Merge "Add CameraInfo to SurfaceRequest and PreviewView retrieves CameraInfo from SurfaceRequest instead." into androidx-master-dev
diff --git a/activity/activity-ktx/api/1.2.0-alpha05.ignore b/activity/activity-ktx/api/1.2.0-alpha05.ignore
new file mode 100644
index 0000000..762b574
--- /dev/null
+++ b/activity/activity-ktx/api/1.2.0-alpha05.ignore
@@ -0,0 +1,7 @@
+// Baseline format: 1.0
+ChangedType: androidx.activity.ActivityViewModelLazyKt#viewModels(androidx.activity.ComponentActivity, kotlin.jvm.functions.Function0<? extends androidx.lifecycle.ViewModelProvider.Factory>):
+ Method androidx.activity.ActivityViewModelLazyKt.viewModels has changed return type from kotlin.Lazy<VM> to kotlin.Lazy<? extends VM>
+
+
+InvalidNullConversion: androidx.activity.ActivityViewModelLazyKt#viewModels(androidx.activity.ComponentActivity, kotlin.jvm.functions.Function0<? extends androidx.lifecycle.ViewModelProvider.Factory>):
+ Attempted to remove @NonNull annotation from method androidx.activity.ActivityViewModelLazyKt.viewModels(androidx.activity.ComponentActivity,kotlin.jvm.functions.Function0<? extends androidx.lifecycle.ViewModelProvider.Factory>)
diff --git a/activity/activity-ktx/api/1.2.0-alpha05.txt b/activity/activity-ktx/api/1.2.0-alpha05.txt
index f28cc78..1c5cbac 100644
--- a/activity/activity-ktx/api/1.2.0-alpha05.txt
+++ b/activity/activity-ktx/api/1.2.0-alpha05.txt
@@ -13,7 +13,7 @@
}
public final class 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);
+ method @MainThread public static inline <reified VM> kotlin.Lazy<? extends VM>! viewModels(androidx.activity.ComponentActivity, kotlin.jvm.functions.Function0<? extends androidx.lifecycle.ViewModelProvider.Factory>? factoryProducer = null);
}
public final class OnBackPressedDispatcherKt {
diff --git a/activity/activity-ktx/api/api_lint.ignore b/activity/activity-ktx/api/api_lint.ignore
index 285b745..85e5f3a 100644
--- a/activity/activity-ktx/api/api_lint.ignore
+++ b/activity/activity-ktx/api/api_lint.ignore
@@ -1,3 +1,7 @@
// Baseline format: 1.0
+MissingNullability: androidx.activity.ActivityViewModelLazyKt#viewModels(androidx.activity.ComponentActivity, kotlin.jvm.functions.Function0<? extends androidx.lifecycle.ViewModelProvider.Factory>):
+ Missing nullability on method `viewModels` return
+
+
RegistrationName: androidx.activity.OnBackPressedDispatcherKt#addCallback(androidx.activity.OnBackPressedDispatcher, androidx.lifecycle.LifecycleOwner, boolean, kotlin.jvm.functions.Function1<? super androidx.activity.OnBackPressedCallback,kotlin.Unit>):
Callback methods should be named register/unregister; was addCallback
diff --git a/activity/activity-ktx/api/current.txt b/activity/activity-ktx/api/current.txt
index f28cc78..1c5cbac 100644
--- a/activity/activity-ktx/api/current.txt
+++ b/activity/activity-ktx/api/current.txt
@@ -13,7 +13,7 @@
}
public final class 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);
+ method @MainThread public static inline <reified VM> kotlin.Lazy<? extends VM>! viewModels(androidx.activity.ComponentActivity, kotlin.jvm.functions.Function0<? extends androidx.lifecycle.ViewModelProvider.Factory>? factoryProducer = null);
}
public final class OnBackPressedDispatcherKt {
diff --git a/activity/activity-ktx/api/public_plus_experimental_1.2.0-alpha05.txt b/activity/activity-ktx/api/public_plus_experimental_1.2.0-alpha05.txt
index f28cc78..1c5cbac 100644
--- a/activity/activity-ktx/api/public_plus_experimental_1.2.0-alpha05.txt
+++ b/activity/activity-ktx/api/public_plus_experimental_1.2.0-alpha05.txt
@@ -13,7 +13,7 @@
}
public final class 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);
+ method @MainThread public static inline <reified VM> kotlin.Lazy<? extends VM>! viewModels(androidx.activity.ComponentActivity, kotlin.jvm.functions.Function0<? extends androidx.lifecycle.ViewModelProvider.Factory>? factoryProducer = null);
}
public final class OnBackPressedDispatcherKt {
diff --git a/activity/activity-ktx/api/public_plus_experimental_current.txt b/activity/activity-ktx/api/public_plus_experimental_current.txt
index f28cc78..1c5cbac 100644
--- a/activity/activity-ktx/api/public_plus_experimental_current.txt
+++ b/activity/activity-ktx/api/public_plus_experimental_current.txt
@@ -13,7 +13,7 @@
}
public final class 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);
+ method @MainThread public static inline <reified VM> kotlin.Lazy<? extends VM>! viewModels(androidx.activity.ComponentActivity, kotlin.jvm.functions.Function0<? extends androidx.lifecycle.ViewModelProvider.Factory>? factoryProducer = null);
}
public final class OnBackPressedDispatcherKt {
diff --git a/activity/activity-ktx/api/restricted_1.2.0-alpha05.ignore b/activity/activity-ktx/api/restricted_1.2.0-alpha05.ignore
new file mode 100644
index 0000000..762b574
--- /dev/null
+++ b/activity/activity-ktx/api/restricted_1.2.0-alpha05.ignore
@@ -0,0 +1,7 @@
+// Baseline format: 1.0
+ChangedType: androidx.activity.ActivityViewModelLazyKt#viewModels(androidx.activity.ComponentActivity, kotlin.jvm.functions.Function0<? extends androidx.lifecycle.ViewModelProvider.Factory>):
+ Method androidx.activity.ActivityViewModelLazyKt.viewModels has changed return type from kotlin.Lazy<VM> to kotlin.Lazy<? extends VM>
+
+
+InvalidNullConversion: androidx.activity.ActivityViewModelLazyKt#viewModels(androidx.activity.ComponentActivity, kotlin.jvm.functions.Function0<? extends androidx.lifecycle.ViewModelProvider.Factory>):
+ Attempted to remove @NonNull annotation from method androidx.activity.ActivityViewModelLazyKt.viewModels(androidx.activity.ComponentActivity,kotlin.jvm.functions.Function0<? extends androidx.lifecycle.ViewModelProvider.Factory>)
diff --git a/activity/activity-ktx/api/restricted_1.2.0-alpha05.txt b/activity/activity-ktx/api/restricted_1.2.0-alpha05.txt
index f28cc78..1c5cbac 100644
--- a/activity/activity-ktx/api/restricted_1.2.0-alpha05.txt
+++ b/activity/activity-ktx/api/restricted_1.2.0-alpha05.txt
@@ -13,7 +13,7 @@
}
public final class 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);
+ method @MainThread public static inline <reified VM> kotlin.Lazy<? extends VM>! viewModels(androidx.activity.ComponentActivity, kotlin.jvm.functions.Function0<? extends androidx.lifecycle.ViewModelProvider.Factory>? factoryProducer = null);
}
public final class OnBackPressedDispatcherKt {
diff --git a/activity/activity-ktx/api/restricted_current.txt b/activity/activity-ktx/api/restricted_current.txt
index f28cc78..1c5cbac 100644
--- a/activity/activity-ktx/api/restricted_current.txt
+++ b/activity/activity-ktx/api/restricted_current.txt
@@ -13,7 +13,7 @@
}
public final class 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);
+ method @MainThread public static inline <reified VM> kotlin.Lazy<? extends VM>! viewModels(androidx.activity.ComponentActivity, kotlin.jvm.functions.Function0<? extends androidx.lifecycle.ViewModelProvider.Factory>? factoryProducer = null);
}
public final class OnBackPressedDispatcherKt {
diff --git a/activity/activity-ktx/build.gradle b/activity/activity-ktx/build.gradle
index ce1eb88..c728b82 100644
--- a/activity/activity-ktx/build.gradle
+++ b/activity/activity-ktx/build.gradle
@@ -38,10 +38,10 @@
api("androidx.core:core-ktx:1.1.0") {
because 'Mirror activity dependency graph for -ktx artifacts'
}
- api("androidx.lifecycle:lifecycle-runtime-ktx:2.3.0-alpha01") {
+ api(project(":lifecycle:lifecycle-runtime-ktx")) {
because 'Mirror activity dependency graph for -ktx artifacts'
}
- api("androidx.lifecycle:lifecycle-viewmodel-ktx:2.3.0-alpha01")
+ api(project(":lifecycle:lifecycle-viewmodel-ktx"))
api(KOTLIN_STDLIB)
androidTestImplementation(project(":lifecycle:lifecycle-runtime-testing"))
diff --git a/activity/activity/build.gradle b/activity/activity/build.gradle
index 6571d19..9005de6 100644
--- a/activity/activity/build.gradle
+++ b/activity/activity/build.gradle
@@ -23,10 +23,10 @@
api("androidx.annotation:annotation:1.1.0")
implementation("androidx.collection:collection:1.0.0")
api("androidx.core:core:1.1.0")
- api("androidx.lifecycle:lifecycle-runtime:2.3.0-alpha01")
- api("androidx.lifecycle:lifecycle-viewmodel:2.3.0-alpha01")
- api("androidx.savedstate:savedstate:1.0.0")
- api("androidx.lifecycle:lifecycle-viewmodel-savedstate:2.3.0-alpha01")
+ api(project(":lifecycle:lifecycle-runtime"))
+ api(project(":lifecycle:lifecycle-viewmodel"))
+ api(project(":savedstate:savedstate"))
+ api(project(":lifecycle:lifecycle-viewmodel-savedstate"))
androidTestImplementation(project(":lifecycle:lifecycle-runtime-testing"))
androidTestImplementation(KOTLIN_STDLIB)
diff --git a/activity/activity/src/androidTest/java/androidx/activity/ComponentActivityViewModelTest.kt b/activity/activity/src/androidTest/java/androidx/activity/ComponentActivityViewModelTest.kt
index e52b140..b79499a 100644
--- a/activity/activity/src/androidTest/java/androidx/activity/ComponentActivityViewModelTest.kt
+++ b/activity/activity/src/androidTest/java/androidx/activity/ComponentActivityViewModelTest.kt
@@ -47,10 +47,18 @@
@Test
fun testSameViewModelStorePrePostOnCreate() {
with(ActivityScenario.launch(ViewModelActivity::class.java)) {
+ val originalStore = withActivity { preOnCreateViewModelStore }
assertWithMessage(
"Pre-onCreate() ViewModelStore should equal the post-onCreate() ViewModelStore")
- .that(withActivity { preOnCreateViewModelStore })
+ .that(originalStore)
.isSameInstanceAs(withActivity { postOnCreateViewModelStore })
+
+ recreate()
+
+ assertThat(withActivity { preOnCreateViewModelStore })
+ .isSameInstanceAs(originalStore)
+ assertThat(withActivity { postOnCreateViewModelStore })
+ .isSameInstanceAs(originalStore)
}
}
diff --git a/activity/activity/src/androidTest/java/androidx/activity/ContentViewTest.kt b/activity/activity/src/androidTest/java/androidx/activity/ContentViewTest.kt
index 356b6da..830c798 100644
--- a/activity/activity/src/androidTest/java/androidx/activity/ContentViewTest.kt
+++ b/activity/activity/src/androidTest/java/androidx/activity/ContentViewTest.kt
@@ -22,6 +22,8 @@
import android.widget.TextView
import androidx.activity.test.R
import androidx.lifecycle.ViewTreeLifecycleOwner
+import androidx.lifecycle.ViewTreeViewModelStoreOwner
+import androidx.savedstate.ViewTreeSavedStateRegistryOwner
import androidx.test.core.app.ActivityScenario
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.LargeTest
@@ -45,7 +47,7 @@
}
@Test
- fun testViewTreeLifecycleOwnerInflation() {
+ fun testViewTreeInflation() {
with(ActivityScenario.launch(ContentViewActivity::class.java)) {
val inflatedTextView: TextView = withActivity { findViewById(R.id.inflated_text_view) }
@@ -53,12 +55,18 @@
assertWithMessage("inflated view has correct ViewTreeLifecycleOwner")
.that(ViewTreeLifecycleOwner.get(inflatedTextView))
.isSameInstanceAs(this@withActivity)
+ assertWithMessage("inflated view has correct ViewTreeViewModelStoreOwner")
+ .that(ViewTreeViewModelStoreOwner.get(inflatedTextView))
+ .isSameInstanceAs(this@withActivity)
+ assertWithMessage("inflated view has correct ViewTreeSavedStateRegistryOwner")
+ .that(ViewTreeSavedStateRegistryOwner.get(inflatedTextView))
+ .isSameInstanceAs(this@withActivity)
}
}
}
@Test
- fun testViewTreeLifecycleAttachment() {
+ fun testViewTreeAttachment() {
runAttachTest("setContentView view only") { setContentView(it) }
runAttachTest("setContentView with LayoutParams") {
setContentView(it, ViewGroup.LayoutParams(WRAP_CONTENT, WRAP_CONTENT))
@@ -76,19 +84,27 @@
withActivity {
val view = View(this)
- var attachedResult: Any? = "did not attach"
+ var attachedLifecycleOwner: Any? = "did not attach"
+ var attachedViewModelStoreOwner: Any? = "did not attach"
+ var attachedSavedStateRegistryOwner: Any? = "did not attach"
view.addOnAttachStateChangeListener(object : View.OnAttachStateChangeListener {
override fun onViewDetachedFromWindow(v: View?) {
// Do nothing
}
override fun onViewAttachedToWindow(v: View?) {
- attachedResult = ViewTreeLifecycleOwner.get(view)
+ attachedLifecycleOwner = ViewTreeLifecycleOwner.get(view)
+ attachedViewModelStoreOwner = ViewTreeViewModelStoreOwner.get(view)
+ attachedSavedStateRegistryOwner = ViewTreeSavedStateRegistryOwner.get(view)
}
})
attach(view)
assertWithMessage("$message: ViewTreeLifecycleOwner was set correctly")
- .that(attachedResult).isSameInstanceAs(this)
+ .that(attachedLifecycleOwner).isSameInstanceAs(this)
+ assertWithMessage("$message: ViewTreeViewModelStoreOwner was set correctly")
+ .that(attachedViewModelStoreOwner).isSameInstanceAs(this)
+ assertWithMessage("$message: ViewTreeSavedStateRegistryOwner was set correctly")
+ .that(attachedSavedStateRegistryOwner).isSameInstanceAs(this)
}
}
}
diff --git a/activity/activity/src/main/java/androidx/activity/ComponentActivity.java b/activity/activity/src/main/java/androidx/activity/ComponentActivity.java
index 58b8ab1..96a1451 100644
--- a/activity/activity/src/main/java/androidx/activity/ComponentActivity.java
+++ b/activity/activity/src/main/java/androidx/activity/ComponentActivity.java
@@ -67,9 +67,11 @@
import androidx.lifecycle.ViewModelStore;
import androidx.lifecycle.ViewModelStoreOwner;
import androidx.lifecycle.ViewTreeLifecycleOwner;
+import androidx.lifecycle.ViewTreeViewModelStoreOwner;
import androidx.savedstate.SavedStateRegistry;
import androidx.savedstate.SavedStateRegistryController;
import androidx.savedstate.SavedStateRegistryOwner;
+import androidx.savedstate.ViewTreeSavedStateRegistryOwner;
import java.util.ArrayList;
import java.util.List;
@@ -351,17 +353,13 @@
@Override
public void setContentView(@LayoutRes int layoutResID) {
- // Set the VTLO before setting the content view so that the inflation process
- // and attach listeners will see it already present
- ViewTreeLifecycleOwner.set(getWindow().getDecorView(), this);
+ initViewTreeOwners();
super.setContentView(layoutResID);
}
@Override
public void setContentView(@SuppressLint({"UnknownNullness", "MissingNullability"}) View view) {
- // Set the VTLO before setting the content view so that attach listeners
- // will see it already present
- ViewTreeLifecycleOwner.set(getWindow().getDecorView(), this);
+ initViewTreeOwners();
super.setContentView(view);
}
@@ -369,9 +367,7 @@
public void setContentView(@SuppressLint({"UnknownNullness", "MissingNullability"}) View view,
@SuppressLint({"UnknownNullness", "MissingNullability"})
ViewGroup.LayoutParams params) {
- // Set the VTLO before setting the content view so that attach listeners
- // will see it already present
- ViewTreeLifecycleOwner.set(getWindow().getDecorView(), this);
+ initViewTreeOwners();
super.setContentView(view, params);
}
@@ -379,12 +375,18 @@
public void addContentView(@SuppressLint({"UnknownNullness", "MissingNullability"}) View view,
@SuppressLint({"UnknownNullness", "MissingNullability"})
ViewGroup.LayoutParams params) {
- // Set the VTLO before setting the content view so that attach listeners
- // will see it already present.
- ViewTreeLifecycleOwner.set(getWindow().getDecorView(), this);
+ initViewTreeOwners();
super.addContentView(view, params);
}
+ private void initViewTreeOwners() {
+ // Set the view tree owners before setting the content view so that the inflation process
+ // and attach listeners will see them already present
+ ViewTreeLifecycleOwner.set(getWindow().getDecorView(), this);
+ ViewTreeViewModelStoreOwner.set(getWindow().getDecorView(), this);
+ ViewTreeSavedStateRegistryOwner.set(getWindow().getDecorView(), this);
+ }
+
/**
* {@inheritDoc}
* <p>
diff --git a/activity/activity/src/main/java/androidx/activity/result/contract/ActivityResultContracts.java b/activity/activity/src/main/java/androidx/activity/result/contract/ActivityResultContracts.java
index eed853e..870a0e2 100644
--- a/activity/activity/src/main/java/androidx/activity/result/contract/ActivityResultContracts.java
+++ b/activity/activity/src/main/java/androidx/activity/result/contract/ActivityResultContracts.java
@@ -295,7 +295,7 @@
* {@link MediaStore#ACTION_IMAGE_CAPTURE take a picture} saving it into the provided
* content-{@link Uri}.
* <p>
- * Returns a thumbnail.
+ * May return a thumbnail of the photo in the result Intent if the camera provides one.
* <p>
* This can be extended to override {@link #createIntent} if you wish to pass additional
* extras to the Intent created by {@code super.createIntent()}.
diff --git a/annotation/annotation-experimental/api/1.1.0-alpha01.ignore b/annotation/annotation-experimental/api/1.1.0-alpha01.ignore
index c6f8d57..4413cc6 100644
--- a/annotation/annotation-experimental/api/1.1.0-alpha01.ignore
+++ b/annotation/annotation-experimental/api/1.1.0-alpha01.ignore
@@ -1,3 +1,3 @@
// Baseline format: 1.0
ChangedType: androidx.annotation.experimental.UseExperimental#markerClass():
- Method androidx.annotation.experimental.UseExperimental.markerClass has changed return type from Class<?> to error.NonExistentClass[]
+ Method androidx.annotation.experimental.UseExperimental.markerClass has changed return type from Class<?> to Class<? extends java.lang.annotation.Annotation>[]
diff --git a/annotation/annotation-experimental/api/restricted_1.1.0-alpha01.ignore b/annotation/annotation-experimental/api/restricted_1.1.0-alpha01.ignore
index c6f8d57..4413cc6 100644
--- a/annotation/annotation-experimental/api/restricted_1.1.0-alpha01.ignore
+++ b/annotation/annotation-experimental/api/restricted_1.1.0-alpha01.ignore
@@ -1,3 +1,3 @@
// Baseline format: 1.0
ChangedType: androidx.annotation.experimental.UseExperimental#markerClass():
- Method androidx.annotation.experimental.UseExperimental.markerClass has changed return type from Class<?> to error.NonExistentClass[]
+ Method androidx.annotation.experimental.UseExperimental.markerClass has changed return type from Class<?> to Class<? extends java.lang.annotation.Annotation>[]
diff --git a/appcompat/appcompat-resources/api/1.2.0-rc01.txt b/appcompat/appcompat-resources/api/1.2.0-rc01.txt
new file mode 100644
index 0000000..7de85f8
--- /dev/null
+++ b/appcompat/appcompat-resources/api/1.2.0-rc01.txt
@@ -0,0 +1,35 @@
+// 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 {
+ 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/appcompat-resources/api/1.3.0-alpha01.txt b/appcompat/appcompat-resources/api/1.3.0-alpha01.txt
new file mode 100644
index 0000000..7de85f8
--- /dev/null
+++ b/appcompat/appcompat-resources/api/1.3.0-alpha01.txt
@@ -0,0 +1,35 @@
+// 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 {
+ 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/appcompat-resources/api/public_plus_experimental_1.2.0-rc01.txt b/appcompat/appcompat-resources/api/public_plus_experimental_1.2.0-rc01.txt
new file mode 100644
index 0000000..990b059
--- /dev/null
+++ b/appcompat/appcompat-resources/api/public_plus_experimental_1.2.0-rc01.txt
@@ -0,0 +1,35 @@
+// 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/appcompat-resources/api/public_plus_experimental_1.3.0-alpha01.txt b/appcompat/appcompat-resources/api/public_plus_experimental_1.3.0-alpha01.txt
new file mode 100644
index 0000000..990b059
--- /dev/null
+++ b/appcompat/appcompat-resources/api/public_plus_experimental_1.3.0-alpha01.txt
@@ -0,0 +1,35 @@
+// 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/transition/transition-ktx/api/res-2.0.0-alpha01.txt b/appcompat/appcompat-resources/api/res-1.2.0-rc01.txt
similarity index 100%
copy from transition/transition-ktx/api/res-2.0.0-alpha01.txt
copy to appcompat/appcompat-resources/api/res-1.2.0-rc01.txt
diff --git a/transition/transition-ktx/api/res-2.0.0-alpha01.txt b/appcompat/appcompat-resources/api/res-1.3.0-alpha01.txt
similarity index 100%
rename from transition/transition-ktx/api/res-2.0.0-alpha01.txt
rename to appcompat/appcompat-resources/api/res-1.3.0-alpha01.txt
diff --git a/appcompat/appcompat-resources/api/restricted_1.2.0-rc01.txt b/appcompat/appcompat-resources/api/restricted_1.2.0-rc01.txt
new file mode 100644
index 0000000..1f32e40
--- /dev/null
+++ b/appcompat/appcompat-resources/api/restricted_1.2.0-rc01.txt
@@ -0,0 +1,90 @@
+// 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);
+ }
+
+ @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class DrawableWrapper extends android.graphics.drawable.Drawable implements android.graphics.drawable.Drawable.Callback {
+ ctor public DrawableWrapper(android.graphics.drawable.Drawable!);
+ method public void draw(android.graphics.Canvas!);
+ method public int getOpacity();
+ method public android.graphics.drawable.Drawable! getWrappedDrawable();
+ 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 setWrappedDrawable(android.graphics.drawable.Drawable!);
+ method public void unscheduleDrawable(android.graphics.drawable.Drawable!, Runnable!);
+ }
+
+}
+
+package androidx.appcompat.widget {
+
+ @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) 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_PREFIX) public final class ResourceManagerInternal {
+ ctor public ResourceManagerInternal();
+ method public static androidx.appcompat.widget.ResourceManagerInternal! 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);
+ method public void setHooks(androidx.appcompat.widget.ResourceManagerInternal.ResourceManagerHooks!);
+ }
+
+ @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class TintContextWrapper extends android.content.ContextWrapper {
+ method public static android.content.Context! wrap(android.content.Context);
+ }
+
+ @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class TintInfo {
+ ctor public TintInfo();
+ field public boolean mHasTintList;
+ field public boolean mHasTintMode;
+ field public android.content.res.ColorStateList! mTintList;
+ field public android.graphics.PorterDuff.Mode! mTintMode;
+ }
+
+ @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class VectorEnabledTintResources extends android.content.res.Resources {
+ ctor public VectorEnabledTintResources(android.content.Context, android.content.res.Resources);
+ method public android.graphics.drawable.Drawable! getDrawable(int) throws android.content.res.Resources.NotFoundException;
+ 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
+ }
+
+}
+
diff --git a/appcompat/appcompat-resources/api/restricted_1.3.0-alpha01.txt b/appcompat/appcompat-resources/api/restricted_1.3.0-alpha01.txt
new file mode 100644
index 0000000..1f32e40
--- /dev/null
+++ b/appcompat/appcompat-resources/api/restricted_1.3.0-alpha01.txt
@@ -0,0 +1,90 @@
+// 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);
+ }
+
+ @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class DrawableWrapper extends android.graphics.drawable.Drawable implements android.graphics.drawable.Drawable.Callback {
+ ctor public DrawableWrapper(android.graphics.drawable.Drawable!);
+ method public void draw(android.graphics.Canvas!);
+ method public int getOpacity();
+ method public android.graphics.drawable.Drawable! getWrappedDrawable();
+ 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 setWrappedDrawable(android.graphics.drawable.Drawable!);
+ method public void unscheduleDrawable(android.graphics.drawable.Drawable!, Runnable!);
+ }
+
+}
+
+package androidx.appcompat.widget {
+
+ @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) 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_PREFIX) public final class ResourceManagerInternal {
+ ctor public ResourceManagerInternal();
+ method public static androidx.appcompat.widget.ResourceManagerInternal! 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);
+ method public void setHooks(androidx.appcompat.widget.ResourceManagerInternal.ResourceManagerHooks!);
+ }
+
+ @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class TintContextWrapper extends android.content.ContextWrapper {
+ method public static android.content.Context! wrap(android.content.Context);
+ }
+
+ @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class TintInfo {
+ ctor public TintInfo();
+ field public boolean mHasTintList;
+ field public boolean mHasTintMode;
+ field public android.content.res.ColorStateList! mTintList;
+ field public android.graphics.PorterDuff.Mode! mTintMode;
+ }
+
+ @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class VectorEnabledTintResources extends android.content.res.Resources {
+ ctor public VectorEnabledTintResources(android.content.Context, android.content.res.Resources);
+ method public android.graphics.drawable.Drawable! getDrawable(int) throws android.content.res.Resources.NotFoundException;
+ 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
+ }
+
+}
+
diff --git a/appcompat/appcompat/api/1.2.0-rc01.txt b/appcompat/appcompat/api/1.2.0-rc01.txt
new file mode 100644
index 0000000..aed2d02
--- /dev/null
+++ b/appcompat/appcompat/api/1.2.0-rc01.txt
@@ -0,0 +1,979 @@
+// 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.lifecycle.LifecycleOwner androidx.core.app.TaskStackBuilder.SupportParentable {
+ ctor public AppCompatActivity();
+ ctor @ContentView public AppCompatActivity(@LayoutRes int);
+ 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 @Deprecated public void attachBaseContext(android.content.Context!);
+ method @CallSuper public android.content.Context attachBaseContext2(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.content.Context, android.app.Activity, 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 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 @RequiresApi(17) public abstract void setLocalNightMode(int);
+ method public abstract void setSupportActionBar(androidx.appcompat.widget.Toolbar?);
+ method public void setTheme(@StyleRes int);
+ 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!);
+ }
+
+ @Deprecated public interface CollapsibleActionView {
+ method @Deprecated public void onActionViewCollapsed();
+ method @Deprecated 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.view.TintableBackgroundView androidx.core.widget.TintableCompoundDrawablesView {
+ 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 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_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 @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);
+ }
+
+ 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 {
+ 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 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 AppCompatImageView extends android.widget.ImageView implements androidx.core.view.TintableBackgroundView {
+ 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 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 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.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/appcompat/api/1.3.0-alpha01.txt b/appcompat/appcompat/api/1.3.0-alpha01.txt
new file mode 100644
index 0000000..aed2d02
--- /dev/null
+++ b/appcompat/appcompat/api/1.3.0-alpha01.txt
@@ -0,0 +1,979 @@
+// 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.lifecycle.LifecycleOwner androidx.core.app.TaskStackBuilder.SupportParentable {
+ ctor public AppCompatActivity();
+ ctor @ContentView public AppCompatActivity(@LayoutRes int);
+ 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 @Deprecated public void attachBaseContext(android.content.Context!);
+ method @CallSuper public android.content.Context attachBaseContext2(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.content.Context, android.app.Activity, 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 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 @RequiresApi(17) public abstract void setLocalNightMode(int);
+ method public abstract void setSupportActionBar(androidx.appcompat.widget.Toolbar?);
+ method public void setTheme(@StyleRes int);
+ 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!);
+ }
+
+ @Deprecated public interface CollapsibleActionView {
+ method @Deprecated public void onActionViewCollapsed();
+ method @Deprecated 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.view.TintableBackgroundView androidx.core.widget.TintableCompoundDrawablesView {
+ 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 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_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 @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);
+ }
+
+ 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 {
+ 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 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 AppCompatImageView extends android.widget.ImageView implements androidx.core.view.TintableBackgroundView {
+ 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 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 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.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/appcompat/api/public_plus_experimental_1.2.0-rc01.txt b/appcompat/appcompat/api/public_plus_experimental_1.2.0-rc01.txt
new file mode 100644
index 0000000..6f176e4
--- /dev/null
+++ b/appcompat/appcompat/api/public_plus_experimental_1.2.0-rc01.txt
@@ -0,0 +1,987 @@
+// 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();
+ ctor @ContentView public AppCompatActivity(@LayoutRes int);
+ 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 @Deprecated public void attachBaseContext(android.content.Context!);
+ method @CallSuper public android.content.Context attachBaseContext2(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.content.Context, android.app.Activity, 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 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 @RequiresApi(17) public abstract void setLocalNightMode(int);
+ method public abstract void setSupportActionBar(androidx.appcompat.widget.Toolbar?);
+ method public void setTheme(@StyleRes int);
+ 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!);
+ }
+
+ @Deprecated public interface CollapsibleActionView {
+ method @Deprecated public void onActionViewCollapsed();
+ method @Deprecated 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 androidx.core.widget.TintableCompoundDrawablesView {
+ 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 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_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 @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);
+ }
+
+ 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/appcompat/api/public_plus_experimental_1.3.0-alpha01.txt b/appcompat/appcompat/api/public_plus_experimental_1.3.0-alpha01.txt
new file mode 100644
index 0000000..6f176e4
--- /dev/null
+++ b/appcompat/appcompat/api/public_plus_experimental_1.3.0-alpha01.txt
@@ -0,0 +1,987 @@
+// 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();
+ ctor @ContentView public AppCompatActivity(@LayoutRes int);
+ 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 @Deprecated public void attachBaseContext(android.content.Context!);
+ method @CallSuper public android.content.Context attachBaseContext2(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.content.Context, android.app.Activity, 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 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 @RequiresApi(17) public abstract void setLocalNightMode(int);
+ method public abstract void setSupportActionBar(androidx.appcompat.widget.Toolbar?);
+ method public void setTheme(@StyleRes int);
+ 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!);
+ }
+
+ @Deprecated public interface CollapsibleActionView {
+ method @Deprecated public void onActionViewCollapsed();
+ method @Deprecated 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 androidx.core.widget.TintableCompoundDrawablesView {
+ 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 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_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 @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);
+ }
+
+ 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/appcompat/api/res-1.2.0-rc01.txt b/appcompat/appcompat/api/res-1.2.0-rc01.txt
new file mode 100644
index 0000000..cb8c1e3
--- /dev/null
+++ b/appcompat/appcompat/api/res-1.2.0-rc01.txt
@@ -0,0 +1,366 @@
+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
+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
+layout support_simple_spinner_dropdown_item
+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 ThemeOverlay_AppCompat
+style ThemeOverlay_AppCompat_ActionBar
+style ThemeOverlay_AppCompat_Dark
+style ThemeOverlay_AppCompat_Dark_ActionBar
+style ThemeOverlay_AppCompat_DayNight
+style ThemeOverlay_AppCompat_DayNight_ActionBar
+style ThemeOverlay_AppCompat_Dialog
+style ThemeOverlay_AppCompat_Dialog_Alert
+style ThemeOverlay_AppCompat_Light
+style Theme_AppCompat
+style Theme_AppCompat_DayNight
+style Theme_AppCompat_DayNight_DarkActionBar
+style Theme_AppCompat_DayNight_Dialog
+style Theme_AppCompat_DayNight_DialogWhenLarge
+style Theme_AppCompat_DayNight_Dialog_Alert
+style Theme_AppCompat_DayNight_Dialog_MinWidth
+style Theme_AppCompat_DayNight_NoActionBar
+style Theme_AppCompat_Dialog
+style Theme_AppCompat_DialogWhenLarge
+style Theme_AppCompat_Dialog_Alert
+style Theme_AppCompat_Dialog_MinWidth
+style Theme_AppCompat_Light
+style Theme_AppCompat_Light_DarkActionBar
+style Theme_AppCompat_Light_Dialog
+style Theme_AppCompat_Light_DialogWhenLarge
+style Theme_AppCompat_Light_Dialog_Alert
+style Theme_AppCompat_Light_Dialog_MinWidth
+style Theme_AppCompat_Light_NoActionBar
+style Theme_AppCompat_NoActionBar
+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_ButtonBar
+style Widget_AppCompat_ButtonBar_AlertDialog
+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_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
diff --git a/appcompat/appcompat/api/res-1.3.0-alpha01.txt b/appcompat/appcompat/api/res-1.3.0-alpha01.txt
new file mode 100644
index 0000000..cb8c1e3
--- /dev/null
+++ b/appcompat/appcompat/api/res-1.3.0-alpha01.txt
@@ -0,0 +1,366 @@
+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
+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
+layout support_simple_spinner_dropdown_item
+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 ThemeOverlay_AppCompat
+style ThemeOverlay_AppCompat_ActionBar
+style ThemeOverlay_AppCompat_Dark
+style ThemeOverlay_AppCompat_Dark_ActionBar
+style ThemeOverlay_AppCompat_DayNight
+style ThemeOverlay_AppCompat_DayNight_ActionBar
+style ThemeOverlay_AppCompat_Dialog
+style ThemeOverlay_AppCompat_Dialog_Alert
+style ThemeOverlay_AppCompat_Light
+style Theme_AppCompat
+style Theme_AppCompat_DayNight
+style Theme_AppCompat_DayNight_DarkActionBar
+style Theme_AppCompat_DayNight_Dialog
+style Theme_AppCompat_DayNight_DialogWhenLarge
+style Theme_AppCompat_DayNight_Dialog_Alert
+style Theme_AppCompat_DayNight_Dialog_MinWidth
+style Theme_AppCompat_DayNight_NoActionBar
+style Theme_AppCompat_Dialog
+style Theme_AppCompat_DialogWhenLarge
+style Theme_AppCompat_Dialog_Alert
+style Theme_AppCompat_Dialog_MinWidth
+style Theme_AppCompat_Light
+style Theme_AppCompat_Light_DarkActionBar
+style Theme_AppCompat_Light_Dialog
+style Theme_AppCompat_Light_DialogWhenLarge
+style Theme_AppCompat_Light_Dialog_Alert
+style Theme_AppCompat_Light_Dialog_MinWidth
+style Theme_AppCompat_Light_NoActionBar
+style Theme_AppCompat_NoActionBar
+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_ButtonBar
+style Widget_AppCompat_ButtonBar_AlertDialog
+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_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
diff --git a/appcompat/appcompat/api/restricted_1.2.0-rc01.txt b/appcompat/appcompat/api/restricted_1.2.0-rc01.txt
new file mode 100644
index 0000000..10b05b7
--- /dev/null
+++ b/appcompat/appcompat/api/restricted_1.2.0-rc01.txt
@@ -0,0 +1,2204 @@
+// 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 @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public boolean closeOptionsMenu();
+ method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public boolean collapseActionView();
+ method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void dispatchMenuVisibilityChanged(boolean);
+ method public abstract android.view.View! getCustomView();
+ method @androidx.appcompat.app.ActionBar.DisplayOptions 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 @androidx.appcompat.app.ActionBar.NavigationMode 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 @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public boolean invalidateOptionsMenu();
+ method public boolean isHideOnContentScrollEnabled();
+ method public abstract boolean isShowing();
+ method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public boolean isTitleTruncated();
+ method @Deprecated public abstract androidx.appcompat.app.ActionBar.Tab! newTab();
+ method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void onConfigurationChanged(android.content.res.Configuration!);
+ method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public boolean onKeyShortcut(int, android.view.KeyEvent!);
+ method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public boolean onMenuKeyEvent(android.view.KeyEvent!);
+ method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public boolean openOptionsMenu();
+ 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 @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void setDefaultDisplayHomeAsUpEnabled(boolean);
+ method public abstract void setDisplayHomeAsUpEnabled(boolean);
+ method public abstract void setDisplayOptions(@androidx.appcompat.app.ActionBar.DisplayOptions int);
+ method public abstract void setDisplayOptions(@androidx.appcompat.app.ActionBar.DisplayOptions int, @androidx.appcompat.app.ActionBar.DisplayOptions 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(@androidx.appcompat.app.ActionBar.NavigationMode int);
+ method @Deprecated public abstract void setSelectedNavigationItem(int);
+ method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void setShowHideAnimationEnabled(boolean);
+ 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 @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void setWindowTitle(CharSequence!);
+ method public abstract void show();
+ method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public androidx.appcompat.view.ActionMode! startActionMode(androidx.appcompat.view.ActionMode.Callback!);
+ 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
+ }
+
+ @IntDef(flag=true, value={androidx.appcompat.app.ActionBar.DISPLAY_USE_LOGO, androidx.appcompat.app.ActionBar.DISPLAY_SHOW_HOME, androidx.appcompat.app.ActionBar.DISPLAY_HOME_AS_UP, androidx.appcompat.app.ActionBar.DISPLAY_SHOW_TITLE, androidx.appcompat.app.ActionBar.DISPLAY_SHOW_CUSTOM}) @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) public static @interface ActionBar.DisplayOptions {
+ }
+
+ 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;
+ }
+
+ @IntDef({androidx.appcompat.app.ActionBar.NAVIGATION_MODE_STANDARD, androidx.appcompat.app.ActionBar.NAVIGATION_MODE_LIST, androidx.appcompat.app.ActionBar.NAVIGATION_MODE_TABS}) @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) public static @interface ActionBar.NavigationMode {
+ }
+
+ 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 @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public androidx.appcompat.app.AlertDialog.Builder! setRecycleOnMeasureEnabled(boolean);
+ 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 @Deprecated @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public androidx.appcompat.app.AlertDialog.Builder! setView(android.view.View!, int, int, int, int);
+ 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();
+ ctor @ContentView public AppCompatActivity(@LayoutRes int);
+ 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(@androidx.appcompat.app.AppCompatDelegate.NightMode 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 @Deprecated public void attachBaseContext(android.content.Context!);
+ method @CallSuper public android.content.Context attachBaseContext2(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.content.Context, android.app.Activity, 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 @androidx.appcompat.app.AppCompatDelegate.NightMode public static int getDefaultNightMode();
+ method public abstract androidx.appcompat.app.ActionBarDrawerToggle.Delegate? getDrawerToggleDelegate();
+ method @androidx.appcompat.app.AppCompatDelegate.NightMode 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 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(@androidx.appcompat.app.AppCompatDelegate.NightMode int);
+ method public abstract void setHandleNativeActionModesEnabled(boolean);
+ method @RequiresApi(17) public abstract void setLocalNightMode(@androidx.appcompat.app.AppCompatDelegate.NightMode int);
+ method public abstract void setSupportActionBar(androidx.appcompat.widget.Toolbar?);
+ method public void setTheme(@StyleRes int);
+ 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
+ }
+
+ @IntDef({androidx.appcompat.app.AppCompatDelegate.MODE_NIGHT_NO, androidx.appcompat.app.AppCompatDelegate.MODE_NIGHT_YES, androidx.appcompat.app.AppCompatDelegate.MODE_NIGHT_AUTO_TIME, androidx.appcompat.app.AppCompatDelegate.MODE_NIGHT_FOLLOW_SYSTEM, androidx.appcompat.app.AppCompatDelegate.MODE_NIGHT_UNSPECIFIED, androidx.appcompat.app.AppCompatDelegate.MODE_NIGHT_AUTO_BATTERY}) @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) public static @interface AppCompatDelegate.NightMode {
+ }
+
+ 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!);
+ }
+
+ @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) 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_PREFIX) 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_PREFIX) 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_PREFIX) 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 {
+
+ 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 @androidx.appcompat.graphics.drawable.DrawerArrowDrawable.ArrowDirection 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(@androidx.appcompat.graphics.drawable.DrawerArrowDrawable.ArrowDirection 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
+ }
+
+ @IntDef({androidx.appcompat.graphics.drawable.DrawerArrowDrawable.ARROW_DIRECTION_LEFT, androidx.appcompat.graphics.drawable.DrawerArrowDrawable.ARROW_DIRECTION_RIGHT, androidx.appcompat.graphics.drawable.DrawerArrowDrawable.ARROW_DIRECTION_START, androidx.appcompat.graphics.drawable.DrawerArrowDrawable.ARROW_DIRECTION_END}) @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) public static @interface DrawerArrowDrawable.ArrowDirection {
+ }
+
+}
+
+package androidx.appcompat.text {
+
+ @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class AllCapsTransformationMethod implements android.text.method.TransformationMethod {
+ 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_PREFIX) 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 {
+ 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 @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public boolean isUiFocusable();
+ 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!);
+ }
+
+ @Deprecated public interface CollapsibleActionView {
+ method @Deprecated public void onActionViewCollapsed();
+ method @Deprecated 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);
+ }
+
+ @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) 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_PREFIX) public class SupportActionModeWrapper extends android.view.ActionMode {
+ 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 CharSequence! getTitle();
+ method public void invalidate();
+ 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_PREFIX) 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_PREFIX) public class SupportMenuInflater extends android.view.MenuInflater {
+ ctor public SupportMenuInflater(android.content.Context!);
+ }
+
+ @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) 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_PREFIX) public class WindowCallbackWrapper implements android.view.Window.Callback {
+ 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 final android.view.Window.Callback! getWrapped();
+ 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 public boolean onPreparePanel(int, android.view.View!, android.view.Menu!);
+ 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_PREFIX) public class ActionMenuItem implements androidx.core.internal.view.SupportMenuItem {
+ 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 char getAlphabeticShortcut();
+ method public int getGroupId();
+ method public android.graphics.drawable.Drawable! getIcon();
+ method public android.content.Intent! getIntent();
+ method public int getItemId();
+ method public android.view.ContextMenu.ContextMenuInfo! getMenuInfo();
+ 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 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 boolean requiresActionButton();
+ method public boolean requiresOverflow();
+ 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! 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! setIntent(android.content.Intent!);
+ method public android.view.MenuItem! setNumericShortcut(char);
+ 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 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_PREFIX) public class ActionMenuItemView extends androidx.appcompat.widget.AppCompatTextView implements androidx.appcompat.widget.ActionMenuView.ActionMenuChildView androidx.appcompat.view.menu.MenuView.ItemView android.view.View.OnClickListener {
+ 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 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 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_PREFIX) 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_PREFIX) public final class ExpandedMenuView extends android.widget.ListView implements android.widget.AdapterView.OnItemClickListener 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 public void onItemClick(android.widget.AdapterView!, android.view.View!, int, long);
+ }
+
+ @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class ListMenuItemView extends android.widget.LinearLayout implements android.widget.AbsListView.SelectionBoundsAdjuster 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 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_PREFIX) public class ListMenuPresenter implements android.widget.AdapterView.OnItemClickListener 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_PREFIX) public class MenuAdapter extends android.widget.BaseAdapter {
+ 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 setForceShowIcon(boolean);
+ }
+
+ @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class MenuBuilder implements androidx.core.internal.view.SupportMenu {
+ 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 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_PREFIX) 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_PREFIX) public static interface MenuBuilder.ItemInvoker {
+ method public boolean invokeItem(androidx.appcompat.view.menu.MenuItemImpl!);
+ }
+
+ @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public final class MenuItemImpl implements androidx.core.internal.view.SupportMenuItem {
+ 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 char getAlphabeticShortcut();
+ method public int getGroupId();
+ method public android.graphics.drawable.Drawable! getIcon();
+ method public android.content.Intent! getIntent();
+ method @android.view.ViewDebug.CapturedViewProperty public int getItemId();
+ method public android.view.ContextMenu.ContextMenuInfo! getMenuInfo();
+ 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 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 boolean requiresOverflow();
+ 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! 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! setIntent(android.content.Intent!);
+ method public void setIsActionButton(boolean);
+ method public android.view.MenuItem! setNumericShortcut(char);
+ 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 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();
+ }
+
+ @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class MenuItemWrapperICS implements android.view.MenuItem {
+ ctor public MenuItemWrapperICS(android.content.Context!, androidx.core.internal.view.SupportMenuItem!);
+ method public boolean collapseActionView();
+ method public boolean expandActionView();
+ method public android.view.ActionProvider! getActionProvider();
+ method public android.view.View! getActionView();
+ method public char getAlphabeticShortcut();
+ method public int getGroupId();
+ method public android.graphics.drawable.Drawable! getIcon();
+ method public android.content.Intent! getIntent();
+ method public int getItemId();
+ method public android.view.ContextMenu.ContextMenuInfo! getMenuInfo();
+ method public char getNumericShortcut();
+ method public int getOrder();
+ method public android.view.SubMenu! getSubMenu();
+ method public CharSequence! getTitle();
+ method public CharSequence! getTitleCondensed();
+ 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! setCheckable(boolean);
+ method public android.view.MenuItem! setChecked(boolean);
+ 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! setIntent(android.content.Intent!);
+ method public android.view.MenuItem! setNumericShortcut(char);
+ 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 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! setVisible(boolean);
+ }
+
+ @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) 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_PREFIX) 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_PREFIX) 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_PREFIX) public class MenuWrapperICS implements android.view.Menu {
+ ctor public MenuWrapperICS(android.content.Context!, androidx.core.internal.view.SupportMenu!);
+ 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 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 clear();
+ method public void close();
+ method public android.view.MenuItem! findItem(int);
+ method public android.view.MenuItem! getItem(int);
+ method public boolean hasVisibleItems();
+ method public boolean isShortcutKey(int, android.view.KeyEvent!);
+ method public boolean performIdentifierAction(int, int);
+ method public boolean performShortcut(int, android.view.KeyEvent!, int);
+ method public void removeGroup(int);
+ method public void removeItem(int);
+ method public void setGroupCheckable(int, boolean, boolean);
+ method public void setGroupEnabled(int, boolean);
+ method public void setGroupVisible(int, boolean);
+ method public void setQwertyMode(boolean);
+ method public int size();
+ }
+
+ @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) 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_PREFIX) public class SubMenuBuilder extends androidx.appcompat.view.menu.MenuBuilder implements android.view.SubMenu {
+ 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_PREFIX) public class ActionBarContainer extends android.widget.FrameLayout {
+ ctor public ActionBarContainer(android.content.Context!);
+ ctor public ActionBarContainer(android.content.Context!, android.util.AttributeSet!);
+ method public android.view.View! getTabContainer();
+ method public void onFinishInflate();
+ method public void onLayout(boolean, int, int, int, int);
+ method public void onMeasure(int, int);
+ 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);
+ }
+
+ @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class ActionBarContextView extends android.view.ViewGroup {
+ 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 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 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 androidx.core.view.ViewPropertyAnimatorCompat! setupAnimatorToVisibility(int, long);
+ method public boolean showOverflowMenu();
+ }
+
+ @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class ActionBarOverlayLayout extends android.view.ViewGroup implements androidx.appcompat.widget.DecorContentParent androidx.core.view.NestedScrollingParent androidx.core.view.NestedScrollingParent2 androidx.core.view.NestedScrollingParent3 {
+ ctor public ActionBarOverlayLayout(android.content.Context);
+ ctor public ActionBarOverlayLayout(android.content.Context, android.util.AttributeSet?);
+ method public boolean canShowOverflowMenu();
+ method public void dismissPopups();
+ 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 public int getActionBarHideOffset();
+ 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 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 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 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 extends android.view.ViewGroup.MarginLayoutParams {
+ 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 {
+ 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 @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public androidx.appcompat.widget.ActionMenuView.LayoutParams! generateOverflowButtonLayoutParams();
+ method public android.view.Menu! getMenu();
+ method public android.graphics.drawable.Drawable? getOverflowIcon();
+ method public int getPopupTheme();
+ method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public int getWindowAnimations();
+ method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) protected boolean hasSupportDividerBeforeChildAt(int);
+ method public boolean hideOverflowMenu();
+ method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void initialize(androidx.appcompat.view.menu.MenuBuilder!);
+ method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public boolean invokeItem(androidx.appcompat.view.menu.MenuItemImpl!);
+ method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public boolean isOverflowMenuShowPending();
+ method public boolean isOverflowMenuShowing();
+ method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public boolean isOverflowReserved();
+ method public void onConfigurationChanged(android.content.res.Configuration!);
+ method public void onDetachedFromWindow();
+ method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public androidx.appcompat.view.menu.MenuBuilder! peekMenu();
+ method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void setExpandedActionViewsExclusive(boolean);
+ method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void setMenuCallbacks(androidx.appcompat.view.menu.MenuPresenter.Callback!, androidx.appcompat.view.menu.MenuBuilder.Callback!);
+ method public void setOnMenuItemClickListener(androidx.appcompat.widget.ActionMenuView.OnMenuItemClickListener!);
+ method public void setOverflowIcon(android.graphics.drawable.Drawable?);
+ method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void setOverflowReserved(boolean);
+ method public void setPopupTheme(@StyleRes int);
+ method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void setPresenter(androidx.appcompat.widget.ActionMenuPresenter!);
+ method public boolean showOverflowMenu();
+ }
+
+ @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public static interface ActionMenuView.ActionMenuChildView {
+ method public boolean needsDividerAfter();
+ method public boolean needsDividerBefore();
+ }
+
+ 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!);
+ }
+
+ @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class ActivityChooserView extends android.view.ViewGroup {
+ 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 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_PREFIX) public void setProvider(androidx.core.view.ActionProvider!);
+ method public boolean showPopup();
+ }
+
+ @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public static class ActivityChooserView.InnerLayout extends android.widget.LinearLayout {
+ ctor public ActivityChooserView.InnerLayout(android.content.Context!, android.util.AttributeSet!);
+ }
+
+ @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) 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 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 androidx.core.widget.TintableCompoundDrawablesView {
+ 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 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_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 @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);
+ }
+
+ 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);
+ }
+
+ @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) 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);
+ method public static void preload();
+ }
+
+ 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?);
+ }
+
+ @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) 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 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);
+ }
+
+ @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class ButtonBarLayout extends android.widget.LinearLayout {
+ ctor public ButtonBarLayout(android.content.Context, android.util.AttributeSet?);
+ method public void setAllowStacking(boolean);
+ }
+
+ @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) 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_PREFIX) 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_PREFIX) public class DialogTitle extends androidx.appcompat.widget.AppCompatTextView {
+ 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);
+ }
+
+ @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class FitWindowsFrameLayout extends android.widget.FrameLayout 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_PREFIX) public class FitWindowsLinearLayout extends android.widget.LinearLayout 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_PREFIX) 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_PREFIX) public abstract class ForwardingListener implements android.view.View.OnAttachStateChangeListener android.view.View.OnTouchListener {
+ 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 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 @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public int getDividerWidth();
+ method public int getGravity();
+ method @androidx.appcompat.widget.LinearLayoutCompat.OrientationMode public int getOrientation();
+ method @androidx.appcompat.widget.LinearLayoutCompat.DividerMode 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(@androidx.appcompat.widget.LinearLayoutCompat.OrientationMode int);
+ method public void setShowDividers(@androidx.appcompat.widget.LinearLayoutCompat.DividerMode 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
+ }
+
+ @IntDef(flag=true, value={androidx.appcompat.widget.LinearLayoutCompat.SHOW_DIVIDER_NONE, androidx.appcompat.widget.LinearLayoutCompat.SHOW_DIVIDER_BEGINNING, androidx.appcompat.widget.LinearLayoutCompat.SHOW_DIVIDER_MIDDLE, androidx.appcompat.widget.LinearLayoutCompat.SHOW_DIVIDER_END}) @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) public static @interface LinearLayoutCompat.DividerMode {
+ }
+
+ 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;
+ }
+
+ @IntDef({androidx.appcompat.widget.LinearLayoutCompat.HORIZONTAL, androidx.appcompat.widget.LinearLayoutCompat.VERTICAL}) @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) public static @interface LinearLayoutCompat.OrientationMode {
+ }
+
+ public class ListPopupWindow implements androidx.appcompat.view.menu.ShowableListMenu {
+ 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 @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public boolean isDropDownAlwaysVisible();
+ 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 @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void setDropDownAlwaysVisible(boolean);
+ method public void setDropDownGravity(int);
+ method public void setEpicenterBounds(android.graphics.Rect?);
+ method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void setForceIgnoreOutsideTouch(boolean);
+ 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 @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void setOverlapAnchor(boolean);
+ 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
+ }
+
+ @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) 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_PREFIX) 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_PREFIX) public static class MenuPopupWindow.MenuDropDownListView extends android.widget.ListView {
+ ctor public MenuPopupWindow.MenuDropDownListView(android.content.Context!, boolean);
+ method public void clearSelection();
+ 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 void setHoverListener(androidx.appcompat.widget.MenuItemHoverListener!);
+ field public static final int INVALID_POSITION = -1; // 0xffffffff
+ field public static final int NO_POSITION = -1; // 0xffffffff
+ }
+
+ 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!);
+ }
+
+ @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class ScrollingTabContainerView extends android.widget.HorizontalScrollView implements android.widget.AdapterView.OnItemSelectedListener {
+ 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 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 extends android.animation.AnimatorListenerAdapter {
+ ctor protected ScrollingTabContainerView.VisibilityAnimListener();
+ 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 {
+ 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 @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void setAppSearchData(android.os.Bundle!);
+ 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);
+ }
+
+ @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) 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);
+ }
+
+ 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?);
+ }
+
+ @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) 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 android.content.res.TypedArray! getWrappedTypeArray();
+ 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 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 @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public boolean canShowOverflowMenu();
+ 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 @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public androidx.appcompat.widget.DecorToolbar! getWrapper();
+ method public boolean hasExpandedActionView();
+ method public boolean hideOverflowMenu();
+ method public void inflateMenu(@MenuRes int);
+ method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public boolean isOverflowMenuShowPending();
+ method public boolean isOverflowMenuShowing();
+ method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public boolean isTitleTruncated();
+ 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 @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void setCollapsible(boolean);
+ 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 @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void setMenu(androidx.appcompat.view.menu.MenuBuilder!, androidx.appcompat.widget.ActionMenuPresenter!);
+ method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void setMenuCallbacks(androidx.appcompat.view.menu.MenuPresenter.Callback!, androidx.appcompat.view.menu.MenuBuilder.Callback!);
+ 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;
+ }
+
+ @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) 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();
+ }
+
+ public class TooltipCompat {
+ method public static void setTooltipText(android.view.View, CharSequence?);
+ }
+
+ @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public final class ViewStubCompat extends android.view.View {
+ ctor public ViewStubCompat(android.content.Context, android.util.AttributeSet?);
+ ctor public ViewStubCompat(android.content.Context, android.util.AttributeSet?, int);
+ method public int getInflatedId();
+ method public android.view.LayoutInflater! getLayoutInflater();
+ method public int getLayoutResource();
+ method public android.view.View! inflate();
+ 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!);
+ }
+
+ public static interface ViewStubCompat.OnInflateListener {
+ method public void onInflate(androidx.appcompat.widget.ViewStubCompat!, android.view.View!);
+ }
+
+ @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) 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_PREFIX) public interface WithHint {
+ method public CharSequence? getHint();
+ }
+
+}
+
diff --git a/appcompat/appcompat/api/restricted_1.3.0-alpha01.txt b/appcompat/appcompat/api/restricted_1.3.0-alpha01.txt
new file mode 100644
index 0000000..10b05b7
--- /dev/null
+++ b/appcompat/appcompat/api/restricted_1.3.0-alpha01.txt
@@ -0,0 +1,2204 @@
+// 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 @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public boolean closeOptionsMenu();
+ method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public boolean collapseActionView();
+ method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void dispatchMenuVisibilityChanged(boolean);
+ method public abstract android.view.View! getCustomView();
+ method @androidx.appcompat.app.ActionBar.DisplayOptions 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 @androidx.appcompat.app.ActionBar.NavigationMode 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 @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public boolean invalidateOptionsMenu();
+ method public boolean isHideOnContentScrollEnabled();
+ method public abstract boolean isShowing();
+ method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public boolean isTitleTruncated();
+ method @Deprecated public abstract androidx.appcompat.app.ActionBar.Tab! newTab();
+ method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void onConfigurationChanged(android.content.res.Configuration!);
+ method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public boolean onKeyShortcut(int, android.view.KeyEvent!);
+ method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public boolean onMenuKeyEvent(android.view.KeyEvent!);
+ method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public boolean openOptionsMenu();
+ 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 @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void setDefaultDisplayHomeAsUpEnabled(boolean);
+ method public abstract void setDisplayHomeAsUpEnabled(boolean);
+ method public abstract void setDisplayOptions(@androidx.appcompat.app.ActionBar.DisplayOptions int);
+ method public abstract void setDisplayOptions(@androidx.appcompat.app.ActionBar.DisplayOptions int, @androidx.appcompat.app.ActionBar.DisplayOptions 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(@androidx.appcompat.app.ActionBar.NavigationMode int);
+ method @Deprecated public abstract void setSelectedNavigationItem(int);
+ method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void setShowHideAnimationEnabled(boolean);
+ 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 @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void setWindowTitle(CharSequence!);
+ method public abstract void show();
+ method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public androidx.appcompat.view.ActionMode! startActionMode(androidx.appcompat.view.ActionMode.Callback!);
+ 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
+ }
+
+ @IntDef(flag=true, value={androidx.appcompat.app.ActionBar.DISPLAY_USE_LOGO, androidx.appcompat.app.ActionBar.DISPLAY_SHOW_HOME, androidx.appcompat.app.ActionBar.DISPLAY_HOME_AS_UP, androidx.appcompat.app.ActionBar.DISPLAY_SHOW_TITLE, androidx.appcompat.app.ActionBar.DISPLAY_SHOW_CUSTOM}) @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) public static @interface ActionBar.DisplayOptions {
+ }
+
+ 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;
+ }
+
+ @IntDef({androidx.appcompat.app.ActionBar.NAVIGATION_MODE_STANDARD, androidx.appcompat.app.ActionBar.NAVIGATION_MODE_LIST, androidx.appcompat.app.ActionBar.NAVIGATION_MODE_TABS}) @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) public static @interface ActionBar.NavigationMode {
+ }
+
+ 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 @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public androidx.appcompat.app.AlertDialog.Builder! setRecycleOnMeasureEnabled(boolean);
+ 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 @Deprecated @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public androidx.appcompat.app.AlertDialog.Builder! setView(android.view.View!, int, int, int, int);
+ 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();
+ ctor @ContentView public AppCompatActivity(@LayoutRes int);
+ 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(@androidx.appcompat.app.AppCompatDelegate.NightMode 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 @Deprecated public void attachBaseContext(android.content.Context!);
+ method @CallSuper public android.content.Context attachBaseContext2(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.content.Context, android.app.Activity, 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 @androidx.appcompat.app.AppCompatDelegate.NightMode public static int getDefaultNightMode();
+ method public abstract androidx.appcompat.app.ActionBarDrawerToggle.Delegate? getDrawerToggleDelegate();
+ method @androidx.appcompat.app.AppCompatDelegate.NightMode 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 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(@androidx.appcompat.app.AppCompatDelegate.NightMode int);
+ method public abstract void setHandleNativeActionModesEnabled(boolean);
+ method @RequiresApi(17) public abstract void setLocalNightMode(@androidx.appcompat.app.AppCompatDelegate.NightMode int);
+ method public abstract void setSupportActionBar(androidx.appcompat.widget.Toolbar?);
+ method public void setTheme(@StyleRes int);
+ 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
+ }
+
+ @IntDef({androidx.appcompat.app.AppCompatDelegate.MODE_NIGHT_NO, androidx.appcompat.app.AppCompatDelegate.MODE_NIGHT_YES, androidx.appcompat.app.AppCompatDelegate.MODE_NIGHT_AUTO_TIME, androidx.appcompat.app.AppCompatDelegate.MODE_NIGHT_FOLLOW_SYSTEM, androidx.appcompat.app.AppCompatDelegate.MODE_NIGHT_UNSPECIFIED, androidx.appcompat.app.AppCompatDelegate.MODE_NIGHT_AUTO_BATTERY}) @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) public static @interface AppCompatDelegate.NightMode {
+ }
+
+ 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!);
+ }
+
+ @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) 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_PREFIX) 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_PREFIX) 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_PREFIX) 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 {
+
+ 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 @androidx.appcompat.graphics.drawable.DrawerArrowDrawable.ArrowDirection 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(@androidx.appcompat.graphics.drawable.DrawerArrowDrawable.ArrowDirection 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
+ }
+
+ @IntDef({androidx.appcompat.graphics.drawable.DrawerArrowDrawable.ARROW_DIRECTION_LEFT, androidx.appcompat.graphics.drawable.DrawerArrowDrawable.ARROW_DIRECTION_RIGHT, androidx.appcompat.graphics.drawable.DrawerArrowDrawable.ARROW_DIRECTION_START, androidx.appcompat.graphics.drawable.DrawerArrowDrawable.ARROW_DIRECTION_END}) @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) public static @interface DrawerArrowDrawable.ArrowDirection {
+ }
+
+}
+
+package androidx.appcompat.text {
+
+ @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class AllCapsTransformationMethod implements android.text.method.TransformationMethod {
+ 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_PREFIX) 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 {
+ 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 @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public boolean isUiFocusable();
+ 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!);
+ }
+
+ @Deprecated public interface CollapsibleActionView {
+ method @Deprecated public void onActionViewCollapsed();
+ method @Deprecated 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);
+ }
+
+ @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) 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_PREFIX) public class SupportActionModeWrapper extends android.view.ActionMode {
+ 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 CharSequence! getTitle();
+ method public void invalidate();
+ 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_PREFIX) 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_PREFIX) public class SupportMenuInflater extends android.view.MenuInflater {
+ ctor public SupportMenuInflater(android.content.Context!);
+ }
+
+ @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) 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_PREFIX) public class WindowCallbackWrapper implements android.view.Window.Callback {
+ 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 final android.view.Window.Callback! getWrapped();
+ 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 public boolean onPreparePanel(int, android.view.View!, android.view.Menu!);
+ 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_PREFIX) public class ActionMenuItem implements androidx.core.internal.view.SupportMenuItem {
+ 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 char getAlphabeticShortcut();
+ method public int getGroupId();
+ method public android.graphics.drawable.Drawable! getIcon();
+ method public android.content.Intent! getIntent();
+ method public int getItemId();
+ method public android.view.ContextMenu.ContextMenuInfo! getMenuInfo();
+ 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 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 boolean requiresActionButton();
+ method public boolean requiresOverflow();
+ 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! 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! setIntent(android.content.Intent!);
+ method public android.view.MenuItem! setNumericShortcut(char);
+ 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 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_PREFIX) public class ActionMenuItemView extends androidx.appcompat.widget.AppCompatTextView implements androidx.appcompat.widget.ActionMenuView.ActionMenuChildView androidx.appcompat.view.menu.MenuView.ItemView android.view.View.OnClickListener {
+ 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 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 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_PREFIX) 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_PREFIX) public final class ExpandedMenuView extends android.widget.ListView implements android.widget.AdapterView.OnItemClickListener 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 public void onItemClick(android.widget.AdapterView!, android.view.View!, int, long);
+ }
+
+ @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class ListMenuItemView extends android.widget.LinearLayout implements android.widget.AbsListView.SelectionBoundsAdjuster 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 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_PREFIX) public class ListMenuPresenter implements android.widget.AdapterView.OnItemClickListener 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_PREFIX) public class MenuAdapter extends android.widget.BaseAdapter {
+ 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 setForceShowIcon(boolean);
+ }
+
+ @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class MenuBuilder implements androidx.core.internal.view.SupportMenu {
+ 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 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_PREFIX) 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_PREFIX) public static interface MenuBuilder.ItemInvoker {
+ method public boolean invokeItem(androidx.appcompat.view.menu.MenuItemImpl!);
+ }
+
+ @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public final class MenuItemImpl implements androidx.core.internal.view.SupportMenuItem {
+ 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 char getAlphabeticShortcut();
+ method public int getGroupId();
+ method public android.graphics.drawable.Drawable! getIcon();
+ method public android.content.Intent! getIntent();
+ method @android.view.ViewDebug.CapturedViewProperty public int getItemId();
+ method public android.view.ContextMenu.ContextMenuInfo! getMenuInfo();
+ 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 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 boolean requiresOverflow();
+ 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! 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! setIntent(android.content.Intent!);
+ method public void setIsActionButton(boolean);
+ method public android.view.MenuItem! setNumericShortcut(char);
+ 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 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();
+ }
+
+ @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class MenuItemWrapperICS implements android.view.MenuItem {
+ ctor public MenuItemWrapperICS(android.content.Context!, androidx.core.internal.view.SupportMenuItem!);
+ method public boolean collapseActionView();
+ method public boolean expandActionView();
+ method public android.view.ActionProvider! getActionProvider();
+ method public android.view.View! getActionView();
+ method public char getAlphabeticShortcut();
+ method public int getGroupId();
+ method public android.graphics.drawable.Drawable! getIcon();
+ method public android.content.Intent! getIntent();
+ method public int getItemId();
+ method public android.view.ContextMenu.ContextMenuInfo! getMenuInfo();
+ method public char getNumericShortcut();
+ method public int getOrder();
+ method public android.view.SubMenu! getSubMenu();
+ method public CharSequence! getTitle();
+ method public CharSequence! getTitleCondensed();
+ 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! setCheckable(boolean);
+ method public android.view.MenuItem! setChecked(boolean);
+ 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! setIntent(android.content.Intent!);
+ method public android.view.MenuItem! setNumericShortcut(char);
+ 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 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! setVisible(boolean);
+ }
+
+ @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) 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_PREFIX) 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_PREFIX) 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_PREFIX) public class MenuWrapperICS implements android.view.Menu {
+ ctor public MenuWrapperICS(android.content.Context!, androidx.core.internal.view.SupportMenu!);
+ 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 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 clear();
+ method public void close();
+ method public android.view.MenuItem! findItem(int);
+ method public android.view.MenuItem! getItem(int);
+ method public boolean hasVisibleItems();
+ method public boolean isShortcutKey(int, android.view.KeyEvent!);
+ method public boolean performIdentifierAction(int, int);
+ method public boolean performShortcut(int, android.view.KeyEvent!, int);
+ method public void removeGroup(int);
+ method public void removeItem(int);
+ method public void setGroupCheckable(int, boolean, boolean);
+ method public void setGroupEnabled(int, boolean);
+ method public void setGroupVisible(int, boolean);
+ method public void setQwertyMode(boolean);
+ method public int size();
+ }
+
+ @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) 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_PREFIX) public class SubMenuBuilder extends androidx.appcompat.view.menu.MenuBuilder implements android.view.SubMenu {
+ 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_PREFIX) public class ActionBarContainer extends android.widget.FrameLayout {
+ ctor public ActionBarContainer(android.content.Context!);
+ ctor public ActionBarContainer(android.content.Context!, android.util.AttributeSet!);
+ method public android.view.View! getTabContainer();
+ method public void onFinishInflate();
+ method public void onLayout(boolean, int, int, int, int);
+ method public void onMeasure(int, int);
+ 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);
+ }
+
+ @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class ActionBarContextView extends android.view.ViewGroup {
+ 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 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 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 androidx.core.view.ViewPropertyAnimatorCompat! setupAnimatorToVisibility(int, long);
+ method public boolean showOverflowMenu();
+ }
+
+ @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class ActionBarOverlayLayout extends android.view.ViewGroup implements androidx.appcompat.widget.DecorContentParent androidx.core.view.NestedScrollingParent androidx.core.view.NestedScrollingParent2 androidx.core.view.NestedScrollingParent3 {
+ ctor public ActionBarOverlayLayout(android.content.Context);
+ ctor public ActionBarOverlayLayout(android.content.Context, android.util.AttributeSet?);
+ method public boolean canShowOverflowMenu();
+ method public void dismissPopups();
+ 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 public int getActionBarHideOffset();
+ 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 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 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 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 extends android.view.ViewGroup.MarginLayoutParams {
+ 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 {
+ 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 @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public androidx.appcompat.widget.ActionMenuView.LayoutParams! generateOverflowButtonLayoutParams();
+ method public android.view.Menu! getMenu();
+ method public android.graphics.drawable.Drawable? getOverflowIcon();
+ method public int getPopupTheme();
+ method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public int getWindowAnimations();
+ method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) protected boolean hasSupportDividerBeforeChildAt(int);
+ method public boolean hideOverflowMenu();
+ method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void initialize(androidx.appcompat.view.menu.MenuBuilder!);
+ method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public boolean invokeItem(androidx.appcompat.view.menu.MenuItemImpl!);
+ method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public boolean isOverflowMenuShowPending();
+ method public boolean isOverflowMenuShowing();
+ method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public boolean isOverflowReserved();
+ method public void onConfigurationChanged(android.content.res.Configuration!);
+ method public void onDetachedFromWindow();
+ method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public androidx.appcompat.view.menu.MenuBuilder! peekMenu();
+ method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void setExpandedActionViewsExclusive(boolean);
+ method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void setMenuCallbacks(androidx.appcompat.view.menu.MenuPresenter.Callback!, androidx.appcompat.view.menu.MenuBuilder.Callback!);
+ method public void setOnMenuItemClickListener(androidx.appcompat.widget.ActionMenuView.OnMenuItemClickListener!);
+ method public void setOverflowIcon(android.graphics.drawable.Drawable?);
+ method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void setOverflowReserved(boolean);
+ method public void setPopupTheme(@StyleRes int);
+ method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void setPresenter(androidx.appcompat.widget.ActionMenuPresenter!);
+ method public boolean showOverflowMenu();
+ }
+
+ @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public static interface ActionMenuView.ActionMenuChildView {
+ method public boolean needsDividerAfter();
+ method public boolean needsDividerBefore();
+ }
+
+ 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!);
+ }
+
+ @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class ActivityChooserView extends android.view.ViewGroup {
+ 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 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_PREFIX) public void setProvider(androidx.core.view.ActionProvider!);
+ method public boolean showPopup();
+ }
+
+ @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public static class ActivityChooserView.InnerLayout extends android.widget.LinearLayout {
+ ctor public ActivityChooserView.InnerLayout(android.content.Context!, android.util.AttributeSet!);
+ }
+
+ @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) 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 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 androidx.core.widget.TintableCompoundDrawablesView {
+ 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 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_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 @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);
+ }
+
+ 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);
+ }
+
+ @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) 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);
+ method public static void preload();
+ }
+
+ 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?);
+ }
+
+ @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) 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 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);
+ }
+
+ @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class ButtonBarLayout extends android.widget.LinearLayout {
+ ctor public ButtonBarLayout(android.content.Context, android.util.AttributeSet?);
+ method public void setAllowStacking(boolean);
+ }
+
+ @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) 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_PREFIX) 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_PREFIX) public class DialogTitle extends androidx.appcompat.widget.AppCompatTextView {
+ 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);
+ }
+
+ @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class FitWindowsFrameLayout extends android.widget.FrameLayout 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_PREFIX) public class FitWindowsLinearLayout extends android.widget.LinearLayout 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_PREFIX) 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_PREFIX) public abstract class ForwardingListener implements android.view.View.OnAttachStateChangeListener android.view.View.OnTouchListener {
+ 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 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 @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public int getDividerWidth();
+ method public int getGravity();
+ method @androidx.appcompat.widget.LinearLayoutCompat.OrientationMode public int getOrientation();
+ method @androidx.appcompat.widget.LinearLayoutCompat.DividerMode 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(@androidx.appcompat.widget.LinearLayoutCompat.OrientationMode int);
+ method public void setShowDividers(@androidx.appcompat.widget.LinearLayoutCompat.DividerMode 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
+ }
+
+ @IntDef(flag=true, value={androidx.appcompat.widget.LinearLayoutCompat.SHOW_DIVIDER_NONE, androidx.appcompat.widget.LinearLayoutCompat.SHOW_DIVIDER_BEGINNING, androidx.appcompat.widget.LinearLayoutCompat.SHOW_DIVIDER_MIDDLE, androidx.appcompat.widget.LinearLayoutCompat.SHOW_DIVIDER_END}) @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) public static @interface LinearLayoutCompat.DividerMode {
+ }
+
+ 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;
+ }
+
+ @IntDef({androidx.appcompat.widget.LinearLayoutCompat.HORIZONTAL, androidx.appcompat.widget.LinearLayoutCompat.VERTICAL}) @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) public static @interface LinearLayoutCompat.OrientationMode {
+ }
+
+ public class ListPopupWindow implements androidx.appcompat.view.menu.ShowableListMenu {
+ 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 @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public boolean isDropDownAlwaysVisible();
+ 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 @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void setDropDownAlwaysVisible(boolean);
+ method public void setDropDownGravity(int);
+ method public void setEpicenterBounds(android.graphics.Rect?);
+ method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void setForceIgnoreOutsideTouch(boolean);
+ 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 @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void setOverlapAnchor(boolean);
+ 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
+ }
+
+ @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) 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_PREFIX) 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_PREFIX) public static class MenuPopupWindow.MenuDropDownListView extends android.widget.ListView {
+ ctor public MenuPopupWindow.MenuDropDownListView(android.content.Context!, boolean);
+ method public void clearSelection();
+ 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 void setHoverListener(androidx.appcompat.widget.MenuItemHoverListener!);
+ field public static final int INVALID_POSITION = -1; // 0xffffffff
+ field public static final int NO_POSITION = -1; // 0xffffffff
+ }
+
+ 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!);
+ }
+
+ @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class ScrollingTabContainerView extends android.widget.HorizontalScrollView implements android.widget.AdapterView.OnItemSelectedListener {
+ 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 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 extends android.animation.AnimatorListenerAdapter {
+ ctor protected ScrollingTabContainerView.VisibilityAnimListener();
+ 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 {
+ 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 @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void setAppSearchData(android.os.Bundle!);
+ 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);
+ }
+
+ @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) 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);
+ }
+
+ 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?);
+ }
+
+ @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) 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 android.content.res.TypedArray! getWrappedTypeArray();
+ 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 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 @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public boolean canShowOverflowMenu();
+ 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 @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public androidx.appcompat.widget.DecorToolbar! getWrapper();
+ method public boolean hasExpandedActionView();
+ method public boolean hideOverflowMenu();
+ method public void inflateMenu(@MenuRes int);
+ method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public boolean isOverflowMenuShowPending();
+ method public boolean isOverflowMenuShowing();
+ method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public boolean isTitleTruncated();
+ 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 @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void setCollapsible(boolean);
+ 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 @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void setMenu(androidx.appcompat.view.menu.MenuBuilder!, androidx.appcompat.widget.ActionMenuPresenter!);
+ method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void setMenuCallbacks(androidx.appcompat.view.menu.MenuPresenter.Callback!, androidx.appcompat.view.menu.MenuBuilder.Callback!);
+ 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;
+ }
+
+ @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) 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();
+ }
+
+ public class TooltipCompat {
+ method public static void setTooltipText(android.view.View, CharSequence?);
+ }
+
+ @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public final class ViewStubCompat extends android.view.View {
+ ctor public ViewStubCompat(android.content.Context, android.util.AttributeSet?);
+ ctor public ViewStubCompat(android.content.Context, android.util.AttributeSet?, int);
+ method public int getInflatedId();
+ method public android.view.LayoutInflater! getLayoutInflater();
+ method public int getLayoutResource();
+ method public android.view.View! inflate();
+ 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!);
+ }
+
+ public static interface ViewStubCompat.OnInflateListener {
+ method public void onInflate(androidx.appcompat.widget.ViewStubCompat!, android.view.View!);
+ }
+
+ @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) 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_PREFIX) public interface WithHint {
+ method public CharSequence? getHint();
+ }
+
+}
+
diff --git a/appcompat/appcompat/build.gradle b/appcompat/appcompat/build.gradle
index 3f30b8c..a6f32e2 100644
--- a/appcompat/appcompat/build.gradle
+++ b/appcompat/appcompat/build.gradle
@@ -12,7 +12,7 @@
dependencies {
api("androidx.annotation:annotation:1.1.0")
- api("androidx.core:core:1.3.0-beta01")
+ api(project(":core:core"))
implementation("androidx.collection:collection:1.0.0")
api("androidx.cursoradapter:cursoradapter:1.0.0")
api("androidx.fragment:fragment:1.1.0")
diff --git a/benchmark/common/api/1.1.0-alpha01.txt b/benchmark/common/api/1.1.0-alpha01.txt
index 61b357d..291b7b8 100644
--- a/benchmark/common/api/1.1.0-alpha01.txt
+++ b/benchmark/common/api/1.1.0-alpha01.txt
@@ -14,5 +14,11 @@
public static final class BenchmarkState.Companion {
}
+ public final class IdeOutputKt {
+ }
+
+ public final class MetricNameUtilsKt {
+ }
+
}
diff --git a/benchmark/common/api/current.txt b/benchmark/common/api/current.txt
index 61b357d..291b7b8 100644
--- a/benchmark/common/api/current.txt
+++ b/benchmark/common/api/current.txt
@@ -14,5 +14,11 @@
public static final class BenchmarkState.Companion {
}
+ public final class IdeOutputKt {
+ }
+
+ public final class MetricNameUtilsKt {
+ }
+
}
diff --git a/benchmark/common/api/public_plus_experimental_1.1.0-alpha01.txt b/benchmark/common/api/public_plus_experimental_1.1.0-alpha01.txt
index 907fabb..9f8db28 100644
--- a/benchmark/common/api/public_plus_experimental_1.1.0-alpha01.txt
+++ b/benchmark/common/api/public_plus_experimental_1.1.0-alpha01.txt
@@ -21,5 +21,11 @@
@kotlin.annotation.Retention(AnnotationRetention.BINARY) @kotlin.annotation.Target(allowedTargets=AnnotationTarget.FUNCTION) public static @interface BenchmarkState.Companion.ExperimentalExternalReport {
}
+ public final class IdeOutputKt {
+ }
+
+ public final class MetricNameUtilsKt {
+ }
+
}
diff --git a/benchmark/common/api/public_plus_experimental_current.txt b/benchmark/common/api/public_plus_experimental_current.txt
index 907fabb..9f8db28 100644
--- a/benchmark/common/api/public_plus_experimental_current.txt
+++ b/benchmark/common/api/public_plus_experimental_current.txt
@@ -21,5 +21,11 @@
@kotlin.annotation.Retention(AnnotationRetention.BINARY) @kotlin.annotation.Target(allowedTargets=AnnotationTarget.FUNCTION) public static @interface BenchmarkState.Companion.ExperimentalExternalReport {
}
+ public final class IdeOutputKt {
+ }
+
+ public final class MetricNameUtilsKt {
+ }
+
}
diff --git a/benchmark/common/api/restricted_1.1.0-alpha01.txt b/benchmark/common/api/restricted_1.1.0-alpha01.txt
index 61b357d..291b7b8 100644
--- a/benchmark/common/api/restricted_1.1.0-alpha01.txt
+++ b/benchmark/common/api/restricted_1.1.0-alpha01.txt
@@ -14,5 +14,11 @@
public static final class BenchmarkState.Companion {
}
+ public final class IdeOutputKt {
+ }
+
+ public final class MetricNameUtilsKt {
+ }
+
}
diff --git a/benchmark/common/api/restricted_current.txt b/benchmark/common/api/restricted_current.txt
index 61b357d..291b7b8 100644
--- a/benchmark/common/api/restricted_current.txt
+++ b/benchmark/common/api/restricted_current.txt
@@ -14,5 +14,11 @@
public static final class BenchmarkState.Companion {
}
+ public final class IdeOutputKt {
+ }
+
+ public final class MetricNameUtilsKt {
+ }
+
}
diff --git a/benchmark/common/src/androidTest/java/androidx/benchmark/Allocator.kt b/benchmark/common/src/androidTest/java/androidx/benchmark/Allocator.kt
new file mode 100644
index 0000000..0b312c7
--- /dev/null
+++ b/benchmark/common/src/androidTest/java/androidx/benchmark/Allocator.kt
@@ -0,0 +1,44 @@
+/*
+ * Copyright 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT 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 org.junit.Assert
+
+private class Allocator {
+ init {
+ count++
+ }
+
+ companion object {
+ private var count = 0
+
+ fun allocate(numberToAllocate: Int) {
+ count = 0
+ repeat(numberToAllocate) {
+ Allocator()
+ }
+ Assert.assertEquals(numberToAllocate, count)
+ }
+ }
+}
+
+/**
+ * Allocates the specified number of objects, used for allocation tracker verification.
+ */
+fun allocate(objectsToAllocate: Int) {
+ Allocator.allocate(objectsToAllocate)
+}
\ No newline at end of file
diff --git a/benchmark/common/src/androidTest/java/androidx/benchmark/BenchmarkStateTest.kt b/benchmark/common/src/androidTest/java/androidx/benchmark/BenchmarkStateTest.kt
index f1c9c79..0ead918 100644
--- a/benchmark/common/src/androidTest/java/androidx/benchmark/BenchmarkStateTest.kt
+++ b/benchmark/common/src/androidTest/java/androidx/benchmark/BenchmarkStateTest.kt
@@ -17,6 +17,7 @@
package androidx.benchmark
import android.Manifest
+import android.util.Log
import androidx.benchmark.BenchmarkState.Companion.ExperimentalExternalReport
import androidx.test.filters.LargeTest
import androidx.test.filters.SdkSuppress
@@ -36,26 +37,50 @@
@LargeTest
@RunWith(JUnit4::class)
class BenchmarkStateTest {
- private fun ms2ns(ms: Long): Long = TimeUnit.MILLISECONDS.toNanos(ms)
+ private fun us2ns(ms: Long): Long = TimeUnit.MICROSECONDS.toNanos(ms)
@get:Rule
val writePermissionRule =
GrantPermissionRule.grant(Manifest.permission.WRITE_EXTERNAL_STORAGE)!!
+ /**
+ * Run the block, and then spin-loop until durationUs has elapsed.
+ *
+ * Note: block must take less time than durationUs
+ */
+ private inline fun runAndSpin(durationUs: Long, crossinline block: () -> Unit = {}) {
+ val start = System.nanoTime()
+ block()
+ val end = start + us2ns(durationUs)
+
+ @Suppress("ControlFlowWithEmptyBody") // intentionally spinning
+ while (System.nanoTime() < end) {}
+ }
+
@Test
- fun simple() {
+ fun validateMetrics() {
// would be better to mock the clock, but going with minimal changes for now
val state = BenchmarkState()
while (state.keepRunning()) {
- Thread.sleep(3)
+ runAndSpin(durationUs = 300) {
+ allocate(100)
+ }
+
state.pauseTiming()
- Thread.sleep(5)
+ runAndSpin(durationUs = 600) {
+ allocate(200)
+ }
state.resumeTiming()
}
- val median = state.getReport().getStats("timeNs").median
+ val medianTime = state.getReport().getStats("timeNs").median
assertTrue(
- "median $median should be between 2ms and 4ms",
- ms2ns(2) < median && median < ms2ns(4)
+ "median time (ns) $medianTime should be approximately 300us",
+ medianTime in us2ns(280)..us2ns(350)
+ )
+ val medianAlloc = state.getReport().getStats("allocationCount").median
+ assertTrue(
+ "median allocs $medianAlloc should be approximately 100",
+ medianAlloc in 100..110
)
}
@@ -120,36 +145,46 @@
assertEquals(initialPriority, ThreadPriority.get())
}
- @Test
- fun iterationCheck() {
+ private fun iterationCheck(checkingForThermalThrottling: Boolean) {
val state = BenchmarkState()
// disable thermal throttle checks, since it can cause loops to be thrown out
- state.performThrottleChecks = false
+ // note that this bypasses allocation count
+ state.simplifiedTimingOnlyMode = checkingForThermalThrottling
var total = 0
while (state.keepRunning()) {
total++
}
val report = state.getReport()
- val expectedCount =
- report.warmupIterations + report.repeatIterations * BenchmarkState.REPEAT_COUNT_TIME
+ val expectedRepeatCount = BenchmarkState.REPEAT_COUNT_TIME +
+ if (!checkingForThermalThrottling) BenchmarkState.REPEAT_COUNT_ALLOCATION else 0
+ val expectedCount = report.warmupIterations + report.repeatIterations * expectedRepeatCount
assertEquals(expectedCount, total)
// verify we're not in warmup mode
assertTrue(report.warmupIterations > 0)
assertTrue(report.repeatIterations > 1)
+ // verify we're not running in a special mode that affects repeat count (dry run, profiling)
assertEquals(50, BenchmarkState.REPEAT_COUNT_TIME)
}
@Test
- fun ideSummary() {
- val summary1 = BenchmarkState.ideSummaryLine("foo", 1000)
- val summary2 = BenchmarkState.ideSummaryLine("fooBarLongerKey", 10000)
+ fun iterationCheck_simple() {
+ iterationCheck(checkingForThermalThrottling = true)
+ }
- assertEquals(
- summary1.indexOf("foo"),
- summary2.indexOf("foo")
- )
+ @Test
+ fun iterationCheck_withAllocations() {
+ if (CpuInfo.locked ||
+ IsolationActivity.sustainedPerformanceModeInUse ||
+ Errors.isEmulator
+ ) {
+ // In any of these conditions, it's known that throttling won't happen, so it's safe
+ // to check for allocation count, by setting checkingForThermalThrottling = false
+ iterationCheck(checkingForThermalThrottling = false)
+ } else {
+ Log.d(BenchmarkState.TAG, "Warning - bypassing iterationCheck_withAllocations")
+ }
}
@Test
@@ -173,9 +208,13 @@
assertNotNull(bundle.get("${prefix}standardDeviation"))
// including metric name
- assertNotNull(bundle.get("${prefix}timeNs_min"))
- assertNotNull(bundle.get("${prefix}timeNs_median"))
- assertNotNull(bundle.get("${prefix}timeNs_stddev"))
+ assertNotNull(bundle.get("${prefix}time_nanos_min"))
+ assertNotNull(bundle.get("${prefix}time_nanos_median"))
+ assertNotNull(bundle.get("${prefix}time_nanos_stddev"))
+
+ assertNotNull(bundle.get("${prefix}allocation_count_min"))
+ assertNotNull(bundle.get("${prefix}allocation_count_median"))
+ assertNotNull(bundle.get("${prefix}allocation_count_stddev"))
}
@Test
diff --git a/benchmark/common/src/androidTest/java/androidx/benchmark/IdeOutputTest.kt b/benchmark/common/src/androidTest/java/androidx/benchmark/IdeOutputTest.kt
new file mode 100644
index 0000000..68e7f7d
--- /dev/null
+++ b/benchmark/common/src/androidTest/java/androidx/benchmark/IdeOutputTest.kt
@@ -0,0 +1,51 @@
+/*
+ * Copyright 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT 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.Assert
+import org.junit.Assert.assertEquals
+import org.junit.Test
+import org.junit.runner.RunWith
+import org.junit.runners.JUnit4
+
+@SmallTest
+@RunWith(JUnit4::class)
+class IdeOutputTest {
+ @Test
+ fun ideSummary_alignment() {
+ val summary1 = ideSummaryLine("foo", 1000, 100)
+ val summary2 = ideSummaryLine("fooBarLongerKey", 10000, 0)
+
+ assertEquals(
+ summary1.indexOf("foo"),
+ summary2.indexOf("foo")
+ )
+ }
+
+ @Test
+ fun ideSummary_allocs() {
+ assertEquals(
+ " 1,000 ns foo",
+ ideSummaryLine("foo", 1000, null)
+ )
+ assertEquals(
+ " 1,000 ns 10 allocs foo",
+ ideSummaryLine("foo", 1000, 10)
+ )
+ }
+}
\ No newline at end of file
diff --git a/benchmark/common/src/androidTest/java/androidx/benchmark/MetricCaptureTest.kt b/benchmark/common/src/androidTest/java/androidx/benchmark/MetricCaptureTest.kt
index f7b1caa..4c9b873 100644
--- a/benchmark/common/src/androidTest/java/androidx/benchmark/MetricCaptureTest.kt
+++ b/benchmark/common/src/androidTest/java/androidx/benchmark/MetricCaptureTest.kt
@@ -25,39 +25,21 @@
@SmallTest
@RunWith(JUnit4::class)
class AllocationCountCaptureTest {
- class Allocator {
- init {
- count++
- }
-
- companion object {
- private var count = 0
-
- fun allocate(numberToAllocate: Int) {
- count = 0
- repeat(numberToAllocate) {
- Allocator()
- }
- assertEquals(numberToAllocate, count)
- }
- }
- }
-
@Test
fun simple() {
AllocationCountCapture().verifyMedian(100..110) {
- Allocator.allocate(100)
+ allocate(100)
}
}
@Test
fun pauseResume() {
AllocationCountCapture().verifyMedian(100..110) {
- Allocator.allocate(100)
+ allocate(100)
capturePaused()
// these 1000 allocations shouldn't be counted, capture is paused!
- Allocator.allocate(1000)
+ allocate(1000)
captureResumed()
}
}
diff --git a/benchmark/common/src/androidTest/java/androidx/benchmark/MetricNameUtilsTest.kt b/benchmark/common/src/androidTest/java/androidx/benchmark/MetricNameUtilsTest.kt
new file mode 100644
index 0000000..a17f17b
--- /dev/null
+++ b/benchmark/common/src/androidTest/java/androidx/benchmark/MetricNameUtilsTest.kt
@@ -0,0 +1,43 @@
+/*
+ * Copyright 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT 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.Assert.assertEquals
+import org.junit.Test
+import org.junit.runner.RunWith
+import org.junit.runners.JUnit4
+
+@SmallTest
+@RunWith(JUnit4::class)
+class MetricNameUtilsTest {
+ @Test
+ fun toSnakeCase() {
+ assertEquals("noop", "noop".toSnakeCase())
+ assertEquals("camel_case", "camelCase".toSnakeCase())
+ assertEquals("time_ns", "timeNs".toSnakeCase())
+ assertEquals("a_ba_ba_b", "aBaBaB".toSnakeCase())
+ }
+
+ @Test
+ fun toOutputMetricName() {
+ assertEquals("noop", "noop".toOutputMetricName())
+ assertEquals("camel_case", "camelCase".toOutputMetricName())
+ assertEquals("time_nanos", "timeNs".toOutputMetricName())
+ assertEquals("a_ba_ba_b", "aBaBaB".toOutputMetricName())
+ }
+}
\ No newline at end of file
diff --git a/benchmark/common/src/main/java/androidx/benchmark/BenchmarkState.kt b/benchmark/common/src/main/java/androidx/benchmark/BenchmarkState.kt
index e6f3f59..320a74c 100644
--- a/benchmark/common/src/main/java/androidx/benchmark/BenchmarkState.kt
+++ b/benchmark/common/src/main/java/androidx/benchmark/BenchmarkState.kt
@@ -29,7 +29,6 @@
import androidx.test.platform.app.InstrumentationRegistry
import androidx.tracing.Trace
import java.io.File
-import java.text.NumberFormat
import java.util.concurrent.TimeUnit
/**
@@ -59,7 +58,8 @@
private var stages = listOf(
MetricsContainer(arrayOf(TimeCapture()), 1),
- MetricsContainer(arrayOf(TimeCapture()), REPEAT_COUNT_TIME)
+ MetricsContainer(arrayOf(TimeCapture()), REPEAT_COUNT_TIME),
+ MetricsContainer(arrayOf(AllocationCountCapture()), REPEAT_COUNT_ALLOCATION)
)
private var metrics = stages[0]
@@ -98,7 +98,20 @@
private var repeatCount = 0
- internal var performThrottleChecks = true
+ /**
+ * Set this to true to run a simplified timing loop - no allocation tracking, and no global
+ * state set/reset (such as thread priorities)
+ *
+ * This var is used in one of two cases, either set to true by [ThrottleDetector.measureWorkNs]
+ * when device performance testing for thermal throttling in between benchmarks, or in
+ * correctness tests of this library.
+ *
+ * When set to true, indicates that this BenchmarkState **should not**:
+ * - touch thread priorities
+ * - perform allocation counting (only timing results matter)
+ * - call [ThrottleDetector], since it would infinitely recurse
+ */
+ internal var simplifiedTimingOnlyMode = false
private var throttleRemainingRetries = THROTTLE_MAX_RETRIES
private var stats = mutableListOf<Stats>()
@@ -254,6 +267,9 @@
startProfilingTimeStageIfRequested()
Trace.beginSection("Benchmark Time")
}
+ RUNNING_ALLOCATION_STAGE -> {
+ Trace.beginSection("Benchmark Allocations")
+ }
}
iterationsRemaining = iterationsPerRepeat
metrics.captureStart()
@@ -264,7 +280,7 @@
*/
private fun endRunningStage(): Boolean {
if (state != RUNNING_WARMUP_STAGE &&
- performThrottleChecks &&
+ !simplifiedTimingOnlyMode &&
throttleRemainingRetries > 0 &&
sleepIfThermalThrottled(THROTTLE_BACKOFF_S)
) {
@@ -274,20 +290,33 @@
repeatCount = 0
return false
}
- Trace.endSection() // paired with start in beginBenchmarkingLoop()
+ Trace.endSection() // paired with start in beginRunningStage()
when (state) {
RUNNING_WARMUP_STAGE -> {
warmupRepeats = repeatCount
iterationsPerRepeat = computeMaxIterations()
}
- RUNNING_TIME_STAGE -> {
- stopProfilingTimeStageIfRequested()
+ RUNNING_TIME_STAGE, RUNNING_ALLOCATION_STAGE -> {
+ if (state == RUNNING_TIME_STAGE) {
+ stopProfilingTimeStageIfRequested()
+ }
stats.addAll(metrics.captureFinished(maxIterations = iterationsPerRepeat))
allData.addAll(metrics.data)
}
}
- state += 1
+ state++
+ if (state == RUNNING_ALLOCATION_STAGE) {
+ // skip allocation stage if we are only doing minimal looping (startupMode, dryRunMode,
+ // profilingMode), or if we only care about timing (checkForThermalThrottling)
+ if (simplifiedTimingOnlyMode ||
+ Arguments.startupMode ||
+ Arguments.dryRunMode ||
+ Arguments.profilingMode != ProfilingMode.None
+ ) {
+ state++
+ }
+ }
return true
}
@@ -303,7 +332,9 @@
endRunningStage()
beginRunningStage()
}
- } else if (state == RUNNING_TIME_STAGE && repeatCount >= REPEAT_COUNT_TIME) {
+ } else if (state == RUNNING_TIME_STAGE && repeatCount >= REPEAT_COUNT_TIME ||
+ state == RUNNING_ALLOCATION_STAGE && repeatCount >= REPEAT_COUNT_ALLOCATION
+ ) {
if (endRunningStage()) {
if (state == FINISHED) {
afterBenchmark()
@@ -392,7 +423,7 @@
beginRunningStage()
return true
}
- RUNNING_WARMUP_STAGE, RUNNING_TIME_STAGE -> {
+ RUNNING_WARMUP_STAGE, RUNNING_TIME_STAGE, RUNNING_ALLOCATION_STAGE -> {
iterationsRemaining--
if (iterationsRemaining <= 0) {
throwIfPaused() // only check at end of loop to save cycles
@@ -416,15 +447,17 @@
firstBenchmark = false
thermalThrottleSleepSeconds = 0
- if (performThrottleChecks &&
- !CpuInfo.locked &&
- !IsolationActivity.sustainedPerformanceModeInUse &&
- !Errors.isEmulator
- ) {
- ThrottleDetector.computeThrottleBaseline()
- }
- ThreadPriority.bumpCurrentThreadPriority()
+ if (!simplifiedTimingOnlyMode) {
+ if (!CpuInfo.locked &&
+ !IsolationActivity.sustainedPerformanceModeInUse &&
+ !Errors.isEmulator
+ ) {
+ ThrottleDetector.computeThrottleBaseline()
+ }
+
+ ThreadPriority.bumpCurrentThreadPriority()
+ }
totalRunTimeStartNs = System.nanoTime() // Record this time to find total duration
state = RUNNING_WARMUP_STAGE // begin benchmarking
@@ -433,7 +466,12 @@
private fun afterBenchmark() {
totalRunTimeNs = System.nanoTime() - totalRunTimeStartNs
- ThreadPriority.resetBumpedThread()
+
+ if (!simplifiedTimingOnlyMode) {
+ // Don't modify thread priority when checking for thermal throttling, since 'outer'
+ // BenchmarkState owns thread priority
+ ThreadPriority.resetBumpedThread()
+ }
warmupManager.logInfo()
}
@@ -491,7 +529,11 @@
// these 'legacy' CI output stats are considered output
stats.forEach { it.putInBundle(status, PREFIX) }
}
- status.putIdeSummaryLine(key, getMinTimeNanos())
+ status.putIdeSummaryLine(
+ testName = key,
+ nanos = getMinTimeNanos(),
+ allocations = stats.firstOrNull { it.name == "allocationCount" }?.median
+ )
return status
}
@@ -535,13 +577,12 @@
companion object {
internal const val TAG = "Benchmark"
- private const val STUDIO_OUTPUT_KEY_PREFIX = "android.studio.display."
- private const val STUDIO_OUTPUT_KEY_ID = "benchmark"
private const val NOT_STARTED = -1 // The benchmark has not started yet.
private const val RUNNING_WARMUP_STAGE = 0 // The benchmark warmup stage is running.
private const val RUNNING_TIME_STAGE = 1 // The time benchmarking stage is running.
- private const val FINISHED = 2 // The benchmark has stopped; all stages are finished.
+ private const val RUNNING_ALLOCATION_STAGE = 2 // The alloc benchmarking stage is running.
+ private const val FINISHED = 3 // The benchmark has stopped; all stages are finished.
private const val CONNECTED_PROFILING_SLEEP_MS = 20_000L
@@ -554,6 +595,8 @@
else -> 50
}
+ internal const val REPEAT_COUNT_ALLOCATION = 10
+
private val OVERRIDE_ITERATIONS = if (
Arguments.dryRunMode ||
Arguments.startupMode ||
@@ -623,39 +666,15 @@
val bundle = Bundle()
val fullTestName = PREFIX +
if (className.isNotEmpty()) "$className.$testName" else testName
- bundle.putIdeSummaryLine(fullTestName, report.getStats("timeNs").min)
+ bundle.putIdeSummaryLine(
+ testName = fullTestName,
+ nanos = report.getStats("timeNs").min,
+ allocations = null
+ )
InstrumentationRegistry.getInstrumentation().sendStatus(Activity.RESULT_OK, bundle)
// Report values to file output
ResultWriter.appendReport(report)
}
-
- private fun ideSummaryLineWrapped(key: String, nanos: Long): String {
- val warningLines =
- Errors.acquireWarningStringForLogging()?.split("\n") ?: listOf()
- return (warningLines + ideSummaryLine(key, nanos))
- // remove first line if empty
- .filterIndexed { index, it -> index != 0 || it.isNotEmpty() }
- // join, prepending key to everything but first string,
- // to make each line look the same
- .joinToString("\n$STUDIO_OUTPUT_KEY_ID: ")
- }
-
- // 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.
- internal fun ideSummaryLine(key: String, nanos: Long) = String.format(
- // 13 is used for alignment here, because it's enough that 9.99sec will still
- // align with any other output, without moving data too far to the right
- "%13s ns %s",
- NumberFormat.getNumberInstance().format(nanos),
- key
- )
-
- internal fun Bundle.putIdeSummaryLine(testName: String, nanos: Long) {
- putString(
- STUDIO_OUTPUT_KEY_PREFIX + STUDIO_OUTPUT_KEY_ID,
- ideSummaryLineWrapped(testName, nanos)
- )
- }
}
}
diff --git a/benchmark/common/src/main/java/androidx/benchmark/IdeOutput.kt b/benchmark/common/src/main/java/androidx/benchmark/IdeOutput.kt
new file mode 100644
index 0000000..7146f5b
--- /dev/null
+++ b/benchmark/common/src/main/java/androidx/benchmark/IdeOutput.kt
@@ -0,0 +1,56 @@
+/*
+ * Copyright 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT 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.os.Bundle
+import java.text.NumberFormat
+
+private const val STUDIO_OUTPUT_KEY_PREFIX = "android.studio.display."
+private const val STUDIO_OUTPUT_KEY_ID = "benchmark"
+
+private fun ideSummaryLineWrapped(key: String, nanos: Long, allocations: Long?): String {
+ val warningLines =
+ Errors.acquireWarningStringForLogging()?.split("\n") ?: listOf()
+ return (warningLines + ideSummaryLine(key, nanos, allocations))
+ // remove first line if empty
+ .filterIndexed { index, it -> index != 0 || it.isNotEmpty() }
+ // join, prepending key to everything but first string,
+ // to make each line look the same
+ .joinToString("\n$STUDIO_OUTPUT_KEY_ID: ")
+}
+
+// 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.
+internal fun ideSummaryLine(key: String, nanos: Long, allocations: Long?): String {
+ val numberFormat = NumberFormat.getNumberInstance()
+ return listOfNotNull(
+ // 13 alignment is enough for ~10 seconds
+ "%13s ns".format(numberFormat.format(nanos)),
+ // 9 alignment is enough for ~10 million allocations
+ allocations?.run {
+ "%8s allocs".format(numberFormat.format(allocations))
+ },
+ key
+ ).joinToString(" ")
+}
+
+internal fun Bundle.putIdeSummaryLine(testName: String, nanos: Long, allocations: Long?) {
+ putString(
+ STUDIO_OUTPUT_KEY_PREFIX + STUDIO_OUTPUT_KEY_ID,
+ ideSummaryLineWrapped(testName, nanos, allocations)
+ )
+}
\ No newline at end of file
diff --git a/benchmark/common/src/main/java/androidx/benchmark/MetricNameUtils.kt b/benchmark/common/src/main/java/androidx/benchmark/MetricNameUtils.kt
new file mode 100644
index 0000000..219e5a0
--- /dev/null
+++ b/benchmark/common/src/main/java/androidx/benchmark/MetricNameUtils.kt
@@ -0,0 +1,34 @@
+/*
+ * Copyright 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT 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.annotation.SuppressLint
+
+@SuppressLint("DefaultLocale")
+internal fun String.toSnakeCase(): String = replace(Regex("([a-z])([A-Z])")) {
+ it.groups[1]!!.value + "_" + it.groups[2]!!.value.toLowerCase()
+}
+
+/**
+ * Converts a metric name from the camelCase JSON output format to the snake_case version
+ * used by AndroidX CI, and reducing abbreviations for clarity.
+ *
+ * This functionality is a stopgap as we migrate to actually using JSON in CI.
+ */
+internal fun String.toOutputMetricName() = this
+ .toSnakeCase()
+ .replace(Regex("_ns$"), "_nanos")
\ No newline at end of file
diff --git a/benchmark/common/src/main/java/androidx/benchmark/Stats.kt b/benchmark/common/src/main/java/androidx/benchmark/Stats.kt
index d8457d4..50d4dc4 100644
--- a/benchmark/common/src/main/java/androidx/benchmark/Stats.kt
+++ b/benchmark/common/src/main/java/androidx/benchmark/Stats.kt
@@ -67,9 +67,13 @@
status.putLong("${prefix}median", median)
status.putLong("${prefix}standardDeviation", standardDeviation.toLong())
}
- status.putLong("${prefix}${name}_min", min)
- status.putLong("${prefix}${name}_median", median)
- status.putLong("${prefix}${name}_stddev", standardDeviation.toLong())
+
+ // format string for
+ val bundleName = name.toOutputMetricName()
+
+ status.putLong("${prefix}${bundleName}_min", min)
+ status.putLong("${prefix}${bundleName}_median", median)
+ status.putLong("${prefix}${bundleName}_stddev", standardDeviation.toLong())
}
override fun equals(other: Any?): Boolean {
diff --git a/benchmark/common/src/main/java/androidx/benchmark/ThrottleDetector.kt b/benchmark/common/src/main/java/androidx/benchmark/ThrottleDetector.kt
index 086d705..4d8ed0e 100644
--- a/benchmark/common/src/main/java/androidx/benchmark/ThrottleDetector.kt
+++ b/benchmark/common/src/main/java/androidx/benchmark/ThrottleDetector.kt
@@ -38,7 +38,7 @@
copySomeData()
val state = BenchmarkState()
- state.performThrottleChecks = false
+ state.simplifiedTimingOnlyMode = true
val sourceMatrix = FloatArray(16) { System.nanoTime().toFloat() }
val resultMatrix = FloatArray(16)
diff --git a/buildSrc/build_dependencies.gradle b/buildSrc/build_dependencies.gradle
index 4473c0c..7f1bbd46 100644
--- a/buildSrc/build_dependencies.gradle
+++ b/buildSrc/build_dependencies.gradle
@@ -22,8 +22,8 @@
if (isUiProject) {
build_versions.kotlin = "1.3.70"
build_versions.kotlin_coroutines = "1.3.0"
- build_versions.agp = '4.1.0-alpha03'
- build_versions.lint = '27.1.0-alpha03'
+ build_versions.agp = '4.1.0-alpha08'
+ build_versions.lint = '27.1.0-alpha08'
} else {
build_versions.kotlin = "1.3.71"
build_versions.kotlin_coroutines = "1.3.4"
diff --git a/buildSrc/src/main/kotlin/androidx/build/LibraryVersions.kt b/buildSrc/src/main/kotlin/androidx/build/LibraryVersions.kt
index 0a431a1..45d1c65 100644
--- a/buildSrc/src/main/kotlin/androidx/build/LibraryVersions.kt
+++ b/buildSrc/src/main/kotlin/androidx/build/LibraryVersions.kt
@@ -24,7 +24,7 @@
val ADS_IDENTIFIER = Version("1.0.0-alpha04")
val ANNOTATION = Version("1.2.0-alpha01")
val ANNOTATION_EXPERIMENTAL = Version("1.1.0-alpha01")
- val APPCOMPAT = Version("1.2.0-beta01")
+ val APPCOMPAT = Version("1.3.0-alpha01")
val APPSEARCH = Version("1.0.0-alpha01")
val ARCH_CORE = Version("2.2.0-alpha01")
val ARCH_CORE_TESTING = ARCH_CORE
@@ -106,7 +106,7 @@
val TESTSCREENSHOT = Version("1.0.0-alpha01")
val TEXTCLASSIFIER = Version("1.0.0-alpha03")
val TRACING = Version("1.0.0-alpha01")
- val TRANSITION = Version("2.0.0-alpha01")
+ val TRANSITION = Version("1.4.0-alpha01")
val TVPROVIDER = Version("1.1.0-alpha01")
val UI = Version("0.1.0-dev11")
val VECTORDRAWABLE = Version("1.2.0-alpha01")
@@ -115,7 +115,7 @@
val VERSIONED_PARCELABLE = Version("1.2.0-alpha01")
val VIEWPAGER = Version("1.1.0-alpha01")
val VIEWPAGER2 = Version("1.1.0-alpha01")
- val WEAR = Version("1.1.0-beta01")
+ val WEAR = Version("1.1.0-rc01")
val WEBKIT = Version("1.3.0-alpha02")
val WINDOW = Version("1.0.0-alpha02")
val WINDOW_SIDECAR = Version("0.1.0-alpha01")
diff --git a/buildSrc/src/main/kotlin/androidx/build/dependencies/Dependencies.kt b/buildSrc/src/main/kotlin/androidx/build/dependencies/Dependencies.kt
index 539c487..25bdc09 100644
--- a/buildSrc/src/main/kotlin/androidx/build/dependencies/Dependencies.kt
+++ b/buildSrc/src/main/kotlin/androidx/build/dependencies/Dependencies.kt
@@ -86,6 +86,8 @@
const val RETROFIT = "com.squareup.retrofit2:retrofit:2.7.2"
const val OKHTTP_MOCKWEBSERVER = "com.squareup.okhttp3:mockwebserver:3.14.7"
+const val SQLDELIGHT_ANDROID = "com.squareup.sqldelight:android-driver:1.3.0"
+const val SQLDELIGHT_COROUTINES_EXT = "com.squareup.sqldelight:coroutines-extensions:1.3.0"
const val ROBOLECTRIC = "org.robolectric:robolectric:4.3.1"
diff --git a/buildSrc/src/main/kotlin/androidx/build/license/CheckExternalDependencyLicensesTask.kt b/buildSrc/src/main/kotlin/androidx/build/license/CheckExternalDependencyLicensesTask.kt
index fb5b037..9dceaba 100644
--- a/buildSrc/src/main/kotlin/androidx/build/license/CheckExternalDependencyLicensesTask.kt
+++ b/buildSrc/src/main/kotlin/androidx/build/license/CheckExternalDependencyLicensesTask.kt
@@ -20,7 +20,9 @@
import org.gradle.api.GradleException
import org.gradle.api.Project
import org.gradle.api.artifacts.ExternalDependency
+import org.gradle.api.attributes.Usage
import org.gradle.api.tasks.TaskAction
+import org.gradle.kotlin.dsl.named
import java.io.File
/**
@@ -106,7 +108,11 @@
fun Project.configureExternalDependencyLicenseCheck() {
val task = tasks.register(CheckExternalDependencyLicensesTask.TASK_NAME,
CheckExternalDependencyLicensesTask::class.java)
- configurations.create(CheckExternalDependencyLicensesTask.CONFIGURATION_NAME)
+ configurations.create(CheckExternalDependencyLicensesTask.CONFIGURATION_NAME) {
+ it.attributes {
+ it.attribute(Usage.USAGE_ATTRIBUTE, objects.named(Usage.JAVA_RUNTIME))
+ }
+ }
rootProject.tasks.named(CheckExternalDependencyLicensesTask.TASK_NAME).configure {
it.dependsOn(task)
}
diff --git a/buildSrc/src/main/kotlin/androidx/build/metalava/MetalavaRunner.kt b/buildSrc/src/main/kotlin/androidx/build/metalava/MetalavaRunner.kt
index b6d00a4..3580d2a 100644
--- a/buildSrc/src/main/kotlin/androidx/build/metalava/MetalavaRunner.kt
+++ b/buildSrc/src/main/kotlin/androidx/build/metalava/MetalavaRunner.kt
@@ -22,17 +22,21 @@
import org.gradle.api.artifacts.Configuration
import org.gradle.api.file.FileCollection
import org.gradle.api.provider.ListProperty
-import org.gradle.api.provider.Property
+import org.gradle.api.provider.SetProperty
import org.gradle.process.ExecOperations
import org.gradle.workers.WorkAction
-import org.gradle.workers.WorkerExecutor
import org.gradle.workers.WorkParameters
+import org.gradle.workers.WorkerExecutor
import java.io.File
import javax.inject.Inject
// MetalavaRunner stores common configuration for executing Metalava
-fun runMetalavaWithArgs(metalavaJar: File, args: List<String>, workerExecutor: WorkerExecutor) {
+fun runMetalavaWithArgs(
+ metalavaConfiguration: Configuration,
+ args: List<String>,
+ workerExecutor: WorkerExecutor
+) {
val allArgs = listOf(
"--no-banner",
"--hide",
@@ -42,13 +46,13 @@
val workQueue = workerExecutor.noIsolation()
workQueue.submit(MetalavaWorkAction::class.java) { parameters ->
parameters.getArgs().set(allArgs)
- parameters.getMetalavaJar().set(metalavaJar)
+ parameters.getMetalavaClasspath().set(metalavaConfiguration.files)
}
}
interface MetalavaParams : WorkParameters {
fun getArgs(): ListProperty<String>
- fun getMetalavaJar(): Property<File>
+ fun getMetalavaClasspath(): SetProperty<File>
}
abstract class MetalavaWorkAction @Inject constructor (
@@ -57,7 +61,7 @@
override fun execute() {
val allArgs = getParameters().getArgs().get()
- val metalavaJar = getParameters().getMetalavaJar().get()
+ val metalavaJar = getParameters().getMetalavaClasspath().get()
execOperations.javaexec {
it.classpath(metalavaJar)
@@ -67,13 +71,9 @@
}
}
-fun Project.getMetalavaJar(): File {
- return getMetalavaConfiguration().resolvedConfiguration.files.iterator().next()
-}
-
fun Project.getMetalavaConfiguration(): Configuration {
return configurations.findByName("metalava") ?: configurations.create("metalava") {
- val dependency = dependencies.create("com.android:metalava:1.3.0:shadow@jar")
+ val dependency = dependencies.create("com.android:metalava:1.3.0")
it.dependencies.add(dependency)
}
}
@@ -110,9 +110,8 @@
// The list of checks that are API lint warnings and are yet to be enabled
"ExecutorRegistration",
"NotCloseable",
- "UseIcu",
"SamShouldBeLast",
- "MissingJvmStatic",
+ "MissingJvmstatic",
// We should only treat these as warnings
"IntentBuilderName",
@@ -124,7 +123,7 @@
"MinMaxConstant",
"TopLevelBuilder",
"BuilderSetStyle",
- "MissingBuild",
+ "MissingBuildMethod",
"SetterReturnsThis",
"OverlappingConstants",
"IllegalStateException",
@@ -133,6 +132,7 @@
"AbstractInner",
"ArrayReturn",
"MethodNameTense",
+ "UseIcu",
"NoByteOrShort",
"CommonArgsFirst"
).joinToString()
@@ -189,7 +189,7 @@
) {
val args = getGenerateApiArgs(bootClasspath, dependencyClasspath, sourcePaths, outputFile,
generateApiMode, apiLintMode, pathToManifest)
- runMetalavaWithArgs(getMetalavaJar(), args, workerExecutor)
+ runMetalavaWithArgs(getMetalavaConfiguration(), args, workerExecutor)
}
// Generates the specified api file
diff --git a/buildSrc/src/main/kotlin/androidx/build/metalava/MetalavaTask.kt b/buildSrc/src/main/kotlin/androidx/build/metalava/MetalavaTask.kt
index 41307f6..e9c8498 100644
--- a/buildSrc/src/main/kotlin/androidx/build/metalava/MetalavaTask.kt
+++ b/buildSrc/src/main/kotlin/androidx/build/metalava/MetalavaTask.kt
@@ -57,6 +57,6 @@
abstract val manifestPath: RegularFileProperty
fun runWithArgs(args: List<String>) {
- runMetalavaWithArgs(project.getMetalavaJar(), args, workerExecutor)
+ runMetalavaWithArgs(configuration, args, workerExecutor)
}
}
diff --git a/buildSrc/src/main/kotlin/androidx/build/studio/StudioVersions.kt b/buildSrc/src/main/kotlin/androidx/build/studio/StudioVersions.kt
index 871083b..1656ec0 100644
--- a/buildSrc/src/main/kotlin/androidx/build/studio/StudioVersions.kt
+++ b/buildSrc/src/main/kotlin/androidx/build/studio/StudioVersions.kt
@@ -57,7 +57,7 @@
}
private object UiStudioVersions : StudioVersions() {
- override val studioVersion = "4.1.0.3"
+ override val studioVersion = "4.1.0.8"
override val ideaMajorVersion = "193"
- override val studioBuildNumber = "6297379"
+ override val studioBuildNumber = "6423924"
}
diff --git a/camera/camera-core/src/androidTest/java/androidx/camera/core/CameraXTest.java b/camera/camera-core/src/androidTest/java/androidx/camera/core/CameraXTest.java
index 927876d..864834f 100644
--- a/camera/camera-core/src/androidTest/java/androidx/camera/core/CameraXTest.java
+++ b/camera/camera-core/src/androidTest/java/androidx/camera/core/CameraXTest.java
@@ -227,38 +227,44 @@
@Test
public void viewPortRectFillCenter() {
- assertThat(getScaledRect(CONTAINER_RECT, FIT_ASPECT_RATIO, ViewPort.FILL_CENTER))
- .isEqualTo(new RectF(15, 10, 45, 40));
+ Rect expectedRect = new Rect();
+ getScaledRect(CONTAINER_RECT, FIT_ASPECT_RATIO, ViewPort.FILL_CENTER).round(expectedRect);
+ assertThat(expectedRect).isEqualTo(new Rect(15, 10, 45, 40));
}
@Test
public void getScaledRectFillStart() {
- assertThat(getScaledRect(CONTAINER_RECT, FIT_ASPECT_RATIO, ViewPort.FILL_START))
- .isEqualTo(new RectF(10, 10, 40, 40));
+ Rect expectedRect = new Rect();
+ getScaledRect(CONTAINER_RECT, FIT_ASPECT_RATIO, ViewPort.FILL_START).round(expectedRect);
+ assertThat(expectedRect).isEqualTo(new Rect(10, 10, 40, 40));
}
@Test
public void getScaledRectFillEnd() {
- assertThat(getScaledRect(CONTAINER_RECT, FIT_ASPECT_RATIO, ViewPort.FILL_END))
- .isEqualTo(new RectF(20, 10, 50, 40));
+ Rect expectedRect = new Rect();
+ getScaledRect(CONTAINER_RECT, FIT_ASPECT_RATIO, ViewPort.FILL_END).round(expectedRect);
+ assertThat(expectedRect).isEqualTo(new Rect(20, 10, 50, 40));
}
@Test
public void getScaledRectFitCenter() {
- assertThat(getScaledRect(CONTAINER_RECT, FIT_ASPECT_RATIO, ViewPort.FIT_CENTER))
- .isEqualTo(new RectF(10, 5, 50, 45));
+ Rect expectedRect = new Rect();
+ getScaledRect(CONTAINER_RECT, FIT_ASPECT_RATIO, ViewPort.FIT_CENTER).round(expectedRect);
+ assertThat(expectedRect).isEqualTo(new Rect(10, 5, 50, 45));
}
@Test
public void getScaledRectFitStart() {
- assertThat(getScaledRect(CONTAINER_RECT, FIT_ASPECT_RATIO, ViewPort.FIT_START))
- .isEqualTo(new RectF(10, 10, 50, 50));
+ Rect expectedRect = new Rect();
+ getScaledRect(CONTAINER_RECT, FIT_ASPECT_RATIO, ViewPort.FIT_START).round(expectedRect);
+ assertThat(expectedRect).isEqualTo(new Rect(10, 10, 50, 50));
}
@Test
public void getScaledRectFitEnd() {
- assertThat(getScaledRect(CONTAINER_RECT, FIT_ASPECT_RATIO, ViewPort.FIT_END))
- .isEqualTo(new RectF(10, 0, 50, 40));
+ Rect expectedRect = new Rect();
+ getScaledRect(CONTAINER_RECT, FIT_ASPECT_RATIO, ViewPort.FIT_END).round(expectedRect);
+ assertThat(expectedRect).isEqualTo(new Rect(10, 0, 50, 40));
}
@Test
diff --git a/camera/camera-core/src/main/java/androidx/camera/core/ImageAnalysis.java b/camera/camera-core/src/main/java/androidx/camera/core/ImageAnalysis.java
index 4f7ea16..fcc3103 100644
--- a/camera/camera-core/src/main/java/androidx/camera/core/ImageAnalysis.java
+++ b/camera/camera-core/src/main/java/androidx/camera/core/ImageAnalysis.java
@@ -18,6 +18,7 @@
import static androidx.camera.core.impl.ImageAnalysisConfig.OPTION_BACKPRESSURE_STRATEGY;
import static androidx.camera.core.impl.ImageAnalysisConfig.OPTION_IMAGE_QUEUE_DEPTH;
+import static androidx.camera.core.impl.ImageAnalysisConfig.OPTION_IMAGE_READER_PROXY_PROVIDER;
import static androidx.camera.core.impl.ImageOutputConfig.OPTION_MAX_RESOLUTION;
import static androidx.camera.core.impl.ImageOutputConfig.OPTION_SUPPORTED_RESOLUTIONS;
import static androidx.camera.core.impl.ImageOutputConfig.OPTION_TARGET_ASPECT_RATIO;
@@ -182,13 +183,18 @@
int imageQueueDepth =
config.getBackpressureStrategy() == STRATEGY_BLOCK_PRODUCER
? config.getImageQueueDepth() : NON_BLOCKING_IMAGE_DEPTH;
-
- ImageReaderProxy imageReaderProxy =
- ImageReaderProxys.createIsolatedReader(
- resolution.getWidth(),
- resolution.getHeight(),
- getImageFormat(),
- imageQueueDepth);
+ ImageReaderProxy imageReaderProxy;
+ if (config.getImageReaderProxyProvider() != null) {
+ imageReaderProxy = config.getImageReaderProxyProvider().newInstance(
+ resolution.getWidth(), resolution.getHeight(), getImageFormat(),
+ imageQueueDepth, 0);
+ } else {
+ imageReaderProxy = ImageReaderProxys.createIsolatedReader(
+ resolution.getWidth(),
+ resolution.getHeight(),
+ getImageFormat(),
+ imageQueueDepth);
+ }
tryUpdateRelativeRotation();
@@ -1009,5 +1015,15 @@
getMutableConfig().insertOption(OPTION_USE_CASE_EVENT_CALLBACK, useCaseEventCallback);
return this;
}
+
+ /** @hide */
+ @NonNull
+ @RestrictTo(Scope.LIBRARY_GROUP)
+ public Builder setImageReaderProxyProvider(
+ @NonNull ImageReaderProxyProvider imageReaderProxyProvider) {
+ getMutableConfig().insertOption(OPTION_IMAGE_READER_PROXY_PROVIDER,
+ imageReaderProxyProvider);
+ return this;
+ }
}
}
diff --git a/camera/camera-core/src/main/java/androidx/camera/core/ImageCapture.java b/camera/camera-core/src/main/java/androidx/camera/core/ImageCapture.java
index a63c885..6cb252b 100644
--- a/camera/camera-core/src/main/java/androidx/camera/core/ImageCapture.java
+++ b/camera/camera-core/src/main/java/androidx/camera/core/ImageCapture.java
@@ -24,6 +24,7 @@
import static androidx.camera.core.impl.ImageCaptureConfig.OPTION_DEFAULT_SESSION_CONFIG;
import static androidx.camera.core.impl.ImageCaptureConfig.OPTION_FLASH_MODE;
import static androidx.camera.core.impl.ImageCaptureConfig.OPTION_IMAGE_CAPTURE_MODE;
+import static androidx.camera.core.impl.ImageCaptureConfig.OPTION_IMAGE_READER_PROXY_PROVIDER;
import static androidx.camera.core.impl.ImageCaptureConfig.OPTION_IO_EXECUTOR;
import static androidx.camera.core.impl.ImageCaptureConfig.OPTION_MAX_CAPTURE_STAGES;
import static androidx.camera.core.impl.ImageCaptureConfig.OPTION_MAX_RESOLUTION;
@@ -320,7 +321,12 @@
sessionConfigBuilder.addRepeatingCameraCaptureCallback(mSessionCallbackChecker);
// Setup the ImageReader to do processing
- if (mCaptureProcessor != null) {
+ if (config.getImageReaderProxyProvider() != null) {
+ mImageReader = config.getImageReaderProxyProvider().newInstance(resolution.getWidth(),
+ resolution.getHeight(), getImageFormat(), MAX_IMAGES, 0);
+ mMetadataMatchingCaptureCallback = new CameraCaptureCallback() {
+ };
+ } else if (mCaptureProcessor != null) {
// TODO: To allow user to use an Executor for the image processing.
ProcessingImageReader processingImageReader =
new ProcessingImageReader(
@@ -1152,7 +1158,8 @@
state.mIsAfTriggered = true;
ListenableFuture<CameraCaptureResult> future = getCameraControl().triggerAf();
// Add listener to avoid FutureReturnValueIgnored error.
- future.addListener(() -> { }, CameraXExecutors.directExecutor());
+ future.addListener(() -> {
+ }, CameraXExecutors.directExecutor());
}
/** Issues a request to start auto exposure scan. */
@@ -2401,6 +2408,16 @@
return this;
}
+ /** @hide */
+ @NonNull
+ @RestrictTo(Scope.LIBRARY_GROUP)
+ public Builder setImageReaderProxyProvider(
+ @NonNull ImageReaderProxyProvider imageReaderProxyProvider) {
+ getMutableConfig().insertOption(OPTION_IMAGE_READER_PROXY_PROVIDER,
+ imageReaderProxyProvider);
+ return this;
+ }
+
// Implementations of IoConfig.Builder default methods
/**
diff --git a/camera/camera-core/src/main/java/androidx/camera/core/ImageReaderProxyProvider.java b/camera/camera-core/src/main/java/androidx/camera/core/ImageReaderProxyProvider.java
new file mode 100644
index 0000000..a75a49d
--- /dev/null
+++ b/camera/camera-core/src/main/java/androidx/camera/core/ImageReaderProxyProvider.java
@@ -0,0 +1,37 @@
+/*
+ * Copyright 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT 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.camera.core;
+
+import androidx.annotation.NonNull;
+import androidx.annotation.RestrictTo;
+import androidx.camera.core.impl.ImageReaderProxy;
+
+/**
+ * Provider that provides a {@link androidx.camera.core.impl.ImageReaderProxy} instance.
+ *
+ * @hide
+ */
+@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
+public interface ImageReaderProxyProvider {
+
+ /**
+ * Implemented by the caller to provider a instance of ImageReaderProxy with the given
+ * parameters.
+ */
+ @NonNull
+ ImageReaderProxy newInstance(int width, int height, int format, int queueDepth, long usage);
+}
diff --git a/camera/camera-core/src/main/java/androidx/camera/core/impl/ImageAnalysisConfig.java b/camera/camera-core/src/main/java/androidx/camera/core/impl/ImageAnalysisConfig.java
index 20463c0..bf9b060 100644
--- a/camera/camera-core/src/main/java/androidx/camera/core/impl/ImageAnalysisConfig.java
+++ b/camera/camera-core/src/main/java/androidx/camera/core/impl/ImageAnalysisConfig.java
@@ -31,6 +31,7 @@
import androidx.camera.core.CameraSelector;
import androidx.camera.core.ImageAnalysis;
import androidx.camera.core.ImageAnalysis.BackpressureStrategy;
+import androidx.camera.core.ImageReaderProxyProvider;
import androidx.camera.core.UseCase;
import androidx.camera.core.internal.ThreadConfig;
@@ -54,6 +55,9 @@
BackpressureStrategy.class);
public static final Option<Integer> OPTION_IMAGE_QUEUE_DEPTH =
Option.create("camerax.core.imageAnalysis.imageQueueDepth", int.class);
+ public static final Option<ImageReaderProxyProvider> OPTION_IMAGE_READER_PROXY_PROVIDER =
+ Option.create("camerax.core.imageAnalysis.imageReaderProxyProvider",
+ ImageReaderProxyProvider.class);
// *********************************************************************************************
@@ -123,6 +127,17 @@
return retrieveOption(OPTION_IMAGE_QUEUE_DEPTH);
}
+ /**
+ * Gets the caller provided {@link ImageReaderProxy}.
+ *
+ * @hide
+ */
+ @RestrictTo(Scope.LIBRARY_GROUP)
+ @Nullable
+ public ImageReaderProxyProvider getImageReaderProxyProvider() {
+ return retrieveOption(OPTION_IMAGE_READER_PROXY_PROVIDER, null);
+ }
+
// Start of the default implementation of Config
// *********************************************************************************************
diff --git a/camera/camera-core/src/main/java/androidx/camera/core/impl/ImageCaptureConfig.java b/camera/camera-core/src/main/java/androidx/camera/core/impl/ImageCaptureConfig.java
index 6497fd3..9c19af5 100644
--- a/camera/camera-core/src/main/java/androidx/camera/core/impl/ImageCaptureConfig.java
+++ b/camera/camera-core/src/main/java/androidx/camera/core/impl/ImageCaptureConfig.java
@@ -24,10 +24,12 @@
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
+import androidx.annotation.RestrictTo;
import androidx.camera.core.AspectRatio;
import androidx.camera.core.CameraSelector;
import androidx.camera.core.ImageCapture;
import androidx.camera.core.ImageCapture.CaptureMode;
+import androidx.camera.core.ImageReaderProxyProvider;
import androidx.camera.core.UseCase;
import androidx.camera.core.internal.IoConfig;
@@ -59,6 +61,9 @@
Option.create("camerax.core.imageCapture.bufferFormat", Integer.class);
public static final Option<Integer> OPTION_MAX_CAPTURE_STAGES =
Option.create("camerax.core.imageCapture.maxCaptureStages", Integer.class);
+ public static final Option<ImageReaderProxyProvider> OPTION_IMAGE_READER_PROXY_PROVIDER =
+ Option.create("camerax.core.imageAnalysis.imageReaderProxyProvider",
+ ImageReaderProxyProvider.class);
// *********************************************************************************************
@@ -201,6 +206,17 @@
return retrieveOption(OPTION_MAX_CAPTURE_STAGES);
}
+ /**
+ * Gets the caller provided {@link ImageReaderProxy}.
+ *
+ * @hide
+ */
+ @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
+ @Nullable
+ public ImageReaderProxyProvider getImageReaderProxyProvider() {
+ return retrieveOption(OPTION_IMAGE_READER_PROXY_PROVIDER, null);
+ }
+
// Start of the default implementation of Config
// *********************************************************************************************
diff --git a/camera/camera-core/src/test/java/androidx/camera/core/ImageAnalysisTest.java b/camera/camera-core/src/test/java/androidx/camera/core/ImageAnalysisTest.java
index 0d1dfd9..d213605 100644
--- a/camera/camera-core/src/test/java/androidx/camera/core/ImageAnalysisTest.java
+++ b/camera/camera-core/src/test/java/androidx/camera/core/ImageAnalysisTest.java
@@ -16,15 +16,9 @@
package androidx.camera.core;
-import static androidx.camera.testing.fakes.FakeCameraDeviceSurfaceManager.MAX_OUTPUT_SIZE;
-
import static com.google.common.truth.Truth.assertThat;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.when;
-
import android.content.Context;
-import android.media.Image;
import android.os.Build;
import android.os.Handler;
import android.os.HandlerThread;
@@ -34,6 +28,7 @@
import androidx.camera.testing.fakes.FakeAppConfig;
import androidx.camera.testing.fakes.FakeCamera;
import androidx.camera.testing.fakes.FakeCameraFactory;
+import androidx.camera.testing.fakes.FakeImageReaderProxy;
import androidx.camera.testing.fakes.FakeLifecycleOwner;
import androidx.test.core.app.ApplicationProvider;
import androidx.test.filters.MediumTest;
@@ -62,23 +57,25 @@
@MediumTest
@RunWith(RobolectricTestRunner.class)
@DoNotInstrument
-@Config(minSdk = Build.VERSION_CODES.LOLLIPOP, shadows = {ShadowCameraX.class,
- ShadowImageReader.class})
+@Config(minSdk = Build.VERSION_CODES.LOLLIPOP, shadows = {ShadowCameraX.class})
public class ImageAnalysisTest {
private static final int QUEUE_DEPTH = 8;
- private static final Image MOCK_IMAGE_1 = createMockImage(1);
- private static final Image MOCK_IMAGE_2 = createMockImage(2);
- private static final Image MOCK_IMAGE_3 = createMockImage(3);
+ private static final String IMAGE_TAG = "IMAGE_TAG";
+ private static final long TIMESTAMP_1 = 1;
+ private static final long TIMESTAMP_2 = 2;
+ private static final long TIMESTAMP_3 = 3;
private Handler mCallbackHandler;
private Handler mBackgroundHandler;
private Executor mBackgroundExecutor;
private List<ImageProxy> mImageProxiesReceived;
private ImageAnalysis mImageAnalysis;
+ private FakeImageReaderProxy mFakeImageReaderProxy;
@Before
public void setUp() throws ExecutionException, InterruptedException {
+ mFakeImageReaderProxy = new FakeImageReaderProxy(QUEUE_DEPTH);
HandlerThread callbackThread = new HandlerThread("Callback");
callbackThread.start();
mCallbackHandler = new Handler(callbackThread.getLooper());
@@ -90,8 +87,6 @@
mImageProxiesReceived = new ArrayList<>();
- ShadowImageReader.clear();
-
CameraFactory.Provider cameraFactoryProvider = (ignored1, ignored2) -> {
FakeCameraFactory cameraFactory = new FakeCameraFactory();
cameraFactory.insertDefaultBackCamera(ShadowCameraX.DEFAULT_CAMERA_ID,
@@ -114,32 +109,32 @@
}
@Test
- public void resultSize_isEqualToSurfaceSize() {
+ public void resultSize_isEqualToSurfaceSize() throws InterruptedException {
// Arrange.
setUpImageAnalysisWithStrategy(ImageAnalysis.STRATEGY_KEEP_ONLY_LATEST);
// Act.
- ShadowImageReader.triggerCallbackWithMockImage(MOCK_IMAGE_1);
+ mFakeImageReaderProxy.triggerImageAvailable(IMAGE_TAG, TIMESTAMP_1);
flushHandler(mBackgroundHandler);
flushHandler(mCallbackHandler);
// Assert.
assertThat(Iterables.getOnlyElement(mImageProxiesReceived).getHeight()).isEqualTo(
- MAX_OUTPUT_SIZE.getHeight());
+ mFakeImageReaderProxy.getHeight());
assertThat(Iterables.getOnlyElement(mImageProxiesReceived).getWidth()).isEqualTo(
- MAX_OUTPUT_SIZE.getWidth());
+ mFakeImageReaderProxy.getWidth());
}
@Test
- public void nonBlockingAnalyzerClosed_imageNotAnalyzed() {
+ public void nonBlockingAnalyzerClosed_imageNotAnalyzed() throws InterruptedException {
// Arrange.
setUpImageAnalysisWithStrategy(ImageAnalysis.STRATEGY_KEEP_ONLY_LATEST);
// Act.
// Receive images from camera feed.
- ShadowImageReader.triggerCallbackWithMockImage(MOCK_IMAGE_1);
+ mFakeImageReaderProxy.triggerImageAvailable(IMAGE_TAG, TIMESTAMP_1);
flushHandler(mBackgroundHandler);
- ShadowImageReader.triggerCallbackWithMockImage(MOCK_IMAGE_2);
+ mFakeImageReaderProxy.triggerImageAvailable(IMAGE_TAG, TIMESTAMP_2);
flushHandler(mBackgroundHandler);
// Assert.
@@ -148,24 +143,24 @@
// Flush callback handler and image1 is received.
flushHandler(mCallbackHandler);
- assertThat(getImagesReceived()).containsExactly(MOCK_IMAGE_1);
+ assertThat(getImageTimestampsReceived()).containsExactly(TIMESTAMP_1);
// Clear ImageAnalysis and flush both handlers. No more image should be received because
// it's closed.
mImageAnalysis.clear();
flushHandler(mBackgroundHandler);
flushHandler(mCallbackHandler);
- assertThat(getImagesReceived()).containsExactly(MOCK_IMAGE_1);
+ assertThat(getImageTimestampsReceived()).containsExactly(TIMESTAMP_1);
}
@Test
- public void blockingAnalyzerClosed_imageNotAnalyzed() {
+ public void blockingAnalyzerClosed_imageNotAnalyzed() throws InterruptedException {
// Arrange.
setUpImageAnalysisWithStrategy(ImageAnalysis.STRATEGY_BLOCK_PRODUCER);
// Act.
// Receive images from camera feed.
- ShadowImageReader.triggerCallbackWithMockImage(MOCK_IMAGE_1);
+ mFakeImageReaderProxy.triggerImageAvailable(IMAGE_TAG, TIMESTAMP_1);
flushHandler(mBackgroundHandler);
// Assert.
@@ -179,17 +174,17 @@
}
@Test
- public void keepOnlyLatestStrategy_doesNotBlock() {
+ public void keepOnlyLatestStrategy_doesNotBlock() throws InterruptedException {
// Arrange.
setUpImageAnalysisWithStrategy(ImageAnalysis.STRATEGY_KEEP_ONLY_LATEST);
// Act.
// Receive images from camera feed.
- ShadowImageReader.triggerCallbackWithMockImage(MOCK_IMAGE_1);
+ mFakeImageReaderProxy.triggerImageAvailable(IMAGE_TAG, TIMESTAMP_1);
flushHandler(mBackgroundHandler);
- ShadowImageReader.triggerCallbackWithMockImage(MOCK_IMAGE_2);
+ mFakeImageReaderProxy.triggerImageAvailable(IMAGE_TAG, TIMESTAMP_2);
flushHandler(mBackgroundHandler);
- ShadowImageReader.triggerCallbackWithMockImage(MOCK_IMAGE_3);
+ mFakeImageReaderProxy.triggerImageAvailable(IMAGE_TAG, TIMESTAMP_3);
flushHandler(mBackgroundHandler);
// Assert.
@@ -198,32 +193,32 @@
// Flush callback handler and image1 is received.
flushHandler(mCallbackHandler);
- assertThat(getImagesReceived()).containsExactly(MOCK_IMAGE_1);
+ assertThat(getImageTimestampsReceived()).containsExactly(TIMESTAMP_1);
// Flush both handlers and the previous cached image3 is received (image2 was dropped). The
// code alternates the 2 threads so they have to be both flushed to proceed.
flushHandler(mBackgroundHandler);
flushHandler(mCallbackHandler);
- assertThat(getImagesReceived()).containsExactly(MOCK_IMAGE_1, MOCK_IMAGE_3);
+ assertThat(getImageTimestampsReceived()).containsExactly(TIMESTAMP_1, TIMESTAMP_3);
// Flush both handlers and no more frame.
flushHandler(mBackgroundHandler);
flushHandler(mCallbackHandler);
- assertThat(getImagesReceived()).containsExactly(MOCK_IMAGE_1, MOCK_IMAGE_3);
+ assertThat(getImageTimestampsReceived()).containsExactly(TIMESTAMP_1, TIMESTAMP_3);
}
@Test
- public void blockProducerStrategy_doesNotDropFrames() {
+ public void blockProducerStrategy_doesNotDropFrames() throws InterruptedException {
// Arrange.
setUpImageAnalysisWithStrategy(ImageAnalysis.STRATEGY_BLOCK_PRODUCER);
// Act.
// Receive images from camera feed.
- ShadowImageReader.triggerCallbackWithMockImage(MOCK_IMAGE_1);
+ mFakeImageReaderProxy.triggerImageAvailable(IMAGE_TAG, TIMESTAMP_1);
flushHandler(mBackgroundHandler);
- ShadowImageReader.triggerCallbackWithMockImage(MOCK_IMAGE_2);
+ mFakeImageReaderProxy.triggerImageAvailable(IMAGE_TAG, TIMESTAMP_2);
flushHandler(mBackgroundHandler);
- ShadowImageReader.triggerCallbackWithMockImage(MOCK_IMAGE_3);
+ mFakeImageReaderProxy.triggerImageAvailable(IMAGE_TAG, TIMESTAMP_3);
flushHandler(mBackgroundHandler);
// Assert.
@@ -232,7 +227,8 @@
// Flush callback handler and 3 frames received.
flushHandler(mCallbackHandler);
- assertThat(getImagesReceived()).containsExactly(MOCK_IMAGE_1, MOCK_IMAGE_2, MOCK_IMAGE_3);
+ assertThat(getImageTimestampsReceived())
+ .containsExactly(TIMESTAMP_1, TIMESTAMP_2, TIMESTAMP_3);
}
private void setUpImageAnalysisWithStrategy(
@@ -241,6 +237,8 @@
.setBackgroundExecutor(mBackgroundExecutor)
.setImageQueueDepth(QUEUE_DEPTH)
.setBackpressureStrategy(backpressureStrategy)
+ .setImageReaderProxyProvider(
+ (width, height, format, queueDepth, usage) -> mFakeImageReaderProxy)
.build();
mImageAnalysis.setAnalyzer(CameraXExecutors.newHandlerExecutor(mCallbackHandler),
@@ -258,10 +256,10 @@
});
}
- private List<Image> getImagesReceived() {
- List<Image> imagesReceived = new ArrayList<>();
+ private List<Long> getImageTimestampsReceived() {
+ List<Long> imagesReceived = new ArrayList<>();
for (ImageProxy imageProxy : mImageProxiesReceived) {
- imagesReceived.add(imageProxy.getImage());
+ imagesReceived.add(imageProxy.getImageInfo().getTimestamp());
}
return imagesReceived;
}
@@ -274,10 +272,4 @@
private static void flushHandler(Handler handler) {
((ShadowLooper) Shadow.extract(handler.getLooper())).idle();
}
-
- private static Image createMockImage(long timestamp) {
- Image mockImage = mock(Image.class);
- when(mockImage.getTimestamp()).thenReturn(timestamp);
- return mockImage;
- }
}
diff --git a/camera/camera-core/src/test/java/androidx/camera/core/ImageCaptureTest.kt b/camera/camera-core/src/test/java/androidx/camera/core/ImageCaptureTest.kt
index f7d2e66..2e92e31 100644
--- a/camera/camera-core/src/test/java/androidx/camera/core/ImageCaptureTest.kt
+++ b/camera/camera-core/src/test/java/androidx/camera/core/ImageCaptureTest.kt
@@ -17,25 +17,20 @@
package androidx.camera.core
import android.content.Context
-import android.media.Image
+import android.graphics.ImageFormat
import android.os.Build
import android.os.Handler
import android.os.HandlerThread
import android.view.Surface
-import androidx.camera.core.impl.CameraControlInternal.ControlUpdateCallback
import androidx.camera.core.impl.CameraFactory
import androidx.camera.core.impl.CameraThreadConfig
import androidx.camera.core.impl.CaptureConfig
-import androidx.camera.core.impl.SessionConfig
import androidx.camera.core.impl.UseCaseConfig
import androidx.camera.core.impl.utils.executor.CameraXExecutors
import androidx.camera.testing.fakes.FakeAppConfig
import androidx.camera.testing.fakes.FakeCamera
-import androidx.camera.testing.fakes.FakeCameraCaptureResult
-import androidx.camera.testing.fakes.FakeCameraControl
-import androidx.camera.testing.fakes.FakeCameraDeviceSurfaceManager
import androidx.camera.testing.fakes.FakeCameraFactory
-import androidx.camera.testing.fakes.FakeCameraInfoInternal
+import androidx.camera.testing.fakes.FakeImageReaderProxy
import androidx.camera.testing.fakes.FakeLifecycleOwner
import androidx.test.core.app.ApplicationProvider
import androidx.test.filters.MediumTest
@@ -45,8 +40,6 @@
import org.junit.Before
import org.junit.Test
import org.junit.runner.RunWith
-import org.mockito.Mockito
-import org.mockito.Mockito.mock
import org.robolectric.RobolectricTestRunner
import org.robolectric.annotation.Config
import org.robolectric.annotation.internal.DoNotInstrument
@@ -61,39 +54,21 @@
@MediumTest
@RunWith(RobolectricTestRunner::class)
@DoNotInstrument
-@Config(
- minSdk = Build.VERSION_CODES.LOLLIPOP,
- shadows = [ShadowCameraX::class, ShadowImageReader::class]
-)
+@Config(minSdk = Build.VERSION_CODES.LOLLIPOP, shadows = [ShadowCameraX::class])
class ImageCaptureTest {
private var executor: Executor? = null
private var callbackHandler: Handler? = null
- private var fakeCameraControl: FakeCameraControl? = null
+ private var fakeImageReaderProxy: FakeImageReaderProxy? = null
@Before
@Throws(ExecutionException::class, InterruptedException::class)
fun setUp() {
- fakeCameraControl = FakeCameraControl(
- object : ControlUpdateCallback {
- override fun onCameraControlUpdateSessionConfig(
- sessionConfig: SessionConfig
- ) {
- }
-
- override fun onCameraControlCaptureRequests(
- captureConfigs: List<CaptureConfig>
- ) {
- }
- })
val cameraFactoryProvider =
CameraFactory.Provider { _: Context?, _: CameraThreadConfig? ->
val cameraFactory = FakeCameraFactory()
cameraFactory.insertDefaultBackCamera(ShadowCameraX.DEFAULT_CAMERA_ID) {
- FakeCamera(
- ShadowCameraX.DEFAULT_CAMERA_ID, fakeCameraControl,
- FakeCameraInfoInternal()
- )
+ FakeCamera(ShadowCameraX.DEFAULT_CAMERA_ID)
}
cameraFactory
}
@@ -107,7 +82,6 @@
callbackThread.start()
callbackHandler = Handler(callbackThread.looper)
executor = CameraXExecutors.newHandlerExecutor(callbackHandler!!)
- ShadowImageReader.clear()
}
@After
@@ -115,17 +89,20 @@
fun tearDown() {
InstrumentationRegistry.getInstrumentation().runOnMainSync { CameraX.unbindAll() }
CameraX.shutdown().get()
+ fakeImageReaderProxy = null
}
@Test
fun capturedImageSize_isEqualToSurfaceSize() {
// Arrange.
- val timestamp = 0L
val imageCapture = ImageCapture.Builder()
+ // Set non jpg format so it doesn't trigger the exif code path.
+ .setBufferFormat(ImageFormat.YUV_420_888)
.setTargetRotation(Surface.ROTATION_0)
.setCaptureMode(ImageCapture.CAPTURE_MODE_MINIMIZE_LATENCY)
.setFlashMode(ImageCapture.FLASH_MODE_OFF)
.setCaptureOptionUnpacker { _: UseCaseConfig<*>?, _: CaptureConfig.Builder? -> }
+ .setImageReaderProxyProvider(getImageReaderProxyProvider())
.build()
var capturedImage: ImageProxy? = null
val onImageCapturedCallback = object : ImageCapture.OnImageCapturedCallback() {
@@ -150,29 +127,24 @@
lifecycleOwner.startAndResume()
}
imageCapture.takePicture(executor!!, onImageCapturedCallback)
- // Send mock image.
- ShadowImageReader.triggerCallbackWithMockImage(createMockImage(timestamp))
- flushHandler(callbackHandler)
- // Send fake image info.
- fakeCameraControl?.notifyAllRequestsOnCaptureCompleted(
- FakeCameraCaptureResult.Builder().setTimestamp(timestamp).build()
- )
+ // Send fake image.
+ fakeImageReaderProxy?.triggerImageAvailable("tag", 0)
flushHandler(callbackHandler)
// Assert.
- Truth.assertThat(capturedImage?.width)
- .isEqualTo(FakeCameraDeviceSurfaceManager.MAX_OUTPUT_SIZE.width)
- Truth.assertThat(capturedImage?.height)
- .isEqualTo(FakeCameraDeviceSurfaceManager.MAX_OUTPUT_SIZE.height)
+ Truth.assertThat(capturedImage?.width).isEqualTo(fakeImageReaderProxy?.width)
+ Truth.assertThat(capturedImage?.height).isEqualTo(fakeImageReaderProxy?.height)
+ }
+
+ private fun getImageReaderProxyProvider(): ImageReaderProxyProvider {
+ return ImageReaderProxyProvider { _, _, imageFormat, queueDepth, _ ->
+ fakeImageReaderProxy = FakeImageReaderProxy(queueDepth)
+ fakeImageReaderProxy?.imageFormat = imageFormat
+ fakeImageReaderProxy!!
+ }
}
private fun flushHandler(handler: Handler?) {
(Shadow.extract<Any>(handler!!.looper) as ShadowLooper).idle()
}
-
- private fun createMockImage(timestamp: Long): Image? {
- val mockImage = mock(Image::class.java)
- Mockito.`when`(mockImage.timestamp).thenReturn(timestamp)
- return mockImage
- }
}
diff --git a/camera/camera-core/src/test/java/androidx/camera/core/ShadowImageReader.java b/camera/camera-core/src/test/java/androidx/camera/core/ShadowImageReader.java
deleted file mode 100644
index 72f7481..0000000
--- a/camera/camera-core/src/test/java/androidx/camera/core/ShadowImageReader.java
+++ /dev/null
@@ -1,151 +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.camera.core;
-
-import static org.mockito.Mockito.when;
-
-import android.media.Image;
-import android.media.ImageReader;
-import android.os.Build;
-import android.os.Handler;
-
-import androidx.annotation.Nullable;
-import androidx.annotation.RequiresApi;
-import androidx.core.util.Preconditions;
-
-import org.robolectric.annotation.Implementation;
-import org.robolectric.annotation.Implements;
-import org.robolectric.shadow.api.Shadow;
-
-/**
- * A Robolectric shadow of {@link ImageReader}.
- */
-@Implements(ImageReader.class)
-public class ShadowImageReader {
-
- // Image to return when user call acquireLatestImage() or acquireNextImage().
- private static Image sIncomingImage;
-
- @Nullable
- private volatile ImageReader.OnImageAvailableListener mListener;
-
- private static ImageReader sImageReader;
- private static ShadowImageReader sShadowImageReader;
-
- private static int sWidth;
- private static int sHeight;
- private static int sMaxImages;
-
- /**
- * Shadow of {@link ImageReader#newInstance(int, int, int, int, long)}.
- */
- @Implementation
- @RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
- public static ImageReader newInstance(int width, int height, int format, int maxImages,
- long usage) {
- throw new UnsupportedOperationException("Shadow method not implemented.");
- }
-
- /**
- * Shadow of {@link ImageReader#newInstance(int, int, int, int)}.
- */
- @Implementation
- @RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
- public static ImageReader newInstance(int width, int height, int format, int maxImages) {
- Preconditions.checkState(sImageReader == null,
- "Only support one shadow ImageReader instance");
- sMaxImages = maxImages;
- sWidth = width;
- sHeight = height;
- sImageReader = Shadow.newInstanceOf(ImageReader.class);
- sShadowImageReader = Shadow.extract(sImageReader);
- return sImageReader;
- }
-
- /**
- * Sets the incoming image and triggers
- * {@link ImageReader.OnImageAvailableListener#onImageAvailable(ImageReader)}.
- */
- public static void triggerCallbackWithMockImage(Image mockImage) {
- when(mockImage.getWidth()).thenReturn(sWidth);
- when(mockImage.getHeight()).thenReturn(sHeight);
- sIncomingImage = mockImage;
- sShadowImageReader.getListener().onImageAvailable(sImageReader);
- }
-
- @Implementation
- public void close() {
- // no-op.
- }
-
- @Implementation
- public int getMaxImages() {
- return sMaxImages;
- }
-
- /**
- * Clears incoming images.
- */
- public static void clear() {
- sIncomingImage = null;
- sImageReader = null;
- sShadowImageReader = null;
- }
-
-
- /**
- * Shadow of {@link ImageReader#setOnImageAvailableListener}.
- */
- @Implementation
- public void setOnImageAvailableListener(ImageReader.OnImageAvailableListener listener,
- Handler handler) {
- this.mListener = listener;
- }
-
- /**
- * Shadow of {@link ImageReader#acquireLatestImage()}.
- */
- @Implementation
- public Image acquireLatestImage() {
- return popIncomingImage();
- }
-
- /**
- * Shadow of {@link ImageReader#acquireNextImage()}.
- */
- @Implementation
- public Image acquireNextImage() {
- return popIncomingImage();
- }
-
- private Image popIncomingImage() {
- try {
- return sIncomingImage;
- } finally {
- sIncomingImage = null;
- }
- }
-
- /**
- * Returns the last OnImageAvailableListener that was passed in call to
- * setOnImageAvailableListener or null if never called.
- */
- @Nullable
- public ImageReader.OnImageAvailableListener getListener() {
- return mListener;
- }
-}
diff --git a/camera/camera-testing/src/main/java/androidx/camera/testing/fakes/FakeImageReaderProxy.java b/camera/camera-testing/src/main/java/androidx/camera/testing/fakes/FakeImageReaderProxy.java
index b04e66e..e57eede 100644
--- a/camera/camera-testing/src/main/java/androidx/camera/testing/fakes/FakeImageReaderProxy.java
+++ b/camera/camera-testing/src/main/java/androidx/camera/testing/fakes/FakeImageReaderProxy.java
@@ -47,13 +47,13 @@
// Queue of all futures for ImageProxys which have not yet been closed.
@SuppressWarnings("WeakerAccess") /* synthetic accessor */
- BlockingQueue<ListenableFuture<Void>> mImageProxyBlockingQueue;
+ BlockingQueue<ListenableFuture<Void>> mImageProxyBlockingQueue;
// Queue of ImageProxys which have not yet been acquired.
private BlockingQueue<ImageProxy> mImageProxyAcquisitionQueue;
@SuppressWarnings("WeakerAccess") /* synthetic accessor */
- ImageReaderProxy.OnImageAvailableListener mListener;
+ ImageReaderProxy.OnImageAvailableListener mListener;
/**
* Create a new {@link FakeImageReaderProxy} instance.
@@ -140,6 +140,10 @@
mSurface = surface;
}
+ public void setImageFormat(int imageFormat) {
+ mImageFormat = imageFormat;
+ }
+
/**
* Manually trigger OnImageAvailableListener to notify the Image is ready.
*
@@ -152,12 +156,7 @@
final ListenableFuture<Void> future = fakeImageProxy.getCloseFuture();
mImageProxyBlockingQueue.put(future);
- future.addListener(new Runnable() {
- @Override
- public void run() {
- mImageProxyBlockingQueue.remove(future);
- }
- },
+ future.addListener(() -> mImageProxyBlockingQueue.remove(future),
CameraXExecutors.directExecutor()
);
@@ -183,13 +182,7 @@
final ListenableFuture<Void> future = fakeImageProxy.getCloseFuture();
if (mImageProxyBlockingQueue.offer(future, timeout, timeUnit)) {
-
- future.addListener(new Runnable() {
- @Override
- public void run() {
- mImageProxyBlockingQueue.remove(future);
- }
- },
+ future.addListener(() -> mImageProxyBlockingQueue.remove(future),
CameraXExecutors.directExecutor()
);
diff --git a/camera/camera-view/src/androidTest/java/androidx/camera/view/TextureViewImplementationTest.java b/camera/camera-view/src/androidTest/java/androidx/camera/view/TextureViewImplementationTest.java
index da3d691..71b0fc970 100644
--- a/camera/camera-view/src/androidTest/java/androidx/camera/view/TextureViewImplementationTest.java
+++ b/camera/camera-view/src/androidTest/java/androidx/camera/view/TextureViewImplementationTest.java
@@ -20,6 +20,7 @@
import android.content.Context;
import android.graphics.SurfaceTexture;
+import android.os.Build;
import android.util.Size;
import android.view.Surface;
import android.view.TextureView;
@@ -32,7 +33,6 @@
import androidx.camera.view.preview.transform.PreviewTransform;
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;
@@ -143,10 +143,9 @@
assertThat(surfaceTextureListener.onSurfaceTextureDestroyed(mSurfaceTexture)).isTrue();
}
- @SdkSuppress(maxSdkVersion = 25)
@Test
@LargeTest
- public void releaseSurfaceTexture_afterSurfaceTextureDestroyed_andCameraNoLongerUsingSurface_1()
+ public void releaseSurfaceTexture_afterSurfaceTextureDestroyed_andCameraNoLongerUsingSurface()
throws Exception {
SurfaceRequest surfaceRequest = getSurfaceRequest();
mImplementation.getSurfaceProvider().onSurfaceRequested(surfaceRequest);
@@ -166,32 +165,9 @@
Thread.sleep(1_000);
assertThat(mImplementation.mSurfaceReleaseFuture).isNull();
- }
-
- @SdkSuppress(minSdkVersion = 26)
- @Test
- @LargeTest
- public void releaseSurfaceTexture_afterSurfaceTextureDestroyed_andCameraNoLongerUsingSurface_2()
- throws Exception {
- SurfaceRequest surfaceRequest = getSurfaceRequest();
- mImplementation.getSurfaceProvider().onSurfaceRequested(surfaceRequest);
- DeferrableSurface deferrableSurface = surfaceRequest.getDeferrableSurface();
- final ListenableFuture<Surface> surfaceListenableFuture = deferrableSurface.getSurface();
-
- final TextureView.SurfaceTextureListener surfaceTextureListener =
- mImplementation.mTextureView.getSurfaceTextureListener();
- surfaceTextureListener.onSurfaceTextureAvailable(mSurfaceTexture, ANY_WIDTH, ANY_HEIGHT);
-
- surfaceListenableFuture.get();
-
- surfaceTextureListener.onSurfaceTextureDestroyed(mSurfaceTexture);
- deferrableSurface.close();
-
- // Wait enough time for surfaceReleaseFuture's listener to be called
- Thread.sleep(1_000);
-
- assertThat(mImplementation.mSurfaceReleaseFuture).isNull();
- assertThat(mSurfaceTexture.isReleased()).isTrue();
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
+ assertThat(mSurfaceTexture.isReleased()).isTrue();
+ }
}
@Test
@@ -262,13 +238,11 @@
@Test
@LargeTest
public void releaseDetachedSurfaceTexture_whenDeferrableSurfaceClose() throws Exception {
-
- SurfaceRequest surfaceRequest = getSurfaceRequest();
+ final SurfaceRequest surfaceRequest = getSurfaceRequest();
mImplementation.getSurfaceProvider().onSurfaceRequested(surfaceRequest);
- DeferrableSurface deferrableSurface = surfaceRequest.getDeferrableSurface();
+ final DeferrableSurface deferrableSurface = surfaceRequest.getDeferrableSurface();
final ListenableFuture<Surface> surfaceListenableFuture = deferrableSurface.getSurface();
-
final TextureView.SurfaceTextureListener surfaceTextureListener =
mImplementation.mTextureView.getSurfaceTextureListener();
@@ -284,9 +258,10 @@
Thread.sleep(1_000);
assertThat(mImplementation.mSurfaceReleaseFuture).isNull();
- assertThat(mSurfaceTexture.isReleased()).isTrue();
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
+ assertThat(mSurfaceTexture.isReleased()).isTrue();
+ }
assertThat(mImplementation.mDetachedSurfaceTexture).isNull();
-
}
@Test
diff --git a/collection/OWNERS b/collection/OWNERS
index e450f4c..a02ebce 100644
--- a/collection/OWNERS
+++ b/collection/OWNERS
@@ -1 +1,2 @@
jakew@google.com
+android@jakewharton.com
diff --git a/collection/collection-ktx/api/1.2.0-alpha01.txt b/collection/collection-ktx/api/1.2.0-alpha01.txt
index 26a6709..ddbfe32 100644
--- a/collection/collection-ktx/api/1.2.0-alpha01.txt
+++ b/collection/collection-ktx/api/1.2.0-alpha01.txt
@@ -25,7 +25,7 @@
}
public final class 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 inline <K, V> androidx.collection.LruCache<K,V> lruCache(int maxSize, kotlin.jvm.functions.Function2<? super K,? super V,java.lang.Integer> sizeOf = { _, _ -> return 1 }, kotlin.jvm.functions.Function1<? super K,? extends V> create = { return null as V }, kotlin.jvm.functions.Function4<? super java.lang.Boolean,? super K,? super V,? super V,kotlin.Unit> onEntryRemoved = { _, _, _, _ -> });
}
public final class SparseArrayKt {
diff --git a/collection/collection-ktx/api/current.txt b/collection/collection-ktx/api/current.txt
index 26a6709..ddbfe32 100644
--- a/collection/collection-ktx/api/current.txt
+++ b/collection/collection-ktx/api/current.txt
@@ -25,7 +25,7 @@
}
public final class 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 inline <K, V> androidx.collection.LruCache<K,V> lruCache(int maxSize, kotlin.jvm.functions.Function2<? super K,? super V,java.lang.Integer> sizeOf = { _, _ -> return 1 }, kotlin.jvm.functions.Function1<? super K,? extends V> create = { return null as V }, kotlin.jvm.functions.Function4<? super java.lang.Boolean,? super K,? super V,? super V,kotlin.Unit> onEntryRemoved = { _, _, _, _ -> });
}
public final class SparseArrayKt {
diff --git a/collection/collection-ktx/api/public_plus_experimental_1.2.0-alpha01.txt b/collection/collection-ktx/api/public_plus_experimental_1.2.0-alpha01.txt
index 26a6709..ddbfe32 100644
--- a/collection/collection-ktx/api/public_plus_experimental_1.2.0-alpha01.txt
+++ b/collection/collection-ktx/api/public_plus_experimental_1.2.0-alpha01.txt
@@ -25,7 +25,7 @@
}
public final class 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 inline <K, V> androidx.collection.LruCache<K,V> lruCache(int maxSize, kotlin.jvm.functions.Function2<? super K,? super V,java.lang.Integer> sizeOf = { _, _ -> return 1 }, kotlin.jvm.functions.Function1<? super K,? extends V> create = { return null as V }, kotlin.jvm.functions.Function4<? super java.lang.Boolean,? super K,? super V,? super V,kotlin.Unit> onEntryRemoved = { _, _, _, _ -> });
}
public final class SparseArrayKt {
diff --git a/collection/collection-ktx/api/public_plus_experimental_current.txt b/collection/collection-ktx/api/public_plus_experimental_current.txt
index 26a6709..ddbfe32 100644
--- a/collection/collection-ktx/api/public_plus_experimental_current.txt
+++ b/collection/collection-ktx/api/public_plus_experimental_current.txt
@@ -25,7 +25,7 @@
}
public final class 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 inline <K, V> androidx.collection.LruCache<K,V> lruCache(int maxSize, kotlin.jvm.functions.Function2<? super K,? super V,java.lang.Integer> sizeOf = { _, _ -> return 1 }, kotlin.jvm.functions.Function1<? super K,? extends V> create = { return null as V }, kotlin.jvm.functions.Function4<? super java.lang.Boolean,? super K,? super V,? super V,kotlin.Unit> onEntryRemoved = { _, _, _, _ -> });
}
public final class SparseArrayKt {
diff --git a/collection/collection-ktx/api/restricted_1.2.0-alpha01.txt b/collection/collection-ktx/api/restricted_1.2.0-alpha01.txt
index 26a6709..ddbfe32 100644
--- a/collection/collection-ktx/api/restricted_1.2.0-alpha01.txt
+++ b/collection/collection-ktx/api/restricted_1.2.0-alpha01.txt
@@ -25,7 +25,7 @@
}
public final class 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 inline <K, V> androidx.collection.LruCache<K,V> lruCache(int maxSize, kotlin.jvm.functions.Function2<? super K,? super V,java.lang.Integer> sizeOf = { _, _ -> return 1 }, kotlin.jvm.functions.Function1<? super K,? extends V> create = { return null as V }, kotlin.jvm.functions.Function4<? super java.lang.Boolean,? super K,? super V,? super V,kotlin.Unit> onEntryRemoved = { _, _, _, _ -> });
}
public final class SparseArrayKt {
diff --git a/collection/collection-ktx/api/restricted_current.txt b/collection/collection-ktx/api/restricted_current.txt
index 26a6709..ddbfe32 100644
--- a/collection/collection-ktx/api/restricted_current.txt
+++ b/collection/collection-ktx/api/restricted_current.txt
@@ -25,7 +25,7 @@
}
public final class 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 inline <K, V> androidx.collection.LruCache<K,V> lruCache(int maxSize, kotlin.jvm.functions.Function2<? super K,? super V,java.lang.Integer> sizeOf = { _, _ -> return 1 }, kotlin.jvm.functions.Function1<? super K,? extends V> create = { return null as V }, kotlin.jvm.functions.Function4<? super java.lang.Boolean,? super K,? super V,? super V,kotlin.Unit> onEntryRemoved = { _, _, _, _ -> });
}
public final class SparseArrayKt {
diff --git a/collection/collection/api/1.2.0-alpha01.ignore b/collection/collection/api/1.2.0-alpha01.ignore
new file mode 100644
index 0000000..7876d30
--- /dev/null
+++ b/collection/collection/api/1.2.0-alpha01.ignore
@@ -0,0 +1,3 @@
+// Baseline format: 1.0
+InvalidNullConversion: androidx.collection.ArraySet#valueAt(int):
+ Attempted to remove @Nullable annotation from method androidx.collection.ArraySet.valueAt(int)
diff --git a/collection/collection/api/1.2.0-alpha01.txt b/collection/collection/api/1.2.0-alpha01.txt
index 7d0bd29..975bc87 100644
--- a/collection/collection/api/1.2.0-alpha01.txt
+++ b/collection/collection/api/1.2.0-alpha01.txt
@@ -37,7 +37,7 @@
method public int size();
method public Object![] toArray();
method public <T> T![] toArray(T![]);
- method public E? valueAt(int);
+ method public E! valueAt(int);
}
public final class CircularArray<E> {
diff --git a/collection/collection/api/api_lint.ignore b/collection/collection/api/api_lint.ignore
index 03c418f..a0c5243 100644
--- a/collection/collection/api/api_lint.ignore
+++ b/collection/collection/api/api_lint.ignore
@@ -27,16 +27,6 @@
MissingNullability: androidx.collection.ArrayMap#ArrayMap(androidx.collection.SimpleArrayMap) parameter #0:
Missing nullability on parameter `map` in method `ArrayMap`
-MissingNullability: androidx.collection.ArrayMap#entrySet():
- Missing nullability on method `entrySet` return
-MissingNullability: androidx.collection.ArrayMap#keySet():
- Missing nullability on method `keySet` return
-MissingNullability: androidx.collection.ArrayMap#putAll(java.util.Map<? extends K,? extends V>) parameter #0:
- Missing nullability on parameter `map` in method `putAll`
-MissingNullability: androidx.collection.ArrayMap#values():
- Missing nullability on method `values` return
-MissingNullability: androidx.collection.ArraySet#iterator():
- Missing nullability on method `iterator` return
MissingNullability: androidx.collection.LongSparseArray#clone():
Missing nullability on method `clone` return
MissingNullability: androidx.collection.LongSparseArray#remove(long, Object) parameter #1:
diff --git a/collection/collection/api/current.txt b/collection/collection/api/current.txt
index 7d0bd29..975bc87 100644
--- a/collection/collection/api/current.txt
+++ b/collection/collection/api/current.txt
@@ -37,7 +37,7 @@
method public int size();
method public Object![] toArray();
method public <T> T![] toArray(T![]);
- method public E? valueAt(int);
+ method public E! valueAt(int);
}
public final class CircularArray<E> {
diff --git a/collection/collection/api/public_plus_experimental_1.2.0-alpha01.txt b/collection/collection/api/public_plus_experimental_1.2.0-alpha01.txt
index 7d0bd29..975bc87 100644
--- a/collection/collection/api/public_plus_experimental_1.2.0-alpha01.txt
+++ b/collection/collection/api/public_plus_experimental_1.2.0-alpha01.txt
@@ -37,7 +37,7 @@
method public int size();
method public Object![] toArray();
method public <T> T![] toArray(T![]);
- method public E? valueAt(int);
+ method public E! valueAt(int);
}
public final class CircularArray<E> {
diff --git a/collection/collection/api/public_plus_experimental_current.txt b/collection/collection/api/public_plus_experimental_current.txt
index 7d0bd29..975bc87 100644
--- a/collection/collection/api/public_plus_experimental_current.txt
+++ b/collection/collection/api/public_plus_experimental_current.txt
@@ -37,7 +37,7 @@
method public int size();
method public Object![] toArray();
method public <T> T![] toArray(T![]);
- method public E? valueAt(int);
+ method public E! valueAt(int);
}
public final class CircularArray<E> {
diff --git a/collection/collection/api/restricted_1.2.0-alpha01.ignore b/collection/collection/api/restricted_1.2.0-alpha01.ignore
new file mode 100644
index 0000000..7876d30
--- /dev/null
+++ b/collection/collection/api/restricted_1.2.0-alpha01.ignore
@@ -0,0 +1,3 @@
+// Baseline format: 1.0
+InvalidNullConversion: androidx.collection.ArraySet#valueAt(int):
+ Attempted to remove @Nullable annotation from method androidx.collection.ArraySet.valueAt(int)
diff --git a/collection/collection/api/restricted_1.2.0-alpha01.txt b/collection/collection/api/restricted_1.2.0-alpha01.txt
index 7d0bd29..975bc87 100644
--- a/collection/collection/api/restricted_1.2.0-alpha01.txt
+++ b/collection/collection/api/restricted_1.2.0-alpha01.txt
@@ -37,7 +37,7 @@
method public int size();
method public Object![] toArray();
method public <T> T![] toArray(T![]);
- method public E? valueAt(int);
+ method public E! valueAt(int);
}
public final class CircularArray<E> {
diff --git a/collection/collection/api/restricted_current.txt b/collection/collection/api/restricted_current.txt
index 7d0bd29..975bc87 100644
--- a/collection/collection/api/restricted_current.txt
+++ b/collection/collection/api/restricted_current.txt
@@ -37,7 +37,7 @@
method public int size();
method public Object![] toArray();
method public <T> T![] toArray(T![]);
- method public E? valueAt(int);
+ method public E! valueAt(int);
}
public final class CircularArray<E> {
diff --git a/collection/collection/src/main/java/androidx/collection/ArrayMap.java b/collection/collection/src/main/java/androidx/collection/ArrayMap.java
index b3b918c..51401cc 100644
--- a/collection/collection/src/main/java/androidx/collection/ArrayMap.java
+++ b/collection/collection/src/main/java/androidx/collection/ArrayMap.java
@@ -19,8 +19,11 @@
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
+import java.lang.reflect.Array;
import java.util.Collection;
+import java.util.Iterator;
import java.util.Map;
+import java.util.NoSuchElementException;
import java.util.Set;
/**
@@ -51,7 +54,9 @@
* explicit call to set the capacity should turn off this aggressive shrinking behavior.</p>
*/
public class ArrayMap<K, V> extends SimpleArrayMap<K, V> implements Map<K, V> {
- @Nullable MapCollections<K, V> mCollections;
+ @Nullable EntrySet mEntrySet;
+ @Nullable KeySet mKeySet;
+ @Nullable ValueCollection mValues;
public ArrayMap() {
super();
@@ -72,58 +77,6 @@
super(map);
}
- private MapCollections<K, V> getCollection() {
- if (mCollections == null) {
- mCollections = new MapCollections<K, V>() {
- @Override
- protected int colGetSize() {
- return mSize;
- }
-
- @Override
- protected Object colGetEntry(int index, int offset) {
- return mArray[(index<<1) + offset];
- }
-
- @Override
- protected int colIndexOfKey(Object key) {
- return indexOfKey(key);
- }
-
- @Override
- protected int colIndexOfValue(Object value) {
- return indexOfValue(value);
- }
-
- @Override
- protected Map<K, V> colGetMap() {
- return ArrayMap.this;
- }
-
- @Override
- protected void colPut(K key, V value) {
- put(key, value);
- }
-
- @Override
- protected V colSetValue(int index, V value) {
- return setValueAt(index, value);
- }
-
- @Override
- protected void colRemoveAt(int index) {
- removeAt(index);
- }
-
- @Override
- protected void colClear() {
- clear();
- }
- };
- }
- return mCollections;
- }
-
/**
* Determine if the array map contains all of the keys in the given collection.
* @param collection The collection whose contents are to be checked against.
@@ -131,7 +84,12 @@
* in <var>collection</var>, else returns false.
*/
public boolean containsAll(@NonNull Collection<?> collection) {
- return MapCollections.containsAllHelper(this, collection);
+ for (Object o : collection) {
+ if (!containsKey(o)) {
+ return false;
+ }
+ }
+ return true;
}
/**
@@ -152,7 +110,11 @@
* @return Returns true if any keys were removed from the array map, else false.
*/
public boolean removeAll(@NonNull Collection<?> collection) {
- return MapCollections.removeAllHelper(this, collection);
+ int oldSize = mSize;
+ for (Object o : collection) {
+ remove(o);
+ }
+ return oldSize != mSize;
}
/**
@@ -162,7 +124,13 @@
* @return Returns true if any keys were removed from the array map, else false.
*/
public boolean retainAll(@NonNull Collection<?> collection) {
- return MapCollections.retainAllHelper(this, collection);
+ int oldSize = mSize;
+ for (int i = mSize - 1; i >= 0; i--) {
+ if (!collection.contains(keyAt(i))) {
+ removeAt(i);
+ }
+ }
+ return oldSize != mSize;
}
/**
@@ -181,7 +149,11 @@
@NonNull
@Override
public Set<Entry<K, V>> entrySet() {
- return getCollection().getEntrySet();
+ Set<Entry<K, V>> entrySet = mEntrySet;
+ if (entrySet == null) {
+ entrySet = mEntrySet = new EntrySet();
+ }
+ return entrySet;
}
/**
@@ -194,7 +166,11 @@
@NonNull
@Override
public Set<K> keySet() {
- return getCollection().getKeySet();
+ Set<K> keySet = mKeySet;
+ if (keySet == null) {
+ keySet = mKeySet = new KeySet();
+ }
+ return keySet;
}
/**
@@ -207,6 +183,469 @@
@NonNull
@Override
public Collection<V> values() {
- return getCollection().getValues();
+ Collection<V> values = mValues;
+ if (values == null) {
+ values = mValues = new ValueCollection();
+ }
+ return values;
+ }
+
+ final class EntrySet implements Set<Map.Entry<K, V>> {
+ @Override
+ public boolean add(Map.Entry<K, V> object) {
+ // TODO support
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public boolean addAll(Collection<? extends Map.Entry<K, V>> collection) {
+ int oldSize = mSize;
+ for (Map.Entry<K, V> entry : collection) {
+ put(entry.getKey(), entry.getValue());
+ }
+ return oldSize != mSize; // TODO broken heuristic
+ }
+
+ @Override
+ public void clear() {
+ ArrayMap.this.clear();
+ }
+
+ @Override
+ public boolean contains(Object o) {
+ if (!(o instanceof Map.Entry))
+ return false;
+ Map.Entry<?, ?> e = (Map.Entry<?, ?>) o;
+ int index = indexOfKey(e.getKey());
+ if (index < 0) {
+ return false;
+ }
+ V foundVal = valueAt(index);
+ return ContainerHelpers.equal(foundVal, e.getValue());
+ }
+
+ @Override
+ public boolean containsAll(Collection<?> collection) {
+ for (Object o : collection) {
+ if (!contains(o)) {
+ return false;
+ }
+ }
+ return true;
+ }
+
+ @Override
+ public boolean isEmpty() {
+ return ArrayMap.this.isEmpty();
+ }
+
+ @Override
+ public Iterator<Map.Entry<K, V>> iterator() {
+ return new MapIterator();
+ }
+
+ @Override
+ public boolean remove(Object object) {
+ // TODO support
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public boolean removeAll(Collection<?> collection) {
+ // TODO support
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public boolean retainAll(Collection<?> collection) {
+ // TODO support
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public int size() {
+ return mSize;
+ }
+
+ @Override
+ public Object[] toArray() {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public <T> T[] toArray(T[] array) {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public boolean equals(Object object) {
+ return equalsSetHelper(this, object);
+ }
+
+ @Override
+ public int hashCode() {
+ int result = 0;
+ for (int i=mSize-1; i>=0; i--) {
+ K key = keyAt(i);
+ V value = valueAt(i);
+ result += ( (key == null ? 0 : key.hashCode()) ^
+ (value == null ? 0 : value.hashCode()) );
+ }
+ return result;
+ }
+ }
+
+ final class KeySet implements Set<K> {
+ @Override
+ public boolean add(K object) {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public boolean addAll(Collection<? extends K> collection) {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public void clear() {
+ ArrayMap.this.clear();
+ }
+
+ @Override
+ public boolean contains(Object object) {
+ return containsKey(object);
+ }
+
+ @Override
+ public boolean containsAll(Collection<?> collection) {
+ return ArrayMap.this.containsAll(collection);
+ }
+
+ @Override
+ public boolean isEmpty() {
+ return ArrayMap.this.isEmpty();
+ }
+
+ @Override
+ public Iterator<K> iterator() {
+ return new KeyIterator();
+ }
+
+ @Override
+ public boolean remove(Object object) {
+ int index = indexOfKey(object);
+ if (index >= 0) {
+ removeAt(index);
+ return true;
+ }
+ return false;
+ }
+
+ @Override
+ public boolean removeAll(Collection<?> collection) {
+ return ArrayMap.this.removeAll(collection);
+ }
+
+ @Override
+ public boolean retainAll(Collection<?> collection) {
+ return ArrayMap.this.retainAll(collection);
+ }
+
+ @Override
+ public int size() {
+ return mSize;
+ }
+
+ @Override
+ public Object[] toArray() {
+ final int N = mSize;
+ Object[] result = new Object[N];
+ for (int i=0; i<N; i++) {
+ result[i] = keyAt(i);
+ }
+ return result;
+ }
+
+ @Override
+ public <T> T[] toArray(T[] array) {
+ return toArrayHelper(array, 0);
+ }
+
+ @Override
+ public boolean equals(Object object) {
+ return equalsSetHelper(this, object);
+ }
+
+ @Override
+ public int hashCode() {
+ int result = 0;
+ for (int i=mSize-1; i>=0; i--) {
+ K obj = keyAt(i);
+ result += obj == null ? 0 : obj.hashCode();
+ }
+ return result;
+ }
+ }
+
+ final class ValueCollection implements Collection<V> {
+ @Override
+ public boolean add(V object) {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public boolean addAll(Collection<? extends V> collection) {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public void clear() {
+ ArrayMap.this.clear();
+ }
+
+ @Override
+ public boolean contains(Object object) {
+ return indexOfValue(object) >= 0;
+ }
+
+ @Override
+ public boolean containsAll(Collection<?> collection) {
+ for (Object o : collection) {
+ if (!contains(o)) {
+ return false;
+ }
+ }
+ return true;
+ }
+
+ @Override
+ public boolean isEmpty() {
+ return ArrayMap.this.isEmpty();
+ }
+
+ @Override
+ public Iterator<V> iterator() {
+ return new ValueIterator();
+ }
+
+ @Override
+ public boolean remove(Object object) {
+ int index = indexOfValue(object);
+ if (index >= 0) {
+ removeAt(index);
+ return true;
+ }
+ return false;
+ }
+
+ @Override
+ public boolean removeAll(Collection<?> collection) {
+ int N = mSize;
+ boolean changed = false;
+ for (int i=0; i<N; i++) {
+ V cur = valueAt(i);
+ if (collection.contains(cur)) {
+ removeAt(i);
+ i--;
+ N--;
+ changed = true;
+ }
+ }
+ return changed;
+ }
+
+ @Override
+ public boolean retainAll(Collection<?> collection) {
+ int N = mSize;
+ boolean changed = false;
+ for (int i=0; i<N; i++) {
+ V cur = valueAt(i);
+ if (!collection.contains(cur)) {
+ removeAt(i);
+ i--;
+ N--;
+ changed = true;
+ }
+ }
+ return changed;
+ }
+
+ @Override
+ public int size() {
+ return mSize;
+ }
+
+ @Override
+ public Object[] toArray() {
+ final int N = mSize;
+ Object[] result = new Object[N];
+ for (int i=0; i<N; i++) {
+ result[i] = valueAt(i);
+ }
+ return result;
+ }
+
+ @Override
+ public <T> T[] toArray(T[] array) {
+ return toArrayHelper(array, 1);
+ }
+ }
+
+ final class KeyIterator extends IndexBasedArrayIterator<K> {
+ KeyIterator() {
+ super(ArrayMap.this.mSize);
+ }
+
+ @Override
+ protected K elementAt(int index) {
+ return keyAt(index);
+ }
+
+ @Override
+ protected void removeAt(int index) {
+ ArrayMap.this.removeAt(index);
+ }
+ }
+
+ final class ValueIterator extends IndexBasedArrayIterator<V> {
+ ValueIterator() {
+ super(ArrayMap.this.mSize);
+ }
+
+ @Override
+ protected V elementAt(int index) {
+ return valueAt(index);
+ }
+
+ @Override
+ protected void removeAt(int index) {
+ ArrayMap.this.removeAt(index);
+ }
+ }
+
+ final class MapIterator implements Iterator<Map.Entry<K, V>>, Map.Entry<K, V> {
+ int mEnd;
+ int mIndex;
+ boolean mEntryValid;
+
+ MapIterator() {
+ mEnd = mSize - 1;
+ mIndex = -1;
+ }
+
+ @Override
+ public boolean hasNext() {
+ return mIndex < mEnd;
+ }
+
+ @Override
+ public Map.Entry<K, V> next() {
+ if (!hasNext()) throw new NoSuchElementException();
+ mIndex++;
+ mEntryValid = true;
+ return this;
+ }
+
+ @Override
+ public void remove() {
+ if (!mEntryValid) {
+ throw new IllegalStateException();
+ }
+ removeAt(mIndex);
+ mIndex--;
+ mEnd--;
+ mEntryValid = false;
+ }
+
+ @Override
+ public K getKey() {
+ if (!mEntryValid) {
+ throw new IllegalStateException(
+ "This container does not support retaining Map.Entry objects");
+ }
+ return keyAt(mIndex);
+ }
+
+ @Override
+ public V getValue() {
+ if (!mEntryValid) {
+ throw new IllegalStateException(
+ "This container does not support retaining Map.Entry objects");
+ }
+ return valueAt(mIndex);
+ }
+
+ @Override
+ public V setValue(V object) {
+ if (!mEntryValid) {
+ throw new IllegalStateException(
+ "This container does not support retaining Map.Entry objects");
+ }
+ return setValueAt(mIndex, object);
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (!mEntryValid) {
+ throw new IllegalStateException(
+ "This container does not support retaining Map.Entry objects");
+ }
+ if (!(o instanceof Map.Entry)) {
+ return false;
+ }
+ Map.Entry<?, ?> e = (Map.Entry<?, ?>) o;
+ return ContainerHelpers.equal(e.getKey(), keyAt(mIndex))
+ && ContainerHelpers.equal(e.getValue(), valueAt(mIndex));
+ }
+
+ @Override
+ public int hashCode() {
+ if (!mEntryValid) {
+ throw new IllegalStateException(
+ "This container does not support retaining Map.Entry objects");
+ }
+ K key = keyAt(mIndex);
+ V value = valueAt(mIndex);
+ return (key == null ? 0 : key.hashCode()) ^
+ (value == null ? 0 : value.hashCode());
+ }
+
+ @Override
+ public String toString() {
+ return getKey() + "=" + getValue();
+ }
+ }
+
+ @SuppressWarnings("unchecked")
+ <T> T[] toArrayHelper(T[] array, int offset) {
+ final int N = mSize;
+ if (array.length < N) {
+ @SuppressWarnings("unchecked") T[] newArray
+ = (T[]) Array.newInstance(array.getClass().getComponentType(), N);
+ array = newArray;
+ }
+ for (int i=0; i<N; i++) {
+ array[i] = (T) mArray[(i<<1)+offset];
+ }
+ if (array.length > N) {
+ array[N] = null;
+ }
+ return array;
+ }
+
+ static <T> boolean equalsSetHelper(Set<T> set, Object object) {
+ if (set == object) {
+ return true;
+ }
+ if (object instanceof Set) {
+ Set<?> s = (Set<?>) object;
+
+ try {
+ return set.size() == s.size() && set.containsAll(s);
+ } catch (NullPointerException ignored) {
+ } catch (ClassCastException ignored) {
+ }
+ }
+ return false;
}
}
diff --git a/collection/collection/src/main/java/androidx/collection/ArraySet.java b/collection/collection/src/main/java/androidx/collection/ArraySet.java
index 541bd0a..a74e3f9 100644
--- a/collection/collection/src/main/java/androidx/collection/ArraySet.java
+++ b/collection/collection/src/main/java/androidx/collection/ArraySet.java
@@ -23,7 +23,6 @@
import java.util.Collection;
import java.util.ConcurrentModificationException;
import java.util.Iterator;
-import java.util.Map;
import java.util.Set;
/**
@@ -84,7 +83,6 @@
Object[] mArray;
@SuppressWarnings("WeakerAccess") /* synthetic access */
int mSize;
- private MapCollections<E, E> mCollections;
private int binarySearch(int hash) {
try {
@@ -381,7 +379,6 @@
* @param index The desired index, must be between 0 and {@link #size()}-1.
* @return Returns the value stored at the given index.
*/
- @Nullable
@SuppressWarnings("unchecked")
public E valueAt(int index) {
return (E) mArray[index];
@@ -690,74 +687,32 @@
return buffer.toString();
}
- // ------------------------------------------------------------------------
- // Interop with traditional Java containers. Not as efficient as using
- // specialized collection APIs.
- // ------------------------------------------------------------------------
-
- private MapCollections<E, E> getCollection() {
- if (mCollections == null) {
- mCollections = new MapCollections<E, E>() {
- @Override
- protected int colGetSize() {
- return mSize;
- }
-
- @Override
- protected Object colGetEntry(int index, int offset) {
- return mArray[index];
- }
-
- @Override
- protected int colIndexOfKey(Object key) {
- throw new UnsupportedOperationException();
- }
-
- @Override
- protected int colIndexOfValue(Object value) {
- throw new UnsupportedOperationException();
- }
-
- @Override
- protected Map<E, E> colGetMap() {
- throw new UnsupportedOperationException();
- }
-
- @Override
- protected void colPut(E key, E value) {
- throw new UnsupportedOperationException();
- }
-
- @Override
- protected E colSetValue(int index, E value) {
- throw new UnsupportedOperationException();
- }
-
- @Override
- protected void colRemoveAt(int index) {
- removeAt(index);
- }
-
- @Override
- protected void colClear() {
- throw new UnsupportedOperationException();
- }
- };
- }
- return mCollections;
- }
-
/**
* Return an {@link java.util.Iterator} over all values in the set.
*
- * <p><b>Note:</b> this is a fairly inefficient way to access the array contents, it
- * requires generating a number of temporary objects and allocates additional state
- * information associated with the container that will remain for the life of the container.</p>
+ * <p><b>Note:</b> this is aless efficient way to access the array contents compared to
+ * looping from 0 until {@link #size()} and calling {@link #valueAt(int)}.
*/
@NonNull
@Override
public Iterator<E> iterator() {
- return getCollection().new ArrayIterator<>(0);
+ return new ElementIterator();
+ }
+
+ private class ElementIterator extends IndexBasedArrayIterator<E> {
+ ElementIterator() {
+ super(mSize);
+ }
+
+ @Override
+ protected E elementAt(int index) {
+ return valueAt(index);
+ }
+
+ @Override
+ protected void removeAt(int index) {
+ ArraySet.this.removeAt(index);
+ }
}
/**
diff --git a/collection/collection/src/main/java/androidx/collection/IndexBasedArrayIterator.java b/collection/collection/src/main/java/androidx/collection/IndexBasedArrayIterator.java
new file mode 100644
index 0000000..9b10713
--- /dev/null
+++ b/collection/collection/src/main/java/androidx/collection/IndexBasedArrayIterator.java
@@ -0,0 +1,58 @@
+/*
+ * Copyright 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT 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.collection;
+
+import java.util.Iterator;
+import java.util.NoSuchElementException;
+
+abstract class IndexBasedArrayIterator<T> implements Iterator<T> {
+ private int mSize;
+ private int mIndex;
+ private boolean mCanRemove;
+
+ IndexBasedArrayIterator(int startingSize) {
+ mSize = startingSize;
+ }
+
+ protected abstract T elementAt(int index);
+ protected abstract void removeAt(int index);
+
+ @Override
+ public final boolean hasNext() {
+ return mIndex < mSize;
+ }
+
+ @Override
+ public T next() {
+ if (!hasNext()) throw new NoSuchElementException();
+ T res = elementAt(mIndex);
+ mIndex++;
+ mCanRemove = true;
+ return res;
+ }
+
+ @Override
+ public void remove() {
+ if (!mCanRemove) {
+ throw new IllegalStateException();
+ }
+ // Attempt removal first so an UnsupportedOperationException retains a valid state.
+ removeAt(mIndex--);
+ mSize--;
+ mCanRemove = false;
+ }
+}
diff --git a/collection/collection/src/main/java/androidx/collection/MapCollections.java b/collection/collection/src/main/java/androidx/collection/MapCollections.java
deleted file mode 100644
index ff74d7c..0000000
--- a/collection/collection/src/main/java/androidx/collection/MapCollections.java
+++ /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.collection;
-
-import androidx.annotation.Nullable;
-
-import java.lang.reflect.Array;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.NoSuchElementException;
-import java.util.Set;
-
-/**
- * Helper for writing standard Java collection interfaces to a data
- * structure like {@link ArrayMap}.
- */
-abstract class MapCollections<K, V> {
- @Nullable EntrySet mEntrySet;
- @Nullable KeySet mKeySet;
- @Nullable ValuesCollection mValues;
-
- final class ArrayIterator<T> implements Iterator<T> {
- final int mOffset;
- int mSize;
- int mIndex;
- boolean mCanRemove = false;
-
- ArrayIterator(int offset) {
- mOffset = offset;
- mSize = colGetSize();
- }
-
- @Override
- public boolean hasNext() {
- return mIndex < mSize;
- }
-
- @Override
- @SuppressWarnings("unchecked")
- public T next() {
- if (!hasNext()) throw new NoSuchElementException();
- Object res = colGetEntry(mIndex, mOffset);
- mIndex++;
- mCanRemove = true;
- return (T)res;
- }
-
- @Override
- public void remove() {
- if (!mCanRemove) {
- throw new IllegalStateException();
- }
- mIndex--;
- mSize--;
- mCanRemove = false;
- colRemoveAt(mIndex);
- }
- }
-
- final class MapIterator implements Iterator<Map.Entry<K, V>>, Map.Entry<K, V> {
- int mEnd;
- int mIndex;
- boolean mEntryValid = false;
-
- MapIterator() {
- mEnd = colGetSize() - 1;
- mIndex = -1;
- }
-
- @Override
- public boolean hasNext() {
- return mIndex < mEnd;
- }
-
- @Override
- public Map.Entry<K, V> next() {
- if (!hasNext()) throw new NoSuchElementException();
- mIndex++;
- mEntryValid = true;
- return this;
- }
-
- @Override
- public void remove() {
- if (!mEntryValid) {
- throw new IllegalStateException();
- }
- colRemoveAt(mIndex);
- mIndex--;
- mEnd--;
- mEntryValid = false;
- }
-
- @Override
- @SuppressWarnings("unchecked")
- public K getKey() {
- if (!mEntryValid) {
- throw new IllegalStateException(
- "This container does not support retaining Map.Entry objects");
- }
- return (K)colGetEntry(mIndex, 0);
- }
-
- @Override
- @SuppressWarnings("unchecked")
- public V getValue() {
- if (!mEntryValid) {
- throw new IllegalStateException(
- "This container does not support retaining Map.Entry objects");
- }
- return (V)colGetEntry(mIndex, 1);
- }
-
- @Override
- public V setValue(V object) {
- if (!mEntryValid) {
- throw new IllegalStateException(
- "This container does not support retaining Map.Entry objects");
- }
- return colSetValue(mIndex, object);
- }
-
- @Override
- public boolean equals(Object o) {
- if (!mEntryValid) {
- throw new IllegalStateException(
- "This container does not support retaining Map.Entry objects");
- }
- if (!(o instanceof Map.Entry)) {
- return false;
- }
- Map.Entry<?, ?> e = (Map.Entry<?, ?>) o;
- return ContainerHelpers.equal(e.getKey(), colGetEntry(mIndex, 0))
- && ContainerHelpers.equal(e.getValue(), colGetEntry(mIndex, 1));
- }
-
- @Override
- public int hashCode() {
- if (!mEntryValid) {
- throw new IllegalStateException(
- "This container does not support retaining Map.Entry objects");
- }
- final Object key = colGetEntry(mIndex, 0);
- final Object value = colGetEntry(mIndex, 1);
- return (key == null ? 0 : key.hashCode()) ^
- (value == null ? 0 : value.hashCode());
- }
-
- @Override
- public String toString() {
- return getKey() + "=" + getValue();
- }
- }
-
- final class EntrySet implements Set<Map.Entry<K, V>> {
- @Override
- public boolean add(Map.Entry<K, V> object) {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public boolean addAll(Collection<? extends Map.Entry<K, V>> collection) {
- int oldSize = colGetSize();
- for (Map.Entry<K, V> entry : collection) {
- colPut(entry.getKey(), entry.getValue());
- }
- return oldSize != colGetSize();
- }
-
- @Override
- public void clear() {
- colClear();
- }
-
- @Override
- public boolean contains(Object o) {
- if (!(o instanceof Map.Entry))
- return false;
- Map.Entry<?, ?> e = (Map.Entry<?, ?>) o;
- int index = colIndexOfKey(e.getKey());
- if (index < 0) {
- return false;
- }
- Object foundVal = colGetEntry(index, 1);
- return ContainerHelpers.equal(foundVal, e.getValue());
- }
-
- @Override
- public boolean containsAll(Collection<?> collection) {
- Iterator<?> it = collection.iterator();
- while (it.hasNext()) {
- if (!contains(it.next())) {
- return false;
- }
- }
- return true;
- }
-
- @Override
- public boolean isEmpty() {
- return colGetSize() == 0;
- }
-
- @Override
- public Iterator<Map.Entry<K, V>> iterator() {
- return new MapIterator();
- }
-
- @Override
- public boolean remove(Object object) {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public boolean removeAll(Collection<?> collection) {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public boolean retainAll(Collection<?> collection) {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public int size() {
- return colGetSize();
- }
-
- @Override
- public Object[] toArray() {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public <T> T[] toArray(T[] array) {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public boolean equals(Object object) {
- return equalsSetHelper(this, object);
- }
-
- @Override
- public int hashCode() {
- int result = 0;
- for (int i=colGetSize()-1; i>=0; i--) {
- final Object key = colGetEntry(i, 0);
- final Object value = colGetEntry(i, 1);
- result += ( (key == null ? 0 : key.hashCode()) ^
- (value == null ? 0 : value.hashCode()) );
- }
- return result;
- }
- };
-
- final class KeySet implements Set<K> {
-
- @Override
- public boolean add(K object) {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public boolean addAll(Collection<? extends K> collection) {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public void clear() {
- colClear();
- }
-
- @Override
- public boolean contains(Object object) {
- return colIndexOfKey(object) >= 0;
- }
-
- @Override
- public boolean containsAll(Collection<?> collection) {
- return containsAllHelper(colGetMap(), collection);
- }
-
- @Override
- public boolean isEmpty() {
- return colGetSize() == 0;
- }
-
- @Override
- public Iterator<K> iterator() {
- return new ArrayIterator<K>(0);
- }
-
- @Override
- public boolean remove(Object object) {
- int index = colIndexOfKey(object);
- if (index >= 0) {
- colRemoveAt(index);
- return true;
- }
- return false;
- }
-
- @Override
- public boolean removeAll(Collection<?> collection) {
- return removeAllHelper(colGetMap(), collection);
- }
-
- @Override
- public boolean retainAll(Collection<?> collection) {
- return retainAllHelper(colGetMap(), collection);
- }
-
- @Override
- public int size() {
- return colGetSize();
- }
-
- @Override
- public Object[] toArray() {
- return toArrayHelper(0);
- }
-
- @Override
- public <T> T[] toArray(T[] array) {
- return toArrayHelper(array, 0);
- }
-
- @Override
- public boolean equals(Object object) {
- return equalsSetHelper(this, object);
- }
-
- @Override
- public int hashCode() {
- int result = 0;
- for (int i=colGetSize()-1; i>=0; i--) {
- Object obj = colGetEntry(i, 0);
- result += obj == null ? 0 : obj.hashCode();
- }
- return result;
- }
- };
-
- final class ValuesCollection implements Collection<V> {
-
- @Override
- public boolean add(V object) {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public boolean addAll(Collection<? extends V> collection) {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public void clear() {
- colClear();
- }
-
- @Override
- public boolean contains(Object object) {
- return colIndexOfValue(object) >= 0;
- }
-
- @Override
- public boolean containsAll(Collection<?> collection) {
- Iterator<?> it = collection.iterator();
- while (it.hasNext()) {
- if (!contains(it.next())) {
- return false;
- }
- }
- return true;
- }
-
- @Override
- public boolean isEmpty() {
- return colGetSize() == 0;
- }
-
- @Override
- public Iterator<V> iterator() {
- return new ArrayIterator<V>(1);
- }
-
- @Override
- public boolean remove(Object object) {
- int index = colIndexOfValue(object);
- if (index >= 0) {
- colRemoveAt(index);
- return true;
- }
- return false;
- }
-
- @Override
- public boolean removeAll(Collection<?> collection) {
- int N = colGetSize();
- boolean changed = false;
- for (int i=0; i<N; i++) {
- Object cur = colGetEntry(i, 1);
- if (collection.contains(cur)) {
- colRemoveAt(i);
- i--;
- N--;
- changed = true;
- }
- }
- return changed;
- }
-
- @Override
- public boolean retainAll(Collection<?> collection) {
- int N = colGetSize();
- boolean changed = false;
- for (int i=0; i<N; i++) {
- Object cur = colGetEntry(i, 1);
- if (!collection.contains(cur)) {
- colRemoveAt(i);
- i--;
- N--;
- changed = true;
- }
- }
- return changed;
- }
-
- @Override
- public int size() {
- return colGetSize();
- }
-
- @Override
- public Object[] toArray() {
- return toArrayHelper(1);
- }
-
- @Override
- public <T> T[] toArray(T[] array) {
- return toArrayHelper(array, 1);
- }
- };
-
- public static <K, V> boolean containsAllHelper(Map<K, V> map, Collection<?> collection) {
- Iterator<?> it = collection.iterator();
- while (it.hasNext()) {
- if (!map.containsKey(it.next())) {
- return false;
- }
- }
- return true;
- }
-
- public static <K, V> boolean removeAllHelper(Map<K, V> map, Collection<?> collection) {
- int oldSize = map.size();
- Iterator<?> it = collection.iterator();
- while (it.hasNext()) {
- map.remove(it.next());
- }
- return oldSize != map.size();
- }
-
- public static <K, V> boolean retainAllHelper(Map<K, V> map, Collection<?> collection) {
- int oldSize = map.size();
- Iterator<K> it = map.keySet().iterator();
- while (it.hasNext()) {
- if (!collection.contains(it.next())) {
- it.remove();
- }
- }
- return oldSize != map.size();
- }
-
-
- public Object[] toArrayHelper(int offset) {
- final int N = colGetSize();
- Object[] result = new Object[N];
- for (int i=0; i<N; i++) {
- result[i] = colGetEntry(i, offset);
- }
- return result;
- }
-
- @SuppressWarnings("unchecked")
- public <T> T[] toArrayHelper(T[] array, int offset) {
- final int N = colGetSize();
- if (array.length < N) {
- @SuppressWarnings("unchecked") T[] newArray
- = (T[]) Array.newInstance(array.getClass().getComponentType(), N);
- array = newArray;
- }
- for (int i=0; i<N; i++) {
- array[i] = (T)colGetEntry(i, offset);
- }
- if (array.length > N) {
- array[N] = null;
- }
- return array;
- }
-
- public static <T> boolean equalsSetHelper(Set<T> set, Object object) {
- if (set == object) {
- return true;
- }
- if (object instanceof Set) {
- Set<?> s = (Set<?>) object;
-
- try {
- return set.size() == s.size() && set.containsAll(s);
- } catch (NullPointerException ignored) {
- return false;
- } catch (ClassCastException ignored) {
- return false;
- }
- }
- return false;
- }
-
- public Set<Map.Entry<K, V>> getEntrySet() {
- if (mEntrySet == null) {
- mEntrySet = new EntrySet();
- }
- return mEntrySet;
- }
-
- public Set<K> getKeySet() {
- if (mKeySet == null) {
- mKeySet = new KeySet();
- }
- return mKeySet;
- }
-
- public Collection<V> getValues() {
- if (mValues == null) {
- mValues = new ValuesCollection();
- }
- return mValues;
- }
-
- protected abstract int colGetSize();
- protected abstract Object colGetEntry(int index, int offset);
- protected abstract int colIndexOfKey(Object key);
- protected abstract int colIndexOfValue(Object key);
- protected abstract Map<K, V> colGetMap();
- protected abstract void colPut(K key, V value);
- protected abstract V colSetValue(int index, V value);
- protected abstract void colRemoveAt(int index);
- protected abstract void colClear();
-}
diff --git a/collection/collection/src/main/java/androidx/collection/SimpleArrayMap.java b/collection/collection/src/main/java/androidx/collection/SimpleArrayMap.java
index 94824d6..c8e5dc7 100644
--- a/collection/collection/src/main/java/androidx/collection/SimpleArrayMap.java
+++ b/collection/collection/src/main/java/androidx/collection/SimpleArrayMap.java
@@ -683,13 +683,33 @@
if (this == object) {
return true;
}
- if (object instanceof SimpleArrayMap) {
- SimpleArrayMap<?, ?> map = (SimpleArrayMap<?, ?>) object;
- if (size() != map.size()) {
- return false;
- }
+ try {
+ if (object instanceof SimpleArrayMap) {
+ SimpleArrayMap<?, ?> map = (SimpleArrayMap<?, ?>) object;
+ if (size() != map.size()) {
+ return false;
+ }
- try {
+ for (int i=0; i<mSize; i++) {
+ K key = keyAt(i);
+ V mine = valueAt(i);
+ // TODO use index-based ops for this
+ Object theirs = map.get(key);
+ if (mine == null) {
+ if (theirs != null || !map.containsKey(key)) {
+ return false;
+ }
+ } else if (!mine.equals(theirs)) {
+ return false;
+ }
+ }
+ return true;
+ } else if (object instanceof Map) {
+ Map<?, ?> map = (Map<?, ?>) object;
+ if (size() != map.size()) {
+ return false;
+ }
+
for (int i=0; i<mSize; i++) {
K key = keyAt(i);
V mine = valueAt(i);
@@ -702,37 +722,10 @@
return false;
}
}
- } catch (NullPointerException ignored) {
- return false;
- } catch (ClassCastException ignored) {
- return false;
+ return true;
}
- return true;
- } else if (object instanceof Map) {
- Map<?, ?> map = (Map<?, ?>) object;
- if (size() != map.size()) {
- return false;
- }
-
- try {
- for (int i=0; i<mSize; i++) {
- K key = keyAt(i);
- V mine = valueAt(i);
- Object theirs = map.get(key);
- if (mine == null) {
- if (theirs != null || !map.containsKey(key)) {
- return false;
- }
- } else if (!mine.equals(theirs)) {
- return false;
- }
- }
- } catch (NullPointerException ignored) {
- return false;
- } catch (ClassCastException ignored) {
- return false;
- }
- return true;
+ } catch (NullPointerException ignored) {
+ } catch (ClassCastException ignored) {
}
return false;
}
diff --git a/collection/collection/src/test/java/androidx/collection/SimpleArrayMapTest.java b/collection/collection/src/test/java/androidx/collection/SimpleArrayMapTest.java
index 8faca32..66f5ea9 100644
--- a/collection/collection/src/test/java/androidx/collection/SimpleArrayMapTest.java
+++ b/collection/collection/src/test/java/androidx/collection/SimpleArrayMapTest.java
@@ -26,13 +26,59 @@
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;
+import java.util.Collections;
import java.util.ConcurrentModificationException;
+import java.util.HashMap;
import java.util.Locale;
import java.util.concurrent.atomic.AtomicBoolean;
@RunWith(JUnit4.class)
public class SimpleArrayMapTest {
@Test
+ @SuppressWarnings({"SimplifiableJUnitAssertion", "EqualsWithItself",
+ "EqualsBetweenInconvertibleTypes"})
+ public void equalsEmpty() {
+ SimpleArrayMap<String, String> empty = new SimpleArrayMap<>();
+
+ assertTrue(empty.equals(empty));
+ assertTrue(empty.equals(Collections.emptyMap()));
+ assertTrue(empty.equals(new SimpleArrayMap<String, String>()));
+ assertTrue(empty.equals(new HashMap<String, String>()));
+
+ assertFalse(empty.equals(Collections.singletonMap("foo", "bar")));
+
+ SimpleArrayMap<String, String> simpleArrayMapNotEmpty = new SimpleArrayMap<>();
+ simpleArrayMapNotEmpty.put("foo", "bar");
+ assertFalse(empty.equals(simpleArrayMapNotEmpty));
+
+ HashMap<String, String> hashMapNotEquals = new HashMap<>();
+ hashMapNotEquals.put("foo", "bar");
+ assertFalse(empty.equals(hashMapNotEquals));
+ }
+
+ @Test
+ @SuppressWarnings({"SimplifiableJUnitAssertion", "EqualsWithItself",
+ "EqualsBetweenInconvertibleTypes"})
+ public void equalsNonEmpty() {
+ SimpleArrayMap<String, String> map = new SimpleArrayMap<>();
+ map.put("foo", "bar");
+
+ assertTrue(map.equals(map));
+ assertTrue(map.equals(Collections.singletonMap("foo", "bar")));
+
+ SimpleArrayMap<String, String> otherSimpleArrayMap = new SimpleArrayMap<>();
+ otherSimpleArrayMap.put("foo", "bar");
+
+ HashMap<String, String> otherHashMap = new HashMap<>();
+ otherHashMap.put("foo", "bar");
+ assertTrue(map.equals(otherHashMap));
+
+ assertFalse(map.equals(Collections.emptyMap()));
+ assertFalse(map.equals(new SimpleArrayMap<String, String>()));
+ assertFalse(map.equals(new HashMap<String, String>()));
+ }
+
+ @Test
public void getOrDefaultPrefersStoredValue() {
SimpleArrayMap<String, String> map = new SimpleArrayMap<>();
map.put("one", "1");
diff --git a/compose/compose-runtime/api/0.1.0-dev11.txt b/compose/compose-runtime/api/0.1.0-dev11.txt
index ed6342d..478441a 100644
--- a/compose/compose-runtime/api/0.1.0-dev11.txt
+++ b/compose/compose-runtime/api/0.1.0-dev11.txt
@@ -45,6 +45,9 @@
method public void start(N?, N? instance);
}
+ public final class BitwiseOperatorsKt {
+ }
+
public final class BuildableMap<K, V> implements kotlin.jvm.internal.markers.KMappedMarker java.util.Map<K,V> {
ctor public BuildableMap(kotlinx.collections.immutable.PersistentMap<K,? extends V> map);
method public kotlinx.collections.immutable.PersistentMap<K,V> component1();
@@ -130,9 +133,9 @@
method public androidx.compose.Composer<N> getComposer();
method public T! getNode();
method public inline void set(int value, kotlin.jvm.functions.Function2<? super T,? super java.lang.Integer,kotlin.Unit> block);
- method public inline <reified V> void set(V? value, kotlin.jvm.functions.Function2<? super T,? super V,kotlin.Unit> block);
+ method public inline <reified V> void set(V? value, kotlin.jvm.functions.Function2<? super T,? super V,? extends kotlin.Unit> block);
method public inline void update(int value, kotlin.jvm.functions.Function2<? super T,? super java.lang.Integer,kotlin.Unit> block);
- method public inline <reified V> void update(V? value, kotlin.jvm.functions.Function2<? super T,? super V,kotlin.Unit> block);
+ method public inline <reified V> void update(V? value, kotlin.jvm.functions.Function2<? super T,? super V,? extends kotlin.Unit> block);
}
public interface ComposerValidator {
@@ -207,7 +210,6 @@
}
public final class KeyInfo {
- ctor public KeyInfo(Object key, int location, int nodes, int index);
method public int getIndex();
method public Object getKey();
method public int getLocation();
@@ -243,8 +245,8 @@
method public static inline operator <T> void setValue(androidx.compose.MutableState<T>, Object? thisObj, kotlin.reflect.KProperty<?> property, T? value);
method @androidx.compose.Composable public static inline <T> androidx.compose.MutableState<T> state(kotlin.jvm.functions.Function2<? super T,? super T,java.lang.Boolean> areEquivalent = ReferentiallyEqual, kotlin.jvm.functions.Function0<? extends T> init);
method @androidx.compose.Composable public static inline <T, V1> androidx.compose.MutableState<T> stateFor(V1? v1, kotlin.jvm.functions.Function0<? extends T> init);
- method @androidx.compose.Composable public static inline <T, reified V1, reified V2> androidx.compose.MutableState<T> stateFor(V1? v1, V2? v2, kotlin.jvm.functions.Function0<? extends T> init);
method @androidx.compose.Composable public static inline <T> androidx.compose.MutableState<T> stateFor(Object![]? inputs, kotlin.jvm.functions.Function0<? extends T> init);
+ method @androidx.compose.Composable public static inline <T, reified V1, reified V2> androidx.compose.MutableState<T>! stateFor(V1? v1, V2? v2, kotlin.jvm.functions.Function0<? extends T> init);
}
public final class NullCompilationScope {
@@ -324,8 +326,10 @@
method public Object? get(int index);
method public int getCurrent();
method public int getCurrentEnd();
+ method public Object! getGroupData();
method public int getGroupEnd();
method public Object! getGroupKey();
+ method public Object! getGroupNode();
method public int getGroupSize();
method public boolean getInEmpty();
method public int getNodeIndex();
@@ -350,8 +354,10 @@
method public void startNode(Object key);
property public final int current;
property public final int currentEnd;
+ property public final Object! groupData;
property public final int groupEnd;
property public final Object! groupKey;
+ property public final Object! groupNode;
property public final int groupSize;
property public final boolean inEmpty;
property public final boolean isGroup;
@@ -389,6 +395,7 @@
method public androidx.compose.Anchor anchor(int index = current);
method public void beginInsert();
method public void close();
+ method public int endData();
method public int endGroup();
method public void endInsert();
method public int endNode();
@@ -419,9 +426,12 @@
method public int skipGroup();
method public int skipNode();
method public void skipToGroupEnd();
+ method public void startData(Object key, Object? data);
method public void startGroup(Object key);
method public void startNode(Object key);
+ method public void startNode(Object key, Object? node);
method public Object? update(Object? value);
+ method public void updateData(Object? value);
property public final boolean closed;
property public final int current;
property public final int groupSize;
diff --git a/compose/compose-runtime/api/api_lint.ignore b/compose/compose-runtime/api/api_lint.ignore
index b197564..96ccb31 100644
--- a/compose/compose-runtime/api/api_lint.ignore
+++ b/compose/compose-runtime/api/api_lint.ignore
@@ -39,7 +39,7 @@
Exceptions must be named `FooException`, was `FrameAborted`
-KotlinOperator: androidx.compose.ComposerUpdater#set(V, kotlin.jvm.functions.Function2<? super T,? super V,kotlin.Unit>):
+KotlinOperator: androidx.compose.ComposerUpdater#set(V, kotlin.jvm.functions.Function2<? super T,? super V,? extends kotlin.Unit>):
Note that adding the `operator` keyword would allow calling this method using operator syntax
KotlinOperator: androidx.compose.ComposerUpdater#set(int, kotlin.jvm.functions.Function2<? super T,? super java.lang.Integer,kotlin.Unit>):
Note that adding the `operator` keyword would allow calling this method using operator syntax
@@ -59,5 +59,11 @@
Missing nullability on parameter `value` in method `containsValue`
MissingNullability: androidx.compose.BuildableMap#get(Object) parameter #0:
Missing nullability on parameter `key` in method `get`
+MissingNullability: androidx.compose.MutableStateKt#stateFor(V1, V2, kotlin.jvm.functions.Function0<? extends T>):
+ Missing nullability on method `stateFor` return
+MissingNullability: androidx.compose.SlotReader#getGroupData():
+ Missing nullability on method `getGroupData` return
MissingNullability: androidx.compose.SlotReader#getGroupKey():
Missing nullability on method `getGroupKey` return
+MissingNullability: androidx.compose.SlotReader#getGroupNode():
+ Missing nullability on method `getGroupNode` return
diff --git a/compose/compose-runtime/api/current.txt b/compose/compose-runtime/api/current.txt
index ed6342d..478441a 100644
--- a/compose/compose-runtime/api/current.txt
+++ b/compose/compose-runtime/api/current.txt
@@ -45,6 +45,9 @@
method public void start(N?, N? instance);
}
+ public final class BitwiseOperatorsKt {
+ }
+
public final class BuildableMap<K, V> implements kotlin.jvm.internal.markers.KMappedMarker java.util.Map<K,V> {
ctor public BuildableMap(kotlinx.collections.immutable.PersistentMap<K,? extends V> map);
method public kotlinx.collections.immutable.PersistentMap<K,V> component1();
@@ -130,9 +133,9 @@
method public androidx.compose.Composer<N> getComposer();
method public T! getNode();
method public inline void set(int value, kotlin.jvm.functions.Function2<? super T,? super java.lang.Integer,kotlin.Unit> block);
- method public inline <reified V> void set(V? value, kotlin.jvm.functions.Function2<? super T,? super V,kotlin.Unit> block);
+ method public inline <reified V> void set(V? value, kotlin.jvm.functions.Function2<? super T,? super V,? extends kotlin.Unit> block);
method public inline void update(int value, kotlin.jvm.functions.Function2<? super T,? super java.lang.Integer,kotlin.Unit> block);
- method public inline <reified V> void update(V? value, kotlin.jvm.functions.Function2<? super T,? super V,kotlin.Unit> block);
+ method public inline <reified V> void update(V? value, kotlin.jvm.functions.Function2<? super T,? super V,? extends kotlin.Unit> block);
}
public interface ComposerValidator {
@@ -207,7 +210,6 @@
}
public final class KeyInfo {
- ctor public KeyInfo(Object key, int location, int nodes, int index);
method public int getIndex();
method public Object getKey();
method public int getLocation();
@@ -243,8 +245,8 @@
method public static inline operator <T> void setValue(androidx.compose.MutableState<T>, Object? thisObj, kotlin.reflect.KProperty<?> property, T? value);
method @androidx.compose.Composable public static inline <T> androidx.compose.MutableState<T> state(kotlin.jvm.functions.Function2<? super T,? super T,java.lang.Boolean> areEquivalent = ReferentiallyEqual, kotlin.jvm.functions.Function0<? extends T> init);
method @androidx.compose.Composable public static inline <T, V1> androidx.compose.MutableState<T> stateFor(V1? v1, kotlin.jvm.functions.Function0<? extends T> init);
- method @androidx.compose.Composable public static inline <T, reified V1, reified V2> androidx.compose.MutableState<T> stateFor(V1? v1, V2? v2, kotlin.jvm.functions.Function0<? extends T> init);
method @androidx.compose.Composable public static inline <T> androidx.compose.MutableState<T> stateFor(Object![]? inputs, kotlin.jvm.functions.Function0<? extends T> init);
+ method @androidx.compose.Composable public static inline <T, reified V1, reified V2> androidx.compose.MutableState<T>! stateFor(V1? v1, V2? v2, kotlin.jvm.functions.Function0<? extends T> init);
}
public final class NullCompilationScope {
@@ -324,8 +326,10 @@
method public Object? get(int index);
method public int getCurrent();
method public int getCurrentEnd();
+ method public Object! getGroupData();
method public int getGroupEnd();
method public Object! getGroupKey();
+ method public Object! getGroupNode();
method public int getGroupSize();
method public boolean getInEmpty();
method public int getNodeIndex();
@@ -350,8 +354,10 @@
method public void startNode(Object key);
property public final int current;
property public final int currentEnd;
+ property public final Object! groupData;
property public final int groupEnd;
property public final Object! groupKey;
+ property public final Object! groupNode;
property public final int groupSize;
property public final boolean inEmpty;
property public final boolean isGroup;
@@ -389,6 +395,7 @@
method public androidx.compose.Anchor anchor(int index = current);
method public void beginInsert();
method public void close();
+ method public int endData();
method public int endGroup();
method public void endInsert();
method public int endNode();
@@ -419,9 +426,12 @@
method public int skipGroup();
method public int skipNode();
method public void skipToGroupEnd();
+ method public void startData(Object key, Object? data);
method public void startGroup(Object key);
method public void startNode(Object key);
+ method public void startNode(Object key, Object? node);
method public Object? update(Object? value);
+ method public void updateData(Object? value);
property public final boolean closed;
property public final int current;
property public final int groupSize;
diff --git a/compose/compose-runtime/api/public_plus_experimental_0.1.0-dev11.txt b/compose/compose-runtime/api/public_plus_experimental_0.1.0-dev11.txt
index ed6342d..478441a 100644
--- a/compose/compose-runtime/api/public_plus_experimental_0.1.0-dev11.txt
+++ b/compose/compose-runtime/api/public_plus_experimental_0.1.0-dev11.txt
@@ -45,6 +45,9 @@
method public void start(N?, N? instance);
}
+ public final class BitwiseOperatorsKt {
+ }
+
public final class BuildableMap<K, V> implements kotlin.jvm.internal.markers.KMappedMarker java.util.Map<K,V> {
ctor public BuildableMap(kotlinx.collections.immutable.PersistentMap<K,? extends V> map);
method public kotlinx.collections.immutable.PersistentMap<K,V> component1();
@@ -130,9 +133,9 @@
method public androidx.compose.Composer<N> getComposer();
method public T! getNode();
method public inline void set(int value, kotlin.jvm.functions.Function2<? super T,? super java.lang.Integer,kotlin.Unit> block);
- method public inline <reified V> void set(V? value, kotlin.jvm.functions.Function2<? super T,? super V,kotlin.Unit> block);
+ method public inline <reified V> void set(V? value, kotlin.jvm.functions.Function2<? super T,? super V,? extends kotlin.Unit> block);
method public inline void update(int value, kotlin.jvm.functions.Function2<? super T,? super java.lang.Integer,kotlin.Unit> block);
- method public inline <reified V> void update(V? value, kotlin.jvm.functions.Function2<? super T,? super V,kotlin.Unit> block);
+ method public inline <reified V> void update(V? value, kotlin.jvm.functions.Function2<? super T,? super V,? extends kotlin.Unit> block);
}
public interface ComposerValidator {
@@ -207,7 +210,6 @@
}
public final class KeyInfo {
- ctor public KeyInfo(Object key, int location, int nodes, int index);
method public int getIndex();
method public Object getKey();
method public int getLocation();
@@ -243,8 +245,8 @@
method public static inline operator <T> void setValue(androidx.compose.MutableState<T>, Object? thisObj, kotlin.reflect.KProperty<?> property, T? value);
method @androidx.compose.Composable public static inline <T> androidx.compose.MutableState<T> state(kotlin.jvm.functions.Function2<? super T,? super T,java.lang.Boolean> areEquivalent = ReferentiallyEqual, kotlin.jvm.functions.Function0<? extends T> init);
method @androidx.compose.Composable public static inline <T, V1> androidx.compose.MutableState<T> stateFor(V1? v1, kotlin.jvm.functions.Function0<? extends T> init);
- method @androidx.compose.Composable public static inline <T, reified V1, reified V2> androidx.compose.MutableState<T> stateFor(V1? v1, V2? v2, kotlin.jvm.functions.Function0<? extends T> init);
method @androidx.compose.Composable public static inline <T> androidx.compose.MutableState<T> stateFor(Object![]? inputs, kotlin.jvm.functions.Function0<? extends T> init);
+ method @androidx.compose.Composable public static inline <T, reified V1, reified V2> androidx.compose.MutableState<T>! stateFor(V1? v1, V2? v2, kotlin.jvm.functions.Function0<? extends T> init);
}
public final class NullCompilationScope {
@@ -324,8 +326,10 @@
method public Object? get(int index);
method public int getCurrent();
method public int getCurrentEnd();
+ method public Object! getGroupData();
method public int getGroupEnd();
method public Object! getGroupKey();
+ method public Object! getGroupNode();
method public int getGroupSize();
method public boolean getInEmpty();
method public int getNodeIndex();
@@ -350,8 +354,10 @@
method public void startNode(Object key);
property public final int current;
property public final int currentEnd;
+ property public final Object! groupData;
property public final int groupEnd;
property public final Object! groupKey;
+ property public final Object! groupNode;
property public final int groupSize;
property public final boolean inEmpty;
property public final boolean isGroup;
@@ -389,6 +395,7 @@
method public androidx.compose.Anchor anchor(int index = current);
method public void beginInsert();
method public void close();
+ method public int endData();
method public int endGroup();
method public void endInsert();
method public int endNode();
@@ -419,9 +426,12 @@
method public int skipGroup();
method public int skipNode();
method public void skipToGroupEnd();
+ method public void startData(Object key, Object? data);
method public void startGroup(Object key);
method public void startNode(Object key);
+ method public void startNode(Object key, Object? node);
method public Object? update(Object? value);
+ method public void updateData(Object? value);
property public final boolean closed;
property public final int current;
property public final int groupSize;
diff --git a/compose/compose-runtime/api/public_plus_experimental_current.txt b/compose/compose-runtime/api/public_plus_experimental_current.txt
index ed6342d..478441a 100644
--- a/compose/compose-runtime/api/public_plus_experimental_current.txt
+++ b/compose/compose-runtime/api/public_plus_experimental_current.txt
@@ -45,6 +45,9 @@
method public void start(N?, N? instance);
}
+ public final class BitwiseOperatorsKt {
+ }
+
public final class BuildableMap<K, V> implements kotlin.jvm.internal.markers.KMappedMarker java.util.Map<K,V> {
ctor public BuildableMap(kotlinx.collections.immutable.PersistentMap<K,? extends V> map);
method public kotlinx.collections.immutable.PersistentMap<K,V> component1();
@@ -130,9 +133,9 @@
method public androidx.compose.Composer<N> getComposer();
method public T! getNode();
method public inline void set(int value, kotlin.jvm.functions.Function2<? super T,? super java.lang.Integer,kotlin.Unit> block);
- method public inline <reified V> void set(V? value, kotlin.jvm.functions.Function2<? super T,? super V,kotlin.Unit> block);
+ method public inline <reified V> void set(V? value, kotlin.jvm.functions.Function2<? super T,? super V,? extends kotlin.Unit> block);
method public inline void update(int value, kotlin.jvm.functions.Function2<? super T,? super java.lang.Integer,kotlin.Unit> block);
- method public inline <reified V> void update(V? value, kotlin.jvm.functions.Function2<? super T,? super V,kotlin.Unit> block);
+ method public inline <reified V> void update(V? value, kotlin.jvm.functions.Function2<? super T,? super V,? extends kotlin.Unit> block);
}
public interface ComposerValidator {
@@ -207,7 +210,6 @@
}
public final class KeyInfo {
- ctor public KeyInfo(Object key, int location, int nodes, int index);
method public int getIndex();
method public Object getKey();
method public int getLocation();
@@ -243,8 +245,8 @@
method public static inline operator <T> void setValue(androidx.compose.MutableState<T>, Object? thisObj, kotlin.reflect.KProperty<?> property, T? value);
method @androidx.compose.Composable public static inline <T> androidx.compose.MutableState<T> state(kotlin.jvm.functions.Function2<? super T,? super T,java.lang.Boolean> areEquivalent = ReferentiallyEqual, kotlin.jvm.functions.Function0<? extends T> init);
method @androidx.compose.Composable public static inline <T, V1> androidx.compose.MutableState<T> stateFor(V1? v1, kotlin.jvm.functions.Function0<? extends T> init);
- method @androidx.compose.Composable public static inline <T, reified V1, reified V2> androidx.compose.MutableState<T> stateFor(V1? v1, V2? v2, kotlin.jvm.functions.Function0<? extends T> init);
method @androidx.compose.Composable public static inline <T> androidx.compose.MutableState<T> stateFor(Object![]? inputs, kotlin.jvm.functions.Function0<? extends T> init);
+ method @androidx.compose.Composable public static inline <T, reified V1, reified V2> androidx.compose.MutableState<T>! stateFor(V1? v1, V2? v2, kotlin.jvm.functions.Function0<? extends T> init);
}
public final class NullCompilationScope {
@@ -324,8 +326,10 @@
method public Object? get(int index);
method public int getCurrent();
method public int getCurrentEnd();
+ method public Object! getGroupData();
method public int getGroupEnd();
method public Object! getGroupKey();
+ method public Object! getGroupNode();
method public int getGroupSize();
method public boolean getInEmpty();
method public int getNodeIndex();
@@ -350,8 +354,10 @@
method public void startNode(Object key);
property public final int current;
property public final int currentEnd;
+ property public final Object! groupData;
property public final int groupEnd;
property public final Object! groupKey;
+ property public final Object! groupNode;
property public final int groupSize;
property public final boolean inEmpty;
property public final boolean isGroup;
@@ -389,6 +395,7 @@
method public androidx.compose.Anchor anchor(int index = current);
method public void beginInsert();
method public void close();
+ method public int endData();
method public int endGroup();
method public void endInsert();
method public int endNode();
@@ -419,9 +426,12 @@
method public int skipGroup();
method public int skipNode();
method public void skipToGroupEnd();
+ method public void startData(Object key, Object? data);
method public void startGroup(Object key);
method public void startNode(Object key);
+ method public void startNode(Object key, Object? node);
method public Object? update(Object? value);
+ method public void updateData(Object? value);
property public final boolean closed;
property public final int current;
property public final int groupSize;
diff --git a/compose/compose-runtime/api/restricted_0.1.0-dev11.txt b/compose/compose-runtime/api/restricted_0.1.0-dev11.txt
index ed6342d..478441a 100644
--- a/compose/compose-runtime/api/restricted_0.1.0-dev11.txt
+++ b/compose/compose-runtime/api/restricted_0.1.0-dev11.txt
@@ -45,6 +45,9 @@
method public void start(N?, N? instance);
}
+ public final class BitwiseOperatorsKt {
+ }
+
public final class BuildableMap<K, V> implements kotlin.jvm.internal.markers.KMappedMarker java.util.Map<K,V> {
ctor public BuildableMap(kotlinx.collections.immutable.PersistentMap<K,? extends V> map);
method public kotlinx.collections.immutable.PersistentMap<K,V> component1();
@@ -130,9 +133,9 @@
method public androidx.compose.Composer<N> getComposer();
method public T! getNode();
method public inline void set(int value, kotlin.jvm.functions.Function2<? super T,? super java.lang.Integer,kotlin.Unit> block);
- method public inline <reified V> void set(V? value, kotlin.jvm.functions.Function2<? super T,? super V,kotlin.Unit> block);
+ method public inline <reified V> void set(V? value, kotlin.jvm.functions.Function2<? super T,? super V,? extends kotlin.Unit> block);
method public inline void update(int value, kotlin.jvm.functions.Function2<? super T,? super java.lang.Integer,kotlin.Unit> block);
- method public inline <reified V> void update(V? value, kotlin.jvm.functions.Function2<? super T,? super V,kotlin.Unit> block);
+ method public inline <reified V> void update(V? value, kotlin.jvm.functions.Function2<? super T,? super V,? extends kotlin.Unit> block);
}
public interface ComposerValidator {
@@ -207,7 +210,6 @@
}
public final class KeyInfo {
- ctor public KeyInfo(Object key, int location, int nodes, int index);
method public int getIndex();
method public Object getKey();
method public int getLocation();
@@ -243,8 +245,8 @@
method public static inline operator <T> void setValue(androidx.compose.MutableState<T>, Object? thisObj, kotlin.reflect.KProperty<?> property, T? value);
method @androidx.compose.Composable public static inline <T> androidx.compose.MutableState<T> state(kotlin.jvm.functions.Function2<? super T,? super T,java.lang.Boolean> areEquivalent = ReferentiallyEqual, kotlin.jvm.functions.Function0<? extends T> init);
method @androidx.compose.Composable public static inline <T, V1> androidx.compose.MutableState<T> stateFor(V1? v1, kotlin.jvm.functions.Function0<? extends T> init);
- method @androidx.compose.Composable public static inline <T, reified V1, reified V2> androidx.compose.MutableState<T> stateFor(V1? v1, V2? v2, kotlin.jvm.functions.Function0<? extends T> init);
method @androidx.compose.Composable public static inline <T> androidx.compose.MutableState<T> stateFor(Object![]? inputs, kotlin.jvm.functions.Function0<? extends T> init);
+ method @androidx.compose.Composable public static inline <T, reified V1, reified V2> androidx.compose.MutableState<T>! stateFor(V1? v1, V2? v2, kotlin.jvm.functions.Function0<? extends T> init);
}
public final class NullCompilationScope {
@@ -324,8 +326,10 @@
method public Object? get(int index);
method public int getCurrent();
method public int getCurrentEnd();
+ method public Object! getGroupData();
method public int getGroupEnd();
method public Object! getGroupKey();
+ method public Object! getGroupNode();
method public int getGroupSize();
method public boolean getInEmpty();
method public int getNodeIndex();
@@ -350,8 +354,10 @@
method public void startNode(Object key);
property public final int current;
property public final int currentEnd;
+ property public final Object! groupData;
property public final int groupEnd;
property public final Object! groupKey;
+ property public final Object! groupNode;
property public final int groupSize;
property public final boolean inEmpty;
property public final boolean isGroup;
@@ -389,6 +395,7 @@
method public androidx.compose.Anchor anchor(int index = current);
method public void beginInsert();
method public void close();
+ method public int endData();
method public int endGroup();
method public void endInsert();
method public int endNode();
@@ -419,9 +426,12 @@
method public int skipGroup();
method public int skipNode();
method public void skipToGroupEnd();
+ method public void startData(Object key, Object? data);
method public void startGroup(Object key);
method public void startNode(Object key);
+ method public void startNode(Object key, Object? node);
method public Object? update(Object? value);
+ method public void updateData(Object? value);
property public final boolean closed;
property public final int current;
property public final int groupSize;
diff --git a/compose/compose-runtime/api/restricted_current.txt b/compose/compose-runtime/api/restricted_current.txt
index ed6342d..478441a 100644
--- a/compose/compose-runtime/api/restricted_current.txt
+++ b/compose/compose-runtime/api/restricted_current.txt
@@ -45,6 +45,9 @@
method public void start(N?, N? instance);
}
+ public final class BitwiseOperatorsKt {
+ }
+
public final class BuildableMap<K, V> implements kotlin.jvm.internal.markers.KMappedMarker java.util.Map<K,V> {
ctor public BuildableMap(kotlinx.collections.immutable.PersistentMap<K,? extends V> map);
method public kotlinx.collections.immutable.PersistentMap<K,V> component1();
@@ -130,9 +133,9 @@
method public androidx.compose.Composer<N> getComposer();
method public T! getNode();
method public inline void set(int value, kotlin.jvm.functions.Function2<? super T,? super java.lang.Integer,kotlin.Unit> block);
- method public inline <reified V> void set(V? value, kotlin.jvm.functions.Function2<? super T,? super V,kotlin.Unit> block);
+ method public inline <reified V> void set(V? value, kotlin.jvm.functions.Function2<? super T,? super V,? extends kotlin.Unit> block);
method public inline void update(int value, kotlin.jvm.functions.Function2<? super T,? super java.lang.Integer,kotlin.Unit> block);
- method public inline <reified V> void update(V? value, kotlin.jvm.functions.Function2<? super T,? super V,kotlin.Unit> block);
+ method public inline <reified V> void update(V? value, kotlin.jvm.functions.Function2<? super T,? super V,? extends kotlin.Unit> block);
}
public interface ComposerValidator {
@@ -207,7 +210,6 @@
}
public final class KeyInfo {
- ctor public KeyInfo(Object key, int location, int nodes, int index);
method public int getIndex();
method public Object getKey();
method public int getLocation();
@@ -243,8 +245,8 @@
method public static inline operator <T> void setValue(androidx.compose.MutableState<T>, Object? thisObj, kotlin.reflect.KProperty<?> property, T? value);
method @androidx.compose.Composable public static inline <T> androidx.compose.MutableState<T> state(kotlin.jvm.functions.Function2<? super T,? super T,java.lang.Boolean> areEquivalent = ReferentiallyEqual, kotlin.jvm.functions.Function0<? extends T> init);
method @androidx.compose.Composable public static inline <T, V1> androidx.compose.MutableState<T> stateFor(V1? v1, kotlin.jvm.functions.Function0<? extends T> init);
- method @androidx.compose.Composable public static inline <T, reified V1, reified V2> androidx.compose.MutableState<T> stateFor(V1? v1, V2? v2, kotlin.jvm.functions.Function0<? extends T> init);
method @androidx.compose.Composable public static inline <T> androidx.compose.MutableState<T> stateFor(Object![]? inputs, kotlin.jvm.functions.Function0<? extends T> init);
+ method @androidx.compose.Composable public static inline <T, reified V1, reified V2> androidx.compose.MutableState<T>! stateFor(V1? v1, V2? v2, kotlin.jvm.functions.Function0<? extends T> init);
}
public final class NullCompilationScope {
@@ -324,8 +326,10 @@
method public Object? get(int index);
method public int getCurrent();
method public int getCurrentEnd();
+ method public Object! getGroupData();
method public int getGroupEnd();
method public Object! getGroupKey();
+ method public Object! getGroupNode();
method public int getGroupSize();
method public boolean getInEmpty();
method public int getNodeIndex();
@@ -350,8 +354,10 @@
method public void startNode(Object key);
property public final int current;
property public final int currentEnd;
+ property public final Object! groupData;
property public final int groupEnd;
property public final Object! groupKey;
+ property public final Object! groupNode;
property public final int groupSize;
property public final boolean inEmpty;
property public final boolean isGroup;
@@ -389,6 +395,7 @@
method public androidx.compose.Anchor anchor(int index = current);
method public void beginInsert();
method public void close();
+ method public int endData();
method public int endGroup();
method public void endInsert();
method public int endNode();
@@ -419,9 +426,12 @@
method public int skipGroup();
method public int skipNode();
method public void skipToGroupEnd();
+ method public void startData(Object key, Object? data);
method public void startGroup(Object key);
method public void startNode(Object key);
+ method public void startNode(Object key, Object? node);
method public Object? update(Object? value);
+ method public void updateData(Object? value);
property public final boolean closed;
property public final int current;
property public final int groupSize;
diff --git a/compose/compose-runtime/src/androidAndroidTest/kotlin/androidx/compose/test/EffectsTests.kt b/compose/compose-runtime/src/androidAndroidTest/kotlin/androidx/compose/test/EffectsTests.kt
index eecbedf..aa0bf3f 100644
--- a/compose/compose-runtime/src/androidAndroidTest/kotlin/androidx/compose/test/EffectsTests.kt
+++ b/compose/compose-runtime/src/androidAndroidTest/kotlin/androidx/compose/test/EffectsTests.kt
@@ -506,6 +506,26 @@
}
@Test
+ fun testPreCommit6() {
+ var readValue = 0
+
+ @Composable
+ fun UpdateStateInPreCommit() {
+ var value by state { 1 }
+ readValue = value
+ onPreCommit {
+ value = 2
+ }
+ }
+
+ compose {
+ UpdateStateInPreCommit()
+ }.then { _ ->
+ assertEquals(2, readValue)
+ }
+ }
+
+ @Test
fun testOnDispose1() {
var mount by mutableStateOf(true)
diff --git a/samples/SupportTransitionDemos/src/main/java/com/example/android/support/transition/widget/FastOutSlowInInterpolator.java b/compose/compose-runtime/src/commonMain/kotlin/androidx/compose/BitwiseOperators.kt
similarity index 68%
copy from samples/SupportTransitionDemos/src/main/java/com/example/android/support/transition/widget/FastOutSlowInInterpolator.java
copy to compose/compose-runtime/src/commonMain/kotlin/androidx/compose/BitwiseOperators.kt
index 6cf5ba4..ec31452 100644
--- a/samples/SupportTransitionDemos/src/main/java/com/example/android/support/transition/widget/FastOutSlowInInterpolator.java
+++ b/compose/compose-runtime/src/commonMain/kotlin/androidx/compose/BitwiseOperators.kt
@@ -14,13 +14,12 @@
* limitations under the License.
*/
-package com.example.android.support.transition.widget;
+@file:Suppress("NOTHING_TO_INLINE")
-import androidx.core.animation.PathInterpolator;
+package androidx.compose
-class FastOutSlowInInterpolator extends PathInterpolator {
+@OptIn(ExperimentalStdlibApi::class)
+internal inline infix fun Int.ror(other: Int) = this.rotateRight(other)
- FastOutSlowInInterpolator() {
- super(0.4f, 0f, 0.2f, 1f);
- }
-}
+@OptIn(ExperimentalStdlibApi::class)
+internal inline infix fun Int.rol(other: Int) = this.rotateLeft(other)
\ No newline at end of file
diff --git a/compose/compose-runtime/src/commonMain/kotlin/androidx/compose/Composer.kt b/compose/compose-runtime/src/commonMain/kotlin/androidx/compose/Composer.kt
index a20d3c3..50d9c20 100644
--- a/compose/compose-runtime/src/commonMain/kotlin/androidx/compose/Composer.kt
+++ b/compose/compose-runtime/src/commonMain/kotlin/androidx/compose/Composer.kt
@@ -44,16 +44,20 @@
) -> Unit
private class GroupInfo(
- /** The current location of the slot relative to the start location of the pending slot changes
+ /**
+ * The current location of the slot relative to the start location of the pending slot changes
*/
var slotIndex: Int,
- /** The current location of the first node relative the start location of the pending node
+ /**
+ * The current location of the first node relative the start location of the pending node
* changes
*/
var nodeIndex: Int,
- /** The current number of nodes the group contains after changes have been applied */
+ /**
+ * The current number of nodes the group contains after changes have been applied
+ */
var nodeCount: Int
)
@@ -68,7 +72,6 @@
* structure of the tree is detected.
*/
private class Pending(
- val parentKeyInfo: KeyInfo,
val keyInfos: MutableList<KeyInfo>,
val startIndex: Int
) {
@@ -78,16 +81,14 @@
require(startIndex >= 0) { "Invalid start index" }
}
- var nodeCount = parentKeyInfo.nodes
-
private val usedKeys = mutableListOf<KeyInfo>()
private val groupInfos = run {
var runningNodeIndex = 0
- val result = hashMapOf<Any?, GroupInfo>()
+ val result = hashMapOf<Group, GroupInfo>()
for (index in 0 until keyInfos.size) {
- val key = keyInfos[index]
- result[key] = GroupInfo(index, runningNodeIndex, key.nodes)
- runningNodeIndex += key.nodes
+ val keyInfo = keyInfos[index]
+ result[keyInfo.group] = GroupInfo(index, runningNodeIndex, keyInfo.nodes)
+ runningNodeIndex += keyInfo.nodes
}
result
}
@@ -153,27 +154,29 @@
}
fun registerInsert(keyInfo: KeyInfo, insertIndex: Int) {
- groupInfos[keyInfo] = GroupInfo(-1, insertIndex, 0)
+ groupInfos[keyInfo.group] = GroupInfo(-1, insertIndex, 0)
}
- fun updateNodeCount(keyInfo: KeyInfo?, newCount: Int) {
- groupInfos[keyInfo]?.let {
- val index = it.nodeIndex
- val difference = newCount - it.nodeCount
- it.nodeCount = newCount
+ fun updateNodeCount(group: Group, newCount: Int): Boolean {
+ val groupInfo = groupInfos[group]
+ if (groupInfo != null) {
+ val index = groupInfo.nodeIndex
+ val difference = newCount - groupInfo.nodeCount
+ groupInfo.nodeCount = newCount
if (difference != 0) {
- nodeCount += difference
- groupInfos.values.forEach { group ->
- if (group.nodeIndex >= index && group != it)
- group.nodeIndex += difference
+ groupInfos.values.forEach { childGroupInfo ->
+ if (childGroupInfo.nodeIndex >= index && childGroupInfo != groupInfo)
+ childGroupInfo.nodeIndex += difference
}
}
+ return true
}
+ return false
}
- fun slotPositionOf(keyInfo: KeyInfo) = groupInfos[keyInfo]?.slotIndex ?: -1
- fun nodePositionOf(keyInfo: KeyInfo) = groupInfos[keyInfo]?.nodeIndex ?: -1
- fun updatedNodeCountOf(keyInfo: KeyInfo) = groupInfos[keyInfo]?.nodeCount ?: keyInfo.nodes
+ fun slotPositionOf(keyInfo: KeyInfo) = groupInfos[keyInfo.group]?.slotIndex ?: -1
+ fun nodePositionOf(keyInfo: KeyInfo) = groupInfos[keyInfo.group]?.nodeIndex ?: -1
+ fun updatedNodeCountOf(keyInfo: KeyInfo) = groupInfos[keyInfo.group]?.nodeCount ?: keyInfo.nodes
}
private val RootKey = OpaqueKey("root")
@@ -343,15 +346,14 @@
private var nodeIndexStack = IntStack()
private var groupNodeCount: Int = 0
private var groupNodeCountStack = IntStack()
+ private val nodeCountOverrides = HashMap<Group, Int>()
private var collectKeySources = false
- private val keyHashesStack = IntStack()
- private var childrenAllowed = true
+ private var nodeExpected = false
private var invalidations: MutableList<Invalidation> = mutableListOf()
private val entersStack = IntStack()
- private val providersStack = Stack<Pair<Int, AmbientMap>>().apply {
- push(-1 to buildableMapOf())
- }
+ private var parentProvider: AmbientMap = buildableMapOf()
+ private val providerUpdates = HashMap<Group, AmbientMap>()
private var providersInvalid = false
private val providersInvalidStack = IntStack()
@@ -382,12 +384,15 @@
private val insertTable = SlotTable()
private var writer: SlotWriter = insertTable.openWriter().also { it.close() }
+ private var hasProvider = false
private var insertAnchor: Anchor = insertTable.anchor(0)
private val insertFixups = mutableListOf<Change<N>>()
protected fun composeRoot(block: () -> Unit) {
startRoot()
+ startGroup(invocation)
block()
+ endGroup()
endRoot()
}
@@ -411,7 +416,7 @@
* @see [startMovableGroup]
* @see [startRestartGroup]
*/
- fun startReplaceableGroup(key: Int) = start(key, false)
+ fun startReplaceableGroup(key: Int) = start(key, false, null)
/**
* Indicates the end of a "Replaceable Group" at the current execution position. A
@@ -452,7 +457,7 @@
* @see [startReplaceableGroup]
* @see [startRestartGroup]
*/
- fun startMovableGroup(key: Any) = start(key, false)
+ fun startMovableGroup(key: Any) = start(key, false, null)
/**
* Indicates the end of a "Movable Group" at the current execution position. A Movable Group is
@@ -493,10 +498,9 @@
reader = slotTable.openReader()
startGroup(RootKey)
parentReference?.let { parentRef ->
- val parentScope = parentRef.getAmbientScope()
+ parentProvider = parentRef.getAmbientScope()
providersInvalidStack.push(providersInvalid.asInt())
- providersInvalid = changed(parentScope)
- providersStack.push(0 to parentScope)
+ providersInvalid = changed(parentProvider)
}
}
@@ -507,9 +511,6 @@
fun endRoot() {
endGroup()
recordEndRoot()
- if (parentReference != null) {
- providersStack.pop()
- }
finalizeCompose()
reader.close()
}
@@ -520,7 +521,6 @@
fun abortRoot() {
cleanUpCompose()
pendingStack.clear()
- keyHashesStack.clear()
nodeIndexStack.clear()
groupNodeCountStack.clear()
entersStack.clear()
@@ -528,6 +528,7 @@
invalidateStack.clear()
reader.close()
currentCompoundKeyHash = 0
+ nodeExpected = false
}
/**
@@ -595,6 +596,8 @@
changes.clear()
}
+ providerUpdates.clear()
+
@Suppress("ReplaceManualRangeWithIndicesCalls") // Avoids allocation of an iterator
for (index in 0 until invalidationAnchors.size) {
val (anchor, invalidation) = invalidationAnchors[index]
@@ -637,7 +640,7 @@
*
* @param key The key for the group
*/
- fun startGroup(key: Any) = start(key, false)
+ fun startGroup(key: Any) = start(key, false, null)
/**
* End the current group.
@@ -662,29 +665,27 @@
* @param key the key for the node.
*/
fun startNode(key: Any) {
- start(key, true)
- childrenAllowed = false
+ start(key, true, null)
+ nodeExpected = true
}
// Deprecated
fun <T : N> emitNode(factory: () -> T) {
+ validateNodeExpected()
if (inserting) {
val insertIndex = nodeIndexStack.peek()
// The pending is the pending information for where the node is being inserted.
// pending will be null here when the parent was inserted too.
- pending?.let { it.nodeCount++ }
groupNodeCount++
recordFixup { applier, slots, _ ->
val node = factory()
- slots.update(node)
+ slots.node = node
applier.insert(insertIndex, node)
applier.down(node)
}
} else {
- recordDown()
- reader.next() // Skip node slot
+ recordDown(reader.node)
}
- childrenAllowed = true
}
/**
@@ -693,20 +694,19 @@
*/
@Suppress("UNUSED")
fun <T : N> createNode(factory: () -> T) {
+ validateNodeExpected()
require(inserting) { "createNode() can only be called when inserting" }
val insertIndex = nodeIndexStack.peek()
// see emitNode
- pending?.let { it.nodeCount++ }
groupNodeCount++
recordFixup { applier, slots, _ ->
val node = factory()
- slots.update(node)
+ slots.node = node
applier.insert(insertIndex, node)
applier.down(node)
}
// Allocate a slot that will be fixed-up by the above operation.
writer.skip()
- childrenAllowed = true
}
/**
@@ -714,17 +714,16 @@
* inserting.
*/
fun emitNode(node: N) {
+ validateNodeExpected()
require(inserting) { "emitNode() called when not inserting" }
val insertIndex = nodeIndexStack.peek()
// see emitNode
- pending?.let { it.nodeCount++ }
groupNodeCount++
- writer.update(node)
+ writer.node = node
recordApplierOperation { applier, _, _ ->
applier.insert(insertIndex, node)
applier.down(node)
}
- childrenAllowed = true
}
/**
@@ -733,12 +732,11 @@
* location as [emitNode] or [createNode] as called even if the value is unused.
*/
fun useNode(): N {
+ validateNodeExpected()
require(!inserting) { "useNode() called while inserting" }
- recordDown()
- val result = reader.next()
- childrenAllowed = true
- @Suppress("UNCHECKED_CAST")
- return result as N
+ val result = reader.node
+ recordDown(result)
+ return result
}
/**
@@ -768,7 +766,10 @@
/**
* Return the next value in the slot table and advance the current location.
*/
- fun nextSlot(): Any? = if (inserting) EMPTY else reader.next()
+ fun nextSlot(): Any? = if (inserting) {
+ validateNodeNotExpected()
+ EMPTY
+ } else reader.next()
/**
* Determine if the current slot table value is equal to the given value, if true, the value
@@ -812,8 +813,7 @@
recordSlotTableOperation(-1) { _, slots, lifecycleManager ->
if (value is CompositionLifecycleObserver)
lifecycleManager.entering(value)
- val previous = slots.update(value)
- when (previous) {
+ when (val previous = slots.update(value)) {
is CompositionLifecycleObserver ->
lifecycleManager.leaving(previous)
is RecomposeScope ->
@@ -826,20 +826,31 @@
}
/**
- * Return the provider scope provided at [location]
- */
- private fun providedScopeAt(location: Int, reader: SlotReader): AmbientMap {
- require(reader.groupKey(location) == provider)
- val valuesGroupSize = reader.groupSize(location + 1)
- val mapLocation = location + valuesGroupSize + 3 // one for each group slot
- @Suppress("UNCHECKED_CAST")
- return reader.get(mapLocation) as AmbientMap
- }
-
- /**
* Return the current ambient scope which was provided by a parent group.
*/
- private fun currentAmbientScope(): AmbientMap = providersStack.peek().second
+ private fun currentAmbientScope(): AmbientMap {
+ if (inserting && hasProvider) {
+ var group: Group? = writer.group(writer.parentLocation)
+ while (group != null) {
+ if (group.key === ambientMap) {
+ @Suppress("UNCHECKED_CAST")
+ return group.data as AmbientMap
+ }
+ group = group.parent
+ }
+ }
+ if (slotTable.size > 0) {
+ var group: Group? = reader.group(reader.parentLocation)
+ while (group != null) {
+ if (group.key === ambientMap) {
+ @Suppress("UNCHECKED_CAST")
+ return providerUpdates[group] ?: group.data as AmbientMap
+ }
+ group = group.parent
+ }
+ }
+ return parentProvider
+ }
/**
* Return the ambient scope for the location provided. If this is while the composer is
@@ -854,20 +865,17 @@
return currentAmbientScope()
}
- // Find the nearest provider group to location and return the scope recorded there.
- val groupPath = slotTable.groupPathTo(location)
- return slotTable.read { reader ->
- groupPath.lastOrNull { reader.groupKey(it) == provider }?.let {
- providedScopeAt(it, reader)
- } ?: buildableMapOf()
+ if (location >= 0) {
+ var group: Group? = slotTable.read { it.group(location) }
+ while (group != null) {
+ if (group.key == ambientMap) {
+ @Suppress("UNCHECKED_CAST")
+ return providerUpdates[group] ?: group.data as AmbientMap
+ }
+ group = group.parent
+ }
}
- }
-
- /**
- * Record [scope] as the current scope provided by the current group.
- */
- private fun pushProviderScope(scope: AmbientMap) {
- providersStack.push(reader.startStack.peekOr(0) to scope)
+ return parentProvider
}
/**
@@ -896,11 +904,12 @@
startGroup(providerValues)
val currentProviders = invokeComposableForResult(this) { ambientMapOf(values) }
endGroup()
- val providersStackSize = providersStack.size
- val invalid = if (inserting) {
- val providers = updateProviderMapGroup(parentScope, currentProviders)
- pushProviderScope(providers)
- false
+ val providers: AmbientMap
+ val invalid: Boolean
+ if (inserting) {
+ providers = updateProviderMapGroup(parentScope, currentProviders)
+ invalid = false
+ hasProvider = true
} else {
val current = reader.current
@@ -912,8 +921,7 @@
// skipping is true iff parentScope has not changed.
if (!skipping || oldValues != currentProviders) {
- val providers = updateProviderMapGroup(parentScope, currentProviders)
- pushProviderScope(providers)
+ providers = updateProviderMapGroup(parentScope, currentProviders)
// Compare against the old scope as currentProviders might have modified the scope
// back to the previous value. This could happen, for example, if currentProviders
@@ -921,33 +929,26 @@
// currentProviders for that key. If the scope has not changed, because these
// providers obscure a change in the parent as described above, re-enable skipping
// for the child region.
- providers != oldScope
+ invalid = providers != oldScope
} else {
// Nothing has changed
skipGroup()
- pushProviderScope(oldScope)
- false
+ providers = oldScope
+ invalid = false
}
}
- // If the provider scope has changed then we need prevent skipping until endProviders()
- // is called.
+ if (invalid && !inserting) {
+ providerUpdates[reader.group] = providers
+ }
providersInvalidStack.push(providersInvalid.asInt())
providersInvalid = invalid
-
- require(providersStackSize + 1 == providersStack.size) {
- "The provider stack was not updated correctly"
- }
-
- startGroup(invocation)
+ start(ambientMap, false, providers)
}
internal fun endProviders() {
endGroup()
- val group = reader.startStack.peekOr(0)
endGroup()
- val (topGroup, _) = providersStack.pop()
- require(group == topGroup)
providersInvalid = providersInvalidStack.pop().asBool()
}
@@ -1004,6 +1005,23 @@
private fun ensureWriter() {
if (writer.closed) {
writer = insertTable.openWriter()
+ hasProvider = false
+ }
+ }
+
+ /**
+ * Start the reader group updating the data of the group if necessary
+ */
+ private fun startReaderGroup(isNode: Boolean, data: Any?) {
+ if (isNode) {
+ reader.startNode(EMPTY)
+ } else {
+ if (data != null && reader.groupData !== data) {
+ recordSlotEditingOperation { _, slots, _ ->
+ slots.updateData(data)
+ }
+ }
+ reader.startGroup(EMPTY)
}
}
@@ -1011,30 +1029,25 @@
* Important: This is a short-cut for the full version of [start] and should be kept in sync
* with its implementation. This version avoids boxing for [Int] keys.
*/
- private fun start(key: Int, isNode: Boolean) {
+ private fun start(key: Int, isNode: Boolean, data: Any?) {
if (!inserting && pending == null && key == reader.groupKey) {
- require(childrenAllowed) { "A call to createNode(), emitNode() or useNode() expected" }
+ validateNodeNotExpected()
- if (!isNode) {
- updateCompoundKeyWhenWeEnterGroupKeyHash(key)
- }
- if (isNode) reader.startNode(EMPTY) else reader.startGroup(EMPTY)
-
+ updateCompoundKeyWhenWeEnterGroupKeyHash(key)
+ startReaderGroup(isNode, data)
enterGroup(isNode, null)
} else {
- start(key as Any, isNode)
+ start(key as Any, isNode, data)
}
}
- private fun start(key: Any, isNode: Boolean) {
+ private fun start(key: Any, isNode: Boolean, data: Any?) {
// !! IMPORTANT !! If there are changes to this method there might need to be
// corresponding changes to the Int short cut method above.
- require(childrenAllowed) { "A call to createNode(), emitNode() or useNode() expected" }
+ validateNodeNotExpected()
- if (!isNode) {
- updateCompoundKeyWhenWeEnterGroup(key)
- }
+ updateCompoundKeyWhenWeEnterGroup(key)
// Check for the insert fast path. If we are already inserting (creating nodes) then
// there is no need to track insert, deletes and moves with a pending changes object.
@@ -1042,9 +1055,13 @@
reader.beginEmpty()
if (collectKeySources)
recordSourceKeyInfo(key)
- if (isNode) writer.startNode(key) else writer.startGroup(key)
+ when {
+ isNode -> writer.startNode(key)
+ data != null -> writer.startData(key, data)
+ else -> writer.startGroup(key)
+ }
pending?.let { pending ->
- val insertKeyInfo = KeyInfo(key, -1, 0, -1)
+ val insertKeyInfo = KeyInfo(key, -1, 0, -1, writer.parentGroup)
pending.registerInsert(insertKeyInfo, nodeIndex - pending.startIndex)
pending.recordUsed(insertKeyInfo)
}
@@ -1056,11 +1073,9 @@
val slotKey = reader.groupKey
if (slotKey == key) {
// The group is the same as what was generated last time.
- if (isNode) reader.startNode(key) else reader.startGroup(key)
+ startReaderGroup(isNode, data)
} else {
- val nodes = reader.parentNodes - reader.nodeIndex
pending = Pending(
- KeyInfo(0, -1, nodes, -1),
reader.extractKeys(),
nodeIndex
)
@@ -1097,7 +1112,7 @@
slots.moveGroup(currentRelativePosition)
}
}
- if (isNode) reader.startNode(key) else reader.startGroup(key)
+ startReaderGroup(isNode, data)
} else {
// The group is new, go into insert mode. All child groups will written to the
// insertTable until the group is complete which will schedule the groups to be
@@ -1110,13 +1125,13 @@
ensureWriter()
writer.beginInsert()
val insertLocation = writer.current
- writer.startGroup(key)
+ if (isNode) writer.startNode(key) else writer.startGroup(key)
insertAnchor = writer.anchor(insertLocation)
- val insertKeyInfo = KeyInfo(key, -1, 0, -1)
+ val insertKeyInfo = KeyInfo(key, -1, 0, -1, writer.parentGroup)
pending.registerInsert(insertKeyInfo, nodeIndex - pending.startIndex)
pending.recordUsed(insertKeyInfo)
newPending = Pending(
- insertKeyInfo, mutableListOf(),
+ mutableListOf(),
if (isNode) 0 else nodeIndex
)
}
@@ -1143,12 +1158,8 @@
// increment the node index and the group's node count. If the parent is tracking structural
// changes in pending then restore that too.
val previousPending = pendingStack.pop()
- if (previousPending != null) {
- // Update the parent count of nodes
- previousPending.updateNodeCount(pending?.parentKeyInfo, expectedNodeCount)
- if (!inserting) {
- previousPending.groupIndex++
- }
+ if (previousPending != null && !inserting) {
+ previousPending.groupIndex++
}
this.pending = previousPending
this.nodeIndex = nodeIndexStack.pop() + expectedNodeCount
@@ -1159,9 +1170,13 @@
// All the changes to the group (or node) have been recorded. All new nodes have been
// inserted but it has yet to determine which need to be removed or moved. Note that the
// changes are relative to the first change in the list of nodes that are changing.
- if (!isNode) {
- updateCompoundKeyWhenWeExitGroup()
- }
+
+ updateCompoundKeyWhenWeExitGroup(
+ if (inserting)
+ writer.group(writer.parentLocation).key
+ else
+ reader.group(reader.parentLocation).key
+ )
var expectedNodeCount = groupNodeCount
val pending = pending
if (pending != null && pending.keyInfos.size > 0) {
@@ -1190,7 +1205,7 @@
// group
val deleteOffset = pending.nodePositionOf(previousInfo)
recordRemoveNode(deleteOffset + pending.startIndex, previousInfo.nodes)
- pending.updateNodeCount(previousInfo, 0)
+ pending.updateNodeCount(previousInfo.group, 0)
recordReaderMoving(previousInfo.location)
reader.reposition(previousInfo.location)
recordDelete()
@@ -1260,7 +1275,6 @@
invalidations.removeRange(startSlot, reader.current)
}
- // Cache the current [inserting] state for the pending update below.
val inserting = inserting
if (inserting) {
if (isNode) {
@@ -1268,16 +1282,23 @@
expectedNodeCount = 1
}
reader.endEmpty()
+ val group = writer.parentGroup
writer.endGroup()
if (!reader.inEmpty) {
writer.endInsert()
writer.close()
recordInsert(insertAnchor)
this.inserting = false
+ nodeCountOverrides[group] = 0
+ updateNodeCountOverrides(group, expectedNodeCount)
}
} else {
if (isNode) recordUp()
recordEndGroup()
+ val group = reader.parentGroup
+ if (expectedNodeCount != group.nodes) {
+ updateNodeCountOverrides(group, expectedNodeCount)
+ }
if (isNode) {
expectedNodeCount = 1
reader.endNode()
@@ -1290,107 +1311,59 @@
}
/**
- * Skip to a sibling group that contains location given. This also ensures the nodeIndex is
- * correctly updated to reflect any groups skipped.
+ * Recompose any invalidate child groups of the current parent group. This should be called
+ * after the group is started but on or before the first child group. It is intended to be
+ * called instead of [skipReaderToGroupEnd] if any child groups are invalid. If no children
+ * are invalid it will call [skipReaderToGroupEnd].
*/
- private fun skipToGroupContaining(location: Int) {
- val reader = reader
- while (reader.current < location) {
- if (reader.isGroupEnd) return
- if (reader.isGroup) {
- if (location < reader.groupSize + reader.current) return
- nodeIndex += reader.skipGroup()
- } else {
- reader.next()
- }
- }
- }
-
- /**
- * Enter a group that contains the location. This updates the composer state as if the group was
- * generated with no changes.
- */
- private fun enterGroups(location: Int, level: Int): Int {
- val reader = reader
- var currentLevel = level
- while (true) {
- skipToGroupContaining(location)
- if (reader.current == location) {
- break
- } else {
- enterGroup(reader.isNode, null)
- currentLevel++
- if (reader.isNode) {
- reader.startNode(EMPTY)
- recordDown()
- reader.next() // skip navigation slot
- nodeIndex = 0
- } else {
- updateCompoundKeyWhenWeEnterGroup(reader.groupKey)
- // If the current group is an ambient provider, add the map to the ambient
- // scope stack
- if (reader.groupKey === provider) {
- val current = reader.current
- providersStack.push(current to providedScopeAt(current, reader))
- }
- reader.startGroup(EMPTY)
- }
- }
- }
- return currentLevel
- }
-
- /**
- * Exit any groups that were entered until a sibling of maxLocation is reached.
- */
- private fun exitGroups(location: Int, level: Int): Int {
- val reader = reader
- var currentProviderScope = providersStack.peek().first
- var currentLevel = level
- while (currentLevel > 0) {
- skipToGroupContaining(location)
- if (reader.isGroupEnd) {
- val startLocation = reader.parentLocation
-
- // If the current group is a provider scope, pop it off the stack as this
- // exits the scope.
- if (reader.startStack.peekOr(0) == currentProviderScope) {
- providersStack.pop()
- currentProviderScope = providersStack.peek().first
- }
-
- val isNode = reader.isNode(startLocation)
- if (isNode) recordUp()
- else updateCompoundKeyWhenWeExitGroup()
- recordEndGroup()
- reader.endGroup()
- currentLevel--
- exitGroup(if (isNode) 1 else groupNodeCount, false)
- } else break
- }
- return currentLevel
- }
-
- private fun recomposeComponentRange(start: Int, end: Int) {
+ private fun recomposeToGroupEnd() {
val wasComposing = isComposing
isComposing = true
var recomposed = false
+ val start = reader.parentLocation
+ val end = start + reader.groupSize(start) + 1
+ val recomposeGroup = reader.group(start)
+ val recomposeIndex = nodeIndex
+ val recomposeCompoundKey = currentCompoundKeyHash
+ val oldGroupNodeCount = groupNodeCount
+ var oldGroup = recomposeGroup
+
var firstInRange = invalidations.firstInRange(start, end)
- var level = 0
- val previousParent = reader.parentLocation
while (firstInRange != null) {
val location = firstInRange.location
invalidations.removeLocation(location)
- level = exitGroups(location, level)
- level = enterGroups(location, level)
+ recomposed = true
+
+ reader.reposition(location)
+ val newGroup = reader.group
+
+ // Record the changes to the applier location
+ recordUpsAndDowns(oldGroup, newGroup, recomposeGroup)
+ oldGroup = newGroup
+
+ // Calculate the node index (the distance index in the node this groups nodes are
+ // located in the parent node).
+ nodeIndex = nodeIndexOf(
+ location,
+ newGroup,
+ start,
+ recomposeGroup,
+ recomposeIndex
+ )
+
+ // Calculate the compound hash code (a semi-unique code for every group in the
+ // composition used to restore saved state).
+ currentCompoundKeyHash = compoundKeyOf(
+ newGroup.parent,
+ recomposeGroup,
+ recomposeCompoundKey
+ )
firstInRange.scope.compose(this)
- recomposed = true
-
// Using slots.current here ensures composition always walks forward even if a component
// before the current composition is invalidated when performing this composition. Any
// such components will be considered invalid for the next composition. Skipping them
@@ -1401,15 +1374,155 @@
}
if (recomposed) {
- exitGroups(end, level)
- require(reader.parentLocation == previousParent) { "Group enter mismatch" }
+ recordUpsAndDowns(oldGroup, recomposeGroup, recomposeGroup)
+ val parentGroup = reader.parentGroup
+ reader.skipToGroupEnd()
+ val parentGroupNodes = (nodeCountOverrides[parentGroup] ?: parentGroup.nodes)
+ nodeIndex = recomposeIndex + parentGroupNodes
+ groupNodeCount = oldGroupNodeCount + parentGroupNodes
} else {
// No recompositions were requested in the range, skip it.
skipReaderToGroupEnd()
}
+ currentCompoundKeyHash = recomposeCompoundKey
+
isComposing = wasComposing
}
+ /**
+ * As operations to insert and remove nodes are recorded, the number of nodes that will be in
+ * the group after changes are applied is maintained in a side overrides table. This method
+ * updates that count and then updates any parent groups that include the nodes this group
+ * emits.
+ */
+ private fun updateNodeCountOverrides(group: Group, newCount: Int) {
+ val currentCount = nodeCountOverrides[group] ?: group.nodes
+ if (currentCount != newCount) {
+ // Update the overrides
+ val delta = newCount - currentCount
+ var current: Group? = group
+
+ var minPending = pendingStack.size - 1
+ while (current != null) {
+ val newCurrentNodes = (nodeCountOverrides[current] ?: current.nodes) + delta
+ nodeCountOverrides[current] = newCurrentNodes
+ for (pendingIndex in minPending downTo 0) {
+ val pending = pendingStack.peek(pendingIndex)
+ if (pending != null && pending.updateNodeCount(current, newCurrentNodes)) {
+ minPending = pendingIndex - 1
+ break
+ }
+ }
+ if (current.isNode) break
+ current = current.parent
+ }
+ }
+ }
+
+ /**
+ * Calculates the node index (the index in the child list of a node will appear in the
+ * resulting tree) for [group]. Passing in [recomposeGroup] and its node index in
+ * [recomposeIndex] allows the calculation to exit early if there is no node group between
+ * [group] and [recomposeGroup].
+ */
+ private fun nodeIndexOf(
+ groupLocation: Int,
+ group: Group,
+ recomposeLocation: Int,
+ recomposeGroup: Group,
+ recomposeIndex: Int
+ ): Int {
+ // Find the anchor group which is either the recomposeGroup or the first parent node
+ var anchorGroup = group.parent ?: error("Invalid group")
+ while (anchorGroup != recomposeGroup) {
+ if (anchorGroup.isNode) break
+ anchorGroup = anchorGroup.parent ?: error("group not contained in recompose group")
+ }
+
+ var index = if (anchorGroup.isNode) 0 else recomposeIndex
+
+ // An early out if the group and anchor sizes are the same as the index must then be index
+ if (anchorGroup.slots == group.slots) return index
+
+ // Find the location of the anchor group
+ val anchorLocation =
+ if (anchorGroup == recomposeGroup) {
+ recomposeLocation
+ } else {
+ // anchor node must be between recomposeLocation and groupLocation but no farther
+ // back than anchorGroup.size - group.size + 1 because anchorGroup contains group
+ var location = recomposeLocation
+ val anchorLimit = groupLocation - (anchorGroup.slots - group.slots + 1)
+ if (location < anchorLimit) location = anchorLimit
+ while (reader.get(location) !== anchorGroup)
+ location++
+ location
+ }
+
+ // Walk down from the anchor group counting nodes of siblings in front of this group
+ var current = anchorLocation
+ val nodeIndexLimit = index + ((nodeCountOverrides[anchorGroup] ?: anchorGroup.nodes) -
+ group.nodes)
+ loop@ while (index < nodeIndexLimit) {
+ if (current == groupLocation) break
+ current++
+ while (!reader.isGroup(current)) current++
+ while (current < groupLocation) {
+ val currentGroup = reader.group(current)
+ val end = currentGroup.slots + current + 1
+ if (groupLocation < end) continue@loop
+ index += nodeCountOverrides[currentGroup] ?: currentGroup.nodes
+
+ current = end
+ }
+ break
+ }
+ return index
+ }
+
+ /**
+ * Records the operations necessary to move the applier the node affected by the previous
+ * group to the new group.
+ */
+ private fun recordUpsAndDowns(oldGroup: Group, newGroup: Group, commonRoot: Group) {
+ val nearestCommonRoot = nearestCommonRootOf(
+ oldGroup,
+ newGroup,
+ commonRoot
+ ) ?: commonRoot
+
+ // Record ups for the nodes between oldGroup and nearestCommonRoot
+ var current: Group? = oldGroup
+ while (current != null && current != nearestCommonRoot) {
+ if (current.isNode) recordUp()
+ current = current.parent
+ }
+
+ // Record downs from nearestCommonRoot to newGroup
+ doRecordDownsFor(newGroup, nearestCommonRoot)
+ }
+
+ private fun doRecordDownsFor(group: Group?, nearestCommonRoot: Group?) {
+ if (group != null && group != nearestCommonRoot) {
+ doRecordDownsFor(group.parent, nearestCommonRoot)
+ @Suppress("UNCHECKED_CAST")
+ if (group.isNode) recordDown(group.node as N)
+ }
+ }
+
+ /**
+ * Calculate the compound key (a semi-unique key produced for every group in the composition)
+ * for [group]. Passing in the [recomposeGroup] and [recomposeKey] allows this method to exit
+ * early.
+ */
+ private fun compoundKeyOf(group: Group?, recomposeGroup: Group, recomposeKey: Int): Int {
+ return if (group == recomposeGroup) recomposeKey else (compoundKeyOf(
+ (group ?: error("Detached group")).parent,
+ recomposeGroup,
+ recomposeKey
+ ) rol 3) xor group.key.hashCode()
+ }
+
internal fun invalidate(scope: RecomposeScope): InvalidationResult {
val location = scope.anchor?.location(slotTable)
?: return InvalidationResult.IGNORED // The scope never entered the composition
@@ -1439,8 +1552,12 @@
skipGroup()
} else {
val reader = reader
- val current = reader.current
- recomposeComponentRange(current, current + reader.groupSize)
+ val key = reader.groupKey
+ updateCompoundKeyWhenWeEnterGroup(key)
+ startReaderGroup(reader.isNode, reader.groupData)
+ recomposeToGroupEnd()
+ reader.endGroup()
+ updateCompoundKeyWhenWeExitGroup(key)
}
}
@@ -1457,8 +1574,7 @@
if (invalidations.isEmpty()) {
skipReaderToGroupEnd()
} else {
- val parentLocation = reader.parentLocation
- recomposeComponentRange(parentLocation, parentLocation + reader.parentSlots + 1)
+ recomposeToGroupEnd()
}
}
@@ -1470,7 +1586,7 @@
*/
fun startRestartGroup(key: Int) {
val location = reader.current
- start(key, false)
+ start(key, false, null)
if (inserting) {
val scope = RecomposeScope(this)
invalidateStack.push(scope)
@@ -1534,8 +1650,35 @@
internal fun hasInvalidations() = invalidations.isNotEmpty()
+ @Suppress("UNCHECKED_CAST")
+ private var SlotWriter.node
+ get() = nodeGroup.node as N
+ set(value) { nodeGroup.node = value }
+ private val SlotWriter.nodeGroup get() = get(current - 1) as NodeGroup
+ private fun SlotWriter.nodeGroupAt(location: Int) = get(location) as NodeGroup
+ private fun SlotWriter.nodeAt(location: Int) = nodeGroupAt(location).node
+ @Suppress("UNCHECKED_CAST")
+ private val SlotReader.node get() = nodeGroupAt(current - 1).node as N
+ private fun SlotReader.nodeGroupAt(location: Int) = get(location) as NodeGroup
+ @Suppress("UNCHECKED_CAST")
+ private fun SlotReader.nodeAt(location: Int) = nodeGroupAt(location).node as N
+
+ private fun validateNodeExpected() {
+ require(nodeExpected) {
+ "A call to createNode(), emitNode() or useNode() expected was not expected"
+ }
+ nodeExpected = false
+ }
+
+ private fun validateNodeNotExpected() {
+ require(!nodeExpected) { "A call to createNode(), emitNode() or useNode() expected" }
+ }
+
/**
- * Add a raw change to the change list.
+ * Add a raw change to the change list. Once [record] is called, the operation is realized
+ * into the change list. The helper routines below reduce the number of operations that must
+ * be realized to change the previous tree to the new tree as well as update the slot table
+ * to prepare for the next composition.
*/
private fun record(change: Change<N>) {
changes.add(change)
@@ -1547,6 +1690,7 @@
* and the slot table writer slot is the same as the current reader's slot.
*/
private fun recordOperation(change: Change<N>) {
+ realizeInsertUps()
realizeUps()
realizeDowns()
realizeOperationLocation(0)
@@ -1558,17 +1702,23 @@
* node.
*/
private fun recordApplierOperation(change: Change<N>) {
- realizeInsertApplier()
+ realizeInsertUps()
realizeUps()
realizeDowns()
record(change)
}
+ /**
+ * Record a change that will insert, remove or move a slot table group. This ensures the slot
+ * table is prepared for the change be ensuring the parent group is started and then ended
+ * as the group is left.
+ */
private fun recordSlotEditingOperation(offset: Int = 0, change: Change<N>) {
realizeOperationLocation(offset)
recordSlotEditing()
record(change)
}
+
/**
* Record a change ensuring, when it is applied, the write matches the current slot in the
* reader.
@@ -1579,19 +1729,14 @@
}
// Navigation of the node tree is performed by recording all the locations of the nodes as
- // they are traversed by the reader and recording them in the downNodes array with the
- // corresponding location of the start node for the location. When the node navigation is
- // realized all the downs in the down nodes is played to the applier and recording their
- // locations in the realizedDowns stack. Downing the applier, the current realized downs
- // are checked if they still apply and a corresponding up is called if they are not.
+ // they are traversed by the reader and recording them in the downNodes array. When the node
+ // navigation is realized all the downs in the down nodes is played to the applier.
//
// If an up is recorded before the corresponding down is realized then it is simply removed
// from the downNodes stack.
- private var realizedDowns = IntStack()
private var pendingUps = 0
private var downNodes = Stack<N>()
- private var downLocations = IntStack()
private fun realizeUps() {
val count = pendingUps
@@ -1601,39 +1746,32 @@
}
}
- private fun realizeDowns() {
- if (downNodes.isNotEmpty()) {
- for (index in 0 until downLocations.size) {
- realizedDowns.push(downLocations.peek(index))
+ private fun realizeDowns(nodes: Array<N>) {
+ record { applier, _, _ ->
+ for (index in nodes.indices) {
+ applier.down(nodes[index])
}
- @Suppress("UNCHECKED_CAST")
- val nodes = Array(downNodes.size) { index -> downNodes.peek(index) as Any } as Array<N>
- record { applier, _, _ ->
- for (index in nodes.indices) {
- applier.down(nodes[index])
- }
- }
- downNodes.clear()
- downLocations.clear()
}
}
- private fun recordDown() {
+ private fun realizeDowns() {
+ if (downNodes.isNotEmpty()) {
+ @Suppress("UNCHECKED_CAST")
+ realizeDowns(downNodes.toArray())
+ downNodes.clear()
+ }
+ }
+
+ private fun recordDown(node: N) {
@Suppress("UNCHECKED_CAST")
- downNodes.push(reader.get(reader.current) as N)
- downLocations.push(reader.parentLocation)
+ downNodes.push(node)
}
private fun recordUp() {
if (downNodes.isNotEmpty()) {
downNodes.pop()
- downLocations.pop()
} else {
- val parentLocation = reader.parentLocation
- if (realizedDowns.peekOr(-1) == parentLocation) {
- pendingUps++
- realizedDowns.pop()
- }
+ pendingUps++
}
}
@@ -1643,7 +1781,7 @@
pendingInsertUps++
}
- private fun realizeInsertApplier() {
+ private fun realizeInsertUps() {
if (pendingInsertUps > 0) {
val count = pendingInsertUps
record { applier, _, _ -> repeat(count) { applier.up() } }
@@ -1657,7 +1795,7 @@
// writersReaderDelta tracks the difference between reader's current slot the current of
// the writer must be before the recorded change is applied. Moving the writer to a location
// is performed by advancing the writer the same the number of slots traversed by the reader
- // since the last write change. This works transparently for inserts. For deletes the number
+ // since the last write change. This works transparently for inserts. For deletes the number
// of nodes deleted needs to be added to writersReaderDelta. When slots move the delta is
// updated as if the move has already taken place. The delta is updated again once the group
// begin edited is complete.
@@ -1668,8 +1806,23 @@
// recorded correctly in its internal data structures. The startedGroups stack maintains the
// groups that must be closed before we can move past the started group.
+ /**
+ * The skew or delta between where the writer will be and where the reader is now. This can
+ * be thought of as the unrealized distance the writer must move to match the current slot in
+ * the reader. When an operation affects the slot table the writer location must be realized
+ * by moving the writer slot table the unrealized distance.
+ */
private var writersReaderDelta = 0
+
+ /**
+ * Record whether any groups were stared. If no groups were started then the root group
+ * doesn't need to be started or ended either.
+ */
private var startedGroup = false
+
+ /**
+ * A stack of the location of the groups that were started.
+ */
private val startedGroups = IntStack()
private fun realizeOperationLocation(offset: Int) {
@@ -1707,7 +1860,7 @@
}
private fun recordFixup(change: Change<N>) {
- realizeInsertApplier()
+ realizeInsertUps()
val anchor = insertAnchor
val start = insertTable.anchorLocation(anchor)
val location = writer.current - start
@@ -1717,10 +1870,6 @@
insertFixups.add(change)
}
- private val removeCurrentGroupInstance: Change<N> = { _, slots, lifecycleManager ->
- removeCurrentGroup(slots, lifecycleManager)
- }
-
/**
* When a group is removed the reader will move but the writer will not so to ensure both the
* writer and reader are tracking the same slot we advance the [writersReaderDelta] to
@@ -1756,13 +1905,11 @@
}
}
- private val skipToEndGroupInstance: Change<N> = { _, slots, _ -> slots.skipToGroupEnd() }
private fun recordSkipToGroupEnd() {
recordSlotTableOperation(change = skipToEndGroupInstance)
writersReaderDelta = reader.current
}
- private val endGroupInstance: Change<N> = { _, slots, _ -> slots.endGroup() }
private fun recordEndGroup() {
val location = reader.parentLocation
val currentStartedGroup = startedGroups.peekOr(-1)
@@ -1781,13 +1928,10 @@
}
private fun finalizeCompose() {
- realizeInsertApplier()
+ realizeInsertUps()
realizeUps()
require(pendingStack.isEmpty()) { "Start/end imbalance" }
require(startedGroups.isEmpty()) { "Missed recording an endGroup()" }
- require(providersStack.size == 1) {
- "Provider stack imbalance, stack size ${providersStack.size}"
- }
cleanUpCompose()
}
@@ -1796,10 +1940,11 @@
nodeIndex = 0
groupNodeCount = 0
writersReaderDelta = 0
- startedGroups.clear()
+ currentCompoundKeyHash = 0
+ nodeExpected = false
startedGroup = false
- providersStack.clear()
- providersStack.push(-1 to buildableMapOf())
+ startedGroups.clear()
+ nodeCountOverrides.clear()
}
private var previousRemove = -1
@@ -1896,16 +2041,12 @@
updateCompoundKeyWhenWeEnterGroupKeyHash(groupKey.hashCode())
}
- @OptIn(ExperimentalStdlibApi::class)
private fun updateCompoundKeyWhenWeEnterGroupKeyHash(keyHash: Int) {
- keyHashesStack.push(keyHash)
- currentCompoundKeyHash = currentCompoundKeyHash.rotateLeft(3) xor keyHash
+ currentCompoundKeyHash = (currentCompoundKeyHash rol 3) xor keyHash
}
- @OptIn(ExperimentalStdlibApi::class)
- private fun updateCompoundKeyWhenWeExitGroup() {
- val keyHash = keyHashesStack.pop()
- currentCompoundKeyHash = (currentCompoundKeyHash xor keyHash).rotateRight(3)
+ private fun updateCompoundKeyWhenWeExitGroup(groupKey: Any) {
+ currentCompoundKeyHash = (currentCompoundKeyHash xor groupKey.hashCode()) ror 3
}
}
@@ -1999,7 +2140,7 @@
is CompositionLifecycleObserver -> {
lifecycleManager.leaving(slot)
}
- is GroupStart -> {
+ is Group -> {
groupEndStack.push(groupEnd)
groupEnd = index + slot.slots
}
@@ -2115,6 +2256,50 @@
return realFn(composer)
}
+private fun Group.distanceFrom(root: Group): Int {
+ var count = 0
+ var current: Group? = this
+ while (current != null && current != root) {
+ current = current.parent
+ count++
+ }
+ return count
+}
+
+// find the nearest common root
+private fun nearestCommonRootOf(a: Group, b: Group, common: Group): Group? {
+ // Early outs, to avoid calling distanceFrom in trivial cases
+ if (a == b) return a // A group is the nearest common root of itself
+ if (a == common || b == common) return common // If either is common then common is nearest
+ if (a.parent == b) return b // if b is a's parent b is the nearest common root
+ if (b.parent == a) return a // if a is b's parent a is the nearest common root
+ if (a.parent == b.parent) return a.parent // if a an b share a parent it is the nearest common
+
+ // Find the nearest using distance from common
+ var currentA: Group? = a
+ var currentB: Group? = b
+ val aDistance = a.distanceFrom(common)
+ val bDistance = b.distanceFrom(common)
+ repeat(aDistance - bDistance) { currentA = currentA?.parent }
+ repeat(bDistance - aDistance) { currentB = currentB?.parent }
+
+ // Both ca and cb are now the same distance from a known common root,
+ // therefore, the first parent that is the same is the lowest common root.
+ while (currentA != currentB) {
+ currentA = currentA?.parent
+ currentB = currentB?.parent
+ }
+
+ // ca == cb so it doesn't matter which is returned
+ return currentA
+}
+
+private val removeCurrentGroupInstance: Change<*> = { _, slots, lifecycleManager ->
+ removeCurrentGroup(slots, lifecycleManager)
+}
+private val skipToEndGroupInstance: Change<*> = { _, slots, _ -> slots.skipToGroupEnd() }
+private val endGroupInstance: Change<*> = { _, slots, _ -> slots.endGroup() }
+
@PublishedApi
internal val invocation = OpaqueKey("invocation")
@@ -2122,6 +2307,9 @@
internal val provider = OpaqueKey("provider")
@PublishedApi
+internal val ambientMap = OpaqueKey("ambientMap")
+
+@PublishedApi
internal val providerValues = OpaqueKey("providerValues")
@PublishedApi
diff --git a/compose/compose-runtime/src/commonMain/kotlin/androidx/compose/Recomposer.kt b/compose/compose-runtime/src/commonMain/kotlin/androidx/compose/Recomposer.kt
index f7e9f7a..4a3e288 100644
--- a/compose/compose-runtime/src/commonMain/kotlin/androidx/compose/Recomposer.kt
+++ b/compose/compose-runtime/src/commonMain/kotlin/androidx/compose/Recomposer.kt
@@ -77,6 +77,9 @@
composer.isComposing = composerWasComposing
}
// TODO(b/143755743)
+ if (!composerWasComposing) {
+ FrameManager.nextFrame()
+ }
composer.applyChanges()
if (!composerWasComposing) {
FrameManager.nextFrame()
diff --git a/compose/compose-runtime/src/commonMain/kotlin/androidx/compose/SlotTable.kt b/compose/compose-runtime/src/commonMain/kotlin/androidx/compose/SlotTable.kt
index 9aef41a..cbb94ad 100644
--- a/compose/compose-runtime/src/commonMain/kotlin/androidx/compose/SlotTable.kt
+++ b/compose/compose-runtime/src/commonMain/kotlin/androidx/compose/SlotTable.kt
@@ -26,7 +26,7 @@
internal val startStack = IntStack()
private val slots = table.slots
- private var currentGroup: GroupStart? = null
+ private var currentGroup: Group? = null
private var emptyCount = 0
private val nodeIndexStack = IntStack()
@@ -40,10 +40,14 @@
*/
val isGroup get() = current < currentEnd && calculateCurrentGroup() != null
+ internal val group get() = assumeGroup()
+ internal fun group(location: Int) = slots[location].asGroup
+ internal val parentGroup get() = slots[parentLocation].asGroup
+
/**
* Determine if the slot at [index] is the start of a group
*/
- fun isGroup(index: Int) = slots[index] is GroupStart
+ fun isGroup(index: Int) = slots[index] is Group
/**
* Determine if the slot is start of a node.
@@ -54,7 +58,7 @@
* Determine if the slot at [location] is a node group. This will throw if the slot at
* [location] is not a node.
*/
- fun isNode(location: Int) = slots[location].asGroupStart.isNode
+ fun isNode(location: Int) = slots[location].asGroup.isNode
/**
* Determine if the reader is at the end of a group and an [endGroup] or [endNode] is expected.
@@ -75,7 +79,7 @@
* Get the size of the group at [index]. Will throw an exception if [index] is not a group
* start.
*/
- fun groupSize(index: Int) = slots[index].asGroupStart.slots
+ fun groupSize(index: Int) = slots[index].asGroup.slots
/**
* Get location the end of the currently started group.
@@ -85,7 +89,12 @@
/**
* Get location of the end of the group at [index].
*/
- fun groupEnd(index: Int) = index + slots[index].asGroupStart.slots + 1
+ fun groupEnd(index: Int) = index + slots[index].asGroup.slots + 1
+
+ /**
+ * Get the data for the current group. Returns null if [current] is not a group
+ */
+ val groupData get() = if (current < currentEnd) calculateCurrentGroup()?.data else null
/**
* Get the key of the current group. Returns [EMPTY] if the [current] is not a group.
@@ -93,10 +102,15 @@
val groupKey get() = if (current < currentEnd) calculateCurrentGroup()?.key ?: EMPTY else EMPTY
/**
+ * Get the node associated with the group if there is one.
+ */
+ val groupNode get() = (assumeGroup() as? NodeGroup)?.node
+
+ /**
* Get the key of the group at [index]. Will throw an exception if [index] is not a group
* start.
*/
- fun groupKey(index: Int) = slots[index].asGroupStart.key
+ fun groupKey(index: Int) = slots[index].asGroup.key
/**
* Return the location of the parent group of the [current]
@@ -107,13 +121,13 @@
* Return the number of nodes where emitted into the current group.
*/
val parentNodes: Int get() =
- if (startStack.isEmpty()) 0 else slots[startStack.peek()].asGroupStart.nodes
+ if (startStack.isEmpty()) 0 else slots[startStack.peek()].asGroup.nodes
/**
* Return the number of slots are in the current group.
*/
val parentSlots: Int get() =
- if (startStack.isEmpty()) 0 else slots[startStack.peek()].asGroupStart.slots
+ if (startStack.isEmpty()) 0 else slots[startStack.peek()].asGroup.slots
/**
* Get the value stored at [anchor].
@@ -191,7 +205,7 @@
fun skipToGroupEnd() {
require(emptyCount == 0) { "Cannot skip the enclosing group while in an empty region" }
require(startStack.isNotEmpty()) { "No enclosing group to skip" }
- nodeIndex = slots[startStack.peek()].asGroupStart.nodes + nodeIndexStack.peek()
+ nodeIndex = slots[startStack.peek()].asGroup.nodes + nodeIndexStack.peek()
currentGroup = null
current = currentEnd
}
@@ -209,8 +223,8 @@
val startLocation = startStack.pop()
if (startStack.isEmpty()) return
val parentLocation = startStack.peekOr(0)
- val group = slots[startLocation].asGroupStart
- val parentGroup = slots[parentLocation].asGroupStart
+ val group = slots[startLocation].asGroup
+ val parentGroup = slots[parentLocation].asGroup
nodeIndex = nodeIndexStack.pop() + if (group.isNode) 1 else nodeIndex
currentEnd = parentGroup.slots + parentLocation + 1
currentGroup = null
@@ -234,8 +248,8 @@
var index = 0
while (current < currentEnd) {
val location = current
- val key = slots[location].asGroupStart.key
- result.add(KeyInfo(key, location, skipGroup(), index++))
+ val group = slots[location].asGroup
+ result.add(KeyInfo(group.key, location, skipGroup(), index++, group))
}
current = oldCurrent
this.nodeIndex = oldNodeIndex
@@ -251,16 +265,16 @@
nodeIndex = 0
val group = assumeGroup()
currentEnd = current + group.slots + 1
- require(group.kind == kind) { "Group kind changed" }
+ require(group.kind == kind || key == EMPTY) { "Group kind changed" }
require(key == EMPTY || key == group.key) { "Group key changed" }
current++
currentGroup = null
}
}
- private fun calculateCurrentGroup(): GroupStart? =
- (currentGroup ?: slots[current] as? GroupStart)?.also { currentGroup = it }
- private fun assumeGroup(): GroupStart = calculateCurrentGroup()
+ private fun calculateCurrentGroup(): Group? =
+ (currentGroup ?: slots[current] as? Group)?.also { currentGroup = it }
+ private fun assumeGroup(): Group = calculateCurrentGroup()
?: error("Expected a group start")
}
@@ -284,28 +298,32 @@
/**
* Return true if the current slot starts a group
*/
- val isGroup get() = current < currentEnd && get(current) is GroupStart
+ val isGroup get() = current < currentEnd && get(current) is Group
/**
* Return true if the slot at index starts a gorup
*/
- fun isGroup(index: Int) = get(index) is GroupStart
+ fun isGroup(index: Int) = get(index) is Group
+
+ internal fun group(location: Int) = slots[effectiveIndex(location)].asGroup
+
+ internal val parentGroup: Group get() = group(parentLocation)
/**
* Return true if the current slot starts a node. A node is a kind of group so this will
* return true for isGroup as well.
*/
- val isNode get() = current < currentEnd && (get(current) as? GroupStart)?.isNode ?: false
+ val isNode get() = current < currentEnd && (get(current) as? Group)?.isNode ?: false
/**
* Return the number of nodes in the group. isGroup must be true or this will throw.
*/
- val groupSize get() = get(current).asGroupStart.slots
+ val groupSize get() = get(current).asGroup.slots
/**
* Return the size of the group at index. isGroup(index) must be true of this will throw.
*/
- fun groupSize(index: Int): Int = get(index).asGroupStart.slots
+ fun groupSize(index: Int): Int = get(index).asGroup.slots
/**
* Get the number of nodes emitted to the group prior to the current slot.
@@ -318,7 +336,7 @@
val parentNodes: Int
get() {
return if (startStack.isEmpty()) 0
- else slots[effectiveIndex(startStack.peek())].asGroupStart.nodes
+ else slots[effectiveIndex(startStack.peek())].asGroup.nodes
}
/**
@@ -336,7 +354,7 @@
* Return the start location of the nearest group that contains the slot at [anchor].
*/
fun parentIndex(anchor: Anchor): Int {
- val group = get(anchor).asGroupStart
+ val group = get(anchor).asGroup
val location = table.anchorLocation(anchor)
val parent = group.parent
if (parent != null) {
@@ -381,7 +399,14 @@
}
/**
- * Set the value at the current slot.
+ * Updates the data for a data group
+ */
+ fun updateData(value: Any?) {
+ (get(current) as? DataGroup ?: error("Expected a data group")).data = value
+ }
+
+ /**
+ * Set the value at the slot previous to current.
*/
fun set(value: Any?) {
slots[effectiveIndex(current - 1)] = value
@@ -438,8 +463,8 @@
val parentLoc = parentLocation
if (parentLoc != location) {
if (startStack.isEmpty() && location > 0) ensureStarted(0)
- val currentParent = if (parentLoc >= 0) get(parentLocation).asGroupStart else null
- val newParent = get(location).asGroupStart
+ val currentParent = if (parentLoc >= 0) get(parentLocation).asGroup else null
+ val newParent = get(location).asGroup
// The new parent must be a (possibly indirect) child of the current parent
require(newParent.isDecendentOf(currentParent)) {
@@ -448,7 +473,7 @@
val oldCurrent = current
current = location
- startGroup(newParent.key, newParent.kind)
+ startGroup(newParent.key, newParent.kind, newParent.data)
current = oldCurrent
}
}
@@ -477,11 +502,11 @@
* @param key The group key. Passing EMPTY will retain as was written last time.
* An EMPTY key is not valid when inserting groups.
*/
- fun startGroup(key: Any) = startGroup(key, GROUP)
+ fun startGroup(key: Any) = startGroup(key, GROUP, null)
- private fun startGroup(key: Any, kind: GroupKind) {
+ private fun startGroup(key: Any, kind: GroupKind, data: Any?) {
val inserting = insertCount > 0
- val parent = if (startStack.isEmpty()) null else get(startStack.peek()).asGroupStart
+ val parent = if (startStack.isEmpty()) null else get(startStack.peek()).asGroup
startStack.push(current)
nodeCountStack.push(nodeCount)
@@ -491,13 +516,18 @@
endStack.push(slots.size - table.gapLen - currentEnd)
currentEnd = if (inserting) {
require(key != SlotTable.EMPTY) { "Inserting an EMPTY key" }
- update(GroupStart(kind, key, parent))
+ update(Group(kind, key, parent, data))
nodeCount = 0
current
} else {
- val group = advance().asGroupStart
+ val group = advance().asGroup
require(group.kind == kind) { "Group kind changed" }
require(key == SlotTable.EMPTY || group.key == key) { "Group key changed" }
+ if (kind == DATA) {
+ (group as? DataGroup ?: error("Expected a data group")).data = data
+ } else if (kind == NODE && data != null) {
+ (group as? NodeGroup ?: error("Expected a node group")).node = data
+ }
nodeCount = group.nodes
current + group.slots
}
@@ -523,7 +553,7 @@
// Update group length
val startLocation = startStack.pop()
- val group = get(startLocation).asGroupStart
+ val group = get(startLocation).asGroup
val cur = current
val oldSlots = group.slots
val oldNodes = group.nodes
@@ -536,7 +566,7 @@
table.clearGap()
} else if (startStack.isNotEmpty()) {
nodeCount = nodeCountStack.pop()
- val parent = get(startStack.peek()).asGroupStart
+ val parent = get(startStack.peek()).asGroup
if (group.parent == parent) {
nodeCount += if (inserting) {
if (group.isNode) 1 else newNodes
@@ -639,7 +669,12 @@
/**
* Start a node.
*/
- fun startNode(key: Any) = startGroup(key, NODE)
+ fun startNode(key: Any) = startGroup(key, NODE, null)
+
+ /**
+ * Start a node
+ */
+ fun startNode(key: Any, node: Any?) = startGroup(key, NODE, node)
/**
* End a node
@@ -647,6 +682,16 @@
fun endNode() = endGroup()
/**
+ * Start a data node.
+ */
+ fun startData(key: Any, data: Any?) = startGroup(key, DATA, data)
+
+ /**
+ * End a data node
+ */
+ fun endData() = endGroup()
+
+ /**
* Skip a node
*/
fun skipNode() = skipGroup()
@@ -702,7 +747,7 @@
tableWriter.moveGapTo(sourceEnd)
sourceSlots.copyInto(destSlots, current, sourceStart, sourceEnd)
- val group = get(destStart).asGroupStart
+ val group = get(destStart).asGroup
// Update the sizes of the parents of the group that was moved.
var currentGroup = group.parent
@@ -716,7 +761,7 @@
}
// Update the parent of the group moved.
- group.parent = get(startStack.peek()).asGroupStart
+ group.parent = get(startStack.peek()).asGroup
// Extract the anchors in range
val startAnchors = table.anchors.locationOf(sourceStart)
@@ -773,7 +818,7 @@
}
private fun advanceToNextGroup(): Int {
- val groupStart = advance().asGroupStart
+ val groupStart = advance().asGroup
current += groupStart.slots
return if (groupStart.isNode) 1 else groupStart.nodes
@@ -878,7 +923,7 @@
}
}
-private fun GroupStart.isDecendentOf(parent: GroupStart?): Boolean {
+private fun Group.isDecendentOf(parent: Group?): Boolean {
if (parent == null) return true
var current = this.parent
while (current != null) {
@@ -888,17 +933,43 @@
return false
}
-private val Any?.asGroupStart: GroupStart
- get() = this as? GroupStart ?: error("Expected a group start")
+private val Any?.asGroup: Group
+ get() = this as? Group ?: error("Expected a group")
-internal class GroupStart(
- val kind: GroupKind,
+internal fun Group(kind: GroupKind, key: Any, parent: Group?, data: Any?) =
+ when (kind) {
+ NODE -> NodeGroup(key, parent).also { it.node = data }
+ DATA -> DataGroup(key, parent, data)
+ else -> Group(key, parent)
+ }
+
+internal open class Group(
val key: Any,
- var parent: GroupStart?
+ var parent: Group?
) {
var slots: Int = 0
var nodes: Int = 0
- val isNode get() = kind == NODE
+ open val kind: GroupKind get() = GROUP
+ open val isNode get() = false
+ open val node: Any? get() = null
+ open val data: Any? get() = null
+}
+
+internal class NodeGroup(
+ key: Any,
+ parent: Group?
+) : Group(key, parent) {
+ override val kind: GroupKind get() = NODE
+ override val isNode get() = true
+ override var node: Any? = null
+}
+
+internal class DataGroup(
+ key: Any,
+ parent: Group?,
+ override var data: Any?
+) : Group(key, parent) {
+ override val kind: GroupKind get() = DATA
}
/**
@@ -1047,17 +1118,20 @@
fun verifyWellFormed() {
var current = 0
- fun validateGroup(parentLocation: Int, parent: GroupStart?): Int {
+ fun validateGroup(parentLocation: Int, parent: Group?): Int {
val location = current++
- val group = slots[location].asGroupStart
+ val group = slots[location].asGroup
require(group.parent == parent) { "Incorrect parent for group at $location" }
val end = location + group.slots + 1
val parentEnd = parentLocation + (parent?.slots?.let { it + 1 } ?: size)
require(end <= size) { "Group extends past then end of its table at $location" }
require(end <= parentEnd) { "Group extends past its parent at $location" }
+ require(!group.isNode || group.node != null) {
+ "Node groups must have a node at $location"
+ }
// Find the first child
- while (current < end && slots[current] !is GroupStart) current++
+ while (current < end && slots[current] !is Group) current++
// Validate the child groups
var nodeCount = 0
@@ -1225,11 +1299,12 @@
/**
* Information about groups and their keys.
*/
-class KeyInfo(
+class KeyInfo internal constructor(
/**
* The group key.
*/
val key: Any,
+
/**
* The location of the group.
*/
@@ -1243,7 +1318,12 @@
/**
* The index of the key info in the list returned by extractKeys
*/
- val index: Int
+ val index: Int,
+
+ /**
+ * The group
+ */
+ internal val group: Group
)
class Anchor(internal var loc: Int) {
@@ -1255,5 +1335,6 @@
private const val GROUP: GroupKind = 0
private const val NODE: GroupKind = 1
+private const val DATA: GroupKind = 2
private const val MIN_GROWTH_SIZE = 128
diff --git a/compose/compose-runtime/src/commonMain/kotlin/androidx/compose/Stack.kt b/compose/compose-runtime/src/commonMain/kotlin/androidx/compose/Stack.kt
index d6d2fb4..d825775 100644
--- a/compose/compose-runtime/src/commonMain/kotlin/androidx/compose/Stack.kt
+++ b/compose/compose-runtime/src/commonMain/kotlin/androidx/compose/Stack.kt
@@ -29,6 +29,8 @@
fun isEmpty() = backing.isEmpty()
fun isNotEmpty() = !isEmpty()
fun clear() = backing.clear()
+ @Suppress("UNCHECKED_CAST")
+ fun toArray(): Array<T> = Array<Any?>(backing.size) { backing[it] } as Array<T>
}
internal class IntStack {
diff --git a/compose/compose-runtime/src/unitTest/kotlin/androidx/compose/CompositionTests.kt b/compose/compose-runtime/src/unitTest/kotlin/androidx/compose/CompositionTests.kt
index 51a2515..2ce4b94 100644
--- a/compose/compose-runtime/src/unitTest/kotlin/androidx/compose/CompositionTests.kt
+++ b/compose/compose-runtime/src/unitTest/kotlin/androidx/compose/CompositionTests.kt
@@ -2060,6 +2060,269 @@
test()
}
}
+
+ @Test
+ fun evenOddRecomposeGroup() {
+ var includeEven = true
+ var includeOdd = true
+ val invalidates = mutableListOf<() -> Unit>()
+
+ fun invalidateComposition() {
+ for (invalidate in invalidates) {
+ invalidate()
+ }
+ invalidates.clear()
+ }
+
+ @Composable
+ fun MockComposeScope.wrapper(children: @Composable() () -> Unit) {
+ children()
+ }
+
+ @Composable
+ fun MockComposeScope.emitText() {
+ invalidates.add(invalidate)
+ if (includeOdd) {
+ key(1) {
+ text("odd 1")
+ }
+ }
+ if (includeEven) {
+ key(2) {
+ text("even 2")
+ }
+ }
+ if (includeOdd) {
+ key(3) {
+ text("odd 3")
+ }
+ }
+ if (includeEven) {
+ key(4) {
+ text("even 4")
+ }
+ }
+ }
+
+ @Composable
+ fun MockComposeScope.test() {
+ linear {
+ wrapper {
+ emitText()
+ }
+ emitText()
+ wrapper {
+ emitText()
+ }
+ emitText()
+ }
+ }
+
+ fun MockViewValidator.wrapper(children: () -> Unit) {
+ children()
+ }
+
+ fun MockViewValidator.emitText() {
+ if (includeOdd) {
+ text("odd 1")
+ }
+ if (includeEven) {
+ text("even 2")
+ }
+ if (includeOdd) {
+ text("odd 3")
+ }
+ if (includeEven) {
+ text("even 4")
+ }
+ }
+
+ fun MockViewValidator.test() {
+ linear {
+ wrapper {
+ emitText()
+ }
+ emitText()
+ wrapper {
+ emitText()
+ }
+ emitText()
+ }
+ }
+
+ val myComposition = compose {
+ test()
+ }
+
+ fun validate() {
+ validate(myComposition.root) {
+ test()
+ }
+ }
+ validate()
+
+ includeEven = false
+ invalidateComposition()
+ myComposition.expectChanges()
+ validate()
+
+ includeEven = true
+ includeOdd = false
+ invalidateComposition()
+ myComposition.expectChanges()
+ validate()
+
+ includeEven = false
+ includeOdd = false
+ invalidateComposition()
+ myComposition.expectChanges()
+ validate()
+
+ includeEven = true
+ invalidateComposition()
+ myComposition.expectChanges()
+ validate()
+
+ includeOdd = true
+ invalidateComposition()
+ myComposition.expectChanges()
+ validate()
+ }
+
+ @Test
+ fun evenOddWithMovement() {
+ var includeEven = true
+ var includeOdd = true
+ var order = listOf(1, 2, 3, 4)
+ val invalidates = mutableListOf<() -> Unit>()
+
+ fun invalidateComposition() {
+ for (invalidate in invalidates) {
+ invalidate()
+ }
+ invalidates.clear()
+ }
+
+ @Composable
+ fun MockComposeScope.wrapper(children: @Composable() () -> Unit) {
+ children()
+ }
+
+ @Composable
+ fun MockComposeScope.emitText(all: Boolean) {
+ invalidates.add(invalidate)
+ for (i in order) {
+ if (i % 2 == 1 && (all || includeOdd)) {
+ key(i) {
+ text("odd $i")
+ }
+ }
+ if (i % 2 == 0 && (all || includeEven)) {
+ key(i) {
+ text("even $i")
+ }
+ }
+ }
+ }
+
+ @Composable
+ fun MockComposeScope.test() {
+ linear {
+ invalidates.add(invalidate)
+ for (i in order) {
+ key(i) {
+ text("group $i")
+ if (i == 2 || (includeEven && includeOdd)) {
+ text("including everything")
+ } else {
+ if (includeEven) {
+ text("including evens")
+ }
+ if (includeOdd) {
+ text("including odds")
+ }
+ }
+ emitText(i == 2)
+ }
+ }
+ emitText(false)
+ }
+ }
+
+ fun MockViewValidator.emitText(all: Boolean) {
+ for (i in order) {
+ if (i % 2 == 1 && (includeOdd || all)) {
+ text("odd $i")
+ }
+ if (i % 2 == 0 && (includeEven || all)) {
+ text("even $i")
+ }
+ }
+ }
+
+ fun MockViewValidator.test() {
+ linear {
+ for (i in order) {
+ text("group $i")
+ if (i == 2 || (includeEven && includeOdd)) {
+ text("including everything")
+ } else {
+ if (includeEven) {
+ text("including evens")
+ }
+ if (includeOdd) {
+ text("including odds")
+ }
+ }
+ emitText(i == 2)
+ }
+ emitText(false)
+ }
+ }
+
+ val myComposition = compose {
+ test()
+ }
+
+ fun validate() {
+ validate(myComposition.root) {
+ test()
+ }
+ }
+ validate()
+
+ order = listOf(1, 2, 4, 3)
+ includeEven = false
+ invalidateComposition()
+ myComposition.expectChanges()
+ validate()
+
+ order = listOf(1, 4, 2, 3)
+ includeEven = true
+ includeOdd = false
+ invalidateComposition()
+ myComposition.expectChanges()
+ validate()
+
+ order = listOf(3, 4, 2, 1)
+ includeEven = false
+ includeOdd = false
+ invalidateComposition()
+ myComposition.expectChanges()
+ validate()
+
+ order = listOf(4, 3, 2, 1)
+ includeEven = true
+ invalidateComposition()
+ myComposition.expectChanges()
+ validate()
+
+ order = listOf(1, 2, 3, 4)
+ includeOdd = true
+ invalidateComposition()
+ myComposition.expectChanges()
+ validate()
+ }
}
private fun <T> assertArrayEquals(message: String, expected: Array<T>, received: Array<T>) {
diff --git a/compose/compose-runtime/src/unitTest/kotlin/androidx/compose/SlotTableTests.kt b/compose/compose-runtime/src/unitTest/kotlin/androidx/compose/SlotTableTests.kt
index 494dc0a..c5ad857 100644
--- a/compose/compose-runtime/src/unitTest/kotlin/androidx/compose/SlotTableTests.kt
+++ b/compose/compose-runtime/src/unitTest/kotlin/androidx/compose/SlotTableTests.kt
@@ -512,7 +512,7 @@
repeat(10) {
writer.startGroup(0)
repeat(3) {
- writer.startNode(1)
+ writer.startNode(1, 1)
writer.endNode()
}
assertEquals(3, writer.endGroup())
@@ -541,7 +541,7 @@
writer.startGroup(0)
repeat(3) {
writer.startGroup(0)
- writer.startNode(1)
+ writer.startNode(1, 1)
writer.endNode()
assertEquals(1, writer.endGroup())
}
@@ -565,7 +565,7 @@
writer.beginInsert()
repeat(2) {
writer.startGroup(0)
- writer.startNode(1)
+ writer.startNode(1, 1)
writer.endNode()
assertEquals(1, writer.endGroup())
}
@@ -594,7 +594,7 @@
writer.startGroup(0)
repeat(3) {
writer.startGroup(0)
- writer.startNode(1)
+ writer.startNode(1, 1)
writer.endNode()
assertEquals(1, writer.endGroup())
}
@@ -638,12 +638,12 @@
writer.beginInsert()
writer.startGroup(rootKey)
writer.startGroup(0)
- writer.startNode(1)
+ writer.startNode(1, 1)
repeat(10) {
- writer.startNode(1)
+ writer.startNode(1, 1)
writer.startGroup(0)
repeat(3) {
- writer.startNode(1)
+ writer.startNode(1, 1)
writer.endNode()
}
assertEquals(3, writer.endGroup())
@@ -664,12 +664,12 @@
writer.beginInsert()
writer.startGroup(rootKey)
writer.startGroup(0)
- writer.startNode(1)
+ writer.startNode(1, 1)
repeat(10) {
- writer.startNode(1)
+ writer.startNode(1, 1)
writer.startGroup(0)
repeat(3) {
- writer.startNode(1)
+ writer.startNode(1, 1)
writer.endNode()
}
assertEquals(3, writer.endGroup())
@@ -712,7 +712,7 @@
writer.startGroup(rootKey)
writer.startGroup(0)
repeat(10) {
- writer.startNode(1)
+ writer.startNode(1, 1)
writer.endNode()
}
writer.endGroup()
@@ -749,7 +749,7 @@
writer.startGroup(0)
writer.startGroup(1)
writer.endGroup()
- writer.startNode(2)
+ writer.startNode(2, 2)
writer.endNode()
writer.endGroup()
writer.endInsert()
@@ -779,7 +779,7 @@
assertEquals(false, writer.isGroup)
writer.endGroup()
assertEquals(true, writer.isNode)
- writer.startNode(2)
+ writer.startNode(2, 2)
assertEquals(false, writer.isNode)
writer.endNode()
writer.endGroup()
@@ -802,7 +802,7 @@
}
fun element(key: Any, block: () -> Unit) {
- writer.startNode(key)
+ writer.startNode(key, key)
block()
writer.endNode()
}
@@ -1000,7 +1000,7 @@
}
fun element(key: Any, block: () -> Unit) {
- writer.startNode(key)
+ writer.startNode(key, key)
block()
writer.endNode()
}
@@ -1150,7 +1150,7 @@
}
val movedAnchors = mutableSetOf<Anchor>()
- slotsToMove.forEachIndexed() { index, anchor ->
+ slotsToMove.forEachIndexed { index, anchor ->
try {
if (anchor !in movedAnchors) {
destTable.write { writer ->
@@ -1223,7 +1223,7 @@
}
fun element(key: Any, block: () -> Unit) {
- writer.startNode(key)
+ writer.startNode(key, key)
block()
writer.endNode()
}
@@ -1260,7 +1260,7 @@
}
fun element(key: Int, block: () -> Unit) {
- writer.startNode(key)
+ writer.startNode(key, key)
block()
writer.endNode()
}
diff --git a/compose/compose-runtime/src/unitTest/kotlin/androidx/compose/mock/View.kt b/compose/compose-runtime/src/unitTest/kotlin/androidx/compose/mock/View.kt
index 1951853..8c6eb96 100644
--- a/compose/compose-runtime/src/unitTest/kotlin/androidx/compose/mock/View.kt
+++ b/compose/compose-runtime/src/unitTest/kotlin/androidx/compose/mock/View.kt
@@ -16,8 +16,8 @@
package androidx.compose.mock
-fun indent(indent: Int) {
- repeat(indent) { print(' ') }
+fun indent(indent: Int, builder: StringBuilder) {
+ repeat(indent) { builder.append(' ') }
}
open class View {
@@ -25,20 +25,23 @@
val children = mutableListOf<View>()
val attributes = mutableMapOf<String, Any>()
- fun render(indent: Int = 0) {
- indent(indent)
- print("<$name$attributesAsString")
+ private fun render(indent: Int = 0, builder: StringBuilder) {
+ indent(indent, builder)
+ builder.append("<$name$attributesAsString")
if (children.size > 0) {
- println(">")
- children.forEach { it.render(indent + 2) }
- indent(indent)
- println("</$name>")
+ builder.appendln(">")
+ children.forEach { it.render(indent + 2, builder) }
+ indent(indent, builder)
+ builder.appendln("</$name>")
} else {
- println(" />")
+ builder.appendln(" />")
}
}
- fun addAt(index: Int, view: View) { children.add(index, view) }
+ fun addAt(index: Int, view: View) {
+ children.add(index, view)
+ }
+
fun removeAt(index: Int, count: Int) {
if (index < children.count()) {
if (count == 1) {
@@ -48,6 +51,7 @@
}
}
}
+
fun moveAt(from: Int, to: Int, count: Int) {
if (count == 1) {
val insertLocation = if (from > to) to else (to - 1)
@@ -90,4 +94,9 @@
children.map { it.toString() }.joinToString(" ")
override fun toString() = "<$name$attributesAsString>$childrenAsString</$name>"
+
+ fun toFmtString() = StringBuilder().let {
+ render(0, it)
+ it.toString()
+ }
}
diff --git a/concurrent/futures-ktx/api/1.1.0-beta01.txt b/concurrent/futures-ktx/api/1.1.0-beta01.txt
index bff1b13..6c14320 100644
--- a/concurrent/futures-ktx/api/1.1.0-beta01.txt
+++ b/concurrent/futures-ktx/api/1.1.0-beta01.txt
@@ -2,7 +2,7 @@
package androidx.concurrent.futures {
public final class ListenableFutureKt {
- method public static suspend <T> Object! await(com.google.common.util.concurrent.ListenableFuture<T>, kotlin.coroutines.Continuation<? super T> p);
+ method public static suspend <T> Object? await(com.google.common.util.concurrent.ListenableFuture<T>, kotlin.coroutines.Continuation<? super T> p);
}
}
diff --git a/concurrent/futures-ktx/api/api_lint.ignore b/concurrent/futures-ktx/api/api_lint.ignore
index 0d817eb..042ebc4 100644
--- a/concurrent/futures-ktx/api/api_lint.ignore
+++ b/concurrent/futures-ktx/api/api_lint.ignore
@@ -1,7 +1,3 @@
// Baseline format: 1.0
DocumentExceptions: androidx.concurrent.futures.ListenableFutureKt#await(com.google.common.util.concurrent.ListenableFuture<T>, kotlin.coroutines.Continuation<? super T>):
Method ListenableFutureKt.await appears to be throwing java.lang.Throwable; this should be recorded with a @Throws annotation; see https://android.github.io/kotlin-guides/interop.html#document-exceptions
-
-
-MissingNullability: androidx.concurrent.futures.ListenableFutureKt#await(com.google.common.util.concurrent.ListenableFuture<T>, kotlin.coroutines.Continuation<? super T>):
- Missing nullability on method `await` return
diff --git a/concurrent/futures-ktx/api/current.txt b/concurrent/futures-ktx/api/current.txt
index bff1b13..6c14320 100644
--- a/concurrent/futures-ktx/api/current.txt
+++ b/concurrent/futures-ktx/api/current.txt
@@ -2,7 +2,7 @@
package androidx.concurrent.futures {
public final class ListenableFutureKt {
- method public static suspend <T> Object! await(com.google.common.util.concurrent.ListenableFuture<T>, kotlin.coroutines.Continuation<? super T> p);
+ method public static suspend <T> Object? await(com.google.common.util.concurrent.ListenableFuture<T>, kotlin.coroutines.Continuation<? super T> p);
}
}
diff --git a/concurrent/futures-ktx/api/public_plus_experimental_1.1.0-beta01.txt b/concurrent/futures-ktx/api/public_plus_experimental_1.1.0-beta01.txt
index bff1b13..6c14320 100644
--- a/concurrent/futures-ktx/api/public_plus_experimental_1.1.0-beta01.txt
+++ b/concurrent/futures-ktx/api/public_plus_experimental_1.1.0-beta01.txt
@@ -2,7 +2,7 @@
package androidx.concurrent.futures {
public final class ListenableFutureKt {
- method public static suspend <T> Object! await(com.google.common.util.concurrent.ListenableFuture<T>, kotlin.coroutines.Continuation<? super T> p);
+ method public static suspend <T> Object? await(com.google.common.util.concurrent.ListenableFuture<T>, kotlin.coroutines.Continuation<? super T> p);
}
}
diff --git a/concurrent/futures-ktx/api/public_plus_experimental_current.txt b/concurrent/futures-ktx/api/public_plus_experimental_current.txt
index bff1b13..6c14320 100644
--- a/concurrent/futures-ktx/api/public_plus_experimental_current.txt
+++ b/concurrent/futures-ktx/api/public_plus_experimental_current.txt
@@ -2,7 +2,7 @@
package androidx.concurrent.futures {
public final class ListenableFutureKt {
- method public static suspend <T> Object! await(com.google.common.util.concurrent.ListenableFuture<T>, kotlin.coroutines.Continuation<? super T> p);
+ method public static suspend <T> Object? await(com.google.common.util.concurrent.ListenableFuture<T>, kotlin.coroutines.Continuation<? super T> p);
}
}
diff --git a/concurrent/futures-ktx/api/restricted_1.1.0-beta01.txt b/concurrent/futures-ktx/api/restricted_1.1.0-beta01.txt
index bff1b13..6c14320 100644
--- a/concurrent/futures-ktx/api/restricted_1.1.0-beta01.txt
+++ b/concurrent/futures-ktx/api/restricted_1.1.0-beta01.txt
@@ -2,7 +2,7 @@
package androidx.concurrent.futures {
public final class ListenableFutureKt {
- method public static suspend <T> Object! await(com.google.common.util.concurrent.ListenableFuture<T>, kotlin.coroutines.Continuation<? super T> p);
+ method public static suspend <T> Object? await(com.google.common.util.concurrent.ListenableFuture<T>, kotlin.coroutines.Continuation<? super T> p);
}
}
diff --git a/concurrent/futures-ktx/api/restricted_current.txt b/concurrent/futures-ktx/api/restricted_current.txt
index bff1b13..6c14320 100644
--- a/concurrent/futures-ktx/api/restricted_current.txt
+++ b/concurrent/futures-ktx/api/restricted_current.txt
@@ -2,7 +2,7 @@
package androidx.concurrent.futures {
public final class ListenableFutureKt {
- method public static suspend <T> Object! await(com.google.common.util.concurrent.ListenableFuture<T>, kotlin.coroutines.Continuation<? super T> p);
+ method public static suspend <T> Object? await(com.google.common.util.concurrent.ListenableFuture<T>, kotlin.coroutines.Continuation<? super T> p);
}
}
diff --git a/core/core-ktx/api/1.4.0-alpha01.ignore b/core/core-ktx/api/1.4.0-alpha01.ignore
new file mode 100644
index 0000000..618a0f6
--- /dev/null
+++ b/core/core-ktx/api/1.4.0-alpha01.ignore
@@ -0,0 +1,7 @@
+// Baseline format: 1.0
+InvalidNullConversion: androidx.core.text.SpannedStringKt#getSpans(android.text.Spanned, int, int):
+ Attempted to remove @NonNull annotation from method androidx.core.text.SpannedStringKt.getSpans(android.text.Spanned,int,int)
+
+
+RemovedMethod: androidx.core.view.ViewKt#updateLayoutParamsTyped(android.view.View, kotlin.jvm.functions.Function1<? super T,kotlin.Unit>):
+ Removed method androidx.core.view.ViewKt.updateLayoutParamsTyped(android.view.View,kotlin.jvm.functions.Function1<? super T,kotlin.Unit>)
diff --git a/core/core-ktx/api/1.4.0-alpha01.txt b/core/core-ktx/api/1.4.0-alpha01.txt
index 8b85ea4..d7b9bd6 100644
--- a/core/core-ktx/api/1.4.0-alpha01.txt
+++ b/core/core-ktx/api/1.4.0-alpha01.txt
@@ -365,7 +365,7 @@
}
public final class SpannedStringKt {
- method public static inline <reified T> T![] getSpans(android.text.Spanned, int start = 0, int end = length);
+ 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);
}
@@ -424,7 +424,7 @@
}
public final class 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 inline <K, V> android.util.LruCache<K,V> lruCache(int maxSize, kotlin.jvm.functions.Function2<? super K,? super V,java.lang.Integer> sizeOf = { _, _ -> return 1 }, kotlin.jvm.functions.Function1<? super K,? extends V> create = { return null as V }, kotlin.jvm.functions.Function4<? super java.lang.Boolean,? super K,? super V,? super V,kotlin.Unit> onEntryRemoved = { _, _, _, _ -> });
}
public final class PairKt {
@@ -582,7 +582,7 @@
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 <reified T> void updateLayoutParams(android.view.View, kotlin.jvm.functions.Function1<? super T,? extends 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);
}
diff --git a/core/core-ktx/api/current.txt b/core/core-ktx/api/current.txt
index 8b85ea4..d7b9bd6 100644
--- a/core/core-ktx/api/current.txt
+++ b/core/core-ktx/api/current.txt
@@ -365,7 +365,7 @@
}
public final class SpannedStringKt {
- method public static inline <reified T> T![] getSpans(android.text.Spanned, int start = 0, int end = length);
+ 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);
}
@@ -424,7 +424,7 @@
}
public final class 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 inline <K, V> android.util.LruCache<K,V> lruCache(int maxSize, kotlin.jvm.functions.Function2<? super K,? super V,java.lang.Integer> sizeOf = { _, _ -> return 1 }, kotlin.jvm.functions.Function1<? super K,? extends V> create = { return null as V }, kotlin.jvm.functions.Function4<? super java.lang.Boolean,? super K,? super V,? super V,kotlin.Unit> onEntryRemoved = { _, _, _, _ -> });
}
public final class PairKt {
@@ -582,7 +582,7 @@
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 <reified T> void updateLayoutParams(android.view.View, kotlin.jvm.functions.Function1<? super T,? extends 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);
}
diff --git a/core/core-ktx/api/public_plus_experimental_1.4.0-alpha01.txt b/core/core-ktx/api/public_plus_experimental_1.4.0-alpha01.txt
index 8b85ea4..d7b9bd6 100644
--- a/core/core-ktx/api/public_plus_experimental_1.4.0-alpha01.txt
+++ b/core/core-ktx/api/public_plus_experimental_1.4.0-alpha01.txt
@@ -365,7 +365,7 @@
}
public final class SpannedStringKt {
- method public static inline <reified T> T![] getSpans(android.text.Spanned, int start = 0, int end = length);
+ 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);
}
@@ -424,7 +424,7 @@
}
public final class 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 inline <K, V> android.util.LruCache<K,V> lruCache(int maxSize, kotlin.jvm.functions.Function2<? super K,? super V,java.lang.Integer> sizeOf = { _, _ -> return 1 }, kotlin.jvm.functions.Function1<? super K,? extends V> create = { return null as V }, kotlin.jvm.functions.Function4<? super java.lang.Boolean,? super K,? super V,? super V,kotlin.Unit> onEntryRemoved = { _, _, _, _ -> });
}
public final class PairKt {
@@ -582,7 +582,7 @@
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 <reified T> void updateLayoutParams(android.view.View, kotlin.jvm.functions.Function1<? super T,? extends 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);
}
diff --git a/core/core-ktx/api/public_plus_experimental_current.txt b/core/core-ktx/api/public_plus_experimental_current.txt
index 8b85ea4..d7b9bd6 100644
--- a/core/core-ktx/api/public_plus_experimental_current.txt
+++ b/core/core-ktx/api/public_plus_experimental_current.txt
@@ -365,7 +365,7 @@
}
public final class SpannedStringKt {
- method public static inline <reified T> T![] getSpans(android.text.Spanned, int start = 0, int end = length);
+ 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);
}
@@ -424,7 +424,7 @@
}
public final class 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 inline <K, V> android.util.LruCache<K,V> lruCache(int maxSize, kotlin.jvm.functions.Function2<? super K,? super V,java.lang.Integer> sizeOf = { _, _ -> return 1 }, kotlin.jvm.functions.Function1<? super K,? extends V> create = { return null as V }, kotlin.jvm.functions.Function4<? super java.lang.Boolean,? super K,? super V,? super V,kotlin.Unit> onEntryRemoved = { _, _, _, _ -> });
}
public final class PairKt {
@@ -582,7 +582,7 @@
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 <reified T> void updateLayoutParams(android.view.View, kotlin.jvm.functions.Function1<? super T,? extends 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);
}
diff --git a/core/core-ktx/api/restricted_1.4.0-alpha01.ignore b/core/core-ktx/api/restricted_1.4.0-alpha01.ignore
new file mode 100644
index 0000000..618a0f6
--- /dev/null
+++ b/core/core-ktx/api/restricted_1.4.0-alpha01.ignore
@@ -0,0 +1,7 @@
+// Baseline format: 1.0
+InvalidNullConversion: androidx.core.text.SpannedStringKt#getSpans(android.text.Spanned, int, int):
+ Attempted to remove @NonNull annotation from method androidx.core.text.SpannedStringKt.getSpans(android.text.Spanned,int,int)
+
+
+RemovedMethod: androidx.core.view.ViewKt#updateLayoutParamsTyped(android.view.View, kotlin.jvm.functions.Function1<? super T,kotlin.Unit>):
+ Removed method androidx.core.view.ViewKt.updateLayoutParamsTyped(android.view.View,kotlin.jvm.functions.Function1<? super T,kotlin.Unit>)
diff --git a/core/core-ktx/api/restricted_1.4.0-alpha01.txt b/core/core-ktx/api/restricted_1.4.0-alpha01.txt
index 8b85ea4..d7b9bd6 100644
--- a/core/core-ktx/api/restricted_1.4.0-alpha01.txt
+++ b/core/core-ktx/api/restricted_1.4.0-alpha01.txt
@@ -365,7 +365,7 @@
}
public final class SpannedStringKt {
- method public static inline <reified T> T![] getSpans(android.text.Spanned, int start = 0, int end = length);
+ 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);
}
@@ -424,7 +424,7 @@
}
public final class 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 inline <K, V> android.util.LruCache<K,V> lruCache(int maxSize, kotlin.jvm.functions.Function2<? super K,? super V,java.lang.Integer> sizeOf = { _, _ -> return 1 }, kotlin.jvm.functions.Function1<? super K,? extends V> create = { return null as V }, kotlin.jvm.functions.Function4<? super java.lang.Boolean,? super K,? super V,? super V,kotlin.Unit> onEntryRemoved = { _, _, _, _ -> });
}
public final class PairKt {
@@ -582,7 +582,7 @@
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 <reified T> void updateLayoutParams(android.view.View, kotlin.jvm.functions.Function1<? super T,? extends 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);
}
diff --git a/core/core-ktx/api/restricted_current.txt b/core/core-ktx/api/restricted_current.txt
index 8b85ea4..d7b9bd6 100644
--- a/core/core-ktx/api/restricted_current.txt
+++ b/core/core-ktx/api/restricted_current.txt
@@ -365,7 +365,7 @@
}
public final class SpannedStringKt {
- method public static inline <reified T> T![] getSpans(android.text.Spanned, int start = 0, int end = length);
+ 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);
}
@@ -424,7 +424,7 @@
}
public final class 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 inline <K, V> android.util.LruCache<K,V> lruCache(int maxSize, kotlin.jvm.functions.Function2<? super K,? super V,java.lang.Integer> sizeOf = { _, _ -> return 1 }, kotlin.jvm.functions.Function1<? super K,? extends V> create = { return null as V }, kotlin.jvm.functions.Function4<? super java.lang.Boolean,? super K,? super V,? super V,kotlin.Unit> onEntryRemoved = { _, _, _, _ -> });
}
public final class PairKt {
@@ -582,7 +582,7 @@
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 <reified T> void updateLayoutParams(android.view.View, kotlin.jvm.functions.Function1<? super T,? extends 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);
}
diff --git a/core/core-role/src/main/java/androidx/core/role/RoleManagerCompat.java b/core/core-role/src/main/java/androidx/core/role/RoleManagerCompat.java
index fee2d79..38f250a 100644
--- a/core/core-role/src/main/java/androidx/core/role/RoleManagerCompat.java
+++ b/core/core-role/src/main/java/androidx/core/role/RoleManagerCompat.java
@@ -178,7 +178,8 @@
* <p>
* To qualify for this role, an application needs to implement
* {@link android.telecom.CallScreeningService}. The application will be able to screen calls
- * and provide call identification.
+ * and provide call identification. The application will also be able to display over other apps
+ * on Android 11 or above.
*
* @see android.telecom.CallScreeningService
*/
diff --git a/core/core/api/api_lint.ignore b/core/core/api/api_lint.ignore
index 021d52e..116fb6e 100644
--- a/core/core/api/api_lint.ignore
+++ b/core/core/api/api_lint.ignore
@@ -1341,10 +1341,6 @@
Missing nullability on parameter `view` in method `canScrollHorizontally`
MissingNullability: androidx.core.view.ViewCompat#canScrollVertically(android.view.View, int) parameter #0:
Missing nullability on parameter `view` in method `canScrollVertically`
-MissingNullability: androidx.core.view.ViewCompat#dispatchApplyWindowInsets(android.view.View, androidx.core.view.WindowInsetsCompat):
- Missing nullability on method `dispatchApplyWindowInsets` return
-MissingNullability: androidx.core.view.ViewCompat#dispatchApplyWindowInsets(android.view.View, androidx.core.view.WindowInsetsCompat) parameter #1:
- Missing nullability on parameter `insets` in method `dispatchApplyWindowInsets`
MissingNullability: androidx.core.view.ViewCompat#enableAccessibleClickableSpanSupport(android.view.View) parameter #0:
Missing nullability on parameter `view` in method `enableAccessibleClickableSpanSupport`
MissingNullability: androidx.core.view.ViewCompat#getAccessibilityNodeProvider(android.view.View):
@@ -1407,10 +1403,6 @@
Missing nullability on method `keyboardNavigationClusterSearch` return
MissingNullability: androidx.core.view.ViewCompat#keyboardNavigationClusterSearch(android.view.View, android.view.View, int) parameter #1:
Missing nullability on parameter `currentCluster` in method `keyboardNavigationClusterSearch`
-MissingNullability: androidx.core.view.ViewCompat#onApplyWindowInsets(android.view.View, androidx.core.view.WindowInsetsCompat):
- Missing nullability on method `onApplyWindowInsets` return
-MissingNullability: androidx.core.view.ViewCompat#onApplyWindowInsets(android.view.View, androidx.core.view.WindowInsetsCompat) parameter #1:
- Missing nullability on parameter `insets` in method `onApplyWindowInsets`
MissingNullability: androidx.core.view.ViewCompat#onInitializeAccessibilityEvent(android.view.View, android.view.accessibility.AccessibilityEvent) parameter #0:
Missing nullability on parameter `v` in method `onInitializeAccessibilityEvent`
MissingNullability: androidx.core.view.ViewCompat#onInitializeAccessibilityEvent(android.view.View, android.view.accessibility.AccessibilityEvent) parameter #1:
@@ -1455,8 +1447,6 @@
Missing nullability on parameter `view` in method `setLayerType`
MissingNullability: androidx.core.view.ViewCompat#setLayerType(android.view.View, int, android.graphics.Paint) parameter #2:
Missing nullability on parameter `paint` in method `setLayerType`
-MissingNullability: androidx.core.view.ViewCompat#setOnApplyWindowInsetsListener(android.view.View, androidx.core.view.OnApplyWindowInsetsListener) parameter #1:
- Missing nullability on parameter `listener` in method `setOnApplyWindowInsetsListener`
MissingNullability: androidx.core.view.ViewCompat#setOverScrollMode(android.view.View, int) parameter #0:
Missing nullability on parameter `v` in method `setOverScrollMode`
MissingNullability: androidx.core.view.ViewCompat#setPivotX(android.view.View, float) parameter #0:
diff --git a/datastore/datastore-core/api/1.0.0-alpha01.txt b/datastore/datastore-core/api/1.0.0-alpha01.txt
index 4ac156f..fbcafff 100644
--- a/datastore/datastore-core/api/1.0.0-alpha01.txt
+++ b/datastore/datastore-core/api/1.0.0-alpha01.txt
@@ -3,12 +3,12 @@
public interface DataStore<T> {
method public kotlinx.coroutines.flow.Flow<T> getDataFlow();
- method public suspend Object! updateData(kotlin.jvm.functions.Function2<? super T,? super kotlin.coroutines.Continuation<? super T>,?> transform, kotlin.coroutines.Continuation<? super T> p);
+ method public suspend Object? updateData(kotlin.jvm.functions.Function2<? super T,? super kotlin.coroutines.Continuation<? super T>,?> transform, kotlin.coroutines.Continuation<? super T> p);
property public abstract kotlinx.coroutines.flow.Flow<T> dataFlow;
}
public static interface DataStore.InitializerApi<T> {
- method public suspend Object! updateData(kotlin.jvm.functions.Function2<? super T,? super kotlin.coroutines.Continuation<? super T>,?> transform, kotlin.coroutines.Continuation<? super T> p);
+ method public suspend Object? updateData(kotlin.jvm.functions.Function2<? super T,? super kotlin.coroutines.Continuation<? super T>,?> transform, kotlin.coroutines.Continuation<? super T> p);
}
public static interface DataStore.Serializer<T> {
@@ -21,7 +21,7 @@
public final class SingleProcessDataStore<T> implements androidx.datastore.DataStore<T> {
ctor public SingleProcessDataStore(kotlin.jvm.functions.Function0<? extends java.io.File> produceFile, androidx.datastore.DataStore.Serializer<T> serializer, java.util.List<? extends kotlin.jvm.functions.Function2<? super androidx.datastore.DataStore.InitializerApi<T>,? super kotlin.coroutines.Continuation<? super kotlin.Unit>,?>> initTasksList, kotlinx.coroutines.CoroutineScope scope);
method public kotlinx.coroutines.flow.Flow<T> getDataFlow();
- method public suspend Object! updateData(kotlin.jvm.functions.Function2<? super T,? super kotlin.coroutines.Continuation<? super T>,?> transform, kotlin.coroutines.Continuation<? super T> p);
+ method public suspend Object? updateData(kotlin.jvm.functions.Function2<? super T,? super kotlin.coroutines.Continuation<? super T>,?> transform, kotlin.coroutines.Continuation<? super T> p);
property public kotlinx.coroutines.flow.Flow<T> dataFlow;
}
diff --git a/datastore/datastore-core/api/api_lint.ignore b/datastore/datastore-core/api/api_lint.ignore
deleted file mode 100644
index dbccae3..0000000
--- a/datastore/datastore-core/api/api_lint.ignore
+++ /dev/null
@@ -1,7 +0,0 @@
-// Baseline format: 1.0
-MissingNullability: androidx.datastore.DataStore#updateData(kotlin.jvm.functions.Function2<? super T,? super kotlin.coroutines.Continuation<? super T>,?>, kotlin.coroutines.Continuation<? super T>):
- Missing nullability on method `updateData` return
-MissingNullability: androidx.datastore.DataStore.InitializerApi#updateData(kotlin.jvm.functions.Function2<? super T,? super kotlin.coroutines.Continuation<? super T>,?>, kotlin.coroutines.Continuation<? super T>):
- Missing nullability on method `updateData` return
-MissingNullability: androidx.datastore.SingleProcessDataStore#updateData(kotlin.jvm.functions.Function2<? super T,? super kotlin.coroutines.Continuation<? super T>,?>, kotlin.coroutines.Continuation<? super T>):
- Missing nullability on method `updateData` return
diff --git a/datastore/datastore-core/api/current.txt b/datastore/datastore-core/api/current.txt
index 4ac156f..fbcafff 100644
--- a/datastore/datastore-core/api/current.txt
+++ b/datastore/datastore-core/api/current.txt
@@ -3,12 +3,12 @@
public interface DataStore<T> {
method public kotlinx.coroutines.flow.Flow<T> getDataFlow();
- method public suspend Object! updateData(kotlin.jvm.functions.Function2<? super T,? super kotlin.coroutines.Continuation<? super T>,?> transform, kotlin.coroutines.Continuation<? super T> p);
+ method public suspend Object? updateData(kotlin.jvm.functions.Function2<? super T,? super kotlin.coroutines.Continuation<? super T>,?> transform, kotlin.coroutines.Continuation<? super T> p);
property public abstract kotlinx.coroutines.flow.Flow<T> dataFlow;
}
public static interface DataStore.InitializerApi<T> {
- method public suspend Object! updateData(kotlin.jvm.functions.Function2<? super T,? super kotlin.coroutines.Continuation<? super T>,?> transform, kotlin.coroutines.Continuation<? super T> p);
+ method public suspend Object? updateData(kotlin.jvm.functions.Function2<? super T,? super kotlin.coroutines.Continuation<? super T>,?> transform, kotlin.coroutines.Continuation<? super T> p);
}
public static interface DataStore.Serializer<T> {
@@ -21,7 +21,7 @@
public final class SingleProcessDataStore<T> implements androidx.datastore.DataStore<T> {
ctor public SingleProcessDataStore(kotlin.jvm.functions.Function0<? extends java.io.File> produceFile, androidx.datastore.DataStore.Serializer<T> serializer, java.util.List<? extends kotlin.jvm.functions.Function2<? super androidx.datastore.DataStore.InitializerApi<T>,? super kotlin.coroutines.Continuation<? super kotlin.Unit>,?>> initTasksList, kotlinx.coroutines.CoroutineScope scope);
method public kotlinx.coroutines.flow.Flow<T> getDataFlow();
- method public suspend Object! updateData(kotlin.jvm.functions.Function2<? super T,? super kotlin.coroutines.Continuation<? super T>,?> transform, kotlin.coroutines.Continuation<? super T> p);
+ method public suspend Object? updateData(kotlin.jvm.functions.Function2<? super T,? super kotlin.coroutines.Continuation<? super T>,?> transform, kotlin.coroutines.Continuation<? super T> p);
property public kotlinx.coroutines.flow.Flow<T> dataFlow;
}
diff --git a/datastore/datastore-core/api/public_plus_experimental_1.0.0-alpha01.txt b/datastore/datastore-core/api/public_plus_experimental_1.0.0-alpha01.txt
index 4ac156f..fbcafff 100644
--- a/datastore/datastore-core/api/public_plus_experimental_1.0.0-alpha01.txt
+++ b/datastore/datastore-core/api/public_plus_experimental_1.0.0-alpha01.txt
@@ -3,12 +3,12 @@
public interface DataStore<T> {
method public kotlinx.coroutines.flow.Flow<T> getDataFlow();
- method public suspend Object! updateData(kotlin.jvm.functions.Function2<? super T,? super kotlin.coroutines.Continuation<? super T>,?> transform, kotlin.coroutines.Continuation<? super T> p);
+ method public suspend Object? updateData(kotlin.jvm.functions.Function2<? super T,? super kotlin.coroutines.Continuation<? super T>,?> transform, kotlin.coroutines.Continuation<? super T> p);
property public abstract kotlinx.coroutines.flow.Flow<T> dataFlow;
}
public static interface DataStore.InitializerApi<T> {
- method public suspend Object! updateData(kotlin.jvm.functions.Function2<? super T,? super kotlin.coroutines.Continuation<? super T>,?> transform, kotlin.coroutines.Continuation<? super T> p);
+ method public suspend Object? updateData(kotlin.jvm.functions.Function2<? super T,? super kotlin.coroutines.Continuation<? super T>,?> transform, kotlin.coroutines.Continuation<? super T> p);
}
public static interface DataStore.Serializer<T> {
@@ -21,7 +21,7 @@
public final class SingleProcessDataStore<T> implements androidx.datastore.DataStore<T> {
ctor public SingleProcessDataStore(kotlin.jvm.functions.Function0<? extends java.io.File> produceFile, androidx.datastore.DataStore.Serializer<T> serializer, java.util.List<? extends kotlin.jvm.functions.Function2<? super androidx.datastore.DataStore.InitializerApi<T>,? super kotlin.coroutines.Continuation<? super kotlin.Unit>,?>> initTasksList, kotlinx.coroutines.CoroutineScope scope);
method public kotlinx.coroutines.flow.Flow<T> getDataFlow();
- method public suspend Object! updateData(kotlin.jvm.functions.Function2<? super T,? super kotlin.coroutines.Continuation<? super T>,?> transform, kotlin.coroutines.Continuation<? super T> p);
+ method public suspend Object? updateData(kotlin.jvm.functions.Function2<? super T,? super kotlin.coroutines.Continuation<? super T>,?> transform, kotlin.coroutines.Continuation<? super T> p);
property public kotlinx.coroutines.flow.Flow<T> dataFlow;
}
diff --git a/datastore/datastore-core/api/public_plus_experimental_current.txt b/datastore/datastore-core/api/public_plus_experimental_current.txt
index 4ac156f..fbcafff 100644
--- a/datastore/datastore-core/api/public_plus_experimental_current.txt
+++ b/datastore/datastore-core/api/public_plus_experimental_current.txt
@@ -3,12 +3,12 @@
public interface DataStore<T> {
method public kotlinx.coroutines.flow.Flow<T> getDataFlow();
- method public suspend Object! updateData(kotlin.jvm.functions.Function2<? super T,? super kotlin.coroutines.Continuation<? super T>,?> transform, kotlin.coroutines.Continuation<? super T> p);
+ method public suspend Object? updateData(kotlin.jvm.functions.Function2<? super T,? super kotlin.coroutines.Continuation<? super T>,?> transform, kotlin.coroutines.Continuation<? super T> p);
property public abstract kotlinx.coroutines.flow.Flow<T> dataFlow;
}
public static interface DataStore.InitializerApi<T> {
- method public suspend Object! updateData(kotlin.jvm.functions.Function2<? super T,? super kotlin.coroutines.Continuation<? super T>,?> transform, kotlin.coroutines.Continuation<? super T> p);
+ method public suspend Object? updateData(kotlin.jvm.functions.Function2<? super T,? super kotlin.coroutines.Continuation<? super T>,?> transform, kotlin.coroutines.Continuation<? super T> p);
}
public static interface DataStore.Serializer<T> {
@@ -21,7 +21,7 @@
public final class SingleProcessDataStore<T> implements androidx.datastore.DataStore<T> {
ctor public SingleProcessDataStore(kotlin.jvm.functions.Function0<? extends java.io.File> produceFile, androidx.datastore.DataStore.Serializer<T> serializer, java.util.List<? extends kotlin.jvm.functions.Function2<? super androidx.datastore.DataStore.InitializerApi<T>,? super kotlin.coroutines.Continuation<? super kotlin.Unit>,?>> initTasksList, kotlinx.coroutines.CoroutineScope scope);
method public kotlinx.coroutines.flow.Flow<T> getDataFlow();
- method public suspend Object! updateData(kotlin.jvm.functions.Function2<? super T,? super kotlin.coroutines.Continuation<? super T>,?> transform, kotlin.coroutines.Continuation<? super T> p);
+ method public suspend Object? updateData(kotlin.jvm.functions.Function2<? super T,? super kotlin.coroutines.Continuation<? super T>,?> transform, kotlin.coroutines.Continuation<? super T> p);
property public kotlinx.coroutines.flow.Flow<T> dataFlow;
}
diff --git a/datastore/datastore-core/api/restricted_1.0.0-alpha01.txt b/datastore/datastore-core/api/restricted_1.0.0-alpha01.txt
index 4ac156f..fbcafff 100644
--- a/datastore/datastore-core/api/restricted_1.0.0-alpha01.txt
+++ b/datastore/datastore-core/api/restricted_1.0.0-alpha01.txt
@@ -3,12 +3,12 @@
public interface DataStore<T> {
method public kotlinx.coroutines.flow.Flow<T> getDataFlow();
- method public suspend Object! updateData(kotlin.jvm.functions.Function2<? super T,? super kotlin.coroutines.Continuation<? super T>,?> transform, kotlin.coroutines.Continuation<? super T> p);
+ method public suspend Object? updateData(kotlin.jvm.functions.Function2<? super T,? super kotlin.coroutines.Continuation<? super T>,?> transform, kotlin.coroutines.Continuation<? super T> p);
property public abstract kotlinx.coroutines.flow.Flow<T> dataFlow;
}
public static interface DataStore.InitializerApi<T> {
- method public suspend Object! updateData(kotlin.jvm.functions.Function2<? super T,? super kotlin.coroutines.Continuation<? super T>,?> transform, kotlin.coroutines.Continuation<? super T> p);
+ method public suspend Object? updateData(kotlin.jvm.functions.Function2<? super T,? super kotlin.coroutines.Continuation<? super T>,?> transform, kotlin.coroutines.Continuation<? super T> p);
}
public static interface DataStore.Serializer<T> {
@@ -21,7 +21,7 @@
public final class SingleProcessDataStore<T> implements androidx.datastore.DataStore<T> {
ctor public SingleProcessDataStore(kotlin.jvm.functions.Function0<? extends java.io.File> produceFile, androidx.datastore.DataStore.Serializer<T> serializer, java.util.List<? extends kotlin.jvm.functions.Function2<? super androidx.datastore.DataStore.InitializerApi<T>,? super kotlin.coroutines.Continuation<? super kotlin.Unit>,?>> initTasksList, kotlinx.coroutines.CoroutineScope scope);
method public kotlinx.coroutines.flow.Flow<T> getDataFlow();
- method public suspend Object! updateData(kotlin.jvm.functions.Function2<? super T,? super kotlin.coroutines.Continuation<? super T>,?> transform, kotlin.coroutines.Continuation<? super T> p);
+ method public suspend Object? updateData(kotlin.jvm.functions.Function2<? super T,? super kotlin.coroutines.Continuation<? super T>,?> transform, kotlin.coroutines.Continuation<? super T> p);
property public kotlinx.coroutines.flow.Flow<T> dataFlow;
}
diff --git a/datastore/datastore-core/api/restricted_current.txt b/datastore/datastore-core/api/restricted_current.txt
index 4ac156f..fbcafff 100644
--- a/datastore/datastore-core/api/restricted_current.txt
+++ b/datastore/datastore-core/api/restricted_current.txt
@@ -3,12 +3,12 @@
public interface DataStore<T> {
method public kotlinx.coroutines.flow.Flow<T> getDataFlow();
- method public suspend Object! updateData(kotlin.jvm.functions.Function2<? super T,? super kotlin.coroutines.Continuation<? super T>,?> transform, kotlin.coroutines.Continuation<? super T> p);
+ method public suspend Object? updateData(kotlin.jvm.functions.Function2<? super T,? super kotlin.coroutines.Continuation<? super T>,?> transform, kotlin.coroutines.Continuation<? super T> p);
property public abstract kotlinx.coroutines.flow.Flow<T> dataFlow;
}
public static interface DataStore.InitializerApi<T> {
- method public suspend Object! updateData(kotlin.jvm.functions.Function2<? super T,? super kotlin.coroutines.Continuation<? super T>,?> transform, kotlin.coroutines.Continuation<? super T> p);
+ method public suspend Object? updateData(kotlin.jvm.functions.Function2<? super T,? super kotlin.coroutines.Continuation<? super T>,?> transform, kotlin.coroutines.Continuation<? super T> p);
}
public static interface DataStore.Serializer<T> {
@@ -21,7 +21,7 @@
public final class SingleProcessDataStore<T> implements androidx.datastore.DataStore<T> {
ctor public SingleProcessDataStore(kotlin.jvm.functions.Function0<? extends java.io.File> produceFile, androidx.datastore.DataStore.Serializer<T> serializer, java.util.List<? extends kotlin.jvm.functions.Function2<? super androidx.datastore.DataStore.InitializerApi<T>,? super kotlin.coroutines.Continuation<? super kotlin.Unit>,?>> initTasksList, kotlinx.coroutines.CoroutineScope scope);
method public kotlinx.coroutines.flow.Flow<T> getDataFlow();
- method public suspend Object! updateData(kotlin.jvm.functions.Function2<? super T,? super kotlin.coroutines.Continuation<? super T>,?> transform, kotlin.coroutines.Continuation<? super T> p);
+ method public suspend Object? updateData(kotlin.jvm.functions.Function2<? super T,? super kotlin.coroutines.Continuation<? super T>,?> transform, kotlin.coroutines.Continuation<? super T> p);
property public kotlinx.coroutines.flow.Flow<T> dataFlow;
}
diff --git a/enterprise/feedback/testing/api/1.1.0-alpha01.txt b/enterprise/feedback/testing/api/1.1.0-alpha01.txt
index 9c90bc0..beb926b 100644
--- a/enterprise/feedback/testing/api/1.1.0-alpha01.txt
+++ b/enterprise/feedback/testing/api/1.1.0-alpha01.txt
@@ -2,6 +2,7 @@
package androidx.enterprise.feedback {
public class FakeKeyedAppStatesReporter extends androidx.enterprise.feedback.KeyedAppStatesReporter {
+ ctor public FakeKeyedAppStatesReporter();
method public java.util.List<androidx.enterprise.feedback.KeyedAppState!> getKeyedAppStates();
method public java.util.Map<java.lang.String!,androidx.enterprise.feedback.KeyedAppState!> getKeyedAppStatesByKey();
method public int getNumberOfUploads();
diff --git a/enterprise/feedback/testing/api/current.txt b/enterprise/feedback/testing/api/current.txt
index 9c90bc0..beb926b 100644
--- a/enterprise/feedback/testing/api/current.txt
+++ b/enterprise/feedback/testing/api/current.txt
@@ -2,6 +2,7 @@
package androidx.enterprise.feedback {
public class FakeKeyedAppStatesReporter extends androidx.enterprise.feedback.KeyedAppStatesReporter {
+ ctor public FakeKeyedAppStatesReporter();
method public java.util.List<androidx.enterprise.feedback.KeyedAppState!> getKeyedAppStates();
method public java.util.Map<java.lang.String!,androidx.enterprise.feedback.KeyedAppState!> getKeyedAppStatesByKey();
method public int getNumberOfUploads();
diff --git a/enterprise/feedback/testing/api/public_plus_experimental_1.1.0-alpha01.txt b/enterprise/feedback/testing/api/public_plus_experimental_1.1.0-alpha01.txt
index 9c90bc0..beb926b 100644
--- a/enterprise/feedback/testing/api/public_plus_experimental_1.1.0-alpha01.txt
+++ b/enterprise/feedback/testing/api/public_plus_experimental_1.1.0-alpha01.txt
@@ -2,6 +2,7 @@
package androidx.enterprise.feedback {
public class FakeKeyedAppStatesReporter extends androidx.enterprise.feedback.KeyedAppStatesReporter {
+ ctor public FakeKeyedAppStatesReporter();
method public java.util.List<androidx.enterprise.feedback.KeyedAppState!> getKeyedAppStates();
method public java.util.Map<java.lang.String!,androidx.enterprise.feedback.KeyedAppState!> getKeyedAppStatesByKey();
method public int getNumberOfUploads();
diff --git a/enterprise/feedback/testing/api/public_plus_experimental_current.txt b/enterprise/feedback/testing/api/public_plus_experimental_current.txt
index 9c90bc0..beb926b 100644
--- a/enterprise/feedback/testing/api/public_plus_experimental_current.txt
+++ b/enterprise/feedback/testing/api/public_plus_experimental_current.txt
@@ -2,6 +2,7 @@
package androidx.enterprise.feedback {
public class FakeKeyedAppStatesReporter extends androidx.enterprise.feedback.KeyedAppStatesReporter {
+ ctor public FakeKeyedAppStatesReporter();
method public java.util.List<androidx.enterprise.feedback.KeyedAppState!> getKeyedAppStates();
method public java.util.Map<java.lang.String!,androidx.enterprise.feedback.KeyedAppState!> getKeyedAppStatesByKey();
method public int getNumberOfUploads();
diff --git a/enterprise/feedback/testing/api/restricted_1.1.0-alpha01.txt b/enterprise/feedback/testing/api/restricted_1.1.0-alpha01.txt
index 9c90bc0..beb926b 100644
--- a/enterprise/feedback/testing/api/restricted_1.1.0-alpha01.txt
+++ b/enterprise/feedback/testing/api/restricted_1.1.0-alpha01.txt
@@ -2,6 +2,7 @@
package androidx.enterprise.feedback {
public class FakeKeyedAppStatesReporter extends androidx.enterprise.feedback.KeyedAppStatesReporter {
+ ctor public FakeKeyedAppStatesReporter();
method public java.util.List<androidx.enterprise.feedback.KeyedAppState!> getKeyedAppStates();
method public java.util.Map<java.lang.String!,androidx.enterprise.feedback.KeyedAppState!> getKeyedAppStatesByKey();
method public int getNumberOfUploads();
diff --git a/enterprise/feedback/testing/api/restricted_current.txt b/enterprise/feedback/testing/api/restricted_current.txt
index 9c90bc0..beb926b 100644
--- a/enterprise/feedback/testing/api/restricted_current.txt
+++ b/enterprise/feedback/testing/api/restricted_current.txt
@@ -2,6 +2,7 @@
package androidx.enterprise.feedback {
public class FakeKeyedAppStatesReporter extends androidx.enterprise.feedback.KeyedAppStatesReporter {
+ ctor public FakeKeyedAppStatesReporter();
method public java.util.List<androidx.enterprise.feedback.KeyedAppState!> getKeyedAppStates();
method public java.util.Map<java.lang.String!,androidx.enterprise.feedback.KeyedAppState!> getKeyedAppStatesByKey();
method public int getNumberOfUploads();
diff --git a/fragment/fragment-ktx/api/1.3.0-alpha05.ignore b/fragment/fragment-ktx/api/1.3.0-alpha05.ignore
new file mode 100644
index 0000000..4da20b8
--- /dev/null
+++ b/fragment/fragment-ktx/api/1.3.0-alpha05.ignore
@@ -0,0 +1,21 @@
+// Baseline format: 1.0
+ChangedType: androidx.fragment.app.FragmentViewModelLazyKt#activityViewModels(androidx.fragment.app.Fragment, kotlin.jvm.functions.Function0<? extends androidx.lifecycle.ViewModelProvider.Factory>):
+ Method androidx.fragment.app.FragmentViewModelLazyKt.activityViewModels has changed return type from kotlin.Lazy<VM> to kotlin.Lazy<? extends VM>
+ChangedType: androidx.fragment.app.FragmentViewModelLazyKt#viewModels(androidx.fragment.app.Fragment, kotlin.jvm.functions.Function0<? extends androidx.lifecycle.ViewModelStoreOwner>, kotlin.jvm.functions.Function0<? extends androidx.lifecycle.ViewModelProvider.Factory>):
+ Method androidx.fragment.app.FragmentViewModelLazyKt.viewModels has changed return type from kotlin.Lazy<VM> to kotlin.Lazy<? extends VM>
+
+
+InvalidNullConversion: androidx.fragment.app.FragmentTransactionKt#add(androidx.fragment.app.FragmentTransaction, String, android.os.Bundle):
+ Attempted to remove @NonNull annotation from method androidx.fragment.app.FragmentTransactionKt.add(androidx.fragment.app.FragmentTransaction,String,android.os.Bundle)
+InvalidNullConversion: androidx.fragment.app.FragmentTransactionKt#add(androidx.fragment.app.FragmentTransaction, int, String, android.os.Bundle):
+ Attempted to remove @NonNull annotation from method androidx.fragment.app.FragmentTransactionKt.add(androidx.fragment.app.FragmentTransaction,int,String,android.os.Bundle)
+InvalidNullConversion: androidx.fragment.app.FragmentTransactionKt#add(androidx.fragment.app.FragmentTransaction, int, String, android.os.Bundle) parameter #2:
+ Attempted to change parameter from @Nullable to @NonNull: incompatible change for parameter tag in androidx.fragment.app.FragmentTransactionKt.add(androidx.fragment.app.FragmentTransaction arg1, int containerViewId, String tag, android.os.Bundle args)
+InvalidNullConversion: androidx.fragment.app.FragmentTransactionKt#replace(androidx.fragment.app.FragmentTransaction, int, String, android.os.Bundle):
+ Attempted to remove @NonNull annotation from method androidx.fragment.app.FragmentTransactionKt.replace(androidx.fragment.app.FragmentTransaction,int,String,android.os.Bundle)
+InvalidNullConversion: androidx.fragment.app.FragmentTransactionKt#replace(androidx.fragment.app.FragmentTransaction, int, String, android.os.Bundle) parameter #2:
+ Attempted to change parameter from @Nullable to @NonNull: incompatible change for parameter tag in androidx.fragment.app.FragmentTransactionKt.replace(androidx.fragment.app.FragmentTransaction arg1, int containerViewId, String tag, android.os.Bundle args)
+InvalidNullConversion: androidx.fragment.app.FragmentViewModelLazyKt#activityViewModels(androidx.fragment.app.Fragment, kotlin.jvm.functions.Function0<? extends androidx.lifecycle.ViewModelProvider.Factory>):
+ Attempted to remove @NonNull annotation from method androidx.fragment.app.FragmentViewModelLazyKt.activityViewModels(androidx.fragment.app.Fragment,kotlin.jvm.functions.Function0<? extends androidx.lifecycle.ViewModelProvider.Factory>)
+InvalidNullConversion: androidx.fragment.app.FragmentViewModelLazyKt#viewModels(androidx.fragment.app.Fragment, kotlin.jvm.functions.Function0<? extends androidx.lifecycle.ViewModelStoreOwner>, kotlin.jvm.functions.Function0<? extends androidx.lifecycle.ViewModelProvider.Factory>):
+ Attempted to remove @NonNull annotation from method androidx.fragment.app.FragmentViewModelLazyKt.viewModels(androidx.fragment.app.Fragment,kotlin.jvm.functions.Function0<? extends androidx.lifecycle.ViewModelStoreOwner>,kotlin.jvm.functions.Function0<? extends androidx.lifecycle.ViewModelProvider.Factory>)
diff --git a/fragment/fragment-ktx/api/1.3.0-alpha05.txt b/fragment/fragment-ktx/api/1.3.0-alpha05.txt
index a00fd44..7fc1d63 100644
--- a/fragment/fragment-ktx/api/1.3.0-alpha05.txt
+++ b/fragment/fragment-ktx/api/1.3.0-alpha05.txt
@@ -2,8 +2,10 @@
package androidx.fragment.app {
public final class FragmentKt {
- method public static void setFragmentResult(androidx.fragment.app.Fragment, String requestKey, android.os.Bundle? result);
- method public static void setFragmentResultListener(androidx.fragment.app.Fragment, String requestKey, kotlin.jvm.functions.Function2<? super java.lang.String,? super android.os.Bundle,kotlin.Unit>? listener);
+ method public static void clearFragmentResult(androidx.fragment.app.Fragment, String requestKey);
+ method public static void clearFragmentResultListener(androidx.fragment.app.Fragment, String requestKey);
+ method public static void setFragmentResult(androidx.fragment.app.Fragment, String requestKey, android.os.Bundle result);
+ method public static inline void setFragmentResultListener(androidx.fragment.app.Fragment, String requestKey, kotlin.jvm.functions.Function2<? super java.lang.String,? super android.os.Bundle,kotlin.Unit> listener);
}
public final class FragmentManagerKt {
@@ -13,19 +15,19 @@
}
public final class FragmentResultOwnerKt {
- method public static void setFragmentResultListener(androidx.fragment.app.FragmentResultOwner, String requestKey, androidx.lifecycle.LifecycleOwner lifecycleOwner, kotlin.jvm.functions.Function2<? super java.lang.String,? super android.os.Bundle,kotlin.Unit>? listener);
+ method public static inline void setFragmentResultListener(androidx.fragment.app.FragmentResultOwner, String requestKey, androidx.lifecycle.LifecycleOwner lifecycleOwner, kotlin.jvm.functions.Function2<? super java.lang.String,? super android.os.Bundle,kotlin.Unit> listener);
}
public final class FragmentTransactionKt {
- method public static inline <reified F extends androidx.fragment.app.Fragment> androidx.fragment.app.FragmentTransaction add(androidx.fragment.app.FragmentTransaction, @IdRes int containerViewId, String? tag = null, android.os.Bundle? args = null);
- method public static inline <reified F extends androidx.fragment.app.Fragment> androidx.fragment.app.FragmentTransaction add(androidx.fragment.app.FragmentTransaction, String tag, android.os.Bundle? args = null);
- method public static inline <reified F extends androidx.fragment.app.Fragment> androidx.fragment.app.FragmentTransaction replace(androidx.fragment.app.FragmentTransaction, @IdRes int containerViewId, String? tag = null, android.os.Bundle? args = null);
+ method public static inline <reified F> androidx.fragment.app.FragmentTransaction! add(androidx.fragment.app.FragmentTransaction, @IdRes int containerViewId, String tag = null, android.os.Bundle? args = null);
+ method public static inline <reified F> androidx.fragment.app.FragmentTransaction! add(androidx.fragment.app.FragmentTransaction, String tag, android.os.Bundle? args = null);
+ method public static inline <reified F> androidx.fragment.app.FragmentTransaction! replace(androidx.fragment.app.FragmentTransaction, @IdRes int containerViewId, String tag = null, android.os.Bundle? args = null);
}
public final class 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 inline <reified VM> kotlin.Lazy<? extends 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.ViewModelStore> storeProducer, 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);
+ method @MainThread public static inline <reified VM> kotlin.Lazy<? extends VM>! viewModels(androidx.fragment.app.Fragment, kotlin.jvm.functions.Function0<? extends androidx.lifecycle.ViewModelStoreOwner> ownerProducer = { return this }, kotlin.jvm.functions.Function0<? extends androidx.lifecycle.ViewModelProvider.Factory>? factoryProducer = null);
}
public final class ViewKt {
diff --git a/fragment/fragment-ktx/api/api_lint.ignore b/fragment/fragment-ktx/api/api_lint.ignore
new file mode 100644
index 0000000..a8ac758
--- /dev/null
+++ b/fragment/fragment-ktx/api/api_lint.ignore
@@ -0,0 +1,11 @@
+// Baseline format: 1.0
+MissingNullability: androidx.fragment.app.FragmentTransactionKt#add(androidx.fragment.app.FragmentTransaction, String, android.os.Bundle):
+ Missing nullability on method `add` return
+MissingNullability: androidx.fragment.app.FragmentTransactionKt#add(androidx.fragment.app.FragmentTransaction, int, String, android.os.Bundle):
+ Missing nullability on method `add` return
+MissingNullability: androidx.fragment.app.FragmentTransactionKt#replace(androidx.fragment.app.FragmentTransaction, int, String, android.os.Bundle):
+ Missing nullability on method `replace` return
+MissingNullability: androidx.fragment.app.FragmentViewModelLazyKt#activityViewModels(androidx.fragment.app.Fragment, kotlin.jvm.functions.Function0<? extends androidx.lifecycle.ViewModelProvider.Factory>):
+ Missing nullability on method `activityViewModels` return
+MissingNullability: androidx.fragment.app.FragmentViewModelLazyKt#viewModels(androidx.fragment.app.Fragment, kotlin.jvm.functions.Function0<? extends androidx.lifecycle.ViewModelStoreOwner>, kotlin.jvm.functions.Function0<? extends androidx.lifecycle.ViewModelProvider.Factory>):
+ Missing nullability on method `viewModels` return
diff --git a/fragment/fragment-ktx/api/current.txt b/fragment/fragment-ktx/api/current.txt
index a00fd44..7fc1d63 100644
--- a/fragment/fragment-ktx/api/current.txt
+++ b/fragment/fragment-ktx/api/current.txt
@@ -2,8 +2,10 @@
package androidx.fragment.app {
public final class FragmentKt {
- method public static void setFragmentResult(androidx.fragment.app.Fragment, String requestKey, android.os.Bundle? result);
- method public static void setFragmentResultListener(androidx.fragment.app.Fragment, String requestKey, kotlin.jvm.functions.Function2<? super java.lang.String,? super android.os.Bundle,kotlin.Unit>? listener);
+ method public static void clearFragmentResult(androidx.fragment.app.Fragment, String requestKey);
+ method public static void clearFragmentResultListener(androidx.fragment.app.Fragment, String requestKey);
+ method public static void setFragmentResult(androidx.fragment.app.Fragment, String requestKey, android.os.Bundle result);
+ method public static inline void setFragmentResultListener(androidx.fragment.app.Fragment, String requestKey, kotlin.jvm.functions.Function2<? super java.lang.String,? super android.os.Bundle,kotlin.Unit> listener);
}
public final class FragmentManagerKt {
@@ -13,19 +15,19 @@
}
public final class FragmentResultOwnerKt {
- method public static void setFragmentResultListener(androidx.fragment.app.FragmentResultOwner, String requestKey, androidx.lifecycle.LifecycleOwner lifecycleOwner, kotlin.jvm.functions.Function2<? super java.lang.String,? super android.os.Bundle,kotlin.Unit>? listener);
+ method public static inline void setFragmentResultListener(androidx.fragment.app.FragmentResultOwner, String requestKey, androidx.lifecycle.LifecycleOwner lifecycleOwner, kotlin.jvm.functions.Function2<? super java.lang.String,? super android.os.Bundle,kotlin.Unit> listener);
}
public final class FragmentTransactionKt {
- method public static inline <reified F extends androidx.fragment.app.Fragment> androidx.fragment.app.FragmentTransaction add(androidx.fragment.app.FragmentTransaction, @IdRes int containerViewId, String? tag = null, android.os.Bundle? args = null);
- method public static inline <reified F extends androidx.fragment.app.Fragment> androidx.fragment.app.FragmentTransaction add(androidx.fragment.app.FragmentTransaction, String tag, android.os.Bundle? args = null);
- method public static inline <reified F extends androidx.fragment.app.Fragment> androidx.fragment.app.FragmentTransaction replace(androidx.fragment.app.FragmentTransaction, @IdRes int containerViewId, String? tag = null, android.os.Bundle? args = null);
+ method public static inline <reified F> androidx.fragment.app.FragmentTransaction! add(androidx.fragment.app.FragmentTransaction, @IdRes int containerViewId, String tag = null, android.os.Bundle? args = null);
+ method public static inline <reified F> androidx.fragment.app.FragmentTransaction! add(androidx.fragment.app.FragmentTransaction, String tag, android.os.Bundle? args = null);
+ method public static inline <reified F> androidx.fragment.app.FragmentTransaction! replace(androidx.fragment.app.FragmentTransaction, @IdRes int containerViewId, String tag = null, android.os.Bundle? args = null);
}
public final class 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 inline <reified VM> kotlin.Lazy<? extends 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.ViewModelStore> storeProducer, 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);
+ method @MainThread public static inline <reified VM> kotlin.Lazy<? extends VM>! viewModels(androidx.fragment.app.Fragment, kotlin.jvm.functions.Function0<? extends androidx.lifecycle.ViewModelStoreOwner> ownerProducer = { return this }, kotlin.jvm.functions.Function0<? extends androidx.lifecycle.ViewModelProvider.Factory>? factoryProducer = null);
}
public final class ViewKt {
diff --git a/fragment/fragment-ktx/api/public_plus_experimental_1.3.0-alpha05.txt b/fragment/fragment-ktx/api/public_plus_experimental_1.3.0-alpha05.txt
index a00fd44..7fc1d63 100644
--- a/fragment/fragment-ktx/api/public_plus_experimental_1.3.0-alpha05.txt
+++ b/fragment/fragment-ktx/api/public_plus_experimental_1.3.0-alpha05.txt
@@ -2,8 +2,10 @@
package androidx.fragment.app {
public final class FragmentKt {
- method public static void setFragmentResult(androidx.fragment.app.Fragment, String requestKey, android.os.Bundle? result);
- method public static void setFragmentResultListener(androidx.fragment.app.Fragment, String requestKey, kotlin.jvm.functions.Function2<? super java.lang.String,? super android.os.Bundle,kotlin.Unit>? listener);
+ method public static void clearFragmentResult(androidx.fragment.app.Fragment, String requestKey);
+ method public static void clearFragmentResultListener(androidx.fragment.app.Fragment, String requestKey);
+ method public static void setFragmentResult(androidx.fragment.app.Fragment, String requestKey, android.os.Bundle result);
+ method public static inline void setFragmentResultListener(androidx.fragment.app.Fragment, String requestKey, kotlin.jvm.functions.Function2<? super java.lang.String,? super android.os.Bundle,kotlin.Unit> listener);
}
public final class FragmentManagerKt {
@@ -13,19 +15,19 @@
}
public final class FragmentResultOwnerKt {
- method public static void setFragmentResultListener(androidx.fragment.app.FragmentResultOwner, String requestKey, androidx.lifecycle.LifecycleOwner lifecycleOwner, kotlin.jvm.functions.Function2<? super java.lang.String,? super android.os.Bundle,kotlin.Unit>? listener);
+ method public static inline void setFragmentResultListener(androidx.fragment.app.FragmentResultOwner, String requestKey, androidx.lifecycle.LifecycleOwner lifecycleOwner, kotlin.jvm.functions.Function2<? super java.lang.String,? super android.os.Bundle,kotlin.Unit> listener);
}
public final class FragmentTransactionKt {
- method public static inline <reified F extends androidx.fragment.app.Fragment> androidx.fragment.app.FragmentTransaction add(androidx.fragment.app.FragmentTransaction, @IdRes int containerViewId, String? tag = null, android.os.Bundle? args = null);
- method public static inline <reified F extends androidx.fragment.app.Fragment> androidx.fragment.app.FragmentTransaction add(androidx.fragment.app.FragmentTransaction, String tag, android.os.Bundle? args = null);
- method public static inline <reified F extends androidx.fragment.app.Fragment> androidx.fragment.app.FragmentTransaction replace(androidx.fragment.app.FragmentTransaction, @IdRes int containerViewId, String? tag = null, android.os.Bundle? args = null);
+ method public static inline <reified F> androidx.fragment.app.FragmentTransaction! add(androidx.fragment.app.FragmentTransaction, @IdRes int containerViewId, String tag = null, android.os.Bundle? args = null);
+ method public static inline <reified F> androidx.fragment.app.FragmentTransaction! add(androidx.fragment.app.FragmentTransaction, String tag, android.os.Bundle? args = null);
+ method public static inline <reified F> androidx.fragment.app.FragmentTransaction! replace(androidx.fragment.app.FragmentTransaction, @IdRes int containerViewId, String tag = null, android.os.Bundle? args = null);
}
public final class 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 inline <reified VM> kotlin.Lazy<? extends 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.ViewModelStore> storeProducer, 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);
+ method @MainThread public static inline <reified VM> kotlin.Lazy<? extends VM>! viewModels(androidx.fragment.app.Fragment, kotlin.jvm.functions.Function0<? extends androidx.lifecycle.ViewModelStoreOwner> ownerProducer = { return this }, kotlin.jvm.functions.Function0<? extends androidx.lifecycle.ViewModelProvider.Factory>? factoryProducer = null);
}
public final class ViewKt {
diff --git a/fragment/fragment-ktx/api/public_plus_experimental_current.txt b/fragment/fragment-ktx/api/public_plus_experimental_current.txt
index a00fd44..7fc1d63 100644
--- a/fragment/fragment-ktx/api/public_plus_experimental_current.txt
+++ b/fragment/fragment-ktx/api/public_plus_experimental_current.txt
@@ -2,8 +2,10 @@
package androidx.fragment.app {
public final class FragmentKt {
- method public static void setFragmentResult(androidx.fragment.app.Fragment, String requestKey, android.os.Bundle? result);
- method public static void setFragmentResultListener(androidx.fragment.app.Fragment, String requestKey, kotlin.jvm.functions.Function2<? super java.lang.String,? super android.os.Bundle,kotlin.Unit>? listener);
+ method public static void clearFragmentResult(androidx.fragment.app.Fragment, String requestKey);
+ method public static void clearFragmentResultListener(androidx.fragment.app.Fragment, String requestKey);
+ method public static void setFragmentResult(androidx.fragment.app.Fragment, String requestKey, android.os.Bundle result);
+ method public static inline void setFragmentResultListener(androidx.fragment.app.Fragment, String requestKey, kotlin.jvm.functions.Function2<? super java.lang.String,? super android.os.Bundle,kotlin.Unit> listener);
}
public final class FragmentManagerKt {
@@ -13,19 +15,19 @@
}
public final class FragmentResultOwnerKt {
- method public static void setFragmentResultListener(androidx.fragment.app.FragmentResultOwner, String requestKey, androidx.lifecycle.LifecycleOwner lifecycleOwner, kotlin.jvm.functions.Function2<? super java.lang.String,? super android.os.Bundle,kotlin.Unit>? listener);
+ method public static inline void setFragmentResultListener(androidx.fragment.app.FragmentResultOwner, String requestKey, androidx.lifecycle.LifecycleOwner lifecycleOwner, kotlin.jvm.functions.Function2<? super java.lang.String,? super android.os.Bundle,kotlin.Unit> listener);
}
public final class FragmentTransactionKt {
- method public static inline <reified F extends androidx.fragment.app.Fragment> androidx.fragment.app.FragmentTransaction add(androidx.fragment.app.FragmentTransaction, @IdRes int containerViewId, String? tag = null, android.os.Bundle? args = null);
- method public static inline <reified F extends androidx.fragment.app.Fragment> androidx.fragment.app.FragmentTransaction add(androidx.fragment.app.FragmentTransaction, String tag, android.os.Bundle? args = null);
- method public static inline <reified F extends androidx.fragment.app.Fragment> androidx.fragment.app.FragmentTransaction replace(androidx.fragment.app.FragmentTransaction, @IdRes int containerViewId, String? tag = null, android.os.Bundle? args = null);
+ method public static inline <reified F> androidx.fragment.app.FragmentTransaction! add(androidx.fragment.app.FragmentTransaction, @IdRes int containerViewId, String tag = null, android.os.Bundle? args = null);
+ method public static inline <reified F> androidx.fragment.app.FragmentTransaction! add(androidx.fragment.app.FragmentTransaction, String tag, android.os.Bundle? args = null);
+ method public static inline <reified F> androidx.fragment.app.FragmentTransaction! replace(androidx.fragment.app.FragmentTransaction, @IdRes int containerViewId, String tag = null, android.os.Bundle? args = null);
}
public final class 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 inline <reified VM> kotlin.Lazy<? extends 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.ViewModelStore> storeProducer, 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);
+ method @MainThread public static inline <reified VM> kotlin.Lazy<? extends VM>! viewModels(androidx.fragment.app.Fragment, kotlin.jvm.functions.Function0<? extends androidx.lifecycle.ViewModelStoreOwner> ownerProducer = { return this }, kotlin.jvm.functions.Function0<? extends androidx.lifecycle.ViewModelProvider.Factory>? factoryProducer = null);
}
public final class ViewKt {
diff --git a/fragment/fragment-ktx/api/restricted_1.3.0-alpha05.ignore b/fragment/fragment-ktx/api/restricted_1.3.0-alpha05.ignore
new file mode 100644
index 0000000..4da20b8
--- /dev/null
+++ b/fragment/fragment-ktx/api/restricted_1.3.0-alpha05.ignore
@@ -0,0 +1,21 @@
+// Baseline format: 1.0
+ChangedType: androidx.fragment.app.FragmentViewModelLazyKt#activityViewModels(androidx.fragment.app.Fragment, kotlin.jvm.functions.Function0<? extends androidx.lifecycle.ViewModelProvider.Factory>):
+ Method androidx.fragment.app.FragmentViewModelLazyKt.activityViewModels has changed return type from kotlin.Lazy<VM> to kotlin.Lazy<? extends VM>
+ChangedType: androidx.fragment.app.FragmentViewModelLazyKt#viewModels(androidx.fragment.app.Fragment, kotlin.jvm.functions.Function0<? extends androidx.lifecycle.ViewModelStoreOwner>, kotlin.jvm.functions.Function0<? extends androidx.lifecycle.ViewModelProvider.Factory>):
+ Method androidx.fragment.app.FragmentViewModelLazyKt.viewModels has changed return type from kotlin.Lazy<VM> to kotlin.Lazy<? extends VM>
+
+
+InvalidNullConversion: androidx.fragment.app.FragmentTransactionKt#add(androidx.fragment.app.FragmentTransaction, String, android.os.Bundle):
+ Attempted to remove @NonNull annotation from method androidx.fragment.app.FragmentTransactionKt.add(androidx.fragment.app.FragmentTransaction,String,android.os.Bundle)
+InvalidNullConversion: androidx.fragment.app.FragmentTransactionKt#add(androidx.fragment.app.FragmentTransaction, int, String, android.os.Bundle):
+ Attempted to remove @NonNull annotation from method androidx.fragment.app.FragmentTransactionKt.add(androidx.fragment.app.FragmentTransaction,int,String,android.os.Bundle)
+InvalidNullConversion: androidx.fragment.app.FragmentTransactionKt#add(androidx.fragment.app.FragmentTransaction, int, String, android.os.Bundle) parameter #2:
+ Attempted to change parameter from @Nullable to @NonNull: incompatible change for parameter tag in androidx.fragment.app.FragmentTransactionKt.add(androidx.fragment.app.FragmentTransaction arg1, int containerViewId, String tag, android.os.Bundle args)
+InvalidNullConversion: androidx.fragment.app.FragmentTransactionKt#replace(androidx.fragment.app.FragmentTransaction, int, String, android.os.Bundle):
+ Attempted to remove @NonNull annotation from method androidx.fragment.app.FragmentTransactionKt.replace(androidx.fragment.app.FragmentTransaction,int,String,android.os.Bundle)
+InvalidNullConversion: androidx.fragment.app.FragmentTransactionKt#replace(androidx.fragment.app.FragmentTransaction, int, String, android.os.Bundle) parameter #2:
+ Attempted to change parameter from @Nullable to @NonNull: incompatible change for parameter tag in androidx.fragment.app.FragmentTransactionKt.replace(androidx.fragment.app.FragmentTransaction arg1, int containerViewId, String tag, android.os.Bundle args)
+InvalidNullConversion: androidx.fragment.app.FragmentViewModelLazyKt#activityViewModels(androidx.fragment.app.Fragment, kotlin.jvm.functions.Function0<? extends androidx.lifecycle.ViewModelProvider.Factory>):
+ Attempted to remove @NonNull annotation from method androidx.fragment.app.FragmentViewModelLazyKt.activityViewModels(androidx.fragment.app.Fragment,kotlin.jvm.functions.Function0<? extends androidx.lifecycle.ViewModelProvider.Factory>)
+InvalidNullConversion: androidx.fragment.app.FragmentViewModelLazyKt#viewModels(androidx.fragment.app.Fragment, kotlin.jvm.functions.Function0<? extends androidx.lifecycle.ViewModelStoreOwner>, kotlin.jvm.functions.Function0<? extends androidx.lifecycle.ViewModelProvider.Factory>):
+ Attempted to remove @NonNull annotation from method androidx.fragment.app.FragmentViewModelLazyKt.viewModels(androidx.fragment.app.Fragment,kotlin.jvm.functions.Function0<? extends androidx.lifecycle.ViewModelStoreOwner>,kotlin.jvm.functions.Function0<? extends androidx.lifecycle.ViewModelProvider.Factory>)
diff --git a/fragment/fragment-ktx/api/restricted_1.3.0-alpha05.txt b/fragment/fragment-ktx/api/restricted_1.3.0-alpha05.txt
index a00fd44..7fc1d63 100644
--- a/fragment/fragment-ktx/api/restricted_1.3.0-alpha05.txt
+++ b/fragment/fragment-ktx/api/restricted_1.3.0-alpha05.txt
@@ -2,8 +2,10 @@
package androidx.fragment.app {
public final class FragmentKt {
- method public static void setFragmentResult(androidx.fragment.app.Fragment, String requestKey, android.os.Bundle? result);
- method public static void setFragmentResultListener(androidx.fragment.app.Fragment, String requestKey, kotlin.jvm.functions.Function2<? super java.lang.String,? super android.os.Bundle,kotlin.Unit>? listener);
+ method public static void clearFragmentResult(androidx.fragment.app.Fragment, String requestKey);
+ method public static void clearFragmentResultListener(androidx.fragment.app.Fragment, String requestKey);
+ method public static void setFragmentResult(androidx.fragment.app.Fragment, String requestKey, android.os.Bundle result);
+ method public static inline void setFragmentResultListener(androidx.fragment.app.Fragment, String requestKey, kotlin.jvm.functions.Function2<? super java.lang.String,? super android.os.Bundle,kotlin.Unit> listener);
}
public final class FragmentManagerKt {
@@ -13,19 +15,19 @@
}
public final class FragmentResultOwnerKt {
- method public static void setFragmentResultListener(androidx.fragment.app.FragmentResultOwner, String requestKey, androidx.lifecycle.LifecycleOwner lifecycleOwner, kotlin.jvm.functions.Function2<? super java.lang.String,? super android.os.Bundle,kotlin.Unit>? listener);
+ method public static inline void setFragmentResultListener(androidx.fragment.app.FragmentResultOwner, String requestKey, androidx.lifecycle.LifecycleOwner lifecycleOwner, kotlin.jvm.functions.Function2<? super java.lang.String,? super android.os.Bundle,kotlin.Unit> listener);
}
public final class FragmentTransactionKt {
- method public static inline <reified F extends androidx.fragment.app.Fragment> androidx.fragment.app.FragmentTransaction add(androidx.fragment.app.FragmentTransaction, @IdRes int containerViewId, String? tag = null, android.os.Bundle? args = null);
- method public static inline <reified F extends androidx.fragment.app.Fragment> androidx.fragment.app.FragmentTransaction add(androidx.fragment.app.FragmentTransaction, String tag, android.os.Bundle? args = null);
- method public static inline <reified F extends androidx.fragment.app.Fragment> androidx.fragment.app.FragmentTransaction replace(androidx.fragment.app.FragmentTransaction, @IdRes int containerViewId, String? tag = null, android.os.Bundle? args = null);
+ method public static inline <reified F> androidx.fragment.app.FragmentTransaction! add(androidx.fragment.app.FragmentTransaction, @IdRes int containerViewId, String tag = null, android.os.Bundle? args = null);
+ method public static inline <reified F> androidx.fragment.app.FragmentTransaction! add(androidx.fragment.app.FragmentTransaction, String tag, android.os.Bundle? args = null);
+ method public static inline <reified F> androidx.fragment.app.FragmentTransaction! replace(androidx.fragment.app.FragmentTransaction, @IdRes int containerViewId, String tag = null, android.os.Bundle? args = null);
}
public final class 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 inline <reified VM> kotlin.Lazy<? extends 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.ViewModelStore> storeProducer, 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);
+ method @MainThread public static inline <reified VM> kotlin.Lazy<? extends VM>! viewModels(androidx.fragment.app.Fragment, kotlin.jvm.functions.Function0<? extends androidx.lifecycle.ViewModelStoreOwner> ownerProducer = { return this }, kotlin.jvm.functions.Function0<? extends androidx.lifecycle.ViewModelProvider.Factory>? factoryProducer = null);
}
public final class ViewKt {
diff --git a/fragment/fragment-ktx/api/restricted_current.txt b/fragment/fragment-ktx/api/restricted_current.txt
index a00fd44..7fc1d63 100644
--- a/fragment/fragment-ktx/api/restricted_current.txt
+++ b/fragment/fragment-ktx/api/restricted_current.txt
@@ -2,8 +2,10 @@
package androidx.fragment.app {
public final class FragmentKt {
- method public static void setFragmentResult(androidx.fragment.app.Fragment, String requestKey, android.os.Bundle? result);
- method public static void setFragmentResultListener(androidx.fragment.app.Fragment, String requestKey, kotlin.jvm.functions.Function2<? super java.lang.String,? super android.os.Bundle,kotlin.Unit>? listener);
+ method public static void clearFragmentResult(androidx.fragment.app.Fragment, String requestKey);
+ method public static void clearFragmentResultListener(androidx.fragment.app.Fragment, String requestKey);
+ method public static void setFragmentResult(androidx.fragment.app.Fragment, String requestKey, android.os.Bundle result);
+ method public static inline void setFragmentResultListener(androidx.fragment.app.Fragment, String requestKey, kotlin.jvm.functions.Function2<? super java.lang.String,? super android.os.Bundle,kotlin.Unit> listener);
}
public final class FragmentManagerKt {
@@ -13,19 +15,19 @@
}
public final class FragmentResultOwnerKt {
- method public static void setFragmentResultListener(androidx.fragment.app.FragmentResultOwner, String requestKey, androidx.lifecycle.LifecycleOwner lifecycleOwner, kotlin.jvm.functions.Function2<? super java.lang.String,? super android.os.Bundle,kotlin.Unit>? listener);
+ method public static inline void setFragmentResultListener(androidx.fragment.app.FragmentResultOwner, String requestKey, androidx.lifecycle.LifecycleOwner lifecycleOwner, kotlin.jvm.functions.Function2<? super java.lang.String,? super android.os.Bundle,kotlin.Unit> listener);
}
public final class FragmentTransactionKt {
- method public static inline <reified F extends androidx.fragment.app.Fragment> androidx.fragment.app.FragmentTransaction add(androidx.fragment.app.FragmentTransaction, @IdRes int containerViewId, String? tag = null, android.os.Bundle? args = null);
- method public static inline <reified F extends androidx.fragment.app.Fragment> androidx.fragment.app.FragmentTransaction add(androidx.fragment.app.FragmentTransaction, String tag, android.os.Bundle? args = null);
- method public static inline <reified F extends androidx.fragment.app.Fragment> androidx.fragment.app.FragmentTransaction replace(androidx.fragment.app.FragmentTransaction, @IdRes int containerViewId, String? tag = null, android.os.Bundle? args = null);
+ method public static inline <reified F> androidx.fragment.app.FragmentTransaction! add(androidx.fragment.app.FragmentTransaction, @IdRes int containerViewId, String tag = null, android.os.Bundle? args = null);
+ method public static inline <reified F> androidx.fragment.app.FragmentTransaction! add(androidx.fragment.app.FragmentTransaction, String tag, android.os.Bundle? args = null);
+ method public static inline <reified F> androidx.fragment.app.FragmentTransaction! replace(androidx.fragment.app.FragmentTransaction, @IdRes int containerViewId, String tag = null, android.os.Bundle? args = null);
}
public final class 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 inline <reified VM> kotlin.Lazy<? extends 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.ViewModelStore> storeProducer, 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);
+ method @MainThread public static inline <reified VM> kotlin.Lazy<? extends VM>! viewModels(androidx.fragment.app.Fragment, kotlin.jvm.functions.Function0<? extends androidx.lifecycle.ViewModelStoreOwner> ownerProducer = { return this }, kotlin.jvm.functions.Function0<? extends androidx.lifecycle.ViewModelProvider.Factory>? factoryProducer = null);
}
public final class ViewKt {
diff --git a/fragment/fragment-ktx/src/androidTest/java/androidx/fragment/app/FragmentResultOwnerTest.kt b/fragment/fragment-ktx/src/androidTest/java/androidx/fragment/app/FragmentResultOwnerTest.kt
index df2c2a4..1c877f0 100644
--- a/fragment/fragment-ktx/src/androidTest/java/androidx/fragment/app/FragmentResultOwnerTest.kt
+++ b/fragment/fragment-ktx/src/androidTest/java/androidx/fragment/app/FragmentResultOwnerTest.kt
@@ -57,6 +57,33 @@
}
@Test
+ fun clearFragmentResult() {
+ with(ActivityScenario.launch(TestActivity::class.java)) {
+ val fragment1 = ResultFragment()
+
+ val fm = withActivity {
+ supportFragmentManager
+ }
+
+ val expectedResult = "resultGood"
+ val resultBundle = bundleOf("bundleKey" to expectedResult)
+
+ fm.setFragmentResult("requestKey", resultBundle)
+ fm.clearFragmentResult("requestKey")
+
+ withActivity {
+ fm.commitNow {
+ add(fragment1, null)
+ }
+ }
+
+ assertWithMessage("The result should be null")
+ .that(fragment1.actualResult)
+ .isNull()
+ }
+ }
+
+ @Test
fun clearFragmentResultListener() {
with(ActivityScenario.launch(TestActivity::class.java)) {
val fragment1 = ResultFragment()
@@ -74,7 +101,7 @@
val expectedResult = "resultGood"
val resultBundle = bundleOf("bundleKey" to expectedResult)
- fm.setFragmentResultListener("requestKey", fragment1, null)
+ fm.clearFragmentResultListener("requestKey")
fm.setFragmentResult("requestKey", resultBundle)
assertWithMessage("The listener was cleared but the result was not null")
diff --git a/fragment/fragment-ktx/src/androidTest/java/androidx/fragment/app/FragmentTest.kt b/fragment/fragment-ktx/src/androidTest/java/androidx/fragment/app/FragmentTest.kt
index 65aa8d9..a545f2c 100644
--- a/fragment/fragment-ktx/src/androidTest/java/androidx/fragment/app/FragmentTest.kt
+++ b/fragment/fragment-ktx/src/androidTest/java/androidx/fragment/app/FragmentTest.kt
@@ -20,13 +20,13 @@
import androidx.core.os.bundleOf
import androidx.test.core.app.ActivityScenario
import androidx.test.ext.junit.runners.AndroidJUnit4
-import androidx.test.filters.MediumTest
+import androidx.test.filters.LargeTest
import androidx.testutils.withActivity
import com.google.common.truth.Truth.assertWithMessage
import org.junit.Test
import org.junit.runner.RunWith
-@MediumTest
+@LargeTest
@RunWith(AndroidJUnit4::class)
class FragmentTest {
diff --git a/fragment/fragment-ktx/src/main/java/androidx/fragment/app/Fragment.kt b/fragment/fragment-ktx/src/main/java/androidx/fragment/app/Fragment.kt
index ae7b287..45e9ff0 100644
--- a/fragment/fragment-ktx/src/main/java/androidx/fragment/app/Fragment.kt
+++ b/fragment/fragment-ktx/src/main/java/androidx/fragment/app/Fragment.kt
@@ -23,7 +23,8 @@
* [FragmentResultListener] that is called given to [setFragmentResultListener] with the same
* [requestKey]. If no [FragmentResultListener] with the same key is set or the Lifecycle
* associated with the listener is not at least [androidx.lifecycle.Lifecycle.State.STARTED], the
- * result is stored until one becomes available, or a null result with the same [requestKey] is set.
+ * result is stored until one becomes available, or [clearFragmentResult] is called with the same
+ * requestKey.
*
* @param requestKey key used to identify the result
* @param result the result to be passed to another fragment or `null` if you want to
@@ -31,24 +32,53 @@
*/
fun Fragment.setFragmentResult(
requestKey: String,
- result: Bundle?
+ result: Bundle
) = parentFragmentManager.setFragmentResult(requestKey, result)
/**
+ * Clears the stored result for the given requestKey.
+ *
+ * This clears a result that was previously set a call to [setFragmentResult].
+ *
+ * If this is called with a requestKey that is not associated with any result, this method
+ * does nothing.
+ *
+ * @param requestKey key used to identify the result
+ */
+fun Fragment.clearFragmentResult(
+ requestKey: String
+) = parentFragmentManager.clearFragmentResult(requestKey)
+
+/**
* Sets the [FragmentResultListener] for a given [requestKey]. Once this Fragment is
* at least in the [androidx.lifecycle.Lifecycle.State.STARTED] state, any results set by
* [setFragmentResult] using the same [requestKey] will be delivered to the
* [FragmentResultListener.onFragmentResult] callback. The callback will remain active until this
- * Fragment reaches the [androidx.lifecycle.Lifecycle.State.DESTROYED] state or a null
- * [FragmentResultListener] is set for the same [requestKey].
+ * Fragment reaches the [androidx.lifecycle.Lifecycle.State.DESTROYED] state or
+ * [clearFragmentResultListener] is called with the same requestKey..
*
* @param requestKey requestKey used to store the result
* @param listener listener for result changes or `null` to remove any previously
* registered listener.
*/
-fun Fragment.setFragmentResultListener(
+inline fun Fragment.setFragmentResultListener(
requestKey: String,
- listener: ((resultKey: String, bundle: Bundle) -> Unit)?
+ crossinline listener: ((resultKey: String, bundle: Bundle) -> Unit)
) {
parentFragmentManager.setFragmentResultListener(requestKey, this, listener)
}
+
+/**
+ * Clears the stored [FragmentResultListener] for the given requestKey.
+ *
+ * This clears a [FragmentResultListener] that was previously set a call to
+ * [setFragmentResultListener].
+ *
+ * If this is called with a requestKey that is not associated with any [FragmentResultListener],
+ * this method does nothing.
+ *
+ * @param requestKey key used to identify the result
+ */
+fun Fragment.clearFragmentResultListener(
+ requestKey: String
+) = parentFragmentManager.clearFragmentResultListener(requestKey)
diff --git a/fragment/fragment-ktx/src/main/java/androidx/fragment/app/FragmentResultOwner.kt b/fragment/fragment-ktx/src/main/java/androidx/fragment/app/FragmentResultOwner.kt
index 2957c25..efdae55 100644
--- a/fragment/fragment-ktx/src/main/java/androidx/fragment/app/FragmentResultOwner.kt
+++ b/fragment/fragment-ktx/src/main/java/androidx/fragment/app/FragmentResultOwner.kt
@@ -32,11 +32,11 @@
* @param listener listener for result changes or `null` to remove any previously registered
* listener.
*/
-fun FragmentResultOwner.setFragmentResultListener(
+inline fun FragmentResultOwner.setFragmentResultListener(
requestKey: String,
lifecycleOwner: LifecycleOwner,
- listener: ((resultKey: String, bundle: Bundle) -> Unit)?
+ crossinline listener: ((resultKey: String, bundle: Bundle) -> Unit)
) {
- val resultListener = if (listener == null) null else FragmentResultListener(listener)
- setFragmentResultListener(requestKey, lifecycleOwner, resultListener)
+ setFragmentResultListener(requestKey, lifecycleOwner,
+ FragmentResultListener { resultKey, bundle -> listener.invoke(resultKey, bundle) })
}
diff --git a/fragment/fragment-testing/api/1.3.0-alpha05.ignore b/fragment/fragment-testing/api/1.3.0-alpha05.ignore
new file mode 100644
index 0000000..0c3c8e4
--- /dev/null
+++ b/fragment/fragment-testing/api/1.3.0-alpha05.ignore
@@ -0,0 +1,9 @@
+// Baseline format: 1.0
+InvalidNullConversion: androidx.fragment.app.testing.FragmentScenarioKt#launchFragment(android.os.Bundle, int, androidx.fragment.app.FragmentFactory):
+ Attempted to remove @NonNull annotation from method androidx.fragment.app.testing.FragmentScenarioKt.launchFragment(android.os.Bundle,int,androidx.fragment.app.FragmentFactory)
+InvalidNullConversion: androidx.fragment.app.testing.FragmentScenarioKt#launchFragment(android.os.Bundle, int, kotlin.jvm.functions.Function0<? extends F>):
+ Attempted to remove @NonNull annotation from method androidx.fragment.app.testing.FragmentScenarioKt.launchFragment(android.os.Bundle,int,kotlin.jvm.functions.Function0<? extends F>)
+InvalidNullConversion: androidx.fragment.app.testing.FragmentScenarioKt#launchFragmentInContainer(android.os.Bundle, int, androidx.fragment.app.FragmentFactory):
+ Attempted to remove @NonNull annotation from method androidx.fragment.app.testing.FragmentScenarioKt.launchFragmentInContainer(android.os.Bundle,int,androidx.fragment.app.FragmentFactory)
+InvalidNullConversion: androidx.fragment.app.testing.FragmentScenarioKt#launchFragmentInContainer(android.os.Bundle, int, kotlin.jvm.functions.Function0<? extends F>):
+ Attempted to remove @NonNull annotation from method androidx.fragment.app.testing.FragmentScenarioKt.launchFragmentInContainer(android.os.Bundle,int,kotlin.jvm.functions.Function0<? extends F>)
diff --git a/fragment/fragment-testing/api/1.3.0-alpha05.txt b/fragment/fragment-testing/api/1.3.0-alpha05.txt
index 2a78f24..7b33baa 100644
--- a/fragment/fragment-testing/api/1.3.0-alpha05.txt
+++ b/fragment/fragment-testing/api/1.3.0-alpha05.txt
@@ -20,10 +20,10 @@
}
public final class FragmentScenarioKt {
- method public static inline <reified F extends androidx.fragment.app.Fragment> androidx.fragment.app.testing.FragmentScenario<F> launchFragment(android.os.Bundle? fragmentArgs = null, @StyleRes int themeResId = androidx.fragment.testing.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, @StyleRes int themeResId = androidx.fragment.testing.R.style.FragmentScenarioEmptyFragmentActivityTheme, kotlin.jvm.functions.Function0<? 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, @StyleRes int themeResId = androidx.fragment.testing.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, @StyleRes int themeResId = androidx.fragment.testing.R.style.FragmentScenarioEmptyFragmentActivityTheme, kotlin.jvm.functions.Function0<? extends F> instantiate);
+ method public static inline <reified F> androidx.fragment.app.testing.FragmentScenario<F>! launchFragment(android.os.Bundle? fragmentArgs = null, @StyleRes int themeResId = androidx.fragment.testing.R.style.FragmentScenarioEmptyFragmentActivityTheme, androidx.fragment.app.FragmentFactory? factory = null);
+ method public static inline <reified F> androidx.fragment.app.testing.FragmentScenario<F>! launchFragment(android.os.Bundle? fragmentArgs = null, @StyleRes int themeResId = androidx.fragment.testing.R.style.FragmentScenarioEmptyFragmentActivityTheme, kotlin.jvm.functions.Function0<? extends F> instantiate);
+ method public static inline <reified F> androidx.fragment.app.testing.FragmentScenario<F>! launchFragmentInContainer(android.os.Bundle? fragmentArgs = null, @StyleRes int themeResId = androidx.fragment.testing.R.style.FragmentScenarioEmptyFragmentActivityTheme, androidx.fragment.app.FragmentFactory? factory = null);
+ method public static inline <reified F> androidx.fragment.app.testing.FragmentScenario<F>! launchFragmentInContainer(android.os.Bundle? fragmentArgs = null, @StyleRes int themeResId = androidx.fragment.testing.R.style.FragmentScenarioEmptyFragmentActivityTheme, kotlin.jvm.functions.Function0<? extends F> instantiate);
}
}
diff --git a/fragment/fragment-testing/api/api_lint.ignore b/fragment/fragment-testing/api/api_lint.ignore
new file mode 100644
index 0000000..5f4e236
--- /dev/null
+++ b/fragment/fragment-testing/api/api_lint.ignore
@@ -0,0 +1,9 @@
+// Baseline format: 1.0
+MissingNullability: androidx.fragment.app.testing.FragmentScenarioKt#launchFragment(android.os.Bundle, int, androidx.fragment.app.FragmentFactory):
+ Missing nullability on method `launchFragment` return
+MissingNullability: androidx.fragment.app.testing.FragmentScenarioKt#launchFragment(android.os.Bundle, int, kotlin.jvm.functions.Function0<? extends F>):
+ Missing nullability on method `launchFragment` return
+MissingNullability: androidx.fragment.app.testing.FragmentScenarioKt#launchFragmentInContainer(android.os.Bundle, int, androidx.fragment.app.FragmentFactory):
+ Missing nullability on method `launchFragmentInContainer` return
+MissingNullability: androidx.fragment.app.testing.FragmentScenarioKt#launchFragmentInContainer(android.os.Bundle, int, kotlin.jvm.functions.Function0<? extends F>):
+ Missing nullability on method `launchFragmentInContainer` return
diff --git a/fragment/fragment-testing/api/current.txt b/fragment/fragment-testing/api/current.txt
index 2a78f24..7b33baa 100644
--- a/fragment/fragment-testing/api/current.txt
+++ b/fragment/fragment-testing/api/current.txt
@@ -20,10 +20,10 @@
}
public final class FragmentScenarioKt {
- method public static inline <reified F extends androidx.fragment.app.Fragment> androidx.fragment.app.testing.FragmentScenario<F> launchFragment(android.os.Bundle? fragmentArgs = null, @StyleRes int themeResId = androidx.fragment.testing.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, @StyleRes int themeResId = androidx.fragment.testing.R.style.FragmentScenarioEmptyFragmentActivityTheme, kotlin.jvm.functions.Function0<? 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, @StyleRes int themeResId = androidx.fragment.testing.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, @StyleRes int themeResId = androidx.fragment.testing.R.style.FragmentScenarioEmptyFragmentActivityTheme, kotlin.jvm.functions.Function0<? extends F> instantiate);
+ method public static inline <reified F> androidx.fragment.app.testing.FragmentScenario<F>! launchFragment(android.os.Bundle? fragmentArgs = null, @StyleRes int themeResId = androidx.fragment.testing.R.style.FragmentScenarioEmptyFragmentActivityTheme, androidx.fragment.app.FragmentFactory? factory = null);
+ method public static inline <reified F> androidx.fragment.app.testing.FragmentScenario<F>! launchFragment(android.os.Bundle? fragmentArgs = null, @StyleRes int themeResId = androidx.fragment.testing.R.style.FragmentScenarioEmptyFragmentActivityTheme, kotlin.jvm.functions.Function0<? extends F> instantiate);
+ method public static inline <reified F> androidx.fragment.app.testing.FragmentScenario<F>! launchFragmentInContainer(android.os.Bundle? fragmentArgs = null, @StyleRes int themeResId = androidx.fragment.testing.R.style.FragmentScenarioEmptyFragmentActivityTheme, androidx.fragment.app.FragmentFactory? factory = null);
+ method public static inline <reified F> androidx.fragment.app.testing.FragmentScenario<F>! launchFragmentInContainer(android.os.Bundle? fragmentArgs = null, @StyleRes int themeResId = androidx.fragment.testing.R.style.FragmentScenarioEmptyFragmentActivityTheme, kotlin.jvm.functions.Function0<? extends F> instantiate);
}
}
diff --git a/fragment/fragment-testing/api/public_plus_experimental_1.3.0-alpha05.txt b/fragment/fragment-testing/api/public_plus_experimental_1.3.0-alpha05.txt
index 2a78f24..7b33baa 100644
--- a/fragment/fragment-testing/api/public_plus_experimental_1.3.0-alpha05.txt
+++ b/fragment/fragment-testing/api/public_plus_experimental_1.3.0-alpha05.txt
@@ -20,10 +20,10 @@
}
public final class FragmentScenarioKt {
- method public static inline <reified F extends androidx.fragment.app.Fragment> androidx.fragment.app.testing.FragmentScenario<F> launchFragment(android.os.Bundle? fragmentArgs = null, @StyleRes int themeResId = androidx.fragment.testing.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, @StyleRes int themeResId = androidx.fragment.testing.R.style.FragmentScenarioEmptyFragmentActivityTheme, kotlin.jvm.functions.Function0<? 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, @StyleRes int themeResId = androidx.fragment.testing.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, @StyleRes int themeResId = androidx.fragment.testing.R.style.FragmentScenarioEmptyFragmentActivityTheme, kotlin.jvm.functions.Function0<? extends F> instantiate);
+ method public static inline <reified F> androidx.fragment.app.testing.FragmentScenario<F>! launchFragment(android.os.Bundle? fragmentArgs = null, @StyleRes int themeResId = androidx.fragment.testing.R.style.FragmentScenarioEmptyFragmentActivityTheme, androidx.fragment.app.FragmentFactory? factory = null);
+ method public static inline <reified F> androidx.fragment.app.testing.FragmentScenario<F>! launchFragment(android.os.Bundle? fragmentArgs = null, @StyleRes int themeResId = androidx.fragment.testing.R.style.FragmentScenarioEmptyFragmentActivityTheme, kotlin.jvm.functions.Function0<? extends F> instantiate);
+ method public static inline <reified F> androidx.fragment.app.testing.FragmentScenario<F>! launchFragmentInContainer(android.os.Bundle? fragmentArgs = null, @StyleRes int themeResId = androidx.fragment.testing.R.style.FragmentScenarioEmptyFragmentActivityTheme, androidx.fragment.app.FragmentFactory? factory = null);
+ method public static inline <reified F> androidx.fragment.app.testing.FragmentScenario<F>! launchFragmentInContainer(android.os.Bundle? fragmentArgs = null, @StyleRes int themeResId = androidx.fragment.testing.R.style.FragmentScenarioEmptyFragmentActivityTheme, kotlin.jvm.functions.Function0<? extends F> instantiate);
}
}
diff --git a/fragment/fragment-testing/api/public_plus_experimental_current.txt b/fragment/fragment-testing/api/public_plus_experimental_current.txt
index 2a78f24..7b33baa 100644
--- a/fragment/fragment-testing/api/public_plus_experimental_current.txt
+++ b/fragment/fragment-testing/api/public_plus_experimental_current.txt
@@ -20,10 +20,10 @@
}
public final class FragmentScenarioKt {
- method public static inline <reified F extends androidx.fragment.app.Fragment> androidx.fragment.app.testing.FragmentScenario<F> launchFragment(android.os.Bundle? fragmentArgs = null, @StyleRes int themeResId = androidx.fragment.testing.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, @StyleRes int themeResId = androidx.fragment.testing.R.style.FragmentScenarioEmptyFragmentActivityTheme, kotlin.jvm.functions.Function0<? 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, @StyleRes int themeResId = androidx.fragment.testing.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, @StyleRes int themeResId = androidx.fragment.testing.R.style.FragmentScenarioEmptyFragmentActivityTheme, kotlin.jvm.functions.Function0<? extends F> instantiate);
+ method public static inline <reified F> androidx.fragment.app.testing.FragmentScenario<F>! launchFragment(android.os.Bundle? fragmentArgs = null, @StyleRes int themeResId = androidx.fragment.testing.R.style.FragmentScenarioEmptyFragmentActivityTheme, androidx.fragment.app.FragmentFactory? factory = null);
+ method public static inline <reified F> androidx.fragment.app.testing.FragmentScenario<F>! launchFragment(android.os.Bundle? fragmentArgs = null, @StyleRes int themeResId = androidx.fragment.testing.R.style.FragmentScenarioEmptyFragmentActivityTheme, kotlin.jvm.functions.Function0<? extends F> instantiate);
+ method public static inline <reified F> androidx.fragment.app.testing.FragmentScenario<F>! launchFragmentInContainer(android.os.Bundle? fragmentArgs = null, @StyleRes int themeResId = androidx.fragment.testing.R.style.FragmentScenarioEmptyFragmentActivityTheme, androidx.fragment.app.FragmentFactory? factory = null);
+ method public static inline <reified F> androidx.fragment.app.testing.FragmentScenario<F>! launchFragmentInContainer(android.os.Bundle? fragmentArgs = null, @StyleRes int themeResId = androidx.fragment.testing.R.style.FragmentScenarioEmptyFragmentActivityTheme, kotlin.jvm.functions.Function0<? extends F> instantiate);
}
}
diff --git a/fragment/fragment-testing/api/restricted_1.3.0-alpha05.ignore b/fragment/fragment-testing/api/restricted_1.3.0-alpha05.ignore
new file mode 100644
index 0000000..0c3c8e4
--- /dev/null
+++ b/fragment/fragment-testing/api/restricted_1.3.0-alpha05.ignore
@@ -0,0 +1,9 @@
+// Baseline format: 1.0
+InvalidNullConversion: androidx.fragment.app.testing.FragmentScenarioKt#launchFragment(android.os.Bundle, int, androidx.fragment.app.FragmentFactory):
+ Attempted to remove @NonNull annotation from method androidx.fragment.app.testing.FragmentScenarioKt.launchFragment(android.os.Bundle,int,androidx.fragment.app.FragmentFactory)
+InvalidNullConversion: androidx.fragment.app.testing.FragmentScenarioKt#launchFragment(android.os.Bundle, int, kotlin.jvm.functions.Function0<? extends F>):
+ Attempted to remove @NonNull annotation from method androidx.fragment.app.testing.FragmentScenarioKt.launchFragment(android.os.Bundle,int,kotlin.jvm.functions.Function0<? extends F>)
+InvalidNullConversion: androidx.fragment.app.testing.FragmentScenarioKt#launchFragmentInContainer(android.os.Bundle, int, androidx.fragment.app.FragmentFactory):
+ Attempted to remove @NonNull annotation from method androidx.fragment.app.testing.FragmentScenarioKt.launchFragmentInContainer(android.os.Bundle,int,androidx.fragment.app.FragmentFactory)
+InvalidNullConversion: androidx.fragment.app.testing.FragmentScenarioKt#launchFragmentInContainer(android.os.Bundle, int, kotlin.jvm.functions.Function0<? extends F>):
+ Attempted to remove @NonNull annotation from method androidx.fragment.app.testing.FragmentScenarioKt.launchFragmentInContainer(android.os.Bundle,int,kotlin.jvm.functions.Function0<? extends F>)
diff --git a/fragment/fragment-testing/api/restricted_1.3.0-alpha05.txt b/fragment/fragment-testing/api/restricted_1.3.0-alpha05.txt
index 2a78f24..7b33baa 100644
--- a/fragment/fragment-testing/api/restricted_1.3.0-alpha05.txt
+++ b/fragment/fragment-testing/api/restricted_1.3.0-alpha05.txt
@@ -20,10 +20,10 @@
}
public final class FragmentScenarioKt {
- method public static inline <reified F extends androidx.fragment.app.Fragment> androidx.fragment.app.testing.FragmentScenario<F> launchFragment(android.os.Bundle? fragmentArgs = null, @StyleRes int themeResId = androidx.fragment.testing.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, @StyleRes int themeResId = androidx.fragment.testing.R.style.FragmentScenarioEmptyFragmentActivityTheme, kotlin.jvm.functions.Function0<? 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, @StyleRes int themeResId = androidx.fragment.testing.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, @StyleRes int themeResId = androidx.fragment.testing.R.style.FragmentScenarioEmptyFragmentActivityTheme, kotlin.jvm.functions.Function0<? extends F> instantiate);
+ method public static inline <reified F> androidx.fragment.app.testing.FragmentScenario<F>! launchFragment(android.os.Bundle? fragmentArgs = null, @StyleRes int themeResId = androidx.fragment.testing.R.style.FragmentScenarioEmptyFragmentActivityTheme, androidx.fragment.app.FragmentFactory? factory = null);
+ method public static inline <reified F> androidx.fragment.app.testing.FragmentScenario<F>! launchFragment(android.os.Bundle? fragmentArgs = null, @StyleRes int themeResId = androidx.fragment.testing.R.style.FragmentScenarioEmptyFragmentActivityTheme, kotlin.jvm.functions.Function0<? extends F> instantiate);
+ method public static inline <reified F> androidx.fragment.app.testing.FragmentScenario<F>! launchFragmentInContainer(android.os.Bundle? fragmentArgs = null, @StyleRes int themeResId = androidx.fragment.testing.R.style.FragmentScenarioEmptyFragmentActivityTheme, androidx.fragment.app.FragmentFactory? factory = null);
+ method public static inline <reified F> androidx.fragment.app.testing.FragmentScenario<F>! launchFragmentInContainer(android.os.Bundle? fragmentArgs = null, @StyleRes int themeResId = androidx.fragment.testing.R.style.FragmentScenarioEmptyFragmentActivityTheme, kotlin.jvm.functions.Function0<? extends F> instantiate);
}
}
diff --git a/fragment/fragment-testing/api/restricted_current.txt b/fragment/fragment-testing/api/restricted_current.txt
index 2a78f24..7b33baa 100644
--- a/fragment/fragment-testing/api/restricted_current.txt
+++ b/fragment/fragment-testing/api/restricted_current.txt
@@ -20,10 +20,10 @@
}
public final class FragmentScenarioKt {
- method public static inline <reified F extends androidx.fragment.app.Fragment> androidx.fragment.app.testing.FragmentScenario<F> launchFragment(android.os.Bundle? fragmentArgs = null, @StyleRes int themeResId = androidx.fragment.testing.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, @StyleRes int themeResId = androidx.fragment.testing.R.style.FragmentScenarioEmptyFragmentActivityTheme, kotlin.jvm.functions.Function0<? 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, @StyleRes int themeResId = androidx.fragment.testing.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, @StyleRes int themeResId = androidx.fragment.testing.R.style.FragmentScenarioEmptyFragmentActivityTheme, kotlin.jvm.functions.Function0<? extends F> instantiate);
+ method public static inline <reified F> androidx.fragment.app.testing.FragmentScenario<F>! launchFragment(android.os.Bundle? fragmentArgs = null, @StyleRes int themeResId = androidx.fragment.testing.R.style.FragmentScenarioEmptyFragmentActivityTheme, androidx.fragment.app.FragmentFactory? factory = null);
+ method public static inline <reified F> androidx.fragment.app.testing.FragmentScenario<F>! launchFragment(android.os.Bundle? fragmentArgs = null, @StyleRes int themeResId = androidx.fragment.testing.R.style.FragmentScenarioEmptyFragmentActivityTheme, kotlin.jvm.functions.Function0<? extends F> instantiate);
+ method public static inline <reified F> androidx.fragment.app.testing.FragmentScenario<F>! launchFragmentInContainer(android.os.Bundle? fragmentArgs = null, @StyleRes int themeResId = androidx.fragment.testing.R.style.FragmentScenarioEmptyFragmentActivityTheme, androidx.fragment.app.FragmentFactory? factory = null);
+ method public static inline <reified F> androidx.fragment.app.testing.FragmentScenario<F>! launchFragmentInContainer(android.os.Bundle? fragmentArgs = null, @StyleRes int themeResId = androidx.fragment.testing.R.style.FragmentScenarioEmptyFragmentActivityTheme, kotlin.jvm.functions.Function0<? extends F> instantiate);
}
}
diff --git a/fragment/fragment/api/1.3.0-alpha05.txt b/fragment/fragment/api/1.3.0-alpha05.txt
index cd5b776..00d7fd4 100644
--- a/fragment/fragment/api/1.3.0-alpha05.txt
+++ b/fragment/fragment/api/1.3.0-alpha05.txt
@@ -271,6 +271,8 @@
ctor public FragmentManager();
method public void addOnBackStackChangedListener(androidx.fragment.app.FragmentManager.OnBackStackChangedListener);
method public androidx.fragment.app.FragmentTransaction beginTransaction();
+ method public final void clearFragmentResult(String);
+ method public final void clearFragmentResultListener(String);
method public void dump(String, java.io.FileDescriptor?, java.io.PrintWriter, String![]?);
method @Deprecated public static void enableDebugLogging(boolean);
method public boolean executePendingTransactions();
@@ -296,8 +298,8 @@
method public void removeOnBackStackChangedListener(androidx.fragment.app.FragmentManager.OnBackStackChangedListener);
method public androidx.fragment.app.Fragment.SavedState? saveFragmentInstanceState(androidx.fragment.app.Fragment);
method public void setFragmentFactory(androidx.fragment.app.FragmentFactory);
- method public final void setFragmentResult(String, android.os.Bundle?);
- method public final void setFragmentResultListener(String, androidx.lifecycle.LifecycleOwner, androidx.fragment.app.FragmentResultListener?);
+ method public final void setFragmentResult(String, android.os.Bundle);
+ method public final void setFragmentResultListener(String, androidx.lifecycle.LifecycleOwner, androidx.fragment.app.FragmentResultListener);
method public void unregisterFragmentLifecycleCallbacks(androidx.fragment.app.FragmentManager.FragmentLifecycleCallbacks);
field public static final int POP_BACK_STACK_INCLUSIVE = 1; // 0x1
}
@@ -351,8 +353,10 @@
}
public interface FragmentResultOwner {
- method public void setFragmentResult(String, android.os.Bundle?);
- method public void setFragmentResultListener(String, androidx.lifecycle.LifecycleOwner, androidx.fragment.app.FragmentResultListener?);
+ method public void clearFragmentResult(String);
+ method public void clearFragmentResultListener(String);
+ method public void setFragmentResult(String, android.os.Bundle);
+ method public void setFragmentResultListener(String, androidx.lifecycle.LifecycleOwner, androidx.fragment.app.FragmentResultListener);
}
@Deprecated public abstract class FragmentStatePagerAdapter extends androidx.viewpager.widget.PagerAdapter {
diff --git a/fragment/fragment/api/current.txt b/fragment/fragment/api/current.txt
index cd5b776..00d7fd4 100644
--- a/fragment/fragment/api/current.txt
+++ b/fragment/fragment/api/current.txt
@@ -271,6 +271,8 @@
ctor public FragmentManager();
method public void addOnBackStackChangedListener(androidx.fragment.app.FragmentManager.OnBackStackChangedListener);
method public androidx.fragment.app.FragmentTransaction beginTransaction();
+ method public final void clearFragmentResult(String);
+ method public final void clearFragmentResultListener(String);
method public void dump(String, java.io.FileDescriptor?, java.io.PrintWriter, String![]?);
method @Deprecated public static void enableDebugLogging(boolean);
method public boolean executePendingTransactions();
@@ -296,8 +298,8 @@
method public void removeOnBackStackChangedListener(androidx.fragment.app.FragmentManager.OnBackStackChangedListener);
method public androidx.fragment.app.Fragment.SavedState? saveFragmentInstanceState(androidx.fragment.app.Fragment);
method public void setFragmentFactory(androidx.fragment.app.FragmentFactory);
- method public final void setFragmentResult(String, android.os.Bundle?);
- method public final void setFragmentResultListener(String, androidx.lifecycle.LifecycleOwner, androidx.fragment.app.FragmentResultListener?);
+ method public final void setFragmentResult(String, android.os.Bundle);
+ method public final void setFragmentResultListener(String, androidx.lifecycle.LifecycleOwner, androidx.fragment.app.FragmentResultListener);
method public void unregisterFragmentLifecycleCallbacks(androidx.fragment.app.FragmentManager.FragmentLifecycleCallbacks);
field public static final int POP_BACK_STACK_INCLUSIVE = 1; // 0x1
}
@@ -351,8 +353,10 @@
}
public interface FragmentResultOwner {
- method public void setFragmentResult(String, android.os.Bundle?);
- method public void setFragmentResultListener(String, androidx.lifecycle.LifecycleOwner, androidx.fragment.app.FragmentResultListener?);
+ method public void clearFragmentResult(String);
+ method public void clearFragmentResultListener(String);
+ method public void setFragmentResult(String, android.os.Bundle);
+ method public void setFragmentResultListener(String, androidx.lifecycle.LifecycleOwner, androidx.fragment.app.FragmentResultListener);
}
@Deprecated public abstract class FragmentStatePagerAdapter extends androidx.viewpager.widget.PagerAdapter {
diff --git a/fragment/fragment/api/public_plus_experimental_1.3.0-alpha05.txt b/fragment/fragment/api/public_plus_experimental_1.3.0-alpha05.txt
index ee84b05..f884115 100644
--- a/fragment/fragment/api/public_plus_experimental_1.3.0-alpha05.txt
+++ b/fragment/fragment/api/public_plus_experimental_1.3.0-alpha05.txt
@@ -271,6 +271,8 @@
ctor public FragmentManager();
method public void addOnBackStackChangedListener(androidx.fragment.app.FragmentManager.OnBackStackChangedListener);
method public androidx.fragment.app.FragmentTransaction beginTransaction();
+ method public final void clearFragmentResult(String);
+ method public final void clearFragmentResultListener(String);
method public void dump(String, java.io.FileDescriptor?, java.io.PrintWriter, String![]?);
method @Deprecated public static void enableDebugLogging(boolean);
method public boolean executePendingTransactions();
@@ -296,8 +298,8 @@
method public void removeOnBackStackChangedListener(androidx.fragment.app.FragmentManager.OnBackStackChangedListener);
method public androidx.fragment.app.Fragment.SavedState? saveFragmentInstanceState(androidx.fragment.app.Fragment);
method public void setFragmentFactory(androidx.fragment.app.FragmentFactory);
- method public final void setFragmentResult(String, android.os.Bundle?);
- method public final void setFragmentResultListener(String, androidx.lifecycle.LifecycleOwner, androidx.fragment.app.FragmentResultListener?);
+ method public final void setFragmentResult(String, android.os.Bundle);
+ method public final void setFragmentResultListener(String, androidx.lifecycle.LifecycleOwner, androidx.fragment.app.FragmentResultListener);
method public void unregisterFragmentLifecycleCallbacks(androidx.fragment.app.FragmentManager.FragmentLifecycleCallbacks);
field public static final int POP_BACK_STACK_INCLUSIVE = 1; // 0x1
}
@@ -351,8 +353,10 @@
}
public interface FragmentResultOwner {
- method public void setFragmentResult(String, android.os.Bundle?);
- method public void setFragmentResultListener(String, androidx.lifecycle.LifecycleOwner, androidx.fragment.app.FragmentResultListener?);
+ method public void clearFragmentResult(String);
+ method public void clearFragmentResultListener(String);
+ method public void setFragmentResult(String, android.os.Bundle);
+ method public void setFragmentResultListener(String, androidx.lifecycle.LifecycleOwner, androidx.fragment.app.FragmentResultListener);
}
@Deprecated public abstract class FragmentStatePagerAdapter extends androidx.viewpager.widget.PagerAdapter {
diff --git a/fragment/fragment/api/public_plus_experimental_current.txt b/fragment/fragment/api/public_plus_experimental_current.txt
index ee84b05..f884115 100644
--- a/fragment/fragment/api/public_plus_experimental_current.txt
+++ b/fragment/fragment/api/public_plus_experimental_current.txt
@@ -271,6 +271,8 @@
ctor public FragmentManager();
method public void addOnBackStackChangedListener(androidx.fragment.app.FragmentManager.OnBackStackChangedListener);
method public androidx.fragment.app.FragmentTransaction beginTransaction();
+ method public final void clearFragmentResult(String);
+ method public final void clearFragmentResultListener(String);
method public void dump(String, java.io.FileDescriptor?, java.io.PrintWriter, String![]?);
method @Deprecated public static void enableDebugLogging(boolean);
method public boolean executePendingTransactions();
@@ -296,8 +298,8 @@
method public void removeOnBackStackChangedListener(androidx.fragment.app.FragmentManager.OnBackStackChangedListener);
method public androidx.fragment.app.Fragment.SavedState? saveFragmentInstanceState(androidx.fragment.app.Fragment);
method public void setFragmentFactory(androidx.fragment.app.FragmentFactory);
- method public final void setFragmentResult(String, android.os.Bundle?);
- method public final void setFragmentResultListener(String, androidx.lifecycle.LifecycleOwner, androidx.fragment.app.FragmentResultListener?);
+ method public final void setFragmentResult(String, android.os.Bundle);
+ method public final void setFragmentResultListener(String, androidx.lifecycle.LifecycleOwner, androidx.fragment.app.FragmentResultListener);
method public void unregisterFragmentLifecycleCallbacks(androidx.fragment.app.FragmentManager.FragmentLifecycleCallbacks);
field public static final int POP_BACK_STACK_INCLUSIVE = 1; // 0x1
}
@@ -351,8 +353,10 @@
}
public interface FragmentResultOwner {
- method public void setFragmentResult(String, android.os.Bundle?);
- method public void setFragmentResultListener(String, androidx.lifecycle.LifecycleOwner, androidx.fragment.app.FragmentResultListener?);
+ method public void clearFragmentResult(String);
+ method public void clearFragmentResultListener(String);
+ method public void setFragmentResult(String, android.os.Bundle);
+ method public void setFragmentResultListener(String, androidx.lifecycle.LifecycleOwner, androidx.fragment.app.FragmentResultListener);
}
@Deprecated public abstract class FragmentStatePagerAdapter extends androidx.viewpager.widget.PagerAdapter {
diff --git a/fragment/fragment/api/restricted_1.3.0-alpha05.txt b/fragment/fragment/api/restricted_1.3.0-alpha05.txt
index 075b569..2475536 100644
--- a/fragment/fragment/api/restricted_1.3.0-alpha05.txt
+++ b/fragment/fragment/api/restricted_1.3.0-alpha05.txt
@@ -276,6 +276,8 @@
ctor public FragmentManager();
method public void addOnBackStackChangedListener(androidx.fragment.app.FragmentManager.OnBackStackChangedListener);
method public androidx.fragment.app.FragmentTransaction beginTransaction();
+ method public final void clearFragmentResult(String);
+ method public final void clearFragmentResultListener(String);
method public void dump(String, java.io.FileDescriptor?, java.io.PrintWriter, String![]?);
method @Deprecated public static void enableDebugLogging(boolean);
method public boolean executePendingTransactions();
@@ -302,8 +304,8 @@
method public void removeOnBackStackChangedListener(androidx.fragment.app.FragmentManager.OnBackStackChangedListener);
method public androidx.fragment.app.Fragment.SavedState? saveFragmentInstanceState(androidx.fragment.app.Fragment);
method public void setFragmentFactory(androidx.fragment.app.FragmentFactory);
- method public final void setFragmentResult(String, android.os.Bundle?);
- method public final void setFragmentResultListener(String, androidx.lifecycle.LifecycleOwner, androidx.fragment.app.FragmentResultListener?);
+ method public final void setFragmentResult(String, android.os.Bundle);
+ method public final void setFragmentResultListener(String, androidx.lifecycle.LifecycleOwner, androidx.fragment.app.FragmentResultListener);
method public void unregisterFragmentLifecycleCallbacks(androidx.fragment.app.FragmentManager.FragmentLifecycleCallbacks);
field public static final int POP_BACK_STACK_INCLUSIVE = 1; // 0x1
}
@@ -357,8 +359,10 @@
}
public interface FragmentResultOwner {
- method public void setFragmentResult(String, android.os.Bundle?);
- method public void setFragmentResultListener(String, androidx.lifecycle.LifecycleOwner, androidx.fragment.app.FragmentResultListener?);
+ method public void clearFragmentResult(String);
+ method public void clearFragmentResultListener(String);
+ method public void setFragmentResult(String, android.os.Bundle);
+ method public void setFragmentResultListener(String, androidx.lifecycle.LifecycleOwner, androidx.fragment.app.FragmentResultListener);
}
@Deprecated public abstract class FragmentStatePagerAdapter extends androidx.viewpager.widget.PagerAdapter {
diff --git a/fragment/fragment/api/restricted_current.txt b/fragment/fragment/api/restricted_current.txt
index 075b569..2475536 100644
--- a/fragment/fragment/api/restricted_current.txt
+++ b/fragment/fragment/api/restricted_current.txt
@@ -276,6 +276,8 @@
ctor public FragmentManager();
method public void addOnBackStackChangedListener(androidx.fragment.app.FragmentManager.OnBackStackChangedListener);
method public androidx.fragment.app.FragmentTransaction beginTransaction();
+ method public final void clearFragmentResult(String);
+ method public final void clearFragmentResultListener(String);
method public void dump(String, java.io.FileDescriptor?, java.io.PrintWriter, String![]?);
method @Deprecated public static void enableDebugLogging(boolean);
method public boolean executePendingTransactions();
@@ -302,8 +304,8 @@
method public void removeOnBackStackChangedListener(androidx.fragment.app.FragmentManager.OnBackStackChangedListener);
method public androidx.fragment.app.Fragment.SavedState? saveFragmentInstanceState(androidx.fragment.app.Fragment);
method public void setFragmentFactory(androidx.fragment.app.FragmentFactory);
- method public final void setFragmentResult(String, android.os.Bundle?);
- method public final void setFragmentResultListener(String, androidx.lifecycle.LifecycleOwner, androidx.fragment.app.FragmentResultListener?);
+ method public final void setFragmentResult(String, android.os.Bundle);
+ method public final void setFragmentResultListener(String, androidx.lifecycle.LifecycleOwner, androidx.fragment.app.FragmentResultListener);
method public void unregisterFragmentLifecycleCallbacks(androidx.fragment.app.FragmentManager.FragmentLifecycleCallbacks);
field public static final int POP_BACK_STACK_INCLUSIVE = 1; // 0x1
}
@@ -357,8 +359,10 @@
}
public interface FragmentResultOwner {
- method public void setFragmentResult(String, android.os.Bundle?);
- method public void setFragmentResultListener(String, androidx.lifecycle.LifecycleOwner, androidx.fragment.app.FragmentResultListener?);
+ method public void clearFragmentResult(String);
+ method public void clearFragmentResultListener(String);
+ method public void setFragmentResult(String, android.os.Bundle);
+ method public void setFragmentResultListener(String, androidx.lifecycle.LifecycleOwner, androidx.fragment.app.FragmentResultListener);
}
@Deprecated public abstract class FragmentStatePagerAdapter extends androidx.viewpager.widget.PagerAdapter {
diff --git a/fragment/fragment/build.gradle b/fragment/fragment/build.gradle
index 04c6674..b046b22 100644
--- a/fragment/fragment/build.gradle
+++ b/fragment/fragment/build.gradle
@@ -42,6 +42,7 @@
api(project(":lifecycle:lifecycle-livedata-core"))
api(project(":lifecycle:lifecycle-viewmodel"))
api(project(":lifecycle:lifecycle-viewmodel-savedstate"))
+ api(project(":savedstate:savedstate"))
androidTestImplementation("androidx.appcompat:appcompat:1.1.0", {
exclude group: 'androidx.fragment', module: 'fragment'
diff --git a/fragment/fragment/src/androidTest/java/androidx/fragment/app/FragmentResultTest.kt b/fragment/fragment/src/androidTest/java/androidx/fragment/app/FragmentResultTest.kt
index 22ad270..11f56ca 100644
--- a/fragment/fragment/src/androidTest/java/androidx/fragment/app/FragmentResultTest.kt
+++ b/fragment/fragment/src/androidTest/java/androidx/fragment/app/FragmentResultTest.kt
@@ -74,6 +74,76 @@
}
@Test
+ fun testClearResult() {
+ with(ActivityScenario.launch(FragmentTestActivity::class.java)) {
+ val fm = withActivity {
+ setContentView(R.layout.simple_container)
+ supportFragmentManager
+ }
+ val fragment1 = ResultFragment()
+
+ fm.beginTransaction()
+ .add(R.id.fragmentContainer, fragment1)
+ .commit()
+ executePendingTransactions()
+
+ val fragment2 = StrictFragment()
+
+ fm.beginTransaction()
+ .replace(R.id.fragmentContainer, fragment2)
+ .addToBackStack(null)
+ .commit()
+ executePendingTransactions()
+
+ val resultBundle = Bundle()
+ val expectedResult = "resultGood"
+ resultBundle.putString("bundleKey", expectedResult)
+
+ fm.setFragmentResult("requestKey", resultBundle)
+ fm.clearFragmentResult("requestKey")
+
+ assertWithMessage("The result should not be set")
+ .that(fragment1.actualResult)
+ .isNull()
+
+ withActivity {
+ fm.popBackStackImmediate()
+ }
+
+ assertWithMessage("The result should not be set")
+ .that(fragment1.actualResult)
+ .isNull()
+ }
+ }
+
+ @Test
+ fun testClearResultListener() {
+ with(ActivityScenario.launch(FragmentTestActivity::class.java)) {
+ val fm = withActivity {
+ setContentView(R.layout.simple_container)
+ supportFragmentManager
+ }
+ val fragment1 = ResultFragment()
+
+ fm.beginTransaction()
+ .add(R.id.fragmentContainer, fragment1)
+ .commit()
+ executePendingTransactions()
+
+ val resultBundle = Bundle()
+ val expectedResult = "resultGood"
+ resultBundle.putString("bundleKey", expectedResult)
+
+ fm.clearFragmentResultListener("requestKey")
+ fm.setFragmentResult("requestKey", resultBundle)
+
+ assertWithMessage("The result is incorrect")
+ .that(fragment1.actualResult)
+ .isNull()
+ }
+ }
+
+ @Test
fun testSetResultWhileResumed() {
with(ActivityScenario.launch(FragmentTestActivity::class.java)) {
val fm = withActivity {
diff --git a/fragment/fragment/src/androidTest/java/androidx/fragment/app/FragmentViewLifecycleTest.kt b/fragment/fragment/src/androidTest/java/androidx/fragment/app/FragmentViewLifecycleTest.kt
index 9d2a203..fc91326 100644
--- a/fragment/fragment/src/androidTest/java/androidx/fragment/app/FragmentViewLifecycleTest.kt
+++ b/fragment/fragment/src/androidTest/java/androidx/fragment/app/FragmentViewLifecycleTest.kt
@@ -29,6 +29,8 @@
import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.Observer
import androidx.lifecycle.ViewTreeLifecycleOwner
+import androidx.lifecycle.ViewTreeViewModelStoreOwner
+import androidx.savedstate.ViewTreeSavedStateRegistryOwner
import androidx.test.annotation.UiThreadTest
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.LargeTest
@@ -244,18 +246,19 @@
}
/**
- * Test that the ViewTreeLifecycleOwner for a fragment's view is the fragment's own
- * viewLifecycleOwner.
+ * Test that the ViewTree get() methods for a fragment's view work correctly.
*/
@Test
- fun testFragmentViewTreeLifecycleOwner() {
+ fun testFragmentViewTree() {
val activity = activityRule.activity
val fm = activity.supportFragmentManager
- val fragment = ViewTreeLifecycleOwnerCheckFragment()
+ val fragment = ViewTreeCheckFragment()
var observedLifecycleOwner: Any? = "not set"
var observedTreeLifecycleOwner: Any? = "not set"
+ var observedTreeViewModelStoreOwner: Any? = "not set"
+ var observedTreeViewSavedStateRegistryOwner: Any? = "not set"
val latch = CountDownLatch(1)
activity.runOnUiThread {
@@ -266,6 +269,12 @@
observedLifecycleOwner = owner
observedTreeLifecycleOwner = fragment.view?.let { ViewTreeLifecycleOwner.get(it) }
+ observedTreeViewModelStoreOwner = fragment.view?.let {
+ ViewTreeViewModelStoreOwner.get(it)
+ }
+ observedTreeViewSavedStateRegistryOwner = fragment.view?.let {
+ ViewTreeSavedStateRegistryOwner.get(it)
+ }
}
fm.beginTransaction().add(R.id.content, fragment).commitNow()
@@ -277,11 +286,30 @@
assertWithMessage("ViewTreeLifecycleOwner should match viewLifecycleOwner after commitNow")
.that(ViewTreeLifecycleOwner.get(fragment.view ?: error("no fragment view created")))
.isSameInstanceAs(fragment.viewLifecycleOwner)
+ assertWithMessage("ViewTreeViewModelStoreOwner should match fragment after commitNow")
+ .that(ViewTreeViewModelStoreOwner.get(fragment.view
+ ?: error("no fragment view created")))
+ .isSameInstanceAs(fragment)
+ assertWithMessage("ViewTreeSavedStateRegistryOwner should match fragment after commitNow")
+ .that(
+ ViewTreeSavedStateRegistryOwner.get(
+ fragment.view ?: error("no fragment view created")
+ )
+ )
+ .isSameInstanceAs(fragment)
assertWithMessage("ViewTreeLifecycleOwner should match viewLifecycleOwner in " +
"viewLifecycleOwnerLiveData observer")
.that(observedTreeLifecycleOwner)
.isSameInstanceAs(fragment.viewLifecycleOwner)
+ assertWithMessage("ViewTreeViewModelStoreOwner should match fragment in " +
+ "viewLifecycleOwnerLiveData observer")
+ .that(observedTreeViewModelStoreOwner)
+ .isSameInstanceAs(fragment)
+ assertWithMessage("ViewTreeSavedStateRegistryOwner should match fragment in " +
+ "viewLifecycleOwnerLiveData observer")
+ .that(observedTreeViewSavedStateRegistryOwner)
+ .isSameInstanceAs(fragment)
assertWithMessage("ViewTreeLifecycleOwner should match observed LifecycleOwner in " +
"viewLifecycleOwnerLiveData observer")
@@ -292,10 +320,20 @@
"onViewCreated")
.that(fragment.onViewCreatedLifecycleOwner)
.isSameInstanceAs(fragment.viewLifecycleOwner)
+ assertWithMessage("ViewTreeViewModelStoreOwner should match fragment in " +
+ "onViewCreated")
+ .that(fragment.onViewCreatedViewModelStoreOwner)
+ .isSameInstanceAs(fragment)
+ assertWithMessage("ViewTreeSavedStateRegistryOwner should match fragment in " +
+ "onViewCreated")
+ .that(fragment.onViewCreatedSavedStateRegistryOwner)
+ .isSameInstanceAs(fragment)
}
- class ViewTreeLifecycleOwnerCheckFragment : Fragment() {
+ class ViewTreeCheckFragment : Fragment() {
var onViewCreatedLifecycleOwner: Any? = "not set"
+ var onViewCreatedViewModelStoreOwner: Any? = "not set"
+ var onViewCreatedSavedStateRegistryOwner: Any? = "not set"
override fun onCreateView(
inflater: LayoutInflater,
@@ -305,6 +343,8 @@
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
onViewCreatedLifecycleOwner = ViewTreeLifecycleOwner.get(view)
+ onViewCreatedViewModelStoreOwner = ViewTreeViewModelStoreOwner.get(view)
+ onViewCreatedSavedStateRegistryOwner = ViewTreeSavedStateRegistryOwner.get(view)
}
}
diff --git a/fragment/fragment/src/androidTest/java/androidx/fragment/app/SpecialEffectsControllerTest.kt b/fragment/fragment/src/androidTest/java/androidx/fragment/app/SpecialEffectsControllerTest.kt
index 1cf4611..847275b 100644
--- a/fragment/fragment/src/androidTest/java/androidx/fragment/app/SpecialEffectsControllerTest.kt
+++ b/fragment/fragment/src/androidTest/java/androidx/fragment/app/SpecialEffectsControllerTest.kt
@@ -361,7 +361,7 @@
) : SpecialEffectsController(container) {
val operationsToExecute = mutableListOf<Operation>()
- override fun executeOperations(operations: MutableList<Operation>) {
+ override fun executeOperations(operations: MutableList<Operation>, isPop: Boolean) {
operationsToExecute.addAll(operations)
operations.forEach { operation ->
operation.cancellationSignal.setOnCancelListener {
@@ -379,7 +379,7 @@
internal class InstantSpecialEffectsController(
container: ViewGroup
) : SpecialEffectsController(container) {
- override fun executeOperations(operations: MutableList<Operation>) {
+ override fun executeOperations(operations: MutableList<Operation>, isPop: Boolean) {
operations.forEach(Operation::complete)
}
}
diff --git a/fragment/fragment/src/main/java/androidx/fragment/app/DefaultSpecialEffectsController.java b/fragment/fragment/src/main/java/androidx/fragment/app/DefaultSpecialEffectsController.java
index 0747e34..5f36bd0 100644
--- a/fragment/fragment/src/main/java/androidx/fragment/app/DefaultSpecialEffectsController.java
+++ b/fragment/fragment/src/main/java/androidx/fragment/app/DefaultSpecialEffectsController.java
@@ -83,10 +83,7 @@
}
@Override
- void executeOperations(@NonNull List<Operation> operations) {
- // TODO Pipe this information in from the actual transactions being done
- boolean isPop = !operations.isEmpty()
- && operations.get(operations.size() - 1).getType() == Operation.Type.REMOVE;
+ void executeOperations(@NonNull List<Operation> operations, boolean isPop) {
List<AnimationInfo> animations = new ArrayList<>();
List<TransitionInfo> transitions = new ArrayList<>();
final List<Operation> awaitingContainerChanges = new ArrayList<>(operations);
diff --git a/fragment/fragment/src/main/java/androidx/fragment/app/Fragment.java b/fragment/fragment/src/main/java/androidx/fragment/app/Fragment.java
index 2d594f9..f4f585e 100644
--- a/fragment/fragment/src/main/java/androidx/fragment/app/Fragment.java
+++ b/fragment/fragment/src/main/java/androidx/fragment/app/Fragment.java
@@ -84,10 +84,12 @@
import androidx.lifecycle.ViewModelStore;
import androidx.lifecycle.ViewModelStoreOwner;
import androidx.lifecycle.ViewTreeLifecycleOwner;
+import androidx.lifecycle.ViewTreeViewModelStoreOwner;
import androidx.loader.app.LoaderManager;
import androidx.savedstate.SavedStateRegistry;
import androidx.savedstate.SavedStateRegistryController;
import androidx.savedstate.SavedStateRegistryOwner;
+import androidx.savedstate.ViewTreeSavedStateRegistryOwner;
import java.io.FileDescriptor;
import java.io.PrintWriter;
@@ -514,8 +516,22 @@
}
/**
- * Alternate constructor that can be used to provide a default layout
- * that will be inflated by {@link #onCreateView(LayoutInflater, ViewGroup, Bundle)}.
+ * Alternate constructor that can be called from your default, no argument constructor to
+ * provide a default layout that will be inflated by
+ * {@link #onCreateView(LayoutInflater, ViewGroup, Bundle)}.
+ *
+ * <pre class="prettyprint">
+ * class MyFragment extends Fragment {
+ * public MyFragment() {
+ * super(R.layout.fragment_main);
+ * }
+ * }
+ * </pre>
+ *
+ * You must
+ * {@link FragmentManager#setFragmentFactory(FragmentFactory) set a custom FragmentFactory}
+ * if you want to use a non-default constructor to ensure that your constructor is called
+ * when the fragment is re-instantiated.
*
* @see #Fragment()
* @see #onCreateView(LayoutInflater, ViewGroup, Bundle)
@@ -2894,8 +2910,10 @@
mViewLifecycleOwner.initialize();
// Tell the fragment's new view about it before we tell anyone listening
// to mViewLifecycleOwnerLiveData and before onViewCreated, so that calls to
- // ViewTreeLifecycleOwner.get() return something meaningful
+ // ViewTree get() methods return something meaningful
ViewTreeLifecycleOwner.set(mView, mViewLifecycleOwner);
+ ViewTreeViewModelStoreOwner.set(mView, this);
+ ViewTreeSavedStateRegistryOwner.set(mView, this);
// Then inform any Observers of the new LifecycleOwner
mViewLifecycleOwnerLiveData.setValue(mViewLifecycleOwner);
} else {
diff --git a/fragment/fragment/src/main/java/androidx/fragment/app/FragmentManager.java b/fragment/fragment/src/main/java/androidx/fragment/app/FragmentManager.java
index 7c30f81f..d2330c9 100644
--- a/fragment/fragment/src/main/java/androidx/fragment/app/FragmentManager.java
+++ b/fragment/fragment/src/main/java/androidx/fragment/app/FragmentManager.java
@@ -793,13 +793,7 @@
}
@Override
- public final void setFragmentResult(@NonNull String requestKey, @Nullable Bundle result) {
- if (result == null) {
- // if the given result is null, remove the result
- mResults.remove(requestKey);
- return;
- }
-
+ public final void setFragmentResult(@NonNull String requestKey, @NonNull Bundle result) {
// Check if there is a listener waiting for a result with this key
LifecycleAwareResultListener resultListener = mResultListeners.get(requestKey);
// if there is and it is started, fire the callback
@@ -811,16 +805,16 @@
}
}
+ @Override
+ public final void clearFragmentResult(@NonNull String requestKey) {
+ mResults.remove(requestKey);
+ }
+
@SuppressLint("SyntheticAccessor")
@Override
public final void setFragmentResultListener(@NonNull final String requestKey,
@NonNull final LifecycleOwner lifecycleOwner,
- @Nullable final FragmentResultListener listener) {
- if (listener == null) {
- mResultListeners.remove(requestKey);
- return;
- }
-
+ @NonNull final FragmentResultListener listener) {
final Lifecycle lifecycle = lifecycleOwner.getLifecycle();
if (lifecycle.getCurrentState() == Lifecycle.State.DESTROYED) {
return;
@@ -837,7 +831,7 @@
// if there is a result, fire the callback
listener.onFragmentResult(requestKey, storedResult);
// and clear the result
- setFragmentResult(requestKey, null);
+ clearFragmentResult(requestKey);
}
}
@@ -851,6 +845,11 @@
mResultListeners.put(requestKey, new LifecycleAwareResultListener(lifecycle, listener));
}
+ @Override
+ public final void clearFragmentResultListener(@NonNull String requestKey) {
+ mResultListeners.remove(requestKey);
+ }
+
/**
* Put a reference to a fragment in a Bundle. This Bundle can be
* persisted as saved state, and when later restoring
@@ -2060,9 +2059,13 @@
if (allowReordering) {
moveToState(mCurState, true);
}
+ // The last operation determines the overall direction, this ensures that operations
+ // such as push, push, pop, push are correctly considered a push
+ boolean isPop = isRecordPop.get(endIndex - 1);
Set<SpecialEffectsController> changedControllers = collectChangedControllers(
records, startIndex, endIndex);
for (SpecialEffectsController controller : changedControllers) {
+ controller.updateOperationDirection(isPop);
controller.executePendingOperations();
}
} else {
diff --git a/fragment/fragment/src/main/java/androidx/fragment/app/FragmentResultOwner.java b/fragment/fragment/src/main/java/androidx/fragment/app/FragmentResultOwner.java
index 18d6f91..9a8fe2bd 100644
--- a/fragment/fragment/src/main/java/androidx/fragment/app/FragmentResultOwner.java
+++ b/fragment/fragment/src/main/java/androidx/fragment/app/FragmentResultOwner.java
@@ -19,7 +19,6 @@
import android.os.Bundle;
import androidx.annotation.NonNull;
-import androidx.annotation.Nullable;
import androidx.lifecycle.LifecycleOwner;
/**
@@ -34,13 +33,23 @@
* the same requestKey. If no {@link FragmentResultListener} with the same key is set or the
* Lifecycle associated with the listener is not at least
* {@link androidx.lifecycle.Lifecycle.State#STARTED}, the result is stored until one becomes
- * available, or a null result with the same requestKey is set.
+ * available, or {@link #clearFragmentResult(String)} is called with the same requestKey.
*
* @param requestKey key used to identify the result
- * @param result the result to be passed to another fragment or {@code null} if you want to
- * clear out any pending result.
+ * @param result the result to be passed to another fragment
*/
- void setFragmentResult(@NonNull String requestKey, @Nullable Bundle result);
+ void setFragmentResult(@NonNull String requestKey, @NonNull Bundle result);
+
+ /**
+ * Clears the stored result for the given requestKey.
+ *
+ * This clears any result that was previously set via
+ * {@link #setFragmentResult(String, Bundle)} that hasn't yet been delivered to a
+ * {@link FragmentResultListener}.
+ *
+ * @param requestKey key used to identify the result
+ */
+ void clearFragmentResult(@NonNull String requestKey);
/**
* Sets the {@link FragmentResultListener} for a given requestKey. Once the given
@@ -49,14 +58,23 @@
* requestKey will be delivered to the
* {@link FragmentResultListener#onFragmentResult(String, Bundle) callback}. The callback will
* remain active until the LifecycleOwner reaches the
- * {@link androidx.lifecycle.Lifecycle.State#DESTROYED} state or a null
- * {@link FragmentResultListener} is set for the same requestKey.
+ * {@link androidx.lifecycle.Lifecycle.State#DESTROYED} state or
+ * {@link #clearFragmentResultListener(String)} is called with the same requestKey.
*
- * @param requestKey requestKey used to store the result
+ * @param requestKey requestKey used to identify the result
* @param lifecycleOwner lifecycleOwner for handling the result
- * @param listener listener for result changes or {@code null} to remove any previously
- * registered listener.
+ * @param listener listener for result changes
*/
void setFragmentResultListener(@NonNull String requestKey,
- @NonNull LifecycleOwner lifecycleOwner, @Nullable FragmentResultListener listener);
+ @NonNull LifecycleOwner lifecycleOwner, @NonNull FragmentResultListener listener);
+
+ /**
+ * Clears the stored {@link FragmentResultListener} for the given requestKey.
+ *
+ * This clears any {@link FragmentResultListener} that was previously set via
+ * {@link #setFragmentResultListener(String, LifecycleOwner, FragmentResultListener)}.
+ *
+ * @param requestKey key used to identify the result
+ */
+ void clearFragmentResultListener(@NonNull String requestKey);
}
diff --git a/fragment/fragment/src/main/java/androidx/fragment/app/SpecialEffectsController.java b/fragment/fragment/src/main/java/androidx/fragment/app/SpecialEffectsController.java
index 084fff2..efe8956 100644
--- a/fragment/fragment/src/main/java/androidx/fragment/app/SpecialEffectsController.java
+++ b/fragment/fragment/src/main/java/androidx/fragment/app/SpecialEffectsController.java
@@ -83,6 +83,8 @@
@SuppressWarnings("WeakerAccess") /* synthetic access */
final HashMap<Fragment, Operation> mAwaitingCompletionOperations = new HashMap<>();
+ boolean mOperationDirectionIsPop = false;
+
SpecialEffectsController(@NonNull ViewGroup container) {
mContainer = container;
}
@@ -159,10 +161,15 @@
}
}
+ void updateOperationDirection(boolean isPop) {
+ mOperationDirectionIsPop = isPop;
+ }
+
void executePendingOperations() {
synchronized (mPendingOperations) {
- executeOperations(new ArrayList<>(mPendingOperations));
+ executeOperations(new ArrayList<>(mPendingOperations), mOperationDirectionIsPop);
mPendingOperations.clear();
+ mOperationDirectionIsPop = false;
}
}
@@ -190,13 +197,16 @@
* properly cancelling all special effects when the signal is cancelled.
*
* @param operations the list of operations to execute in order.
+ * @param isPop whether this set of operations should be considered as triggered by a 'pop'.
+ * This can be used to control the direction of any special effects if they
+ * are not symmetric.
*/
- abstract void executeOperations(@NonNull List<Operation> operations);
+ abstract void executeOperations(@NonNull List<Operation> operations, boolean isPop);
/**
* Class representing an ongoing special effects operation.
*
- * @see #executeOperations(List)
+ * @see #executeOperations(List, boolean)
*/
static class Operation {
diff --git a/jetifier/jetifier/migration.config b/jetifier/jetifier/migration.config
index e38b86e..c2cb71b 100644
--- a/jetifier/jetifier/migration.config
+++ b/jetifier/jetifier/migration.config
@@ -449,6 +449,10 @@
"to": "ignore"
},
{
+ "from": "androidx/collection/IndexBasedArrayIterator(.*)",
+ "to": "android/support/v4/util/IndexBasedArrayIterator{0}"
+ },
+ {
"from": "androidx/core/(.+)/(.+)Kt(.*)",
"to": "ignore"
},
@@ -4279,7 +4283,8 @@
"android/support/v7/widget/util/SortedListAdapterCallback": "androidx/recyclerview/widget/SortedListAdapterCallback",
"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/v13/view/inputmethod/InputContentInfoCompat": "androidx/core/view/inputmethod/InputContentInfoCompat",
+ "android/viewbinding/ViewBinding": "androidx/viewbinding/ViewBinding"
}
},
"proGuardMap": {
diff --git a/leanback/leanback/api/1.1.0-alpha04.txt b/leanback/leanback/api/1.1.0-alpha04.txt
index b645e9a..ea90aa3 100644
--- a/leanback/leanback/api/1.1.0-alpha04.txt
+++ b/leanback/leanback/api/1.1.0-alpha04.txt
@@ -93,6 +93,7 @@
}
@Deprecated public class BrowseFragment extends androidx.leanback.app.BaseFragment {
+ ctor @Deprecated public BrowseFragment();
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);
@@ -195,6 +196,7 @@
}
public class BrowseSupportFragment extends androidx.leanback.app.BaseSupportFragment {
+ ctor public BrowseSupportFragment();
method public static android.os.Bundle! createArgs(android.os.Bundle!, String!, int);
method public void enableMainFragmentScaling(boolean);
method @Deprecated public void enableRowScaling(boolean);
@@ -294,6 +296,7 @@
}
@Deprecated public class DetailsFragment extends androidx.leanback.app.BaseFragment {
+ ctor @Deprecated public DetailsFragment();
method @Deprecated public androidx.leanback.widget.ObjectAdapter! getAdapter();
method @Deprecated public androidx.leanback.widget.BaseOnItemViewClickedListener! getOnItemViewClickedListener();
method @Deprecated public androidx.leanback.widget.DetailsParallax! getParallax();
@@ -335,6 +338,7 @@
}
public class DetailsSupportFragment extends androidx.leanback.app.BaseSupportFragment {
+ ctor public DetailsSupportFragment();
method public androidx.leanback.widget.ObjectAdapter! getAdapter();
method public androidx.leanback.widget.BaseOnItemViewClickedListener! getOnItemViewClickedListener();
method public androidx.leanback.widget.DetailsParallax! getParallax();
@@ -933,6 +937,7 @@
}
@Deprecated public class VerticalGridFragment extends androidx.leanback.app.BaseFragment {
+ ctor @Deprecated public VerticalGridFragment();
method @Deprecated public androidx.leanback.widget.ObjectAdapter! getAdapter();
method @Deprecated public androidx.leanback.widget.VerticalGridPresenter! getGridPresenter();
method @Deprecated public androidx.leanback.widget.OnItemViewClickedListener! getOnItemViewClickedListener();
@@ -945,6 +950,7 @@
}
public class VerticalGridSupportFragment extends androidx.leanback.app.BaseSupportFragment {
+ ctor public VerticalGridSupportFragment();
method public androidx.leanback.widget.ObjectAdapter! getAdapter();
method public androidx.leanback.widget.VerticalGridPresenter! getGridPresenter();
method public androidx.leanback.widget.OnItemViewClickedListener! getOnItemViewClickedListener();
diff --git a/leanback/leanback/api/current.txt b/leanback/leanback/api/current.txt
index b645e9a..ea90aa3 100644
--- a/leanback/leanback/api/current.txt
+++ b/leanback/leanback/api/current.txt
@@ -93,6 +93,7 @@
}
@Deprecated public class BrowseFragment extends androidx.leanback.app.BaseFragment {
+ ctor @Deprecated public BrowseFragment();
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);
@@ -195,6 +196,7 @@
}
public class BrowseSupportFragment extends androidx.leanback.app.BaseSupportFragment {
+ ctor public BrowseSupportFragment();
method public static android.os.Bundle! createArgs(android.os.Bundle!, String!, int);
method public void enableMainFragmentScaling(boolean);
method @Deprecated public void enableRowScaling(boolean);
@@ -294,6 +296,7 @@
}
@Deprecated public class DetailsFragment extends androidx.leanback.app.BaseFragment {
+ ctor @Deprecated public DetailsFragment();
method @Deprecated public androidx.leanback.widget.ObjectAdapter! getAdapter();
method @Deprecated public androidx.leanback.widget.BaseOnItemViewClickedListener! getOnItemViewClickedListener();
method @Deprecated public androidx.leanback.widget.DetailsParallax! getParallax();
@@ -335,6 +338,7 @@
}
public class DetailsSupportFragment extends androidx.leanback.app.BaseSupportFragment {
+ ctor public DetailsSupportFragment();
method public androidx.leanback.widget.ObjectAdapter! getAdapter();
method public androidx.leanback.widget.BaseOnItemViewClickedListener! getOnItemViewClickedListener();
method public androidx.leanback.widget.DetailsParallax! getParallax();
@@ -933,6 +937,7 @@
}
@Deprecated public class VerticalGridFragment extends androidx.leanback.app.BaseFragment {
+ ctor @Deprecated public VerticalGridFragment();
method @Deprecated public androidx.leanback.widget.ObjectAdapter! getAdapter();
method @Deprecated public androidx.leanback.widget.VerticalGridPresenter! getGridPresenter();
method @Deprecated public androidx.leanback.widget.OnItemViewClickedListener! getOnItemViewClickedListener();
@@ -945,6 +950,7 @@
}
public class VerticalGridSupportFragment extends androidx.leanback.app.BaseSupportFragment {
+ ctor public VerticalGridSupportFragment();
method public androidx.leanback.widget.ObjectAdapter! getAdapter();
method public androidx.leanback.widget.VerticalGridPresenter! getGridPresenter();
method public androidx.leanback.widget.OnItemViewClickedListener! getOnItemViewClickedListener();
diff --git a/leanback/leanback/api/public_plus_experimental_1.1.0-alpha04.txt b/leanback/leanback/api/public_plus_experimental_1.1.0-alpha04.txt
index b645e9a..ea90aa3 100644
--- a/leanback/leanback/api/public_plus_experimental_1.1.0-alpha04.txt
+++ b/leanback/leanback/api/public_plus_experimental_1.1.0-alpha04.txt
@@ -93,6 +93,7 @@
}
@Deprecated public class BrowseFragment extends androidx.leanback.app.BaseFragment {
+ ctor @Deprecated public BrowseFragment();
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);
@@ -195,6 +196,7 @@
}
public class BrowseSupportFragment extends androidx.leanback.app.BaseSupportFragment {
+ ctor public BrowseSupportFragment();
method public static android.os.Bundle! createArgs(android.os.Bundle!, String!, int);
method public void enableMainFragmentScaling(boolean);
method @Deprecated public void enableRowScaling(boolean);
@@ -294,6 +296,7 @@
}
@Deprecated public class DetailsFragment extends androidx.leanback.app.BaseFragment {
+ ctor @Deprecated public DetailsFragment();
method @Deprecated public androidx.leanback.widget.ObjectAdapter! getAdapter();
method @Deprecated public androidx.leanback.widget.BaseOnItemViewClickedListener! getOnItemViewClickedListener();
method @Deprecated public androidx.leanback.widget.DetailsParallax! getParallax();
@@ -335,6 +338,7 @@
}
public class DetailsSupportFragment extends androidx.leanback.app.BaseSupportFragment {
+ ctor public DetailsSupportFragment();
method public androidx.leanback.widget.ObjectAdapter! getAdapter();
method public androidx.leanback.widget.BaseOnItemViewClickedListener! getOnItemViewClickedListener();
method public androidx.leanback.widget.DetailsParallax! getParallax();
@@ -933,6 +937,7 @@
}
@Deprecated public class VerticalGridFragment extends androidx.leanback.app.BaseFragment {
+ ctor @Deprecated public VerticalGridFragment();
method @Deprecated public androidx.leanback.widget.ObjectAdapter! getAdapter();
method @Deprecated public androidx.leanback.widget.VerticalGridPresenter! getGridPresenter();
method @Deprecated public androidx.leanback.widget.OnItemViewClickedListener! getOnItemViewClickedListener();
@@ -945,6 +950,7 @@
}
public class VerticalGridSupportFragment extends androidx.leanback.app.BaseSupportFragment {
+ ctor public VerticalGridSupportFragment();
method public androidx.leanback.widget.ObjectAdapter! getAdapter();
method public androidx.leanback.widget.VerticalGridPresenter! getGridPresenter();
method public androidx.leanback.widget.OnItemViewClickedListener! getOnItemViewClickedListener();
diff --git a/leanback/leanback/api/public_plus_experimental_current.txt b/leanback/leanback/api/public_plus_experimental_current.txt
index b645e9a..ea90aa3 100644
--- a/leanback/leanback/api/public_plus_experimental_current.txt
+++ b/leanback/leanback/api/public_plus_experimental_current.txt
@@ -93,6 +93,7 @@
}
@Deprecated public class BrowseFragment extends androidx.leanback.app.BaseFragment {
+ ctor @Deprecated public BrowseFragment();
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);
@@ -195,6 +196,7 @@
}
public class BrowseSupportFragment extends androidx.leanback.app.BaseSupportFragment {
+ ctor public BrowseSupportFragment();
method public static android.os.Bundle! createArgs(android.os.Bundle!, String!, int);
method public void enableMainFragmentScaling(boolean);
method @Deprecated public void enableRowScaling(boolean);
@@ -294,6 +296,7 @@
}
@Deprecated public class DetailsFragment extends androidx.leanback.app.BaseFragment {
+ ctor @Deprecated public DetailsFragment();
method @Deprecated public androidx.leanback.widget.ObjectAdapter! getAdapter();
method @Deprecated public androidx.leanback.widget.BaseOnItemViewClickedListener! getOnItemViewClickedListener();
method @Deprecated public androidx.leanback.widget.DetailsParallax! getParallax();
@@ -335,6 +338,7 @@
}
public class DetailsSupportFragment extends androidx.leanback.app.BaseSupportFragment {
+ ctor public DetailsSupportFragment();
method public androidx.leanback.widget.ObjectAdapter! getAdapter();
method public androidx.leanback.widget.BaseOnItemViewClickedListener! getOnItemViewClickedListener();
method public androidx.leanback.widget.DetailsParallax! getParallax();
@@ -933,6 +937,7 @@
}
@Deprecated public class VerticalGridFragment extends androidx.leanback.app.BaseFragment {
+ ctor @Deprecated public VerticalGridFragment();
method @Deprecated public androidx.leanback.widget.ObjectAdapter! getAdapter();
method @Deprecated public androidx.leanback.widget.VerticalGridPresenter! getGridPresenter();
method @Deprecated public androidx.leanback.widget.OnItemViewClickedListener! getOnItemViewClickedListener();
@@ -945,6 +950,7 @@
}
public class VerticalGridSupportFragment extends androidx.leanback.app.BaseSupportFragment {
+ ctor public VerticalGridSupportFragment();
method public androidx.leanback.widget.ObjectAdapter! getAdapter();
method public androidx.leanback.widget.VerticalGridPresenter! getGridPresenter();
method public androidx.leanback.widget.OnItemViewClickedListener! getOnItemViewClickedListener();
diff --git a/leanback/leanback/api/restricted_1.1.0-alpha04.txt b/leanback/leanback/api/restricted_1.1.0-alpha04.txt
index d8b7c2a..0606e63 100644
--- a/leanback/leanback/api/restricted_1.1.0-alpha04.txt
+++ b/leanback/leanback/api/restricted_1.1.0-alpha04.txt
@@ -115,6 +115,7 @@
}
@Deprecated public class BrowseFragment extends androidx.leanback.app.BaseFragment {
+ ctor @Deprecated public BrowseFragment();
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);
@@ -217,6 +218,7 @@
}
public class BrowseSupportFragment extends androidx.leanback.app.BaseSupportFragment {
+ ctor public BrowseSupportFragment();
method public static android.os.Bundle! createArgs(android.os.Bundle!, String!, int);
method public void enableMainFragmentScaling(boolean);
method @Deprecated public void enableRowScaling(boolean);
@@ -316,6 +318,7 @@
}
@Deprecated public class DetailsFragment extends androidx.leanback.app.BaseFragment {
+ ctor @Deprecated public DetailsFragment();
method @Deprecated public androidx.leanback.widget.ObjectAdapter! getAdapter();
method @Deprecated public androidx.leanback.widget.BaseOnItemViewClickedListener! getOnItemViewClickedListener();
method @Deprecated public androidx.leanback.widget.DetailsParallax! getParallax();
@@ -357,6 +360,7 @@
}
public class DetailsSupportFragment extends androidx.leanback.app.BaseSupportFragment {
+ ctor public DetailsSupportFragment();
method public androidx.leanback.widget.ObjectAdapter! getAdapter();
method public androidx.leanback.widget.BaseOnItemViewClickedListener! getOnItemViewClickedListener();
method public androidx.leanback.widget.DetailsParallax! getParallax();
@@ -974,6 +978,7 @@
}
@Deprecated public class VerticalGridFragment extends androidx.leanback.app.BaseFragment {
+ ctor @Deprecated public VerticalGridFragment();
method @Deprecated public androidx.leanback.widget.ObjectAdapter! getAdapter();
method @Deprecated public androidx.leanback.widget.VerticalGridPresenter! getGridPresenter();
method @Deprecated public androidx.leanback.widget.OnItemViewClickedListener! getOnItemViewClickedListener();
@@ -986,6 +991,7 @@
}
public class VerticalGridSupportFragment extends androidx.leanback.app.BaseSupportFragment {
+ ctor public VerticalGridSupportFragment();
method public androidx.leanback.widget.ObjectAdapter! getAdapter();
method public androidx.leanback.widget.VerticalGridPresenter! getGridPresenter();
method public androidx.leanback.widget.OnItemViewClickedListener! getOnItemViewClickedListener();
diff --git a/leanback/leanback/api/restricted_current.txt b/leanback/leanback/api/restricted_current.txt
index d8b7c2a..0606e63 100644
--- a/leanback/leanback/api/restricted_current.txt
+++ b/leanback/leanback/api/restricted_current.txt
@@ -115,6 +115,7 @@
}
@Deprecated public class BrowseFragment extends androidx.leanback.app.BaseFragment {
+ ctor @Deprecated public BrowseFragment();
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);
@@ -217,6 +218,7 @@
}
public class BrowseSupportFragment extends androidx.leanback.app.BaseSupportFragment {
+ ctor public BrowseSupportFragment();
method public static android.os.Bundle! createArgs(android.os.Bundle!, String!, int);
method public void enableMainFragmentScaling(boolean);
method @Deprecated public void enableRowScaling(boolean);
@@ -316,6 +318,7 @@
}
@Deprecated public class DetailsFragment extends androidx.leanback.app.BaseFragment {
+ ctor @Deprecated public DetailsFragment();
method @Deprecated public androidx.leanback.widget.ObjectAdapter! getAdapter();
method @Deprecated public androidx.leanback.widget.BaseOnItemViewClickedListener! getOnItemViewClickedListener();
method @Deprecated public androidx.leanback.widget.DetailsParallax! getParallax();
@@ -357,6 +360,7 @@
}
public class DetailsSupportFragment extends androidx.leanback.app.BaseSupportFragment {
+ ctor public DetailsSupportFragment();
method public androidx.leanback.widget.ObjectAdapter! getAdapter();
method public androidx.leanback.widget.BaseOnItemViewClickedListener! getOnItemViewClickedListener();
method public androidx.leanback.widget.DetailsParallax! getParallax();
@@ -974,6 +978,7 @@
}
@Deprecated public class VerticalGridFragment extends androidx.leanback.app.BaseFragment {
+ ctor @Deprecated public VerticalGridFragment();
method @Deprecated public androidx.leanback.widget.ObjectAdapter! getAdapter();
method @Deprecated public androidx.leanback.widget.VerticalGridPresenter! getGridPresenter();
method @Deprecated public androidx.leanback.widget.OnItemViewClickedListener! getOnItemViewClickedListener();
@@ -986,6 +991,7 @@
}
public class VerticalGridSupportFragment extends androidx.leanback.app.BaseSupportFragment {
+ ctor public VerticalGridSupportFragment();
method public androidx.leanback.widget.ObjectAdapter! getAdapter();
method public androidx.leanback.widget.VerticalGridPresenter! getGridPresenter();
method public androidx.leanback.widget.OnItemViewClickedListener! getOnItemViewClickedListener();
diff --git a/lifecycle/lifecycle-compiler/build.gradle b/lifecycle/lifecycle-compiler/build.gradle
index 0b6e05d..626fbfe 100644
--- a/lifecycle/lifecycle-compiler/build.gradle
+++ b/lifecycle/lifecycle-compiler/build.gradle
@@ -29,7 +29,7 @@
// we actually need to compile :lifecycle:lifecycle-common, but compileJava is easier
task compileTestLibrarySource(type: JavaCompile, dependsOn: compileJava) {
- source "src/tests/test-data/lib/src"
+ source "src/test/test-data/lib/src"
classpath = project.compileJava.classpath
destinationDir = new File(project.buildDir, 'test-data/lib/classes')
}
@@ -37,7 +37,7 @@
task jarTestLibrarySource(type: Jar, dependsOn: compileTestLibrarySource) {
from compileTestLibrarySource.destinationDir
archiveName = "test-library.jar"
- destinationDir = file("src/tests/test-data/lib/")
+ destinationDir = file("src/test/test-data/lib/")
}
androidx {
diff --git a/lifecycle/lifecycle-compiler/reset_results.py b/lifecycle/lifecycle-compiler/reset_results.py
index 994f20d..66e29eb 100644
--- a/lifecycle/lifecycle-compiler/reset_results.py
+++ b/lifecycle/lifecycle-compiler/reset_results.py
@@ -26,12 +26,12 @@
with open(sys.argv[1]) as f:
content = f.readlines()
-with open("src/tests/test-data/expected/license.txt") as license:
+with open("src/test/test-data/expected/license.txt") as license:
licenseLines = license.readlines()
def writeToFile(fileName, lines):
- file = open("src/tests/test-data/expected/" + fileName, "w")
+ file = open("src/test/test-data/expected/" + fileName, "w")
for line in lines:
file.write(line)
diff --git a/lifecycle/lifecycle-compiler/src/tests/kotlin/androidx/lifecycle/InvalidCasesTest.kt b/lifecycle/lifecycle-compiler/src/test/kotlin/androidx/lifecycle/InvalidCasesTest.kt
similarity index 100%
rename from lifecycle/lifecycle-compiler/src/tests/kotlin/androidx/lifecycle/InvalidCasesTest.kt
rename to lifecycle/lifecycle-compiler/src/test/kotlin/androidx/lifecycle/InvalidCasesTest.kt
diff --git a/lifecycle/lifecycle-compiler/src/tests/kotlin/androidx/lifecycle/ValidCasesTest.kt b/lifecycle/lifecycle-compiler/src/test/kotlin/androidx/lifecycle/ValidCasesTest.kt
similarity index 98%
rename from lifecycle/lifecycle-compiler/src/tests/kotlin/androidx/lifecycle/ValidCasesTest.kt
rename to lifecycle/lifecycle-compiler/src/test/kotlin/androidx/lifecycle/ValidCasesTest.kt
index a217af4..f08930a 100644
--- a/lifecycle/lifecycle-compiler/src/tests/kotlin/androidx/lifecycle/ValidCasesTest.kt
+++ b/lifecycle/lifecycle-compiler/src/test/kotlin/androidx/lifecycle/ValidCasesTest.kt
@@ -150,7 +150,7 @@
}
private fun libraryClasspathFiles() =
- getSystemClasspathFiles() + File("src/tests/test-data/lib/test-library.jar")
+ getSystemClasspathFiles() + File("src/test/test-data/lib/test-library.jar")
private fun getSystemClasspathFiles(): Set<File> {
val pathSeparator = System.getProperty("path.separator")
diff --git a/lifecycle/lifecycle-compiler/src/tests/kotlin/androidx/lifecycle/utils/TestUtils.kt b/lifecycle/lifecycle-compiler/src/test/kotlin/androidx/lifecycle/utils/TestUtils.kt
similarity index 94%
rename from lifecycle/lifecycle-compiler/src/tests/kotlin/androidx/lifecycle/utils/TestUtils.kt
rename to lifecycle/lifecycle-compiler/src/test/kotlin/androidx/lifecycle/utils/TestUtils.kt
index b29a2f0..272a8f2 100644
--- a/lifecycle/lifecycle-compiler/src/tests/kotlin/androidx/lifecycle/utils/TestUtils.kt
+++ b/lifecycle/lifecycle-compiler/src/test/kotlin/androidx/lifecycle/utils/TestUtils.kt
@@ -25,7 +25,7 @@
import javax.tools.JavaFileObject
fun load(fullClassName: String, folder: String): JavaFileObject {
- val folderPath = "src/tests/test-data/${if (folder.isEmpty()) "" else folder + "/"}"
+ val folderPath = "src/test/test-data/${if (folder.isEmpty()) "" else folder + "/"}"
val split = fullClassName.split(".")
val code = File("$folderPath/${split.last()}.java").readText(Charset.defaultCharset())
return JavaFileObjects.forSourceString(fullClassName, code)
diff --git a/lifecycle/lifecycle-compiler/src/tests/test-data/Bar.java b/lifecycle/lifecycle-compiler/src/test/test-data/Bar.java
similarity index 100%
rename from lifecycle/lifecycle-compiler/src/tests/test-data/Bar.java
rename to lifecycle/lifecycle-compiler/src/test/test-data/Bar.java
diff --git a/lifecycle/lifecycle-compiler/src/tests/test-data/DerivedFromJar.java b/lifecycle/lifecycle-compiler/src/test/test-data/DerivedFromJar.java
similarity index 100%
rename from lifecycle/lifecycle-compiler/src/tests/test-data/DerivedFromJar.java
rename to lifecycle/lifecycle-compiler/src/test/test-data/DerivedFromJar.java
diff --git a/lifecycle/lifecycle-compiler/src/tests/test-data/DerivedFromJar1.java b/lifecycle/lifecycle-compiler/src/test/test-data/DerivedFromJar1.java
similarity index 100%
rename from lifecycle/lifecycle-compiler/src/tests/test-data/DerivedFromJar1.java
rename to lifecycle/lifecycle-compiler/src/test/test-data/DerivedFromJar1.java
diff --git a/lifecycle/lifecycle-compiler/src/tests/test-data/DifferentPackagesBase1.java b/lifecycle/lifecycle-compiler/src/test/test-data/DifferentPackagesBase1.java
similarity index 100%
rename from lifecycle/lifecycle-compiler/src/tests/test-data/DifferentPackagesBase1.java
rename to lifecycle/lifecycle-compiler/src/test/test-data/DifferentPackagesBase1.java
diff --git a/lifecycle/lifecycle-compiler/src/tests/test-data/DifferentPackagesBase2.java b/lifecycle/lifecycle-compiler/src/test/test-data/DifferentPackagesBase2.java
similarity index 100%
rename from lifecycle/lifecycle-compiler/src/tests/test-data/DifferentPackagesBase2.java
rename to lifecycle/lifecycle-compiler/src/test/test-data/DifferentPackagesBase2.java
diff --git a/lifecycle/lifecycle-compiler/src/tests/test-data/DifferentPackagesDerived1.java b/lifecycle/lifecycle-compiler/src/test/test-data/DifferentPackagesDerived1.java
similarity index 100%
rename from lifecycle/lifecycle-compiler/src/tests/test-data/DifferentPackagesDerived1.java
rename to lifecycle/lifecycle-compiler/src/test/test-data/DifferentPackagesDerived1.java
diff --git a/lifecycle/lifecycle-compiler/src/tests/test-data/DifferentPackagesDerived2.java b/lifecycle/lifecycle-compiler/src/test/test-data/DifferentPackagesDerived2.java
similarity index 100%
rename from lifecycle/lifecycle-compiler/src/tests/test-data/DifferentPackagesDerived2.java
rename to lifecycle/lifecycle-compiler/src/test/test-data/DifferentPackagesDerived2.java
diff --git a/lifecycle/lifecycle-compiler/src/tests/test-data/IGNORE_CHECKSTYLE b/lifecycle/lifecycle-compiler/src/test/test-data/IGNORE_CHECKSTYLE
similarity index 100%
rename from lifecycle/lifecycle-compiler/src/tests/test-data/IGNORE_CHECKSTYLE
rename to lifecycle/lifecycle-compiler/src/test/test-data/IGNORE_CHECKSTYLE
diff --git a/lifecycle/lifecycle-compiler/src/tests/test-data/InheritanceOk1.java b/lifecycle/lifecycle-compiler/src/test/test-data/InheritanceOk1.java
similarity index 100%
rename from lifecycle/lifecycle-compiler/src/tests/test-data/InheritanceOk1.java
rename to lifecycle/lifecycle-compiler/src/test/test-data/InheritanceOk1.java
diff --git a/lifecycle/lifecycle-compiler/src/tests/test-data/InheritanceOk2.java b/lifecycle/lifecycle-compiler/src/test/test-data/InheritanceOk2.java
similarity index 100%
rename from lifecycle/lifecycle-compiler/src/tests/test-data/InheritanceOk2.java
rename to lifecycle/lifecycle-compiler/src/test/test-data/InheritanceOk2.java
diff --git a/lifecycle/lifecycle-compiler/src/tests/test-data/InheritanceOk3.java b/lifecycle/lifecycle-compiler/src/test/test-data/InheritanceOk3.java
similarity index 100%
rename from lifecycle/lifecycle-compiler/src/tests/test-data/InheritanceOk3.java
rename to lifecycle/lifecycle-compiler/src/test/test-data/InheritanceOk3.java
diff --git a/lifecycle/lifecycle-compiler/src/tests/test-data/InterfaceOk1.java b/lifecycle/lifecycle-compiler/src/test/test-data/InterfaceOk1.java
similarity index 100%
rename from lifecycle/lifecycle-compiler/src/tests/test-data/InterfaceOk1.java
rename to lifecycle/lifecycle-compiler/src/test/test-data/InterfaceOk1.java
diff --git a/lifecycle/lifecycle-compiler/src/tests/test-data/InterfaceOk2.java b/lifecycle/lifecycle-compiler/src/test/test-data/InterfaceOk2.java
similarity index 100%
rename from lifecycle/lifecycle-compiler/src/tests/test-data/InterfaceOk2.java
rename to lifecycle/lifecycle-compiler/src/test/test-data/InterfaceOk2.java
diff --git a/lifecycle/lifecycle-compiler/src/tests/test-data/InvalidClassModifier.java b/lifecycle/lifecycle-compiler/src/test/test-data/InvalidClassModifier.java
similarity index 100%
rename from lifecycle/lifecycle-compiler/src/tests/test-data/InvalidClassModifier.java
rename to lifecycle/lifecycle-compiler/src/test/test-data/InvalidClassModifier.java
diff --git a/lifecycle/lifecycle-compiler/src/tests/test-data/InvalidFirstArg1.java b/lifecycle/lifecycle-compiler/src/test/test-data/InvalidFirstArg1.java
similarity index 100%
rename from lifecycle/lifecycle-compiler/src/tests/test-data/InvalidFirstArg1.java
rename to lifecycle/lifecycle-compiler/src/test/test-data/InvalidFirstArg1.java
diff --git a/lifecycle/lifecycle-compiler/src/tests/test-data/InvalidFirstArg2.java b/lifecycle/lifecycle-compiler/src/test/test-data/InvalidFirstArg2.java
similarity index 100%
rename from lifecycle/lifecycle-compiler/src/tests/test-data/InvalidFirstArg2.java
rename to lifecycle/lifecycle-compiler/src/test/test-data/InvalidFirstArg2.java
diff --git a/lifecycle/lifecycle-compiler/src/tests/test-data/InvalidInheritance1.java b/lifecycle/lifecycle-compiler/src/test/test-data/InvalidInheritance1.java
similarity index 100%
rename from lifecycle/lifecycle-compiler/src/tests/test-data/InvalidInheritance1.java
rename to lifecycle/lifecycle-compiler/src/test/test-data/InvalidInheritance1.java
diff --git a/lifecycle/lifecycle-compiler/src/tests/test-data/InvalidInheritance2.java b/lifecycle/lifecycle-compiler/src/test/test-data/InvalidInheritance2.java
similarity index 100%
rename from lifecycle/lifecycle-compiler/src/tests/test-data/InvalidInheritance2.java
rename to lifecycle/lifecycle-compiler/src/test/test-data/InvalidInheritance2.java
diff --git a/lifecycle/lifecycle-compiler/src/tests/test-data/InvalidMethodModifier.java b/lifecycle/lifecycle-compiler/src/test/test-data/InvalidMethodModifier.java
similarity index 100%
rename from lifecycle/lifecycle-compiler/src/tests/test-data/InvalidMethodModifier.java
rename to lifecycle/lifecycle-compiler/src/test/test-data/InvalidMethodModifier.java
diff --git a/lifecycle/lifecycle-compiler/src/tests/test-data/InvalidSecondArg.java b/lifecycle/lifecycle-compiler/src/test/test-data/InvalidSecondArg.java
similarity index 100%
rename from lifecycle/lifecycle-compiler/src/tests/test-data/InvalidSecondArg.java
rename to lifecycle/lifecycle-compiler/src/test/test-data/InvalidSecondArg.java
diff --git a/lifecycle/lifecycle-compiler/src/tests/test-data/NoPackageOk.java b/lifecycle/lifecycle-compiler/src/test/test-data/NoPackageOk.java
similarity index 100%
rename from lifecycle/lifecycle-compiler/src/tests/test-data/NoPackageOk.java
rename to lifecycle/lifecycle-compiler/src/test/test-data/NoPackageOk.java
diff --git a/lifecycle/lifecycle-compiler/src/tests/test-data/OnAnyMethod.java b/lifecycle/lifecycle-compiler/src/test/test-data/OnAnyMethod.java
similarity index 100%
rename from lifecycle/lifecycle-compiler/src/tests/test-data/OnAnyMethod.java
rename to lifecycle/lifecycle-compiler/src/test/test-data/OnAnyMethod.java
diff --git a/lifecycle/lifecycle-compiler/src/tests/test-data/TooManyArgs1.java b/lifecycle/lifecycle-compiler/src/test/test-data/TooManyArgs1.java
similarity index 100%
rename from lifecycle/lifecycle-compiler/src/tests/test-data/TooManyArgs1.java
rename to lifecycle/lifecycle-compiler/src/test/test-data/TooManyArgs1.java
diff --git a/lifecycle/lifecycle-compiler/src/tests/test-data/TooManyArgs2.java b/lifecycle/lifecycle-compiler/src/test/test-data/TooManyArgs2.java
similarity index 100%
rename from lifecycle/lifecycle-compiler/src/tests/test-data/TooManyArgs2.java
rename to lifecycle/lifecycle-compiler/src/test/test-data/TooManyArgs2.java
diff --git a/lifecycle/lifecycle-compiler/src/tests/test-data/expected/DerivedFromJar1_LifecycleAdapter.java b/lifecycle/lifecycle-compiler/src/test/test-data/expected/DerivedFromJar1_LifecycleAdapter.java
similarity index 100%
rename from lifecycle/lifecycle-compiler/src/tests/test-data/expected/DerivedFromJar1_LifecycleAdapter.java
rename to lifecycle/lifecycle-compiler/src/test/test-data/expected/DerivedFromJar1_LifecycleAdapter.java
diff --git a/lifecycle/lifecycle-compiler/src/tests/test-data/expected/DerivedFromJar_LifecycleAdapter.java b/lifecycle/lifecycle-compiler/src/test/test-data/expected/DerivedFromJar_LifecycleAdapter.java
similarity index 100%
rename from lifecycle/lifecycle-compiler/src/tests/test-data/expected/DerivedFromJar_LifecycleAdapter.java
rename to lifecycle/lifecycle-compiler/src/test/test-data/expected/DerivedFromJar_LifecycleAdapter.java
diff --git a/lifecycle/lifecycle-compiler/src/tests/test-data/expected/DifferentPackagesBase1_LifecycleAdapter.java b/lifecycle/lifecycle-compiler/src/test/test-data/expected/DifferentPackagesBase1_LifecycleAdapter.java
similarity index 100%
rename from lifecycle/lifecycle-compiler/src/tests/test-data/expected/DifferentPackagesBase1_LifecycleAdapter.java
rename to lifecycle/lifecycle-compiler/src/test/test-data/expected/DifferentPackagesBase1_LifecycleAdapter.java
diff --git a/lifecycle/lifecycle-compiler/src/tests/test-data/expected/DifferentPackagesBase2_LifecycleAdapter.java b/lifecycle/lifecycle-compiler/src/test/test-data/expected/DifferentPackagesBase2_LifecycleAdapter.java
similarity index 100%
rename from lifecycle/lifecycle-compiler/src/tests/test-data/expected/DifferentPackagesBase2_LifecycleAdapter.java
rename to lifecycle/lifecycle-compiler/src/test/test-data/expected/DifferentPackagesBase2_LifecycleAdapter.java
diff --git a/lifecycle/lifecycle-compiler/src/tests/test-data/expected/DifferentPackagesDerived1_LifecycleAdapter.java b/lifecycle/lifecycle-compiler/src/test/test-data/expected/DifferentPackagesDerived1_LifecycleAdapter.java
similarity index 100%
rename from lifecycle/lifecycle-compiler/src/tests/test-data/expected/DifferentPackagesDerived1_LifecycleAdapter.java
rename to lifecycle/lifecycle-compiler/src/test/test-data/expected/DifferentPackagesDerived1_LifecycleAdapter.java
diff --git a/lifecycle/lifecycle-compiler/src/tests/test-data/expected/DifferentPackagesDerived2_LifecycleAdapter.java b/lifecycle/lifecycle-compiler/src/test/test-data/expected/DifferentPackagesDerived2_LifecycleAdapter.java
similarity index 100%
rename from lifecycle/lifecycle-compiler/src/tests/test-data/expected/DifferentPackagesDerived2_LifecycleAdapter.java
rename to lifecycle/lifecycle-compiler/src/test/test-data/expected/DifferentPackagesDerived2_LifecycleAdapter.java
diff --git a/lifecycle/lifecycle-compiler/src/tests/test-data/expected/InheritanceOk2Base_LifecycleAdapter.java b/lifecycle/lifecycle-compiler/src/test/test-data/expected/InheritanceOk2Base_LifecycleAdapter.java
similarity index 100%
rename from lifecycle/lifecycle-compiler/src/tests/test-data/expected/InheritanceOk2Base_LifecycleAdapter.java
rename to lifecycle/lifecycle-compiler/src/test/test-data/expected/InheritanceOk2Base_LifecycleAdapter.java
diff --git a/lifecycle/lifecycle-compiler/src/tests/test-data/expected/InheritanceOk2Derived_LifecycleAdapter.java b/lifecycle/lifecycle-compiler/src/test/test-data/expected/InheritanceOk2Derived_LifecycleAdapter.java
similarity index 100%
rename from lifecycle/lifecycle-compiler/src/tests/test-data/expected/InheritanceOk2Derived_LifecycleAdapter.java
rename to lifecycle/lifecycle-compiler/src/test/test-data/expected/InheritanceOk2Derived_LifecycleAdapter.java
diff --git a/lifecycle/lifecycle-compiler/src/tests/test-data/expected/InheritanceOk3Base_LifecycleAdapter.java b/lifecycle/lifecycle-compiler/src/test/test-data/expected/InheritanceOk3Base_LifecycleAdapter.java
similarity index 100%
rename from lifecycle/lifecycle-compiler/src/tests/test-data/expected/InheritanceOk3Base_LifecycleAdapter.java
rename to lifecycle/lifecycle-compiler/src/test/test-data/expected/InheritanceOk3Base_LifecycleAdapter.java
diff --git a/lifecycle/lifecycle-compiler/src/tests/test-data/expected/InheritanceOk3Derived_LifecycleAdapter.java b/lifecycle/lifecycle-compiler/src/test/test-data/expected/InheritanceOk3Derived_LifecycleAdapter.java
similarity index 100%
rename from lifecycle/lifecycle-compiler/src/tests/test-data/expected/InheritanceOk3Derived_LifecycleAdapter.java
rename to lifecycle/lifecycle-compiler/src/test/test-data/expected/InheritanceOk3Derived_LifecycleAdapter.java
diff --git a/lifecycle/lifecycle-compiler/src/tests/test-data/expected/InterfaceOk2Base_LifecycleAdapter.java b/lifecycle/lifecycle-compiler/src/test/test-data/expected/InterfaceOk2Base_LifecycleAdapter.java
similarity index 100%
rename from lifecycle/lifecycle-compiler/src/tests/test-data/expected/InterfaceOk2Base_LifecycleAdapter.java
rename to lifecycle/lifecycle-compiler/src/test/test-data/expected/InterfaceOk2Base_LifecycleAdapter.java
diff --git a/lifecycle/lifecycle-compiler/src/tests/test-data/expected/InterfaceOk2Derived_LifecycleAdapter.java b/lifecycle/lifecycle-compiler/src/test/test-data/expected/InterfaceOk2Derived_LifecycleAdapter.java
similarity index 100%
rename from lifecycle/lifecycle-compiler/src/tests/test-data/expected/InterfaceOk2Derived_LifecycleAdapter.java
rename to lifecycle/lifecycle-compiler/src/test/test-data/expected/InterfaceOk2Derived_LifecycleAdapter.java
diff --git a/lifecycle/lifecycle-compiler/src/tests/test-data/expected/InterfaceOk2Interface_LifecycleAdapter.java b/lifecycle/lifecycle-compiler/src/test/test-data/expected/InterfaceOk2Interface_LifecycleAdapter.java
similarity index 100%
rename from lifecycle/lifecycle-compiler/src/tests/test-data/expected/InterfaceOk2Interface_LifecycleAdapter.java
rename to lifecycle/lifecycle-compiler/src/test/test-data/expected/InterfaceOk2Interface_LifecycleAdapter.java
diff --git a/lifecycle/lifecycle-compiler/src/tests/test-data/expected/ObserverNoAdapter_LifecycleAdapter.java b/lifecycle/lifecycle-compiler/src/test/test-data/expected/ObserverNoAdapter_LifecycleAdapter.java
similarity index 100%
rename from lifecycle/lifecycle-compiler/src/tests/test-data/expected/ObserverNoAdapter_LifecycleAdapter.java
rename to lifecycle/lifecycle-compiler/src/test/test-data/expected/ObserverNoAdapter_LifecycleAdapter.java
diff --git a/lifecycle/lifecycle-compiler/src/tests/test-data/expected/OnAnyMethod_LifecycleAdapter.java b/lifecycle/lifecycle-compiler/src/test/test-data/expected/OnAnyMethod_LifecycleAdapter.java
similarity index 100%
rename from lifecycle/lifecycle-compiler/src/tests/test-data/expected/OnAnyMethod_LifecycleAdapter.java
rename to lifecycle/lifecycle-compiler/src/test/test-data/expected/OnAnyMethod_LifecycleAdapter.java
diff --git a/lifecycle/lifecycle-compiler/src/tests/test-data/expected/license.txt b/lifecycle/lifecycle-compiler/src/test/test-data/expected/license.txt
similarity index 100%
rename from lifecycle/lifecycle-compiler/src/tests/test-data/expected/license.txt
rename to lifecycle/lifecycle-compiler/src/test/test-data/expected/license.txt
diff --git a/lifecycle/lifecycle-compiler/src/tests/test-data/lib/src/test/library/LibraryBaseObserver.java b/lifecycle/lifecycle-compiler/src/test/test-data/lib/src/test/library/LibraryBaseObserver.java
similarity index 100%
rename from lifecycle/lifecycle-compiler/src/tests/test-data/lib/src/test/library/LibraryBaseObserver.java
rename to lifecycle/lifecycle-compiler/src/test/test-data/lib/src/test/library/LibraryBaseObserver.java
diff --git a/lifecycle/lifecycle-compiler/src/tests/test-data/lib/src/test/library/LibraryBaseObserver_LifecycleAdapter.java b/lifecycle/lifecycle-compiler/src/test/test-data/lib/src/test/library/LibraryBaseObserver_LifecycleAdapter.java
similarity index 100%
rename from lifecycle/lifecycle-compiler/src/tests/test-data/lib/src/test/library/LibraryBaseObserver_LifecycleAdapter.java
rename to lifecycle/lifecycle-compiler/src/test/test-data/lib/src/test/library/LibraryBaseObserver_LifecycleAdapter.java
diff --git a/lifecycle/lifecycle-compiler/src/tests/test-data/lib/src/test/library/ObserverNoAdapter.java b/lifecycle/lifecycle-compiler/src/test/test-data/lib/src/test/library/ObserverNoAdapter.java
similarity index 100%
rename from lifecycle/lifecycle-compiler/src/tests/test-data/lib/src/test/library/ObserverNoAdapter.java
rename to lifecycle/lifecycle-compiler/src/test/test-data/lib/src/test/library/ObserverNoAdapter.java
diff --git a/lifecycle/lifecycle-compiler/src/tests/test-data/lib/src/test/library/PPObserverNoAdapter.java b/lifecycle/lifecycle-compiler/src/test/test-data/lib/src/test/library/PPObserverNoAdapter.java
similarity index 100%
rename from lifecycle/lifecycle-compiler/src/tests/test-data/lib/src/test/library/PPObserverNoAdapter.java
rename to lifecycle/lifecycle-compiler/src/test/test-data/lib/src/test/library/PPObserverNoAdapter.java
diff --git a/lifecycle/lifecycle-compiler/src/tests/test-data/lib/src/test/library/PPObserverWithAdapter.java b/lifecycle/lifecycle-compiler/src/test/test-data/lib/src/test/library/PPObserverWithAdapter.java
similarity index 100%
rename from lifecycle/lifecycle-compiler/src/tests/test-data/lib/src/test/library/PPObserverWithAdapter.java
rename to lifecycle/lifecycle-compiler/src/test/test-data/lib/src/test/library/PPObserverWithAdapter.java
diff --git a/lifecycle/lifecycle-compiler/src/tests/test-data/lib/test-library.jar b/lifecycle/lifecycle-compiler/src/test/test-data/lib/test-library.jar
similarity index 100%
rename from lifecycle/lifecycle-compiler/src/tests/test-data/lib/test-library.jar
rename to lifecycle/lifecycle-compiler/src/test/test-data/lib/test-library.jar
Binary files differ
diff --git a/lifecycle/lifecycle-livedata-core/src/test/java/androidx/lifecycle/LiveDataTest.java b/lifecycle/lifecycle-livedata-core/src/test/java/androidx/lifecycle/LiveDataTest.java
index cdcf327..a3ecdfd 100644
--- a/lifecycle/lifecycle-livedata-core/src/test/java/androidx/lifecycle/LiveDataTest.java
+++ b/lifecycle/lifecycle-livedata-core/src/test/java/androidx/lifecycle/LiveDataTest.java
@@ -396,8 +396,8 @@
mLiveData.observe(mOwner, observer1);
mLiveData.observe(mOwner, observer2);
mLiveData.setValue("bla");
- verify(observer1, Mockito.atMost(2)).onChanged("gt");
- verify(observer2, Mockito.atMost(2)).onChanged("gt");
+ verify(observer1, Mockito.times(1)).onChanged("gt");
+ verify(observer2, Mockito.times(1)).onChanged("gt");
}
@Test
diff --git a/lifecycle/lifecycle-livedata-ktx/api/2.3.0-alpha03.ignore b/lifecycle/lifecycle-livedata-ktx/api/2.3.0-alpha03.ignore
new file mode 100644
index 0000000..5129315
--- /dev/null
+++ b/lifecycle/lifecycle-livedata-ktx/api/2.3.0-alpha03.ignore
@@ -0,0 +1,3 @@
+// Baseline format: 1.0
+InvalidNullConversion: androidx.lifecycle.LiveDataScope#emitSource(androidx.lifecycle.LiveData<T>, kotlin.coroutines.Continuation<? super kotlinx.coroutines.DisposableHandle>):
+ Attempted to change method return from @NonNull to @Nullable: incompatible change for method androidx.lifecycle.LiveDataScope.emitSource(androidx.lifecycle.LiveData<T>,kotlin.coroutines.Continuation<? super kotlinx.coroutines.DisposableHandle>)
diff --git a/lifecycle/lifecycle-livedata-ktx/api/2.3.0-alpha03.txt b/lifecycle/lifecycle-livedata-ktx/api/2.3.0-alpha03.txt
index b5a6b57..5dbd0c7a 100644
--- a/lifecycle/lifecycle-livedata-ktx/api/2.3.0-alpha03.txt
+++ b/lifecycle/lifecycle-livedata-ktx/api/2.3.0-alpha03.txt
@@ -15,8 +15,8 @@
}
public interface LiveDataScope<T> {
- method public suspend Object! emit(T? value, kotlin.coroutines.Continuation<? super kotlin.Unit> p);
- method public suspend Object emitSource(androidx.lifecycle.LiveData<T> source, kotlin.coroutines.Continuation<? super kotlinx.coroutines.DisposableHandle> p);
+ method public suspend Object? emit(T? value, kotlin.coroutines.Continuation<? super kotlin.Unit> p);
+ method public suspend Object? emitSource(androidx.lifecycle.LiveData<T> source, kotlin.coroutines.Continuation<? super kotlinx.coroutines.DisposableHandle> p);
method public T? getLatestValue();
property public abstract T? latestValue;
}
diff --git a/lifecycle/lifecycle-livedata-ktx/api/api_lint.ignore b/lifecycle/lifecycle-livedata-ktx/api/api_lint.ignore
deleted file mode 100644
index 9763738..0000000
--- a/lifecycle/lifecycle-livedata-ktx/api/api_lint.ignore
+++ /dev/null
@@ -1,3 +0,0 @@
-// Baseline format: 1.0
-MissingNullability: androidx.lifecycle.LiveDataScope#emit(T, kotlin.coroutines.Continuation<? super kotlin.Unit>):
- Missing nullability on method `emit` return
diff --git a/lifecycle/lifecycle-livedata-ktx/api/current.txt b/lifecycle/lifecycle-livedata-ktx/api/current.txt
index b5a6b57..5dbd0c7a 100644
--- a/lifecycle/lifecycle-livedata-ktx/api/current.txt
+++ b/lifecycle/lifecycle-livedata-ktx/api/current.txt
@@ -15,8 +15,8 @@
}
public interface LiveDataScope<T> {
- method public suspend Object! emit(T? value, kotlin.coroutines.Continuation<? super kotlin.Unit> p);
- method public suspend Object emitSource(androidx.lifecycle.LiveData<T> source, kotlin.coroutines.Continuation<? super kotlinx.coroutines.DisposableHandle> p);
+ method public suspend Object? emit(T? value, kotlin.coroutines.Continuation<? super kotlin.Unit> p);
+ method public suspend Object? emitSource(androidx.lifecycle.LiveData<T> source, kotlin.coroutines.Continuation<? super kotlinx.coroutines.DisposableHandle> p);
method public T? getLatestValue();
property public abstract T? latestValue;
}
diff --git a/lifecycle/lifecycle-livedata-ktx/api/public_plus_experimental_2.3.0-alpha03.txt b/lifecycle/lifecycle-livedata-ktx/api/public_plus_experimental_2.3.0-alpha03.txt
index b5a6b57..5dbd0c7a 100644
--- a/lifecycle/lifecycle-livedata-ktx/api/public_plus_experimental_2.3.0-alpha03.txt
+++ b/lifecycle/lifecycle-livedata-ktx/api/public_plus_experimental_2.3.0-alpha03.txt
@@ -15,8 +15,8 @@
}
public interface LiveDataScope<T> {
- method public suspend Object! emit(T? value, kotlin.coroutines.Continuation<? super kotlin.Unit> p);
- method public suspend Object emitSource(androidx.lifecycle.LiveData<T> source, kotlin.coroutines.Continuation<? super kotlinx.coroutines.DisposableHandle> p);
+ method public suspend Object? emit(T? value, kotlin.coroutines.Continuation<? super kotlin.Unit> p);
+ method public suspend Object? emitSource(androidx.lifecycle.LiveData<T> source, kotlin.coroutines.Continuation<? super kotlinx.coroutines.DisposableHandle> p);
method public T? getLatestValue();
property public abstract T? latestValue;
}
diff --git a/lifecycle/lifecycle-livedata-ktx/api/public_plus_experimental_current.txt b/lifecycle/lifecycle-livedata-ktx/api/public_plus_experimental_current.txt
index b5a6b57..5dbd0c7a 100644
--- a/lifecycle/lifecycle-livedata-ktx/api/public_plus_experimental_current.txt
+++ b/lifecycle/lifecycle-livedata-ktx/api/public_plus_experimental_current.txt
@@ -15,8 +15,8 @@
}
public interface LiveDataScope<T> {
- method public suspend Object! emit(T? value, kotlin.coroutines.Continuation<? super kotlin.Unit> p);
- method public suspend Object emitSource(androidx.lifecycle.LiveData<T> source, kotlin.coroutines.Continuation<? super kotlinx.coroutines.DisposableHandle> p);
+ method public suspend Object? emit(T? value, kotlin.coroutines.Continuation<? super kotlin.Unit> p);
+ method public suspend Object? emitSource(androidx.lifecycle.LiveData<T> source, kotlin.coroutines.Continuation<? super kotlinx.coroutines.DisposableHandle> p);
method public T? getLatestValue();
property public abstract T? latestValue;
}
diff --git a/lifecycle/lifecycle-livedata-ktx/api/restricted_2.3.0-alpha03.ignore b/lifecycle/lifecycle-livedata-ktx/api/restricted_2.3.0-alpha03.ignore
new file mode 100644
index 0000000..5129315
--- /dev/null
+++ b/lifecycle/lifecycle-livedata-ktx/api/restricted_2.3.0-alpha03.ignore
@@ -0,0 +1,3 @@
+// Baseline format: 1.0
+InvalidNullConversion: androidx.lifecycle.LiveDataScope#emitSource(androidx.lifecycle.LiveData<T>, kotlin.coroutines.Continuation<? super kotlinx.coroutines.DisposableHandle>):
+ Attempted to change method return from @NonNull to @Nullable: incompatible change for method androidx.lifecycle.LiveDataScope.emitSource(androidx.lifecycle.LiveData<T>,kotlin.coroutines.Continuation<? super kotlinx.coroutines.DisposableHandle>)
diff --git a/lifecycle/lifecycle-livedata-ktx/api/restricted_2.3.0-alpha03.txt b/lifecycle/lifecycle-livedata-ktx/api/restricted_2.3.0-alpha03.txt
index b5a6b57..5dbd0c7a 100644
--- a/lifecycle/lifecycle-livedata-ktx/api/restricted_2.3.0-alpha03.txt
+++ b/lifecycle/lifecycle-livedata-ktx/api/restricted_2.3.0-alpha03.txt
@@ -15,8 +15,8 @@
}
public interface LiveDataScope<T> {
- method public suspend Object! emit(T? value, kotlin.coroutines.Continuation<? super kotlin.Unit> p);
- method public suspend Object emitSource(androidx.lifecycle.LiveData<T> source, kotlin.coroutines.Continuation<? super kotlinx.coroutines.DisposableHandle> p);
+ method public suspend Object? emit(T? value, kotlin.coroutines.Continuation<? super kotlin.Unit> p);
+ method public suspend Object? emitSource(androidx.lifecycle.LiveData<T> source, kotlin.coroutines.Continuation<? super kotlinx.coroutines.DisposableHandle> p);
method public T? getLatestValue();
property public abstract T? latestValue;
}
diff --git a/lifecycle/lifecycle-livedata-ktx/api/restricted_current.txt b/lifecycle/lifecycle-livedata-ktx/api/restricted_current.txt
index b5a6b57..5dbd0c7a 100644
--- a/lifecycle/lifecycle-livedata-ktx/api/restricted_current.txt
+++ b/lifecycle/lifecycle-livedata-ktx/api/restricted_current.txt
@@ -15,8 +15,8 @@
}
public interface LiveDataScope<T> {
- method public suspend Object! emit(T? value, kotlin.coroutines.Continuation<? super kotlin.Unit> p);
- method public suspend Object emitSource(androidx.lifecycle.LiveData<T> source, kotlin.coroutines.Continuation<? super kotlinx.coroutines.DisposableHandle> p);
+ method public suspend Object? emit(T? value, kotlin.coroutines.Continuation<? super kotlin.Unit> p);
+ method public suspend Object? emitSource(androidx.lifecycle.LiveData<T> source, kotlin.coroutines.Continuation<? super kotlinx.coroutines.DisposableHandle> p);
method public T? getLatestValue();
property public abstract T? latestValue;
}
diff --git a/lifecycle/lifecycle-runtime-ktx/api/2.3.0-alpha03.txt b/lifecycle/lifecycle-runtime-ktx/api/2.3.0-alpha03.txt
index b3d791e..60b6383 100644
--- a/lifecycle/lifecycle-runtime-ktx/api/2.3.0-alpha03.txt
+++ b/lifecycle/lifecycle-runtime-ktx/api/2.3.0-alpha03.txt
@@ -16,13 +16,13 @@
}
public final class PausingDispatcherKt {
- method public static suspend <T> Object! whenCreated(androidx.lifecycle.LifecycleOwner, kotlin.jvm.functions.Function2<? super kotlinx.coroutines.CoroutineScope,? super kotlin.coroutines.Continuation<? super T>,?> block, kotlin.coroutines.Continuation<? super T> p);
- method public static suspend <T> Object! whenCreated(androidx.lifecycle.Lifecycle, kotlin.jvm.functions.Function2<? super kotlinx.coroutines.CoroutineScope,? super kotlin.coroutines.Continuation<? super T>,?> block, kotlin.coroutines.Continuation<? super T> p);
- method public static suspend <T> Object! whenResumed(androidx.lifecycle.LifecycleOwner, kotlin.jvm.functions.Function2<? super kotlinx.coroutines.CoroutineScope,? super kotlin.coroutines.Continuation<? super T>,?> block, kotlin.coroutines.Continuation<? super T> p);
- method public static suspend <T> Object! whenResumed(androidx.lifecycle.Lifecycle, kotlin.jvm.functions.Function2<? super kotlinx.coroutines.CoroutineScope,? super kotlin.coroutines.Continuation<? super T>,?> block, kotlin.coroutines.Continuation<? super T> p);
- method public static suspend <T> Object! whenStarted(androidx.lifecycle.LifecycleOwner, kotlin.jvm.functions.Function2<? super kotlinx.coroutines.CoroutineScope,? super kotlin.coroutines.Continuation<? super T>,?> block, kotlin.coroutines.Continuation<? super T> p);
- method public static suspend <T> Object! whenStarted(androidx.lifecycle.Lifecycle, kotlin.jvm.functions.Function2<? super kotlinx.coroutines.CoroutineScope,? super kotlin.coroutines.Continuation<? super T>,?> block, kotlin.coroutines.Continuation<? super T> p);
- method public static suspend <T> Object! whenStateAtLeast(androidx.lifecycle.Lifecycle, androidx.lifecycle.Lifecycle.State minState, kotlin.jvm.functions.Function2<? super kotlinx.coroutines.CoroutineScope,? super kotlin.coroutines.Continuation<? super T>,?> block, kotlin.coroutines.Continuation<? super T> p);
+ method public static suspend <T> Object? whenCreated(androidx.lifecycle.LifecycleOwner, kotlin.jvm.functions.Function2<? super kotlinx.coroutines.CoroutineScope,? super kotlin.coroutines.Continuation<? super T>,?> block, kotlin.coroutines.Continuation<? super T> p);
+ method public static suspend <T> Object? whenCreated(androidx.lifecycle.Lifecycle, kotlin.jvm.functions.Function2<? super kotlinx.coroutines.CoroutineScope,? super kotlin.coroutines.Continuation<? super T>,?> block, kotlin.coroutines.Continuation<? super T> p);
+ method public static suspend <T> Object? whenResumed(androidx.lifecycle.LifecycleOwner, kotlin.jvm.functions.Function2<? super kotlinx.coroutines.CoroutineScope,? super kotlin.coroutines.Continuation<? super T>,?> block, kotlin.coroutines.Continuation<? super T> p);
+ method public static suspend <T> Object? whenResumed(androidx.lifecycle.Lifecycle, kotlin.jvm.functions.Function2<? super kotlinx.coroutines.CoroutineScope,? super kotlin.coroutines.Continuation<? super T>,?> block, kotlin.coroutines.Continuation<? super T> p);
+ method public static suspend <T> Object? whenStarted(androidx.lifecycle.LifecycleOwner, kotlin.jvm.functions.Function2<? super kotlinx.coroutines.CoroutineScope,? super kotlin.coroutines.Continuation<? super T>,?> block, kotlin.coroutines.Continuation<? super T> p);
+ method public static suspend <T> Object? whenStarted(androidx.lifecycle.Lifecycle, kotlin.jvm.functions.Function2<? super kotlinx.coroutines.CoroutineScope,? super kotlin.coroutines.Continuation<? super T>,?> block, kotlin.coroutines.Continuation<? super T> p);
+ method public static suspend <T> Object? whenStateAtLeast(androidx.lifecycle.Lifecycle, androidx.lifecycle.Lifecycle.State minState, kotlin.jvm.functions.Function2<? super kotlinx.coroutines.CoroutineScope,? super kotlin.coroutines.Continuation<? super T>,?> block, kotlin.coroutines.Continuation<? super T> p);
}
public final class ViewKt {
diff --git a/lifecycle/lifecycle-runtime-ktx/api/api_lint.ignore b/lifecycle/lifecycle-runtime-ktx/api/api_lint.ignore
deleted file mode 100644
index 51b3d63..0000000
--- a/lifecycle/lifecycle-runtime-ktx/api/api_lint.ignore
+++ /dev/null
@@ -1,15 +0,0 @@
-// Baseline format: 1.0
-MissingNullability: androidx.lifecycle.PausingDispatcherKt#whenCreated(androidx.lifecycle.Lifecycle, kotlin.jvm.functions.Function2<? super kotlinx.coroutines.CoroutineScope,? super kotlin.coroutines.Continuation<? super T>,?>, kotlin.coroutines.Continuation<? super T>):
- Missing nullability on method `whenCreated` return
-MissingNullability: androidx.lifecycle.PausingDispatcherKt#whenCreated(androidx.lifecycle.LifecycleOwner, kotlin.jvm.functions.Function2<? super kotlinx.coroutines.CoroutineScope,? super kotlin.coroutines.Continuation<? super T>,?>, kotlin.coroutines.Continuation<? super T>):
- Missing nullability on method `whenCreated` return
-MissingNullability: androidx.lifecycle.PausingDispatcherKt#whenResumed(androidx.lifecycle.Lifecycle, kotlin.jvm.functions.Function2<? super kotlinx.coroutines.CoroutineScope,? super kotlin.coroutines.Continuation<? super T>,?>, kotlin.coroutines.Continuation<? super T>):
- Missing nullability on method `whenResumed` return
-MissingNullability: androidx.lifecycle.PausingDispatcherKt#whenResumed(androidx.lifecycle.LifecycleOwner, kotlin.jvm.functions.Function2<? super kotlinx.coroutines.CoroutineScope,? super kotlin.coroutines.Continuation<? super T>,?>, kotlin.coroutines.Continuation<? super T>):
- Missing nullability on method `whenResumed` return
-MissingNullability: androidx.lifecycle.PausingDispatcherKt#whenStarted(androidx.lifecycle.Lifecycle, kotlin.jvm.functions.Function2<? super kotlinx.coroutines.CoroutineScope,? super kotlin.coroutines.Continuation<? super T>,?>, kotlin.coroutines.Continuation<? super T>):
- Missing nullability on method `whenStarted` return
-MissingNullability: androidx.lifecycle.PausingDispatcherKt#whenStarted(androidx.lifecycle.LifecycleOwner, kotlin.jvm.functions.Function2<? super kotlinx.coroutines.CoroutineScope,? super kotlin.coroutines.Continuation<? super T>,?>, kotlin.coroutines.Continuation<? super T>):
- Missing nullability on method `whenStarted` return
-MissingNullability: androidx.lifecycle.PausingDispatcherKt#whenStateAtLeast(androidx.lifecycle.Lifecycle, androidx.lifecycle.Lifecycle.State, kotlin.jvm.functions.Function2<? super kotlinx.coroutines.CoroutineScope,? super kotlin.coroutines.Continuation<? super T>,?>, kotlin.coroutines.Continuation<? super T>):
- Missing nullability on method `whenStateAtLeast` return
diff --git a/lifecycle/lifecycle-runtime-ktx/api/current.txt b/lifecycle/lifecycle-runtime-ktx/api/current.txt
index b3d791e..60b6383 100644
--- a/lifecycle/lifecycle-runtime-ktx/api/current.txt
+++ b/lifecycle/lifecycle-runtime-ktx/api/current.txt
@@ -16,13 +16,13 @@
}
public final class PausingDispatcherKt {
- method public static suspend <T> Object! whenCreated(androidx.lifecycle.LifecycleOwner, kotlin.jvm.functions.Function2<? super kotlinx.coroutines.CoroutineScope,? super kotlin.coroutines.Continuation<? super T>,?> block, kotlin.coroutines.Continuation<? super T> p);
- method public static suspend <T> Object! whenCreated(androidx.lifecycle.Lifecycle, kotlin.jvm.functions.Function2<? super kotlinx.coroutines.CoroutineScope,? super kotlin.coroutines.Continuation<? super T>,?> block, kotlin.coroutines.Continuation<? super T> p);
- method public static suspend <T> Object! whenResumed(androidx.lifecycle.LifecycleOwner, kotlin.jvm.functions.Function2<? super kotlinx.coroutines.CoroutineScope,? super kotlin.coroutines.Continuation<? super T>,?> block, kotlin.coroutines.Continuation<? super T> p);
- method public static suspend <T> Object! whenResumed(androidx.lifecycle.Lifecycle, kotlin.jvm.functions.Function2<? super kotlinx.coroutines.CoroutineScope,? super kotlin.coroutines.Continuation<? super T>,?> block, kotlin.coroutines.Continuation<? super T> p);
- method public static suspend <T> Object! whenStarted(androidx.lifecycle.LifecycleOwner, kotlin.jvm.functions.Function2<? super kotlinx.coroutines.CoroutineScope,? super kotlin.coroutines.Continuation<? super T>,?> block, kotlin.coroutines.Continuation<? super T> p);
- method public static suspend <T> Object! whenStarted(androidx.lifecycle.Lifecycle, kotlin.jvm.functions.Function2<? super kotlinx.coroutines.CoroutineScope,? super kotlin.coroutines.Continuation<? super T>,?> block, kotlin.coroutines.Continuation<? super T> p);
- method public static suspend <T> Object! whenStateAtLeast(androidx.lifecycle.Lifecycle, androidx.lifecycle.Lifecycle.State minState, kotlin.jvm.functions.Function2<? super kotlinx.coroutines.CoroutineScope,? super kotlin.coroutines.Continuation<? super T>,?> block, kotlin.coroutines.Continuation<? super T> p);
+ method public static suspend <T> Object? whenCreated(androidx.lifecycle.LifecycleOwner, kotlin.jvm.functions.Function2<? super kotlinx.coroutines.CoroutineScope,? super kotlin.coroutines.Continuation<? super T>,?> block, kotlin.coroutines.Continuation<? super T> p);
+ method public static suspend <T> Object? whenCreated(androidx.lifecycle.Lifecycle, kotlin.jvm.functions.Function2<? super kotlinx.coroutines.CoroutineScope,? super kotlin.coroutines.Continuation<? super T>,?> block, kotlin.coroutines.Continuation<? super T> p);
+ method public static suspend <T> Object? whenResumed(androidx.lifecycle.LifecycleOwner, kotlin.jvm.functions.Function2<? super kotlinx.coroutines.CoroutineScope,? super kotlin.coroutines.Continuation<? super T>,?> block, kotlin.coroutines.Continuation<? super T> p);
+ method public static suspend <T> Object? whenResumed(androidx.lifecycle.Lifecycle, kotlin.jvm.functions.Function2<? super kotlinx.coroutines.CoroutineScope,? super kotlin.coroutines.Continuation<? super T>,?> block, kotlin.coroutines.Continuation<? super T> p);
+ method public static suspend <T> Object? whenStarted(androidx.lifecycle.LifecycleOwner, kotlin.jvm.functions.Function2<? super kotlinx.coroutines.CoroutineScope,? super kotlin.coroutines.Continuation<? super T>,?> block, kotlin.coroutines.Continuation<? super T> p);
+ method public static suspend <T> Object? whenStarted(androidx.lifecycle.Lifecycle, kotlin.jvm.functions.Function2<? super kotlinx.coroutines.CoroutineScope,? super kotlin.coroutines.Continuation<? super T>,?> block, kotlin.coroutines.Continuation<? super T> p);
+ method public static suspend <T> Object? whenStateAtLeast(androidx.lifecycle.Lifecycle, androidx.lifecycle.Lifecycle.State minState, kotlin.jvm.functions.Function2<? super kotlinx.coroutines.CoroutineScope,? super kotlin.coroutines.Continuation<? super T>,?> block, kotlin.coroutines.Continuation<? super T> p);
}
public final class ViewKt {
diff --git a/lifecycle/lifecycle-runtime-ktx/api/public_plus_experimental_2.3.0-alpha03.txt b/lifecycle/lifecycle-runtime-ktx/api/public_plus_experimental_2.3.0-alpha03.txt
index b3d791e..60b6383 100644
--- a/lifecycle/lifecycle-runtime-ktx/api/public_plus_experimental_2.3.0-alpha03.txt
+++ b/lifecycle/lifecycle-runtime-ktx/api/public_plus_experimental_2.3.0-alpha03.txt
@@ -16,13 +16,13 @@
}
public final class PausingDispatcherKt {
- method public static suspend <T> Object! whenCreated(androidx.lifecycle.LifecycleOwner, kotlin.jvm.functions.Function2<? super kotlinx.coroutines.CoroutineScope,? super kotlin.coroutines.Continuation<? super T>,?> block, kotlin.coroutines.Continuation<? super T> p);
- method public static suspend <T> Object! whenCreated(androidx.lifecycle.Lifecycle, kotlin.jvm.functions.Function2<? super kotlinx.coroutines.CoroutineScope,? super kotlin.coroutines.Continuation<? super T>,?> block, kotlin.coroutines.Continuation<? super T> p);
- method public static suspend <T> Object! whenResumed(androidx.lifecycle.LifecycleOwner, kotlin.jvm.functions.Function2<? super kotlinx.coroutines.CoroutineScope,? super kotlin.coroutines.Continuation<? super T>,?> block, kotlin.coroutines.Continuation<? super T> p);
- method public static suspend <T> Object! whenResumed(androidx.lifecycle.Lifecycle, kotlin.jvm.functions.Function2<? super kotlinx.coroutines.CoroutineScope,? super kotlin.coroutines.Continuation<? super T>,?> block, kotlin.coroutines.Continuation<? super T> p);
- method public static suspend <T> Object! whenStarted(androidx.lifecycle.LifecycleOwner, kotlin.jvm.functions.Function2<? super kotlinx.coroutines.CoroutineScope,? super kotlin.coroutines.Continuation<? super T>,?> block, kotlin.coroutines.Continuation<? super T> p);
- method public static suspend <T> Object! whenStarted(androidx.lifecycle.Lifecycle, kotlin.jvm.functions.Function2<? super kotlinx.coroutines.CoroutineScope,? super kotlin.coroutines.Continuation<? super T>,?> block, kotlin.coroutines.Continuation<? super T> p);
- method public static suspend <T> Object! whenStateAtLeast(androidx.lifecycle.Lifecycle, androidx.lifecycle.Lifecycle.State minState, kotlin.jvm.functions.Function2<? super kotlinx.coroutines.CoroutineScope,? super kotlin.coroutines.Continuation<? super T>,?> block, kotlin.coroutines.Continuation<? super T> p);
+ method public static suspend <T> Object? whenCreated(androidx.lifecycle.LifecycleOwner, kotlin.jvm.functions.Function2<? super kotlinx.coroutines.CoroutineScope,? super kotlin.coroutines.Continuation<? super T>,?> block, kotlin.coroutines.Continuation<? super T> p);
+ method public static suspend <T> Object? whenCreated(androidx.lifecycle.Lifecycle, kotlin.jvm.functions.Function2<? super kotlinx.coroutines.CoroutineScope,? super kotlin.coroutines.Continuation<? super T>,?> block, kotlin.coroutines.Continuation<? super T> p);
+ method public static suspend <T> Object? whenResumed(androidx.lifecycle.LifecycleOwner, kotlin.jvm.functions.Function2<? super kotlinx.coroutines.CoroutineScope,? super kotlin.coroutines.Continuation<? super T>,?> block, kotlin.coroutines.Continuation<? super T> p);
+ method public static suspend <T> Object? whenResumed(androidx.lifecycle.Lifecycle, kotlin.jvm.functions.Function2<? super kotlinx.coroutines.CoroutineScope,? super kotlin.coroutines.Continuation<? super T>,?> block, kotlin.coroutines.Continuation<? super T> p);
+ method public static suspend <T> Object? whenStarted(androidx.lifecycle.LifecycleOwner, kotlin.jvm.functions.Function2<? super kotlinx.coroutines.CoroutineScope,? super kotlin.coroutines.Continuation<? super T>,?> block, kotlin.coroutines.Continuation<? super T> p);
+ method public static suspend <T> Object? whenStarted(androidx.lifecycle.Lifecycle, kotlin.jvm.functions.Function2<? super kotlinx.coroutines.CoroutineScope,? super kotlin.coroutines.Continuation<? super T>,?> block, kotlin.coroutines.Continuation<? super T> p);
+ method public static suspend <T> Object? whenStateAtLeast(androidx.lifecycle.Lifecycle, androidx.lifecycle.Lifecycle.State minState, kotlin.jvm.functions.Function2<? super kotlinx.coroutines.CoroutineScope,? super kotlin.coroutines.Continuation<? super T>,?> block, kotlin.coroutines.Continuation<? super T> p);
}
public final class ViewKt {
diff --git a/lifecycle/lifecycle-runtime-ktx/api/public_plus_experimental_current.txt b/lifecycle/lifecycle-runtime-ktx/api/public_plus_experimental_current.txt
index b3d791e..60b6383 100644
--- a/lifecycle/lifecycle-runtime-ktx/api/public_plus_experimental_current.txt
+++ b/lifecycle/lifecycle-runtime-ktx/api/public_plus_experimental_current.txt
@@ -16,13 +16,13 @@
}
public final class PausingDispatcherKt {
- method public static suspend <T> Object! whenCreated(androidx.lifecycle.LifecycleOwner, kotlin.jvm.functions.Function2<? super kotlinx.coroutines.CoroutineScope,? super kotlin.coroutines.Continuation<? super T>,?> block, kotlin.coroutines.Continuation<? super T> p);
- method public static suspend <T> Object! whenCreated(androidx.lifecycle.Lifecycle, kotlin.jvm.functions.Function2<? super kotlinx.coroutines.CoroutineScope,? super kotlin.coroutines.Continuation<? super T>,?> block, kotlin.coroutines.Continuation<? super T> p);
- method public static suspend <T> Object! whenResumed(androidx.lifecycle.LifecycleOwner, kotlin.jvm.functions.Function2<? super kotlinx.coroutines.CoroutineScope,? super kotlin.coroutines.Continuation<? super T>,?> block, kotlin.coroutines.Continuation<? super T> p);
- method public static suspend <T> Object! whenResumed(androidx.lifecycle.Lifecycle, kotlin.jvm.functions.Function2<? super kotlinx.coroutines.CoroutineScope,? super kotlin.coroutines.Continuation<? super T>,?> block, kotlin.coroutines.Continuation<? super T> p);
- method public static suspend <T> Object! whenStarted(androidx.lifecycle.LifecycleOwner, kotlin.jvm.functions.Function2<? super kotlinx.coroutines.CoroutineScope,? super kotlin.coroutines.Continuation<? super T>,?> block, kotlin.coroutines.Continuation<? super T> p);
- method public static suspend <T> Object! whenStarted(androidx.lifecycle.Lifecycle, kotlin.jvm.functions.Function2<? super kotlinx.coroutines.CoroutineScope,? super kotlin.coroutines.Continuation<? super T>,?> block, kotlin.coroutines.Continuation<? super T> p);
- method public static suspend <T> Object! whenStateAtLeast(androidx.lifecycle.Lifecycle, androidx.lifecycle.Lifecycle.State minState, kotlin.jvm.functions.Function2<? super kotlinx.coroutines.CoroutineScope,? super kotlin.coroutines.Continuation<? super T>,?> block, kotlin.coroutines.Continuation<? super T> p);
+ method public static suspend <T> Object? whenCreated(androidx.lifecycle.LifecycleOwner, kotlin.jvm.functions.Function2<? super kotlinx.coroutines.CoroutineScope,? super kotlin.coroutines.Continuation<? super T>,?> block, kotlin.coroutines.Continuation<? super T> p);
+ method public static suspend <T> Object? whenCreated(androidx.lifecycle.Lifecycle, kotlin.jvm.functions.Function2<? super kotlinx.coroutines.CoroutineScope,? super kotlin.coroutines.Continuation<? super T>,?> block, kotlin.coroutines.Continuation<? super T> p);
+ method public static suspend <T> Object? whenResumed(androidx.lifecycle.LifecycleOwner, kotlin.jvm.functions.Function2<? super kotlinx.coroutines.CoroutineScope,? super kotlin.coroutines.Continuation<? super T>,?> block, kotlin.coroutines.Continuation<? super T> p);
+ method public static suspend <T> Object? whenResumed(androidx.lifecycle.Lifecycle, kotlin.jvm.functions.Function2<? super kotlinx.coroutines.CoroutineScope,? super kotlin.coroutines.Continuation<? super T>,?> block, kotlin.coroutines.Continuation<? super T> p);
+ method public static suspend <T> Object? whenStarted(androidx.lifecycle.LifecycleOwner, kotlin.jvm.functions.Function2<? super kotlinx.coroutines.CoroutineScope,? super kotlin.coroutines.Continuation<? super T>,?> block, kotlin.coroutines.Continuation<? super T> p);
+ method public static suspend <T> Object? whenStarted(androidx.lifecycle.Lifecycle, kotlin.jvm.functions.Function2<? super kotlinx.coroutines.CoroutineScope,? super kotlin.coroutines.Continuation<? super T>,?> block, kotlin.coroutines.Continuation<? super T> p);
+ method public static suspend <T> Object? whenStateAtLeast(androidx.lifecycle.Lifecycle, androidx.lifecycle.Lifecycle.State minState, kotlin.jvm.functions.Function2<? super kotlinx.coroutines.CoroutineScope,? super kotlin.coroutines.Continuation<? super T>,?> block, kotlin.coroutines.Continuation<? super T> p);
}
public final class ViewKt {
diff --git a/lifecycle/lifecycle-runtime-ktx/api/restricted_2.3.0-alpha03.txt b/lifecycle/lifecycle-runtime-ktx/api/restricted_2.3.0-alpha03.txt
index b3d791e..60b6383 100644
--- a/lifecycle/lifecycle-runtime-ktx/api/restricted_2.3.0-alpha03.txt
+++ b/lifecycle/lifecycle-runtime-ktx/api/restricted_2.3.0-alpha03.txt
@@ -16,13 +16,13 @@
}
public final class PausingDispatcherKt {
- method public static suspend <T> Object! whenCreated(androidx.lifecycle.LifecycleOwner, kotlin.jvm.functions.Function2<? super kotlinx.coroutines.CoroutineScope,? super kotlin.coroutines.Continuation<? super T>,?> block, kotlin.coroutines.Continuation<? super T> p);
- method public static suspend <T> Object! whenCreated(androidx.lifecycle.Lifecycle, kotlin.jvm.functions.Function2<? super kotlinx.coroutines.CoroutineScope,? super kotlin.coroutines.Continuation<? super T>,?> block, kotlin.coroutines.Continuation<? super T> p);
- method public static suspend <T> Object! whenResumed(androidx.lifecycle.LifecycleOwner, kotlin.jvm.functions.Function2<? super kotlinx.coroutines.CoroutineScope,? super kotlin.coroutines.Continuation<? super T>,?> block, kotlin.coroutines.Continuation<? super T> p);
- method public static suspend <T> Object! whenResumed(androidx.lifecycle.Lifecycle, kotlin.jvm.functions.Function2<? super kotlinx.coroutines.CoroutineScope,? super kotlin.coroutines.Continuation<? super T>,?> block, kotlin.coroutines.Continuation<? super T> p);
- method public static suspend <T> Object! whenStarted(androidx.lifecycle.LifecycleOwner, kotlin.jvm.functions.Function2<? super kotlinx.coroutines.CoroutineScope,? super kotlin.coroutines.Continuation<? super T>,?> block, kotlin.coroutines.Continuation<? super T> p);
- method public static suspend <T> Object! whenStarted(androidx.lifecycle.Lifecycle, kotlin.jvm.functions.Function2<? super kotlinx.coroutines.CoroutineScope,? super kotlin.coroutines.Continuation<? super T>,?> block, kotlin.coroutines.Continuation<? super T> p);
- method public static suspend <T> Object! whenStateAtLeast(androidx.lifecycle.Lifecycle, androidx.lifecycle.Lifecycle.State minState, kotlin.jvm.functions.Function2<? super kotlinx.coroutines.CoroutineScope,? super kotlin.coroutines.Continuation<? super T>,?> block, kotlin.coroutines.Continuation<? super T> p);
+ method public static suspend <T> Object? whenCreated(androidx.lifecycle.LifecycleOwner, kotlin.jvm.functions.Function2<? super kotlinx.coroutines.CoroutineScope,? super kotlin.coroutines.Continuation<? super T>,?> block, kotlin.coroutines.Continuation<? super T> p);
+ method public static suspend <T> Object? whenCreated(androidx.lifecycle.Lifecycle, kotlin.jvm.functions.Function2<? super kotlinx.coroutines.CoroutineScope,? super kotlin.coroutines.Continuation<? super T>,?> block, kotlin.coroutines.Continuation<? super T> p);
+ method public static suspend <T> Object? whenResumed(androidx.lifecycle.LifecycleOwner, kotlin.jvm.functions.Function2<? super kotlinx.coroutines.CoroutineScope,? super kotlin.coroutines.Continuation<? super T>,?> block, kotlin.coroutines.Continuation<? super T> p);
+ method public static suspend <T> Object? whenResumed(androidx.lifecycle.Lifecycle, kotlin.jvm.functions.Function2<? super kotlinx.coroutines.CoroutineScope,? super kotlin.coroutines.Continuation<? super T>,?> block, kotlin.coroutines.Continuation<? super T> p);
+ method public static suspend <T> Object? whenStarted(androidx.lifecycle.LifecycleOwner, kotlin.jvm.functions.Function2<? super kotlinx.coroutines.CoroutineScope,? super kotlin.coroutines.Continuation<? super T>,?> block, kotlin.coroutines.Continuation<? super T> p);
+ method public static suspend <T> Object? whenStarted(androidx.lifecycle.Lifecycle, kotlin.jvm.functions.Function2<? super kotlinx.coroutines.CoroutineScope,? super kotlin.coroutines.Continuation<? super T>,?> block, kotlin.coroutines.Continuation<? super T> p);
+ method public static suspend <T> Object? whenStateAtLeast(androidx.lifecycle.Lifecycle, androidx.lifecycle.Lifecycle.State minState, kotlin.jvm.functions.Function2<? super kotlinx.coroutines.CoroutineScope,? super kotlin.coroutines.Continuation<? super T>,?> block, kotlin.coroutines.Continuation<? super T> p);
}
public final class ViewKt {
diff --git a/lifecycle/lifecycle-runtime-ktx/api/restricted_current.txt b/lifecycle/lifecycle-runtime-ktx/api/restricted_current.txt
index b3d791e..60b6383 100644
--- a/lifecycle/lifecycle-runtime-ktx/api/restricted_current.txt
+++ b/lifecycle/lifecycle-runtime-ktx/api/restricted_current.txt
@@ -16,13 +16,13 @@
}
public final class PausingDispatcherKt {
- method public static suspend <T> Object! whenCreated(androidx.lifecycle.LifecycleOwner, kotlin.jvm.functions.Function2<? super kotlinx.coroutines.CoroutineScope,? super kotlin.coroutines.Continuation<? super T>,?> block, kotlin.coroutines.Continuation<? super T> p);
- method public static suspend <T> Object! whenCreated(androidx.lifecycle.Lifecycle, kotlin.jvm.functions.Function2<? super kotlinx.coroutines.CoroutineScope,? super kotlin.coroutines.Continuation<? super T>,?> block, kotlin.coroutines.Continuation<? super T> p);
- method public static suspend <T> Object! whenResumed(androidx.lifecycle.LifecycleOwner, kotlin.jvm.functions.Function2<? super kotlinx.coroutines.CoroutineScope,? super kotlin.coroutines.Continuation<? super T>,?> block, kotlin.coroutines.Continuation<? super T> p);
- method public static suspend <T> Object! whenResumed(androidx.lifecycle.Lifecycle, kotlin.jvm.functions.Function2<? super kotlinx.coroutines.CoroutineScope,? super kotlin.coroutines.Continuation<? super T>,?> block, kotlin.coroutines.Continuation<? super T> p);
- method public static suspend <T> Object! whenStarted(androidx.lifecycle.LifecycleOwner, kotlin.jvm.functions.Function2<? super kotlinx.coroutines.CoroutineScope,? super kotlin.coroutines.Continuation<? super T>,?> block, kotlin.coroutines.Continuation<? super T> p);
- method public static suspend <T> Object! whenStarted(androidx.lifecycle.Lifecycle, kotlin.jvm.functions.Function2<? super kotlinx.coroutines.CoroutineScope,? super kotlin.coroutines.Continuation<? super T>,?> block, kotlin.coroutines.Continuation<? super T> p);
- method public static suspend <T> Object! whenStateAtLeast(androidx.lifecycle.Lifecycle, androidx.lifecycle.Lifecycle.State minState, kotlin.jvm.functions.Function2<? super kotlinx.coroutines.CoroutineScope,? super kotlin.coroutines.Continuation<? super T>,?> block, kotlin.coroutines.Continuation<? super T> p);
+ method public static suspend <T> Object? whenCreated(androidx.lifecycle.LifecycleOwner, kotlin.jvm.functions.Function2<? super kotlinx.coroutines.CoroutineScope,? super kotlin.coroutines.Continuation<? super T>,?> block, kotlin.coroutines.Continuation<? super T> p);
+ method public static suspend <T> Object? whenCreated(androidx.lifecycle.Lifecycle, kotlin.jvm.functions.Function2<? super kotlinx.coroutines.CoroutineScope,? super kotlin.coroutines.Continuation<? super T>,?> block, kotlin.coroutines.Continuation<? super T> p);
+ method public static suspend <T> Object? whenResumed(androidx.lifecycle.LifecycleOwner, kotlin.jvm.functions.Function2<? super kotlinx.coroutines.CoroutineScope,? super kotlin.coroutines.Continuation<? super T>,?> block, kotlin.coroutines.Continuation<? super T> p);
+ method public static suspend <T> Object? whenResumed(androidx.lifecycle.Lifecycle, kotlin.jvm.functions.Function2<? super kotlinx.coroutines.CoroutineScope,? super kotlin.coroutines.Continuation<? super T>,?> block, kotlin.coroutines.Continuation<? super T> p);
+ method public static suspend <T> Object? whenStarted(androidx.lifecycle.LifecycleOwner, kotlin.jvm.functions.Function2<? super kotlinx.coroutines.CoroutineScope,? super kotlin.coroutines.Continuation<? super T>,?> block, kotlin.coroutines.Continuation<? super T> p);
+ method public static suspend <T> Object? whenStarted(androidx.lifecycle.Lifecycle, kotlin.jvm.functions.Function2<? super kotlinx.coroutines.CoroutineScope,? super kotlin.coroutines.Continuation<? super T>,?> block, kotlin.coroutines.Continuation<? super T> p);
+ method public static suspend <T> Object? whenStateAtLeast(androidx.lifecycle.Lifecycle, androidx.lifecycle.Lifecycle.State minState, kotlin.jvm.functions.Function2<? super kotlinx.coroutines.CoroutineScope,? super kotlin.coroutines.Continuation<? super T>,?> block, kotlin.coroutines.Continuation<? super T> p);
}
public final class ViewKt {
diff --git a/lifecycle/lifecycle-viewmodel-ktx/api/2.3.0-alpha03.ignore b/lifecycle/lifecycle-viewmodel-ktx/api/2.3.0-alpha03.ignore
new file mode 100644
index 0000000..9aa947be
--- /dev/null
+++ b/lifecycle/lifecycle-viewmodel-ktx/api/2.3.0-alpha03.ignore
@@ -0,0 +1,3 @@
+// Baseline format: 1.0
+InvalidNullConversion: androidx.lifecycle.ViewModelProviderKt#get(androidx.lifecycle.ViewModelProvider):
+ Attempted to remove @NonNull annotation from method androidx.lifecycle.ViewModelProviderKt.get(androidx.lifecycle.ViewModelProvider)
diff --git a/lifecycle/lifecycle-viewmodel-ktx/api/2.3.0-alpha03.txt b/lifecycle/lifecycle-viewmodel-ktx/api/2.3.0-alpha03.txt
index 34d2bd2..926ef60 100644
--- a/lifecycle/lifecycle-viewmodel-ktx/api/2.3.0-alpha03.txt
+++ b/lifecycle/lifecycle-viewmodel-ktx/api/2.3.0-alpha03.txt
@@ -13,7 +13,11 @@
}
public final class ViewModelProviderKt {
- method @MainThread public static inline <reified VM extends androidx.lifecycle.ViewModel> VM get(androidx.lifecycle.ViewModelProvider);
+ method @MainThread public static inline <reified VM> VM! get(androidx.lifecycle.ViewModelProvider);
+ }
+
+ public final class ViewTreeViewModelKt {
+ method public static androidx.lifecycle.ViewModelStoreOwner? findViewTreeViewModelStoreOwner(android.view.View);
}
}
diff --git a/lifecycle/lifecycle-viewmodel-ktx/api/current.txt b/lifecycle/lifecycle-viewmodel-ktx/api/current.txt
index 34d2bd2..926ef60 100644
--- a/lifecycle/lifecycle-viewmodel-ktx/api/current.txt
+++ b/lifecycle/lifecycle-viewmodel-ktx/api/current.txt
@@ -13,7 +13,11 @@
}
public final class ViewModelProviderKt {
- method @MainThread public static inline <reified VM extends androidx.lifecycle.ViewModel> VM get(androidx.lifecycle.ViewModelProvider);
+ method @MainThread public static inline <reified VM> VM! get(androidx.lifecycle.ViewModelProvider);
+ }
+
+ public final class ViewTreeViewModelKt {
+ method public static androidx.lifecycle.ViewModelStoreOwner? findViewTreeViewModelStoreOwner(android.view.View);
}
}
diff --git a/lifecycle/lifecycle-viewmodel-ktx/api/public_plus_experimental_2.3.0-alpha03.txt b/lifecycle/lifecycle-viewmodel-ktx/api/public_plus_experimental_2.3.0-alpha03.txt
index 34d2bd2..926ef60 100644
--- a/lifecycle/lifecycle-viewmodel-ktx/api/public_plus_experimental_2.3.0-alpha03.txt
+++ b/lifecycle/lifecycle-viewmodel-ktx/api/public_plus_experimental_2.3.0-alpha03.txt
@@ -13,7 +13,11 @@
}
public final class ViewModelProviderKt {
- method @MainThread public static inline <reified VM extends androidx.lifecycle.ViewModel> VM get(androidx.lifecycle.ViewModelProvider);
+ method @MainThread public static inline <reified VM> VM! get(androidx.lifecycle.ViewModelProvider);
+ }
+
+ public final class ViewTreeViewModelKt {
+ method public static androidx.lifecycle.ViewModelStoreOwner? findViewTreeViewModelStoreOwner(android.view.View);
}
}
diff --git a/lifecycle/lifecycle-viewmodel-ktx/api/public_plus_experimental_current.txt b/lifecycle/lifecycle-viewmodel-ktx/api/public_plus_experimental_current.txt
index 34d2bd2..926ef60 100644
--- a/lifecycle/lifecycle-viewmodel-ktx/api/public_plus_experimental_current.txt
+++ b/lifecycle/lifecycle-viewmodel-ktx/api/public_plus_experimental_current.txt
@@ -13,7 +13,11 @@
}
public final class ViewModelProviderKt {
- method @MainThread public static inline <reified VM extends androidx.lifecycle.ViewModel> VM get(androidx.lifecycle.ViewModelProvider);
+ method @MainThread public static inline <reified VM> VM! get(androidx.lifecycle.ViewModelProvider);
+ }
+
+ public final class ViewTreeViewModelKt {
+ method public static androidx.lifecycle.ViewModelStoreOwner? findViewTreeViewModelStoreOwner(android.view.View);
}
}
diff --git a/lifecycle/lifecycle-viewmodel-ktx/api/restricted_2.3.0-alpha03.ignore b/lifecycle/lifecycle-viewmodel-ktx/api/restricted_2.3.0-alpha03.ignore
new file mode 100644
index 0000000..9aa947be
--- /dev/null
+++ b/lifecycle/lifecycle-viewmodel-ktx/api/restricted_2.3.0-alpha03.ignore
@@ -0,0 +1,3 @@
+// Baseline format: 1.0
+InvalidNullConversion: androidx.lifecycle.ViewModelProviderKt#get(androidx.lifecycle.ViewModelProvider):
+ Attempted to remove @NonNull annotation from method androidx.lifecycle.ViewModelProviderKt.get(androidx.lifecycle.ViewModelProvider)
diff --git a/lifecycle/lifecycle-viewmodel-ktx/api/restricted_2.3.0-alpha03.txt b/lifecycle/lifecycle-viewmodel-ktx/api/restricted_2.3.0-alpha03.txt
index 34d2bd2..926ef60 100644
--- a/lifecycle/lifecycle-viewmodel-ktx/api/restricted_2.3.0-alpha03.txt
+++ b/lifecycle/lifecycle-viewmodel-ktx/api/restricted_2.3.0-alpha03.txt
@@ -13,7 +13,11 @@
}
public final class ViewModelProviderKt {
- method @MainThread public static inline <reified VM extends androidx.lifecycle.ViewModel> VM get(androidx.lifecycle.ViewModelProvider);
+ method @MainThread public static inline <reified VM> VM! get(androidx.lifecycle.ViewModelProvider);
+ }
+
+ public final class ViewTreeViewModelKt {
+ method public static androidx.lifecycle.ViewModelStoreOwner? findViewTreeViewModelStoreOwner(android.view.View);
}
}
diff --git a/lifecycle/lifecycle-viewmodel-ktx/api/restricted_current.txt b/lifecycle/lifecycle-viewmodel-ktx/api/restricted_current.txt
index 34d2bd2..926ef60 100644
--- a/lifecycle/lifecycle-viewmodel-ktx/api/restricted_current.txt
+++ b/lifecycle/lifecycle-viewmodel-ktx/api/restricted_current.txt
@@ -13,7 +13,11 @@
}
public final class ViewModelProviderKt {
- method @MainThread public static inline <reified VM extends androidx.lifecycle.ViewModel> VM get(androidx.lifecycle.ViewModelProvider);
+ method @MainThread public static inline <reified VM> VM! get(androidx.lifecycle.ViewModelProvider);
+ }
+
+ public final class ViewTreeViewModelKt {
+ method public static androidx.lifecycle.ViewModelStoreOwner? findViewTreeViewModelStoreOwner(android.view.View);
}
}
diff --git a/lifecycle/lifecycle-viewmodel-ktx/src/androidTest/java/androidx/lifecycle/ViewTreeViewModelStoreOwnerTest.kt b/lifecycle/lifecycle-viewmodel-ktx/src/androidTest/java/androidx/lifecycle/ViewTreeViewModelStoreOwnerTest.kt
new file mode 100644
index 0000000..dff909e
--- /dev/null
+++ b/lifecycle/lifecycle-viewmodel-ktx/src/androidTest/java/androidx/lifecycle/ViewTreeViewModelStoreOwnerTest.kt
@@ -0,0 +1,121 @@
+/*
+ * 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 android.view.View
+import android.view.ViewGroup
+import android.widget.FrameLayout
+import androidx.test.ext.junit.runners.AndroidJUnit4
+import androidx.test.filters.SmallTest
+import androidx.test.platform.app.InstrumentationRegistry
+import com.google.common.truth.Truth.assertWithMessage
+import org.junit.Test
+import org.junit.runner.RunWith
+
+@RunWith(AndroidJUnit4::class)
+@SmallTest
+class ViewTreeViewModelStoreOwnerTest {
+ /**
+ * Tests that a direct set/get on a single view survives a round trip
+ */
+ @Test
+ fun setGetSameView() {
+ val v = View(InstrumentationRegistry.getInstrumentation().context)
+
+ assertWithMessage("initial ViewModelStoreOwner expects null")
+ .that(v.findViewTreeViewModelStoreOwner())
+ .isNull()
+
+ val dummyOwner: ViewModelStoreOwner = DummyViewModelStoreOwner()
+ ViewTreeViewModelStoreOwner.set(v, dummyOwner)
+
+ assertWithMessage("get the ViewModelStoreOwner set directly")
+ .that(v.findViewTreeViewModelStoreOwner())
+ .isEqualTo(dummyOwner)
+ }
+
+ /**
+ * Tests that the owner set on a root of a subhierarchy is seen by both direct children
+ * and other descendants
+ */
+ @Test
+ fun getAncestorOwner() {
+ val context = InstrumentationRegistry.getInstrumentation().context
+ val root: ViewGroup = FrameLayout(context)
+ val parent: ViewGroup = FrameLayout(context)
+ val child = View(context)
+ root.addView(parent)
+ parent.addView(child)
+
+ assertWithMessage("initial ViewModelStoreOwner expects null")
+ .that(child.findViewTreeViewModelStoreOwner())
+ .isNull()
+
+ val dummyOwner: ViewModelStoreOwner = DummyViewModelStoreOwner()
+ ViewTreeViewModelStoreOwner.set(root, dummyOwner)
+
+ assertWithMessage("root sees owner")
+ .that(root.findViewTreeViewModelStoreOwner())
+ .isEqualTo(dummyOwner)
+ assertWithMessage("direct child sees owner")
+ .that(parent.findViewTreeViewModelStoreOwner())
+ .isEqualTo(dummyOwner)
+ assertWithMessage("grandchild sees owner")
+ .that(child.findViewTreeViewModelStoreOwner())
+ .isEqualTo(dummyOwner)
+ }
+
+ /**
+ * Tests that a new owner set between a root and a descendant is seen by the descendant
+ * instead of the root value
+ */
+ @Test
+ fun shadowedOwner() {
+ val context =
+ InstrumentationRegistry.getInstrumentation().context
+ val root: ViewGroup = FrameLayout(context)
+ val parent: ViewGroup = FrameLayout(context)
+ val child = View(context)
+ root.addView(parent)
+ parent.addView(child)
+
+ assertWithMessage("initial ViewModelStoreOwner expects null")
+ .that(child.findViewTreeViewModelStoreOwner())
+ .isNull()
+
+ val rootDummyOwner: ViewModelStoreOwner = DummyViewModelStoreOwner()
+ ViewTreeViewModelStoreOwner.set(root, rootDummyOwner)
+
+ val parentDummyOwner: ViewModelStoreOwner = DummyViewModelStoreOwner()
+ ViewTreeViewModelStoreOwner.set(parent, parentDummyOwner)
+
+ assertWithMessage("root sees owner")
+ .that(root.findViewTreeViewModelStoreOwner())
+ .isEqualTo(rootDummyOwner)
+ assertWithMessage("direct child sees owner")
+ .that(parent.findViewTreeViewModelStoreOwner())
+ .isEqualTo(parentDummyOwner)
+ assertWithMessage("grandchild sees owner")
+ .that(child.findViewTreeViewModelStoreOwner())
+ .isEqualTo(parentDummyOwner)
+ }
+
+ internal class DummyViewModelStoreOwner : ViewModelStoreOwner {
+ override fun getViewModelStore(): ViewModelStore {
+ throw UnsupportedOperationException("not a real ViewModelStoreOwner")
+ }
+ }
+}
diff --git a/samples/SupportTransitionDemos/src/main/java/com/example/android/support/transition/widget/FastOutSlowInInterpolator.java b/lifecycle/lifecycle-viewmodel-ktx/src/main/java/androidx/lifecycle/ViewTreeViewModel.kt
similarity index 63%
copy from samples/SupportTransitionDemos/src/main/java/com/example/android/support/transition/widget/FastOutSlowInInterpolator.java
copy to lifecycle/lifecycle-viewmodel-ktx/src/main/java/androidx/lifecycle/ViewTreeViewModel.kt
index 6cf5ba4..dc9622f 100644
--- a/samples/SupportTransitionDemos/src/main/java/com/example/android/support/transition/widget/FastOutSlowInInterpolator.java
+++ b/lifecycle/lifecycle-viewmodel-ktx/src/main/java/androidx/lifecycle/ViewTreeViewModel.kt
@@ -14,13 +14,13 @@
* limitations under the License.
*/
-package com.example.android.support.transition.widget;
+package androidx.lifecycle
-import androidx.core.animation.PathInterpolator;
+import android.view.View
-class FastOutSlowInInterpolator extends PathInterpolator {
-
- FastOutSlowInInterpolator() {
- super(0.4f, 0f, 0.2f, 1f);
- }
-}
+/**
+ * Locates the [ViewModelStoreOwner] associated with this [View], if present.
+ * This may be used to retain state associated with this view across configuration changes.
+ */
+fun View.findViewTreeViewModelStoreOwner(): ViewModelStoreOwner? =
+ ViewTreeViewModelStoreOwner.get(this)
diff --git a/lifecycle/lifecycle-viewmodel-savedstate/api/2.3.0-alpha03.txt b/lifecycle/lifecycle-viewmodel-savedstate/api/2.3.0-alpha03.txt
index f5d4374..d1638a6 100644
--- a/lifecycle/lifecycle-viewmodel-savedstate/api/2.3.0-alpha03.txt
+++ b/lifecycle/lifecycle-viewmodel-savedstate/api/2.3.0-alpha03.txt
@@ -10,6 +10,7 @@
public final class SavedStateHandle {
ctor public SavedStateHandle(java.util.Map<java.lang.String!,java.lang.Object!>);
ctor public SavedStateHandle();
+ method @MainThread public void clearSavedStateProvider(String);
method @MainThread public boolean contains(String);
method @MainThread public <T> T? get(String);
method @MainThread public <T> androidx.lifecycle.MutableLiveData<T!> getLiveData(String);
@@ -17,6 +18,7 @@
method @MainThread public java.util.Set<java.lang.String!> keys();
method @MainThread public <T> T? remove(String);
method @MainThread public <T> void set(String, T?);
+ method @MainThread public void setSavedStateProvider(String, androidx.savedstate.SavedStateRegistry.SavedStateProvider);
}
public final class SavedStateViewModelFactory implements androidx.lifecycle.ViewModelProvider.Factory {
diff --git a/lifecycle/lifecycle-viewmodel-savedstate/api/current.txt b/lifecycle/lifecycle-viewmodel-savedstate/api/current.txt
index f5d4374..d1638a6 100644
--- a/lifecycle/lifecycle-viewmodel-savedstate/api/current.txt
+++ b/lifecycle/lifecycle-viewmodel-savedstate/api/current.txt
@@ -10,6 +10,7 @@
public final class SavedStateHandle {
ctor public SavedStateHandle(java.util.Map<java.lang.String!,java.lang.Object!>);
ctor public SavedStateHandle();
+ method @MainThread public void clearSavedStateProvider(String);
method @MainThread public boolean contains(String);
method @MainThread public <T> T? get(String);
method @MainThread public <T> androidx.lifecycle.MutableLiveData<T!> getLiveData(String);
@@ -17,6 +18,7 @@
method @MainThread public java.util.Set<java.lang.String!> keys();
method @MainThread public <T> T? remove(String);
method @MainThread public <T> void set(String, T?);
+ method @MainThread public void setSavedStateProvider(String, androidx.savedstate.SavedStateRegistry.SavedStateProvider);
}
public final class SavedStateViewModelFactory implements androidx.lifecycle.ViewModelProvider.Factory {
diff --git a/lifecycle/lifecycle-viewmodel-savedstate/api/public_plus_experimental_2.3.0-alpha03.txt b/lifecycle/lifecycle-viewmodel-savedstate/api/public_plus_experimental_2.3.0-alpha03.txt
index f5d4374..d1638a6 100644
--- a/lifecycle/lifecycle-viewmodel-savedstate/api/public_plus_experimental_2.3.0-alpha03.txt
+++ b/lifecycle/lifecycle-viewmodel-savedstate/api/public_plus_experimental_2.3.0-alpha03.txt
@@ -10,6 +10,7 @@
public final class SavedStateHandle {
ctor public SavedStateHandle(java.util.Map<java.lang.String!,java.lang.Object!>);
ctor public SavedStateHandle();
+ method @MainThread public void clearSavedStateProvider(String);
method @MainThread public boolean contains(String);
method @MainThread public <T> T? get(String);
method @MainThread public <T> androidx.lifecycle.MutableLiveData<T!> getLiveData(String);
@@ -17,6 +18,7 @@
method @MainThread public java.util.Set<java.lang.String!> keys();
method @MainThread public <T> T? remove(String);
method @MainThread public <T> void set(String, T?);
+ method @MainThread public void setSavedStateProvider(String, androidx.savedstate.SavedStateRegistry.SavedStateProvider);
}
public final class SavedStateViewModelFactory implements androidx.lifecycle.ViewModelProvider.Factory {
diff --git a/lifecycle/lifecycle-viewmodel-savedstate/api/public_plus_experimental_current.txt b/lifecycle/lifecycle-viewmodel-savedstate/api/public_plus_experimental_current.txt
index f5d4374..d1638a6 100644
--- a/lifecycle/lifecycle-viewmodel-savedstate/api/public_plus_experimental_current.txt
+++ b/lifecycle/lifecycle-viewmodel-savedstate/api/public_plus_experimental_current.txt
@@ -10,6 +10,7 @@
public final class SavedStateHandle {
ctor public SavedStateHandle(java.util.Map<java.lang.String!,java.lang.Object!>);
ctor public SavedStateHandle();
+ method @MainThread public void clearSavedStateProvider(String);
method @MainThread public boolean contains(String);
method @MainThread public <T> T? get(String);
method @MainThread public <T> androidx.lifecycle.MutableLiveData<T!> getLiveData(String);
@@ -17,6 +18,7 @@
method @MainThread public java.util.Set<java.lang.String!> keys();
method @MainThread public <T> T? remove(String);
method @MainThread public <T> void set(String, T?);
+ method @MainThread public void setSavedStateProvider(String, androidx.savedstate.SavedStateRegistry.SavedStateProvider);
}
public final class SavedStateViewModelFactory implements androidx.lifecycle.ViewModelProvider.Factory {
diff --git a/lifecycle/lifecycle-viewmodel-savedstate/api/restricted_2.3.0-alpha03.txt b/lifecycle/lifecycle-viewmodel-savedstate/api/restricted_2.3.0-alpha03.txt
index ee292b0..ec77411 100644
--- a/lifecycle/lifecycle-viewmodel-savedstate/api/restricted_2.3.0-alpha03.txt
+++ b/lifecycle/lifecycle-viewmodel-savedstate/api/restricted_2.3.0-alpha03.txt
@@ -11,6 +11,7 @@
public final class SavedStateHandle {
ctor public SavedStateHandle(java.util.Map<java.lang.String!,java.lang.Object!>);
ctor public SavedStateHandle();
+ method @MainThread public void clearSavedStateProvider(String);
method @MainThread public boolean contains(String);
method @MainThread public <T> T? get(String);
method @MainThread public <T> androidx.lifecycle.MutableLiveData<T!> getLiveData(String);
@@ -18,6 +19,7 @@
method @MainThread public java.util.Set<java.lang.String!> keys();
method @MainThread public <T> T? remove(String);
method @MainThread public <T> void set(String, T?);
+ method @MainThread public void setSavedStateProvider(String, androidx.savedstate.SavedStateRegistry.SavedStateProvider);
}
public final class SavedStateViewModelFactory implements androidx.lifecycle.ViewModelProvider.Factory {
diff --git a/lifecycle/lifecycle-viewmodel-savedstate/api/restricted_current.txt b/lifecycle/lifecycle-viewmodel-savedstate/api/restricted_current.txt
index ee292b0..ec77411 100644
--- a/lifecycle/lifecycle-viewmodel-savedstate/api/restricted_current.txt
+++ b/lifecycle/lifecycle-viewmodel-savedstate/api/restricted_current.txt
@@ -11,6 +11,7 @@
public final class SavedStateHandle {
ctor public SavedStateHandle(java.util.Map<java.lang.String!,java.lang.Object!>);
ctor public SavedStateHandle();
+ method @MainThread public void clearSavedStateProvider(String);
method @MainThread public boolean contains(String);
method @MainThread public <T> T? get(String);
method @MainThread public <T> androidx.lifecycle.MutableLiveData<T!> getLiveData(String);
@@ -18,6 +19,7 @@
method @MainThread public java.util.Set<java.lang.String!> keys();
method @MainThread public <T> T? remove(String);
method @MainThread public <T> void set(String, T?);
+ method @MainThread public void setSavedStateProvider(String, androidx.savedstate.SavedStateRegistry.SavedStateProvider);
}
public final class SavedStateViewModelFactory implements androidx.lifecycle.ViewModelProvider.Factory {
diff --git a/lifecycle/lifecycle-viewmodel-savedstate/src/androidTest/java/androidx/lifecycle/SavedStateHandleProviderTest.kt b/lifecycle/lifecycle-viewmodel-savedstate/src/androidTest/java/androidx/lifecycle/SavedStateHandleProviderTest.kt
new file mode 100644
index 0000000..9dc49ff
--- /dev/null
+++ b/lifecycle/lifecycle-viewmodel-savedstate/src/androidTest/java/androidx/lifecycle/SavedStateHandleProviderTest.kt
@@ -0,0 +1,77 @@
+/*
+ * Copyright 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT 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.os.Bundle
+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 com.google.common.truth.Truth.assertWithMessage
+import org.junit.Test
+import org.junit.runner.RunWith
+
+@SmallTest
+@RunWith(AndroidJUnit4::class)
+class SavedStateHandleProviderTest {
+
+ @UiThreadTest
+ @Test
+ fun test() {
+ val handle = SavedStateHandle()
+ var called = false
+ handle.setSavedStateProvider("provider") {
+ called = true
+ Bundle().apply {
+ putString("state", "saved")
+ }
+ }
+
+ // Now save the state
+ val savedState = handle.savedStateProvider().saveState()
+ assertWithMessage("SavedStateProvider should be called")
+ .that(called)
+ .isTrue()
+ val newHandle = SavedStateHandle.createHandle(savedState, null)
+ val savedBundle = newHandle.get<Bundle?>("provider")
+ assertThat(savedBundle)
+ .isNotNull()
+ assertThat(savedBundle?.getString("state"))
+ .isEqualTo("saved")
+ }
+
+ @UiThreadTest
+ @Test
+ fun testResetProvider() {
+ val handle = SavedStateHandle()
+ var called = false
+ handle.setSavedStateProvider("provider") {
+ called = true
+ Bundle().apply {
+ putString("state", "saved")
+ }
+ }
+ // Now reset the SavedStateProvider
+ handle.clearSavedStateProvider("provider")
+
+ // Now save the state
+ handle.savedStateProvider().saveState()
+ assertWithMessage("SavedStateProvider should not be called")
+ .that(called)
+ .isFalse()
+ }
+}
diff --git a/lifecycle/lifecycle-viewmodel-savedstate/src/main/java/androidx/lifecycle/SavedStateHandle.java b/lifecycle/lifecycle-viewmodel-savedstate/src/main/java/androidx/lifecycle/SavedStateHandle.java
index 07b60b3..e5f903f 100644
--- a/lifecycle/lifecycle-viewmodel-savedstate/src/main/java/androidx/lifecycle/SavedStateHandle.java
+++ b/lifecycle/lifecycle-viewmodel-savedstate/src/main/java/androidx/lifecycle/SavedStateHandle.java
@@ -55,6 +55,7 @@
*/
public final class SavedStateHandle {
final Map<String, Object> mRegular;
+ final Map<String, SavedStateProvider> mSavedStateProviders = new HashMap<>();
private final Map<String, SavingStateLiveData<?>> mLiveDatas = new HashMap<>();
private static final String VALUES = "values";
@@ -65,6 +66,14 @@
@NonNull
@Override
public Bundle saveState() {
+ // Get the saved state from each SavedStateProvider registered with this
+ // SavedStateHandle, iterating through a copy to avoid re-entrance
+ Map<String, SavedStateProvider> map = new HashMap<>(mSavedStateProviders);
+ for (Map.Entry<String, SavedStateProvider> entry : map.entrySet()) {
+ Bundle savedState = entry.getValue().saveState();
+ set(entry.getKey(), savedState);
+ }
+ // Convert the Map of current values into a Bundle
Set<String> keySet = mRegular.keySet();
ArrayList keys = new ArrayList(keySet.size());
ArrayList value = new ArrayList(keys.size());
@@ -282,6 +291,52 @@
return latestValue;
}
+ /**
+ * Set a {@link SavedStateProvider} that will have its state saved into this SavedStateHandle.
+ * This provides a mechanism to lazily provide the {@link Bundle} of saved state for the
+ * given key.
+ * <p>
+ * Calls to {@link #get} with this same key will return the previously saved state as a
+ * {@link Bundle} if it exists.
+ *
+ * <pre>
+ * Bundle previousState = savedStateHandle.get("custom_object");
+ * if (previousState != null) {
+ * // Convert the previousState into your custom object
+ * }
+ * savedStateHandle.setSavedStateProvider("custom_object", () -> {
+ * Bundle savedState = new Bundle();
+ * // Put your custom object into the Bundle, doing any conversion required
+ * return savedState;
+ * });
+ * </pre>
+ *
+ * Note: calling this method within {@link SavedStateProvider#saveState()} is supported, but
+ * will only affect future state saving operations.
+ *
+ * @param key a key which will populated with a {@link Bundle} produced by the provider
+ * @param provider a SavedStateProvider which will receive a callback to
+ * {@link SavedStateProvider#saveState()} when the state should be saved
+ */
+ @MainThread
+ public void setSavedStateProvider(@NonNull String key, @NonNull SavedStateProvider provider) {
+ mSavedStateProviders.put(key, provider);
+ }
+
+ /**
+ * Clear any {@link SavedStateProvider} that was previously set via
+ * {@link #setSavedStateProvider(String, SavedStateProvider)}.
+ *
+ * Note: calling this method within {@link SavedStateProvider#saveState()} is supported, but
+ * will only affect future state saving operations.
+ *
+ * @param key a key previously used with {@link #setSavedStateProvider}
+ */
+ @MainThread
+ public void clearSavedStateProvider(@NonNull String key) {
+ mSavedStateProviders.remove(key);
+ }
+
static class SavingStateLiveData<T> extends MutableLiveData<T> {
private String mKey;
private SavedStateHandle mHandle;
diff --git a/lifecycle/lifecycle-viewmodel/api/2.3.0-alpha03.txt b/lifecycle/lifecycle-viewmodel/api/2.3.0-alpha03.txt
index 07a8cb5..7df8caf 100644
--- a/lifecycle/lifecycle-viewmodel/api/2.3.0-alpha03.txt
+++ b/lifecycle/lifecycle-viewmodel/api/2.3.0-alpha03.txt
@@ -46,5 +46,10 @@
method public androidx.lifecycle.ViewModelStore getViewModelStore();
}
+ public class ViewTreeViewModelStoreOwner {
+ method public static androidx.lifecycle.ViewModelStoreOwner? get(android.view.View);
+ method public static void set(android.view.View, androidx.lifecycle.ViewModelStoreOwner?);
+ }
+
}
diff --git a/lifecycle/lifecycle-viewmodel/api/current.txt b/lifecycle/lifecycle-viewmodel/api/current.txt
index 07a8cb5..7df8caf 100644
--- a/lifecycle/lifecycle-viewmodel/api/current.txt
+++ b/lifecycle/lifecycle-viewmodel/api/current.txt
@@ -46,5 +46,10 @@
method public androidx.lifecycle.ViewModelStore getViewModelStore();
}
+ public class ViewTreeViewModelStoreOwner {
+ method public static androidx.lifecycle.ViewModelStoreOwner? get(android.view.View);
+ method public static void set(android.view.View, androidx.lifecycle.ViewModelStoreOwner?);
+ }
+
}
diff --git a/lifecycle/lifecycle-viewmodel/api/public_plus_experimental_2.3.0-alpha03.txt b/lifecycle/lifecycle-viewmodel/api/public_plus_experimental_2.3.0-alpha03.txt
index 07a8cb5..7df8caf 100644
--- a/lifecycle/lifecycle-viewmodel/api/public_plus_experimental_2.3.0-alpha03.txt
+++ b/lifecycle/lifecycle-viewmodel/api/public_plus_experimental_2.3.0-alpha03.txt
@@ -46,5 +46,10 @@
method public androidx.lifecycle.ViewModelStore getViewModelStore();
}
+ public class ViewTreeViewModelStoreOwner {
+ method public static androidx.lifecycle.ViewModelStoreOwner? get(android.view.View);
+ method public static void set(android.view.View, androidx.lifecycle.ViewModelStoreOwner?);
+ }
+
}
diff --git a/lifecycle/lifecycle-viewmodel/api/public_plus_experimental_current.txt b/lifecycle/lifecycle-viewmodel/api/public_plus_experimental_current.txt
index 07a8cb5..7df8caf 100644
--- a/lifecycle/lifecycle-viewmodel/api/public_plus_experimental_current.txt
+++ b/lifecycle/lifecycle-viewmodel/api/public_plus_experimental_current.txt
@@ -46,5 +46,10 @@
method public androidx.lifecycle.ViewModelStore getViewModelStore();
}
+ public class ViewTreeViewModelStoreOwner {
+ method public static androidx.lifecycle.ViewModelStoreOwner? get(android.view.View);
+ method public static void set(android.view.View, androidx.lifecycle.ViewModelStoreOwner?);
+ }
+
}
diff --git a/lifecycle/lifecycle-viewmodel/api/restricted_2.3.0-alpha03.txt b/lifecycle/lifecycle-viewmodel/api/restricted_2.3.0-alpha03.txt
index 07a8cb5..7df8caf 100644
--- a/lifecycle/lifecycle-viewmodel/api/restricted_2.3.0-alpha03.txt
+++ b/lifecycle/lifecycle-viewmodel/api/restricted_2.3.0-alpha03.txt
@@ -46,5 +46,10 @@
method public androidx.lifecycle.ViewModelStore getViewModelStore();
}
+ public class ViewTreeViewModelStoreOwner {
+ method public static androidx.lifecycle.ViewModelStoreOwner? get(android.view.View);
+ method public static void set(android.view.View, androidx.lifecycle.ViewModelStoreOwner?);
+ }
+
}
diff --git a/lifecycle/lifecycle-viewmodel/api/restricted_current.txt b/lifecycle/lifecycle-viewmodel/api/restricted_current.txt
index 07a8cb5..7df8caf 100644
--- a/lifecycle/lifecycle-viewmodel/api/restricted_current.txt
+++ b/lifecycle/lifecycle-viewmodel/api/restricted_current.txt
@@ -46,5 +46,10 @@
method public androidx.lifecycle.ViewModelStore getViewModelStore();
}
+ public class ViewTreeViewModelStoreOwner {
+ method public static androidx.lifecycle.ViewModelStoreOwner? get(android.view.View);
+ method public static void set(android.view.View, androidx.lifecycle.ViewModelStoreOwner?);
+ }
+
}
diff --git a/lifecycle/lifecycle-viewmodel/build.gradle b/lifecycle/lifecycle-viewmodel/build.gradle
index e501d7f..22c6267 100644
--- a/lifecycle/lifecycle-viewmodel/build.gradle
+++ b/lifecycle/lifecycle-viewmodel/build.gradle
@@ -23,6 +23,7 @@
plugins {
id("AndroidXPlugin")
id("com.android.library")
+ id("kotlin-android")
}
android {
@@ -40,6 +41,13 @@
testImplementation(JUNIT)
testImplementation(MOCKITO_CORE)
+
+ androidTestImplementation(TRUTH)
+ androidTestImplementation(KOTLIN_STDLIB)
+ androidTestImplementation(JUNIT)
+ androidTestImplementation(ANDROIDX_TEST_EXT_JUNIT)
+ androidTestImplementation(ANDROIDX_TEST_CORE)
+ androidTestImplementation(ANDROIDX_TEST_RUNNER)
}
androidx {
diff --git a/lifecycle/lifecycle-viewmodel/src/androidTest/java/androidx/lifecycle/ViewTreeViewModelStoreOwnerTest.kt b/lifecycle/lifecycle-viewmodel/src/androidTest/java/androidx/lifecycle/ViewTreeViewModelStoreOwnerTest.kt
new file mode 100644
index 0000000..a878c28
--- /dev/null
+++ b/lifecycle/lifecycle-viewmodel/src/androidTest/java/androidx/lifecycle/ViewTreeViewModelStoreOwnerTest.kt
@@ -0,0 +1,121 @@
+/*
+ * 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 android.view.View
+import android.view.ViewGroup
+import android.widget.FrameLayout
+import androidx.test.ext.junit.runners.AndroidJUnit4
+import androidx.test.filters.SmallTest
+import androidx.test.platform.app.InstrumentationRegistry
+import com.google.common.truth.Truth.assertWithMessage
+import org.junit.Test
+import org.junit.runner.RunWith
+
+@RunWith(AndroidJUnit4::class)
+@SmallTest
+class ViewTreeViewModelStoreOwnerTest {
+ /**
+ * Tests that a direct set/get on a single view survives a round trip
+ */
+ @Test
+ fun setGetSameView() {
+ val v = View(InstrumentationRegistry.getInstrumentation().context)
+
+ assertWithMessage("initial ViewModelStoreOwner expects null")
+ .that(ViewTreeViewModelStoreOwner.get(v))
+ .isNull()
+
+ val dummyOwner: ViewModelStoreOwner = DummyViewModelStoreOwner()
+ ViewTreeViewModelStoreOwner.set(v, dummyOwner)
+
+ assertWithMessage("get the ViewModelStoreOwner set directly")
+ .that(ViewTreeViewModelStoreOwner.get(v))
+ .isEqualTo(dummyOwner)
+ }
+
+ /**
+ * Tests that the owner set on a root of a subhierarchy is seen by both direct children
+ * and other descendants
+ */
+ @Test
+ fun getAncestorOwner() {
+ val context = InstrumentationRegistry.getInstrumentation().context
+ val root: ViewGroup = FrameLayout(context)
+ val parent: ViewGroup = FrameLayout(context)
+ val child = View(context)
+ root.addView(parent)
+ parent.addView(child)
+
+ assertWithMessage("initial ViewModelStoreOwner expects null")
+ .that(ViewTreeViewModelStoreOwner.get(child))
+ .isNull()
+
+ val dummyOwner: ViewModelStoreOwner = DummyViewModelStoreOwner()
+ ViewTreeViewModelStoreOwner.set(root, dummyOwner)
+
+ assertWithMessage("root sees owner")
+ .that(ViewTreeViewModelStoreOwner.get(root))
+ .isEqualTo(dummyOwner)
+ assertWithMessage("direct child sees owner")
+ .that(ViewTreeViewModelStoreOwner.get(parent))
+ .isEqualTo(dummyOwner)
+ assertWithMessage("grandchild sees owner")
+ .that(ViewTreeViewModelStoreOwner.get(child))
+ .isEqualTo(dummyOwner)
+ }
+
+ /**
+ * Tests that a new owner set between a root and a descendant is seen by the descendant
+ * instead of the root value
+ */
+ @Test
+ fun shadowedOwner() {
+ val context =
+ InstrumentationRegistry.getInstrumentation().context
+ val root: ViewGroup = FrameLayout(context)
+ val parent: ViewGroup = FrameLayout(context)
+ val child = View(context)
+ root.addView(parent)
+ parent.addView(child)
+
+ assertWithMessage("initial ViewModelStoreOwner expects null")
+ .that(ViewTreeViewModelStoreOwner.get(child))
+ .isNull()
+
+ val rootDummyOwner: ViewModelStoreOwner = DummyViewModelStoreOwner()
+ ViewTreeViewModelStoreOwner.set(root, rootDummyOwner)
+
+ val parentDummyOwner: ViewModelStoreOwner = DummyViewModelStoreOwner()
+ ViewTreeViewModelStoreOwner.set(parent, parentDummyOwner)
+
+ assertWithMessage("root sees owner")
+ .that(ViewTreeViewModelStoreOwner.get(root))
+ .isEqualTo(rootDummyOwner)
+ assertWithMessage("direct child sees owner")
+ .that(ViewTreeViewModelStoreOwner.get(parent))
+ .isEqualTo(parentDummyOwner)
+ assertWithMessage("grandchild sees owner")
+ .that(ViewTreeViewModelStoreOwner.get(child))
+ .isEqualTo(parentDummyOwner)
+ }
+
+ internal class DummyViewModelStoreOwner : ViewModelStoreOwner {
+ override fun getViewModelStore(): ViewModelStore {
+ throw UnsupportedOperationException("not a real ViewModelStoreOwner")
+ }
+ }
+}
diff --git a/lifecycle/lifecycle-viewmodel/src/main/java/androidx/lifecycle/ViewModelStoreOwner.java b/lifecycle/lifecycle-viewmodel/src/main/java/androidx/lifecycle/ViewModelStoreOwner.java
index d9bec9f..19152be 100644
--- a/lifecycle/lifecycle-viewmodel/src/main/java/androidx/lifecycle/ViewModelStoreOwner.java
+++ b/lifecycle/lifecycle-viewmodel/src/main/java/androidx/lifecycle/ViewModelStoreOwner.java
@@ -24,6 +24,8 @@
* A responsibility of an implementation of this interface is to retain owned ViewModelStore
* during the configuration changes and call {@link ViewModelStore#clear()}, when this scope is
* going to be destroyed.
+ *
+ * @see ViewTreeViewModelStoreOwner
*/
@SuppressWarnings("WeakerAccess")
public interface ViewModelStoreOwner {
diff --git a/lifecycle/lifecycle-viewmodel/src/main/java/androidx/lifecycle/ViewTreeViewModelStoreOwner.java b/lifecycle/lifecycle-viewmodel/src/main/java/androidx/lifecycle/ViewTreeViewModelStoreOwner.java
new file mode 100644
index 0000000..ccf8720
--- /dev/null
+++ b/lifecycle/lifecycle-viewmodel/src/main/java/androidx/lifecycle/ViewTreeViewModelStoreOwner.java
@@ -0,0 +1,74 @@
+/*
+ * Copyright 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT 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.view.View;
+import android.view.ViewParent;
+
+import androidx.annotation.NonNull;
+import androidx.annotation.Nullable;
+import androidx.lifecycle.viewmodel.R;
+
+/**
+ * Accessors for finding a view tree-local {@link ViewModelStoreOwner} that allows access to a
+ * {@link ViewModelStore} for the given view.
+ */
+public class ViewTreeViewModelStoreOwner {
+ private ViewTreeViewModelStoreOwner() {
+ // No instances
+ }
+
+ /**
+ * Set the {@link ViewModelStoreOwner} associated with the given {@link View}.
+ * Calls to {@link #get(View)} from this view or descendants will return
+ * {@code viewModelStoreOwner}.
+ *
+ * <p>This should only be called by constructs such as activities or fragments that manage
+ * a view tree and retain state through a {@link ViewModelStoreOwner}. Callers
+ * should only set a {@link ViewModelStoreOwner} that will be <em>stable.</em> The associated
+ * {@link ViewModelStore} should be cleared if the view tree is removed and is not
+ * guaranteed to later become reattached to a window.</p>
+ *
+ * @param view Root view associated with the viewModelStoreOwner
+ * @param viewModelStoreOwner ViewModelStoreOwner associated with the given view
+ */
+ public static void set(@NonNull View view, @Nullable ViewModelStoreOwner viewModelStoreOwner) {
+ view.setTag(R.id.view_tree_view_model_store_owner, viewModelStoreOwner);
+ }
+
+ /**
+ * Retrieve the {@link ViewModelStoreOwner} associated with the given {@link View}.
+ * This may be used to retain state associated with this view across configuration changes.
+ *
+ * @param view View to fetch a {@link ViewModelStoreOwner} for
+ * @return The {@link ViewModelStoreOwner} associated with this view and/or some subset
+ * of its ancestors
+ */
+ @Nullable
+ public static ViewModelStoreOwner get(@NonNull View view) {
+ ViewModelStoreOwner found = (ViewModelStoreOwner) view.getTag(
+ R.id.view_tree_view_model_store_owner);
+ if (found != null) return found;
+ ViewParent parent = view.getParent();
+ while (found == null && parent instanceof View) {
+ final View parentView = (View) parent;
+ found = (ViewModelStoreOwner) parentView.getTag(R.id.view_tree_view_model_store_owner);
+ parent = parentView.getParent();
+ }
+ return found;
+ }
+}
diff --git a/lifecycle/lifecycle-viewmodel/src/main/res/values/ids.xml b/lifecycle/lifecycle-viewmodel/src/main/res/values/ids.xml
new file mode 100644
index 0000000..7782440
--- /dev/null
+++ b/lifecycle/lifecycle-viewmodel/src/main/res/values/ids.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Copyright 2020 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT 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>
+ <id name="view_tree_view_model_store_owner" />
+</resources>
\ No newline at end of file
diff --git a/media2/player/api/restricted_1.1.0-alpha01.ignore b/media2/player/api/restricted_1.1.0-alpha01.ignore
index 53e98b5..35ef1f7 100644
--- a/media2/player/api/restricted_1.1.0-alpha01.ignore
+++ b/media2/player/api/restricted_1.1.0-alpha01.ignore
@@ -117,7 +117,5 @@
Removed package androidx.media2.player.common
RemovedPackage: androidx.media2.player.exoplayer:
Removed package androidx.media2.player.exoplayer
-RemovedPackage: androidx.media2.player.futures:
- Removed package androidx.media2.player.futures
RemovedPackage: androidx.media2.player.subtitle:
Removed package androidx.media2.player.subtitle
diff --git a/media2/session/api/1.1.0-alpha01.ignore b/media2/session/api/1.1.0-alpha01.ignore
deleted file mode 100644
index a5f5b4a..0000000
--- a/media2/session/api/1.1.0-alpha01.ignore
+++ /dev/null
@@ -1,3 +0,0 @@
-// Baseline format: 1.0
-RemovedInterface: androidx.media2.session.SessionResult:
- Class androidx.media2.session.SessionResult no longer implements androidx.versionedparcelable.VersionedParcelable
diff --git a/media2/session/api/restricted_1.1.0-alpha01.ignore b/media2/session/api/restricted_1.1.0-alpha01.ignore
index 55a2b04..67d4c10 100644
--- a/media2/session/api/restricted_1.1.0-alpha01.ignore
+++ b/media2/session/api/restricted_1.1.0-alpha01.ignore
@@ -39,8 +39,6 @@
Removed class androidx.media2.session.SessionToken.OnSessionTokenCreatedListener
-RemovedMethod: androidx.media2.session.MediaController#getTrackInfo():
- Removed method androidx.media2.session.MediaController.getTrackInfo()
RemovedMethod: androidx.media2.session.MediaController#playFromMediaId(String, android.os.Bundle):
Removed method androidx.media2.session.MediaController.playFromMediaId(String,android.os.Bundle)
RemovedMethod: androidx.media2.session.MediaController#playFromSearch(String, android.os.Bundle):
@@ -55,10 +53,6 @@
Removed method androidx.media2.session.MediaController.prepareFromUri(android.net.Uri,android.os.Bundle)
RemovedMethod: androidx.media2.session.MediaController#setTimeDiff(Long):
Removed method androidx.media2.session.MediaController.setTimeDiff(Long)
-RemovedMethod: androidx.media2.session.MediaController.ControllerCallback#onTrackInfoChanged(androidx.media2.session.MediaController, java.util.List<androidx.media2.common.SessionPlayer.TrackInfo>):
- Removed method androidx.media2.session.MediaController.ControllerCallback.onTrackInfoChanged(androidx.media2.session.MediaController,java.util.List<androidx.media2.common.SessionPlayer.TrackInfo>)
-RemovedMethod: androidx.media2.session.MediaController.ControllerCallback#onVideoSizeChanged(androidx.media2.session.MediaController, androidx.media2.common.MediaItem, androidx.media2.common.VideoSize):
- Removed method androidx.media2.session.MediaController.ControllerCallback.onVideoSizeChanged(androidx.media2.session.MediaController,androidx.media2.common.MediaItem,androidx.media2.common.VideoSize)
RemovedMethod: androidx.media2.session.MediaSession#getSessionCompat():
Removed method androidx.media2.session.MediaSession.getSessionCompat()
RemovedMethod: androidx.media2.session.MediaSession#isClosed():
@@ -87,7 +81,3 @@
Removed method androidx.media2.session.SessionToken.getComponentName()
RemovedMethod: androidx.media2.session.SessionToken#isLegacySession():
Removed method androidx.media2.session.SessionToken.isLegacySession()
-
-
-RemovedPackage: androidx.media2.session.futures:
- Removed package androidx.media2.session.futures
diff --git a/mediarouter/mediarouter/api/restricted_1.2.0-alpha01.ignore b/mediarouter/mediarouter/api/restricted_1.2.0-alpha01.ignore
index 3d77a2e..6871cc5 100644
--- a/mediarouter/mediarouter/api/restricted_1.2.0-alpha01.ignore
+++ b/mediarouter/mediarouter/api/restricted_1.2.0-alpha01.ignore
@@ -2,10 +2,15 @@
RemovedClass: androidx.mediarouter.media.MediaRouteProvider.DynamicGroupRouteController.DynamicRouteDescriptor.SelectionState:
Removed class androidx.mediarouter.media.MediaRouteProvider.DynamicGroupRouteController.DynamicRouteDescriptor.SelectionState
-RemovedMethod: androidx.mediarouter.app.MediaRouteControllerDialogFragment#getRouteSelector():
- Removed method androidx.mediarouter.app.MediaRouteControllerDialogFragment.getRouteSelector()
-RemovedMethod: androidx.mediarouter.app.MediaRouteControllerDialogFragment#setRouteSelector(androidx.mediarouter.media.MediaRouteSelector):
- Removed method androidx.mediarouter.app.MediaRouteControllerDialogFragment.setRouteSelector(androidx.mediarouter.media.MediaRouteSelector)
+
+RemovedField: androidx.mediarouter.media.MediaRouter.RouteInfo#DEVICE_TYPE_BLUETOOTH:
+ Removed field androidx.mediarouter.media.MediaRouter.RouteInfo.DEVICE_TYPE_BLUETOOTH
+RemovedField: androidx.mediarouter.media.MediaRouter.RouteInfo#DEVICE_TYPE_UNKNOWN:
+ Removed field androidx.mediarouter.media.MediaRouter.RouteInfo.DEVICE_TYPE_UNKNOWN
+RemovedField: androidx.mediarouter.media.MediaRouter.RouteInfo#PRESENTATION_DISPLAY_ID_NONE:
+ Removed field androidx.mediarouter.media.MediaRouter.RouteInfo.PRESENTATION_DISPLAY_ID_NONE
+
+
RemovedMethod: androidx.mediarouter.app.MediaRouteControllerDialogFragment#getRouteSelector():
Removed method androidx.mediarouter.app.MediaRouteControllerDialogFragment.getRouteSelector()
RemovedMethod: androidx.mediarouter.app.MediaRouteControllerDialogFragment#setRouteSelector(androidx.mediarouter.media.MediaRouteSelector):
@@ -40,10 +45,3 @@
Removed method androidx.mediarouter.media.MediaRouter.RouteInfo.isDefaultOrBluetooth()
RemovedMethod: androidx.mediarouter.media.MediaRouter.RouteInfo#isGroup():
Removed method androidx.mediarouter.media.MediaRouter.RouteInfo.isGroup()
-
-RemovedField: androidx.mediarouter.media.MediaRouter.RouteInfo#DEVICE_TYPE_BLUETOOTH:
- Removed field androidx.mediarouter.media.MediaRouter.RouteInfo.DEVICE_TYPE_BLUETOOTH
-RemovedField: androidx.mediarouter.media.MediaRouter.RouteInfo#DEVICE_TYPE_UNKNOWN:
- Removed field androidx.mediarouter.media.MediaRouter.RouteInfo.DEVICE_TYPE_UNKNOWN
-RemovedField: androidx.mediarouter.media.MediaRouter.RouteInfo#PRESENTATION_DISPLAY_ID_NONE:
- Removed field androidx.mediarouter.media.MediaRouter.RouteInfo.PRESENTATION_DISPLAY_ID_NONE
diff --git a/navigation/navigation-dynamic-features-fragment/api/2.3.0-alpha07.txt b/navigation/navigation-dynamic-features-fragment/api/2.3.0-alpha07.txt
index 9d22e3d..0034957 100644
--- a/navigation/navigation-dynamic-features-fragment/api/2.3.0-alpha07.txt
+++ b/navigation/navigation-dynamic-features-fragment/api/2.3.0-alpha07.txt
@@ -23,9 +23,9 @@
}
public final class DynamicFragmentNavigatorDestinationBuilderKt {
- method public static inline <reified F extends androidx.fragment.app.Fragment> void fragment(androidx.navigation.dynamicfeatures.DynamicNavGraphBuilder, @IdRes int id);
- method public static inline <reified F extends androidx.fragment.app.Fragment> void fragment(androidx.navigation.dynamicfeatures.DynamicNavGraphBuilder, @IdRes int id, kotlin.jvm.functions.Function1<? super androidx.navigation.dynamicfeatures.fragment.DynamicFragmentNavigatorDestinationBuilder,kotlin.Unit> builder);
method public static inline void fragment(androidx.navigation.dynamicfeatures.DynamicNavGraphBuilder, @IdRes int id, String fragmentClassName, kotlin.jvm.functions.Function1<? super androidx.navigation.dynamicfeatures.fragment.DynamicFragmentNavigatorDestinationBuilder,kotlin.Unit> builder);
+ method public static inline <reified F> void fragment(androidx.navigation.dynamicfeatures.DynamicNavGraphBuilder, @IdRes int id);
+ method public static inline <reified F> void fragment(androidx.navigation.dynamicfeatures.DynamicNavGraphBuilder, @IdRes int id, kotlin.jvm.functions.Function1<? super androidx.navigation.dynamicfeatures.fragment.DynamicFragmentNavigatorDestinationBuilder,? extends kotlin.Unit> builder);
}
public class DynamicNavHostFragment extends androidx.navigation.fragment.NavHostFragment {
diff --git a/navigation/navigation-dynamic-features-fragment/api/current.txt b/navigation/navigation-dynamic-features-fragment/api/current.txt
index 9d22e3d..0034957 100644
--- a/navigation/navigation-dynamic-features-fragment/api/current.txt
+++ b/navigation/navigation-dynamic-features-fragment/api/current.txt
@@ -23,9 +23,9 @@
}
public final class DynamicFragmentNavigatorDestinationBuilderKt {
- method public static inline <reified F extends androidx.fragment.app.Fragment> void fragment(androidx.navigation.dynamicfeatures.DynamicNavGraphBuilder, @IdRes int id);
- method public static inline <reified F extends androidx.fragment.app.Fragment> void fragment(androidx.navigation.dynamicfeatures.DynamicNavGraphBuilder, @IdRes int id, kotlin.jvm.functions.Function1<? super androidx.navigation.dynamicfeatures.fragment.DynamicFragmentNavigatorDestinationBuilder,kotlin.Unit> builder);
method public static inline void fragment(androidx.navigation.dynamicfeatures.DynamicNavGraphBuilder, @IdRes int id, String fragmentClassName, kotlin.jvm.functions.Function1<? super androidx.navigation.dynamicfeatures.fragment.DynamicFragmentNavigatorDestinationBuilder,kotlin.Unit> builder);
+ method public static inline <reified F> void fragment(androidx.navigation.dynamicfeatures.DynamicNavGraphBuilder, @IdRes int id);
+ method public static inline <reified F> void fragment(androidx.navigation.dynamicfeatures.DynamicNavGraphBuilder, @IdRes int id, kotlin.jvm.functions.Function1<? super androidx.navigation.dynamicfeatures.fragment.DynamicFragmentNavigatorDestinationBuilder,? extends kotlin.Unit> builder);
}
public class DynamicNavHostFragment extends androidx.navigation.fragment.NavHostFragment {
diff --git a/navigation/navigation-dynamic-features-fragment/api/public_plus_experimental_2.3.0-alpha07.txt b/navigation/navigation-dynamic-features-fragment/api/public_plus_experimental_2.3.0-alpha07.txt
index 9d22e3d..0034957 100644
--- a/navigation/navigation-dynamic-features-fragment/api/public_plus_experimental_2.3.0-alpha07.txt
+++ b/navigation/navigation-dynamic-features-fragment/api/public_plus_experimental_2.3.0-alpha07.txt
@@ -23,9 +23,9 @@
}
public final class DynamicFragmentNavigatorDestinationBuilderKt {
- method public static inline <reified F extends androidx.fragment.app.Fragment> void fragment(androidx.navigation.dynamicfeatures.DynamicNavGraphBuilder, @IdRes int id);
- method public static inline <reified F extends androidx.fragment.app.Fragment> void fragment(androidx.navigation.dynamicfeatures.DynamicNavGraphBuilder, @IdRes int id, kotlin.jvm.functions.Function1<? super androidx.navigation.dynamicfeatures.fragment.DynamicFragmentNavigatorDestinationBuilder,kotlin.Unit> builder);
method public static inline void fragment(androidx.navigation.dynamicfeatures.DynamicNavGraphBuilder, @IdRes int id, String fragmentClassName, kotlin.jvm.functions.Function1<? super androidx.navigation.dynamicfeatures.fragment.DynamicFragmentNavigatorDestinationBuilder,kotlin.Unit> builder);
+ method public static inline <reified F> void fragment(androidx.navigation.dynamicfeatures.DynamicNavGraphBuilder, @IdRes int id);
+ method public static inline <reified F> void fragment(androidx.navigation.dynamicfeatures.DynamicNavGraphBuilder, @IdRes int id, kotlin.jvm.functions.Function1<? super androidx.navigation.dynamicfeatures.fragment.DynamicFragmentNavigatorDestinationBuilder,? extends kotlin.Unit> builder);
}
public class DynamicNavHostFragment extends androidx.navigation.fragment.NavHostFragment {
diff --git a/navigation/navigation-dynamic-features-fragment/api/public_plus_experimental_current.txt b/navigation/navigation-dynamic-features-fragment/api/public_plus_experimental_current.txt
index 9d22e3d..0034957 100644
--- a/navigation/navigation-dynamic-features-fragment/api/public_plus_experimental_current.txt
+++ b/navigation/navigation-dynamic-features-fragment/api/public_plus_experimental_current.txt
@@ -23,9 +23,9 @@
}
public final class DynamicFragmentNavigatorDestinationBuilderKt {
- method public static inline <reified F extends androidx.fragment.app.Fragment> void fragment(androidx.navigation.dynamicfeatures.DynamicNavGraphBuilder, @IdRes int id);
- method public static inline <reified F extends androidx.fragment.app.Fragment> void fragment(androidx.navigation.dynamicfeatures.DynamicNavGraphBuilder, @IdRes int id, kotlin.jvm.functions.Function1<? super androidx.navigation.dynamicfeatures.fragment.DynamicFragmentNavigatorDestinationBuilder,kotlin.Unit> builder);
method public static inline void fragment(androidx.navigation.dynamicfeatures.DynamicNavGraphBuilder, @IdRes int id, String fragmentClassName, kotlin.jvm.functions.Function1<? super androidx.navigation.dynamicfeatures.fragment.DynamicFragmentNavigatorDestinationBuilder,kotlin.Unit> builder);
+ method public static inline <reified F> void fragment(androidx.navigation.dynamicfeatures.DynamicNavGraphBuilder, @IdRes int id);
+ method public static inline <reified F> void fragment(androidx.navigation.dynamicfeatures.DynamicNavGraphBuilder, @IdRes int id, kotlin.jvm.functions.Function1<? super androidx.navigation.dynamicfeatures.fragment.DynamicFragmentNavigatorDestinationBuilder,? extends kotlin.Unit> builder);
}
public class DynamicNavHostFragment extends androidx.navigation.fragment.NavHostFragment {
diff --git a/navigation/navigation-dynamic-features-fragment/api/restricted_2.3.0-alpha07.txt b/navigation/navigation-dynamic-features-fragment/api/restricted_2.3.0-alpha07.txt
index 9d22e3d..0034957 100644
--- a/navigation/navigation-dynamic-features-fragment/api/restricted_2.3.0-alpha07.txt
+++ b/navigation/navigation-dynamic-features-fragment/api/restricted_2.3.0-alpha07.txt
@@ -23,9 +23,9 @@
}
public final class DynamicFragmentNavigatorDestinationBuilderKt {
- method public static inline <reified F extends androidx.fragment.app.Fragment> void fragment(androidx.navigation.dynamicfeatures.DynamicNavGraphBuilder, @IdRes int id);
- method public static inline <reified F extends androidx.fragment.app.Fragment> void fragment(androidx.navigation.dynamicfeatures.DynamicNavGraphBuilder, @IdRes int id, kotlin.jvm.functions.Function1<? super androidx.navigation.dynamicfeatures.fragment.DynamicFragmentNavigatorDestinationBuilder,kotlin.Unit> builder);
method public static inline void fragment(androidx.navigation.dynamicfeatures.DynamicNavGraphBuilder, @IdRes int id, String fragmentClassName, kotlin.jvm.functions.Function1<? super androidx.navigation.dynamicfeatures.fragment.DynamicFragmentNavigatorDestinationBuilder,kotlin.Unit> builder);
+ method public static inline <reified F> void fragment(androidx.navigation.dynamicfeatures.DynamicNavGraphBuilder, @IdRes int id);
+ method public static inline <reified F> void fragment(androidx.navigation.dynamicfeatures.DynamicNavGraphBuilder, @IdRes int id, kotlin.jvm.functions.Function1<? super androidx.navigation.dynamicfeatures.fragment.DynamicFragmentNavigatorDestinationBuilder,? extends kotlin.Unit> builder);
}
public class DynamicNavHostFragment extends androidx.navigation.fragment.NavHostFragment {
diff --git a/navigation/navigation-dynamic-features-fragment/api/restricted_current.txt b/navigation/navigation-dynamic-features-fragment/api/restricted_current.txt
index 9d22e3d..0034957 100644
--- a/navigation/navigation-dynamic-features-fragment/api/restricted_current.txt
+++ b/navigation/navigation-dynamic-features-fragment/api/restricted_current.txt
@@ -23,9 +23,9 @@
}
public final class DynamicFragmentNavigatorDestinationBuilderKt {
- method public static inline <reified F extends androidx.fragment.app.Fragment> void fragment(androidx.navigation.dynamicfeatures.DynamicNavGraphBuilder, @IdRes int id);
- method public static inline <reified F extends androidx.fragment.app.Fragment> void fragment(androidx.navigation.dynamicfeatures.DynamicNavGraphBuilder, @IdRes int id, kotlin.jvm.functions.Function1<? super androidx.navigation.dynamicfeatures.fragment.DynamicFragmentNavigatorDestinationBuilder,kotlin.Unit> builder);
method public static inline void fragment(androidx.navigation.dynamicfeatures.DynamicNavGraphBuilder, @IdRes int id, String fragmentClassName, kotlin.jvm.functions.Function1<? super androidx.navigation.dynamicfeatures.fragment.DynamicFragmentNavigatorDestinationBuilder,kotlin.Unit> builder);
+ method public static inline <reified F> void fragment(androidx.navigation.dynamicfeatures.DynamicNavGraphBuilder, @IdRes int id);
+ method public static inline <reified F> void fragment(androidx.navigation.dynamicfeatures.DynamicNavGraphBuilder, @IdRes int id, kotlin.jvm.functions.Function1<? super androidx.navigation.dynamicfeatures.fragment.DynamicFragmentNavigatorDestinationBuilder,? extends kotlin.Unit> builder);
}
public class DynamicNavHostFragment extends androidx.navigation.fragment.NavHostFragment {
diff --git a/navigation/navigation-fragment-ktx/api/2.3.0-alpha07.ignore b/navigation/navigation-fragment-ktx/api/2.3.0-alpha07.ignore
new file mode 100644
index 0000000..41c0d71
--- /dev/null
+++ b/navigation/navigation-fragment-ktx/api/2.3.0-alpha07.ignore
@@ -0,0 +1,9 @@
+// Baseline format: 1.0
+ChangedType: androidx.navigation.NavGraphViewModelLazyKt#navGraphViewModels(androidx.fragment.app.Fragment, int, kotlin.jvm.functions.Function0<? extends androidx.lifecycle.ViewModelProvider.Factory>):
+ Method androidx.navigation.NavGraphViewModelLazyKt.navGraphViewModels has changed return type from kotlin.Lazy<VM> to kotlin.Lazy<? extends VM>
+
+
+InvalidNullConversion: androidx.navigation.NavGraphViewModelLazyKt#navGraphViewModels(androidx.fragment.app.Fragment, int, kotlin.jvm.functions.Function0<? extends androidx.lifecycle.ViewModelProvider.Factory>):
+ Attempted to remove @NonNull annotation from method androidx.navigation.NavGraphViewModelLazyKt.navGraphViewModels(androidx.fragment.app.Fragment,int,kotlin.jvm.functions.Function0<? extends androidx.lifecycle.ViewModelProvider.Factory>)
+InvalidNullConversion: androidx.navigation.fragment.FragmentNavArgsLazyKt#navArgs(androidx.fragment.app.Fragment):
+ Attempted to remove @NonNull annotation from method androidx.navigation.fragment.FragmentNavArgsLazyKt.navArgs(androidx.fragment.app.Fragment)
diff --git a/navigation/navigation-fragment-ktx/api/2.3.0-alpha07.txt b/navigation/navigation-fragment-ktx/api/2.3.0-alpha07.txt
index a09cb97..9e92831 100644
--- a/navigation/navigation-fragment-ktx/api/2.3.0-alpha07.txt
+++ b/navigation/navigation-fragment-ktx/api/2.3.0-alpha07.txt
@@ -2,7 +2,7 @@
package androidx.navigation {
public final class NavGraphViewModelLazyKt {
- method @MainThread public static inline <reified VM extends androidx.lifecycle.ViewModel> kotlin.Lazy<VM> navGraphViewModels(androidx.fragment.app.Fragment, @IdRes int navGraphId, kotlin.jvm.functions.Function0<? extends androidx.lifecycle.ViewModelProvider.Factory>? factoryProducer = null);
+ method @MainThread public static inline <reified VM> kotlin.Lazy<? extends VM>! navGraphViewModels(androidx.fragment.app.Fragment, @IdRes int navGraphId, kotlin.jvm.functions.Function0<? extends androidx.lifecycle.ViewModelProvider.Factory>? factoryProducer = null);
}
}
@@ -15,8 +15,8 @@
}
public final class DialogFragmentNavigatorDestinationBuilderKt {
- method public static inline <reified F extends androidx.fragment.app.DialogFragment> void dialog(androidx.navigation.NavGraphBuilder, @IdRes int id);
- method public static inline <reified F extends androidx.fragment.app.DialogFragment> void dialog(androidx.navigation.NavGraphBuilder, @IdRes int id, kotlin.jvm.functions.Function1<? super androidx.navigation.fragment.DialogFragmentNavigatorDestinationBuilder,kotlin.Unit> builder);
+ method public static inline <reified F> void dialog(androidx.navigation.NavGraphBuilder, @IdRes int id);
+ method public static inline <reified F> void dialog(androidx.navigation.NavGraphBuilder, @IdRes int id, kotlin.jvm.functions.Function1<? super androidx.navigation.fragment.DialogFragmentNavigatorDestinationBuilder,? extends kotlin.Unit> builder);
}
public final class FragmentKt {
@@ -24,7 +24,7 @@
}
public final class FragmentNavArgsLazyKt {
- method @MainThread public static inline <reified Args extends androidx.navigation.NavArgs> androidx.navigation.NavArgsLazy<Args> navArgs(androidx.fragment.app.Fragment);
+ method @MainThread public static inline <reified Args> androidx.navigation.NavArgsLazy<Args>! navArgs(androidx.fragment.app.Fragment);
}
public final class FragmentNavigatorDestinationBuilder extends androidx.navigation.NavDestinationBuilder<androidx.navigation.fragment.FragmentNavigator.Destination> {
@@ -33,8 +33,8 @@
}
public final class 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);
+ method public static inline <reified F> void fragment(androidx.navigation.NavGraphBuilder, @IdRes int id);
+ method public static inline <reified F> void fragment(androidx.navigation.NavGraphBuilder, @IdRes int id, kotlin.jvm.functions.Function1<? super androidx.navigation.fragment.FragmentNavigatorDestinationBuilder,? extends kotlin.Unit> builder);
}
public final class FragmentNavigatorExtrasKt {
diff --git a/navigation/navigation-fragment-ktx/api/api_lint.ignore b/navigation/navigation-fragment-ktx/api/api_lint.ignore
index 05fb76a..f0a1f88 100644
--- a/navigation/navigation-fragment-ktx/api/api_lint.ignore
+++ b/navigation/navigation-fragment-ktx/api/api_lint.ignore
@@ -1,3 +1,9 @@
// Baseline format: 1.0
DocumentExceptions: androidx.navigation.fragment.FragmentNavArgsLazyKt#navArgs(androidx.fragment.app.Fragment):
Method FragmentNavArgsLazyKt.navArgs appears to be throwing java.lang.IllegalStateException; this should be listed in the documentation; see https://android.github.io/kotlin-guides/interop.html#document-exceptions
+
+
+MissingNullability: androidx.navigation.NavGraphViewModelLazyKt#navGraphViewModels(androidx.fragment.app.Fragment, int, kotlin.jvm.functions.Function0<? extends androidx.lifecycle.ViewModelProvider.Factory>):
+ Missing nullability on method `navGraphViewModels` return
+MissingNullability: androidx.navigation.fragment.FragmentNavArgsLazyKt#navArgs(androidx.fragment.app.Fragment):
+ Missing nullability on method `navArgs` return
diff --git a/navigation/navigation-fragment-ktx/api/current.txt b/navigation/navigation-fragment-ktx/api/current.txt
index a09cb97..9e92831 100644
--- a/navigation/navigation-fragment-ktx/api/current.txt
+++ b/navigation/navigation-fragment-ktx/api/current.txt
@@ -2,7 +2,7 @@
package androidx.navigation {
public final class NavGraphViewModelLazyKt {
- method @MainThread public static inline <reified VM extends androidx.lifecycle.ViewModel> kotlin.Lazy<VM> navGraphViewModels(androidx.fragment.app.Fragment, @IdRes int navGraphId, kotlin.jvm.functions.Function0<? extends androidx.lifecycle.ViewModelProvider.Factory>? factoryProducer = null);
+ method @MainThread public static inline <reified VM> kotlin.Lazy<? extends VM>! navGraphViewModels(androidx.fragment.app.Fragment, @IdRes int navGraphId, kotlin.jvm.functions.Function0<? extends androidx.lifecycle.ViewModelProvider.Factory>? factoryProducer = null);
}
}
@@ -15,8 +15,8 @@
}
public final class DialogFragmentNavigatorDestinationBuilderKt {
- method public static inline <reified F extends androidx.fragment.app.DialogFragment> void dialog(androidx.navigation.NavGraphBuilder, @IdRes int id);
- method public static inline <reified F extends androidx.fragment.app.DialogFragment> void dialog(androidx.navigation.NavGraphBuilder, @IdRes int id, kotlin.jvm.functions.Function1<? super androidx.navigation.fragment.DialogFragmentNavigatorDestinationBuilder,kotlin.Unit> builder);
+ method public static inline <reified F> void dialog(androidx.navigation.NavGraphBuilder, @IdRes int id);
+ method public static inline <reified F> void dialog(androidx.navigation.NavGraphBuilder, @IdRes int id, kotlin.jvm.functions.Function1<? super androidx.navigation.fragment.DialogFragmentNavigatorDestinationBuilder,? extends kotlin.Unit> builder);
}
public final class FragmentKt {
@@ -24,7 +24,7 @@
}
public final class FragmentNavArgsLazyKt {
- method @MainThread public static inline <reified Args extends androidx.navigation.NavArgs> androidx.navigation.NavArgsLazy<Args> navArgs(androidx.fragment.app.Fragment);
+ method @MainThread public static inline <reified Args> androidx.navigation.NavArgsLazy<Args>! navArgs(androidx.fragment.app.Fragment);
}
public final class FragmentNavigatorDestinationBuilder extends androidx.navigation.NavDestinationBuilder<androidx.navigation.fragment.FragmentNavigator.Destination> {
@@ -33,8 +33,8 @@
}
public final class 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);
+ method public static inline <reified F> void fragment(androidx.navigation.NavGraphBuilder, @IdRes int id);
+ method public static inline <reified F> void fragment(androidx.navigation.NavGraphBuilder, @IdRes int id, kotlin.jvm.functions.Function1<? super androidx.navigation.fragment.FragmentNavigatorDestinationBuilder,? extends kotlin.Unit> builder);
}
public final class FragmentNavigatorExtrasKt {
diff --git a/navigation/navigation-fragment-ktx/api/public_plus_experimental_2.3.0-alpha07.txt b/navigation/navigation-fragment-ktx/api/public_plus_experimental_2.3.0-alpha07.txt
index a09cb97..9e92831 100644
--- a/navigation/navigation-fragment-ktx/api/public_plus_experimental_2.3.0-alpha07.txt
+++ b/navigation/navigation-fragment-ktx/api/public_plus_experimental_2.3.0-alpha07.txt
@@ -2,7 +2,7 @@
package androidx.navigation {
public final class NavGraphViewModelLazyKt {
- method @MainThread public static inline <reified VM extends androidx.lifecycle.ViewModel> kotlin.Lazy<VM> navGraphViewModels(androidx.fragment.app.Fragment, @IdRes int navGraphId, kotlin.jvm.functions.Function0<? extends androidx.lifecycle.ViewModelProvider.Factory>? factoryProducer = null);
+ method @MainThread public static inline <reified VM> kotlin.Lazy<? extends VM>! navGraphViewModels(androidx.fragment.app.Fragment, @IdRes int navGraphId, kotlin.jvm.functions.Function0<? extends androidx.lifecycle.ViewModelProvider.Factory>? factoryProducer = null);
}
}
@@ -15,8 +15,8 @@
}
public final class DialogFragmentNavigatorDestinationBuilderKt {
- method public static inline <reified F extends androidx.fragment.app.DialogFragment> void dialog(androidx.navigation.NavGraphBuilder, @IdRes int id);
- method public static inline <reified F extends androidx.fragment.app.DialogFragment> void dialog(androidx.navigation.NavGraphBuilder, @IdRes int id, kotlin.jvm.functions.Function1<? super androidx.navigation.fragment.DialogFragmentNavigatorDestinationBuilder,kotlin.Unit> builder);
+ method public static inline <reified F> void dialog(androidx.navigation.NavGraphBuilder, @IdRes int id);
+ method public static inline <reified F> void dialog(androidx.navigation.NavGraphBuilder, @IdRes int id, kotlin.jvm.functions.Function1<? super androidx.navigation.fragment.DialogFragmentNavigatorDestinationBuilder,? extends kotlin.Unit> builder);
}
public final class FragmentKt {
@@ -24,7 +24,7 @@
}
public final class FragmentNavArgsLazyKt {
- method @MainThread public static inline <reified Args extends androidx.navigation.NavArgs> androidx.navigation.NavArgsLazy<Args> navArgs(androidx.fragment.app.Fragment);
+ method @MainThread public static inline <reified Args> androidx.navigation.NavArgsLazy<Args>! navArgs(androidx.fragment.app.Fragment);
}
public final class FragmentNavigatorDestinationBuilder extends androidx.navigation.NavDestinationBuilder<androidx.navigation.fragment.FragmentNavigator.Destination> {
@@ -33,8 +33,8 @@
}
public final class 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);
+ method public static inline <reified F> void fragment(androidx.navigation.NavGraphBuilder, @IdRes int id);
+ method public static inline <reified F> void fragment(androidx.navigation.NavGraphBuilder, @IdRes int id, kotlin.jvm.functions.Function1<? super androidx.navigation.fragment.FragmentNavigatorDestinationBuilder,? extends kotlin.Unit> builder);
}
public final class FragmentNavigatorExtrasKt {
diff --git a/navigation/navigation-fragment-ktx/api/public_plus_experimental_current.txt b/navigation/navigation-fragment-ktx/api/public_plus_experimental_current.txt
index a09cb97..9e92831 100644
--- a/navigation/navigation-fragment-ktx/api/public_plus_experimental_current.txt
+++ b/navigation/navigation-fragment-ktx/api/public_plus_experimental_current.txt
@@ -2,7 +2,7 @@
package androidx.navigation {
public final class NavGraphViewModelLazyKt {
- method @MainThread public static inline <reified VM extends androidx.lifecycle.ViewModel> kotlin.Lazy<VM> navGraphViewModels(androidx.fragment.app.Fragment, @IdRes int navGraphId, kotlin.jvm.functions.Function0<? extends androidx.lifecycle.ViewModelProvider.Factory>? factoryProducer = null);
+ method @MainThread public static inline <reified VM> kotlin.Lazy<? extends VM>! navGraphViewModels(androidx.fragment.app.Fragment, @IdRes int navGraphId, kotlin.jvm.functions.Function0<? extends androidx.lifecycle.ViewModelProvider.Factory>? factoryProducer = null);
}
}
@@ -15,8 +15,8 @@
}
public final class DialogFragmentNavigatorDestinationBuilderKt {
- method public static inline <reified F extends androidx.fragment.app.DialogFragment> void dialog(androidx.navigation.NavGraphBuilder, @IdRes int id);
- method public static inline <reified F extends androidx.fragment.app.DialogFragment> void dialog(androidx.navigation.NavGraphBuilder, @IdRes int id, kotlin.jvm.functions.Function1<? super androidx.navigation.fragment.DialogFragmentNavigatorDestinationBuilder,kotlin.Unit> builder);
+ method public static inline <reified F> void dialog(androidx.navigation.NavGraphBuilder, @IdRes int id);
+ method public static inline <reified F> void dialog(androidx.navigation.NavGraphBuilder, @IdRes int id, kotlin.jvm.functions.Function1<? super androidx.navigation.fragment.DialogFragmentNavigatorDestinationBuilder,? extends kotlin.Unit> builder);
}
public final class FragmentKt {
@@ -24,7 +24,7 @@
}
public final class FragmentNavArgsLazyKt {
- method @MainThread public static inline <reified Args extends androidx.navigation.NavArgs> androidx.navigation.NavArgsLazy<Args> navArgs(androidx.fragment.app.Fragment);
+ method @MainThread public static inline <reified Args> androidx.navigation.NavArgsLazy<Args>! navArgs(androidx.fragment.app.Fragment);
}
public final class FragmentNavigatorDestinationBuilder extends androidx.navigation.NavDestinationBuilder<androidx.navigation.fragment.FragmentNavigator.Destination> {
@@ -33,8 +33,8 @@
}
public final class 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);
+ method public static inline <reified F> void fragment(androidx.navigation.NavGraphBuilder, @IdRes int id);
+ method public static inline <reified F> void fragment(androidx.navigation.NavGraphBuilder, @IdRes int id, kotlin.jvm.functions.Function1<? super androidx.navigation.fragment.FragmentNavigatorDestinationBuilder,? extends kotlin.Unit> builder);
}
public final class FragmentNavigatorExtrasKt {
diff --git a/navigation/navigation-fragment-ktx/api/restricted_2.3.0-alpha07.ignore b/navigation/navigation-fragment-ktx/api/restricted_2.3.0-alpha07.ignore
new file mode 100644
index 0000000..41c0d71
--- /dev/null
+++ b/navigation/navigation-fragment-ktx/api/restricted_2.3.0-alpha07.ignore
@@ -0,0 +1,9 @@
+// Baseline format: 1.0
+ChangedType: androidx.navigation.NavGraphViewModelLazyKt#navGraphViewModels(androidx.fragment.app.Fragment, int, kotlin.jvm.functions.Function0<? extends androidx.lifecycle.ViewModelProvider.Factory>):
+ Method androidx.navigation.NavGraphViewModelLazyKt.navGraphViewModels has changed return type from kotlin.Lazy<VM> to kotlin.Lazy<? extends VM>
+
+
+InvalidNullConversion: androidx.navigation.NavGraphViewModelLazyKt#navGraphViewModels(androidx.fragment.app.Fragment, int, kotlin.jvm.functions.Function0<? extends androidx.lifecycle.ViewModelProvider.Factory>):
+ Attempted to remove @NonNull annotation from method androidx.navigation.NavGraphViewModelLazyKt.navGraphViewModels(androidx.fragment.app.Fragment,int,kotlin.jvm.functions.Function0<? extends androidx.lifecycle.ViewModelProvider.Factory>)
+InvalidNullConversion: androidx.navigation.fragment.FragmentNavArgsLazyKt#navArgs(androidx.fragment.app.Fragment):
+ Attempted to remove @NonNull annotation from method androidx.navigation.fragment.FragmentNavArgsLazyKt.navArgs(androidx.fragment.app.Fragment)
diff --git a/navigation/navigation-fragment-ktx/api/restricted_2.3.0-alpha07.txt b/navigation/navigation-fragment-ktx/api/restricted_2.3.0-alpha07.txt
index a09cb97..9e92831 100644
--- a/navigation/navigation-fragment-ktx/api/restricted_2.3.0-alpha07.txt
+++ b/navigation/navigation-fragment-ktx/api/restricted_2.3.0-alpha07.txt
@@ -2,7 +2,7 @@
package androidx.navigation {
public final class NavGraphViewModelLazyKt {
- method @MainThread public static inline <reified VM extends androidx.lifecycle.ViewModel> kotlin.Lazy<VM> navGraphViewModels(androidx.fragment.app.Fragment, @IdRes int navGraphId, kotlin.jvm.functions.Function0<? extends androidx.lifecycle.ViewModelProvider.Factory>? factoryProducer = null);
+ method @MainThread public static inline <reified VM> kotlin.Lazy<? extends VM>! navGraphViewModels(androidx.fragment.app.Fragment, @IdRes int navGraphId, kotlin.jvm.functions.Function0<? extends androidx.lifecycle.ViewModelProvider.Factory>? factoryProducer = null);
}
}
@@ -15,8 +15,8 @@
}
public final class DialogFragmentNavigatorDestinationBuilderKt {
- method public static inline <reified F extends androidx.fragment.app.DialogFragment> void dialog(androidx.navigation.NavGraphBuilder, @IdRes int id);
- method public static inline <reified F extends androidx.fragment.app.DialogFragment> void dialog(androidx.navigation.NavGraphBuilder, @IdRes int id, kotlin.jvm.functions.Function1<? super androidx.navigation.fragment.DialogFragmentNavigatorDestinationBuilder,kotlin.Unit> builder);
+ method public static inline <reified F> void dialog(androidx.navigation.NavGraphBuilder, @IdRes int id);
+ method public static inline <reified F> void dialog(androidx.navigation.NavGraphBuilder, @IdRes int id, kotlin.jvm.functions.Function1<? super androidx.navigation.fragment.DialogFragmentNavigatorDestinationBuilder,? extends kotlin.Unit> builder);
}
public final class FragmentKt {
@@ -24,7 +24,7 @@
}
public final class FragmentNavArgsLazyKt {
- method @MainThread public static inline <reified Args extends androidx.navigation.NavArgs> androidx.navigation.NavArgsLazy<Args> navArgs(androidx.fragment.app.Fragment);
+ method @MainThread public static inline <reified Args> androidx.navigation.NavArgsLazy<Args>! navArgs(androidx.fragment.app.Fragment);
}
public final class FragmentNavigatorDestinationBuilder extends androidx.navigation.NavDestinationBuilder<androidx.navigation.fragment.FragmentNavigator.Destination> {
@@ -33,8 +33,8 @@
}
public final class 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);
+ method public static inline <reified F> void fragment(androidx.navigation.NavGraphBuilder, @IdRes int id);
+ method public static inline <reified F> void fragment(androidx.navigation.NavGraphBuilder, @IdRes int id, kotlin.jvm.functions.Function1<? super androidx.navigation.fragment.FragmentNavigatorDestinationBuilder,? extends kotlin.Unit> builder);
}
public final class FragmentNavigatorExtrasKt {
diff --git a/navigation/navigation-fragment-ktx/api/restricted_current.txt b/navigation/navigation-fragment-ktx/api/restricted_current.txt
index a09cb97..9e92831 100644
--- a/navigation/navigation-fragment-ktx/api/restricted_current.txt
+++ b/navigation/navigation-fragment-ktx/api/restricted_current.txt
@@ -2,7 +2,7 @@
package androidx.navigation {
public final class NavGraphViewModelLazyKt {
- method @MainThread public static inline <reified VM extends androidx.lifecycle.ViewModel> kotlin.Lazy<VM> navGraphViewModels(androidx.fragment.app.Fragment, @IdRes int navGraphId, kotlin.jvm.functions.Function0<? extends androidx.lifecycle.ViewModelProvider.Factory>? factoryProducer = null);
+ method @MainThread public static inline <reified VM> kotlin.Lazy<? extends VM>! navGraphViewModels(androidx.fragment.app.Fragment, @IdRes int navGraphId, kotlin.jvm.functions.Function0<? extends androidx.lifecycle.ViewModelProvider.Factory>? factoryProducer = null);
}
}
@@ -15,8 +15,8 @@
}
public final class DialogFragmentNavigatorDestinationBuilderKt {
- method public static inline <reified F extends androidx.fragment.app.DialogFragment> void dialog(androidx.navigation.NavGraphBuilder, @IdRes int id);
- method public static inline <reified F extends androidx.fragment.app.DialogFragment> void dialog(androidx.navigation.NavGraphBuilder, @IdRes int id, kotlin.jvm.functions.Function1<? super androidx.navigation.fragment.DialogFragmentNavigatorDestinationBuilder,kotlin.Unit> builder);
+ method public static inline <reified F> void dialog(androidx.navigation.NavGraphBuilder, @IdRes int id);
+ method public static inline <reified F> void dialog(androidx.navigation.NavGraphBuilder, @IdRes int id, kotlin.jvm.functions.Function1<? super androidx.navigation.fragment.DialogFragmentNavigatorDestinationBuilder,? extends kotlin.Unit> builder);
}
public final class FragmentKt {
@@ -24,7 +24,7 @@
}
public final class FragmentNavArgsLazyKt {
- method @MainThread public static inline <reified Args extends androidx.navigation.NavArgs> androidx.navigation.NavArgsLazy<Args> navArgs(androidx.fragment.app.Fragment);
+ method @MainThread public static inline <reified Args> androidx.navigation.NavArgsLazy<Args>! navArgs(androidx.fragment.app.Fragment);
}
public final class FragmentNavigatorDestinationBuilder extends androidx.navigation.NavDestinationBuilder<androidx.navigation.fragment.FragmentNavigator.Destination> {
@@ -33,8 +33,8 @@
}
public final class 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);
+ method public static inline <reified F> void fragment(androidx.navigation.NavGraphBuilder, @IdRes int id);
+ method public static inline <reified F> void fragment(androidx.navigation.NavGraphBuilder, @IdRes int id, kotlin.jvm.functions.Function1<? super androidx.navigation.fragment.FragmentNavigatorDestinationBuilder,? extends kotlin.Unit> builder);
}
public final class FragmentNavigatorExtrasKt {
diff --git a/navigation/navigation-runtime-ktx/api/2.3.0-alpha07.ignore b/navigation/navigation-runtime-ktx/api/2.3.0-alpha07.ignore
new file mode 100644
index 0000000..1337f0e
--- /dev/null
+++ b/navigation/navigation-runtime-ktx/api/2.3.0-alpha07.ignore
@@ -0,0 +1,3 @@
+// Baseline format: 1.0
+InvalidNullConversion: androidx.navigation.ActivityNavArgsLazyKt#navArgs(android.app.Activity):
+ Attempted to remove @NonNull annotation from method androidx.navigation.ActivityNavArgsLazyKt.navArgs(android.app.Activity)
diff --git a/navigation/navigation-runtime-ktx/api/2.3.0-alpha07.txt b/navigation/navigation-runtime-ktx/api/2.3.0-alpha07.txt
index 09505f5..bedf2f5 100644
--- a/navigation/navigation-runtime-ktx/api/2.3.0-alpha07.txt
+++ b/navigation/navigation-runtime-ktx/api/2.3.0-alpha07.txt
@@ -6,7 +6,7 @@
}
public final class ActivityNavArgsLazyKt {
- method @MainThread public static inline <reified Args extends androidx.navigation.NavArgs> androidx.navigation.NavArgsLazy<Args> navArgs(android.app.Activity);
+ method @MainThread public static inline <reified Args> androidx.navigation.NavArgsLazy<Args>! navArgs(android.app.Activity);
}
public final class ActivityNavigatorDestinationBuilder extends androidx.navigation.NavDestinationBuilder<androidx.navigation.ActivityNavigator.Destination> {
diff --git a/navigation/navigation-runtime-ktx/api/api_lint.ignore b/navigation/navigation-runtime-ktx/api/api_lint.ignore
new file mode 100644
index 0000000..5cc9b6e
--- /dev/null
+++ b/navigation/navigation-runtime-ktx/api/api_lint.ignore
@@ -0,0 +1,3 @@
+// Baseline format: 1.0
+MissingNullability: androidx.navigation.ActivityNavArgsLazyKt#navArgs(android.app.Activity):
+ Missing nullability on method `navArgs` return
diff --git a/navigation/navigation-runtime-ktx/api/current.txt b/navigation/navigation-runtime-ktx/api/current.txt
index 09505f5..bedf2f5 100644
--- a/navigation/navigation-runtime-ktx/api/current.txt
+++ b/navigation/navigation-runtime-ktx/api/current.txt
@@ -6,7 +6,7 @@
}
public final class ActivityNavArgsLazyKt {
- method @MainThread public static inline <reified Args extends androidx.navigation.NavArgs> androidx.navigation.NavArgsLazy<Args> navArgs(android.app.Activity);
+ method @MainThread public static inline <reified Args> androidx.navigation.NavArgsLazy<Args>! navArgs(android.app.Activity);
}
public final class ActivityNavigatorDestinationBuilder extends androidx.navigation.NavDestinationBuilder<androidx.navigation.ActivityNavigator.Destination> {
diff --git a/navigation/navigation-runtime-ktx/api/public_plus_experimental_2.3.0-alpha07.txt b/navigation/navigation-runtime-ktx/api/public_plus_experimental_2.3.0-alpha07.txt
index 09505f5..bedf2f5 100644
--- a/navigation/navigation-runtime-ktx/api/public_plus_experimental_2.3.0-alpha07.txt
+++ b/navigation/navigation-runtime-ktx/api/public_plus_experimental_2.3.0-alpha07.txt
@@ -6,7 +6,7 @@
}
public final class ActivityNavArgsLazyKt {
- method @MainThread public static inline <reified Args extends androidx.navigation.NavArgs> androidx.navigation.NavArgsLazy<Args> navArgs(android.app.Activity);
+ method @MainThread public static inline <reified Args> androidx.navigation.NavArgsLazy<Args>! navArgs(android.app.Activity);
}
public final class ActivityNavigatorDestinationBuilder extends androidx.navigation.NavDestinationBuilder<androidx.navigation.ActivityNavigator.Destination> {
diff --git a/navigation/navigation-runtime-ktx/api/public_plus_experimental_current.txt b/navigation/navigation-runtime-ktx/api/public_plus_experimental_current.txt
index 09505f5..bedf2f5 100644
--- a/navigation/navigation-runtime-ktx/api/public_plus_experimental_current.txt
+++ b/navigation/navigation-runtime-ktx/api/public_plus_experimental_current.txt
@@ -6,7 +6,7 @@
}
public final class ActivityNavArgsLazyKt {
- method @MainThread public static inline <reified Args extends androidx.navigation.NavArgs> androidx.navigation.NavArgsLazy<Args> navArgs(android.app.Activity);
+ method @MainThread public static inline <reified Args> androidx.navigation.NavArgsLazy<Args>! navArgs(android.app.Activity);
}
public final class ActivityNavigatorDestinationBuilder extends androidx.navigation.NavDestinationBuilder<androidx.navigation.ActivityNavigator.Destination> {
diff --git a/navigation/navigation-runtime-ktx/api/restricted_2.3.0-alpha07.ignore b/navigation/navigation-runtime-ktx/api/restricted_2.3.0-alpha07.ignore
new file mode 100644
index 0000000..1337f0e
--- /dev/null
+++ b/navigation/navigation-runtime-ktx/api/restricted_2.3.0-alpha07.ignore
@@ -0,0 +1,3 @@
+// Baseline format: 1.0
+InvalidNullConversion: androidx.navigation.ActivityNavArgsLazyKt#navArgs(android.app.Activity):
+ Attempted to remove @NonNull annotation from method androidx.navigation.ActivityNavArgsLazyKt.navArgs(android.app.Activity)
diff --git a/navigation/navigation-runtime-ktx/api/restricted_2.3.0-alpha07.txt b/navigation/navigation-runtime-ktx/api/restricted_2.3.0-alpha07.txt
index 09505f5..bedf2f5 100644
--- a/navigation/navigation-runtime-ktx/api/restricted_2.3.0-alpha07.txt
+++ b/navigation/navigation-runtime-ktx/api/restricted_2.3.0-alpha07.txt
@@ -6,7 +6,7 @@
}
public final class ActivityNavArgsLazyKt {
- method @MainThread public static inline <reified Args extends androidx.navigation.NavArgs> androidx.navigation.NavArgsLazy<Args> navArgs(android.app.Activity);
+ method @MainThread public static inline <reified Args> androidx.navigation.NavArgsLazy<Args>! navArgs(android.app.Activity);
}
public final class ActivityNavigatorDestinationBuilder extends androidx.navigation.NavDestinationBuilder<androidx.navigation.ActivityNavigator.Destination> {
diff --git a/navigation/navigation-runtime-ktx/api/restricted_current.txt b/navigation/navigation-runtime-ktx/api/restricted_current.txt
index 09505f5..bedf2f5 100644
--- a/navigation/navigation-runtime-ktx/api/restricted_current.txt
+++ b/navigation/navigation-runtime-ktx/api/restricted_current.txt
@@ -6,7 +6,7 @@
}
public final class ActivityNavArgsLazyKt {
- method @MainThread public static inline <reified Args extends androidx.navigation.NavArgs> androidx.navigation.NavArgsLazy<Args> navArgs(android.app.Activity);
+ method @MainThread public static inline <reified Args> androidx.navigation.NavArgsLazy<Args>! navArgs(android.app.Activity);
}
public final class ActivityNavigatorDestinationBuilder extends androidx.navigation.NavDestinationBuilder<androidx.navigation.ActivityNavigator.Destination> {
diff --git a/navigation/navigation-safe-args-generator/src/main/kotlin/androidx/navigation/safe/args/generator/NavParser.kt b/navigation/navigation-safe-args-generator/src/main/kotlin/androidx/navigation/safe/args/generator/NavParser.kt
index 30be3b6..d658429 100644
--- a/navigation/navigation-safe-args-generator/src/main/kotlin/androidx/navigation/safe/args/generator/NavParser.kt
+++ b/navigation/navigation-safe-args-generator/src/main/kotlin/androidx/navigation/safe/args/generator/NavParser.kt
@@ -161,6 +161,7 @@
val defaultTypedValue = when (type) {
IntType -> parseIntValue(defaultValue)
LongType -> parseLongValue(defaultValue)
+ DoubleType -> parseDoubleValue(defaultValue)
FloatType -> parseFloatValue(defaultValue)
BoolType -> parseBoolean(defaultValue)
ReferenceType -> {
@@ -183,7 +184,7 @@
StringValue(defaultValue)
}
}
- IntArrayType, LongArrayType, FloatArrayType, StringArrayType,
+ IntArrayType, LongArrayType, DoubleArrayType, FloatArrayType, StringArrayType,
BoolArrayType, ReferenceArrayType, is ObjectArrayType -> {
if (defaultValue == VALUE_NULL) {
NullValue
@@ -281,6 +282,10 @@
if (intValue != null) {
return Argument(name, IntType, intValue)
}
+ val doubleValue = parseDoubleValue(defaultValue)
+ if (doubleValue != null) {
+ return Argument(name, DoubleType, doubleValue)
+ }
val floatValue = parseFloatValue(defaultValue)
if (floatValue != null) {
return Argument(name, FloatType, floatValue)
@@ -341,6 +346,9 @@
private fun parseFloatValue(value: String): FloatValue? =
value.toFloatOrNull()?.let { FloatValue(value) }
+private fun parseDoubleValue(value: String): DoubleValue? =
+ value.toDoubleOrNull()?.let { DoubleValue(value) }
+
private fun parseBoolean(value: String): BooleanValue? {
if (value == VALUE_TRUE || value == VALUE_FALSE) {
return BooleanValue(value)
diff --git a/navigation/navigation-safe-args-generator/src/main/kotlin/androidx/navigation/safe/args/generator/Types.kt b/navigation/navigation-safe-args-generator/src/main/kotlin/androidx/navigation/safe/args/generator/Types.kt
index 679deea..1956910 100644
--- a/navigation/navigation-safe-args-generator/src/main/kotlin/androidx/navigation/safe/args/generator/Types.kt
+++ b/navigation/navigation-safe-args-generator/src/main/kotlin/androidx/navigation/safe/args/generator/Types.kt
@@ -31,6 +31,8 @@
"long[]" -> LongArrayType
"float" -> FloatType
"float[]" -> FloatArrayType
+ "double" -> DoubleType
+ "double[]" -> DoubleArrayType
"boolean" -> BoolType
"boolean[]" -> BoolArrayType
"reference" -> ReferenceType
@@ -96,6 +98,20 @@
override fun allowsNullable() = true
}
+object DoubleType : NavType {
+ override fun bundlePutMethod() = "putDouble"
+ override fun bundleGetMethod() = "getDouble"
+ override fun toString() = "double"
+ override fun allowsNullable() = false
+}
+
+object DoubleArrayType : NavType {
+ override fun bundlePutMethod() = "putDoubleArray"
+ override fun bundleGetMethod() = "getDoubleArray"
+ override fun toString() = "double[]"
+ override fun allowsNullable() = true
+}
+
object StringType : NavType {
override fun bundlePutMethod() = "putString"
override fun bundleGetMethod() = "getString"
@@ -171,6 +187,9 @@
// keeping value as String, it will help to preserve client format of it: scientific, dot
data class FloatValue(val value: String) : WritableValue
+// keeping value as String, it will help to preserve client format of it: scientific, dot
+data class DoubleValue(val value: String) : WritableValue
+
data class BooleanValue(val value: String) : WritableValue
object NullValue : WritableValue
diff --git a/navigation/navigation-safe-args-generator/src/main/kotlin/androidx/navigation/safe/args/generator/java/JavaNavWriter.kt b/navigation/navigation-safe-args-generator/src/main/kotlin/androidx/navigation/safe/args/generator/java/JavaNavWriter.kt
index 80ed320..c2bdd0f 100644
--- a/navigation/navigation-safe-args-generator/src/main/kotlin/androidx/navigation/safe/args/generator/java/JavaNavWriter.kt
+++ b/navigation/navigation-safe-args-generator/src/main/kotlin/androidx/navigation/safe/args/generator/java/JavaNavWriter.kt
@@ -18,6 +18,8 @@
import androidx.navigation.safe.args.generator.BoolArrayType
import androidx.navigation.safe.args.generator.BoolType
+import androidx.navigation.safe.args.generator.DoubleArrayType
+import androidx.navigation.safe.args.generator.DoubleType
import androidx.navigation.safe.args.generator.FloatArrayType
import androidx.navigation.safe.args.generator.FloatType
import androidx.navigation.safe.args.generator.IntArrayType
@@ -450,8 +452,10 @@
ReferenceType,
LongType -> "$getterName != that.$getterName"
FloatType -> "Float.compare(that.$getterName, $getterName) != 0"
- StringType, IntArrayType, LongArrayType, FloatArrayType, StringArrayType,
- BoolArrayType, ReferenceArrayType, is ObjectArrayType, is ObjectType ->
+ DoubleType -> "Double.compare(that.$getterName, $getterName) != 0"
+ StringType, IntArrayType, LongArrayType, FloatArrayType, DoubleArrayType,
+ StringArrayType, BoolArrayType, ReferenceArrayType, is ObjectArrayType,
+ is ObjectType ->
"$getterName != null ? !$getterName.equals(that.$getterName) " +
": that.$getterName != null"
else -> throw IllegalStateException("unknown type: $type")
@@ -482,7 +486,8 @@
val hashCodeExpression = when (type) {
IntType, ReferenceType -> getterName
FloatType -> "Float.floatToIntBits($getterName)"
- IntArrayType, LongArrayType, FloatArrayType, StringArrayType,
+ DoubleType -> "Long.valueOf(Double.doubleToLongBits($getterName)).hashCode()"
+ IntArrayType, LongArrayType, FloatArrayType, DoubleArrayType, StringArrayType,
BoolArrayType, ReferenceArrayType, is ObjectArrayType ->
"java.util.Arrays.hashCode($getterName)"
StringType, is ObjectType ->
diff --git a/navigation/navigation-safe-args-generator/src/main/kotlin/androidx/navigation/safe/args/generator/java/JavaTypes.kt b/navigation/navigation-safe-args-generator/src/main/kotlin/androidx/navigation/safe/args/generator/java/JavaTypes.kt
index b495c26..645848c 100644
--- a/navigation/navigation-safe-args-generator/src/main/kotlin/androidx/navigation/safe/args/generator/java/JavaTypes.kt
+++ b/navigation/navigation-safe-args-generator/src/main/kotlin/androidx/navigation/safe/args/generator/java/JavaTypes.kt
@@ -19,6 +19,9 @@
import androidx.navigation.safe.args.generator.BoolArrayType
import androidx.navigation.safe.args.generator.BoolType
import androidx.navigation.safe.args.generator.BooleanValue
+import androidx.navigation.safe.args.generator.DoubleArrayType
+import androidx.navigation.safe.args.generator.DoubleType
+import androidx.navigation.safe.args.generator.DoubleValue
import androidx.navigation.safe.args.generator.EnumValue
import androidx.navigation.safe.args.generator.FloatArrayType
import androidx.navigation.safe.args.generator.FloatType
@@ -202,6 +205,8 @@
LongArrayType -> ArrayTypeName.of(TypeName.LONG)
FloatType -> TypeName.FLOAT
FloatArrayType -> ArrayTypeName.of(TypeName.FLOAT)
+ DoubleType -> TypeName.DOUBLE
+ DoubleArrayType -> ArrayTypeName.of(TypeName.DOUBLE)
StringType -> ClassName.get(String::class.java)
StringArrayType -> ArrayTypeName.of(ClassName.get(String::class.java))
BoolType -> TypeName.BOOLEAN
@@ -225,6 +230,7 @@
is IntValue -> CodeBlock.of(value)
is LongValue -> CodeBlock.of(value)
is FloatValue -> CodeBlock.of("${value}F")
+ is DoubleValue -> CodeBlock.of(value)
is BooleanValue -> CodeBlock.of(value)
is NullValue -> CodeBlock.of("null")
is EnumValue -> CodeBlock.of("$T.$N", type.typeName(), value)
diff --git a/navigation/navigation-safe-args-generator/src/main/kotlin/androidx/navigation/safe/args/generator/kotlin/KotlinTypes.kt b/navigation/navigation-safe-args-generator/src/main/kotlin/androidx/navigation/safe/args/generator/kotlin/KotlinTypes.kt
index 4a1782a..f0eb8c2 100644
--- a/navigation/navigation-safe-args-generator/src/main/kotlin/androidx/navigation/safe/args/generator/kotlin/KotlinTypes.kt
+++ b/navigation/navigation-safe-args-generator/src/main/kotlin/androidx/navigation/safe/args/generator/kotlin/KotlinTypes.kt
@@ -19,6 +19,9 @@
import androidx.navigation.safe.args.generator.BoolArrayType
import androidx.navigation.safe.args.generator.BoolType
import androidx.navigation.safe.args.generator.BooleanValue
+import androidx.navigation.safe.args.generator.DoubleArrayType
+import androidx.navigation.safe.args.generator.DoubleType
+import androidx.navigation.safe.args.generator.DoubleValue
import androidx.navigation.safe.args.generator.EnumValue
import androidx.navigation.safe.args.generator.FloatArrayType
import androidx.navigation.safe.args.generator.FloatType
@@ -47,6 +50,7 @@
import com.squareup.kotlinpoet.BOOLEAN
import com.squareup.kotlinpoet.ClassName
import com.squareup.kotlinpoet.CodeBlock
+import com.squareup.kotlinpoet.DOUBLE
import com.squareup.kotlinpoet.FLOAT
import com.squareup.kotlinpoet.FunSpec
import com.squareup.kotlinpoet.INT
@@ -159,6 +163,8 @@
LongArrayType -> LongArray::class.asTypeName()
FloatType -> FLOAT
FloatArrayType -> FloatArray::class.asTypeName()
+ DoubleType -> DOUBLE
+ DoubleArrayType -> DoubleArray::class.asTypeName()
StringType -> String::class.asTypeName()
StringArrayType -> ARRAY.parameterizedBy(String::class.asTypeName())
BoolType -> BOOLEAN
@@ -183,6 +189,7 @@
is IntValue -> CodeBlock.of(value)
is LongValue -> CodeBlock.of(value)
is FloatValue -> CodeBlock.of("${value}F")
+ is DoubleValue -> CodeBlock.of(value)
is BooleanValue -> CodeBlock.of(value)
is NullValue -> CodeBlock.of("null")
is EnumValue -> CodeBlock.of("%T.%N", type.typeName(), value)
diff --git a/navigation/navigation-safe-args-generator/src/tests/kotlin/androidx/navigation/safe/args/generator/DestinationTest.kt b/navigation/navigation-safe-args-generator/src/test/kotlin/androidx/navigation/safe/args/generator/DestinationTest.kt
similarity index 100%
rename from navigation/navigation-safe-args-generator/src/tests/kotlin/androidx/navigation/safe/args/generator/DestinationTest.kt
rename to navigation/navigation-safe-args-generator/src/test/kotlin/androidx/navigation/safe/args/generator/DestinationTest.kt
diff --git a/navigation/navigation-safe-args-generator/src/tests/kotlin/androidx/navigation/safe/args/generator/InvalidXmlTest.kt b/navigation/navigation-safe-args-generator/src/test/kotlin/androidx/navigation/safe/args/generator/InvalidXmlTest.kt
similarity index 100%
rename from navigation/navigation-safe-args-generator/src/tests/kotlin/androidx/navigation/safe/args/generator/InvalidXmlTest.kt
rename to navigation/navigation-safe-args-generator/src/test/kotlin/androidx/navigation/safe/args/generator/InvalidXmlTest.kt
diff --git a/navigation/navigation-safe-args-generator/src/tests/kotlin/androidx/navigation/safe/args/generator/JavaNavWriterTest.kt b/navigation/navigation-safe-args-generator/src/test/kotlin/androidx/navigation/safe/args/generator/JavaNavWriterTest.kt
similarity index 97%
rename from navigation/navigation-safe-args-generator/src/tests/kotlin/androidx/navigation/safe/args/generator/JavaNavWriterTest.kt
rename to navigation/navigation-safe-args-generator/src/test/kotlin/androidx/navigation/safe/args/generator/JavaNavWriterTest.kt
index e2d0d45..8c561d6 100644
--- a/navigation/navigation-safe-args-generator/src/tests/kotlin/androidx/navigation/safe/args/generator/JavaNavWriterTest.kt
+++ b/navigation/navigation-safe-args-generator/src/test/kotlin/androidx/navigation/safe/args/generator/JavaNavWriterTest.kt
@@ -197,6 +197,8 @@
Argument("referenceZeroDefaultValue", ReferenceType, IntValue("0")),
Argument("floatArg", FloatType, FloatValue("1")),
Argument("floatArrayArg", FloatArrayType),
+ Argument("doubleArg", DoubleType, DoubleValue("1.2")),
+ Argument("doubleArrayArg", DoubleArrayType),
Argument("objectArrayArg", ObjectArrayType(
"android.content.pm.ActivityInfo")),
Argument("boolArg", BoolType, BooleanValue("true")),
@@ -279,7 +281,8 @@
val generatedFiles = compileFiles(actual).generatedFiles()
val loader = InMemoryGeneratedClassLoader(generatedFiles)
- fun createNextObj(mainArgValue: String) = loader.loadClass("a.b.MainFragmentDirections")
+ fun createNextObj(mainArgValue: String): Any? = loader.loadClass("a.b" +
+ ".MainFragmentDirections")
.getDeclaredMethod("next", String::class.java)
.invoke(null, mainArgValue)
diff --git a/navigation/navigation-safe-args-generator/src/tests/kotlin/androidx/navigation/safe/args/generator/KotlinNavWriterTest.kt b/navigation/navigation-safe-args-generator/src/test/kotlin/androidx/navigation/safe/args/generator/KotlinNavWriterTest.kt
similarity index 97%
rename from navigation/navigation-safe-args-generator/src/tests/kotlin/androidx/navigation/safe/args/generator/KotlinNavWriterTest.kt
rename to navigation/navigation-safe-args-generator/src/test/kotlin/androidx/navigation/safe/args/generator/KotlinNavWriterTest.kt
index 3a5dc96..8726a8d 100644
--- a/navigation/navigation-safe-args-generator/src/tests/kotlin/androidx/navigation/safe/args/generator/KotlinNavWriterTest.kt
+++ b/navigation/navigation-safe-args-generator/src/test/kotlin/androidx/navigation/safe/args/generator/KotlinNavWriterTest.kt
@@ -145,6 +145,8 @@
Argument("referenceZeroDefaultValue", ReferenceType, IntValue("0")),
Argument("floatArg", FloatType, FloatValue("1")),
Argument("floatArrayArg", FloatArrayType),
+ Argument("doubleArg", DoubleType, DoubleValue("1.2")),
+ Argument("doubleArrayArg", DoubleArrayType),
Argument("objectArrayArg", ObjectArrayType("android.content.pm.ActivityInfo")),
Argument("boolArg", BoolType, BooleanValue("true")),
Argument(
diff --git a/navigation/navigation-safe-args-generator/src/tests/kotlin/androidx/navigation/safe/args/generator/NavArgumentResolverTest.kt b/navigation/navigation-safe-args-generator/src/test/kotlin/androidx/navigation/safe/args/generator/NavArgumentResolverTest.kt
similarity index 100%
rename from navigation/navigation-safe-args-generator/src/tests/kotlin/androidx/navigation/safe/args/generator/NavArgumentResolverTest.kt
rename to navigation/navigation-safe-args-generator/src/test/kotlin/androidx/navigation/safe/args/generator/NavArgumentResolverTest.kt
diff --git a/navigation/navigation-safe-args-generator/src/tests/kotlin/androidx/navigation/safe/args/generator/NavGeneratorTest.kt b/navigation/navigation-safe-args-generator/src/test/kotlin/androidx/navigation/safe/args/generator/NavGeneratorTest.kt
similarity index 100%
rename from navigation/navigation-safe-args-generator/src/tests/kotlin/androidx/navigation/safe/args/generator/NavGeneratorTest.kt
rename to navigation/navigation-safe-args-generator/src/test/kotlin/androidx/navigation/safe/args/generator/NavGeneratorTest.kt
diff --git a/navigation/navigation-safe-args-generator/src/tests/kotlin/androidx/navigation/safe/args/generator/NavParserTest.kt b/navigation/navigation-safe-args-generator/src/test/kotlin/androidx/navigation/safe/args/generator/NavParserTest.kt
similarity index 95%
rename from navigation/navigation-safe-args-generator/src/tests/kotlin/androidx/navigation/safe/args/generator/NavParserTest.kt
rename to navigation/navigation-safe-args-generator/src/test/kotlin/androidx/navigation/safe/args/generator/NavParserTest.kt
index e45da8a..44de798 100644
--- a/navigation/navigation-safe-args-generator/src/tests/kotlin/androidx/navigation/safe/args/generator/NavParserTest.kt
+++ b/navigation/navigation-safe-args-generator/src/test/kotlin/androidx/navigation/safe/args/generator/NavParserTest.kt
@@ -47,6 +47,7 @@
Argument("myarg2", StringType),
Argument("randomArgument", StringType),
Argument("intArgument", IntType, IntValue("261")),
+ Argument("doubleArgument", DoubleType, DoubleValue("1.2345")),
Argument("referenceZeroDefaultValue", ReferenceType, IntValue("0")),
Argument(
"activityInfo",
@@ -59,6 +60,7 @@
true
),
Argument("intArrayArg", IntArrayType),
+ Argument("doubleArrayArg", DoubleArrayType),
Argument("stringArrayArg", StringArrayType),
Argument("objectArrayArg", ObjectArrayType(
"android.content.pm.ActivityInfo")),
@@ -197,7 +199,7 @@
val infer = { value: String -> inferArgument("foo", value, "a.b") }
val intArg = { value: String -> Argument("foo", IntType, IntValue(value)) }
val longArg = { value: String -> Argument("foo", LongType, LongValue(value)) }
- val floatArg = { value: String -> Argument("foo", FloatType, FloatValue(value)) }
+ val doubleArg = { value: String -> Argument("foo", DoubleType, DoubleValue(value)) }
val stringArg = { value: String -> Argument("foo", StringType, StringValue(value)) }
val nullStringArg = Argument("foo", StringType, NullValue, true)
val boolArg = { value: String -> Argument("foo", BoolType, BooleanValue(value)) }
@@ -218,10 +220,10 @@
assertThat(infer("@+id/foo"), `is`(referenceArg("a.b", "id", "foo")))
assertThat(infer("@foo:stuff"), `is`(stringArg("@foo:stuff")))
assertThat(infer("@/stuff"), `is`(stringArg("@/stuff")))
- assertThat(infer("10101010100100"), `is`(floatArg("10101010100100")))
- assertThat(infer("1."), `is`(floatArg("1.")))
- assertThat(infer("1.2e-4"), `is`(floatArg("1.2e-4")))
- assertThat(infer(".4"), `is`(floatArg(".4")))
+ assertThat(infer("10101010100100"), `is`(doubleArg("10101010100100")))
+ assertThat(infer("1."), `is`(doubleArg("1.")))
+ assertThat(infer("1.2e-4"), `is`(doubleArg("1.2e-4")))
+ assertThat(infer(".4"), `is`(doubleArg(".4")))
assertThat(infer("true"), `is`(boolArg("true")))
assertThat(infer("false"), `is`(boolArg("false")))
assertThat(infer("123L"), `is`(longArg("123L")))
diff --git a/navigation/navigation-safe-args-generator/src/tests/kotlin/androidx/navigation/safe/args/generator/TestData.kt b/navigation/navigation-safe-args-generator/src/test/kotlin/androidx/navigation/safe/args/generator/TestData.kt
similarity index 91%
rename from navigation/navigation-safe-args-generator/src/tests/kotlin/androidx/navigation/safe/args/generator/TestData.kt
rename to navigation/navigation-safe-args-generator/src/test/kotlin/androidx/navigation/safe/args/generator/TestData.kt
index 279b1dd..8b94484c 100644
--- a/navigation/navigation-safe-args-generator/src/tests/kotlin/androidx/navigation/safe/args/generator/TestData.kt
+++ b/navigation/navigation-safe-args-generator/src/test/kotlin/androidx/navigation/safe/args/generator/TestData.kt
@@ -18,4 +18,4 @@
import java.io.File
-fun testData(path: String) = File("src/tests/test-data/$path")
\ No newline at end of file
+fun testData(path: String) = File("src/test/test-data/$path")
\ No newline at end of file
diff --git a/navigation/navigation-safe-args-generator/src/tests/kotlin/androidx/navigation/safe/args/generator/TestUtils.kt b/navigation/navigation-safe-args-generator/src/test/kotlin/androidx/navigation/safe/args/generator/TestUtils.kt
similarity index 94%
rename from navigation/navigation-safe-args-generator/src/tests/kotlin/androidx/navigation/safe/args/generator/TestUtils.kt
rename to navigation/navigation-safe-args-generator/src/test/kotlin/androidx/navigation/safe/args/generator/TestUtils.kt
index 484ebcf..728f47c 100644
--- a/navigation/navigation-safe-args-generator/src/tests/kotlin/androidx/navigation/safe/args/generator/TestUtils.kt
+++ b/navigation/navigation-safe-args-generator/src/test/kotlin/androidx/navigation/safe/args/generator/TestUtils.kt
@@ -28,7 +28,7 @@
this.parsesAs(loadSourceFileObject(fullClassName, folder))
fun loadSourceString(fullClassName: String, folder: String, fileExtension: String): String {
- val folderPath = "src/tests/test-data/${if (folder.isEmpty()) "" else "$folder/"}"
+ val folderPath = "src/test/test-data/${if (folder.isEmpty()) "" else "$folder/"}"
val split = fullClassName.split(".")
return File("$folderPath/${split.last()}.$fileExtension").readText(Charset.defaultCharset())
}
diff --git a/navigation/navigation-safe-args-generator/src/tests/kotlin/androidx/navigation/safe/args/generator/WritableValueTest.kt b/navigation/navigation-safe-args-generator/src/test/kotlin/androidx/navigation/safe/args/generator/WritableValueTest.kt
similarity index 100%
rename from navigation/navigation-safe-args-generator/src/tests/kotlin/androidx/navigation/safe/args/generator/WritableValueTest.kt
rename to navigation/navigation-safe-args-generator/src/test/kotlin/androidx/navigation/safe/args/generator/WritableValueTest.kt
diff --git a/navigation/navigation-safe-args-generator/src/tests/test-data/IGNORE_CHECKSTYLE b/navigation/navigation-safe-args-generator/src/test/test-data/IGNORE_CHECKSTYLE
similarity index 100%
rename from navigation/navigation-safe-args-generator/src/tests/test-data/IGNORE_CHECKSTYLE
rename to navigation/navigation-safe-args-generator/src/test/test-data/IGNORE_CHECKSTYLE
diff --git a/navigation/navigation-safe-args-generator/src/tests/test-data/a/b/R.java b/navigation/navigation-safe-args-generator/src/test/test-data/a/b/R.java
similarity index 100%
rename from navigation/navigation-safe-args-generator/src/tests/test-data/a/b/R.java
rename to navigation/navigation-safe-args-generator/src/test/test-data/a/b/R.java
diff --git a/navigation/navigation-safe-args-generator/src/tests/test-data/a/b/secondreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallylongpackage/R.java b/navigation/navigation-safe-args-generator/src/test/test-data/a/b/secondreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallylongpackage/R.java
similarity index 100%
rename from navigation/navigation-safe-args-generator/src/tests/test-data/a/b/secondreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallylongpackage/R.java
rename to navigation/navigation-safe-args-generator/src/test/test-data/a/b/secondreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallylongpackage/R.java
diff --git a/navigation/navigation-safe-args-generator/src/tests/test-data/expected/java_nav_writer_test/Finish.java b/navigation/navigation-safe-args-generator/src/test/test-data/expected/java_nav_writer_test/Finish.java
similarity index 100%
rename from navigation/navigation-safe-args-generator/src/tests/test-data/expected/java_nav_writer_test/Finish.java
rename to navigation/navigation-safe-args-generator/src/test/test-data/expected/java_nav_writer_test/Finish.java
diff --git a/navigation/navigation-safe-args-generator/src/tests/test-data/expected/java_nav_writer_test/LongPackageFragmentDirections.java b/navigation/navigation-safe-args-generator/src/test/test-data/expected/java_nav_writer_test/LongPackageFragmentDirections.java
similarity index 100%
rename from navigation/navigation-safe-args-generator/src/tests/test-data/expected/java_nav_writer_test/LongPackageFragmentDirections.java
rename to navigation/navigation-safe-args-generator/src/test/test-data/expected/java_nav_writer_test/LongPackageFragmentDirections.java
diff --git a/navigation/navigation-safe-args-generator/src/tests/test-data/expected/java_nav_writer_test/MainFragment$InnerFragmentArgs.java b/navigation/navigation-safe-args-generator/src/test/test-data/expected/java_nav_writer_test/MainFragment$InnerFragmentArgs.java
similarity index 100%
rename from navigation/navigation-safe-args-generator/src/tests/test-data/expected/java_nav_writer_test/MainFragment$InnerFragmentArgs.java
rename to navigation/navigation-safe-args-generator/src/test/test-data/expected/java_nav_writer_test/MainFragment$InnerFragmentArgs.java
diff --git a/navigation/navigation-safe-args-generator/src/tests/test-data/expected/java_nav_writer_test/MainFragmentArgs.java b/navigation/navigation-safe-args-generator/src/test/test-data/expected/java_nav_writer_test/MainFragmentArgs.java
similarity index 84%
rename from navigation/navigation-safe-args-generator/src/tests/test-data/expected/java_nav_writer_test/MainFragmentArgs.java
rename to navigation/navigation-safe-args-generator/src/test/test-data/expected/java_nav_writer_test/MainFragmentArgs.java
index 58cff15..896c272 100644
--- a/navigation/navigation-safe-args-generator/src/tests/test-data/expected/java_nav_writer_test/MainFragmentArgs.java
+++ b/navigation/navigation-safe-args-generator/src/test/test-data/expected/java_nav_writer_test/MainFragmentArgs.java
@@ -79,6 +79,23 @@
} else {
throw new IllegalArgumentException("Required argument \"floatArrayArg\" is missing and does not have an android:defaultValue");
}
+ if (bundle.containsKey("doubleArg")) {
+ double doubleArg;
+ doubleArg = bundle.getDouble("doubleArg");
+ __result.arguments.put("doubleArg", doubleArg);
+ } else {
+ __result.arguments.put("doubleArg", 1.2);
+ }
+ if (bundle.containsKey("doubleArrayArg")) {
+ double[] doubleArrayArg;
+ doubleArrayArg = bundle.getDoubleArray("doubleArrayArg");
+ if (doubleArrayArg == null) {
+ throw new IllegalArgumentException("Argument \"doubleArrayArg\" is marked as non-null but was passed a null value.");
+ }
+ __result.arguments.put("doubleArrayArg", doubleArrayArg);
+ } else {
+ throw new IllegalArgumentException("Required argument \"doubleArrayArg\" is missing and does not have an android:defaultValue");
+ }
if (bundle.containsKey("objectArrayArg")) {
ActivityInfo[] objectArrayArg;
Parcelable[] __array = bundle.getParcelableArray("objectArrayArg");
@@ -163,6 +180,17 @@
}
@SuppressWarnings("unchecked")
+ public double getDoubleArg() {
+ return (double) arguments.get("doubleArg");
+ }
+
+ @SuppressWarnings("unchecked")
+ @NonNull
+ public double[] getDoubleArrayArg() {
+ return (double[]) arguments.get("doubleArrayArg");
+ }
+
+ @SuppressWarnings("unchecked")
@NonNull
public ActivityInfo[] getObjectArrayArg() {
return (ActivityInfo[]) arguments.get("objectArrayArg");
@@ -221,6 +249,16 @@
float[] floatArrayArg = (float[]) arguments.get("floatArrayArg");
__result.putFloatArray("floatArrayArg", floatArrayArg);
}
+ if (arguments.containsKey("doubleArg")) {
+ double doubleArg = (double) arguments.get("doubleArg");
+ __result.putDouble("doubleArg", doubleArg);
+ } else {
+ __result.putDouble("doubleArg", 1.2);
+ }
+ if (arguments.containsKey("doubleArrayArg")) {
+ double[] doubleArrayArg = (double[]) arguments.get("doubleArrayArg");
+ __result.putDoubleArray("doubleArrayArg", doubleArrayArg);
+ }
if (arguments.containsKey("objectArrayArg")) {
ActivityInfo[] objectArrayArg = (ActivityInfo[]) arguments.get("objectArrayArg");
__result.putParcelableArray("objectArrayArg", objectArrayArg);
@@ -303,6 +341,18 @@
if (getFloatArrayArg() != null ? !getFloatArrayArg().equals(that.getFloatArrayArg()) : that.getFloatArrayArg() != null) {
return false;
}
+ if (arguments.containsKey("doubleArg") != that.arguments.containsKey("doubleArg")) {
+ return false;
+ }
+ if (Double.compare(that.getDoubleArg(), getDoubleArg()) != 0) {
+ return false;
+ }
+ if (arguments.containsKey("doubleArrayArg") != that.arguments.containsKey("doubleArrayArg")) {
+ return false;
+ }
+ if (getDoubleArrayArg() != null ? !getDoubleArrayArg().equals(that.getDoubleArrayArg()) : that.getDoubleArrayArg() != null) {
+ return false;
+ }
if (arguments.containsKey("objectArrayArg") != that.arguments.containsKey("objectArrayArg")) {
return false;
}
@@ -339,6 +389,8 @@
result = 31 * result + getReferenceZeroDefaultValue();
result = 31 * result + Float.floatToIntBits(getFloatArg());
result = 31 * result + java.util.Arrays.hashCode(getFloatArrayArg());
+ result = 31 * result + Long.valueOf(Double.doubleToLongBits(getDoubleArg())).hashCode();
+ result = 31 * result + java.util.Arrays.hashCode(getDoubleArrayArg());
result = 31 * result + java.util.Arrays.hashCode(getObjectArrayArg());
result = 31 * result + (getBoolArg() ? 1 : 0);
result = 31 * result + (getOptionalParcelable() != null ? getOptionalParcelable().hashCode() : 0);
@@ -355,6 +407,8 @@
+ ", referenceZeroDefaultValue=" + getReferenceZeroDefaultValue()
+ ", floatArg=" + getFloatArg()
+ ", floatArrayArg=" + getFloatArrayArg()
+ + ", doubleArg=" + getDoubleArg()
+ + ", doubleArrayArg=" + getDoubleArrayArg()
+ ", objectArrayArg=" + getObjectArrayArg()
+ ", boolArg=" + getBoolArg()
+ ", optionalParcelable=" + getOptionalParcelable()
@@ -370,7 +424,7 @@
}
public Builder(@NonNull String main, @NonNull float[] floatArrayArg,
- @NonNull ActivityInfo[] objectArrayArg) {
+ @NonNull double[] doubleArrayArg, @NonNull ActivityInfo[] objectArrayArg) {
if (main == null) {
throw new IllegalArgumentException("Argument \"main\" is marked as non-null but was passed a null value.");
}
@@ -379,6 +433,10 @@
throw new IllegalArgumentException("Argument \"floatArrayArg\" is marked as non-null but was passed a null value.");
}
this.arguments.put("floatArrayArg", floatArrayArg);
+ if (doubleArrayArg == null) {
+ throw new IllegalArgumentException("Argument \"doubleArrayArg\" is marked as non-null but was passed a null value.");
+ }
+ this.arguments.put("doubleArrayArg", doubleArrayArg);
if (objectArrayArg == null) {
throw new IllegalArgumentException("Argument \"objectArrayArg\" is marked as non-null but was passed a null value.");
}
@@ -434,6 +492,21 @@
}
@NonNull
+ public Builder setDoubleArg(double doubleArg) {
+ this.arguments.put("doubleArg", doubleArg);
+ return this;
+ }
+
+ @NonNull
+ public Builder setDoubleArrayArg(@NonNull double[] doubleArrayArg) {
+ if (doubleArrayArg == null) {
+ throw new IllegalArgumentException("Argument \"doubleArrayArg\" is marked as non-null but was passed a null value.");
+ }
+ this.arguments.put("doubleArrayArg", doubleArrayArg);
+ return this;
+ }
+
+ @NonNull
public Builder setObjectArrayArg(@NonNull ActivityInfo[] objectArrayArg) {
if (objectArrayArg == null) {
throw new IllegalArgumentException("Argument \"objectArrayArg\" is marked as non-null but was passed a null value.");
@@ -496,6 +569,17 @@
}
@SuppressWarnings("unchecked")
+ public double getDoubleArg() {
+ return (double) arguments.get("doubleArg");
+ }
+
+ @SuppressWarnings("unchecked")
+ @NonNull
+ public double[] getDoubleArrayArg() {
+ return (double[]) arguments.get("doubleArrayArg");
+ }
+
+ @SuppressWarnings("unchecked")
@NonNull
public ActivityInfo[] getObjectArrayArg() {
return (ActivityInfo[]) arguments.get("objectArrayArg");
diff --git a/navigation/navigation-safe-args-generator/src/tests/test-data/expected/java_nav_writer_test/MainFragmentDirections.java b/navigation/navigation-safe-args-generator/src/test/test-data/expected/java_nav_writer_test/MainFragmentDirections.java
similarity index 100%
rename from navigation/navigation-safe-args-generator/src/tests/test-data/expected/java_nav_writer_test/MainFragmentDirections.java
rename to navigation/navigation-safe-args-generator/src/test/test-data/expected/java_nav_writer_test/MainFragmentDirections.java
diff --git a/navigation/navigation-safe-args-generator/src/tests/test-data/expected/java_nav_writer_test/Next.java b/navigation/navigation-safe-args-generator/src/test/test-data/expected/java_nav_writer_test/Next.java
similarity index 100%
rename from navigation/navigation-safe-args-generator/src/tests/test-data/expected/java_nav_writer_test/Next.java
rename to navigation/navigation-safe-args-generator/src/test/test-data/expected/java_nav_writer_test/Next.java
diff --git a/navigation/navigation-safe-args-generator/src/tests/test-data/expected/java_nav_writer_test/SanitizedMainFragmentArgs.java b/navigation/navigation-safe-args-generator/src/test/test-data/expected/java_nav_writer_test/SanitizedMainFragmentArgs.java
similarity index 100%
rename from navigation/navigation-safe-args-generator/src/tests/test-data/expected/java_nav_writer_test/SanitizedMainFragmentArgs.java
rename to navigation/navigation-safe-args-generator/src/test/test-data/expected/java_nav_writer_test/SanitizedMainFragmentArgs.java
diff --git a/navigation/navigation-safe-args-generator/src/tests/test-data/expected/java_nav_writer_test/SanitizedMainFragmentDirections.java b/navigation/navigation-safe-args-generator/src/test/test-data/expected/java_nav_writer_test/SanitizedMainFragmentDirections.java
similarity index 100%
rename from navigation/navigation-safe-args-generator/src/tests/test-data/expected/java_nav_writer_test/SanitizedMainFragmentDirections.java
rename to navigation/navigation-safe-args-generator/src/test/test-data/expected/java_nav_writer_test/SanitizedMainFragmentDirections.java
diff --git a/navigation/navigation-safe-args-generator/src/tests/test-data/expected/kotlin_nav_writer_test/FunFragmentDirections.kt b/navigation/navigation-safe-args-generator/src/test/test-data/expected/kotlin_nav_writer_test/FunFragmentDirections.kt
similarity index 100%
rename from navigation/navigation-safe-args-generator/src/tests/test-data/expected/kotlin_nav_writer_test/FunFragmentDirections.kt
rename to navigation/navigation-safe-args-generator/src/test/test-data/expected/kotlin_nav_writer_test/FunFragmentDirections.kt
diff --git a/navigation/navigation-safe-args-generator/src/tests/test-data/expected/kotlin_nav_writer_test/LongPackageFragmentDirections.kt b/navigation/navigation-safe-args-generator/src/test/test-data/expected/kotlin_nav_writer_test/LongPackageFragmentDirections.kt
similarity index 100%
rename from navigation/navigation-safe-args-generator/src/tests/test-data/expected/kotlin_nav_writer_test/LongPackageFragmentDirections.kt
rename to navigation/navigation-safe-args-generator/src/test/test-data/expected/kotlin_nav_writer_test/LongPackageFragmentDirections.kt
diff --git a/navigation/navigation-safe-args-generator/src/tests/test-data/expected/kotlin_nav_writer_test/MainFragmentArgs.kt b/navigation/navigation-safe-args-generator/src/test/test-data/expected/kotlin_nav_writer_test/MainFragmentArgs.kt
similarity index 85%
rename from navigation/navigation-safe-args-generator/src/tests/test-data/expected/kotlin_nav_writer_test/MainFragmentArgs.kt
rename to navigation/navigation-safe-args-generator/src/test/test-data/expected/kotlin_nav_writer_test/MainFragmentArgs.kt
index 447ecf2..3ba79a4 100644
--- a/navigation/navigation-safe-args-generator/src/tests/test-data/expected/kotlin_nav_writer_test/MainFragmentArgs.kt
+++ b/navigation/navigation-safe-args-generator/src/test/test-data/expected/kotlin_nav_writer_test/MainFragmentArgs.kt
@@ -10,6 +10,8 @@
import java.nio.file.AccessMode
import kotlin.Array
import kotlin.Boolean
+import kotlin.Double
+import kotlin.DoubleArray
import kotlin.Float
import kotlin.FloatArray
import kotlin.Int
@@ -24,6 +26,8 @@
val referenceZeroDefaultValue: Int = 0,
val floatArg: Float = 1F,
val floatArrayArg: FloatArray,
+ val doubleArg: Double = 1.2,
+ val doubleArrayArg: DoubleArray,
val objectArrayArg: Array<ActivityInfo>,
val boolArg: Boolean = true,
val optionalParcelable: ActivityInfo? = null,
@@ -38,6 +42,8 @@
result.putInt("referenceZeroDefaultValue", this.referenceZeroDefaultValue)
result.putFloat("floatArg", this.floatArg)
result.putFloatArray("floatArrayArg", this.floatArrayArg)
+ result.putDouble("doubleArg", this.doubleArg)
+ result.putDoubleArray("doubleArrayArg", this.doubleArrayArg)
result.putParcelableArray("objectArrayArg", this.objectArrayArg)
result.putBoolean("boolArg", this.boolArg)
if (Parcelable::class.java.isAssignableFrom(ActivityInfo::class.java)) {
@@ -100,6 +106,21 @@
} else {
throw IllegalArgumentException("Required argument \"floatArrayArg\" is missing and does not have an android:defaultValue")
}
+ val __doubleArg : Double
+ if (bundle.containsKey("doubleArg")) {
+ __doubleArg = bundle.getDouble("doubleArg")
+ } else {
+ __doubleArg = 1.2
+ }
+ val __doubleArrayArg : DoubleArray?
+ if (bundle.containsKey("doubleArrayArg")) {
+ __doubleArrayArg = bundle.getDoubleArray("doubleArrayArg")
+ if (__doubleArrayArg == null) {
+ throw IllegalArgumentException("Argument \"doubleArrayArg\" is marked as non-null but was passed a null value.")
+ }
+ } else {
+ throw IllegalArgumentException("Required argument \"doubleArrayArg\" is missing and does not have an android:defaultValue")
+ }
val __objectArrayArg : Array<ActivityInfo>?
if (bundle.containsKey("objectArrayArg")) {
__objectArrayArg = bundle.getParcelableArray("objectArrayArg")?.map { it as ActivityInfo
@@ -144,7 +165,8 @@
__enumArg = AccessMode.READ
}
return MainFragmentArgs(__main, __optional, __reference, __referenceZeroDefaultValue,
- __floatArg, __floatArrayArg, __objectArrayArg, __boolArg, __optionalParcelable, __enumArg)
+ __floatArg, __floatArrayArg, __doubleArg, __doubleArrayArg, __objectArrayArg, __boolArg,
+ __optionalParcelable, __enumArg)
}
}
}
diff --git a/navigation/navigation-safe-args-generator/src/tests/test-data/expected/kotlin_nav_writer_test/MainFragmentDirections.kt b/navigation/navigation-safe-args-generator/src/test/test-data/expected/kotlin_nav_writer_test/MainFragmentDirections.kt
similarity index 100%
rename from navigation/navigation-safe-args-generator/src/tests/test-data/expected/kotlin_nav_writer_test/MainFragmentDirections.kt
rename to navigation/navigation-safe-args-generator/src/test/test-data/expected/kotlin_nav_writer_test/MainFragmentDirections.kt
diff --git a/navigation/navigation-safe-args-generator/src/tests/test-data/expected/kotlin_nav_writer_test/Next.kt b/navigation/navigation-safe-args-generator/src/test/test-data/expected/kotlin_nav_writer_test/Next.kt
similarity index 100%
rename from navigation/navigation-safe-args-generator/src/tests/test-data/expected/kotlin_nav_writer_test/Next.kt
rename to navigation/navigation-safe-args-generator/src/test/test-data/expected/kotlin_nav_writer_test/Next.kt
diff --git a/navigation/navigation-safe-args-generator/src/tests/test-data/expected/nav_generator_test/java/nested/LoginDirections.java b/navigation/navigation-safe-args-generator/src/test/test-data/expected/nav_generator_test/java/nested/LoginDirections.java
similarity index 100%
rename from navigation/navigation-safe-args-generator/src/tests/test-data/expected/nav_generator_test/java/nested/LoginDirections.java
rename to navigation/navigation-safe-args-generator/src/test/test-data/expected/nav_generator_test/java/nested/LoginDirections.java
diff --git a/navigation/navigation-safe-args-generator/src/tests/test-data/expected/nav_generator_test/java/nested/LoginFragmentDirections.java b/navigation/navigation-safe-args-generator/src/test/test-data/expected/nav_generator_test/java/nested/LoginFragmentDirections.java
similarity index 100%
rename from navigation/navigation-safe-args-generator/src/tests/test-data/expected/nav_generator_test/java/nested/LoginFragmentDirections.java
rename to navigation/navigation-safe-args-generator/src/test/test-data/expected/nav_generator_test/java/nested/LoginFragmentDirections.java
diff --git a/navigation/navigation-safe-args-generator/src/tests/test-data/expected/nav_generator_test/java/nested/MainFragmentDirections.java b/navigation/navigation-safe-args-generator/src/test/test-data/expected/nav_generator_test/java/nested/MainFragmentDirections.java
similarity index 100%
rename from navigation/navigation-safe-args-generator/src/tests/test-data/expected/nav_generator_test/java/nested/MainFragmentDirections.java
rename to navigation/navigation-safe-args-generator/src/test/test-data/expected/nav_generator_test/java/nested/MainFragmentDirections.java
diff --git a/navigation/navigation-safe-args-generator/src/tests/test-data/expected/nav_generator_test/java/nested/RegisterFragmentDirections.java b/navigation/navigation-safe-args-generator/src/test/test-data/expected/nav_generator_test/java/nested/RegisterFragmentDirections.java
similarity index 100%
rename from navigation/navigation-safe-args-generator/src/tests/test-data/expected/nav_generator_test/java/nested/RegisterFragmentDirections.java
rename to navigation/navigation-safe-args-generator/src/test/test-data/expected/nav_generator_test/java/nested/RegisterFragmentDirections.java
diff --git a/navigation/navigation-safe-args-generator/src/tests/test-data/expected/nav_generator_test/java/nested_overridden_action/InnerSettingsDirections.java b/navigation/navigation-safe-args-generator/src/test/test-data/expected/nav_generator_test/java/nested_overridden_action/InnerSettingsDirections.java
similarity index 100%
rename from navigation/navigation-safe-args-generator/src/tests/test-data/expected/nav_generator_test/java/nested_overridden_action/InnerSettingsDirections.java
rename to navigation/navigation-safe-args-generator/src/test/test-data/expected/nav_generator_test/java/nested_overridden_action/InnerSettingsDirections.java
diff --git a/navigation/navigation-safe-args-generator/src/tests/test-data/expected/nav_generator_test/java/nested_overridden_action/InnerSettingsFragmentDirections.java b/navigation/navigation-safe-args-generator/src/test/test-data/expected/nav_generator_test/java/nested_overridden_action/InnerSettingsFragmentDirections.java
similarity index 100%
rename from navigation/navigation-safe-args-generator/src/tests/test-data/expected/nav_generator_test/java/nested_overridden_action/InnerSettingsFragmentDirections.java
rename to navigation/navigation-safe-args-generator/src/test/test-data/expected/nav_generator_test/java/nested_overridden_action/InnerSettingsFragmentDirections.java
diff --git a/navigation/navigation-safe-args-generator/src/tests/test-data/expected/nav_generator_test/java/nested_overridden_action/MainFragmentDirections.java b/navigation/navigation-safe-args-generator/src/test/test-data/expected/nav_generator_test/java/nested_overridden_action/MainFragmentDirections.java
similarity index 100%
rename from navigation/navigation-safe-args-generator/src/tests/test-data/expected/nav_generator_test/java/nested_overridden_action/MainFragmentDirections.java
rename to navigation/navigation-safe-args-generator/src/test/test-data/expected/nav_generator_test/java/nested_overridden_action/MainFragmentDirections.java
diff --git a/navigation/navigation-safe-args-generator/src/tests/test-data/expected/nav_generator_test/java/nested_overridden_action/SettingsDirections.java b/navigation/navigation-safe-args-generator/src/test/test-data/expected/nav_generator_test/java/nested_overridden_action/SettingsDirections.java
similarity index 100%
rename from navigation/navigation-safe-args-generator/src/tests/test-data/expected/nav_generator_test/java/nested_overridden_action/SettingsDirections.java
rename to navigation/navigation-safe-args-generator/src/test/test-data/expected/nav_generator_test/java/nested_overridden_action/SettingsDirections.java
diff --git a/navigation/navigation-safe-args-generator/src/tests/test-data/expected/nav_generator_test/java/nested_overridden_action/SettingsFragmentDirections.java b/navigation/navigation-safe-args-generator/src/test/test-data/expected/nav_generator_test/java/nested_overridden_action/SettingsFragmentDirections.java
similarity index 100%
rename from navigation/navigation-safe-args-generator/src/tests/test-data/expected/nav_generator_test/java/nested_overridden_action/SettingsFragmentDirections.java
rename to navigation/navigation-safe-args-generator/src/test/test-data/expected/nav_generator_test/java/nested_overridden_action/SettingsFragmentDirections.java
diff --git a/navigation/navigation-safe-args-generator/src/tests/test-data/expected/nav_generator_test/java/nested_same_action/MainFragmentDirections.java b/navigation/navigation-safe-args-generator/src/test/test-data/expected/nav_generator_test/java/nested_same_action/MainFragmentDirections.java
similarity index 100%
rename from navigation/navigation-safe-args-generator/src/tests/test-data/expected/nav_generator_test/java/nested_same_action/MainFragmentDirections.java
rename to navigation/navigation-safe-args-generator/src/test/test-data/expected/nav_generator_test/java/nested_same_action/MainFragmentDirections.java
diff --git a/navigation/navigation-safe-args-generator/src/tests/test-data/expected/nav_generator_test/java/nested_same_action/SettingsDirections.java b/navigation/navigation-safe-args-generator/src/test/test-data/expected/nav_generator_test/java/nested_same_action/SettingsDirections.java
similarity index 100%
rename from navigation/navigation-safe-args-generator/src/tests/test-data/expected/nav_generator_test/java/nested_same_action/SettingsDirections.java
rename to navigation/navigation-safe-args-generator/src/test/test-data/expected/nav_generator_test/java/nested_same_action/SettingsDirections.java
diff --git a/navigation/navigation-safe-args-generator/src/tests/test-data/expected/nav_generator_test/java/nested_same_action/SettingsFragmentDirections.java b/navigation/navigation-safe-args-generator/src/test/test-data/expected/nav_generator_test/java/nested_same_action/SettingsFragmentDirections.java
similarity index 100%
rename from navigation/navigation-safe-args-generator/src/tests/test-data/expected/nav_generator_test/java/nested_same_action/SettingsFragmentDirections.java
rename to navigation/navigation-safe-args-generator/src/test/test-data/expected/nav_generator_test/java/nested_same_action/SettingsFragmentDirections.java
diff --git a/navigation/navigation-safe-args-generator/src/tests/test-data/expected/nav_generator_test/kotlin/nested/LoginDirections.kt b/navigation/navigation-safe-args-generator/src/test/test-data/expected/nav_generator_test/kotlin/nested/LoginDirections.kt
similarity index 100%
rename from navigation/navigation-safe-args-generator/src/tests/test-data/expected/nav_generator_test/kotlin/nested/LoginDirections.kt
rename to navigation/navigation-safe-args-generator/src/test/test-data/expected/nav_generator_test/kotlin/nested/LoginDirections.kt
diff --git a/navigation/navigation-safe-args-generator/src/tests/test-data/expected/nav_generator_test/kotlin/nested/LoginFragmentDirections.kt b/navigation/navigation-safe-args-generator/src/test/test-data/expected/nav_generator_test/kotlin/nested/LoginFragmentDirections.kt
similarity index 100%
rename from navigation/navigation-safe-args-generator/src/tests/test-data/expected/nav_generator_test/kotlin/nested/LoginFragmentDirections.kt
rename to navigation/navigation-safe-args-generator/src/test/test-data/expected/nav_generator_test/kotlin/nested/LoginFragmentDirections.kt
diff --git a/navigation/navigation-safe-args-generator/src/tests/test-data/expected/nav_generator_test/kotlin/nested/MainFragmentDirections.kt b/navigation/navigation-safe-args-generator/src/test/test-data/expected/nav_generator_test/kotlin/nested/MainFragmentDirections.kt
similarity index 100%
rename from navigation/navigation-safe-args-generator/src/tests/test-data/expected/nav_generator_test/kotlin/nested/MainFragmentDirections.kt
rename to navigation/navigation-safe-args-generator/src/test/test-data/expected/nav_generator_test/kotlin/nested/MainFragmentDirections.kt
diff --git a/navigation/navigation-safe-args-generator/src/tests/test-data/expected/nav_generator_test/kotlin/nested/RegisterFragmentDirections.kt b/navigation/navigation-safe-args-generator/src/test/test-data/expected/nav_generator_test/kotlin/nested/RegisterFragmentDirections.kt
similarity index 100%
rename from navigation/navigation-safe-args-generator/src/tests/test-data/expected/nav_generator_test/kotlin/nested/RegisterFragmentDirections.kt
rename to navigation/navigation-safe-args-generator/src/test/test-data/expected/nav_generator_test/kotlin/nested/RegisterFragmentDirections.kt
diff --git a/navigation/navigation-safe-args-generator/src/tests/test-data/expected/nav_generator_test/kotlin/nested_overridden_action/InnerSettingsDirections.kt b/navigation/navigation-safe-args-generator/src/test/test-data/expected/nav_generator_test/kotlin/nested_overridden_action/InnerSettingsDirections.kt
similarity index 100%
rename from navigation/navigation-safe-args-generator/src/tests/test-data/expected/nav_generator_test/kotlin/nested_overridden_action/InnerSettingsDirections.kt
rename to navigation/navigation-safe-args-generator/src/test/test-data/expected/nav_generator_test/kotlin/nested_overridden_action/InnerSettingsDirections.kt
diff --git a/navigation/navigation-safe-args-generator/src/tests/test-data/expected/nav_generator_test/kotlin/nested_overridden_action/InnerSettingsFragmentDirections.kt b/navigation/navigation-safe-args-generator/src/test/test-data/expected/nav_generator_test/kotlin/nested_overridden_action/InnerSettingsFragmentDirections.kt
similarity index 100%
rename from navigation/navigation-safe-args-generator/src/tests/test-data/expected/nav_generator_test/kotlin/nested_overridden_action/InnerSettingsFragmentDirections.kt
rename to navigation/navigation-safe-args-generator/src/test/test-data/expected/nav_generator_test/kotlin/nested_overridden_action/InnerSettingsFragmentDirections.kt
diff --git a/navigation/navigation-safe-args-generator/src/tests/test-data/expected/nav_generator_test/kotlin/nested_overridden_action/MainFragmentDirections.kt b/navigation/navigation-safe-args-generator/src/test/test-data/expected/nav_generator_test/kotlin/nested_overridden_action/MainFragmentDirections.kt
similarity index 100%
rename from navigation/navigation-safe-args-generator/src/tests/test-data/expected/nav_generator_test/kotlin/nested_overridden_action/MainFragmentDirections.kt
rename to navigation/navigation-safe-args-generator/src/test/test-data/expected/nav_generator_test/kotlin/nested_overridden_action/MainFragmentDirections.kt
diff --git a/navigation/navigation-safe-args-generator/src/tests/test-data/expected/nav_generator_test/kotlin/nested_overridden_action/SettingsDirections.kt b/navigation/navigation-safe-args-generator/src/test/test-data/expected/nav_generator_test/kotlin/nested_overridden_action/SettingsDirections.kt
similarity index 100%
rename from navigation/navigation-safe-args-generator/src/tests/test-data/expected/nav_generator_test/kotlin/nested_overridden_action/SettingsDirections.kt
rename to navigation/navigation-safe-args-generator/src/test/test-data/expected/nav_generator_test/kotlin/nested_overridden_action/SettingsDirections.kt
diff --git a/navigation/navigation-safe-args-generator/src/tests/test-data/expected/nav_generator_test/kotlin/nested_overridden_action/SettingsFragmentDirections.kt b/navigation/navigation-safe-args-generator/src/test/test-data/expected/nav_generator_test/kotlin/nested_overridden_action/SettingsFragmentDirections.kt
similarity index 100%
rename from navigation/navigation-safe-args-generator/src/tests/test-data/expected/nav_generator_test/kotlin/nested_overridden_action/SettingsFragmentDirections.kt
rename to navigation/navigation-safe-args-generator/src/test/test-data/expected/nav_generator_test/kotlin/nested_overridden_action/SettingsFragmentDirections.kt
diff --git a/navigation/navigation-safe-args-generator/src/tests/test-data/expected/nav_generator_test/kotlin/nested_same_action/MainFragmentDirections.kt b/navigation/navigation-safe-args-generator/src/test/test-data/expected/nav_generator_test/kotlin/nested_same_action/MainFragmentDirections.kt
similarity index 100%
rename from navigation/navigation-safe-args-generator/src/tests/test-data/expected/nav_generator_test/kotlin/nested_same_action/MainFragmentDirections.kt
rename to navigation/navigation-safe-args-generator/src/test/test-data/expected/nav_generator_test/kotlin/nested_same_action/MainFragmentDirections.kt
diff --git a/navigation/navigation-safe-args-generator/src/tests/test-data/expected/nav_generator_test/kotlin/nested_same_action/SettingsDirections.kt b/navigation/navigation-safe-args-generator/src/test/test-data/expected/nav_generator_test/kotlin/nested_same_action/SettingsDirections.kt
similarity index 100%
rename from navigation/navigation-safe-args-generator/src/tests/test-data/expected/nav_generator_test/kotlin/nested_same_action/SettingsDirections.kt
rename to navigation/navigation-safe-args-generator/src/test/test-data/expected/nav_generator_test/kotlin/nested_same_action/SettingsDirections.kt
diff --git a/navigation/navigation-safe-args-generator/src/tests/test-data/expected/nav_generator_test/kotlin/nested_same_action/SettingsFragmentDirections.kt b/navigation/navigation-safe-args-generator/src/test/test-data/expected/nav_generator_test/kotlin/nested_same_action/SettingsFragmentDirections.kt
similarity index 100%
rename from navigation/navigation-safe-args-generator/src/tests/test-data/expected/nav_generator_test/kotlin/nested_same_action/SettingsFragmentDirections.kt
rename to navigation/navigation-safe-args-generator/src/test/test-data/expected/nav_generator_test/kotlin/nested_same_action/SettingsFragmentDirections.kt
diff --git a/navigation/navigation-safe-args-generator/src/tests/test-data/invalid_xmls/action_no_id.xml b/navigation/navigation-safe-args-generator/src/test/test-data/invalid_xmls/action_no_id.xml
similarity index 100%
rename from navigation/navigation-safe-args-generator/src/tests/test-data/invalid_xmls/action_no_id.xml
rename to navigation/navigation-safe-args-generator/src/test/test-data/invalid_xmls/action_no_id.xml
diff --git a/navigation/navigation-safe-args-generator/src/tests/test-data/invalid_xmls/invalid_default_value_int.xml b/navigation/navigation-safe-args-generator/src/test/test-data/invalid_xmls/invalid_default_value_int.xml
similarity index 100%
rename from navigation/navigation-safe-args-generator/src/tests/test-data/invalid_xmls/invalid_default_value_int.xml
rename to navigation/navigation-safe-args-generator/src/test/test-data/invalid_xmls/invalid_default_value_int.xml
diff --git a/navigation/navigation-safe-args-generator/src/tests/test-data/invalid_xmls/invalid_default_value_reference.xml b/navigation/navigation-safe-args-generator/src/test/test-data/invalid_xmls/invalid_default_value_reference.xml
similarity index 100%
rename from navigation/navigation-safe-args-generator/src/tests/test-data/invalid_xmls/invalid_default_value_reference.xml
rename to navigation/navigation-safe-args-generator/src/test/test-data/invalid_xmls/invalid_default_value_reference.xml
diff --git a/navigation/navigation-safe-args-generator/src/tests/test-data/invalid_xmls/invalid_deprecated_type.xml b/navigation/navigation-safe-args-generator/src/test/test-data/invalid_xmls/invalid_deprecated_type.xml
similarity index 100%
rename from navigation/navigation-safe-args-generator/src/tests/test-data/invalid_xmls/invalid_deprecated_type.xml
rename to navigation/navigation-safe-args-generator/src/test/test-data/invalid_xmls/invalid_deprecated_type.xml
diff --git a/navigation/navigation-safe-args-generator/src/tests/test-data/invalid_xmls/invalid_id_action.xml b/navigation/navigation-safe-args-generator/src/test/test-data/invalid_xmls/invalid_id_action.xml
similarity index 100%
rename from navigation/navigation-safe-args-generator/src/tests/test-data/invalid_xmls/invalid_id_action.xml
rename to navigation/navigation-safe-args-generator/src/test/test-data/invalid_xmls/invalid_id_action.xml
diff --git a/navigation/navigation-safe-args-generator/src/tests/test-data/invalid_xmls/invalid_id_destination.xml b/navigation/navigation-safe-args-generator/src/test/test-data/invalid_xmls/invalid_id_destination.xml
similarity index 100%
rename from navigation/navigation-safe-args-generator/src/tests/test-data/invalid_xmls/invalid_id_destination.xml
rename to navigation/navigation-safe-args-generator/src/test/test-data/invalid_xmls/invalid_id_destination.xml
diff --git a/navigation/navigation-safe-args-generator/src/tests/test-data/invalid_xmls/invalid_include_graph_attr.xml b/navigation/navigation-safe-args-generator/src/test/test-data/invalid_xmls/invalid_include_graph_attr.xml
similarity index 100%
rename from navigation/navigation-safe-args-generator/src/tests/test-data/invalid_xmls/invalid_include_graph_attr.xml
rename to navigation/navigation-safe-args-generator/src/test/test-data/invalid_xmls/invalid_include_graph_attr.xml
diff --git a/navigation/navigation-safe-args-generator/src/tests/test-data/invalid_xmls/invalid_include_tag.xml b/navigation/navigation-safe-args-generator/src/test/test-data/invalid_xmls/invalid_include_tag.xml
similarity index 100%
rename from navigation/navigation-safe-args-generator/src/tests/test-data/invalid_xmls/invalid_include_tag.xml
rename to navigation/navigation-safe-args-generator/src/test/test-data/invalid_xmls/invalid_include_tag.xml
diff --git a/navigation/navigation-safe-args-generator/src/tests/test-data/invalid_xmls/null_but_not_nullable.xml b/navigation/navigation-safe-args-generator/src/test/test-data/invalid_xmls/null_but_not_nullable.xml
similarity index 100%
rename from navigation/navigation-safe-args-generator/src/tests/test-data/invalid_xmls/null_but_not_nullable.xml
rename to navigation/navigation-safe-args-generator/src/test/test-data/invalid_xmls/null_but_not_nullable.xml
diff --git a/navigation/navigation-safe-args-generator/src/tests/test-data/invalid_xmls/null_default_value_reference.xml b/navigation/navigation-safe-args-generator/src/test/test-data/invalid_xmls/null_default_value_reference.xml
similarity index 100%
rename from navigation/navigation-safe-args-generator/src/tests/test-data/invalid_xmls/null_default_value_reference.xml
rename to navigation/navigation-safe-args-generator/src/test/test-data/invalid_xmls/null_default_value_reference.xml
diff --git a/navigation/navigation-safe-args-generator/src/tests/test-data/invalid_xmls/same_name_actions.xml b/navigation/navigation-safe-args-generator/src/test/test-data/invalid_xmls/same_name_actions.xml
similarity index 100%
rename from navigation/navigation-safe-args-generator/src/tests/test-data/invalid_xmls/same_name_actions.xml
rename to navigation/navigation-safe-args-generator/src/test/test-data/invalid_xmls/same_name_actions.xml
diff --git a/navigation/navigation-safe-args-generator/src/tests/test-data/invalid_xmls/same_name_args.xml b/navigation/navigation-safe-args-generator/src/test/test-data/invalid_xmls/same_name_args.xml
similarity index 100%
rename from navigation/navigation-safe-args-generator/src/tests/test-data/invalid_xmls/same_name_args.xml
rename to navigation/navigation-safe-args-generator/src/test/test-data/invalid_xmls/same_name_args.xml
diff --git a/navigation/navigation-safe-args-generator/src/tests/test-data/invalid_xmls/type_is_not_nullable.xml b/navigation/navigation-safe-args-generator/src/test/test-data/invalid_xmls/type_is_not_nullable.xml
similarity index 100%
rename from navigation/navigation-safe-args-generator/src/tests/test-data/invalid_xmls/type_is_not_nullable.xml
rename to navigation/navigation-safe-args-generator/src/test/test-data/invalid_xmls/type_is_not_nullable.xml
diff --git a/navigation/navigation-safe-args-generator/src/tests/test-data/invalid_xmls/unnamed_destination_with_action.xml b/navigation/navigation-safe-args-generator/src/test/test-data/invalid_xmls/unnamed_destination_with_action.xml
similarity index 100%
rename from navigation/navigation-safe-args-generator/src/tests/test-data/invalid_xmls/unnamed_destination_with_action.xml
rename to navigation/navigation-safe-args-generator/src/test/test-data/invalid_xmls/unnamed_destination_with_action.xml
diff --git a/navigation/navigation-safe-args-generator/src/tests/test-data/naive_test.xml b/navigation/navigation-safe-args-generator/src/test/test-data/naive_test.xml
similarity index 93%
rename from navigation/navigation-safe-args-generator/src/tests/test-data/naive_test.xml
rename to navigation/navigation-safe-args-generator/src/test/test-data/naive_test.xml
index 50542fc..81141594 100644
--- a/navigation/navigation-safe-args-generator/src/tests/test-data/naive_test.xml
+++ b/navigation/navigation-safe-args-generator/src/test/test-data/naive_test.xml
@@ -25,6 +25,8 @@
<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="doubleArgument" app:argType="double"
+ android:defaultValue="1.2345"/>
<argument android:name="referenceZeroDefaultValue" app:argType="reference" android:defaultValue="0"/>
<argument android:name="activityInfo" app:argType="android.content.pm.ActivityInfo"/>
<argument android:name="activityInfoNull"
@@ -33,6 +35,7 @@
android:defaultValue="@null"
/>
<argument android:name="intArrayArg" app:argType="integer[]"/>
+ <argument android:name="doubleArrayArg" app:argType="double[]"/>
<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"
diff --git a/navigation/navigation-safe-args-generator/src/tests/test-data/nested_include_login_test.xml b/navigation/navigation-safe-args-generator/src/test/test-data/nested_include_login_test.xml
similarity index 100%
rename from navigation/navigation-safe-args-generator/src/tests/test-data/nested_include_login_test.xml
rename to navigation/navigation-safe-args-generator/src/test/test-data/nested_include_login_test.xml
diff --git a/navigation/navigation-safe-args-generator/src/tests/test-data/nested_login_test.xml b/navigation/navigation-safe-args-generator/src/test/test-data/nested_login_test.xml
similarity index 100%
rename from navigation/navigation-safe-args-generator/src/tests/test-data/nested_login_test.xml
rename to navigation/navigation-safe-args-generator/src/test/test-data/nested_login_test.xml
diff --git a/navigation/navigation-safe-args-generator/src/tests/test-data/nested_overridden_action_test.xml b/navigation/navigation-safe-args-generator/src/test/test-data/nested_overridden_action_test.xml
similarity index 100%
rename from navigation/navigation-safe-args-generator/src/tests/test-data/nested_overridden_action_test.xml
rename to navigation/navigation-safe-args-generator/src/test/test-data/nested_overridden_action_test.xml
diff --git a/navigation/navigation-safe-args-generator/src/tests/test-data/nested_same_action_test.xml b/navigation/navigation-safe-args-generator/src/test/test-data/nested_same_action_test.xml
similarity index 100%
rename from navigation/navigation-safe-args-generator/src/tests/test-data/nested_same_action_test.xml
rename to navigation/navigation-safe-args-generator/src/test/test-data/nested_same_action_test.xml
diff --git a/navigation/navigation-safe-args-gradle-plugin/src/test/test-data/app-project-kotlin/src/main/res/navigation/nav_test.xml b/navigation/navigation-safe-args-gradle-plugin/src/test/test-data/app-project-kotlin/src/main/res/navigation/nav_test.xml
index fa455bd..0f6f3c3 100644
--- a/navigation/navigation-safe-args-gradle-plugin/src/test/test-data/app-project-kotlin/src/main/res/navigation/nav_test.xml
+++ b/navigation/navigation-safe-args-gradle-plugin/src/test/test-data/app-project-kotlin/src/main/res/navigation/nav_test.xml
@@ -46,7 +46,7 @@
<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="doubleArg" 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"/>
diff --git a/navigation/navigation-ui-ktx/api/2.3.0-alpha07.txt b/navigation/navigation-ui-ktx/api/2.3.0-alpha07.txt
index 168f63e..b03728d 100644
--- a/navigation/navigation-ui-ktx/api/2.3.0-alpha07.txt
+++ b/navigation/navigation-ui-ktx/api/2.3.0-alpha07.txt
@@ -7,9 +7,9 @@
}
public final class AppBarConfigurationKt {
- method public static inline androidx.navigation.ui.AppBarConfiguration AppBarConfiguration(androidx.navigation.NavGraph navGraph, androidx.customview.widget.Openable? 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.customview.widget.Openable? 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.customview.widget.Openable? drawerLayout = null, kotlin.jvm.functions.Function0<java.lang.Boolean> fallbackOnNavigateUpListener = { false });
+ method public static inline androidx.navigation.ui.AppBarConfiguration AppBarConfiguration(androidx.navigation.NavGraph navGraph, androidx.customview.widget.Openable? drawerLayout = null, kotlin.jvm.functions.Function0<java.lang.Boolean> fallbackOnNavigateUpListener = { return false });
+ method public static inline androidx.navigation.ui.AppBarConfiguration AppBarConfiguration(android.view.Menu topLevelMenu, androidx.customview.widget.Openable? drawerLayout = null, kotlin.jvm.functions.Function0<java.lang.Boolean> fallbackOnNavigateUpListener = { return false });
+ method public static inline androidx.navigation.ui.AppBarConfiguration AppBarConfiguration(java.util.Set<java.lang.Integer> topLevelDestinationIds, androidx.customview.widget.Openable? drawerLayout = null, kotlin.jvm.functions.Function0<java.lang.Boolean> fallbackOnNavigateUpListener = { return false });
}
public final class BottomNavigationViewKt {
diff --git a/navigation/navigation-ui-ktx/api/current.txt b/navigation/navigation-ui-ktx/api/current.txt
index 168f63e..b03728d 100644
--- a/navigation/navigation-ui-ktx/api/current.txt
+++ b/navigation/navigation-ui-ktx/api/current.txt
@@ -7,9 +7,9 @@
}
public final class AppBarConfigurationKt {
- method public static inline androidx.navigation.ui.AppBarConfiguration AppBarConfiguration(androidx.navigation.NavGraph navGraph, androidx.customview.widget.Openable? 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.customview.widget.Openable? 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.customview.widget.Openable? drawerLayout = null, kotlin.jvm.functions.Function0<java.lang.Boolean> fallbackOnNavigateUpListener = { false });
+ method public static inline androidx.navigation.ui.AppBarConfiguration AppBarConfiguration(androidx.navigation.NavGraph navGraph, androidx.customview.widget.Openable? drawerLayout = null, kotlin.jvm.functions.Function0<java.lang.Boolean> fallbackOnNavigateUpListener = { return false });
+ method public static inline androidx.navigation.ui.AppBarConfiguration AppBarConfiguration(android.view.Menu topLevelMenu, androidx.customview.widget.Openable? drawerLayout = null, kotlin.jvm.functions.Function0<java.lang.Boolean> fallbackOnNavigateUpListener = { return false });
+ method public static inline androidx.navigation.ui.AppBarConfiguration AppBarConfiguration(java.util.Set<java.lang.Integer> topLevelDestinationIds, androidx.customview.widget.Openable? drawerLayout = null, kotlin.jvm.functions.Function0<java.lang.Boolean> fallbackOnNavigateUpListener = { return false });
}
public final class BottomNavigationViewKt {
diff --git a/navigation/navigation-ui-ktx/api/public_plus_experimental_2.3.0-alpha07.txt b/navigation/navigation-ui-ktx/api/public_plus_experimental_2.3.0-alpha07.txt
index 168f63e..b03728d 100644
--- a/navigation/navigation-ui-ktx/api/public_plus_experimental_2.3.0-alpha07.txt
+++ b/navigation/navigation-ui-ktx/api/public_plus_experimental_2.3.0-alpha07.txt
@@ -7,9 +7,9 @@
}
public final class AppBarConfigurationKt {
- method public static inline androidx.navigation.ui.AppBarConfiguration AppBarConfiguration(androidx.navigation.NavGraph navGraph, androidx.customview.widget.Openable? 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.customview.widget.Openable? 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.customview.widget.Openable? drawerLayout = null, kotlin.jvm.functions.Function0<java.lang.Boolean> fallbackOnNavigateUpListener = { false });
+ method public static inline androidx.navigation.ui.AppBarConfiguration AppBarConfiguration(androidx.navigation.NavGraph navGraph, androidx.customview.widget.Openable? drawerLayout = null, kotlin.jvm.functions.Function0<java.lang.Boolean> fallbackOnNavigateUpListener = { return false });
+ method public static inline androidx.navigation.ui.AppBarConfiguration AppBarConfiguration(android.view.Menu topLevelMenu, androidx.customview.widget.Openable? drawerLayout = null, kotlin.jvm.functions.Function0<java.lang.Boolean> fallbackOnNavigateUpListener = { return false });
+ method public static inline androidx.navigation.ui.AppBarConfiguration AppBarConfiguration(java.util.Set<java.lang.Integer> topLevelDestinationIds, androidx.customview.widget.Openable? drawerLayout = null, kotlin.jvm.functions.Function0<java.lang.Boolean> fallbackOnNavigateUpListener = { return false });
}
public final class BottomNavigationViewKt {
diff --git a/navigation/navigation-ui-ktx/api/public_plus_experimental_current.txt b/navigation/navigation-ui-ktx/api/public_plus_experimental_current.txt
index 168f63e..b03728d 100644
--- a/navigation/navigation-ui-ktx/api/public_plus_experimental_current.txt
+++ b/navigation/navigation-ui-ktx/api/public_plus_experimental_current.txt
@@ -7,9 +7,9 @@
}
public final class AppBarConfigurationKt {
- method public static inline androidx.navigation.ui.AppBarConfiguration AppBarConfiguration(androidx.navigation.NavGraph navGraph, androidx.customview.widget.Openable? 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.customview.widget.Openable? 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.customview.widget.Openable? drawerLayout = null, kotlin.jvm.functions.Function0<java.lang.Boolean> fallbackOnNavigateUpListener = { false });
+ method public static inline androidx.navigation.ui.AppBarConfiguration AppBarConfiguration(androidx.navigation.NavGraph navGraph, androidx.customview.widget.Openable? drawerLayout = null, kotlin.jvm.functions.Function0<java.lang.Boolean> fallbackOnNavigateUpListener = { return false });
+ method public static inline androidx.navigation.ui.AppBarConfiguration AppBarConfiguration(android.view.Menu topLevelMenu, androidx.customview.widget.Openable? drawerLayout = null, kotlin.jvm.functions.Function0<java.lang.Boolean> fallbackOnNavigateUpListener = { return false });
+ method public static inline androidx.navigation.ui.AppBarConfiguration AppBarConfiguration(java.util.Set<java.lang.Integer> topLevelDestinationIds, androidx.customview.widget.Openable? drawerLayout = null, kotlin.jvm.functions.Function0<java.lang.Boolean> fallbackOnNavigateUpListener = { return false });
}
public final class BottomNavigationViewKt {
diff --git a/navigation/navigation-ui-ktx/api/restricted_2.3.0-alpha07.txt b/navigation/navigation-ui-ktx/api/restricted_2.3.0-alpha07.txt
index 168f63e..b03728d 100644
--- a/navigation/navigation-ui-ktx/api/restricted_2.3.0-alpha07.txt
+++ b/navigation/navigation-ui-ktx/api/restricted_2.3.0-alpha07.txt
@@ -7,9 +7,9 @@
}
public final class AppBarConfigurationKt {
- method public static inline androidx.navigation.ui.AppBarConfiguration AppBarConfiguration(androidx.navigation.NavGraph navGraph, androidx.customview.widget.Openable? 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.customview.widget.Openable? 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.customview.widget.Openable? drawerLayout = null, kotlin.jvm.functions.Function0<java.lang.Boolean> fallbackOnNavigateUpListener = { false });
+ method public static inline androidx.navigation.ui.AppBarConfiguration AppBarConfiguration(androidx.navigation.NavGraph navGraph, androidx.customview.widget.Openable? drawerLayout = null, kotlin.jvm.functions.Function0<java.lang.Boolean> fallbackOnNavigateUpListener = { return false });
+ method public static inline androidx.navigation.ui.AppBarConfiguration AppBarConfiguration(android.view.Menu topLevelMenu, androidx.customview.widget.Openable? drawerLayout = null, kotlin.jvm.functions.Function0<java.lang.Boolean> fallbackOnNavigateUpListener = { return false });
+ method public static inline androidx.navigation.ui.AppBarConfiguration AppBarConfiguration(java.util.Set<java.lang.Integer> topLevelDestinationIds, androidx.customview.widget.Openable? drawerLayout = null, kotlin.jvm.functions.Function0<java.lang.Boolean> fallbackOnNavigateUpListener = { return false });
}
public final class BottomNavigationViewKt {
diff --git a/navigation/navigation-ui-ktx/api/restricted_current.txt b/navigation/navigation-ui-ktx/api/restricted_current.txt
index 168f63e..b03728d 100644
--- a/navigation/navigation-ui-ktx/api/restricted_current.txt
+++ b/navigation/navigation-ui-ktx/api/restricted_current.txt
@@ -7,9 +7,9 @@
}
public final class AppBarConfigurationKt {
- method public static inline androidx.navigation.ui.AppBarConfiguration AppBarConfiguration(androidx.navigation.NavGraph navGraph, androidx.customview.widget.Openable? 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.customview.widget.Openable? 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.customview.widget.Openable? drawerLayout = null, kotlin.jvm.functions.Function0<java.lang.Boolean> fallbackOnNavigateUpListener = { false });
+ method public static inline androidx.navigation.ui.AppBarConfiguration AppBarConfiguration(androidx.navigation.NavGraph navGraph, androidx.customview.widget.Openable? drawerLayout = null, kotlin.jvm.functions.Function0<java.lang.Boolean> fallbackOnNavigateUpListener = { return false });
+ method public static inline androidx.navigation.ui.AppBarConfiguration AppBarConfiguration(android.view.Menu topLevelMenu, androidx.customview.widget.Openable? drawerLayout = null, kotlin.jvm.functions.Function0<java.lang.Boolean> fallbackOnNavigateUpListener = { return false });
+ method public static inline androidx.navigation.ui.AppBarConfiguration AppBarConfiguration(java.util.Set<java.lang.Integer> topLevelDestinationIds, androidx.customview.widget.Openable? drawerLayout = null, kotlin.jvm.functions.Function0<java.lang.Boolean> fallbackOnNavigateUpListener = { return false });
}
public final class BottomNavigationViewKt {
diff --git a/paging/common/api/3.0.0-alpha01.txt b/paging/common/api/3.0.0-alpha01.txt
index 26686b0..81fa647 100644
--- a/paging/common/api/3.0.0-alpha01.txt
+++ b/paging/common/api/3.0.0-alpha01.txt
@@ -37,6 +37,9 @@
method @AnyThread public void onInvalidated();
}
+ public @interface ExperimentalPagingApi {
+ }
+
@Deprecated public abstract class ItemKeyedDataSource<Key, Value> extends androidx.paging.DataSource<Key,Value> {
ctor @Deprecated public ItemKeyedDataSource();
method @Deprecated public abstract Key getKey(Value item);
@@ -74,21 +77,20 @@
public abstract sealed class LoadState {
method public final boolean getEndOfPaginationReached();
+ method public final boolean isFromMediator();
}
public static final class LoadState.Error extends androidx.paging.LoadState {
- ctor public LoadState.Error(Throwable error);
- method public Throwable component1();
- method public androidx.paging.LoadState.Error copy(Throwable error);
+ ctor public LoadState.Error(Throwable error, boolean fromMediator);
method public Throwable getError();
}
public static final class LoadState.Loading extends androidx.paging.LoadState {
- field public static final androidx.paging.LoadState.Loading! INSTANCE;
+ ctor public LoadState.Loading(boolean fromMediator);
}
public static final class LoadState.NotLoading extends androidx.paging.LoadState {
- ctor public LoadState.NotLoading(boolean endOfPaginationReached);
+ ctor public LoadState.NotLoading(boolean endOfPaginationReached, boolean fromMediator);
}
public enum LoadType {
@@ -265,9 +267,9 @@
ctor public PagingSource();
method public final boolean getInvalid();
method public boolean getJumpingSupported();
- method public Key? getRefreshKey(androidx.paging.PagingState<Key,Value> state);
+ method @androidx.paging.ExperimentalPagingApi public Key? getRefreshKey(androidx.paging.PagingState<Key,Value> state);
method public void invalidate();
- method public abstract suspend Object load(androidx.paging.PagingSource.LoadParams<Key> params, kotlin.coroutines.Continuation<? super androidx.paging.PagingSource.LoadResult<Key,Value>> p);
+ method public abstract suspend Object? load(androidx.paging.PagingSource.LoadParams<Key> params, kotlin.coroutines.Continuation<? super androidx.paging.PagingSource.LoadResult<Key,Value>> p);
method public final void registerInvalidatedCallback(kotlin.jvm.functions.Function0<kotlin.Unit> onInvalidatedCallback);
method public final void unregisterInvalidatedCallback(kotlin.jvm.functions.Function0<kotlin.Unit> onInvalidatedCallback);
property public final boolean invalid;
@@ -375,10 +377,10 @@
field @Deprecated public final int startPosition;
}
- public abstract class RemoteMediator<Key, Value> {
+ @androidx.paging.ExperimentalPagingApi public abstract class RemoteMediator<Key, Value> {
ctor public RemoteMediator();
- method public suspend Object initialize(kotlin.coroutines.Continuation<? super androidx.paging.RemoteMediator.InitializeAction> $completion);
- method public abstract suspend Object load(androidx.paging.LoadType loadType, androidx.paging.PagingState<Key,Value> state, kotlin.coroutines.Continuation<? super androidx.paging.RemoteMediator.MediatorResult> p);
+ method public suspend Object? initialize(kotlin.coroutines.Continuation<? super androidx.paging.RemoteMediator.InitializeAction> $completion);
+ method public abstract suspend Object? load(androidx.paging.LoadType loadType, androidx.paging.PagingState<Key,Value> state, kotlin.coroutines.Continuation<? super androidx.paging.RemoteMediator.MediatorResult> p);
}
public enum RemoteMediator.InitializeAction {
diff --git a/paging/common/api/current.txt b/paging/common/api/current.txt
index 26686b0..81fa647 100644
--- a/paging/common/api/current.txt
+++ b/paging/common/api/current.txt
@@ -37,6 +37,9 @@
method @AnyThread public void onInvalidated();
}
+ public @interface ExperimentalPagingApi {
+ }
+
@Deprecated public abstract class ItemKeyedDataSource<Key, Value> extends androidx.paging.DataSource<Key,Value> {
ctor @Deprecated public ItemKeyedDataSource();
method @Deprecated public abstract Key getKey(Value item);
@@ -74,21 +77,20 @@
public abstract sealed class LoadState {
method public final boolean getEndOfPaginationReached();
+ method public final boolean isFromMediator();
}
public static final class LoadState.Error extends androidx.paging.LoadState {
- ctor public LoadState.Error(Throwable error);
- method public Throwable component1();
- method public androidx.paging.LoadState.Error copy(Throwable error);
+ ctor public LoadState.Error(Throwable error, boolean fromMediator);
method public Throwable getError();
}
public static final class LoadState.Loading extends androidx.paging.LoadState {
- field public static final androidx.paging.LoadState.Loading! INSTANCE;
+ ctor public LoadState.Loading(boolean fromMediator);
}
public static final class LoadState.NotLoading extends androidx.paging.LoadState {
- ctor public LoadState.NotLoading(boolean endOfPaginationReached);
+ ctor public LoadState.NotLoading(boolean endOfPaginationReached, boolean fromMediator);
}
public enum LoadType {
@@ -265,9 +267,9 @@
ctor public PagingSource();
method public final boolean getInvalid();
method public boolean getJumpingSupported();
- method public Key? getRefreshKey(androidx.paging.PagingState<Key,Value> state);
+ method @androidx.paging.ExperimentalPagingApi public Key? getRefreshKey(androidx.paging.PagingState<Key,Value> state);
method public void invalidate();
- method public abstract suspend Object load(androidx.paging.PagingSource.LoadParams<Key> params, kotlin.coroutines.Continuation<? super androidx.paging.PagingSource.LoadResult<Key,Value>> p);
+ method public abstract suspend Object? load(androidx.paging.PagingSource.LoadParams<Key> params, kotlin.coroutines.Continuation<? super androidx.paging.PagingSource.LoadResult<Key,Value>> p);
method public final void registerInvalidatedCallback(kotlin.jvm.functions.Function0<kotlin.Unit> onInvalidatedCallback);
method public final void unregisterInvalidatedCallback(kotlin.jvm.functions.Function0<kotlin.Unit> onInvalidatedCallback);
property public final boolean invalid;
@@ -375,10 +377,10 @@
field @Deprecated public final int startPosition;
}
- public abstract class RemoteMediator<Key, Value> {
+ @androidx.paging.ExperimentalPagingApi public abstract class RemoteMediator<Key, Value> {
ctor public RemoteMediator();
- method public suspend Object initialize(kotlin.coroutines.Continuation<? super androidx.paging.RemoteMediator.InitializeAction> $completion);
- method public abstract suspend Object load(androidx.paging.LoadType loadType, androidx.paging.PagingState<Key,Value> state, kotlin.coroutines.Continuation<? super androidx.paging.RemoteMediator.MediatorResult> p);
+ method public suspend Object? initialize(kotlin.coroutines.Continuation<? super androidx.paging.RemoteMediator.InitializeAction> $completion);
+ method public abstract suspend Object? load(androidx.paging.LoadType loadType, androidx.paging.PagingState<Key,Value> state, kotlin.coroutines.Continuation<? super androidx.paging.RemoteMediator.MediatorResult> p);
}
public enum RemoteMediator.InitializeAction {
diff --git a/paging/common/api/public_plus_experimental_3.0.0-alpha01.txt b/paging/common/api/public_plus_experimental_3.0.0-alpha01.txt
index 26686b0..81fa647 100644
--- a/paging/common/api/public_plus_experimental_3.0.0-alpha01.txt
+++ b/paging/common/api/public_plus_experimental_3.0.0-alpha01.txt
@@ -37,6 +37,9 @@
method @AnyThread public void onInvalidated();
}
+ public @interface ExperimentalPagingApi {
+ }
+
@Deprecated public abstract class ItemKeyedDataSource<Key, Value> extends androidx.paging.DataSource<Key,Value> {
ctor @Deprecated public ItemKeyedDataSource();
method @Deprecated public abstract Key getKey(Value item);
@@ -74,21 +77,20 @@
public abstract sealed class LoadState {
method public final boolean getEndOfPaginationReached();
+ method public final boolean isFromMediator();
}
public static final class LoadState.Error extends androidx.paging.LoadState {
- ctor public LoadState.Error(Throwable error);
- method public Throwable component1();
- method public androidx.paging.LoadState.Error copy(Throwable error);
+ ctor public LoadState.Error(Throwable error, boolean fromMediator);
method public Throwable getError();
}
public static final class LoadState.Loading extends androidx.paging.LoadState {
- field public static final androidx.paging.LoadState.Loading! INSTANCE;
+ ctor public LoadState.Loading(boolean fromMediator);
}
public static final class LoadState.NotLoading extends androidx.paging.LoadState {
- ctor public LoadState.NotLoading(boolean endOfPaginationReached);
+ ctor public LoadState.NotLoading(boolean endOfPaginationReached, boolean fromMediator);
}
public enum LoadType {
@@ -265,9 +267,9 @@
ctor public PagingSource();
method public final boolean getInvalid();
method public boolean getJumpingSupported();
- method public Key? getRefreshKey(androidx.paging.PagingState<Key,Value> state);
+ method @androidx.paging.ExperimentalPagingApi public Key? getRefreshKey(androidx.paging.PagingState<Key,Value> state);
method public void invalidate();
- method public abstract suspend Object load(androidx.paging.PagingSource.LoadParams<Key> params, kotlin.coroutines.Continuation<? super androidx.paging.PagingSource.LoadResult<Key,Value>> p);
+ method public abstract suspend Object? load(androidx.paging.PagingSource.LoadParams<Key> params, kotlin.coroutines.Continuation<? super androidx.paging.PagingSource.LoadResult<Key,Value>> p);
method public final void registerInvalidatedCallback(kotlin.jvm.functions.Function0<kotlin.Unit> onInvalidatedCallback);
method public final void unregisterInvalidatedCallback(kotlin.jvm.functions.Function0<kotlin.Unit> onInvalidatedCallback);
property public final boolean invalid;
@@ -375,10 +377,10 @@
field @Deprecated public final int startPosition;
}
- public abstract class RemoteMediator<Key, Value> {
+ @androidx.paging.ExperimentalPagingApi public abstract class RemoteMediator<Key, Value> {
ctor public RemoteMediator();
- method public suspend Object initialize(kotlin.coroutines.Continuation<? super androidx.paging.RemoteMediator.InitializeAction> $completion);
- method public abstract suspend Object load(androidx.paging.LoadType loadType, androidx.paging.PagingState<Key,Value> state, kotlin.coroutines.Continuation<? super androidx.paging.RemoteMediator.MediatorResult> p);
+ method public suspend Object? initialize(kotlin.coroutines.Continuation<? super androidx.paging.RemoteMediator.InitializeAction> $completion);
+ method public abstract suspend Object? load(androidx.paging.LoadType loadType, androidx.paging.PagingState<Key,Value> state, kotlin.coroutines.Continuation<? super androidx.paging.RemoteMediator.MediatorResult> p);
}
public enum RemoteMediator.InitializeAction {
diff --git a/paging/common/api/public_plus_experimental_current.txt b/paging/common/api/public_plus_experimental_current.txt
index 26686b0..81fa647 100644
--- a/paging/common/api/public_plus_experimental_current.txt
+++ b/paging/common/api/public_plus_experimental_current.txt
@@ -37,6 +37,9 @@
method @AnyThread public void onInvalidated();
}
+ public @interface ExperimentalPagingApi {
+ }
+
@Deprecated public abstract class ItemKeyedDataSource<Key, Value> extends androidx.paging.DataSource<Key,Value> {
ctor @Deprecated public ItemKeyedDataSource();
method @Deprecated public abstract Key getKey(Value item);
@@ -74,21 +77,20 @@
public abstract sealed class LoadState {
method public final boolean getEndOfPaginationReached();
+ method public final boolean isFromMediator();
}
public static final class LoadState.Error extends androidx.paging.LoadState {
- ctor public LoadState.Error(Throwable error);
- method public Throwable component1();
- method public androidx.paging.LoadState.Error copy(Throwable error);
+ ctor public LoadState.Error(Throwable error, boolean fromMediator);
method public Throwable getError();
}
public static final class LoadState.Loading extends androidx.paging.LoadState {
- field public static final androidx.paging.LoadState.Loading! INSTANCE;
+ ctor public LoadState.Loading(boolean fromMediator);
}
public static final class LoadState.NotLoading extends androidx.paging.LoadState {
- ctor public LoadState.NotLoading(boolean endOfPaginationReached);
+ ctor public LoadState.NotLoading(boolean endOfPaginationReached, boolean fromMediator);
}
public enum LoadType {
@@ -265,9 +267,9 @@
ctor public PagingSource();
method public final boolean getInvalid();
method public boolean getJumpingSupported();
- method public Key? getRefreshKey(androidx.paging.PagingState<Key,Value> state);
+ method @androidx.paging.ExperimentalPagingApi public Key? getRefreshKey(androidx.paging.PagingState<Key,Value> state);
method public void invalidate();
- method public abstract suspend Object load(androidx.paging.PagingSource.LoadParams<Key> params, kotlin.coroutines.Continuation<? super androidx.paging.PagingSource.LoadResult<Key,Value>> p);
+ method public abstract suspend Object? load(androidx.paging.PagingSource.LoadParams<Key> params, kotlin.coroutines.Continuation<? super androidx.paging.PagingSource.LoadResult<Key,Value>> p);
method public final void registerInvalidatedCallback(kotlin.jvm.functions.Function0<kotlin.Unit> onInvalidatedCallback);
method public final void unregisterInvalidatedCallback(kotlin.jvm.functions.Function0<kotlin.Unit> onInvalidatedCallback);
property public final boolean invalid;
@@ -375,10 +377,10 @@
field @Deprecated public final int startPosition;
}
- public abstract class RemoteMediator<Key, Value> {
+ @androidx.paging.ExperimentalPagingApi public abstract class RemoteMediator<Key, Value> {
ctor public RemoteMediator();
- method public suspend Object initialize(kotlin.coroutines.Continuation<? super androidx.paging.RemoteMediator.InitializeAction> $completion);
- method public abstract suspend Object load(androidx.paging.LoadType loadType, androidx.paging.PagingState<Key,Value> state, kotlin.coroutines.Continuation<? super androidx.paging.RemoteMediator.MediatorResult> p);
+ method public suspend Object? initialize(kotlin.coroutines.Continuation<? super androidx.paging.RemoteMediator.InitializeAction> $completion);
+ method public abstract suspend Object? load(androidx.paging.LoadType loadType, androidx.paging.PagingState<Key,Value> state, kotlin.coroutines.Continuation<? super androidx.paging.RemoteMediator.MediatorResult> p);
}
public enum RemoteMediator.InitializeAction {
diff --git a/paging/common/api/restricted_3.0.0-alpha01.txt b/paging/common/api/restricted_3.0.0-alpha01.txt
index 26686b0..81fa647 100644
--- a/paging/common/api/restricted_3.0.0-alpha01.txt
+++ b/paging/common/api/restricted_3.0.0-alpha01.txt
@@ -37,6 +37,9 @@
method @AnyThread public void onInvalidated();
}
+ public @interface ExperimentalPagingApi {
+ }
+
@Deprecated public abstract class ItemKeyedDataSource<Key, Value> extends androidx.paging.DataSource<Key,Value> {
ctor @Deprecated public ItemKeyedDataSource();
method @Deprecated public abstract Key getKey(Value item);
@@ -74,21 +77,20 @@
public abstract sealed class LoadState {
method public final boolean getEndOfPaginationReached();
+ method public final boolean isFromMediator();
}
public static final class LoadState.Error extends androidx.paging.LoadState {
- ctor public LoadState.Error(Throwable error);
- method public Throwable component1();
- method public androidx.paging.LoadState.Error copy(Throwable error);
+ ctor public LoadState.Error(Throwable error, boolean fromMediator);
method public Throwable getError();
}
public static final class LoadState.Loading extends androidx.paging.LoadState {
- field public static final androidx.paging.LoadState.Loading! INSTANCE;
+ ctor public LoadState.Loading(boolean fromMediator);
}
public static final class LoadState.NotLoading extends androidx.paging.LoadState {
- ctor public LoadState.NotLoading(boolean endOfPaginationReached);
+ ctor public LoadState.NotLoading(boolean endOfPaginationReached, boolean fromMediator);
}
public enum LoadType {
@@ -265,9 +267,9 @@
ctor public PagingSource();
method public final boolean getInvalid();
method public boolean getJumpingSupported();
- method public Key? getRefreshKey(androidx.paging.PagingState<Key,Value> state);
+ method @androidx.paging.ExperimentalPagingApi public Key? getRefreshKey(androidx.paging.PagingState<Key,Value> state);
method public void invalidate();
- method public abstract suspend Object load(androidx.paging.PagingSource.LoadParams<Key> params, kotlin.coroutines.Continuation<? super androidx.paging.PagingSource.LoadResult<Key,Value>> p);
+ method public abstract suspend Object? load(androidx.paging.PagingSource.LoadParams<Key> params, kotlin.coroutines.Continuation<? super androidx.paging.PagingSource.LoadResult<Key,Value>> p);
method public final void registerInvalidatedCallback(kotlin.jvm.functions.Function0<kotlin.Unit> onInvalidatedCallback);
method public final void unregisterInvalidatedCallback(kotlin.jvm.functions.Function0<kotlin.Unit> onInvalidatedCallback);
property public final boolean invalid;
@@ -375,10 +377,10 @@
field @Deprecated public final int startPosition;
}
- public abstract class RemoteMediator<Key, Value> {
+ @androidx.paging.ExperimentalPagingApi public abstract class RemoteMediator<Key, Value> {
ctor public RemoteMediator();
- method public suspend Object initialize(kotlin.coroutines.Continuation<? super androidx.paging.RemoteMediator.InitializeAction> $completion);
- method public abstract suspend Object load(androidx.paging.LoadType loadType, androidx.paging.PagingState<Key,Value> state, kotlin.coroutines.Continuation<? super androidx.paging.RemoteMediator.MediatorResult> p);
+ method public suspend Object? initialize(kotlin.coroutines.Continuation<? super androidx.paging.RemoteMediator.InitializeAction> $completion);
+ method public abstract suspend Object? load(androidx.paging.LoadType loadType, androidx.paging.PagingState<Key,Value> state, kotlin.coroutines.Continuation<? super androidx.paging.RemoteMediator.MediatorResult> p);
}
public enum RemoteMediator.InitializeAction {
diff --git a/paging/common/api/restricted_current.txt b/paging/common/api/restricted_current.txt
index 26686b0..81fa647 100644
--- a/paging/common/api/restricted_current.txt
+++ b/paging/common/api/restricted_current.txt
@@ -37,6 +37,9 @@
method @AnyThread public void onInvalidated();
}
+ public @interface ExperimentalPagingApi {
+ }
+
@Deprecated public abstract class ItemKeyedDataSource<Key, Value> extends androidx.paging.DataSource<Key,Value> {
ctor @Deprecated public ItemKeyedDataSource();
method @Deprecated public abstract Key getKey(Value item);
@@ -74,21 +77,20 @@
public abstract sealed class LoadState {
method public final boolean getEndOfPaginationReached();
+ method public final boolean isFromMediator();
}
public static final class LoadState.Error extends androidx.paging.LoadState {
- ctor public LoadState.Error(Throwable error);
- method public Throwable component1();
- method public androidx.paging.LoadState.Error copy(Throwable error);
+ ctor public LoadState.Error(Throwable error, boolean fromMediator);
method public Throwable getError();
}
public static final class LoadState.Loading extends androidx.paging.LoadState {
- field public static final androidx.paging.LoadState.Loading! INSTANCE;
+ ctor public LoadState.Loading(boolean fromMediator);
}
public static final class LoadState.NotLoading extends androidx.paging.LoadState {
- ctor public LoadState.NotLoading(boolean endOfPaginationReached);
+ ctor public LoadState.NotLoading(boolean endOfPaginationReached, boolean fromMediator);
}
public enum LoadType {
@@ -265,9 +267,9 @@
ctor public PagingSource();
method public final boolean getInvalid();
method public boolean getJumpingSupported();
- method public Key? getRefreshKey(androidx.paging.PagingState<Key,Value> state);
+ method @androidx.paging.ExperimentalPagingApi public Key? getRefreshKey(androidx.paging.PagingState<Key,Value> state);
method public void invalidate();
- method public abstract suspend Object load(androidx.paging.PagingSource.LoadParams<Key> params, kotlin.coroutines.Continuation<? super androidx.paging.PagingSource.LoadResult<Key,Value>> p);
+ method public abstract suspend Object? load(androidx.paging.PagingSource.LoadParams<Key> params, kotlin.coroutines.Continuation<? super androidx.paging.PagingSource.LoadResult<Key,Value>> p);
method public final void registerInvalidatedCallback(kotlin.jvm.functions.Function0<kotlin.Unit> onInvalidatedCallback);
method public final void unregisterInvalidatedCallback(kotlin.jvm.functions.Function0<kotlin.Unit> onInvalidatedCallback);
property public final boolean invalid;
@@ -375,10 +377,10 @@
field @Deprecated public final int startPosition;
}
- public abstract class RemoteMediator<Key, Value> {
+ @androidx.paging.ExperimentalPagingApi public abstract class RemoteMediator<Key, Value> {
ctor public RemoteMediator();
- method public suspend Object initialize(kotlin.coroutines.Continuation<? super androidx.paging.RemoteMediator.InitializeAction> $completion);
- method public abstract suspend Object load(androidx.paging.LoadType loadType, androidx.paging.PagingState<Key,Value> state, kotlin.coroutines.Continuation<? super androidx.paging.RemoteMediator.MediatorResult> p);
+ method public suspend Object? initialize(kotlin.coroutines.Continuation<? super androidx.paging.RemoteMediator.InitializeAction> $completion);
+ method public abstract suspend Object? load(androidx.paging.LoadType loadType, androidx.paging.PagingState<Key,Value> state, kotlin.coroutines.Continuation<? super androidx.paging.RemoteMediator.MediatorResult> p);
}
public enum RemoteMediator.InitializeAction {
diff --git a/paging/common/src/main/kotlin/androidx/paging/CachedPageEventFlow.kt b/paging/common/src/main/kotlin/androidx/paging/CachedPageEventFlow.kt
index 8580292..3e324fe 100644
--- a/paging/common/src/main/kotlin/androidx/paging/CachedPageEventFlow.kt
+++ b/paging/common/src/main/kotlin/androidx/paging/CachedPageEventFlow.kt
@@ -202,7 +202,11 @@
}
private fun handlePageDrop(event: PageEvent.Drop<T>) {
- loadStates[event.loadType] = LoadState.NotLoading(endOfPaginationReached = false)
+ val previousState = loadStates[event.loadType]
+ loadStates[event.loadType] = LoadState.NotLoading(
+ endOfPaginationReached = false,
+ fromMediator = previousState?.fromMediator == true
+ )
when (event.loadType) {
LoadType.PREPEND -> {
@@ -262,7 +266,7 @@
)
} else {
loadStates.forEach { entry ->
- if (entry.value == LoadState.Loading || entry.value is LoadState.Error) {
+ if (entry.value is LoadState.Loading || entry.value is LoadState.Error) {
events.add(PageEvent.LoadStateUpdate(entry.key, entry.value))
}
}
diff --git a/paging/common/src/main/kotlin/androidx/paging/ContiguousPagedList.kt b/paging/common/src/main/kotlin/androidx/paging/ContiguousPagedList.kt
index 8b1cfe8..75aca57 100644
--- a/paging/common/src/main/kotlin/androidx/paging/ContiguousPagedList.kt
+++ b/paging/common/src/main/kotlin/androidx/paging/ContiguousPagedList.kt
@@ -93,6 +93,7 @@
@Suppress("UNCHECKED_CAST")
override val lastKey: K?
get() {
+ @OptIn(ExperimentalPagingApi::class)
return (storage.getRefreshKeyInfo(config) as PagingState<K, V>?)
?.let { pagingSource.getRefreshKey(it) }
?: initialLastKey
diff --git a/samples/SupportTransitionDemos/src/main/java/com/example/android/support/transition/widget/FastOutSlowInInterpolator.java b/paging/common/src/main/kotlin/androidx/paging/ExperimentalPagingApi.kt
similarity index 69%
rename from samples/SupportTransitionDemos/src/main/java/com/example/android/support/transition/widget/FastOutSlowInInterpolator.java
rename to paging/common/src/main/kotlin/androidx/paging/ExperimentalPagingApi.kt
index 6cf5ba4..359a6e8 100644
--- a/samples/SupportTransitionDemos/src/main/java/com/example/android/support/transition/widget/FastOutSlowInInterpolator.java
+++ b/paging/common/src/main/kotlin/androidx/paging/ExperimentalPagingApi.kt
@@ -14,13 +14,11 @@
* limitations under the License.
*/
-package com.example.android.support.transition.widget;
+package androidx.paging
-import androidx.core.animation.PathInterpolator;
-
-class FastOutSlowInInterpolator extends PathInterpolator {
-
- FastOutSlowInInterpolator() {
- super(0.4f, 0f, 0.2f, 1f);
- }
-}
+/**
+ * Marks experimental Paging APIs, which may have known issues that would likely be solved by a
+ * source-incompatible change in newer versions of the artifact that supplies it.
+ */
+@RequiresOptIn
+annotation class ExperimentalPagingApi
\ No newline at end of file
diff --git a/paging/common/src/main/kotlin/androidx/paging/LegacyPageFetcher.kt b/paging/common/src/main/kotlin/androidx/paging/LegacyPageFetcher.kt
index 60bc683..ab51d26 100644
--- a/paging/common/src/main/kotlin/androidx/paging/LegacyPageFetcher.kt
+++ b/paging/common/src/main/kotlin/androidx/paging/LegacyPageFetcher.kt
@@ -16,6 +16,7 @@
package androidx.paging
+import androidx.paging.LoadState.Loading
import androidx.paging.LoadState.NotLoading
import androidx.paging.PagingSource.LoadParams
import kotlinx.coroutines.CoroutineDispatcher
@@ -86,7 +87,7 @@
private fun onLoadError(type: LoadType, throwable: Throwable) {
if (isDetached) return // abort!
- val state = LoadState.Error(throwable)
+ val state = LoadState.Error(throwable, fromMediator = false)
loadStateManager.setState(type, state)
}
@@ -111,7 +112,7 @@
return
}
- loadStateManager.setState(LoadType.PREPEND, LoadState.Loading)
+ loadStateManager.setState(LoadType.PREPEND, Loading.instance(fromMediator = false))
val loadParams = LoadParams.Prepend(
key,
@@ -129,7 +130,7 @@
return
}
- loadStateManager.setState(LoadType.APPEND, LoadState.Loading)
+ loadStateManager.setState(LoadType.APPEND, Loading.instance(fromMediator = false))
val loadParams = LoadParams.Append(
key,
config.pageSize,
diff --git a/paging/common/src/main/kotlin/androidx/paging/LegacyPagingSource.kt b/paging/common/src/main/kotlin/androidx/paging/LegacyPagingSource.kt
index a726700..7ab9b0c 100644
--- a/paging/common/src/main/kotlin/androidx/paging/LegacyPagingSource.kt
+++ b/paging/common/src/main/kotlin/androidx/paging/LegacyPagingSource.kt
@@ -73,6 +73,7 @@
dataSource.invalidate()
}
+ @OptIn(ExperimentalPagingApi::class)
@Suppress("UNCHECKED_CAST")
override fun getRefreshKey(state: PagingState<Key, Value>): Key? {
return when (dataSource.type) {
diff --git a/paging/common/src/main/kotlin/androidx/paging/LoadState.kt b/paging/common/src/main/kotlin/androidx/paging/LoadState.kt
index 364f431..edaf11e 100644
--- a/paging/common/src/main/kotlin/androidx/paging/LoadState.kt
+++ b/paging/common/src/main/kotlin/androidx/paging/LoadState.kt
@@ -28,9 +28,16 @@
* should continue to make requests for additional data in this direction or if it should
* halt as the end of the dataset has been reached.
*
+ * @param fromMediator `true` if this [LoadState] was generated from a request to [RemoteMediator].
+ * Otherwise `false`, when indicating the state of requests to [PagingSource.load].
+ *
* @see LoadType
*/
-sealed class LoadState(val endOfPaginationReached: Boolean) {
+sealed class LoadState(
+ val endOfPaginationReached: Boolean,
+ @get:JvmName("isFromMediator")
+ val fromMediator: Boolean
+) {
/**
* Indicates the [PagingData] is not currently loading, and no error currently observed.
*
@@ -38,42 +45,122 @@
* [LoadState] is associated with, `true` otherwise. This parameter informs [Pager] if it
* should continue to make requests for additional data in this direction or if it should
* halt as the end of the dataset has been reached.
+ *
+ * @param fromMediator `true` if this [LoadState] was generated from a request to
+ * [RemoteMediator]. Otherwise `false`, when indicating the state of requests to
+ * [PagingSource.load].
*/
- @Suppress("DataClassPrivateConstructor")
- class NotLoading constructor(
- endOfPaginationReached: Boolean
- ) : LoadState(endOfPaginationReached) {
+ class NotLoading(
+ endOfPaginationReached: Boolean,
+ fromMediator: Boolean
+ ) : LoadState(endOfPaginationReached, fromMediator) {
override fun toString(): String {
- return "NotLoading(endOfPaginationReached=$endOfPaginationReached)"
+ return "NotLoading(endOfPaginationReached=$endOfPaginationReached, " +
+ "isRemoteError=$fromMediator)"
}
override fun equals(other: Any?): Boolean {
- if (other !is NotLoading) return false
-
- return endOfPaginationReached == other.endOfPaginationReached
+ return other is NotLoading &&
+ endOfPaginationReached == other.endOfPaginationReached &&
+ fromMediator == other.fromMediator
}
override fun hashCode(): Int {
- return endOfPaginationReached.hashCode()
+ return endOfPaginationReached.hashCode() + fromMediator.hashCode()
}
internal companion object {
- val Done = NotLoading(true)
- val Idle = NotLoading(false)
+ internal fun instance(
+ endOfPaginationReached: Boolean,
+ fromMediator: Boolean
+ ): NotLoading = when {
+ fromMediator -> when {
+ endOfPaginationReached -> DoneRemote
+ else -> IdleRemote
+ }
+ else -> when {
+ endOfPaginationReached -> Done
+ else -> Idle
+ }
+ }
+
+ internal val Done = NotLoading(true, fromMediator = false)
+ internal val Idle = NotLoading(false, fromMediator = false)
+
+ @Suppress("MemberVisibilityCanBePrivate") // synthetic access
+ internal val DoneRemote = NotLoading(true, fromMediator = true)
+
+ @Suppress("MemberVisibilityCanBePrivate") // synthetic access
+ internal val IdleRemote = NotLoading(false, fromMediator = true)
}
}
/**
* Loading is in progress.
+ *
+ * @param fromMediator `true` if this [LoadState] was generated from a request to
+ * [RemoteMediator]. Otherwise `false`, when indicating the state of requests to
+ * [PagingSource.load].
*/
- object Loading : LoadState(false)
+ class Loading(fromMediator: Boolean) : LoadState(false, fromMediator) {
+ override fun toString(): String {
+ return "Loading(endOfPaginationReached=$endOfPaginationReached, " +
+ "isRemoteError=$fromMediator)"
+ }
+
+ override fun equals(other: Any?): Boolean {
+ return other is Loading &&
+ endOfPaginationReached == other.endOfPaginationReached &&
+ fromMediator == other.fromMediator
+ }
+
+ override fun hashCode(): Int {
+ return endOfPaginationReached.hashCode() + fromMediator.hashCode()
+ }
+
+ internal companion object {
+ internal fun instance(fromMediator: Boolean): Loading {
+ return if (fromMediator) Remote else Local
+ }
+
+ @Suppress("MemberVisibilityCanBePrivate") // synthetic access
+ internal val Remote = Loading(fromMediator = true)
+
+ @Suppress("MemberVisibilityCanBePrivate") // synthetic access
+ internal val Local = Loading(fromMediator = false)
+ }
+ }
/**
* Loading hit an error.
*
* @param error [Throwable] that caused the load operation to generate this error state.
*
+ * @param fromMediator `true` if this [LoadState] was generated from a request to
+ * [RemoteMediator]. Otherwise `false`, when indicating the state of requests to
+ * [PagingSource.load].
+ *
* @see androidx.paging.PagedList.retry
*/
- data class Error(val error: Throwable) : LoadState(false)
+ class Error(
+ val error: Throwable,
+ fromMediator: Boolean
+ ) : LoadState(false, fromMediator) {
+ override fun equals(other: Any?): Boolean {
+ return other is Error &&
+ endOfPaginationReached == other.endOfPaginationReached &&
+ fromMediator == other.fromMediator &&
+ error == other.error
+ }
+
+ override fun hashCode(): Int {
+ return endOfPaginationReached.hashCode() + fromMediator.hashCode() + error.hashCode()
+ }
+
+ override fun toString(): String {
+ return "Error(endOfPaginationReached=$endOfPaginationReached, " +
+ "isRemoteError=$fromMediator, " +
+ "error=$error)"
+ }
+ }
}
diff --git a/paging/common/src/main/kotlin/androidx/paging/PageEvent.kt b/paging/common/src/main/kotlin/androidx/paging/PageEvent.kt
index 64809ce..c91526a 100644
--- a/paging/common/src/main/kotlin/androidx/paging/PageEvent.kt
+++ b/paging/common/src/main/kotlin/androidx/paging/PageEvent.kt
@@ -44,8 +44,8 @@
"Prepend state defining placeholdersAfter must be > 0, but was" +
" $placeholdersAfter"
}
- require(loadStates[REFRESH] != LoadState.NotLoading(endOfPaginationReached = true)) {
- "Refresh state may not be NotLoading(endOfPaginationReached=true)"
+ require(loadStates[REFRESH]?.endOfPaginationReached != true) {
+ "Refresh state may not set endOfPaginationReached = true"
}
}
@@ -149,7 +149,7 @@
val loadState: LoadState
) : PageEvent<T>() {
init {
- require(loadState == LoadState.Loading || loadState is LoadState.Error) {
+ require(loadState is LoadState.Loading || loadState is LoadState.Error) {
"LoadStateUpdates can only be used for Loading or Error. To update loadState to " +
"Idle or Done, use Insert / Drop events."
}
diff --git a/paging/common/src/main/kotlin/androidx/paging/PageFetcher.kt b/paging/common/src/main/kotlin/androidx/paging/PageFetcher.kt
index b5830bc..d51560b 100644
--- a/paging/common/src/main/kotlin/androidx/paging/PageFetcher.kt
+++ b/paging/common/src/main/kotlin/androidx/paging/PageFetcher.kt
@@ -35,6 +35,7 @@
private val pagingSourceFactory: () -> PagingSource<Key, Value>,
private val initialKey: Key?,
private val config: PagingConfig,
+ @OptIn(ExperimentalPagingApi::class)
remoteMediator: RemoteMediator<Key, Value>? = null
) {
private val remoteMediatorAccessor = remoteMediator?.let { RemoteMediatorAccessor(it) }
@@ -56,11 +57,13 @@
val flow: Flow<PagingData<Value>> = channelFlow {
refreshChannel.asFlow()
.onStart {
+ @OptIn(ExperimentalPagingApi::class)
emit(remoteMediatorAccessor?.initialize() == LAUNCH_INITIAL_REFRESH)
}
.scan(null) { previousGeneration: PageFetcherSnapshot<Key, Value>?,
triggerRemoteRefresh ->
val pagingSource = pagingSourceFactory()
+ @OptIn(ExperimentalPagingApi::class)
val initialKey = previousGeneration?.refreshKeyInfo()
?.let { pagingSource.getRefreshKey(it) }
?: initialKey
diff --git a/paging/common/src/main/kotlin/androidx/paging/PageFetcherSnapshot.kt b/paging/common/src/main/kotlin/androidx/paging/PageFetcherSnapshot.kt
index 3c760b3..34e9cb8 100644
--- a/paging/common/src/main/kotlin/androidx/paging/PageFetcherSnapshot.kt
+++ b/paging/common/src/main/kotlin/androidx/paging/PageFetcherSnapshot.kt
@@ -157,17 +157,14 @@
@OptIn(ExperimentalCoroutinesApi::class)
hintChannel.offer(failure.viewportHint)
}
- failure is LoadError.Mediator<Key, Value> && failure.loadType == REFRESH -> {
+ failure is LoadError.Mediator<Key, Value> -> {
remoteMediatorAccessor?.run {
val pagingState = stateLock.withLock { state.currentPagingState(lastHint) }
launch {
- doBoundaryCall(this@retryLoadError, REFRESH, pagingState)
+ doBoundaryCall(this@retryLoadError, failure.loadType, pagingState)
}
}
}
- failure is LoadError.Mediator<Key, Value> -> {
- remoteMediatorAccessor?.load(this, failure.loadType, failure.state)
- }
}
}
@@ -288,7 +285,7 @@
)
private suspend fun doInitialLoad(scope: CoroutineScope, state: PagerState<Key, Value>) {
- stateLock.withLock { state.setLoading(REFRESH) }
+ stateLock.withLock { state.setLoading(REFRESH, false) }
val params = loadParams(REFRESH, initialKey)
when (val result = pagingSource.load(params)) {
@@ -339,7 +336,7 @@
is LoadResult.Error -> stateLock.withLock {
state.setHintError(
REFRESH,
- Error(result.throwable),
+ Error(result.throwable, fromMediator = false),
ViewportHint.DUMMY_VALUE
)
}
@@ -364,7 +361,7 @@
indexInPage,
pageIndex,
hintOffset
- )?.also { setLoading(loadType) }
+ )?.also { setLoading(loadType, false) }
}
}
}
@@ -394,7 +391,11 @@
}
is LoadResult.Error -> {
stateLock.withLock {
- state.setHintError(loadType, Error(result.throwable), generationalHint.hint)
+ state.setHintError(
+ loadType,
+ Error(result.throwable, fromMediator = false),
+ generationalHint.hint
+ )
}
return
}
@@ -465,14 +466,14 @@
loadType: LoadType,
pagingState: PagingState<Key, Value>
) {
- stateLock.withLock { state.setLoading(loadType) }
+ stateLock.withLock { state.setLoading(loadType, true) }
+ @OptIn(ExperimentalPagingApi::class)
when (val boundaryResult = load(coroutineScope, loadType, pagingState)) {
is RemoteMediator.MediatorResult.Error -> {
stateLock.withLock {
this@PageFetcherSnapshot.state.setBoundaryError(
loadType,
- Error(boundaryResult.throwable),
- this@PageFetcherSnapshot.lastHint
+ Error(boundaryResult.throwable, fromMediator = true)
)
}
}
@@ -491,10 +492,13 @@
}
}
- private suspend fun PagerState<Key, Value>.setLoading(loadType: LoadType) {
- if (loadStates[loadType] != Loading) {
- loadStates[loadType] = Loading
- pageEventCh.send(LoadStateUpdate(loadType, Loading))
+ private suspend fun PagerState<Key, Value>.setLoading(
+ loadType: LoadType,
+ fromMediator: Boolean
+ ) {
+ if (loadStates[loadType] != Loading.instance(fromMediator)) {
+ loadStates[loadType] = Loading.instance(fromMediator)
+ pageEventCh.send(LoadStateUpdate(loadType, Loading.instance(fromMediator)))
}
}
@@ -518,8 +522,7 @@
// DB error, NW error -> reflect NW error? configurable?
private suspend fun PagerState<Key, Value>.setBoundaryError(
loadType: LoadType,
- loadState: Error,
- hint: ViewportHint?
+ loadState: Error
) {
if (loadStates[loadType] !is Error) {
loadStates[loadType] = loadState
@@ -527,7 +530,7 @@
}
// Save the hint for retry on incoming retry signal, typically sent from user interaction.
- failedHintsByLoadType[loadType] = LoadError.Mediator(loadType, currentPagingState(hint))
+ failedHintsByLoadType[loadType] = LoadError.Mediator(loadType)
}
/**
diff --git a/paging/common/src/main/kotlin/androidx/paging/PagedList.kt b/paging/common/src/main/kotlin/androidx/paging/PagedList.kt
index 0898a0e..b8d3278 100644
--- a/paging/common/src/main/kotlin/androidx/paging/PagedList.kt
+++ b/paging/common/src/main/kotlin/androidx/paging/PagedList.kt
@@ -860,9 +860,9 @@
*/
@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
abstract class LoadStateManager {
- var refreshState: LoadState = LoadState.NotLoading(endOfPaginationReached = false)
- var startState: LoadState = LoadState.NotLoading(endOfPaginationReached = false)
- var endState: LoadState = LoadState.NotLoading(endOfPaginationReached = false)
+ var refreshState: LoadState = LoadState.NotLoading.Idle
+ var startState: LoadState = LoadState.NotLoading.Idle
+ var endState: LoadState = LoadState.NotLoading.Idle
fun setState(type: LoadType, state: LoadState) {
// deduplicate signals
diff --git a/paging/common/src/main/kotlin/androidx/paging/Pager.kt b/paging/common/src/main/kotlin/androidx/paging/Pager.kt
index a14ed76..10d37e5 100644
--- a/paging/common/src/main/kotlin/androidx/paging/Pager.kt
+++ b/paging/common/src/main/kotlin/androidx/paging/Pager.kt
@@ -25,9 +25,11 @@
* paginated data. These objects can be transformed to alter data as it loads, and presented in a
* `RecyclerView`.
*/
-class Pager<Key : Any, Value : Any> @JvmOverloads constructor(
+class Pager<Key : Any, Value : Any>
+@JvmOverloads constructor(
config: PagingConfig,
initialKey: Key? = null,
+ @OptIn(ExperimentalPagingApi::class)
remoteMediator: RemoteMediator<Key, Value>? = null,
pagingSourceFactory: () -> PagingSource<Key, Value>
) {
diff --git a/paging/common/src/main/kotlin/androidx/paging/PagerState.kt b/paging/common/src/main/kotlin/androidx/paging/PagerState.kt
index c8eadad..6a2cbb69 100644
--- a/paging/common/src/main/kotlin/androidx/paging/PagerState.kt
+++ b/paging/common/src/main/kotlin/androidx/paging/PagerState.kt
@@ -361,7 +361,6 @@
) : LoadError<Key, Value>(loadType)
internal class Mediator<Key : Any, Value : Any>(
- loadType: LoadType,
- val state: PagingState<Key, Value>
+ loadType: LoadType
) : LoadError<Key, Value>(loadType)
}
diff --git a/paging/common/src/main/kotlin/androidx/paging/PagingDataDiffer.kt b/paging/common/src/main/kotlin/androidx/paging/PagingDataDiffer.kt
index 7413a99..183140d 100644
--- a/paging/common/src/main/kotlin/androidx/paging/PagingDataDiffer.kt
+++ b/paging/common/src/main/kotlin/androidx/paging/PagingDataDiffer.kt
@@ -55,6 +55,8 @@
"Collecting from multiple PagingData concurrently is an illegal operation."
}
+ receiver = pagingData.receiver
+
try {
pagingData.flow
.collect { event ->
@@ -68,7 +70,6 @@
lastAccessedIndex = lastAccessedIndex
)
presenter = newPresenter
- receiver = pagingData.receiver
// Transform the last loadAround index from the old list to the new list
// by passing it through the DiffResult, and pass it forward as a
diff --git a/paging/common/src/main/kotlin/androidx/paging/PagingSource.kt b/paging/common/src/main/kotlin/androidx/paging/PagingSource.kt
index 3e5c3fb..8f876fc 100644
--- a/paging/common/src/main/kotlin/androidx/paging/PagingSource.kt
+++ b/paging/common/src/main/kotlin/androidx/paging/PagingSource.kt
@@ -321,6 +321,7 @@
* list of loaded pages is not empty. In the case where a refresh is triggered before the
* initial load succeeds or it errors out, the initial key passed to [Pager] will be used.
*/
+ @ExperimentalPagingApi
open fun getRefreshKey(state: PagingState<Key, Value>): Key? = null
private val onInvalidatedCallbacks = CopyOnWriteArrayList<() -> Unit>()
diff --git a/paging/common/src/main/kotlin/androidx/paging/RemoteMediator.kt b/paging/common/src/main/kotlin/androidx/paging/RemoteMediator.kt
index c379042..a1d4fa8 100644
--- a/paging/common/src/main/kotlin/androidx/paging/RemoteMediator.kt
+++ b/paging/common/src/main/kotlin/androidx/paging/RemoteMediator.kt
@@ -30,6 +30,7 @@
*
* @sample androidx.paging.samples.remoteMediatorSample
*/
+@ExperimentalPagingApi
abstract class RemoteMediator<Key : Any, Value : Any> {
/**
* Implement this method to load additional remote data, which will then be stored for the
diff --git a/paging/common/src/main/kotlin/androidx/paging/RemoteMediatorAccessor.kt b/paging/common/src/main/kotlin/androidx/paging/RemoteMediatorAccessor.kt
index a0b4cda..2822beda 100644
--- a/paging/common/src/main/kotlin/androidx/paging/RemoteMediatorAccessor.kt
+++ b/paging/common/src/main/kotlin/androidx/paging/RemoteMediatorAccessor.kt
@@ -29,6 +29,7 @@
* Usage of [RemoteMediator] within [PageFetcher] and [PageFetcherSnapshot] should always be
* accessed behind this class, which handles state tracking of active remote jobs.
*/
+@OptIn(ExperimentalPagingApi::class)
internal class RemoteMediatorAccessor<Key : Any, Value : Any>(
private val remoteMediator: RemoteMediator<Key, Value>
) {
diff --git a/paging/common/src/main/kotlin/androidx/paging/Separators.kt b/paging/common/src/main/kotlin/androidx/paging/Separators.kt
index 7027e34..d0f40b0 100644
--- a/paging/common/src/main/kotlin/androidx/paging/Separators.kt
+++ b/paging/common/src/main/kotlin/androidx/paging/Separators.kt
@@ -227,13 +227,13 @@
if (loadType == APPEND) {
startTerminalSeparatorDeferred
} else {
- loadStates[PREPEND] == LoadState.NotLoading(endOfPaginationReached = true)
+ loadStates[PREPEND]?.endOfPaginationReached == true
}
internal fun <T : Any> Insert<T>.terminatesEnd(): Boolean = if (loadType == PREPEND) {
endTerminalSeparatorDeferred
} else {
- loadStates[APPEND] == LoadState.NotLoading(endOfPaginationReached = true)
+ loadStates[APPEND]?.endOfPaginationReached == true
}
fun onInsert(event: Insert<T>): Insert<R> {
diff --git a/paging/common/src/test/kotlin/androidx/paging/ContiguousPagedListTest.kt b/paging/common/src/test/kotlin/androidx/paging/ContiguousPagedListTest.kt
index ae11e35..aac3f4b 100644
--- a/paging/common/src/test/kotlin/androidx/paging/ContiguousPagedListTest.kt
+++ b/paging/common/src/test/kotlin/androidx/paging/ContiguousPagedListTest.kt
@@ -20,8 +20,10 @@
package androidx.paging
import androidx.paging.ItemKeyedDataSourceTest.ItemDataSource
+import androidx.paging.LoadState.Error
+import androidx.paging.LoadState.Loading
+import androidx.paging.LoadState.NotLoading
import androidx.paging.LoadType.APPEND
-import androidx.paging.LoadType.REFRESH
import androidx.paging.LoadType.PREPEND
import androidx.paging.PagedList.BoundaryCallback
import androidx.paging.PagedList.Callback
@@ -62,6 +64,7 @@
*/
private inner class TestPagingSource(val listData: List<Item> = ITEMS) :
PagingSource<Int, Item>() {
+ @OptIn(ExperimentalPagingApi::class)
override fun getRefreshKey(state: PagingState<Int, Item>): Int? {
return state.anchorPosition
?.let { anchorPosition -> state.closestItemToPosition(anchorPosition)?.pos }
@@ -600,7 +603,12 @@
// No loading going on currently
assertEquals(
- listOf(StateChange(APPEND, LoadState.NotLoading(endOfPaginationReached = false))),
+ listOf(
+ StateChange(
+ APPEND,
+ NotLoading(endOfPaginationReached = false, fromMediator = false)
+ )
+ ),
states.getAllAndClear()
)
verifyRange(0, 40, pagedList)
@@ -609,7 +617,7 @@
pagedList.loadAround(35)
mainThread.executeAll()
assertEquals(
- listOf(StateChange(APPEND, LoadState.Loading)),
+ listOf(StateChange(APPEND, Loading(fromMediator = false))),
states.getAllAndClear()
)
verifyRange(0, 40, pagedList)
@@ -617,7 +625,12 @@
// load finishes
drain()
assertEquals(
- listOf(StateChange(APPEND, LoadState.NotLoading(endOfPaginationReached = false))),
+ listOf(
+ StateChange(
+ APPEND,
+ NotLoading(endOfPaginationReached = false, fromMediator = false)
+ )
+ ),
states.getAllAndClear()
)
verifyRange(0, 60, pagedList)
@@ -628,7 +641,7 @@
pagedList.loadAround(55)
mainThread.executeAll()
assertEquals(
- listOf(StateChange(APPEND, LoadState.Loading)),
+ listOf(StateChange(APPEND, Loading(fromMediator = false))),
states.getAllAndClear()
)
verifyRange(0, 60, pagedList)
@@ -636,7 +649,7 @@
// load now in error state
drain()
assertEquals(
- listOf(StateChange(APPEND, LoadState.Error(EXCEPTION))),
+ listOf(StateChange(APPEND, Error(EXCEPTION, fromMediator = false))),
states.getAllAndClear()
)
verifyRange(0, 60, pagedList)
@@ -645,14 +658,19 @@
pagedList.retry()
mainThread.executeAll()
assertEquals(
- listOf(StateChange(APPEND, LoadState.Loading)),
+ listOf(StateChange(APPEND, Loading(fromMediator = false))),
states.getAllAndClear()
)
// load finishes
drain()
assertEquals(
- listOf(StateChange(APPEND, LoadState.NotLoading(endOfPaginationReached = false))),
+ listOf(
+ StateChange(
+ APPEND,
+ NotLoading(endOfPaginationReached = false, fromMediator = false)
+ )
+ ),
states.getAllAndClear()
)
verifyRange(0, 80, pagedList)
@@ -677,9 +695,15 @@
verifyRange(1, 3, pagedList)
assertEquals(
listOf(
- StateChange(PREPEND, LoadState.NotLoading(endOfPaginationReached = false)),
- StateChange(PREPEND, LoadState.Loading),
- StateChange(PREPEND, LoadState.NotLoading(endOfPaginationReached = false))
+ StateChange(
+ PREPEND,
+ NotLoading(endOfPaginationReached = false, fromMediator = false)
+ ),
+ StateChange(PREPEND, Loading(fromMediator = false)),
+ StateChange(
+ PREPEND,
+ NotLoading(endOfPaginationReached = false, fromMediator = false)
+ )
),
states.getAllAndClear()
)
@@ -691,8 +715,8 @@
verifyRange(1, 3, pagedList)
assertEquals(
listOf(
- StateChange(PREPEND, LoadState.Loading),
- StateChange(PREPEND, LoadState.Error(EXCEPTION))
+ StateChange(PREPEND, Loading(fromMediator = false)),
+ StateChange(PREPEND, Error(EXCEPTION, fromMediator = false))
),
states.getAllAndClear()
)
@@ -701,7 +725,12 @@
pagedList.loadAround(if (placeholdersEnabled) 3 else 2)
drain()
assertEquals(
- listOf(StateChange(PREPEND, LoadState.NotLoading(endOfPaginationReached = false))),
+ listOf(
+ StateChange(
+ PREPEND,
+ NotLoading(endOfPaginationReached = false, fromMediator = false)
+ )
+ ),
states.getAllAndClear()
)
verifyRange(2, 3, pagedList)
@@ -726,9 +755,15 @@
verifyRange(1, 3, pagedList)
assertEquals(
listOf(
- StateChange(APPEND, LoadState.NotLoading(endOfPaginationReached = false)),
- StateChange(APPEND, LoadState.Loading),
- StateChange(APPEND, LoadState.NotLoading(endOfPaginationReached = false))
+ StateChange(
+ APPEND,
+ NotLoading(endOfPaginationReached = false, fromMediator = false)
+ ),
+ StateChange(APPEND, Loading(fromMediator = false)),
+ StateChange(
+ APPEND,
+ NotLoading(endOfPaginationReached = false, fromMediator = false)
+ )
),
states.getAllAndClear()
)
@@ -740,8 +775,8 @@
verifyRange(1, 3, pagedList)
assertEquals(
listOf(
- StateChange(APPEND, LoadState.Loading),
- StateChange(APPEND, LoadState.Error(EXCEPTION))
+ StateChange(APPEND, Loading(fromMediator = false)),
+ StateChange(APPEND, Error(EXCEPTION, fromMediator = false))
),
states.getAllAndClear()
)
@@ -750,7 +785,12 @@
pagedList.loadAround(if (placeholdersEnabled) 1 else 0)
drain()
assertEquals(
- listOf(StateChange(APPEND, LoadState.NotLoading(endOfPaginationReached = false))),
+ listOf(
+ StateChange(
+ APPEND,
+ NotLoading(endOfPaginationReached = false, fromMediator = false)
+ )
+ ),
states.getAllAndClear()
)
verifyRange(0, 3, pagedList)
@@ -768,9 +808,12 @@
drain()
assertEquals(
listOf(
- StateChange(APPEND, LoadState.NotLoading(endOfPaginationReached = false)),
- StateChange(APPEND, LoadState.Loading),
- StateChange(APPEND, LoadState.Error(EXCEPTION))
+ StateChange(
+ APPEND,
+ NotLoading(endOfPaginationReached = false, fromMediator = false)
+ ),
+ StateChange(APPEND, Loading(fromMediator = false)),
+ StateChange(APPEND, Error(EXCEPTION, fromMediator = false))
),
states.getAllAndClear()
)
diff --git a/paging/common/src/test/kotlin/androidx/paging/FlattenedPageEventStorageTest.kt b/paging/common/src/test/kotlin/androidx/paging/FlattenedPageEventStorageTest.kt
index 6740cfc..3b072ea 100644
--- a/paging/common/src/test/kotlin/androidx/paging/FlattenedPageEventStorageTest.kt
+++ b/paging/common/src/test/kotlin/androidx/paging/FlattenedPageEventStorageTest.kt
@@ -227,7 +227,7 @@
@Test
fun stateInInsert() {
- val error = LoadState.Error(RuntimeException("?"))
+ val error = LoadState.Error(RuntimeException("?"), fromMediator = false)
list.add(
Refresh(
pages = listOf(
@@ -238,7 +238,7 @@
placeholdersAfter = 5,
loadStates = mapOf(
REFRESH to NotLoading.Idle,
- PREPEND to Loading,
+ PREPEND to Loading(fromMediator = false),
APPEND to error
)
)
@@ -249,7 +249,7 @@
placeholdersBefore = 3,
placeholdersAfter = 5,
refreshState = NotLoading.Idle,
- startState = Loading,
+ startState = Loading(fromMediator = false),
endState = error
)
)
diff --git a/paging/common/src/test/kotlin/androidx/paging/LegacyPageFetcherTest.kt b/paging/common/src/test/kotlin/androidx/paging/LegacyPageFetcherTest.kt
index e40892c..4b1a107 100644
--- a/paging/common/src/test/kotlin/androidx/paging/LegacyPageFetcherTest.kt
+++ b/paging/common/src/test/kotlin/androidx/paging/LegacyPageFetcherTest.kt
@@ -18,6 +18,8 @@
package androidx.paging
+import androidx.paging.LoadState.Loading
+import androidx.paging.LoadState.NotLoading
import androidx.paging.LoadType.APPEND
import androidx.paging.LoadType.PREPEND
import androidx.paging.PagedList.Config
@@ -157,7 +159,7 @@
assertTrue(consumer.takeResults().isEmpty())
assertEquals(
- listOf(StateChange(APPEND, LoadState.Loading)),
+ listOf(StateChange(APPEND, Loading(fromMediator = false))),
consumer.takeStateChanges()
)
@@ -165,7 +167,12 @@
assertEquals(listOf(Result(APPEND, rangeResult(6, 8))), consumer.takeResults())
assertEquals(
- listOf(StateChange(APPEND, LoadState.NotLoading(endOfPaginationReached = false))),
+ listOf(
+ StateChange(
+ APPEND,
+ NotLoading(endOfPaginationReached = false, fromMediator = false)
+ )
+ ),
consumer.takeStateChanges()
)
}
@@ -179,7 +186,7 @@
assertTrue(consumer.takeResults().isEmpty())
assertEquals(
- listOf(StateChange(PREPEND, LoadState.Loading)),
+ listOf(StateChange(PREPEND, Loading(fromMediator = false))),
consumer.takeStateChanges()
)
@@ -190,7 +197,12 @@
consumer.takeResults()
)
assertEquals(
- listOf(StateChange(PREPEND, LoadState.NotLoading(endOfPaginationReached = false))),
+ listOf(
+ StateChange(
+ PREPEND,
+ NotLoading(endOfPaginationReached = false, fromMediator = false)
+ )
+ ),
consumer.takeStateChanges()
)
}
@@ -213,10 +225,16 @@
)
assertEquals(
listOf(
- StateChange(APPEND, LoadState.Loading),
- StateChange(APPEND, LoadState.NotLoading(endOfPaginationReached = false)),
- StateChange(APPEND, LoadState.Loading),
- StateChange(APPEND, LoadState.NotLoading(endOfPaginationReached = false))
+ StateChange(APPEND, Loading(fromMediator = false)),
+ StateChange(
+ APPEND,
+ NotLoading(endOfPaginationReached = false, fromMediator = false)
+ ),
+ StateChange(APPEND, Loading(fromMediator = false)),
+ StateChange(
+ APPEND,
+ NotLoading(endOfPaginationReached = false, fromMediator = false)
+ )
),
consumer.takeStateChanges()
)
@@ -240,10 +258,15 @@
)
assertEquals(
listOf(
- StateChange(PREPEND, LoadState.Loading),
- StateChange(PREPEND, LoadState.NotLoading(endOfPaginationReached = false)),
- StateChange(PREPEND, LoadState.Loading),
- StateChange(PREPEND, LoadState.NotLoading(endOfPaginationReached = false))
+ StateChange(PREPEND, Loading(fromMediator = false)),
+ StateChange(
+ PREPEND, NotLoading(endOfPaginationReached = false, fromMediator = false)
+ ),
+ StateChange(PREPEND, Loading(fromMediator = false)),
+ StateChange(
+ PREPEND,
+ NotLoading(endOfPaginationReached = false, fromMediator = false)
+ )
),
consumer.takeStateChanges()
)
@@ -262,7 +285,9 @@
consumer.takeResults()
)
assertEquals(
- listOf(StateChange(APPEND, LoadState.NotLoading(endOfPaginationReached = true))),
+ listOf(
+ StateChange(APPEND, NotLoading(endOfPaginationReached = true, fromMediator = false))
+ ),
consumer.takeStateChanges()
)
}
@@ -280,7 +305,12 @@
consumer.takeResults()
)
assertEquals(
- listOf(StateChange(PREPEND, LoadState.NotLoading(endOfPaginationReached = true))),
+ listOf(
+ StateChange(
+ PREPEND,
+ NotLoading(endOfPaginationReached = true, fromMediator = false)
+ )
+ ),
consumer.takeStateChanges()
)
}
diff --git a/paging/common/src/test/kotlin/androidx/paging/LegacyPagingSourceTest.kt b/paging/common/src/test/kotlin/androidx/paging/LegacyPagingSourceTest.kt
index 84851df..731e31d 100644
--- a/paging/common/src/test/kotlin/androidx/paging/LegacyPagingSourceTest.kt
+++ b/paging/common/src/test/kotlin/androidx/paging/LegacyPagingSourceTest.kt
@@ -16,7 +16,6 @@
package androidx.paging
-import androidx.paging.LoadType.REFRESH
import androidx.paging.PagingSource.LoadResult.Page
import kotlinx.coroutines.CoroutineDispatcher
import kotlinx.coroutines.GlobalScope
@@ -31,6 +30,7 @@
import kotlin.test.assertFalse
import kotlin.test.assertTrue
+@OptIn(ExperimentalPagingApi::class)
@RunWith(JUnit4::class)
class LegacyPagingSourceTest {
private val fakePagingState = PagingState(
diff --git a/paging/common/src/test/kotlin/androidx/paging/PageEventTest.kt b/paging/common/src/test/kotlin/androidx/paging/PageEventTest.kt
index 0d4ca2d..de09d2a 100644
--- a/paging/common/src/test/kotlin/androidx/paging/PageEventTest.kt
+++ b/paging/common/src/test/kotlin/androidx/paging/PageEventTest.kt
@@ -138,7 +138,10 @@
@Test
fun stateTransform() {
- val state = LoadStateUpdate<Char>(loadType = REFRESH, loadState = LoadState.Loading)
+ val state = LoadStateUpdate<Char>(
+ loadType = REFRESH,
+ loadState = LoadState.Loading(fromMediator = false)
+ )
assertSame(state, state.map { it + 1 })
assertSame(state, state.flatMap { listOf(it, it) })
diff --git a/paging/common/src/test/kotlin/androidx/paging/PageFetcherSnapshotTest.kt b/paging/common/src/test/kotlin/androidx/paging/PageFetcherSnapshotTest.kt
index 05a3bc1..d2d5726 100644
--- a/paging/common/src/test/kotlin/androidx/paging/PageFetcherSnapshotTest.kt
+++ b/paging/common/src/test/kotlin/androidx/paging/PageFetcherSnapshotTest.kt
@@ -75,9 +75,9 @@
advanceUntilIdle()
val expected: List<PageEvent<Int>> = listOf(
- LoadStateUpdate(REFRESH, Loading),
+ LoadStateUpdate(REFRESH, Loading(fromMediator = false)),
createRefresh(1..2),
- LoadStateUpdate(PREPEND, Loading),
+ LoadStateUpdate(PREPEND, Loading(fromMediator = false)),
createPrepend(
pageOffset = -1,
range = 0..0,
@@ -101,15 +101,15 @@
advanceUntilIdle()
val expected: List<PageEvent<Int>> = listOf(
- LoadStateUpdate(REFRESH, Loading),
+ LoadStateUpdate(REFRESH, Loading(fromMediator = false)),
createRefresh(1..2),
- LoadStateUpdate(PREPEND, Loading),
+ LoadStateUpdate(PREPEND, Loading(fromMediator = false)),
createPrepend(
pageOffset = -1,
range = 0..0,
startState = NotLoading.Done
),
- LoadStateUpdate(APPEND, Loading),
+ LoadStateUpdate(APPEND, Loading(fromMediator = false)),
Drop(PREPEND, 1, 1),
createAppend(
pageOffset = 1,
@@ -133,9 +133,9 @@
advanceUntilIdle()
val expected: List<PageEvent<Int>> = listOf(
- LoadStateUpdate(REFRESH, Loading),
+ LoadStateUpdate(REFRESH, Loading(fromMediator = false)),
createRefresh(range = 97..98),
- LoadStateUpdate(APPEND, Loading),
+ LoadStateUpdate(APPEND, Loading(fromMediator = false)),
createAppend(pageOffset = 1, range = 99..99, endState = NotLoading.Done)
)
@@ -155,16 +155,16 @@
advanceUntilIdle()
val expected: List<PageEvent<Int>> = listOf(
- LoadStateUpdate(REFRESH, Loading),
+ LoadStateUpdate(REFRESH, Loading(fromMediator = false)),
createRefresh(range = 97..98),
- LoadStateUpdate(APPEND, Loading),
+ LoadStateUpdate(APPEND, Loading(fromMediator = false)),
createAppend(
pageOffset = 1,
range = 99..99,
startState = NotLoading.Idle,
endState = NotLoading.Done
),
- LoadStateUpdate(PREPEND, Loading),
+ LoadStateUpdate(PREPEND, Loading(fromMediator = false)),
Drop(APPEND, 1, 1),
createPrepend(
pageOffset = -1,
@@ -186,7 +186,7 @@
advanceUntilIdle()
val expected: List<PageEvent<Int>> = listOf(
- LoadStateUpdate(REFRESH, Loading),
+ LoadStateUpdate(REFRESH, Loading(fromMediator = false)),
createRefresh(range = 0..1, startState = NotLoading.Done, endState = NotLoading.Idle)
)
@@ -202,7 +202,7 @@
advanceUntilIdle()
val expected: List<PageEvent<Int>> = listOf(
- LoadStateUpdate(REFRESH, Loading),
+ LoadStateUpdate(REFRESH, Loading(fromMediator = false)),
createRefresh(
range = 98..99,
startState = NotLoading.Idle,
@@ -222,7 +222,7 @@
advanceUntilIdle()
val expected: List<PageEvent<Int>> = listOf(
- LoadStateUpdate(REFRESH, Loading),
+ LoadStateUpdate(REFRESH, Loading(fromMediator = false)),
createRefresh(range = 50..51)
)
@@ -239,9 +239,9 @@
advanceUntilIdle()
val expected: List<PageEvent<Int>> = listOf(
- LoadStateUpdate(REFRESH, Loading),
+ LoadStateUpdate(REFRESH, Loading(fromMediator = false)),
createRefresh(range = 50..51),
- LoadStateUpdate(PREPEND, Loading),
+ LoadStateUpdate(PREPEND, Loading(fromMediator = false)),
createPrepend(pageOffset = -1, range = 49..49)
)
@@ -259,9 +259,9 @@
advanceUntilIdle()
val expected: List<PageEvent<Int>> = listOf(
- LoadStateUpdate(REFRESH, Loading),
+ LoadStateUpdate(REFRESH, Loading(fromMediator = false)),
createRefresh(range = 50..51),
- LoadStateUpdate(PREPEND, Loading),
+ LoadStateUpdate(PREPEND, Loading(fromMediator = false)),
createPrepend(pageOffset = -1, range = 49..49)
)
@@ -282,11 +282,11 @@
advanceUntilIdle()
val expected: List<PageEvent<Int>> = listOf(
- LoadStateUpdate(REFRESH, Loading),
+ LoadStateUpdate(REFRESH, Loading(fromMediator = false)),
createRefresh(range = 50..51),
- LoadStateUpdate(PREPEND, Loading),
+ LoadStateUpdate(PREPEND, Loading(fromMediator = false)),
createPrepend(pageOffset = -1, range = 49..49),
- LoadStateUpdate(PREPEND, Loading),
+ LoadStateUpdate(PREPEND, Loading(fromMediator = false)),
Drop(APPEND, 1, 50),
createPrepend(pageOffset = -2, range = 48..48)
)
@@ -317,10 +317,14 @@
advanceUntilIdle()
val expected: List<PageEvent<Int>> = listOf(
- LoadStateUpdate(REFRESH, Loading),
+ LoadStateUpdate(REFRESH, Loading(fromMediator = false)),
createRefresh(range = 50..54),
- LoadStateUpdate(PREPEND, Loading),
- createPrepend(pageOffset = -1, range = 49..49, startState = Loading),
+ LoadStateUpdate(PREPEND, Loading(fromMediator = false)),
+ createPrepend(
+ pageOffset = -1,
+ range = 49..49,
+ startState = Loading(fromMediator = false)
+ ),
createPrepend(pageOffset = -2, range = 48..48)
)
@@ -345,12 +349,12 @@
advanceUntilIdle()
val expected: List<PageEvent<Int>> = listOf(
- LoadStateUpdate(REFRESH, Loading),
+ LoadStateUpdate(REFRESH, Loading(fromMediator = false)),
createRefresh(range = 50..51),
- LoadStateUpdate(PREPEND, Loading),
+ LoadStateUpdate(PREPEND, Loading(fromMediator = false)),
createPrepend(pageOffset = -1, range = 49..49),
- LoadStateUpdate(PREPEND, Loading),
- LoadStateUpdate(APPEND, Loading),
+ LoadStateUpdate(PREPEND, Loading(fromMediator = false)),
+ LoadStateUpdate(APPEND, Loading(fromMediator = false)),
Drop(APPEND, 1, 50),
createPrepend(pageOffset = -2, range = 48..48)
)
@@ -377,10 +381,14 @@
advanceUntilIdle()
val expected: List<PageEvent<Int>> = listOf(
- LoadStateUpdate(REFRESH, Loading),
+ LoadStateUpdate(REFRESH, Loading(fromMediator = false)),
createRefresh(50..52),
- LoadStateUpdate(PREPEND, Loading),
- createPrepend(pageOffset = -1, range = 49..49, startState = Loading),
+ LoadStateUpdate(PREPEND, Loading(fromMediator = false)),
+ createPrepend(
+ pageOffset = -1,
+ range = 49..49,
+ startState = Loading(fromMediator = false)
+ ),
createPrepend(-2, 48..48)
)
@@ -398,9 +406,9 @@
advanceUntilIdle()
val expected: List<PageEvent<Int>> = listOf(
- LoadStateUpdate(REFRESH, Loading),
+ LoadStateUpdate(REFRESH, Loading(fromMediator = false)),
createRefresh(50..51),
- LoadStateUpdate(APPEND, Loading),
+ LoadStateUpdate(APPEND, Loading(fromMediator = false)),
createAppend(1, 52..52)
)
@@ -425,14 +433,14 @@
advanceUntilIdle()
val expected: List<PageEvent<Int>> = listOf(
- LoadStateUpdate(REFRESH, Loading),
+ LoadStateUpdate(REFRESH, Loading(fromMediator = false)),
createRefresh(50..52),
- LoadStateUpdate(APPEND, Loading),
+ LoadStateUpdate(APPEND, Loading(fromMediator = false)),
createAppend(
pageOffset = 1,
range = 53..53,
startState = NotLoading.Idle,
- endState = Loading
+ endState = Loading(fromMediator = false)
),
createAppend(2, 54..54)
)
@@ -453,11 +461,11 @@
advanceUntilIdle()
val expected: List<PageEvent<Int>> = listOf(
- LoadStateUpdate(REFRESH, Loading),
+ LoadStateUpdate(REFRESH, Loading(fromMediator = false)),
createRefresh(range = 50..51),
- LoadStateUpdate(APPEND, Loading),
+ LoadStateUpdate(APPEND, Loading(fromMediator = false)),
createAppend(pageOffset = 1, range = 52..52),
- LoadStateUpdate(APPEND, Loading),
+ LoadStateUpdate(APPEND, Loading(fromMediator = false)),
Drop(PREPEND, 1, 52),
createAppend(pageOffset = 2, range = 53..53)
)
@@ -487,10 +495,14 @@
advanceUntilIdle()
val expected: List<PageEvent<Int>> = listOf(
- LoadStateUpdate(REFRESH, Loading),
+ LoadStateUpdate(REFRESH, Loading(fromMediator = false)),
createRefresh(range = 50..54),
- LoadStateUpdate(APPEND, Loading),
- createAppend(pageOffset = 1, range = 55..55, endState = Loading),
+ LoadStateUpdate(APPEND, Loading(fromMediator = false)),
+ createAppend(
+ pageOffset = 1,
+ range = 55..55,
+ endState = Loading(fromMediator = false)
+ ),
createAppend(pageOffset = 2, range = 56..56)
)
@@ -515,12 +527,12 @@
advanceUntilIdle()
val expected: List<PageEvent<Int>> = listOf(
- LoadStateUpdate(REFRESH, Loading),
+ LoadStateUpdate(REFRESH, Loading(fromMediator = false)),
createRefresh(range = 50..51),
- LoadStateUpdate(APPEND, Loading),
+ LoadStateUpdate(APPEND, Loading(fromMediator = false)),
createAppend(pageOffset = 1, range = 52..52),
- LoadStateUpdate(APPEND, Loading),
- LoadStateUpdate(PREPEND, Loading),
+ LoadStateUpdate(APPEND, Loading(fromMediator = false)),
+ LoadStateUpdate(PREPEND, Loading(fromMediator = false)),
Drop(PREPEND, 1, 52),
createAppend(
pageOffset = 2,
@@ -544,11 +556,11 @@
val expected: List<List<PageEvent<Int>>> = listOf(
listOf(
- LoadStateUpdate(REFRESH, Loading),
+ LoadStateUpdate(REFRESH, Loading(fromMediator = false)),
createRefresh(50..51)
),
listOf(
- LoadStateUpdate(REFRESH, Loading),
+ LoadStateUpdate(REFRESH, Loading(fromMediator = false)),
createRefresh(50..51)
)
)
@@ -573,13 +585,13 @@
val expected: List<List<PageEvent<Int>>> = listOf(
listOf(
- LoadStateUpdate(REFRESH, Loading),
+ LoadStateUpdate(REFRESH, Loading(fromMediator = false)),
createRefresh(50..51),
- LoadStateUpdate(APPEND, Loading),
+ LoadStateUpdate(APPEND, Loading(fromMediator = false)),
createAppend(1, 52..52)
),
listOf(
- LoadStateUpdate(REFRESH, Loading),
+ LoadStateUpdate(REFRESH, Loading(fromMediator = false)),
createRefresh(51..52)
)
)
@@ -625,11 +637,11 @@
collectPagerData(pager) { pageEvents, _ ->
val expected = listOf<PageEvent<Int>>(
- LoadStateUpdate(REFRESH, Loading),
+ LoadStateUpdate(REFRESH, Loading(fromMediator = false)),
createRefresh(50..51),
- LoadStateUpdate(APPEND, Loading),
- LoadStateUpdate(APPEND, Error(LOAD_ERROR)),
- LoadStateUpdate(APPEND, Loading),
+ LoadStateUpdate(APPEND, Loading(fromMediator = false)),
+ LoadStateUpdate(APPEND, Error(LOAD_ERROR, fromMediator = false)),
+ LoadStateUpdate(APPEND, Loading(fromMediator = false)),
createAppend(1, 52..52)
)
@@ -653,9 +665,9 @@
collectPagerData(pager) { pageEvents, _ ->
val expected = listOf<PageEvent<Int>>(
- LoadStateUpdate(REFRESH, Loading),
+ LoadStateUpdate(REFRESH, Loading(fromMediator = false)),
createRefresh(50..51),
- LoadStateUpdate(APPEND, Loading),
+ LoadStateUpdate(APPEND, Loading(fromMediator = false)),
createAppend(1, 52..52)
)
@@ -678,11 +690,11 @@
collectPagerData(pager) { pageEvents, _ ->
val expected = listOf<PageEvent<Int>>(
- LoadStateUpdate(REFRESH, Loading),
+ LoadStateUpdate(REFRESH, Loading(fromMediator = false)),
createRefresh(50..51),
- LoadStateUpdate(APPEND, Loading),
- LoadStateUpdate(APPEND, Error(LOAD_ERROR)),
- LoadStateUpdate(APPEND, Loading),
+ LoadStateUpdate(APPEND, Loading(fromMediator = false)),
+ LoadStateUpdate(APPEND, Error(LOAD_ERROR, fromMediator = false)),
+ LoadStateUpdate(APPEND, Loading(fromMediator = false)),
createAppend(1, 52..52)
)
@@ -708,19 +720,19 @@
collectPagerData(pager) { pageEvents, _ ->
val expected = listOf<PageEvent<Int>>(
- LoadStateUpdate(REFRESH, Loading),
+ LoadStateUpdate(REFRESH, Loading(fromMediator = false)),
createRefresh(50..51),
- LoadStateUpdate(APPEND, Loading),
- LoadStateUpdate(APPEND, Error(LOAD_ERROR)),
- LoadStateUpdate(PREPEND, Loading),
- LoadStateUpdate(PREPEND, Error(LOAD_ERROR)),
- LoadStateUpdate(PREPEND, Loading),
- LoadStateUpdate(APPEND, Loading),
+ LoadStateUpdate(APPEND, Loading(fromMediator = false)),
+ LoadStateUpdate(APPEND, Error(LOAD_ERROR, fromMediator = false)),
+ LoadStateUpdate(PREPEND, Loading(fromMediator = false)),
+ LoadStateUpdate(PREPEND, Error(LOAD_ERROR, fromMediator = false)),
+ LoadStateUpdate(PREPEND, Loading(fromMediator = false)),
+ LoadStateUpdate(APPEND, Loading(fromMediator = false)),
createPrepend(
pageOffset = -1,
range = 49..49,
startState = NotLoading.Idle,
- endState = Loading
+ endState = Loading(fromMediator = false)
),
Drop(PREPEND, 1, 50),
createAppend(1, 52..52)
@@ -749,9 +761,9 @@
collectPagerData(pager) { pageEvents, _ ->
val expected = listOf<PageEvent<Int>>(
- LoadStateUpdate(REFRESH, Loading),
- LoadStateUpdate(REFRESH, Error(LOAD_ERROR)),
- LoadStateUpdate(REFRESH, Loading),
+ LoadStateUpdate(REFRESH, Loading(fromMediator = false)),
+ LoadStateUpdate(REFRESH, Error(LOAD_ERROR, fromMediator = false)),
+ LoadStateUpdate(REFRESH, Loading(fromMediator = false)),
createRefresh(50..51)
)
@@ -772,11 +784,11 @@
val pager = PageFetcherSnapshot(50, pageSource, config, retryFlow = retryCh.asFlow())
collectPagerData(pager) { pageEvents, _ ->
val expected = listOf<PageEvent<Int>>(
- LoadStateUpdate(REFRESH, Loading),
- LoadStateUpdate(REFRESH, Error(LOAD_ERROR)),
- LoadStateUpdate(REFRESH, Loading),
+ LoadStateUpdate(REFRESH, Loading(fromMediator = false)),
+ LoadStateUpdate(REFRESH, Error(LOAD_ERROR, fromMediator = false)),
+ LoadStateUpdate(REFRESH, Loading(fromMediator = false)),
createRefresh(50..51),
- LoadStateUpdate(PREPEND, Loading),
+ LoadStateUpdate(PREPEND, Loading(fromMediator = false)),
createPrepend(pageOffset = -1, range = 49..49)
)
@@ -793,6 +805,90 @@
}
@Test
+ fun retry_remotePrepend() = testScope.runBlockingTest {
+ @OptIn(ExperimentalPagingApi::class)
+ val remoteMediator = object : RemoteMediatorMock() {
+ override suspend fun load(
+ loadType: LoadType,
+ state: PagingState<Int, Int>
+ ): MediatorResult {
+ super.load(loadType, state)
+
+ return if (loadType == PREPEND) {
+ MediatorResult.Error(EXCEPTION)
+ } else {
+ MediatorResult.Success(endOfPaginationReached = true)
+ }
+ }
+ }
+
+ val pageSource = TestPagingSource(items = List(2) { it })
+ val pager = PageFetcherSnapshot(
+ initialKey = 0,
+ pagingSource = pageSource,
+ config = config,
+ retryFlow = retryCh.asFlow(),
+ remoteMediatorAccessor = RemoteMediatorAccessor(remoteMediator),
+ triggerRemoteRefresh = false
+ )
+
+ collectPagerData(pager) { _, _ ->
+ // Resolve initial load.
+ advanceUntilIdle()
+
+ retryCh.offer(Unit)
+ advanceUntilIdle()
+
+ retryCh.offer(Unit)
+ advanceUntilIdle()
+
+ assertEquals(3, remoteMediator.loadEvents.filter { it.loadType == PREPEND }.size)
+ }
+ }
+
+ @Test
+ fun retry_remoteAppend() = testScope.runBlockingTest {
+ @OptIn(ExperimentalPagingApi::class)
+ val remoteMediator = object : RemoteMediatorMock() {
+ override suspend fun load(
+ loadType: LoadType,
+ state: PagingState<Int, Int>
+ ): MediatorResult {
+ super.load(loadType, state)
+
+ return if (loadType == APPEND) {
+ MediatorResult.Error(EXCEPTION)
+ } else {
+ MediatorResult.Success(endOfPaginationReached = true)
+ }
+ }
+ }
+
+ val pageSource = TestPagingSource(items = List(2) { it })
+ val pager = PageFetcherSnapshot(
+ initialKey = 0,
+ pagingSource = pageSource,
+ config = config,
+ retryFlow = retryCh.asFlow(),
+ remoteMediatorAccessor = RemoteMediatorAccessor(remoteMediator),
+ triggerRemoteRefresh = false
+ )
+
+ collectPagerData(pager) { _, _ ->
+ // Resolve initial load.
+ advanceUntilIdle()
+
+ retryCh.offer(Unit)
+ advanceUntilIdle()
+
+ retryCh.offer(Unit)
+ advanceUntilIdle()
+
+ assertEquals(3, remoteMediator.loadEvents.filter { it.loadType == APPEND }.size)
+ }
+ }
+
+ @Test
fun disablePlaceholders_refresh() = testScope.runBlockingTest {
val config = PagingConfig(
pageSize = 1,
@@ -807,7 +903,7 @@
advanceUntilIdle()
val expected: List<PageEvent<Int>> = listOf(
- LoadStateUpdate(REFRESH, Loading),
+ LoadStateUpdate(REFRESH, Loading(fromMediator = false)),
createRefresh(range = 50..51).let { Refresh(it.pages, 0, 0, it.loadStates) }
)
@@ -832,9 +928,9 @@
advanceUntilIdle()
val expected: List<PageEvent<Int>> = listOf(
- LoadStateUpdate(REFRESH, Loading),
+ LoadStateUpdate(REFRESH, Loading(fromMediator = false)),
createRefresh(range = 50..51).let { Refresh(it.pages, 0, 0, it.loadStates) },
- LoadStateUpdate(PREPEND, Loading),
+ LoadStateUpdate(PREPEND, Loading(fromMediator = false)),
createPrepend(-1, 49..49).let { Prepend(it.pages, 0, it.loadStates) }
)
@@ -859,9 +955,9 @@
advanceUntilIdle()
val expected: List<PageEvent<Int>> = listOf(
- LoadStateUpdate(REFRESH, Loading),
+ LoadStateUpdate(REFRESH, Loading(fromMediator = false)),
createRefresh(range = 50..51).let { Refresh(it.pages, 0, 0, it.loadStates) },
- LoadStateUpdate(APPEND, Loading),
+ LoadStateUpdate(APPEND, Loading(fromMediator = false)),
createAppend(1, 52..52).let { Append(it.pages, 0, it.loadStates) }
)
@@ -886,9 +982,9 @@
advanceUntilIdle()
val expected: List<PageEvent<Int>> = listOf(
- LoadStateUpdate(REFRESH, Loading),
+ LoadStateUpdate(REFRESH, Loading(fromMediator = false)),
createRefresh(range = 50..52),
- LoadStateUpdate(APPEND, Loading),
+ LoadStateUpdate(APPEND, Loading(fromMediator = false)),
createAppend(pageOffset = 1, range = 53..53)
)
@@ -1024,10 +1120,10 @@
assertEvents(
listOf(
- LoadStateUpdate(REFRESH, Loading),
- LoadStateUpdate(REFRESH, Error(LOAD_ERROR)),
- LoadStateUpdate(REFRESH, Loading),
- LoadStateUpdate(REFRESH, Error(LOAD_ERROR))
+ LoadStateUpdate(REFRESH, Loading(fromMediator = false)),
+ LoadStateUpdate(REFRESH, Error(LOAD_ERROR, fromMediator = false)),
+ LoadStateUpdate(REFRESH, Loading(fromMediator = false)),
+ LoadStateUpdate(REFRESH, Error(LOAD_ERROR, fromMediator = false))
),
pageEvents
)
@@ -1036,6 +1132,7 @@
@Test
fun remoteMediator_initialLoadLoadStateError() = testScope.runBlockingTest {
+ @OptIn(ExperimentalPagingApi::class)
val remoteMediator = object : RemoteMediatorMock() {
override suspend fun load(
loadType: LoadType,
@@ -1059,8 +1156,8 @@
assertEvents(
listOf(
- LoadStateUpdate(REFRESH, Loading),
- LoadStateUpdate(REFRESH, Error(EXCEPTION))
+ LoadStateUpdate(REFRESH, Loading(fromMediator = true)),
+ LoadStateUpdate(REFRESH, Error(EXCEPTION, fromMediator = true))
),
pageEvents
)
@@ -1123,6 +1220,7 @@
@Test
fun remoteMediator_endOfPaginationNotReachedLoadState() = testScope.runBlockingTest {
+ @OptIn(ExperimentalPagingApi::class)
val remoteMediator = object : RemoteMediatorMock() {
override suspend fun load(
loadType: LoadType,
@@ -1153,8 +1251,8 @@
assertEvents(
listOf(
- LoadStateUpdate(loadType = REFRESH, loadState = Loading),
- LoadStateUpdate(loadType = APPEND, loadState = Loading),
+ LoadStateUpdate(loadType = REFRESH, loadState = Loading(fromMediator = false)),
+ LoadStateUpdate(loadType = APPEND, loadState = Loading(fromMediator = true)),
Refresh(
pages = listOf(
TransformablePage(
@@ -1180,6 +1278,7 @@
@Test
fun remoteMediator_endOfPaginationReachedLoadState() = testScope.runBlockingTest {
+ @OptIn(ExperimentalPagingApi::class)
val remoteMediator = object : RemoteMediatorMock() {
override suspend fun load(
loadType: LoadType,
@@ -1210,8 +1309,8 @@
assertEvents(
listOf(
- LoadStateUpdate(loadType = REFRESH, loadState = Loading),
- LoadStateUpdate(loadType = APPEND, loadState = Loading),
+ LoadStateUpdate(loadType = REFRESH, loadState = Loading(fromMediator = false)),
+ LoadStateUpdate(loadType = APPEND, loadState = Loading(fromMediator = true)),
Refresh(
pages = listOf(
TransformablePage(
diff --git a/paging/common/src/test/kotlin/androidx/paging/PageFetcherTest.kt b/paging/common/src/test/kotlin/androidx/paging/PageFetcherTest.kt
index a553c28..a6ba3ed 100644
--- a/paging/common/src/test/kotlin/androidx/paging/PageFetcherTest.kt
+++ b/paging/common/src/test/kotlin/androidx/paging/PageFetcherTest.kt
@@ -16,7 +16,10 @@
package androidx.paging
+import androidx.paging.LoadState.Loading
import androidx.paging.LoadType.APPEND
+import androidx.paging.LoadType.REFRESH
+import androidx.paging.PageEvent.LoadStateUpdate
import androidx.paging.RemoteMediator.InitializeAction.LAUNCH_INITIAL_REFRESH
import androidx.paging.RemoteMediator.InitializeAction.SKIP_INITIAL_REFRESH
import com.google.common.truth.Truth.assertThat
@@ -214,6 +217,7 @@
@Test
fun remoteMediator_initializeSkip() = testScope.runBlockingTest {
+ @OptIn(ExperimentalPagingApi::class)
val remoteMediatorMock = RemoteMediatorMock().apply {
initializeResult = SKIP_INITIAL_REFRESH
}
@@ -236,6 +240,7 @@
@Test
fun remoteMediator_initializeLaunch() = testScope.runBlockingTest {
+ @OptIn(ExperimentalPagingApi::class)
val remoteMediatorMock = RemoteMediatorMock().apply {
initializeResult = LAUNCH_INITIAL_REFRESH
}
@@ -300,7 +305,7 @@
advanceUntilIdle()
val expected: List<PageEvent<Int>> = listOf(
- PageEvent.LoadStateUpdate(LoadType.REFRESH, LoadState.Loading),
+ LoadStateUpdate(REFRESH, Loading(fromMediator = false)),
createRefresh(range = 50..51)
)
assertEvents(expected, fetcherState.pageEventLists[0])
diff --git a/paging/common/src/test/kotlin/androidx/paging/PagedListTest.kt b/paging/common/src/test/kotlin/androidx/paging/PagedListTest.kt
index a889369d..63490e2 100644
--- a/paging/common/src/test/kotlin/androidx/paging/PagedListTest.kt
+++ b/paging/common/src/test/kotlin/androidx/paging/PagedListTest.kt
@@ -144,8 +144,8 @@
}
}
- loadStateManager.setState(REFRESH, LoadState.Error(EXCEPTION))
- loadStateManager.setState(REFRESH, LoadState.Error(EXCEPTION))
+ loadStateManager.setState(REFRESH, LoadState.Error(EXCEPTION, fromMediator = false))
+ loadStateManager.setState(REFRESH, LoadState.Error(EXCEPTION, fromMediator = false))
assertEquals(1, onStateChangeCalls)
}
diff --git a/paging/common/src/test/kotlin/androidx/paging/PagingDataDifferTest.kt b/paging/common/src/test/kotlin/androidx/paging/PagingDataDifferTest.kt
index 130bac4..c2ad4b9 100644
--- a/paging/common/src/test/kotlin/androidx/paging/PagingDataDifferTest.kt
+++ b/paging/common/src/test/kotlin/androidx/paging/PagingDataDifferTest.kt
@@ -32,6 +32,7 @@
import org.junit.runner.RunWith
import org.junit.runners.JUnit4
import kotlin.coroutines.ContinuationInterceptor
+import kotlin.test.assertEquals
import kotlin.test.assertFailsWith
import kotlin.test.assertFalse
@@ -119,6 +120,38 @@
job.cancel()
}
+
+ @Test
+ fun retry() = testScope.runBlockingTest {
+ val differ = SimpleDiffer()
+ val receiver = UiReceiverFake()
+
+ val job = launch {
+ differ.collectFrom(infinitelySuspendingPagingData(receiver), dummyPresenterCallback)
+ }
+
+ differ.retry()
+
+ assertEquals(1, receiver.retryEvents.size)
+
+ job.cancel()
+ }
+
+ @Test
+ fun refresh() = testScope.runBlockingTest {
+ val differ = SimpleDiffer()
+ val receiver = UiReceiverFake()
+
+ val job = launch {
+ differ.collectFrom(infinitelySuspendingPagingData(receiver), dummyPresenterCallback)
+ }
+
+ differ.refresh()
+
+ assertEquals(1, receiver.refreshEvents.size)
+
+ job.cancel()
+ }
}
private fun infinitelySuspendingPagingData(receiver: UiReceiver = dummyReceiver) = PagingData<Int>(
@@ -126,6 +159,24 @@
receiver
)
+private class UiReceiverFake : UiReceiver {
+ val hints = mutableListOf<ViewportHint>()
+ val retryEvents = mutableListOf<Unit>()
+ val refreshEvents = mutableListOf<Unit>()
+
+ override fun addHint(hint: ViewportHint) {
+ hints.add(hint)
+ }
+
+ override fun retry() {
+ retryEvents.add(Unit)
+ }
+
+ override fun refresh() {
+ refreshEvents.add(Unit)
+ }
+}
+
private class SimpleDiffer : PagingDataDiffer<Int>() {
override suspend fun performDiff(
previousList: NullPaddedList<Int>,
diff --git a/paging/common/src/test/kotlin/androidx/paging/PagingSourceTest.kt b/paging/common/src/test/kotlin/androidx/paging/PagingSourceTest.kt
index 4f0354f..54047f9 100644
--- a/paging/common/src/test/kotlin/androidx/paging/PagingSourceTest.kt
+++ b/paging/common/src/test/kotlin/androidx/paging/PagingSourceTest.kt
@@ -257,6 +257,7 @@
private var error = false
+ @OptIn(ExperimentalPagingApi::class)
override fun getRefreshKey(state: PagingState<Key, Item>): Key? {
return state.anchorPosition
?.let { anchorPosition -> state.closestItemToPosition(anchorPosition) }
diff --git a/paging/common/src/test/kotlin/androidx/paging/RemoteMediatorAccessorTest.kt b/paging/common/src/test/kotlin/androidx/paging/RemoteMediatorAccessorTest.kt
index fe74500..c6f3f56 100644
--- a/paging/common/src/test/kotlin/androidx/paging/RemoteMediatorAccessorTest.kt
+++ b/paging/common/src/test/kotlin/androidx/paging/RemoteMediatorAccessorTest.kt
@@ -39,7 +39,7 @@
import kotlin.test.assertTrue
import kotlin.test.fail
-@OptIn(ExperimentalCoroutinesApi::class)
+@OptIn(ExperimentalCoroutinesApi::class, ExperimentalPagingApi::class)
@RunWith(JUnit4::class)
class RemoteMediatorAccessorTest {
private val testScope = TestCoroutineScope()
diff --git a/paging/common/src/test/kotlin/androidx/paging/TestPagingSourceExt.kt b/paging/common/src/test/kotlin/androidx/paging/TestPagingSourceExt.kt
index fd56c3c..cc959c5 100644
--- a/paging/common/src/test/kotlin/androidx/paging/TestPagingSourceExt.kt
+++ b/paging/common/src/test/kotlin/androidx/paging/TestPagingSourceExt.kt
@@ -16,18 +16,19 @@
package androidx.paging
-import androidx.paging.TestPagingSource.Companion.items
+import androidx.paging.LoadState.NotLoading
+import androidx.paging.TestPagingSource.Companion.ITEMS
internal fun createRefresh(
range: IntRange,
- startState: LoadState = LoadState.NotLoading(endOfPaginationReached = false),
- endState: LoadState = LoadState.NotLoading(endOfPaginationReached = false)
+ startState: LoadState = NotLoading(endOfPaginationReached = false, fromMediator = false),
+ endState: LoadState = NotLoading(endOfPaginationReached = false, fromMediator = false)
) = PageEvent.Insert.Refresh(
pages = pages(0, range),
placeholdersBefore = range.first.coerceAtLeast(0),
- placeholdersAfter = (items.size - range.last - 1).coerceAtLeast(0),
+ placeholdersAfter = (ITEMS.size - range.last - 1).coerceAtLeast(0),
loadStates = mapOf(
- LoadType.REFRESH to LoadState.NotLoading(endOfPaginationReached = false),
+ LoadType.REFRESH to NotLoading(endOfPaginationReached = false, fromMediator = false),
LoadType.PREPEND to startState,
LoadType.APPEND to endState
)
@@ -36,13 +37,13 @@
internal fun createPrepend(
pageOffset: Int,
range: IntRange,
- startState: LoadState = LoadState.NotLoading(endOfPaginationReached = false),
- endState: LoadState = LoadState.NotLoading(endOfPaginationReached = false)
+ startState: LoadState = NotLoading(endOfPaginationReached = false, fromMediator = false),
+ endState: LoadState = NotLoading(endOfPaginationReached = false, fromMediator = false)
) = PageEvent.Insert.Prepend(
pages = pages(pageOffset, range),
placeholdersBefore = range.first.coerceAtLeast(0),
loadStates = mapOf(
- LoadType.REFRESH to LoadState.NotLoading(endOfPaginationReached = false),
+ LoadType.REFRESH to NotLoading(endOfPaginationReached = false, fromMediator = false),
LoadType.PREPEND to startState,
LoadType.APPEND to endState
)
@@ -51,13 +52,13 @@
internal fun createAppend(
pageOffset: Int,
range: IntRange,
- startState: LoadState = LoadState.NotLoading(endOfPaginationReached = false),
- endState: LoadState = LoadState.NotLoading(endOfPaginationReached = false)
+ startState: LoadState = NotLoading(endOfPaginationReached = false, fromMediator = false),
+ endState: LoadState = NotLoading(endOfPaginationReached = false, fromMediator = false)
) = PageEvent.Insert.Append(
pages = pages(pageOffset, range),
- placeholdersAfter = (items.size - range.last - 1).coerceAtLeast(0),
+ placeholdersAfter = (ITEMS.size - range.last - 1).coerceAtLeast(0),
loadStates = mapOf(
- LoadType.REFRESH to LoadState.NotLoading(endOfPaginationReached = false),
+ LoadType.REFRESH to NotLoading(endOfPaginationReached = false, fromMediator = false),
LoadType.PREPEND to startState,
LoadType.APPEND to endState
)
@@ -69,7 +70,7 @@
) = listOf(
TransformablePage(
originalPageOffset = pageOffset,
- data = items.slice(range),
+ data = ITEMS.slice(range),
originalPageSize = range.count(),
originalIndices = null
)
diff --git a/paging/guava/api/3.0.0-alpha01.txt b/paging/guava/api/3.0.0-alpha01.txt
index af15849..1e78f92 100644
--- a/paging/guava/api/3.0.0-alpha01.txt
+++ b/paging/guava/api/3.0.0-alpha01.txt
@@ -3,7 +3,7 @@
public abstract class ListenableFuturePagingSource<Key, Value> extends androidx.paging.PagingSource<Key,Value> {
ctor public ListenableFuturePagingSource();
- method public suspend Object load(androidx.paging.PagingSource.LoadParams<Key> p, kotlin.coroutines.Continuation<? super androidx.paging.PagingSource.LoadResult<Key,Value>> $completion);
+ method public suspend Object? load(androidx.paging.PagingSource.LoadParams<Key> p, kotlin.coroutines.Continuation<? super androidx.paging.PagingSource.LoadResult<Key,Value>> $completion);
method public abstract com.google.common.util.concurrent.ListenableFuture<androidx.paging.PagingSource.LoadResult<Key,Value>> loadFuture(androidx.paging.PagingSource.LoadParams<Key> params);
}
diff --git a/paging/guava/api/current.txt b/paging/guava/api/current.txt
index af15849..1e78f92 100644
--- a/paging/guava/api/current.txt
+++ b/paging/guava/api/current.txt
@@ -3,7 +3,7 @@
public abstract class ListenableFuturePagingSource<Key, Value> extends androidx.paging.PagingSource<Key,Value> {
ctor public ListenableFuturePagingSource();
- method public suspend Object load(androidx.paging.PagingSource.LoadParams<Key> p, kotlin.coroutines.Continuation<? super androidx.paging.PagingSource.LoadResult<Key,Value>> $completion);
+ method public suspend Object? load(androidx.paging.PagingSource.LoadParams<Key> p, kotlin.coroutines.Continuation<? super androidx.paging.PagingSource.LoadResult<Key,Value>> $completion);
method public abstract com.google.common.util.concurrent.ListenableFuture<androidx.paging.PagingSource.LoadResult<Key,Value>> loadFuture(androidx.paging.PagingSource.LoadParams<Key> params);
}
diff --git a/paging/guava/api/public_plus_experimental_3.0.0-alpha01.txt b/paging/guava/api/public_plus_experimental_3.0.0-alpha01.txt
index af15849..1e78f92 100644
--- a/paging/guava/api/public_plus_experimental_3.0.0-alpha01.txt
+++ b/paging/guava/api/public_plus_experimental_3.0.0-alpha01.txt
@@ -3,7 +3,7 @@
public abstract class ListenableFuturePagingSource<Key, Value> extends androidx.paging.PagingSource<Key,Value> {
ctor public ListenableFuturePagingSource();
- method public suspend Object load(androidx.paging.PagingSource.LoadParams<Key> p, kotlin.coroutines.Continuation<? super androidx.paging.PagingSource.LoadResult<Key,Value>> $completion);
+ method public suspend Object? load(androidx.paging.PagingSource.LoadParams<Key> p, kotlin.coroutines.Continuation<? super androidx.paging.PagingSource.LoadResult<Key,Value>> $completion);
method public abstract com.google.common.util.concurrent.ListenableFuture<androidx.paging.PagingSource.LoadResult<Key,Value>> loadFuture(androidx.paging.PagingSource.LoadParams<Key> params);
}
diff --git a/paging/guava/api/public_plus_experimental_current.txt b/paging/guava/api/public_plus_experimental_current.txt
index af15849..1e78f92 100644
--- a/paging/guava/api/public_plus_experimental_current.txt
+++ b/paging/guava/api/public_plus_experimental_current.txt
@@ -3,7 +3,7 @@
public abstract class ListenableFuturePagingSource<Key, Value> extends androidx.paging.PagingSource<Key,Value> {
ctor public ListenableFuturePagingSource();
- method public suspend Object load(androidx.paging.PagingSource.LoadParams<Key> p, kotlin.coroutines.Continuation<? super androidx.paging.PagingSource.LoadResult<Key,Value>> $completion);
+ method public suspend Object? load(androidx.paging.PagingSource.LoadParams<Key> p, kotlin.coroutines.Continuation<? super androidx.paging.PagingSource.LoadResult<Key,Value>> $completion);
method public abstract com.google.common.util.concurrent.ListenableFuture<androidx.paging.PagingSource.LoadResult<Key,Value>> loadFuture(androidx.paging.PagingSource.LoadParams<Key> params);
}
diff --git a/paging/guava/api/restricted_3.0.0-alpha01.txt b/paging/guava/api/restricted_3.0.0-alpha01.txt
index af15849..1e78f92 100644
--- a/paging/guava/api/restricted_3.0.0-alpha01.txt
+++ b/paging/guava/api/restricted_3.0.0-alpha01.txt
@@ -3,7 +3,7 @@
public abstract class ListenableFuturePagingSource<Key, Value> extends androidx.paging.PagingSource<Key,Value> {
ctor public ListenableFuturePagingSource();
- method public suspend Object load(androidx.paging.PagingSource.LoadParams<Key> p, kotlin.coroutines.Continuation<? super androidx.paging.PagingSource.LoadResult<Key,Value>> $completion);
+ method public suspend Object? load(androidx.paging.PagingSource.LoadParams<Key> p, kotlin.coroutines.Continuation<? super androidx.paging.PagingSource.LoadResult<Key,Value>> $completion);
method public abstract com.google.common.util.concurrent.ListenableFuture<androidx.paging.PagingSource.LoadResult<Key,Value>> loadFuture(androidx.paging.PagingSource.LoadParams<Key> params);
}
diff --git a/paging/guava/api/restricted_current.txt b/paging/guava/api/restricted_current.txt
index af15849..1e78f92 100644
--- a/paging/guava/api/restricted_current.txt
+++ b/paging/guava/api/restricted_current.txt
@@ -3,7 +3,7 @@
public abstract class ListenableFuturePagingSource<Key, Value> extends androidx.paging.PagingSource<Key,Value> {
ctor public ListenableFuturePagingSource();
- method public suspend Object load(androidx.paging.PagingSource.LoadParams<Key> p, kotlin.coroutines.Continuation<? super androidx.paging.PagingSource.LoadResult<Key,Value>> $completion);
+ method public suspend Object? load(androidx.paging.PagingSource.LoadParams<Key> p, kotlin.coroutines.Continuation<? super androidx.paging.PagingSource.LoadResult<Key,Value>> $completion);
method public abstract com.google.common.util.concurrent.ListenableFuture<androidx.paging.PagingSource.LoadResult<Key,Value>> loadFuture(androidx.paging.PagingSource.LoadParams<Key> params);
}
diff --git a/paging/integration-tests/testapp/src/main/java/androidx/paging/integration/testapp/custom/ItemDataSource.kt b/paging/integration-tests/testapp/src/main/java/androidx/paging/integration/testapp/custom/ItemDataSource.kt
index bff3ebf..0cdddba 100644
--- a/paging/integration-tests/testapp/src/main/java/androidx/paging/integration/testapp/custom/ItemDataSource.kt
+++ b/paging/integration-tests/testapp/src/main/java/androidx/paging/integration/testapp/custom/ItemDataSource.kt
@@ -18,6 +18,7 @@
import android.graphics.Color
import androidx.annotation.ColorInt
+import androidx.paging.ExperimentalPagingApi
import androidx.paging.LoadType
import androidx.paging.PagingSource
import androidx.paging.PagingState
@@ -34,6 +35,7 @@
private val generationId = sGenerationId++
+ @OptIn(ExperimentalPagingApi::class)
override fun getRefreshKey(state: PagingState<Int, Item>): Int? = state.anchorPosition
override suspend fun load(params: LoadParams<Int>): LoadResult<Int, Item> =
diff --git a/paging/integration-tests/testapp/src/main/java/androidx/paging/integration/testapp/v3/ItemPagingSource.kt b/paging/integration-tests/testapp/src/main/java/androidx/paging/integration/testapp/v3/ItemPagingSource.kt
index da89bf0..b7a5340 100644
--- a/paging/integration-tests/testapp/src/main/java/androidx/paging/integration/testapp/v3/ItemPagingSource.kt
+++ b/paging/integration-tests/testapp/src/main/java/androidx/paging/integration/testapp/v3/ItemPagingSource.kt
@@ -18,6 +18,7 @@
import android.graphics.Color
import androidx.annotation.ColorInt
+import androidx.paging.ExperimentalPagingApi
import androidx.paging.LoadType
import androidx.paging.PagingSource
import androidx.paging.PagingState
@@ -34,6 +35,7 @@
private val generationId = sGenerationId++
+ @OptIn(ExperimentalPagingApi::class)
override fun getRefreshKey(state: PagingState<Int, Item>): Int? = state.anchorPosition
override suspend fun load(params: LoadParams<Int>): LoadResult<Int, Item> =
diff --git a/paging/integration-tests/testapp/src/main/java/androidx/paging/integration/testapp/v3/StateItemAdapter.kt b/paging/integration-tests/testapp/src/main/java/androidx/paging/integration/testapp/v3/StateItemAdapter.kt
index ea9d2f8..66f1dfc 100644
--- a/paging/integration-tests/testapp/src/main/java/androidx/paging/integration/testapp/v3/StateItemAdapter.kt
+++ b/paging/integration-tests/testapp/src/main/java/androidx/paging/integration/testapp/v3/StateItemAdapter.kt
@@ -40,9 +40,9 @@
if (loadState is LoadState.Error) {
errorMsg.text = loadState.error.localizedMessage
}
- progressBar.visibility = toVisibility(loadState == LoadState.Loading)
- retry.visibility = toVisibility(loadState != LoadState.Loading)
- errorMsg.visibility = toVisibility(loadState != LoadState.Loading)
+ progressBar.visibility = toVisibility(loadState is LoadState.Loading)
+ retry.visibility = toVisibility(loadState !is LoadState.Loading)
+ errorMsg.visibility = toVisibility(loadState !is LoadState.Loading)
}
private fun toVisibility(constraint: Boolean): Int = if (constraint) {
diff --git a/paging/integration-tests/testapp/src/main/java/androidx/paging/integration/testapp/v3room/NetworkCustomerPagingSource.kt b/paging/integration-tests/testapp/src/main/java/androidx/paging/integration/testapp/v3room/NetworkCustomerPagingSource.kt
index 748042e..ae1744b 100644
--- a/paging/integration-tests/testapp/src/main/java/androidx/paging/integration/testapp/v3room/NetworkCustomerPagingSource.kt
+++ b/paging/integration-tests/testapp/src/main/java/androidx/paging/integration/testapp/v3room/NetworkCustomerPagingSource.kt
@@ -16,6 +16,7 @@
package androidx.paging.integration.testapp.v3room
+import androidx.paging.ExperimentalPagingApi
import androidx.paging.PagingSource
import androidx.paging.PagingState
import androidx.paging.integration.testapp.room.Customer
@@ -32,6 +33,7 @@
return customer
}
+ @OptIn(ExperimentalPagingApi::class)
override fun getRefreshKey(state: PagingState<Int, Customer>): Int? = state.anchorPosition
override suspend fun load(params: LoadParams<Int>): LoadResult<Int, Customer> {
diff --git a/paging/integration-tests/testapp/src/main/java/androidx/paging/integration/testapp/v3room/V3RemoteMediator.kt b/paging/integration-tests/testapp/src/main/java/androidx/paging/integration/testapp/v3room/V3RemoteMediator.kt
index 13b49ac..719df71 100644
--- a/paging/integration-tests/testapp/src/main/java/androidx/paging/integration/testapp/v3room/V3RemoteMediator.kt
+++ b/paging/integration-tests/testapp/src/main/java/androidx/paging/integration/testapp/v3room/V3RemoteMediator.kt
@@ -16,6 +16,7 @@
package androidx.paging.integration.testapp.v3room
+import androidx.paging.ExperimentalPagingApi
import androidx.paging.LoadType
import androidx.paging.PagingSource
import androidx.paging.PagingState
@@ -26,6 +27,7 @@
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.withContext
+@OptIn(ExperimentalPagingApi::class)
internal class V3RemoteMediator(
private val database: SampleDatabase,
private val networkSource: NetworkCustomerPagingSource
diff --git a/paging/runtime/api/3.0.0-alpha01.txt b/paging/runtime/api/3.0.0-alpha01.txt
index 4733ee1..6382175 100644
--- a/paging/runtime/api/3.0.0-alpha01.txt
+++ b/paging/runtime/api/3.0.0-alpha01.txt
@@ -97,7 +97,7 @@
method protected T? getItem(int position);
method public int getItemCount();
method public final long getItemId(int position);
- method public final suspend Object! presentData(androidx.paging.PagingData<T> pagingData, kotlin.coroutines.Continuation<? super kotlin.Unit> p);
+ method public final suspend Object? presentData(androidx.paging.PagingData<T> pagingData, kotlin.coroutines.Continuation<? super kotlin.Unit> p);
method public final void refresh();
method public void removeLoadStateListener(kotlin.jvm.functions.Function2<? super androidx.paging.LoadType,? super androidx.paging.LoadState,kotlin.Unit> listener);
method public final void retry();
diff --git a/paging/runtime/api/api_lint.ignore b/paging/runtime/api/api_lint.ignore
index 9e7a61c..45e4c89 100644
--- a/paging/runtime/api/api_lint.ignore
+++ b/paging/runtime/api/api_lint.ignore
@@ -9,11 +9,5 @@
Listeners should always be at end of argument list (method `AsyncPagedListDiffer`)
-MissingNullability: androidx.paging.AsyncPagingDataDiffer#presentData(androidx.paging.PagingData<T>, kotlin.coroutines.Continuation<? super kotlin.Unit>):
- Missing nullability on method `presentData` return
-MissingNullability: androidx.paging.PagingDataAdapter#presentData(androidx.paging.PagingData<T>, kotlin.coroutines.Continuation<? super kotlin.Unit>):
- Missing nullability on method `presentData` return
-
-
TopLevelBuilder: androidx.paging.LivePagedListBuilder:
Builder should be defined as inner class: androidx.paging.LivePagedListBuilder
diff --git a/paging/runtime/api/current.txt b/paging/runtime/api/current.txt
index 4733ee1..6382175 100644
--- a/paging/runtime/api/current.txt
+++ b/paging/runtime/api/current.txt
@@ -97,7 +97,7 @@
method protected T? getItem(int position);
method public int getItemCount();
method public final long getItemId(int position);
- method public final suspend Object! presentData(androidx.paging.PagingData<T> pagingData, kotlin.coroutines.Continuation<? super kotlin.Unit> p);
+ method public final suspend Object? presentData(androidx.paging.PagingData<T> pagingData, kotlin.coroutines.Continuation<? super kotlin.Unit> p);
method public final void refresh();
method public void removeLoadStateListener(kotlin.jvm.functions.Function2<? super androidx.paging.LoadType,? super androidx.paging.LoadState,kotlin.Unit> listener);
method public final void retry();
diff --git a/paging/runtime/api/public_plus_experimental_3.0.0-alpha01.txt b/paging/runtime/api/public_plus_experimental_3.0.0-alpha01.txt
index 4733ee1..6382175 100644
--- a/paging/runtime/api/public_plus_experimental_3.0.0-alpha01.txt
+++ b/paging/runtime/api/public_plus_experimental_3.0.0-alpha01.txt
@@ -97,7 +97,7 @@
method protected T? getItem(int position);
method public int getItemCount();
method public final long getItemId(int position);
- method public final suspend Object! presentData(androidx.paging.PagingData<T> pagingData, kotlin.coroutines.Continuation<? super kotlin.Unit> p);
+ method public final suspend Object? presentData(androidx.paging.PagingData<T> pagingData, kotlin.coroutines.Continuation<? super kotlin.Unit> p);
method public final void refresh();
method public void removeLoadStateListener(kotlin.jvm.functions.Function2<? super androidx.paging.LoadType,? super androidx.paging.LoadState,kotlin.Unit> listener);
method public final void retry();
diff --git a/paging/runtime/api/public_plus_experimental_current.txt b/paging/runtime/api/public_plus_experimental_current.txt
index 4733ee1..6382175 100644
--- a/paging/runtime/api/public_plus_experimental_current.txt
+++ b/paging/runtime/api/public_plus_experimental_current.txt
@@ -97,7 +97,7 @@
method protected T? getItem(int position);
method public int getItemCount();
method public final long getItemId(int position);
- method public final suspend Object! presentData(androidx.paging.PagingData<T> pagingData, kotlin.coroutines.Continuation<? super kotlin.Unit> p);
+ method public final suspend Object? presentData(androidx.paging.PagingData<T> pagingData, kotlin.coroutines.Continuation<? super kotlin.Unit> p);
method public final void refresh();
method public void removeLoadStateListener(kotlin.jvm.functions.Function2<? super androidx.paging.LoadType,? super androidx.paging.LoadState,kotlin.Unit> listener);
method public final void retry();
diff --git a/paging/runtime/api/restricted_3.0.0-alpha01.txt b/paging/runtime/api/restricted_3.0.0-alpha01.txt
index 4733ee1..6382175 100644
--- a/paging/runtime/api/restricted_3.0.0-alpha01.txt
+++ b/paging/runtime/api/restricted_3.0.0-alpha01.txt
@@ -97,7 +97,7 @@
method protected T? getItem(int position);
method public int getItemCount();
method public final long getItemId(int position);
- method public final suspend Object! presentData(androidx.paging.PagingData<T> pagingData, kotlin.coroutines.Continuation<? super kotlin.Unit> p);
+ method public final suspend Object? presentData(androidx.paging.PagingData<T> pagingData, kotlin.coroutines.Continuation<? super kotlin.Unit> p);
method public final void refresh();
method public void removeLoadStateListener(kotlin.jvm.functions.Function2<? super androidx.paging.LoadType,? super androidx.paging.LoadState,kotlin.Unit> listener);
method public final void retry();
diff --git a/paging/runtime/api/restricted_current.txt b/paging/runtime/api/restricted_current.txt
index 4733ee1..6382175 100644
--- a/paging/runtime/api/restricted_current.txt
+++ b/paging/runtime/api/restricted_current.txt
@@ -97,7 +97,7 @@
method protected T? getItem(int position);
method public int getItemCount();
method public final long getItemId(int position);
- method public final suspend Object! presentData(androidx.paging.PagingData<T> pagingData, kotlin.coroutines.Continuation<? super kotlin.Unit> p);
+ method public final suspend Object? presentData(androidx.paging.PagingData<T> pagingData, kotlin.coroutines.Continuation<? super kotlin.Unit> p);
method public final void refresh();
method public void removeLoadStateListener(kotlin.jvm.functions.Function2<? super androidx.paging.LoadType,? super androidx.paging.LoadState,kotlin.Unit> listener);
method public final void retry();
diff --git a/paging/runtime/src/androidTest/java/androidx/paging/AsyncPagingDataDifferTest.kt b/paging/runtime/src/androidTest/java/androidx/paging/AsyncPagingDataDifferTest.kt
index e651d29..098bb9f 100644
--- a/paging/runtime/src/androidTest/java/androidx/paging/AsyncPagingDataDifferTest.kt
+++ b/paging/runtime/src/androidTest/java/androidx/paging/AsyncPagingDataDifferTest.kt
@@ -21,11 +21,11 @@
import androidx.paging.ListUpdateEvent.Inserted
import androidx.paging.ListUpdateEvent.Moved
import androidx.paging.ListUpdateEvent.Removed
-import androidx.paging.LoadState.NotLoading
import androidx.paging.LoadState.Loading
+import androidx.paging.LoadState.NotLoading
import androidx.paging.LoadType.APPEND
-import androidx.paging.LoadType.REFRESH
import androidx.paging.LoadType.PREPEND
+import androidx.paging.LoadType.REFRESH
import androidx.recyclerview.widget.DiffUtil
import androidx.recyclerview.widget.ListUpdateCallback
import androidx.test.filters.SmallTest
@@ -137,11 +137,17 @@
// empty previous list.
assertEvents(
listOf(
- LoadEvent(REFRESH, NotLoading(endOfPaginationReached = false)),
- LoadEvent(PREPEND, NotLoading(endOfPaginationReached = false)),
- LoadEvent(APPEND, NotLoading(endOfPaginationReached = false)),
- LoadEvent(REFRESH, Loading),
- LoadEvent(REFRESH, NotLoading(endOfPaginationReached = false))
+ LoadEvent(
+ REFRESH,
+ NotLoading(endOfPaginationReached = false, fromMediator = false)
+ ),
+ LoadEvent(
+ PREPEND,
+ NotLoading(endOfPaginationReached = false, fromMediator = false)
+ ),
+ LoadEvent(APPEND, NotLoading(endOfPaginationReached = false, fromMediator = false)),
+ LoadEvent(REFRESH, Loading(fromMediator = false)),
+ LoadEvent(REFRESH, NotLoading(endOfPaginationReached = false, fromMediator = false))
),
loadEvents
)
@@ -156,8 +162,8 @@
// empty next list.
assertEvents(
listOf(
- LoadEvent(PREPEND, NotLoading(endOfPaginationReached = true)),
- LoadEvent(APPEND, NotLoading(endOfPaginationReached = true))
+ LoadEvent(PREPEND, NotLoading(endOfPaginationReached = true, fromMediator = false)),
+ LoadEvent(APPEND, NotLoading(endOfPaginationReached = true, fromMediator = false))
),
loadEvents
)
diff --git a/paging/runtime/src/androidTest/java/androidx/paging/LivePagedListBuilderTest.kt b/paging/runtime/src/androidTest/java/androidx/paging/LivePagedListBuilderTest.kt
index 29a14ff..4604928 100644
--- a/paging/runtime/src/androidTest/java/androidx/paging/LivePagedListBuilderTest.kt
+++ b/paging/runtime/src/androidTest/java/androidx/paging/LivePagedListBuilderTest.kt
@@ -21,9 +21,9 @@
import androidx.lifecycle.Lifecycle
import androidx.lifecycle.Observer
import androidx.lifecycle.testing.TestLifecycleOwner
-import androidx.paging.LoadState.NotLoading
import androidx.paging.LoadState.Error
import androidx.paging.LoadState.Loading
+import androidx.paging.LoadState.NotLoading
import androidx.paging.LoadType.REFRESH
import androidx.test.filters.SmallTest
import androidx.testutils.TestDispatcher
@@ -205,9 +205,14 @@
// TODO: Investigate removing initial IDLE state from callback updates.
assertEquals(
listOf(
- LoadStateEvent(REFRESH, NotLoading(endOfPaginationReached = false)),
- LoadStateEvent(REFRESH, Loading),
- LoadStateEvent(REFRESH, Error(EXCEPTION))
+ LoadStateEvent(
+ REFRESH, NotLoading(
+ endOfPaginationReached = false,
+ fromMediator = false
+ )
+ ),
+ LoadStateEvent(REFRESH, Loading(fromMediator = false)),
+ LoadStateEvent(REFRESH, Error(EXCEPTION, fromMediator = false))
), loadStates
)
@@ -222,10 +227,13 @@
assertEquals(
listOf(
- LoadStateEvent(REFRESH, NotLoading(endOfPaginationReached = false)),
- LoadStateEvent(REFRESH, Loading),
- LoadStateEvent(REFRESH, Error(EXCEPTION)),
- LoadStateEvent(REFRESH, Loading)
+ LoadStateEvent(
+ REFRESH,
+ NotLoading(endOfPaginationReached = false, fromMediator = false)
+ ),
+ LoadStateEvent(REFRESH, Loading(fromMediator = false)),
+ LoadStateEvent(REFRESH, Error(EXCEPTION, fromMediator = false)),
+ LoadStateEvent(REFRESH, Loading(fromMediator = false))
), loadStates
)
@@ -234,11 +242,17 @@
pagedListHolder[0]!!.addWeakLoadStateListener(loadStateChangedCallback)
assertEquals(
listOf(
- LoadStateEvent(REFRESH, NotLoading(endOfPaginationReached = false)),
- LoadStateEvent(REFRESH, Loading),
- LoadStateEvent(REFRESH, Error(EXCEPTION)),
- LoadStateEvent(REFRESH, Loading),
- LoadStateEvent(REFRESH, NotLoading(endOfPaginationReached = false))
+ LoadStateEvent(
+ REFRESH,
+ NotLoading(endOfPaginationReached = false, fromMediator = false)
+ ),
+ LoadStateEvent(REFRESH, Loading(fromMediator = false)),
+ LoadStateEvent(REFRESH, Error(EXCEPTION, fromMediator = false)),
+ LoadStateEvent(REFRESH, Loading(fromMediator = false)),
+ LoadStateEvent(
+ REFRESH,
+ NotLoading(endOfPaginationReached = false, fromMediator = false)
+ )
),
loadStates
)
diff --git a/paging/runtime/src/androidTest/java/androidx/paging/LoadStateAdapterTest.kt b/paging/runtime/src/androidTest/java/androidx/paging/LoadStateAdapterTest.kt
index 8e8cc96..4449877 100644
--- a/paging/runtime/src/androidTest/java/androidx/paging/LoadStateAdapterTest.kt
+++ b/paging/runtime/src/androidTest/java/androidx/paging/LoadStateAdapterTest.kt
@@ -18,9 +18,9 @@
import android.view.View
import android.view.ViewGroup
-import androidx.paging.LoadState.NotLoading
import androidx.paging.LoadState.Error
import androidx.paging.LoadState.Loading
+import androidx.paging.LoadState.NotLoading
import androidx.paging.LoadStateAdapterTest.AdapterEventRecorder.Event.CHANGE
import androidx.paging.LoadStateAdapterTest.AdapterEventRecorder.Event.INSERT
import androidx.paging.LoadStateAdapterTest.AdapterEventRecorder.Event.REMOVED
@@ -101,21 +101,29 @@
fun init() {
val adapter = SimpleLoadStateAdapter()
assertEquals(0, adapter.itemCount)
- assertFalse(adapter.displayLoadStateAsItem(NotLoading(endOfPaginationReached = false)))
- assertFalse(adapter.displayLoadStateAsItem(NotLoading(endOfPaginationReached = true)))
- assertTrue(adapter.displayLoadStateAsItem(Error(Throwable())))
- assertTrue(adapter.displayLoadStateAsItem(Loading))
+ assertFalse(
+ adapter.displayLoadStateAsItem(
+ NotLoading(endOfPaginationReached = false, fromMediator = false)
+ )
+ )
+ assertFalse(
+ adapter.displayLoadStateAsItem(
+ NotLoading(endOfPaginationReached = true, fromMediator = false)
+ )
+ )
+ assertTrue(adapter.displayLoadStateAsItem(Error(Throwable(), fromMediator = false)))
+ assertTrue(adapter.displayLoadStateAsItem(Loading(fromMediator = false)))
}
@Test
fun notifyEquality() {
val adapter = SimpleLoadStateAdapter()
- adapter.loadState = Loading
+ adapter.loadState = Loading(fromMediator = false)
val eventRecorder = AdapterEventRecorder()
adapter.registerAdapterDataObserver(eventRecorder)
- adapter.loadState = Loading
+ adapter.loadState = Loading(fromMediator = false)
assertTrue(eventRecorder.getClearEvents().isEmpty())
}
@@ -126,12 +134,12 @@
assertFalse("sanity check", throwable1 == throwable2)
val adapter = SimpleLoadStateAdapter()
- adapter.loadState = Error(throwable1)
+ adapter.loadState = Error(throwable1, fromMediator = false)
val eventRecorder = AdapterEventRecorder()
adapter.registerAdapterDataObserver(eventRecorder)
- adapter.loadState = Error(throwable2)
+ adapter.loadState = Error(throwable2, fromMediator = false)
assertEquals(listOf(CHANGE), eventRecorder.getClearEvents())
}
@@ -143,25 +151,25 @@
adapter.registerAdapterDataObserver(eventRecorder)
// idle, done, nothing should happen
- adapter.loadState = NotLoading(endOfPaginationReached = false)
+ adapter.loadState = NotLoading(endOfPaginationReached = false, fromMediator = false)
assertTrue(eventRecorder.getClearEvents().isEmpty())
- adapter.loadState = NotLoading(endOfPaginationReached = true)
+ adapter.loadState = NotLoading(endOfPaginationReached = true, fromMediator = false)
assertTrue(eventRecorder.getClearEvents().isEmpty())
// insert item
- adapter.loadState = Loading
+ adapter.loadState = Loading(fromMediator = false)
assertEquals(listOf(INSERT), eventRecorder.getClearEvents())
// change to error
- adapter.loadState = Error(Throwable())
+ adapter.loadState = Error(Throwable(), fromMediator = false)
assertEquals(listOf(CHANGE), eventRecorder.getClearEvents())
// change to different error
- adapter.loadState = Error(Throwable())
+ adapter.loadState = Error(Throwable(), fromMediator = false)
assertEquals(listOf(CHANGE), eventRecorder.getClearEvents())
// remove
- adapter.loadState = NotLoading(endOfPaginationReached = true)
+ adapter.loadState = NotLoading(endOfPaginationReached = true, fromMediator = false)
assertEquals(listOf(REMOVED), eventRecorder.getClearEvents())
}
}
\ No newline at end of file
diff --git a/paging/runtime/src/main/java/androidx/paging/AsyncPagingDataDiffer.kt b/paging/runtime/src/main/java/androidx/paging/AsyncPagingDataDiffer.kt
index 53c83e8..bcbc669 100644
--- a/paging/runtime/src/main/java/androidx/paging/AsyncPagingDataDiffer.kt
+++ b/paging/runtime/src/main/java/androidx/paging/AsyncPagingDataDiffer.kt
@@ -194,9 +194,9 @@
CopyOnWriteArrayList()
internal val loadStates = mutableMapOf<LoadType, LoadState>(
- REFRESH to LoadState.NotLoading(endOfPaginationReached = false),
- PREPEND to LoadState.NotLoading(endOfPaginationReached = false),
- APPEND to LoadState.NotLoading(endOfPaginationReached = false)
+ REFRESH to LoadState.NotLoading(endOfPaginationReached = false, fromMediator = false),
+ PREPEND to LoadState.NotLoading(endOfPaginationReached = false, fromMediator = false),
+ APPEND to LoadState.NotLoading(endOfPaginationReached = false, fromMediator = false)
)
/**
diff --git a/paging/runtime/src/main/java/androidx/paging/LivePagedList.kt b/paging/runtime/src/main/java/androidx/paging/LivePagedList.kt
index 3faa73c..b96bb08 100644
--- a/paging/runtime/src/main/java/androidx/paging/LivePagedList.kt
+++ b/paging/runtime/src/main/java/androidx/paging/LivePagedList.kt
@@ -74,7 +74,7 @@
pagingSource.registerInvalidatedCallback(callback)
withContext(notifyDispatcher) {
- currentData.setInitialLoadState(REFRESH, Loading)
+ currentData.setInitialLoadState(REFRESH, Loading(fromMediator = false))
}
@Suppress("UNCHECKED_CAST")
@@ -82,7 +82,10 @@
val params = config.toRefreshLoadParams(lastKey)
when (val initialResult = pagingSource.load(params)) {
is PagingSource.LoadResult.Error -> {
- currentData.setInitialLoadState(REFRESH, Error(initialResult.throwable))
+ currentData.setInitialLoadState(
+ REFRESH,
+ Error(initialResult.throwable, fromMediator = false)
+ )
}
is PagingSource.LoadResult.Page -> {
val pagedList = PagedList.create(
diff --git a/paging/runtime/src/main/java/androidx/paging/LoadStateAdapter.kt b/paging/runtime/src/main/java/androidx/paging/LoadStateAdapter.kt
index a8eb7e8..45c2742 100644
--- a/paging/runtime/src/main/java/androidx/paging/LoadStateAdapter.kt
+++ b/paging/runtime/src/main/java/androidx/paging/LoadStateAdapter.kt
@@ -46,7 +46,10 @@
* Changing this property will immediately notify the Adapter to change the item it's
* presenting.
*/
- var loadState: LoadState = LoadState.NotLoading(endOfPaginationReached = false)
+ var loadState: LoadState = LoadState.NotLoading(
+ endOfPaginationReached = false,
+ fromMediator = false
+ )
set(loadState) {
if (field != loadState) {
val oldItem = displayLoadStateAsItem(field)
diff --git a/paging/rxjava2/api/3.0.0-alpha01.txt b/paging/rxjava2/api/3.0.0-alpha01.txt
index 6b95400..a600023 100644
--- a/paging/rxjava2/api/3.0.0-alpha01.txt
+++ b/paging/rxjava2/api/3.0.0-alpha01.txt
@@ -40,7 +40,7 @@
public abstract class RxPagingSource<Key, Value> extends androidx.paging.PagingSource<Key,Value> {
ctor public RxPagingSource();
- method public final suspend Object load(androidx.paging.PagingSource.LoadParams<Key> params, kotlin.coroutines.Continuation<? super androidx.paging.PagingSource.LoadResult<Key,Value>> p);
+ method public final suspend Object? load(androidx.paging.PagingSource.LoadParams<Key> params, kotlin.coroutines.Continuation<? super androidx.paging.PagingSource.LoadResult<Key,Value>> p);
method public abstract io.reactivex.Single<androidx.paging.PagingSource.LoadResult<Key,Value>> loadSingle(androidx.paging.PagingSource.LoadParams<Key> params);
}
diff --git a/paging/rxjava2/api/current.txt b/paging/rxjava2/api/current.txt
index 6b95400..a600023 100644
--- a/paging/rxjava2/api/current.txt
+++ b/paging/rxjava2/api/current.txt
@@ -40,7 +40,7 @@
public abstract class RxPagingSource<Key, Value> extends androidx.paging.PagingSource<Key,Value> {
ctor public RxPagingSource();
- method public final suspend Object load(androidx.paging.PagingSource.LoadParams<Key> params, kotlin.coroutines.Continuation<? super androidx.paging.PagingSource.LoadResult<Key,Value>> p);
+ method public final suspend Object? load(androidx.paging.PagingSource.LoadParams<Key> params, kotlin.coroutines.Continuation<? super androidx.paging.PagingSource.LoadResult<Key,Value>> p);
method public abstract io.reactivex.Single<androidx.paging.PagingSource.LoadResult<Key,Value>> loadSingle(androidx.paging.PagingSource.LoadParams<Key> params);
}
diff --git a/paging/rxjava2/api/public_plus_experimental_3.0.0-alpha01.txt b/paging/rxjava2/api/public_plus_experimental_3.0.0-alpha01.txt
index 6b95400..a600023 100644
--- a/paging/rxjava2/api/public_plus_experimental_3.0.0-alpha01.txt
+++ b/paging/rxjava2/api/public_plus_experimental_3.0.0-alpha01.txt
@@ -40,7 +40,7 @@
public abstract class RxPagingSource<Key, Value> extends androidx.paging.PagingSource<Key,Value> {
ctor public RxPagingSource();
- method public final suspend Object load(androidx.paging.PagingSource.LoadParams<Key> params, kotlin.coroutines.Continuation<? super androidx.paging.PagingSource.LoadResult<Key,Value>> p);
+ method public final suspend Object? load(androidx.paging.PagingSource.LoadParams<Key> params, kotlin.coroutines.Continuation<? super androidx.paging.PagingSource.LoadResult<Key,Value>> p);
method public abstract io.reactivex.Single<androidx.paging.PagingSource.LoadResult<Key,Value>> loadSingle(androidx.paging.PagingSource.LoadParams<Key> params);
}
diff --git a/paging/rxjava2/api/public_plus_experimental_current.txt b/paging/rxjava2/api/public_plus_experimental_current.txt
index 6b95400..a600023 100644
--- a/paging/rxjava2/api/public_plus_experimental_current.txt
+++ b/paging/rxjava2/api/public_plus_experimental_current.txt
@@ -40,7 +40,7 @@
public abstract class RxPagingSource<Key, Value> extends androidx.paging.PagingSource<Key,Value> {
ctor public RxPagingSource();
- method public final suspend Object load(androidx.paging.PagingSource.LoadParams<Key> params, kotlin.coroutines.Continuation<? super androidx.paging.PagingSource.LoadResult<Key,Value>> p);
+ method public final suspend Object? load(androidx.paging.PagingSource.LoadParams<Key> params, kotlin.coroutines.Continuation<? super androidx.paging.PagingSource.LoadResult<Key,Value>> p);
method public abstract io.reactivex.Single<androidx.paging.PagingSource.LoadResult<Key,Value>> loadSingle(androidx.paging.PagingSource.LoadParams<Key> params);
}
diff --git a/paging/rxjava2/api/restricted_3.0.0-alpha01.txt b/paging/rxjava2/api/restricted_3.0.0-alpha01.txt
index 6b95400..a600023 100644
--- a/paging/rxjava2/api/restricted_3.0.0-alpha01.txt
+++ b/paging/rxjava2/api/restricted_3.0.0-alpha01.txt
@@ -40,7 +40,7 @@
public abstract class RxPagingSource<Key, Value> extends androidx.paging.PagingSource<Key,Value> {
ctor public RxPagingSource();
- method public final suspend Object load(androidx.paging.PagingSource.LoadParams<Key> params, kotlin.coroutines.Continuation<? super androidx.paging.PagingSource.LoadResult<Key,Value>> p);
+ method public final suspend Object? load(androidx.paging.PagingSource.LoadParams<Key> params, kotlin.coroutines.Continuation<? super androidx.paging.PagingSource.LoadResult<Key,Value>> p);
method public abstract io.reactivex.Single<androidx.paging.PagingSource.LoadResult<Key,Value>> loadSingle(androidx.paging.PagingSource.LoadParams<Key> params);
}
diff --git a/paging/rxjava2/api/restricted_current.txt b/paging/rxjava2/api/restricted_current.txt
index 6b95400..a600023 100644
--- a/paging/rxjava2/api/restricted_current.txt
+++ b/paging/rxjava2/api/restricted_current.txt
@@ -40,7 +40,7 @@
public abstract class RxPagingSource<Key, Value> extends androidx.paging.PagingSource<Key,Value> {
ctor public RxPagingSource();
- method public final suspend Object load(androidx.paging.PagingSource.LoadParams<Key> params, kotlin.coroutines.Continuation<? super androidx.paging.PagingSource.LoadResult<Key,Value>> p);
+ method public final suspend Object? load(androidx.paging.PagingSource.LoadParams<Key> params, kotlin.coroutines.Continuation<? super androidx.paging.PagingSource.LoadResult<Key,Value>> p);
method public abstract io.reactivex.Single<androidx.paging.PagingSource.LoadResult<Key,Value>> loadSingle(androidx.paging.PagingSource.LoadParams<Key> params);
}
diff --git a/paging/rxjava2/src/main/java/androidx/paging/RxPagedListBuilder.kt b/paging/rxjava2/src/main/java/androidx/paging/RxPagedListBuilder.kt
index 577abad..9bc75cc 100644
--- a/paging/rxjava2/src/main/java/androidx/paging/RxPagedListBuilder.kt
+++ b/paging/rxjava2/src/main/java/androidx/paging/RxPagedListBuilder.kt
@@ -18,6 +18,7 @@
import android.annotation.SuppressLint
import androidx.arch.core.executor.ArchTaskExecutor
+import androidx.paging.LoadState.Loading
import io.reactivex.BackpressureStrategy
import io.reactivex.Flowable
import io.reactivex.Observable
@@ -389,7 +390,7 @@
pagingSource.registerInvalidatedCallback(callback)
withContext(notifyDispatcher) {
- currentData.setInitialLoadState(LoadType.REFRESH, LoadState.Loading)
+ currentData.setInitialLoadState(LoadType.REFRESH, Loading(fromMediator = false))
}
@Suppress("UNCHECKED_CAST")
@@ -399,7 +400,7 @@
is PagingSource.LoadResult.Error -> {
currentData.setInitialLoadState(
LoadType.REFRESH,
- LoadState.Error(initialResult.throwable)
+ LoadState.Error(initialResult.throwable, fromMediator = false)
)
}
is PagingSource.LoadResult.Page -> {
diff --git a/paging/rxjava2/src/test/java/androidx/paging/RxPagedListBuilderTest.kt b/paging/rxjava2/src/test/java/androidx/paging/RxPagedListBuilderTest.kt
index 6197eb1..9ea4c87 100644
--- a/paging/rxjava2/src/test/java/androidx/paging/RxPagedListBuilderTest.kt
+++ b/paging/rxjava2/src/test/java/androidx/paging/RxPagedListBuilderTest.kt
@@ -16,9 +16,10 @@
package androidx.paging
-import androidx.paging.LoadState.NotLoading
import androidx.paging.LoadState.Error
import androidx.paging.LoadState.Loading
+import androidx.paging.LoadState.NotLoading
+import androidx.paging.LoadType.REFRESH
import io.reactivex.Observable
import io.reactivex.observers.TestObserver
import io.reactivex.schedulers.TestScheduler
@@ -193,14 +194,14 @@
// initial load failed, check that we're in error state
val loadStateChangedCallback = { type: LoadType, state: LoadState ->
- if (type == LoadType.REFRESH) {
+ if (type == REFRESH) {
loadStates.add(LoadStateEvent(type, state))
}
}
initPagedList.addWeakLoadStateListener(loadStateChangedCallback)
assertEquals(
listOf(
- LoadStateEvent(LoadType.REFRESH, Loading)
+ LoadStateEvent(REFRESH, Loading(fromMediator = false))
), loadStates
)
@@ -210,8 +211,8 @@
assertEquals(
listOf(
- LoadStateEvent(LoadType.REFRESH, Loading),
- LoadStateEvent(LoadType.REFRESH, Error(EXCEPTION))
+ LoadStateEvent(REFRESH, Loading(fromMediator = false)),
+ LoadStateEvent(REFRESH, Error(EXCEPTION, fromMediator = false))
), loadStates
)
@@ -221,9 +222,9 @@
assertEquals(
listOf(
- LoadStateEvent(LoadType.REFRESH, Loading),
- LoadStateEvent(LoadType.REFRESH, Error(EXCEPTION)),
- LoadStateEvent(LoadType.REFRESH, Loading)
+ LoadStateEvent(REFRESH, Loading(fromMediator = false)),
+ LoadStateEvent(REFRESH, Error(EXCEPTION, fromMediator = false)),
+ LoadStateEvent(REFRESH, Loading(fromMediator = false))
), loadStates
)
// flush loadInitial, should succeed now
@@ -239,10 +240,13 @@
assertEquals(
listOf(
- LoadStateEvent(LoadType.REFRESH, Loading),
- LoadStateEvent(LoadType.REFRESH, Error(EXCEPTION)),
- LoadStateEvent(LoadType.REFRESH, Loading),
- LoadStateEvent(LoadType.REFRESH, NotLoading(endOfPaginationReached = false))
+ LoadStateEvent(REFRESH, Loading(fromMediator = false)),
+ LoadStateEvent(REFRESH, Error(EXCEPTION, fromMediator = false)),
+ LoadStateEvent(REFRESH, Loading(fromMediator = false)),
+ LoadStateEvent(
+ REFRESH,
+ NotLoading(endOfPaginationReached = false, fromMediator = false)
+ )
), loadStates
)
}
diff --git a/paging/samples/src/main/java/androidx/paging/samples/LoadStateAdapterSample.kt b/paging/samples/src/main/java/androidx/paging/samples/LoadStateAdapterSample.kt
index af3396f..ce32515 100644
--- a/paging/samples/src/main/java/androidx/paging/samples/LoadStateAdapterSample.kt
+++ b/paging/samples/src/main/java/androidx/paging/samples/LoadStateAdapterSample.kt
@@ -47,9 +47,9 @@
if (loadState is LoadState.Error) {
errorMsg.text = loadState.error.localizedMessage
}
- progressBar.visibility = toVisibility(loadState == LoadState.Loading)
- retry.visibility = toVisibility(loadState != LoadState.Loading)
- errorMsg.visibility = toVisibility(loadState != LoadState.Loading)
+ progressBar.visibility = toVisibility(loadState is LoadState.Loading)
+ retry.visibility = toVisibility(loadState !is LoadState.Loading)
+ errorMsg.visibility = toVisibility(loadState !is LoadState.Loading)
}
private fun toVisibility(constraint: Boolean): Int = if (constraint) {
diff --git a/paging/samples/src/main/java/androidx/paging/samples/RemoteMediatorSample.kt b/paging/samples/src/main/java/androidx/paging/samples/RemoteMediatorSample.kt
index 41b7559..d925d0a 100644
--- a/paging/samples/src/main/java/androidx/paging/samples/RemoteMediatorSample.kt
+++ b/paging/samples/src/main/java/androidx/paging/samples/RemoteMediatorSample.kt
@@ -19,6 +19,7 @@
package androidx.paging.samples
import androidx.annotation.Sampled
+import androidx.paging.ExperimentalPagingApi
import androidx.paging.LoadType
import androidx.paging.PagingState
import androidx.paging.RemoteMediator
@@ -48,6 +49,7 @@
* This sample loads `Item`s via Retrofit from a network service using String tokens to load
* pages (each response has a next/previous token), and inserts them into database.
*/
+ @OptIn(ExperimentalPagingApi::class)
class MyRemoteMediator(
private val database: ItemDao,
private val networkService: MyBackendService
diff --git a/preference/preference/api/restricted_1.2.0-alpha01.txt b/preference/preference/api/restricted_1.2.0-alpha01.txt
index 7b25888..17eff09 100644
--- a/preference/preference/api/restricted_1.2.0-alpha01.txt
+++ b/preference/preference/api/restricted_1.2.0-alpha01.txt
@@ -588,7 +588,7 @@
}
-package @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY) @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY) androidx.preference.internal {
+package @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY) androidx.preference.internal {
@RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class PreferenceImageView extends android.widget.ImageView {
ctor public PreferenceImageView(android.content.Context!);
diff --git a/preference/preference/api/restricted_current.txt b/preference/preference/api/restricted_current.txt
index 7b25888..17eff09 100644
--- a/preference/preference/api/restricted_current.txt
+++ b/preference/preference/api/restricted_current.txt
@@ -588,7 +588,7 @@
}
-package @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY) @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY) androidx.preference.internal {
+package @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY) androidx.preference.internal {
@RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class PreferenceImageView extends android.widget.ImageView {
ctor public PreferenceImageView(android.content.Context!);
diff --git a/recyclerview/recyclerview/src/androidTest/java/androidx/recyclerview/widget/RecyclerViewLayoutTest.java b/recyclerview/recyclerview/src/androidTest/java/androidx/recyclerview/widget/RecyclerViewLayoutTest.java
index 9c4f2b7..4e7a7fd 100644
--- a/recyclerview/recyclerview/src/androidTest/java/androidx/recyclerview/widget/RecyclerViewLayoutTest.java
+++ b/recyclerview/recyclerview/src/androidTest/java/androidx/recyclerview/widget/RecyclerViewLayoutTest.java
@@ -3109,73 +3109,6 @@
accessRecyclerOnOnMeasureTest(false);
}
-
- @Test
- public void smoothScroll_whenSmoothScrollerStops_destinationReached() throws Throwable {
-
- // Arrange
-
- int heightOfParent = getActivity().getContainer().getHeight();
-
- final int itemCount = 500;
- final int targetPosition = 450;
- final int itemHeight = heightOfParent / 25; // About 25 items on screen.
-
- final RecyclerView rv = new RecyclerView(getActivity());
-
- TestAdapter testAdapter = new TestAdapter(itemCount, new RecyclerView.LayoutParams(
- ViewGroup.LayoutParams.MATCH_PARENT, itemHeight));
- rv.setAdapter(testAdapter);
-
- final CountDownLatch calledOnStart = new CountDownLatch(1);
- final CountDownLatch calledOnStop = new CountDownLatch(1);
-
- rv.setLayoutManager(new LinearLayoutManager(getActivity()) {
- @Override
- public void smoothScrollToPosition(RecyclerView recyclerView, RecyclerView.State state,
- int position) {
- LinearSmoothScroller linearSmoothScroller =
- new LinearSmoothScroller(recyclerView.getContext()) {
- @Override
- protected void onStart() {
- super.onStart();
- calledOnStart.countDown();
- }
-
- @Override
- protected void onStop() {
- super.onStop();
- calledOnStop.countDown();
- }
- };
- linearSmoothScroller.setTargetPosition(position);
- startSmoothScroll(linearSmoothScroller);
- }
- });
-
- TestedFrameLayout testedFrameLayout = getActivity().getContainer();
- testedFrameLayout.expectLayouts(1);
- setRecyclerView(rv);
- testedFrameLayout.waitForLayout(2);
-
- // Act
-
- mActivityRule.runOnUiThread(new Runnable() {
- @Override
- public void run() {
- rv.smoothScrollToPosition(targetPosition);
- }
- });
-
- // Assert
-
- assertTrue("onStart should be called quickly ", calledOnStart.await(2, TimeUnit.SECONDS));
- assertTrue("onStop should be called eventually", calledOnStop.await(30, TimeUnit.SECONDS));
- assertNotNull("smoothScrollToPosition should succeed",
- rv.findViewHolderForLayoutPosition(targetPosition));
- checkForMainThreadException();
- }
-
@Test
public void smoothScroll_destinationDeletedDuring_newDestinationReached() throws Throwable {
diff --git a/recyclerview/recyclerview/src/androidTest/java/androidx/recyclerview/widget/RecyclerViewSmoothScrollToPositionTest.kt b/recyclerview/recyclerview/src/androidTest/java/androidx/recyclerview/widget/RecyclerViewSmoothScrollToPositionTest.kt
index 38c57bb..3468c5e 100644
--- a/recyclerview/recyclerview/src/androidTest/java/androidx/recyclerview/widget/RecyclerViewSmoothScrollToPositionTest.kt
+++ b/recyclerview/recyclerview/src/androidTest/java/androidx/recyclerview/widget/RecyclerViewSmoothScrollToPositionTest.kt
@@ -16,59 +16,40 @@
package androidx.recyclerview.widget
+import android.content.Context
import android.view.View
import android.view.ViewGroup
import android.widget.TextView
-import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.LargeTest
import androidx.test.rule.ActivityTestRule
import org.hamcrest.CoreMatchers.`is`
+import org.junit.Assert
import org.junit.Assert.assertThat
-import org.junit.Before
import org.junit.Rule
import org.junit.Test
import org.junit.runner.RunWith
+import org.junit.runners.JUnit4
import java.util.concurrent.CountDownLatch
import java.util.concurrent.TimeUnit
-private const val RV_WIDTH = 500
-private const val RV_HEIGHT = 500
-private const val ITEM_WIDTH = 500
-private const val ITEM_HEIGHT = 200
-private const val NUM_ITEMS = 100
-
-// TODO: This probably isn't a small test
@LargeTest
-@RunWith(AndroidJUnit4::class)
+@RunWith(JUnit4::class)
class RecyclerViewSmoothScrollToPositionTest {
- private lateinit var recyclerView: RecyclerView
- private lateinit var testContentView: TestContentView
-
@get:Rule
val mActivityTestRule = ActivityTestRule(TestContentViewActivity::class.java)
- @Before
- @Throws(Throwable::class)
- fun setUp() {
- val context = mActivityTestRule.activity
-
- recyclerView = RecyclerView(context)
-
- recyclerView.layoutParams = ViewGroup.LayoutParams(RV_WIDTH, RV_HEIGHT)
- recyclerView.setBackgroundColor(0x7FFF0000)
- recyclerView.layoutManager = LinearLayoutManager(context)
- recyclerView.adapter = MyAdapter()
-
- testContentView = mActivityTestRule.activity.contentView
- testContentView.expectLayouts(1)
- mActivityTestRule.runOnUiThread { testContentView.addView(recyclerView) }
- testContentView.awaitLayouts(2)
- }
-
@Test
@Throws(Throwable::class)
fun smoothScrollToPosition_calledDuringScrollJustBeforeStop_scrollStateCallbacksCorrect() {
+
+ val recyclerView =
+ setup(
+ 500 to 500,
+ 500 to 200,
+ 100
+ )
+
val called2ndTime = -1
// Arrange
@@ -87,7 +68,7 @@
override fun onScrolled(recyclerView: RecyclerView, dx: Int, dy: Int) {
recyclerView.findChildWithTag(target)?.let {
- if (it.bottom == RV_HEIGHT) {
+ if (it.bottom == 500) {
log.add(called2ndTime)
recyclerView.smoothScrollToPosition(target)
}
@@ -105,6 +86,104 @@
assertThat(log[1], `is`(called2ndTime))
assertThat(log[2], `is`(RecyclerView.SCROLL_STATE_IDLE))
}
+
+ @Test
+ @Throws(Throwable::class)
+ fun smoothScroll_whenSmoothScrollerStops_destinationReached() {
+
+ // Arrange
+
+ val calledOnStart = CountDownLatch(1)
+ val calledOnStop = CountDownLatch(1)
+
+ val layoutManager =
+ object : LinearLayoutManager(mActivityTestRule.activity) {
+
+ override fun smoothScrollToPosition(
+ recyclerView: RecyclerView,
+ state: RecyclerView.State,
+ position: Int
+ ) {
+ val linearSmoothScroller: LinearSmoothScroller =
+ object : LinearSmoothScroller(recyclerView.context) {
+ override fun onStart() {
+ super.onStart()
+ calledOnStart.countDown()
+ }
+
+ override fun onStop() {
+ super.onStop()
+ calledOnStop.countDown()
+ }
+ }
+ linearSmoothScroller.targetPosition = position
+ startSmoothScroll(linearSmoothScroller)
+ }
+ }
+
+ // We are going to traverse through 5 of 10 total screens worth of items to find the
+ // target view.
+ val itemHeight = 100
+ val itemsPerScreen = 5
+ val screensToTraverse = 5
+ val totalScreens = 10
+
+ val targetPosition = itemsPerScreen * screensToTraverse
+
+ val recyclerView =
+ setup(
+ 500 to itemHeight * itemsPerScreen,
+ 500 to itemHeight,
+ itemsPerScreen * totalScreens,
+ layoutManager = layoutManager
+ )
+
+ // Act
+
+ BaseRecyclerViewInstrumentationTest.mActivityRule.runOnUiThread(Runnable {
+ recyclerView.smoothScrollToPosition(
+ targetPosition
+ )
+ })
+
+ // Assert
+
+ Assert.assertTrue(
+ "onStart should be called quickly ",
+ calledOnStart.await(2, TimeUnit.SECONDS)
+ )
+ Assert.assertTrue(
+ "onStop should be called eventually",
+ calledOnStop.await(30, TimeUnit.SECONDS)
+ )
+ Assert.assertNotNull(
+ "smoothScrollToPosition should succeed",
+ recyclerView.findViewHolderForLayoutPosition(targetPosition)
+ )
+ }
+
+ private fun setup(
+ rvDimensions: Pair<Int, Int>,
+ itemDimensions: Pair<Int, Int>,
+ numItems: Int,
+ context: Context = mActivityTestRule.activity,
+ layoutManager: RecyclerView.LayoutManager = LinearLayoutManager(context)
+ ): RecyclerView {
+
+ val recyclerView = RecyclerView(context)
+
+ recyclerView.layoutParams = ViewGroup.LayoutParams(rvDimensions.first, rvDimensions.second)
+ recyclerView.setBackgroundColor(0x7FFF0000)
+ recyclerView.layoutManager = layoutManager
+ recyclerView.adapter = MyAdapter(itemDimensions, numItems)
+
+ val testContentView = mActivityTestRule.activity.contentView
+ testContentView.expectLayouts(1)
+ mActivityTestRule.runOnUiThread { testContentView.addView(recyclerView) }
+ testContentView.awaitLayouts(2)
+
+ return recyclerView
+ }
}
private fun ViewGroup.findChildWithTag(tag: Int): View? {
@@ -116,22 +195,25 @@
return null
}
-private class MyAdapter : RecyclerView.Adapter<RecyclerView.ViewHolder>() {
+private class MyAdapter(
+ val itemDimensions: Pair<Int, Int>,
+ val numItems: Int
+) : RecyclerView.Adapter<RecyclerView.ViewHolder>() {
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int) =
object : RecyclerView.ViewHolder(
TextView(parent.context).apply {
- minWidth = ITEM_WIDTH
- minHeight = ITEM_HEIGHT
+ minWidth = itemDimensions.first
+ minHeight = itemDimensions.second
}
) {}
override fun onBindViewHolder(holder: RecyclerView.ViewHolder, position: Int) {
(holder.itemView as TextView).apply {
- text = Integer.toString(position)
+ text = position.toString()
tag = position
}
}
- override fun getItemCount() = NUM_ITEMS
+ override fun getItemCount() = numItems
}
\ No newline at end of file
diff --git a/room/compiler/src/main/kotlin/androidx/room/util/SimpleJavaVersion.kt b/room/compiler/src/main/kotlin/androidx/room/util/SimpleJavaVersion.kt
index d5ba947..8041f42 100644
--- a/room/compiler/src/main/kotlin/androidx/room/util/SimpleJavaVersion.kt
+++ b/room/compiler/src/main/kotlin/androidx/room/util/SimpleJavaVersion.kt
@@ -58,7 +58,10 @@
}
val parts = version.split('.')
- if (parts.size != 3) {
+
+ // There are valid JDK version strings with more than 3 parts when split by dots.
+ // For example: "11.0.6+10-post-Ubuntu-1ubuntu118.04.1".
+ if (parts.size < 3) {
return null
}
diff --git a/room/compiler/src/test/kotlin/androidx/room/util/SimpleJavaVersionTest.kt b/room/compiler/src/test/kotlin/androidx/room/util/SimpleJavaVersionTest.kt
index f23a305..33fd70b 100644
--- a/room/compiler/src/test/kotlin/androidx/room/util/SimpleJavaVersionTest.kt
+++ b/room/compiler/src/test/kotlin/androidx/room/util/SimpleJavaVersionTest.kt
@@ -25,6 +25,10 @@
fun testTryParse() {
assert(SimpleJavaVersion.tryParse("11.0.1+13-LTS") == SimpleJavaVersion(11, 0, null))
assert(
+ SimpleJavaVersion.tryParse("11.0.6+10-post-Ubuntu-1ubuntu118.04.1")
+ == SimpleJavaVersion(11, 0, null)
+ )
+ assert(
SimpleJavaVersion.tryParse("1.8.0_202-release-1483-b39-5396753")
== SimpleJavaVersion(8, 0, 202)
)
@@ -39,6 +43,10 @@
fun testParse() {
assert(SimpleJavaVersion.parse("11.0.1+13-LTS") == SimpleJavaVersion(11, 0, null))
assert(
+ SimpleJavaVersion.parse("11.0.6+10-post-Ubuntu-1ubuntu118.04.1")
+ == SimpleJavaVersion(11, 0, null)
+ )
+ assert(
SimpleJavaVersion.parse("1.8.0_202-release-1483-b39-5396753")
== SimpleJavaVersion(8, 0, 202)
)
diff --git a/room/ktx/api/2.3.0-alpha01.txt b/room/ktx/api/2.3.0-alpha01.txt
index c9ca3c6..9f26936 100644
--- a/room/ktx/api/2.3.0-alpha01.txt
+++ b/room/ktx/api/2.3.0-alpha01.txt
@@ -5,7 +5,7 @@
}
public final class RoomDatabaseKt {
- method public static suspend <R> Object! withTransaction(androidx.room.RoomDatabase, kotlin.jvm.functions.Function1<? super kotlin.coroutines.Continuation<? super R>,?> block, kotlin.coroutines.Continuation<? super R> p);
+ method public static suspend <R> Object? withTransaction(androidx.room.RoomDatabase, kotlin.jvm.functions.Function1<? super kotlin.coroutines.Continuation<? super R>,?> block, kotlin.coroutines.Continuation<? super R> p);
}
}
diff --git a/room/ktx/api/api_lint.ignore b/room/ktx/api/api_lint.ignore
deleted file mode 100644
index 3cbc9d4..0000000
--- a/room/ktx/api/api_lint.ignore
+++ /dev/null
@@ -1,3 +0,0 @@
-// Baseline format: 1.0
-MissingNullability: androidx.room.RoomDatabaseKt#withTransaction(androidx.room.RoomDatabase, kotlin.jvm.functions.Function1<? super kotlin.coroutines.Continuation<? super R>,?>, kotlin.coroutines.Continuation<? super R>):
- Missing nullability on method `withTransaction` return
diff --git a/room/ktx/api/current.txt b/room/ktx/api/current.txt
index c9ca3c6..9f26936 100644
--- a/room/ktx/api/current.txt
+++ b/room/ktx/api/current.txt
@@ -5,7 +5,7 @@
}
public final class RoomDatabaseKt {
- method public static suspend <R> Object! withTransaction(androidx.room.RoomDatabase, kotlin.jvm.functions.Function1<? super kotlin.coroutines.Continuation<? super R>,?> block, kotlin.coroutines.Continuation<? super R> p);
+ method public static suspend <R> Object? withTransaction(androidx.room.RoomDatabase, kotlin.jvm.functions.Function1<? super kotlin.coroutines.Continuation<? super R>,?> block, kotlin.coroutines.Continuation<? super R> p);
}
}
diff --git a/room/ktx/api/public_plus_experimental_2.3.0-alpha01.txt b/room/ktx/api/public_plus_experimental_2.3.0-alpha01.txt
index c9ca3c6..9f26936 100644
--- a/room/ktx/api/public_plus_experimental_2.3.0-alpha01.txt
+++ b/room/ktx/api/public_plus_experimental_2.3.0-alpha01.txt
@@ -5,7 +5,7 @@
}
public final class RoomDatabaseKt {
- method public static suspend <R> Object! withTransaction(androidx.room.RoomDatabase, kotlin.jvm.functions.Function1<? super kotlin.coroutines.Continuation<? super R>,?> block, kotlin.coroutines.Continuation<? super R> p);
+ method public static suspend <R> Object? withTransaction(androidx.room.RoomDatabase, kotlin.jvm.functions.Function1<? super kotlin.coroutines.Continuation<? super R>,?> block, kotlin.coroutines.Continuation<? super R> p);
}
}
diff --git a/room/ktx/api/public_plus_experimental_current.txt b/room/ktx/api/public_plus_experimental_current.txt
index c9ca3c6..9f26936 100644
--- a/room/ktx/api/public_plus_experimental_current.txt
+++ b/room/ktx/api/public_plus_experimental_current.txt
@@ -5,7 +5,7 @@
}
public final class RoomDatabaseKt {
- method public static suspend <R> Object! withTransaction(androidx.room.RoomDatabase, kotlin.jvm.functions.Function1<? super kotlin.coroutines.Continuation<? super R>,?> block, kotlin.coroutines.Continuation<? super R> p);
+ method public static suspend <R> Object? withTransaction(androidx.room.RoomDatabase, kotlin.jvm.functions.Function1<? super kotlin.coroutines.Continuation<? super R>,?> block, kotlin.coroutines.Continuation<? super R> p);
}
}
diff --git a/room/ktx/api/restricted_2.3.0-alpha01.txt b/room/ktx/api/restricted_2.3.0-alpha01.txt
index 710c968..cc27399 100644
--- a/room/ktx/api/restricted_2.3.0-alpha01.txt
+++ b/room/ktx/api/restricted_2.3.0-alpha01.txt
@@ -3,22 +3,22 @@
@RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public final class CoroutinesRoom {
method public static <R> kotlinx.coroutines.flow.Flow<R> createFlow(androidx.room.RoomDatabase db, boolean inTransaction, String![] tableNames, java.util.concurrent.Callable<R> callable);
- method public static suspend <R> Object! execute(androidx.room.RoomDatabase p, boolean db, java.util.concurrent.Callable<R> inTransaction, kotlin.coroutines.Continuation<? super R> callable);
- method public static suspend <R> Object! execute(androidx.room.RoomDatabase p, boolean db, android.os.CancellationSignal inTransaction, java.util.concurrent.Callable<R> cancellationSignal, kotlin.coroutines.Continuation<? super R> callable);
+ method public static suspend <R> Object? execute(androidx.room.RoomDatabase p, boolean db, java.util.concurrent.Callable<R> inTransaction, kotlin.coroutines.Continuation<? super R> callable);
+ method public static suspend <R> Object? execute(androidx.room.RoomDatabase p, boolean db, android.os.CancellationSignal inTransaction, java.util.concurrent.Callable<R> cancellationSignal, kotlin.coroutines.Continuation<? super R> callable);
field public static final androidx.room.CoroutinesRoom.Companion! Companion;
}
public static final class CoroutinesRoom.Companion {
method public <R> kotlinx.coroutines.flow.Flow<R> createFlow(androidx.room.RoomDatabase db, boolean inTransaction, String![] tableNames, java.util.concurrent.Callable<R> callable);
- method public suspend <R> Object! execute(androidx.room.RoomDatabase db, boolean inTransaction, java.util.concurrent.Callable<R> callable, kotlin.coroutines.Continuation<? super R> p);
- method public suspend <R> Object! execute(androidx.room.RoomDatabase db, boolean inTransaction, android.os.CancellationSignal cancellationSignal, java.util.concurrent.Callable<R> callable, kotlin.coroutines.Continuation<? super R> p);
+ method public suspend <R> Object? execute(androidx.room.RoomDatabase db, boolean inTransaction, java.util.concurrent.Callable<R> callable, kotlin.coroutines.Continuation<? super R> p);
+ method public suspend <R> Object? execute(androidx.room.RoomDatabase db, boolean inTransaction, android.os.CancellationSignal cancellationSignal, java.util.concurrent.Callable<R> callable, kotlin.coroutines.Continuation<? super R> p);
}
public final class CoroutinesRoomKt {
}
public final class RoomDatabaseKt {
- method public static suspend <R> Object! withTransaction(androidx.room.RoomDatabase, kotlin.jvm.functions.Function1<? super kotlin.coroutines.Continuation<? super R>,?> block, kotlin.coroutines.Continuation<? super R> p);
+ method public static suspend <R> Object? withTransaction(androidx.room.RoomDatabase, kotlin.jvm.functions.Function1<? super kotlin.coroutines.Continuation<? super R>,?> block, kotlin.coroutines.Continuation<? super R> p);
}
}
diff --git a/room/ktx/api/restricted_current.txt b/room/ktx/api/restricted_current.txt
index 710c968..cc27399 100644
--- a/room/ktx/api/restricted_current.txt
+++ b/room/ktx/api/restricted_current.txt
@@ -3,22 +3,22 @@
@RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public final class CoroutinesRoom {
method public static <R> kotlinx.coroutines.flow.Flow<R> createFlow(androidx.room.RoomDatabase db, boolean inTransaction, String![] tableNames, java.util.concurrent.Callable<R> callable);
- method public static suspend <R> Object! execute(androidx.room.RoomDatabase p, boolean db, java.util.concurrent.Callable<R> inTransaction, kotlin.coroutines.Continuation<? super R> callable);
- method public static suspend <R> Object! execute(androidx.room.RoomDatabase p, boolean db, android.os.CancellationSignal inTransaction, java.util.concurrent.Callable<R> cancellationSignal, kotlin.coroutines.Continuation<? super R> callable);
+ method public static suspend <R> Object? execute(androidx.room.RoomDatabase p, boolean db, java.util.concurrent.Callable<R> inTransaction, kotlin.coroutines.Continuation<? super R> callable);
+ method public static suspend <R> Object? execute(androidx.room.RoomDatabase p, boolean db, android.os.CancellationSignal inTransaction, java.util.concurrent.Callable<R> cancellationSignal, kotlin.coroutines.Continuation<? super R> callable);
field public static final androidx.room.CoroutinesRoom.Companion! Companion;
}
public static final class CoroutinesRoom.Companion {
method public <R> kotlinx.coroutines.flow.Flow<R> createFlow(androidx.room.RoomDatabase db, boolean inTransaction, String![] tableNames, java.util.concurrent.Callable<R> callable);
- method public suspend <R> Object! execute(androidx.room.RoomDatabase db, boolean inTransaction, java.util.concurrent.Callable<R> callable, kotlin.coroutines.Continuation<? super R> p);
- method public suspend <R> Object! execute(androidx.room.RoomDatabase db, boolean inTransaction, android.os.CancellationSignal cancellationSignal, java.util.concurrent.Callable<R> callable, kotlin.coroutines.Continuation<? super R> p);
+ method public suspend <R> Object? execute(androidx.room.RoomDatabase db, boolean inTransaction, java.util.concurrent.Callable<R> callable, kotlin.coroutines.Continuation<? super R> p);
+ method public suspend <R> Object? execute(androidx.room.RoomDatabase db, boolean inTransaction, android.os.CancellationSignal cancellationSignal, java.util.concurrent.Callable<R> callable, kotlin.coroutines.Continuation<? super R> p);
}
public final class CoroutinesRoomKt {
}
public final class RoomDatabaseKt {
- method public static suspend <R> Object! withTransaction(androidx.room.RoomDatabase, kotlin.jvm.functions.Function1<? super kotlin.coroutines.Continuation<? super R>,?> block, kotlin.coroutines.Continuation<? super R> p);
+ method public static suspend <R> Object? withTransaction(androidx.room.RoomDatabase, kotlin.jvm.functions.Function1<? super kotlin.coroutines.Continuation<? super R>,?> block, kotlin.coroutines.Continuation<? super R> p);
}
}
diff --git a/samples/SupportTransitionDemos/src/main/java/com/example/android/support/transition/widget/ArcMotionUsage.java b/samples/SupportTransitionDemos/src/main/java/com/example/android/support/transition/widget/ArcMotionUsage.java
index e8fa14e..7f4a952 100644
--- a/samples/SupportTransitionDemos/src/main/java/com/example/android/support/transition/widget/ArcMotionUsage.java
+++ b/samples/SupportTransitionDemos/src/main/java/com/example/android/support/transition/widget/ArcMotionUsage.java
@@ -21,6 +21,7 @@
import android.view.View;
import android.widget.FrameLayout;
+import androidx.interpolator.view.animation.FastOutSlowInInterpolator;
import androidx.transition.ArcMotion;
import androidx.transition.ChangeBounds;
import androidx.transition.Transition;
diff --git a/samples/SupportTransitionDemos/src/main/java/com/example/android/support/transition/widget/ChangeColor.java b/samples/SupportTransitionDemos/src/main/java/com/example/android/support/transition/widget/ChangeColor.java
index 5bba2a1..19f6041 100644
--- a/samples/SupportTransitionDemos/src/main/java/com/example/android/support/transition/widget/ChangeColor.java
+++ b/samples/SupportTransitionDemos/src/main/java/com/example/android/support/transition/widget/ChangeColor.java
@@ -16,6 +16,9 @@
package com.example.android.support.transition.widget;
+import android.animation.Animator;
+import android.animation.ArgbEvaluator;
+import android.animation.ValueAnimator;
import android.graphics.drawable.ColorDrawable;
import android.graphics.drawable.Drawable;
import android.view.View;
@@ -23,9 +26,6 @@
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
-import androidx.core.animation.Animator;
-import androidx.core.animation.ArgbEvaluator;
-import androidx.core.animation.ValueAnimator;
import androidx.transition.Transition;
import androidx.transition.TransitionValues;
@@ -64,8 +64,8 @@
@Nullable
@Override
public Animator createAnimator(@NonNull ViewGroup sceneRoot,
- @Nullable TransitionValues startValues,
- @Nullable TransitionValues endValues) {
+ @Nullable TransitionValues startValues,
+ @Nullable TransitionValues endValues) {
// This transition can only be applied to views that are on both starting and ending scenes.
if (null == startValues || null == endValues) {
return null;
@@ -91,13 +91,13 @@
// animation runs on the UI thread. The Evaluator controls what type of
// interpolation is done. In this case, an ArgbEvaluator interpolates between two
// #argb values, which are specified as the 2nd and 3rd input arguments.
- ValueAnimator animator = ValueAnimator.ofObject(ArgbEvaluator.getInstance(),
+ ValueAnimator animator = ValueAnimator.ofObject(new ArgbEvaluator(),
startColor.getColor(), endColor.getColor());
// Add an update listener to the Animator object.
animator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
@Override
- public void onAnimationUpdate(@NonNull Animator animation) {
- Object value = ((ValueAnimator) animation).getAnimatedValue();
+ public void onAnimationUpdate(ValueAnimator animation) {
+ Object value = animation.getAnimatedValue();
// Each time the ValueAnimator produces a new frame in the animation, change
// the background color of the target. Ensure that the value isn't null.
if (null != value) {
diff --git a/samples/SupportTransitionDemos/src/main/java/com/example/android/support/transition/widget/ChangeTransformUsage.java b/samples/SupportTransitionDemos/src/main/java/com/example/android/support/transition/widget/ChangeTransformUsage.java
index f3c94e0..6761f59 100644
--- a/samples/SupportTransitionDemos/src/main/java/com/example/android/support/transition/widget/ChangeTransformUsage.java
+++ b/samples/SupportTransitionDemos/src/main/java/com/example/android/support/transition/widget/ChangeTransformUsage.java
@@ -22,6 +22,7 @@
import android.widget.FrameLayout;
import android.widget.LinearLayout;
+import androidx.interpolator.view.animation.FastOutSlowInInterpolator;
import androidx.transition.ArcMotion;
import androidx.transition.ChangeTransform;
import androidx.transition.TransitionManager;
diff --git a/samples/SupportTransitionDemos/src/main/java/com/example/android/support/transition/widget/FragmentTransitionUsage.java b/samples/SupportTransitionDemos/src/main/java/com/example/android/support/transition/widget/FragmentTransitionUsage.java
index 1d6a8b0..fa7016a 100644
--- a/samples/SupportTransitionDemos/src/main/java/com/example/android/support/transition/widget/FragmentTransitionUsage.java
+++ b/samples/SupportTransitionDemos/src/main/java/com/example/android/support/transition/widget/FragmentTransitionUsage.java
@@ -25,6 +25,7 @@
import androidx.core.view.ViewCompat;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
+import androidx.interpolator.view.animation.FastOutSlowInInterpolator;
import androidx.transition.AutoTransition;
import androidx.transition.Fade;
import androidx.transition.Transition;
diff --git a/savedstate/savedstate/api/1.1.0-alpha01.txt b/savedstate/savedstate/api/1.1.0-alpha01.txt
index ff8482b..e11a77c 100644
--- a/savedstate/savedstate/api/1.1.0-alpha01.txt
+++ b/savedstate/savedstate/api/1.1.0-alpha01.txt
@@ -28,5 +28,10 @@
method public androidx.savedstate.SavedStateRegistry getSavedStateRegistry();
}
+ public final class ViewTreeSavedStateRegistryOwner {
+ method public static androidx.savedstate.SavedStateRegistryOwner? get(android.view.View);
+ method public static void set(android.view.View, androidx.savedstate.SavedStateRegistryOwner?);
+ }
+
}
diff --git a/savedstate/savedstate/api/current.txt b/savedstate/savedstate/api/current.txt
index ff8482b..e11a77c 100644
--- a/savedstate/savedstate/api/current.txt
+++ b/savedstate/savedstate/api/current.txt
@@ -28,5 +28,10 @@
method public androidx.savedstate.SavedStateRegistry getSavedStateRegistry();
}
+ public final class ViewTreeSavedStateRegistryOwner {
+ method public static androidx.savedstate.SavedStateRegistryOwner? get(android.view.View);
+ method public static void set(android.view.View, androidx.savedstate.SavedStateRegistryOwner?);
+ }
+
}
diff --git a/savedstate/savedstate/api/public_plus_experimental_1.1.0-alpha01.txt b/savedstate/savedstate/api/public_plus_experimental_1.1.0-alpha01.txt
index ff8482b..e11a77c 100644
--- a/savedstate/savedstate/api/public_plus_experimental_1.1.0-alpha01.txt
+++ b/savedstate/savedstate/api/public_plus_experimental_1.1.0-alpha01.txt
@@ -28,5 +28,10 @@
method public androidx.savedstate.SavedStateRegistry getSavedStateRegistry();
}
+ public final class ViewTreeSavedStateRegistryOwner {
+ method public static androidx.savedstate.SavedStateRegistryOwner? get(android.view.View);
+ method public static void set(android.view.View, androidx.savedstate.SavedStateRegistryOwner?);
+ }
+
}
diff --git a/savedstate/savedstate/api/public_plus_experimental_current.txt b/savedstate/savedstate/api/public_plus_experimental_current.txt
index ff8482b..e11a77c 100644
--- a/savedstate/savedstate/api/public_plus_experimental_current.txt
+++ b/savedstate/savedstate/api/public_plus_experimental_current.txt
@@ -28,5 +28,10 @@
method public androidx.savedstate.SavedStateRegistry getSavedStateRegistry();
}
+ public final class ViewTreeSavedStateRegistryOwner {
+ method public static androidx.savedstate.SavedStateRegistryOwner? get(android.view.View);
+ method public static void set(android.view.View, androidx.savedstate.SavedStateRegistryOwner?);
+ }
+
}
diff --git a/savedstate/savedstate/api/restricted_1.1.0-alpha01.txt b/savedstate/savedstate/api/restricted_1.1.0-alpha01.txt
index ff8482b..e11a77c 100644
--- a/savedstate/savedstate/api/restricted_1.1.0-alpha01.txt
+++ b/savedstate/savedstate/api/restricted_1.1.0-alpha01.txt
@@ -28,5 +28,10 @@
method public androidx.savedstate.SavedStateRegistry getSavedStateRegistry();
}
+ public final class ViewTreeSavedStateRegistryOwner {
+ method public static androidx.savedstate.SavedStateRegistryOwner? get(android.view.View);
+ method public static void set(android.view.View, androidx.savedstate.SavedStateRegistryOwner?);
+ }
+
}
diff --git a/savedstate/savedstate/api/restricted_current.txt b/savedstate/savedstate/api/restricted_current.txt
index ff8482b..e11a77c 100644
--- a/savedstate/savedstate/api/restricted_current.txt
+++ b/savedstate/savedstate/api/restricted_current.txt
@@ -28,5 +28,10 @@
method public androidx.savedstate.SavedStateRegistry getSavedStateRegistry();
}
+ public final class ViewTreeSavedStateRegistryOwner {
+ method public static androidx.savedstate.SavedStateRegistryOwner? get(android.view.View);
+ method public static void set(android.view.View, androidx.savedstate.SavedStateRegistryOwner?);
+ }
+
}
diff --git a/savedstate/savedstate/src/androidTest/java/androidx/savedstate/ViewTreeSavedStateRegistryOwnerTest.java b/savedstate/savedstate/src/androidTest/java/androidx/savedstate/ViewTreeSavedStateRegistryOwnerTest.java
new file mode 100644
index 0000000..9fc0e4a
--- /dev/null
+++ b/savedstate/savedstate/src/androidTest/java/androidx/savedstate/ViewTreeSavedStateRegistryOwnerTest.java
@@ -0,0 +1,125 @@
+/*
+ * Copyright 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT 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 static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNull;
+
+import android.content.Context;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.FrameLayout;
+
+import androidx.annotation.NonNull;
+import androidx.lifecycle.Lifecycle;
+import androidx.test.ext.junit.runners.AndroidJUnit4;
+import androidx.test.filters.SmallTest;
+import androidx.test.platform.app.InstrumentationRegistry;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+@RunWith(AndroidJUnit4.class)
+@SmallTest
+public class ViewTreeSavedStateRegistryOwnerTest {
+
+ /**
+ * Tests that a direct set/get on a single view survives a round trip
+ */
+ @Test
+ public void setGetSameView() {
+ final View v = new View(InstrumentationRegistry.getInstrumentation().getContext());
+ final SavedStateRegistryOwner dummyOwner = new DummyOwner();
+
+ assertNull("initial SavedStateRegistryOwner expects null",
+ ViewTreeSavedStateRegistryOwner.get(v));
+
+ ViewTreeSavedStateRegistryOwner.set(v, dummyOwner);
+
+ assertEquals("get the SavedStateRegistryOwner set directly", dummyOwner,
+ ViewTreeSavedStateRegistryOwner.get(v));
+ }
+
+ /**
+ * Tests that the owner set on a root of a subhierarchy is seen by both direct children
+ * and other descendants
+ */
+ @Test
+ public void getAncestorOwner() {
+ final Context context = InstrumentationRegistry.getInstrumentation().getContext();
+ final ViewGroup root = new FrameLayout(context);
+ final ViewGroup parent = new FrameLayout(context);
+ final View child = new View(context);
+ root.addView(parent);
+ parent.addView(child);
+
+ assertNull("initial SavedStateRegistryOwner expects null",
+ ViewTreeSavedStateRegistryOwner.get(child));
+
+ final SavedStateRegistryOwner dummyOwner = new DummyOwner();
+ ViewTreeSavedStateRegistryOwner.set(root, dummyOwner);
+
+ assertEquals("root sees owner", dummyOwner, ViewTreeSavedStateRegistryOwner.get(root));
+ assertEquals("direct child sees owner", dummyOwner,
+ ViewTreeSavedStateRegistryOwner.get(parent));
+ assertEquals("grandchild sees owner", dummyOwner,
+ ViewTreeSavedStateRegistryOwner.get(child));
+ }
+
+ /**
+ * Tests that a new owner set between a root and a descendant is seen by the descendant
+ * instead of the root value
+ */
+ @Test
+ public void shadowedOwner() {
+ final Context context = InstrumentationRegistry.getInstrumentation().getContext();
+ final ViewGroup root = new FrameLayout(context);
+ final ViewGroup parent = new FrameLayout(context);
+ final View child = new View(context);
+ root.addView(parent);
+ parent.addView(child);
+
+ assertNull("initial SavedStateRegistryOwner expects null",
+ ViewTreeSavedStateRegistryOwner.get(child));
+
+ final SavedStateRegistryOwner rootDummyOwner = new DummyOwner();
+ ViewTreeSavedStateRegistryOwner.set(root, rootDummyOwner);
+
+ final SavedStateRegistryOwner parentDummyOwner = new DummyOwner();
+ ViewTreeSavedStateRegistryOwner.set(parent, parentDummyOwner);
+
+ assertEquals("root sees owner", rootDummyOwner, ViewTreeSavedStateRegistryOwner.get(root));
+ assertEquals("direct child sees owner", parentDummyOwner,
+ ViewTreeSavedStateRegistryOwner.get(parent));
+ assertEquals("grandchild sees owner", parentDummyOwner,
+ ViewTreeSavedStateRegistryOwner.get(child));
+ }
+
+ static class DummyOwner implements SavedStateRegistryOwner {
+ @NonNull
+ @Override
+ public Lifecycle getLifecycle() {
+ throw new UnsupportedOperationException("not a real SavedStateRegistryOwner");
+ }
+
+ @NonNull
+ @Override
+ public SavedStateRegistry getSavedStateRegistry() {
+ throw new UnsupportedOperationException("not a real SavedStateRegistryOwner");
+ }
+ }
+}
diff --git a/savedstate/savedstate/src/main/java/androidx/savedstate/SavedStateRegistryOwner.java b/savedstate/savedstate/src/main/java/androidx/savedstate/SavedStateRegistryOwner.java
index 18b3fb3..5de2ce4 100644
--- a/savedstate/savedstate/src/main/java/androidx/savedstate/SavedStateRegistryOwner.java
+++ b/savedstate/savedstate/src/main/java/androidx/savedstate/SavedStateRegistryOwner.java
@@ -22,6 +22,8 @@
/**
* A scope that owns {@link SavedStateRegistry}
+ *
+ * @see ViewTreeSavedStateRegistryOwner
*/
public interface SavedStateRegistryOwner extends LifecycleOwner {
/**
diff --git a/savedstate/savedstate/src/main/java/androidx/savedstate/ViewTreeSavedStateRegistryOwner.java b/savedstate/savedstate/src/main/java/androidx/savedstate/ViewTreeSavedStateRegistryOwner.java
new file mode 100644
index 0000000..e82e908
--- /dev/null
+++ b/savedstate/savedstate/src/main/java/androidx/savedstate/ViewTreeSavedStateRegistryOwner.java
@@ -0,0 +1,82 @@
+/*
+ * Copyright 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT 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.view.View;
+import android.view.ViewParent;
+
+import androidx.annotation.NonNull;
+import androidx.annotation.Nullable;
+
+/**
+ * Accessors for finding a view tree-local {@link SavedStateRegistryOwner} that allows managing the
+ * saving state using {@link SavedStateRegistry} for the given view.
+ */
+public final class ViewTreeSavedStateRegistryOwner {
+ private ViewTreeSavedStateRegistryOwner() {
+ // No instances
+ }
+
+ /**
+ * Set the {@link SavedStateRegistryOwner} responsible for managing the saved state for the
+ * given {@link View}.
+ * Calls to {@link #get(View)} from this view or descendants will return {@code owner}.
+ *
+ * This is is automatically set for you in the common cases of using fragments or
+ * ComponentActivity.
+ *
+ * <p>This should only be called by constructs such as activities or fragments that manage
+ * a view tree and their saved state through a {@link SavedStateRegistryOwner}. Callers
+ * should only set a {@link SavedStateRegistryOwner} that will be <em>stable.</em> The
+ * associated {@link SavedStateRegistry} should be cleared if the view tree is removed and is
+ * not guaranteed to later become reattached to a window.</p>
+ *
+ * @param view Root view managed by {@link SavedStateRegistryOwner}
+ * @param owner The {@link SavedStateRegistryOwner} responsible for managing the
+ * saved state for the given view
+ */
+ public static void set(@NonNull View view, @Nullable SavedStateRegistryOwner owner) {
+ view.setTag(R.id.view_tree_saved_state_registry_owner, owner);
+ }
+
+ /**
+ * Retrieve the {@link SavedStateRegistryOwner} responsible for managing the saved state
+ * for the given {@link View}.
+ * This may be used to save or restore the state associated with the view.
+ *
+ * The returned {@link SavedStateRegistryOwner} is managing all the Views within the Fragment
+ * or Activity the given {@link View} is added to.
+ *
+ * @param view View to fetch a {@link SavedStateRegistryOwner} for
+ * @return The {@link SavedStateRegistryOwner} responsible for managing the saved state for
+ * the given view and/or some subset of its ancestors
+ */
+ @Nullable
+ public static SavedStateRegistryOwner get(@NonNull View view) {
+ SavedStateRegistryOwner found = (SavedStateRegistryOwner) view.getTag(
+ R.id.view_tree_saved_state_registry_owner);
+ if (found != null) return found;
+ ViewParent parent = view.getParent();
+ while (found == null && parent instanceof View) {
+ final View parentView = (View) parent;
+ found = (SavedStateRegistryOwner) parentView.getTag(
+ R.id.view_tree_saved_state_registry_owner);
+ parent = parentView.getParent();
+ }
+ return found;
+ }
+}
diff --git a/savedstate/savedstate/src/main/res/values/ids.xml b/savedstate/savedstate/src/main/res/values/ids.xml
new file mode 100644
index 0000000..fdea827
--- /dev/null
+++ b/savedstate/savedstate/src/main/res/values/ids.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Copyright 2020 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT 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>
+ <id name="view_tree_saved_state_registry_owner" />
+</resources>
\ No newline at end of file
diff --git a/security/crypto/src/main/java/androidx/security/crypto/EncryptedFile.java b/security/crypto/src/main/java/androidx/security/crypto/EncryptedFile.java
index 77eddfe..8170241 100644
--- a/security/crypto/src/main/java/androidx/security/crypto/EncryptedFile.java
+++ b/security/crypto/src/main/java/androidx/security/crypto/EncryptedFile.java
@@ -92,12 +92,12 @@
*/
public enum FileEncryptionScheme {
/**
- * The file content is encrypted using {@link StreamingAead} with AES-GCM, with the
+ * The file content is encrypted using <a href="https://google.github.io/tink/javadoc/tink/1.3.0/com/google/crypto/tink/streamingaead/StreamingAead.html">StreamingAead</a> with AES-GCM, with the
* file name as associated data.
*
* For more information please see the Tink documentation:
*
- * {@link StreamingAeadKeyTemplates}.AES256_GCM_HKDF_4KB
+ * <a href="https://google.github.io/tink/javadoc/tink/1.3.0/com/google/crypto/tink/streamingaead/StreamingAeadKeyTemplates.html">StreamingAeadKeyTemplates</a>.AES256_GCM_HKDF_4KB
*/
AES256_GCM_HKDF_4KB(StreamingAeadKeyTemplates.AES256_GCM_HKDF_4KB);
diff --git a/security/crypto/src/main/java/androidx/security/crypto/EncryptedSharedPreferences.java b/security/crypto/src/main/java/androidx/security/crypto/EncryptedSharedPreferences.java
index e65cd68..c627a0a 100644
--- a/security/crypto/src/main/java/androidx/security/crypto/EncryptedSharedPreferences.java
+++ b/security/crypto/src/main/java/androidx/security/crypto/EncryptedSharedPreferences.java
@@ -141,7 +141,7 @@
*
* For more information please see the Tink documentation:
*
- * {@link DeterministicAeadKeyTemplates}.AES256_SIV
+ * <a href="https://google.github.io/tink/javadoc/tink/1.3.0/com/google/crypto/tink/daead/DeterministicAeadKeyTemplates.html">DeterministicAeadKeyTemplates</a>.AES256_SIV
*/
AES256_SIV(DeterministicAeadKeyTemplates.AES256_SIV);
@@ -165,7 +165,7 @@
*
* For more information please see the Tink documentation:
*
- * {@link AeadKeyTemplates}.AES256_GCM
+ * <a href="https://google.github.io/tink/javadoc/tink/1.3.0/com/google/crypto/tink/aead/AeadKeyTemplates.html">AeadKeyTemplates</a>.AES256_GCM
*/
AES256_GCM(AeadKeyTemplates.AES256_GCM);
diff --git a/serialization/serialization-runtime/api/public_plus_experimental_1.0.0-alpha01.txt b/serialization/serialization-runtime/api/public_plus_experimental_1.0.0-alpha01.txt
index 2a70d43..cbd277d 100644
--- a/serialization/serialization-runtime/api/public_plus_experimental_1.0.0-alpha01.txt
+++ b/serialization/serialization-runtime/api/public_plus_experimental_1.0.0-alpha01.txt
@@ -1,5 +1,5 @@
// Signature format: 3.0
-package @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) androidx.serialization.runtime.internal {
+package @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) androidx.serialization.runtime.internal {
public interface CollectionFactory<C extends java.util.Collection<?>> {
method public C create(int);
diff --git a/serialization/serialization-runtime/api/public_plus_experimental_current.txt b/serialization/serialization-runtime/api/public_plus_experimental_current.txt
index 2a70d43..cbd277d 100644
--- a/serialization/serialization-runtime/api/public_plus_experimental_current.txt
+++ b/serialization/serialization-runtime/api/public_plus_experimental_current.txt
@@ -1,5 +1,5 @@
// Signature format: 3.0
-package @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) androidx.serialization.runtime.internal {
+package @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) androidx.serialization.runtime.internal {
public interface CollectionFactory<C extends java.util.Collection<?>> {
method public C create(int);
diff --git a/serialization/serialization-runtime/api/restricted_1.0.0-alpha01.txt b/serialization/serialization-runtime/api/restricted_1.0.0-alpha01.txt
index 2a70d43..cbd277d 100644
--- a/serialization/serialization-runtime/api/restricted_1.0.0-alpha01.txt
+++ b/serialization/serialization-runtime/api/restricted_1.0.0-alpha01.txt
@@ -1,5 +1,5 @@
// Signature format: 3.0
-package @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) androidx.serialization.runtime.internal {
+package @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) androidx.serialization.runtime.internal {
public interface CollectionFactory<C extends java.util.Collection<?>> {
method public C create(int);
diff --git a/serialization/serialization-runtime/api/restricted_current.txt b/serialization/serialization-runtime/api/restricted_current.txt
index 2a70d43..cbd277d 100644
--- a/serialization/serialization-runtime/api/restricted_current.txt
+++ b/serialization/serialization-runtime/api/restricted_current.txt
@@ -1,5 +1,5 @@
// Signature format: 3.0
-package @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) androidx.serialization.runtime.internal {
+package @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) androidx.serialization.runtime.internal {
public interface CollectionFactory<C extends java.util.Collection<?>> {
method public C create(int);
diff --git a/settings.gradle b/settings.gradle
index f532734..1939dd9 100644
--- a/settings.gradle
+++ b/settings.gradle
@@ -291,6 +291,7 @@
includeProject(":sqlite:sqlite-framework", "sqlite/sqlite-framework")
includeProject(":sqlite:sqlite-inspection", "sqlite/sqlite-inspection")
includeProject(":sqlite:integration-tests:inspection-room-testapp", "sqlite/integration-tests/inspection-room-testapp")
+includeProject(":sqlite:integration-tests:inspection-sqldelight-testapp", "sqlite/integration-tests/inspection-sqldelight-testapp")
includeProject(":swiperefreshlayout:swiperefreshlayout", "swiperefreshlayout/swiperefreshlayout")
includeProject(":test-screenshot", "test/screenshot")
includeProject(":test-screenshot-proto", "test/screenshot/proto")
diff --git a/sqlite/integration-tests/inspection-sqldelight-testapp/build.gradle b/sqlite/integration-tests/inspection-sqldelight-testapp/build.gradle
new file mode 100644
index 0000000..0e47e38
--- /dev/null
+++ b/sqlite/integration-tests/inspection-sqldelight-testapp/build.gradle
@@ -0,0 +1,47 @@
+/*
+ * Copyright (C) 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT 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.*
+
+plugins {
+ id("AndroidXPlugin")
+ id("com.android.application")
+ id("org.jetbrains.kotlin.android")
+}
+
+dependencies {
+ implementation(KOTLIN_STDLIB)
+ implementation(SQLDELIGHT_ANDROID)
+ androidTestImplementation(JUNIT)
+ androidTestImplementation(SQLDELIGHT_COROUTINES_EXT)
+ androidTestImplementation(KOTLIN_COROUTINES_ANDROID)
+ androidTestImplementation(ANDROIDX_TEST_EXT_KTX)
+ androidTestImplementation(TRUTH)
+ androidTestImplementation(ANDROIDX_TEST_RUNNER)
+ androidTestImplementation(project(":sqlite:sqlite-inspection"))
+ androidTestImplementation(project(":inspection:inspection-testing"))
+ androidTestImplementation("com.google.protobuf:protobuf-javalite:3.10.0")
+}
+
+android {
+ sourceSets {
+ main.java.srcDirs += ["src/main/generated"]
+ }
+ defaultConfig {
+ // studio pipeline works only starting with Android O
+ minSdkVersion 26
+ }
+}
\ No newline at end of file
diff --git a/sqlite/integration-tests/inspection-sqldelight-testapp/src/androidTest/java/androidx/sqlite/inspection/SqlDelightInvalidationTest.kt b/sqlite/integration-tests/inspection-sqldelight-testapp/src/androidTest/java/androidx/sqlite/inspection/SqlDelightInvalidationTest.kt
new file mode 100644
index 0000000..78cb5b6
--- /dev/null
+++ b/sqlite/integration-tests/inspection-sqldelight-testapp/src/androidTest/java/androidx/sqlite/inspection/SqlDelightInvalidationTest.kt
@@ -0,0 +1,178 @@
+/*
+ * Copyright 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT 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.sqlite.inspection
+
+import android.database.sqlite.SQLiteDatabase
+import androidx.inspection.Connection
+import androidx.inspection.InspectorEnvironment
+import androidx.inspection.InspectorFactory
+import androidx.inspection.testing.InspectorTester
+import androidx.sqlite.db.SupportSQLiteDatabase
+import androidx.sqlite.inspection.SqliteInspectorProtocol.Command
+import androidx.sqlite.inspection.SqliteInspectorProtocol.QueryCommand
+import androidx.sqlite.inspection.SqliteInspectorProtocol.TrackDatabasesCommand
+import androidx.sqlite.inspection.sqldeligttestapp.Database
+import androidx.sqlite.inspection.test.TestEntity
+import androidx.test.core.app.ApplicationProvider
+import androidx.test.ext.junit.runners.AndroidJUnit4
+import com.google.common.truth.Truth.assertThat
+import com.google.common.truth.Truth.assertWithMessage
+import com.squareup.sqldelight.Query
+import com.squareup.sqldelight.android.AndroidSqliteDriver
+import com.squareup.sqldelight.db.SqlDriver
+import com.squareup.sqldelight.runtime.coroutines.asFlow
+import com.squareup.sqldelight.runtime.coroutines.mapToList
+import kotlinx.coroutines.ExperimentalCoroutinesApi
+import kotlinx.coroutines.FlowPreview
+import kotlinx.coroutines.flow.produceIn
+import kotlinx.coroutines.flow.take
+import kotlinx.coroutines.runBlocking
+import org.junit.After
+import org.junit.Before
+import org.junit.Test
+import org.junit.runner.RunWith
+import java.util.concurrent.Executors
+
+@ExperimentalCoroutinesApi
+@RunWith(AndroidJUnit4::class)
+@FlowPreview
+class SqlDelightInvalidationTest {
+
+ lateinit var driver: SqlDriver
+ lateinit var openedDb: SupportSQLiteDatabase
+
+ @Before
+ fun setup() {
+ driver = AndroidSqliteDriver(
+ schema = Database.Schema,
+ context = ApplicationProvider.getApplicationContext(),
+ callback = object : AndroidSqliteDriver.Callback(Database.Schema) {
+ override fun onCreate(db: SupportSQLiteDatabase) {
+ openedDb = db
+ super.onCreate(db)
+ }
+ })
+ }
+
+ @Test
+ fun test() {
+ runBlocking {
+ val dao = Database(driver).testEntityQueries
+ dao.insertOrReplace("one")
+ val sqliteDb = openedDb.getSqliteDb()
+ val query = dao.selectAll()
+ val tester = sqliteInspectorTester(TestInspectorEnvironment(sqliteDb, listOf(query)))
+ val updates = query.asFlow().mapToList().take(2).produceIn(this)
+
+ val firstExpected = TestEntity.Impl(1, "one")
+ val secondExpected = TestEntity.Impl(2, "foo")
+ assertThat(updates.receive()).isEqualTo(listOf(firstExpected))
+
+ val startTrackingCommand = Command.newBuilder().setTrackDatabases(
+ TrackDatabasesCommand.getDefaultInstance()
+ ).build()
+
+ tester.sendCommand(startTrackingCommand.toByteArray())
+
+ val insertQuery = """INSERT INTO TestEntity VALUES(2, "foo")"""
+ val insertCommand = Command.newBuilder().setQuery(
+ QueryCommand.newBuilder()
+ .setDatabaseId(1)
+ .setQuery(insertQuery)
+ .build()
+ ).build()
+ val responseBytes = tester.sendCommand(insertCommand.toByteArray())
+ val response = SqliteInspectorProtocol.Response.parseFrom(responseBytes)
+ assertWithMessage("test sanity, insert query should succeed")
+ .that(response.hasErrorOccurred())
+ .isFalse()
+
+ assertThat(updates.receive()).isEqualTo(
+ listOf(
+ firstExpected,
+ secondExpected
+ )
+ )
+ }
+ }
+
+ @After
+ fun tearDown() {
+ driver.close()
+ }
+}
+
+/**
+ * extract the framework sqlite database instance from a room database via reflection.
+ */
+private fun SupportSQLiteDatabase.getSqliteDb(): SQLiteDatabase {
+ // this runs with defaults so we can extract db from it until inspection supports support
+ // instances directly
+ return this::class.java.getDeclaredField("mDelegate").let {
+ it.isAccessible = true
+ it.get(this)
+ } as SQLiteDatabase
+}
+
+suspend fun sqliteInspectorTester(environment: InspectorEnvironment) = InspectorTester(
+ inspectorId = "test",
+ environment = environment,
+ factoryOverride = object : InspectorFactory<SqliteInspector>("test") {
+ override fun createInspector(
+ connection: Connection,
+ environment: InspectorEnvironment
+ ): SqliteInspector {
+ return SqliteInspector(
+ connection,
+ environment,
+ Executors.newSingleThreadExecutor(),
+ Executors.newSingleThreadScheduledExecutor()
+ )
+ }
+ }
+)
+
+@Suppress("UNCHECKED_CAST")
+class TestInspectorEnvironment(
+ private val sqliteDb: SQLiteDatabase,
+ private val queries: List<Query<*>>
+) : InspectorEnvironment {
+ override fun registerEntryHook(
+ originClass: Class<*>,
+ originMethod: String,
+ entryHook: InspectorEnvironment.EntryHook
+ ) {
+ // no-op
+ }
+
+ override fun <T : Any?> findInstances(clazz: Class<T>): List<T> {
+ if (clazz.isAssignableFrom(Query::class.java)) {
+ return queries as List<T>
+ } else if (clazz.isAssignableFrom(SQLiteDatabase::class.java)) {
+ return listOf(sqliteDb as T)
+ }
+ return emptyList()
+ }
+
+ override fun <T : Any?> registerExitHook(
+ originClass: Class<*>,
+ originMethod: String,
+ exitHook: InspectorEnvironment.ExitHook<T>
+ ) {
+ // no-op
+ }
+}
\ No newline at end of file
diff --git a/sqlite/integration-tests/inspection-sqldelight-testapp/src/main/AndroidManifest.xml b/sqlite/integration-tests/inspection-sqldelight-testapp/src/main/AndroidManifest.xml
new file mode 100644
index 0000000..c44e080
--- /dev/null
+++ b/sqlite/integration-tests/inspection-sqldelight-testapp/src/main/AndroidManifest.xml
@@ -0,0 +1,21 @@
+<!--
+ ~ Copyright (C) 2020 The Android Open Source Project
+ ~
+ ~ Licensed under the Apache License, Version 2.0 (the "License");
+ ~ you may not use this file except in compliance with the License.
+ ~ You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing, software
+ ~ distributed under the License is distributed on an "AS IS" BASIS,
+ ~ WITHOUT 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.sqlite.inspection.sqldeligttestapp">
+ <application>
+ </application>
+</manifest>
diff --git a/sqlite/integration-tests/inspection-sqldelight-testapp/src/main/generated/README.md b/sqlite/integration-tests/inspection-sqldelight-testapp/src/main/generated/README.md
new file mode 100644
index 0000000..2cd242a
--- /dev/null
+++ b/sqlite/integration-tests/inspection-sqldelight-testapp/src/main/generated/README.md
@@ -0,0 +1,3 @@
+Unfortunately sqldelight's plugin and dokka have a conflict with two versions of
+com.intellij.* files presented at the same time in the classpath. To avoid constant search for
+compatible version the generated code was simply committed.
\ No newline at end of file
diff --git a/sqlite/integration-tests/inspection-sqldelight-testapp/src/main/generated/androidx/sqlite/inspection/sqldeligttestapp/Database.kt b/sqlite/integration-tests/inspection-sqldelight-testapp/src/main/generated/androidx/sqlite/inspection/sqldeligttestapp/Database.kt
new file mode 100644
index 0000000..bebc2ab
--- /dev/null
+++ b/sqlite/integration-tests/inspection-sqldelight-testapp/src/main/generated/androidx/sqlite/inspection/sqldeligttestapp/Database.kt
@@ -0,0 +1,34 @@
+/*
+ * Copyright 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT 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.sqlite.inspection.sqldeligttestapp
+
+import androidx.sqlite.inspection.test.TestEntityQueries
+import androidx.sqlite.inspection.sqldeligttestapp.app.newInstance
+import androidx.sqlite.inspection.sqldeligttestapp.app.schema
+import com.squareup.sqldelight.Transacter
+import com.squareup.sqldelight.db.SqlDriver
+
+interface Database : Transacter {
+ val testEntityQueries: TestEntityQueries
+
+ companion object {
+ val Schema: SqlDriver.Schema
+ get() = Database::class.schema
+
+ operator fun invoke(driver: SqlDriver): Database = Database::class.newInstance(driver)
+ }
+}
diff --git a/sqlite/integration-tests/inspection-sqldelight-testapp/src/main/generated/androidx/sqlite/inspection/sqldeligttestapp/app/DatabaseImpl.kt b/sqlite/integration-tests/inspection-sqldelight-testapp/src/main/generated/androidx/sqlite/inspection/sqldeligttestapp/app/DatabaseImpl.kt
new file mode 100644
index 0000000..1c56ea4
--- /dev/null
+++ b/sqlite/integration-tests/inspection-sqldelight-testapp/src/main/generated/androidx/sqlite/inspection/sqldeligttestapp/app/DatabaseImpl.kt
@@ -0,0 +1,109 @@
+/*
+ * Copyright 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT 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.sqlite.inspection.sqldeligttestapp.app
+
+import androidx.sqlite.inspection.test.TestEntity
+import androidx.sqlite.inspection.test.TestEntityQueries
+import androidx.sqlite.inspection.sqldeligttestapp.Database
+import com.squareup.sqldelight.Query
+import com.squareup.sqldelight.TransacterImpl
+import com.squareup.sqldelight.db.SqlDriver
+import com.squareup.sqldelight.internal.copyOnWriteList
+import kotlin.Any
+import kotlin.Int
+import kotlin.Long
+import kotlin.String
+import kotlin.collections.MutableList
+import kotlin.reflect.KClass
+
+internal val KClass<Database>.schema: SqlDriver.Schema
+ get() = DatabaseImpl.Schema
+
+internal fun KClass<Database>.newInstance(driver: SqlDriver): Database =
+ DatabaseImpl(driver)
+
+private class DatabaseImpl(
+ driver: SqlDriver
+) : TransacterImpl(driver),
+ Database {
+ override val testEntityQueries: TestEntityQueriesImpl =
+ TestEntityQueriesImpl(
+ this,
+ driver
+ )
+
+ object Schema : SqlDriver.Schema {
+ override val version: Int
+ get() = 1
+
+ override fun create(driver: SqlDriver) {
+ driver.execute(
+ null, """
+ |CREATE TABLE TestEntity(
+ | id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
+ | value TEXT NOT NULL
+ |)
+ """.trimMargin(), 0
+ )
+ }
+
+ override fun migrate(
+ driver: SqlDriver,
+ oldVersion: Int,
+ newVersion: Int
+ ) {
+ }
+ }
+}
+
+private class TestEntityQueriesImpl(
+ private val database: DatabaseImpl,
+ private val driver: SqlDriver
+) : TransacterImpl(driver), TestEntityQueries {
+ internal val selectAll: MutableList<Query<*>> = copyOnWriteList()
+
+ override fun <T : Any> selectAll(mapper: (id: Long, value: String) -> T): Query<T> =
+ Query(
+ 186750743,
+ selectAll,
+ driver,
+ "TestEntity.sq",
+ "selectAll",
+ "SELECT * FROM TestEntity"
+ ) { cursor ->
+ mapper(
+ cursor.getLong(0)!!,
+ cursor.getString(1)!!
+ )
+ }
+
+ override fun selectAll(): Query<TestEntity> = selectAll(TestEntity::Impl)
+
+ override fun insertOrReplace(value: String) {
+ driver.execute(
+ -2020431062, """
+ |INSERT OR REPLACE INTO TestEntity(
+ | value
+ |)
+ |VALUES (?1)
+ """.trimMargin(), 1
+ ) {
+ bindString(1, value)
+ }
+ notifyQueries(-2020431062, { database.testEntityQueries.selectAll })
+ }
+}
diff --git a/sqlite/integration-tests/inspection-sqldelight-testapp/src/main/generated/androidx/sqlite/inspection/test/TestEntity.kt b/sqlite/integration-tests/inspection-sqldelight-testapp/src/main/generated/androidx/sqlite/inspection/test/TestEntity.kt
new file mode 100644
index 0000000..12d65c1
--- /dev/null
+++ b/sqlite/integration-tests/inspection-sqldelight-testapp/src/main/generated/androidx/sqlite/inspection/test/TestEntity.kt
@@ -0,0 +1,22 @@
+package androidx.sqlite.inspection.test
+
+import kotlin.Long
+import kotlin.String
+
+interface TestEntity {
+ val id: Long
+
+ val value: String
+
+ data class Impl(
+ override val id: Long,
+ override val value: String
+ ) : TestEntity {
+ override fun toString(): String = """
+ |TestEntity.Impl [
+ | id: $id
+ | value: $value
+ |]
+ """.trimMargin()
+ }
+}
diff --git a/sqlite/integration-tests/inspection-sqldelight-testapp/src/main/generated/androidx/sqlite/inspection/test/TestEntityQueries.kt b/sqlite/integration-tests/inspection-sqldelight-testapp/src/main/generated/androidx/sqlite/inspection/test/TestEntityQueries.kt
new file mode 100644
index 0000000..91ebe2c
--- /dev/null
+++ b/sqlite/integration-tests/inspection-sqldelight-testapp/src/main/generated/androidx/sqlite/inspection/test/TestEntityQueries.kt
@@ -0,0 +1,15 @@
+package androidx.sqlite.inspection.test
+
+import com.squareup.sqldelight.Query
+import com.squareup.sqldelight.Transacter
+import kotlin.Any
+import kotlin.Long
+import kotlin.String
+
+interface TestEntityQueries : Transacter {
+ fun <T : Any> selectAll(mapper: (id: Long, value: String) -> T): Query<T>
+
+ fun selectAll(): Query<TestEntity>
+
+ fun insertOrReplace(value: String)
+}
diff --git a/sqlite/integration-tests/inspection-sqldelight-testapp/src/main/sqldelight/androidx/sqlite/inspection/test/TestEntity.sq b/sqlite/integration-tests/inspection-sqldelight-testapp/src/main/sqldelight/androidx/sqlite/inspection/test/TestEntity.sq
new file mode 100644
index 0000000..ed491b1
--- /dev/null
+++ b/sqlite/integration-tests/inspection-sqldelight-testapp/src/main/sqldelight/androidx/sqlite/inspection/test/TestEntity.sq
@@ -0,0 +1,13 @@
+CREATE TABLE TestEntity(
+ id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
+ value TEXT NOT NULL
+);
+
+selectAll:
+SELECT * FROM TestEntity;
+
+insertOrReplace:
+INSERT OR REPLACE INTO TestEntity(
+ value
+)
+VALUES (?);
diff --git a/sqlite/sqlite-inspection/src/androidTest/java/androidx/sqlite/inspection/RoomInvalidationRegistryWithoutRoomTest.kt b/sqlite/sqlite-inspection/src/androidTest/java/androidx/sqlite/inspection/RoomInvalidationRegistryWithoutRoomTest.kt
index 22d7cbc..c1a0759 100644
--- a/sqlite/sqlite-inspection/src/androidTest/java/androidx/sqlite/inspection/RoomInvalidationRegistryWithoutRoomTest.kt
+++ b/sqlite/sqlite-inspection/src/androidTest/java/androidx/sqlite/inspection/RoomInvalidationRegistryWithoutRoomTest.kt
@@ -55,8 +55,8 @@
}
}
val tracker = RoomInvalidationRegistry(env)
- tracker.triggerInvalidationChecks()
+ tracker.triggerInvalidations()
tracker.invalidateCache()
- tracker.triggerInvalidationChecks()
+ tracker.triggerInvalidations()
}
}
diff --git a/sqlite/sqlite-inspection/src/main/java/androidx/sqlite/inspection/RoomInvalidationRegistry.java b/sqlite/sqlite-inspection/src/main/java/androidx/sqlite/inspection/RoomInvalidationRegistry.java
index 8a861ad..08cf69e 100644
--- a/sqlite/sqlite-inspection/src/main/java/androidx/sqlite/inspection/RoomInvalidationRegistry.java
+++ b/sqlite/sqlite-inspection/src/main/java/androidx/sqlite/inspection/RoomInvalidationRegistry.java
@@ -63,7 +63,7 @@
* <p>
* If the list of InvalidationTracker instances are not cached, this will do a lookup.
*/
- void triggerInvalidationChecks() {
+ void triggerInvalidations() {
if (mInvoker == null) {
return;
}
diff --git a/sqlite/sqlite-inspection/src/main/java/androidx/sqlite/inspection/SqlDelightInvalidation.java b/sqlite/sqlite-inspection/src/main/java/androidx/sqlite/inspection/SqlDelightInvalidation.java
new file mode 100644
index 0000000..9f7ad85
--- /dev/null
+++ b/sqlite/sqlite-inspection/src/main/java/androidx/sqlite/inspection/SqlDelightInvalidation.java
@@ -0,0 +1,73 @@
+/*
+ * Copyright 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT 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.sqlite.inspection;
+
+import androidx.annotation.NonNull;
+import androidx.inspection.InspectorEnvironment;
+
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.util.List;
+
+class SqlDelightInvalidation {
+ private static final String SQLDELIGHT_QUERY_CLASS_NAME = "com.squareup.sqldelight.Query";
+ private static final String SQLDELIGHT_NOTIFY_METHOD_NAME = "notifyDataChanged";
+
+ private final InspectorEnvironment mEnvironment;
+ private final Class<?> mQueryClass;
+ private final Method mNotifyDataChangeMethod;
+
+ SqlDelightInvalidation(InspectorEnvironment environment, Class<?> queryClass,
+ Method notifyDataChangeMethod) {
+ mQueryClass = queryClass;
+ mEnvironment = environment;
+ mNotifyDataChangeMethod = notifyDataChangeMethod;
+ }
+
+ @NonNull
+ static SqlDelightInvalidation create(@NonNull InspectorEnvironment environment) {
+ ClassLoader classLoader = SqlDelightInvalidation.class.getClassLoader();
+ try {
+ Class<?> queryClass = classLoader.loadClass(SQLDELIGHT_QUERY_CLASS_NAME);
+ Method notifyMethod = queryClass.getMethod(SQLDELIGHT_NOTIFY_METHOD_NAME);
+ return new SqlDelightInvalidation(environment, queryClass, notifyMethod);
+ } catch (ClassNotFoundException | NoSuchMethodException e) {
+ return new SqlDelightInvalidation(environment, null, null);
+ }
+ }
+
+ void triggerInvalidations() {
+ if (mQueryClass == null || mNotifyDataChangeMethod == null) {
+ return;
+ }
+ // invalidating all queries because we can't say which ones were actually affected.
+ List<?> queries = mEnvironment.findInstances(mQueryClass);
+ for (Object query: queries) {
+ notifyDataChanged(query);
+ }
+ }
+
+ private void notifyDataChanged(Object query) {
+ try {
+ mNotifyDataChangeMethod.invoke(query);
+ } catch (IllegalAccessException | InvocationTargetException e) {
+ // ok it didn't work out for us,
+ // in first version we don't have a special UI around it,
+ // so we can't do much about it.
+ }
+ }
+}
diff --git a/sqlite/sqlite-inspection/src/main/java/androidx/sqlite/inspection/SqliteInspector.java b/sqlite/sqlite-inspection/src/main/java/androidx/sqlite/inspection/SqliteInspector.java
index a8cd77c..89b10c1 100644
--- a/sqlite/sqlite-inspection/src/main/java/androidx/sqlite/inspection/SqliteInspector.java
+++ b/sqlite/sqlite-inspection/src/main/java/androidx/sqlite/inspection/SqliteInspector.java
@@ -16,6 +16,8 @@
package androidx.sqlite.inspection;
+import static android.database.DatabaseUtils.getSqlStatementType;
+
import static androidx.sqlite.inspection.SqliteInspectionExecutors.directExecutor;
import android.annotation.SuppressLint;
@@ -155,6 +157,9 @@
*/
private final RoomInvalidationRegistry mRoomInvalidationRegistry;
+ @NonNull
+ private final SqlDelightInvalidation mSqlDelightInvalidation;
+
SqliteInspector(@NonNull Connection connection, InspectorEnvironment environment,
Executor ioExecutor, ScheduledExecutorService scheduledExecutor) {
super(connection);
@@ -162,6 +167,7 @@
mIOExecutor = ioExecutor;
mScheduledExecutor = scheduledExecutor;
mRoomInvalidationRegistry = new RoomInvalidationRegistry(mEnvironment);
+ mSqlDelightInvalidation = SqlDelightInvalidation.create(mEnvironment);
}
@Override
@@ -316,7 +322,7 @@
// Only track cursors that might modify the database.
// TODO: handle PRAGMA select queries, e.g. PRAGMA_TABLE_INFO
- if (query != null && DatabaseUtils.getSqlStatementType(query)
+ if (query != null && getSqlStatementType(query)
!= DatabaseUtils.STATEMENT_SELECT) {
trackedCursors.put(cursor, null);
}
@@ -370,7 +376,7 @@
.build()
.toByteArray()
);
- mRoomInvalidationRegistry.triggerInvalidationChecks();
+ triggerInvalidation(command.getQuery());
} catch (SQLiteException | IllegalArgumentException exception) {
callback.reply(createErrorOccurredResponse(exception, true).toByteArray());
} finally {
@@ -390,6 +396,13 @@
});
}
+ private void triggerInvalidation(String query) {
+ if (getSqlStatementType(query) != DatabaseUtils.STATEMENT_SELECT) {
+ mSqlDelightInvalidation.triggerInvalidations();
+ mRoomInvalidationRegistry.triggerInvalidations();
+ }
+ }
+
@SuppressLint("Recycle") // For: "The cursor should be freed up after use with #close"
private static Cursor rawQuery(@NonNull SQLiteDatabase database, @NonNull String queryText,
@NonNull final String[] params, @Nullable CancellationSignal cancellationSignal) {
diff --git a/testutils/testutils-paging/build.gradle b/testutils/testutils-paging/build.gradle
index 72fde95..7d242fa 100644
--- a/testutils/testutils-paging/build.gradle
+++ b/testutils/testutils-paging/build.gradle
@@ -14,6 +14,9 @@
* limitations under the License.
*/
+
+import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
+
import static androidx.build.dependencies.DependenciesKt.getKOTLIN_STDLIB
import static androidx.build.dependencies.DependenciesKt.getKOTLIN_TEST
@@ -27,3 +30,10 @@
implementation(project(":paging:paging-common"))
implementation(KOTLIN_TEST)
}
+
+// Allow usage of Kotlin's @OptIn.
+tasks.withType(KotlinCompile).configureEach {
+ kotlinOptions {
+ freeCompilerArgs += ["-Xopt-in=kotlin.RequiresOptIn"]
+ }
+}
diff --git a/testutils/testutils-paging/src/main/java/androidx/paging/RemoteMediatorMock.kt b/testutils/testutils-paging/src/main/java/androidx/paging/RemoteMediatorMock.kt
index 35ee7b4b..5339547 100644
--- a/testutils/testutils-paging/src/main/java/androidx/paging/RemoteMediatorMock.kt
+++ b/testutils/testutils-paging/src/main/java/androidx/paging/RemoteMediatorMock.kt
@@ -19,6 +19,7 @@
import androidx.paging.RemoteMediator.InitializeAction.SKIP_INITIAL_REFRESH
import kotlinx.coroutines.delay
+@OptIn(ExperimentalPagingApi::class)
open class RemoteMediatorMock(private val loadDelay: Long = 0) : RemoteMediator<Int, Int>() {
val loadEvents = mutableListOf<LoadEvent<Int, Int>>()
private val _newLoadEvents = mutableListOf<LoadEvent<Int, Int>>()
diff --git a/testutils/testutils-paging/src/main/java/androidx/paging/TestPagingSource.kt b/testutils/testutils-paging/src/main/java/androidx/paging/TestPagingSource.kt
index b094a61..c918b7f 100644
--- a/testutils/testutils-paging/src/main/java/androidx/paging/TestPagingSource.kt
+++ b/testutils/testutils-paging/src/main/java/androidx/paging/TestPagingSource.kt
@@ -27,7 +27,8 @@
*/
class TestPagingSource(
counted: Boolean = true,
- override val jumpingSupported: Boolean = true
+ override val jumpingSupported: Boolean = true,
+ val items: List<Int> = Companion.ITEMS
) : PagingSource<Int, Int>() {
var errorNextLoad = false
@@ -65,12 +66,13 @@
)
}
+ @OptIn(ExperimentalPagingApi::class)
override fun getRefreshKey(state: PagingState<Int, Int>): Int? {
return state.anchorPosition
}
companion object {
- val items = List(100) { it }
+ val ITEMS = List(100) { it }
val LOAD_ERROR = Exception("Exception from TestPagingSource.errorNextLoad")
}
}
diff --git a/tracing/tracing-ktx/api/1.0.0-alpha01.txt b/tracing/tracing-ktx/api/1.0.0-alpha01.txt
index 8227d8b..3af3298 100644
--- a/tracing/tracing-ktx/api/1.0.0-alpha01.txt
+++ b/tracing/tracing-ktx/api/1.0.0-alpha01.txt
@@ -3,7 +3,7 @@
public final class TraceKt {
method public static inline <T> T! trace(String label, kotlin.jvm.functions.Function0<? extends T> block);
- method public static suspend inline <T> Object! traceAsync(String methodName, int cookie, kotlin.jvm.functions.Function1<? super kotlin.coroutines.Continuation<? super T>,?> block, kotlin.coroutines.Continuation<? super T>! p);
+ method public static suspend inline <T> Object? traceAsync(String methodName, int cookie, kotlin.jvm.functions.Function1<? super kotlin.coroutines.Continuation<? super T>,?> block, kotlin.coroutines.Continuation<? super T> p);
}
}
diff --git a/tracing/tracing-ktx/api/api_lint.ignore b/tracing/tracing-ktx/api/api_lint.ignore
deleted file mode 100644
index 7255b7a..0000000
--- a/tracing/tracing-ktx/api/api_lint.ignore
+++ /dev/null
@@ -1,5 +0,0 @@
-// Baseline format: 1.0
-MissingNullability: androidx.tracing.TraceKt#traceAsync(String, int, kotlin.jvm.functions.Function1<? super kotlin.coroutines.Continuation<? super T>,?>, kotlin.coroutines.Continuation<? super T>):
- Missing nullability on method `traceAsync` return
-MissingNullability: androidx.tracing.TraceKt#traceAsync(String, int, kotlin.jvm.functions.Function1<? super kotlin.coroutines.Continuation<? super T>,?>, kotlin.coroutines.Continuation<? super T>) parameter #3:
- Missing nullability on parameter `p` in method `traceAsync`
diff --git a/tracing/tracing-ktx/api/current.txt b/tracing/tracing-ktx/api/current.txt
index 8227d8b..3af3298 100644
--- a/tracing/tracing-ktx/api/current.txt
+++ b/tracing/tracing-ktx/api/current.txt
@@ -3,7 +3,7 @@
public final class TraceKt {
method public static inline <T> T! trace(String label, kotlin.jvm.functions.Function0<? extends T> block);
- method public static suspend inline <T> Object! traceAsync(String methodName, int cookie, kotlin.jvm.functions.Function1<? super kotlin.coroutines.Continuation<? super T>,?> block, kotlin.coroutines.Continuation<? super T>! p);
+ method public static suspend inline <T> Object? traceAsync(String methodName, int cookie, kotlin.jvm.functions.Function1<? super kotlin.coroutines.Continuation<? super T>,?> block, kotlin.coroutines.Continuation<? super T> p);
}
}
diff --git a/tracing/tracing-ktx/api/public_plus_experimental_1.0.0-alpha01.txt b/tracing/tracing-ktx/api/public_plus_experimental_1.0.0-alpha01.txt
index 8227d8b..3af3298 100644
--- a/tracing/tracing-ktx/api/public_plus_experimental_1.0.0-alpha01.txt
+++ b/tracing/tracing-ktx/api/public_plus_experimental_1.0.0-alpha01.txt
@@ -3,7 +3,7 @@
public final class TraceKt {
method public static inline <T> T! trace(String label, kotlin.jvm.functions.Function0<? extends T> block);
- method public static suspend inline <T> Object! traceAsync(String methodName, int cookie, kotlin.jvm.functions.Function1<? super kotlin.coroutines.Continuation<? super T>,?> block, kotlin.coroutines.Continuation<? super T>! p);
+ method public static suspend inline <T> Object? traceAsync(String methodName, int cookie, kotlin.jvm.functions.Function1<? super kotlin.coroutines.Continuation<? super T>,?> block, kotlin.coroutines.Continuation<? super T> p);
}
}
diff --git a/tracing/tracing-ktx/api/public_plus_experimental_current.txt b/tracing/tracing-ktx/api/public_plus_experimental_current.txt
index 8227d8b..3af3298 100644
--- a/tracing/tracing-ktx/api/public_plus_experimental_current.txt
+++ b/tracing/tracing-ktx/api/public_plus_experimental_current.txt
@@ -3,7 +3,7 @@
public final class TraceKt {
method public static inline <T> T! trace(String label, kotlin.jvm.functions.Function0<? extends T> block);
- method public static suspend inline <T> Object! traceAsync(String methodName, int cookie, kotlin.jvm.functions.Function1<? super kotlin.coroutines.Continuation<? super T>,?> block, kotlin.coroutines.Continuation<? super T>! p);
+ method public static suspend inline <T> Object? traceAsync(String methodName, int cookie, kotlin.jvm.functions.Function1<? super kotlin.coroutines.Continuation<? super T>,?> block, kotlin.coroutines.Continuation<? super T> p);
}
}
diff --git a/tracing/tracing-ktx/api/restricted_1.0.0-alpha01.txt b/tracing/tracing-ktx/api/restricted_1.0.0-alpha01.txt
index 8227d8b..3af3298 100644
--- a/tracing/tracing-ktx/api/restricted_1.0.0-alpha01.txt
+++ b/tracing/tracing-ktx/api/restricted_1.0.0-alpha01.txt
@@ -3,7 +3,7 @@
public final class TraceKt {
method public static inline <T> T! trace(String label, kotlin.jvm.functions.Function0<? extends T> block);
- method public static suspend inline <T> Object! traceAsync(String methodName, int cookie, kotlin.jvm.functions.Function1<? super kotlin.coroutines.Continuation<? super T>,?> block, kotlin.coroutines.Continuation<? super T>! p);
+ method public static suspend inline <T> Object? traceAsync(String methodName, int cookie, kotlin.jvm.functions.Function1<? super kotlin.coroutines.Continuation<? super T>,?> block, kotlin.coroutines.Continuation<? super T> p);
}
}
diff --git a/tracing/tracing-ktx/api/restricted_current.txt b/tracing/tracing-ktx/api/restricted_current.txt
index 8227d8b..3af3298 100644
--- a/tracing/tracing-ktx/api/restricted_current.txt
+++ b/tracing/tracing-ktx/api/restricted_current.txt
@@ -3,7 +3,7 @@
public final class TraceKt {
method public static inline <T> T! trace(String label, kotlin.jvm.functions.Function0<? extends T> block);
- method public static suspend inline <T> Object! traceAsync(String methodName, int cookie, kotlin.jvm.functions.Function1<? super kotlin.coroutines.Continuation<? super T>,?> block, kotlin.coroutines.Continuation<? super T>! p);
+ method public static suspend inline <T> Object? traceAsync(String methodName, int cookie, kotlin.jvm.functions.Function1<? super kotlin.coroutines.Continuation<? super T>,?> block, kotlin.coroutines.Continuation<? super T> p);
}
}
diff --git a/transition/transition-ktx/api/2.0.0-alpha01.txt b/transition/transition-ktx/api/2.0.0-alpha01.txt
deleted file mode 100644
index b01e160..0000000
--- a/transition/transition-ktx/api/2.0.0-alpha01.txt
+++ /dev/null
@@ -1,14 +0,0 @@
-// Signature format: 3.0
-package androidx.transition {
-
- public final class TransitionKt {
- method public static inline androidx.transition.Transition.TransitionListener addListener(androidx.transition.Transition, kotlin.jvm.functions.Function1<? super androidx.transition.Transition,kotlin.Unit> onEnd = {}, kotlin.jvm.functions.Function1<? super androidx.transition.Transition,kotlin.Unit> onStart = {}, kotlin.jvm.functions.Function1<? super androidx.transition.Transition,kotlin.Unit> onCancel = {}, kotlin.jvm.functions.Function1<? super androidx.transition.Transition,kotlin.Unit> onResume = {}, kotlin.jvm.functions.Function1<? super androidx.transition.Transition,kotlin.Unit> onPause = {});
- method public static inline androidx.transition.Transition.TransitionListener doOnCancel(androidx.transition.Transition, kotlin.jvm.functions.Function1<? super androidx.transition.Transition,kotlin.Unit> action);
- method public static inline androidx.transition.Transition.TransitionListener doOnEnd(androidx.transition.Transition, kotlin.jvm.functions.Function1<? super androidx.transition.Transition,kotlin.Unit> action);
- method public static inline androidx.transition.Transition.TransitionListener doOnPause(androidx.transition.Transition, kotlin.jvm.functions.Function1<? super androidx.transition.Transition,kotlin.Unit> action);
- method public static inline androidx.transition.Transition.TransitionListener doOnResume(androidx.transition.Transition, kotlin.jvm.functions.Function1<? super androidx.transition.Transition,kotlin.Unit> action);
- method public static inline androidx.transition.Transition.TransitionListener doOnStart(androidx.transition.Transition, kotlin.jvm.functions.Function1<? super androidx.transition.Transition,kotlin.Unit> action);
- }
-
-}
-
diff --git a/transition/transition-ktx/api/public_plus_experimental_2.0.0-alpha01.txt b/transition/transition-ktx/api/public_plus_experimental_2.0.0-alpha01.txt
deleted file mode 100644
index b01e160..0000000
--- a/transition/transition-ktx/api/public_plus_experimental_2.0.0-alpha01.txt
+++ /dev/null
@@ -1,14 +0,0 @@
-// Signature format: 3.0
-package androidx.transition {
-
- public final class TransitionKt {
- method public static inline androidx.transition.Transition.TransitionListener addListener(androidx.transition.Transition, kotlin.jvm.functions.Function1<? super androidx.transition.Transition,kotlin.Unit> onEnd = {}, kotlin.jvm.functions.Function1<? super androidx.transition.Transition,kotlin.Unit> onStart = {}, kotlin.jvm.functions.Function1<? super androidx.transition.Transition,kotlin.Unit> onCancel = {}, kotlin.jvm.functions.Function1<? super androidx.transition.Transition,kotlin.Unit> onResume = {}, kotlin.jvm.functions.Function1<? super androidx.transition.Transition,kotlin.Unit> onPause = {});
- method public static inline androidx.transition.Transition.TransitionListener doOnCancel(androidx.transition.Transition, kotlin.jvm.functions.Function1<? super androidx.transition.Transition,kotlin.Unit> action);
- method public static inline androidx.transition.Transition.TransitionListener doOnEnd(androidx.transition.Transition, kotlin.jvm.functions.Function1<? super androidx.transition.Transition,kotlin.Unit> action);
- method public static inline androidx.transition.Transition.TransitionListener doOnPause(androidx.transition.Transition, kotlin.jvm.functions.Function1<? super androidx.transition.Transition,kotlin.Unit> action);
- method public static inline androidx.transition.Transition.TransitionListener doOnResume(androidx.transition.Transition, kotlin.jvm.functions.Function1<? super androidx.transition.Transition,kotlin.Unit> action);
- method public static inline androidx.transition.Transition.TransitionListener doOnStart(androidx.transition.Transition, kotlin.jvm.functions.Function1<? super androidx.transition.Transition,kotlin.Unit> action);
- }
-
-}
-
diff --git a/transition/transition-ktx/api/restricted_2.0.0-alpha01.txt b/transition/transition-ktx/api/restricted_2.0.0-alpha01.txt
deleted file mode 100644
index b01e160..0000000
--- a/transition/transition-ktx/api/restricted_2.0.0-alpha01.txt
+++ /dev/null
@@ -1,14 +0,0 @@
-// Signature format: 3.0
-package androidx.transition {
-
- public final class TransitionKt {
- method public static inline androidx.transition.Transition.TransitionListener addListener(androidx.transition.Transition, kotlin.jvm.functions.Function1<? super androidx.transition.Transition,kotlin.Unit> onEnd = {}, kotlin.jvm.functions.Function1<? super androidx.transition.Transition,kotlin.Unit> onStart = {}, kotlin.jvm.functions.Function1<? super androidx.transition.Transition,kotlin.Unit> onCancel = {}, kotlin.jvm.functions.Function1<? super androidx.transition.Transition,kotlin.Unit> onResume = {}, kotlin.jvm.functions.Function1<? super androidx.transition.Transition,kotlin.Unit> onPause = {});
- method public static inline androidx.transition.Transition.TransitionListener doOnCancel(androidx.transition.Transition, kotlin.jvm.functions.Function1<? super androidx.transition.Transition,kotlin.Unit> action);
- method public static inline androidx.transition.Transition.TransitionListener doOnEnd(androidx.transition.Transition, kotlin.jvm.functions.Function1<? super androidx.transition.Transition,kotlin.Unit> action);
- method public static inline androidx.transition.Transition.TransitionListener doOnPause(androidx.transition.Transition, kotlin.jvm.functions.Function1<? super androidx.transition.Transition,kotlin.Unit> action);
- method public static inline androidx.transition.Transition.TransitionListener doOnResume(androidx.transition.Transition, kotlin.jvm.functions.Function1<? super androidx.transition.Transition,kotlin.Unit> action);
- method public static inline androidx.transition.Transition.TransitionListener doOnStart(androidx.transition.Transition, kotlin.jvm.functions.Function1<? super androidx.transition.Transition,kotlin.Unit> action);
- }
-
-}
-
diff --git a/transition/transition/api/2.0.0-alpha01.txt b/transition/transition/api/2.0.0-alpha01.txt
deleted file mode 100644
index d5d8dbf..0000000
--- a/transition/transition/api/2.0.0-alpha01.txt
+++ /dev/null
@@ -1,283 +0,0 @@
-// Signature format: 3.0
-package androidx.transition {
-
- public class ArcMotion extends androidx.transition.PathMotion {
- ctor public ArcMotion();
- ctor public ArcMotion(android.content.Context, android.util.AttributeSet);
- method public float getMaximumAngle();
- method public float getMinimumHorizontalAngle();
- method public float getMinimumVerticalAngle();
- method public android.graphics.Path getPath(float, float, float, float);
- method public void setMaximumAngle(float);
- method public void setMinimumHorizontalAngle(float);
- method public void setMinimumVerticalAngle(float);
- }
-
- public class AutoTransition extends androidx.transition.TransitionSet {
- ctor public AutoTransition();
- ctor public AutoTransition(android.content.Context, android.util.AttributeSet);
- }
-
- public class ChangeBounds extends androidx.transition.Transition {
- ctor public ChangeBounds();
- ctor public ChangeBounds(android.content.Context, android.util.AttributeSet);
- method public void captureEndValues(androidx.transition.TransitionValues);
- method public void captureStartValues(androidx.transition.TransitionValues);
- method public boolean getResizeClip();
- method public void setResizeClip(boolean);
- }
-
- public class ChangeClipBounds extends androidx.transition.Transition {
- ctor public ChangeClipBounds();
- ctor public ChangeClipBounds(android.content.Context, android.util.AttributeSet);
- method public void captureEndValues(androidx.transition.TransitionValues);
- method public void captureStartValues(androidx.transition.TransitionValues);
- }
-
- public class ChangeImageTransform extends androidx.transition.Transition {
- ctor public ChangeImageTransform();
- ctor public ChangeImageTransform(android.content.Context, android.util.AttributeSet);
- method public void captureEndValues(androidx.transition.TransitionValues);
- method public void captureStartValues(androidx.transition.TransitionValues);
- }
-
- public class ChangeScroll extends androidx.transition.Transition {
- ctor public ChangeScroll();
- ctor public ChangeScroll(android.content.Context, android.util.AttributeSet);
- method public void captureEndValues(androidx.transition.TransitionValues);
- method public void captureStartValues(androidx.transition.TransitionValues);
- }
-
- public class ChangeTransform extends androidx.transition.Transition {
- ctor public ChangeTransform();
- ctor public ChangeTransform(android.content.Context, android.util.AttributeSet);
- method public void captureEndValues(androidx.transition.TransitionValues);
- method public void captureStartValues(androidx.transition.TransitionValues);
- method public boolean getReparent();
- method public boolean getReparentWithOverlay();
- method public void setReparent(boolean);
- method public void setReparentWithOverlay(boolean);
- }
-
- public class CircularPropagation extends androidx.transition.VisibilityPropagation {
- ctor public CircularPropagation();
- method public long getStartDelay(android.view.ViewGroup!, androidx.transition.Transition!, androidx.transition.TransitionValues!, androidx.transition.TransitionValues!);
- method public void setPropagationSpeed(float);
- }
-
- public class Explode extends androidx.transition.Visibility {
- ctor public Explode();
- ctor public Explode(android.content.Context, android.util.AttributeSet);
- }
-
- public class Fade extends androidx.transition.Visibility {
- ctor public Fade(int);
- ctor public Fade();
- ctor public Fade(android.content.Context, android.util.AttributeSet);
- field public static final int IN = 1; // 0x1
- field public static final int OUT = 2; // 0x2
- }
-
- public abstract class PathMotion {
- ctor public PathMotion();
- ctor public PathMotion(android.content.Context, android.util.AttributeSet);
- method public abstract android.graphics.Path getPath(float, float, float, float);
- }
-
- public class PatternPathMotion extends androidx.transition.PathMotion {
- ctor public PatternPathMotion();
- ctor public PatternPathMotion(android.content.Context, android.util.AttributeSet);
- ctor public PatternPathMotion(android.graphics.Path!);
- method public android.graphics.Path getPath(float, float, float, float);
- method public android.graphics.Path! getPatternPath();
- method public void setPatternPath(android.graphics.Path!);
- }
-
- public class Scene {
- ctor public Scene(android.view.ViewGroup);
- ctor public Scene(android.view.ViewGroup, android.view.View);
- method public void enter();
- method public void exit();
- method public static androidx.transition.Scene? getCurrentScene(android.view.ViewGroup);
- method public static androidx.transition.Scene getSceneForLayout(android.view.ViewGroup, @LayoutRes int, android.content.Context);
- method public android.view.ViewGroup getSceneRoot();
- method public void setEnterAction(Runnable?);
- method public void setExitAction(Runnable?);
- }
-
- public class SidePropagation extends androidx.transition.VisibilityPropagation {
- ctor public SidePropagation();
- method public long getStartDelay(android.view.ViewGroup!, androidx.transition.Transition!, androidx.transition.TransitionValues!, androidx.transition.TransitionValues!);
- method public void setPropagationSpeed(float);
- method public void setSide(int);
- }
-
- public class Slide extends androidx.transition.Visibility {
- ctor public Slide();
- ctor public Slide(int);
- ctor public Slide(android.content.Context, android.util.AttributeSet);
- method public int getSlideEdge();
- method public void setSlideEdge(int);
- }
-
- public abstract class Transition implements java.lang.Cloneable {
- ctor public Transition();
- ctor public Transition(android.content.Context, android.util.AttributeSet);
- method public androidx.transition.Transition addListener(androidx.transition.Transition.TransitionListener);
- method public androidx.transition.Transition addTarget(android.view.View);
- method public androidx.transition.Transition addTarget(@IdRes int);
- method public androidx.transition.Transition addTarget(String);
- method public androidx.transition.Transition addTarget(Class<?>);
- method public abstract void captureEndValues(androidx.transition.TransitionValues);
- method public abstract void captureStartValues(androidx.transition.TransitionValues);
- method public androidx.transition.Transition clone();
- method public androidx.core.animation.Animator? createAnimator(android.view.ViewGroup, androidx.transition.TransitionValues?, androidx.transition.TransitionValues?);
- method public androidx.transition.Transition excludeChildren(android.view.View, boolean);
- method public androidx.transition.Transition excludeChildren(@IdRes int, boolean);
- method public androidx.transition.Transition excludeChildren(Class<?>, boolean);
- method public androidx.transition.Transition excludeTarget(android.view.View, boolean);
- method public androidx.transition.Transition excludeTarget(@IdRes int, boolean);
- method public androidx.transition.Transition excludeTarget(String, boolean);
- method public androidx.transition.Transition excludeTarget(Class<?>, boolean);
- method public long getDuration();
- method public android.graphics.Rect? getEpicenter();
- method public androidx.transition.Transition.EpicenterCallback? getEpicenterCallback();
- method public androidx.core.animation.Interpolator? getInterpolator();
- method public String getName();
- method public androidx.transition.PathMotion getPathMotion();
- method public androidx.transition.TransitionPropagation? getPropagation();
- method public long getStartDelay();
- method public java.util.List<java.lang.Integer!> getTargetIds();
- method public java.util.List<java.lang.String!>? getTargetNames();
- method public java.util.List<java.lang.Class<?>!>? getTargetTypes();
- method public java.util.List<android.view.View!> getTargets();
- method public String![]? getTransitionProperties();
- method public androidx.transition.TransitionValues? getTransitionValues(android.view.View, boolean);
- method public boolean isTransitionRequired(androidx.transition.TransitionValues?, androidx.transition.TransitionValues?);
- method public androidx.transition.Transition removeListener(androidx.transition.Transition.TransitionListener);
- method public androidx.transition.Transition removeTarget(android.view.View);
- method public androidx.transition.Transition removeTarget(@IdRes int);
- method public androidx.transition.Transition removeTarget(String);
- method public androidx.transition.Transition removeTarget(Class<?>);
- method public androidx.transition.Transition setDuration(long);
- method public void setEpicenterCallback(androidx.transition.Transition.EpicenterCallback?);
- method public androidx.transition.Transition setInterpolator(androidx.core.animation.Interpolator?);
- method public void setMatchOrder(int...);
- method public void setPathMotion(androidx.transition.PathMotion?);
- method public void setPropagation(androidx.transition.TransitionPropagation?);
- method public androidx.transition.Transition setStartDelay(long);
- field public static final int MATCH_ID = 3; // 0x3
- field public static final int MATCH_INSTANCE = 1; // 0x1
- field public static final int MATCH_ITEM_ID = 4; // 0x4
- field public static final int MATCH_NAME = 2; // 0x2
- }
-
- public abstract static class Transition.EpicenterCallback {
- ctor public Transition.EpicenterCallback();
- method public abstract android.graphics.Rect! onGetEpicenter(androidx.transition.Transition);
- }
-
- public static interface Transition.TransitionListener {
- method public void onTransitionCancel(androidx.transition.Transition);
- method public void onTransitionEnd(androidx.transition.Transition);
- method public void onTransitionPause(androidx.transition.Transition);
- method public void onTransitionResume(androidx.transition.Transition);
- method public void onTransitionStart(androidx.transition.Transition);
- }
-
- public class TransitionInflater {
- method public static androidx.transition.TransitionInflater from(android.content.Context);
- method public androidx.transition.Transition! inflateTransition(int);
- method public androidx.transition.TransitionManager! inflateTransitionManager(int, android.view.ViewGroup!);
- }
-
- public class TransitionListenerAdapter implements androidx.transition.Transition.TransitionListener {
- ctor public TransitionListenerAdapter();
- method public void onTransitionCancel(androidx.transition.Transition);
- method public void onTransitionEnd(androidx.transition.Transition);
- method public void onTransitionPause(androidx.transition.Transition);
- method public void onTransitionResume(androidx.transition.Transition);
- method public void onTransitionStart(androidx.transition.Transition);
- }
-
- public class TransitionManager {
- ctor public TransitionManager();
- method public static void beginDelayedTransition(android.view.ViewGroup);
- method public static void beginDelayedTransition(android.view.ViewGroup, androidx.transition.Transition?);
- method public static void endTransitions(android.view.ViewGroup!);
- method public static void go(androidx.transition.Scene);
- method public static void go(androidx.transition.Scene, androidx.transition.Transition?);
- method public void setTransition(androidx.transition.Scene, androidx.transition.Transition?);
- method public void setTransition(androidx.transition.Scene, androidx.transition.Scene, androidx.transition.Transition?);
- method public void transitionTo(androidx.transition.Scene);
- }
-
- public abstract class TransitionPropagation {
- ctor public TransitionPropagation();
- method public abstract void captureValues(androidx.transition.TransitionValues!);
- method public abstract String![]! getPropagationProperties();
- method public abstract long getStartDelay(android.view.ViewGroup!, androidx.transition.Transition!, androidx.transition.TransitionValues!, androidx.transition.TransitionValues!);
- }
-
- public class TransitionSet extends androidx.transition.Transition {
- ctor public TransitionSet();
- ctor public TransitionSet(android.content.Context, android.util.AttributeSet);
- method public androidx.transition.TransitionSet addListener(androidx.transition.Transition.TransitionListener);
- method public androidx.transition.TransitionSet addTarget(android.view.View);
- method public androidx.transition.TransitionSet addTarget(@IdRes int);
- method public androidx.transition.TransitionSet addTarget(String);
- method public androidx.transition.TransitionSet addTarget(Class<?>);
- method public androidx.transition.TransitionSet addTransition(androidx.transition.Transition);
- method public void captureEndValues(androidx.transition.TransitionValues);
- method public void captureStartValues(androidx.transition.TransitionValues);
- method public int getOrdering();
- method public androidx.transition.Transition? getTransitionAt(int);
- method public int getTransitionCount();
- method public androidx.transition.TransitionSet removeListener(androidx.transition.Transition.TransitionListener);
- method public androidx.transition.TransitionSet removeTarget(@IdRes int);
- method public androidx.transition.TransitionSet removeTarget(android.view.View);
- method public androidx.transition.TransitionSet removeTarget(Class<?>);
- method public androidx.transition.TransitionSet removeTarget(String);
- method public androidx.transition.TransitionSet removeTransition(androidx.transition.Transition);
- method public androidx.transition.TransitionSet setDuration(long);
- method public androidx.transition.TransitionSet setInterpolator(androidx.core.animation.Interpolator?);
- method public androidx.transition.TransitionSet setOrdering(int);
- method public androidx.transition.TransitionSet setStartDelay(long);
- field public static final int ORDERING_SEQUENTIAL = 1; // 0x1
- field public static final int ORDERING_TOGETHER = 0; // 0x0
- }
-
- public class TransitionValues {
- ctor @Deprecated public TransitionValues();
- ctor public TransitionValues(android.view.View);
- field public final java.util.Map<java.lang.String!,java.lang.Object!>! values;
- field public android.view.View! view;
- }
-
- public abstract class Visibility extends androidx.transition.Transition {
- ctor public Visibility();
- ctor public Visibility(android.content.Context, android.util.AttributeSet);
- method public void captureEndValues(androidx.transition.TransitionValues);
- method public void captureStartValues(androidx.transition.TransitionValues);
- method public int getMode();
- method public boolean isVisible(androidx.transition.TransitionValues!);
- method public androidx.core.animation.Animator? onAppear(android.view.ViewGroup!, androidx.transition.TransitionValues!, int, androidx.transition.TransitionValues!, int);
- method public androidx.core.animation.Animator? onAppear(android.view.ViewGroup!, android.view.View!, androidx.transition.TransitionValues!, androidx.transition.TransitionValues!);
- method public androidx.core.animation.Animator? onDisappear(android.view.ViewGroup!, androidx.transition.TransitionValues!, int, androidx.transition.TransitionValues!, int);
- method public androidx.core.animation.Animator? onDisappear(android.view.ViewGroup!, android.view.View!, androidx.transition.TransitionValues!, androidx.transition.TransitionValues!);
- method public void setMode(int);
- field public static final int MODE_IN = 1; // 0x1
- field public static final int MODE_OUT = 2; // 0x2
- }
-
- public abstract class VisibilityPropagation extends androidx.transition.TransitionPropagation {
- ctor public VisibilityPropagation();
- method public void captureValues(androidx.transition.TransitionValues!);
- method public String![]! getPropagationProperties();
- method public int getViewVisibility(androidx.transition.TransitionValues!);
- method public int getViewX(androidx.transition.TransitionValues!);
- method public int getViewY(androidx.transition.TransitionValues!);
- }
-
-}
-
diff --git a/transition/transition/api/current.txt b/transition/transition/api/current.txt
index d5d8dbf..e314794 100644
--- a/transition/transition/api/current.txt
+++ b/transition/transition/api/current.txt
@@ -130,8 +130,8 @@
method public androidx.transition.Transition addTarget(Class<?>);
method public abstract void captureEndValues(androidx.transition.TransitionValues);
method public abstract void captureStartValues(androidx.transition.TransitionValues);
- method public androidx.transition.Transition clone();
- method public androidx.core.animation.Animator? createAnimator(android.view.ViewGroup, androidx.transition.TransitionValues?, androidx.transition.TransitionValues?);
+ method public androidx.transition.Transition! clone();
+ method public android.animation.Animator? createAnimator(android.view.ViewGroup, androidx.transition.TransitionValues?, androidx.transition.TransitionValues?);
method public androidx.transition.Transition excludeChildren(android.view.View, boolean);
method public androidx.transition.Transition excludeChildren(@IdRes int, boolean);
method public androidx.transition.Transition excludeChildren(Class<?>, boolean);
@@ -142,7 +142,7 @@
method public long getDuration();
method public android.graphics.Rect? getEpicenter();
method public androidx.transition.Transition.EpicenterCallback? getEpicenterCallback();
- method public androidx.core.animation.Interpolator? getInterpolator();
+ method public android.animation.TimeInterpolator? getInterpolator();
method public String getName();
method public androidx.transition.PathMotion getPathMotion();
method public androidx.transition.TransitionPropagation? getPropagation();
@@ -161,7 +161,7 @@
method public androidx.transition.Transition removeTarget(Class<?>);
method public androidx.transition.Transition setDuration(long);
method public void setEpicenterCallback(androidx.transition.Transition.EpicenterCallback?);
- method public androidx.transition.Transition setInterpolator(androidx.core.animation.Interpolator?);
+ method public androidx.transition.Transition setInterpolator(android.animation.TimeInterpolator?);
method public void setMatchOrder(int...);
method public void setPathMotion(androidx.transition.PathMotion?);
method public void setPropagation(androidx.transition.TransitionPropagation?);
@@ -240,7 +240,7 @@
method public androidx.transition.TransitionSet removeTarget(String);
method public androidx.transition.TransitionSet removeTransition(androidx.transition.Transition);
method public androidx.transition.TransitionSet setDuration(long);
- method public androidx.transition.TransitionSet setInterpolator(androidx.core.animation.Interpolator?);
+ method public androidx.transition.TransitionSet setInterpolator(android.animation.TimeInterpolator?);
method public androidx.transition.TransitionSet setOrdering(int);
method public androidx.transition.TransitionSet setStartDelay(long);
field public static final int ORDERING_SEQUENTIAL = 1; // 0x1
@@ -261,10 +261,10 @@
method public void captureStartValues(androidx.transition.TransitionValues);
method public int getMode();
method public boolean isVisible(androidx.transition.TransitionValues!);
- method public androidx.core.animation.Animator? onAppear(android.view.ViewGroup!, androidx.transition.TransitionValues!, int, androidx.transition.TransitionValues!, int);
- method public androidx.core.animation.Animator? onAppear(android.view.ViewGroup!, android.view.View!, androidx.transition.TransitionValues!, androidx.transition.TransitionValues!);
- method public androidx.core.animation.Animator? onDisappear(android.view.ViewGroup!, androidx.transition.TransitionValues!, int, androidx.transition.TransitionValues!, int);
- method public androidx.core.animation.Animator? onDisappear(android.view.ViewGroup!, android.view.View!, androidx.transition.TransitionValues!, androidx.transition.TransitionValues!);
+ method public android.animation.Animator? onAppear(android.view.ViewGroup!, androidx.transition.TransitionValues!, int, androidx.transition.TransitionValues!, int);
+ method public android.animation.Animator? onAppear(android.view.ViewGroup!, android.view.View!, androidx.transition.TransitionValues!, androidx.transition.TransitionValues!);
+ method public android.animation.Animator? onDisappear(android.view.ViewGroup!, androidx.transition.TransitionValues!, int, androidx.transition.TransitionValues!, int);
+ method public android.animation.Animator? onDisappear(android.view.ViewGroup!, android.view.View!, androidx.transition.TransitionValues!, androidx.transition.TransitionValues!);
method public void setMode(int);
field public static final int MODE_IN = 1; // 0x1
field public static final int MODE_OUT = 2; // 0x2
diff --git a/transition/transition/api/public_plus_experimental_2.0.0-alpha01.txt b/transition/transition/api/public_plus_experimental_2.0.0-alpha01.txt
deleted file mode 100644
index d5d8dbf..0000000
--- a/transition/transition/api/public_plus_experimental_2.0.0-alpha01.txt
+++ /dev/null
@@ -1,283 +0,0 @@
-// Signature format: 3.0
-package androidx.transition {
-
- public class ArcMotion extends androidx.transition.PathMotion {
- ctor public ArcMotion();
- ctor public ArcMotion(android.content.Context, android.util.AttributeSet);
- method public float getMaximumAngle();
- method public float getMinimumHorizontalAngle();
- method public float getMinimumVerticalAngle();
- method public android.graphics.Path getPath(float, float, float, float);
- method public void setMaximumAngle(float);
- method public void setMinimumHorizontalAngle(float);
- method public void setMinimumVerticalAngle(float);
- }
-
- public class AutoTransition extends androidx.transition.TransitionSet {
- ctor public AutoTransition();
- ctor public AutoTransition(android.content.Context, android.util.AttributeSet);
- }
-
- public class ChangeBounds extends androidx.transition.Transition {
- ctor public ChangeBounds();
- ctor public ChangeBounds(android.content.Context, android.util.AttributeSet);
- method public void captureEndValues(androidx.transition.TransitionValues);
- method public void captureStartValues(androidx.transition.TransitionValues);
- method public boolean getResizeClip();
- method public void setResizeClip(boolean);
- }
-
- public class ChangeClipBounds extends androidx.transition.Transition {
- ctor public ChangeClipBounds();
- ctor public ChangeClipBounds(android.content.Context, android.util.AttributeSet);
- method public void captureEndValues(androidx.transition.TransitionValues);
- method public void captureStartValues(androidx.transition.TransitionValues);
- }
-
- public class ChangeImageTransform extends androidx.transition.Transition {
- ctor public ChangeImageTransform();
- ctor public ChangeImageTransform(android.content.Context, android.util.AttributeSet);
- method public void captureEndValues(androidx.transition.TransitionValues);
- method public void captureStartValues(androidx.transition.TransitionValues);
- }
-
- public class ChangeScroll extends androidx.transition.Transition {
- ctor public ChangeScroll();
- ctor public ChangeScroll(android.content.Context, android.util.AttributeSet);
- method public void captureEndValues(androidx.transition.TransitionValues);
- method public void captureStartValues(androidx.transition.TransitionValues);
- }
-
- public class ChangeTransform extends androidx.transition.Transition {
- ctor public ChangeTransform();
- ctor public ChangeTransform(android.content.Context, android.util.AttributeSet);
- method public void captureEndValues(androidx.transition.TransitionValues);
- method public void captureStartValues(androidx.transition.TransitionValues);
- method public boolean getReparent();
- method public boolean getReparentWithOverlay();
- method public void setReparent(boolean);
- method public void setReparentWithOverlay(boolean);
- }
-
- public class CircularPropagation extends androidx.transition.VisibilityPropagation {
- ctor public CircularPropagation();
- method public long getStartDelay(android.view.ViewGroup!, androidx.transition.Transition!, androidx.transition.TransitionValues!, androidx.transition.TransitionValues!);
- method public void setPropagationSpeed(float);
- }
-
- public class Explode extends androidx.transition.Visibility {
- ctor public Explode();
- ctor public Explode(android.content.Context, android.util.AttributeSet);
- }
-
- public class Fade extends androidx.transition.Visibility {
- ctor public Fade(int);
- ctor public Fade();
- ctor public Fade(android.content.Context, android.util.AttributeSet);
- field public static final int IN = 1; // 0x1
- field public static final int OUT = 2; // 0x2
- }
-
- public abstract class PathMotion {
- ctor public PathMotion();
- ctor public PathMotion(android.content.Context, android.util.AttributeSet);
- method public abstract android.graphics.Path getPath(float, float, float, float);
- }
-
- public class PatternPathMotion extends androidx.transition.PathMotion {
- ctor public PatternPathMotion();
- ctor public PatternPathMotion(android.content.Context, android.util.AttributeSet);
- ctor public PatternPathMotion(android.graphics.Path!);
- method public android.graphics.Path getPath(float, float, float, float);
- method public android.graphics.Path! getPatternPath();
- method public void setPatternPath(android.graphics.Path!);
- }
-
- public class Scene {
- ctor public Scene(android.view.ViewGroup);
- ctor public Scene(android.view.ViewGroup, android.view.View);
- method public void enter();
- method public void exit();
- method public static androidx.transition.Scene? getCurrentScene(android.view.ViewGroup);
- method public static androidx.transition.Scene getSceneForLayout(android.view.ViewGroup, @LayoutRes int, android.content.Context);
- method public android.view.ViewGroup getSceneRoot();
- method public void setEnterAction(Runnable?);
- method public void setExitAction(Runnable?);
- }
-
- public class SidePropagation extends androidx.transition.VisibilityPropagation {
- ctor public SidePropagation();
- method public long getStartDelay(android.view.ViewGroup!, androidx.transition.Transition!, androidx.transition.TransitionValues!, androidx.transition.TransitionValues!);
- method public void setPropagationSpeed(float);
- method public void setSide(int);
- }
-
- public class Slide extends androidx.transition.Visibility {
- ctor public Slide();
- ctor public Slide(int);
- ctor public Slide(android.content.Context, android.util.AttributeSet);
- method public int getSlideEdge();
- method public void setSlideEdge(int);
- }
-
- public abstract class Transition implements java.lang.Cloneable {
- ctor public Transition();
- ctor public Transition(android.content.Context, android.util.AttributeSet);
- method public androidx.transition.Transition addListener(androidx.transition.Transition.TransitionListener);
- method public androidx.transition.Transition addTarget(android.view.View);
- method public androidx.transition.Transition addTarget(@IdRes int);
- method public androidx.transition.Transition addTarget(String);
- method public androidx.transition.Transition addTarget(Class<?>);
- method public abstract void captureEndValues(androidx.transition.TransitionValues);
- method public abstract void captureStartValues(androidx.transition.TransitionValues);
- method public androidx.transition.Transition clone();
- method public androidx.core.animation.Animator? createAnimator(android.view.ViewGroup, androidx.transition.TransitionValues?, androidx.transition.TransitionValues?);
- method public androidx.transition.Transition excludeChildren(android.view.View, boolean);
- method public androidx.transition.Transition excludeChildren(@IdRes int, boolean);
- method public androidx.transition.Transition excludeChildren(Class<?>, boolean);
- method public androidx.transition.Transition excludeTarget(android.view.View, boolean);
- method public androidx.transition.Transition excludeTarget(@IdRes int, boolean);
- method public androidx.transition.Transition excludeTarget(String, boolean);
- method public androidx.transition.Transition excludeTarget(Class<?>, boolean);
- method public long getDuration();
- method public android.graphics.Rect? getEpicenter();
- method public androidx.transition.Transition.EpicenterCallback? getEpicenterCallback();
- method public androidx.core.animation.Interpolator? getInterpolator();
- method public String getName();
- method public androidx.transition.PathMotion getPathMotion();
- method public androidx.transition.TransitionPropagation? getPropagation();
- method public long getStartDelay();
- method public java.util.List<java.lang.Integer!> getTargetIds();
- method public java.util.List<java.lang.String!>? getTargetNames();
- method public java.util.List<java.lang.Class<?>!>? getTargetTypes();
- method public java.util.List<android.view.View!> getTargets();
- method public String![]? getTransitionProperties();
- method public androidx.transition.TransitionValues? getTransitionValues(android.view.View, boolean);
- method public boolean isTransitionRequired(androidx.transition.TransitionValues?, androidx.transition.TransitionValues?);
- method public androidx.transition.Transition removeListener(androidx.transition.Transition.TransitionListener);
- method public androidx.transition.Transition removeTarget(android.view.View);
- method public androidx.transition.Transition removeTarget(@IdRes int);
- method public androidx.transition.Transition removeTarget(String);
- method public androidx.transition.Transition removeTarget(Class<?>);
- method public androidx.transition.Transition setDuration(long);
- method public void setEpicenterCallback(androidx.transition.Transition.EpicenterCallback?);
- method public androidx.transition.Transition setInterpolator(androidx.core.animation.Interpolator?);
- method public void setMatchOrder(int...);
- method public void setPathMotion(androidx.transition.PathMotion?);
- method public void setPropagation(androidx.transition.TransitionPropagation?);
- method public androidx.transition.Transition setStartDelay(long);
- field public static final int MATCH_ID = 3; // 0x3
- field public static final int MATCH_INSTANCE = 1; // 0x1
- field public static final int MATCH_ITEM_ID = 4; // 0x4
- field public static final int MATCH_NAME = 2; // 0x2
- }
-
- public abstract static class Transition.EpicenterCallback {
- ctor public Transition.EpicenterCallback();
- method public abstract android.graphics.Rect! onGetEpicenter(androidx.transition.Transition);
- }
-
- public static interface Transition.TransitionListener {
- method public void onTransitionCancel(androidx.transition.Transition);
- method public void onTransitionEnd(androidx.transition.Transition);
- method public void onTransitionPause(androidx.transition.Transition);
- method public void onTransitionResume(androidx.transition.Transition);
- method public void onTransitionStart(androidx.transition.Transition);
- }
-
- public class TransitionInflater {
- method public static androidx.transition.TransitionInflater from(android.content.Context);
- method public androidx.transition.Transition! inflateTransition(int);
- method public androidx.transition.TransitionManager! inflateTransitionManager(int, android.view.ViewGroup!);
- }
-
- public class TransitionListenerAdapter implements androidx.transition.Transition.TransitionListener {
- ctor public TransitionListenerAdapter();
- method public void onTransitionCancel(androidx.transition.Transition);
- method public void onTransitionEnd(androidx.transition.Transition);
- method public void onTransitionPause(androidx.transition.Transition);
- method public void onTransitionResume(androidx.transition.Transition);
- method public void onTransitionStart(androidx.transition.Transition);
- }
-
- public class TransitionManager {
- ctor public TransitionManager();
- method public static void beginDelayedTransition(android.view.ViewGroup);
- method public static void beginDelayedTransition(android.view.ViewGroup, androidx.transition.Transition?);
- method public static void endTransitions(android.view.ViewGroup!);
- method public static void go(androidx.transition.Scene);
- method public static void go(androidx.transition.Scene, androidx.transition.Transition?);
- method public void setTransition(androidx.transition.Scene, androidx.transition.Transition?);
- method public void setTransition(androidx.transition.Scene, androidx.transition.Scene, androidx.transition.Transition?);
- method public void transitionTo(androidx.transition.Scene);
- }
-
- public abstract class TransitionPropagation {
- ctor public TransitionPropagation();
- method public abstract void captureValues(androidx.transition.TransitionValues!);
- method public abstract String![]! getPropagationProperties();
- method public abstract long getStartDelay(android.view.ViewGroup!, androidx.transition.Transition!, androidx.transition.TransitionValues!, androidx.transition.TransitionValues!);
- }
-
- public class TransitionSet extends androidx.transition.Transition {
- ctor public TransitionSet();
- ctor public TransitionSet(android.content.Context, android.util.AttributeSet);
- method public androidx.transition.TransitionSet addListener(androidx.transition.Transition.TransitionListener);
- method public androidx.transition.TransitionSet addTarget(android.view.View);
- method public androidx.transition.TransitionSet addTarget(@IdRes int);
- method public androidx.transition.TransitionSet addTarget(String);
- method public androidx.transition.TransitionSet addTarget(Class<?>);
- method public androidx.transition.TransitionSet addTransition(androidx.transition.Transition);
- method public void captureEndValues(androidx.transition.TransitionValues);
- method public void captureStartValues(androidx.transition.TransitionValues);
- method public int getOrdering();
- method public androidx.transition.Transition? getTransitionAt(int);
- method public int getTransitionCount();
- method public androidx.transition.TransitionSet removeListener(androidx.transition.Transition.TransitionListener);
- method public androidx.transition.TransitionSet removeTarget(@IdRes int);
- method public androidx.transition.TransitionSet removeTarget(android.view.View);
- method public androidx.transition.TransitionSet removeTarget(Class<?>);
- method public androidx.transition.TransitionSet removeTarget(String);
- method public androidx.transition.TransitionSet removeTransition(androidx.transition.Transition);
- method public androidx.transition.TransitionSet setDuration(long);
- method public androidx.transition.TransitionSet setInterpolator(androidx.core.animation.Interpolator?);
- method public androidx.transition.TransitionSet setOrdering(int);
- method public androidx.transition.TransitionSet setStartDelay(long);
- field public static final int ORDERING_SEQUENTIAL = 1; // 0x1
- field public static final int ORDERING_TOGETHER = 0; // 0x0
- }
-
- public class TransitionValues {
- ctor @Deprecated public TransitionValues();
- ctor public TransitionValues(android.view.View);
- field public final java.util.Map<java.lang.String!,java.lang.Object!>! values;
- field public android.view.View! view;
- }
-
- public abstract class Visibility extends androidx.transition.Transition {
- ctor public Visibility();
- ctor public Visibility(android.content.Context, android.util.AttributeSet);
- method public void captureEndValues(androidx.transition.TransitionValues);
- method public void captureStartValues(androidx.transition.TransitionValues);
- method public int getMode();
- method public boolean isVisible(androidx.transition.TransitionValues!);
- method public androidx.core.animation.Animator? onAppear(android.view.ViewGroup!, androidx.transition.TransitionValues!, int, androidx.transition.TransitionValues!, int);
- method public androidx.core.animation.Animator? onAppear(android.view.ViewGroup!, android.view.View!, androidx.transition.TransitionValues!, androidx.transition.TransitionValues!);
- method public androidx.core.animation.Animator? onDisappear(android.view.ViewGroup!, androidx.transition.TransitionValues!, int, androidx.transition.TransitionValues!, int);
- method public androidx.core.animation.Animator? onDisappear(android.view.ViewGroup!, android.view.View!, androidx.transition.TransitionValues!, androidx.transition.TransitionValues!);
- method public void setMode(int);
- field public static final int MODE_IN = 1; // 0x1
- field public static final int MODE_OUT = 2; // 0x2
- }
-
- public abstract class VisibilityPropagation extends androidx.transition.TransitionPropagation {
- ctor public VisibilityPropagation();
- method public void captureValues(androidx.transition.TransitionValues!);
- method public String![]! getPropagationProperties();
- method public int getViewVisibility(androidx.transition.TransitionValues!);
- method public int getViewX(androidx.transition.TransitionValues!);
- method public int getViewY(androidx.transition.TransitionValues!);
- }
-
-}
-
diff --git a/transition/transition/api/public_plus_experimental_current.txt b/transition/transition/api/public_plus_experimental_current.txt
index d5d8dbf..e314794 100644
--- a/transition/transition/api/public_plus_experimental_current.txt
+++ b/transition/transition/api/public_plus_experimental_current.txt
@@ -130,8 +130,8 @@
method public androidx.transition.Transition addTarget(Class<?>);
method public abstract void captureEndValues(androidx.transition.TransitionValues);
method public abstract void captureStartValues(androidx.transition.TransitionValues);
- method public androidx.transition.Transition clone();
- method public androidx.core.animation.Animator? createAnimator(android.view.ViewGroup, androidx.transition.TransitionValues?, androidx.transition.TransitionValues?);
+ method public androidx.transition.Transition! clone();
+ method public android.animation.Animator? createAnimator(android.view.ViewGroup, androidx.transition.TransitionValues?, androidx.transition.TransitionValues?);
method public androidx.transition.Transition excludeChildren(android.view.View, boolean);
method public androidx.transition.Transition excludeChildren(@IdRes int, boolean);
method public androidx.transition.Transition excludeChildren(Class<?>, boolean);
@@ -142,7 +142,7 @@
method public long getDuration();
method public android.graphics.Rect? getEpicenter();
method public androidx.transition.Transition.EpicenterCallback? getEpicenterCallback();
- method public androidx.core.animation.Interpolator? getInterpolator();
+ method public android.animation.TimeInterpolator? getInterpolator();
method public String getName();
method public androidx.transition.PathMotion getPathMotion();
method public androidx.transition.TransitionPropagation? getPropagation();
@@ -161,7 +161,7 @@
method public androidx.transition.Transition removeTarget(Class<?>);
method public androidx.transition.Transition setDuration(long);
method public void setEpicenterCallback(androidx.transition.Transition.EpicenterCallback?);
- method public androidx.transition.Transition setInterpolator(androidx.core.animation.Interpolator?);
+ method public androidx.transition.Transition setInterpolator(android.animation.TimeInterpolator?);
method public void setMatchOrder(int...);
method public void setPathMotion(androidx.transition.PathMotion?);
method public void setPropagation(androidx.transition.TransitionPropagation?);
@@ -240,7 +240,7 @@
method public androidx.transition.TransitionSet removeTarget(String);
method public androidx.transition.TransitionSet removeTransition(androidx.transition.Transition);
method public androidx.transition.TransitionSet setDuration(long);
- method public androidx.transition.TransitionSet setInterpolator(androidx.core.animation.Interpolator?);
+ method public androidx.transition.TransitionSet setInterpolator(android.animation.TimeInterpolator?);
method public androidx.transition.TransitionSet setOrdering(int);
method public androidx.transition.TransitionSet setStartDelay(long);
field public static final int ORDERING_SEQUENTIAL = 1; // 0x1
@@ -261,10 +261,10 @@
method public void captureStartValues(androidx.transition.TransitionValues);
method public int getMode();
method public boolean isVisible(androidx.transition.TransitionValues!);
- method public androidx.core.animation.Animator? onAppear(android.view.ViewGroup!, androidx.transition.TransitionValues!, int, androidx.transition.TransitionValues!, int);
- method public androidx.core.animation.Animator? onAppear(android.view.ViewGroup!, android.view.View!, androidx.transition.TransitionValues!, androidx.transition.TransitionValues!);
- method public androidx.core.animation.Animator? onDisappear(android.view.ViewGroup!, androidx.transition.TransitionValues!, int, androidx.transition.TransitionValues!, int);
- method public androidx.core.animation.Animator? onDisappear(android.view.ViewGroup!, android.view.View!, androidx.transition.TransitionValues!, androidx.transition.TransitionValues!);
+ method public android.animation.Animator? onAppear(android.view.ViewGroup!, androidx.transition.TransitionValues!, int, androidx.transition.TransitionValues!, int);
+ method public android.animation.Animator? onAppear(android.view.ViewGroup!, android.view.View!, androidx.transition.TransitionValues!, androidx.transition.TransitionValues!);
+ method public android.animation.Animator? onDisappear(android.view.ViewGroup!, androidx.transition.TransitionValues!, int, androidx.transition.TransitionValues!, int);
+ method public android.animation.Animator? onDisappear(android.view.ViewGroup!, android.view.View!, androidx.transition.TransitionValues!, androidx.transition.TransitionValues!);
method public void setMode(int);
field public static final int MODE_IN = 1; // 0x1
field public static final int MODE_OUT = 2; // 0x2
diff --git a/transition/transition/api/res-2.0.0-alpha01.txt b/transition/transition/api/res-2.0.0-alpha01.txt
deleted file mode 100644
index e69de29..0000000
--- a/transition/transition/api/res-2.0.0-alpha01.txt
+++ /dev/null
diff --git a/transition/transition/api/restricted_2.0.0-alpha01.txt b/transition/transition/api/restricted_2.0.0-alpha01.txt
deleted file mode 100644
index eec52d6..0000000
--- a/transition/transition/api/restricted_2.0.0-alpha01.txt
+++ /dev/null
@@ -1,320 +0,0 @@
-// Signature format: 3.0
-package androidx.transition {
-
- public class ArcMotion extends androidx.transition.PathMotion {
- ctor public ArcMotion();
- ctor public ArcMotion(android.content.Context, android.util.AttributeSet);
- method public float getMaximumAngle();
- method public float getMinimumHorizontalAngle();
- method public float getMinimumVerticalAngle();
- method public android.graphics.Path getPath(float, float, float, float);
- method public void setMaximumAngle(float);
- method public void setMinimumHorizontalAngle(float);
- method public void setMinimumVerticalAngle(float);
- }
-
- public class AutoTransition extends androidx.transition.TransitionSet {
- ctor public AutoTransition();
- ctor public AutoTransition(android.content.Context, android.util.AttributeSet);
- }
-
- public class ChangeBounds extends androidx.transition.Transition {
- ctor public ChangeBounds();
- ctor public ChangeBounds(android.content.Context, android.util.AttributeSet);
- method public void captureEndValues(androidx.transition.TransitionValues);
- method public void captureStartValues(androidx.transition.TransitionValues);
- method public boolean getResizeClip();
- method public void setResizeClip(boolean);
- }
-
- public class ChangeClipBounds extends androidx.transition.Transition {
- ctor public ChangeClipBounds();
- ctor public ChangeClipBounds(android.content.Context, android.util.AttributeSet);
- method public void captureEndValues(androidx.transition.TransitionValues);
- method public void captureStartValues(androidx.transition.TransitionValues);
- }
-
- public class ChangeImageTransform extends androidx.transition.Transition {
- ctor public ChangeImageTransform();
- ctor public ChangeImageTransform(android.content.Context, android.util.AttributeSet);
- method public void captureEndValues(androidx.transition.TransitionValues);
- method public void captureStartValues(androidx.transition.TransitionValues);
- }
-
- public class ChangeScroll extends androidx.transition.Transition {
- ctor public ChangeScroll();
- ctor public ChangeScroll(android.content.Context, android.util.AttributeSet);
- method public void captureEndValues(androidx.transition.TransitionValues);
- method public void captureStartValues(androidx.transition.TransitionValues);
- }
-
- public class ChangeTransform extends androidx.transition.Transition {
- ctor public ChangeTransform();
- ctor public ChangeTransform(android.content.Context, android.util.AttributeSet);
- method public void captureEndValues(androidx.transition.TransitionValues);
- method public void captureStartValues(androidx.transition.TransitionValues);
- method public boolean getReparent();
- method public boolean getReparentWithOverlay();
- method public void setReparent(boolean);
- method public void setReparentWithOverlay(boolean);
- }
-
- public class CircularPropagation extends androidx.transition.VisibilityPropagation {
- ctor public CircularPropagation();
- method public long getStartDelay(android.view.ViewGroup!, androidx.transition.Transition!, androidx.transition.TransitionValues!, androidx.transition.TransitionValues!);
- method public void setPropagationSpeed(float);
- }
-
- public class Explode extends androidx.transition.Visibility {
- ctor public Explode();
- ctor public Explode(android.content.Context, android.util.AttributeSet);
- }
-
- public class Fade extends androidx.transition.Visibility {
- ctor public Fade(@androidx.transition.Visibility.Mode int);
- ctor public Fade();
- ctor public Fade(android.content.Context, android.util.AttributeSet);
- field public static final int IN = 1; // 0x1
- field public static final int OUT = 2; // 0x2
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class FragmentTransitionSupport extends androidx.fragment.app.FragmentTransitionImpl {
- 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!);
- }
-
- public abstract class PathMotion {
- ctor public PathMotion();
- ctor public PathMotion(android.content.Context, android.util.AttributeSet);
- method public abstract android.graphics.Path getPath(float, float, float, float);
- }
-
- public class PatternPathMotion extends androidx.transition.PathMotion {
- ctor public PatternPathMotion();
- ctor public PatternPathMotion(android.content.Context, android.util.AttributeSet);
- ctor public PatternPathMotion(android.graphics.Path!);
- method public android.graphics.Path getPath(float, float, float, float);
- method public android.graphics.Path! getPatternPath();
- method public void setPatternPath(android.graphics.Path!);
- }
-
- public class Scene {
- ctor public Scene(android.view.ViewGroup);
- ctor public Scene(android.view.ViewGroup, android.view.View);
- method public void enter();
- method public void exit();
- method public static androidx.transition.Scene? getCurrentScene(android.view.ViewGroup);
- method public static androidx.transition.Scene getSceneForLayout(android.view.ViewGroup, @LayoutRes int, android.content.Context);
- method public android.view.ViewGroup getSceneRoot();
- method public void setEnterAction(Runnable?);
- method public void setExitAction(Runnable?);
- }
-
- public class SidePropagation extends androidx.transition.VisibilityPropagation {
- ctor public SidePropagation();
- method public long getStartDelay(android.view.ViewGroup!, androidx.transition.Transition!, androidx.transition.TransitionValues!, androidx.transition.TransitionValues!);
- method public void setPropagationSpeed(float);
- method public void setSide(@androidx.transition.Slide.GravityFlag int);
- }
-
- public class Slide extends androidx.transition.Visibility {
- ctor public Slide();
- ctor public Slide(@androidx.transition.Slide.GravityFlag int);
- ctor public Slide(android.content.Context, android.util.AttributeSet);
- method @androidx.transition.Slide.GravityFlag public int getSlideEdge();
- method public void setSlideEdge(@androidx.transition.Slide.GravityFlag int);
- }
-
- @IntDef({android.view.Gravity.LEFT, android.view.Gravity.TOP, android.view.Gravity.RIGHT, android.view.Gravity.BOTTOM, android.view.Gravity.START, android.view.Gravity.END}) @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) public static @interface Slide.GravityFlag {
- }
-
- public abstract class Transition implements java.lang.Cloneable {
- ctor public Transition();
- ctor public Transition(android.content.Context, android.util.AttributeSet);
- method public androidx.transition.Transition addListener(androidx.transition.Transition.TransitionListener);
- method public androidx.transition.Transition addTarget(android.view.View);
- method public androidx.transition.Transition addTarget(@IdRes int);
- method public androidx.transition.Transition addTarget(String);
- method public androidx.transition.Transition addTarget(Class<?>);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) protected void animate(androidx.core.animation.Animator!);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) protected void cancel();
- method public abstract void captureEndValues(androidx.transition.TransitionValues);
- method public abstract void captureStartValues(androidx.transition.TransitionValues);
- method public androidx.transition.Transition clone();
- method public androidx.core.animation.Animator? createAnimator(android.view.ViewGroup, androidx.transition.TransitionValues?, androidx.transition.TransitionValues?);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) 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_PREFIX) protected void end();
- method public androidx.transition.Transition excludeChildren(android.view.View, boolean);
- method public androidx.transition.Transition excludeChildren(@IdRes int, boolean);
- method public androidx.transition.Transition excludeChildren(Class<?>, boolean);
- method public androidx.transition.Transition excludeTarget(android.view.View, boolean);
- method public androidx.transition.Transition excludeTarget(@IdRes int, boolean);
- method public androidx.transition.Transition excludeTarget(String, boolean);
- method public androidx.transition.Transition excludeTarget(Class<?>, boolean);
- method public long getDuration();
- method public android.graphics.Rect? getEpicenter();
- method public androidx.transition.Transition.EpicenterCallback? getEpicenterCallback();
- method public androidx.core.animation.Interpolator? getInterpolator();
- method public String getName();
- method public androidx.transition.PathMotion getPathMotion();
- method public androidx.transition.TransitionPropagation? getPropagation();
- method public long getStartDelay();
- method public java.util.List<java.lang.Integer!> getTargetIds();
- method public java.util.List<java.lang.String!>? getTargetNames();
- method public java.util.List<java.lang.Class<?>!>? getTargetTypes();
- method public java.util.List<android.view.View!> getTargets();
- method public String![]? getTransitionProperties();
- method public androidx.transition.TransitionValues? getTransitionValues(android.view.View, boolean);
- method public boolean isTransitionRequired(androidx.transition.TransitionValues?, androidx.transition.TransitionValues?);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void pause(android.view.View!);
- method public androidx.transition.Transition removeListener(androidx.transition.Transition.TransitionListener);
- method public androidx.transition.Transition removeTarget(android.view.View);
- method public androidx.transition.Transition removeTarget(@IdRes int);
- method public androidx.transition.Transition removeTarget(String);
- method public androidx.transition.Transition removeTarget(Class<?>);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void resume(android.view.View!);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) protected void runAnimators();
- method public androidx.transition.Transition setDuration(long);
- method public void setEpicenterCallback(androidx.transition.Transition.EpicenterCallback?);
- method public androidx.transition.Transition setInterpolator(androidx.core.animation.Interpolator?);
- method public void setMatchOrder(@androidx.transition.Transition.MatchOrder int...);
- method public void setPathMotion(androidx.transition.PathMotion?);
- method public void setPropagation(androidx.transition.TransitionPropagation?);
- method public androidx.transition.Transition setStartDelay(long);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) protected void start();
- field public static final int MATCH_ID = 3; // 0x3
- field public static final int MATCH_INSTANCE = 1; // 0x1
- field public static final int MATCH_ITEM_ID = 4; // 0x4
- field public static final int MATCH_NAME = 2; // 0x2
- }
-
- public abstract static class Transition.EpicenterCallback {
- ctor public Transition.EpicenterCallback();
- method public abstract android.graphics.Rect! onGetEpicenter(androidx.transition.Transition);
- }
-
- @IntDef({androidx.transition.Transition.MATCH_INSTANCE, androidx.transition.Transition.MATCH_NAME, androidx.transition.Transition.MATCH_ID, androidx.transition.Transition.MATCH_ITEM_ID}) @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) public static @interface Transition.MatchOrder {
- }
-
- public static interface Transition.TransitionListener {
- method public void onTransitionCancel(androidx.transition.Transition);
- method public void onTransitionEnd(androidx.transition.Transition);
- method public void onTransitionPause(androidx.transition.Transition);
- method public void onTransitionResume(androidx.transition.Transition);
- method public void onTransitionStart(androidx.transition.Transition);
- }
-
- public class TransitionInflater {
- method public static androidx.transition.TransitionInflater from(android.content.Context);
- method public androidx.transition.Transition! inflateTransition(int);
- method public androidx.transition.TransitionManager! inflateTransitionManager(int, android.view.ViewGroup!);
- }
-
- public class TransitionListenerAdapter implements androidx.transition.Transition.TransitionListener {
- ctor public TransitionListenerAdapter();
- method public void onTransitionCancel(androidx.transition.Transition);
- method public void onTransitionEnd(androidx.transition.Transition);
- method public void onTransitionPause(androidx.transition.Transition);
- method public void onTransitionResume(androidx.transition.Transition);
- method public void onTransitionStart(androidx.transition.Transition);
- }
-
- public class TransitionManager {
- ctor public TransitionManager();
- method public static void beginDelayedTransition(android.view.ViewGroup);
- method public static void beginDelayedTransition(android.view.ViewGroup, androidx.transition.Transition?);
- method public static void endTransitions(android.view.ViewGroup!);
- method public static void go(androidx.transition.Scene);
- method public static void go(androidx.transition.Scene, androidx.transition.Transition?);
- method public void setTransition(androidx.transition.Scene, androidx.transition.Transition?);
- method public void setTransition(androidx.transition.Scene, androidx.transition.Scene, androidx.transition.Transition?);
- method public void transitionTo(androidx.transition.Scene);
- }
-
- public abstract class TransitionPropagation {
- ctor public TransitionPropagation();
- method public abstract void captureValues(androidx.transition.TransitionValues!);
- method public abstract String![]! getPropagationProperties();
- method public abstract long getStartDelay(android.view.ViewGroup!, androidx.transition.Transition!, androidx.transition.TransitionValues!, androidx.transition.TransitionValues!);
- }
-
- public class TransitionSet extends androidx.transition.Transition {
- ctor public TransitionSet();
- ctor public TransitionSet(android.content.Context, android.util.AttributeSet);
- method public androidx.transition.TransitionSet addListener(androidx.transition.Transition.TransitionListener);
- method public androidx.transition.TransitionSet addTarget(android.view.View);
- method public androidx.transition.TransitionSet addTarget(@IdRes int);
- method public androidx.transition.TransitionSet addTarget(String);
- method public androidx.transition.TransitionSet addTarget(Class<?>);
- method public androidx.transition.TransitionSet addTransition(androidx.transition.Transition);
- method public void captureEndValues(androidx.transition.TransitionValues);
- method public void captureStartValues(androidx.transition.TransitionValues);
- method public int getOrdering();
- method public androidx.transition.Transition? getTransitionAt(int);
- method public int getTransitionCount();
- method public androidx.transition.TransitionSet removeListener(androidx.transition.Transition.TransitionListener);
- method public androidx.transition.TransitionSet removeTarget(@IdRes int);
- method public androidx.transition.TransitionSet removeTarget(android.view.View);
- method public androidx.transition.TransitionSet removeTarget(Class<?>);
- method public androidx.transition.TransitionSet removeTarget(String);
- method public androidx.transition.TransitionSet removeTransition(androidx.transition.Transition);
- method public androidx.transition.TransitionSet setDuration(long);
- method public androidx.transition.TransitionSet setInterpolator(androidx.core.animation.Interpolator?);
- method public androidx.transition.TransitionSet setOrdering(int);
- method public androidx.transition.TransitionSet setStartDelay(long);
- field public static final int ORDERING_SEQUENTIAL = 1; // 0x1
- field public static final int ORDERING_TOGETHER = 0; // 0x0
- }
-
- public class TransitionValues {
- ctor @Deprecated public TransitionValues();
- ctor public TransitionValues(android.view.View);
- field public final java.util.Map<java.lang.String!,java.lang.Object!>! values;
- field public android.view.View! view;
- }
-
- public abstract class Visibility extends androidx.transition.Transition {
- ctor public Visibility();
- ctor public Visibility(android.content.Context, android.util.AttributeSet);
- method public void captureEndValues(androidx.transition.TransitionValues);
- method public void captureStartValues(androidx.transition.TransitionValues);
- method @androidx.transition.Visibility.Mode public int getMode();
- method public boolean isVisible(androidx.transition.TransitionValues!);
- method public androidx.core.animation.Animator? onAppear(android.view.ViewGroup!, androidx.transition.TransitionValues!, int, androidx.transition.TransitionValues!, int);
- method public androidx.core.animation.Animator? onAppear(android.view.ViewGroup!, android.view.View!, androidx.transition.TransitionValues!, androidx.transition.TransitionValues!);
- method public androidx.core.animation.Animator? onDisappear(android.view.ViewGroup!, androidx.transition.TransitionValues!, int, androidx.transition.TransitionValues!, int);
- method public androidx.core.animation.Animator? onDisappear(android.view.ViewGroup!, android.view.View!, androidx.transition.TransitionValues!, androidx.transition.TransitionValues!);
- method public void setMode(@androidx.transition.Visibility.Mode int);
- field public static final int MODE_IN = 1; // 0x1
- field public static final int MODE_OUT = 2; // 0x2
- }
-
- @IntDef(flag=true, value={androidx.transition.Visibility.MODE_IN, androidx.transition.Visibility.MODE_OUT, androidx.transition.Fade.IN, androidx.transition.Fade.OUT}) @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) public static @interface Visibility.Mode {
- }
-
- public abstract class VisibilityPropagation extends androidx.transition.TransitionPropagation {
- ctor public VisibilityPropagation();
- method public void captureValues(androidx.transition.TransitionValues!);
- method public String![]! getPropagationProperties();
- method public int getViewVisibility(androidx.transition.TransitionValues!);
- method public int getViewX(androidx.transition.TransitionValues!);
- method public int getViewY(androidx.transition.TransitionValues!);
- }
-
-}
-
diff --git a/transition/transition/api/restricted_current.txt b/transition/transition/api/restricted_current.txt
index eec52d6..fdce88d 100644
--- a/transition/transition/api/restricted_current.txt
+++ b/transition/transition/api/restricted_current.txt
@@ -151,12 +151,12 @@
method public androidx.transition.Transition addTarget(@IdRes int);
method public androidx.transition.Transition addTarget(String);
method public androidx.transition.Transition addTarget(Class<?>);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) protected void animate(androidx.core.animation.Animator!);
+ method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) protected void animate(android.animation.Animator!);
method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) protected void cancel();
method public abstract void captureEndValues(androidx.transition.TransitionValues);
method public abstract void captureStartValues(androidx.transition.TransitionValues);
- method public androidx.transition.Transition clone();
- method public androidx.core.animation.Animator? createAnimator(android.view.ViewGroup, androidx.transition.TransitionValues?, androidx.transition.TransitionValues?);
+ method public androidx.transition.Transition! clone();
+ method public android.animation.Animator? createAnimator(android.view.ViewGroup, androidx.transition.TransitionValues?, androidx.transition.TransitionValues?);
method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) 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_PREFIX) protected void end();
method public androidx.transition.Transition excludeChildren(android.view.View, boolean);
@@ -169,7 +169,7 @@
method public long getDuration();
method public android.graphics.Rect? getEpicenter();
method public androidx.transition.Transition.EpicenterCallback? getEpicenterCallback();
- method public androidx.core.animation.Interpolator? getInterpolator();
+ method public android.animation.TimeInterpolator? getInterpolator();
method public String getName();
method public androidx.transition.PathMotion getPathMotion();
method public androidx.transition.TransitionPropagation? getPropagation();
@@ -191,7 +191,7 @@
method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) protected void runAnimators();
method public androidx.transition.Transition setDuration(long);
method public void setEpicenterCallback(androidx.transition.Transition.EpicenterCallback?);
- method public androidx.transition.Transition setInterpolator(androidx.core.animation.Interpolator?);
+ method public androidx.transition.Transition setInterpolator(android.animation.TimeInterpolator?);
method public void setMatchOrder(@androidx.transition.Transition.MatchOrder int...);
method public void setPathMotion(androidx.transition.PathMotion?);
method public void setPropagation(androidx.transition.TransitionPropagation?);
@@ -274,7 +274,7 @@
method public androidx.transition.TransitionSet removeTarget(String);
method public androidx.transition.TransitionSet removeTransition(androidx.transition.Transition);
method public androidx.transition.TransitionSet setDuration(long);
- method public androidx.transition.TransitionSet setInterpolator(androidx.core.animation.Interpolator?);
+ method public androidx.transition.TransitionSet setInterpolator(android.animation.TimeInterpolator?);
method public androidx.transition.TransitionSet setOrdering(int);
method public androidx.transition.TransitionSet setStartDelay(long);
field public static final int ORDERING_SEQUENTIAL = 1; // 0x1
@@ -295,10 +295,10 @@
method public void captureStartValues(androidx.transition.TransitionValues);
method @androidx.transition.Visibility.Mode public int getMode();
method public boolean isVisible(androidx.transition.TransitionValues!);
- method public androidx.core.animation.Animator? onAppear(android.view.ViewGroup!, androidx.transition.TransitionValues!, int, androidx.transition.TransitionValues!, int);
- method public androidx.core.animation.Animator? onAppear(android.view.ViewGroup!, android.view.View!, androidx.transition.TransitionValues!, androidx.transition.TransitionValues!);
- method public androidx.core.animation.Animator? onDisappear(android.view.ViewGroup!, androidx.transition.TransitionValues!, int, androidx.transition.TransitionValues!, int);
- method public androidx.core.animation.Animator? onDisappear(android.view.ViewGroup!, android.view.View!, androidx.transition.TransitionValues!, androidx.transition.TransitionValues!);
+ method public android.animation.Animator? onAppear(android.view.ViewGroup!, androidx.transition.TransitionValues!, int, androidx.transition.TransitionValues!, int);
+ method public android.animation.Animator? onAppear(android.view.ViewGroup!, android.view.View!, androidx.transition.TransitionValues!, androidx.transition.TransitionValues!);
+ method public android.animation.Animator? onDisappear(android.view.ViewGroup!, androidx.transition.TransitionValues!, int, androidx.transition.TransitionValues!, int);
+ method public android.animation.Animator? onDisappear(android.view.ViewGroup!, android.view.View!, androidx.transition.TransitionValues!, androidx.transition.TransitionValues!);
method public void setMode(@androidx.transition.Visibility.Mode int);
field public static final int MODE_IN = 1; // 0x1
field public static final int MODE_OUT = 2; // 0x2
diff --git a/transition/transition/build.gradle b/transition/transition/build.gradle
index 6d3f74d..7a5e169 100644
--- a/transition/transition/build.gradle
+++ b/transition/transition/build.gradle
@@ -13,7 +13,6 @@
dependencies {
api("androidx.annotation:annotation:1.1.0")
api("androidx.core:core:1.1.0")
- api(project(":core:core-animation"))
implementation("androidx.collection:collection:1.1.0")
compileOnly(project(":fragment:fragment"))
compileOnly("androidx.appcompat:appcompat:1.0.1")
@@ -38,8 +37,8 @@
android {
compileOptions {
- sourceCompatibility = JavaVersion.VERSION_1_8
- targetCompatibility = JavaVersion.VERSION_1_8
+ sourceCompatibility = JavaVersion.VERSION_1_7
+ targetCompatibility = JavaVersion.VERSION_1_7
}
buildTypes.all {
consumerProguardFiles 'proguard-rules.pro'
diff --git a/transition/transition/src/androidTest/java/androidx/transition/BaseTransitionTest.java b/transition/transition/src/androidTest/java/androidx/transition/BaseTransitionTest.java
index 5e25809..a8fc93e 100644
--- a/transition/transition/src/androidTest/java/androidx/transition/BaseTransitionTest.java
+++ b/transition/transition/src/androidTest/java/androidx/transition/BaseTransitionTest.java
@@ -21,12 +21,12 @@
import static org.mockito.Mockito.timeout;
import static org.mockito.Mockito.verify;
+import android.animation.Animator;
+import android.animation.ObjectAnimator;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;
-import androidx.core.animation.Animator;
-import androidx.core.animation.ObjectAnimator;
import androidx.test.platform.app.InstrumentationRegistry;
import androidx.testutils.AnimationDurationScaleRule;
import androidx.transition.test.R;
diff --git a/transition/transition/src/androidTest/java/androidx/transition/ChangeBoundsTest.java b/transition/transition/src/androidTest/java/androidx/transition/ChangeBoundsTest.java
index 97357e5..7e7f751 100644
--- a/transition/transition/src/androidTest/java/androidx/transition/ChangeBoundsTest.java
+++ b/transition/transition/src/androidTest/java/androidx/transition/ChangeBoundsTest.java
@@ -24,10 +24,10 @@
import android.content.Context;
import android.os.Build;
import android.view.View;
+import android.view.animation.LinearInterpolator;
import android.widget.FrameLayout;
import androidx.annotation.NonNull;
-import androidx.core.animation.LinearInterpolator;
import androidx.test.annotation.UiThreadTest;
import androidx.test.filters.LargeTest;
import androidx.transition.test.R;
diff --git a/transition/transition/src/androidTest/java/androidx/transition/ChangeImageTransformTest.java b/transition/transition/src/androidTest/java/androidx/transition/ChangeImageTransformTest.java
index 6903822..6b3802f 100644
--- a/transition/transition/src/androidTest/java/androidx/transition/ChangeImageTransformTest.java
+++ b/transition/transition/src/androidTest/java/androidx/transition/ChangeImageTransformTest.java
@@ -25,6 +25,8 @@
import static org.mockito.Mockito.never;
import static org.mockito.Mockito.verify;
+import android.animation.Animator;
+import android.animation.AnimatorListenerAdapter;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Matrix;
@@ -37,8 +39,6 @@
import android.widget.ImageView;
import androidx.annotation.NonNull;
-import androidx.core.animation.Animator;
-import androidx.core.animation.AnimatorListenerAdapter;
import androidx.core.app.ActivityCompat;
import androidx.test.filters.LargeTest;
import androidx.test.platform.app.InstrumentationRegistry;
@@ -372,12 +372,12 @@
}
@Override
- public void onAnimationStart(@NonNull Animator animation) {
+ public void onAnimationStart(Animator animation) {
mStartMatrix = copyMatrix();
}
@Override
- public void onAnimationEnd(@NonNull Animator animation) {
+ public void onAnimationEnd(Animator animation) {
mEndMatrix = copyMatrix();
}
diff --git a/transition/transition/src/androidTest/java/androidx/transition/FadeTest.java b/transition/transition/src/androidTest/java/androidx/transition/FadeTest.java
index 36fe4d5..fa58f8b 100644
--- a/transition/transition/src/androidTest/java/androidx/transition/FadeTest.java
+++ b/transition/transition/src/androidTest/java/androidx/transition/FadeTest.java
@@ -31,15 +31,15 @@
import static org.mockito.Mockito.timeout;
import static org.mockito.Mockito.verify;
+import android.animation.Animator;
+import android.animation.ObjectAnimator;
+import android.animation.ValueAnimator;
import android.os.Build;
import android.view.View;
import android.view.ViewGroup;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
-import androidx.core.animation.Animator;
-import androidx.core.animation.ObjectAnimator;
-import androidx.core.animation.ValueAnimator;
import androidx.test.annotation.UiThreadTest;
import androidx.test.filters.LargeTest;
import androidx.test.platform.app.InstrumentationRegistry;
@@ -300,12 +300,11 @@
@Nullable final TransitionValues endValues) {
final Animator animator = super.createAnimator(sceneRoot, startValues, endValues);
if (animator instanceof ObjectAnimator) {
- animator.addUpdateListener(
+ ((ObjectAnimator) animator).addUpdateListener(
new ValueAnimator.AnimatorUpdateListener() {
@Override
- public void onAnimationUpdate(@NonNull Animator animation) {
- final ValueAnimator anim = (ValueAnimator) animation;
- final float alpha = (float) anim.getAnimatedValue();
+ public void onAnimationUpdate(ValueAnimator animation) {
+ final float alpha = (float) animation.getAnimatedValue();
mAlphaValues[1] = alpha;
if (mInitialAlpha < 0) {
mInitialAlpha = alpha;
diff --git a/transition/transition/src/androidTest/java/androidx/transition/PrevTransitionStoppedTest.java b/transition/transition/src/androidTest/java/androidx/transition/PrevTransitionStoppedTest.java
index 8050da9..873d8c6 100644
--- a/transition/transition/src/androidTest/java/androidx/transition/PrevTransitionStoppedTest.java
+++ b/transition/transition/src/androidTest/java/androidx/transition/PrevTransitionStoppedTest.java
@@ -21,12 +21,12 @@
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
+import android.animation.Animator;
+import android.animation.ValueAnimator;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
-import androidx.core.animation.Animator;
-import androidx.core.animation.ValueAnimator;
import androidx.test.filters.MediumTest;
import androidx.transition.test.R;
diff --git a/transition/transition/src/androidTest/java/androidx/transition/PropagationTest.java b/transition/transition/src/androidTest/java/androidx/transition/PropagationTest.java
index a5a104d..8c6da69 100644
--- a/transition/transition/src/androidTest/java/androidx/transition/PropagationTest.java
+++ b/transition/transition/src/androidTest/java/androidx/transition/PropagationTest.java
@@ -23,6 +23,9 @@
import static org.junit.Assert.assertThat;
import static org.junit.Assert.assertTrue;
+import android.animation.Animator;
+import android.animation.AnimatorListenerAdapter;
+import android.animation.ObjectAnimator;
import android.graphics.Rect;
import android.util.SparseArray;
import android.view.Gravity;
@@ -30,9 +33,6 @@
import android.view.ViewGroup;
import androidx.annotation.NonNull;
-import androidx.core.animation.Animator;
-import androidx.core.animation.AnimatorListenerAdapter;
-import androidx.core.animation.ObjectAnimator;
import androidx.test.filters.MediumTest;
import androidx.test.platform.app.InstrumentationRegistry;
import androidx.transition.test.R;
@@ -111,7 +111,7 @@
final Animator anim = super.onDisappear(sceneRoot, view, startValues, endValues);
anim.addListener(new AnimatorListenerAdapter() {
@Override
- public void onAnimationStart(@NonNull Animator animation) {
+ public void onAnimationStart(Animator animation) {
final ObjectAnimator a = (ObjectAnimator) animation;
final int viewId = ((View) a.getTarget()).getId();
final long startDelay = a.getStartDelay();
diff --git a/transition/transition/src/androidTest/java/androidx/transition/TrackingVisibility.java b/transition/transition/src/androidTest/java/androidx/transition/TrackingVisibility.java
index 91917c5..46c421e 100644
--- a/transition/transition/src/androidTest/java/androidx/transition/TrackingVisibility.java
+++ b/transition/transition/src/androidTest/java/androidx/transition/TrackingVisibility.java
@@ -15,14 +15,13 @@
*/
package androidx.transition;
+import android.animation.Animator;
+import android.animation.AnimatorListenerAdapter;
+import android.animation.ObjectAnimator;
import android.graphics.Rect;
import android.view.View;
import android.view.ViewGroup;
-import androidx.annotation.NonNull;
-import androidx.core.animation.Animator;
-import androidx.core.animation.AnimatorListenerAdapter;
-import androidx.core.animation.ObjectAnimator;
import androidx.fragment.app.TargetTracking;
import java.util.ArrayList;
@@ -73,7 +72,7 @@
// and wait for that to end.
animator.addListener(new AnimatorListenerAdapter() {
@Override
- public void onAnimationStart(@NonNull Animator animation) {
+ public void onAnimationStart(Animator animation) {
super.onAnimationStart(animation);
animation.removeListener(this);
animation.addListener(this);
@@ -81,7 +80,7 @@
}
@Override
- public void onAnimationEnd(@NonNull Animator animation) {
+ public void onAnimationEnd(Animator animation) {
endAnimatorCountDownLatch.countDown();
animation.removeListener(this);
}
@@ -91,7 +90,6 @@
return null;
}
- @NonNull
@Override
public ArrayList<View> getTrackedTargets() {
return targets;
diff --git a/transition/transition/src/androidTest/java/androidx/transition/TransitionSetTest.java b/transition/transition/src/androidTest/java/androidx/transition/TransitionSetTest.java
index f146126..dfcb088 100644
--- a/transition/transition/src/androidTest/java/androidx/transition/TransitionSetTest.java
+++ b/transition/transition/src/androidTest/java/androidx/transition/TransitionSetTest.java
@@ -25,15 +25,14 @@
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertSame;
+import android.animation.TimeInterpolator;
import android.graphics.Rect;
import android.view.View;
import android.view.ViewGroup;
+import android.view.animation.AccelerateDecelerateInterpolator;
+import android.view.animation.AccelerateInterpolator;
+import android.view.animation.DecelerateInterpolator;
-import androidx.annotation.NonNull;
-import androidx.core.animation.AccelerateDecelerateInterpolator;
-import androidx.core.animation.AccelerateInterpolator;
-import androidx.core.animation.DecelerateInterpolator;
-import androidx.core.animation.Interpolator;
import androidx.test.filters.SmallTest;
import androidx.transition.test.R;
@@ -146,7 +145,7 @@
fade.setPropagation(new TestPropagation());
fade.setEpicenterCallback(new Transition.EpicenterCallback() {
@Override
- public Rect onGetEpicenter(@NonNull Transition transition) {
+ public Rect onGetEpicenter(Transition transition) {
return null;
}
});
@@ -156,11 +155,11 @@
TransitionSet transitionSet = new TransitionSet();
int duration = 100;
TestPropagation propagation = new TestPropagation();
- Interpolator interpolator = new DecelerateInterpolator();
+ TimeInterpolator interpolator = new DecelerateInterpolator();
PathMotion pathMotion = new ArcMotion();
Transition.EpicenterCallback epicenterCallback = new Transition.EpicenterCallback() {
@Override
- public Rect onGetEpicenter(@NonNull Transition transition) {
+ public Rect onGetEpicenter(Transition transition) {
return null;
}
};
@@ -185,7 +184,7 @@
fade.setPropagation(new TestPropagation());
fade.setEpicenterCallback(new Transition.EpicenterCallback() {
@Override
- public Rect onGetEpicenter(@NonNull Transition transition) {
+ public Rect onGetEpicenter(Transition transition) {
return null;
}
});
@@ -212,11 +211,11 @@
Fade fade = new Fade();
int duration = 100;
TestPropagation propagation = new TestPropagation();
- Interpolator interpolator = new DecelerateInterpolator();
+ TimeInterpolator interpolator = new DecelerateInterpolator();
PathMotion pathMotion = new ArcMotion();
Transition.EpicenterCallback epicenterCallback = new Transition.EpicenterCallback() {
@Override
- public Rect onGetEpicenter(@NonNull Transition transition) {
+ public Rect onGetEpicenter(Transition transition) {
return null;
}
};
@@ -246,7 +245,7 @@
transitionSet.addTransition(fade); // here set's duration and interpolator are applied
int overriddenDuration = 200;
- Interpolator overriddenInterpolator = new AccelerateInterpolator();
+ TimeInterpolator overriddenInterpolator = new AccelerateInterpolator();
fade.setDuration(overriddenDuration);
fade.setInterpolator(overriddenInterpolator);
diff --git a/transition/transition/src/androidTest/java/androidx/transition/TransitionTest.java b/transition/transition/src/androidTest/java/androidx/transition/TransitionTest.java
index 5c654b5..2a52da8 100644
--- a/transition/transition/src/androidTest/java/androidx/transition/TransitionTest.java
+++ b/transition/transition/src/androidTest/java/androidx/transition/TransitionTest.java
@@ -32,20 +32,20 @@
import static org.mockito.Mockito.never;
import static org.mockito.Mockito.verify;
+import android.animation.Animator;
+import android.animation.ObjectAnimator;
+import android.animation.TimeInterpolator;
import android.graphics.Rect;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
+import android.view.animation.LinearInterpolator;
import android.widget.Button;
import android.widget.FrameLayout;
import android.widget.ImageView;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
-import androidx.core.animation.Animator;
-import androidx.core.animation.Interpolator;
-import androidx.core.animation.LinearInterpolator;
-import androidx.core.animation.ObjectAnimator;
import androidx.core.view.ViewCompat;
import androidx.test.annotation.UiThreadTest;
import androidx.test.filters.MediumTest;
@@ -88,7 +88,7 @@
@Test
public void testInterpolator() {
Transition transition = new EmptyTransition();
- Interpolator interpolator = new LinearInterpolator();
+ TimeInterpolator interpolator = new LinearInterpolator();
assertThat(transition.setInterpolator(interpolator), is(sameInstance(transition)));
assertThat(transition.getInterpolator(), is(interpolator));
}
@@ -226,7 +226,7 @@
public void testExcludeTargetType() throws Throwable {
showInitialScene();
Transition transition = new EmptyTransition();
- FrameLayout container = rule.getActivity().findViewById(R.id.container);
+ FrameLayout container = (FrameLayout) rule.getActivity().findViewById(R.id.container);
View view0 = rule.getActivity().findViewById(R.id.view0);
transition.addTarget(View.class);
assertThat(transition.isValidTarget(container), is(true));
diff --git a/transition/transition/src/androidTest/java/androidx/transition/TranslationAnimationCreatorTest.java b/transition/transition/src/androidTest/java/androidx/transition/TranslationAnimationCreatorTest.java
index 12173c1..976277a 100644
--- a/transition/transition/src/androidTest/java/androidx/transition/TranslationAnimationCreatorTest.java
+++ b/transition/transition/src/androidTest/java/androidx/transition/TranslationAnimationCreatorTest.java
@@ -20,10 +20,10 @@
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
+import android.animation.Animator;
import android.view.View;
+import android.view.animation.LinearInterpolator;
-import androidx.core.animation.Animator;
-import androidx.core.animation.LinearInterpolator;
import androidx.test.annotation.UiThreadTest;
import androidx.test.filters.LargeTest;
diff --git a/transition/transition/src/androidTest/java/androidx/transition/VisibilityTest.java b/transition/transition/src/androidTest/java/androidx/transition/VisibilityTest.java
index 704b0b3..dd8cb01 100644
--- a/transition/transition/src/androidTest/java/androidx/transition/VisibilityTest.java
+++ b/transition/transition/src/androidTest/java/androidx/transition/VisibilityTest.java
@@ -27,14 +27,14 @@
import static org.mockito.Mockito.timeout;
import static org.mockito.Mockito.verify;
+import android.animation.Animator;
+import android.animation.ObjectAnimator;
+import android.animation.ValueAnimator;
import android.view.View;
import android.view.ViewGroup;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
-import androidx.core.animation.Animator;
-import androidx.core.animation.ObjectAnimator;
-import androidx.core.animation.ValueAnimator;
import androidx.test.annotation.UiThreadTest;
import androidx.test.filters.FlakyTest;
import androidx.test.filters.MediumTest;
diff --git a/transition/transition/src/main/java/androidx/transition/AnimatorUtils.java b/transition/transition/src/main/java/androidx/transition/AnimatorUtils.java
new file mode 100644
index 0000000..6772a60
--- /dev/null
+++ b/transition/transition/src/main/java/androidx/transition/AnimatorUtils.java
@@ -0,0 +1,83 @@
+/*
+ * 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.animation.Animator;
+import android.animation.AnimatorListenerAdapter;
+import android.os.Build;
+
+import androidx.annotation.NonNull;
+
+import java.util.ArrayList;
+
+class AnimatorUtils {
+
+ static void addPauseListener(@NonNull Animator animator,
+ @NonNull AnimatorListenerAdapter listener) {
+ if (Build.VERSION.SDK_INT >= 19) {
+ animator.addPauseListener(listener);
+ }
+ }
+
+ static void pause(@NonNull Animator animator) {
+ if (Build.VERSION.SDK_INT >= 19) {
+ animator.pause();
+ } else {
+ final ArrayList<Animator.AnimatorListener> listeners = animator.getListeners();
+ if (listeners != null) {
+ for (int i = 0, size = listeners.size(); i < size; i++) {
+ final Animator.AnimatorListener listener = listeners.get(i);
+ if (listener instanceof AnimatorPauseListenerCompat) {
+ ((AnimatorPauseListenerCompat) listener).onAnimationPause(animator);
+ }
+ }
+ }
+ }
+ }
+
+ static void resume(@NonNull Animator animator) {
+ if (Build.VERSION.SDK_INT >= 19) {
+ animator.resume();
+ } else {
+ final ArrayList<Animator.AnimatorListener> listeners = animator.getListeners();
+ if (listeners != null) {
+ for (int i = 0, size = listeners.size(); i < size; i++) {
+ final Animator.AnimatorListener listener = listeners.get(i);
+ if (listener instanceof AnimatorPauseListenerCompat) {
+ ((AnimatorPauseListenerCompat) listener).onAnimationResume(animator);
+ }
+ }
+ }
+ }
+ }
+
+ /**
+ * Listeners can implement this interface in addition to the platform AnimatorPauseListener to
+ * make them compatible with API level 18 and below. Animators will not be paused or resumed,
+ * but the callbacks here are invoked.
+ */
+ interface AnimatorPauseListenerCompat {
+
+ void onAnimationPause(Animator animation);
+
+ void onAnimationResume(Animator animation);
+
+ }
+
+ private AnimatorUtils() {
+ }
+}
diff --git a/transition/transition/src/main/java/androidx/transition/ChangeBounds.java b/transition/transition/src/main/java/androidx/transition/ChangeBounds.java
index a652cb5..a0fcc2c 100644
--- a/transition/transition/src/main/java/androidx/transition/ChangeBounds.java
+++ b/transition/transition/src/main/java/androidx/transition/ChangeBounds.java
@@ -16,6 +16,11 @@
package androidx.transition;
+import android.animation.Animator;
+import android.animation.AnimatorListenerAdapter;
+import android.animation.AnimatorSet;
+import android.animation.ObjectAnimator;
+import android.animation.PropertyValuesHolder;
import android.annotation.SuppressLint;
import android.content.Context;
import android.content.res.TypedArray;
@@ -34,12 +39,6 @@
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
-import androidx.core.animation.Animator;
-import androidx.core.animation.AnimatorListenerAdapter;
-import androidx.core.animation.AnimatorSet;
-import androidx.core.animation.ObjectAnimator;
-import androidx.core.animation.PropertyValuesHolder;
-import androidx.core.animation.RectEvaluator;
import androidx.core.content.res.TypedArrayUtils;
import androidx.core.view.ViewCompat;
@@ -308,19 +307,19 @@
if (startWidth == endWidth && startHeight == endHeight) {
Path topLeftPath = getPathMotion().getPath(startLeft, startTop, endLeft,
endTop);
- anim = ObjectAnimator.ofObject(view, POSITION_PROPERTY, null,
+ anim = ObjectAnimatorUtils.ofPointF(view, POSITION_PROPERTY,
topLeftPath);
} else {
final ViewBounds viewBounds = new ViewBounds(view);
Path topLeftPath = getPathMotion().getPath(startLeft, startTop,
endLeft, endTop);
- ObjectAnimator topLeftAnimator = ObjectAnimator
- .ofObject(viewBounds, TOP_LEFT_PROPERTY, null, topLeftPath);
+ ObjectAnimator topLeftAnimator = ObjectAnimatorUtils
+ .ofPointF(viewBounds, TOP_LEFT_PROPERTY, topLeftPath);
Path bottomRightPath = getPathMotion().getPath(startRight, startBottom,
endRight, endBottom);
- ObjectAnimator bottomRightAnimator = ObjectAnimator.ofObject(
- viewBounds, BOTTOM_RIGHT_PROPERTY, null, bottomRightPath);
+ ObjectAnimator bottomRightAnimator = ObjectAnimatorUtils.ofPointF(
+ viewBounds, BOTTOM_RIGHT_PROPERTY, bottomRightPath);
AnimatorSet set = new AnimatorSet();
set.playTogether(topLeftAnimator, bottomRightAnimator);
anim = set;
@@ -334,12 +333,12 @@
} else if (startLeft != endLeft || startTop != endTop) {
Path topLeftPath = getPathMotion().getPath(startLeft, startTop,
endLeft, endTop);
- anim = ObjectAnimator.ofObject(view, TOP_LEFT_ONLY_PROPERTY, null,
+ anim = ObjectAnimatorUtils.ofPointF(view, TOP_LEFT_ONLY_PROPERTY,
topLeftPath);
} else {
Path bottomRight = getPathMotion().getPath(startRight, startBottom,
endRight, endBottom);
- anim = ObjectAnimator.ofObject(view, BOTTOM_RIGHT_ONLY_PROPERTY, null,
+ anim = ObjectAnimatorUtils.ofPointF(view, BOTTOM_RIGHT_ONLY_PROPERTY,
bottomRight);
}
} else {
@@ -353,7 +352,7 @@
if (startLeft != endLeft || startTop != endTop) {
Path topLeftPath = getPathMotion().getPath(startLeft, startTop, endLeft,
endTop);
- positionAnimator = ObjectAnimator.ofObject(view, POSITION_PROPERTY, null,
+ positionAnimator = ObjectAnimatorUtils.ofPointF(view, POSITION_PROPERTY,
topLeftPath);
}
final Rect finalClip = endClip;
@@ -372,12 +371,12 @@
private boolean mIsCanceled;
@Override
- public void onAnimationCancel(@NonNull Animator animation) {
+ public void onAnimationCancel(Animator animation) {
mIsCanceled = true;
}
@Override
- public void onAnimationEnd(@NonNull Animator animation) {
+ public void onAnimationEnd(Animator animation) {
if (!mIsCanceled) {
ViewCompat.setClipBounds(view, finalClip);
ViewUtils.setLeftTopRightBottom(view, endLeft, endTop, endRight,
@@ -443,12 +442,12 @@
Path topLeftPath = getPathMotion().getPath(startX - mTempLocation[0],
startY - mTempLocation[1], endX - mTempLocation[0],
endY - mTempLocation[1]);
- PropertyValuesHolder origin = PropertyValuesHolder.ofObject(
- DRAWABLE_ORIGIN_PROPERTY, null, topLeftPath);
+ PropertyValuesHolder origin = PropertyValuesHolderUtils.ofPointF(
+ DRAWABLE_ORIGIN_PROPERTY, topLeftPath);
ObjectAnimator anim = ObjectAnimator.ofPropertyValuesHolder(drawable, origin);
anim.addListener(new AnimatorListenerAdapter() {
@Override
- public void onAnimationEnd(@NonNull Animator animation) {
+ public void onAnimationEnd(Animator animation) {
ViewUtils.getOverlay(sceneRoot).remove(drawable);
ViewUtils.setTransitionAlpha(view, transitionAlpha);
}
diff --git a/transition/transition/src/main/java/androidx/transition/ChangeClipBounds.java b/transition/transition/src/main/java/androidx/transition/ChangeClipBounds.java
index 85c039d..b568ae2 100644
--- a/transition/transition/src/main/java/androidx/transition/ChangeClipBounds.java
+++ b/transition/transition/src/main/java/androidx/transition/ChangeClipBounds.java
@@ -16,6 +16,9 @@
package androidx.transition;
+import android.animation.Animator;
+import android.animation.AnimatorListenerAdapter;
+import android.animation.ObjectAnimator;
import android.content.Context;
import android.graphics.Rect;
import android.util.AttributeSet;
@@ -24,10 +27,6 @@
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
-import androidx.core.animation.Animator;
-import androidx.core.animation.AnimatorListenerAdapter;
-import androidx.core.animation.ObjectAnimator;
-import androidx.core.animation.RectEvaluator;
import androidx.core.view.ViewCompat;
/**
@@ -116,7 +115,7 @@
final View endView = endValues.view;
animator.addListener(new AnimatorListenerAdapter() {
@Override
- public void onAnimationEnd(@NonNull Animator animation) {
+ public void onAnimationEnd(Animator animation) {
ViewCompat.setClipBounds(endView, null);
}
});
diff --git a/transition/transition/src/main/java/androidx/transition/ChangeImageTransform.java b/transition/transition/src/main/java/androidx/transition/ChangeImageTransform.java
index 1b53282..cfdbbd3 100644
--- a/transition/transition/src/main/java/androidx/transition/ChangeImageTransform.java
+++ b/transition/transition/src/main/java/androidx/transition/ChangeImageTransform.java
@@ -16,6 +16,9 @@
package androidx.transition;
+import android.animation.Animator;
+import android.animation.ObjectAnimator;
+import android.animation.TypeEvaluator;
import android.content.Context;
import android.graphics.Matrix;
import android.graphics.Rect;
@@ -28,9 +31,6 @@
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
-import androidx.core.animation.Animator;
-import androidx.core.animation.ObjectAnimator;
-import androidx.core.animation.TypeEvaluator;
import java.util.Map;
@@ -54,8 +54,7 @@
private static final TypeEvaluator<Matrix> NULL_MATRIX_EVALUATOR = new TypeEvaluator<Matrix>() {
@Override
- public Matrix evaluate(float fraction, @NonNull Matrix startValue,
- @NonNull Matrix endValue) {
+ public Matrix evaluate(float fraction, Matrix startValue, Matrix endValue) {
return null;
}
};
diff --git a/transition/transition/src/main/java/androidx/transition/ChangeScroll.java b/transition/transition/src/main/java/androidx/transition/ChangeScroll.java
index 56421e3..d2b9a21 100644
--- a/transition/transition/src/main/java/androidx/transition/ChangeScroll.java
+++ b/transition/transition/src/main/java/androidx/transition/ChangeScroll.java
@@ -16,6 +16,8 @@
package androidx.transition;
+import android.animation.Animator;
+import android.animation.ObjectAnimator;
import android.content.Context;
import android.util.AttributeSet;
import android.view.View;
@@ -23,8 +25,6 @@
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
-import androidx.core.animation.Animator;
-import androidx.core.animation.ObjectAnimator;
/**
diff --git a/transition/transition/src/main/java/androidx/transition/ChangeTransform.java b/transition/transition/src/main/java/androidx/transition/ChangeTransform.java
index 69f36f5..84b869f 100644
--- a/transition/transition/src/main/java/androidx/transition/ChangeTransform.java
+++ b/transition/transition/src/main/java/androidx/transition/ChangeTransform.java
@@ -16,6 +16,10 @@
package androidx.transition;
+import android.animation.Animator;
+import android.animation.AnimatorListenerAdapter;
+import android.animation.ObjectAnimator;
+import android.animation.PropertyValuesHolder;
import android.annotation.SuppressLint;
import android.content.Context;
import android.content.res.TypedArray;
@@ -30,11 +34,6 @@
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
-import androidx.core.animation.Animator;
-import androidx.core.animation.AnimatorListenerAdapter;
-import androidx.core.animation.FloatArrayEvaluator;
-import androidx.core.animation.ObjectAnimator;
-import androidx.core.animation.PropertyValuesHolder;
import androidx.core.content.res.TypedArrayUtils;
import androidx.core.view.ViewCompat;
@@ -322,8 +321,8 @@
Path path = getPathMotion().getPath(startMatrixValues[Matrix.MTRANS_X],
startMatrixValues[Matrix.MTRANS_Y], endMatrixValues[Matrix.MTRANS_X],
endMatrixValues[Matrix.MTRANS_Y]);
- PropertyValuesHolder translationProperty = PropertyValuesHolder.ofObject(
- TRANSLATIONS_PROPERTY, null, path);
+ PropertyValuesHolder translationProperty = PropertyValuesHolderUtils.ofPointF(
+ TRANSLATIONS_PROPERTY, path);
ObjectAnimator animator = ObjectAnimator.ofPropertyValuesHolder(pathAnimatorMatrix,
valuesProperty, translationProperty);
@@ -334,12 +333,12 @@
private Matrix mTempMatrix = new Matrix();
@Override
- public void onAnimationCancel(@NonNull Animator animation) {
+ public void onAnimationCancel(Animator animation) {
mIsCanceled = true;
}
@Override
- public void onAnimationEnd(@NonNull Animator animation) {
+ public void onAnimationEnd(Animator animation) {
if (!mIsCanceled) {
if (handleParentChange && mUseOverlay) {
setCurrentMatrix(finalEndMatrix);
@@ -353,13 +352,13 @@
}
@Override
- public void onAnimationPause(@NonNull Animator animation) {
+ public void onAnimationPause(Animator animation) {
Matrix currentMatrix = pathAnimatorMatrix.getMatrix();
setCurrentMatrix(currentMatrix);
}
@Override
- public void onAnimationResume(@NonNull Animator animation) {
+ public void onAnimationResume(Animator animation) {
setIdentityTransforms(view);
}
@@ -371,7 +370,7 @@
};
animator.addListener(listener);
- animator.addPauseListener(listener);
+ AnimatorUtils.addPauseListener(animator, listener);
return animator;
}
diff --git a/transition/transition/src/main/java/androidx/transition/Explode.java b/transition/transition/src/main/java/androidx/transition/Explode.java
index a142b40..2423e3e 100644
--- a/transition/transition/src/main/java/androidx/transition/Explode.java
+++ b/transition/transition/src/main/java/androidx/transition/Explode.java
@@ -16,18 +16,18 @@
package androidx.transition;
+import android.animation.Animator;
+import android.animation.TimeInterpolator;
import android.content.Context;
import android.graphics.Rect;
import android.util.AttributeSet;
import android.view.View;
import android.view.ViewGroup;
+import android.view.animation.AccelerateInterpolator;
+import android.view.animation.DecelerateInterpolator;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
-import androidx.core.animation.AccelerateInterpolator;
-import androidx.core.animation.Animator;
-import androidx.core.animation.DecelerateInterpolator;
-import androidx.core.animation.Interpolator;
/**
* This transition tracks changes to the visibility of target views in the
@@ -42,8 +42,8 @@
*/
public class Explode extends Visibility {
- private static final Interpolator sDecelerate = new DecelerateInterpolator();
- private static final Interpolator sAccelerate = new AccelerateInterpolator();
+ private static final TimeInterpolator sDecelerate = new DecelerateInterpolator();
+ private static final TimeInterpolator sAccelerate = new AccelerateInterpolator();
private static final String PROPNAME_SCREEN_BOUNDS = "android:explode:screenBounds";
private int[] mTempLoc = new int[2];
diff --git a/transition/transition/src/main/java/androidx/transition/Fade.java b/transition/transition/src/main/java/androidx/transition/Fade.java
index 39071f1..50c8390 100644
--- a/transition/transition/src/main/java/androidx/transition/Fade.java
+++ b/transition/transition/src/main/java/androidx/transition/Fade.java
@@ -16,6 +16,9 @@
package androidx.transition;
+import android.animation.Animator;
+import android.animation.AnimatorListenerAdapter;
+import android.animation.ObjectAnimator;
import android.annotation.SuppressLint;
import android.content.Context;
import android.content.res.TypedArray;
@@ -27,9 +30,6 @@
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
-import androidx.core.animation.Animator;
-import androidx.core.animation.AnimatorListenerAdapter;
-import androidx.core.animation.ObjectAnimator;
import androidx.core.content.res.TypedArrayUtils;
import androidx.core.view.ViewCompat;
@@ -191,7 +191,7 @@
}
@Override
- public void onAnimationStart(@NonNull Animator animation) {
+ public void onAnimationStart(Animator animation) {
if (ViewCompat.hasOverlappingRendering(mView)
&& mView.getLayerType() == View.LAYER_TYPE_NONE) {
mLayerTypeChanged = true;
@@ -200,7 +200,7 @@
}
@Override
- public void onAnimationEnd(@NonNull Animator animation) {
+ public void onAnimationEnd(Animator animation) {
ViewUtils.setTransitionAlpha(mView, 1);
if (mLayerTypeChanged) {
mView.setLayerType(View.LAYER_TYPE_NONE, null);
diff --git a/transition/transition/src/main/java/androidx/transition/FloatArrayEvaluator.java b/transition/transition/src/main/java/androidx/transition/FloatArrayEvaluator.java
new file mode 100644
index 0000000..9947921
--- /dev/null
+++ b/transition/transition/src/main/java/androidx/transition/FloatArrayEvaluator.java
@@ -0,0 +1,70 @@
+/*
+ * 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.animation.TypeEvaluator;
+
+/**
+ * This evaluator can be used to perform type interpolation between <code>float[]</code> values.
+ * Each index into the array is treated as a separate value to interpolate. For example,
+ * evaluating <code>{100, 200}</code> and <code>{300, 400}</code> will interpolate the value at
+ * the first index between 100 and 300 and the value at the second index value between 200 and 400.
+ */
+class FloatArrayEvaluator implements TypeEvaluator<float[]> {
+
+ private float[] mArray;
+
+ /**
+ * Create a FloatArrayEvaluator that reuses <code>reuseArray</code> for every evaluate() call.
+ * Caution must be taken to ensure that the value returned from
+ * {@link android.animation.ValueAnimator#getAnimatedValue()} is not cached, modified, or
+ * used across threads. The value will be modified on each <code>evaluate()</code> call.
+ *
+ * @param reuseArray The array to modify and return from <code>evaluate</code>.
+ */
+ FloatArrayEvaluator(float[] reuseArray) {
+ mArray = reuseArray;
+ }
+
+ /**
+ * Interpolates the value at each index by the fraction. If
+ * {@link #FloatArrayEvaluator(float[])} was used to construct this object,
+ * <code>reuseArray</code> will be returned, otherwise a new <code>float[]</code>
+ * will be returned.
+ *
+ * @param fraction The fraction from the starting to the ending values
+ * @param startValue The start value.
+ * @param endValue The end value.
+ * @return A <code>float[]</code> where each element is an interpolation between
+ * the same index in startValue and endValue.
+ */
+ @Override
+ public float[] evaluate(float fraction, float[] startValue, float[] endValue) {
+ float[] array = mArray;
+ if (array == null) {
+ array = new float[startValue.length];
+ }
+
+ for (int i = 0; i < array.length; i++) {
+ float start = startValue[i];
+ float end = endValue[i];
+ array[i] = start + (fraction * (end - start));
+ }
+ return array;
+ }
+
+}
diff --git a/transition/transition/src/main/java/androidx/transition/ObjectAnimatorUtils.java b/transition/transition/src/main/java/androidx/transition/ObjectAnimatorUtils.java
new file mode 100644
index 0000000..bd73b58
--- /dev/null
+++ b/transition/transition/src/main/java/androidx/transition/ObjectAnimatorUtils.java
@@ -0,0 +1,36 @@
+/*
+ * 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.animation.ObjectAnimator;
+import android.graphics.Path;
+import android.graphics.PointF;
+import android.os.Build;
+import android.util.Property;
+
+class ObjectAnimatorUtils {
+
+ static <T> ObjectAnimator ofPointF(T target, Property<T, PointF> property, Path path) {
+ if (Build.VERSION.SDK_INT >= 21) {
+ return ObjectAnimator.ofObject(target, property, null, path);
+ }
+ return ObjectAnimator.ofFloat(target, new PathProperty<>(property, path), 0f, 1f);
+ }
+
+ private ObjectAnimatorUtils() {
+ }
+}
diff --git a/transition/transition/src/main/java/androidx/transition/PathProperty.java b/transition/transition/src/main/java/androidx/transition/PathProperty.java
new file mode 100644
index 0000000..be2dddb
--- /dev/null
+++ b/transition/transition/src/main/java/androidx/transition/PathProperty.java
@@ -0,0 +1,65 @@
+/*
+ * 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.Path;
+import android.graphics.PathMeasure;
+import android.graphics.PointF;
+import android.util.Property;
+
+/**
+ * A special {@link Property} that can animate a pair of properties bi-dimensionally along the
+ * specified path.
+ * <p>
+ * This property should always be used with Animator that sets float fractions between
+ * {@code 0.f} and {@code 1.f}. For example, setting {@code 0.5f} to this property sets the
+ * values right in the middle of the specified path to the underlying properties.
+ * <p>
+ * Unlike many of the platform built-in properties, instances of this class cannot be reused
+ * for later animations.
+ */
+class PathProperty<T> extends Property<T, Float> {
+
+ private final Property<T, PointF> mProperty;
+ private final PathMeasure mPathMeasure;
+ private final float mPathLength;
+ private final float[] mPosition = new float[2];
+ private final PointF mPointF = new PointF();
+ private float mCurrentFraction;
+
+ PathProperty(Property<T, PointF> property, Path path) {
+ super(Float.class, property.getName());
+ mProperty = property;
+ mPathMeasure = new PathMeasure(path, false);
+ mPathLength = mPathMeasure.getLength();
+ }
+
+ @Override
+ public Float get(T object) {
+ return mCurrentFraction;
+ }
+
+ @Override
+ public void set(T target, Float fraction) {
+ mCurrentFraction = fraction;
+ mPathMeasure.getPosTan(mPathLength * fraction, mPosition, null);
+ mPointF.x = mPosition[0];
+ mPointF.y = mPosition[1];
+ mProperty.set(target, mPointF);
+ }
+
+}
diff --git a/transition/transition/src/main/java/androidx/transition/PropertyValuesHolderUtils.java b/transition/transition/src/main/java/androidx/transition/PropertyValuesHolderUtils.java
new file mode 100644
index 0000000..42527c4
--- /dev/null
+++ b/transition/transition/src/main/java/androidx/transition/PropertyValuesHolderUtils.java
@@ -0,0 +1,46 @@
+/*
+ * 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.animation.PropertyValuesHolder;
+import android.graphics.Path;
+import android.graphics.PointF;
+import android.os.Build;
+import android.util.Property;
+
+class PropertyValuesHolderUtils {
+
+ /**
+ * Constructs and returns a PropertyValuesHolder with a given property and
+ * a Path along which the values should be animated. This variant supports a
+ * <code>TypeConverter</code> to convert from <code>PointF</code> to the target
+ * type.
+ *
+ * @param property The property being animated. Should not be null.
+ * @param path The Path along which the values should be animated.
+ * @return PropertyValuesHolder The constructed PropertyValuesHolder object.
+ */
+ static PropertyValuesHolder ofPointF(Property<?, PointF> property, Path path) {
+ if (Build.VERSION.SDK_INT >= 21) {
+ return PropertyValuesHolder.ofObject(property, null, path);
+ }
+ return PropertyValuesHolder.ofFloat(new PathProperty<>(property, path), 0f, 1f);
+ }
+
+ private PropertyValuesHolderUtils() {
+ }
+}
diff --git a/transition/transition/src/main/java/androidx/transition/RectEvaluator.java b/transition/transition/src/main/java/androidx/transition/RectEvaluator.java
new file mode 100644
index 0000000..6dab422
--- /dev/null
+++ b/transition/transition/src/main/java/androidx/transition/RectEvaluator.java
@@ -0,0 +1,86 @@
+/*
+ * 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.transition;
+
+import android.animation.TypeEvaluator;
+import android.graphics.Rect;
+
+/**
+ * This evaluator can be used to perform type interpolation between <code>Rect</code> values.
+ */
+class RectEvaluator implements TypeEvaluator<Rect> {
+
+ /**
+ * When null, a new Rect is returned on every evaluate call. When non-null,
+ * mRect will be modified and returned on every evaluate.
+ */
+ private Rect mRect;
+
+ /**
+ * Construct a RectEvaluator that returns a new Rect on every evaluate call.
+ * To avoid creating an object for each evaluate call,
+ * {@link RectEvaluator#RectEvaluator(android.graphics.Rect)} should be used
+ * whenever possible.
+ */
+ RectEvaluator() {
+ }
+
+ /**
+ * Constructs a RectEvaluator that modifies and returns <code>reuseRect</code>
+ * in {@link #evaluate(float, android.graphics.Rect, android.graphics.Rect)} calls.
+ * The value returned from
+ * {@link #evaluate(float, android.graphics.Rect, android.graphics.Rect)} should
+ * not be cached because it will change over time as the object is reused on each
+ * call.
+ *
+ * @param reuseRect A Rect to be modified and returned by evaluate.
+ */
+ RectEvaluator(Rect reuseRect) {
+ mRect = reuseRect;
+ }
+
+ /**
+ * This function returns the result of linearly interpolating the start and
+ * end Rect values, with <code>fraction</code> representing the proportion
+ * between the start and end values. The calculation is a simple parametric
+ * calculation on each of the separate components in the Rect objects
+ * (left, top, right, and bottom).
+ *
+ * <p>If {@link #RectEvaluator(android.graphics.Rect)} was used to construct
+ * this RectEvaluator, the object returned will be the <code>reuseRect</code>
+ * passed into the constructor.</p>
+ *
+ * @param fraction The fraction from the starting to the ending values
+ * @param startValue The start Rect
+ * @param endValue The end Rect
+ * @return A linear interpolation between the start and end values, given the
+ * <code>fraction</code> parameter.
+ */
+ @Override
+ public Rect evaluate(float fraction, Rect startValue, Rect endValue) {
+ int left = startValue.left + (int) ((endValue.left - startValue.left) * fraction);
+ int top = startValue.top + (int) ((endValue.top - startValue.top) * fraction);
+ int right = startValue.right + (int) ((endValue.right - startValue.right) * fraction);
+ int bottom = startValue.bottom + (int) ((endValue.bottom - startValue.bottom) * fraction);
+ if (mRect == null) {
+ return new Rect(left, top, right, bottom);
+ } else {
+ mRect.set(left, top, right, bottom);
+ return mRect;
+ }
+ }
+}
diff --git a/transition/transition/src/main/java/androidx/transition/Slide.java b/transition/transition/src/main/java/androidx/transition/Slide.java
index fc06702..ac438c3 100644
--- a/transition/transition/src/main/java/androidx/transition/Slide.java
+++ b/transition/transition/src/main/java/androidx/transition/Slide.java
@@ -18,6 +18,8 @@
import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import android.animation.Animator;
+import android.animation.TimeInterpolator;
import android.annotation.SuppressLint;
import android.content.Context;
import android.content.res.TypedArray;
@@ -25,15 +27,13 @@
import android.view.Gravity;
import android.view.View;
import android.view.ViewGroup;
+import android.view.animation.AccelerateInterpolator;
+import android.view.animation.DecelerateInterpolator;
import androidx.annotation.IntDef;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.RestrictTo;
-import androidx.core.animation.AccelerateInterpolator;
-import androidx.core.animation.Animator;
-import androidx.core.animation.DecelerateInterpolator;
-import androidx.core.animation.Interpolator;
import androidx.core.content.res.TypedArrayUtils;
import androidx.core.view.ViewCompat;
@@ -53,8 +53,8 @@
*/
public class Slide extends Visibility {
- private static final Interpolator sDecelerate = new DecelerateInterpolator();
- private static final Interpolator sAccelerate = new AccelerateInterpolator();
+ private static final TimeInterpolator sDecelerate = new DecelerateInterpolator();
+ private static final TimeInterpolator sAccelerate = new AccelerateInterpolator();
private static final String PROPNAME_SCREEN_POSITION = "android:slide:screenPosition";
private CalculateSlide mSlideCalculator = sCalculateBottom;
private int mSlideEdge = Gravity.BOTTOM;
diff --git a/transition/transition/src/main/java/androidx/transition/Transition.java b/transition/transition/src/main/java/androidx/transition/Transition.java
index b0444f5..4458a46 100644
--- a/transition/transition/src/main/java/androidx/transition/Transition.java
+++ b/transition/transition/src/main/java/androidx/transition/Transition.java
@@ -18,6 +18,9 @@
import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import android.animation.Animator;
+import android.animation.AnimatorListenerAdapter;
+import android.animation.TimeInterpolator;
import android.annotation.SuppressLint;
import android.content.Context;
import android.content.res.TypedArray;
@@ -33,6 +36,7 @@
import android.view.TextureView;
import android.view.View;
import android.view.ViewGroup;
+import android.view.animation.AnimationUtils;
import android.widget.ListView;
import android.widget.Spinner;
@@ -43,10 +47,6 @@
import androidx.annotation.RestrictTo;
import androidx.collection.ArrayMap;
import androidx.collection.LongSparseArray;
-import androidx.core.animation.Animator;
-import androidx.core.animation.AnimatorInflater;
-import androidx.core.animation.AnimatorListenerAdapter;
-import androidx.core.animation.Interpolator;
import androidx.core.content.res.TypedArrayUtils;
import androidx.core.view.ViewCompat;
@@ -182,7 +182,7 @@
private long mStartDelay = -1;
long mDuration = -1;
- private Interpolator mInterpolator = null;
+ private TimeInterpolator mInterpolator = null;
ArrayList<Integer> mTargetIds = new ArrayList<>();
ArrayList<View> mTargets = new ArrayList<>();
private ArrayList<String> mTargetNames = null;
@@ -287,7 +287,7 @@
final int resId = TypedArrayUtils.getNamedResourceId(a, parser, "interpolator",
Styleable.Transition.INTERPOLATOR, 0);
if (resId > 0) {
- setInterpolator(AnimatorInflater.loadInterpolator(context, resId));
+ setInterpolator(AnimationUtils.loadInterpolator(context, resId));
}
String matchOrder = TypedArrayUtils.getNamedString(a, parser, "matchOrder",
Styleable.Transition.MATCH_ORDER);
@@ -391,7 +391,7 @@
* @return This transition object.
*/
@NonNull
- public Transition setInterpolator(@Nullable Interpolator interpolator) {
+ public Transition setInterpolator(@Nullable TimeInterpolator interpolator) {
mInterpolator = interpolator;
return this;
}
@@ -405,7 +405,7 @@
* returns null.
*/
@Nullable
- public Interpolator getInterpolator() {
+ public TimeInterpolator getInterpolator() {
return mInterpolator;
}
@@ -894,12 +894,12 @@
// TODO: could be a single listener instance for all of them since it uses the param
animator.addListener(new AnimatorListenerAdapter() {
@Override
- public void onAnimationStart(@NonNull Animator animation) {
+ public void onAnimationStart(Animator animation) {
mCurrentAnimators.add(animation);
}
@Override
- public void onAnimationEnd(@NonNull Animator animation) {
+ public void onAnimationEnd(Animator animation) {
runningAnimators.remove(animation);
mCurrentAnimators.remove(animation);
}
@@ -1721,7 +1721,7 @@
AnimationInfo info = runningAnimators.valueAt(i);
if (info.mView != null && windowId.equals(info.mWindowId)) {
Animator anim = runningAnimators.keyAt(i);
- anim.pause();
+ AnimatorUtils.pause(anim);
}
}
if (mListeners != null && mListeners.size() > 0) {
@@ -1754,7 +1754,7 @@
AnimationInfo info = runningAnimators.valueAt(i);
if (info.mView != null && windowId.equals(info.mWindowId)) {
Animator anim = runningAnimators.keyAt(i);
- anim.resume();
+ AnimatorUtils.resume(anim);
}
}
if (mListeners != null && mListeners.size() > 0) {
@@ -1907,7 +1907,7 @@
}
animator.addListener(new AnimatorListenerAdapter() {
@Override
- public void onAnimationEnd(@NonNull Animator animation) {
+ public void onAnimationEnd(Animator animation) {
end();
animation.removeListener(this);
}
@@ -2205,13 +2205,11 @@
mCanRemoveViews = canRemoveViews;
}
- @NonNull
@Override
public String toString() {
return toString("");
}
- @NonNull
@Override
public Transition clone() {
try {
@@ -2223,7 +2221,7 @@
clone.mEndValuesList = null;
return clone;
} catch (CloneNotSupportedException e) {
- throw new RuntimeException(e);
+ return null;
}
}
diff --git a/transition/transition/src/main/java/androidx/transition/TransitionSet.java b/transition/transition/src/main/java/androidx/transition/TransitionSet.java
index 0371233..0c71667 100644
--- a/transition/transition/src/main/java/androidx/transition/TransitionSet.java
+++ b/transition/transition/src/main/java/androidx/transition/TransitionSet.java
@@ -18,6 +18,7 @@
import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import android.animation.TimeInterpolator;
import android.annotation.SuppressLint;
import android.content.Context;
import android.content.res.TypedArray;
@@ -31,7 +32,6 @@
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.RestrictTo;
-import androidx.core.animation.Interpolator;
import androidx.core.content.res.TypedArrayUtils;
import java.util.ArrayList;
@@ -254,7 +254,7 @@
@NonNull
@Override
- public TransitionSet setInterpolator(@Nullable Interpolator interpolator) {
+ public TransitionSet setInterpolator(@Nullable TimeInterpolator interpolator) {
mChangeFlags |= FLAG_CHANGE_INTERPOLATOR;
if (mTransitions != null) {
int numTransitions = mTransitions.size();
@@ -634,7 +634,6 @@
return result;
}
- @NonNull
@Override
public Transition clone() {
TransitionSet clone = (TransitionSet) super.clone();
diff --git a/transition/transition/src/main/java/androidx/transition/TransitionUtils.java b/transition/transition/src/main/java/androidx/transition/TransitionUtils.java
index ae17040..5360727 100644
--- a/transition/transition/src/main/java/androidx/transition/TransitionUtils.java
+++ b/transition/transition/src/main/java/androidx/transition/TransitionUtils.java
@@ -16,6 +16,9 @@
package androidx.transition;
+import android.animation.Animator;
+import android.animation.AnimatorSet;
+import android.animation.TypeEvaluator;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Matrix;
@@ -26,11 +29,6 @@
import android.view.ViewGroup;
import android.widget.ImageView;
-import androidx.annotation.NonNull;
-import androidx.core.animation.Animator;
-import androidx.core.animation.AnimatorSet;
-import androidx.core.animation.TypeEvaluator;
-
class TransitionUtils {
private static final int MAX_IMAGE_SIZE = 1024 * 1024;
@@ -162,10 +160,8 @@
final Matrix mTempMatrix = new Matrix();
- @NonNull
@Override
- public Matrix evaluate(float fraction, @NonNull Matrix startValue,
- @NonNull Matrix endValue) {
+ public Matrix evaluate(float fraction, Matrix startValue, Matrix endValue) {
startValue.getValues(mTempStartValues);
endValue.getValues(mTempEndValues);
for (int i = 0; i < 9; i++) {
diff --git a/transition/transition/src/main/java/androidx/transition/TranslationAnimationCreator.java b/transition/transition/src/main/java/androidx/transition/TranslationAnimationCreator.java
index 7104c4a..7a24a33 100644
--- a/transition/transition/src/main/java/androidx/transition/TranslationAnimationCreator.java
+++ b/transition/transition/src/main/java/androidx/transition/TranslationAnimationCreator.java
@@ -16,15 +16,15 @@
package androidx.transition;
+import android.animation.Animator;
+import android.animation.AnimatorListenerAdapter;
+import android.animation.ObjectAnimator;
+import android.animation.PropertyValuesHolder;
+import android.animation.TimeInterpolator;
import android.view.View;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
-import androidx.core.animation.Animator;
-import androidx.core.animation.AnimatorListenerAdapter;
-import androidx.core.animation.Interpolator;
-import androidx.core.animation.ObjectAnimator;
-import androidx.core.animation.PropertyValuesHolder;
/**
* This class is used by Slide and Explode to create an animator that goes from the start
@@ -52,7 +52,7 @@
@Nullable
static Animator createAnimation(@NonNull View view, @NonNull TransitionValues values,
int viewPosX, int viewPosY, float startX, float startY, float endX, float endY,
- @Nullable Interpolator interpolator, @NonNull Transition transition) {
+ @Nullable TimeInterpolator interpolator, @NonNull Transition transition) {
float terminalX = view.getTranslationX();
float terminalY = view.getTranslationY();
int[] startPosition = (int[]) values.view.getTag(R.id.transition_position);
@@ -77,7 +77,7 @@
startPosX, startPosY, terminalX, terminalY);
transition.addListener(listener);
anim.addListener(listener);
- anim.addPauseListener(listener);
+ AnimatorUtils.addPauseListener(anim, listener);
anim.setInterpolator(interpolator);
return anim;
}
@@ -110,7 +110,7 @@
}
@Override
- public void onAnimationCancel(@NonNull Animator animation) {
+ public void onAnimationCancel(Animator animation) {
if (mTransitionPosition == null) {
mTransitionPosition = new int[2];
}
@@ -120,7 +120,7 @@
}
@Override
- public void onAnimationPause(@NonNull Animator animator) {
+ public void onAnimationPause(Animator animator) {
mPausedX = mMovingView.getTranslationX();
mPausedY = mMovingView.getTranslationY();
mMovingView.setTranslationX(mTerminalX);
@@ -128,7 +128,7 @@
}
@Override
- public void onAnimationResume(@NonNull Animator animator) {
+ public void onAnimationResume(Animator animator) {
mMovingView.setTranslationX(mPausedX);
mMovingView.setTranslationY(mPausedY);
}
diff --git a/transition/transition/src/main/java/androidx/transition/Visibility.java b/transition/transition/src/main/java/androidx/transition/Visibility.java
index 3d10a0f..23fbc3b 100644
--- a/transition/transition/src/main/java/androidx/transition/Visibility.java
+++ b/transition/transition/src/main/java/androidx/transition/Visibility.java
@@ -18,6 +18,8 @@
import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import android.animation.Animator;
+import android.animation.AnimatorListenerAdapter;
import android.annotation.SuppressLint;
import android.content.Context;
import android.content.res.TypedArray;
@@ -30,8 +32,6 @@
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.RestrictTo;
-import androidx.core.animation.Animator;
-import androidx.core.animation.AnimatorListenerAdapter;
import androidx.core.content.res.TypedArrayUtils;
import java.lang.annotation.Retention;
@@ -474,7 +474,7 @@
DisappearListener disappearListener = new DisappearListener(viewToKeep,
endVisibility, true);
animator.addListener(disappearListener);
- animator.addPauseListener(disappearListener);
+ AnimatorUtils.addPauseListener(animator, disappearListener);
addListener(disappearListener);
} else {
ViewUtils.setTransitionVisibility(viewToKeep, originalVisibility);
@@ -525,7 +525,7 @@
}
private static class DisappearListener extends AnimatorListenerAdapter
- implements TransitionListener {
+ implements TransitionListener, AnimatorUtils.AnimatorPauseListenerCompat {
private final View mView;
private final int mFinalVisibility;
@@ -547,7 +547,7 @@
// This overrides both AnimatorListenerAdapter and
// AnimatorUtilsApi14.AnimatorPauseListenerCompat
@Override
- public void onAnimationPause(@NonNull Animator animation) {
+ public void onAnimationPause(Animator animation) {
if (!mCanceled) {
ViewUtils.setTransitionVisibility(mView, mFinalVisibility);
}
@@ -556,27 +556,27 @@
// This overrides both AnimatorListenerAdapter and
// AnimatorUtilsApi14.AnimatorPauseListenerCompat
@Override
- public void onAnimationResume(@NonNull Animator animation) {
+ public void onAnimationResume(Animator animation) {
if (!mCanceled) {
ViewUtils.setTransitionVisibility(mView, View.VISIBLE);
}
}
@Override
- public void onAnimationCancel(@NonNull Animator animation) {
+ public void onAnimationCancel(Animator animation) {
mCanceled = true;
}
@Override
- public void onAnimationRepeat(@NonNull Animator animation) {
+ public void onAnimationRepeat(Animator animation) {
}
@Override
- public void onAnimationStart(@NonNull Animator animation) {
+ public void onAnimationStart(Animator animation) {
}
@Override
- public void onAnimationEnd(@NonNull Animator animation) {
+ public void onAnimationEnd(Animator animation) {
hideViewWhenNotCanceled();
}
diff --git a/ui/integration-tests/src/main/java/androidx/ui/integration/test/core/SimpleRadioButton1TestCase.kt b/ui/integration-tests/src/main/java/androidx/ui/integration/test/core/SimpleRadioButton1TestCase.kt
index 474a4a4..7803ca8 100644
--- a/ui/integration-tests/src/main/java/androidx/ui/integration/test/core/SimpleRadioButton1TestCase.kt
+++ b/ui/integration-tests/src/main/java/androidx/ui/integration/test/core/SimpleRadioButton1TestCase.kt
@@ -17,17 +17,18 @@
package androidx.ui.integration.test.core
import androidx.compose.Composable
-import androidx.compose.remember
+import androidx.ui.core.DensityAmbient
import androidx.ui.core.Modifier
import androidx.ui.foundation.Border
import androidx.ui.foundation.Box
-import androidx.ui.foundation.Canvas
+import androidx.ui.foundation.Canvas2
import androidx.ui.foundation.ContentGravity
import androidx.ui.foundation.shape.corner.CircleShape
import androidx.ui.graphics.Color
-import androidx.ui.graphics.Paint
import androidx.ui.graphics.drawOutline
import androidx.ui.layout.preferredSize
+import androidx.ui.unit.Px
+import androidx.ui.unit.PxSize
import androidx.ui.unit.dp
class SimpleRadioButton1TestCase : BaseSimpleRadioButtonTestCase() {
@@ -39,12 +40,13 @@
border = Border(1.dp, Color.Cyan),
gravity = ContentGravity.Center
) {
- val paint = remember {
- Paint().apply { color = Color.Cyan }
- }
val innerSize = getInnerSize().value
- Canvas(Modifier.preferredSize(innerSize)) {
- drawOutline(CircleShape.createOutline(size, this), paint)
+ val density = DensityAmbient.current
+ Canvas2(Modifier.preferredSize(innerSize)) {
+ drawOutline(
+ CircleShape.createOutline(PxSize(Px(size.width), Px(size.height)), density),
+ Color.Cyan
+ )
}
}
}
diff --git a/ui/integration-tests/src/main/java/androidx/ui/integration/test/core/SimpleRadioButton3TestCase.kt b/ui/integration-tests/src/main/java/androidx/ui/integration/test/core/SimpleRadioButton3TestCase.kt
index 9974a93..65fae25 100644
--- a/ui/integration-tests/src/main/java/androidx/ui/integration/test/core/SimpleRadioButton3TestCase.kt
+++ b/ui/integration-tests/src/main/java/androidx/ui/integration/test/core/SimpleRadioButton3TestCase.kt
@@ -17,28 +17,22 @@
package androidx.ui.integration.test.core
import androidx.compose.Composable
-import androidx.compose.remember
import androidx.ui.core.Modifier
-import androidx.ui.foundation.Canvas
-import androidx.ui.geometry.Offset
-import androidx.ui.graphics.Paint
-import androidx.ui.graphics.PaintingStyle
+import androidx.ui.foundation.Canvas2
+import androidx.ui.graphics.Color
+import androidx.ui.graphics.painter.Stroke
import androidx.ui.layout.preferredSize
import androidx.ui.unit.dp
-import androidx.ui.unit.minDimension
class SimpleRadioButton3TestCase : BaseSimpleRadioButtonTestCase() {
@Composable
override fun emitContent() {
val innerSize = getInnerSize()
- val borderPaint = remember { Paint().apply { style = PaintingStyle.stroke } }
- val fillPaint = remember { Paint() }
- Canvas(Modifier.preferredSize(48.dp)) {
- val center = Offset(size.width.value / 2f, size.height.value / 2f)
- drawCircle(center, size.minDimension.value, borderPaint)
- val innerRadius = innerSize.value.value / 2f
- drawCircle(center, innerRadius, fillPaint)
+ val stroke = Stroke()
+ Canvas2(Modifier.preferredSize(48.dp)) {
+ drawCircle(Color.Black, size.minDimension, style = stroke)
+ drawCircle(Color.Black, innerSize.value.value / 2f, center)
}
}
}
diff --git a/ui/integration-tests/src/main/java/androidx/ui/integration/test/foundation/ScrollerTestCase.kt b/ui/integration-tests/src/main/java/androidx/ui/integration/test/foundation/ScrollerTestCase.kt
index d47ac96..6dd8fb5 100644
--- a/ui/integration-tests/src/main/java/androidx/ui/integration/test/foundation/ScrollerTestCase.kt
+++ b/ui/integration-tests/src/main/java/androidx/ui/integration/test/foundation/ScrollerTestCase.kt
@@ -17,21 +17,17 @@
package androidx.ui.integration.test.foundation
import androidx.compose.Composable
-import androidx.compose.remember
import androidx.ui.core.Modifier
-import androidx.ui.foundation.Canvas
+import androidx.ui.foundation.Canvas2
import androidx.ui.foundation.ScrollerPosition
import androidx.ui.foundation.VerticalScroller
import androidx.ui.graphics.Color
-import androidx.ui.graphics.Paint
-import androidx.ui.graphics.PaintingStyle
import androidx.ui.integration.test.ToggleableTestCase
import androidx.ui.layout.Column
import androidx.ui.layout.fillMaxHeight
import androidx.ui.layout.preferredSize
import androidx.ui.test.ComposeTestCase
import androidx.ui.unit.dp
-import androidx.ui.unit.toRect
/**
* Test case that puts a large number of boxes in a column in a vertical scroller to force scrolling.
@@ -74,11 +70,8 @@
@Composable
fun ColorStripe(red: Int, green: Int, blue: Int) {
- val paint = remember { Paint() }
- Canvas(Modifier.preferredSize(45.dp, 5.dp)) {
- paint.color = Color(red = red, green = green, blue = blue)
- paint.style = PaintingStyle.fill
- drawRect(size.toRect(), paint)
+ Canvas2(Modifier.preferredSize(45.dp, 5.dp)) {
+ drawRect(Color(red = red, green = green, blue = blue))
}
}
}
diff --git a/ui/ui-android-view/integration-tests/android-view-demos/src/main/java/androidx/ui/androidview/demos/ComposeNothingInAndroidTap.kt b/ui/ui-android-view/integration-tests/android-view-demos/src/main/java/androidx/ui/androidview/demos/ComposeNothingInAndroidTap.kt
deleted file mode 100644
index 932b630..0000000
--- a/ui/ui-android-view/integration-tests/android-view-demos/src/main/java/androidx/ui/androidview/demos/ComposeNothingInAndroidTap.kt
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Copyright 2020 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT 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.ui.androidview.demos
-
-import android.os.Bundle
-import android.view.ViewGroup
-import android.widget.TextView
-import androidx.activity.ComponentActivity
-import androidx.compose.Composition
-import androidx.compose.Recomposer
-import androidx.ui.androidview.adapters.setOnClick
-import androidx.ui.core.Modifier
-import androidx.ui.core.setContent
-import androidx.ui.foundation.Box
-import androidx.ui.foundation.drawBackground
-import androidx.ui.graphics.Color
-import androidx.ui.graphics.RectangleShape
-import androidx.ui.graphics.toArgb
-import androidx.ui.layout.fillMaxSize
-
-open class ComposeNothingInAndroidTap : ComponentActivity() {
-
- private var currentColor = Color.DarkGray
-
- private lateinit var composition: Composition
-
- override fun onCreate(savedInstanceState: Bundle?) {
- super.onCreate(savedInstanceState)
- setContentView(R.layout.compose_in_android_tap)
-
- findViewById<TextView>(R.id.text1).text =
- "Intended to Demonstrate that when no gestureFilterModifiers are added to compose, " +
- "Compose will not interact with the pointer input stream. This currently " +
- "isn't actually the case however. "
-
- findViewById<TextView>(R.id.text2).text =
- "When you tap anywhere within the bounds of the colored, including the grey box in " +
- "the middle, the color is supposed to change. This currently does not occur " +
- "when you tap on the grey box however."
-
- val container = findViewById<ViewGroup>(R.id.clickableContainer)
- container.isClickable = true
- container.setBackgroundColor(currentColor.toArgb())
- container.setOnClick {
- currentColor = if (currentColor == Color.Green) {
- Color.Red
- } else {
- Color.Green
- }
- container.setBackgroundColor(currentColor.toArgb())
- }
- composition = container.setContent(Recomposer.current()) {
- Box(Modifier.drawBackground(Color.LightGray, RectangleShape).fillMaxSize())
- }
- }
-
- override fun onDestroy() {
- super.onDestroy()
- composition.dispose()
- }
-}
\ No newline at end of file
diff --git a/ui/ui-android-view/integration-tests/android-view-demos/src/main/java/androidx/ui/androidview/demos/ComposeScrollInAndroidScrollDifferentOrientation.kt b/ui/ui-android-view/integration-tests/android-view-demos/src/main/java/androidx/ui/androidview/demos/ComposeScrollInAndroidScrollDifferentOrientation.kt
deleted file mode 100644
index afbd12c..0000000
--- a/ui/ui-android-view/integration-tests/android-view-demos/src/main/java/androidx/ui/androidview/demos/ComposeScrollInAndroidScrollDifferentOrientation.kt
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * Copyright 2020 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT 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.ui.androidview.demos
-
-import android.os.Bundle
-import android.view.View
-import android.view.ViewGroup
-import android.widget.TextView
-import androidx.activity.ComponentActivity
-import androidx.compose.Composition
-import androidx.compose.Recomposer
-import androidx.ui.core.Modifier
-import androidx.ui.core.setContent
-import androidx.ui.foundation.Box
-import androidx.ui.foundation.HorizontalScroller
-import androidx.ui.foundation.drawBackground
-import androidx.ui.graphics.Color
-import androidx.ui.graphics.RectangleShape
-import androidx.ui.graphics.toArgb
-import androidx.ui.layout.fillMaxHeight
-import androidx.ui.layout.fillMaxWidth
-import androidx.ui.layout.padding
-import androidx.ui.layout.preferredHeight
-import androidx.ui.layout.preferredWidth
-import androidx.ui.unit.dp
-
-open class ComposeScrollInAndroidScrollDifferentOrientation : ComponentActivity() {
-
- private lateinit var composition: Composition
-
- override fun onCreate(savedInstanceState: Bundle?) {
- super.onCreate(savedInstanceState)
- setContentView(R.layout.compose_in_android_scroll)
-
- findViewById<View>(R.id.container).setBackgroundColor(Color.DarkGray.toArgb())
-
- findViewById<TextView>(R.id.text1).text =
- "Demonstrates that scrolling in Compose and scrolling in Android interop correctly " +
- "when Compose is inside of Android."
-
- findViewById<TextView>(R.id.text2).text =
- "The inner scrollable container is Compose, the other one is Android. You can only " +
- "scroll in one orientation at a time."
-
- val container = findViewById<ViewGroup>(R.id.container)
- composition = container.setContent(Recomposer.current()) {
- HorizontalScroller(
- modifier = Modifier
- .padding(48.dp)
- .drawBackground(Color.Gray, RectangleShape)
- .fillMaxWidth()
- .preferredHeight(456.dp)
- ) {
- Box(
- Modifier
- .padding(48.dp)
- .drawBackground(Color.LightGray, RectangleShape)
- .preferredWidth(360.dp)
- .fillMaxHeight()
- )
- }
- }
- }
-
- override fun onDestroy() {
- super.onDestroy()
- composition.dispose()
- }
-}
\ No newline at end of file
diff --git a/ui/ui-android-view/integration-tests/android-view-demos/src/main/java/androidx/ui/androidview/demos/ComposeScrollInAndroidScrollSameOrientation.kt b/ui/ui-android-view/integration-tests/android-view-demos/src/main/java/androidx/ui/androidview/demos/ComposeScrollInAndroidScrollSameOrientation.kt
deleted file mode 100644
index 0fa29be..0000000
--- a/ui/ui-android-view/integration-tests/android-view-demos/src/main/java/androidx/ui/androidview/demos/ComposeScrollInAndroidScrollSameOrientation.kt
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * Copyright 2020 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT 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.ui.androidview.demos
-
-import android.os.Bundle
-import android.view.View
-import android.view.ViewGroup
-import android.widget.TextView
-import androidx.activity.ComponentActivity
-import androidx.compose.Composition
-import androidx.compose.Recomposer
-import androidx.ui.core.Modifier
-import androidx.ui.core.setContent
-import androidx.ui.foundation.Box
-import androidx.ui.foundation.VerticalScroller
-import androidx.ui.foundation.drawBackground
-import androidx.ui.graphics.Color
-import androidx.ui.graphics.RectangleShape
-import androidx.ui.graphics.toArgb
-import androidx.ui.layout.fillMaxWidth
-import androidx.ui.layout.padding
-import androidx.ui.layout.preferredHeight
-import androidx.ui.unit.dp
-
-open class ComposeScrollInAndroidScrollSameOrientation : ComponentActivity() {
-
- private lateinit var composition: Composition
-
- override fun onCreate(savedInstanceState: Bundle?) {
- super.onCreate(savedInstanceState)
- setContentView(R.layout.compose_in_android_scroll)
-
- findViewById<View>(R.id.container).setBackgroundColor(Color.DarkGray.toArgb())
-
- findViewById<TextView>(R.id.text1).text =
- "Intended to demonstrate that scrolling between 2 scrollable things interops " +
- "\"correctly\" between Compose and Android when Compose is inside Android. " +
- "This currently does not actually work because nested scrolling interop is " +
- "not complete."
-
- findViewById<TextView>(R.id.text2).text =
- "The outer scrollable container always wins because it always intercepts the scroll " +
- "before the child scrolling container can start scrolling."
-
- val container = findViewById<ViewGroup>(R.id.container)
- composition = container.setContent(Recomposer.current()) {
- VerticalScroller(
- modifier = Modifier
- .padding(48.dp)
- .drawBackground(Color.Gray, RectangleShape)
- .fillMaxWidth()
- .preferredHeight(456.dp)
- ) {
- Box(
- Modifier
- .padding(48.dp)
- .drawBackground(Color.LightGray, RectangleShape)
- .fillMaxWidth()
- .preferredHeight(456.dp)
- )
- }
- }
- }
-
- override fun onDestroy() {
- super.onDestroy()
- composition.dispose()
- }
-}
\ No newline at end of file
diff --git a/ui/ui-android-view/integration-tests/android-view-demos/src/main/java/androidx/ui/androidview/demos/ComposeTapInAndroidScroll.kt b/ui/ui-android-view/integration-tests/android-view-demos/src/main/java/androidx/ui/androidview/demos/ComposeTapInAndroidScroll.kt
deleted file mode 100644
index 13518bf..0000000
--- a/ui/ui-android-view/integration-tests/android-view-demos/src/main/java/androidx/ui/androidview/demos/ComposeTapInAndroidScroll.kt
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * Copyright 2020 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT 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.ui.androidview.demos
-
-import android.os.Bundle
-import android.view.View
-import android.view.ViewGroup
-import android.widget.TextView
-import androidx.activity.ComponentActivity
-import androidx.compose.Composition
-import androidx.compose.Recomposer
-import androidx.compose.state
-import androidx.ui.core.Modifier
-import androidx.ui.core.gesture.tapGestureFilter
-import androidx.ui.core.setContent
-import androidx.ui.foundation.Box
-import androidx.ui.foundation.drawBackground
-import androidx.ui.graphics.Color
-import androidx.ui.graphics.RectangleShape
-import androidx.ui.graphics.toArgb
-import androidx.ui.layout.fillMaxWidth
-import androidx.ui.layout.preferredHeight
-import androidx.ui.layout.preferredSize
-import androidx.ui.layout.wrapContentSize
-import androidx.ui.material.ripple.ripple
-import androidx.ui.unit.dp
-
-open class ComposeTapInAndroidScroll : ComponentActivity() {
-
- private lateinit var composition: Composition
-
- override fun onCreate(savedInstanceState: Bundle?) {
- super.onCreate(savedInstanceState)
- setContentView(R.layout.compose_in_android_scroll)
-
- findViewById<View>(R.id.container).setBackgroundColor(Color.DarkGray.toArgb())
-
- findViewById<TextView>(R.id.text1).text =
- "Demonstrates that press gestures and movement gestures interact correctly between " +
- "Android and Compose when Compose is inside of Android."
-
- findViewById<TextView>(R.id.text2).text =
- "The inner box is Compose, the rest is Android. Tapping the inner box will change " +
- "it's color. Putting a finger down on the inner box and dragging vertically," +
- " will cause the outer Android ScrollView to scroll and removing the finger " +
- "from the screen will not cause the Compose box to change colors. "
-
- val container = findViewById<ViewGroup>(R.id.container)
- composition = container.setContent(Recomposer.current()) {
-
- val currentColor = state { Color.LightGray }
-
- val tap =
- Modifier.tapGestureFilter {
- currentColor.value =
- if (currentColor.value == Color.Blue) Color.Yellow else Color.Blue
- }
-
- Box(
- Modifier
- .drawBackground(Color.Gray, RectangleShape)
- .fillMaxWidth()
- .preferredHeight(456.dp)
- .wrapContentSize()
- .ripple()
- .plus(tap)
- .drawBackground(currentColor.value, RectangleShape)
- .preferredSize(192.dp)
- )
- }
- }
-
- override fun onDestroy() {
- super.onDestroy()
- composition.dispose()
- }
-}
\ No newline at end of file
diff --git a/ui/ui-android-view/integration-tests/android-view-demos/src/main/java/androidx/ui/androidview/demos/ComposeTapInAndroidTap.kt b/ui/ui-android-view/integration-tests/android-view-demos/src/main/java/androidx/ui/androidview/demos/ComposeTapInAndroidTap.kt
deleted file mode 100644
index 73f84b5..0000000
--- a/ui/ui-android-view/integration-tests/android-view-demos/src/main/java/androidx/ui/androidview/demos/ComposeTapInAndroidTap.kt
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * Copyright 2020 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT 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.ui.androidview.demos
-
-import android.annotation.SuppressLint
-import android.os.Bundle
-import android.view.ViewGroup
-import android.widget.TextView
-import androidx.activity.ComponentActivity
-import androidx.compose.Composition
-import androidx.compose.Recomposer
-import androidx.compose.state
-import androidx.ui.androidview.adapters.setOnClick
-import androidx.ui.core.Modifier
-import androidx.ui.core.gesture.tapGestureFilter
-import androidx.ui.core.setContent
-import androidx.ui.foundation.Box
-import androidx.ui.foundation.drawBackground
-import androidx.ui.graphics.Color
-import androidx.ui.graphics.RectangleShape
-import androidx.ui.graphics.toArgb
-import androidx.ui.layout.Column
-import androidx.ui.layout.fillMaxSize
-
-open class ComposeTapInAndroidTap : ComponentActivity() {
-
- private var currentColor = Color.DarkGray
-
- private lateinit var composition: Composition
-
- @SuppressLint("SetTextI18n")
- override fun onCreate(savedInstanceState: Bundle?) {
- super.onCreate(savedInstanceState)
- setContentView(R.layout.compose_in_android_tap)
-
- findViewById<TextView>(R.id.text1).text =
- "Demonstrates correct interop with simple tapping"
- findViewById<TextView>(R.id.text2).text =
- "The inner box is Compose, the outer is Android. When you tap on the inner box, " +
- "only it changes colors. When you tap on the outer box, only the outer box " +
- "changes colors."
-
- val container = findViewById<ViewGroup>(R.id.clickableContainer)
- container.isClickable = true
- container.setBackgroundColor(currentColor.toArgb())
- container.setOnClick {
- currentColor = if (currentColor == Color.Green) {
- Color.Red
- } else {
- Color.Green
- }
- container.setBackgroundColor(currentColor.toArgb())
- }
-
- composition = container.setContent(Recomposer.current()) {
-
- val currentColor = state { Color.LightGray }
-
- val tap =
- Modifier.tapGestureFilter {
- currentColor.value =
- if (currentColor.value == Color.Blue) Color.Yellow else Color.Blue
- }
-
- Column {
- Box(
- tap + Modifier.drawBackground(currentColor.value, RectangleShape).fillMaxSize()
- )
- }
- }
- }
-
- override fun onDestroy() {
- super.onDestroy()
- composition.dispose()
- }
-}
\ No newline at end of file
diff --git a/ui/ui-android-view/integration-tests/android-view-demos/src/main/java/androidx/ui/androidview/demos/PointerInputInterop.kt b/ui/ui-android-view/integration-tests/android-view-demos/src/main/java/androidx/ui/androidview/demos/PointerInputInteropAndroidInCompose.kt
similarity index 61%
rename from ui/ui-android-view/integration-tests/android-view-demos/src/main/java/androidx/ui/androidview/demos/PointerInputInterop.kt
rename to ui/ui-android-view/integration-tests/android-view-demos/src/main/java/androidx/ui/androidview/demos/PointerInputInteropAndroidInCompose.kt
index 4a8eef9..1e42453 100644
--- a/ui/ui-android-view/integration-tests/android-view-demos/src/main/java/androidx/ui/androidview/demos/PointerInputInterop.kt
+++ b/ui/ui-android-view/integration-tests/android-view-demos/src/main/java/androidx/ui/androidview/demos/PointerInputInteropAndroidInCompose.kt
@@ -16,6 +16,7 @@
package androidx.ui.androidview.demos
+import android.graphics.Color
import android.view.View
import android.view.ViewGroup
import androidx.compose.Composable
@@ -23,48 +24,32 @@
import androidx.ui.core.Alignment
import androidx.ui.core.Modifier
import androidx.ui.core.gesture.tapGestureFilter
-import androidx.ui.demos.common.ActivityDemo
import androidx.ui.demos.common.ComposableDemo
import androidx.ui.demos.common.DemoCategory
import androidx.ui.foundation.Box
import androidx.ui.foundation.HorizontalScroller
import androidx.ui.foundation.Text
+import androidx.ui.foundation.VerticalScroller
+import androidx.ui.foundation.drawBackground
import androidx.ui.layout.Column
import androidx.ui.layout.fillMaxSize
+import androidx.ui.layout.padding
+import androidx.ui.layout.preferredHeight
import androidx.ui.layout.preferredSize
import androidx.ui.layout.wrapContentSize
import androidx.ui.unit.dp
import androidx.ui.viewinterop.AndroidView
-val ComposeInAndroidDemos = DemoCategory(
- "Compose in Android Interop", listOf(
- ActivityDemo(
- "Compose with no gestures in Android tap",
- ComposeNothingInAndroidTap::class
- ),
- ActivityDemo(
- "Compose tap in Android tap",
- ComposeTapInAndroidTap::class
- ),
- ActivityDemo(
- "Compose tap in Android scroll",
- ComposeTapInAndroidScroll::class
- ),
- ActivityDemo(
- "Compose scroll in Android scroll (same orientation)",
- ComposeScrollInAndroidScrollSameOrientation::class
- ),
- ActivityDemo(
- "Compose scroll in Android scroll (different orientations)",
- ComposeScrollInAndroidScrollDifferentOrientation::class
- )
- )
-)
-
val AndroidInComposeDemos = DemoCategory("Android In Compose Interop", listOf(
ComposableDemo("4 Android tap in Compose") { FourAndroidTapInCompose() },
ComposableDemo("Android tap in Compose tap") { AndroidTapInComposeTap() },
- ComposableDemo("Android tap in Compose scroll") { AndroidTapInComposeScroll() }
+ ComposableDemo("Android tap in Compose scroll") { AndroidTapInComposeScroll() },
+ ComposableDemo("Android scroll in Compose scroll (different orientation)") {
+ AndroidScrollInComposeScrollDifferentOrientation()
+ },
+ ComposableDemo("Android scroll in Compose scroll (same orientation)") {
+ AndroidScrollInComposeScrollSameOrientation()
+ }
))
@Composable
@@ -81,19 +66,19 @@
.wrapContentSize(Alignment.Center)
.preferredSize(240.dp)
) {
- AndroidView(R.layout.pointer_interop_targeting_demo) { view ->
+ AndroidView(R.layout.android_4_buttons_in_compose) { view ->
view as ViewGroup
view.findViewById<View>(R.id.buttonBlue).setOnClick {
- view.setBackgroundColor(android.graphics.Color.BLUE)
+ view.setBackgroundColor(Color.BLUE)
}
view.findViewById<View>(R.id.buttonRed).setOnClick {
- view.setBackgroundColor(android.graphics.Color.RED)
+ view.setBackgroundColor(Color.RED)
}
view.findViewById<View>(R.id.buttonGreen).setOnClick {
- view.setBackgroundColor(android.graphics.Color.GREEN)
+ view.setBackgroundColor(Color.GREEN)
}
view.findViewById<View>(R.id.buttonYellow).setOnClick {
- view.setBackgroundColor(android.graphics.Color.YELLOW)
+ view.setBackgroundColor(Color.YELLOW)
}
}
}
@@ -105,7 +90,7 @@
var theView: View? = null
val onTap: () -> Unit = {
- theView?.setBackgroundColor(android.graphics.Color.BLUE)
+ theView?.setBackgroundColor(Color.BLUE)
}
Column {
@@ -127,11 +112,11 @@
.wrapContentSize(Alignment.Center)
.preferredSize(240.dp)
) {
- AndroidView(R.layout.pointer_interop_tap_in_tap_demo) { view ->
+ AndroidView(R.layout.android_tap_in_compose_tap) { view ->
theView = view
- theView?.setBackgroundColor(android.graphics.Color.GREEN)
+ theView?.setBackgroundColor(Color.GREEN)
view.findViewById<View>(R.id.buttonRed).setOnClick {
- theView?.setBackgroundColor(android.graphics.Color.RED)
+ theView?.setBackgroundColor(Color.RED)
}
}
}
@@ -153,33 +138,73 @@
"will not be clicked when released."
)
HorizontalScroller {
- AndroidView(R.layout.pointer_interop_tap_in_drag_demo) { view ->
- view.setBackgroundColor(android.graphics.Color.YELLOW)
+ AndroidView(R.layout.android_tap_in_compose_scroll) { view ->
+ view.setBackgroundColor(Color.YELLOW)
view.findViewById<View>(R.id.buttonRed).apply {
isClickable = false
setOnClick {
- view.setBackgroundColor(android.graphics.Color.RED)
+ view.setBackgroundColor(Color.RED)
}
}
view.findViewById<View>(R.id.buttonGreen).apply {
isClickable = false
setOnClick {
- view.setBackgroundColor(android.graphics.Color.GREEN)
+ view.setBackgroundColor(Color.GREEN)
}
}
view.findViewById<View>(R.id.buttonBlue).apply {
isClickable = false
setOnClick {
- view.setBackgroundColor(android.graphics.Color.BLUE)
+ view.setBackgroundColor(Color.BLUE)
}
}
view.findViewById<View>(R.id.buttonYellow).apply {
isClickable = false
setOnClick {
- view.setBackgroundColor(android.graphics.Color.YELLOW)
+ view.setBackgroundColor(Color.YELLOW)
}
}
}
}
}
+}
+
+@Composable
+private fun AndroidScrollInComposeScrollDifferentOrientation() {
+ Column {
+ Text("Demonstrates correct \"scroll orientation\" locking when something scrollable in " +
+ "Android is nested inside something scrollable in Compose.")
+ Text("You should only be able to scroll in one orientation at a time.")
+ HorizontalScroller(modifier = Modifier.drawBackground(androidx.ui.graphics.Color.Blue)) {
+ Box(modifier = Modifier.padding(96.dp).drawBackground(androidx.ui.graphics.Color.Red)) {
+ AndroidView(R.layout.android_scroll_in_compose_scroll_different_orientation)
+ }
+ }
+ }
+}
+
+@Composable
+private fun AndroidScrollInComposeScrollSameOrientation() {
+ Column {
+ Text("Supposed to demonstrate correct nested scrolling when something scrollable in " +
+ "Android is inside something scrollable in Compose.")
+ Text(
+ "This doesn't actually work because nested scrolling isn't implemented between " +
+ "Compose and Android. Normally, this lack of implementation would mean the " +
+ "parent would always intercept first and thus block the child from ever " +
+ "scrolling. However, currently, the touch slop for Android is smaller than " +
+ "that for Compose, and thus the child scrolls and prevents the parent from " +
+ "intercepting. "
+ )
+ VerticalScroller(modifier = Modifier.drawBackground(androidx.ui.graphics.Color.Blue)) {
+ Box(
+ modifier = Modifier
+ .padding(96.dp)
+ .drawBackground(androidx.ui.graphics.Color.Red)
+ .preferredHeight(750.dp)
+ ) {
+ AndroidView(R.layout.android_scroll_in_compose_scroll_same_orientation)
+ }
+ }
+ }
}
\ No newline at end of file
diff --git a/ui/ui-android-view/integration-tests/android-view-demos/src/main/java/androidx/ui/androidview/demos/PointerInputInteropComposeInAndroid.kt b/ui/ui-android-view/integration-tests/android-view-demos/src/main/java/androidx/ui/androidview/demos/PointerInputInteropComposeInAndroid.kt
new file mode 100644
index 0000000..272f6ca
--- /dev/null
+++ b/ui/ui-android-view/integration-tests/android-view-demos/src/main/java/androidx/ui/androidview/demos/PointerInputInteropComposeInAndroid.kt
@@ -0,0 +1,317 @@
+/*
+ * Copyright 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT 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.ui.androidview.demos
+
+import android.annotation.SuppressLint
+import android.os.Bundle
+import android.view.View
+import android.view.ViewGroup
+import android.widget.TextView
+import androidx.activity.ComponentActivity
+import androidx.compose.Composition
+import androidx.compose.Recomposer
+import androidx.compose.state
+import androidx.ui.androidview.adapters.setOnClick
+import androidx.ui.core.Modifier
+import androidx.ui.core.gesture.tapGestureFilter
+import androidx.ui.core.setContent
+import androidx.ui.demos.common.ActivityDemo
+import androidx.ui.demos.common.DemoCategory
+import androidx.ui.foundation.Box
+import androidx.ui.foundation.HorizontalScroller
+import androidx.ui.foundation.VerticalScroller
+import androidx.ui.foundation.drawBackground
+import androidx.ui.graphics.Color
+import androidx.ui.graphics.RectangleShape
+import androidx.ui.graphics.toArgb
+import androidx.ui.layout.Column
+import androidx.ui.layout.fillMaxHeight
+import androidx.ui.layout.fillMaxSize
+import androidx.ui.layout.fillMaxWidth
+import androidx.ui.layout.padding
+import androidx.ui.layout.preferredHeight
+import androidx.ui.layout.preferredSize
+import androidx.ui.layout.preferredWidth
+import androidx.ui.layout.wrapContentSize
+import androidx.ui.material.ripple.ripple
+import androidx.ui.unit.dp
+
+val ComposeInAndroidDemos = DemoCategory(
+ "Compose in Android Interop", listOf(
+ ActivityDemo(
+ "Compose with no gestures in Android tap",
+ ComposeNothingInAndroidTap::class
+ ),
+ ActivityDemo(
+ "Compose tap in Android tap",
+ ComposeTapInAndroidTap::class
+ ),
+ ActivityDemo(
+ "Compose tap in Android scroll",
+ ComposeTapInAndroidScroll::class
+ ),
+ ActivityDemo(
+ "Compose scroll in Android scroll (same orientation)",
+ ComposeScrollInAndroidScrollSameOrientation::class
+ ),
+ ActivityDemo(
+ "Compose scroll in Android scroll (different orientations)",
+ ComposeScrollInAndroidScrollDifferentOrientation::class
+ )
+ )
+)
+
+open class ComposeNothingInAndroidTap : ComponentActivity() {
+
+ private var currentColor = Color.DarkGray
+
+ private lateinit var composition: Composition
+
+ @SuppressLint("SetTextI18n")
+ override fun onCreate(savedInstanceState: Bundle?) {
+ super.onCreate(savedInstanceState)
+ setContentView(R.layout.compose_in_android_tap)
+
+ findViewById<TextView>(R.id.text1).text =
+ "Intended to Demonstrate that when no gestureFilterModifiers are added to compose, " +
+ "Compose will not interact with the pointer input stream. This currently " +
+ "isn't actually the case however. "
+
+ findViewById<TextView>(R.id.text2).text =
+ "When you tap anywhere within the bounds of the colored, including the grey box in " +
+ "the middle, the color is supposed to change. This currently does not occur " +
+ "when you tap on the grey box however."
+
+ val container = findViewById<ViewGroup>(R.id.clickableContainer)
+ container.isClickable = true
+ container.setBackgroundColor(currentColor.toArgb())
+ container.setOnClick {
+ currentColor = if (currentColor == Color.Green) {
+ Color.Red
+ } else {
+ Color.Green
+ }
+ container.setBackgroundColor(currentColor.toArgb())
+ }
+ composition = container.setContent(Recomposer.current()) {
+ Box(Modifier.drawBackground(Color.LightGray, RectangleShape).fillMaxSize())
+ }
+ }
+
+ override fun onDestroy() {
+ super.onDestroy()
+ composition.dispose()
+ }
+}
+
+open class ComposeTapInAndroidTap : ComponentActivity() {
+
+ private var currentColor = Color.DarkGray
+
+ private lateinit var composition: Composition
+
+ @SuppressLint("SetTextI18n")
+ override fun onCreate(savedInstanceState: Bundle?) {
+ super.onCreate(savedInstanceState)
+ setContentView(R.layout.compose_in_android_tap)
+
+ findViewById<TextView>(R.id.text1).text =
+ "Demonstrates correct interop with simple tapping"
+ findViewById<TextView>(R.id.text2).text =
+ "The inner box is Compose, the outer is Android. When you tap on the inner box, " +
+ "only it changes colors. When you tap on the outer box, only the outer box " +
+ "changes colors."
+
+ val container = findViewById<ViewGroup>(R.id.clickableContainer)
+ container.isClickable = true
+ container.setBackgroundColor(currentColor.toArgb())
+ container.setOnClick {
+ currentColor = if (currentColor == Color.Green) {
+ Color.Red
+ } else {
+ Color.Green
+ }
+ container.setBackgroundColor(currentColor.toArgb())
+ }
+
+ composition = container.setContent(Recomposer.current()) {
+
+ val currentColor = state { Color.LightGray }
+
+ val tap =
+ Modifier.tapGestureFilter {
+ currentColor.value =
+ if (currentColor.value == Color.Blue) Color.Yellow else Color.Blue
+ }
+
+ Column {
+ Box(
+ tap + Modifier.drawBackground(currentColor.value, RectangleShape).fillMaxSize()
+ )
+ }
+ }
+ }
+
+ override fun onDestroy() {
+ super.onDestroy()
+ composition.dispose()
+ }
+}
+
+open class ComposeTapInAndroidScroll : ComponentActivity() {
+
+ private lateinit var composition: Composition
+
+ @SuppressLint("SetTextI18n")
+ override fun onCreate(savedInstanceState: Bundle?) {
+ super.onCreate(savedInstanceState)
+ setContentView(R.layout.compose_in_android_scroll)
+
+ findViewById<View>(R.id.container).setBackgroundColor(Color.DarkGray.toArgb())
+
+ findViewById<TextView>(R.id.text1).text =
+ "Demonstrates that press gestures and movement gestures interact correctly between " +
+ "Android and Compose when Compose is inside of Android."
+
+ findViewById<TextView>(R.id.text2).text =
+ "The inner box is Compose, the rest is Android. Tapping the inner box will change " +
+ "it's color. Putting a finger down on the inner box and dragging vertically," +
+ " will cause the outer Android ScrollView to scroll and removing the finger " +
+ "from the screen will not cause the Compose box to change colors. "
+
+ val container = findViewById<ViewGroup>(R.id.container)
+ composition = container.setContent(Recomposer.current()) {
+
+ val currentColor = state { Color.LightGray }
+
+ val tap =
+ Modifier.tapGestureFilter {
+ currentColor.value =
+ if (currentColor.value == Color.Blue) Color.Yellow else Color.Blue
+ }
+
+ Box(
+ Modifier
+ .drawBackground(Color.Gray, RectangleShape)
+ .fillMaxWidth()
+ .preferredHeight(456.dp)
+ .wrapContentSize()
+ .ripple()
+ .plus(tap)
+ .drawBackground(currentColor.value, RectangleShape)
+ .preferredSize(192.dp)
+ )
+ }
+ }
+
+ override fun onDestroy() {
+ super.onDestroy()
+ composition.dispose()
+ }
+}
+
+open class ComposeScrollInAndroidScrollSameOrientation : ComponentActivity() {
+
+ private lateinit var composition: Composition
+
+ @SuppressLint("SetTextI18n")
+ override fun onCreate(savedInstanceState: Bundle?) {
+ super.onCreate(savedInstanceState)
+ setContentView(R.layout.compose_in_android_scroll)
+
+ findViewById<View>(R.id.container).setBackgroundColor(Color.DarkGray.toArgb())
+
+ findViewById<TextView>(R.id.text1).text =
+ "Intended to demonstrate that scrolling between 2 scrollable things interops " +
+ "\"correctly\" between Compose and Android when Compose is inside Android. " +
+ "This currently does not actually work because nested scrolling interop is " +
+ "not complete."
+
+ findViewById<TextView>(R.id.text2).text =
+ "The outer scrollable container always wins because it always intercepts the scroll " +
+ "before the child scrolling container can start scrolling."
+
+ val container = findViewById<ViewGroup>(R.id.container)
+ composition = container.setContent(Recomposer.current()) {
+ VerticalScroller(
+ modifier = Modifier
+ .padding(48.dp)
+ .drawBackground(Color.Gray, RectangleShape)
+ .fillMaxWidth()
+ .preferredHeight(456.dp)
+ ) {
+ Box(
+ Modifier
+ .padding(48.dp)
+ .drawBackground(Color.LightGray, RectangleShape)
+ .fillMaxWidth()
+ .preferredHeight(456.dp)
+ )
+ }
+ }
+ }
+
+ override fun onDestroy() {
+ super.onDestroy()
+ composition.dispose()
+ }
+}
+
+open class ComposeScrollInAndroidScrollDifferentOrientation : ComponentActivity() {
+
+ private lateinit var composition: Composition
+
+ @SuppressLint("SetTextI18n")
+ override fun onCreate(savedInstanceState: Bundle?) {
+ super.onCreate(savedInstanceState)
+ setContentView(R.layout.compose_in_android_scroll)
+
+ findViewById<View>(R.id.container).setBackgroundColor(Color.DarkGray.toArgb())
+
+ findViewById<TextView>(R.id.text1).text =
+ "Demonstrates that scrolling in Compose and scrolling in Android interop correctly " +
+ "when Compose is inside of Android."
+
+ findViewById<TextView>(R.id.text2).text =
+ "The inner scrollable container is Compose, the other one is Android. You can only " +
+ "scroll in one orientation at a time."
+
+ val container = findViewById<ViewGroup>(R.id.container)
+ composition = container.setContent(Recomposer.current()) {
+ HorizontalScroller(
+ modifier = Modifier
+ .padding(48.dp)
+ .drawBackground(Color.Gray, RectangleShape)
+ .fillMaxWidth()
+ .preferredHeight(456.dp)
+ ) {
+ Box(
+ Modifier
+ .padding(48.dp)
+ .drawBackground(Color.LightGray, RectangleShape)
+ .preferredWidth(360.dp)
+ .fillMaxHeight()
+ )
+ }
+ }
+ }
+
+ override fun onDestroy() {
+ super.onDestroy()
+ composition.dispose()
+ }
+}
\ No newline at end of file
diff --git a/ui/ui-android-view/integration-tests/android-view-demos/src/main/res/layout/pointer_interop_targeting_demo.xml b/ui/ui-android-view/integration-tests/android-view-demos/src/main/res/layout/android_4_buttons_in_compose.xml
similarity index 100%
rename from ui/ui-android-view/integration-tests/android-view-demos/src/main/res/layout/pointer_interop_targeting_demo.xml
rename to ui/ui-android-view/integration-tests/android-view-demos/src/main/res/layout/android_4_buttons_in_compose.xml
diff --git a/ui/ui-android-view/integration-tests/android-view-demos/src/main/res/layout/android_scroll_in_compose_scroll_different_orientation.xml b/ui/ui-android-view/integration-tests/android-view-demos/src/main/res/layout/android_scroll_in_compose_scroll_different_orientation.xml
new file mode 100644
index 0000000..63de95c
--- /dev/null
+++ b/ui/ui-android-view/integration-tests/android-view-demos/src/main/res/layout/android_scroll_in_compose_scroll_different_orientation.xml
@@ -0,0 +1,76 @@
+<?xml version="1.0" encoding="utf-8"?><!--
+ Copyright 2020 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT 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 android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ xmlns:android="http://schemas.android.com/apk/res/android">
+ <LinearLayout
+ android:layout_width="500dp"
+ android:layout_height="wrap_content"
+ android:orientation="vertical"
+ android:gravity="center">
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:textSize="96sp"
+ android:text="1" />
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:textSize="96sp"
+ android:text="2" />
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:textSize="96sp"
+ android:text="3" />
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:textSize="96sp"
+ android:text="4" />
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:textSize="96sp"
+ android:text="5" />
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:textSize="96sp"
+ android:text="6" />
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:textSize="96sp"
+ android:text="7" />
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:textSize="96sp"
+ android:text="8" />
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:textSize="96sp"
+ android:text="9" />
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:textSize="96sp"
+ android:text="10" />
+ </LinearLayout>
+</ScrollView>
\ No newline at end of file
diff --git a/ui/ui-android-view/integration-tests/android-view-demos/src/main/res/layout/android_scroll_in_compose_scroll_same_orientation.xml b/ui/ui-android-view/integration-tests/android-view-demos/src/main/res/layout/android_scroll_in_compose_scroll_same_orientation.xml
new file mode 100644
index 0000000..b0044d9
--- /dev/null
+++ b/ui/ui-android-view/integration-tests/android-view-demos/src/main/res/layout/android_scroll_in_compose_scroll_same_orientation.xml
@@ -0,0 +1,76 @@
+<?xml version="1.0" encoding="utf-8"?><!--
+ Copyright 2020 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT 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 android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ xmlns:android="http://schemas.android.com/apk/res/android">
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:orientation="vertical"
+ android:gravity="center">
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:textSize="96sp"
+ android:text="1" />
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:textSize="96sp"
+ android:text="2" />
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:textSize="96sp"
+ android:text="3" />
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:textSize="96sp"
+ android:text="4" />
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:textSize="96sp"
+ android:text="5" />
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:textSize="96sp"
+ android:text="6" />
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:textSize="96sp"
+ android:text="7" />
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:textSize="96sp"
+ android:text="8" />
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:textSize="96sp"
+ android:text="9" />
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:textSize="96sp"
+ android:text="10" />
+ </LinearLayout>
+</ScrollView>
\ No newline at end of file
diff --git a/ui/ui-android-view/integration-tests/android-view-demos/src/main/res/layout/pointer_interop_tap_in_drag_demo.xml b/ui/ui-android-view/integration-tests/android-view-demos/src/main/res/layout/android_tap_in_compose_scroll.xml
similarity index 100%
rename from ui/ui-android-view/integration-tests/android-view-demos/src/main/res/layout/pointer_interop_tap_in_drag_demo.xml
rename to ui/ui-android-view/integration-tests/android-view-demos/src/main/res/layout/android_tap_in_compose_scroll.xml
diff --git a/ui/ui-android-view/integration-tests/android-view-demos/src/main/res/layout/pointer_interop_tap_in_tap_demo.xml b/ui/ui-android-view/integration-tests/android-view-demos/src/main/res/layout/android_tap_in_compose_tap.xml
similarity index 100%
rename from ui/ui-android-view/integration-tests/android-view-demos/src/main/res/layout/pointer_interop_tap_in_tap_demo.xml
rename to ui/ui-android-view/integration-tests/android-view-demos/src/main/res/layout/android_tap_in_compose_tap.xml
diff --git a/ui/ui-animation/api/0.1.0-dev11.txt b/ui/ui-animation/api/0.1.0-dev11.txt
index 27e987e..8ca8f65 100644
--- a/ui/ui-animation/api/0.1.0-dev11.txt
+++ b/ui/ui-animation/api/0.1.0-dev11.txt
@@ -27,7 +27,7 @@
}
public final class CrossfadeKt {
- method public static <T> void Crossfade(T? current, kotlin.jvm.functions.Function1<? super T,kotlin.Unit> children);
+ method public static <T> void Crossfade(T? current, androidx.animation.AnimationBuilder<java.lang.Float> animation = androidx.animation.TweenBuilder(), kotlin.jvm.functions.Function1<? super T,kotlin.Unit> children);
}
public final class DisposableAnimationClock implements androidx.animation.AnimationClockObservable {
@@ -77,13 +77,13 @@
public final class SingleValueAnimationKt {
method public static float animate(float target, androidx.animation.AnimationBuilder<java.lang.Float> animBuilder = remember({
- <init>()
+ return <init>()
}), kotlin.jvm.functions.Function1<? super java.lang.Float,kotlin.Unit>? endListener = null);
method public static <T, V extends androidx.animation.AnimationVector> T! animate(T? target, androidx.animation.TwoWayConverter<T,V> converter, androidx.animation.AnimationBuilder<T> animBuilder = remember({
- <init>()
+ return <init>()
}), kotlin.jvm.functions.Function1<? super T,kotlin.Unit>? endListener = null);
method public static long animate-90dr43Y(long target, androidx.animation.AnimationBuilder<androidx.ui.graphics.Color> animBuilder = remember({
- <init>()
+ return <init>()
}), kotlin.jvm.functions.Function1<? super androidx.ui.graphics.Color,kotlin.Unit>? endListener = null);
}
diff --git a/ui/ui-animation/api/current.txt b/ui/ui-animation/api/current.txt
index 27e987e..8ca8f65 100644
--- a/ui/ui-animation/api/current.txt
+++ b/ui/ui-animation/api/current.txt
@@ -27,7 +27,7 @@
}
public final class CrossfadeKt {
- method public static <T> void Crossfade(T? current, kotlin.jvm.functions.Function1<? super T,kotlin.Unit> children);
+ method public static <T> void Crossfade(T? current, androidx.animation.AnimationBuilder<java.lang.Float> animation = androidx.animation.TweenBuilder(), kotlin.jvm.functions.Function1<? super T,kotlin.Unit> children);
}
public final class DisposableAnimationClock implements androidx.animation.AnimationClockObservable {
@@ -77,13 +77,13 @@
public final class SingleValueAnimationKt {
method public static float animate(float target, androidx.animation.AnimationBuilder<java.lang.Float> animBuilder = remember({
- <init>()
+ return <init>()
}), kotlin.jvm.functions.Function1<? super java.lang.Float,kotlin.Unit>? endListener = null);
method public static <T, V extends androidx.animation.AnimationVector> T! animate(T? target, androidx.animation.TwoWayConverter<T,V> converter, androidx.animation.AnimationBuilder<T> animBuilder = remember({
- <init>()
+ return <init>()
}), kotlin.jvm.functions.Function1<? super T,kotlin.Unit>? endListener = null);
method public static long animate-90dr43Y(long target, androidx.animation.AnimationBuilder<androidx.ui.graphics.Color> animBuilder = remember({
- <init>()
+ return <init>()
}), kotlin.jvm.functions.Function1<? super androidx.ui.graphics.Color,kotlin.Unit>? endListener = null);
}
diff --git a/ui/ui-animation/api/public_plus_experimental_0.1.0-dev11.txt b/ui/ui-animation/api/public_plus_experimental_0.1.0-dev11.txt
index 27e987e..8ca8f65 100644
--- a/ui/ui-animation/api/public_plus_experimental_0.1.0-dev11.txt
+++ b/ui/ui-animation/api/public_plus_experimental_0.1.0-dev11.txt
@@ -27,7 +27,7 @@
}
public final class CrossfadeKt {
- method public static <T> void Crossfade(T? current, kotlin.jvm.functions.Function1<? super T,kotlin.Unit> children);
+ method public static <T> void Crossfade(T? current, androidx.animation.AnimationBuilder<java.lang.Float> animation = androidx.animation.TweenBuilder(), kotlin.jvm.functions.Function1<? super T,kotlin.Unit> children);
}
public final class DisposableAnimationClock implements androidx.animation.AnimationClockObservable {
@@ -77,13 +77,13 @@
public final class SingleValueAnimationKt {
method public static float animate(float target, androidx.animation.AnimationBuilder<java.lang.Float> animBuilder = remember({
- <init>()
+ return <init>()
}), kotlin.jvm.functions.Function1<? super java.lang.Float,kotlin.Unit>? endListener = null);
method public static <T, V extends androidx.animation.AnimationVector> T! animate(T? target, androidx.animation.TwoWayConverter<T,V> converter, androidx.animation.AnimationBuilder<T> animBuilder = remember({
- <init>()
+ return <init>()
}), kotlin.jvm.functions.Function1<? super T,kotlin.Unit>? endListener = null);
method public static long animate-90dr43Y(long target, androidx.animation.AnimationBuilder<androidx.ui.graphics.Color> animBuilder = remember({
- <init>()
+ return <init>()
}), kotlin.jvm.functions.Function1<? super androidx.ui.graphics.Color,kotlin.Unit>? endListener = null);
}
diff --git a/ui/ui-animation/api/public_plus_experimental_current.txt b/ui/ui-animation/api/public_plus_experimental_current.txt
index 27e987e..8ca8f65 100644
--- a/ui/ui-animation/api/public_plus_experimental_current.txt
+++ b/ui/ui-animation/api/public_plus_experimental_current.txt
@@ -27,7 +27,7 @@
}
public final class CrossfadeKt {
- method public static <T> void Crossfade(T? current, kotlin.jvm.functions.Function1<? super T,kotlin.Unit> children);
+ method public static <T> void Crossfade(T? current, androidx.animation.AnimationBuilder<java.lang.Float> animation = androidx.animation.TweenBuilder(), kotlin.jvm.functions.Function1<? super T,kotlin.Unit> children);
}
public final class DisposableAnimationClock implements androidx.animation.AnimationClockObservable {
@@ -77,13 +77,13 @@
public final class SingleValueAnimationKt {
method public static float animate(float target, androidx.animation.AnimationBuilder<java.lang.Float> animBuilder = remember({
- <init>()
+ return <init>()
}), kotlin.jvm.functions.Function1<? super java.lang.Float,kotlin.Unit>? endListener = null);
method public static <T, V extends androidx.animation.AnimationVector> T! animate(T? target, androidx.animation.TwoWayConverter<T,V> converter, androidx.animation.AnimationBuilder<T> animBuilder = remember({
- <init>()
+ return <init>()
}), kotlin.jvm.functions.Function1<? super T,kotlin.Unit>? endListener = null);
method public static long animate-90dr43Y(long target, androidx.animation.AnimationBuilder<androidx.ui.graphics.Color> animBuilder = remember({
- <init>()
+ return <init>()
}), kotlin.jvm.functions.Function1<? super androidx.ui.graphics.Color,kotlin.Unit>? endListener = null);
}
diff --git a/ui/ui-animation/api/restricted_0.1.0-dev11.txt b/ui/ui-animation/api/restricted_0.1.0-dev11.txt
index 27e987e..8ca8f65 100644
--- a/ui/ui-animation/api/restricted_0.1.0-dev11.txt
+++ b/ui/ui-animation/api/restricted_0.1.0-dev11.txt
@@ -27,7 +27,7 @@
}
public final class CrossfadeKt {
- method public static <T> void Crossfade(T? current, kotlin.jvm.functions.Function1<? super T,kotlin.Unit> children);
+ method public static <T> void Crossfade(T? current, androidx.animation.AnimationBuilder<java.lang.Float> animation = androidx.animation.TweenBuilder(), kotlin.jvm.functions.Function1<? super T,kotlin.Unit> children);
}
public final class DisposableAnimationClock implements androidx.animation.AnimationClockObservable {
@@ -77,13 +77,13 @@
public final class SingleValueAnimationKt {
method public static float animate(float target, androidx.animation.AnimationBuilder<java.lang.Float> animBuilder = remember({
- <init>()
+ return <init>()
}), kotlin.jvm.functions.Function1<? super java.lang.Float,kotlin.Unit>? endListener = null);
method public static <T, V extends androidx.animation.AnimationVector> T! animate(T? target, androidx.animation.TwoWayConverter<T,V> converter, androidx.animation.AnimationBuilder<T> animBuilder = remember({
- <init>()
+ return <init>()
}), kotlin.jvm.functions.Function1<? super T,kotlin.Unit>? endListener = null);
method public static long animate-90dr43Y(long target, androidx.animation.AnimationBuilder<androidx.ui.graphics.Color> animBuilder = remember({
- <init>()
+ return <init>()
}), kotlin.jvm.functions.Function1<? super androidx.ui.graphics.Color,kotlin.Unit>? endListener = null);
}
diff --git a/ui/ui-animation/api/restricted_current.txt b/ui/ui-animation/api/restricted_current.txt
index 27e987e..8ca8f65 100644
--- a/ui/ui-animation/api/restricted_current.txt
+++ b/ui/ui-animation/api/restricted_current.txt
@@ -27,7 +27,7 @@
}
public final class CrossfadeKt {
- method public static <T> void Crossfade(T? current, kotlin.jvm.functions.Function1<? super T,kotlin.Unit> children);
+ method public static <T> void Crossfade(T? current, androidx.animation.AnimationBuilder<java.lang.Float> animation = androidx.animation.TweenBuilder(), kotlin.jvm.functions.Function1<? super T,kotlin.Unit> children);
}
public final class DisposableAnimationClock implements androidx.animation.AnimationClockObservable {
@@ -77,13 +77,13 @@
public final class SingleValueAnimationKt {
method public static float animate(float target, androidx.animation.AnimationBuilder<java.lang.Float> animBuilder = remember({
- <init>()
+ return <init>()
}), kotlin.jvm.functions.Function1<? super java.lang.Float,kotlin.Unit>? endListener = null);
method public static <T, V extends androidx.animation.AnimationVector> T! animate(T? target, androidx.animation.TwoWayConverter<T,V> converter, androidx.animation.AnimationBuilder<T> animBuilder = remember({
- <init>()
+ return <init>()
}), kotlin.jvm.functions.Function1<? super T,kotlin.Unit>? endListener = null);
method public static long animate-90dr43Y(long target, androidx.animation.AnimationBuilder<androidx.ui.graphics.Color> animBuilder = remember({
- <init>()
+ return <init>()
}), kotlin.jvm.functions.Function1<? super androidx.ui.graphics.Color,kotlin.Unit>? endListener = null);
}
diff --git a/ui/ui-animation/integration-tests/animation-demos/src/main/java/androidx/ui/animation/demos/AnimatableSeekBarDemo.kt b/ui/ui-animation/integration-tests/animation-demos/src/main/java/androidx/ui/animation/demos/AnimatableSeekBarDemo.kt
index 9b40566..15804e9 100644
--- a/ui/ui-animation/integration-tests/animation-demos/src/main/java/androidx/ui/animation/demos/AnimatableSeekBarDemo.kt
+++ b/ui/ui-animation/integration-tests/animation-demos/src/main/java/androidx/ui/animation/demos/AnimatableSeekBarDemo.kt
@@ -32,12 +32,11 @@
import androidx.ui.core.gesture.pressIndicatorGestureFilter
import androidx.ui.core.gesture.rawDragGestureFilter
import androidx.ui.foundation.Box
-import androidx.ui.foundation.Canvas
+import androidx.ui.foundation.Canvas2
import androidx.ui.foundation.Text
import androidx.ui.geometry.Offset
-import androidx.ui.geometry.Rect
+import androidx.ui.geometry.Size
import androidx.ui.graphics.Color
-import androidx.ui.graphics.Paint
import androidx.ui.layout.Column
import androidx.ui.layout.fillMaxWidth
import androidx.ui.layout.padding
@@ -68,31 +67,27 @@
initState = "start",
toState = "end"
) { state ->
- val paint = remember { Paint() }
- Canvas(Modifier.preferredSize(600.dp, 400.dp)) {
- val rect = Rect(
- 0f, 0f, size.width.value * 0.2f,
- size.width.value * 0.2f
- )
- drawRect(rect, paint.apply {
- color = Color(1.0f, 0f, 0f, state[alphaKey])
- })
-
- drawRect(rect.translate(state[offset1] * size.width.value, 0f),
- paint.apply {
- color = Color(0f, 0f, 1f, state[alphaKey])
- })
+ Canvas2(Modifier.preferredSize(600.dp, 400.dp)) {
+ val rectSize = size * 0.2f
+ drawRect(Color(1.0f, 0f, 0f, state[alphaKey]), size = rectSize)
drawRect(
- rect.translate(state[offset2] * size.width.value, 0f),
- paint.apply {
- color = Color(0f, 1f, 1f, state[alphaKey])
- })
+ Color(0f, 0f, 1f, state[alphaKey]),
+ topLeft = Offset(state[offset1] * size.width, 0.0f),
+ size = rectSize
+ )
- drawRect(rect.translate(state[offset3] * size.width.value, 0f),
- paint.apply {
- color = Color(0f, 1f, 0f, state[alphaKey])
- })
+ drawRect(
+ Color(0f, 1f, 1f, state[alphaKey]),
+ topLeft = Offset(state[offset2] * size.width, 0.0f),
+ size = rectSize
+ )
+
+ drawRect(
+ Color(0f, 1f, 0f, state[alphaKey]),
+ topLeft = Offset(state[offset3] * size.width, 0.0f),
+ size = rectSize
+ )
}
}
}
@@ -128,26 +123,28 @@
@Composable
fun DrawSeekBar(modifier: Modifier = Modifier, x: Float, clock: ManualAnimationClock) {
- val paint = remember { Paint() }
- Canvas(modifier.fillMaxWidth().preferredHeight(60.dp)) {
- val centerY = size.height.value / 2
- val xConstraint = x.coerceIn(0f, size.width.value)
- clock.clockTimeMillis = (400 * (x / size.width.value)).toLong().coerceIn(0, 399)
+ Canvas2(modifier.fillMaxWidth().preferredHeight(60.dp)) {
+ val xConstraint = x.coerceIn(0f, size.width)
+ clock.clockTimeMillis = (400 * (x / size.width)).toLong().coerceIn(0, 399)
// draw bar
- paint.color = Color.Gray
+ val barHeight = 10.0f
+ val offset = Offset(0.0f, center.dy - 5)
drawRect(
- Rect(0f, centerY - 5, size.width.value, centerY + 5),
- paint
+ Color.Gray,
+ topLeft = offset,
+ size = Size(size.width, barHeight)
)
- paint.color = Color.Magenta
drawRect(
- Rect(0f, centerY - 5, xConstraint, centerY + 5),
- paint
+ Color.Magenta,
+ topLeft = offset,
+ size = Size(xConstraint, barHeight)
)
// draw ticker
drawCircle(
- Offset(xConstraint, centerY), 40f, paint
+ Color.Magenta,
+ center = Offset(xConstraint, center.dy),
+ radius = 40f
)
}
}
diff --git a/ui/ui-animation/integration-tests/animation-demos/src/main/java/androidx/ui/animation/demos/FancyScrollingDemo.kt b/ui/ui-animation/integration-tests/animation-demos/src/main/java/androidx/ui/animation/demos/FancyScrollingDemo.kt
index 40c83fb..785608f 100644
--- a/ui/ui-animation/integration-tests/animation-demos/src/main/java/androidx/ui/animation/demos/FancyScrollingDemo.kt
+++ b/ui/ui-animation/integration-tests/animation-demos/src/main/java/androidx/ui/animation/demos/FancyScrollingDemo.kt
@@ -22,18 +22,17 @@
import androidx.animation.TargetAnimation
import androidx.animation.fling
import androidx.compose.Composable
-import androidx.compose.remember
import androidx.compose.state
import androidx.ui.animation.animatedFloat
-import androidx.ui.core.DrawScope
import androidx.ui.core.Modifier
import androidx.ui.core.gesture.DragObserver
import androidx.ui.core.gesture.rawDragGestureFilter
-import androidx.ui.foundation.Canvas
+import androidx.ui.foundation.Canvas2
import androidx.ui.foundation.Text
-import androidx.ui.geometry.Rect
+import androidx.ui.geometry.Offset
+import androidx.ui.geometry.Size
import androidx.ui.graphics.Color
-import androidx.ui.graphics.Paint
+import androidx.ui.graphics.painter.CanvasScope
import androidx.ui.layout.Column
import androidx.ui.layout.fillMaxWidth
import androidx.ui.layout.padding
@@ -77,9 +76,9 @@
})
}
})
- val paint = remember { Paint() }
- Canvas(gesture.fillMaxWidth().preferredHeight(400.dp)) {
- val width = size.width.value / 2f
+
+ Canvas2(gesture.fillMaxWidth().preferredHeight(400.dp)) {
+ val width = size.width / 2f
val scroll = animScroll.value + width / 2
itemWidth.value = width
if (DEBUG) {
@@ -88,16 +87,15 @@
" AnimatedFloat: ${animScroll.value}"
)
}
- drawItems(scroll, width, size.height.value, paint)
+ drawItems(scroll, width, size.height)
}
}
}
-private fun DrawScope.drawItems(
+private fun CanvasScope.drawItems(
scrollPosition: Float,
width: Float,
- height: Float,
- paint: Paint
+ height: Float
) {
var startingPos = scrollPosition % width
if (startingPos > 0) {
@@ -108,20 +106,24 @@
if (startingColorIndex < 0) {
startingColorIndex += colors.size
}
- paint.color = colors[startingColorIndex]
+
+ val size = Size(width - 20, height)
drawRect(
- Rect(startingPos + 10, 0f, startingPos + width - 10, height),
- paint
+ colors[startingColorIndex],
+ topLeft = Offset(startingPos + 10, 0f),
+ size = size
)
- paint.color = colors[(startingColorIndex + colors.size - 1) % colors.size]
+
drawRect(
- Rect(startingPos + width + 10, 0f, startingPos + width * 2 - 10, height),
- paint
+ colors[(startingColorIndex + colors.size - 1) % colors.size],
+ topLeft = Offset(startingPos + width + 10, 0.0f),
+ size = size
)
- paint.color = colors[(startingColorIndex + colors.size - 2) % colors.size]
+
drawRect(
- Rect(startingPos + width * 2 + 10, 0f, startingPos + width * 3 - 10, height),
- paint
+ colors[(startingColorIndex + colors.size - 2) % colors.size],
+ topLeft = Offset(startingPos + width * 2 + 10, 0.0f),
+ size = size
)
}
diff --git a/ui/ui-animation/integration-tests/animation-demos/src/main/java/androidx/ui/animation/demos/GestureBasedAnimationDemo.kt b/ui/ui-animation/integration-tests/animation-demos/src/main/java/androidx/ui/animation/demos/GestureBasedAnimationDemo.kt
index aa1102e..e23ff6e 100644
--- a/ui/ui-animation/integration-tests/animation-demos/src/main/java/androidx/ui/animation/demos/GestureBasedAnimationDemo.kt
+++ b/ui/ui-animation/integration-tests/animation-demos/src/main/java/androidx/ui/animation/demos/GestureBasedAnimationDemo.kt
@@ -19,16 +19,15 @@
import androidx.animation.FloatPropKey
import androidx.animation.transitionDefinition
import androidx.compose.Composable
-import androidx.compose.remember
import androidx.compose.state
import androidx.ui.animation.ColorPropKey
import androidx.ui.animation.Transition
import androidx.ui.core.Modifier
import androidx.ui.core.gesture.pressIndicatorGestureFilter
-import androidx.ui.foundation.Canvas
-import androidx.ui.geometry.Rect
+import androidx.ui.foundation.Canvas2
+import androidx.ui.geometry.Offset
+import androidx.ui.geometry.Size
import androidx.ui.graphics.Color
-import androidx.ui.graphics.Paint
import androidx.ui.layout.fillMaxSize
private const val halfSize = 200f
@@ -73,16 +72,11 @@
@Composable
private fun ScaledColorRect(modifier: Modifier = Modifier, scale: Float, color: Color) {
- val paint = remember { Paint() }
- Canvas(modifier.fillMaxSize()) {
- val centerX = size.width.value / 2
- val centerY = size.height.value / 2
- paint.color = color
+ Canvas2(modifier.fillMaxSize()) {
drawRect(
- Rect(
- centerX - halfSize * scale, centerY - halfSize * scale,
- centerX + halfSize * scale, centerY + halfSize * scale
- ), paint
+ color,
+ topLeft = Offset(center.dx - halfSize * scale, center.dy - halfSize * scale),
+ size = Size(halfSize * 2 * scale, halfSize * 2 * scale)
)
}
}
diff --git a/ui/ui-animation/integration-tests/animation-demos/src/main/java/androidx/ui/animation/demos/MultiDimensionalAnimationDemo.kt b/ui/ui-animation/integration-tests/animation-demos/src/main/java/androidx/ui/animation/demos/MultiDimensionalAnimationDemo.kt
index cb073a5..dbdd101 100644
--- a/ui/ui-animation/integration-tests/animation-demos/src/main/java/androidx/ui/animation/demos/MultiDimensionalAnimationDemo.kt
+++ b/ui/ui-animation/integration-tests/animation-demos/src/main/java/androidx/ui/animation/demos/MultiDimensionalAnimationDemo.kt
@@ -25,11 +25,12 @@
import androidx.ui.animation.RectPropKey
import androidx.ui.animation.Transition
import androidx.ui.core.Modifier
-import androidx.ui.foundation.Canvas
+import androidx.ui.foundation.Canvas2
import androidx.ui.foundation.Clickable
+import androidx.ui.geometry.Offset
import androidx.ui.geometry.Rect
+import androidx.ui.geometry.Size
import androidx.ui.graphics.Color
-import androidx.ui.graphics.Paint
import androidx.ui.layout.fillMaxSize
@Composable
@@ -52,13 +53,16 @@
},
toState = currentState.value
) { state ->
- val paint = remember { Paint() }
- Canvas(modifier = Modifier.fillMaxSize()) {
- width.value = size.width.value
- height.value = size.height.value
+ Canvas2(modifier = Modifier.fillMaxSize()) {
+ width.value = size.width
+ height.value = size.height
- paint.color = state[background]
- drawRect(state[bounds], paint)
+ val bounds = state[bounds]
+ drawRect(
+ state[background],
+ topLeft = Offset(bounds.left, bounds.top),
+ size = Size(bounds.width, bounds.height)
+ )
}
}
}
diff --git a/ui/ui-animation/integration-tests/animation-demos/src/main/java/androidx/ui/animation/demos/RepeatedRotationDemo.kt b/ui/ui-animation/integration-tests/animation-demos/src/main/java/androidx/ui/animation/demos/RepeatedRotationDemo.kt
index 9060849..c4c6297 100644
--- a/ui/ui-animation/integration-tests/animation-demos/src/main/java/androidx/ui/animation/demos/RepeatedRotationDemo.kt
+++ b/ui/ui-animation/integration-tests/animation-demos/src/main/java/androidx/ui/animation/demos/RepeatedRotationDemo.kt
@@ -25,10 +25,10 @@
import androidx.ui.core.Alignment
import androidx.ui.core.Modifier
import androidx.ui.core.gesture.tapGestureFilter
-import androidx.ui.foundation.Canvas
+import androidx.ui.foundation.Canvas2
import androidx.ui.foundation.Text
import androidx.ui.graphics.Color
-import androidx.ui.graphics.Paint
+import androidx.ui.graphics.painter.rotate
import androidx.ui.layout.Arrangement
import androidx.ui.layout.Column
import androidx.ui.layout.fillMaxSize
@@ -37,7 +37,6 @@
import androidx.ui.text.TextStyle
import androidx.ui.unit.dp
import androidx.ui.unit.sp
-import androidx.ui.unit.toRect
@Composable
fun RepeatedRotationDemo() {
@@ -62,13 +61,10 @@
definition = definition,
toState = state.value
) { state ->
- Canvas(Modifier.preferredSize(100.dp)) {
- // TODO (njawad) replace with save lambda when multi children DrawNodes are supported
- save()
- rotate(state[rotation])
- drawRect(size.toRect(), Paint().apply { color = Color(0xFF00FF00) })
- // TODO (njawad) replace with save lambda when multi children DrawNodes are supported
- restore()
+ Canvas2(Modifier.preferredSize(100.dp)) {
+ rotate(state[rotation], 0.0f, 0.0f) {
+ drawRect(Color(0xFF00FF00))
+ }
}
}
}
diff --git a/ui/ui-animation/integration-tests/animation-demos/src/main/java/androidx/ui/animation/demos/SpringBackScrollingDemo.kt b/ui/ui-animation/integration-tests/animation-demos/src/main/java/androidx/ui/animation/demos/SpringBackScrollingDemo.kt
index 9a6d2e8..d987ca9 100644
--- a/ui/ui-animation/integration-tests/animation-demos/src/main/java/androidx/ui/animation/demos/SpringBackScrollingDemo.kt
+++ b/ui/ui-animation/integration-tests/animation-demos/src/main/java/androidx/ui/animation/demos/SpringBackScrollingDemo.kt
@@ -21,18 +21,17 @@
import androidx.animation.PhysicsBuilder
import androidx.animation.fling
import androidx.compose.Composable
-import androidx.compose.remember
import androidx.compose.state
import androidx.ui.animation.animatedFloat
-import androidx.ui.core.DrawScope
import androidx.ui.core.Modifier
import androidx.ui.core.gesture.DragObserver
import androidx.ui.core.gesture.rawDragGestureFilter
-import androidx.ui.foundation.Canvas
+import androidx.ui.foundation.Canvas2
import androidx.ui.foundation.Text
-import androidx.ui.geometry.Rect
+import androidx.ui.geometry.Offset
+import androidx.ui.geometry.Size
import androidx.ui.graphics.Color
-import androidx.ui.graphics.Paint
+import androidx.ui.graphics.painter.CanvasScope
import androidx.ui.layout.Column
import androidx.ui.layout.fillMaxHeight
import androidx.ui.layout.fillMaxWidth
@@ -68,9 +67,8 @@
})
}
})
- val paint = remember { Paint() }
- Canvas(gesture.fillMaxWidth().preferredHeight(400.dp)) {
- itemWidth.value = size.width.value / 2f
+ Canvas2(gesture.fillMaxWidth().preferredHeight(400.dp)) {
+ itemWidth.value = size.width / 2f
if (isFlinging.value) {
// Figure out what position to spring back to
val target = animScroll.targetValue
@@ -102,13 +100,13 @@
" scroll value: ${animScroll.value}"
)
}
- drawRects(paint, animScroll.value)
+ drawRects(animScroll.value)
}
}
}
-private fun DrawScope.drawRects(paint: Paint, animScroll: Float) {
- val width = size.width.value / 2f
+private fun CanvasScope.drawRects(animScroll: Float) {
+ val width = size.width / 2f
val scroll = animScroll + width / 2
var startingPos = scroll % width
if (startingPos > 0) {
@@ -118,26 +116,25 @@
if (startingColorIndex < 0) {
startingColorIndex += colors.size
}
- paint.color = colors[startingColorIndex]
+
+ val rectSize = Size(width - 20.0f, size.height)
+
drawRect(
- Rect(
- startingPos + 10, 0f, startingPos + width - 10,
- size.height.value
- ), paint
+ colors[startingColorIndex],
+ topLeft = Offset(startingPos + 10, 0f),
+ size = rectSize
)
- paint.color = colors[(startingColorIndex + colors.size - 1) % colors.size]
+
drawRect(
- Rect(
- startingPos + width + 10, 0f, startingPos + width * 2 - 10,
- size.height.value
- ), paint
+ colors[(startingColorIndex + colors.size - 1) % colors.size],
+ topLeft = Offset(startingPos + width + 10, 0f),
+ size = rectSize
)
- paint.color = colors[(startingColorIndex + colors.size - 2) % colors.size]
+
drawRect(
- Rect(
- startingPos + width * 2 + 10, 0f, startingPos + width * 3 - 10,
- size.height.value
- ), paint
+ colors[(startingColorIndex + colors.size - 2) % colors.size],
+ topLeft = Offset(startingPos + width * 2 + 10, 0.0f),
+ size = rectSize
)
}
diff --git a/ui/ui-animation/integration-tests/animation-demos/src/main/java/androidx/ui/animation/demos/StateAnimationWithInterruptionsDemo.kt b/ui/ui-animation/integration-tests/animation-demos/src/main/java/androidx/ui/animation/demos/StateAnimationWithInterruptionsDemo.kt
index 380a227..a7313a0 100644
--- a/ui/ui-animation/integration-tests/animation-demos/src/main/java/androidx/ui/animation/demos/StateAnimationWithInterruptionsDemo.kt
+++ b/ui/ui-animation/integration-tests/animation-demos/src/main/java/androidx/ui/animation/demos/StateAnimationWithInterruptionsDemo.kt
@@ -27,11 +27,11 @@
import androidx.ui.animation.Transition
import androidx.ui.core.Modifier
import androidx.ui.foundation.Box
-import androidx.ui.foundation.Canvas
+import androidx.ui.foundation.Canvas2
import androidx.ui.foundation.drawBackground
-import androidx.ui.geometry.Rect
+import androidx.ui.geometry.Offset
+import androidx.ui.geometry.Size
import androidx.ui.graphics.Color
-import androidx.ui.graphics.Paint
import androidx.ui.layout.fillMaxSize
@Composable
@@ -96,15 +96,11 @@
private fun ColorRectState(state: TransitionState) {
val color = state[background]
val scaleY = state[y]
- Canvas(Modifier.fillMaxSize().drawBackground(color = color)) {
- val paint = Paint().apply {
- this.color = Color(alpha = 255, red = 255, green = 255, blue = 255)
- }
+ Canvas2(Modifier.fillMaxSize().drawBackground(color = color)) {
drawRect(
- Rect(
- 100f, 0f, size.width.value - 100f,
- scaleY * size.height.value
- ), paint
+ Color(alpha = 255, red = 255, green = 255, blue = 255),
+ topLeft = Offset(100f, 0f),
+ size = Size(size.width - 200f, scaleY * size.height)
)
}
}
diff --git a/ui/ui-animation/integration-tests/animation-demos/src/main/java/androidx/ui/animation/demos/StateBasedRippleDemo.kt b/ui/ui-animation/integration-tests/animation-demos/src/main/java/androidx/ui/animation/demos/StateBasedRippleDemo.kt
index 5a65259..e6013b5 100644
--- a/ui/ui-animation/integration-tests/animation-demos/src/main/java/androidx/ui/animation/demos/StateBasedRippleDemo.kt
+++ b/ui/ui-animation/integration-tests/animation-demos/src/main/java/androidx/ui/animation/demos/StateBasedRippleDemo.kt
@@ -30,10 +30,9 @@
import androidx.ui.core.Modifier
import androidx.ui.core.gesture.pressIndicatorGestureFilter
import androidx.ui.foundation.Box
-import androidx.ui.foundation.Canvas
+import androidx.ui.foundation.Canvas2
import androidx.ui.geometry.Offset
import androidx.ui.graphics.Color
-import androidx.ui.graphics.Paint
import androidx.ui.layout.fillMaxSize
import androidx.ui.unit.PxPosition
import androidx.ui.unit.dp
@@ -69,23 +68,18 @@
@Composable
private fun RippleRectFromState(modifier: Modifier = Modifier, state: TransitionState) {
- Canvas(modifier.fillMaxSize()) {
+ Canvas2(modifier.fillMaxSize()) {
// TODO: file bug for when "down" is not a file level val, it's not memoized correctly
- val x = down.x
- val y = down.y
-
- val paint =
- Paint().apply {
- color = Color(
- alpha = (state[androidx.ui.animation.demos.alpha] * 255).toInt(),
- red = 0,
- green = 235,
- blue = 224
- )
- }
-
- val radius = state[radius]
- drawCircle(Offset(x, y), radius, paint)
+ drawCircle(
+ Color(
+ alpha = (state[alpha] * 255).toInt(),
+ red = 0,
+ green = 235,
+ blue = 224
+ ),
+ center = Offset(down.x, down.y),
+ radius = state[radius]
+ )
}
}
diff --git a/ui/ui-animation/integration-tests/animation-demos/src/main/java/androidx/ui/animation/demos/SwipeToDismissDemo.kt b/ui/ui-animation/integration-tests/animation-demos/src/main/java/androidx/ui/animation/demos/SwipeToDismissDemo.kt
index 545cacc..41ee964 100644
--- a/ui/ui-animation/integration-tests/animation-demos/src/main/java/androidx/ui/animation/demos/SwipeToDismissDemo.kt
+++ b/ui/ui-animation/integration-tests/animation-demos/src/main/java/androidx/ui/animation/demos/SwipeToDismissDemo.kt
@@ -23,20 +23,19 @@
import androidx.animation.TargetAnimation
import androidx.animation.fling
import androidx.compose.Composable
-import androidx.compose.remember
import androidx.compose.state
import androidx.ui.animation.animatedFloat
import androidx.ui.core.DensityAmbient
-import androidx.ui.core.DrawScope
import androidx.ui.core.Modifier
import androidx.ui.core.gesture.DragObserver
import androidx.ui.core.gesture.rawDragGestureFilter
import androidx.ui.core.onPositioned
-import androidx.ui.foundation.Canvas
+import androidx.ui.foundation.Canvas2
import androidx.ui.foundation.Text
-import androidx.ui.geometry.Rect
+import androidx.ui.geometry.Offset
+import androidx.ui.geometry.Size
import androidx.ui.graphics.Color
-import androidx.ui.graphics.Paint
+import androidx.ui.graphics.painter.CanvasScope
import androidx.ui.layout.Column
import androidx.ui.layout.fillMaxWidth
import androidx.ui.layout.padding
@@ -122,9 +121,8 @@
})
val heightDp = with(DensityAmbient.current) { height.toDp() }
- val paint = remember { Paint() }
- Canvas(
+ Canvas2(
modifier.fillMaxWidth()
.preferredHeight(heightDp)
.onPositioned { coordinates ->
@@ -135,64 +133,43 @@
// TODO: this progress can be used to drive state transitions
val alpha = 1f - FastOutSlowInEasing(progress)
val horizontalOffset = progress * itemWidth.value
- drawLeftItems(
- paint, horizontalOffset, itemWidth.value, itemHeight, index.value
- )
- drawDismissingItem(
- paint,
- itemBottom.value, itemWidth.value, itemHeight, index.value + 1,
- alpha
- )
+ drawLeftItems(horizontalOffset, itemWidth.value, itemHeight, index.value)
+ drawDismissingItem(itemBottom.value, itemWidth.value, itemHeight, index.value + 1, alpha)
}
}
-private fun DrawScope.drawLeftItems(
- paint: Paint,
+private fun CanvasScope.drawLeftItems(
horizontalOffset: Float,
width: Float,
height: Float,
index: Int
) {
- paint.color = colors[index % colors.size]
- paint.alpha = 1f
- val centerX = size.width.value / 2
- val itemRect =
- Rect(
- centerX - width * 1.5f + horizontalOffset + padding,
- size.height.value - height,
- centerX - width * 0.5f + horizontalOffset - padding,
- size.height.value
- )
- drawRect(itemRect, paint)
+ val offset = Offset(center.dx - width * 1.5f + horizontalOffset + padding, size.height - height)
+ val rectSize = Size(width - (2 * padding), height)
+ drawRect(colors[index % colors.size], offset, rectSize)
- if (itemRect.left >= 0) {
+ if (offset.dx >= 0) {
// draw another item
- paint.color = colors[(index - 1 + colors.size) % colors.size]
- drawRect(itemRect.translate(-width, 0f), paint)
+ drawRect(
+ colors[(index - 1 + colors.size) % colors.size],
+ offset - Offset(width, 0.0f),
+ rectSize
+ )
}
}
-private fun DrawScope.drawDismissingItem(
- paint: Paint,
+private fun CanvasScope.drawDismissingItem(
bottom: Float,
width: Float,
height: Float,
index: Int,
alpha: Float
-) {
- paint.color = colors[index % colors.size]
- paint.alpha = alpha
- val centerX = size.width.value / 2
- drawRect(
- Rect(
- centerX - width / 2 + padding,
- bottom - height,
- centerX + width / 2 - padding,
- bottom
- ),
- paint
+) = drawRect(
+ colors[index % colors.size],
+ topLeft = Offset(center.dx - width / 2 + padding, bottom - height),
+ size = Size(width - (2 * padding), height),
+ alpha = alpha
)
-}
private val colors = listOf(
Color(0xFFffd7d7),
diff --git a/ui/ui-animation/src/androidTest/java/androidx/ui/animation/CrossfadeTest.kt b/ui/ui-animation/src/androidTest/java/androidx/ui/animation/CrossfadeTest.kt
new file mode 100644
index 0000000..d008d05
--- /dev/null
+++ b/ui/ui-animation/src/androidTest/java/androidx/ui/animation/CrossfadeTest.kt
@@ -0,0 +1,129 @@
+/*
+ * Copyright 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT 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.ui.animation
+
+import androidx.animation.DefaultDuration
+import androidx.animation.TweenBuilder
+import androidx.compose.getValue
+import androidx.compose.mutableStateOf
+import androidx.compose.onDispose
+import androidx.compose.setValue
+import androidx.compose.state
+import androidx.test.filters.MediumTest
+import androidx.ui.foundation.Text
+import androidx.ui.test.createComposeRule
+import androidx.ui.test.findByText
+import androidx.ui.test.runOnIdleCompose
+import androidx.ui.test.waitForIdle
+import org.junit.Assert.assertTrue
+import org.junit.Rule
+import org.junit.Test
+import org.junit.runner.RunWith
+import org.junit.runners.JUnit4
+import java.util.concurrent.CountDownLatch
+import java.util.concurrent.TimeUnit
+
+@RunWith(JUnit4::class)
+@MediumTest
+class CrossfadeTest {
+
+ @get:Rule
+ val composeTestRule = createComposeRule(disableTransitions = false)
+
+ @Test
+ fun crossfadeTest_showsContent() {
+ composeTestRule.clockTestRule.pauseClock()
+
+ composeTestRule.setContent {
+ val showFirst by state { true }
+ Crossfade(showFirst) {
+ Text(if (it) First else Second)
+ }
+ }
+ composeTestRule.clockTestRule.advanceClock(DefaultDuration.toLong())
+
+ findByText(First).assertExists()
+ }
+
+ @Test
+ fun crossfadeTest_disposesContentOnChange() {
+ composeTestRule.clockTestRule.pauseClock()
+
+ var showFirst by mutableStateOf(true)
+ var disposed = false
+ composeTestRule.setContent {
+ Crossfade(showFirst) {
+ Text(if (it) First else Second)
+ onDispose {
+ disposed = true
+ }
+ }
+ }
+ composeTestRule.clockTestRule.advanceClock(DefaultDuration.toLong())
+
+ runOnIdleCompose {
+ showFirst = false
+ }
+
+ waitForIdle()
+
+ composeTestRule.clockTestRule.advanceClock(DefaultDuration.toLong())
+
+ runOnIdleCompose {
+ assertTrue(disposed)
+ }
+
+ findByText(First).assertDoesNotExist()
+ findByText(Second).assertExists()
+ }
+
+ @Test
+ fun crossfadeTest_durationCanBeModifierUsingAnimationBuilder() {
+ composeTestRule.clockTestRule.pauseClock()
+
+ val duration = 100L // smaller than default 300
+ var showFirst by mutableStateOf(true)
+ var disposed = false
+ composeTestRule.setContent {
+ Crossfade(showFirst, TweenBuilder<Float>().apply {
+ this.duration = duration.toInt()
+ }) {
+ Text(if (it) First else Second)
+ onDispose {
+ disposed = true
+ }
+ }
+ }
+ composeTestRule.clockTestRule.advanceClock(duration)
+
+ runOnIdleCompose {
+ showFirst = false
+ }
+
+ waitForIdle()
+
+ composeTestRule.clockTestRule.advanceClock(duration)
+
+ runOnIdleCompose {
+ assertTrue(disposed)
+ }
+ }
+
+ companion object {
+ private const val First = "first"
+ private const val Second = "second"
+ }
+}
diff --git a/ui/ui-animation/src/androidTest/java/androidx/ui/animation/CrossfadeUiTest.kt b/ui/ui-animation/src/androidTest/java/androidx/ui/animation/CrossfadeUiTest.kt
deleted file mode 100644
index 950e2bf..0000000
--- a/ui/ui-animation/src/androidTest/java/androidx/ui/animation/CrossfadeUiTest.kt
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- * Copyright 2020 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT 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.ui.animation
-
-import androidx.compose.getValue
-import androidx.compose.mutableStateOf
-import androidx.compose.onDispose
-import androidx.compose.setValue
-import androidx.compose.state
-import androidx.test.filters.MediumTest
-import androidx.ui.foundation.Text
-import androidx.ui.test.createComposeRule
-import androidx.ui.test.findByText
-import androidx.ui.test.runOnIdleCompose
-import org.junit.Rule
-import org.junit.Test
-import org.junit.runner.RunWith
-import org.junit.runners.JUnit4
-import java.util.concurrent.CountDownLatch
-import java.util.concurrent.TimeUnit
-
-@RunWith(JUnit4::class)
-@MediumTest
-class CrossfadeUiTest {
-
- @get:Rule
- val composeTestRule = createComposeRule(disableTransitions = false)
-
- @Test
- fun crossfadeTest_showsContent() {
- composeTestRule.setContent {
- var showFirst by state { true }
- Crossfade(showFirst) {
- Text(if (it) First else Second)
- }
- }
- composeTestRule.clockTestRule.advanceClock(300)
-
- findByText(First).assertExists()
- }
-
- @Test
- fun crossfadeTest_disposesContentOnChange() {
- var showFirst by mutableStateOf(true)
- val disposeLatch = CountDownLatch(1)
- composeTestRule.setContent {
-
- Crossfade(showFirst) {
- Text(if (it) First else Second)
- onDispose {
- disposeLatch.countDown()
- }
- }
- }
- composeTestRule.clockTestRule.advanceClock(300)
-
- runOnIdleCompose {
- showFirst = false
- }
- composeTestRule.clockTestRule.advanceClock(300)
-
- disposeLatch.await(5, TimeUnit.SECONDS)
-
- findByText(First).assertDoesNotExist()
- findByText(Second).assertExists()
- }
-
- companion object {
- private const val First = "first"
- private const val Second = "second"
- }
-}
\ No newline at end of file
diff --git a/ui/ui-animation/src/main/java/androidx/ui/animation/Crossfade.kt b/ui/ui-animation/src/main/java/androidx/ui/animation/Crossfade.kt
index fa97385..91ab535 100644
--- a/ui/ui-animation/src/main/java/androidx/ui/animation/Crossfade.kt
+++ b/ui/ui-animation/src/main/java/androidx/ui/animation/Crossfade.kt
@@ -17,6 +17,7 @@
package androidx.ui.animation
import androidx.animation.AnimatedFloat
+import androidx.animation.AnimationBuilder
import androidx.animation.AnimationEndReason
import androidx.animation.TweenBuilder
import androidx.compose.Composable
@@ -36,9 +37,14 @@
* @param current is a key representing your current layout state. every time you change a key
* the animation will be triggered. The [children] called with the old key will be faded out while
* the [children] called with the new key will be faded in.
+ * @param animation the [AnimationBuilder] to configure the animation.
*/
@Composable
-fun <T> Crossfade(current: T, children: @Composable() (T) -> Unit) {
+fun <T> Crossfade(
+ current: T,
+ animation: AnimationBuilder<Float> = TweenBuilder(),
+ children: @Composable() (T) -> Unit
+) {
val state = remember { CrossfadeState<T>() }
if (current != state.current) {
state.current = current
@@ -50,6 +56,7 @@
keys.mapTo(state.items) { key ->
CrossfadeAnimationItem(key) { children ->
val opacity = animatedOpacity(
+ animation = animation,
visible = key == current,
onAnimationFinish = {
if (key == state.current) {
@@ -92,6 +99,7 @@
@Composable
private fun animatedOpacity(
+ animation: AnimationBuilder<Float>,
visible: Boolean,
onAnimationFinish: () -> Unit = {}
): AnimatedFloat {
@@ -99,7 +107,7 @@
onCommit(visible) {
animatedFloat.animateTo(
if (visible) 1f else 0f,
- anim = TweenBuilder<Float>().apply { duration = 300 },
+ anim = animation,
onEnd = { reason, _ ->
if (reason == AnimationEndReason.TargetReached) {
onAnimationFinish()
diff --git a/ui/ui-core/api/0.1.0-dev11.txt b/ui/ui-core/api/0.1.0-dev11.txt
index 12cfc0f..45987cc 100644
--- a/ui/ui-core/api/0.1.0-dev11.txt
+++ b/ui/ui-core/api/0.1.0-dev11.txt
@@ -175,7 +175,7 @@
ctor public Constraints2();
method public static long constructor-impl(internal long value);
method public static long copy-impl(long $this, int minWidth = this.minWidth, int maxWidth = this.maxWidth, int minHeight = this.minHeight, int maxHeight = this.maxHeight);
- method public static boolean equals-impl(long p, Object? p1);
+ method public static inline boolean equals-impl(long p, Object? p1);
method public static boolean equals-impl0(long p1, long p2);
method public static boolean getHasBoundedHeight-impl(long $this);
method public static boolean getHasBoundedWidth-impl(long $this);
@@ -183,8 +183,8 @@
method public static int getMaxWidth-impl(long $this);
method public static int getMinHeight-impl(long $this);
method public static int getMinWidth-impl(long $this);
- method public static int hashCode-impl(long p);
- method public static String toString-impl(long p);
+ method public static inline int hashCode-impl(long p);
+ method public static inline String! toString-impl(long p);
field public static final androidx.ui.core.Constraints2.Companion! Companion;
field public static final int Infinity = -1073741824; // 0xc0000000
}
@@ -514,11 +514,11 @@
public final inline class PointerId {
ctor public PointerId();
method public static long constructor-impl(long value);
- method public static boolean equals-impl(long p, Object? p1);
+ method public static inline boolean equals-impl(long p, Object? p1);
method public static boolean equals-impl0(long p1, long p2);
method public long getValue();
- method public static int hashCode-impl(long p);
- method public static String toString-impl(long p);
+ method public static inline int hashCode-impl(long p);
+ method public static inline String! toString-impl(long p);
}
public final class PointerInputChange {
@@ -590,12 +590,12 @@
public final inline class TransformOrigin {
ctor public TransformOrigin();
method public static long constructor-impl(internal long value);
- method public static boolean equals-impl(long p, Object? p1);
+ method public static inline boolean equals-impl(long p, Object? p1);
method public static boolean equals-impl0(long p1, long p2);
method public static float getPivotFractionX-impl(long $this);
method public static float getPivotFractionY-impl(long $this);
- method public static int hashCode-impl(long p);
- method public static String toString-impl(long p);
+ method public static inline int hashCode-impl(long p);
+ method public static inline String! toString-impl(long p);
field public static final androidx.ui.core.TransformOrigin.Companion! Companion;
}
diff --git a/ui/ui-core/api/api_lint.ignore b/ui/ui-core/api/api_lint.ignore
index 57903b1..02812d2 100644
--- a/ui/ui-core/api/api_lint.ignore
+++ b/ui/ui-core/api/api_lint.ignore
@@ -37,3 +37,11 @@
Method parameter should be Collection<PointerEventPass> (or subclass) instead of raw array; was `androidx.ui.core.PointerEventPass[]`
ArrayReturn: androidx.ui.testutils.PointerInputTestUtilKt#invokeOverPasses(kotlin.jvm.functions.Function3<? super java.util.List<androidx.ui.core.PointerInputChange>,? super androidx.ui.core.PointerEventPass,? super androidx.ui.unit.IntPxSize,? extends java.util.List<androidx.ui.core.PointerInputChange>>, androidx.ui.core.PointerInputChange[], androidx.ui.core.PointerEventPass, androidx.ui.unit.IntPxSize) parameter #1:
Method parameter should be Collection<PointerInputChange> (or subclass) instead of raw array; was `androidx.ui.core.PointerInputChange[]`
+
+
+MissingNullability: androidx.ui.core.Constraints2#toString-impl(long):
+ Missing nullability on method `toString-impl` return
+MissingNullability: androidx.ui.core.PointerId#toString-impl(long):
+ Missing nullability on method `toString-impl` return
+MissingNullability: androidx.ui.core.TransformOrigin#toString-impl(long):
+ Missing nullability on method `toString-impl` return
diff --git a/ui/ui-core/api/current.txt b/ui/ui-core/api/current.txt
index 12cfc0f..45987cc 100644
--- a/ui/ui-core/api/current.txt
+++ b/ui/ui-core/api/current.txt
@@ -175,7 +175,7 @@
ctor public Constraints2();
method public static long constructor-impl(internal long value);
method public static long copy-impl(long $this, int minWidth = this.minWidth, int maxWidth = this.maxWidth, int minHeight = this.minHeight, int maxHeight = this.maxHeight);
- method public static boolean equals-impl(long p, Object? p1);
+ method public static inline boolean equals-impl(long p, Object? p1);
method public static boolean equals-impl0(long p1, long p2);
method public static boolean getHasBoundedHeight-impl(long $this);
method public static boolean getHasBoundedWidth-impl(long $this);
@@ -183,8 +183,8 @@
method public static int getMaxWidth-impl(long $this);
method public static int getMinHeight-impl(long $this);
method public static int getMinWidth-impl(long $this);
- method public static int hashCode-impl(long p);
- method public static String toString-impl(long p);
+ method public static inline int hashCode-impl(long p);
+ method public static inline String! toString-impl(long p);
field public static final androidx.ui.core.Constraints2.Companion! Companion;
field public static final int Infinity = -1073741824; // 0xc0000000
}
@@ -514,11 +514,11 @@
public final inline class PointerId {
ctor public PointerId();
method public static long constructor-impl(long value);
- method public static boolean equals-impl(long p, Object? p1);
+ method public static inline boolean equals-impl(long p, Object? p1);
method public static boolean equals-impl0(long p1, long p2);
method public long getValue();
- method public static int hashCode-impl(long p);
- method public static String toString-impl(long p);
+ method public static inline int hashCode-impl(long p);
+ method public static inline String! toString-impl(long p);
}
public final class PointerInputChange {
@@ -590,12 +590,12 @@
public final inline class TransformOrigin {
ctor public TransformOrigin();
method public static long constructor-impl(internal long value);
- method public static boolean equals-impl(long p, Object? p1);
+ method public static inline boolean equals-impl(long p, Object? p1);
method public static boolean equals-impl0(long p1, long p2);
method public static float getPivotFractionX-impl(long $this);
method public static float getPivotFractionY-impl(long $this);
- method public static int hashCode-impl(long p);
- method public static String toString-impl(long p);
+ method public static inline int hashCode-impl(long p);
+ method public static inline String! toString-impl(long p);
field public static final androidx.ui.core.TransformOrigin.Companion! Companion;
}
diff --git a/ui/ui-core/api/public_plus_experimental_0.1.0-dev11.txt b/ui/ui-core/api/public_plus_experimental_0.1.0-dev11.txt
index 12cfc0f..45987cc 100644
--- a/ui/ui-core/api/public_plus_experimental_0.1.0-dev11.txt
+++ b/ui/ui-core/api/public_plus_experimental_0.1.0-dev11.txt
@@ -175,7 +175,7 @@
ctor public Constraints2();
method public static long constructor-impl(internal long value);
method public static long copy-impl(long $this, int minWidth = this.minWidth, int maxWidth = this.maxWidth, int minHeight = this.minHeight, int maxHeight = this.maxHeight);
- method public static boolean equals-impl(long p, Object? p1);
+ method public static inline boolean equals-impl(long p, Object? p1);
method public static boolean equals-impl0(long p1, long p2);
method public static boolean getHasBoundedHeight-impl(long $this);
method public static boolean getHasBoundedWidth-impl(long $this);
@@ -183,8 +183,8 @@
method public static int getMaxWidth-impl(long $this);
method public static int getMinHeight-impl(long $this);
method public static int getMinWidth-impl(long $this);
- method public static int hashCode-impl(long p);
- method public static String toString-impl(long p);
+ method public static inline int hashCode-impl(long p);
+ method public static inline String! toString-impl(long p);
field public static final androidx.ui.core.Constraints2.Companion! Companion;
field public static final int Infinity = -1073741824; // 0xc0000000
}
@@ -514,11 +514,11 @@
public final inline class PointerId {
ctor public PointerId();
method public static long constructor-impl(long value);
- method public static boolean equals-impl(long p, Object? p1);
+ method public static inline boolean equals-impl(long p, Object? p1);
method public static boolean equals-impl0(long p1, long p2);
method public long getValue();
- method public static int hashCode-impl(long p);
- method public static String toString-impl(long p);
+ method public static inline int hashCode-impl(long p);
+ method public static inline String! toString-impl(long p);
}
public final class PointerInputChange {
@@ -590,12 +590,12 @@
public final inline class TransformOrigin {
ctor public TransformOrigin();
method public static long constructor-impl(internal long value);
- method public static boolean equals-impl(long p, Object? p1);
+ method public static inline boolean equals-impl(long p, Object? p1);
method public static boolean equals-impl0(long p1, long p2);
method public static float getPivotFractionX-impl(long $this);
method public static float getPivotFractionY-impl(long $this);
- method public static int hashCode-impl(long p);
- method public static String toString-impl(long p);
+ method public static inline int hashCode-impl(long p);
+ method public static inline String! toString-impl(long p);
field public static final androidx.ui.core.TransformOrigin.Companion! Companion;
}
diff --git a/ui/ui-core/api/public_plus_experimental_current.txt b/ui/ui-core/api/public_plus_experimental_current.txt
index 12cfc0f..45987cc 100644
--- a/ui/ui-core/api/public_plus_experimental_current.txt
+++ b/ui/ui-core/api/public_plus_experimental_current.txt
@@ -175,7 +175,7 @@
ctor public Constraints2();
method public static long constructor-impl(internal long value);
method public static long copy-impl(long $this, int minWidth = this.minWidth, int maxWidth = this.maxWidth, int minHeight = this.minHeight, int maxHeight = this.maxHeight);
- method public static boolean equals-impl(long p, Object? p1);
+ method public static inline boolean equals-impl(long p, Object? p1);
method public static boolean equals-impl0(long p1, long p2);
method public static boolean getHasBoundedHeight-impl(long $this);
method public static boolean getHasBoundedWidth-impl(long $this);
@@ -183,8 +183,8 @@
method public static int getMaxWidth-impl(long $this);
method public static int getMinHeight-impl(long $this);
method public static int getMinWidth-impl(long $this);
- method public static int hashCode-impl(long p);
- method public static String toString-impl(long p);
+ method public static inline int hashCode-impl(long p);
+ method public static inline String! toString-impl(long p);
field public static final androidx.ui.core.Constraints2.Companion! Companion;
field public static final int Infinity = -1073741824; // 0xc0000000
}
@@ -514,11 +514,11 @@
public final inline class PointerId {
ctor public PointerId();
method public static long constructor-impl(long value);
- method public static boolean equals-impl(long p, Object? p1);
+ method public static inline boolean equals-impl(long p, Object? p1);
method public static boolean equals-impl0(long p1, long p2);
method public long getValue();
- method public static int hashCode-impl(long p);
- method public static String toString-impl(long p);
+ method public static inline int hashCode-impl(long p);
+ method public static inline String! toString-impl(long p);
}
public final class PointerInputChange {
@@ -590,12 +590,12 @@
public final inline class TransformOrigin {
ctor public TransformOrigin();
method public static long constructor-impl(internal long value);
- method public static boolean equals-impl(long p, Object? p1);
+ method public static inline boolean equals-impl(long p, Object? p1);
method public static boolean equals-impl0(long p1, long p2);
method public static float getPivotFractionX-impl(long $this);
method public static float getPivotFractionY-impl(long $this);
- method public static int hashCode-impl(long p);
- method public static String toString-impl(long p);
+ method public static inline int hashCode-impl(long p);
+ method public static inline String! toString-impl(long p);
field public static final androidx.ui.core.TransformOrigin.Companion! Companion;
}
diff --git a/ui/ui-core/api/restricted_0.1.0-dev11.txt b/ui/ui-core/api/restricted_0.1.0-dev11.txt
index 12cfc0f..45987cc 100644
--- a/ui/ui-core/api/restricted_0.1.0-dev11.txt
+++ b/ui/ui-core/api/restricted_0.1.0-dev11.txt
@@ -175,7 +175,7 @@
ctor public Constraints2();
method public static long constructor-impl(internal long value);
method public static long copy-impl(long $this, int minWidth = this.minWidth, int maxWidth = this.maxWidth, int minHeight = this.minHeight, int maxHeight = this.maxHeight);
- method public static boolean equals-impl(long p, Object? p1);
+ method public static inline boolean equals-impl(long p, Object? p1);
method public static boolean equals-impl0(long p1, long p2);
method public static boolean getHasBoundedHeight-impl(long $this);
method public static boolean getHasBoundedWidth-impl(long $this);
@@ -183,8 +183,8 @@
method public static int getMaxWidth-impl(long $this);
method public static int getMinHeight-impl(long $this);
method public static int getMinWidth-impl(long $this);
- method public static int hashCode-impl(long p);
- method public static String toString-impl(long p);
+ method public static inline int hashCode-impl(long p);
+ method public static inline String! toString-impl(long p);
field public static final androidx.ui.core.Constraints2.Companion! Companion;
field public static final int Infinity = -1073741824; // 0xc0000000
}
@@ -514,11 +514,11 @@
public final inline class PointerId {
ctor public PointerId();
method public static long constructor-impl(long value);
- method public static boolean equals-impl(long p, Object? p1);
+ method public static inline boolean equals-impl(long p, Object? p1);
method public static boolean equals-impl0(long p1, long p2);
method public long getValue();
- method public static int hashCode-impl(long p);
- method public static String toString-impl(long p);
+ method public static inline int hashCode-impl(long p);
+ method public static inline String! toString-impl(long p);
}
public final class PointerInputChange {
@@ -590,12 +590,12 @@
public final inline class TransformOrigin {
ctor public TransformOrigin();
method public static long constructor-impl(internal long value);
- method public static boolean equals-impl(long p, Object? p1);
+ method public static inline boolean equals-impl(long p, Object? p1);
method public static boolean equals-impl0(long p1, long p2);
method public static float getPivotFractionX-impl(long $this);
method public static float getPivotFractionY-impl(long $this);
- method public static int hashCode-impl(long p);
- method public static String toString-impl(long p);
+ method public static inline int hashCode-impl(long p);
+ method public static inline String! toString-impl(long p);
field public static final androidx.ui.core.TransformOrigin.Companion! Companion;
}
diff --git a/ui/ui-core/api/restricted_current.txt b/ui/ui-core/api/restricted_current.txt
index 12cfc0f..45987cc 100644
--- a/ui/ui-core/api/restricted_current.txt
+++ b/ui/ui-core/api/restricted_current.txt
@@ -175,7 +175,7 @@
ctor public Constraints2();
method public static long constructor-impl(internal long value);
method public static long copy-impl(long $this, int minWidth = this.minWidth, int maxWidth = this.maxWidth, int minHeight = this.minHeight, int maxHeight = this.maxHeight);
- method public static boolean equals-impl(long p, Object? p1);
+ method public static inline boolean equals-impl(long p, Object? p1);
method public static boolean equals-impl0(long p1, long p2);
method public static boolean getHasBoundedHeight-impl(long $this);
method public static boolean getHasBoundedWidth-impl(long $this);
@@ -183,8 +183,8 @@
method public static int getMaxWidth-impl(long $this);
method public static int getMinHeight-impl(long $this);
method public static int getMinWidth-impl(long $this);
- method public static int hashCode-impl(long p);
- method public static String toString-impl(long p);
+ method public static inline int hashCode-impl(long p);
+ method public static inline String! toString-impl(long p);
field public static final androidx.ui.core.Constraints2.Companion! Companion;
field public static final int Infinity = -1073741824; // 0xc0000000
}
@@ -514,11 +514,11 @@
public final inline class PointerId {
ctor public PointerId();
method public static long constructor-impl(long value);
- method public static boolean equals-impl(long p, Object? p1);
+ method public static inline boolean equals-impl(long p, Object? p1);
method public static boolean equals-impl0(long p1, long p2);
method public long getValue();
- method public static int hashCode-impl(long p);
- method public static String toString-impl(long p);
+ method public static inline int hashCode-impl(long p);
+ method public static inline String! toString-impl(long p);
}
public final class PointerInputChange {
@@ -590,12 +590,12 @@
public final inline class TransformOrigin {
ctor public TransformOrigin();
method public static long constructor-impl(internal long value);
- method public static boolean equals-impl(long p, Object? p1);
+ method public static inline boolean equals-impl(long p, Object? p1);
method public static boolean equals-impl0(long p1, long p2);
method public static float getPivotFractionX-impl(long $this);
method public static float getPivotFractionY-impl(long $this);
- method public static int hashCode-impl(long p);
- method public static String toString-impl(long p);
+ method public static inline int hashCode-impl(long p);
+ method public static inline String! toString-impl(long p);
field public static final androidx.ui.core.TransformOrigin.Companion! Companion;
}
diff --git a/ui/ui-foundation/api/0.1.0-dev11.txt b/ui/ui-foundation/api/0.1.0-dev11.txt
index 90b0843..13cf2b5 100644
--- a/ui/ui-foundation/api/0.1.0-dev11.txt
+++ b/ui/ui-foundation/api/0.1.0-dev11.txt
@@ -18,14 +18,15 @@
}
public final class BoxKt {
- method public static void Box-TInkGdk(androidx.ui.core.Modifier modifier = Modifier, androidx.ui.graphics.Shape shape = RectangleShape, long backgroundColor = Color.Transparent, androidx.ui.foundation.Border? border = null, float padding = elvis {
- @null var var411925d7: androidx.ui.unit.Dp = border?.size
+ method public static void Box-TInkGdk(androidx.ui.core.Modifier modifier = Modifier, androidx.ui.graphics.Shape shape = androidx.ui.graphics.RectangleShapeKt.RectangleShape, long backgroundColor = Color.Transparent, androidx.ui.foundation.Border? border = null, float padding = elvis {
+ var var411925d7: androidx.ui.unit.Dp = border?.size
if (var411925d7 != null) var411925d7 else 0.dp
}, float paddingStart = Dp.Unspecified, float paddingTop = Dp.Unspecified, float paddingEnd = Dp.Unspecified, float paddingBottom = Dp.Unspecified, androidx.ui.core.Alignment gravity = ContentGravity.TopStart, kotlin.jvm.functions.Function0<kotlin.Unit> children = emptyContent());
}
public final class CanvasKt {
- method public static void Canvas(androidx.ui.core.Modifier modifier, kotlin.jvm.functions.Function1<? super androidx.ui.core.DrawScope,kotlin.Unit> onCanvas);
+ method @Deprecated public static void Canvas(androidx.ui.core.Modifier modifier, kotlin.jvm.functions.Function1<? super androidx.ui.core.DrawScope,kotlin.Unit> onCanvas);
+ method public static void Canvas2(androidx.ui.core.Modifier modifier, kotlin.jvm.functions.Function1<? super androidx.ui.graphics.painter.CanvasScope,kotlin.Unit> block);
}
public final class ClickableKt {
@@ -36,11 +37,6 @@
method public static void ClickableText(androidx.ui.text.AnnotatedString text, androidx.ui.core.Modifier modifier = Modifier, androidx.ui.text.TextStyle style = TextStyle.Default, boolean softWrap = true, androidx.ui.text.style.TextOverflow overflow = TextOverflow.Clip, int maxLines = 2147483647, kotlin.jvm.functions.Function1<? super androidx.ui.text.TextLayoutResult,kotlin.Unit> onTextLayout = {}, kotlin.jvm.functions.Function1<? super java.lang.Integer,kotlin.Unit> onClick);
}
- public final class ColoredRectKt {
- method @Deprecated public static void ColoredRect-HawTZqg(androidx.ui.graphics.Brush brush, androidx.ui.core.Modifier modifier = Modifier, androidx.ui.unit.Dp? width = null, androidx.ui.unit.Dp? height = null);
- method @Deprecated public static void ColoredRect-rR94L9Y(long color, androidx.ui.core.Modifier modifier = Modifier, androidx.ui.unit.Dp? width = null, androidx.ui.unit.Dp? height = null);
- }
-
public final class ContentColorKt {
method public static long contentColor();
method public static androidx.compose.ProvidableAmbient<androidx.ui.graphics.Color> getContentColorAmbient();
@@ -64,11 +60,11 @@
}
public final class DrawBackgroundKt {
- method @Deprecated public static androidx.ui.foundation.DrawBackground DrawBackground(androidx.ui.graphics.Brush brush, androidx.ui.graphics.Shape shape = RectangleShape);
- method @Deprecated public static androidx.ui.foundation.DrawBackground DrawBackground-qSsqlCY(long color, androidx.ui.graphics.Shape shape = RectangleShape);
+ method @Deprecated public static androidx.ui.foundation.DrawBackground DrawBackground(androidx.ui.graphics.Brush brush, androidx.ui.graphics.Shape shape = androidx.ui.graphics.RectangleShapeKt.RectangleShape);
+ method @Deprecated public static androidx.ui.foundation.DrawBackground DrawBackground-qSsqlCY(long color, androidx.ui.graphics.Shape shape = androidx.ui.graphics.RectangleShapeKt.RectangleShape);
method public static androidx.ui.core.Modifier drawBackground(androidx.ui.core.Modifier, androidx.ui.graphics.Paint paint, androidx.ui.graphics.Shape shape);
- method public static androidx.ui.core.Modifier drawBackground(androidx.ui.core.Modifier, androidx.ui.graphics.Brush brush, androidx.ui.graphics.Shape shape = RectangleShape);
- method public static androidx.ui.core.Modifier drawBackground-IZZjS-Q(androidx.ui.core.Modifier, long color, androidx.ui.graphics.Shape shape = RectangleShape);
+ method public static androidx.ui.core.Modifier drawBackground(androidx.ui.core.Modifier, androidx.ui.graphics.Brush brush, androidx.ui.graphics.Shape shape = androidx.ui.graphics.RectangleShapeKt.RectangleShape);
+ method public static androidx.ui.core.Modifier drawBackground-IZZjS-Q(androidx.ui.core.Modifier, long color, androidx.ui.graphics.Shape shape = androidx.ui.graphics.RectangleShapeKt.RectangleShape);
}
public final class DrawBorder implements androidx.ui.core.DrawModifier {
@@ -76,11 +72,11 @@
}
public final class DrawBorderKt {
- method @Deprecated public static androidx.ui.core.Modifier DrawBorder(androidx.ui.foundation.Border border, androidx.ui.graphics.Shape shape = RectangleShape);
+ method @Deprecated public static androidx.ui.core.Modifier DrawBorder(androidx.ui.foundation.Border border, androidx.ui.graphics.Shape shape = androidx.ui.graphics.RectangleShapeKt.RectangleShape);
method @Deprecated public static androidx.ui.foundation.DrawBorder DrawBorder-3vYgddY(float size, androidx.ui.graphics.Brush brush, androidx.ui.graphics.Shape shape);
- method @Deprecated public static androidx.ui.core.Modifier DrawBorder-Wounw_8(float size, long color, androidx.ui.graphics.Shape shape = RectangleShape);
- method public static androidx.ui.core.Modifier drawBorder(androidx.ui.core.Modifier, androidx.ui.foundation.Border border, androidx.ui.graphics.Shape shape = RectangleShape);
- method public static androidx.ui.core.Modifier drawBorder-ik3FbJE(androidx.ui.core.Modifier, float size, long color, androidx.ui.graphics.Shape shape = RectangleShape);
+ method @Deprecated public static androidx.ui.core.Modifier DrawBorder-Wounw_8(float size, long color, androidx.ui.graphics.Shape shape = androidx.ui.graphics.RectangleShapeKt.RectangleShape);
+ method public static androidx.ui.core.Modifier drawBorder(androidx.ui.core.Modifier, androidx.ui.foundation.Border border, androidx.ui.graphics.Shape shape = androidx.ui.graphics.RectangleShapeKt.RectangleShape);
+ method public static androidx.ui.core.Modifier drawBorder-ik3FbJE(androidx.ui.core.Modifier, float size, long color, androidx.ui.graphics.Shape shape = androidx.ui.graphics.RectangleShapeKt.RectangleShape);
method public static androidx.ui.core.Modifier drawBorder-vGsXmEw(androidx.ui.core.Modifier, float size, androidx.ui.graphics.Brush brush, androidx.ui.graphics.Shape shape);
}
@@ -169,7 +165,7 @@
}
public final class TextFieldKt {
- method public static void TextField-j3NKU0o(androidx.ui.foundation.TextFieldValue value, kotlin.jvm.functions.Function1<? super androidx.ui.foundation.TextFieldValue,kotlin.Unit> onValueChange, androidx.ui.core.Modifier modifier = Modifier, androidx.ui.core.input.FocusNode? focusNode = null, long textColor = Color.Unset, androidx.ui.text.TextStyle textStyle = currentTextStyle(), androidx.ui.input.KeyboardType keyboardType = KeyboardType.Text, androidx.ui.input.ImeAction imeAction = ImeAction.Unspecified, kotlin.jvm.functions.Function1<? super java.lang.Boolean,kotlin.Unit> onFocusChange = {}, kotlin.jvm.functions.Function1<? super androidx.ui.input.ImeAction,kotlin.Unit> onImeActionPerformed = {}, androidx.ui.input.VisualTransformation? visualTransformation = null, kotlin.jvm.functions.Function1<? super androidx.ui.text.TextLayoutResult,kotlin.Unit> onTextLayout = {}, kotlin.jvm.functions.Function1<? super androidx.ui.text.SoftwareKeyboardController,kotlin.Unit> onTextInputStarted = {});
+ method public static void TextField-4vuTNO4(androidx.ui.foundation.TextFieldValue value, kotlin.jvm.functions.Function1<? super androidx.ui.foundation.TextFieldValue,kotlin.Unit> onValueChange, androidx.ui.core.Modifier modifier = Modifier, androidx.ui.core.input.FocusNode? focusNode = null, long textColor = Color.Unset, androidx.ui.text.TextStyle textStyle = currentTextStyle(), androidx.ui.input.KeyboardType keyboardType = KeyboardType.Text, androidx.ui.input.ImeAction imeAction = ImeAction.Unspecified, kotlin.jvm.functions.Function1<? super java.lang.Boolean,kotlin.Unit> onFocusChange = {}, kotlin.jvm.functions.Function1<? super androidx.ui.input.ImeAction,kotlin.Unit> onImeActionPerformed = {}, androidx.ui.input.VisualTransformation? visualTransformation = null, kotlin.jvm.functions.Function1<? super androidx.ui.text.TextLayoutResult,kotlin.Unit> onTextLayout = {}, kotlin.jvm.functions.Function1<? super androidx.ui.text.SoftwareKeyboardController,kotlin.Unit> onTextInputStarted = {}, long cursorColor = contentColor());
}
public final class TextFieldValue {
@@ -266,7 +262,7 @@
public final class FlingConfigKt {
method public static androidx.ui.foundation.animation.FlingConfig AnchorsFlingConfig(java.util.List<java.lang.Float> anchors, androidx.animation.AnimationBuilder<java.lang.Float> animationBuilder = androidx.animation.PhysicsBuilder(), kotlin.jvm.functions.Function3<? super androidx.animation.AnimationEndReason,? super java.lang.Float,? super java.lang.Float,kotlin.Unit>? onAnimationEnd = null, androidx.animation.DecayAnimation decayAnimation = androidx.animation.ExponentialDecay());
- method public static androidx.ui.foundation.animation.FlingConfig FlingConfig(kotlin.jvm.functions.Function3<? super androidx.animation.AnimationEndReason,? super java.lang.Float,? super java.lang.Float,kotlin.Unit>? onAnimationEnd = null, kotlin.jvm.functions.Function1<? super java.lang.Float,androidx.animation.TargetAnimation> adjustTarget = { null });
+ method public static androidx.ui.foundation.animation.FlingConfig FlingConfig(kotlin.jvm.functions.Function3<? super androidx.animation.AnimationEndReason,? super java.lang.Float,? super java.lang.Float,kotlin.Unit>? onAnimationEnd = null, kotlin.jvm.functions.Function1<? super java.lang.Float,androidx.animation.TargetAnimation> adjustTarget = { return null });
method public static void fling(androidx.animation.AnimatedFloat, androidx.ui.foundation.animation.FlingConfig config, float startVelocity);
}
diff --git a/ui/ui-foundation/api/api_lint.ignore b/ui/ui-foundation/api/api_lint.ignore
index 913c852..74e0f91 100644
--- a/ui/ui-foundation/api/api_lint.ignore
+++ b/ui/ui-foundation/api/api_lint.ignore
@@ -1,7 +1,9 @@
// Baseline format: 1.0
+AcronymName: androidx.ui.foundation.Border#copy-HIF-_f0(float, androidx.ui.graphics.Brush):
+ Acronyms should not be capitalized in method names: was `copy-HIF-_f0`, should this be `copy-HiF-_f0`?
AcronymName: androidx.ui.foundation.DrawBackgroundKt#drawBackground-IZZjS-Q(androidx.ui.core.Modifier, long, androidx.ui.graphics.Shape):
Acronyms should not be capitalized in method names: was `drawBackground-IZZjS-Q`, should this be `drawBackground-IzZjS-Q`?
-AcronymName: androidx.ui.foundation.DrawBorderKt#drawBorder-ik3FbJE(androidx.ui.core.Modifier, androidx.ui.unit.Dp, long, androidx.ui.graphics.Shape):
+AcronymName: androidx.ui.foundation.DrawBorderKt#drawBorder-ik3FbJE(androidx.ui.core.Modifier, float, long, androidx.ui.graphics.Shape):
Acronyms should not be capitalized in method names: was `drawBorder-ik3FbJE`, should this be `drawBorder-ik3FbJe`?
AcronymName: androidx.ui.foundation.shape.corner.CornerBasedShape#createOutline-45bKZN0(androidx.ui.unit.PxSize, float, float, float, float):
Acronyms should not be capitalized in method names: was `createOutline-45bKZN0`, should this be `createOutline-45bKzN0`?
diff --git a/ui/ui-foundation/api/current.txt b/ui/ui-foundation/api/current.txt
index 90b0843..13cf2b5 100644
--- a/ui/ui-foundation/api/current.txt
+++ b/ui/ui-foundation/api/current.txt
@@ -18,14 +18,15 @@
}
public final class BoxKt {
- method public static void Box-TInkGdk(androidx.ui.core.Modifier modifier = Modifier, androidx.ui.graphics.Shape shape = RectangleShape, long backgroundColor = Color.Transparent, androidx.ui.foundation.Border? border = null, float padding = elvis {
- @null var var411925d7: androidx.ui.unit.Dp = border?.size
+ method public static void Box-TInkGdk(androidx.ui.core.Modifier modifier = Modifier, androidx.ui.graphics.Shape shape = androidx.ui.graphics.RectangleShapeKt.RectangleShape, long backgroundColor = Color.Transparent, androidx.ui.foundation.Border? border = null, float padding = elvis {
+ var var411925d7: androidx.ui.unit.Dp = border?.size
if (var411925d7 != null) var411925d7 else 0.dp
}, float paddingStart = Dp.Unspecified, float paddingTop = Dp.Unspecified, float paddingEnd = Dp.Unspecified, float paddingBottom = Dp.Unspecified, androidx.ui.core.Alignment gravity = ContentGravity.TopStart, kotlin.jvm.functions.Function0<kotlin.Unit> children = emptyContent());
}
public final class CanvasKt {
- method public static void Canvas(androidx.ui.core.Modifier modifier, kotlin.jvm.functions.Function1<? super androidx.ui.core.DrawScope,kotlin.Unit> onCanvas);
+ method @Deprecated public static void Canvas(androidx.ui.core.Modifier modifier, kotlin.jvm.functions.Function1<? super androidx.ui.core.DrawScope,kotlin.Unit> onCanvas);
+ method public static void Canvas2(androidx.ui.core.Modifier modifier, kotlin.jvm.functions.Function1<? super androidx.ui.graphics.painter.CanvasScope,kotlin.Unit> block);
}
public final class ClickableKt {
@@ -36,11 +37,6 @@
method public static void ClickableText(androidx.ui.text.AnnotatedString text, androidx.ui.core.Modifier modifier = Modifier, androidx.ui.text.TextStyle style = TextStyle.Default, boolean softWrap = true, androidx.ui.text.style.TextOverflow overflow = TextOverflow.Clip, int maxLines = 2147483647, kotlin.jvm.functions.Function1<? super androidx.ui.text.TextLayoutResult,kotlin.Unit> onTextLayout = {}, kotlin.jvm.functions.Function1<? super java.lang.Integer,kotlin.Unit> onClick);
}
- public final class ColoredRectKt {
- method @Deprecated public static void ColoredRect-HawTZqg(androidx.ui.graphics.Brush brush, androidx.ui.core.Modifier modifier = Modifier, androidx.ui.unit.Dp? width = null, androidx.ui.unit.Dp? height = null);
- method @Deprecated public static void ColoredRect-rR94L9Y(long color, androidx.ui.core.Modifier modifier = Modifier, androidx.ui.unit.Dp? width = null, androidx.ui.unit.Dp? height = null);
- }
-
public final class ContentColorKt {
method public static long contentColor();
method public static androidx.compose.ProvidableAmbient<androidx.ui.graphics.Color> getContentColorAmbient();
@@ -64,11 +60,11 @@
}
public final class DrawBackgroundKt {
- method @Deprecated public static androidx.ui.foundation.DrawBackground DrawBackground(androidx.ui.graphics.Brush brush, androidx.ui.graphics.Shape shape = RectangleShape);
- method @Deprecated public static androidx.ui.foundation.DrawBackground DrawBackground-qSsqlCY(long color, androidx.ui.graphics.Shape shape = RectangleShape);
+ method @Deprecated public static androidx.ui.foundation.DrawBackground DrawBackground(androidx.ui.graphics.Brush brush, androidx.ui.graphics.Shape shape = androidx.ui.graphics.RectangleShapeKt.RectangleShape);
+ method @Deprecated public static androidx.ui.foundation.DrawBackground DrawBackground-qSsqlCY(long color, androidx.ui.graphics.Shape shape = androidx.ui.graphics.RectangleShapeKt.RectangleShape);
method public static androidx.ui.core.Modifier drawBackground(androidx.ui.core.Modifier, androidx.ui.graphics.Paint paint, androidx.ui.graphics.Shape shape);
- method public static androidx.ui.core.Modifier drawBackground(androidx.ui.core.Modifier, androidx.ui.graphics.Brush brush, androidx.ui.graphics.Shape shape = RectangleShape);
- method public static androidx.ui.core.Modifier drawBackground-IZZjS-Q(androidx.ui.core.Modifier, long color, androidx.ui.graphics.Shape shape = RectangleShape);
+ method public static androidx.ui.core.Modifier drawBackground(androidx.ui.core.Modifier, androidx.ui.graphics.Brush brush, androidx.ui.graphics.Shape shape = androidx.ui.graphics.RectangleShapeKt.RectangleShape);
+ method public static androidx.ui.core.Modifier drawBackground-IZZjS-Q(androidx.ui.core.Modifier, long color, androidx.ui.graphics.Shape shape = androidx.ui.graphics.RectangleShapeKt.RectangleShape);
}
public final class DrawBorder implements androidx.ui.core.DrawModifier {
@@ -76,11 +72,11 @@
}
public final class DrawBorderKt {
- method @Deprecated public static androidx.ui.core.Modifier DrawBorder(androidx.ui.foundation.Border border, androidx.ui.graphics.Shape shape = RectangleShape);
+ method @Deprecated public static androidx.ui.core.Modifier DrawBorder(androidx.ui.foundation.Border border, androidx.ui.graphics.Shape shape = androidx.ui.graphics.RectangleShapeKt.RectangleShape);
method @Deprecated public static androidx.ui.foundation.DrawBorder DrawBorder-3vYgddY(float size, androidx.ui.graphics.Brush brush, androidx.ui.graphics.Shape shape);
- method @Deprecated public static androidx.ui.core.Modifier DrawBorder-Wounw_8(float size, long color, androidx.ui.graphics.Shape shape = RectangleShape);
- method public static androidx.ui.core.Modifier drawBorder(androidx.ui.core.Modifier, androidx.ui.foundation.Border border, androidx.ui.graphics.Shape shape = RectangleShape);
- method public static androidx.ui.core.Modifier drawBorder-ik3FbJE(androidx.ui.core.Modifier, float size, long color, androidx.ui.graphics.Shape shape = RectangleShape);
+ method @Deprecated public static androidx.ui.core.Modifier DrawBorder-Wounw_8(float size, long color, androidx.ui.graphics.Shape shape = androidx.ui.graphics.RectangleShapeKt.RectangleShape);
+ method public static androidx.ui.core.Modifier drawBorder(androidx.ui.core.Modifier, androidx.ui.foundation.Border border, androidx.ui.graphics.Shape shape = androidx.ui.graphics.RectangleShapeKt.RectangleShape);
+ method public static androidx.ui.core.Modifier drawBorder-ik3FbJE(androidx.ui.core.Modifier, float size, long color, androidx.ui.graphics.Shape shape = androidx.ui.graphics.RectangleShapeKt.RectangleShape);
method public static androidx.ui.core.Modifier drawBorder-vGsXmEw(androidx.ui.core.Modifier, float size, androidx.ui.graphics.Brush brush, androidx.ui.graphics.Shape shape);
}
@@ -169,7 +165,7 @@
}
public final class TextFieldKt {
- method public static void TextField-j3NKU0o(androidx.ui.foundation.TextFieldValue value, kotlin.jvm.functions.Function1<? super androidx.ui.foundation.TextFieldValue,kotlin.Unit> onValueChange, androidx.ui.core.Modifier modifier = Modifier, androidx.ui.core.input.FocusNode? focusNode = null, long textColor = Color.Unset, androidx.ui.text.TextStyle textStyle = currentTextStyle(), androidx.ui.input.KeyboardType keyboardType = KeyboardType.Text, androidx.ui.input.ImeAction imeAction = ImeAction.Unspecified, kotlin.jvm.functions.Function1<? super java.lang.Boolean,kotlin.Unit> onFocusChange = {}, kotlin.jvm.functions.Function1<? super androidx.ui.input.ImeAction,kotlin.Unit> onImeActionPerformed = {}, androidx.ui.input.VisualTransformation? visualTransformation = null, kotlin.jvm.functions.Function1<? super androidx.ui.text.TextLayoutResult,kotlin.Unit> onTextLayout = {}, kotlin.jvm.functions.Function1<? super androidx.ui.text.SoftwareKeyboardController,kotlin.Unit> onTextInputStarted = {});
+ method public static void TextField-4vuTNO4(androidx.ui.foundation.TextFieldValue value, kotlin.jvm.functions.Function1<? super androidx.ui.foundation.TextFieldValue,kotlin.Unit> onValueChange, androidx.ui.core.Modifier modifier = Modifier, androidx.ui.core.input.FocusNode? focusNode = null, long textColor = Color.Unset, androidx.ui.text.TextStyle textStyle = currentTextStyle(), androidx.ui.input.KeyboardType keyboardType = KeyboardType.Text, androidx.ui.input.ImeAction imeAction = ImeAction.Unspecified, kotlin.jvm.functions.Function1<? super java.lang.Boolean,kotlin.Unit> onFocusChange = {}, kotlin.jvm.functions.Function1<? super androidx.ui.input.ImeAction,kotlin.Unit> onImeActionPerformed = {}, androidx.ui.input.VisualTransformation? visualTransformation = null, kotlin.jvm.functions.Function1<? super androidx.ui.text.TextLayoutResult,kotlin.Unit> onTextLayout = {}, kotlin.jvm.functions.Function1<? super androidx.ui.text.SoftwareKeyboardController,kotlin.Unit> onTextInputStarted = {}, long cursorColor = contentColor());
}
public final class TextFieldValue {
@@ -266,7 +262,7 @@
public final class FlingConfigKt {
method public static androidx.ui.foundation.animation.FlingConfig AnchorsFlingConfig(java.util.List<java.lang.Float> anchors, androidx.animation.AnimationBuilder<java.lang.Float> animationBuilder = androidx.animation.PhysicsBuilder(), kotlin.jvm.functions.Function3<? super androidx.animation.AnimationEndReason,? super java.lang.Float,? super java.lang.Float,kotlin.Unit>? onAnimationEnd = null, androidx.animation.DecayAnimation decayAnimation = androidx.animation.ExponentialDecay());
- method public static androidx.ui.foundation.animation.FlingConfig FlingConfig(kotlin.jvm.functions.Function3<? super androidx.animation.AnimationEndReason,? super java.lang.Float,? super java.lang.Float,kotlin.Unit>? onAnimationEnd = null, kotlin.jvm.functions.Function1<? super java.lang.Float,androidx.animation.TargetAnimation> adjustTarget = { null });
+ method public static androidx.ui.foundation.animation.FlingConfig FlingConfig(kotlin.jvm.functions.Function3<? super androidx.animation.AnimationEndReason,? super java.lang.Float,? super java.lang.Float,kotlin.Unit>? onAnimationEnd = null, kotlin.jvm.functions.Function1<? super java.lang.Float,androidx.animation.TargetAnimation> adjustTarget = { return null });
method public static void fling(androidx.animation.AnimatedFloat, androidx.ui.foundation.animation.FlingConfig config, float startVelocity);
}
diff --git a/ui/ui-foundation/api/public_plus_experimental_0.1.0-dev11.txt b/ui/ui-foundation/api/public_plus_experimental_0.1.0-dev11.txt
index 90b0843..13cf2b5 100644
--- a/ui/ui-foundation/api/public_plus_experimental_0.1.0-dev11.txt
+++ b/ui/ui-foundation/api/public_plus_experimental_0.1.0-dev11.txt
@@ -18,14 +18,15 @@
}
public final class BoxKt {
- method public static void Box-TInkGdk(androidx.ui.core.Modifier modifier = Modifier, androidx.ui.graphics.Shape shape = RectangleShape, long backgroundColor = Color.Transparent, androidx.ui.foundation.Border? border = null, float padding = elvis {
- @null var var411925d7: androidx.ui.unit.Dp = border?.size
+ method public static void Box-TInkGdk(androidx.ui.core.Modifier modifier = Modifier, androidx.ui.graphics.Shape shape = androidx.ui.graphics.RectangleShapeKt.RectangleShape, long backgroundColor = Color.Transparent, androidx.ui.foundation.Border? border = null, float padding = elvis {
+ var var411925d7: androidx.ui.unit.Dp = border?.size
if (var411925d7 != null) var411925d7 else 0.dp
}, float paddingStart = Dp.Unspecified, float paddingTop = Dp.Unspecified, float paddingEnd = Dp.Unspecified, float paddingBottom = Dp.Unspecified, androidx.ui.core.Alignment gravity = ContentGravity.TopStart, kotlin.jvm.functions.Function0<kotlin.Unit> children = emptyContent());
}
public final class CanvasKt {
- method public static void Canvas(androidx.ui.core.Modifier modifier, kotlin.jvm.functions.Function1<? super androidx.ui.core.DrawScope,kotlin.Unit> onCanvas);
+ method @Deprecated public static void Canvas(androidx.ui.core.Modifier modifier, kotlin.jvm.functions.Function1<? super androidx.ui.core.DrawScope,kotlin.Unit> onCanvas);
+ method public static void Canvas2(androidx.ui.core.Modifier modifier, kotlin.jvm.functions.Function1<? super androidx.ui.graphics.painter.CanvasScope,kotlin.Unit> block);
}
public final class ClickableKt {
@@ -36,11 +37,6 @@
method public static void ClickableText(androidx.ui.text.AnnotatedString text, androidx.ui.core.Modifier modifier = Modifier, androidx.ui.text.TextStyle style = TextStyle.Default, boolean softWrap = true, androidx.ui.text.style.TextOverflow overflow = TextOverflow.Clip, int maxLines = 2147483647, kotlin.jvm.functions.Function1<? super androidx.ui.text.TextLayoutResult,kotlin.Unit> onTextLayout = {}, kotlin.jvm.functions.Function1<? super java.lang.Integer,kotlin.Unit> onClick);
}
- public final class ColoredRectKt {
- method @Deprecated public static void ColoredRect-HawTZqg(androidx.ui.graphics.Brush brush, androidx.ui.core.Modifier modifier = Modifier, androidx.ui.unit.Dp? width = null, androidx.ui.unit.Dp? height = null);
- method @Deprecated public static void ColoredRect-rR94L9Y(long color, androidx.ui.core.Modifier modifier = Modifier, androidx.ui.unit.Dp? width = null, androidx.ui.unit.Dp? height = null);
- }
-
public final class ContentColorKt {
method public static long contentColor();
method public static androidx.compose.ProvidableAmbient<androidx.ui.graphics.Color> getContentColorAmbient();
@@ -64,11 +60,11 @@
}
public final class DrawBackgroundKt {
- method @Deprecated public static androidx.ui.foundation.DrawBackground DrawBackground(androidx.ui.graphics.Brush brush, androidx.ui.graphics.Shape shape = RectangleShape);
- method @Deprecated public static androidx.ui.foundation.DrawBackground DrawBackground-qSsqlCY(long color, androidx.ui.graphics.Shape shape = RectangleShape);
+ method @Deprecated public static androidx.ui.foundation.DrawBackground DrawBackground(androidx.ui.graphics.Brush brush, androidx.ui.graphics.Shape shape = androidx.ui.graphics.RectangleShapeKt.RectangleShape);
+ method @Deprecated public static androidx.ui.foundation.DrawBackground DrawBackground-qSsqlCY(long color, androidx.ui.graphics.Shape shape = androidx.ui.graphics.RectangleShapeKt.RectangleShape);
method public static androidx.ui.core.Modifier drawBackground(androidx.ui.core.Modifier, androidx.ui.graphics.Paint paint, androidx.ui.graphics.Shape shape);
- method public static androidx.ui.core.Modifier drawBackground(androidx.ui.core.Modifier, androidx.ui.graphics.Brush brush, androidx.ui.graphics.Shape shape = RectangleShape);
- method public static androidx.ui.core.Modifier drawBackground-IZZjS-Q(androidx.ui.core.Modifier, long color, androidx.ui.graphics.Shape shape = RectangleShape);
+ method public static androidx.ui.core.Modifier drawBackground(androidx.ui.core.Modifier, androidx.ui.graphics.Brush brush, androidx.ui.graphics.Shape shape = androidx.ui.graphics.RectangleShapeKt.RectangleShape);
+ method public static androidx.ui.core.Modifier drawBackground-IZZjS-Q(androidx.ui.core.Modifier, long color, androidx.ui.graphics.Shape shape = androidx.ui.graphics.RectangleShapeKt.RectangleShape);
}
public final class DrawBorder implements androidx.ui.core.DrawModifier {
@@ -76,11 +72,11 @@
}
public final class DrawBorderKt {
- method @Deprecated public static androidx.ui.core.Modifier DrawBorder(androidx.ui.foundation.Border border, androidx.ui.graphics.Shape shape = RectangleShape);
+ method @Deprecated public static androidx.ui.core.Modifier DrawBorder(androidx.ui.foundation.Border border, androidx.ui.graphics.Shape shape = androidx.ui.graphics.RectangleShapeKt.RectangleShape);
method @Deprecated public static androidx.ui.foundation.DrawBorder DrawBorder-3vYgddY(float size, androidx.ui.graphics.Brush brush, androidx.ui.graphics.Shape shape);
- method @Deprecated public static androidx.ui.core.Modifier DrawBorder-Wounw_8(float size, long color, androidx.ui.graphics.Shape shape = RectangleShape);
- method public static androidx.ui.core.Modifier drawBorder(androidx.ui.core.Modifier, androidx.ui.foundation.Border border, androidx.ui.graphics.Shape shape = RectangleShape);
- method public static androidx.ui.core.Modifier drawBorder-ik3FbJE(androidx.ui.core.Modifier, float size, long color, androidx.ui.graphics.Shape shape = RectangleShape);
+ method @Deprecated public static androidx.ui.core.Modifier DrawBorder-Wounw_8(float size, long color, androidx.ui.graphics.Shape shape = androidx.ui.graphics.RectangleShapeKt.RectangleShape);
+ method public static androidx.ui.core.Modifier drawBorder(androidx.ui.core.Modifier, androidx.ui.foundation.Border border, androidx.ui.graphics.Shape shape = androidx.ui.graphics.RectangleShapeKt.RectangleShape);
+ method public static androidx.ui.core.Modifier drawBorder-ik3FbJE(androidx.ui.core.Modifier, float size, long color, androidx.ui.graphics.Shape shape = androidx.ui.graphics.RectangleShapeKt.RectangleShape);
method public static androidx.ui.core.Modifier drawBorder-vGsXmEw(androidx.ui.core.Modifier, float size, androidx.ui.graphics.Brush brush, androidx.ui.graphics.Shape shape);
}
@@ -169,7 +165,7 @@
}
public final class TextFieldKt {
- method public static void TextField-j3NKU0o(androidx.ui.foundation.TextFieldValue value, kotlin.jvm.functions.Function1<? super androidx.ui.foundation.TextFieldValue,kotlin.Unit> onValueChange, androidx.ui.core.Modifier modifier = Modifier, androidx.ui.core.input.FocusNode? focusNode = null, long textColor = Color.Unset, androidx.ui.text.TextStyle textStyle = currentTextStyle(), androidx.ui.input.KeyboardType keyboardType = KeyboardType.Text, androidx.ui.input.ImeAction imeAction = ImeAction.Unspecified, kotlin.jvm.functions.Function1<? super java.lang.Boolean,kotlin.Unit> onFocusChange = {}, kotlin.jvm.functions.Function1<? super androidx.ui.input.ImeAction,kotlin.Unit> onImeActionPerformed = {}, androidx.ui.input.VisualTransformation? visualTransformation = null, kotlin.jvm.functions.Function1<? super androidx.ui.text.TextLayoutResult,kotlin.Unit> onTextLayout = {}, kotlin.jvm.functions.Function1<? super androidx.ui.text.SoftwareKeyboardController,kotlin.Unit> onTextInputStarted = {});
+ method public static void TextField-4vuTNO4(androidx.ui.foundation.TextFieldValue value, kotlin.jvm.functions.Function1<? super androidx.ui.foundation.TextFieldValue,kotlin.Unit> onValueChange, androidx.ui.core.Modifier modifier = Modifier, androidx.ui.core.input.FocusNode? focusNode = null, long textColor = Color.Unset, androidx.ui.text.TextStyle textStyle = currentTextStyle(), androidx.ui.input.KeyboardType keyboardType = KeyboardType.Text, androidx.ui.input.ImeAction imeAction = ImeAction.Unspecified, kotlin.jvm.functions.Function1<? super java.lang.Boolean,kotlin.Unit> onFocusChange = {}, kotlin.jvm.functions.Function1<? super androidx.ui.input.ImeAction,kotlin.Unit> onImeActionPerformed = {}, androidx.ui.input.VisualTransformation? visualTransformation = null, kotlin.jvm.functions.Function1<? super androidx.ui.text.TextLayoutResult,kotlin.Unit> onTextLayout = {}, kotlin.jvm.functions.Function1<? super androidx.ui.text.SoftwareKeyboardController,kotlin.Unit> onTextInputStarted = {}, long cursorColor = contentColor());
}
public final class TextFieldValue {
@@ -266,7 +262,7 @@
public final class FlingConfigKt {
method public static androidx.ui.foundation.animation.FlingConfig AnchorsFlingConfig(java.util.List<java.lang.Float> anchors, androidx.animation.AnimationBuilder<java.lang.Float> animationBuilder = androidx.animation.PhysicsBuilder(), kotlin.jvm.functions.Function3<? super androidx.animation.AnimationEndReason,? super java.lang.Float,? super java.lang.Float,kotlin.Unit>? onAnimationEnd = null, androidx.animation.DecayAnimation decayAnimation = androidx.animation.ExponentialDecay());
- method public static androidx.ui.foundation.animation.FlingConfig FlingConfig(kotlin.jvm.functions.Function3<? super androidx.animation.AnimationEndReason,? super java.lang.Float,? super java.lang.Float,kotlin.Unit>? onAnimationEnd = null, kotlin.jvm.functions.Function1<? super java.lang.Float,androidx.animation.TargetAnimation> adjustTarget = { null });
+ method public static androidx.ui.foundation.animation.FlingConfig FlingConfig(kotlin.jvm.functions.Function3<? super androidx.animation.AnimationEndReason,? super java.lang.Float,? super java.lang.Float,kotlin.Unit>? onAnimationEnd = null, kotlin.jvm.functions.Function1<? super java.lang.Float,androidx.animation.TargetAnimation> adjustTarget = { return null });
method public static void fling(androidx.animation.AnimatedFloat, androidx.ui.foundation.animation.FlingConfig config, float startVelocity);
}
diff --git a/ui/ui-foundation/api/public_plus_experimental_current.txt b/ui/ui-foundation/api/public_plus_experimental_current.txt
index 90b0843..13cf2b5 100644
--- a/ui/ui-foundation/api/public_plus_experimental_current.txt
+++ b/ui/ui-foundation/api/public_plus_experimental_current.txt
@@ -18,14 +18,15 @@
}
public final class BoxKt {
- method public static void Box-TInkGdk(androidx.ui.core.Modifier modifier = Modifier, androidx.ui.graphics.Shape shape = RectangleShape, long backgroundColor = Color.Transparent, androidx.ui.foundation.Border? border = null, float padding = elvis {
- @null var var411925d7: androidx.ui.unit.Dp = border?.size
+ method public static void Box-TInkGdk(androidx.ui.core.Modifier modifier = Modifier, androidx.ui.graphics.Shape shape = androidx.ui.graphics.RectangleShapeKt.RectangleShape, long backgroundColor = Color.Transparent, androidx.ui.foundation.Border? border = null, float padding = elvis {
+ var var411925d7: androidx.ui.unit.Dp = border?.size
if (var411925d7 != null) var411925d7 else 0.dp
}, float paddingStart = Dp.Unspecified, float paddingTop = Dp.Unspecified, float paddingEnd = Dp.Unspecified, float paddingBottom = Dp.Unspecified, androidx.ui.core.Alignment gravity = ContentGravity.TopStart, kotlin.jvm.functions.Function0<kotlin.Unit> children = emptyContent());
}
public final class CanvasKt {
- method public static void Canvas(androidx.ui.core.Modifier modifier, kotlin.jvm.functions.Function1<? super androidx.ui.core.DrawScope,kotlin.Unit> onCanvas);
+ method @Deprecated public static void Canvas(androidx.ui.core.Modifier modifier, kotlin.jvm.functions.Function1<? super androidx.ui.core.DrawScope,kotlin.Unit> onCanvas);
+ method public static void Canvas2(androidx.ui.core.Modifier modifier, kotlin.jvm.functions.Function1<? super androidx.ui.graphics.painter.CanvasScope,kotlin.Unit> block);
}
public final class ClickableKt {
@@ -36,11 +37,6 @@
method public static void ClickableText(androidx.ui.text.AnnotatedString text, androidx.ui.core.Modifier modifier = Modifier, androidx.ui.text.TextStyle style = TextStyle.Default, boolean softWrap = true, androidx.ui.text.style.TextOverflow overflow = TextOverflow.Clip, int maxLines = 2147483647, kotlin.jvm.functions.Function1<? super androidx.ui.text.TextLayoutResult,kotlin.Unit> onTextLayout = {}, kotlin.jvm.functions.Function1<? super java.lang.Integer,kotlin.Unit> onClick);
}
- public final class ColoredRectKt {
- method @Deprecated public static void ColoredRect-HawTZqg(androidx.ui.graphics.Brush brush, androidx.ui.core.Modifier modifier = Modifier, androidx.ui.unit.Dp? width = null, androidx.ui.unit.Dp? height = null);
- method @Deprecated public static void ColoredRect-rR94L9Y(long color, androidx.ui.core.Modifier modifier = Modifier, androidx.ui.unit.Dp? width = null, androidx.ui.unit.Dp? height = null);
- }
-
public final class ContentColorKt {
method public static long contentColor();
method public static androidx.compose.ProvidableAmbient<androidx.ui.graphics.Color> getContentColorAmbient();
@@ -64,11 +60,11 @@
}
public final class DrawBackgroundKt {
- method @Deprecated public static androidx.ui.foundation.DrawBackground DrawBackground(androidx.ui.graphics.Brush brush, androidx.ui.graphics.Shape shape = RectangleShape);
- method @Deprecated public static androidx.ui.foundation.DrawBackground DrawBackground-qSsqlCY(long color, androidx.ui.graphics.Shape shape = RectangleShape);
+ method @Deprecated public static androidx.ui.foundation.DrawBackground DrawBackground(androidx.ui.graphics.Brush brush, androidx.ui.graphics.Shape shape = androidx.ui.graphics.RectangleShapeKt.RectangleShape);
+ method @Deprecated public static androidx.ui.foundation.DrawBackground DrawBackground-qSsqlCY(long color, androidx.ui.graphics.Shape shape = androidx.ui.graphics.RectangleShapeKt.RectangleShape);
method public static androidx.ui.core.Modifier drawBackground(androidx.ui.core.Modifier, androidx.ui.graphics.Paint paint, androidx.ui.graphics.Shape shape);
- method public static androidx.ui.core.Modifier drawBackground(androidx.ui.core.Modifier, androidx.ui.graphics.Brush brush, androidx.ui.graphics.Shape shape = RectangleShape);
- method public static androidx.ui.core.Modifier drawBackground-IZZjS-Q(androidx.ui.core.Modifier, long color, androidx.ui.graphics.Shape shape = RectangleShape);
+ method public static androidx.ui.core.Modifier drawBackground(androidx.ui.core.Modifier, androidx.ui.graphics.Brush brush, androidx.ui.graphics.Shape shape = androidx.ui.graphics.RectangleShapeKt.RectangleShape);
+ method public static androidx.ui.core.Modifier drawBackground-IZZjS-Q(androidx.ui.core.Modifier, long color, androidx.ui.graphics.Shape shape = androidx.ui.graphics.RectangleShapeKt.RectangleShape);
}
public final class DrawBorder implements androidx.ui.core.DrawModifier {
@@ -76,11 +72,11 @@
}
public final class DrawBorderKt {
- method @Deprecated public static androidx.ui.core.Modifier DrawBorder(androidx.ui.foundation.Border border, androidx.ui.graphics.Shape shape = RectangleShape);
+ method @Deprecated public static androidx.ui.core.Modifier DrawBorder(androidx.ui.foundation.Border border, androidx.ui.graphics.Shape shape = androidx.ui.graphics.RectangleShapeKt.RectangleShape);
method @Deprecated public static androidx.ui.foundation.DrawBorder DrawBorder-3vYgddY(float size, androidx.ui.graphics.Brush brush, androidx.ui.graphics.Shape shape);
- method @Deprecated public static androidx.ui.core.Modifier DrawBorder-Wounw_8(float size, long color, androidx.ui.graphics.Shape shape = RectangleShape);
- method public static androidx.ui.core.Modifier drawBorder(androidx.ui.core.Modifier, androidx.ui.foundation.Border border, androidx.ui.graphics.Shape shape = RectangleShape);
- method public static androidx.ui.core.Modifier drawBorder-ik3FbJE(androidx.ui.core.Modifier, float size, long color, androidx.ui.graphics.Shape shape = RectangleShape);
+ method @Deprecated public static androidx.ui.core.Modifier DrawBorder-Wounw_8(float size, long color, androidx.ui.graphics.Shape shape = androidx.ui.graphics.RectangleShapeKt.RectangleShape);
+ method public static androidx.ui.core.Modifier drawBorder(androidx.ui.core.Modifier, androidx.ui.foundation.Border border, androidx.ui.graphics.Shape shape = androidx.ui.graphics.RectangleShapeKt.RectangleShape);
+ method public static androidx.ui.core.Modifier drawBorder-ik3FbJE(androidx.ui.core.Modifier, float size, long color, androidx.ui.graphics.Shape shape = androidx.ui.graphics.RectangleShapeKt.RectangleShape);
method public static androidx.ui.core.Modifier drawBorder-vGsXmEw(androidx.ui.core.Modifier, float size, androidx.ui.graphics.Brush brush, androidx.ui.graphics.Shape shape);
}
@@ -169,7 +165,7 @@
}
public final class TextFieldKt {
- method public static void TextField-j3NKU0o(androidx.ui.foundation.TextFieldValue value, kotlin.jvm.functions.Function1<? super androidx.ui.foundation.TextFieldValue,kotlin.Unit> onValueChange, androidx.ui.core.Modifier modifier = Modifier, androidx.ui.core.input.FocusNode? focusNode = null, long textColor = Color.Unset, androidx.ui.text.TextStyle textStyle = currentTextStyle(), androidx.ui.input.KeyboardType keyboardType = KeyboardType.Text, androidx.ui.input.ImeAction imeAction = ImeAction.Unspecified, kotlin.jvm.functions.Function1<? super java.lang.Boolean,kotlin.Unit> onFocusChange = {}, kotlin.jvm.functions.Function1<? super androidx.ui.input.ImeAction,kotlin.Unit> onImeActionPerformed = {}, androidx.ui.input.VisualTransformation? visualTransformation = null, kotlin.jvm.functions.Function1<? super androidx.ui.text.TextLayoutResult,kotlin.Unit> onTextLayout = {}, kotlin.jvm.functions.Function1<? super androidx.ui.text.SoftwareKeyboardController,kotlin.Unit> onTextInputStarted = {});
+ method public static void TextField-4vuTNO4(androidx.ui.foundation.TextFieldValue value, kotlin.jvm.functions.Function1<? super androidx.ui.foundation.TextFieldValue,kotlin.Unit> onValueChange, androidx.ui.core.Modifier modifier = Modifier, androidx.ui.core.input.FocusNode? focusNode = null, long textColor = Color.Unset, androidx.ui.text.TextStyle textStyle = currentTextStyle(), androidx.ui.input.KeyboardType keyboardType = KeyboardType.Text, androidx.ui.input.ImeAction imeAction = ImeAction.Unspecified, kotlin.jvm.functions.Function1<? super java.lang.Boolean,kotlin.Unit> onFocusChange = {}, kotlin.jvm.functions.Function1<? super androidx.ui.input.ImeAction,kotlin.Unit> onImeActionPerformed = {}, androidx.ui.input.VisualTransformation? visualTransformation = null, kotlin.jvm.functions.Function1<? super androidx.ui.text.TextLayoutResult,kotlin.Unit> onTextLayout = {}, kotlin.jvm.functions.Function1<? super androidx.ui.text.SoftwareKeyboardController,kotlin.Unit> onTextInputStarted = {}, long cursorColor = contentColor());
}
public final class TextFieldValue {
@@ -266,7 +262,7 @@
public final class FlingConfigKt {
method public static androidx.ui.foundation.animation.FlingConfig AnchorsFlingConfig(java.util.List<java.lang.Float> anchors, androidx.animation.AnimationBuilder<java.lang.Float> animationBuilder = androidx.animation.PhysicsBuilder(), kotlin.jvm.functions.Function3<? super androidx.animation.AnimationEndReason,? super java.lang.Float,? super java.lang.Float,kotlin.Unit>? onAnimationEnd = null, androidx.animation.DecayAnimation decayAnimation = androidx.animation.ExponentialDecay());
- method public static androidx.ui.foundation.animation.FlingConfig FlingConfig(kotlin.jvm.functions.Function3<? super androidx.animation.AnimationEndReason,? super java.lang.Float,? super java.lang.Float,kotlin.Unit>? onAnimationEnd = null, kotlin.jvm.functions.Function1<? super java.lang.Float,androidx.animation.TargetAnimation> adjustTarget = { null });
+ method public static androidx.ui.foundation.animation.FlingConfig FlingConfig(kotlin.jvm.functions.Function3<? super androidx.animation.AnimationEndReason,? super java.lang.Float,? super java.lang.Float,kotlin.Unit>? onAnimationEnd = null, kotlin.jvm.functions.Function1<? super java.lang.Float,androidx.animation.TargetAnimation> adjustTarget = { return null });
method public static void fling(androidx.animation.AnimatedFloat, androidx.ui.foundation.animation.FlingConfig config, float startVelocity);
}
diff --git a/ui/ui-foundation/api/restricted_0.1.0-dev11.txt b/ui/ui-foundation/api/restricted_0.1.0-dev11.txt
index 90b0843..13cf2b5 100644
--- a/ui/ui-foundation/api/restricted_0.1.0-dev11.txt
+++ b/ui/ui-foundation/api/restricted_0.1.0-dev11.txt
@@ -18,14 +18,15 @@
}
public final class BoxKt {
- method public static void Box-TInkGdk(androidx.ui.core.Modifier modifier = Modifier, androidx.ui.graphics.Shape shape = RectangleShape, long backgroundColor = Color.Transparent, androidx.ui.foundation.Border? border = null, float padding = elvis {
- @null var var411925d7: androidx.ui.unit.Dp = border?.size
+ method public static void Box-TInkGdk(androidx.ui.core.Modifier modifier = Modifier, androidx.ui.graphics.Shape shape = androidx.ui.graphics.RectangleShapeKt.RectangleShape, long backgroundColor = Color.Transparent, androidx.ui.foundation.Border? border = null, float padding = elvis {
+ var var411925d7: androidx.ui.unit.Dp = border?.size
if (var411925d7 != null) var411925d7 else 0.dp
}, float paddingStart = Dp.Unspecified, float paddingTop = Dp.Unspecified, float paddingEnd = Dp.Unspecified, float paddingBottom = Dp.Unspecified, androidx.ui.core.Alignment gravity = ContentGravity.TopStart, kotlin.jvm.functions.Function0<kotlin.Unit> children = emptyContent());
}
public final class CanvasKt {
- method public static void Canvas(androidx.ui.core.Modifier modifier, kotlin.jvm.functions.Function1<? super androidx.ui.core.DrawScope,kotlin.Unit> onCanvas);
+ method @Deprecated public static void Canvas(androidx.ui.core.Modifier modifier, kotlin.jvm.functions.Function1<? super androidx.ui.core.DrawScope,kotlin.Unit> onCanvas);
+ method public static void Canvas2(androidx.ui.core.Modifier modifier, kotlin.jvm.functions.Function1<? super androidx.ui.graphics.painter.CanvasScope,kotlin.Unit> block);
}
public final class ClickableKt {
@@ -36,11 +37,6 @@
method public static void ClickableText(androidx.ui.text.AnnotatedString text, androidx.ui.core.Modifier modifier = Modifier, androidx.ui.text.TextStyle style = TextStyle.Default, boolean softWrap = true, androidx.ui.text.style.TextOverflow overflow = TextOverflow.Clip, int maxLines = 2147483647, kotlin.jvm.functions.Function1<? super androidx.ui.text.TextLayoutResult,kotlin.Unit> onTextLayout = {}, kotlin.jvm.functions.Function1<? super java.lang.Integer,kotlin.Unit> onClick);
}
- public final class ColoredRectKt {
- method @Deprecated public static void ColoredRect-HawTZqg(androidx.ui.graphics.Brush brush, androidx.ui.core.Modifier modifier = Modifier, androidx.ui.unit.Dp? width = null, androidx.ui.unit.Dp? height = null);
- method @Deprecated public static void ColoredRect-rR94L9Y(long color, androidx.ui.core.Modifier modifier = Modifier, androidx.ui.unit.Dp? width = null, androidx.ui.unit.Dp? height = null);
- }
-
public final class ContentColorKt {
method public static long contentColor();
method public static androidx.compose.ProvidableAmbient<androidx.ui.graphics.Color> getContentColorAmbient();
@@ -64,11 +60,11 @@
}
public final class DrawBackgroundKt {
- method @Deprecated public static androidx.ui.foundation.DrawBackground DrawBackground(androidx.ui.graphics.Brush brush, androidx.ui.graphics.Shape shape = RectangleShape);
- method @Deprecated public static androidx.ui.foundation.DrawBackground DrawBackground-qSsqlCY(long color, androidx.ui.graphics.Shape shape = RectangleShape);
+ method @Deprecated public static androidx.ui.foundation.DrawBackground DrawBackground(androidx.ui.graphics.Brush brush, androidx.ui.graphics.Shape shape = androidx.ui.graphics.RectangleShapeKt.RectangleShape);
+ method @Deprecated public static androidx.ui.foundation.DrawBackground DrawBackground-qSsqlCY(long color, androidx.ui.graphics.Shape shape = androidx.ui.graphics.RectangleShapeKt.RectangleShape);
method public static androidx.ui.core.Modifier drawBackground(androidx.ui.core.Modifier, androidx.ui.graphics.Paint paint, androidx.ui.graphics.Shape shape);
- method public static androidx.ui.core.Modifier drawBackground(androidx.ui.core.Modifier, androidx.ui.graphics.Brush brush, androidx.ui.graphics.Shape shape = RectangleShape);
- method public static androidx.ui.core.Modifier drawBackground-IZZjS-Q(androidx.ui.core.Modifier, long color, androidx.ui.graphics.Shape shape = RectangleShape);
+ method public static androidx.ui.core.Modifier drawBackground(androidx.ui.core.Modifier, androidx.ui.graphics.Brush brush, androidx.ui.graphics.Shape shape = androidx.ui.graphics.RectangleShapeKt.RectangleShape);
+ method public static androidx.ui.core.Modifier drawBackground-IZZjS-Q(androidx.ui.core.Modifier, long color, androidx.ui.graphics.Shape shape = androidx.ui.graphics.RectangleShapeKt.RectangleShape);
}
public final class DrawBorder implements androidx.ui.core.DrawModifier {
@@ -76,11 +72,11 @@
}
public final class DrawBorderKt {
- method @Deprecated public static androidx.ui.core.Modifier DrawBorder(androidx.ui.foundation.Border border, androidx.ui.graphics.Shape shape = RectangleShape);
+ method @Deprecated public static androidx.ui.core.Modifier DrawBorder(androidx.ui.foundation.Border border, androidx.ui.graphics.Shape shape = androidx.ui.graphics.RectangleShapeKt.RectangleShape);
method @Deprecated public static androidx.ui.foundation.DrawBorder DrawBorder-3vYgddY(float size, androidx.ui.graphics.Brush brush, androidx.ui.graphics.Shape shape);
- method @Deprecated public static androidx.ui.core.Modifier DrawBorder-Wounw_8(float size, long color, androidx.ui.graphics.Shape shape = RectangleShape);
- method public static androidx.ui.core.Modifier drawBorder(androidx.ui.core.Modifier, androidx.ui.foundation.Border border, androidx.ui.graphics.Shape shape = RectangleShape);
- method public static androidx.ui.core.Modifier drawBorder-ik3FbJE(androidx.ui.core.Modifier, float size, long color, androidx.ui.graphics.Shape shape = RectangleShape);
+ method @Deprecated public static androidx.ui.core.Modifier DrawBorder-Wounw_8(float size, long color, androidx.ui.graphics.Shape shape = androidx.ui.graphics.RectangleShapeKt.RectangleShape);
+ method public static androidx.ui.core.Modifier drawBorder(androidx.ui.core.Modifier, androidx.ui.foundation.Border border, androidx.ui.graphics.Shape shape = androidx.ui.graphics.RectangleShapeKt.RectangleShape);
+ method public static androidx.ui.core.Modifier drawBorder-ik3FbJE(androidx.ui.core.Modifier, float size, long color, androidx.ui.graphics.Shape shape = androidx.ui.graphics.RectangleShapeKt.RectangleShape);
method public static androidx.ui.core.Modifier drawBorder-vGsXmEw(androidx.ui.core.Modifier, float size, androidx.ui.graphics.Brush brush, androidx.ui.graphics.Shape shape);
}
@@ -169,7 +165,7 @@
}
public final class TextFieldKt {
- method public static void TextField-j3NKU0o(androidx.ui.foundation.TextFieldValue value, kotlin.jvm.functions.Function1<? super androidx.ui.foundation.TextFieldValue,kotlin.Unit> onValueChange, androidx.ui.core.Modifier modifier = Modifier, androidx.ui.core.input.FocusNode? focusNode = null, long textColor = Color.Unset, androidx.ui.text.TextStyle textStyle = currentTextStyle(), androidx.ui.input.KeyboardType keyboardType = KeyboardType.Text, androidx.ui.input.ImeAction imeAction = ImeAction.Unspecified, kotlin.jvm.functions.Function1<? super java.lang.Boolean,kotlin.Unit> onFocusChange = {}, kotlin.jvm.functions.Function1<? super androidx.ui.input.ImeAction,kotlin.Unit> onImeActionPerformed = {}, androidx.ui.input.VisualTransformation? visualTransformation = null, kotlin.jvm.functions.Function1<? super androidx.ui.text.TextLayoutResult,kotlin.Unit> onTextLayout = {}, kotlin.jvm.functions.Function1<? super androidx.ui.text.SoftwareKeyboardController,kotlin.Unit> onTextInputStarted = {});
+ method public static void TextField-4vuTNO4(androidx.ui.foundation.TextFieldValue value, kotlin.jvm.functions.Function1<? super androidx.ui.foundation.TextFieldValue,kotlin.Unit> onValueChange, androidx.ui.core.Modifier modifier = Modifier, androidx.ui.core.input.FocusNode? focusNode = null, long textColor = Color.Unset, androidx.ui.text.TextStyle textStyle = currentTextStyle(), androidx.ui.input.KeyboardType keyboardType = KeyboardType.Text, androidx.ui.input.ImeAction imeAction = ImeAction.Unspecified, kotlin.jvm.functions.Function1<? super java.lang.Boolean,kotlin.Unit> onFocusChange = {}, kotlin.jvm.functions.Function1<? super androidx.ui.input.ImeAction,kotlin.Unit> onImeActionPerformed = {}, androidx.ui.input.VisualTransformation? visualTransformation = null, kotlin.jvm.functions.Function1<? super androidx.ui.text.TextLayoutResult,kotlin.Unit> onTextLayout = {}, kotlin.jvm.functions.Function1<? super androidx.ui.text.SoftwareKeyboardController,kotlin.Unit> onTextInputStarted = {}, long cursorColor = contentColor());
}
public final class TextFieldValue {
@@ -266,7 +262,7 @@
public final class FlingConfigKt {
method public static androidx.ui.foundation.animation.FlingConfig AnchorsFlingConfig(java.util.List<java.lang.Float> anchors, androidx.animation.AnimationBuilder<java.lang.Float> animationBuilder = androidx.animation.PhysicsBuilder(), kotlin.jvm.functions.Function3<? super androidx.animation.AnimationEndReason,? super java.lang.Float,? super java.lang.Float,kotlin.Unit>? onAnimationEnd = null, androidx.animation.DecayAnimation decayAnimation = androidx.animation.ExponentialDecay());
- method public static androidx.ui.foundation.animation.FlingConfig FlingConfig(kotlin.jvm.functions.Function3<? super androidx.animation.AnimationEndReason,? super java.lang.Float,? super java.lang.Float,kotlin.Unit>? onAnimationEnd = null, kotlin.jvm.functions.Function1<? super java.lang.Float,androidx.animation.TargetAnimation> adjustTarget = { null });
+ method public static androidx.ui.foundation.animation.FlingConfig FlingConfig(kotlin.jvm.functions.Function3<? super androidx.animation.AnimationEndReason,? super java.lang.Float,? super java.lang.Float,kotlin.Unit>? onAnimationEnd = null, kotlin.jvm.functions.Function1<? super java.lang.Float,androidx.animation.TargetAnimation> adjustTarget = { return null });
method public static void fling(androidx.animation.AnimatedFloat, androidx.ui.foundation.animation.FlingConfig config, float startVelocity);
}
diff --git a/ui/ui-foundation/api/restricted_current.txt b/ui/ui-foundation/api/restricted_current.txt
index 90b0843..13cf2b5 100644
--- a/ui/ui-foundation/api/restricted_current.txt
+++ b/ui/ui-foundation/api/restricted_current.txt
@@ -18,14 +18,15 @@
}
public final class BoxKt {
- method public static void Box-TInkGdk(androidx.ui.core.Modifier modifier = Modifier, androidx.ui.graphics.Shape shape = RectangleShape, long backgroundColor = Color.Transparent, androidx.ui.foundation.Border? border = null, float padding = elvis {
- @null var var411925d7: androidx.ui.unit.Dp = border?.size
+ method public static void Box-TInkGdk(androidx.ui.core.Modifier modifier = Modifier, androidx.ui.graphics.Shape shape = androidx.ui.graphics.RectangleShapeKt.RectangleShape, long backgroundColor = Color.Transparent, androidx.ui.foundation.Border? border = null, float padding = elvis {
+ var var411925d7: androidx.ui.unit.Dp = border?.size
if (var411925d7 != null) var411925d7 else 0.dp
}, float paddingStart = Dp.Unspecified, float paddingTop = Dp.Unspecified, float paddingEnd = Dp.Unspecified, float paddingBottom = Dp.Unspecified, androidx.ui.core.Alignment gravity = ContentGravity.TopStart, kotlin.jvm.functions.Function0<kotlin.Unit> children = emptyContent());
}
public final class CanvasKt {
- method public static void Canvas(androidx.ui.core.Modifier modifier, kotlin.jvm.functions.Function1<? super androidx.ui.core.DrawScope,kotlin.Unit> onCanvas);
+ method @Deprecated public static void Canvas(androidx.ui.core.Modifier modifier, kotlin.jvm.functions.Function1<? super androidx.ui.core.DrawScope,kotlin.Unit> onCanvas);
+ method public static void Canvas2(androidx.ui.core.Modifier modifier, kotlin.jvm.functions.Function1<? super androidx.ui.graphics.painter.CanvasScope,kotlin.Unit> block);
}
public final class ClickableKt {
@@ -36,11 +37,6 @@
method public static void ClickableText(androidx.ui.text.AnnotatedString text, androidx.ui.core.Modifier modifier = Modifier, androidx.ui.text.TextStyle style = TextStyle.Default, boolean softWrap = true, androidx.ui.text.style.TextOverflow overflow = TextOverflow.Clip, int maxLines = 2147483647, kotlin.jvm.functions.Function1<? super androidx.ui.text.TextLayoutResult,kotlin.Unit> onTextLayout = {}, kotlin.jvm.functions.Function1<? super java.lang.Integer,kotlin.Unit> onClick);
}
- public final class ColoredRectKt {
- method @Deprecated public static void ColoredRect-HawTZqg(androidx.ui.graphics.Brush brush, androidx.ui.core.Modifier modifier = Modifier, androidx.ui.unit.Dp? width = null, androidx.ui.unit.Dp? height = null);
- method @Deprecated public static void ColoredRect-rR94L9Y(long color, androidx.ui.core.Modifier modifier = Modifier, androidx.ui.unit.Dp? width = null, androidx.ui.unit.Dp? height = null);
- }
-
public final class ContentColorKt {
method public static long contentColor();
method public static androidx.compose.ProvidableAmbient<androidx.ui.graphics.Color> getContentColorAmbient();
@@ -64,11 +60,11 @@
}
public final class DrawBackgroundKt {
- method @Deprecated public static androidx.ui.foundation.DrawBackground DrawBackground(androidx.ui.graphics.Brush brush, androidx.ui.graphics.Shape shape = RectangleShape);
- method @Deprecated public static androidx.ui.foundation.DrawBackground DrawBackground-qSsqlCY(long color, androidx.ui.graphics.Shape shape = RectangleShape);
+ method @Deprecated public static androidx.ui.foundation.DrawBackground DrawBackground(androidx.ui.graphics.Brush brush, androidx.ui.graphics.Shape shape = androidx.ui.graphics.RectangleShapeKt.RectangleShape);
+ method @Deprecated public static androidx.ui.foundation.DrawBackground DrawBackground-qSsqlCY(long color, androidx.ui.graphics.Shape shape = androidx.ui.graphics.RectangleShapeKt.RectangleShape);
method public static androidx.ui.core.Modifier drawBackground(androidx.ui.core.Modifier, androidx.ui.graphics.Paint paint, androidx.ui.graphics.Shape shape);
- method public static androidx.ui.core.Modifier drawBackground(androidx.ui.core.Modifier, androidx.ui.graphics.Brush brush, androidx.ui.graphics.Shape shape = RectangleShape);
- method public static androidx.ui.core.Modifier drawBackground-IZZjS-Q(androidx.ui.core.Modifier, long color, androidx.ui.graphics.Shape shape = RectangleShape);
+ method public static androidx.ui.core.Modifier drawBackground(androidx.ui.core.Modifier, androidx.ui.graphics.Brush brush, androidx.ui.graphics.Shape shape = androidx.ui.graphics.RectangleShapeKt.RectangleShape);
+ method public static androidx.ui.core.Modifier drawBackground-IZZjS-Q(androidx.ui.core.Modifier, long color, androidx.ui.graphics.Shape shape = androidx.ui.graphics.RectangleShapeKt.RectangleShape);
}
public final class DrawBorder implements androidx.ui.core.DrawModifier {
@@ -76,11 +72,11 @@
}
public final class DrawBorderKt {
- method @Deprecated public static androidx.ui.core.Modifier DrawBorder(androidx.ui.foundation.Border border, androidx.ui.graphics.Shape shape = RectangleShape);
+ method @Deprecated public static androidx.ui.core.Modifier DrawBorder(androidx.ui.foundation.Border border, androidx.ui.graphics.Shape shape = androidx.ui.graphics.RectangleShapeKt.RectangleShape);
method @Deprecated public static androidx.ui.foundation.DrawBorder DrawBorder-3vYgddY(float size, androidx.ui.graphics.Brush brush, androidx.ui.graphics.Shape shape);
- method @Deprecated public static androidx.ui.core.Modifier DrawBorder-Wounw_8(float size, long color, androidx.ui.graphics.Shape shape = RectangleShape);
- method public static androidx.ui.core.Modifier drawBorder(androidx.ui.core.Modifier, androidx.ui.foundation.Border border, androidx.ui.graphics.Shape shape = RectangleShape);
- method public static androidx.ui.core.Modifier drawBorder-ik3FbJE(androidx.ui.core.Modifier, float size, long color, androidx.ui.graphics.Shape shape = RectangleShape);
+ method @Deprecated public static androidx.ui.core.Modifier DrawBorder-Wounw_8(float size, long color, androidx.ui.graphics.Shape shape = androidx.ui.graphics.RectangleShapeKt.RectangleShape);
+ method public static androidx.ui.core.Modifier drawBorder(androidx.ui.core.Modifier, androidx.ui.foundation.Border border, androidx.ui.graphics.Shape shape = androidx.ui.graphics.RectangleShapeKt.RectangleShape);
+ method public static androidx.ui.core.Modifier drawBorder-ik3FbJE(androidx.ui.core.Modifier, float size, long color, androidx.ui.graphics.Shape shape = androidx.ui.graphics.RectangleShapeKt.RectangleShape);
method public static androidx.ui.core.Modifier drawBorder-vGsXmEw(androidx.ui.core.Modifier, float size, androidx.ui.graphics.Brush brush, androidx.ui.graphics.Shape shape);
}
@@ -169,7 +165,7 @@
}
public final class TextFieldKt {
- method public static void TextField-j3NKU0o(androidx.ui.foundation.TextFieldValue value, kotlin.jvm.functions.Function1<? super androidx.ui.foundation.TextFieldValue,kotlin.Unit> onValueChange, androidx.ui.core.Modifier modifier = Modifier, androidx.ui.core.input.FocusNode? focusNode = null, long textColor = Color.Unset, androidx.ui.text.TextStyle textStyle = currentTextStyle(), androidx.ui.input.KeyboardType keyboardType = KeyboardType.Text, androidx.ui.input.ImeAction imeAction = ImeAction.Unspecified, kotlin.jvm.functions.Function1<? super java.lang.Boolean,kotlin.Unit> onFocusChange = {}, kotlin.jvm.functions.Function1<? super androidx.ui.input.ImeAction,kotlin.Unit> onImeActionPerformed = {}, androidx.ui.input.VisualTransformation? visualTransformation = null, kotlin.jvm.functions.Function1<? super androidx.ui.text.TextLayoutResult,kotlin.Unit> onTextLayout = {}, kotlin.jvm.functions.Function1<? super androidx.ui.text.SoftwareKeyboardController,kotlin.Unit> onTextInputStarted = {});
+ method public static void TextField-4vuTNO4(androidx.ui.foundation.TextFieldValue value, kotlin.jvm.functions.Function1<? super androidx.ui.foundation.TextFieldValue,kotlin.Unit> onValueChange, androidx.ui.core.Modifier modifier = Modifier, androidx.ui.core.input.FocusNode? focusNode = null, long textColor = Color.Unset, androidx.ui.text.TextStyle textStyle = currentTextStyle(), androidx.ui.input.KeyboardType keyboardType = KeyboardType.Text, androidx.ui.input.ImeAction imeAction = ImeAction.Unspecified, kotlin.jvm.functions.Function1<? super java.lang.Boolean,kotlin.Unit> onFocusChange = {}, kotlin.jvm.functions.Function1<? super androidx.ui.input.ImeAction,kotlin.Unit> onImeActionPerformed = {}, androidx.ui.input.VisualTransformation? visualTransformation = null, kotlin.jvm.functions.Function1<? super androidx.ui.text.TextLayoutResult,kotlin.Unit> onTextLayout = {}, kotlin.jvm.functions.Function1<? super androidx.ui.text.SoftwareKeyboardController,kotlin.Unit> onTextInputStarted = {}, long cursorColor = contentColor());
}
public final class TextFieldValue {
@@ -266,7 +262,7 @@
public final class FlingConfigKt {
method public static androidx.ui.foundation.animation.FlingConfig AnchorsFlingConfig(java.util.List<java.lang.Float> anchors, androidx.animation.AnimationBuilder<java.lang.Float> animationBuilder = androidx.animation.PhysicsBuilder(), kotlin.jvm.functions.Function3<? super androidx.animation.AnimationEndReason,? super java.lang.Float,? super java.lang.Float,kotlin.Unit>? onAnimationEnd = null, androidx.animation.DecayAnimation decayAnimation = androidx.animation.ExponentialDecay());
- method public static androidx.ui.foundation.animation.FlingConfig FlingConfig(kotlin.jvm.functions.Function3<? super androidx.animation.AnimationEndReason,? super java.lang.Float,? super java.lang.Float,kotlin.Unit>? onAnimationEnd = null, kotlin.jvm.functions.Function1<? super java.lang.Float,androidx.animation.TargetAnimation> adjustTarget = { null });
+ method public static androidx.ui.foundation.animation.FlingConfig FlingConfig(kotlin.jvm.functions.Function3<? super androidx.animation.AnimationEndReason,? super java.lang.Float,? super java.lang.Float,kotlin.Unit>? onAnimationEnd = null, kotlin.jvm.functions.Function1<? super java.lang.Float,androidx.animation.TargetAnimation> adjustTarget = { return null });
method public static void fling(androidx.animation.AnimatedFloat, androidx.ui.foundation.animation.FlingConfig config, float startVelocity);
}
diff --git a/ui/ui-foundation/samples/src/main/java/androidx/ui/foundation/samples/CanvasSamples.kt b/ui/ui-foundation/samples/src/main/java/androidx/ui/foundation/samples/CanvasSamples.kt
index cd44ebc..b1cd6e5 100644
--- a/ui/ui-foundation/samples/src/main/java/androidx/ui/foundation/samples/CanvasSamples.kt
+++ b/ui/ui-foundation/samples/src/main/java/androidx/ui/foundation/samples/CanvasSamples.kt
@@ -21,17 +21,44 @@
import androidx.compose.remember
import androidx.ui.core.Modifier
import androidx.ui.foundation.Canvas
+import androidx.ui.foundation.Canvas2
+import androidx.ui.geometry.Offset
import androidx.ui.graphics.Color
import androidx.ui.graphics.Paint
+import androidx.ui.graphics.painter.CanvasScope
+import androidx.ui.graphics.painter.Stroke
+import androidx.ui.graphics.painter.inset
import androidx.ui.layout.preferredSize
import androidx.ui.unit.dp
import androidx.ui.unit.toRect
@Sampled
@Composable
+@Suppress("DEPRECATION")
+@Deprecated("Prefer usage of Canvas2", ReplaceWith("Canvas2Sample"))
fun CanvasSample() {
val paint = remember { Paint().apply { color = Color.Magenta } }
Canvas(modifier = Modifier.preferredSize(100.dp)) {
drawRect(size.toRect(), paint)
}
-}
\ No newline at end of file
+}
+
+/**
+ * Sample showing how to create a composable that supports issuing
+ * drawing commands through a [CanvasScope]
+ */
+@Sampled
+@Composable
+fun Canvas2Sample() {
+ Canvas2(modifier = Modifier.preferredSize(20.dp)) {
+ drawRect(color = Color.White)
+ inset(10.0f) {
+ drawLine(
+ p1 = Offset.zero,
+ p2 = Offset(size.width, size.height),
+ stroke = Stroke(width = 5.0f),
+ color = Color.Red
+ )
+ }
+ }
+}
diff --git a/ui/ui-foundation/samples/src/main/java/androidx/ui/foundation/samples/ImageSamples.kt b/ui/ui-foundation/samples/src/main/java/androidx/ui/foundation/samples/ImageSamples.kt
index c61b749..9d1e31a 100644
--- a/ui/ui-foundation/samples/src/main/java/androidx/ui/foundation/samples/ImageSamples.kt
+++ b/ui/ui-foundation/samples/src/main/java/androidx/ui/foundation/samples/ImageSamples.kt
@@ -22,15 +22,16 @@
import androidx.ui.core.Modifier
import androidx.ui.foundation.Image
import androidx.ui.geometry.Offset
-import androidx.ui.geometry.Rect
import androidx.ui.graphics.Canvas
import androidx.ui.graphics.Color
import androidx.ui.graphics.ColorFilter
import androidx.ui.graphics.ImageAsset
import androidx.ui.graphics.Paint
import androidx.ui.core.ContentScale
+import androidx.ui.geometry.Size
import androidx.ui.graphics.painter.ImagePainter
import androidx.ui.graphics.painter.Painter
+import androidx.ui.graphics.painter.CanvasScope
import androidx.ui.layout.preferredSize
import androidx.ui.res.loadVectorResource
import androidx.ui.unit.PxSize
@@ -51,7 +52,11 @@
val imageAsset = createTestImage()
// Lays out and draws an image sized to the rectangular subsection of the ImageAsset
Image(
- painter = ImagePainter(imageAsset, Rect.fromLTWH(10.0f, 12.0f, 50.0f, 60.0f))
+ painter = ImagePainter(
+ imageAsset,
+ Offset(10.0f, 12.0f),
+ Size(50.0f, 60.0f)
+ )
)
}
@@ -75,16 +80,11 @@
val customPainter = remember {
object : Painter() {
- val paint = Paint().apply { this.color = Color.Cyan }
-
override val intrinsicSize: PxSize
get() = PxSize(100.px, 100.px)
- override fun onDraw(canvas: Canvas, bounds: PxSize) {
- canvas.drawRect(
- Rect.fromLTWH(0.0f, 0.0f, bounds.width.value, bounds.height.value),
- paint
- )
+ override fun CanvasScope.onDraw() {
+ drawRect(color = Color.Cyan)
}
}
}
diff --git a/ui/ui-foundation/src/androidTest/java/androidx/ui/foundation/AdapterListTest.kt b/ui/ui-foundation/src/androidTest/java/androidx/ui/foundation/AdapterListTest.kt
index 5419937..432fe72 100644
--- a/ui/ui-foundation/src/androidTest/java/androidx/ui/foundation/AdapterListTest.kt
+++ b/ui/ui-foundation/src/androidTest/java/androidx/ui/foundation/AdapterListTest.kt
@@ -22,8 +22,8 @@
import androidx.test.filters.LargeTest
import androidx.ui.semantics.Semantics
import androidx.ui.semantics.testTag
-import androidx.ui.test.SemanticsMatcher
-import androidx.ui.test.assert
+import androidx.ui.test.assertCountEquals
+import androidx.ui.test.children
import androidx.ui.test.createComposeRule
import androidx.ui.test.findByTag
import androidx.ui.test.findByText
@@ -58,9 +58,9 @@
while (numItems >= 0) {
// Confirm the number of children to ensure there are no extra items
- findByTag(tag).assert(SemanticsMatcher.fromCondition("Has $numItems children") {
- children.size == numItems
- })
+ findByTag(tag)
+ .children()
+ .assertCountEquals(numItems)
// Confirm the children's content
for (i in 1..3) {
@@ -104,9 +104,9 @@
// Confirm the number of children to ensure there are no extra items
val numItems = data.size
- findByTag(tag).assert(SemanticsMatcher.fromCondition("Has $numItems children") {
- children.size == numItems
- })
+ findByTag(tag)
+ .children()
+ .assertCountEquals(numItems)
// Confirm the children's content
for (item in data) {
diff --git a/ui/ui-foundation/src/androidTest/java/androidx/ui/foundation/Canvas2Test.kt b/ui/ui-foundation/src/androidTest/java/androidx/ui/foundation/Canvas2Test.kt
new file mode 100644
index 0000000..e3738cb
--- /dev/null
+++ b/ui/ui-foundation/src/androidTest/java/androidx/ui/foundation/Canvas2Test.kt
@@ -0,0 +1,233 @@
+/*
+ * Copyright 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT 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.ui.foundation
+
+import android.os.Build
+import androidx.compose.Composable
+import androidx.test.filters.SdkSuppress
+import androidx.test.filters.LargeTest
+import androidx.ui.core.Alignment
+import androidx.ui.core.DensityAmbient
+import androidx.ui.core.Modifier
+import androidx.ui.core.TestTag
+import androidx.ui.core.onPositioned
+import androidx.ui.foundation.shape.corner.CircleShape
+import androidx.ui.geometry.Offset
+import androidx.ui.graphics.Color
+import androidx.ui.graphics.RectangleShape
+import androidx.ui.graphics.painter.Stroke
+import androidx.ui.graphics.toArgb
+import androidx.ui.layout.Stack
+import androidx.ui.layout.preferredSize
+import androidx.ui.layout.wrapContentSize
+import androidx.ui.semantics.Semantics
+import androidx.ui.test.assertShape
+import androidx.ui.test.captureToBitmap
+import androidx.ui.test.createComposeRule
+import androidx.ui.test.findByTag
+import androidx.ui.test.setContentAndCollectSizes
+import androidx.ui.unit.Density
+import androidx.ui.unit.IntPxSize
+import androidx.ui.unit.dp
+import androidx.ui.unit.px
+import com.google.common.truth.Truth
+import org.junit.Assert
+import org.junit.Assert.assertTrue
+import org.junit.Rule
+import org.junit.Test
+import java.util.concurrent.CountDownLatch
+import java.util.concurrent.TimeUnit
+
+@LargeTest
+@SdkSuppress(minSdkVersion = Build.VERSION_CODES.O)
+class Canvas2Test {
+
+ val contentTag = "Canvas2Test"
+ val boxWidth = 100
+ val boxHeight = 100
+ val containerSize = boxWidth
+
+ @get:Rule
+ val composeTestRule = createComposeRule()
+
+ @Test
+ fun testCanvas2() {
+ val strokeWidth = 5.0f
+ composeTestRule.setContent {
+ val density = DensityAmbient.current.density
+ val containerSize = (containerSize * 2 / density).dp
+ val minWidth = (boxWidth / density).dp
+ val minHeight = (boxHeight / density).dp
+ Box(modifier = Modifier.preferredSize(containerSize)
+ .drawBackground(Color.White)
+ .wrapContentSize(Alignment.Center)) {
+ TestTag(contentTag) {
+ Canvas2(modifier = Modifier.preferredSize(minWidth, minHeight)) {
+ drawLine(
+ p1 = Offset.zero,
+ p2 = Offset(size.width, size.height),
+ color = Color.Red,
+ stroke = Stroke(width = strokeWidth)
+ )
+ }
+ }
+ }
+ }
+
+ val paintBoxColor = Color.Red.toArgb()
+ val containerBgColor = Color.White.toArgb()
+ val strokeOffset = (strokeWidth / 2).toInt() + 3
+ findByTag(contentTag).captureToBitmap().apply {
+ val imageStartX = width / 2 - boxWidth / 2
+ val imageStartY = height / 2 - boxHeight / 2
+
+ // Top left
+ Assert.assertEquals(paintBoxColor, getPixel(imageStartX, imageStartY))
+
+ // Top Left, to the left of the line
+ Assert.assertEquals(containerBgColor,
+ getPixel(imageStartX - strokeOffset, imageStartY))
+
+ // Top Left, to the right of the line
+ Assert.assertEquals(containerBgColor,
+ getPixel(imageStartX + strokeOffset, imageStartY))
+
+ // Bottom right
+ Assert.assertEquals(paintBoxColor, getPixel(imageStartX + boxWidth - 1,
+ imageStartY + boxHeight - 1))
+
+ // Bottom right to the right of the line
+ Assert.assertEquals(containerBgColor,
+ getPixel(imageStartX + boxWidth + strokeOffset,
+ imageStartY + boxHeight))
+
+ // Bottom right to the left of the line
+ Assert.assertEquals(containerBgColor,
+ getPixel(imageStartX + boxWidth - strokeOffset,
+ imageStartY + boxHeight))
+
+ // Middle
+ Assert.assertEquals(paintBoxColor, getPixel(imageStartX + boxWidth / 2,
+ imageStartY + boxHeight / 2))
+
+ // Middle to the left of the line
+ Assert.assertEquals(containerBgColor,
+ getPixel(imageStartX + boxWidth / 2 - strokeOffset,
+ imageStartY + boxHeight / 2))
+
+ // Middle to the right of the line
+ Assert.assertEquals(containerBgColor,
+ getPixel(imageStartX + boxWidth / 2 + strokeOffset,
+ imageStartY + boxHeight / 2))
+ }
+ }
+
+ @Test
+ fun canvas2_noSize_emptyCanvas() {
+ composeTestRule.setContentAndCollectSizes {
+ Canvas2(modifier = Modifier) {
+ drawRect(Color.Black)
+ }
+ }
+ .assertHeightEqualsTo(0.dp)
+ .assertWidthEqualsTo(0.dp)
+ }
+
+ @Test
+ fun canvas2_exactSizes() {
+ var canvasSize: IntPxSize? = null
+ val latch = CountDownLatch(1)
+ composeTestRule.setContentAndCollectSizes {
+ SemanticParent {
+ Canvas2(
+ Modifier.preferredSize(100.dp)
+ .onPositioned { position -> canvasSize = position.size }
+ ) {
+ drawRect(Color.Red)
+
+ latch.countDown()
+ }
+ }
+ }
+
+ assertTrue(latch.await(5, TimeUnit.SECONDS))
+
+ with(composeTestRule.density) {
+ Truth.assertThat(canvasSize!!.width.value).isEqualTo(100.dp.toIntPx().value)
+ Truth.assertThat(canvasSize!!.height.value).isEqualTo(100.dp.toIntPx().value)
+ }
+
+ val bitmap = findByTag(contentTag).captureToBitmap()
+ bitmap.assertShape(
+ density = composeTestRule.density,
+ backgroundColor = Color.Red,
+ shapeColor = Color.Red,
+ shape = RectangleShape
+ )
+ }
+
+ @Test
+ fun canvas2_exactSizes_drawCircle() {
+ var canvasSize: IntPxSize? = null
+ val latch = CountDownLatch(1)
+ composeTestRule.setContentAndCollectSizes {
+ SemanticParent {
+ Canvas2(
+ Modifier.preferredSize(100.dp)
+ .onPositioned { position -> canvasSize = position.size }
+ ) {
+ drawRect(Color.Red)
+ drawCircle(
+ Color.Blue,
+ radius = 10.0f
+ )
+ latch.countDown()
+ }
+ }
+ }
+
+ assertTrue(latch.await(5, TimeUnit.SECONDS))
+
+ with(composeTestRule.density) {
+ Truth.assertThat(canvasSize!!.width.value).isEqualTo(100.dp.toIntPx().value)
+ Truth.assertThat(canvasSize!!.height.value).isEqualTo(100.dp.toIntPx().value)
+ }
+
+ val bitmap = findByTag(contentTag).captureToBitmap()
+ bitmap.assertShape(
+ density = composeTestRule.density,
+ backgroundColor = Color.Red,
+ shapeColor = Color.Blue,
+ shape = CircleShape,
+ shapeSizeX = 20.px,
+ shapeSizeY = 20.px,
+ shapeOverlapPixelCount = 2.px
+ )
+ }
+
+ @Composable
+ fun SemanticParent(children: @Composable Density.() -> Unit) {
+ Stack {
+ TestTag(tag = contentTag) {
+ Semantics(container = true) {
+ Box {
+ DensityAmbient.current.children()
+ }
+ }
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/ui/ui-foundation/src/androidTest/java/androidx/ui/foundation/CanvasTest.kt b/ui/ui-foundation/src/androidTest/java/androidx/ui/foundation/CanvasTest.kt
index 38f9028..0ff7679 100644
--- a/ui/ui-foundation/src/androidTest/java/androidx/ui/foundation/CanvasTest.kt
+++ b/ui/ui-foundation/src/androidTest/java/androidx/ui/foundation/CanvasTest.kt
@@ -44,10 +44,13 @@
import androidx.ui.unit.toOffset
import androidx.ui.unit.toRect
import com.google.common.truth.Truth
+import org.junit.Assert.assertTrue
import org.junit.Rule
import org.junit.Test
import org.junit.runner.RunWith
import org.junit.runners.JUnit4
+import java.util.concurrent.CountDownLatch
+import java.util.concurrent.TimeUnit
@MediumTest
@SdkSuppress(minSdkVersion = Build.VERSION_CODES.O)
@@ -60,6 +63,7 @@
val testTag = "CanvasParent"
@Test
+ @Suppress("DEPRECATION")
fun canvas_noSize_emptyCanvas() {
composeTestRule.setContentAndCollectSizes {
Canvas(modifier = Modifier) {
@@ -71,8 +75,10 @@
}
@Test
+ @Suppress("DEPRECATION")
fun canvas_exactSizes() {
var canvasSize: IntPxSize? = null
+ val latch = CountDownLatch(1)
composeTestRule.setContentAndCollectSizes {
SemanticParent {
Canvas(
@@ -80,10 +86,13 @@
.onPositioned { position -> canvasSize = position.size }
) {
drawRect(size.toRect(), Paint().apply { color = Color.Red })
+ latch.countDown()
}
}
}
+ assertTrue(latch.await(5, TimeUnit.SECONDS))
+
with(composeTestRule.density) {
Truth.assertThat(canvasSize!!.width.value).isEqualTo(100.dp.toIntPx().value)
Truth.assertThat(canvasSize!!.height.value).isEqualTo(100.dp.toIntPx().value)
@@ -99,8 +108,10 @@
}
@Test
+ @Suppress("DEPRECATION")
fun canvas_exactSizes_drawCircle() {
var canvasSize: IntPxSize? = null
+ val latch = CountDownLatch(1)
composeTestRule.setContentAndCollectSizes {
SemanticParent {
Canvas(
@@ -113,10 +124,13 @@
10f,
Paint().apply { color = Color.Blue }
)
+ latch.countDown()
}
}
}
+ assertTrue(latch.await(5, TimeUnit.SECONDS))
+
with(composeTestRule.density) {
Truth.assertThat(canvasSize!!.width.value).isEqualTo(100.dp.toIntPx().value)
Truth.assertThat(canvasSize!!.height.value).isEqualTo(100.dp.toIntPx().value)
diff --git a/ui/ui-foundation/src/androidTest/java/androidx/ui/foundation/ColoredRectTest.kt b/ui/ui-foundation/src/androidTest/java/androidx/ui/foundation/ColoredRectTest.kt
deleted file mode 100644
index 453e8d5..0000000
--- a/ui/ui-foundation/src/androidTest/java/androidx/ui/foundation/ColoredRectTest.kt
+++ /dev/null
@@ -1,82 +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.ui.foundation
-
-import androidx.test.filters.MediumTest
-import androidx.ui.core.Modifier
-import androidx.ui.graphics.Color
-import androidx.ui.layout.DpConstraints
-import androidx.ui.layout.fillMaxSize
-import androidx.ui.layout.preferredSize
-import androidx.ui.test.createComposeRule
-import androidx.ui.test.setContentAndCollectSizes
-import androidx.ui.unit.dp
-import androidx.ui.unit.ipx
-import org.junit.Rule
-import org.junit.Test
-import org.junit.runner.RunWith
-import org.junit.runners.JUnit4
-
-@MediumTest
-@RunWith(JUnit4::class)
-class ColoredRectTest {
-
- @get:Rule
- val composeTestRule = createComposeRule()
-
- private val color = Color(0xFFFF0000)
-
- @Test
- fun coloredRect_fixedSizes() {
- val width = 40.dp
- val height = 71.dp
- composeTestRule
- .setContentAndCollectSizes {
- Box(Modifier.preferredSize(width, height).drawBackground(color))
- }
- .assertWidthEqualsTo(width)
- .assertHeightEqualsTo(height)
- }
-
- @Test
- fun coloredRect_expand_LimitedSizes() {
- val width = 40.dp
- val height = 71.dp
- composeTestRule
- .setContentAndCollectSizes(
- parentConstraints = DpConstraints.fixed(
- width,
- height
- )
- ) {
- Box(Modifier.fillMaxSize().drawBackground(color))
- }
- .assertWidthEqualsTo(width)
- .assertHeightEqualsTo(height)
- }
-
- @Test
- fun coloredRect_expand_WholeScreenSizes() {
- val dm = composeTestRule.displayMetrics
- composeTestRule
- .setContentAndCollectSizes {
- Box(Modifier.fillMaxSize().drawBackground(color))
- }
- .assertWidthEqualsTo { dm.widthPixels.ipx }
- .assertHeightEqualsTo { dm.heightPixels.ipx }
- }
-}
\ No newline at end of file
diff --git a/ui/ui-foundation/src/androidTest/java/androidx/ui/foundation/ImageTest.kt b/ui/ui-foundation/src/androidTest/java/androidx/ui/foundation/ImageTest.kt
index 6039589..1f63cc2 100644
--- a/ui/ui-foundation/src/androidTest/java/androidx/ui/foundation/ImageTest.kt
+++ b/ui/ui-foundation/src/androidTest/java/androidx/ui/foundation/ImageTest.kt
@@ -33,6 +33,8 @@
import androidx.ui.core.ContentScale
import androidx.ui.graphics.painter.ImagePainter
import androidx.ui.core.drawBehind
+import androidx.ui.geometry.Offset
+import androidx.ui.geometry.Size
import androidx.ui.graphics.toArgb
import androidx.ui.layout.preferredSize
import androidx.ui.layout.preferredSizeIn
@@ -138,12 +140,11 @@
TestTag(contentTag) {
Image(
ImagePainter(createImageAsset(),
- Rect.fromLTWH(
+ Offset(
imageWidth / 2.0f - subsectionWidth / 2.0f,
- imageHeight / 2.0f - subsectionHeight / 2.0f,
- subsectionWidth.toFloat(),
- subsectionHeight.toFloat()
- )
+ imageHeight / 2.0f - subsectionHeight / 2.0f
+ ),
+ Size(subsectionWidth.toFloat(), subsectionHeight.toFloat())
)
)
}
diff --git a/ui/ui-foundation/src/androidTest/java/androidx/ui/foundation/MutuallyExclusiveSetItemTest.kt b/ui/ui-foundation/src/androidTest/java/androidx/ui/foundation/MutuallyExclusiveSetItemTest.kt
index d781515..8cf4a60 100644
--- a/ui/ui-foundation/src/androidTest/java/androidx/ui/foundation/MutuallyExclusiveSetItemTest.kt
+++ b/ui/ui-foundation/src/androidTest/java/androidx/ui/foundation/MutuallyExclusiveSetItemTest.kt
@@ -27,6 +27,7 @@
import androidx.ui.test.doClick
import androidx.ui.test.find
import androidx.ui.test.findAll
+import androidx.ui.test.first
import androidx.ui.test.isInMutuallyExclusiveGroup
import org.junit.Rule
import org.junit.Test
diff --git a/ui/ui-foundation/src/androidTest/java/androidx/ui/foundation/TextFieldTest.kt b/ui/ui-foundation/src/androidTest/java/androidx/ui/foundation/TextFieldTest.kt
index c371fca..5ff2ab1 100644
--- a/ui/ui-foundation/src/androidTest/java/androidx/ui/foundation/TextFieldTest.kt
+++ b/ui/ui-foundation/src/androidTest/java/androidx/ui/foundation/TextFieldTest.kt
@@ -16,10 +16,12 @@
package androidx.ui.foundation
+import android.os.Build
import androidx.compose.Composable
import androidx.compose.MutableState
import androidx.compose.Providers
import androidx.compose.state
+import androidx.test.filters.SdkSuppress
import androidx.test.filters.SmallTest
import androidx.ui.core.FocusManagerAmbient
import androidx.ui.core.Modifier
@@ -29,6 +31,8 @@
import androidx.ui.core.input.FocusNode
import androidx.ui.core.input.FocusTransitionObserver
import androidx.ui.core.onPositioned
+import androidx.ui.graphics.Color
+import androidx.ui.graphics.RectangleShape
import androidx.ui.input.CommitTextEditOp
import androidx.ui.input.EditOperation
import androidx.ui.input.EditorValue
@@ -39,14 +43,21 @@
import androidx.ui.layout.preferredWidthIn
import androidx.ui.savedinstancestate.savedInstanceState
import androidx.ui.test.StateRestorationTester
+import androidx.ui.test.assertPixels
+import androidx.ui.test.assertShape
+import androidx.ui.test.captureToBitmap
import androidx.ui.test.createComposeRule
import androidx.ui.test.doClick
import androidx.ui.test.findByTag
import androidx.ui.test.runOnIdleCompose
import androidx.ui.text.TextLayoutResult
import androidx.ui.text.TextRange
+import androidx.ui.text.TextStyle
import androidx.ui.unit.IntPx
+import androidx.ui.unit.IntPxSize
import androidx.ui.unit.dp
+import androidx.ui.unit.ipx
+import androidx.ui.unit.px
import com.google.common.truth.Truth.assertThat
import com.nhaarman.mockitokotlin2.any
import com.nhaarman.mockitokotlin2.argumentCaptor
@@ -60,6 +71,8 @@
import org.junit.Test
import org.junit.runner.RunWith
import org.junit.runners.JUnit4
+import java.util.concurrent.CountDownLatch
+import java.util.concurrent.TimeUnit
@SmallTest
@RunWith(JUnit4::class)
@@ -430,4 +443,74 @@
assertThat(state!!.value).isEqualTo(TextFieldValue("test", TextRange(1, 2)))
}
}
+
+ @Test
+ fun textFieldNotFocused_cursorNotRendered() {
+ composeTestRule.setContent {
+ TestTag("textField") {
+ TextField(
+ value = TextFieldValue(),
+ onValueChange = {},
+ textColor = Color.White,
+ modifier = Modifier.preferredSize(10.dp, 20.dp).drawBackground(Color.White),
+ cursorColor = Color.Blue
+ )
+ }
+ }
+
+ findByTag("textField")
+ .captureToBitmap()
+ .assertShape(
+ density = composeTestRule.density,
+ shape = RectangleShape,
+ shapeColor = Color.White,
+ backgroundColor = Color.White,
+ shapeOverlapPixelCount = 0.px
+ )
+ }
+
+ @Test
+ @SdkSuppress(minSdkVersion = Build.VERSION_CODES.O)
+ fun textFieldFocused_cursorRendered() = with(composeTestRule.density) {
+ val width = 10.dp
+ val height = 20.dp
+ val halfCursorWidth = 2.dp.toIntPx() / 2f
+ val latch = CountDownLatch(1)
+ composeTestRule.setContent {
+ TestTag("textField") {
+ TextField(
+ value = TextFieldValue(),
+ onValueChange = {},
+ textStyle = TextStyle(color = Color.White, background = Color.White),
+ modifier = Modifier.preferredSize(width, height).drawBackground(Color.White),
+ cursorColor = Color.Red,
+ onFocusChange = { focused ->
+ if (focused) latch.countDown()
+ }
+ )
+ }
+ }
+ findByTag("textField").doClick()
+ assert(latch.await(1, TimeUnit.SECONDS))
+
+ findByTag("textField")
+ .captureToBitmap()
+ .assertPixels(
+ IntPxSize(width.toIntPx(), height.toIntPx())
+ ) { position ->
+ if (position.x >= halfCursorWidth - 1.ipx && position.x < halfCursorWidth + 1.ipx) {
+ // skip some pixels around cursor
+ null
+ } else if (position.y < 5.ipx || position.y > height.toIntPx() - 5.ipx) {
+ // skip some pixels vertically
+ null
+ } else if (position.x in 0.ipx..halfCursorWidth) {
+ // cursor
+ Color.Red
+ } else {
+ // text field background
+ Color.White
+ }
+ }
+ }
}
diff --git a/ui/ui-foundation/src/main/java/androidx/ui/foundation/AdapterList.kt b/ui/ui-foundation/src/main/java/androidx/ui/foundation/AdapterList.kt
index c12ea31..c777376 100644
--- a/ui/ui-foundation/src/main/java/androidx/ui/foundation/AdapterList.kt
+++ b/ui/ui-foundation/src/main/java/androidx/ui/foundation/AdapterList.kt
@@ -35,6 +35,7 @@
import androidx.ui.core.Modifier
import androidx.ui.core.Ref
import androidx.ui.core.clipToBounds
+import androidx.ui.core.materialize
import androidx.ui.core.subcomposeInto
import androidx.ui.foundation.gestures.DragDirection
import androidx.ui.foundation.gestures.ScrollableState
@@ -490,7 +491,7 @@
state.forceRecompose = true
androidx.ui.core.LayoutNode(
- modifier = modifier
+ modifier = currentComposer.materialize(modifier
.scrollable(
dragDirection = DragDirection.Vertical,
scrollableState = ScrollableState(
@@ -498,7 +499,7 @@
state.onScrollDeltaConsumptionRequestedListener
)
)
- .clipToBounds(),
+ .clipToBounds()),
ref = state.rootNodeRef,
measureBlocks = state.measureBlocks
)
diff --git a/ui/ui-foundation/src/main/java/androidx/ui/foundation/Canvas.kt b/ui/ui-foundation/src/main/java/androidx/ui/foundation/Canvas.kt
index afca77d..542449b 100644
--- a/ui/ui-foundation/src/main/java/androidx/ui/foundation/Canvas.kt
+++ b/ui/ui-foundation/src/main/java/androidx/ui/foundation/Canvas.kt
@@ -17,9 +17,11 @@
package androidx.ui.foundation
import androidx.compose.Composable
+import androidx.compose.remember
import androidx.ui.core.Modifier
import androidx.ui.core.DrawScope
import androidx.ui.core.drawBehind
+import androidx.ui.graphics.painter.CanvasScope
import androidx.ui.layout.ColumnScope
import androidx.ui.layout.Spacer
@@ -36,9 +38,33 @@
* called during draw stage, you have no access to composition scope, meaning that [Composable]
* function invocation inside it will result to runtime exception
*/
+@Deprecated("Favor usage of Canvas2 which leverages the CanvasScope API. CanvasScope" +
+ " introduces a stateless, declarative API surface without the requirement of maintaining" +
+ "a Paint object",
+ ReplaceWith("Canvas2"))
@Composable
fun Canvas(modifier: Modifier, onCanvas: DrawScope.() -> Unit) {
Spacer(
modifier.drawBehind(onCanvas)
)
+}
+
+/**
+ * Creates a composable that lays out and draws content within a [CanvasScope].
+ * The size of this [Canvas2] is purely dictated by the given modifier chain.
+ *
+ * @sample androidx.ui.foundation.samples.Canvas2Sample
+ *
+ * @param modifier Modifier used to adjust the layout algorithm or draw decoration content (ex.
+ * background)
+ * @param block Lambda callback invoked on the created [CanvasScope] to issue drawing commands
+ */
+@Composable
+fun Canvas2(modifier: Modifier, block: CanvasScope.() -> Unit) {
+ val canvasScope = remember { CanvasScope() }
+ Spacer(
+ modifier.drawBehind {
+ canvasScope.draw(this, size, block)
+ }
+ )
}
\ No newline at end of file
diff --git a/ui/ui-foundation/src/main/java/androidx/ui/foundation/ColoredRect.kt b/ui/ui-foundation/src/main/java/androidx/ui/foundation/ColoredRect.kt
deleted file mode 100644
index ba0bc08..0000000
--- a/ui/ui-foundation/src/main/java/androidx/ui/foundation/ColoredRect.kt
+++ /dev/null
@@ -1,91 +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.ui.foundation
-
-import androidx.compose.Composable
-import androidx.ui.core.Modifier
-import androidx.ui.graphics.Brush
-import androidx.ui.graphics.Color
-import androidx.ui.layout.fillMaxHeight
-import androidx.ui.layout.fillMaxWidth
-import androidx.ui.layout.preferredHeight
-import androidx.ui.layout.preferredWidth
-import androidx.ui.unit.Dp
-
-/**
- * Component that represents a rectangle painted with the specified [Brush].
- *
- * If width and/or height are not specified, this component will expand
- * to the corresponding max constraints received from the parent
- * if these are finite, or to the min constraints otherwise.
- * Note that even if width and height are specified, these will not be satisfied
- * if the component's incoming layout constraints do not allow that.
- *
- * @param brush brush to paint rect with
- * @param width width of this rect, by default it will match incoming layout constraints
- * @param height height of this rect, by default it will match incoming layout constraints
- */
-@Deprecated(
- "Use Box(Modifier.preferredSize(width, height).drawBackground(brush)) instead",
- replaceWith = ReplaceWith(
- "Box(modifier.preferredSize(width, height)\n.drawBackground(brush))",
- "androidx.ui.foundation.preferredSize",
- "androidx.ui.foundation.drawBackground"
- )
-)
-@Composable
-fun ColoredRect(
- brush: Brush,
- modifier: Modifier = Modifier,
- width: Dp? = null,
- height: Dp? = null
-) {
- val widthModifier =
- if (width != null) Modifier.preferredWidth(width) else Modifier.fillMaxWidth()
- val heightModifier =
- if (height != null) Modifier.preferredHeight(height) else Modifier.fillMaxHeight()
- Box(modifier + widthModifier + heightModifier + Modifier.drawBackground(brush))
-}
-
-/**
- * Component that represents a rectangle painted with a solid color.
- *
- * @param color color to paint rect with
- * @param width width of this rect, by default it will match parent's constraints
- * @param height height of this rect, by default it will match parent's constraints
- */
-@Deprecated(
- "Use Box(Modifier.preferredSize(width, height).drawBackground(color)) instead",
- replaceWith = ReplaceWith(
- "Box(modifier.preferredSize(width, height)\n.drawBackground(color))",
- "androidx.ui.foundation.preferredSize",
- "androidx.ui.foundation.drawBackground"
- )
-)
-@Composable
-fun ColoredRect(
- color: Color,
- modifier: Modifier = Modifier,
- width: Dp? = null,
- height: Dp? = null
-) {
- val widthModifier =
- if (width != null) Modifier.preferredWidth(width) else Modifier.fillMaxWidth()
- val heightModifier =
- if (height != null) Modifier.preferredHeight(height) else Modifier.fillMaxHeight()
- Box(modifier + widthModifier + heightModifier + Modifier.drawBackground(color))
-}
diff --git a/ui/ui-foundation/src/main/java/androidx/ui/foundation/DrawBorder.kt b/ui/ui-foundation/src/main/java/androidx/ui/foundation/DrawBorder.kt
index 1dbb37a..c5cc489 100644
--- a/ui/ui-foundation/src/main/java/androidx/ui/foundation/DrawBorder.kt
+++ b/ui/ui-foundation/src/main/java/androidx/ui/foundation/DrawBorder.kt
@@ -201,7 +201,7 @@
canvas: Canvas,
paint: Paint
) {
- val fillWithBorder = borderSize * 2 >= rect.getShortestSide()
+ val fillWithBorder = borderSize * 2 >= rect.minDimension
paint.style = if (fillWithBorder) PaintingStyle.fill else PaintingStyle.stroke
val delta = if (fillWithBorder) 0f else borderSize / 2
diff --git a/ui/ui-foundation/src/main/java/androidx/ui/foundation/TableBorders.kt b/ui/ui-foundation/src/main/java/androidx/ui/foundation/TableBorders.kt
index 70a84ef..4980a52 100644
--- a/ui/ui-foundation/src/main/java/androidx/ui/foundation/TableBorders.kt
+++ b/ui/ui-foundation/src/main/java/androidx/ui/foundation/TableBorders.kt
@@ -55,12 +55,14 @@
dy = verticalOffsets[row].value.toFloat()
)
val p2 = when (orientation) {
- BorderOrientation.Vertical -> p1.copy(
- dy = verticalOffsets[row + 1].value.toFloat()
- )
- BorderOrientation.Horizontal -> p1.copy(
- dx = horizontalOffsets[column + 1].value.toFloat()
- )
+ BorderOrientation.Vertical -> Offset(
+ dx = p1.dx,
+ dy = verticalOffsets[row + 1].value.toFloat()
+ )
+ BorderOrientation.Horizontal -> Offset(
+ dx = horizontalOffsets[column + 1].value.toFloat(),
+ dy = p1.dy
+ )
}
// TODO(calintat): Reset paint when that operation is available.
border.brush.applyTo(paint)
diff --git a/ui/ui-foundation/src/main/java/androidx/ui/foundation/TextField.kt b/ui/ui-foundation/src/main/java/androidx/ui/foundation/TextField.kt
index 62cb8f1..7e34072 100644
--- a/ui/ui-foundation/src/main/java/androidx/ui/foundation/TextField.kt
+++ b/ui/ui-foundation/src/main/java/androidx/ui/foundation/TextField.kt
@@ -18,24 +18,35 @@
import androidx.compose.Composable
import androidx.compose.remember
+import androidx.compose.getValue
+import androidx.compose.mutableStateOf
+import androidx.compose.setValue
import androidx.compose.state
import androidx.ui.text.CoreTextField
import androidx.ui.core.Modifier
+import androidx.ui.core.composed
+import androidx.ui.core.drawBehind
import androidx.ui.core.input.FocusManager
import androidx.ui.core.input.FocusNode
+import androidx.ui.geometry.Offset
+import androidx.ui.geometry.Rect
import androidx.ui.graphics.Color
+import androidx.ui.graphics.Paint
import androidx.ui.graphics.useOrElse
import androidx.ui.input.ImeAction
import androidx.ui.input.EditorValue
import androidx.ui.input.KeyboardType
+import androidx.ui.input.TransformedText
import androidx.ui.input.VisualTransformation
import androidx.ui.layout.fillMaxWidth
import androidx.ui.savedinstancestate.Saver
import androidx.ui.savedinstancestate.listSaver
import androidx.ui.text.SoftwareKeyboardController
+import androidx.ui.text.TextFieldDelegate
import androidx.ui.text.TextLayoutResult
import androidx.ui.text.TextRange
import androidx.ui.text.TextStyle
+import androidx.ui.unit.dp
/**
* A class holding information about the editing state.
@@ -116,8 +127,9 @@
* @param onTextLayout Callback that is executed when a new text layout is calculated.
* @param onTextInputStarted Callback that is executed when the initialization has done for
* communicating with platform text input service, e.g. software keyboard on Android. Called with
- * [SoftwareKeyboardController] instance which can be used for requesting nputshow/hide software
+ * [SoftwareKeyboardController] instance which can be used for requesting input show/hide software
* keyboard.
+ * @param cursorColor Color of the cursor.
*
* @see TextFieldValue
* @see ImeAction
@@ -138,7 +150,8 @@
onImeActionPerformed: (ImeAction) -> Unit = {},
visualTransformation: VisualTransformation? = null,
onTextLayout: (TextLayoutResult) -> Unit = {},
- onTextInputStarted: (SoftwareKeyboardController) -> Unit = {}
+ onTextInputStarted: (SoftwareKeyboardController) -> Unit = {},
+ cursorColor: Color = contentColor()
) {
val fullModel = state { EditorValue() }
if (fullModel.value.text != value.text || fullModel.value.selection != value.selection) {
@@ -155,9 +168,20 @@
val color = textColor.useOrElse { textStyle.color.useOrElse { contentColor() } }
val mergedStyle = textStyle.merge(TextStyle(color = color))
+ val transformedText: TransformedText = remember(fullModel.value, visualTransformation) {
+ val transformed =
+ TextFieldDelegate.applyVisualFilter(fullModel.value, visualTransformation)
+ fullModel.value.composition?.let {
+ TextFieldDelegate.applyCompositionDecoration(it, transformed)
+ } ?: transformed
+ }
+ val cursorState: CursorState = remember { CursorState() }
+
CoreTextField(
value = fullModel.value,
- modifier = modifier.fillMaxWidth(),
+ modifier = modifier
+ .fillMaxWidth()
+ .drawCursor(cursorColor, cursorState, fullModel.value, transformedText),
onValueChange = {
val prevState = fullModel.value
fullModel.value = it
@@ -173,11 +197,57 @@
textStyle = mergedStyle,
keyboardType = keyboardType,
imeAction = imeAction,
- onFocusChange = onFocusChange,
+ onFocusChange = {
+ cursorState.focused = it
+ onFocusChange(it)
+ },
focusNode = focusNode ?: remember { FocusNode() },
onImeActionPerformed = onImeActionPerformed,
visualTransformation = visualTransformation,
- onTextLayout = onTextLayout,
+ onTextLayout = {
+ cursorState.layoutResult = it
+ onTextLayout(it)
+ },
onTextInputStarted = onTextInputStarted
)
}
+
+private class CursorState {
+ var focused by mutableStateOf(false)
+ var layoutResult by mutableStateOf<TextLayoutResult?>(null)
+}
+
+private val CursorThickness = 2.dp
+
+private fun Modifier.drawCursor(
+ cursorColor: Color,
+ cursorState: CursorState,
+ editorValue: EditorValue,
+ transformedText: TransformedText
+): Modifier = composed {
+ val paint = remember { Paint() }
+
+ drawBehind {
+ if (cursorState.focused && editorValue.selection.collapsed) {
+ val cursorWidth = CursorThickness.value * density
+ val cursorHeight = cursorState.layoutResult?.size?.height?.value?.toFloat() ?: 0f
+
+ val cursorRect = cursorState.layoutResult?.getCursorRect(
+ transformedText.offsetMap.originalToTransformed(editorValue.selection.min)
+ ) ?: Rect(
+ 0f, 0f,
+ cursorWidth, cursorHeight
+ )
+ val cursorX = (cursorRect.left + cursorRect.right) / 2
+
+ drawLine(
+ Offset(cursorX, cursorRect.top),
+ Offset(cursorX, cursorRect.bottom),
+ paint.apply {
+ this.color = cursorColor
+ this.strokeWidth = cursorWidth
+ }
+ )
+ }
+ }
+}
diff --git a/ui/ui-framework/api/0.1.0-dev11.txt b/ui/ui-framework/api/0.1.0-dev11.txt
index c1e4b72..928f12f0 100644
--- a/ui/ui-framework/api/0.1.0-dev11.txt
+++ b/ui/ui-framework/api/0.1.0-dev11.txt
@@ -23,7 +23,7 @@
public final class DrawShadowKt {
method @Deprecated public static androidx.ui.core.Modifier drawShadow-IFvMOQI(androidx.ui.graphics.Shape shape, float elevation, boolean clipToOutline = true, @FloatRange(from=0.0, to=1.0) float opacity = 1f);
- method public static androidx.ui.core.Modifier drawShadow-xWKVMPI(androidx.ui.core.Modifier, float elevation, androidx.ui.graphics.Shape shape = RectangleShape, boolean clipToOutline = elevation > 0.dp, @FloatRange(from=0.0, to=1.0) float opacity = 1f);
+ method public static androidx.ui.core.Modifier drawShadow-xWKVMPI(androidx.ui.core.Modifier, float elevation, androidx.ui.graphics.Shape shape = androidx.ui.graphics.RectangleShapeKt.RectangleShape, boolean clipToOutline = elevation > 0.dp, @FloatRange(from=0.0, to=1.0) float opacity = 1f);
}
public enum DropDownAlignment {
@@ -361,7 +361,7 @@
}
public final class VectorAssetBuilder {
- method public androidx.ui.graphics.vector.VectorAssetBuilder addPath(java.util.List<? extends androidx.ui.graphics.vector.PathNode> pathData, String name = "", androidx.ui.graphics.Brush? fill = null, float fillAlpha = 1.0f, androidx.ui.graphics.Brush? stroke = null, float strokeAlpha = 1.0f, float strokeLineWidth = 0.0f, androidx.ui.graphics.StrokeCap strokeLineCap = DefaultStrokeLineCap, androidx.ui.graphics.StrokeJoin strokeLineJoin = DefaultStrokeLineJoin, float strokeLineMiter = 4.0f);
+ method public androidx.ui.graphics.vector.VectorAssetBuilder addPath(java.util.List<? extends androidx.ui.graphics.vector.PathNode> pathData, String name = "", androidx.ui.graphics.Brush? fill = null, float fillAlpha = 1.0f, androidx.ui.graphics.Brush? stroke = null, float strokeAlpha = 1.0f, float strokeLineWidth = 0.0f, androidx.ui.graphics.StrokeCap strokeLineCap = androidx.ui.graphics.vector.VectorKt.DefaultStrokeLineCap, androidx.ui.graphics.StrokeJoin strokeLineJoin = androidx.ui.graphics.vector.VectorKt.DefaultStrokeLineJoin, float strokeLineMiter = 4.0f);
method public androidx.ui.graphics.vector.VectorAsset build();
method public float getDefaultHeight();
method public float getDefaultWidth();
@@ -369,24 +369,24 @@
method public float getViewportHeight();
method public float getViewportWidth();
method public androidx.ui.graphics.vector.VectorAssetBuilder popGroup();
- method public androidx.ui.graphics.vector.VectorAssetBuilder pushGroup(String name = "", float rotate = 0.0f, float pivotX = 0.0f, float pivotY = 0.0f, float scaleX = 1.0f, float scaleY = 1.0f, float translationX = 0.0f, float translationY = 0.0f, java.util.List<? extends androidx.ui.graphics.vector.PathNode> clipPathData = EmptyPath);
+ method public androidx.ui.graphics.vector.VectorAssetBuilder pushGroup(String name = "", float rotate = 0.0f, float pivotX = 0.0f, float pivotY = 0.0f, float scaleX = 1.0f, float scaleY = 1.0f, float translationX = 0.0f, float translationY = 0.0f, java.util.List<? extends androidx.ui.graphics.vector.PathNode> clipPathData = androidx.ui.graphics.vector.VectorKt.EmptyPath);
}
public final class VectorAssetBuilderKt {
- method public static androidx.ui.graphics.vector.VectorAssetBuilder group(androidx.ui.graphics.vector.VectorAssetBuilder, String name = "", float rotate = 0.0f, float pivotX = 0.0f, float pivotY = 0.0f, float scaleX = 1.0f, float scaleY = 1.0f, float translationX = 0.0f, float translationY = 0.0f, java.util.List<? extends androidx.ui.graphics.vector.PathNode> clipPathData = EmptyPath, kotlin.jvm.functions.Function1<? super androidx.ui.graphics.vector.VectorAssetBuilder,kotlin.Unit> block);
- method public static androidx.ui.graphics.vector.VectorAssetBuilder path(androidx.ui.graphics.vector.VectorAssetBuilder, String name = "", androidx.ui.graphics.Brush? fill = null, float fillAlpha = 1.0f, androidx.ui.graphics.Brush? stroke = null, float strokeAlpha = 1.0f, float strokeLineWidth = 0.0f, androidx.ui.graphics.StrokeCap strokeLineCap = DefaultStrokeLineCap, androidx.ui.graphics.StrokeJoin strokeLineJoin = DefaultStrokeLineJoin, float strokeLineMiter = 4.0f, kotlin.jvm.functions.Function1<? super androidx.ui.graphics.vector.PathBuilder,kotlin.Unit> pathBuilder);
+ method public static androidx.ui.graphics.vector.VectorAssetBuilder group(androidx.ui.graphics.vector.VectorAssetBuilder, String name = "", float rotate = 0.0f, float pivotX = 0.0f, float pivotY = 0.0f, float scaleX = 1.0f, float scaleY = 1.0f, float translationX = 0.0f, float translationY = 0.0f, java.util.List<? extends androidx.ui.graphics.vector.PathNode> clipPathData = androidx.ui.graphics.vector.VectorKt.EmptyPath, kotlin.jvm.functions.Function1<? super androidx.ui.graphics.vector.VectorAssetBuilder,kotlin.Unit> block);
+ method public static androidx.ui.graphics.vector.VectorAssetBuilder path(androidx.ui.graphics.vector.VectorAssetBuilder, String name = "", androidx.ui.graphics.Brush? fill = null, float fillAlpha = 1.0f, androidx.ui.graphics.Brush? stroke = null, float strokeAlpha = 1.0f, float strokeLineWidth = 0.0f, androidx.ui.graphics.StrokeCap strokeLineCap = androidx.ui.graphics.vector.VectorKt.DefaultStrokeLineCap, androidx.ui.graphics.StrokeJoin strokeLineJoin = androidx.ui.graphics.vector.VectorKt.DefaultStrokeLineJoin, float strokeLineMiter = 4.0f, kotlin.jvm.functions.Function1<? super androidx.ui.graphics.vector.PathBuilder,kotlin.Unit> pathBuilder);
}
public final class VectorAssetKt {
- method @Deprecated public static androidx.ui.core.Modifier drawVector-N7QT3do(androidx.ui.graphics.vector.VectorAsset vectorImage, long tintColor = Color.Transparent, androidx.ui.graphics.BlendMode tintBlendMode = DefaultTintBlendMode, androidx.ui.core.Alignment alignment = Alignment.Center, androidx.ui.core.ContentScale contentScale = ContentScale.Inside);
+ method @Deprecated public static androidx.ui.core.Modifier drawVector-N7QT3do(androidx.ui.graphics.vector.VectorAsset vectorImage, long tintColor = Color.Transparent, androidx.ui.graphics.BlendMode tintBlendMode = androidx.ui.graphics.vector.VectorKt.DefaultTintBlendMode, androidx.ui.core.Alignment alignment = Alignment.Center, androidx.ui.core.ContentScale contentScale = ContentScale.Inside);
}
public final class VectorComposeKt {
- method public static void Group(androidx.ui.graphics.vector.VectorScope, String name = "", float rotation = 0.0f, float pivotX = 0.0f, float pivotY = 0.0f, float scaleX = 1.0f, float scaleY = 1.0f, float translationX = 0.0f, float translationY = 0.0f, java.util.List<? extends androidx.ui.graphics.vector.PathNode> clipPathData = EmptyPath, kotlin.jvm.functions.Function1<? super androidx.ui.graphics.vector.VectorScope,kotlin.Unit> children);
- method public static void Path(androidx.ui.graphics.vector.VectorScope, java.util.List<? extends androidx.ui.graphics.vector.PathNode> pathData, String name = "", androidx.ui.graphics.Brush? fill = null, float fillAlpha = 1.0f, androidx.ui.graphics.Brush? stroke = null, float strokeAlpha = 1.0f, float strokeLineWidth = 0.0f, androidx.ui.graphics.StrokeCap strokeLineCap = DefaultStrokeLineCap, androidx.ui.graphics.StrokeJoin strokeLineJoin = DefaultStrokeLineJoin, float strokeLineMiter = 4.0f);
- method public static androidx.ui.core.Modifier drawVector-DGWccOo(androidx.ui.core.Modifier, float defaultWidth, float defaultHeight, float viewportWidth = defaultWidth.value, float viewportHeight = defaultHeight.value, long tintColor = DefaultTintColor, androidx.ui.graphics.BlendMode tintBlendMode = DefaultTintBlendMode, androidx.ui.core.Alignment alignment = androidx.ui.graphics.vector.VectorComposeKt.DefaultAlignment, androidx.ui.core.ContentScale contentScale = ContentScale.Inside, String name = "", kotlin.jvm.functions.Function3<? super androidx.ui.graphics.vector.VectorScope,? super java.lang.Float,? super java.lang.Float,kotlin.Unit> children);
- method @Deprecated public static androidx.ui.core.Modifier drawVector-coNG3w0(float defaultWidth, float defaultHeight, float viewportWidth = defaultWidth.value, float viewportHeight = defaultHeight.value, long tintColor = DefaultTintColor, androidx.ui.graphics.BlendMode tintBlendMode = DefaultTintBlendMode, androidx.ui.core.Alignment alignment = androidx.ui.graphics.vector.VectorComposeKt.DefaultAlignment, androidx.ui.core.ContentScale contentScale = ContentScale.Inside, String name = "", kotlin.jvm.functions.Function3<? super androidx.ui.graphics.vector.VectorScope,? super java.lang.Float,? super java.lang.Float,kotlin.Unit> children);
- method @Deprecated public static androidx.ui.core.Modifier drawVector-ekZRHcQ(float defaultWidth, float defaultHeight, float viewportWidth = -1.0f, float viewportHeight = -1.0f, long tintColor = DefaultTintColor, androidx.ui.graphics.BlendMode tintBlendMode = DefaultTintBlendMode, androidx.ui.core.Alignment alignment = androidx.ui.graphics.vector.VectorComposeKt.DefaultAlignment, androidx.ui.core.ContentScale contentScale = ContentScale.Inside, String name = "", kotlin.jvm.functions.Function3<? super androidx.ui.graphics.vector.VectorScope,? super java.lang.Float,? super java.lang.Float,kotlin.Unit> children);
+ method public static void Group(androidx.ui.graphics.vector.VectorScope, String name = "", float rotation = 0.0f, float pivotX = 0.0f, float pivotY = 0.0f, float scaleX = 1.0f, float scaleY = 1.0f, float translationX = 0.0f, float translationY = 0.0f, java.util.List<? extends androidx.ui.graphics.vector.PathNode> clipPathData = androidx.ui.graphics.vector.VectorKt.EmptyPath, kotlin.jvm.functions.Function1<? super androidx.ui.graphics.vector.VectorScope,kotlin.Unit> children);
+ method public static void Path(androidx.ui.graphics.vector.VectorScope, java.util.List<? extends androidx.ui.graphics.vector.PathNode> pathData, String name = "", androidx.ui.graphics.Brush? fill = null, float fillAlpha = 1.0f, androidx.ui.graphics.Brush? stroke = null, float strokeAlpha = 1.0f, float strokeLineWidth = 0.0f, androidx.ui.graphics.StrokeCap strokeLineCap = androidx.ui.graphics.vector.VectorKt.DefaultStrokeLineCap, androidx.ui.graphics.StrokeJoin strokeLineJoin = androidx.ui.graphics.vector.VectorKt.DefaultStrokeLineJoin, float strokeLineMiter = 4.0f);
+ method public static androidx.ui.core.Modifier drawVector-DGWccOo(androidx.ui.core.Modifier, float defaultWidth, float defaultHeight, float viewportWidth = defaultWidth.value, float viewportHeight = defaultHeight.value, long tintColor = androidx.ui.graphics.vector.VectorKt.DefaultTintColor, androidx.ui.graphics.BlendMode tintBlendMode = androidx.ui.graphics.vector.VectorKt.DefaultTintBlendMode, androidx.ui.core.Alignment alignment = androidx.ui.graphics.vector.VectorComposeKt.DefaultAlignment, androidx.ui.core.ContentScale contentScale = ContentScale.Inside, String name = "", kotlin.jvm.functions.Function3<? super androidx.ui.graphics.vector.VectorScope,? super java.lang.Float,? super java.lang.Float,kotlin.Unit> children);
+ method @Deprecated public static androidx.ui.core.Modifier drawVector-coNG3w0(float defaultWidth, float defaultHeight, float viewportWidth = defaultWidth.value, float viewportHeight = defaultHeight.value, long tintColor = androidx.ui.graphics.vector.VectorKt.DefaultTintColor, androidx.ui.graphics.BlendMode tintBlendMode = androidx.ui.graphics.vector.VectorKt.DefaultTintBlendMode, androidx.ui.core.Alignment alignment = androidx.ui.graphics.vector.VectorComposeKt.DefaultAlignment, androidx.ui.core.ContentScale contentScale = ContentScale.Inside, String name = "", kotlin.jvm.functions.Function3<? super androidx.ui.graphics.vector.VectorScope,? super java.lang.Float,? super java.lang.Float,kotlin.Unit> children);
+ method @Deprecated public static androidx.ui.core.Modifier drawVector-ekZRHcQ(float defaultWidth, float defaultHeight, float viewportWidth = -1.0f, float viewportHeight = -1.0f, long tintColor = androidx.ui.graphics.vector.VectorKt.DefaultTintColor, androidx.ui.graphics.BlendMode tintBlendMode = androidx.ui.graphics.vector.VectorKt.DefaultTintBlendMode, androidx.ui.core.Alignment alignment = androidx.ui.graphics.vector.VectorComposeKt.DefaultAlignment, androidx.ui.core.ContentScale contentScale = ContentScale.Inside, String name = "", kotlin.jvm.functions.Function3<? super androidx.ui.graphics.vector.VectorScope,? super java.lang.Float,? super java.lang.Float,kotlin.Unit> children);
}
public final class VectorGroup extends androidx.ui.graphics.vector.VectorNode implements java.lang.Iterable<androidx.ui.graphics.vector.VectorNode> kotlin.jvm.internal.markers.KMappedMarker {
@@ -412,7 +412,7 @@
public final class VectorPainter extends androidx.ui.graphics.painter.Painter {
method public androidx.ui.unit.PxSize getIntrinsicSize();
- method protected void onDraw(androidx.ui.graphics.Canvas canvas, androidx.ui.unit.PxSize bounds);
+ method protected void onDraw(androidx.ui.graphics.painter.CanvasScope);
property public androidx.ui.unit.PxSize intrinsicSize;
}
diff --git a/ui/ui-framework/api/api_lint.ignore b/ui/ui-framework/api/api_lint.ignore
index 5c5d2af..ed3f664 100644
--- a/ui/ui-framework/api/api_lint.ignore
+++ b/ui/ui-framework/api/api_lint.ignore
@@ -1,4 +1,6 @@
// Baseline format: 1.0
+AcronymName: androidx.ui.core.DrawShadowKt#drawShadow-xWKVMPI(androidx.ui.core.Modifier, float, androidx.ui.graphics.Shape, boolean, float):
+ Acronyms should not be capitalized in method names: was `drawShadow-xWKVMPI`, should this be `drawShadow-xWkvmpi`?
AcronymName: androidx.ui.graphics.vector.VectorComposeKt#drawVector-DGWccOo(androidx.ui.core.Modifier, float, float, float, float, long, androidx.ui.graphics.BlendMode, androidx.ui.core.Alignment, androidx.ui.core.ContentScale, String, kotlin.jvm.functions.Function3<? super androidx.ui.graphics.vector.VectorScope,? super java.lang.Float,? super java.lang.Float,kotlin.Unit>):
Acronyms should not be capitalized in method names: was `drawVector-DGWccOo`, should this be `drawVector-DgWccOo`?
diff --git a/ui/ui-framework/api/current.txt b/ui/ui-framework/api/current.txt
index c1e4b72..928f12f0 100644
--- a/ui/ui-framework/api/current.txt
+++ b/ui/ui-framework/api/current.txt
@@ -23,7 +23,7 @@
public final class DrawShadowKt {
method @Deprecated public static androidx.ui.core.Modifier drawShadow-IFvMOQI(androidx.ui.graphics.Shape shape, float elevation, boolean clipToOutline = true, @FloatRange(from=0.0, to=1.0) float opacity = 1f);
- method public static androidx.ui.core.Modifier drawShadow-xWKVMPI(androidx.ui.core.Modifier, float elevation, androidx.ui.graphics.Shape shape = RectangleShape, boolean clipToOutline = elevation > 0.dp, @FloatRange(from=0.0, to=1.0) float opacity = 1f);
+ method public static androidx.ui.core.Modifier drawShadow-xWKVMPI(androidx.ui.core.Modifier, float elevation, androidx.ui.graphics.Shape shape = androidx.ui.graphics.RectangleShapeKt.RectangleShape, boolean clipToOutline = elevation > 0.dp, @FloatRange(from=0.0, to=1.0) float opacity = 1f);
}
public enum DropDownAlignment {
@@ -361,7 +361,7 @@
}
public final class VectorAssetBuilder {
- method public androidx.ui.graphics.vector.VectorAssetBuilder addPath(java.util.List<? extends androidx.ui.graphics.vector.PathNode> pathData, String name = "", androidx.ui.graphics.Brush? fill = null, float fillAlpha = 1.0f, androidx.ui.graphics.Brush? stroke = null, float strokeAlpha = 1.0f, float strokeLineWidth = 0.0f, androidx.ui.graphics.StrokeCap strokeLineCap = DefaultStrokeLineCap, androidx.ui.graphics.StrokeJoin strokeLineJoin = DefaultStrokeLineJoin, float strokeLineMiter = 4.0f);
+ method public androidx.ui.graphics.vector.VectorAssetBuilder addPath(java.util.List<? extends androidx.ui.graphics.vector.PathNode> pathData, String name = "", androidx.ui.graphics.Brush? fill = null, float fillAlpha = 1.0f, androidx.ui.graphics.Brush? stroke = null, float strokeAlpha = 1.0f, float strokeLineWidth = 0.0f, androidx.ui.graphics.StrokeCap strokeLineCap = androidx.ui.graphics.vector.VectorKt.DefaultStrokeLineCap, androidx.ui.graphics.StrokeJoin strokeLineJoin = androidx.ui.graphics.vector.VectorKt.DefaultStrokeLineJoin, float strokeLineMiter = 4.0f);
method public androidx.ui.graphics.vector.VectorAsset build();
method public float getDefaultHeight();
method public float getDefaultWidth();
@@ -369,24 +369,24 @@
method public float getViewportHeight();
method public float getViewportWidth();
method public androidx.ui.graphics.vector.VectorAssetBuilder popGroup();
- method public androidx.ui.graphics.vector.VectorAssetBuilder pushGroup(String name = "", float rotate = 0.0f, float pivotX = 0.0f, float pivotY = 0.0f, float scaleX = 1.0f, float scaleY = 1.0f, float translationX = 0.0f, float translationY = 0.0f, java.util.List<? extends androidx.ui.graphics.vector.PathNode> clipPathData = EmptyPath);
+ method public androidx.ui.graphics.vector.VectorAssetBuilder pushGroup(String name = "", float rotate = 0.0f, float pivotX = 0.0f, float pivotY = 0.0f, float scaleX = 1.0f, float scaleY = 1.0f, float translationX = 0.0f, float translationY = 0.0f, java.util.List<? extends androidx.ui.graphics.vector.PathNode> clipPathData = androidx.ui.graphics.vector.VectorKt.EmptyPath);
}
public final class VectorAssetBuilderKt {
- method public static androidx.ui.graphics.vector.VectorAssetBuilder group(androidx.ui.graphics.vector.VectorAssetBuilder, String name = "", float rotate = 0.0f, float pivotX = 0.0f, float pivotY = 0.0f, float scaleX = 1.0f, float scaleY = 1.0f, float translationX = 0.0f, float translationY = 0.0f, java.util.List<? extends androidx.ui.graphics.vector.PathNode> clipPathData = EmptyPath, kotlin.jvm.functions.Function1<? super androidx.ui.graphics.vector.VectorAssetBuilder,kotlin.Unit> block);
- method public static androidx.ui.graphics.vector.VectorAssetBuilder path(androidx.ui.graphics.vector.VectorAssetBuilder, String name = "", androidx.ui.graphics.Brush? fill = null, float fillAlpha = 1.0f, androidx.ui.graphics.Brush? stroke = null, float strokeAlpha = 1.0f, float strokeLineWidth = 0.0f, androidx.ui.graphics.StrokeCap strokeLineCap = DefaultStrokeLineCap, androidx.ui.graphics.StrokeJoin strokeLineJoin = DefaultStrokeLineJoin, float strokeLineMiter = 4.0f, kotlin.jvm.functions.Function1<? super androidx.ui.graphics.vector.PathBuilder,kotlin.Unit> pathBuilder);
+ method public static androidx.ui.graphics.vector.VectorAssetBuilder group(androidx.ui.graphics.vector.VectorAssetBuilder, String name = "", float rotate = 0.0f, float pivotX = 0.0f, float pivotY = 0.0f, float scaleX = 1.0f, float scaleY = 1.0f, float translationX = 0.0f, float translationY = 0.0f, java.util.List<? extends androidx.ui.graphics.vector.PathNode> clipPathData = androidx.ui.graphics.vector.VectorKt.EmptyPath, kotlin.jvm.functions.Function1<? super androidx.ui.graphics.vector.VectorAssetBuilder,kotlin.Unit> block);
+ method public static androidx.ui.graphics.vector.VectorAssetBuilder path(androidx.ui.graphics.vector.VectorAssetBuilder, String name = "", androidx.ui.graphics.Brush? fill = null, float fillAlpha = 1.0f, androidx.ui.graphics.Brush? stroke = null, float strokeAlpha = 1.0f, float strokeLineWidth = 0.0f, androidx.ui.graphics.StrokeCap strokeLineCap = androidx.ui.graphics.vector.VectorKt.DefaultStrokeLineCap, androidx.ui.graphics.StrokeJoin strokeLineJoin = androidx.ui.graphics.vector.VectorKt.DefaultStrokeLineJoin, float strokeLineMiter = 4.0f, kotlin.jvm.functions.Function1<? super androidx.ui.graphics.vector.PathBuilder,kotlin.Unit> pathBuilder);
}
public final class VectorAssetKt {
- method @Deprecated public static androidx.ui.core.Modifier drawVector-N7QT3do(androidx.ui.graphics.vector.VectorAsset vectorImage, long tintColor = Color.Transparent, androidx.ui.graphics.BlendMode tintBlendMode = DefaultTintBlendMode, androidx.ui.core.Alignment alignment = Alignment.Center, androidx.ui.core.ContentScale contentScale = ContentScale.Inside);
+ method @Deprecated public static androidx.ui.core.Modifier drawVector-N7QT3do(androidx.ui.graphics.vector.VectorAsset vectorImage, long tintColor = Color.Transparent, androidx.ui.graphics.BlendMode tintBlendMode = androidx.ui.graphics.vector.VectorKt.DefaultTintBlendMode, androidx.ui.core.Alignment alignment = Alignment.Center, androidx.ui.core.ContentScale contentScale = ContentScale.Inside);
}
public final class VectorComposeKt {
- method public static void Group(androidx.ui.graphics.vector.VectorScope, String name = "", float rotation = 0.0f, float pivotX = 0.0f, float pivotY = 0.0f, float scaleX = 1.0f, float scaleY = 1.0f, float translationX = 0.0f, float translationY = 0.0f, java.util.List<? extends androidx.ui.graphics.vector.PathNode> clipPathData = EmptyPath, kotlin.jvm.functions.Function1<? super androidx.ui.graphics.vector.VectorScope,kotlin.Unit> children);
- method public static void Path(androidx.ui.graphics.vector.VectorScope, java.util.List<? extends androidx.ui.graphics.vector.PathNode> pathData, String name = "", androidx.ui.graphics.Brush? fill = null, float fillAlpha = 1.0f, androidx.ui.graphics.Brush? stroke = null, float strokeAlpha = 1.0f, float strokeLineWidth = 0.0f, androidx.ui.graphics.StrokeCap strokeLineCap = DefaultStrokeLineCap, androidx.ui.graphics.StrokeJoin strokeLineJoin = DefaultStrokeLineJoin, float strokeLineMiter = 4.0f);
- method public static androidx.ui.core.Modifier drawVector-DGWccOo(androidx.ui.core.Modifier, float defaultWidth, float defaultHeight, float viewportWidth = defaultWidth.value, float viewportHeight = defaultHeight.value, long tintColor = DefaultTintColor, androidx.ui.graphics.BlendMode tintBlendMode = DefaultTintBlendMode, androidx.ui.core.Alignment alignment = androidx.ui.graphics.vector.VectorComposeKt.DefaultAlignment, androidx.ui.core.ContentScale contentScale = ContentScale.Inside, String name = "", kotlin.jvm.functions.Function3<? super androidx.ui.graphics.vector.VectorScope,? super java.lang.Float,? super java.lang.Float,kotlin.Unit> children);
- method @Deprecated public static androidx.ui.core.Modifier drawVector-coNG3w0(float defaultWidth, float defaultHeight, float viewportWidth = defaultWidth.value, float viewportHeight = defaultHeight.value, long tintColor = DefaultTintColor, androidx.ui.graphics.BlendMode tintBlendMode = DefaultTintBlendMode, androidx.ui.core.Alignment alignment = androidx.ui.graphics.vector.VectorComposeKt.DefaultAlignment, androidx.ui.core.ContentScale contentScale = ContentScale.Inside, String name = "", kotlin.jvm.functions.Function3<? super androidx.ui.graphics.vector.VectorScope,? super java.lang.Float,? super java.lang.Float,kotlin.Unit> children);
- method @Deprecated public static androidx.ui.core.Modifier drawVector-ekZRHcQ(float defaultWidth, float defaultHeight, float viewportWidth = -1.0f, float viewportHeight = -1.0f, long tintColor = DefaultTintColor, androidx.ui.graphics.BlendMode tintBlendMode = DefaultTintBlendMode, androidx.ui.core.Alignment alignment = androidx.ui.graphics.vector.VectorComposeKt.DefaultAlignment, androidx.ui.core.ContentScale contentScale = ContentScale.Inside, String name = "", kotlin.jvm.functions.Function3<? super androidx.ui.graphics.vector.VectorScope,? super java.lang.Float,? super java.lang.Float,kotlin.Unit> children);
+ method public static void Group(androidx.ui.graphics.vector.VectorScope, String name = "", float rotation = 0.0f, float pivotX = 0.0f, float pivotY = 0.0f, float scaleX = 1.0f, float scaleY = 1.0f, float translationX = 0.0f, float translationY = 0.0f, java.util.List<? extends androidx.ui.graphics.vector.PathNode> clipPathData = androidx.ui.graphics.vector.VectorKt.EmptyPath, kotlin.jvm.functions.Function1<? super androidx.ui.graphics.vector.VectorScope,kotlin.Unit> children);
+ method public static void Path(androidx.ui.graphics.vector.VectorScope, java.util.List<? extends androidx.ui.graphics.vector.PathNode> pathData, String name = "", androidx.ui.graphics.Brush? fill = null, float fillAlpha = 1.0f, androidx.ui.graphics.Brush? stroke = null, float strokeAlpha = 1.0f, float strokeLineWidth = 0.0f, androidx.ui.graphics.StrokeCap strokeLineCap = androidx.ui.graphics.vector.VectorKt.DefaultStrokeLineCap, androidx.ui.graphics.StrokeJoin strokeLineJoin = androidx.ui.graphics.vector.VectorKt.DefaultStrokeLineJoin, float strokeLineMiter = 4.0f);
+ method public static androidx.ui.core.Modifier drawVector-DGWccOo(androidx.ui.core.Modifier, float defaultWidth, float defaultHeight, float viewportWidth = defaultWidth.value, float viewportHeight = defaultHeight.value, long tintColor = androidx.ui.graphics.vector.VectorKt.DefaultTintColor, androidx.ui.graphics.BlendMode tintBlendMode = androidx.ui.graphics.vector.VectorKt.DefaultTintBlendMode, androidx.ui.core.Alignment alignment = androidx.ui.graphics.vector.VectorComposeKt.DefaultAlignment, androidx.ui.core.ContentScale contentScale = ContentScale.Inside, String name = "", kotlin.jvm.functions.Function3<? super androidx.ui.graphics.vector.VectorScope,? super java.lang.Float,? super java.lang.Float,kotlin.Unit> children);
+ method @Deprecated public static androidx.ui.core.Modifier drawVector-coNG3w0(float defaultWidth, float defaultHeight, float viewportWidth = defaultWidth.value, float viewportHeight = defaultHeight.value, long tintColor = androidx.ui.graphics.vector.VectorKt.DefaultTintColor, androidx.ui.graphics.BlendMode tintBlendMode = androidx.ui.graphics.vector.VectorKt.DefaultTintBlendMode, androidx.ui.core.Alignment alignment = androidx.ui.graphics.vector.VectorComposeKt.DefaultAlignment, androidx.ui.core.ContentScale contentScale = ContentScale.Inside, String name = "", kotlin.jvm.functions.Function3<? super androidx.ui.graphics.vector.VectorScope,? super java.lang.Float,? super java.lang.Float,kotlin.Unit> children);
+ method @Deprecated public static androidx.ui.core.Modifier drawVector-ekZRHcQ(float defaultWidth, float defaultHeight, float viewportWidth = -1.0f, float viewportHeight = -1.0f, long tintColor = androidx.ui.graphics.vector.VectorKt.DefaultTintColor, androidx.ui.graphics.BlendMode tintBlendMode = androidx.ui.graphics.vector.VectorKt.DefaultTintBlendMode, androidx.ui.core.Alignment alignment = androidx.ui.graphics.vector.VectorComposeKt.DefaultAlignment, androidx.ui.core.ContentScale contentScale = ContentScale.Inside, String name = "", kotlin.jvm.functions.Function3<? super androidx.ui.graphics.vector.VectorScope,? super java.lang.Float,? super java.lang.Float,kotlin.Unit> children);
}
public final class VectorGroup extends androidx.ui.graphics.vector.VectorNode implements java.lang.Iterable<androidx.ui.graphics.vector.VectorNode> kotlin.jvm.internal.markers.KMappedMarker {
@@ -412,7 +412,7 @@
public final class VectorPainter extends androidx.ui.graphics.painter.Painter {
method public androidx.ui.unit.PxSize getIntrinsicSize();
- method protected void onDraw(androidx.ui.graphics.Canvas canvas, androidx.ui.unit.PxSize bounds);
+ method protected void onDraw(androidx.ui.graphics.painter.CanvasScope);
property public androidx.ui.unit.PxSize intrinsicSize;
}
diff --git a/ui/ui-framework/api/public_plus_experimental_0.1.0-dev11.txt b/ui/ui-framework/api/public_plus_experimental_0.1.0-dev11.txt
index c1e4b72..928f12f0 100644
--- a/ui/ui-framework/api/public_plus_experimental_0.1.0-dev11.txt
+++ b/ui/ui-framework/api/public_plus_experimental_0.1.0-dev11.txt
@@ -23,7 +23,7 @@
public final class DrawShadowKt {
method @Deprecated public static androidx.ui.core.Modifier drawShadow-IFvMOQI(androidx.ui.graphics.Shape shape, float elevation, boolean clipToOutline = true, @FloatRange(from=0.0, to=1.0) float opacity = 1f);
- method public static androidx.ui.core.Modifier drawShadow-xWKVMPI(androidx.ui.core.Modifier, float elevation, androidx.ui.graphics.Shape shape = RectangleShape, boolean clipToOutline = elevation > 0.dp, @FloatRange(from=0.0, to=1.0) float opacity = 1f);
+ method public static androidx.ui.core.Modifier drawShadow-xWKVMPI(androidx.ui.core.Modifier, float elevation, androidx.ui.graphics.Shape shape = androidx.ui.graphics.RectangleShapeKt.RectangleShape, boolean clipToOutline = elevation > 0.dp, @FloatRange(from=0.0, to=1.0) float opacity = 1f);
}
public enum DropDownAlignment {
@@ -361,7 +361,7 @@
}
public final class VectorAssetBuilder {
- method public androidx.ui.graphics.vector.VectorAssetBuilder addPath(java.util.List<? extends androidx.ui.graphics.vector.PathNode> pathData, String name = "", androidx.ui.graphics.Brush? fill = null, float fillAlpha = 1.0f, androidx.ui.graphics.Brush? stroke = null, float strokeAlpha = 1.0f, float strokeLineWidth = 0.0f, androidx.ui.graphics.StrokeCap strokeLineCap = DefaultStrokeLineCap, androidx.ui.graphics.StrokeJoin strokeLineJoin = DefaultStrokeLineJoin, float strokeLineMiter = 4.0f);
+ method public androidx.ui.graphics.vector.VectorAssetBuilder addPath(java.util.List<? extends androidx.ui.graphics.vector.PathNode> pathData, String name = "", androidx.ui.graphics.Brush? fill = null, float fillAlpha = 1.0f, androidx.ui.graphics.Brush? stroke = null, float strokeAlpha = 1.0f, float strokeLineWidth = 0.0f, androidx.ui.graphics.StrokeCap strokeLineCap = androidx.ui.graphics.vector.VectorKt.DefaultStrokeLineCap, androidx.ui.graphics.StrokeJoin strokeLineJoin = androidx.ui.graphics.vector.VectorKt.DefaultStrokeLineJoin, float strokeLineMiter = 4.0f);
method public androidx.ui.graphics.vector.VectorAsset build();
method public float getDefaultHeight();
method public float getDefaultWidth();
@@ -369,24 +369,24 @@
method public float getViewportHeight();
method public float getViewportWidth();
method public androidx.ui.graphics.vector.VectorAssetBuilder popGroup();
- method public androidx.ui.graphics.vector.VectorAssetBuilder pushGroup(String name = "", float rotate = 0.0f, float pivotX = 0.0f, float pivotY = 0.0f, float scaleX = 1.0f, float scaleY = 1.0f, float translationX = 0.0f, float translationY = 0.0f, java.util.List<? extends androidx.ui.graphics.vector.PathNode> clipPathData = EmptyPath);
+ method public androidx.ui.graphics.vector.VectorAssetBuilder pushGroup(String name = "", float rotate = 0.0f, float pivotX = 0.0f, float pivotY = 0.0f, float scaleX = 1.0f, float scaleY = 1.0f, float translationX = 0.0f, float translationY = 0.0f, java.util.List<? extends androidx.ui.graphics.vector.PathNode> clipPathData = androidx.ui.graphics.vector.VectorKt.EmptyPath);
}
public final class VectorAssetBuilderKt {
- method public static androidx.ui.graphics.vector.VectorAssetBuilder group(androidx.ui.graphics.vector.VectorAssetBuilder, String name = "", float rotate = 0.0f, float pivotX = 0.0f, float pivotY = 0.0f, float scaleX = 1.0f, float scaleY = 1.0f, float translationX = 0.0f, float translationY = 0.0f, java.util.List<? extends androidx.ui.graphics.vector.PathNode> clipPathData = EmptyPath, kotlin.jvm.functions.Function1<? super androidx.ui.graphics.vector.VectorAssetBuilder,kotlin.Unit> block);
- method public static androidx.ui.graphics.vector.VectorAssetBuilder path(androidx.ui.graphics.vector.VectorAssetBuilder, String name = "", androidx.ui.graphics.Brush? fill = null, float fillAlpha = 1.0f, androidx.ui.graphics.Brush? stroke = null, float strokeAlpha = 1.0f, float strokeLineWidth = 0.0f, androidx.ui.graphics.StrokeCap strokeLineCap = DefaultStrokeLineCap, androidx.ui.graphics.StrokeJoin strokeLineJoin = DefaultStrokeLineJoin, float strokeLineMiter = 4.0f, kotlin.jvm.functions.Function1<? super androidx.ui.graphics.vector.PathBuilder,kotlin.Unit> pathBuilder);
+ method public static androidx.ui.graphics.vector.VectorAssetBuilder group(androidx.ui.graphics.vector.VectorAssetBuilder, String name = "", float rotate = 0.0f, float pivotX = 0.0f, float pivotY = 0.0f, float scaleX = 1.0f, float scaleY = 1.0f, float translationX = 0.0f, float translationY = 0.0f, java.util.List<? extends androidx.ui.graphics.vector.PathNode> clipPathData = androidx.ui.graphics.vector.VectorKt.EmptyPath, kotlin.jvm.functions.Function1<? super androidx.ui.graphics.vector.VectorAssetBuilder,kotlin.Unit> block);
+ method public static androidx.ui.graphics.vector.VectorAssetBuilder path(androidx.ui.graphics.vector.VectorAssetBuilder, String name = "", androidx.ui.graphics.Brush? fill = null, float fillAlpha = 1.0f, androidx.ui.graphics.Brush? stroke = null, float strokeAlpha = 1.0f, float strokeLineWidth = 0.0f, androidx.ui.graphics.StrokeCap strokeLineCap = androidx.ui.graphics.vector.VectorKt.DefaultStrokeLineCap, androidx.ui.graphics.StrokeJoin strokeLineJoin = androidx.ui.graphics.vector.VectorKt.DefaultStrokeLineJoin, float strokeLineMiter = 4.0f, kotlin.jvm.functions.Function1<? super androidx.ui.graphics.vector.PathBuilder,kotlin.Unit> pathBuilder);
}
public final class VectorAssetKt {
- method @Deprecated public static androidx.ui.core.Modifier drawVector-N7QT3do(androidx.ui.graphics.vector.VectorAsset vectorImage, long tintColor = Color.Transparent, androidx.ui.graphics.BlendMode tintBlendMode = DefaultTintBlendMode, androidx.ui.core.Alignment alignment = Alignment.Center, androidx.ui.core.ContentScale contentScale = ContentScale.Inside);
+ method @Deprecated public static androidx.ui.core.Modifier drawVector-N7QT3do(androidx.ui.graphics.vector.VectorAsset vectorImage, long tintColor = Color.Transparent, androidx.ui.graphics.BlendMode tintBlendMode = androidx.ui.graphics.vector.VectorKt.DefaultTintBlendMode, androidx.ui.core.Alignment alignment = Alignment.Center, androidx.ui.core.ContentScale contentScale = ContentScale.Inside);
}
public final class VectorComposeKt {
- method public static void Group(androidx.ui.graphics.vector.VectorScope, String name = "", float rotation = 0.0f, float pivotX = 0.0f, float pivotY = 0.0f, float scaleX = 1.0f, float scaleY = 1.0f, float translationX = 0.0f, float translationY = 0.0f, java.util.List<? extends androidx.ui.graphics.vector.PathNode> clipPathData = EmptyPath, kotlin.jvm.functions.Function1<? super androidx.ui.graphics.vector.VectorScope,kotlin.Unit> children);
- method public static void Path(androidx.ui.graphics.vector.VectorScope, java.util.List<? extends androidx.ui.graphics.vector.PathNode> pathData, String name = "", androidx.ui.graphics.Brush? fill = null, float fillAlpha = 1.0f, androidx.ui.graphics.Brush? stroke = null, float strokeAlpha = 1.0f, float strokeLineWidth = 0.0f, androidx.ui.graphics.StrokeCap strokeLineCap = DefaultStrokeLineCap, androidx.ui.graphics.StrokeJoin strokeLineJoin = DefaultStrokeLineJoin, float strokeLineMiter = 4.0f);
- method public static androidx.ui.core.Modifier drawVector-DGWccOo(androidx.ui.core.Modifier, float defaultWidth, float defaultHeight, float viewportWidth = defaultWidth.value, float viewportHeight = defaultHeight.value, long tintColor = DefaultTintColor, androidx.ui.graphics.BlendMode tintBlendMode = DefaultTintBlendMode, androidx.ui.core.Alignment alignment = androidx.ui.graphics.vector.VectorComposeKt.DefaultAlignment, androidx.ui.core.ContentScale contentScale = ContentScale.Inside, String name = "", kotlin.jvm.functions.Function3<? super androidx.ui.graphics.vector.VectorScope,? super java.lang.Float,? super java.lang.Float,kotlin.Unit> children);
- method @Deprecated public static androidx.ui.core.Modifier drawVector-coNG3w0(float defaultWidth, float defaultHeight, float viewportWidth = defaultWidth.value, float viewportHeight = defaultHeight.value, long tintColor = DefaultTintColor, androidx.ui.graphics.BlendMode tintBlendMode = DefaultTintBlendMode, androidx.ui.core.Alignment alignment = androidx.ui.graphics.vector.VectorComposeKt.DefaultAlignment, androidx.ui.core.ContentScale contentScale = ContentScale.Inside, String name = "", kotlin.jvm.functions.Function3<? super androidx.ui.graphics.vector.VectorScope,? super java.lang.Float,? super java.lang.Float,kotlin.Unit> children);
- method @Deprecated public static androidx.ui.core.Modifier drawVector-ekZRHcQ(float defaultWidth, float defaultHeight, float viewportWidth = -1.0f, float viewportHeight = -1.0f, long tintColor = DefaultTintColor, androidx.ui.graphics.BlendMode tintBlendMode = DefaultTintBlendMode, androidx.ui.core.Alignment alignment = androidx.ui.graphics.vector.VectorComposeKt.DefaultAlignment, androidx.ui.core.ContentScale contentScale = ContentScale.Inside, String name = "", kotlin.jvm.functions.Function3<? super androidx.ui.graphics.vector.VectorScope,? super java.lang.Float,? super java.lang.Float,kotlin.Unit> children);
+ method public static void Group(androidx.ui.graphics.vector.VectorScope, String name = "", float rotation = 0.0f, float pivotX = 0.0f, float pivotY = 0.0f, float scaleX = 1.0f, float scaleY = 1.0f, float translationX = 0.0f, float translationY = 0.0f, java.util.List<? extends androidx.ui.graphics.vector.PathNode> clipPathData = androidx.ui.graphics.vector.VectorKt.EmptyPath, kotlin.jvm.functions.Function1<? super androidx.ui.graphics.vector.VectorScope,kotlin.Unit> children);
+ method public static void Path(androidx.ui.graphics.vector.VectorScope, java.util.List<? extends androidx.ui.graphics.vector.PathNode> pathData, String name = "", androidx.ui.graphics.Brush? fill = null, float fillAlpha = 1.0f, androidx.ui.graphics.Brush? stroke = null, float strokeAlpha = 1.0f, float strokeLineWidth = 0.0f, androidx.ui.graphics.StrokeCap strokeLineCap = androidx.ui.graphics.vector.VectorKt.DefaultStrokeLineCap, androidx.ui.graphics.StrokeJoin strokeLineJoin = androidx.ui.graphics.vector.VectorKt.DefaultStrokeLineJoin, float strokeLineMiter = 4.0f);
+ method public static androidx.ui.core.Modifier drawVector-DGWccOo(androidx.ui.core.Modifier, float defaultWidth, float defaultHeight, float viewportWidth = defaultWidth.value, float viewportHeight = defaultHeight.value, long tintColor = androidx.ui.graphics.vector.VectorKt.DefaultTintColor, androidx.ui.graphics.BlendMode tintBlendMode = androidx.ui.graphics.vector.VectorKt.DefaultTintBlendMode, androidx.ui.core.Alignment alignment = androidx.ui.graphics.vector.VectorComposeKt.DefaultAlignment, androidx.ui.core.ContentScale contentScale = ContentScale.Inside, String name = "", kotlin.jvm.functions.Function3<? super androidx.ui.graphics.vector.VectorScope,? super java.lang.Float,? super java.lang.Float,kotlin.Unit> children);
+ method @Deprecated public static androidx.ui.core.Modifier drawVector-coNG3w0(float defaultWidth, float defaultHeight, float viewportWidth = defaultWidth.value, float viewportHeight = defaultHeight.value, long tintColor = androidx.ui.graphics.vector.VectorKt.DefaultTintColor, androidx.ui.graphics.BlendMode tintBlendMode = androidx.ui.graphics.vector.VectorKt.DefaultTintBlendMode, androidx.ui.core.Alignment alignment = androidx.ui.graphics.vector.VectorComposeKt.DefaultAlignment, androidx.ui.core.ContentScale contentScale = ContentScale.Inside, String name = "", kotlin.jvm.functions.Function3<? super androidx.ui.graphics.vector.VectorScope,? super java.lang.Float,? super java.lang.Float,kotlin.Unit> children);
+ method @Deprecated public static androidx.ui.core.Modifier drawVector-ekZRHcQ(float defaultWidth, float defaultHeight, float viewportWidth = -1.0f, float viewportHeight = -1.0f, long tintColor = androidx.ui.graphics.vector.VectorKt.DefaultTintColor, androidx.ui.graphics.BlendMode tintBlendMode = androidx.ui.graphics.vector.VectorKt.DefaultTintBlendMode, androidx.ui.core.Alignment alignment = androidx.ui.graphics.vector.VectorComposeKt.DefaultAlignment, androidx.ui.core.ContentScale contentScale = ContentScale.Inside, String name = "", kotlin.jvm.functions.Function3<? super androidx.ui.graphics.vector.VectorScope,? super java.lang.Float,? super java.lang.Float,kotlin.Unit> children);
}
public final class VectorGroup extends androidx.ui.graphics.vector.VectorNode implements java.lang.Iterable<androidx.ui.graphics.vector.VectorNode> kotlin.jvm.internal.markers.KMappedMarker {
@@ -412,7 +412,7 @@
public final class VectorPainter extends androidx.ui.graphics.painter.Painter {
method public androidx.ui.unit.PxSize getIntrinsicSize();
- method protected void onDraw(androidx.ui.graphics.Canvas canvas, androidx.ui.unit.PxSize bounds);
+ method protected void onDraw(androidx.ui.graphics.painter.CanvasScope);
property public androidx.ui.unit.PxSize intrinsicSize;
}
diff --git a/ui/ui-framework/api/public_plus_experimental_current.txt b/ui/ui-framework/api/public_plus_experimental_current.txt
index c1e4b72..928f12f0 100644
--- a/ui/ui-framework/api/public_plus_experimental_current.txt
+++ b/ui/ui-framework/api/public_plus_experimental_current.txt
@@ -23,7 +23,7 @@
public final class DrawShadowKt {
method @Deprecated public static androidx.ui.core.Modifier drawShadow-IFvMOQI(androidx.ui.graphics.Shape shape, float elevation, boolean clipToOutline = true, @FloatRange(from=0.0, to=1.0) float opacity = 1f);
- method public static androidx.ui.core.Modifier drawShadow-xWKVMPI(androidx.ui.core.Modifier, float elevation, androidx.ui.graphics.Shape shape = RectangleShape, boolean clipToOutline = elevation > 0.dp, @FloatRange(from=0.0, to=1.0) float opacity = 1f);
+ method public static androidx.ui.core.Modifier drawShadow-xWKVMPI(androidx.ui.core.Modifier, float elevation, androidx.ui.graphics.Shape shape = androidx.ui.graphics.RectangleShapeKt.RectangleShape, boolean clipToOutline = elevation > 0.dp, @FloatRange(from=0.0, to=1.0) float opacity = 1f);
}
public enum DropDownAlignment {
@@ -361,7 +361,7 @@
}
public final class VectorAssetBuilder {
- method public androidx.ui.graphics.vector.VectorAssetBuilder addPath(java.util.List<? extends androidx.ui.graphics.vector.PathNode> pathData, String name = "", androidx.ui.graphics.Brush? fill = null, float fillAlpha = 1.0f, androidx.ui.graphics.Brush? stroke = null, float strokeAlpha = 1.0f, float strokeLineWidth = 0.0f, androidx.ui.graphics.StrokeCap strokeLineCap = DefaultStrokeLineCap, androidx.ui.graphics.StrokeJoin strokeLineJoin = DefaultStrokeLineJoin, float strokeLineMiter = 4.0f);
+ method public androidx.ui.graphics.vector.VectorAssetBuilder addPath(java.util.List<? extends androidx.ui.graphics.vector.PathNode> pathData, String name = "", androidx.ui.graphics.Brush? fill = null, float fillAlpha = 1.0f, androidx.ui.graphics.Brush? stroke = null, float strokeAlpha = 1.0f, float strokeLineWidth = 0.0f, androidx.ui.graphics.StrokeCap strokeLineCap = androidx.ui.graphics.vector.VectorKt.DefaultStrokeLineCap, androidx.ui.graphics.StrokeJoin strokeLineJoin = androidx.ui.graphics.vector.VectorKt.DefaultStrokeLineJoin, float strokeLineMiter = 4.0f);
method public androidx.ui.graphics.vector.VectorAsset build();
method public float getDefaultHeight();
method public float getDefaultWidth();
@@ -369,24 +369,24 @@
method public float getViewportHeight();
method public float getViewportWidth();
method public androidx.ui.graphics.vector.VectorAssetBuilder popGroup();
- method public androidx.ui.graphics.vector.VectorAssetBuilder pushGroup(String name = "", float rotate = 0.0f, float pivotX = 0.0f, float pivotY = 0.0f, float scaleX = 1.0f, float scaleY = 1.0f, float translationX = 0.0f, float translationY = 0.0f, java.util.List<? extends androidx.ui.graphics.vector.PathNode> clipPathData = EmptyPath);
+ method public androidx.ui.graphics.vector.VectorAssetBuilder pushGroup(String name = "", float rotate = 0.0f, float pivotX = 0.0f, float pivotY = 0.0f, float scaleX = 1.0f, float scaleY = 1.0f, float translationX = 0.0f, float translationY = 0.0f, java.util.List<? extends androidx.ui.graphics.vector.PathNode> clipPathData = androidx.ui.graphics.vector.VectorKt.EmptyPath);
}
public final class VectorAssetBuilderKt {
- method public static androidx.ui.graphics.vector.VectorAssetBuilder group(androidx.ui.graphics.vector.VectorAssetBuilder, String name = "", float rotate = 0.0f, float pivotX = 0.0f, float pivotY = 0.0f, float scaleX = 1.0f, float scaleY = 1.0f, float translationX = 0.0f, float translationY = 0.0f, java.util.List<? extends androidx.ui.graphics.vector.PathNode> clipPathData = EmptyPath, kotlin.jvm.functions.Function1<? super androidx.ui.graphics.vector.VectorAssetBuilder,kotlin.Unit> block);
- method public static androidx.ui.graphics.vector.VectorAssetBuilder path(androidx.ui.graphics.vector.VectorAssetBuilder, String name = "", androidx.ui.graphics.Brush? fill = null, float fillAlpha = 1.0f, androidx.ui.graphics.Brush? stroke = null, float strokeAlpha = 1.0f, float strokeLineWidth = 0.0f, androidx.ui.graphics.StrokeCap strokeLineCap = DefaultStrokeLineCap, androidx.ui.graphics.StrokeJoin strokeLineJoin = DefaultStrokeLineJoin, float strokeLineMiter = 4.0f, kotlin.jvm.functions.Function1<? super androidx.ui.graphics.vector.PathBuilder,kotlin.Unit> pathBuilder);
+ method public static androidx.ui.graphics.vector.VectorAssetBuilder group(androidx.ui.graphics.vector.VectorAssetBuilder, String name = "", float rotate = 0.0f, float pivotX = 0.0f, float pivotY = 0.0f, float scaleX = 1.0f, float scaleY = 1.0f, float translationX = 0.0f, float translationY = 0.0f, java.util.List<? extends androidx.ui.graphics.vector.PathNode> clipPathData = androidx.ui.graphics.vector.VectorKt.EmptyPath, kotlin.jvm.functions.Function1<? super androidx.ui.graphics.vector.VectorAssetBuilder,kotlin.Unit> block);
+ method public static androidx.ui.graphics.vector.VectorAssetBuilder path(androidx.ui.graphics.vector.VectorAssetBuilder, String name = "", androidx.ui.graphics.Brush? fill = null, float fillAlpha = 1.0f, androidx.ui.graphics.Brush? stroke = null, float strokeAlpha = 1.0f, float strokeLineWidth = 0.0f, androidx.ui.graphics.StrokeCap strokeLineCap = androidx.ui.graphics.vector.VectorKt.DefaultStrokeLineCap, androidx.ui.graphics.StrokeJoin strokeLineJoin = androidx.ui.graphics.vector.VectorKt.DefaultStrokeLineJoin, float strokeLineMiter = 4.0f, kotlin.jvm.functions.Function1<? super androidx.ui.graphics.vector.PathBuilder,kotlin.Unit> pathBuilder);
}
public final class VectorAssetKt {
- method @Deprecated public static androidx.ui.core.Modifier drawVector-N7QT3do(androidx.ui.graphics.vector.VectorAsset vectorImage, long tintColor = Color.Transparent, androidx.ui.graphics.BlendMode tintBlendMode = DefaultTintBlendMode, androidx.ui.core.Alignment alignment = Alignment.Center, androidx.ui.core.ContentScale contentScale = ContentScale.Inside);
+ method @Deprecated public static androidx.ui.core.Modifier drawVector-N7QT3do(androidx.ui.graphics.vector.VectorAsset vectorImage, long tintColor = Color.Transparent, androidx.ui.graphics.BlendMode tintBlendMode = androidx.ui.graphics.vector.VectorKt.DefaultTintBlendMode, androidx.ui.core.Alignment alignment = Alignment.Center, androidx.ui.core.ContentScale contentScale = ContentScale.Inside);
}
public final class VectorComposeKt {
- method public static void Group(androidx.ui.graphics.vector.VectorScope, String name = "", float rotation = 0.0f, float pivotX = 0.0f, float pivotY = 0.0f, float scaleX = 1.0f, float scaleY = 1.0f, float translationX = 0.0f, float translationY = 0.0f, java.util.List<? extends androidx.ui.graphics.vector.PathNode> clipPathData = EmptyPath, kotlin.jvm.functions.Function1<? super androidx.ui.graphics.vector.VectorScope,kotlin.Unit> children);
- method public static void Path(androidx.ui.graphics.vector.VectorScope, java.util.List<? extends androidx.ui.graphics.vector.PathNode> pathData, String name = "", androidx.ui.graphics.Brush? fill = null, float fillAlpha = 1.0f, androidx.ui.graphics.Brush? stroke = null, float strokeAlpha = 1.0f, float strokeLineWidth = 0.0f, androidx.ui.graphics.StrokeCap strokeLineCap = DefaultStrokeLineCap, androidx.ui.graphics.StrokeJoin strokeLineJoin = DefaultStrokeLineJoin, float strokeLineMiter = 4.0f);
- method public static androidx.ui.core.Modifier drawVector-DGWccOo(androidx.ui.core.Modifier, float defaultWidth, float defaultHeight, float viewportWidth = defaultWidth.value, float viewportHeight = defaultHeight.value, long tintColor = DefaultTintColor, androidx.ui.graphics.BlendMode tintBlendMode = DefaultTintBlendMode, androidx.ui.core.Alignment alignment = androidx.ui.graphics.vector.VectorComposeKt.DefaultAlignment, androidx.ui.core.ContentScale contentScale = ContentScale.Inside, String name = "", kotlin.jvm.functions.Function3<? super androidx.ui.graphics.vector.VectorScope,? super java.lang.Float,? super java.lang.Float,kotlin.Unit> children);
- method @Deprecated public static androidx.ui.core.Modifier drawVector-coNG3w0(float defaultWidth, float defaultHeight, float viewportWidth = defaultWidth.value, float viewportHeight = defaultHeight.value, long tintColor = DefaultTintColor, androidx.ui.graphics.BlendMode tintBlendMode = DefaultTintBlendMode, androidx.ui.core.Alignment alignment = androidx.ui.graphics.vector.VectorComposeKt.DefaultAlignment, androidx.ui.core.ContentScale contentScale = ContentScale.Inside, String name = "", kotlin.jvm.functions.Function3<? super androidx.ui.graphics.vector.VectorScope,? super java.lang.Float,? super java.lang.Float,kotlin.Unit> children);
- method @Deprecated public static androidx.ui.core.Modifier drawVector-ekZRHcQ(float defaultWidth, float defaultHeight, float viewportWidth = -1.0f, float viewportHeight = -1.0f, long tintColor = DefaultTintColor, androidx.ui.graphics.BlendMode tintBlendMode = DefaultTintBlendMode, androidx.ui.core.Alignment alignment = androidx.ui.graphics.vector.VectorComposeKt.DefaultAlignment, androidx.ui.core.ContentScale contentScale = ContentScale.Inside, String name = "", kotlin.jvm.functions.Function3<? super androidx.ui.graphics.vector.VectorScope,? super java.lang.Float,? super java.lang.Float,kotlin.Unit> children);
+ method public static void Group(androidx.ui.graphics.vector.VectorScope, String name = "", float rotation = 0.0f, float pivotX = 0.0f, float pivotY = 0.0f, float scaleX = 1.0f, float scaleY = 1.0f, float translationX = 0.0f, float translationY = 0.0f, java.util.List<? extends androidx.ui.graphics.vector.PathNode> clipPathData = androidx.ui.graphics.vector.VectorKt.EmptyPath, kotlin.jvm.functions.Function1<? super androidx.ui.graphics.vector.VectorScope,kotlin.Unit> children);
+ method public static void Path(androidx.ui.graphics.vector.VectorScope, java.util.List<? extends androidx.ui.graphics.vector.PathNode> pathData, String name = "", androidx.ui.graphics.Brush? fill = null, float fillAlpha = 1.0f, androidx.ui.graphics.Brush? stroke = null, float strokeAlpha = 1.0f, float strokeLineWidth = 0.0f, androidx.ui.graphics.StrokeCap strokeLineCap = androidx.ui.graphics.vector.VectorKt.DefaultStrokeLineCap, androidx.ui.graphics.StrokeJoin strokeLineJoin = androidx.ui.graphics.vector.VectorKt.DefaultStrokeLineJoin, float strokeLineMiter = 4.0f);
+ method public static androidx.ui.core.Modifier drawVector-DGWccOo(androidx.ui.core.Modifier, float defaultWidth, float defaultHeight, float viewportWidth = defaultWidth.value, float viewportHeight = defaultHeight.value, long tintColor = androidx.ui.graphics.vector.VectorKt.DefaultTintColor, androidx.ui.graphics.BlendMode tintBlendMode = androidx.ui.graphics.vector.VectorKt.DefaultTintBlendMode, androidx.ui.core.Alignment alignment = androidx.ui.graphics.vector.VectorComposeKt.DefaultAlignment, androidx.ui.core.ContentScale contentScale = ContentScale.Inside, String name = "", kotlin.jvm.functions.Function3<? super androidx.ui.graphics.vector.VectorScope,? super java.lang.Float,? super java.lang.Float,kotlin.Unit> children);
+ method @Deprecated public static androidx.ui.core.Modifier drawVector-coNG3w0(float defaultWidth, float defaultHeight, float viewportWidth = defaultWidth.value, float viewportHeight = defaultHeight.value, long tintColor = androidx.ui.graphics.vector.VectorKt.DefaultTintColor, androidx.ui.graphics.BlendMode tintBlendMode = androidx.ui.graphics.vector.VectorKt.DefaultTintBlendMode, androidx.ui.core.Alignment alignment = androidx.ui.graphics.vector.VectorComposeKt.DefaultAlignment, androidx.ui.core.ContentScale contentScale = ContentScale.Inside, String name = "", kotlin.jvm.functions.Function3<? super androidx.ui.graphics.vector.VectorScope,? super java.lang.Float,? super java.lang.Float,kotlin.Unit> children);
+ method @Deprecated public static androidx.ui.core.Modifier drawVector-ekZRHcQ(float defaultWidth, float defaultHeight, float viewportWidth = -1.0f, float viewportHeight = -1.0f, long tintColor = androidx.ui.graphics.vector.VectorKt.DefaultTintColor, androidx.ui.graphics.BlendMode tintBlendMode = androidx.ui.graphics.vector.VectorKt.DefaultTintBlendMode, androidx.ui.core.Alignment alignment = androidx.ui.graphics.vector.VectorComposeKt.DefaultAlignment, androidx.ui.core.ContentScale contentScale = ContentScale.Inside, String name = "", kotlin.jvm.functions.Function3<? super androidx.ui.graphics.vector.VectorScope,? super java.lang.Float,? super java.lang.Float,kotlin.Unit> children);
}
public final class VectorGroup extends androidx.ui.graphics.vector.VectorNode implements java.lang.Iterable<androidx.ui.graphics.vector.VectorNode> kotlin.jvm.internal.markers.KMappedMarker {
@@ -412,7 +412,7 @@
public final class VectorPainter extends androidx.ui.graphics.painter.Painter {
method public androidx.ui.unit.PxSize getIntrinsicSize();
- method protected void onDraw(androidx.ui.graphics.Canvas canvas, androidx.ui.unit.PxSize bounds);
+ method protected void onDraw(androidx.ui.graphics.painter.CanvasScope);
property public androidx.ui.unit.PxSize intrinsicSize;
}
diff --git a/ui/ui-framework/api/restricted_0.1.0-dev11.txt b/ui/ui-framework/api/restricted_0.1.0-dev11.txt
index e447400..0463c2c 100644
--- a/ui/ui-framework/api/restricted_0.1.0-dev11.txt
+++ b/ui/ui-framework/api/restricted_0.1.0-dev11.txt
@@ -23,7 +23,7 @@
public final class DrawShadowKt {
method @Deprecated public static androidx.ui.core.Modifier drawShadow-IFvMOQI(androidx.ui.graphics.Shape shape, float elevation, boolean clipToOutline = true, @FloatRange(from=0.0, to=1.0) float opacity = 1f);
- method public static androidx.ui.core.Modifier drawShadow-xWKVMPI(androidx.ui.core.Modifier, float elevation, androidx.ui.graphics.Shape shape = RectangleShape, boolean clipToOutline = elevation > 0.dp, @FloatRange(from=0.0, to=1.0) float opacity = 1f);
+ method public static androidx.ui.core.Modifier drawShadow-xWKVMPI(androidx.ui.core.Modifier, float elevation, androidx.ui.graphics.Shape shape = androidx.ui.graphics.RectangleShapeKt.RectangleShape, boolean clipToOutline = elevation > 0.dp, @FloatRange(from=0.0, to=1.0) float opacity = 1f);
}
public enum DropDownAlignment {
@@ -361,7 +361,7 @@
}
public final class VectorAssetBuilder {
- method public androidx.ui.graphics.vector.VectorAssetBuilder addPath(java.util.List<? extends androidx.ui.graphics.vector.PathNode> pathData, String name = "", androidx.ui.graphics.Brush? fill = null, float fillAlpha = 1.0f, androidx.ui.graphics.Brush? stroke = null, float strokeAlpha = 1.0f, float strokeLineWidth = 0.0f, androidx.ui.graphics.StrokeCap strokeLineCap = DefaultStrokeLineCap, androidx.ui.graphics.StrokeJoin strokeLineJoin = DefaultStrokeLineJoin, float strokeLineMiter = 4.0f);
+ method public androidx.ui.graphics.vector.VectorAssetBuilder addPath(java.util.List<? extends androidx.ui.graphics.vector.PathNode> pathData, String name = "", androidx.ui.graphics.Brush? fill = null, float fillAlpha = 1.0f, androidx.ui.graphics.Brush? stroke = null, float strokeAlpha = 1.0f, float strokeLineWidth = 0.0f, androidx.ui.graphics.StrokeCap strokeLineCap = androidx.ui.graphics.vector.VectorKt.DefaultStrokeLineCap, androidx.ui.graphics.StrokeJoin strokeLineJoin = androidx.ui.graphics.vector.VectorKt.DefaultStrokeLineJoin, float strokeLineMiter = 4.0f);
method public androidx.ui.graphics.vector.VectorAsset build();
method public float getDefaultHeight();
method public float getDefaultWidth();
@@ -369,24 +369,24 @@
method public float getViewportHeight();
method public float getViewportWidth();
method public androidx.ui.graphics.vector.VectorAssetBuilder popGroup();
- method public androidx.ui.graphics.vector.VectorAssetBuilder pushGroup(String name = "", float rotate = 0.0f, float pivotX = 0.0f, float pivotY = 0.0f, float scaleX = 1.0f, float scaleY = 1.0f, float translationX = 0.0f, float translationY = 0.0f, java.util.List<? extends androidx.ui.graphics.vector.PathNode> clipPathData = EmptyPath);
+ method public androidx.ui.graphics.vector.VectorAssetBuilder pushGroup(String name = "", float rotate = 0.0f, float pivotX = 0.0f, float pivotY = 0.0f, float scaleX = 1.0f, float scaleY = 1.0f, float translationX = 0.0f, float translationY = 0.0f, java.util.List<? extends androidx.ui.graphics.vector.PathNode> clipPathData = androidx.ui.graphics.vector.VectorKt.EmptyPath);
}
public final class VectorAssetBuilderKt {
- method public static androidx.ui.graphics.vector.VectorAssetBuilder group(androidx.ui.graphics.vector.VectorAssetBuilder, String name = "", float rotate = 0.0f, float pivotX = 0.0f, float pivotY = 0.0f, float scaleX = 1.0f, float scaleY = 1.0f, float translationX = 0.0f, float translationY = 0.0f, java.util.List<? extends androidx.ui.graphics.vector.PathNode> clipPathData = EmptyPath, kotlin.jvm.functions.Function1<? super androidx.ui.graphics.vector.VectorAssetBuilder,kotlin.Unit> block);
- method public static androidx.ui.graphics.vector.VectorAssetBuilder path(androidx.ui.graphics.vector.VectorAssetBuilder, String name = "", androidx.ui.graphics.Brush? fill = null, float fillAlpha = 1.0f, androidx.ui.graphics.Brush? stroke = null, float strokeAlpha = 1.0f, float strokeLineWidth = 0.0f, androidx.ui.graphics.StrokeCap strokeLineCap = DefaultStrokeLineCap, androidx.ui.graphics.StrokeJoin strokeLineJoin = DefaultStrokeLineJoin, float strokeLineMiter = 4.0f, kotlin.jvm.functions.Function1<? super androidx.ui.graphics.vector.PathBuilder,kotlin.Unit> pathBuilder);
+ method public static androidx.ui.graphics.vector.VectorAssetBuilder group(androidx.ui.graphics.vector.VectorAssetBuilder, String name = "", float rotate = 0.0f, float pivotX = 0.0f, float pivotY = 0.0f, float scaleX = 1.0f, float scaleY = 1.0f, float translationX = 0.0f, float translationY = 0.0f, java.util.List<? extends androidx.ui.graphics.vector.PathNode> clipPathData = androidx.ui.graphics.vector.VectorKt.EmptyPath, kotlin.jvm.functions.Function1<? super androidx.ui.graphics.vector.VectorAssetBuilder,kotlin.Unit> block);
+ method public static androidx.ui.graphics.vector.VectorAssetBuilder path(androidx.ui.graphics.vector.VectorAssetBuilder, String name = "", androidx.ui.graphics.Brush? fill = null, float fillAlpha = 1.0f, androidx.ui.graphics.Brush? stroke = null, float strokeAlpha = 1.0f, float strokeLineWidth = 0.0f, androidx.ui.graphics.StrokeCap strokeLineCap = androidx.ui.graphics.vector.VectorKt.DefaultStrokeLineCap, androidx.ui.graphics.StrokeJoin strokeLineJoin = androidx.ui.graphics.vector.VectorKt.DefaultStrokeLineJoin, float strokeLineMiter = 4.0f, kotlin.jvm.functions.Function1<? super androidx.ui.graphics.vector.PathBuilder,kotlin.Unit> pathBuilder);
}
public final class VectorAssetKt {
- method @Deprecated public static androidx.ui.core.Modifier drawVector-N7QT3do(androidx.ui.graphics.vector.VectorAsset vectorImage, long tintColor = Color.Transparent, androidx.ui.graphics.BlendMode tintBlendMode = DefaultTintBlendMode, androidx.ui.core.Alignment alignment = Alignment.Center, androidx.ui.core.ContentScale contentScale = ContentScale.Inside);
+ method @Deprecated public static androidx.ui.core.Modifier drawVector-N7QT3do(androidx.ui.graphics.vector.VectorAsset vectorImage, long tintColor = Color.Transparent, androidx.ui.graphics.BlendMode tintBlendMode = androidx.ui.graphics.vector.VectorKt.DefaultTintBlendMode, androidx.ui.core.Alignment alignment = Alignment.Center, androidx.ui.core.ContentScale contentScale = ContentScale.Inside);
}
public final class VectorComposeKt {
- method public static void Group(androidx.ui.graphics.vector.VectorScope, String name = "", float rotation = 0.0f, float pivotX = 0.0f, float pivotY = 0.0f, float scaleX = 1.0f, float scaleY = 1.0f, float translationX = 0.0f, float translationY = 0.0f, java.util.List<? extends androidx.ui.graphics.vector.PathNode> clipPathData = EmptyPath, kotlin.jvm.functions.Function1<? super androidx.ui.graphics.vector.VectorScope,kotlin.Unit> children);
- method public static void Path(androidx.ui.graphics.vector.VectorScope, java.util.List<? extends androidx.ui.graphics.vector.PathNode> pathData, String name = "", androidx.ui.graphics.Brush? fill = null, float fillAlpha = 1.0f, androidx.ui.graphics.Brush? stroke = null, float strokeAlpha = 1.0f, float strokeLineWidth = 0.0f, androidx.ui.graphics.StrokeCap strokeLineCap = DefaultStrokeLineCap, androidx.ui.graphics.StrokeJoin strokeLineJoin = DefaultStrokeLineJoin, float strokeLineMiter = 4.0f);
- method public static androidx.ui.core.Modifier drawVector-DGWccOo(androidx.ui.core.Modifier, float defaultWidth, float defaultHeight, float viewportWidth = defaultWidth.value, float viewportHeight = defaultHeight.value, long tintColor = DefaultTintColor, androidx.ui.graphics.BlendMode tintBlendMode = DefaultTintBlendMode, androidx.ui.core.Alignment alignment = androidx.ui.graphics.vector.VectorComposeKt.DefaultAlignment, androidx.ui.core.ContentScale contentScale = ContentScale.Inside, String name = "", kotlin.jvm.functions.Function3<? super androidx.ui.graphics.vector.VectorScope,? super java.lang.Float,? super java.lang.Float,kotlin.Unit> children);
- method @Deprecated public static androidx.ui.core.Modifier drawVector-coNG3w0(float defaultWidth, float defaultHeight, float viewportWidth = defaultWidth.value, float viewportHeight = defaultHeight.value, long tintColor = DefaultTintColor, androidx.ui.graphics.BlendMode tintBlendMode = DefaultTintBlendMode, androidx.ui.core.Alignment alignment = androidx.ui.graphics.vector.VectorComposeKt.DefaultAlignment, androidx.ui.core.ContentScale contentScale = ContentScale.Inside, String name = "", kotlin.jvm.functions.Function3<? super androidx.ui.graphics.vector.VectorScope,? super java.lang.Float,? super java.lang.Float,kotlin.Unit> children);
- method @Deprecated public static androidx.ui.core.Modifier drawVector-ekZRHcQ(float defaultWidth, float defaultHeight, float viewportWidth = -1.0f, float viewportHeight = -1.0f, long tintColor = DefaultTintColor, androidx.ui.graphics.BlendMode tintBlendMode = DefaultTintBlendMode, androidx.ui.core.Alignment alignment = androidx.ui.graphics.vector.VectorComposeKt.DefaultAlignment, androidx.ui.core.ContentScale contentScale = ContentScale.Inside, String name = "", kotlin.jvm.functions.Function3<? super androidx.ui.graphics.vector.VectorScope,? super java.lang.Float,? super java.lang.Float,kotlin.Unit> children);
+ method public static void Group(androidx.ui.graphics.vector.VectorScope, String name = "", float rotation = 0.0f, float pivotX = 0.0f, float pivotY = 0.0f, float scaleX = 1.0f, float scaleY = 1.0f, float translationX = 0.0f, float translationY = 0.0f, java.util.List<? extends androidx.ui.graphics.vector.PathNode> clipPathData = androidx.ui.graphics.vector.VectorKt.EmptyPath, kotlin.jvm.functions.Function1<? super androidx.ui.graphics.vector.VectorScope,kotlin.Unit> children);
+ method public static void Path(androidx.ui.graphics.vector.VectorScope, java.util.List<? extends androidx.ui.graphics.vector.PathNode> pathData, String name = "", androidx.ui.graphics.Brush? fill = null, float fillAlpha = 1.0f, androidx.ui.graphics.Brush? stroke = null, float strokeAlpha = 1.0f, float strokeLineWidth = 0.0f, androidx.ui.graphics.StrokeCap strokeLineCap = androidx.ui.graphics.vector.VectorKt.DefaultStrokeLineCap, androidx.ui.graphics.StrokeJoin strokeLineJoin = androidx.ui.graphics.vector.VectorKt.DefaultStrokeLineJoin, float strokeLineMiter = 4.0f);
+ method public static androidx.ui.core.Modifier drawVector-DGWccOo(androidx.ui.core.Modifier, float defaultWidth, float defaultHeight, float viewportWidth = defaultWidth.value, float viewportHeight = defaultHeight.value, long tintColor = androidx.ui.graphics.vector.VectorKt.DefaultTintColor, androidx.ui.graphics.BlendMode tintBlendMode = androidx.ui.graphics.vector.VectorKt.DefaultTintBlendMode, androidx.ui.core.Alignment alignment = androidx.ui.graphics.vector.VectorComposeKt.DefaultAlignment, androidx.ui.core.ContentScale contentScale = ContentScale.Inside, String name = "", kotlin.jvm.functions.Function3<? super androidx.ui.graphics.vector.VectorScope,? super java.lang.Float,? super java.lang.Float,kotlin.Unit> children);
+ method @Deprecated public static androidx.ui.core.Modifier drawVector-coNG3w0(float defaultWidth, float defaultHeight, float viewportWidth = defaultWidth.value, float viewportHeight = defaultHeight.value, long tintColor = androidx.ui.graphics.vector.VectorKt.DefaultTintColor, androidx.ui.graphics.BlendMode tintBlendMode = androidx.ui.graphics.vector.VectorKt.DefaultTintBlendMode, androidx.ui.core.Alignment alignment = androidx.ui.graphics.vector.VectorComposeKt.DefaultAlignment, androidx.ui.core.ContentScale contentScale = ContentScale.Inside, String name = "", kotlin.jvm.functions.Function3<? super androidx.ui.graphics.vector.VectorScope,? super java.lang.Float,? super java.lang.Float,kotlin.Unit> children);
+ method @Deprecated public static androidx.ui.core.Modifier drawVector-ekZRHcQ(float defaultWidth, float defaultHeight, float viewportWidth = -1.0f, float viewportHeight = -1.0f, long tintColor = androidx.ui.graphics.vector.VectorKt.DefaultTintColor, androidx.ui.graphics.BlendMode tintBlendMode = androidx.ui.graphics.vector.VectorKt.DefaultTintBlendMode, androidx.ui.core.Alignment alignment = androidx.ui.graphics.vector.VectorComposeKt.DefaultAlignment, androidx.ui.core.ContentScale contentScale = ContentScale.Inside, String name = "", kotlin.jvm.functions.Function3<? super androidx.ui.graphics.vector.VectorScope,? super java.lang.Float,? super java.lang.Float,kotlin.Unit> children);
}
public final class VectorGroup extends androidx.ui.graphics.vector.VectorNode implements java.lang.Iterable<androidx.ui.graphics.vector.VectorNode> kotlin.jvm.internal.markers.KMappedMarker {
@@ -412,7 +412,7 @@
public final class VectorPainter extends androidx.ui.graphics.painter.Painter {
method public androidx.ui.unit.PxSize getIntrinsicSize();
- method protected void onDraw(androidx.ui.graphics.Canvas canvas, androidx.ui.unit.PxSize bounds);
+ method protected void onDraw(androidx.ui.graphics.painter.CanvasScope);
property public androidx.ui.unit.PxSize intrinsicSize;
}
diff --git a/ui/ui-framework/api/restricted_current.txt b/ui/ui-framework/api/restricted_current.txt
index e447400..0463c2c 100644
--- a/ui/ui-framework/api/restricted_current.txt
+++ b/ui/ui-framework/api/restricted_current.txt
@@ -23,7 +23,7 @@
public final class DrawShadowKt {
method @Deprecated public static androidx.ui.core.Modifier drawShadow-IFvMOQI(androidx.ui.graphics.Shape shape, float elevation, boolean clipToOutline = true, @FloatRange(from=0.0, to=1.0) float opacity = 1f);
- method public static androidx.ui.core.Modifier drawShadow-xWKVMPI(androidx.ui.core.Modifier, float elevation, androidx.ui.graphics.Shape shape = RectangleShape, boolean clipToOutline = elevation > 0.dp, @FloatRange(from=0.0, to=1.0) float opacity = 1f);
+ method public static androidx.ui.core.Modifier drawShadow-xWKVMPI(androidx.ui.core.Modifier, float elevation, androidx.ui.graphics.Shape shape = androidx.ui.graphics.RectangleShapeKt.RectangleShape, boolean clipToOutline = elevation > 0.dp, @FloatRange(from=0.0, to=1.0) float opacity = 1f);
}
public enum DropDownAlignment {
@@ -361,7 +361,7 @@
}
public final class VectorAssetBuilder {
- method public androidx.ui.graphics.vector.VectorAssetBuilder addPath(java.util.List<? extends androidx.ui.graphics.vector.PathNode> pathData, String name = "", androidx.ui.graphics.Brush? fill = null, float fillAlpha = 1.0f, androidx.ui.graphics.Brush? stroke = null, float strokeAlpha = 1.0f, float strokeLineWidth = 0.0f, androidx.ui.graphics.StrokeCap strokeLineCap = DefaultStrokeLineCap, androidx.ui.graphics.StrokeJoin strokeLineJoin = DefaultStrokeLineJoin, float strokeLineMiter = 4.0f);
+ method public androidx.ui.graphics.vector.VectorAssetBuilder addPath(java.util.List<? extends androidx.ui.graphics.vector.PathNode> pathData, String name = "", androidx.ui.graphics.Brush? fill = null, float fillAlpha = 1.0f, androidx.ui.graphics.Brush? stroke = null, float strokeAlpha = 1.0f, float strokeLineWidth = 0.0f, androidx.ui.graphics.StrokeCap strokeLineCap = androidx.ui.graphics.vector.VectorKt.DefaultStrokeLineCap, androidx.ui.graphics.StrokeJoin strokeLineJoin = androidx.ui.graphics.vector.VectorKt.DefaultStrokeLineJoin, float strokeLineMiter = 4.0f);
method public androidx.ui.graphics.vector.VectorAsset build();
method public float getDefaultHeight();
method public float getDefaultWidth();
@@ -369,24 +369,24 @@
method public float getViewportHeight();
method public float getViewportWidth();
method public androidx.ui.graphics.vector.VectorAssetBuilder popGroup();
- method public androidx.ui.graphics.vector.VectorAssetBuilder pushGroup(String name = "", float rotate = 0.0f, float pivotX = 0.0f, float pivotY = 0.0f, float scaleX = 1.0f, float scaleY = 1.0f, float translationX = 0.0f, float translationY = 0.0f, java.util.List<? extends androidx.ui.graphics.vector.PathNode> clipPathData = EmptyPath);
+ method public androidx.ui.graphics.vector.VectorAssetBuilder pushGroup(String name = "", float rotate = 0.0f, float pivotX = 0.0f, float pivotY = 0.0f, float scaleX = 1.0f, float scaleY = 1.0f, float translationX = 0.0f, float translationY = 0.0f, java.util.List<? extends androidx.ui.graphics.vector.PathNode> clipPathData = androidx.ui.graphics.vector.VectorKt.EmptyPath);
}
public final class VectorAssetBuilderKt {
- method public static androidx.ui.graphics.vector.VectorAssetBuilder group(androidx.ui.graphics.vector.VectorAssetBuilder, String name = "", float rotate = 0.0f, float pivotX = 0.0f, float pivotY = 0.0f, float scaleX = 1.0f, float scaleY = 1.0f, float translationX = 0.0f, float translationY = 0.0f, java.util.List<? extends androidx.ui.graphics.vector.PathNode> clipPathData = EmptyPath, kotlin.jvm.functions.Function1<? super androidx.ui.graphics.vector.VectorAssetBuilder,kotlin.Unit> block);
- method public static androidx.ui.graphics.vector.VectorAssetBuilder path(androidx.ui.graphics.vector.VectorAssetBuilder, String name = "", androidx.ui.graphics.Brush? fill = null, float fillAlpha = 1.0f, androidx.ui.graphics.Brush? stroke = null, float strokeAlpha = 1.0f, float strokeLineWidth = 0.0f, androidx.ui.graphics.StrokeCap strokeLineCap = DefaultStrokeLineCap, androidx.ui.graphics.StrokeJoin strokeLineJoin = DefaultStrokeLineJoin, float strokeLineMiter = 4.0f, kotlin.jvm.functions.Function1<? super androidx.ui.graphics.vector.PathBuilder,kotlin.Unit> pathBuilder);
+ method public static androidx.ui.graphics.vector.VectorAssetBuilder group(androidx.ui.graphics.vector.VectorAssetBuilder, String name = "", float rotate = 0.0f, float pivotX = 0.0f, float pivotY = 0.0f, float scaleX = 1.0f, float scaleY = 1.0f, float translationX = 0.0f, float translationY = 0.0f, java.util.List<? extends androidx.ui.graphics.vector.PathNode> clipPathData = androidx.ui.graphics.vector.VectorKt.EmptyPath, kotlin.jvm.functions.Function1<? super androidx.ui.graphics.vector.VectorAssetBuilder,kotlin.Unit> block);
+ method public static androidx.ui.graphics.vector.VectorAssetBuilder path(androidx.ui.graphics.vector.VectorAssetBuilder, String name = "", androidx.ui.graphics.Brush? fill = null, float fillAlpha = 1.0f, androidx.ui.graphics.Brush? stroke = null, float strokeAlpha = 1.0f, float strokeLineWidth = 0.0f, androidx.ui.graphics.StrokeCap strokeLineCap = androidx.ui.graphics.vector.VectorKt.DefaultStrokeLineCap, androidx.ui.graphics.StrokeJoin strokeLineJoin = androidx.ui.graphics.vector.VectorKt.DefaultStrokeLineJoin, float strokeLineMiter = 4.0f, kotlin.jvm.functions.Function1<? super androidx.ui.graphics.vector.PathBuilder,kotlin.Unit> pathBuilder);
}
public final class VectorAssetKt {
- method @Deprecated public static androidx.ui.core.Modifier drawVector-N7QT3do(androidx.ui.graphics.vector.VectorAsset vectorImage, long tintColor = Color.Transparent, androidx.ui.graphics.BlendMode tintBlendMode = DefaultTintBlendMode, androidx.ui.core.Alignment alignment = Alignment.Center, androidx.ui.core.ContentScale contentScale = ContentScale.Inside);
+ method @Deprecated public static androidx.ui.core.Modifier drawVector-N7QT3do(androidx.ui.graphics.vector.VectorAsset vectorImage, long tintColor = Color.Transparent, androidx.ui.graphics.BlendMode tintBlendMode = androidx.ui.graphics.vector.VectorKt.DefaultTintBlendMode, androidx.ui.core.Alignment alignment = Alignment.Center, androidx.ui.core.ContentScale contentScale = ContentScale.Inside);
}
public final class VectorComposeKt {
- method public static void Group(androidx.ui.graphics.vector.VectorScope, String name = "", float rotation = 0.0f, float pivotX = 0.0f, float pivotY = 0.0f, float scaleX = 1.0f, float scaleY = 1.0f, float translationX = 0.0f, float translationY = 0.0f, java.util.List<? extends androidx.ui.graphics.vector.PathNode> clipPathData = EmptyPath, kotlin.jvm.functions.Function1<? super androidx.ui.graphics.vector.VectorScope,kotlin.Unit> children);
- method public static void Path(androidx.ui.graphics.vector.VectorScope, java.util.List<? extends androidx.ui.graphics.vector.PathNode> pathData, String name = "", androidx.ui.graphics.Brush? fill = null, float fillAlpha = 1.0f, androidx.ui.graphics.Brush? stroke = null, float strokeAlpha = 1.0f, float strokeLineWidth = 0.0f, androidx.ui.graphics.StrokeCap strokeLineCap = DefaultStrokeLineCap, androidx.ui.graphics.StrokeJoin strokeLineJoin = DefaultStrokeLineJoin, float strokeLineMiter = 4.0f);
- method public static androidx.ui.core.Modifier drawVector-DGWccOo(androidx.ui.core.Modifier, float defaultWidth, float defaultHeight, float viewportWidth = defaultWidth.value, float viewportHeight = defaultHeight.value, long tintColor = DefaultTintColor, androidx.ui.graphics.BlendMode tintBlendMode = DefaultTintBlendMode, androidx.ui.core.Alignment alignment = androidx.ui.graphics.vector.VectorComposeKt.DefaultAlignment, androidx.ui.core.ContentScale contentScale = ContentScale.Inside, String name = "", kotlin.jvm.functions.Function3<? super androidx.ui.graphics.vector.VectorScope,? super java.lang.Float,? super java.lang.Float,kotlin.Unit> children);
- method @Deprecated public static androidx.ui.core.Modifier drawVector-coNG3w0(float defaultWidth, float defaultHeight, float viewportWidth = defaultWidth.value, float viewportHeight = defaultHeight.value, long tintColor = DefaultTintColor, androidx.ui.graphics.BlendMode tintBlendMode = DefaultTintBlendMode, androidx.ui.core.Alignment alignment = androidx.ui.graphics.vector.VectorComposeKt.DefaultAlignment, androidx.ui.core.ContentScale contentScale = ContentScale.Inside, String name = "", kotlin.jvm.functions.Function3<? super androidx.ui.graphics.vector.VectorScope,? super java.lang.Float,? super java.lang.Float,kotlin.Unit> children);
- method @Deprecated public static androidx.ui.core.Modifier drawVector-ekZRHcQ(float defaultWidth, float defaultHeight, float viewportWidth = -1.0f, float viewportHeight = -1.0f, long tintColor = DefaultTintColor, androidx.ui.graphics.BlendMode tintBlendMode = DefaultTintBlendMode, androidx.ui.core.Alignment alignment = androidx.ui.graphics.vector.VectorComposeKt.DefaultAlignment, androidx.ui.core.ContentScale contentScale = ContentScale.Inside, String name = "", kotlin.jvm.functions.Function3<? super androidx.ui.graphics.vector.VectorScope,? super java.lang.Float,? super java.lang.Float,kotlin.Unit> children);
+ method public static void Group(androidx.ui.graphics.vector.VectorScope, String name = "", float rotation = 0.0f, float pivotX = 0.0f, float pivotY = 0.0f, float scaleX = 1.0f, float scaleY = 1.0f, float translationX = 0.0f, float translationY = 0.0f, java.util.List<? extends androidx.ui.graphics.vector.PathNode> clipPathData = androidx.ui.graphics.vector.VectorKt.EmptyPath, kotlin.jvm.functions.Function1<? super androidx.ui.graphics.vector.VectorScope,kotlin.Unit> children);
+ method public static void Path(androidx.ui.graphics.vector.VectorScope, java.util.List<? extends androidx.ui.graphics.vector.PathNode> pathData, String name = "", androidx.ui.graphics.Brush? fill = null, float fillAlpha = 1.0f, androidx.ui.graphics.Brush? stroke = null, float strokeAlpha = 1.0f, float strokeLineWidth = 0.0f, androidx.ui.graphics.StrokeCap strokeLineCap = androidx.ui.graphics.vector.VectorKt.DefaultStrokeLineCap, androidx.ui.graphics.StrokeJoin strokeLineJoin = androidx.ui.graphics.vector.VectorKt.DefaultStrokeLineJoin, float strokeLineMiter = 4.0f);
+ method public static androidx.ui.core.Modifier drawVector-DGWccOo(androidx.ui.core.Modifier, float defaultWidth, float defaultHeight, float viewportWidth = defaultWidth.value, float viewportHeight = defaultHeight.value, long tintColor = androidx.ui.graphics.vector.VectorKt.DefaultTintColor, androidx.ui.graphics.BlendMode tintBlendMode = androidx.ui.graphics.vector.VectorKt.DefaultTintBlendMode, androidx.ui.core.Alignment alignment = androidx.ui.graphics.vector.VectorComposeKt.DefaultAlignment, androidx.ui.core.ContentScale contentScale = ContentScale.Inside, String name = "", kotlin.jvm.functions.Function3<? super androidx.ui.graphics.vector.VectorScope,? super java.lang.Float,? super java.lang.Float,kotlin.Unit> children);
+ method @Deprecated public static androidx.ui.core.Modifier drawVector-coNG3w0(float defaultWidth, float defaultHeight, float viewportWidth = defaultWidth.value, float viewportHeight = defaultHeight.value, long tintColor = androidx.ui.graphics.vector.VectorKt.DefaultTintColor, androidx.ui.graphics.BlendMode tintBlendMode = androidx.ui.graphics.vector.VectorKt.DefaultTintBlendMode, androidx.ui.core.Alignment alignment = androidx.ui.graphics.vector.VectorComposeKt.DefaultAlignment, androidx.ui.core.ContentScale contentScale = ContentScale.Inside, String name = "", kotlin.jvm.functions.Function3<? super androidx.ui.graphics.vector.VectorScope,? super java.lang.Float,? super java.lang.Float,kotlin.Unit> children);
+ method @Deprecated public static androidx.ui.core.Modifier drawVector-ekZRHcQ(float defaultWidth, float defaultHeight, float viewportWidth = -1.0f, float viewportHeight = -1.0f, long tintColor = androidx.ui.graphics.vector.VectorKt.DefaultTintColor, androidx.ui.graphics.BlendMode tintBlendMode = androidx.ui.graphics.vector.VectorKt.DefaultTintBlendMode, androidx.ui.core.Alignment alignment = androidx.ui.graphics.vector.VectorComposeKt.DefaultAlignment, androidx.ui.core.ContentScale contentScale = ContentScale.Inside, String name = "", kotlin.jvm.functions.Function3<? super androidx.ui.graphics.vector.VectorScope,? super java.lang.Float,? super java.lang.Float,kotlin.Unit> children);
}
public final class VectorGroup extends androidx.ui.graphics.vector.VectorNode implements java.lang.Iterable<androidx.ui.graphics.vector.VectorNode> kotlin.jvm.internal.markers.KMappedMarker {
@@ -412,7 +412,7 @@
public final class VectorPainter extends androidx.ui.graphics.painter.Painter {
method public androidx.ui.unit.PxSize getIntrinsicSize();
- method protected void onDraw(androidx.ui.graphics.Canvas canvas, androidx.ui.unit.PxSize bounds);
+ method protected void onDraw(androidx.ui.graphics.painter.CanvasScope);
property public androidx.ui.unit.PxSize intrinsicSize;
}
diff --git a/ui/ui-framework/integration-tests/framework-demos/src/main/java/androidx/ui/framework/demos/DeclarativeGraphicsDemo.kt b/ui/ui-framework/integration-tests/framework-demos/src/main/java/androidx/ui/framework/demos/DeclarativeGraphicsDemo.kt
new file mode 100644
index 0000000..e6a1ca6
--- /dev/null
+++ b/ui/ui-framework/integration-tests/framework-demos/src/main/java/androidx/ui/framework/demos/DeclarativeGraphicsDemo.kt
@@ -0,0 +1,128 @@
+/*
+ * Copyright 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT 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.ui.framework.demos
+
+import androidx.compose.Composable
+import androidx.ui.core.Alignment
+import androidx.ui.core.Modifier
+import androidx.ui.foundation.Canvas2
+import androidx.ui.graphics.Color
+import androidx.ui.graphics.painter.inset
+import androidx.ui.graphics.painter.rotate
+import androidx.ui.graphics.painter.scale
+import androidx.ui.graphics.painter.translate
+import androidx.ui.layout.fillMaxSize
+import androidx.ui.layout.preferredSize
+import androidx.ui.layout.wrapContentSize
+import androidx.ui.unit.dp
+
+@Composable
+fun DeclarativeGraphicsDemo() {
+ /**
+ * Demo that shows how to leverage CanvasScope to draw 4 rectangular quadrants
+ * inset by a given dimension with a diamond drawn within each of the quadrants
+ */
+ Canvas2(modifier =
+ Modifier.fillMaxSize()
+ .wrapContentSize(Alignment.Center)
+ .preferredSize(120.dp, 120.dp)
+ ) {
+ drawRect(color = Color.Gray)
+ // Inset content by 10 pixels on the left/right sides and 12 by the
+ // top/bottom
+ inset(10.0f, 12.0f) {
+ val quadrantSize = size / 2.0f
+ drawRect(
+ size = quadrantSize,
+ color = Color.Red
+ )
+ // Scale the drawing environment down by 50% about the center of the square drawn
+ // in the top left quadrant
+ scale(0.5f, 0.5f, size.width / 4, size.height / 4) {
+ // Rotate the drawing environment 45 degrees about the center of the square
+ // drawn in the top left
+ rotate(45.0f, size.width / 4, size.height / 4) {
+ drawRect(
+ size = quadrantSize,
+ color = Color.Yellow,
+ alpha = 0.75f
+ )
+ }
+ }
+ // Translate the drawing environment to the right by half the size of the current
+ // width
+ translate(size.width / 2, 0.0f) {
+ drawRect(
+ size = quadrantSize,
+ color = Color.Yellow
+ )
+ // Scale the drawing environment down by 50% about the center of the square drawn
+ // in the top right quadrant
+ scale(0.5f, 0.5f, size.width / 4, size.height / 4) {
+ // rotate the drawing environment 45 degrees about the center of the drawn
+ // square in the top right
+ rotate(45.0f, size.width / 4, size.height / 4) {
+ drawRect(
+ size = quadrantSize,
+ color = Color.Red,
+ alpha = 0.75f
+ )
+ }
+ }
+ }
+ // Translate the drawing environment down by half the size of the current height
+ translate(0.0f, size.height / 2) {
+ drawRect(
+ size = quadrantSize,
+ color = Color.Green
+ )
+ // Scale the drawing environment down by 50% about the center of the square drawn
+ // in the bottom left quadrant
+ scale(0.5f, 0.5f, size.width / 4, size.height / 4) {
+ // Rotate the drawing environment by 45 degrees about the center of the
+ // square drawn in the bottom left quadrant
+ rotate(45.0f, size.width / 4, size.height / 4) {
+ drawRect(
+ size = quadrantSize,
+ color = Color.Blue,
+ alpha = 0.75f
+ )
+ }
+ }
+ }
+ // Translate the drawing environment to the bottom right quadrant of the inset bounds
+ translate(size.width / 2, size.height / 2) {
+ drawRect(
+ size = quadrantSize,
+ color = Color.Blue
+ )
+ // Scale the drawing environment down by 50% about the center of the square drawn
+ // in the bottom right quadrant
+ scale(0.5f, 0.5f, size.width / 4, size.height / 4) {
+ // Rotate the drawing environment 45 degrees about the center of the drawn
+ // square in the bottom right
+ rotate(45.0f, size.width / 4, size.height / 4) {
+ drawRect(
+ size = quadrantSize,
+ color = Color.Green,
+ alpha = 0.75f
+ )
+ }
+ }
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/ui/ui-framework/integration-tests/framework-demos/src/main/java/androidx/ui/framework/demos/FrameworkDemos.kt b/ui/ui-framework/integration-tests/framework-demos/src/main/java/androidx/ui/framework/demos/FrameworkDemos.kt
index 6f11234..826e1ef 100644
--- a/ui/ui-framework/integration-tests/framework-demos/src/main/java/androidx/ui/framework/demos/FrameworkDemos.kt
+++ b/ui/ui-framework/integration-tests/framework-demos/src/main/java/androidx/ui/framework/demos/FrameworkDemos.kt
@@ -35,6 +35,7 @@
import androidx.ui.framework.demos.gestures.ScaleGestureDetectorDemo
import androidx.ui.framework.demos.gestures.TouchSlopDragGestureDetectorDemo
import androidx.ui.framework.demos.gestures.TouchSlopExceededGestureDetectorDemo
+import androidx.ui.framework.demos.viewinterop.ViewInComposeDemo
private val GestureDemos = DemoCategory("Gestures", listOf(
DemoCategory("Simple - Non-Movement", listOf(
@@ -62,11 +63,17 @@
))
))
+private val GraphicsDemos = DemoCategory("Graphics", listOf(
+ ComposableDemo("VectorGraphicsDemo") { VectorGraphicsDemo() },
+ ComposableDemo("DeclarativeGraphicsDemo") { DeclarativeGraphicsDemo() }
+))
+
val FrameworkDemos = DemoCategory("Framework", listOf(
ComposableDemo("Explicit autofill types") { ExplicitAutofillTypesDemo() },
ComposableDemo("Focus") { FocusableDemo() },
ComposableDemo("Multiple collects measure") { MultipleCollectTest() },
ComposableDemo("Popup") { PopupDemo() },
- ComposableDemo("Vector graphics") { VectorGraphicsDemo() },
- GestureDemos
+ GraphicsDemos,
+ GestureDemos,
+ ComposableDemo("View in compose") { ViewInComposeDemo() }
))
diff --git a/ui/ui-framework/samples/src/main/java/androidx/ui/framework/samples/PainterSample.kt b/ui/ui-framework/samples/src/main/java/androidx/ui/framework/samples/PainterSample.kt
index 1cdbe60..23ed33c 100644
--- a/ui/ui-framework/samples/src/main/java/androidx/ui/framework/samples/PainterSample.kt
+++ b/ui/ui-framework/samples/src/main/java/androidx/ui/framework/samples/PainterSample.kt
@@ -19,18 +19,12 @@
import androidx.annotation.Sampled
import androidx.compose.Composable
import androidx.ui.core.Modifier
-import androidx.ui.core.paint
-import androidx.ui.foundation.Box
+import androidx.ui.foundation.Image
import androidx.ui.foundation.drawBackground
-import androidx.ui.geometry.Offset
-import androidx.ui.graphics.BlendMode
-import androidx.ui.graphics.Canvas
import androidx.ui.graphics.Color
-import androidx.ui.graphics.ColorFilter
-import androidx.ui.graphics.Paint
import androidx.ui.graphics.painter.Painter
+import androidx.ui.graphics.painter.CanvasScope
import androidx.ui.layout.padding
-import androidx.ui.layout.preferredSize
import androidx.ui.unit.Px
import androidx.ui.unit.PxSize
import androidx.ui.unit.dp
@@ -40,40 +34,26 @@
fun PainterModifierSample() {
class CustomPainter : Painter() {
- val paint = Paint().apply {
- this.color = Color.Red
- }
-
override val intrinsicSize: PxSize
get() = PxSize(
Px(300.0f),
Px(300.0f)
)
- override fun onDraw(canvas: Canvas, bounds: PxSize) {
- val size = intrinsicSize
- val width = size.width.value
- val height = size.height.value
- canvas.drawCircle(
- Offset(
- width / 2.0f,
- height / 2.0f
- ),
- width / 2.0f,
- paint
+ override fun CanvasScope.onDraw() {
+ drawCircle(
+ center = center,
+ radius = size.minDimension / 2.0f,
+ color = Color.Red
)
}
}
- Box(
- Modifier.preferredSize(300.dp)
- .drawBackground(Color.Gray)
- .padding(30.dp)
- .drawBackground(Color.Yellow)
- .paint(
- CustomPainter(),
- alpha = 0.5f,
- colorFilter = ColorFilter(Color.Cyan, BlendMode.srcIn)
- )
+ Image(
+ modifier =
+ Modifier.drawBackground(Color.Gray)
+ .padding(30.dp)
+ .drawBackground(Color.Yellow),
+ painter = CustomPainter()
)
}
\ No newline at end of file
diff --git a/ui/ui-framework/src/androidTest/java/androidx/ui/core/PainterModifierTest.kt b/ui/ui-framework/src/androidTest/java/androidx/ui/core/PainterModifierTest.kt
index 27a389c..45fe708 100644
--- a/ui/ui-framework/src/androidTest/java/androidx/ui/core/PainterModifierTest.kt
+++ b/ui/ui-framework/src/androidTest/java/androidx/ui/core/PainterModifierTest.kt
@@ -29,14 +29,12 @@
import androidx.ui.core.test.background
import androidx.ui.core.test.waitAndScreenShot
import androidx.ui.framework.test.TestActivity
-import androidx.ui.geometry.Rect
import androidx.ui.graphics.BlendMode
-import androidx.ui.graphics.Canvas
import androidx.ui.graphics.Color
import androidx.ui.graphics.ColorFilter
import androidx.ui.graphics.DefaultAlpha
-import androidx.ui.graphics.Paint
import androidx.ui.graphics.compositeOver
+import androidx.ui.graphics.painter.CanvasScope
import androidx.ui.graphics.painter.Painter
import androidx.ui.graphics.toArgb
import androidx.ui.unit.IntPx
@@ -376,7 +374,7 @@
latch: CountDownLatch
) {
with(DensityAmbient.current) {
- val p = LatchPainter(containerWidth, containerHeight, latch, rtl)
+ val p = LatchPainter(containerWidth, containerHeight, latch)
AtLeastSize(
modifier = Modifier.background(Color.White)
.paint(p, alpha = alpha, colorFilter = colorFilter, rtl = rtl),
@@ -397,23 +395,24 @@
private class LatchPainter(
val width: Float,
val height: Float,
- val latch: CountDownLatch,
- val rtl: Boolean = false
+ val latch: CountDownLatch
) : Painter() {
+
+ var color = Color.Red
+
override val intrinsicSize: PxSize
get() = PxSize(
Px(width),
Px(height)
)
- override fun onDraw(canvas: Canvas, bounds: PxSize) {
- val paint = Paint().apply {
- this.color = if (rtl) Color.Blue else Color.Red
- }
- canvas.drawRect(
- Rect.fromLTWH(0.0f, 0.0f, bounds.width.value, bounds.height.value),
- paint
- )
+ override fun applyRtl(rtl: Boolean): Boolean {
+ color = if (rtl) Color.Blue else Color.Red
+ return true
+ }
+
+ override fun CanvasScope.onDraw() {
+ drawRect(color = color)
latch.countDown()
}
}
diff --git a/ui/ui-framework/src/androidTest/java/androidx/ui/core/test/AndroidViewCompatTest.kt b/ui/ui-framework/src/androidTest/java/androidx/ui/core/test/AndroidViewCompatTest.kt
index b225d18..f024a49 100644
--- a/ui/ui-framework/src/androidTest/java/androidx/ui/core/test/AndroidViewCompatTest.kt
+++ b/ui/ui-framework/src/androidTest/java/androidx/ui/core/test/AndroidViewCompatTest.kt
@@ -200,12 +200,141 @@
.assertPixels(expectedColorProvider = expectedPixelColor)
}
+ // When incoming constraints are fixed.
+
@Test
- fun testMeasurement_isDoneWithCorrectMeasureSpecs() {
+ fun testMeasurement_isDoneWithCorrectMeasureSpecs_1() {
+ testMeasurement_isDoneWithCorrectMeasureSpecs(
+ MeasureSpec.makeMeasureSpec(20, MeasureSpec.EXACTLY),
+ MeasureSpec.makeMeasureSpec(30, MeasureSpec.EXACTLY),
+ Constraints.fixed(20.ipx, 30.ipx),
+ ViewGroup.LayoutParams(40, 50)
+ )
+ }
+
+ @Test
+ fun testMeasurement_isDoneWithCorrectMeasureSpecs_2() {
+ testMeasurement_isDoneWithCorrectMeasureSpecs(
+ MeasureSpec.makeMeasureSpec(20, MeasureSpec.EXACTLY),
+ MeasureSpec.makeMeasureSpec(30, MeasureSpec.EXACTLY),
+ Constraints.fixed(20.ipx, 30.ipx),
+ ViewGroup.LayoutParams(WRAP_CONTENT, WRAP_CONTENT)
+ )
+ }
+
+ @Test
+ fun testMeasurement_isDoneWithCorrectMeasureSpecs_3() {
+ testMeasurement_isDoneWithCorrectMeasureSpecs(
+ MeasureSpec.makeMeasureSpec(20, MeasureSpec.EXACTLY),
+ MeasureSpec.makeMeasureSpec(30, MeasureSpec.EXACTLY),
+ Constraints.fixed(20.ipx, 30.ipx),
+ ViewGroup.LayoutParams(MATCH_PARENT, MATCH_PARENT)
+ )
+ }
+
+ // When incoming constraints are finite.
+
+ @Test
+ fun testMeasurement_isDoneWithCorrectMeasureSpecs_4() {
+ testMeasurement_isDoneWithCorrectMeasureSpecs(
+ MeasureSpec.makeMeasureSpec(25, MeasureSpec.EXACTLY),
+ MeasureSpec.makeMeasureSpec(35, MeasureSpec.EXACTLY),
+ Constraints(
+ minWidth = 20.ipx, maxWidth = 30.ipx, minHeight = 35.ipx, maxHeight = 45.ipx
+ ),
+ ViewGroup.LayoutParams(25, 35)
+ )
+ }
+
+ @Test
+ fun testMeasurement_isDoneWithCorrectMeasureSpecs_5() {
+ testMeasurement_isDoneWithCorrectMeasureSpecs(
+ MeasureSpec.makeMeasureSpec(20, MeasureSpec.EXACTLY),
+ MeasureSpec.makeMeasureSpec(35, MeasureSpec.EXACTLY),
+ Constraints(
+ minWidth = 20.ipx, maxWidth = 30.ipx, minHeight = 35.ipx, maxHeight = 45.ipx
+ ),
+ ViewGroup.LayoutParams(15, 25)
+ )
+ }
+
+ @Test
+ fun testMeasurement_isDoneWithCorrectMeasureSpecs_6() {
+ testMeasurement_isDoneWithCorrectMeasureSpecs(
+ MeasureSpec.makeMeasureSpec(30, MeasureSpec.EXACTLY),
+ MeasureSpec.makeMeasureSpec(45, MeasureSpec.EXACTLY),
+ Constraints(
+ minWidth = 20.ipx, maxWidth = 30.ipx, minHeight = 35.ipx, maxHeight = 45.ipx
+ ),
+ ViewGroup.LayoutParams(35, 50)
+ )
+ }
+
+ @Test
+ fun testMeasurement_isDoneWithCorrectMeasureSpecs_7() {
+ testMeasurement_isDoneWithCorrectMeasureSpecs(
+ MeasureSpec.makeMeasureSpec(40, MeasureSpec.AT_MOST),
+ MeasureSpec.makeMeasureSpec(50, MeasureSpec.AT_MOST),
+ Constraints(maxWidth = 40.ipx, maxHeight = 50.ipx),
+ ViewGroup.LayoutParams(WRAP_CONTENT, WRAP_CONTENT)
+ )
+ }
+
+ @Test
+ fun testMeasurement_isDoneWithCorrectMeasureSpecs_8() {
+ testMeasurement_isDoneWithCorrectMeasureSpecs(
+ MeasureSpec.makeMeasureSpec(40, MeasureSpec.EXACTLY),
+ MeasureSpec.makeMeasureSpec(50, MeasureSpec.EXACTLY),
+ Constraints(maxWidth = 40.ipx, maxHeight = 50.ipx),
+ ViewGroup.LayoutParams(MATCH_PARENT, MATCH_PARENT)
+ )
+ }
+
+ // When incoming constraints are infinite.
+
+ @Test
+ fun testMeasurement_isDoneWithCorrectMeasureSpecs_9() {
+ testMeasurement_isDoneWithCorrectMeasureSpecs(
+ MeasureSpec.makeMeasureSpec(25, MeasureSpec.EXACTLY),
+ MeasureSpec.makeMeasureSpec(35, MeasureSpec.EXACTLY),
+ Constraints(),
+ ViewGroup.LayoutParams(25, 35)
+ )
+ }
+
+ @Test
+ fun testMeasurement_isDoneWithCorrectMeasureSpecs_10() {
+ testMeasurement_isDoneWithCorrectMeasureSpecs(
+ MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED),
+ MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED),
+ Constraints(),
+ ViewGroup.LayoutParams(WRAP_CONTENT, WRAP_CONTENT)
+ )
+ }
+
+ @Test
+ fun testMeasurement_isDoneWithCorrectMeasureSpecs_11() {
+ testMeasurement_isDoneWithCorrectMeasureSpecs(
+ MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED),
+ MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED),
+ Constraints(),
+ ViewGroup.LayoutParams(MATCH_PARENT, MATCH_PARENT)
+ )
+ }
+
+ private fun testMeasurement_isDoneWithCorrectMeasureSpecs(
+ expectedWidthSpec: Int,
+ expectedHeightSpec: Int,
+ constraints: Constraints,
+ layoutParams: ViewGroup.LayoutParams
+ ) {
val viewRef = Ref<MeasureSpecSaverView>()
val widthMeasureSpecRef = Ref<Int>()
val heightMeasureSpecRef = Ref<Int>()
- val constraintsHolder = ConstraintsModel(Constraints())
+ // Unique starting constraints so that new constraints are different and thus recomp is
+ // guaranteed.
+ val constraintsHolder = ConstraintsModel(Constraints.fixed(1234.ipx, 5678.ipx))
+
composeTestRule.setContent {
Container(LayoutConstraints(constraintsHolder.constraints)) {
MeasureSpecSaverView(
@@ -215,97 +344,16 @@
)
}
}
- fun assertMeasureSpec(
- expectedWidthSpec: Int,
- expectedHeightSpec: Int,
- constraints: Constraints,
- layoutParams: ViewGroup.LayoutParams
- ) {
- runOnUiThread {
- constraintsHolder.constraints = constraints
- viewRef.value?.layoutParams = layoutParams
- }
- runOnIdleCompose {
- assertEquals(expectedWidthSpec, widthMeasureSpecRef.value)
- assertEquals(expectedHeightSpec, heightMeasureSpecRef.value)
- }
+ runOnUiThread {
+ constraintsHolder.constraints = constraints
+ viewRef.value?.layoutParams = layoutParams
}
- // When incoming constraints are fixed.
- assertMeasureSpec(
- MeasureSpec.makeMeasureSpec(20, MeasureSpec.EXACTLY),
- MeasureSpec.makeMeasureSpec(30, MeasureSpec.EXACTLY),
- Constraints.fixed(20.ipx, 30.ipx),
- ViewGroup.LayoutParams(40, 50)
- )
- assertMeasureSpec(
- MeasureSpec.makeMeasureSpec(20, MeasureSpec.EXACTLY),
- MeasureSpec.makeMeasureSpec(30, MeasureSpec.EXACTLY),
- Constraints.fixed(20.ipx, 30.ipx),
- ViewGroup.LayoutParams(WRAP_CONTENT, WRAP_CONTENT)
- )
- assertMeasureSpec(
- MeasureSpec.makeMeasureSpec(20, MeasureSpec.EXACTLY),
- MeasureSpec.makeMeasureSpec(30, MeasureSpec.EXACTLY),
- Constraints.fixed(20.ipx, 30.ipx),
- ViewGroup.LayoutParams(MATCH_PARENT, MATCH_PARENT)
- )
- // When incoming constraints are finite.
- assertMeasureSpec(
- MeasureSpec.makeMeasureSpec(25, MeasureSpec.EXACTLY),
- MeasureSpec.makeMeasureSpec(35, MeasureSpec.EXACTLY),
- Constraints(
- minWidth = 20.ipx, maxWidth = 30.ipx, minHeight = 35.ipx, maxHeight = 45.ipx
- ),
- ViewGroup.LayoutParams(25, 35)
- )
- assertMeasureSpec(
- MeasureSpec.makeMeasureSpec(20, MeasureSpec.EXACTLY),
- MeasureSpec.makeMeasureSpec(35, MeasureSpec.EXACTLY),
- Constraints(
- minWidth = 20.ipx, maxWidth = 30.ipx, minHeight = 35.ipx, maxHeight = 45.ipx
- ),
- ViewGroup.LayoutParams(15, 25)
- )
- assertMeasureSpec(
- MeasureSpec.makeMeasureSpec(30, MeasureSpec.EXACTLY),
- MeasureSpec.makeMeasureSpec(45, MeasureSpec.EXACTLY),
- Constraints(
- minWidth = 20.ipx, maxWidth = 30.ipx, minHeight = 35.ipx, maxHeight = 45.ipx
- ),
- ViewGroup.LayoutParams(35, 50)
- )
- assertMeasureSpec(
- MeasureSpec.makeMeasureSpec(40, MeasureSpec.AT_MOST),
- MeasureSpec.makeMeasureSpec(50, MeasureSpec.AT_MOST),
- Constraints(maxWidth = 40.ipx, maxHeight = 50.ipx),
- ViewGroup.LayoutParams(WRAP_CONTENT, WRAP_CONTENT)
- )
- assertMeasureSpec(
- MeasureSpec.makeMeasureSpec(40, MeasureSpec.EXACTLY),
- MeasureSpec.makeMeasureSpec(50, MeasureSpec.EXACTLY),
- Constraints(maxWidth = 40.ipx, maxHeight = 50.ipx),
- ViewGroup.LayoutParams(MATCH_PARENT, MATCH_PARENT)
- )
- // When incoming constraints are infinite.
- assertMeasureSpec(
- MeasureSpec.makeMeasureSpec(25, MeasureSpec.EXACTLY),
- MeasureSpec.makeMeasureSpec(35, MeasureSpec.EXACTLY),
- Constraints(),
- ViewGroup.LayoutParams(25, 35)
- )
- assertMeasureSpec(
- MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED),
- MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED),
- Constraints(),
- ViewGroup.LayoutParams(WRAP_CONTENT, WRAP_CONTENT)
- )
- assertMeasureSpec(
- MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED),
- MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED),
- Constraints(),
- ViewGroup.LayoutParams(MATCH_PARENT, MATCH_PARENT)
- )
+
+ runOnIdleCompose {
+ assertEquals(expectedWidthSpec, widthMeasureSpecRef.value)
+ assertEquals(expectedHeightSpec, heightMeasureSpecRef.value)
+ }
}
@Test
diff --git a/ui/ui-framework/src/androidTest/java/androidx/ui/core/test/LayerTouchTransformTest.kt b/ui/ui-framework/src/androidTest/java/androidx/ui/core/test/LayerTouchTransformTest.kt
index 99b9336..0ba012a 100644
--- a/ui/ui-framework/src/androidTest/java/androidx/ui/core/test/LayerTouchTransformTest.kt
+++ b/ui/ui-framework/src/androidTest/java/androidx/ui/core/test/LayerTouchTransformTest.kt
@@ -39,9 +39,9 @@
import androidx.ui.layout.preferredSize
import androidx.ui.test.captureToBitmap
import androidx.ui.test.createComposeRule
-import androidx.ui.test.doGesture
+import androidx.ui.test.doPartialGesture
import androidx.ui.test.findByTag
-import androidx.ui.test.sendTouchDown
+import androidx.ui.test.sendDown
import androidx.ui.unit.Px
import androidx.ui.unit.PxPosition
import androidx.ui.unit.dp
@@ -142,7 +142,7 @@
// its bounds
val mappedPosition = PxPosition(Px(342.0f), Px(168.0f))
- val node = findByTag(testTag).doGesture { sendTouchDown(mappedPosition) }
+ val node = findByTag(testTag).doPartialGesture { sendDown(mappedPosition) }
latch = CountDownLatch(1).apply {
await(5, TimeUnit.SECONDS)
diff --git a/ui/ui-framework/src/androidTest/java/androidx/ui/node/PointerInteropFilterTest.kt b/ui/ui-framework/src/androidTest/java/androidx/ui/node/PointerInteropFilterTest.kt
index da10c61..eb17f9c 100644
--- a/ui/ui-framework/src/androidTest/java/androidx/ui/node/PointerInteropFilterTest.kt
+++ b/ui/ui-framework/src/androidTest/java/androidx/ui/node/PointerInteropFilterTest.kt
@@ -21,7 +21,6 @@
import android.view.MotionEvent.ACTION_CANCEL
import android.view.MotionEvent.ACTION_DOWN
import android.view.MotionEvent.TOOL_TYPE_UNKNOWN
-import android.widget.FrameLayout
import androidx.activity.ComponentActivity
import androidx.test.filters.SmallTest
import androidx.ui.core.PointerEventPass
@@ -36,6 +35,7 @@
import androidx.ui.testutils.moveTo
import androidx.ui.testutils.up
import androidx.ui.unit.milliseconds
+import androidx.ui.viewinterop.AndroidViewHolder
import com.google.common.truth.Truth.assertThat
import org.junit.Before
import org.junit.Rule
@@ -1635,12 +1635,11 @@
}
@Test
- fun onPointerInput_pointerMove_dispatchedDuringFinalTunnel() {
+ fun onPointerInput_pointerMove_dispatchedDuringPostTunnel() {
val down = down(1, 2.milliseconds, 3f, 4f)
val move = down.moveTo(7.milliseconds, 8f, 9f)
-
pointerInteropFilter.pointerInputFilter::onPointerInput.invokeOverAllPasses(down)
-
+ mockViewGroup.dispatchedMotionEvents.clear()
pointerInteropFilter.pointerInputFilter::onPointerInput.invokeOverPasses(
move,
PointerEventPass.InitialDown,
@@ -1649,14 +1648,89 @@
PointerEventPass.PostUp
)
- assertThat(mockViewGroup.dispatchedMotionEvents).hasSize(1)
+ assertThat(mockViewGroup.dispatchedMotionEvents).hasSize(0)
pointerInteropFilter.pointerInputFilter::onPointerInput.invokeOverPasses(
move,
PointerEventPass.PostDown
)
- assertThat(mockViewGroup.dispatchedMotionEvents).hasSize(2)
+ assertThat(mockViewGroup.dispatchedMotionEvents).hasSize(1)
+ }
+
+ @Test
+ fun onPointerInput_downDisallowInterceptRequestedMove_moveDispatchedDuringInitialTunnel() {
+ val down = down(1, 2.milliseconds, 3f, 4f)
+ val move = down.moveTo(7.milliseconds, 8f, 9f)
+
+ pointerInteropFilter.pointerInputFilter::onPointerInput.invokeOverAllPasses(down)
+ mockViewGroup.dispatchedMotionEvents.clear()
+
+ mockViewGroup.requestDisallowInterceptTouchEvent(true)
+
+ pointerInteropFilter.pointerInputFilter::onPointerInput.invokeOverPasses(
+ move,
+ PointerEventPass.InitialDown
+ )
+
+ assertThat(mockViewGroup.dispatchedMotionEvents).hasSize(1)
+ }
+
+ @Test
+ fun onPointerInput_disallowInterceptRequestedUpDownMove_moveDispatchedDuringPostTunnel() {
+ val downA = down(1, 2.milliseconds, 3f, 4f)
+ val upA = downA.up(11.milliseconds)
+ val downB = down(21, 22.milliseconds, 23f, 24f)
+ val moveB = downB.moveTo(31.milliseconds, 32f, 33f)
+
+ pointerInteropFilter.pointerInputFilter::onPointerInput.invokeOverAllPasses(downA)
+ mockViewGroup.requestDisallowInterceptTouchEvent(true)
+ pointerInteropFilter.pointerInputFilter::onPointerInput.invokeOverAllPasses(upA)
+ pointerInteropFilter.pointerInputFilter::onPointerInput.invokeOverAllPasses(downB)
+ mockViewGroup.dispatchedMotionEvents.clear()
+ pointerInteropFilter.pointerInputFilter::onPointerInput.invokeOverPasses(
+ moveB,
+ PointerEventPass.InitialDown,
+ PointerEventPass.PreUp,
+ PointerEventPass.PreDown,
+ PointerEventPass.PostUp
+ )
+
+ assertThat(mockViewGroup.dispatchedMotionEvents).hasSize(0)
+
+ pointerInteropFilter.pointerInputFilter::onPointerInput.invokeOverPasses(
+ moveB,
+ PointerEventPass.PostDown
+ )
+
+ assertThat(mockViewGroup.dispatchedMotionEvents).hasSize(1)
+ }
+
+ @Test
+ fun onPointerInput_disallowInterceptTrueThenFalseThenMove_moveDispatchedDuringPostTunnel() {
+ val down = down(1, 2.milliseconds, 3f, 4f)
+ val move = down.moveTo(7.milliseconds, 8f, 9f)
+
+ pointerInteropFilter.pointerInputFilter::onPointerInput.invokeOverAllPasses(down)
+ mockViewGroup.requestDisallowInterceptTouchEvent(true)
+ mockViewGroup.requestDisallowInterceptTouchEvent(false)
+ mockViewGroup.dispatchedMotionEvents.clear()
+ pointerInteropFilter.pointerInputFilter::onPointerInput.invokeOverPasses(
+ move,
+ PointerEventPass.InitialDown,
+ PointerEventPass.PreUp,
+ PointerEventPass.PreDown,
+ PointerEventPass.PostUp
+ )
+
+ assertThat(mockViewGroup.dispatchedMotionEvents).hasSize(0)
+
+ pointerInteropFilter.pointerInputFilter::onPointerInput.invokeOverPasses(
+ move,
+ PointerEventPass.PostDown
+ )
+
+ assertThat(mockViewGroup.dispatchedMotionEvents).hasSize(1)
}
@Test
@@ -1866,7 +1940,7 @@
}
@Test
- fun onPointerInput_pointerMove_consumedDuringFinalTunnel() {
+ fun onPointerInput_pointerMove_consumedDuringPostTunnel() {
val down = down(1, 2.milliseconds, 3f, 4f)
val move = down.moveTo(7.milliseconds, 8f, 9f)
@@ -2000,7 +2074,7 @@
}
}
-class MockViewGroup(context: Context) : FrameLayout(context) {
+internal class MockViewGroup(context: Context) : AndroidViewHolder(context) {
var dispatchedMotionEvents = mutableListOf<MotionEvent>()
var returnValue = true
@@ -2034,7 +2108,8 @@
eventTime.toLong(),
action + (actionIndex shl MotionEvent.ACTION_POINTER_INDEX_SHIFT),
numPointers,
- pointerProperties,
+ // TODO(shepshapard): This is bad and temporary
+ pointerProperties.map { PointerProperties(it.id % 32) }.toTypedArray(),
pointerCoords,
0,
0,
diff --git a/ui/ui-framework/src/main/java/androidx/ui/core/PainterModifier.kt b/ui/ui-framework/src/main/java/androidx/ui/core/PainterModifier.kt
index 70dd418..df172d9 100644
--- a/ui/ui-framework/src/main/java/androidx/ui/core/PainterModifier.kt
+++ b/ui/ui-framework/src/main/java/androidx/ui/core/PainterModifier.kt
@@ -242,7 +242,7 @@
painter.draw(
canvas = this,
- bounds = PxSize(srcWidth, srcHeight),
+ size = PxSize(srcWidth, srcHeight),
alpha = alpha,
colorFilter = colorFilter,
rtl = rtl)
diff --git a/ui/ui-framework/src/main/java/androidx/ui/graphics/vector/VectorPainter.kt b/ui/ui-framework/src/main/java/androidx/ui/graphics/vector/VectorPainter.kt
index 50af72a..fcecbe0 100644
--- a/ui/ui-framework/src/main/java/androidx/ui/graphics/vector/VectorPainter.kt
+++ b/ui/ui-framework/src/main/java/androidx/ui/graphics/vector/VectorPainter.kt
@@ -22,9 +22,10 @@
import androidx.compose.onPreCommit
import androidx.compose.remember
import androidx.ui.core.DensityAmbient
-import androidx.ui.graphics.Canvas
import androidx.ui.graphics.ColorFilter
import androidx.ui.graphics.painter.Painter
+import androidx.ui.graphics.painter.CanvasScope
+import androidx.ui.graphics.painter.drawCanvas
import androidx.ui.unit.Dp
import androidx.ui.unit.IntPx
import androidx.ui.unit.Px
@@ -113,8 +114,8 @@
IntPx(ceil(vector.defaultHeight.value).roundToInt())
)
- override fun onDraw(canvas: Canvas, bounds: PxSize) {
- vector.draw(canvas, currentAlpha, currentColorFilter)
+ override fun CanvasScope.onDraw() {
+ drawCanvas { canvas, _ -> vector.draw(canvas, currentAlpha, currentColorFilter) }
}
override fun applyAlpha(alpha: Float): Boolean {
diff --git a/ui/ui-framework/src/main/java/androidx/ui/node/PointerInteropFilter.kt b/ui/ui-framework/src/main/java/androidx/ui/node/PointerInteropFilter.kt
index b9ed6c1..89f7831 100644
--- a/ui/ui-framework/src/main/java/androidx/ui/node/PointerInteropFilter.kt
+++ b/ui/ui-framework/src/main/java/androidx/ui/node/PointerInteropFilter.kt
@@ -17,7 +17,6 @@
package androidx.ui.node
import android.os.SystemClock
-import android.view.View
import androidx.ui.core.Modifier
import androidx.ui.core.PointerEventPass
import androidx.ui.core.PointerInputChange
@@ -29,20 +28,89 @@
import androidx.ui.core.pointerinput.PointerInputModifier
import androidx.ui.unit.IntPxSize
import androidx.ui.unit.milliseconds
+import androidx.ui.viewinterop.AndroidViewHolder
-internal fun Modifier.pointerInteropModifier(view: View): Modifier {
+internal fun Modifier.pointerInteropModifier(view: AndroidViewHolder): Modifier {
return this + PointerInteropFilter(view)
}
-internal class PointerInteropFilter(val view: View) : PointerInputModifier {
+/**
+ * A special PointerInputModifier that manages pointer input interaction with child Android Views
+ * following Android conventions.
+ *
+ * All interactions with the Android View occur through it's associated [AndroidViewHolder].
+ *
+ * When the type of event is not a movement event, we dispatch to the Android View as soon as
+ * possible (during [PointerEventPass.InitialDown]) so that the Android View can react to down
+ * and up events before Compose PointerInputModifiers normally would.
+ *
+ * When the type of event is a movement event, we dispatch to the Android View during
+ * [PointerEventPass.PostDown] to allow Compose PointerInputModifiers to react to movement first,
+ * which mimics a ViewParent intercepting the event stream.
+ *
+ * Whenever we are about to dispatch to the Android View, we check to see if anything in Compose
+ * consumed any aspect of the pointer input changes, and if they did, we intercept the stream and
+ * dispatch ACTION_CANCEL to the Android View if they have already returned true for a call to
+ * View#dispatchTouchEvent(...).
+ *
+ * If we do dispatch to the View, and it returns true, we consume all of the changes so that
+ * nothing in Compose also responds.
+ *
+ * If the Android View calls ViewParent#requestDisallowInterceptTouchEvent with a value of true, we
+ * simply dispatch move events during [PointerEventPass.InitialDown] so that normal
+ * PointerInputModifiers don't get a chance to consume first. Note: This does mean that it is
+ * possible for a Compose PointerInputModifier to "intercept" even after
+ * requestDisallowInterceptTouchEvent has been called because consumption can occur during
+ * [PointerEventPass.InitialDown]. This may seem like a flaw, but in reality, any
+ * PointerInputModifier that consumes that aggressively would likely only do so after some
+ * consumption already occurred on a later pass, and this ability to do so is on par with a
+ * ViewGroup's ability to override dispatchTouchEvent instead of overriding the more usual
+ * onTouchEvent and onInterceptTouchEvent.
+ *
+ * If the Android View calls ViewParent#requestDisallowInterceptTouchEvent is later called again
+ * but with false (exceedingly rare in Android), we revert back to the normal behavior.
+ */
+internal class PointerInteropFilter(
+ /**
+ * The [AndroidViewHolder] that contains the Android View we are dispatching to.
+ */
+ val view: AndroidViewHolder
+) : PointerInputModifier {
+ /**
+ * The 3 possible states
+ */
private enum class DispatchToViewState {
- Unknown, Dispatching, NotDispatching
+ /**
+ * We have yet to dispatch a new event stream to the child Android View.
+ */
+ Unknown,
+ /**
+ * We have dispatched to the child Android View and it wants to continue to receive
+ * events for the current event stream.
+ */
+ Dispatching,
+ /**
+ * We intercepted the event stream, or the Android View no longer wanted to receive
+ * events for the current event stream.
+ */
+ NotDispatching
}
override val pointerInputFilter =
object : PointerInputFilter() {
+
+ init {
+ // Setup so that we are notified when the child Android View calls
+ // ViewParent#requestDisallowInterceptTouchEvent.
+ view.onRequestDisallowInterceptTouchEvent =
+ { disallowIntercept ->
+ this.disallowIntercept = disallowIntercept
+ }
+ }
+
private var state = DispatchToViewState.Unknown
+ private var disallowIntercept = false
override fun onPointerInput(
changes: List<PointerInputChange>,
@@ -52,23 +120,26 @@
@Suppress("NAME_SHADOWING")
var changes = changes
- if (state !== DispatchToViewState.NotDispatching) {
- if (pass == PointerEventPass.InitialDown &&
+ // If we were told to disallow intercept, or if the event was a down or up event,
+ // we dispatch to Android as early as possible. If the event is a move event and
+ // we can still intercept, we dispatch to Android after we have a chance to
+ // intercept due to movement.
+ val dispatchDuringInitialTunnel = disallowIntercept ||
changes.any {
it.changedToDownIgnoreConsumed() || it.changedToUpIgnoreConsumed()
}
- ) {
- changes = dispatchToMotionEvent(changes)
+
+ if (state !== DispatchToViewState.NotDispatching) {
+ if (pass == PointerEventPass.InitialDown && dispatchDuringInitialTunnel) {
+ changes = dispatchToView(changes)
}
- if (pass == PointerEventPass.PostDown &&
- changes.none {
- it.changedToDownIgnoreConsumed() || it.changedToUpIgnoreConsumed()
- }
- ) {
- changes = dispatchToMotionEvent(changes)
+ if (pass == PointerEventPass.PostDown && !dispatchDuringInitialTunnel) {
+ changes = dispatchToView(changes)
}
}
if (pass == PointerEventPass.PostDown) {
+ // If all of the changes were up changes, then the "event stream" has ended
+ // and we reset.
if (changes.all { it.changedToUpIgnoreConsumed() }) {
reset()
}
@@ -77,10 +148,8 @@
}
override fun onCancel() {
- // TODO(shepshapard): We have to know if the cancel event was caused by our View
- // calling ViewParent#requestDisallowInterceptTouchEvent(boolean), or if we
- // are cancelling for some other reason. If our view called
- // requestDisallowInterceptTouchEvent, we shouldn't cancel them.
+ // If we are still dispatching to the Android View, we have to send them a
+ // cancel event, otherwise, we should not.
if (state === DispatchToViewState.Dispatching) {
emptyCancelMotionEventScope(
SystemClock.uptimeMillis().milliseconds
@@ -91,24 +160,42 @@
}
}
+ /**
+ * Resets all of our state to be ready for a "new event stream".
+ */
private fun reset() {
state = DispatchToViewState.Unknown
+ disallowIntercept = false
}
- private fun dispatchToMotionEvent(changes: List<PointerInputChange>):
+ /**
+ * Dispatches to the Android View.
+ *
+ * Also consumes aspects of [changes] and updates our [state] accordingly.
+ *
+ * Will dispatch ACTION_CANCEL if any aspect of [changes] has been consumed and
+ * update our [state] accordingly.
+ *
+ * @param changes The changes to dispatch.
+ * @return The resulting changes (fully consumed or untouched).
+ */
+ private fun dispatchToView(changes: List<PointerInputChange>):
List<PointerInputChange> {
@Suppress("NAME_SHADOWING")
var changes = changes
if (changes.any { it.anyChangeConsumed() }) {
+ // We should no longer dispatch to the Android View.
if (state === DispatchToViewState.Dispatching) {
+ // If we were dipatching, send ACTION_CANCEL.
changes.toCancelMotionEventScope { motionEvent ->
view.dispatchTouchEvent(motionEvent)
}
}
state = DispatchToViewState.NotDispatching
} else {
+ // Dispatch and update our state with the result.
changes.toMotionEventScope { motionEvent ->
state = if (view.dispatchTouchEvent(motionEvent)) {
DispatchToViewState.Dispatching
@@ -117,6 +204,7 @@
}
}
if (state === DispatchToViewState.Dispatching) {
+ // If the Android View claimed the event, consume all changes.
changes = changes.map { it.consumeAllChanges() }
}
}
diff --git a/ui/ui-framework/src/main/java/androidx/ui/node/PointerInteropUtils.kt b/ui/ui-framework/src/main/java/androidx/ui/node/PointerInteropUtils.kt
index f21e4a5..1719e8d 100644
--- a/ui/ui-framework/src/main/java/androidx/ui/node/PointerInteropUtils.kt
+++ b/ui/ui-framework/src/main/java/androidx/ui/node/PointerInteropUtils.kt
@@ -53,9 +53,9 @@
}
}
- // TODO(b/154136736): toInt() is clearly not right.
+ // TODO(b/154136736): "(it.id.value % 32).toInt()" is very fishy.
val pointerProperties =
- map { PointerProperties(it.id.value.toInt()) }
+ map { PointerProperties((it.id.value % 32).toInt()) }
.toTypedArray()
val pointerCoords =
map {
diff --git a/ui/ui-framework/src/main/java/androidx/ui/node/UiComposer.kt b/ui/ui-framework/src/main/java/androidx/ui/node/UiComposer.kt
index 27bf1c9..3242cc3 100644
--- a/ui/ui-framework/src/main/java/androidx/ui/node/UiComposer.kt
+++ b/ui/ui-framework/src/main/java/androidx/ui/node/UiComposer.kt
@@ -27,6 +27,7 @@
import androidx.compose.Recomposer
import androidx.compose.SlotTable
import androidx.ui.core.ComponentNode
+import androidx.ui.viewinterop.AndroidViewHolder
// TODO: evaluate if this class is necessary or not
private class Stack<T> {
@@ -131,10 +132,20 @@
}
is ComponentNode ->
when (instance) {
- is View -> parent.insertAt(
- index,
- instance.toComponentNode()
- )
+ is View -> {
+ // Wrap the instance in an AndroidViewHolder, unless the instance
+ // itself is already one.
+ val androidViewHolder =
+ if (instance is AndroidViewHolder) {
+ instance
+ } else {
+ AndroidViewHolder(instance.context).apply {
+ view = instance
+ }
+ }
+
+ parent.insertAt(index, androidViewHolder.toComponentNode())
+ }
is ComponentNode -> parent.insertAt(index, instance)
else -> invalidNode(instance)
}
diff --git a/ui/ui-framework/src/main/java/androidx/ui/node/ViewInterop.kt b/ui/ui-framework/src/main/java/androidx/ui/node/ViewInterop.kt
index 3bcb9c3..39db2e8 100644
--- a/ui/ui-framework/src/main/java/androidx/ui/node/ViewInterop.kt
+++ b/ui/ui-framework/src/main/java/androidx/ui/node/ViewInterop.kt
@@ -16,8 +16,10 @@
package androidx.ui.node
+import android.content.Context
import android.view.View
import android.view.ViewGroup
+import android.widget.FrameLayout
import androidx.annotation.RestrictTo
import androidx.ui.core.AndroidOwner
import androidx.ui.core.ComponentNode
@@ -31,6 +33,7 @@
import androidx.ui.unit.IntPx
import androidx.ui.unit.ipx
import androidx.ui.unit.isFinite
+import androidx.ui.viewinterop.AndroidViewHolder
/**
* @suppress
@@ -90,7 +93,7 @@
* Builds a [ComponentNode] tree representation for an Android [View].
* The component nodes will proxy the Compose core calls to the [View].
*/
-internal fun View.toComponentNode(): ComponentNode {
+internal fun AndroidViewHolder.toComponentNode(): ComponentNode {
// TODO(soboleva): add layout direction here?
// TODO(popam): forward pointer input, accessibility, focus
// Prepare layout node that proxies measure and layout passes to the View.
@@ -114,22 +117,24 @@
layoutDirection: LayoutDirection
): MeasureScope.MeasureResult {
if (constraints.minWidth != 0.ipx) {
- minimumWidth = constraints.minWidth.value
+ getChildAt(0).minimumWidth = constraints.minWidth.value
}
if (constraints.minHeight != 0.ipx) {
- minimumHeight = constraints.minHeight.value
+ getChildAt(0).minimumHeight = constraints.minHeight.value
}
// TODO (soboleva): native view should get LD value from Compose?
+
+ // TODO(shepshapard): !! necessary?
measure(
obtainMeasureSpec(
constraints.minWidth,
constraints.maxWidth,
- layoutParams.width
+ layoutParams!!.width
),
obtainMeasureSpec(
constraints.minHeight,
constraints.maxHeight,
- layoutParams.height
+ layoutParams!!.height
)
)
return measureScope.layout(measuredWidth.ipx, measuredHeight.ipx) {
diff --git a/ui/ui-framework/src/main/java/androidx/ui/viewinterop/ComposedView.kt b/ui/ui-framework/src/main/java/androidx/ui/viewinterop/ComposedView.kt
index 8e7a437..651d7fe 100644
--- a/ui/ui-framework/src/main/java/androidx/ui/viewinterop/ComposedView.kt
+++ b/ui/ui-framework/src/main/java/androidx/ui/viewinterop/ComposedView.kt
@@ -52,7 +52,8 @@
AndroidViewHolder(view = view)
}
-private class AndroidViewHolder(context: Context) : ViewGroup(context) {
+// Open to be mockable in tests.
+internal open class AndroidViewHolder(context: Context) : ViewGroup(context) {
var view: View? = null
set(value) {
if (value != field) {
@@ -75,6 +76,8 @@
}
}
+ var onRequestDisallowInterceptTouchEvent: ((Boolean) -> Unit)? = null
+
override fun onMeasure(widthMeasureSpec: Int, heightMeasureSpec: Int) {
view?.measure(widthMeasureSpec, heightMeasureSpec)
setMeasuredDimension(view?.measuredWidth ?: 0, view?.measuredHeight ?: 0)
@@ -87,4 +90,9 @@
override fun getLayoutParams(): LayoutParams? {
return view?.layoutParams ?: LayoutParams(MATCH_PARENT, MATCH_PARENT)
}
+
+ override fun requestDisallowInterceptTouchEvent(disallowIntercept: Boolean) {
+ onRequestDisallowInterceptTouchEvent?.invoke(disallowIntercept)
+ super.requestDisallowInterceptTouchEvent(disallowIntercept)
+ }
}
diff --git a/ui/ui-geometry/api/0.1.0-dev11.txt b/ui/ui-geometry/api/0.1.0-dev11.txt
index 4ad12c3..390ba95 100644
--- a/ui/ui-geometry/api/0.1.0-dev11.txt
+++ b/ui/ui-geometry/api/0.1.0-dev11.txt
@@ -1,36 +1,38 @@
// Signature format: 3.0
package androidx.ui.geometry {
- public final class Offset implements androidx.ui.geometry.OffsetBase {
- ctor public Offset(float dx, float dy);
- method public infix androidx.ui.geometry.Rect and(androidx.ui.geometry.Size other);
- method public float component1();
- method public float component2();
- method public androidx.ui.geometry.Offset copy(float dx, float dy);
- method public operator androidx.ui.geometry.Offset div(float operand);
- method public float getDirection();
- method public float getDistance();
- method public float getDistanceSquared();
- method public float getDx();
- method public float getDy();
- method public operator androidx.ui.geometry.Offset minus(androidx.ui.geometry.Offset other);
- method public operator androidx.ui.geometry.Offset plus(androidx.ui.geometry.Offset other);
- method public operator androidx.ui.geometry.Offset rem(float operand);
- method public androidx.ui.geometry.Offset scale(float scaleX, float scaleY);
- method public operator androidx.ui.geometry.Offset times(float operand);
- method public androidx.ui.geometry.Offset translate(float translateX, float translateY);
- method public androidx.ui.geometry.Offset truncDiv(float operand);
- method public operator androidx.ui.geometry.Offset unaryMinus();
+ public final inline class Offset {
+ ctor public Offset();
+ method public static infix androidx.ui.geometry.Rect and-b2zCL34(long $this, long other);
+ method public static long constructor-impl(internal long packedValue);
+ method public static operator long div-impl(long $this, float operand);
+ method public static inline boolean equals-impl(long p, Object? p1);
+ method public static boolean equals-impl0(long p1, long p2);
+ method public static float getDirection-impl(long $this);
+ method public static float getDistance-impl(long $this);
+ method public static float getDistanceSquared-impl(long $this);
+ method public static float getDx-impl(long $this);
+ method public static float getDy-impl(long $this);
+ method public static inline int hashCode-impl(long p);
+ method public static operator long minus-RIqb49o(long $this, long other);
+ method public static operator long plus-RIqb49o(long $this, long other);
+ method public static operator long rem-impl(long $this, float operand);
+ method public static long scale-impl(long $this, float scaleX, float scaleY);
+ method public static operator long times-impl(long $this, float operand);
+ method public static String toString-impl(long $this);
+ method public static long translate-impl(long $this, float translateX, float translateY);
+ method public static long truncDiv-impl(long $this, float operand);
+ method public static operator long unaryMinus-impl(long $this);
field public static final androidx.ui.geometry.Offset.Companion! Companion;
}
public static final class Offset.Companion {
- method public androidx.ui.geometry.Offset getInfinite();
- method public androidx.ui.geometry.Offset getZero();
- method public boolean isValid(androidx.ui.geometry.Offset offset);
- method public androidx.ui.geometry.Offset lerp(androidx.ui.geometry.Offset start, androidx.ui.geometry.Offset stop, float fraction);
- property public final androidx.ui.geometry.Offset infinite;
- property public final androidx.ui.geometry.Offset zero;
+ method public long getInfinite();
+ method public long getZero();
+ method public boolean isValid-RIqb49o(long offset);
+ method public long lerp-nqy8KaQ(long start, long stop, float fraction);
+ property public final long infinite;
+ property public final long zero;
}
public interface OffsetBase {
@@ -46,6 +48,10 @@
property public abstract float dy;
}
+ public final class OffsetKt {
+ method public static long Offset(float dx, float dy);
+ }
+
public final class RRect {
ctor public RRect(float left, float top, float right, float bottom, float topLeftRadiusX, float topLeftRadiusY, float topRightRadiusX, float topRightRadiusY, float bottomRightRadiusX, float bottomRightRadiusY, float bottomLeftRadiusX, float bottomLeftRadiusY);
method public float component1();
@@ -60,7 +66,7 @@
method public float component7();
method public float component8();
method public float component9();
- method public boolean contains(androidx.ui.geometry.Offset point);
+ method public boolean contains-RIqb49o(long point);
method public androidx.ui.geometry.RRect copy(float left, float top, float right, float bottom, float topLeftRadiusX, float topLeftRadiusY, float topRightRadiusX, float topRightRadiusY, float bottomRightRadiusX, float bottomRightRadiusY, float bottomLeftRadiusX, float bottomLeftRadiusY);
method @Deprecated public androidx.ui.geometry.RRect deflate(float delta);
method public float getBottom();
@@ -98,7 +104,7 @@
method public static androidx.ui.geometry.RRect RRect(androidx.ui.geometry.Rect rect, androidx.ui.geometry.Radius topLeft = Radius.zero, androidx.ui.geometry.Radius topRight = Radius.zero, androidx.ui.geometry.Radius bottomRight = Radius.zero, androidx.ui.geometry.Radius bottomLeft = Radius.zero);
method public static androidx.ui.geometry.Radius bottomLeftRadius(androidx.ui.geometry.RRect);
method public static androidx.ui.geometry.Radius bottomRightRadius(androidx.ui.geometry.RRect);
- method public static androidx.ui.geometry.Offset center(androidx.ui.geometry.RRect);
+ method public static long center(androidx.ui.geometry.RRect);
method public static float getLongestSide(androidx.ui.geometry.RRect);
method public static float getShortestSide(androidx.ui.geometry.RRect);
method public static androidx.ui.geometry.RRect grow(androidx.ui.geometry.RRect, float delta);
@@ -113,7 +119,7 @@
method public static androidx.ui.geometry.Rect middleRect(androidx.ui.geometry.RRect);
method public static androidx.ui.geometry.Rect outerRect(androidx.ui.geometry.RRect);
method public static androidx.ui.geometry.Rect safeInnerRect(androidx.ui.geometry.RRect);
- method public static androidx.ui.geometry.RRect shift(androidx.ui.geometry.RRect, androidx.ui.geometry.Offset offset);
+ method public static androidx.ui.geometry.RRect shift-q6ZkaaM(androidx.ui.geometry.RRect, long offset);
method public static androidx.ui.geometry.RRect shrink(androidx.ui.geometry.RRect, float delta);
method public static androidx.ui.geometry.Rect tallMiddleRect(androidx.ui.geometry.RRect);
method public static androidx.ui.geometry.Radius topLeftRadius(androidx.ui.geometry.RRect);
@@ -156,27 +162,27 @@
method public float component2();
method public float component3();
method public float component4();
- method public boolean contains(androidx.ui.geometry.Offset offset);
+ method public boolean contains-RIqb49o(long offset);
method public androidx.ui.geometry.Rect copy(float left, float top, float right, float bottom);
method public androidx.ui.geometry.Rect deflate(float delta);
method public androidx.ui.geometry.Rect expandToInclude(androidx.ui.geometry.Rect other);
method public float getBottom();
- method public androidx.ui.geometry.Offset getBottomCenter();
- method public androidx.ui.geometry.Offset getBottomLeft();
- method public androidx.ui.geometry.Offset getBottomRight();
- method public androidx.ui.geometry.Offset getCenter();
- method public androidx.ui.geometry.Offset getCenterLeft();
- method public androidx.ui.geometry.Offset getCenterRight();
+ method public long getBottomCenter();
+ method public long getBottomLeft();
+ method public long getBottomRight();
+ method public long getCenter();
+ method public long getCenterLeft();
+ method public long getCenterRight();
method public float getHeight();
method public float getLeft();
- method public float getLongestSide();
+ method public float getMaxDimension();
+ method public float getMinDimension();
method public float getRight();
- method public float getShortestSide();
- method public androidx.ui.geometry.Size getSize();
+ method public long getSize();
method public float getTop();
- method public androidx.ui.geometry.Offset getTopCenter();
- method public androidx.ui.geometry.Offset getTopLeft();
- method public androidx.ui.geometry.Offset getTopRight();
+ method public long getTopCenter();
+ method public long getTopLeft();
+ method public long getTopRight();
method public float getWidth();
method public androidx.ui.geometry.Rect inflate(float delta);
method public androidx.ui.geometry.Rect intersect(androidx.ui.geometry.Rect other);
@@ -185,18 +191,20 @@
method public boolean isInfinite();
method public androidx.ui.geometry.Rect join(androidx.ui.geometry.Rect other);
method public boolean overlaps(androidx.ui.geometry.Rect other);
- method public androidx.ui.geometry.Rect shift(androidx.ui.geometry.Offset offset);
+ method public androidx.ui.geometry.Rect shift-RIqb49o(long offset);
method public androidx.ui.geometry.Rect translate(float translateX, float translateY);
property public final float height;
+ property public final float maxDimension;
+ property public final float minDimension;
property public final float width;
field public static final androidx.ui.geometry.Rect.Companion! Companion;
}
public static final class Rect.Companion {
- method public androidx.ui.geometry.Rect fromCircle(androidx.ui.geometry.Offset center, float radius);
+ method public androidx.ui.geometry.Rect fromCircle-hSKLB2U(long center, float radius);
method public androidx.ui.geometry.Rect fromLTRB(float left, float top, float right, float bottom);
method public androidx.ui.geometry.Rect fromLTWH(float left, float top, float width, float height);
- method public androidx.ui.geometry.Rect fromPoints(androidx.ui.geometry.Offset a, androidx.ui.geometry.Offset b);
+ method public androidx.ui.geometry.Rect fromPoints-cs1Rg_A(long a, long b);
method public androidx.ui.geometry.Rect getLargest();
method public androidx.ui.geometry.Rect getZero();
method public float get_giantScalar();
@@ -209,49 +217,54 @@
method public static androidx.ui.geometry.Rect lerp(androidx.ui.geometry.Rect start, androidx.ui.geometry.Rect stop, float fraction);
}
- public class Size implements androidx.ui.geometry.OffsetBase {
- ctor public Size(float width, float height);
- method public final androidx.ui.geometry.Offset bottomCenter(androidx.ui.geometry.Offset origin);
- method public final androidx.ui.geometry.Offset bottomLeft(androidx.ui.geometry.Offset origin);
- method public final androidx.ui.geometry.Offset bottomRight(androidx.ui.geometry.Offset origin);
- method public final androidx.ui.geometry.Offset center(androidx.ui.geometry.Offset origin);
- method public final androidx.ui.geometry.Offset centerLeft(androidx.ui.geometry.Offset origin);
- method public final androidx.ui.geometry.Offset centerRight(androidx.ui.geometry.Offset origin);
- method public final boolean contains(androidx.ui.geometry.Offset offset);
- method public final operator androidx.ui.geometry.Size div(float operand);
- method public float getDx();
- method public float getDy();
- method public final androidx.ui.geometry.Size getFlipped();
- method public final float getHeight();
- method public final float getLongestSide();
- method public final float getShortestSide();
- method public final float getWidth();
- method public final boolean isEmpty();
- method public final operator androidx.ui.geometry.Size minus(androidx.ui.geometry.Offset other);
- method public final operator androidx.ui.geometry.Offset minus(androidx.ui.geometry.Size other);
- method public final operator androidx.ui.geometry.Size plus(androidx.ui.geometry.Offset other);
- method public final operator androidx.ui.geometry.Size rem(float operand);
- method public final operator androidx.ui.geometry.Size times(float operand);
- method public final androidx.ui.geometry.Offset topCenter(androidx.ui.geometry.Offset origin);
- method public final androidx.ui.geometry.Offset topLeft(androidx.ui.geometry.Offset origin);
- method public final androidx.ui.geometry.Offset topRight(androidx.ui.geometry.Offset origin);
- method public final androidx.ui.geometry.Size truncDiv(float operand);
- property public float dx;
- property public float dy;
+ public final inline class Size {
+ ctor public Size();
+ method public static long bottomCenter-RIqb49o(long $this, long origin);
+ method public static long bottomLeft-RIqb49o(long $this, long origin);
+ method public static long bottomRight-RIqb49o(long $this, long origin);
+ method public static long center-RIqb49o(long $this, long origin);
+ method public static long centerLeft-RIqb49o(long $this, long origin);
+ method public static long centerRight-RIqb49o(long $this, long origin);
+ method public static long constructor-impl(internal long value);
+ method public static boolean contains-RIqb49o(long $this, long offset);
+ method public static operator long div-impl(long $this, float operand);
+ method public static inline boolean equals-impl(long p, Object? p1);
+ method public static boolean equals-impl0(long p1, long p2);
+ method public static long getFlipped-impl(long $this);
+ method public static float getHeight-impl(long $this);
+ method public static float getMaxDimension-impl(long $this);
+ method public static float getMinDimension-impl(long $this);
+ method public static float getWidth-impl(long $this);
+ method public static inline int hashCode-impl(long p);
+ method public static boolean isEmpty-impl(long $this);
+ method public static operator long minus-RIqb49o(long $this, long other);
+ method public static operator long minus-b2zCL34(long $this, long other);
+ method public static operator long plus-RIqb49o(long $this, long other);
+ method public static operator long rem-impl(long $this, float operand);
+ method public static operator long times-impl(long $this, float operand);
+ method public static String toString-impl(long $this);
+ method public static long topCenter-RIqb49o(long $this, long origin);
+ method public static long topLeft-RIqb49o(long $this, long origin);
+ method public static long topRight-RIqb49o(long $this, long origin);
+ method public static long truncDiv-impl(long $this, float operand);
field public static final androidx.ui.geometry.Size.Companion! Companion;
}
public static final class Size.Companion {
- method public androidx.ui.geometry.Size copy(androidx.ui.geometry.Size source);
- method public androidx.ui.geometry.Size fromHeight(float height);
- method public androidx.ui.geometry.Size fromRadius(float radius);
- method public androidx.ui.geometry.Size fromWidth(float width);
- method public androidx.ui.geometry.Size getInfinite();
- method public androidx.ui.geometry.Size getZero();
- method public androidx.ui.geometry.Size? lerp(androidx.ui.geometry.Size start, androidx.ui.geometry.Size stop, float fraction);
- method public androidx.ui.geometry.Size square(float dimension);
- property public final androidx.ui.geometry.Size infinite;
- property public final androidx.ui.geometry.Size zero;
+ method public long copy-b2zCL34(long source);
+ method public long fromHeight(float height);
+ method public long fromRadius(float radius);
+ method public long fromWidth(float width);
+ method public long getInfinite();
+ method public long getZero();
+ method public androidx.ui.geometry.Size? lerp-T-c3OIQ(long start, long stop, float fraction);
+ method public long square(float dimension);
+ property public final long infinite;
+ property public final long zero;
+ }
+
+ public final class SizeKt {
+ method public static long Size(float width, float height);
}
}
diff --git a/ui/ui-geometry/api/current.txt b/ui/ui-geometry/api/current.txt
index 4ad12c3..390ba95 100644
--- a/ui/ui-geometry/api/current.txt
+++ b/ui/ui-geometry/api/current.txt
@@ -1,36 +1,38 @@
// Signature format: 3.0
package androidx.ui.geometry {
- public final class Offset implements androidx.ui.geometry.OffsetBase {
- ctor public Offset(float dx, float dy);
- method public infix androidx.ui.geometry.Rect and(androidx.ui.geometry.Size other);
- method public float component1();
- method public float component2();
- method public androidx.ui.geometry.Offset copy(float dx, float dy);
- method public operator androidx.ui.geometry.Offset div(float operand);
- method public float getDirection();
- method public float getDistance();
- method public float getDistanceSquared();
- method public float getDx();
- method public float getDy();
- method public operator androidx.ui.geometry.Offset minus(androidx.ui.geometry.Offset other);
- method public operator androidx.ui.geometry.Offset plus(androidx.ui.geometry.Offset other);
- method public operator androidx.ui.geometry.Offset rem(float operand);
- method public androidx.ui.geometry.Offset scale(float scaleX, float scaleY);
- method public operator androidx.ui.geometry.Offset times(float operand);
- method public androidx.ui.geometry.Offset translate(float translateX, float translateY);
- method public androidx.ui.geometry.Offset truncDiv(float operand);
- method public operator androidx.ui.geometry.Offset unaryMinus();
+ public final inline class Offset {
+ ctor public Offset();
+ method public static infix androidx.ui.geometry.Rect and-b2zCL34(long $this, long other);
+ method public static long constructor-impl(internal long packedValue);
+ method public static operator long div-impl(long $this, float operand);
+ method public static inline boolean equals-impl(long p, Object? p1);
+ method public static boolean equals-impl0(long p1, long p2);
+ method public static float getDirection-impl(long $this);
+ method public static float getDistance-impl(long $this);
+ method public static float getDistanceSquared-impl(long $this);
+ method public static float getDx-impl(long $this);
+ method public static float getDy-impl(long $this);
+ method public static inline int hashCode-impl(long p);
+ method public static operator long minus-RIqb49o(long $this, long other);
+ method public static operator long plus-RIqb49o(long $this, long other);
+ method public static operator long rem-impl(long $this, float operand);
+ method public static long scale-impl(long $this, float scaleX, float scaleY);
+ method public static operator long times-impl(long $this, float operand);
+ method public static String toString-impl(long $this);
+ method public static long translate-impl(long $this, float translateX, float translateY);
+ method public static long truncDiv-impl(long $this, float operand);
+ method public static operator long unaryMinus-impl(long $this);
field public static final androidx.ui.geometry.Offset.Companion! Companion;
}
public static final class Offset.Companion {
- method public androidx.ui.geometry.Offset getInfinite();
- method public androidx.ui.geometry.Offset getZero();
- method public boolean isValid(androidx.ui.geometry.Offset offset);
- method public androidx.ui.geometry.Offset lerp(androidx.ui.geometry.Offset start, androidx.ui.geometry.Offset stop, float fraction);
- property public final androidx.ui.geometry.Offset infinite;
- property public final androidx.ui.geometry.Offset zero;
+ method public long getInfinite();
+ method public long getZero();
+ method public boolean isValid-RIqb49o(long offset);
+ method public long lerp-nqy8KaQ(long start, long stop, float fraction);
+ property public final long infinite;
+ property public final long zero;
}
public interface OffsetBase {
@@ -46,6 +48,10 @@
property public abstract float dy;
}
+ public final class OffsetKt {
+ method public static long Offset(float dx, float dy);
+ }
+
public final class RRect {
ctor public RRect(float left, float top, float right, float bottom, float topLeftRadiusX, float topLeftRadiusY, float topRightRadiusX, float topRightRadiusY, float bottomRightRadiusX, float bottomRightRadiusY, float bottomLeftRadiusX, float bottomLeftRadiusY);
method public float component1();
@@ -60,7 +66,7 @@
method public float component7();
method public float component8();
method public float component9();
- method public boolean contains(androidx.ui.geometry.Offset point);
+ method public boolean contains-RIqb49o(long point);
method public androidx.ui.geometry.RRect copy(float left, float top, float right, float bottom, float topLeftRadiusX, float topLeftRadiusY, float topRightRadiusX, float topRightRadiusY, float bottomRightRadiusX, float bottomRightRadiusY, float bottomLeftRadiusX, float bottomLeftRadiusY);
method @Deprecated public androidx.ui.geometry.RRect deflate(float delta);
method public float getBottom();
@@ -98,7 +104,7 @@
method public static androidx.ui.geometry.RRect RRect(androidx.ui.geometry.Rect rect, androidx.ui.geometry.Radius topLeft = Radius.zero, androidx.ui.geometry.Radius topRight = Radius.zero, androidx.ui.geometry.Radius bottomRight = Radius.zero, androidx.ui.geometry.Radius bottomLeft = Radius.zero);
method public static androidx.ui.geometry.Radius bottomLeftRadius(androidx.ui.geometry.RRect);
method public static androidx.ui.geometry.Radius bottomRightRadius(androidx.ui.geometry.RRect);
- method public static androidx.ui.geometry.Offset center(androidx.ui.geometry.RRect);
+ method public static long center(androidx.ui.geometry.RRect);
method public static float getLongestSide(androidx.ui.geometry.RRect);
method public static float getShortestSide(androidx.ui.geometry.RRect);
method public static androidx.ui.geometry.RRect grow(androidx.ui.geometry.RRect, float delta);
@@ -113,7 +119,7 @@
method public static androidx.ui.geometry.Rect middleRect(androidx.ui.geometry.RRect);
method public static androidx.ui.geometry.Rect outerRect(androidx.ui.geometry.RRect);
method public static androidx.ui.geometry.Rect safeInnerRect(androidx.ui.geometry.RRect);
- method public static androidx.ui.geometry.RRect shift(androidx.ui.geometry.RRect, androidx.ui.geometry.Offset offset);
+ method public static androidx.ui.geometry.RRect shift-q6ZkaaM(androidx.ui.geometry.RRect, long offset);
method public static androidx.ui.geometry.RRect shrink(androidx.ui.geometry.RRect, float delta);
method public static androidx.ui.geometry.Rect tallMiddleRect(androidx.ui.geometry.RRect);
method public static androidx.ui.geometry.Radius topLeftRadius(androidx.ui.geometry.RRect);
@@ -156,27 +162,27 @@
method public float component2();
method public float component3();
method public float component4();
- method public boolean contains(androidx.ui.geometry.Offset offset);
+ method public boolean contains-RIqb49o(long offset);
method public androidx.ui.geometry.Rect copy(float left, float top, float right, float bottom);
method public androidx.ui.geometry.Rect deflate(float delta);
method public androidx.ui.geometry.Rect expandToInclude(androidx.ui.geometry.Rect other);
method public float getBottom();
- method public androidx.ui.geometry.Offset getBottomCenter();
- method public androidx.ui.geometry.Offset getBottomLeft();
- method public androidx.ui.geometry.Offset getBottomRight();
- method public androidx.ui.geometry.Offset getCenter();
- method public androidx.ui.geometry.Offset getCenterLeft();
- method public androidx.ui.geometry.Offset getCenterRight();
+ method public long getBottomCenter();
+ method public long getBottomLeft();
+ method public long getBottomRight();
+ method public long getCenter();
+ method public long getCenterLeft();
+ method public long getCenterRight();
method public float getHeight();
method public float getLeft();
- method public float getLongestSide();
+ method public float getMaxDimension();
+ method public float getMinDimension();
method public float getRight();
- method public float getShortestSide();
- method public androidx.ui.geometry.Size getSize();
+ method public long getSize();
method public float getTop();
- method public androidx.ui.geometry.Offset getTopCenter();
- method public androidx.ui.geometry.Offset getTopLeft();
- method public androidx.ui.geometry.Offset getTopRight();
+ method public long getTopCenter();
+ method public long getTopLeft();
+ method public long getTopRight();
method public float getWidth();
method public androidx.ui.geometry.Rect inflate(float delta);
method public androidx.ui.geometry.Rect intersect(androidx.ui.geometry.Rect other);
@@ -185,18 +191,20 @@
method public boolean isInfinite();
method public androidx.ui.geometry.Rect join(androidx.ui.geometry.Rect other);
method public boolean overlaps(androidx.ui.geometry.Rect other);
- method public androidx.ui.geometry.Rect shift(androidx.ui.geometry.Offset offset);
+ method public androidx.ui.geometry.Rect shift-RIqb49o(long offset);
method public androidx.ui.geometry.Rect translate(float translateX, float translateY);
property public final float height;
+ property public final float maxDimension;
+ property public final float minDimension;
property public final float width;
field public static final androidx.ui.geometry.Rect.Companion! Companion;
}
public static final class Rect.Companion {
- method public androidx.ui.geometry.Rect fromCircle(androidx.ui.geometry.Offset center, float radius);
+ method public androidx.ui.geometry.Rect fromCircle-hSKLB2U(long center, float radius);
method public androidx.ui.geometry.Rect fromLTRB(float left, float top, float right, float bottom);
method public androidx.ui.geometry.Rect fromLTWH(float left, float top, float width, float height);
- method public androidx.ui.geometry.Rect fromPoints(androidx.ui.geometry.Offset a, androidx.ui.geometry.Offset b);
+ method public androidx.ui.geometry.Rect fromPoints-cs1Rg_A(long a, long b);
method public androidx.ui.geometry.Rect getLargest();
method public androidx.ui.geometry.Rect getZero();
method public float get_giantScalar();
@@ -209,49 +217,54 @@
method public static androidx.ui.geometry.Rect lerp(androidx.ui.geometry.Rect start, androidx.ui.geometry.Rect stop, float fraction);
}
- public class Size implements androidx.ui.geometry.OffsetBase {
- ctor public Size(float width, float height);
- method public final androidx.ui.geometry.Offset bottomCenter(androidx.ui.geometry.Offset origin);
- method public final androidx.ui.geometry.Offset bottomLeft(androidx.ui.geometry.Offset origin);
- method public final androidx.ui.geometry.Offset bottomRight(androidx.ui.geometry.Offset origin);
- method public final androidx.ui.geometry.Offset center(androidx.ui.geometry.Offset origin);
- method public final androidx.ui.geometry.Offset centerLeft(androidx.ui.geometry.Offset origin);
- method public final androidx.ui.geometry.Offset centerRight(androidx.ui.geometry.Offset origin);
- method public final boolean contains(androidx.ui.geometry.Offset offset);
- method public final operator androidx.ui.geometry.Size div(float operand);
- method public float getDx();
- method public float getDy();
- method public final androidx.ui.geometry.Size getFlipped();
- method public final float getHeight();
- method public final float getLongestSide();
- method public final float getShortestSide();
- method public final float getWidth();
- method public final boolean isEmpty();
- method public final operator androidx.ui.geometry.Size minus(androidx.ui.geometry.Offset other);
- method public final operator androidx.ui.geometry.Offset minus(androidx.ui.geometry.Size other);
- method public final operator androidx.ui.geometry.Size plus(androidx.ui.geometry.Offset other);
- method public final operator androidx.ui.geometry.Size rem(float operand);
- method public final operator androidx.ui.geometry.Size times(float operand);
- method public final androidx.ui.geometry.Offset topCenter(androidx.ui.geometry.Offset origin);
- method public final androidx.ui.geometry.Offset topLeft(androidx.ui.geometry.Offset origin);
- method public final androidx.ui.geometry.Offset topRight(androidx.ui.geometry.Offset origin);
- method public final androidx.ui.geometry.Size truncDiv(float operand);
- property public float dx;
- property public float dy;
+ public final inline class Size {
+ ctor public Size();
+ method public static long bottomCenter-RIqb49o(long $this, long origin);
+ method public static long bottomLeft-RIqb49o(long $this, long origin);
+ method public static long bottomRight-RIqb49o(long $this, long origin);
+ method public static long center-RIqb49o(long $this, long origin);
+ method public static long centerLeft-RIqb49o(long $this, long origin);
+ method public static long centerRight-RIqb49o(long $this, long origin);
+ method public static long constructor-impl(internal long value);
+ method public static boolean contains-RIqb49o(long $this, long offset);
+ method public static operator long div-impl(long $this, float operand);
+ method public static inline boolean equals-impl(long p, Object? p1);
+ method public static boolean equals-impl0(long p1, long p2);
+ method public static long getFlipped-impl(long $this);
+ method public static float getHeight-impl(long $this);
+ method public static float getMaxDimension-impl(long $this);
+ method public static float getMinDimension-impl(long $this);
+ method public static float getWidth-impl(long $this);
+ method public static inline int hashCode-impl(long p);
+ method public static boolean isEmpty-impl(long $this);
+ method public static operator long minus-RIqb49o(long $this, long other);
+ method public static operator long minus-b2zCL34(long $this, long other);
+ method public static operator long plus-RIqb49o(long $this, long other);
+ method public static operator long rem-impl(long $this, float operand);
+ method public static operator long times-impl(long $this, float operand);
+ method public static String toString-impl(long $this);
+ method public static long topCenter-RIqb49o(long $this, long origin);
+ method public static long topLeft-RIqb49o(long $this, long origin);
+ method public static long topRight-RIqb49o(long $this, long origin);
+ method public static long truncDiv-impl(long $this, float operand);
field public static final androidx.ui.geometry.Size.Companion! Companion;
}
public static final class Size.Companion {
- method public androidx.ui.geometry.Size copy(androidx.ui.geometry.Size source);
- method public androidx.ui.geometry.Size fromHeight(float height);
- method public androidx.ui.geometry.Size fromRadius(float radius);
- method public androidx.ui.geometry.Size fromWidth(float width);
- method public androidx.ui.geometry.Size getInfinite();
- method public androidx.ui.geometry.Size getZero();
- method public androidx.ui.geometry.Size? lerp(androidx.ui.geometry.Size start, androidx.ui.geometry.Size stop, float fraction);
- method public androidx.ui.geometry.Size square(float dimension);
- property public final androidx.ui.geometry.Size infinite;
- property public final androidx.ui.geometry.Size zero;
+ method public long copy-b2zCL34(long source);
+ method public long fromHeight(float height);
+ method public long fromRadius(float radius);
+ method public long fromWidth(float width);
+ method public long getInfinite();
+ method public long getZero();
+ method public androidx.ui.geometry.Size? lerp-T-c3OIQ(long start, long stop, float fraction);
+ method public long square(float dimension);
+ property public final long infinite;
+ property public final long zero;
+ }
+
+ public final class SizeKt {
+ method public static long Size(float width, float height);
}
}
diff --git a/ui/ui-geometry/api/public_plus_experimental_0.1.0-dev11.txt b/ui/ui-geometry/api/public_plus_experimental_0.1.0-dev11.txt
index 4ad12c3..390ba95 100644
--- a/ui/ui-geometry/api/public_plus_experimental_0.1.0-dev11.txt
+++ b/ui/ui-geometry/api/public_plus_experimental_0.1.0-dev11.txt
@@ -1,36 +1,38 @@
// Signature format: 3.0
package androidx.ui.geometry {
- public final class Offset implements androidx.ui.geometry.OffsetBase {
- ctor public Offset(float dx, float dy);
- method public infix androidx.ui.geometry.Rect and(androidx.ui.geometry.Size other);
- method public float component1();
- method public float component2();
- method public androidx.ui.geometry.Offset copy(float dx, float dy);
- method public operator androidx.ui.geometry.Offset div(float operand);
- method public float getDirection();
- method public float getDistance();
- method public float getDistanceSquared();
- method public float getDx();
- method public float getDy();
- method public operator androidx.ui.geometry.Offset minus(androidx.ui.geometry.Offset other);
- method public operator androidx.ui.geometry.Offset plus(androidx.ui.geometry.Offset other);
- method public operator androidx.ui.geometry.Offset rem(float operand);
- method public androidx.ui.geometry.Offset scale(float scaleX, float scaleY);
- method public operator androidx.ui.geometry.Offset times(float operand);
- method public androidx.ui.geometry.Offset translate(float translateX, float translateY);
- method public androidx.ui.geometry.Offset truncDiv(float operand);
- method public operator androidx.ui.geometry.Offset unaryMinus();
+ public final inline class Offset {
+ ctor public Offset();
+ method public static infix androidx.ui.geometry.Rect and-b2zCL34(long $this, long other);
+ method public static long constructor-impl(internal long packedValue);
+ method public static operator long div-impl(long $this, float operand);
+ method public static inline boolean equals-impl(long p, Object? p1);
+ method public static boolean equals-impl0(long p1, long p2);
+ method public static float getDirection-impl(long $this);
+ method public static float getDistance-impl(long $this);
+ method public static float getDistanceSquared-impl(long $this);
+ method public static float getDx-impl(long $this);
+ method public static float getDy-impl(long $this);
+ method public static inline int hashCode-impl(long p);
+ method public static operator long minus-RIqb49o(long $this, long other);
+ method public static operator long plus-RIqb49o(long $this, long other);
+ method public static operator long rem-impl(long $this, float operand);
+ method public static long scale-impl(long $this, float scaleX, float scaleY);
+ method public static operator long times-impl(long $this, float operand);
+ method public static String toString-impl(long $this);
+ method public static long translate-impl(long $this, float translateX, float translateY);
+ method public static long truncDiv-impl(long $this, float operand);
+ method public static operator long unaryMinus-impl(long $this);
field public static final androidx.ui.geometry.Offset.Companion! Companion;
}
public static final class Offset.Companion {
- method public androidx.ui.geometry.Offset getInfinite();
- method public androidx.ui.geometry.Offset getZero();
- method public boolean isValid(androidx.ui.geometry.Offset offset);
- method public androidx.ui.geometry.Offset lerp(androidx.ui.geometry.Offset start, androidx.ui.geometry.Offset stop, float fraction);
- property public final androidx.ui.geometry.Offset infinite;
- property public final androidx.ui.geometry.Offset zero;
+ method public long getInfinite();
+ method public long getZero();
+ method public boolean isValid-RIqb49o(long offset);
+ method public long lerp-nqy8KaQ(long start, long stop, float fraction);
+ property public final long infinite;
+ property public final long zero;
}
public interface OffsetBase {
@@ -46,6 +48,10 @@
property public abstract float dy;
}
+ public final class OffsetKt {
+ method public static long Offset(float dx, float dy);
+ }
+
public final class RRect {
ctor public RRect(float left, float top, float right, float bottom, float topLeftRadiusX, float topLeftRadiusY, float topRightRadiusX, float topRightRadiusY, float bottomRightRadiusX, float bottomRightRadiusY, float bottomLeftRadiusX, float bottomLeftRadiusY);
method public float component1();
@@ -60,7 +66,7 @@
method public float component7();
method public float component8();
method public float component9();
- method public boolean contains(androidx.ui.geometry.Offset point);
+ method public boolean contains-RIqb49o(long point);
method public androidx.ui.geometry.RRect copy(float left, float top, float right, float bottom, float topLeftRadiusX, float topLeftRadiusY, float topRightRadiusX, float topRightRadiusY, float bottomRightRadiusX, float bottomRightRadiusY, float bottomLeftRadiusX, float bottomLeftRadiusY);
method @Deprecated public androidx.ui.geometry.RRect deflate(float delta);
method public float getBottom();
@@ -98,7 +104,7 @@
method public static androidx.ui.geometry.RRect RRect(androidx.ui.geometry.Rect rect, androidx.ui.geometry.Radius topLeft = Radius.zero, androidx.ui.geometry.Radius topRight = Radius.zero, androidx.ui.geometry.Radius bottomRight = Radius.zero, androidx.ui.geometry.Radius bottomLeft = Radius.zero);
method public static androidx.ui.geometry.Radius bottomLeftRadius(androidx.ui.geometry.RRect);
method public static androidx.ui.geometry.Radius bottomRightRadius(androidx.ui.geometry.RRect);
- method public static androidx.ui.geometry.Offset center(androidx.ui.geometry.RRect);
+ method public static long center(androidx.ui.geometry.RRect);
method public static float getLongestSide(androidx.ui.geometry.RRect);
method public static float getShortestSide(androidx.ui.geometry.RRect);
method public static androidx.ui.geometry.RRect grow(androidx.ui.geometry.RRect, float delta);
@@ -113,7 +119,7 @@
method public static androidx.ui.geometry.Rect middleRect(androidx.ui.geometry.RRect);
method public static androidx.ui.geometry.Rect outerRect(androidx.ui.geometry.RRect);
method public static androidx.ui.geometry.Rect safeInnerRect(androidx.ui.geometry.RRect);
- method public static androidx.ui.geometry.RRect shift(androidx.ui.geometry.RRect, androidx.ui.geometry.Offset offset);
+ method public static androidx.ui.geometry.RRect shift-q6ZkaaM(androidx.ui.geometry.RRect, long offset);
method public static androidx.ui.geometry.RRect shrink(androidx.ui.geometry.RRect, float delta);
method public static androidx.ui.geometry.Rect tallMiddleRect(androidx.ui.geometry.RRect);
method public static androidx.ui.geometry.Radius topLeftRadius(androidx.ui.geometry.RRect);
@@ -156,27 +162,27 @@
method public float component2();
method public float component3();
method public float component4();
- method public boolean contains(androidx.ui.geometry.Offset offset);
+ method public boolean contains-RIqb49o(long offset);
method public androidx.ui.geometry.Rect copy(float left, float top, float right, float bottom);
method public androidx.ui.geometry.Rect deflate(float delta);
method public androidx.ui.geometry.Rect expandToInclude(androidx.ui.geometry.Rect other);
method public float getBottom();
- method public androidx.ui.geometry.Offset getBottomCenter();
- method public androidx.ui.geometry.Offset getBottomLeft();
- method public androidx.ui.geometry.Offset getBottomRight();
- method public androidx.ui.geometry.Offset getCenter();
- method public androidx.ui.geometry.Offset getCenterLeft();
- method public androidx.ui.geometry.Offset getCenterRight();
+ method public long getBottomCenter();
+ method public long getBottomLeft();
+ method public long getBottomRight();
+ method public long getCenter();
+ method public long getCenterLeft();
+ method public long getCenterRight();
method public float getHeight();
method public float getLeft();
- method public float getLongestSide();
+ method public float getMaxDimension();
+ method public float getMinDimension();
method public float getRight();
- method public float getShortestSide();
- method public androidx.ui.geometry.Size getSize();
+ method public long getSize();
method public float getTop();
- method public androidx.ui.geometry.Offset getTopCenter();
- method public androidx.ui.geometry.Offset getTopLeft();
- method public androidx.ui.geometry.Offset getTopRight();
+ method public long getTopCenter();
+ method public long getTopLeft();
+ method public long getTopRight();
method public float getWidth();
method public androidx.ui.geometry.Rect inflate(float delta);
method public androidx.ui.geometry.Rect intersect(androidx.ui.geometry.Rect other);
@@ -185,18 +191,20 @@
method public boolean isInfinite();
method public androidx.ui.geometry.Rect join(androidx.ui.geometry.Rect other);
method public boolean overlaps(androidx.ui.geometry.Rect other);
- method public androidx.ui.geometry.Rect shift(androidx.ui.geometry.Offset offset);
+ method public androidx.ui.geometry.Rect shift-RIqb49o(long offset);
method public androidx.ui.geometry.Rect translate(float translateX, float translateY);
property public final float height;
+ property public final float maxDimension;
+ property public final float minDimension;
property public final float width;
field public static final androidx.ui.geometry.Rect.Companion! Companion;
}
public static final class Rect.Companion {
- method public androidx.ui.geometry.Rect fromCircle(androidx.ui.geometry.Offset center, float radius);
+ method public androidx.ui.geometry.Rect fromCircle-hSKLB2U(long center, float radius);
method public androidx.ui.geometry.Rect fromLTRB(float left, float top, float right, float bottom);
method public androidx.ui.geometry.Rect fromLTWH(float left, float top, float width, float height);
- method public androidx.ui.geometry.Rect fromPoints(androidx.ui.geometry.Offset a, androidx.ui.geometry.Offset b);
+ method public androidx.ui.geometry.Rect fromPoints-cs1Rg_A(long a, long b);
method public androidx.ui.geometry.Rect getLargest();
method public androidx.ui.geometry.Rect getZero();
method public float get_giantScalar();
@@ -209,49 +217,54 @@
method public static androidx.ui.geometry.Rect lerp(androidx.ui.geometry.Rect start, androidx.ui.geometry.Rect stop, float fraction);
}
- public class Size implements androidx.ui.geometry.OffsetBase {
- ctor public Size(float width, float height);
- method public final androidx.ui.geometry.Offset bottomCenter(androidx.ui.geometry.Offset origin);
- method public final androidx.ui.geometry.Offset bottomLeft(androidx.ui.geometry.Offset origin);
- method public final androidx.ui.geometry.Offset bottomRight(androidx.ui.geometry.Offset origin);
- method public final androidx.ui.geometry.Offset center(androidx.ui.geometry.Offset origin);
- method public final androidx.ui.geometry.Offset centerLeft(androidx.ui.geometry.Offset origin);
- method public final androidx.ui.geometry.Offset centerRight(androidx.ui.geometry.Offset origin);
- method public final boolean contains(androidx.ui.geometry.Offset offset);
- method public final operator androidx.ui.geometry.Size div(float operand);
- method public float getDx();
- method public float getDy();
- method public final androidx.ui.geometry.Size getFlipped();
- method public final float getHeight();
- method public final float getLongestSide();
- method public final float getShortestSide();
- method public final float getWidth();
- method public final boolean isEmpty();
- method public final operator androidx.ui.geometry.Size minus(androidx.ui.geometry.Offset other);
- method public final operator androidx.ui.geometry.Offset minus(androidx.ui.geometry.Size other);
- method public final operator androidx.ui.geometry.Size plus(androidx.ui.geometry.Offset other);
- method public final operator androidx.ui.geometry.Size rem(float operand);
- method public final operator androidx.ui.geometry.Size times(float operand);
- method public final androidx.ui.geometry.Offset topCenter(androidx.ui.geometry.Offset origin);
- method public final androidx.ui.geometry.Offset topLeft(androidx.ui.geometry.Offset origin);
- method public final androidx.ui.geometry.Offset topRight(androidx.ui.geometry.Offset origin);
- method public final androidx.ui.geometry.Size truncDiv(float operand);
- property public float dx;
- property public float dy;
+ public final inline class Size {
+ ctor public Size();
+ method public static long bottomCenter-RIqb49o(long $this, long origin);
+ method public static long bottomLeft-RIqb49o(long $this, long origin);
+ method public static long bottomRight-RIqb49o(long $this, long origin);
+ method public static long center-RIqb49o(long $this, long origin);
+ method public static long centerLeft-RIqb49o(long $this, long origin);
+ method public static long centerRight-RIqb49o(long $this, long origin);
+ method public static long constructor-impl(internal long value);
+ method public static boolean contains-RIqb49o(long $this, long offset);
+ method public static operator long div-impl(long $this, float operand);
+ method public static inline boolean equals-impl(long p, Object? p1);
+ method public static boolean equals-impl0(long p1, long p2);
+ method public static long getFlipped-impl(long $this);
+ method public static float getHeight-impl(long $this);
+ method public static float getMaxDimension-impl(long $this);
+ method public static float getMinDimension-impl(long $this);
+ method public static float getWidth-impl(long $this);
+ method public static inline int hashCode-impl(long p);
+ method public static boolean isEmpty-impl(long $this);
+ method public static operator long minus-RIqb49o(long $this, long other);
+ method public static operator long minus-b2zCL34(long $this, long other);
+ method public static operator long plus-RIqb49o(long $this, long other);
+ method public static operator long rem-impl(long $this, float operand);
+ method public static operator long times-impl(long $this, float operand);
+ method public static String toString-impl(long $this);
+ method public static long topCenter-RIqb49o(long $this, long origin);
+ method public static long topLeft-RIqb49o(long $this, long origin);
+ method public static long topRight-RIqb49o(long $this, long origin);
+ method public static long truncDiv-impl(long $this, float operand);
field public static final androidx.ui.geometry.Size.Companion! Companion;
}
public static final class Size.Companion {
- method public androidx.ui.geometry.Size copy(androidx.ui.geometry.Size source);
- method public androidx.ui.geometry.Size fromHeight(float height);
- method public androidx.ui.geometry.Size fromRadius(float radius);
- method public androidx.ui.geometry.Size fromWidth(float width);
- method public androidx.ui.geometry.Size getInfinite();
- method public androidx.ui.geometry.Size getZero();
- method public androidx.ui.geometry.Size? lerp(androidx.ui.geometry.Size start, androidx.ui.geometry.Size stop, float fraction);
- method public androidx.ui.geometry.Size square(float dimension);
- property public final androidx.ui.geometry.Size infinite;
- property public final androidx.ui.geometry.Size zero;
+ method public long copy-b2zCL34(long source);
+ method public long fromHeight(float height);
+ method public long fromRadius(float radius);
+ method public long fromWidth(float width);
+ method public long getInfinite();
+ method public long getZero();
+ method public androidx.ui.geometry.Size? lerp-T-c3OIQ(long start, long stop, float fraction);
+ method public long square(float dimension);
+ property public final long infinite;
+ property public final long zero;
+ }
+
+ public final class SizeKt {
+ method public static long Size(float width, float height);
}
}
diff --git a/ui/ui-geometry/api/public_plus_experimental_current.txt b/ui/ui-geometry/api/public_plus_experimental_current.txt
index 4ad12c3..390ba95 100644
--- a/ui/ui-geometry/api/public_plus_experimental_current.txt
+++ b/ui/ui-geometry/api/public_plus_experimental_current.txt
@@ -1,36 +1,38 @@
// Signature format: 3.0
package androidx.ui.geometry {
- public final class Offset implements androidx.ui.geometry.OffsetBase {
- ctor public Offset(float dx, float dy);
- method public infix androidx.ui.geometry.Rect and(androidx.ui.geometry.Size other);
- method public float component1();
- method public float component2();
- method public androidx.ui.geometry.Offset copy(float dx, float dy);
- method public operator androidx.ui.geometry.Offset div(float operand);
- method public float getDirection();
- method public float getDistance();
- method public float getDistanceSquared();
- method public float getDx();
- method public float getDy();
- method public operator androidx.ui.geometry.Offset minus(androidx.ui.geometry.Offset other);
- method public operator androidx.ui.geometry.Offset plus(androidx.ui.geometry.Offset other);
- method public operator androidx.ui.geometry.Offset rem(float operand);
- method public androidx.ui.geometry.Offset scale(float scaleX, float scaleY);
- method public operator androidx.ui.geometry.Offset times(float operand);
- method public androidx.ui.geometry.Offset translate(float translateX, float translateY);
- method public androidx.ui.geometry.Offset truncDiv(float operand);
- method public operator androidx.ui.geometry.Offset unaryMinus();
+ public final inline class Offset {
+ ctor public Offset();
+ method public static infix androidx.ui.geometry.Rect and-b2zCL34(long $this, long other);
+ method public static long constructor-impl(internal long packedValue);
+ method public static operator long div-impl(long $this, float operand);
+ method public static inline boolean equals-impl(long p, Object? p1);
+ method public static boolean equals-impl0(long p1, long p2);
+ method public static float getDirection-impl(long $this);
+ method public static float getDistance-impl(long $this);
+ method public static float getDistanceSquared-impl(long $this);
+ method public static float getDx-impl(long $this);
+ method public static float getDy-impl(long $this);
+ method public static inline int hashCode-impl(long p);
+ method public static operator long minus-RIqb49o(long $this, long other);
+ method public static operator long plus-RIqb49o(long $this, long other);
+ method public static operator long rem-impl(long $this, float operand);
+ method public static long scale-impl(long $this, float scaleX, float scaleY);
+ method public static operator long times-impl(long $this, float operand);
+ method public static String toString-impl(long $this);
+ method public static long translate-impl(long $this, float translateX, float translateY);
+ method public static long truncDiv-impl(long $this, float operand);
+ method public static operator long unaryMinus-impl(long $this);
field public static final androidx.ui.geometry.Offset.Companion! Companion;
}
public static final class Offset.Companion {
- method public androidx.ui.geometry.Offset getInfinite();
- method public androidx.ui.geometry.Offset getZero();
- method public boolean isValid(androidx.ui.geometry.Offset offset);
- method public androidx.ui.geometry.Offset lerp(androidx.ui.geometry.Offset start, androidx.ui.geometry.Offset stop, float fraction);
- property public final androidx.ui.geometry.Offset infinite;
- property public final androidx.ui.geometry.Offset zero;
+ method public long getInfinite();
+ method public long getZero();
+ method public boolean isValid-RIqb49o(long offset);
+ method public long lerp-nqy8KaQ(long start, long stop, float fraction);
+ property public final long infinite;
+ property public final long zero;
}
public interface OffsetBase {
@@ -46,6 +48,10 @@
property public abstract float dy;
}
+ public final class OffsetKt {
+ method public static long Offset(float dx, float dy);
+ }
+
public final class RRect {
ctor public RRect(float left, float top, float right, float bottom, float topLeftRadiusX, float topLeftRadiusY, float topRightRadiusX, float topRightRadiusY, float bottomRightRadiusX, float bottomRightRadiusY, float bottomLeftRadiusX, float bottomLeftRadiusY);
method public float component1();
@@ -60,7 +66,7 @@
method public float component7();
method public float component8();
method public float component9();
- method public boolean contains(androidx.ui.geometry.Offset point);
+ method public boolean contains-RIqb49o(long point);
method public androidx.ui.geometry.RRect copy(float left, float top, float right, float bottom, float topLeftRadiusX, float topLeftRadiusY, float topRightRadiusX, float topRightRadiusY, float bottomRightRadiusX, float bottomRightRadiusY, float bottomLeftRadiusX, float bottomLeftRadiusY);
method @Deprecated public androidx.ui.geometry.RRect deflate(float delta);
method public float getBottom();
@@ -98,7 +104,7 @@
method public static androidx.ui.geometry.RRect RRect(androidx.ui.geometry.Rect rect, androidx.ui.geometry.Radius topLeft = Radius.zero, androidx.ui.geometry.Radius topRight = Radius.zero, androidx.ui.geometry.Radius bottomRight = Radius.zero, androidx.ui.geometry.Radius bottomLeft = Radius.zero);
method public static androidx.ui.geometry.Radius bottomLeftRadius(androidx.ui.geometry.RRect);
method public static androidx.ui.geometry.Radius bottomRightRadius(androidx.ui.geometry.RRect);
- method public static androidx.ui.geometry.Offset center(androidx.ui.geometry.RRect);
+ method public static long center(androidx.ui.geometry.RRect);
method public static float getLongestSide(androidx.ui.geometry.RRect);
method public static float getShortestSide(androidx.ui.geometry.RRect);
method public static androidx.ui.geometry.RRect grow(androidx.ui.geometry.RRect, float delta);
@@ -113,7 +119,7 @@
method public static androidx.ui.geometry.Rect middleRect(androidx.ui.geometry.RRect);
method public static androidx.ui.geometry.Rect outerRect(androidx.ui.geometry.RRect);
method public static androidx.ui.geometry.Rect safeInnerRect(androidx.ui.geometry.RRect);
- method public static androidx.ui.geometry.RRect shift(androidx.ui.geometry.RRect, androidx.ui.geometry.Offset offset);
+ method public static androidx.ui.geometry.RRect shift-q6ZkaaM(androidx.ui.geometry.RRect, long offset);
method public static androidx.ui.geometry.RRect shrink(androidx.ui.geometry.RRect, float delta);
method public static androidx.ui.geometry.Rect tallMiddleRect(androidx.ui.geometry.RRect);
method public static androidx.ui.geometry.Radius topLeftRadius(androidx.ui.geometry.RRect);
@@ -156,27 +162,27 @@
method public float component2();
method public float component3();
method public float component4();
- method public boolean contains(androidx.ui.geometry.Offset offset);
+ method public boolean contains-RIqb49o(long offset);
method public androidx.ui.geometry.Rect copy(float left, float top, float right, float bottom);
method public androidx.ui.geometry.Rect deflate(float delta);
method public androidx.ui.geometry.Rect expandToInclude(androidx.ui.geometry.Rect other);
method public float getBottom();
- method public androidx.ui.geometry.Offset getBottomCenter();
- method public androidx.ui.geometry.Offset getBottomLeft();
- method public androidx.ui.geometry.Offset getBottomRight();
- method public androidx.ui.geometry.Offset getCenter();
- method public androidx.ui.geometry.Offset getCenterLeft();
- method public androidx.ui.geometry.Offset getCenterRight();
+ method public long getBottomCenter();
+ method public long getBottomLeft();
+ method public long getBottomRight();
+ method public long getCenter();
+ method public long getCenterLeft();
+ method public long getCenterRight();
method public float getHeight();
method public float getLeft();
- method public float getLongestSide();
+ method public float getMaxDimension();
+ method public float getMinDimension();
method public float getRight();
- method public float getShortestSide();
- method public androidx.ui.geometry.Size getSize();
+ method public long getSize();
method public float getTop();
- method public androidx.ui.geometry.Offset getTopCenter();
- method public androidx.ui.geometry.Offset getTopLeft();
- method public androidx.ui.geometry.Offset getTopRight();
+ method public long getTopCenter();
+ method public long getTopLeft();
+ method public long getTopRight();
method public float getWidth();
method public androidx.ui.geometry.Rect inflate(float delta);
method public androidx.ui.geometry.Rect intersect(androidx.ui.geometry.Rect other);
@@ -185,18 +191,20 @@
method public boolean isInfinite();
method public androidx.ui.geometry.Rect join(androidx.ui.geometry.Rect other);
method public boolean overlaps(androidx.ui.geometry.Rect other);
- method public androidx.ui.geometry.Rect shift(androidx.ui.geometry.Offset offset);
+ method public androidx.ui.geometry.Rect shift-RIqb49o(long offset);
method public androidx.ui.geometry.Rect translate(float translateX, float translateY);
property public final float height;
+ property public final float maxDimension;
+ property public final float minDimension;
property public final float width;
field public static final androidx.ui.geometry.Rect.Companion! Companion;
}
public static final class Rect.Companion {
- method public androidx.ui.geometry.Rect fromCircle(androidx.ui.geometry.Offset center, float radius);
+ method public androidx.ui.geometry.Rect fromCircle-hSKLB2U(long center, float radius);
method public androidx.ui.geometry.Rect fromLTRB(float left, float top, float right, float bottom);
method public androidx.ui.geometry.Rect fromLTWH(float left, float top, float width, float height);
- method public androidx.ui.geometry.Rect fromPoints(androidx.ui.geometry.Offset a, androidx.ui.geometry.Offset b);
+ method public androidx.ui.geometry.Rect fromPoints-cs1Rg_A(long a, long b);
method public androidx.ui.geometry.Rect getLargest();
method public androidx.ui.geometry.Rect getZero();
method public float get_giantScalar();
@@ -209,49 +217,54 @@
method public static androidx.ui.geometry.Rect lerp(androidx.ui.geometry.Rect start, androidx.ui.geometry.Rect stop, float fraction);
}
- public class Size implements androidx.ui.geometry.OffsetBase {
- ctor public Size(float width, float height);
- method public final androidx.ui.geometry.Offset bottomCenter(androidx.ui.geometry.Offset origin);
- method public final androidx.ui.geometry.Offset bottomLeft(androidx.ui.geometry.Offset origin);
- method public final androidx.ui.geometry.Offset bottomRight(androidx.ui.geometry.Offset origin);
- method public final androidx.ui.geometry.Offset center(androidx.ui.geometry.Offset origin);
- method public final androidx.ui.geometry.Offset centerLeft(androidx.ui.geometry.Offset origin);
- method public final androidx.ui.geometry.Offset centerRight(androidx.ui.geometry.Offset origin);
- method public final boolean contains(androidx.ui.geometry.Offset offset);
- method public final operator androidx.ui.geometry.Size div(float operand);
- method public float getDx();
- method public float getDy();
- method public final androidx.ui.geometry.Size getFlipped();
- method public final float getHeight();
- method public final float getLongestSide();
- method public final float getShortestSide();
- method public final float getWidth();
- method public final boolean isEmpty();
- method public final operator androidx.ui.geometry.Size minus(androidx.ui.geometry.Offset other);
- method public final operator androidx.ui.geometry.Offset minus(androidx.ui.geometry.Size other);
- method public final operator androidx.ui.geometry.Size plus(androidx.ui.geometry.Offset other);
- method public final operator androidx.ui.geometry.Size rem(float operand);
- method public final operator androidx.ui.geometry.Size times(float operand);
- method public final androidx.ui.geometry.Offset topCenter(androidx.ui.geometry.Offset origin);
- method public final androidx.ui.geometry.Offset topLeft(androidx.ui.geometry.Offset origin);
- method public final androidx.ui.geometry.Offset topRight(androidx.ui.geometry.Offset origin);
- method public final androidx.ui.geometry.Size truncDiv(float operand);
- property public float dx;
- property public float dy;
+ public final inline class Size {
+ ctor public Size();
+ method public static long bottomCenter-RIqb49o(long $this, long origin);
+ method public static long bottomLeft-RIqb49o(long $this, long origin);
+ method public static long bottomRight-RIqb49o(long $this, long origin);
+ method public static long center-RIqb49o(long $this, long origin);
+ method public static long centerLeft-RIqb49o(long $this, long origin);
+ method public static long centerRight-RIqb49o(long $this, long origin);
+ method public static long constructor-impl(internal long value);
+ method public static boolean contains-RIqb49o(long $this, long offset);
+ method public static operator long div-impl(long $this, float operand);
+ method public static inline boolean equals-impl(long p, Object? p1);
+ method public static boolean equals-impl0(long p1, long p2);
+ method public static long getFlipped-impl(long $this);
+ method public static float getHeight-impl(long $this);
+ method public static float getMaxDimension-impl(long $this);
+ method public static float getMinDimension-impl(long $this);
+ method public static float getWidth-impl(long $this);
+ method public static inline int hashCode-impl(long p);
+ method public static boolean isEmpty-impl(long $this);
+ method public static operator long minus-RIqb49o(long $this, long other);
+ method public static operator long minus-b2zCL34(long $this, long other);
+ method public static operator long plus-RIqb49o(long $this, long other);
+ method public static operator long rem-impl(long $this, float operand);
+ method public static operator long times-impl(long $this, float operand);
+ method public static String toString-impl(long $this);
+ method public static long topCenter-RIqb49o(long $this, long origin);
+ method public static long topLeft-RIqb49o(long $this, long origin);
+ method public static long topRight-RIqb49o(long $this, long origin);
+ method public static long truncDiv-impl(long $this, float operand);
field public static final androidx.ui.geometry.Size.Companion! Companion;
}
public static final class Size.Companion {
- method public androidx.ui.geometry.Size copy(androidx.ui.geometry.Size source);
- method public androidx.ui.geometry.Size fromHeight(float height);
- method public androidx.ui.geometry.Size fromRadius(float radius);
- method public androidx.ui.geometry.Size fromWidth(float width);
- method public androidx.ui.geometry.Size getInfinite();
- method public androidx.ui.geometry.Size getZero();
- method public androidx.ui.geometry.Size? lerp(androidx.ui.geometry.Size start, androidx.ui.geometry.Size stop, float fraction);
- method public androidx.ui.geometry.Size square(float dimension);
- property public final androidx.ui.geometry.Size infinite;
- property public final androidx.ui.geometry.Size zero;
+ method public long copy-b2zCL34(long source);
+ method public long fromHeight(float height);
+ method public long fromRadius(float radius);
+ method public long fromWidth(float width);
+ method public long getInfinite();
+ method public long getZero();
+ method public androidx.ui.geometry.Size? lerp-T-c3OIQ(long start, long stop, float fraction);
+ method public long square(float dimension);
+ property public final long infinite;
+ property public final long zero;
+ }
+
+ public final class SizeKt {
+ method public static long Size(float width, float height);
}
}
diff --git a/ui/ui-geometry/api/restricted_0.1.0-dev11.txt b/ui/ui-geometry/api/restricted_0.1.0-dev11.txt
index 4ad12c3..390ba95 100644
--- a/ui/ui-geometry/api/restricted_0.1.0-dev11.txt
+++ b/ui/ui-geometry/api/restricted_0.1.0-dev11.txt
@@ -1,36 +1,38 @@
// Signature format: 3.0
package androidx.ui.geometry {
- public final class Offset implements androidx.ui.geometry.OffsetBase {
- ctor public Offset(float dx, float dy);
- method public infix androidx.ui.geometry.Rect and(androidx.ui.geometry.Size other);
- method public float component1();
- method public float component2();
- method public androidx.ui.geometry.Offset copy(float dx, float dy);
- method public operator androidx.ui.geometry.Offset div(float operand);
- method public float getDirection();
- method public float getDistance();
- method public float getDistanceSquared();
- method public float getDx();
- method public float getDy();
- method public operator androidx.ui.geometry.Offset minus(androidx.ui.geometry.Offset other);
- method public operator androidx.ui.geometry.Offset plus(androidx.ui.geometry.Offset other);
- method public operator androidx.ui.geometry.Offset rem(float operand);
- method public androidx.ui.geometry.Offset scale(float scaleX, float scaleY);
- method public operator androidx.ui.geometry.Offset times(float operand);
- method public androidx.ui.geometry.Offset translate(float translateX, float translateY);
- method public androidx.ui.geometry.Offset truncDiv(float operand);
- method public operator androidx.ui.geometry.Offset unaryMinus();
+ public final inline class Offset {
+ ctor public Offset();
+ method public static infix androidx.ui.geometry.Rect and-b2zCL34(long $this, long other);
+ method public static long constructor-impl(internal long packedValue);
+ method public static operator long div-impl(long $this, float operand);
+ method public static inline boolean equals-impl(long p, Object? p1);
+ method public static boolean equals-impl0(long p1, long p2);
+ method public static float getDirection-impl(long $this);
+ method public static float getDistance-impl(long $this);
+ method public static float getDistanceSquared-impl(long $this);
+ method public static float getDx-impl(long $this);
+ method public static float getDy-impl(long $this);
+ method public static inline int hashCode-impl(long p);
+ method public static operator long minus-RIqb49o(long $this, long other);
+ method public static operator long plus-RIqb49o(long $this, long other);
+ method public static operator long rem-impl(long $this, float operand);
+ method public static long scale-impl(long $this, float scaleX, float scaleY);
+ method public static operator long times-impl(long $this, float operand);
+ method public static String toString-impl(long $this);
+ method public static long translate-impl(long $this, float translateX, float translateY);
+ method public static long truncDiv-impl(long $this, float operand);
+ method public static operator long unaryMinus-impl(long $this);
field public static final androidx.ui.geometry.Offset.Companion! Companion;
}
public static final class Offset.Companion {
- method public androidx.ui.geometry.Offset getInfinite();
- method public androidx.ui.geometry.Offset getZero();
- method public boolean isValid(androidx.ui.geometry.Offset offset);
- method public androidx.ui.geometry.Offset lerp(androidx.ui.geometry.Offset start, androidx.ui.geometry.Offset stop, float fraction);
- property public final androidx.ui.geometry.Offset infinite;
- property public final androidx.ui.geometry.Offset zero;
+ method public long getInfinite();
+ method public long getZero();
+ method public boolean isValid-RIqb49o(long offset);
+ method public long lerp-nqy8KaQ(long start, long stop, float fraction);
+ property public final long infinite;
+ property public final long zero;
}
public interface OffsetBase {
@@ -46,6 +48,10 @@
property public abstract float dy;
}
+ public final class OffsetKt {
+ method public static long Offset(float dx, float dy);
+ }
+
public final class RRect {
ctor public RRect(float left, float top, float right, float bottom, float topLeftRadiusX, float topLeftRadiusY, float topRightRadiusX, float topRightRadiusY, float bottomRightRadiusX, float bottomRightRadiusY, float bottomLeftRadiusX, float bottomLeftRadiusY);
method public float component1();
@@ -60,7 +66,7 @@
method public float component7();
method public float component8();
method public float component9();
- method public boolean contains(androidx.ui.geometry.Offset point);
+ method public boolean contains-RIqb49o(long point);
method public androidx.ui.geometry.RRect copy(float left, float top, float right, float bottom, float topLeftRadiusX, float topLeftRadiusY, float topRightRadiusX, float topRightRadiusY, float bottomRightRadiusX, float bottomRightRadiusY, float bottomLeftRadiusX, float bottomLeftRadiusY);
method @Deprecated public androidx.ui.geometry.RRect deflate(float delta);
method public float getBottom();
@@ -98,7 +104,7 @@
method public static androidx.ui.geometry.RRect RRect(androidx.ui.geometry.Rect rect, androidx.ui.geometry.Radius topLeft = Radius.zero, androidx.ui.geometry.Radius topRight = Radius.zero, androidx.ui.geometry.Radius bottomRight = Radius.zero, androidx.ui.geometry.Radius bottomLeft = Radius.zero);
method public static androidx.ui.geometry.Radius bottomLeftRadius(androidx.ui.geometry.RRect);
method public static androidx.ui.geometry.Radius bottomRightRadius(androidx.ui.geometry.RRect);
- method public static androidx.ui.geometry.Offset center(androidx.ui.geometry.RRect);
+ method public static long center(androidx.ui.geometry.RRect);
method public static float getLongestSide(androidx.ui.geometry.RRect);
method public static float getShortestSide(androidx.ui.geometry.RRect);
method public static androidx.ui.geometry.RRect grow(androidx.ui.geometry.RRect, float delta);
@@ -113,7 +119,7 @@
method public static androidx.ui.geometry.Rect middleRect(androidx.ui.geometry.RRect);
method public static androidx.ui.geometry.Rect outerRect(androidx.ui.geometry.RRect);
method public static androidx.ui.geometry.Rect safeInnerRect(androidx.ui.geometry.RRect);
- method public static androidx.ui.geometry.RRect shift(androidx.ui.geometry.RRect, androidx.ui.geometry.Offset offset);
+ method public static androidx.ui.geometry.RRect shift-q6ZkaaM(androidx.ui.geometry.RRect, long offset);
method public static androidx.ui.geometry.RRect shrink(androidx.ui.geometry.RRect, float delta);
method public static androidx.ui.geometry.Rect tallMiddleRect(androidx.ui.geometry.RRect);
method public static androidx.ui.geometry.Radius topLeftRadius(androidx.ui.geometry.RRect);
@@ -156,27 +162,27 @@
method public float component2();
method public float component3();
method public float component4();
- method public boolean contains(androidx.ui.geometry.Offset offset);
+ method public boolean contains-RIqb49o(long offset);
method public androidx.ui.geometry.Rect copy(float left, float top, float right, float bottom);
method public androidx.ui.geometry.Rect deflate(float delta);
method public androidx.ui.geometry.Rect expandToInclude(androidx.ui.geometry.Rect other);
method public float getBottom();
- method public androidx.ui.geometry.Offset getBottomCenter();
- method public androidx.ui.geometry.Offset getBottomLeft();
- method public androidx.ui.geometry.Offset getBottomRight();
- method public androidx.ui.geometry.Offset getCenter();
- method public androidx.ui.geometry.Offset getCenterLeft();
- method public androidx.ui.geometry.Offset getCenterRight();
+ method public long getBottomCenter();
+ method public long getBottomLeft();
+ method public long getBottomRight();
+ method public long getCenter();
+ method public long getCenterLeft();
+ method public long getCenterRight();
method public float getHeight();
method public float getLeft();
- method public float getLongestSide();
+ method public float getMaxDimension();
+ method public float getMinDimension();
method public float getRight();
- method public float getShortestSide();
- method public androidx.ui.geometry.Size getSize();
+ method public long getSize();
method public float getTop();
- method public androidx.ui.geometry.Offset getTopCenter();
- method public androidx.ui.geometry.Offset getTopLeft();
- method public androidx.ui.geometry.Offset getTopRight();
+ method public long getTopCenter();
+ method public long getTopLeft();
+ method public long getTopRight();
method public float getWidth();
method public androidx.ui.geometry.Rect inflate(float delta);
method public androidx.ui.geometry.Rect intersect(androidx.ui.geometry.Rect other);
@@ -185,18 +191,20 @@
method public boolean isInfinite();
method public androidx.ui.geometry.Rect join(androidx.ui.geometry.Rect other);
method public boolean overlaps(androidx.ui.geometry.Rect other);
- method public androidx.ui.geometry.Rect shift(androidx.ui.geometry.Offset offset);
+ method public androidx.ui.geometry.Rect shift-RIqb49o(long offset);
method public androidx.ui.geometry.Rect translate(float translateX, float translateY);
property public final float height;
+ property public final float maxDimension;
+ property public final float minDimension;
property public final float width;
field public static final androidx.ui.geometry.Rect.Companion! Companion;
}
public static final class Rect.Companion {
- method public androidx.ui.geometry.Rect fromCircle(androidx.ui.geometry.Offset center, float radius);
+ method public androidx.ui.geometry.Rect fromCircle-hSKLB2U(long center, float radius);
method public androidx.ui.geometry.Rect fromLTRB(float left, float top, float right, float bottom);
method public androidx.ui.geometry.Rect fromLTWH(float left, float top, float width, float height);
- method public androidx.ui.geometry.Rect fromPoints(androidx.ui.geometry.Offset a, androidx.ui.geometry.Offset b);
+ method public androidx.ui.geometry.Rect fromPoints-cs1Rg_A(long a, long b);
method public androidx.ui.geometry.Rect getLargest();
method public androidx.ui.geometry.Rect getZero();
method public float get_giantScalar();
@@ -209,49 +217,54 @@
method public static androidx.ui.geometry.Rect lerp(androidx.ui.geometry.Rect start, androidx.ui.geometry.Rect stop, float fraction);
}
- public class Size implements androidx.ui.geometry.OffsetBase {
- ctor public Size(float width, float height);
- method public final androidx.ui.geometry.Offset bottomCenter(androidx.ui.geometry.Offset origin);
- method public final androidx.ui.geometry.Offset bottomLeft(androidx.ui.geometry.Offset origin);
- method public final androidx.ui.geometry.Offset bottomRight(androidx.ui.geometry.Offset origin);
- method public final androidx.ui.geometry.Offset center(androidx.ui.geometry.Offset origin);
- method public final androidx.ui.geometry.Offset centerLeft(androidx.ui.geometry.Offset origin);
- method public final androidx.ui.geometry.Offset centerRight(androidx.ui.geometry.Offset origin);
- method public final boolean contains(androidx.ui.geometry.Offset offset);
- method public final operator androidx.ui.geometry.Size div(float operand);
- method public float getDx();
- method public float getDy();
- method public final androidx.ui.geometry.Size getFlipped();
- method public final float getHeight();
- method public final float getLongestSide();
- method public final float getShortestSide();
- method public final float getWidth();
- method public final boolean isEmpty();
- method public final operator androidx.ui.geometry.Size minus(androidx.ui.geometry.Offset other);
- method public final operator androidx.ui.geometry.Offset minus(androidx.ui.geometry.Size other);
- method public final operator androidx.ui.geometry.Size plus(androidx.ui.geometry.Offset other);
- method public final operator androidx.ui.geometry.Size rem(float operand);
- method public final operator androidx.ui.geometry.Size times(float operand);
- method public final androidx.ui.geometry.Offset topCenter(androidx.ui.geometry.Offset origin);
- method public final androidx.ui.geometry.Offset topLeft(androidx.ui.geometry.Offset origin);
- method public final androidx.ui.geometry.Offset topRight(androidx.ui.geometry.Offset origin);
- method public final androidx.ui.geometry.Size truncDiv(float operand);
- property public float dx;
- property public float dy;
+ public final inline class Size {
+ ctor public Size();
+ method public static long bottomCenter-RIqb49o(long $this, long origin);
+ method public static long bottomLeft-RIqb49o(long $this, long origin);
+ method public static long bottomRight-RIqb49o(long $this, long origin);
+ method public static long center-RIqb49o(long $this, long origin);
+ method public static long centerLeft-RIqb49o(long $this, long origin);
+ method public static long centerRight-RIqb49o(long $this, long origin);
+ method public static long constructor-impl(internal long value);
+ method public static boolean contains-RIqb49o(long $this, long offset);
+ method public static operator long div-impl(long $this, float operand);
+ method public static inline boolean equals-impl(long p, Object? p1);
+ method public static boolean equals-impl0(long p1, long p2);
+ method public static long getFlipped-impl(long $this);
+ method public static float getHeight-impl(long $this);
+ method public static float getMaxDimension-impl(long $this);
+ method public static float getMinDimension-impl(long $this);
+ method public static float getWidth-impl(long $this);
+ method public static inline int hashCode-impl(long p);
+ method public static boolean isEmpty-impl(long $this);
+ method public static operator long minus-RIqb49o(long $this, long other);
+ method public static operator long minus-b2zCL34(long $this, long other);
+ method public static operator long plus-RIqb49o(long $this, long other);
+ method public static operator long rem-impl(long $this, float operand);
+ method public static operator long times-impl(long $this, float operand);
+ method public static String toString-impl(long $this);
+ method public static long topCenter-RIqb49o(long $this, long origin);
+ method public static long topLeft-RIqb49o(long $this, long origin);
+ method public static long topRight-RIqb49o(long $this, long origin);
+ method public static long truncDiv-impl(long $this, float operand);
field public static final androidx.ui.geometry.Size.Companion! Companion;
}
public static final class Size.Companion {
- method public androidx.ui.geometry.Size copy(androidx.ui.geometry.Size source);
- method public androidx.ui.geometry.Size fromHeight(float height);
- method public androidx.ui.geometry.Size fromRadius(float radius);
- method public androidx.ui.geometry.Size fromWidth(float width);
- method public androidx.ui.geometry.Size getInfinite();
- method public androidx.ui.geometry.Size getZero();
- method public androidx.ui.geometry.Size? lerp(androidx.ui.geometry.Size start, androidx.ui.geometry.Size stop, float fraction);
- method public androidx.ui.geometry.Size square(float dimension);
- property public final androidx.ui.geometry.Size infinite;
- property public final androidx.ui.geometry.Size zero;
+ method public long copy-b2zCL34(long source);
+ method public long fromHeight(float height);
+ method public long fromRadius(float radius);
+ method public long fromWidth(float width);
+ method public long getInfinite();
+ method public long getZero();
+ method public androidx.ui.geometry.Size? lerp-T-c3OIQ(long start, long stop, float fraction);
+ method public long square(float dimension);
+ property public final long infinite;
+ property public final long zero;
+ }
+
+ public final class SizeKt {
+ method public static long Size(float width, float height);
}
}
diff --git a/ui/ui-geometry/api/restricted_current.txt b/ui/ui-geometry/api/restricted_current.txt
index 4ad12c3..390ba95 100644
--- a/ui/ui-geometry/api/restricted_current.txt
+++ b/ui/ui-geometry/api/restricted_current.txt
@@ -1,36 +1,38 @@
// Signature format: 3.0
package androidx.ui.geometry {
- public final class Offset implements androidx.ui.geometry.OffsetBase {
- ctor public Offset(float dx, float dy);
- method public infix androidx.ui.geometry.Rect and(androidx.ui.geometry.Size other);
- method public float component1();
- method public float component2();
- method public androidx.ui.geometry.Offset copy(float dx, float dy);
- method public operator androidx.ui.geometry.Offset div(float operand);
- method public float getDirection();
- method public float getDistance();
- method public float getDistanceSquared();
- method public float getDx();
- method public float getDy();
- method public operator androidx.ui.geometry.Offset minus(androidx.ui.geometry.Offset other);
- method public operator androidx.ui.geometry.Offset plus(androidx.ui.geometry.Offset other);
- method public operator androidx.ui.geometry.Offset rem(float operand);
- method public androidx.ui.geometry.Offset scale(float scaleX, float scaleY);
- method public operator androidx.ui.geometry.Offset times(float operand);
- method public androidx.ui.geometry.Offset translate(float translateX, float translateY);
- method public androidx.ui.geometry.Offset truncDiv(float operand);
- method public operator androidx.ui.geometry.Offset unaryMinus();
+ public final inline class Offset {
+ ctor public Offset();
+ method public static infix androidx.ui.geometry.Rect and-b2zCL34(long $this, long other);
+ method public static long constructor-impl(internal long packedValue);
+ method public static operator long div-impl(long $this, float operand);
+ method public static inline boolean equals-impl(long p, Object? p1);
+ method public static boolean equals-impl0(long p1, long p2);
+ method public static float getDirection-impl(long $this);
+ method public static float getDistance-impl(long $this);
+ method public static float getDistanceSquared-impl(long $this);
+ method public static float getDx-impl(long $this);
+ method public static float getDy-impl(long $this);
+ method public static inline int hashCode-impl(long p);
+ method public static operator long minus-RIqb49o(long $this, long other);
+ method public static operator long plus-RIqb49o(long $this, long other);
+ method public static operator long rem-impl(long $this, float operand);
+ method public static long scale-impl(long $this, float scaleX, float scaleY);
+ method public static operator long times-impl(long $this, float operand);
+ method public static String toString-impl(long $this);
+ method public static long translate-impl(long $this, float translateX, float translateY);
+ method public static long truncDiv-impl(long $this, float operand);
+ method public static operator long unaryMinus-impl(long $this);
field public static final androidx.ui.geometry.Offset.Companion! Companion;
}
public static final class Offset.Companion {
- method public androidx.ui.geometry.Offset getInfinite();
- method public androidx.ui.geometry.Offset getZero();
- method public boolean isValid(androidx.ui.geometry.Offset offset);
- method public androidx.ui.geometry.Offset lerp(androidx.ui.geometry.Offset start, androidx.ui.geometry.Offset stop, float fraction);
- property public final androidx.ui.geometry.Offset infinite;
- property public final androidx.ui.geometry.Offset zero;
+ method public long getInfinite();
+ method public long getZero();
+ method public boolean isValid-RIqb49o(long offset);
+ method public long lerp-nqy8KaQ(long start, long stop, float fraction);
+ property public final long infinite;
+ property public final long zero;
}
public interface OffsetBase {
@@ -46,6 +48,10 @@
property public abstract float dy;
}
+ public final class OffsetKt {
+ method public static long Offset(float dx, float dy);
+ }
+
public final class RRect {
ctor public RRect(float left, float top, float right, float bottom, float topLeftRadiusX, float topLeftRadiusY, float topRightRadiusX, float topRightRadiusY, float bottomRightRadiusX, float bottomRightRadiusY, float bottomLeftRadiusX, float bottomLeftRadiusY);
method public float component1();
@@ -60,7 +66,7 @@
method public float component7();
method public float component8();
method public float component9();
- method public boolean contains(androidx.ui.geometry.Offset point);
+ method public boolean contains-RIqb49o(long point);
method public androidx.ui.geometry.RRect copy(float left, float top, float right, float bottom, float topLeftRadiusX, float topLeftRadiusY, float topRightRadiusX, float topRightRadiusY, float bottomRightRadiusX, float bottomRightRadiusY, float bottomLeftRadiusX, float bottomLeftRadiusY);
method @Deprecated public androidx.ui.geometry.RRect deflate(float delta);
method public float getBottom();
@@ -98,7 +104,7 @@
method public static androidx.ui.geometry.RRect RRect(androidx.ui.geometry.Rect rect, androidx.ui.geometry.Radius topLeft = Radius.zero, androidx.ui.geometry.Radius topRight = Radius.zero, androidx.ui.geometry.Radius bottomRight = Radius.zero, androidx.ui.geometry.Radius bottomLeft = Radius.zero);
method public static androidx.ui.geometry.Radius bottomLeftRadius(androidx.ui.geometry.RRect);
method public static androidx.ui.geometry.Radius bottomRightRadius(androidx.ui.geometry.RRect);
- method public static androidx.ui.geometry.Offset center(androidx.ui.geometry.RRect);
+ method public static long center(androidx.ui.geometry.RRect);
method public static float getLongestSide(androidx.ui.geometry.RRect);
method public static float getShortestSide(androidx.ui.geometry.RRect);
method public static androidx.ui.geometry.RRect grow(androidx.ui.geometry.RRect, float delta);
@@ -113,7 +119,7 @@
method public static androidx.ui.geometry.Rect middleRect(androidx.ui.geometry.RRect);
method public static androidx.ui.geometry.Rect outerRect(androidx.ui.geometry.RRect);
method public static androidx.ui.geometry.Rect safeInnerRect(androidx.ui.geometry.RRect);
- method public static androidx.ui.geometry.RRect shift(androidx.ui.geometry.RRect, androidx.ui.geometry.Offset offset);
+ method public static androidx.ui.geometry.RRect shift-q6ZkaaM(androidx.ui.geometry.RRect, long offset);
method public static androidx.ui.geometry.RRect shrink(androidx.ui.geometry.RRect, float delta);
method public static androidx.ui.geometry.Rect tallMiddleRect(androidx.ui.geometry.RRect);
method public static androidx.ui.geometry.Radius topLeftRadius(androidx.ui.geometry.RRect);
@@ -156,27 +162,27 @@
method public float component2();
method public float component3();
method public float component4();
- method public boolean contains(androidx.ui.geometry.Offset offset);
+ method public boolean contains-RIqb49o(long offset);
method public androidx.ui.geometry.Rect copy(float left, float top, float right, float bottom);
method public androidx.ui.geometry.Rect deflate(float delta);
method public androidx.ui.geometry.Rect expandToInclude(androidx.ui.geometry.Rect other);
method public float getBottom();
- method public androidx.ui.geometry.Offset getBottomCenter();
- method public androidx.ui.geometry.Offset getBottomLeft();
- method public androidx.ui.geometry.Offset getBottomRight();
- method public androidx.ui.geometry.Offset getCenter();
- method public androidx.ui.geometry.Offset getCenterLeft();
- method public androidx.ui.geometry.Offset getCenterRight();
+ method public long getBottomCenter();
+ method public long getBottomLeft();
+ method public long getBottomRight();
+ method public long getCenter();
+ method public long getCenterLeft();
+ method public long getCenterRight();
method public float getHeight();
method public float getLeft();
- method public float getLongestSide();
+ method public float getMaxDimension();
+ method public float getMinDimension();
method public float getRight();
- method public float getShortestSide();
- method public androidx.ui.geometry.Size getSize();
+ method public long getSize();
method public float getTop();
- method public androidx.ui.geometry.Offset getTopCenter();
- method public androidx.ui.geometry.Offset getTopLeft();
- method public androidx.ui.geometry.Offset getTopRight();
+ method public long getTopCenter();
+ method public long getTopLeft();
+ method public long getTopRight();
method public float getWidth();
method public androidx.ui.geometry.Rect inflate(float delta);
method public androidx.ui.geometry.Rect intersect(androidx.ui.geometry.Rect other);
@@ -185,18 +191,20 @@
method public boolean isInfinite();
method public androidx.ui.geometry.Rect join(androidx.ui.geometry.Rect other);
method public boolean overlaps(androidx.ui.geometry.Rect other);
- method public androidx.ui.geometry.Rect shift(androidx.ui.geometry.Offset offset);
+ method public androidx.ui.geometry.Rect shift-RIqb49o(long offset);
method public androidx.ui.geometry.Rect translate(float translateX, float translateY);
property public final float height;
+ property public final float maxDimension;
+ property public final float minDimension;
property public final float width;
field public static final androidx.ui.geometry.Rect.Companion! Companion;
}
public static final class Rect.Companion {
- method public androidx.ui.geometry.Rect fromCircle(androidx.ui.geometry.Offset center, float radius);
+ method public androidx.ui.geometry.Rect fromCircle-hSKLB2U(long center, float radius);
method public androidx.ui.geometry.Rect fromLTRB(float left, float top, float right, float bottom);
method public androidx.ui.geometry.Rect fromLTWH(float left, float top, float width, float height);
- method public androidx.ui.geometry.Rect fromPoints(androidx.ui.geometry.Offset a, androidx.ui.geometry.Offset b);
+ method public androidx.ui.geometry.Rect fromPoints-cs1Rg_A(long a, long b);
method public androidx.ui.geometry.Rect getLargest();
method public androidx.ui.geometry.Rect getZero();
method public float get_giantScalar();
@@ -209,49 +217,54 @@
method public static androidx.ui.geometry.Rect lerp(androidx.ui.geometry.Rect start, androidx.ui.geometry.Rect stop, float fraction);
}
- public class Size implements androidx.ui.geometry.OffsetBase {
- ctor public Size(float width, float height);
- method public final androidx.ui.geometry.Offset bottomCenter(androidx.ui.geometry.Offset origin);
- method public final androidx.ui.geometry.Offset bottomLeft(androidx.ui.geometry.Offset origin);
- method public final androidx.ui.geometry.Offset bottomRight(androidx.ui.geometry.Offset origin);
- method public final androidx.ui.geometry.Offset center(androidx.ui.geometry.Offset origin);
- method public final androidx.ui.geometry.Offset centerLeft(androidx.ui.geometry.Offset origin);
- method public final androidx.ui.geometry.Offset centerRight(androidx.ui.geometry.Offset origin);
- method public final boolean contains(androidx.ui.geometry.Offset offset);
- method public final operator androidx.ui.geometry.Size div(float operand);
- method public float getDx();
- method public float getDy();
- method public final androidx.ui.geometry.Size getFlipped();
- method public final float getHeight();
- method public final float getLongestSide();
- method public final float getShortestSide();
- method public final float getWidth();
- method public final boolean isEmpty();
- method public final operator androidx.ui.geometry.Size minus(androidx.ui.geometry.Offset other);
- method public final operator androidx.ui.geometry.Offset minus(androidx.ui.geometry.Size other);
- method public final operator androidx.ui.geometry.Size plus(androidx.ui.geometry.Offset other);
- method public final operator androidx.ui.geometry.Size rem(float operand);
- method public final operator androidx.ui.geometry.Size times(float operand);
- method public final androidx.ui.geometry.Offset topCenter(androidx.ui.geometry.Offset origin);
- method public final androidx.ui.geometry.Offset topLeft(androidx.ui.geometry.Offset origin);
- method public final androidx.ui.geometry.Offset topRight(androidx.ui.geometry.Offset origin);
- method public final androidx.ui.geometry.Size truncDiv(float operand);
- property public float dx;
- property public float dy;
+ public final inline class Size {
+ ctor public Size();
+ method public static long bottomCenter-RIqb49o(long $this, long origin);
+ method public static long bottomLeft-RIqb49o(long $this, long origin);
+ method public static long bottomRight-RIqb49o(long $this, long origin);
+ method public static long center-RIqb49o(long $this, long origin);
+ method public static long centerLeft-RIqb49o(long $this, long origin);
+ method public static long centerRight-RIqb49o(long $this, long origin);
+ method public static long constructor-impl(internal long value);
+ method public static boolean contains-RIqb49o(long $this, long offset);
+ method public static operator long div-impl(long $this, float operand);
+ method public static inline boolean equals-impl(long p, Object? p1);
+ method public static boolean equals-impl0(long p1, long p2);
+ method public static long getFlipped-impl(long $this);
+ method public static float getHeight-impl(long $this);
+ method public static float getMaxDimension-impl(long $this);
+ method public static float getMinDimension-impl(long $this);
+ method public static float getWidth-impl(long $this);
+ method public static inline int hashCode-impl(long p);
+ method public static boolean isEmpty-impl(long $this);
+ method public static operator long minus-RIqb49o(long $this, long other);
+ method public static operator long minus-b2zCL34(long $this, long other);
+ method public static operator long plus-RIqb49o(long $this, long other);
+ method public static operator long rem-impl(long $this, float operand);
+ method public static operator long times-impl(long $this, float operand);
+ method public static String toString-impl(long $this);
+ method public static long topCenter-RIqb49o(long $this, long origin);
+ method public static long topLeft-RIqb49o(long $this, long origin);
+ method public static long topRight-RIqb49o(long $this, long origin);
+ method public static long truncDiv-impl(long $this, float operand);
field public static final androidx.ui.geometry.Size.Companion! Companion;
}
public static final class Size.Companion {
- method public androidx.ui.geometry.Size copy(androidx.ui.geometry.Size source);
- method public androidx.ui.geometry.Size fromHeight(float height);
- method public androidx.ui.geometry.Size fromRadius(float radius);
- method public androidx.ui.geometry.Size fromWidth(float width);
- method public androidx.ui.geometry.Size getInfinite();
- method public androidx.ui.geometry.Size getZero();
- method public androidx.ui.geometry.Size? lerp(androidx.ui.geometry.Size start, androidx.ui.geometry.Size stop, float fraction);
- method public androidx.ui.geometry.Size square(float dimension);
- property public final androidx.ui.geometry.Size infinite;
- property public final androidx.ui.geometry.Size zero;
+ method public long copy-b2zCL34(long source);
+ method public long fromHeight(float height);
+ method public long fromRadius(float radius);
+ method public long fromWidth(float width);
+ method public long getInfinite();
+ method public long getZero();
+ method public androidx.ui.geometry.Size? lerp-T-c3OIQ(long start, long stop, float fraction);
+ method public long square(float dimension);
+ property public final long infinite;
+ property public final long zero;
+ }
+
+ public final class SizeKt {
+ method public static long Size(float width, float height);
}
}
diff --git a/ui/ui-geometry/src/main/java/androidx/ui/geometry/Offset.kt b/ui/ui-geometry/src/main/java/androidx/ui/geometry/Offset.kt
index 21eb9d6..2780b7e 100644
--- a/ui/ui-geometry/src/main/java/androidx/ui/geometry/Offset.kt
+++ b/ui/ui-geometry/src/main/java/androidx/ui/geometry/Offset.kt
@@ -16,13 +16,22 @@
package androidx.ui.geometry
+import androidx.compose.Immutable
import androidx.ui.util.lerp
+import androidx.ui.util.packFloats
import androidx.ui.util.toStringAsFixed
+import androidx.ui.util.unpackFloat1
+import androidx.ui.util.unpackFloat2
import kotlin.math.atan2
import kotlin.math.sqrt
import kotlin.math.truncate
/**
+ * Constructs an Offset from the given relative x and y offsets
+ */
+fun Offset(dx: Float, dy: Float) = Offset(packFloats(dx, dy))
+
+/**
* An immutable 2D floating-point offset.
*
* Generally speaking, Offsets can be interpreted in two ways:
@@ -48,7 +57,14 @@
* Creates an offset. The first argument sets [dx], the horizontal component,
* and the second sets [dy], the vertical component.
*/
-data class Offset(override val dx: Float, override val dy: Float) : OffsetBase {
+@Immutable
+inline class Offset(@PublishedApi internal val packedValue: Long) {
+
+ val dx: Float
+ get() = unpackFloat1(packedValue)
+
+ val dy: Float
+ get() = unpackFloat2(packedValue)
companion object {
/**
@@ -274,24 +290,4 @@
infix fun and(other: Size): Rect = Rect.fromLTWH(dx, dy, other.width, other.height)
override fun toString() = "Offset(${dx.toStringAsFixed(1)}, ${dy.toStringAsFixed(1)})"
-
- // We need to manually override equals (and thus also hashCode) because the auto generated
- // equals was treating Offset(0.0, 0.0) != Offset(0.0, -0.0).
- // Filed as https://youtrack.jetbrains.com/issue/KT-27343
-
- override fun equals(other: Any?): Boolean {
- if (this === other) return true
- if (other !is Offset) return false
-
- if (dx != other.dx) return false
- if (dy != other.dy) return false
-
- return true
- }
-
- override fun hashCode(): Int {
- var result = dx.hashCode()
- result = 31 * result + dy.hashCode()
- return result
- }
}
\ No newline at end of file
diff --git a/ui/ui-geometry/src/main/java/androidx/ui/geometry/Rect.kt b/ui/ui-geometry/src/main/java/androidx/ui/geometry/Rect.kt
index 71b77e2..d24d2e5 100644
--- a/ui/ui-geometry/src/main/java/androidx/ui/geometry/Rect.kt
+++ b/ui/ui-geometry/src/main/java/androidx/ui/geometry/Rect.kt
@@ -19,6 +19,8 @@
import androidx.ui.util.lerp
import androidx.ui.util.toStringAsFixed
import kotlin.math.absoluteValue
+import kotlin.math.max
+import kotlin.math.min
// TODO(mount): Normalize this class. There are many methods that can be extension functions.
/**
@@ -237,13 +239,15 @@
* The lesser of the magnitudes of the [width] and the [height] of this
* rectangle.
*/
- fun getShortestSide(): Float = Math.min(width.absoluteValue, height.absoluteValue)
+ val minDimension: Float
+ get() = min(width.absoluteValue, height.absoluteValue)
/**
* The greater of the magnitudes of the [width] and the [height] of this
* rectangle.
*/
- fun getLongestSide(): Float = Math.max(width.absoluteValue, height.absoluteValue)
+ val maxDimension: Float
+ get() = max(width.absoluteValue, height.absoluteValue)
/**
* The offset to the intersection of the top and left edges of this rectangle.
diff --git a/ui/ui-geometry/src/main/java/androidx/ui/geometry/Size.kt b/ui/ui-geometry/src/main/java/androidx/ui/geometry/Size.kt
index 65d5a13..2825aad 100644
--- a/ui/ui-geometry/src/main/java/androidx/ui/geometry/Size.kt
+++ b/ui/ui-geometry/src/main/java/androidx/ui/geometry/Size.kt
@@ -16,20 +16,35 @@
package androidx.ui.geometry
+import androidx.compose.Immutable
import androidx.ui.util.lerp
+import androidx.ui.util.packFloats
import androidx.ui.util.toStringAsFixed
+import androidx.ui.util.unpackFloat1
+import androidx.ui.util.unpackFloat2
import kotlin.math.absoluteValue
+import kotlin.math.max
+import kotlin.math.min
import kotlin.math.truncate
/**
+ * Constructs a [Size] from the given width and height
+ */
+fun Size(width: Float, height: Float) = Size(packFloats(width, height))
+
+/**
* Holds a 2D floating-point size.
*
* You can think of this as an [Offset] from the origin.
*/
-open class Size(val width: Float, val height: Float) : OffsetBase {
+@Immutable
+inline class Size(@PublishedApi internal val value: Long) {
- override val dx: Float = width
- override val dy: Float = height
+ val width: Float
+ get() = unpackFloat1(value)
+
+ val height: Float
+ get() = unpackFloat2(value)
companion object {
/**
@@ -202,12 +217,14 @@
/**
* The lesser of the magnitudes of the [width] and the [height].
*/
- fun getShortestSide(): Float = Math.min(width.absoluteValue, height.absoluteValue)
+ val minDimension: Float
+ get() = min(width.absoluteValue, height.absoluteValue)
/**
* The greater of the magnitudes of the [width] and the [height].
*/
- fun getLongestSide(): Float = Math.max(width.absoluteValue, height.absoluteValue)
+ val maxDimension: Float
+ get() = max(width.absoluteValue, height.absoluteValue)
// Convenience methods that do the equivalent of calling the similarly named
// methods on a Rect constructed from the given origin and this size.
@@ -308,18 +325,4 @@
fun getFlipped() = Size(height, width)
override fun toString() = "Size(${width.toStringAsFixed(1)}, ${height.toStringAsFixed(1)})"
-
- // TODO(Andrey): Can't use data class because of _DebugSize class extending this one.
- override fun equals(other: Any?): Boolean {
- if (this === other) return true
- if (other !is Size) return false
-
- return dx == other.dx && dy == other.dy
- }
-
- override fun hashCode(): Int {
- var result = dx.hashCode()
- result = 31 * result + dy.hashCode()
- return result
- }
-}
+}
\ No newline at end of file
diff --git a/ui/ui-graphics/api/0.1.0-dev11.txt b/ui/ui-graphics/api/0.1.0-dev11.txt
index a4896944..8b672ec 100644
--- a/ui/ui-graphics/api/0.1.0-dev11.txt
+++ b/ui/ui-graphics/api/0.1.0-dev11.txt
@@ -29,7 +29,7 @@
method public void addArc(androidx.ui.geometry.Rect oval, float startAngleDegrees, float sweepAngleDegrees);
method public void addArcRad(androidx.ui.geometry.Rect oval, float startAngleRadians, float sweepAngleRadians);
method public void addOval(androidx.ui.geometry.Rect oval);
- method public void addPath(androidx.ui.graphics.Path path, androidx.ui.geometry.Offset offset);
+ method public void addPath-m3TnucA(androidx.ui.graphics.Path path, long offset);
method public void addRRect(androidx.ui.geometry.RRect rrect);
method public void addRect(androidx.ui.geometry.Rect rect);
method public void arcTo(androidx.ui.geometry.Rect rect, float startAngleDegrees, float sweepAngleDegrees, boolean forceMoveTo);
@@ -50,7 +50,7 @@
method public void relativeQuadraticBezierTo(float x1, float y1, float x2, float y2);
method public void reset();
method public void setFillType(androidx.ui.graphics.PathFillType value);
- method public void shift(androidx.ui.geometry.Offset offset);
+ method public void shift-RIqb49o(long offset);
property public androidx.ui.graphics.PathFillType fillType;
property public boolean isConvex;
property public boolean isEmpty;
@@ -95,8 +95,8 @@
enum_constant public static final androidx.ui.graphics.BlendMode xor;
}
- public interface Brush {
- method public void applyTo(androidx.ui.graphics.Paint p);
+ public abstract sealed class Brush {
+ method public abstract void applyTo(androidx.ui.graphics.Paint p);
}
public final class BrushKt {
@@ -112,22 +112,25 @@
public interface Canvas {
method public void clipPath(androidx.ui.graphics.Path path);
- method public void clipRRect(androidx.ui.geometry.RRect rrect);
- method public void clipRect(androidx.ui.geometry.Rect rect, androidx.ui.graphics.ClipOp clipOp = androidx.ui.graphics.ClipOp.intersect);
+ method public default void clipRect(androidx.ui.geometry.Rect rect, androidx.ui.graphics.ClipOp clipOp = androidx.ui.graphics.ClipOp.intersect);
+ method public void clipRect(float left, float top, float right, float bottom, androidx.ui.graphics.ClipOp clipOp = androidx.ui.graphics.ClipOp.intersect);
method public void concat(androidx.ui.graphics.vectormath.Matrix4 matrix4);
method public void disableZ();
- method public void drawArc(androidx.ui.geometry.Rect rect, float startAngle, float sweepAngle, boolean useCenter, androidx.ui.graphics.Paint paint);
+ method public default void drawArc(androidx.ui.geometry.Rect rect, float startAngle, float sweepAngle, boolean useCenter, androidx.ui.graphics.Paint paint);
+ method public void drawArc(float left, float top, float right, float bottom, float startAngle, float sweepAngle, boolean useCenter, androidx.ui.graphics.Paint paint);
method public default void drawArcRad(androidx.ui.geometry.Rect rect, float startAngleRad, float sweepAngleRad, boolean useCenter, androidx.ui.graphics.Paint paint);
- method public void drawCircle(androidx.ui.geometry.Offset center, float radius, androidx.ui.graphics.Paint paint);
- method public void drawImage(androidx.ui.graphics.ImageAsset image, androidx.ui.geometry.Offset topLeftOffset, androidx.ui.graphics.Paint paint);
- method public void drawImageRect(androidx.ui.graphics.ImageAsset image, androidx.ui.geometry.Rect? src, androidx.ui.geometry.Rect dst, androidx.ui.graphics.Paint paint);
- method public void drawLine(androidx.ui.geometry.Offset p1, androidx.ui.geometry.Offset p2, androidx.ui.graphics.Paint paint);
- method public void drawOval(androidx.ui.geometry.Rect rect, androidx.ui.graphics.Paint paint);
+ method public void drawCircle-NfwrgZA(long center, float radius, androidx.ui.graphics.Paint paint);
+ method public void drawImage--AHD2Ng(androidx.ui.graphics.ImageAsset image, long topLeftOffset, androidx.ui.graphics.Paint paint);
+ method public void drawImageRect-btuv3no(androidx.ui.graphics.ImageAsset image, long srcOffset = Offset.zero, long srcSize = Size(image.width.toFloat(), image.height.toFloat()), long dstOffset, long dstSize, androidx.ui.graphics.Paint paint);
+ method public void drawLine-d9kBv1M(long p1, long p2, androidx.ui.graphics.Paint paint);
+ method public default void drawOval(androidx.ui.geometry.Rect rect, androidx.ui.graphics.Paint paint);
+ method public void drawOval(float left, float top, float right, float bottom, androidx.ui.graphics.Paint paint);
method public void drawPath(androidx.ui.graphics.Path path, androidx.ui.graphics.Paint paint);
method public void drawPicture(androidx.ui.graphics.Picture picture);
method public void drawPoints(androidx.ui.graphics.PointMode pointMode, java.util.List<androidx.ui.geometry.Offset> points, androidx.ui.graphics.Paint paint);
method public void drawRawPoints(androidx.ui.graphics.PointMode pointMode, float[] points, androidx.ui.graphics.Paint paint);
- method public void drawRect(androidx.ui.geometry.Rect rect, androidx.ui.graphics.Paint paint);
+ method public default void drawRect(androidx.ui.geometry.Rect rect, androidx.ui.graphics.Paint paint);
+ method public void drawRect(float left, float top, float right, float bottom, androidx.ui.graphics.Paint paint);
method public void drawRoundRect(float left, float top, float right, float bottom, float radiusX, float radiusY, androidx.ui.graphics.Paint paint);
method public void drawVertices(androidx.ui.graphics.Vertices vertices, androidx.ui.graphics.BlendMode blendMode, androidx.ui.graphics.Paint paint);
method public void enableZ();
@@ -161,7 +164,7 @@
method public static long constructor-impl(long value);
method public static long convert-impl(long $this, androidx.ui.graphics.colorspace.ColorSpace colorSpace);
method public static long copy-impl(long $this, float alpha = this.alpha, float red = this.red, float green = this.green, float blue = this.blue);
- method public static boolean equals-impl(long p, Object? p1);
+ method public static inline boolean equals-impl(long p, Object? p1);
method public static boolean equals-impl0(long p1, long p2);
method public static float getAlpha-impl(long $this);
method public static float getBlue-impl(long $this);
@@ -169,7 +172,7 @@
method public static float getGreen-impl(long $this);
method public static float getRed-impl(long $this);
method public long getValue();
- method public static int hashCode-impl(long p);
+ method public static inline int hashCode-impl(long p);
method public static String toString-impl(long $this);
field public static final androidx.ui.graphics.Color.Companion! Companion;
}
@@ -297,7 +300,9 @@
public final class OutlineKt {
method public static void addOutline(androidx.ui.graphics.Path, androidx.ui.graphics.Outline outline);
+ method public static void drawOutline(androidx.ui.graphics.painter.CanvasScope, androidx.ui.graphics.Outline outline, androidx.ui.graphics.Brush brush, @FloatRange(from=0.0, to=1.0) float alpha = 1.0f, androidx.ui.graphics.painter.DrawStyle style = Fill, androidx.ui.graphics.ColorFilter? colorFilter = null, androidx.ui.graphics.BlendMode blendMode = CanvasScope.DefaultBlendMode);
method public static void drawOutline(androidx.ui.graphics.Canvas, androidx.ui.graphics.Outline outline, androidx.ui.graphics.Paint paint);
+ method public static void drawOutline-GAv4Q-k(androidx.ui.graphics.painter.CanvasScope, androidx.ui.graphics.Outline outline, long color, @FloatRange(from=0.0, to=1.0) float alpha = 1.0f, androidx.ui.graphics.painter.DrawStyle style = Fill, androidx.ui.graphics.ColorFilter? colorFilter = null, androidx.ui.graphics.BlendMode blendMode = CanvasScope.DefaultBlendMode);
}
public final class Paint {
@@ -354,7 +359,7 @@
method public void addArc(androidx.ui.geometry.Rect oval, float startAngleDegrees, float sweepAngleDegrees);
method public void addArcRad(androidx.ui.geometry.Rect oval, float startAngleRadians, float sweepAngleRadians);
method public void addOval(androidx.ui.geometry.Rect oval);
- method public void addPath(androidx.ui.graphics.Path path, androidx.ui.geometry.Offset offset = Offset.zero);
+ method public void addPath-m3TnucA(androidx.ui.graphics.Path path, long offset = Offset.zero);
method public void addRRect(androidx.ui.geometry.RRect rrect);
method public void addRect(androidx.ui.geometry.Rect rect);
method public void arcTo(androidx.ui.geometry.Rect rect, float startAngleDegrees, float sweepAngleDegrees, boolean forceMoveTo);
@@ -375,7 +380,7 @@
method public void relativeQuadraticBezierTo(float x1, float y1, float x2, float y2);
method public void reset();
method public void setFillType(androidx.ui.graphics.PathFillType p);
- method public void shift(androidx.ui.geometry.Offset offset);
+ method public void shift-RIqb49o(long offset);
property public abstract androidx.ui.graphics.PathFillType fillType;
property public abstract boolean isConvex;
property public abstract boolean isEmpty;
@@ -440,32 +445,32 @@
public final inline class Shader {
ctor public Shader();
method public static android.graphics.Shader! constructor-impl(android.graphics.Shader nativeShader);
- method public static boolean equals-impl(android.graphics.Shader! p, Object? p1);
+ method public static inline boolean equals-impl(android.graphics.Shader! p, Object? p1);
method public static boolean equals-impl0(android.graphics.Shader p1, android.graphics.Shader p2);
method public android.graphics.Shader getNativeShader();
- method public static int hashCode-impl(android.graphics.Shader! p);
- method public static String toString-impl(android.graphics.Shader! p);
+ method public static inline int hashCode-impl(android.graphics.Shader! p);
+ method public static inline String! toString-impl(android.graphics.Shader! p);
}
- public class ShaderBrush implements androidx.ui.graphics.Brush {
- method public void applyTo(androidx.ui.graphics.Paint p);
+ public class ShaderBrush extends androidx.ui.graphics.Brush {
+ method public final void applyTo(androidx.ui.graphics.Paint p);
method public final android.graphics.Shader getShader();
}
public final class ShaderKt {
method public static android.graphics.Shader ImageShader(androidx.ui.graphics.ImageAsset image, androidx.ui.graphics.TileMode tileModeX = androidx.ui.graphics.TileMode.Clamp, androidx.ui.graphics.TileMode tileModeY = androidx.ui.graphics.TileMode.Clamp);
- method public static android.graphics.Shader LinearGradientShader(androidx.ui.geometry.Offset from, androidx.ui.geometry.Offset to, java.util.List<androidx.ui.graphics.Color> colors, java.util.List<java.lang.Float>? colorStops = null, androidx.ui.graphics.TileMode tileMode = androidx.ui.graphics.TileMode.Clamp);
- method public static android.graphics.Shader RadialGradientShader(androidx.ui.geometry.Offset center, float radius, java.util.List<androidx.ui.graphics.Color> colors, java.util.List<java.lang.Float>? colorStops = null, androidx.ui.graphics.TileMode tileMode = androidx.ui.graphics.TileMode.Clamp);
+ method public static android.graphics.Shader LinearGradientShader-BG1VTC8(long from, long to, java.util.List<androidx.ui.graphics.Color> colors, java.util.List<java.lang.Float>? colorStops = null, androidx.ui.graphics.TileMode tileMode = androidx.ui.graphics.TileMode.Clamp);
+ method public static android.graphics.Shader RadialGradientShader-nSjqbmE(long center, float radius, java.util.List<androidx.ui.graphics.Color> colors, java.util.List<java.lang.Float>? colorStops = null, androidx.ui.graphics.TileMode tileMode = androidx.ui.graphics.TileMode.Clamp);
}
public final class Shadow {
method public long component1();
- method public androidx.ui.geometry.Offset component2();
+ method public long component2();
method public float component3();
- method public androidx.ui.graphics.Shadow copy-1LPazZ4(long color, androidx.ui.geometry.Offset offset, float blurRadius);
+ method public androidx.ui.graphics.Shadow copy-1LPazZ4(long color, long offset, float blurRadius);
method public float getBlurRadius();
method public long getColor();
- method public androidx.ui.geometry.Offset getOffset();
+ method public long getOffset();
field public static final androidx.ui.graphics.Shadow.Companion! Companion;
}
@@ -482,10 +487,8 @@
method public androidx.ui.graphics.Outline createOutline(androidx.ui.unit.PxSize size, androidx.ui.unit.Density density);
}
- public final class SolidColor implements androidx.ui.graphics.Brush {
+ public final class SolidColor extends androidx.ui.graphics.Brush {
method public void applyTo(androidx.ui.graphics.Paint p);
- method public long component1();
- method public androidx.ui.graphics.SolidColor copy-QEYXlZo(long value);
method public long getValue();
}
@@ -715,39 +718,102 @@
package androidx.ui.graphics.painter {
+ public final class CanvasScope {
+ ctor public CanvasScope();
+ method public void draw(androidx.ui.graphics.Canvas canvas, androidx.ui.unit.PxSize size, kotlin.jvm.functions.Function1<? super androidx.ui.graphics.painter.CanvasScope,kotlin.Unit> block);
+ method public kotlin.Unit? drawArc-_aGsT6c(androidx.ui.graphics.Brush brush, float startAngle, float sweepAngle, boolean useCenter, long topLeft = Offset.zero, long size = this.size, @FloatRange(from=0.0, to=1.0) float alpha = 1.0f, androidx.ui.graphics.painter.DrawStyle style = Fill, androidx.ui.graphics.ColorFilter? colorFilter = null, androidx.ui.graphics.BlendMode blendMode = DefaultBlendMode);
+ method public kotlin.Unit? drawArc-eUb3Eo4(long color, float startAngle, float sweepAngle, boolean useCenter, long topLeft = Offset.zero, long size = this.size, @FloatRange(from=0.0, to=1.0) float alpha = 1.0f, androidx.ui.graphics.painter.DrawStyle style = Fill, androidx.ui.graphics.ColorFilter? colorFilter = null, androidx.ui.graphics.BlendMode blendMode = DefaultBlendMode);
+ method public kotlin.Unit? drawCircle-0EImeI8(long color, float radius = size.minDimension / 2.0, long center = this.center, @FloatRange(from=0.0, to=1.0) float alpha = 1.0f, androidx.ui.graphics.painter.DrawStyle style = Fill, androidx.ui.graphics.ColorFilter? colorFilter = null, androidx.ui.graphics.BlendMode blendMode = DefaultBlendMode);
+ method public kotlin.Unit? drawCircle-uHGJFV8(androidx.ui.graphics.Brush brush, float radius = size.minDimension / 2.0, long center = this.center, @FloatRange(from=0.0, to=1.0) float alpha = 1.0f, androidx.ui.graphics.painter.DrawStyle style = Fill, androidx.ui.graphics.ColorFilter? colorFilter = null, androidx.ui.graphics.BlendMode blendMode = DefaultBlendMode);
+ method public kotlin.Unit? drawImage-IF_VeeU(androidx.ui.graphics.ImageAsset image, long srcOffset = Offset.zero, long srcSize = Size(image.width.toFloat(), image.height.toFloat()), long dstOffset = Offset.zero, long dstSize = this.size, @FloatRange(from=0.0, to=1.0) float alpha = 1.0f, androidx.ui.graphics.painter.DrawStyle style = Fill, androidx.ui.graphics.ColorFilter? colorFilter = null, androidx.ui.graphics.BlendMode blendMode = DefaultBlendMode);
+ method public kotlin.Unit? drawImage-zcoU2q0(androidx.ui.graphics.ImageAsset image, long topLeft = Offset.zero, @FloatRange(from=0.0, to=1.0) float alpha = 1.0f, androidx.ui.graphics.painter.DrawStyle style = Fill, androidx.ui.graphics.ColorFilter? colorFilter = null, androidx.ui.graphics.BlendMode blendMode = DefaultBlendMode);
+ method public kotlin.Unit? drawLine-MfDnFlo(long color, long p1, long p2, androidx.ui.graphics.painter.Stroke stroke, @FloatRange(from=0.0, to=1.0) float alpha = 1.0f, androidx.ui.graphics.ColorFilter? colorFilter = null, androidx.ui.graphics.BlendMode blendMode = DefaultBlendMode);
+ method public kotlin.Unit? drawLine-PWBr8KI(androidx.ui.graphics.Brush brush, long p1, long p2, androidx.ui.graphics.painter.Stroke stroke, @FloatRange(from=0.0, to=1.0) float alpha = 1.0f, androidx.ui.graphics.ColorFilter? colorFilter = null, androidx.ui.graphics.BlendMode blendMode = DefaultBlendMode);
+ method public kotlin.Unit? drawOval-EPCrxCw(long color, long topLeft = Offset.zero, long size = this.size, @FloatRange(from=0.0, to=1.0) float alpha = 1.0f, androidx.ui.graphics.painter.DrawStyle style = Fill, androidx.ui.graphics.ColorFilter? colorFilter = null, androidx.ui.graphics.BlendMode blendMode = DefaultBlendMode);
+ method public kotlin.Unit? drawOval-cuGMcK0(androidx.ui.graphics.Brush brush, long topLeft = Offset.zero, long size = this.size, @FloatRange(from=0.0, to=1.0) float alpha = 1.0f, androidx.ui.graphics.painter.DrawStyle style = Fill, androidx.ui.graphics.ColorFilter? colorFilter = null, androidx.ui.graphics.BlendMode blendMode = DefaultBlendMode);
+ method public kotlin.Unit? drawPath(androidx.ui.graphics.Path path, androidx.ui.graphics.Brush brush, @FloatRange(from=0.0, to=1.0) float alpha = 1.0f, androidx.ui.graphics.painter.DrawStyle style = Fill, androidx.ui.graphics.ColorFilter? colorFilter = null, androidx.ui.graphics.BlendMode blendMode = DefaultBlendMode);
+ method public kotlin.Unit? drawPath-ZizoN6c(androidx.ui.graphics.Path path, long color, @FloatRange(from=0.0, to=1.0) float alpha = 1.0f, androidx.ui.graphics.painter.DrawStyle style = Fill, androidx.ui.graphics.ColorFilter? colorFilter = null, androidx.ui.graphics.BlendMode blendMode = DefaultBlendMode);
+ method public kotlin.Unit? drawPoints(java.util.List<androidx.ui.geometry.Offset> points, androidx.ui.graphics.PointMode pointMode, androidx.ui.graphics.Brush brush, @FloatRange(from=0.0, to=1.0) float alpha = 1.0f, androidx.ui.graphics.painter.DrawStyle style = Fill, androidx.ui.graphics.ColorFilter? colorFilter = null, androidx.ui.graphics.BlendMode blendMode = DefaultBlendMode);
+ method public kotlin.Unit? drawPoints-yiE_nf0(java.util.List<androidx.ui.geometry.Offset> points, androidx.ui.graphics.PointMode pointMode, long color, androidx.ui.graphics.painter.Stroke stroke, @FloatRange(from=0.0, to=1.0) float alpha = 1.0f, androidx.ui.graphics.ColorFilter? colorFilter = null, androidx.ui.graphics.BlendMode blendMode = DefaultBlendMode);
+ method public kotlin.Unit? drawRect-EPCrxCw(long color, long topLeft = Offset.zero, long size = this.size, @FloatRange(from=0.0, to=1.0) float alpha = 1.0f, androidx.ui.graphics.painter.DrawStyle style = Fill, androidx.ui.graphics.ColorFilter? colorFilter = null, androidx.ui.graphics.BlendMode blendMode = DefaultBlendMode);
+ method public kotlin.Unit? drawRect-cuGMcK0(androidx.ui.graphics.Brush brush, long topLeft = Offset.zero, long size = this.size, @FloatRange(from=0.0, to=1.0) float alpha = 1.0f, androidx.ui.graphics.painter.DrawStyle style = Fill, androidx.ui.graphics.ColorFilter? colorFilter = null, androidx.ui.graphics.BlendMode blendMode = DefaultBlendMode);
+ method public kotlin.Unit? drawRoundRect-5PTu5W0(androidx.ui.graphics.Brush brush, long topLeft = Offset.zero, long size = this.size, float radiusX = 0.0f, float radiusY = radiusX, @FloatRange(from=0.0, to=1.0) float alpha = 1.0f, androidx.ui.graphics.painter.DrawStyle style = Fill, androidx.ui.graphics.ColorFilter? colorFilter = null, androidx.ui.graphics.BlendMode blendMode = DefaultBlendMode);
+ method public kotlin.Unit? drawRoundRect-A8SqK14(long color, long topLeft = Offset.zero, long size = this.size, float radiusX = 0.0f, float radiusY = 0.0f, androidx.ui.graphics.painter.DrawStyle style = Fill, @FloatRange(from=0.0, to=1.0) float alpha = 1.0f, androidx.ui.graphics.ColorFilter? colorFilter = null, androidx.ui.graphics.BlendMode blendMode = DefaultBlendMode);
+ method public long getCenter();
+ method public long getSize();
+ property public final long center;
+ property public final long size;
+ field public static final androidx.ui.graphics.painter.CanvasScope.Companion! Companion;
+ field public static final float DefaultAlpha = 1.0f;
+ }
+
+ public static final class CanvasScope.Companion {
+ method public androidx.ui.graphics.BlendMode getDefaultBlendMode();
+ property public final androidx.ui.graphics.BlendMode DefaultBlendMode;
+ }
+
+ public final class CanvasScopeKt {
+ method public static inline androidx.ui.graphics.Canvas? clipPath(androidx.ui.graphics.painter.CanvasScope, androidx.ui.graphics.Path path, kotlin.jvm.functions.Function1<? super androidx.ui.graphics.painter.CanvasScope,kotlin.Unit> block);
+ method public static inline androidx.ui.graphics.Canvas? clipRect-2CUYwUY(androidx.ui.graphics.painter.CanvasScope, long topLeft = Offset.zero, long size = this.size, androidx.ui.graphics.ClipOp clipOp = androidx.ui.graphics.ClipOp.intersect, kotlin.jvm.functions.Function1<? super androidx.ui.graphics.painter.CanvasScope,kotlin.Unit> block);
+ method public static inline kotlin.Unit? drawCanvas(androidx.ui.graphics.painter.CanvasScope, kotlin.jvm.functions.Function2<? super androidx.ui.graphics.Canvas,? super androidx.ui.unit.PxSize,kotlin.Unit> block);
+ method public static inline void inset(androidx.ui.graphics.painter.CanvasScope, float left, float top, float right, float bottom, kotlin.jvm.functions.Function1<? super androidx.ui.graphics.painter.CanvasScope,kotlin.Unit> block);
+ method public static inline void inset(androidx.ui.graphics.painter.CanvasScope, float dx, float dy = dx, kotlin.jvm.functions.Function1<? super androidx.ui.graphics.painter.CanvasScope,kotlin.Unit> block);
+ method public static inline androidx.ui.graphics.Canvas? rotate(androidx.ui.graphics.painter.CanvasScope, float degrees, float pivotX = center.dx, float pivotY = center.dy, kotlin.jvm.functions.Function1<? super androidx.ui.graphics.painter.CanvasScope,kotlin.Unit> block);
+ method public static inline androidx.ui.graphics.Canvas? rotateRad(androidx.ui.graphics.painter.CanvasScope, float radians, float pivotX = center.dx, float pivotY = center.dy, kotlin.jvm.functions.Function1<? super androidx.ui.graphics.painter.CanvasScope,kotlin.Unit> block);
+ method public static inline androidx.ui.graphics.Canvas? scale(androidx.ui.graphics.painter.CanvasScope, float scaleX, float scaleY, float pivotX = center.dx, float pivotY = center.dy, kotlin.jvm.functions.Function1<? super androidx.ui.graphics.painter.CanvasScope,kotlin.Unit> block);
+ method public static inline androidx.ui.graphics.Canvas? translate(androidx.ui.graphics.painter.CanvasScope, float dx, float dy, kotlin.jvm.functions.Function1<? super androidx.ui.graphics.painter.CanvasScope,kotlin.Unit> block);
+ }
+
public final class ColorPainter extends androidx.ui.graphics.painter.Painter {
method public long component1();
method public androidx.ui.graphics.painter.ColorPainter copy-QEYXlZo(long color);
method public long getColor();
method public androidx.ui.unit.PxSize getIntrinsicSize();
- method protected void onDraw(androidx.ui.graphics.Canvas canvas, androidx.ui.unit.PxSize bounds);
+ method protected void onDraw(androidx.ui.graphics.painter.CanvasScope);
property public androidx.ui.unit.PxSize intrinsicSize;
}
+ public abstract sealed class DrawStyle {
+ }
+
+ public final class Fill extends androidx.ui.graphics.painter.DrawStyle {
+ field public static final androidx.ui.graphics.painter.Fill! INSTANCE;
+ }
+
public final class ImagePainter extends androidx.ui.graphics.painter.Painter {
- ctor public ImagePainter(androidx.ui.graphics.ImageAsset image, androidx.ui.geometry.Rect? srcBounds);
- method public androidx.ui.geometry.Rect? component2();
- method public androidx.ui.graphics.painter.ImagePainter copy(androidx.ui.graphics.ImageAsset image, androidx.ui.geometry.Rect? srcBounds);
+ method public androidx.ui.graphics.painter.ImagePainter copy-gqgapXI(androidx.ui.graphics.ImageAsset image, long srcOffset, long srcSize);
method public androidx.ui.unit.PxSize getIntrinsicSize();
- method public androidx.ui.geometry.Rect? getSrcBounds();
- method protected void onDraw(androidx.ui.graphics.Canvas canvas, androidx.ui.unit.PxSize bounds);
+ method protected void onDraw(androidx.ui.graphics.painter.CanvasScope);
property public androidx.ui.unit.PxSize intrinsicSize;
}
- public final class ImagePainterKt {
- }
-
public abstract class Painter {
ctor public Painter();
method protected boolean applyAlpha(float alpha);
method protected boolean applyColorFilter(androidx.ui.graphics.ColorFilter? colorFilter);
method protected boolean applyRtl(boolean rtl);
- method public final void draw(androidx.ui.graphics.Canvas canvas, androidx.ui.unit.PxSize bounds, float alpha = 1.0f, androidx.ui.graphics.ColorFilter? colorFilter = null, boolean rtl = false);
+ method public final void draw(androidx.ui.graphics.Canvas canvas, androidx.ui.unit.PxSize size, float alpha = 1.0f, androidx.ui.graphics.ColorFilter? colorFilter = null, boolean rtl = false);
method public abstract androidx.ui.unit.PxSize getIntrinsicSize();
- method protected abstract void onDraw(androidx.ui.graphics.Canvas canvas, androidx.ui.unit.PxSize bounds);
+ method protected abstract void onDraw(androidx.ui.graphics.painter.CanvasScope);
property public abstract androidx.ui.unit.PxSize intrinsicSize;
}
+ public final class Stroke extends androidx.ui.graphics.painter.DrawStyle {
+ ctor public Stroke(float width, float miter, androidx.ui.graphics.StrokeCap cap, androidx.ui.graphics.StrokeJoin join, android.graphics.PathEffect? pathEffect);
+ ctor public Stroke();
+ method public float component1();
+ method public float component2();
+ method public androidx.ui.graphics.StrokeCap component3();
+ method public androidx.ui.graphics.StrokeJoin component4();
+ method public android.graphics.PathEffect? component5();
+ method public androidx.ui.graphics.painter.Stroke copy(float width, float miter, androidx.ui.graphics.StrokeCap cap, androidx.ui.graphics.StrokeJoin join, android.graphics.PathEffect? pathEffect);
+ method public androidx.ui.graphics.StrokeCap getCap();
+ method public androidx.ui.graphics.StrokeJoin getJoin();
+ method public float getMiter();
+ method public android.graphics.PathEffect? getPathEffect();
+ method public float getWidth();
+ }
+
}
package androidx.ui.graphics.vector {
@@ -1144,7 +1210,7 @@
method public static androidx.ui.geometry.Rect inverseTransformRect(androidx.ui.graphics.vectormath.Matrix4 transform, androidx.ui.geometry.Rect rect);
method public static boolean isIdentity(androidx.ui.graphics.vectormath.Matrix4);
method public static boolean matrixEquals(androidx.ui.graphics.vectormath.Matrix4? a, androidx.ui.graphics.vectormath.Matrix4? b);
- method public static androidx.ui.geometry.Offset transformPoint(androidx.ui.graphics.vectormath.Matrix4, androidx.ui.geometry.Offset point);
+ method public static long transformPoint-k2M_ft0(androidx.ui.graphics.vectormath.Matrix4, long point);
method public static androidx.ui.geometry.Rect transformRect(androidx.ui.graphics.vectormath.Matrix4, androidx.ui.geometry.Rect rect);
}
diff --git a/ui/ui-graphics/api/api_lint.ignore b/ui/ui-graphics/api/api_lint.ignore
index b2fd023..6bbb26a 100644
--- a/ui/ui-graphics/api/api_lint.ignore
+++ b/ui/ui-graphics/api/api_lint.ignore
@@ -75,6 +75,8 @@
Missing nullability on parameter `p` in method `equals-impl`
MissingNullability: androidx.ui.graphics.Shader#hashCode-impl(android.graphics.Shader) parameter #0:
Missing nullability on parameter `p` in method `hashCode-impl`
+MissingNullability: androidx.ui.graphics.Shader#toString-impl(android.graphics.Shader):
+ Missing nullability on method `toString-impl` return
MissingNullability: androidx.ui.graphics.Shader#toString-impl(android.graphics.Shader) parameter #0:
Missing nullability on parameter `p` in method `toString-impl`
diff --git a/ui/ui-graphics/api/current.txt b/ui/ui-graphics/api/current.txt
index a4896944..8b672ec 100644
--- a/ui/ui-graphics/api/current.txt
+++ b/ui/ui-graphics/api/current.txt
@@ -29,7 +29,7 @@
method public void addArc(androidx.ui.geometry.Rect oval, float startAngleDegrees, float sweepAngleDegrees);
method public void addArcRad(androidx.ui.geometry.Rect oval, float startAngleRadians, float sweepAngleRadians);
method public void addOval(androidx.ui.geometry.Rect oval);
- method public void addPath(androidx.ui.graphics.Path path, androidx.ui.geometry.Offset offset);
+ method public void addPath-m3TnucA(androidx.ui.graphics.Path path, long offset);
method public void addRRect(androidx.ui.geometry.RRect rrect);
method public void addRect(androidx.ui.geometry.Rect rect);
method public void arcTo(androidx.ui.geometry.Rect rect, float startAngleDegrees, float sweepAngleDegrees, boolean forceMoveTo);
@@ -50,7 +50,7 @@
method public void relativeQuadraticBezierTo(float x1, float y1, float x2, float y2);
method public void reset();
method public void setFillType(androidx.ui.graphics.PathFillType value);
- method public void shift(androidx.ui.geometry.Offset offset);
+ method public void shift-RIqb49o(long offset);
property public androidx.ui.graphics.PathFillType fillType;
property public boolean isConvex;
property public boolean isEmpty;
@@ -95,8 +95,8 @@
enum_constant public static final androidx.ui.graphics.BlendMode xor;
}
- public interface Brush {
- method public void applyTo(androidx.ui.graphics.Paint p);
+ public abstract sealed class Brush {
+ method public abstract void applyTo(androidx.ui.graphics.Paint p);
}
public final class BrushKt {
@@ -112,22 +112,25 @@
public interface Canvas {
method public void clipPath(androidx.ui.graphics.Path path);
- method public void clipRRect(androidx.ui.geometry.RRect rrect);
- method public void clipRect(androidx.ui.geometry.Rect rect, androidx.ui.graphics.ClipOp clipOp = androidx.ui.graphics.ClipOp.intersect);
+ method public default void clipRect(androidx.ui.geometry.Rect rect, androidx.ui.graphics.ClipOp clipOp = androidx.ui.graphics.ClipOp.intersect);
+ method public void clipRect(float left, float top, float right, float bottom, androidx.ui.graphics.ClipOp clipOp = androidx.ui.graphics.ClipOp.intersect);
method public void concat(androidx.ui.graphics.vectormath.Matrix4 matrix4);
method public void disableZ();
- method public void drawArc(androidx.ui.geometry.Rect rect, float startAngle, float sweepAngle, boolean useCenter, androidx.ui.graphics.Paint paint);
+ method public default void drawArc(androidx.ui.geometry.Rect rect, float startAngle, float sweepAngle, boolean useCenter, androidx.ui.graphics.Paint paint);
+ method public void drawArc(float left, float top, float right, float bottom, float startAngle, float sweepAngle, boolean useCenter, androidx.ui.graphics.Paint paint);
method public default void drawArcRad(androidx.ui.geometry.Rect rect, float startAngleRad, float sweepAngleRad, boolean useCenter, androidx.ui.graphics.Paint paint);
- method public void drawCircle(androidx.ui.geometry.Offset center, float radius, androidx.ui.graphics.Paint paint);
- method public void drawImage(androidx.ui.graphics.ImageAsset image, androidx.ui.geometry.Offset topLeftOffset, androidx.ui.graphics.Paint paint);
- method public void drawImageRect(androidx.ui.graphics.ImageAsset image, androidx.ui.geometry.Rect? src, androidx.ui.geometry.Rect dst, androidx.ui.graphics.Paint paint);
- method public void drawLine(androidx.ui.geometry.Offset p1, androidx.ui.geometry.Offset p2, androidx.ui.graphics.Paint paint);
- method public void drawOval(androidx.ui.geometry.Rect rect, androidx.ui.graphics.Paint paint);
+ method public void drawCircle-NfwrgZA(long center, float radius, androidx.ui.graphics.Paint paint);
+ method public void drawImage--AHD2Ng(androidx.ui.graphics.ImageAsset image, long topLeftOffset, androidx.ui.graphics.Paint paint);
+ method public void drawImageRect-btuv3no(androidx.ui.graphics.ImageAsset image, long srcOffset = Offset.zero, long srcSize = Size(image.width.toFloat(), image.height.toFloat()), long dstOffset, long dstSize, androidx.ui.graphics.Paint paint);
+ method public void drawLine-d9kBv1M(long p1, long p2, androidx.ui.graphics.Paint paint);
+ method public default void drawOval(androidx.ui.geometry.Rect rect, androidx.ui.graphics.Paint paint);
+ method public void drawOval(float left, float top, float right, float bottom, androidx.ui.graphics.Paint paint);
method public void drawPath(androidx.ui.graphics.Path path, androidx.ui.graphics.Paint paint);
method public void drawPicture(androidx.ui.graphics.Picture picture);
method public void drawPoints(androidx.ui.graphics.PointMode pointMode, java.util.List<androidx.ui.geometry.Offset> points, androidx.ui.graphics.Paint paint);
method public void drawRawPoints(androidx.ui.graphics.PointMode pointMode, float[] points, androidx.ui.graphics.Paint paint);
- method public void drawRect(androidx.ui.geometry.Rect rect, androidx.ui.graphics.Paint paint);
+ method public default void drawRect(androidx.ui.geometry.Rect rect, androidx.ui.graphics.Paint paint);
+ method public void drawRect(float left, float top, float right, float bottom, androidx.ui.graphics.Paint paint);
method public void drawRoundRect(float left, float top, float right, float bottom, float radiusX, float radiusY, androidx.ui.graphics.Paint paint);
method public void drawVertices(androidx.ui.graphics.Vertices vertices, androidx.ui.graphics.BlendMode blendMode, androidx.ui.graphics.Paint paint);
method public void enableZ();
@@ -161,7 +164,7 @@
method public static long constructor-impl(long value);
method public static long convert-impl(long $this, androidx.ui.graphics.colorspace.ColorSpace colorSpace);
method public static long copy-impl(long $this, float alpha = this.alpha, float red = this.red, float green = this.green, float blue = this.blue);
- method public static boolean equals-impl(long p, Object? p1);
+ method public static inline boolean equals-impl(long p, Object? p1);
method public static boolean equals-impl0(long p1, long p2);
method public static float getAlpha-impl(long $this);
method public static float getBlue-impl(long $this);
@@ -169,7 +172,7 @@
method public static float getGreen-impl(long $this);
method public static float getRed-impl(long $this);
method public long getValue();
- method public static int hashCode-impl(long p);
+ method public static inline int hashCode-impl(long p);
method public static String toString-impl(long $this);
field public static final androidx.ui.graphics.Color.Companion! Companion;
}
@@ -297,7 +300,9 @@
public final class OutlineKt {
method public static void addOutline(androidx.ui.graphics.Path, androidx.ui.graphics.Outline outline);
+ method public static void drawOutline(androidx.ui.graphics.painter.CanvasScope, androidx.ui.graphics.Outline outline, androidx.ui.graphics.Brush brush, @FloatRange(from=0.0, to=1.0) float alpha = 1.0f, androidx.ui.graphics.painter.DrawStyle style = Fill, androidx.ui.graphics.ColorFilter? colorFilter = null, androidx.ui.graphics.BlendMode blendMode = CanvasScope.DefaultBlendMode);
method public static void drawOutline(androidx.ui.graphics.Canvas, androidx.ui.graphics.Outline outline, androidx.ui.graphics.Paint paint);
+ method public static void drawOutline-GAv4Q-k(androidx.ui.graphics.painter.CanvasScope, androidx.ui.graphics.Outline outline, long color, @FloatRange(from=0.0, to=1.0) float alpha = 1.0f, androidx.ui.graphics.painter.DrawStyle style = Fill, androidx.ui.graphics.ColorFilter? colorFilter = null, androidx.ui.graphics.BlendMode blendMode = CanvasScope.DefaultBlendMode);
}
public final class Paint {
@@ -354,7 +359,7 @@
method public void addArc(androidx.ui.geometry.Rect oval, float startAngleDegrees, float sweepAngleDegrees);
method public void addArcRad(androidx.ui.geometry.Rect oval, float startAngleRadians, float sweepAngleRadians);
method public void addOval(androidx.ui.geometry.Rect oval);
- method public void addPath(androidx.ui.graphics.Path path, androidx.ui.geometry.Offset offset = Offset.zero);
+ method public void addPath-m3TnucA(androidx.ui.graphics.Path path, long offset = Offset.zero);
method public void addRRect(androidx.ui.geometry.RRect rrect);
method public void addRect(androidx.ui.geometry.Rect rect);
method public void arcTo(androidx.ui.geometry.Rect rect, float startAngleDegrees, float sweepAngleDegrees, boolean forceMoveTo);
@@ -375,7 +380,7 @@
method public void relativeQuadraticBezierTo(float x1, float y1, float x2, float y2);
method public void reset();
method public void setFillType(androidx.ui.graphics.PathFillType p);
- method public void shift(androidx.ui.geometry.Offset offset);
+ method public void shift-RIqb49o(long offset);
property public abstract androidx.ui.graphics.PathFillType fillType;
property public abstract boolean isConvex;
property public abstract boolean isEmpty;
@@ -440,32 +445,32 @@
public final inline class Shader {
ctor public Shader();
method public static android.graphics.Shader! constructor-impl(android.graphics.Shader nativeShader);
- method public static boolean equals-impl(android.graphics.Shader! p, Object? p1);
+ method public static inline boolean equals-impl(android.graphics.Shader! p, Object? p1);
method public static boolean equals-impl0(android.graphics.Shader p1, android.graphics.Shader p2);
method public android.graphics.Shader getNativeShader();
- method public static int hashCode-impl(android.graphics.Shader! p);
- method public static String toString-impl(android.graphics.Shader! p);
+ method public static inline int hashCode-impl(android.graphics.Shader! p);
+ method public static inline String! toString-impl(android.graphics.Shader! p);
}
- public class ShaderBrush implements androidx.ui.graphics.Brush {
- method public void applyTo(androidx.ui.graphics.Paint p);
+ public class ShaderBrush extends androidx.ui.graphics.Brush {
+ method public final void applyTo(androidx.ui.graphics.Paint p);
method public final android.graphics.Shader getShader();
}
public final class ShaderKt {
method public static android.graphics.Shader ImageShader(androidx.ui.graphics.ImageAsset image, androidx.ui.graphics.TileMode tileModeX = androidx.ui.graphics.TileMode.Clamp, androidx.ui.graphics.TileMode tileModeY = androidx.ui.graphics.TileMode.Clamp);
- method public static android.graphics.Shader LinearGradientShader(androidx.ui.geometry.Offset from, androidx.ui.geometry.Offset to, java.util.List<androidx.ui.graphics.Color> colors, java.util.List<java.lang.Float>? colorStops = null, androidx.ui.graphics.TileMode tileMode = androidx.ui.graphics.TileMode.Clamp);
- method public static android.graphics.Shader RadialGradientShader(androidx.ui.geometry.Offset center, float radius, java.util.List<androidx.ui.graphics.Color> colors, java.util.List<java.lang.Float>? colorStops = null, androidx.ui.graphics.TileMode tileMode = androidx.ui.graphics.TileMode.Clamp);
+ method public static android.graphics.Shader LinearGradientShader-BG1VTC8(long from, long to, java.util.List<androidx.ui.graphics.Color> colors, java.util.List<java.lang.Float>? colorStops = null, androidx.ui.graphics.TileMode tileMode = androidx.ui.graphics.TileMode.Clamp);
+ method public static android.graphics.Shader RadialGradientShader-nSjqbmE(long center, float radius, java.util.List<androidx.ui.graphics.Color> colors, java.util.List<java.lang.Float>? colorStops = null, androidx.ui.graphics.TileMode tileMode = androidx.ui.graphics.TileMode.Clamp);
}
public final class Shadow {
method public long component1();
- method public androidx.ui.geometry.Offset component2();
+ method public long component2();
method public float component3();
- method public androidx.ui.graphics.Shadow copy-1LPazZ4(long color, androidx.ui.geometry.Offset offset, float blurRadius);
+ method public androidx.ui.graphics.Shadow copy-1LPazZ4(long color, long offset, float blurRadius);
method public float getBlurRadius();
method public long getColor();
- method public androidx.ui.geometry.Offset getOffset();
+ method public long getOffset();
field public static final androidx.ui.graphics.Shadow.Companion! Companion;
}
@@ -482,10 +487,8 @@
method public androidx.ui.graphics.Outline createOutline(androidx.ui.unit.PxSize size, androidx.ui.unit.Density density);
}
- public final class SolidColor implements androidx.ui.graphics.Brush {
+ public final class SolidColor extends androidx.ui.graphics.Brush {
method public void applyTo(androidx.ui.graphics.Paint p);
- method public long component1();
- method public androidx.ui.graphics.SolidColor copy-QEYXlZo(long value);
method public long getValue();
}
@@ -715,39 +718,102 @@
package androidx.ui.graphics.painter {
+ public final class CanvasScope {
+ ctor public CanvasScope();
+ method public void draw(androidx.ui.graphics.Canvas canvas, androidx.ui.unit.PxSize size, kotlin.jvm.functions.Function1<? super androidx.ui.graphics.painter.CanvasScope,kotlin.Unit> block);
+ method public kotlin.Unit? drawArc-_aGsT6c(androidx.ui.graphics.Brush brush, float startAngle, float sweepAngle, boolean useCenter, long topLeft = Offset.zero, long size = this.size, @FloatRange(from=0.0, to=1.0) float alpha = 1.0f, androidx.ui.graphics.painter.DrawStyle style = Fill, androidx.ui.graphics.ColorFilter? colorFilter = null, androidx.ui.graphics.BlendMode blendMode = DefaultBlendMode);
+ method public kotlin.Unit? drawArc-eUb3Eo4(long color, float startAngle, float sweepAngle, boolean useCenter, long topLeft = Offset.zero, long size = this.size, @FloatRange(from=0.0, to=1.0) float alpha = 1.0f, androidx.ui.graphics.painter.DrawStyle style = Fill, androidx.ui.graphics.ColorFilter? colorFilter = null, androidx.ui.graphics.BlendMode blendMode = DefaultBlendMode);
+ method public kotlin.Unit? drawCircle-0EImeI8(long color, float radius = size.minDimension / 2.0, long center = this.center, @FloatRange(from=0.0, to=1.0) float alpha = 1.0f, androidx.ui.graphics.painter.DrawStyle style = Fill, androidx.ui.graphics.ColorFilter? colorFilter = null, androidx.ui.graphics.BlendMode blendMode = DefaultBlendMode);
+ method public kotlin.Unit? drawCircle-uHGJFV8(androidx.ui.graphics.Brush brush, float radius = size.minDimension / 2.0, long center = this.center, @FloatRange(from=0.0, to=1.0) float alpha = 1.0f, androidx.ui.graphics.painter.DrawStyle style = Fill, androidx.ui.graphics.ColorFilter? colorFilter = null, androidx.ui.graphics.BlendMode blendMode = DefaultBlendMode);
+ method public kotlin.Unit? drawImage-IF_VeeU(androidx.ui.graphics.ImageAsset image, long srcOffset = Offset.zero, long srcSize = Size(image.width.toFloat(), image.height.toFloat()), long dstOffset = Offset.zero, long dstSize = this.size, @FloatRange(from=0.0, to=1.0) float alpha = 1.0f, androidx.ui.graphics.painter.DrawStyle style = Fill, androidx.ui.graphics.ColorFilter? colorFilter = null, androidx.ui.graphics.BlendMode blendMode = DefaultBlendMode);
+ method public kotlin.Unit? drawImage-zcoU2q0(androidx.ui.graphics.ImageAsset image, long topLeft = Offset.zero, @FloatRange(from=0.0, to=1.0) float alpha = 1.0f, androidx.ui.graphics.painter.DrawStyle style = Fill, androidx.ui.graphics.ColorFilter? colorFilter = null, androidx.ui.graphics.BlendMode blendMode = DefaultBlendMode);
+ method public kotlin.Unit? drawLine-MfDnFlo(long color, long p1, long p2, androidx.ui.graphics.painter.Stroke stroke, @FloatRange(from=0.0, to=1.0) float alpha = 1.0f, androidx.ui.graphics.ColorFilter? colorFilter = null, androidx.ui.graphics.BlendMode blendMode = DefaultBlendMode);
+ method public kotlin.Unit? drawLine-PWBr8KI(androidx.ui.graphics.Brush brush, long p1, long p2, androidx.ui.graphics.painter.Stroke stroke, @FloatRange(from=0.0, to=1.0) float alpha = 1.0f, androidx.ui.graphics.ColorFilter? colorFilter = null, androidx.ui.graphics.BlendMode blendMode = DefaultBlendMode);
+ method public kotlin.Unit? drawOval-EPCrxCw(long color, long topLeft = Offset.zero, long size = this.size, @FloatRange(from=0.0, to=1.0) float alpha = 1.0f, androidx.ui.graphics.painter.DrawStyle style = Fill, androidx.ui.graphics.ColorFilter? colorFilter = null, androidx.ui.graphics.BlendMode blendMode = DefaultBlendMode);
+ method public kotlin.Unit? drawOval-cuGMcK0(androidx.ui.graphics.Brush brush, long topLeft = Offset.zero, long size = this.size, @FloatRange(from=0.0, to=1.0) float alpha = 1.0f, androidx.ui.graphics.painter.DrawStyle style = Fill, androidx.ui.graphics.ColorFilter? colorFilter = null, androidx.ui.graphics.BlendMode blendMode = DefaultBlendMode);
+ method public kotlin.Unit? drawPath(androidx.ui.graphics.Path path, androidx.ui.graphics.Brush brush, @FloatRange(from=0.0, to=1.0) float alpha = 1.0f, androidx.ui.graphics.painter.DrawStyle style = Fill, androidx.ui.graphics.ColorFilter? colorFilter = null, androidx.ui.graphics.BlendMode blendMode = DefaultBlendMode);
+ method public kotlin.Unit? drawPath-ZizoN6c(androidx.ui.graphics.Path path, long color, @FloatRange(from=0.0, to=1.0) float alpha = 1.0f, androidx.ui.graphics.painter.DrawStyle style = Fill, androidx.ui.graphics.ColorFilter? colorFilter = null, androidx.ui.graphics.BlendMode blendMode = DefaultBlendMode);
+ method public kotlin.Unit? drawPoints(java.util.List<androidx.ui.geometry.Offset> points, androidx.ui.graphics.PointMode pointMode, androidx.ui.graphics.Brush brush, @FloatRange(from=0.0, to=1.0) float alpha = 1.0f, androidx.ui.graphics.painter.DrawStyle style = Fill, androidx.ui.graphics.ColorFilter? colorFilter = null, androidx.ui.graphics.BlendMode blendMode = DefaultBlendMode);
+ method public kotlin.Unit? drawPoints-yiE_nf0(java.util.List<androidx.ui.geometry.Offset> points, androidx.ui.graphics.PointMode pointMode, long color, androidx.ui.graphics.painter.Stroke stroke, @FloatRange(from=0.0, to=1.0) float alpha = 1.0f, androidx.ui.graphics.ColorFilter? colorFilter = null, androidx.ui.graphics.BlendMode blendMode = DefaultBlendMode);
+ method public kotlin.Unit? drawRect-EPCrxCw(long color, long topLeft = Offset.zero, long size = this.size, @FloatRange(from=0.0, to=1.0) float alpha = 1.0f, androidx.ui.graphics.painter.DrawStyle style = Fill, androidx.ui.graphics.ColorFilter? colorFilter = null, androidx.ui.graphics.BlendMode blendMode = DefaultBlendMode);
+ method public kotlin.Unit? drawRect-cuGMcK0(androidx.ui.graphics.Brush brush, long topLeft = Offset.zero, long size = this.size, @FloatRange(from=0.0, to=1.0) float alpha = 1.0f, androidx.ui.graphics.painter.DrawStyle style = Fill, androidx.ui.graphics.ColorFilter? colorFilter = null, androidx.ui.graphics.BlendMode blendMode = DefaultBlendMode);
+ method public kotlin.Unit? drawRoundRect-5PTu5W0(androidx.ui.graphics.Brush brush, long topLeft = Offset.zero, long size = this.size, float radiusX = 0.0f, float radiusY = radiusX, @FloatRange(from=0.0, to=1.0) float alpha = 1.0f, androidx.ui.graphics.painter.DrawStyle style = Fill, androidx.ui.graphics.ColorFilter? colorFilter = null, androidx.ui.graphics.BlendMode blendMode = DefaultBlendMode);
+ method public kotlin.Unit? drawRoundRect-A8SqK14(long color, long topLeft = Offset.zero, long size = this.size, float radiusX = 0.0f, float radiusY = 0.0f, androidx.ui.graphics.painter.DrawStyle style = Fill, @FloatRange(from=0.0, to=1.0) float alpha = 1.0f, androidx.ui.graphics.ColorFilter? colorFilter = null, androidx.ui.graphics.BlendMode blendMode = DefaultBlendMode);
+ method public long getCenter();
+ method public long getSize();
+ property public final long center;
+ property public final long size;
+ field public static final androidx.ui.graphics.painter.CanvasScope.Companion! Companion;
+ field public static final float DefaultAlpha = 1.0f;
+ }
+
+ public static final class CanvasScope.Companion {
+ method public androidx.ui.graphics.BlendMode getDefaultBlendMode();
+ property public final androidx.ui.graphics.BlendMode DefaultBlendMode;
+ }
+
+ public final class CanvasScopeKt {
+ method public static inline androidx.ui.graphics.Canvas? clipPath(androidx.ui.graphics.painter.CanvasScope, androidx.ui.graphics.Path path, kotlin.jvm.functions.Function1<? super androidx.ui.graphics.painter.CanvasScope,kotlin.Unit> block);
+ method public static inline androidx.ui.graphics.Canvas? clipRect-2CUYwUY(androidx.ui.graphics.painter.CanvasScope, long topLeft = Offset.zero, long size = this.size, androidx.ui.graphics.ClipOp clipOp = androidx.ui.graphics.ClipOp.intersect, kotlin.jvm.functions.Function1<? super androidx.ui.graphics.painter.CanvasScope,kotlin.Unit> block);
+ method public static inline kotlin.Unit? drawCanvas(androidx.ui.graphics.painter.CanvasScope, kotlin.jvm.functions.Function2<? super androidx.ui.graphics.Canvas,? super androidx.ui.unit.PxSize,kotlin.Unit> block);
+ method public static inline void inset(androidx.ui.graphics.painter.CanvasScope, float left, float top, float right, float bottom, kotlin.jvm.functions.Function1<? super androidx.ui.graphics.painter.CanvasScope,kotlin.Unit> block);
+ method public static inline void inset(androidx.ui.graphics.painter.CanvasScope, float dx, float dy = dx, kotlin.jvm.functions.Function1<? super androidx.ui.graphics.painter.CanvasScope,kotlin.Unit> block);
+ method public static inline androidx.ui.graphics.Canvas? rotate(androidx.ui.graphics.painter.CanvasScope, float degrees, float pivotX = center.dx, float pivotY = center.dy, kotlin.jvm.functions.Function1<? super androidx.ui.graphics.painter.CanvasScope,kotlin.Unit> block);
+ method public static inline androidx.ui.graphics.Canvas? rotateRad(androidx.ui.graphics.painter.CanvasScope, float radians, float pivotX = center.dx, float pivotY = center.dy, kotlin.jvm.functions.Function1<? super androidx.ui.graphics.painter.CanvasScope,kotlin.Unit> block);
+ method public static inline androidx.ui.graphics.Canvas? scale(androidx.ui.graphics.painter.CanvasScope, float scaleX, float scaleY, float pivotX = center.dx, float pivotY = center.dy, kotlin.jvm.functions.Function1<? super androidx.ui.graphics.painter.CanvasScope,kotlin.Unit> block);
+ method public static inline androidx.ui.graphics.Canvas? translate(androidx.ui.graphics.painter.CanvasScope, float dx, float dy, kotlin.jvm.functions.Function1<? super androidx.ui.graphics.painter.CanvasScope,kotlin.Unit> block);
+ }
+
public final class ColorPainter extends androidx.ui.graphics.painter.Painter {
method public long component1();
method public androidx.ui.graphics.painter.ColorPainter copy-QEYXlZo(long color);
method public long getColor();
method public androidx.ui.unit.PxSize getIntrinsicSize();
- method protected void onDraw(androidx.ui.graphics.Canvas canvas, androidx.ui.unit.PxSize bounds);
+ method protected void onDraw(androidx.ui.graphics.painter.CanvasScope);
property public androidx.ui.unit.PxSize intrinsicSize;
}
+ public abstract sealed class DrawStyle {
+ }
+
+ public final class Fill extends androidx.ui.graphics.painter.DrawStyle {
+ field public static final androidx.ui.graphics.painter.Fill! INSTANCE;
+ }
+
public final class ImagePainter extends androidx.ui.graphics.painter.Painter {
- ctor public ImagePainter(androidx.ui.graphics.ImageAsset image, androidx.ui.geometry.Rect? srcBounds);
- method public androidx.ui.geometry.Rect? component2();
- method public androidx.ui.graphics.painter.ImagePainter copy(androidx.ui.graphics.ImageAsset image, androidx.ui.geometry.Rect? srcBounds);
+ method public androidx.ui.graphics.painter.ImagePainter copy-gqgapXI(androidx.ui.graphics.ImageAsset image, long srcOffset, long srcSize);
method public androidx.ui.unit.PxSize getIntrinsicSize();
- method public androidx.ui.geometry.Rect? getSrcBounds();
- method protected void onDraw(androidx.ui.graphics.Canvas canvas, androidx.ui.unit.PxSize bounds);
+ method protected void onDraw(androidx.ui.graphics.painter.CanvasScope);
property public androidx.ui.unit.PxSize intrinsicSize;
}
- public final class ImagePainterKt {
- }
-
public abstract class Painter {
ctor public Painter();
method protected boolean applyAlpha(float alpha);
method protected boolean applyColorFilter(androidx.ui.graphics.ColorFilter? colorFilter);
method protected boolean applyRtl(boolean rtl);
- method public final void draw(androidx.ui.graphics.Canvas canvas, androidx.ui.unit.PxSize bounds, float alpha = 1.0f, androidx.ui.graphics.ColorFilter? colorFilter = null, boolean rtl = false);
+ method public final void draw(androidx.ui.graphics.Canvas canvas, androidx.ui.unit.PxSize size, float alpha = 1.0f, androidx.ui.graphics.ColorFilter? colorFilter = null, boolean rtl = false);
method public abstract androidx.ui.unit.PxSize getIntrinsicSize();
- method protected abstract void onDraw(androidx.ui.graphics.Canvas canvas, androidx.ui.unit.PxSize bounds);
+ method protected abstract void onDraw(androidx.ui.graphics.painter.CanvasScope);
property public abstract androidx.ui.unit.PxSize intrinsicSize;
}
+ public final class Stroke extends androidx.ui.graphics.painter.DrawStyle {
+ ctor public Stroke(float width, float miter, androidx.ui.graphics.StrokeCap cap, androidx.ui.graphics.StrokeJoin join, android.graphics.PathEffect? pathEffect);
+ ctor public Stroke();
+ method public float component1();
+ method public float component2();
+ method public androidx.ui.graphics.StrokeCap component3();
+ method public androidx.ui.graphics.StrokeJoin component4();
+ method public android.graphics.PathEffect? component5();
+ method public androidx.ui.graphics.painter.Stroke copy(float width, float miter, androidx.ui.graphics.StrokeCap cap, androidx.ui.graphics.StrokeJoin join, android.graphics.PathEffect? pathEffect);
+ method public androidx.ui.graphics.StrokeCap getCap();
+ method public androidx.ui.graphics.StrokeJoin getJoin();
+ method public float getMiter();
+ method public android.graphics.PathEffect? getPathEffect();
+ method public float getWidth();
+ }
+
}
package androidx.ui.graphics.vector {
@@ -1144,7 +1210,7 @@
method public static androidx.ui.geometry.Rect inverseTransformRect(androidx.ui.graphics.vectormath.Matrix4 transform, androidx.ui.geometry.Rect rect);
method public static boolean isIdentity(androidx.ui.graphics.vectormath.Matrix4);
method public static boolean matrixEquals(androidx.ui.graphics.vectormath.Matrix4? a, androidx.ui.graphics.vectormath.Matrix4? b);
- method public static androidx.ui.geometry.Offset transformPoint(androidx.ui.graphics.vectormath.Matrix4, androidx.ui.geometry.Offset point);
+ method public static long transformPoint-k2M_ft0(androidx.ui.graphics.vectormath.Matrix4, long point);
method public static androidx.ui.geometry.Rect transformRect(androidx.ui.graphics.vectormath.Matrix4, androidx.ui.geometry.Rect rect);
}
diff --git a/ui/ui-graphics/api/public_plus_experimental_0.1.0-dev11.txt b/ui/ui-graphics/api/public_plus_experimental_0.1.0-dev11.txt
index a4896944..8b672ec 100644
--- a/ui/ui-graphics/api/public_plus_experimental_0.1.0-dev11.txt
+++ b/ui/ui-graphics/api/public_plus_experimental_0.1.0-dev11.txt
@@ -29,7 +29,7 @@
method public void addArc(androidx.ui.geometry.Rect oval, float startAngleDegrees, float sweepAngleDegrees);
method public void addArcRad(androidx.ui.geometry.Rect oval, float startAngleRadians, float sweepAngleRadians);
method public void addOval(androidx.ui.geometry.Rect oval);
- method public void addPath(androidx.ui.graphics.Path path, androidx.ui.geometry.Offset offset);
+ method public void addPath-m3TnucA(androidx.ui.graphics.Path path, long offset);
method public void addRRect(androidx.ui.geometry.RRect rrect);
method public void addRect(androidx.ui.geometry.Rect rect);
method public void arcTo(androidx.ui.geometry.Rect rect, float startAngleDegrees, float sweepAngleDegrees, boolean forceMoveTo);
@@ -50,7 +50,7 @@
method public void relativeQuadraticBezierTo(float x1, float y1, float x2, float y2);
method public void reset();
method public void setFillType(androidx.ui.graphics.PathFillType value);
- method public void shift(androidx.ui.geometry.Offset offset);
+ method public void shift-RIqb49o(long offset);
property public androidx.ui.graphics.PathFillType fillType;
property public boolean isConvex;
property public boolean isEmpty;
@@ -95,8 +95,8 @@
enum_constant public static final androidx.ui.graphics.BlendMode xor;
}
- public interface Brush {
- method public void applyTo(androidx.ui.graphics.Paint p);
+ public abstract sealed class Brush {
+ method public abstract void applyTo(androidx.ui.graphics.Paint p);
}
public final class BrushKt {
@@ -112,22 +112,25 @@
public interface Canvas {
method public void clipPath(androidx.ui.graphics.Path path);
- method public void clipRRect(androidx.ui.geometry.RRect rrect);
- method public void clipRect(androidx.ui.geometry.Rect rect, androidx.ui.graphics.ClipOp clipOp = androidx.ui.graphics.ClipOp.intersect);
+ method public default void clipRect(androidx.ui.geometry.Rect rect, androidx.ui.graphics.ClipOp clipOp = androidx.ui.graphics.ClipOp.intersect);
+ method public void clipRect(float left, float top, float right, float bottom, androidx.ui.graphics.ClipOp clipOp = androidx.ui.graphics.ClipOp.intersect);
method public void concat(androidx.ui.graphics.vectormath.Matrix4 matrix4);
method public void disableZ();
- method public void drawArc(androidx.ui.geometry.Rect rect, float startAngle, float sweepAngle, boolean useCenter, androidx.ui.graphics.Paint paint);
+ method public default void drawArc(androidx.ui.geometry.Rect rect, float startAngle, float sweepAngle, boolean useCenter, androidx.ui.graphics.Paint paint);
+ method public void drawArc(float left, float top, float right, float bottom, float startAngle, float sweepAngle, boolean useCenter, androidx.ui.graphics.Paint paint);
method public default void drawArcRad(androidx.ui.geometry.Rect rect, float startAngleRad, float sweepAngleRad, boolean useCenter, androidx.ui.graphics.Paint paint);
- method public void drawCircle(androidx.ui.geometry.Offset center, float radius, androidx.ui.graphics.Paint paint);
- method public void drawImage(androidx.ui.graphics.ImageAsset image, androidx.ui.geometry.Offset topLeftOffset, androidx.ui.graphics.Paint paint);
- method public void drawImageRect(androidx.ui.graphics.ImageAsset image, androidx.ui.geometry.Rect? src, androidx.ui.geometry.Rect dst, androidx.ui.graphics.Paint paint);
- method public void drawLine(androidx.ui.geometry.Offset p1, androidx.ui.geometry.Offset p2, androidx.ui.graphics.Paint paint);
- method public void drawOval(androidx.ui.geometry.Rect rect, androidx.ui.graphics.Paint paint);
+ method public void drawCircle-NfwrgZA(long center, float radius, androidx.ui.graphics.Paint paint);
+ method public void drawImage--AHD2Ng(androidx.ui.graphics.ImageAsset image, long topLeftOffset, androidx.ui.graphics.Paint paint);
+ method public void drawImageRect-btuv3no(androidx.ui.graphics.ImageAsset image, long srcOffset = Offset.zero, long srcSize = Size(image.width.toFloat(), image.height.toFloat()), long dstOffset, long dstSize, androidx.ui.graphics.Paint paint);
+ method public void drawLine-d9kBv1M(long p1, long p2, androidx.ui.graphics.Paint paint);
+ method public default void drawOval(androidx.ui.geometry.Rect rect, androidx.ui.graphics.Paint paint);
+ method public void drawOval(float left, float top, float right, float bottom, androidx.ui.graphics.Paint paint);
method public void drawPath(androidx.ui.graphics.Path path, androidx.ui.graphics.Paint paint);
method public void drawPicture(androidx.ui.graphics.Picture picture);
method public void drawPoints(androidx.ui.graphics.PointMode pointMode, java.util.List<androidx.ui.geometry.Offset> points, androidx.ui.graphics.Paint paint);
method public void drawRawPoints(androidx.ui.graphics.PointMode pointMode, float[] points, androidx.ui.graphics.Paint paint);
- method public void drawRect(androidx.ui.geometry.Rect rect, androidx.ui.graphics.Paint paint);
+ method public default void drawRect(androidx.ui.geometry.Rect rect, androidx.ui.graphics.Paint paint);
+ method public void drawRect(float left, float top, float right, float bottom, androidx.ui.graphics.Paint paint);
method public void drawRoundRect(float left, float top, float right, float bottom, float radiusX, float radiusY, androidx.ui.graphics.Paint paint);
method public void drawVertices(androidx.ui.graphics.Vertices vertices, androidx.ui.graphics.BlendMode blendMode, androidx.ui.graphics.Paint paint);
method public void enableZ();
@@ -161,7 +164,7 @@
method public static long constructor-impl(long value);
method public static long convert-impl(long $this, androidx.ui.graphics.colorspace.ColorSpace colorSpace);
method public static long copy-impl(long $this, float alpha = this.alpha, float red = this.red, float green = this.green, float blue = this.blue);
- method public static boolean equals-impl(long p, Object? p1);
+ method public static inline boolean equals-impl(long p, Object? p1);
method public static boolean equals-impl0(long p1, long p2);
method public static float getAlpha-impl(long $this);
method public static float getBlue-impl(long $this);
@@ -169,7 +172,7 @@
method public static float getGreen-impl(long $this);
method public static float getRed-impl(long $this);
method public long getValue();
- method public static int hashCode-impl(long p);
+ method public static inline int hashCode-impl(long p);
method public static String toString-impl(long $this);
field public static final androidx.ui.graphics.Color.Companion! Companion;
}
@@ -297,7 +300,9 @@
public final class OutlineKt {
method public static void addOutline(androidx.ui.graphics.Path, androidx.ui.graphics.Outline outline);
+ method public static void drawOutline(androidx.ui.graphics.painter.CanvasScope, androidx.ui.graphics.Outline outline, androidx.ui.graphics.Brush brush, @FloatRange(from=0.0, to=1.0) float alpha = 1.0f, androidx.ui.graphics.painter.DrawStyle style = Fill, androidx.ui.graphics.ColorFilter? colorFilter = null, androidx.ui.graphics.BlendMode blendMode = CanvasScope.DefaultBlendMode);
method public static void drawOutline(androidx.ui.graphics.Canvas, androidx.ui.graphics.Outline outline, androidx.ui.graphics.Paint paint);
+ method public static void drawOutline-GAv4Q-k(androidx.ui.graphics.painter.CanvasScope, androidx.ui.graphics.Outline outline, long color, @FloatRange(from=0.0, to=1.0) float alpha = 1.0f, androidx.ui.graphics.painter.DrawStyle style = Fill, androidx.ui.graphics.ColorFilter? colorFilter = null, androidx.ui.graphics.BlendMode blendMode = CanvasScope.DefaultBlendMode);
}
public final class Paint {
@@ -354,7 +359,7 @@
method public void addArc(androidx.ui.geometry.Rect oval, float startAngleDegrees, float sweepAngleDegrees);
method public void addArcRad(androidx.ui.geometry.Rect oval, float startAngleRadians, float sweepAngleRadians);
method public void addOval(androidx.ui.geometry.Rect oval);
- method public void addPath(androidx.ui.graphics.Path path, androidx.ui.geometry.Offset offset = Offset.zero);
+ method public void addPath-m3TnucA(androidx.ui.graphics.Path path, long offset = Offset.zero);
method public void addRRect(androidx.ui.geometry.RRect rrect);
method public void addRect(androidx.ui.geometry.Rect rect);
method public void arcTo(androidx.ui.geometry.Rect rect, float startAngleDegrees, float sweepAngleDegrees, boolean forceMoveTo);
@@ -375,7 +380,7 @@
method public void relativeQuadraticBezierTo(float x1, float y1, float x2, float y2);
method public void reset();
method public void setFillType(androidx.ui.graphics.PathFillType p);
- method public void shift(androidx.ui.geometry.Offset offset);
+ method public void shift-RIqb49o(long offset);
property public abstract androidx.ui.graphics.PathFillType fillType;
property public abstract boolean isConvex;
property public abstract boolean isEmpty;
@@ -440,32 +445,32 @@
public final inline class Shader {
ctor public Shader();
method public static android.graphics.Shader! constructor-impl(android.graphics.Shader nativeShader);
- method public static boolean equals-impl(android.graphics.Shader! p, Object? p1);
+ method public static inline boolean equals-impl(android.graphics.Shader! p, Object? p1);
method public static boolean equals-impl0(android.graphics.Shader p1, android.graphics.Shader p2);
method public android.graphics.Shader getNativeShader();
- method public static int hashCode-impl(android.graphics.Shader! p);
- method public static String toString-impl(android.graphics.Shader! p);
+ method public static inline int hashCode-impl(android.graphics.Shader! p);
+ method public static inline String! toString-impl(android.graphics.Shader! p);
}
- public class ShaderBrush implements androidx.ui.graphics.Brush {
- method public void applyTo(androidx.ui.graphics.Paint p);
+ public class ShaderBrush extends androidx.ui.graphics.Brush {
+ method public final void applyTo(androidx.ui.graphics.Paint p);
method public final android.graphics.Shader getShader();
}
public final class ShaderKt {
method public static android.graphics.Shader ImageShader(androidx.ui.graphics.ImageAsset image, androidx.ui.graphics.TileMode tileModeX = androidx.ui.graphics.TileMode.Clamp, androidx.ui.graphics.TileMode tileModeY = androidx.ui.graphics.TileMode.Clamp);
- method public static android.graphics.Shader LinearGradientShader(androidx.ui.geometry.Offset from, androidx.ui.geometry.Offset to, java.util.List<androidx.ui.graphics.Color> colors, java.util.List<java.lang.Float>? colorStops = null, androidx.ui.graphics.TileMode tileMode = androidx.ui.graphics.TileMode.Clamp);
- method public static android.graphics.Shader RadialGradientShader(androidx.ui.geometry.Offset center, float radius, java.util.List<androidx.ui.graphics.Color> colors, java.util.List<java.lang.Float>? colorStops = null, androidx.ui.graphics.TileMode tileMode = androidx.ui.graphics.TileMode.Clamp);
+ method public static android.graphics.Shader LinearGradientShader-BG1VTC8(long from, long to, java.util.List<androidx.ui.graphics.Color> colors, java.util.List<java.lang.Float>? colorStops = null, androidx.ui.graphics.TileMode tileMode = androidx.ui.graphics.TileMode.Clamp);
+ method public static android.graphics.Shader RadialGradientShader-nSjqbmE(long center, float radius, java.util.List<androidx.ui.graphics.Color> colors, java.util.List<java.lang.Float>? colorStops = null, androidx.ui.graphics.TileMode tileMode = androidx.ui.graphics.TileMode.Clamp);
}
public final class Shadow {
method public long component1();
- method public androidx.ui.geometry.Offset component2();
+ method public long component2();
method public float component3();
- method public androidx.ui.graphics.Shadow copy-1LPazZ4(long color, androidx.ui.geometry.Offset offset, float blurRadius);
+ method public androidx.ui.graphics.Shadow copy-1LPazZ4(long color, long offset, float blurRadius);
method public float getBlurRadius();
method public long getColor();
- method public androidx.ui.geometry.Offset getOffset();
+ method public long getOffset();
field public static final androidx.ui.graphics.Shadow.Companion! Companion;
}
@@ -482,10 +487,8 @@
method public androidx.ui.graphics.Outline createOutline(androidx.ui.unit.PxSize size, androidx.ui.unit.Density density);
}
- public final class SolidColor implements androidx.ui.graphics.Brush {
+ public final class SolidColor extends androidx.ui.graphics.Brush {
method public void applyTo(androidx.ui.graphics.Paint p);
- method public long component1();
- method public androidx.ui.graphics.SolidColor copy-QEYXlZo(long value);
method public long getValue();
}
@@ -715,39 +718,102 @@
package androidx.ui.graphics.painter {
+ public final class CanvasScope {
+ ctor public CanvasScope();
+ method public void draw(androidx.ui.graphics.Canvas canvas, androidx.ui.unit.PxSize size, kotlin.jvm.functions.Function1<? super androidx.ui.graphics.painter.CanvasScope,kotlin.Unit> block);
+ method public kotlin.Unit? drawArc-_aGsT6c(androidx.ui.graphics.Brush brush, float startAngle, float sweepAngle, boolean useCenter, long topLeft = Offset.zero, long size = this.size, @FloatRange(from=0.0, to=1.0) float alpha = 1.0f, androidx.ui.graphics.painter.DrawStyle style = Fill, androidx.ui.graphics.ColorFilter? colorFilter = null, androidx.ui.graphics.BlendMode blendMode = DefaultBlendMode);
+ method public kotlin.Unit? drawArc-eUb3Eo4(long color, float startAngle, float sweepAngle, boolean useCenter, long topLeft = Offset.zero, long size = this.size, @FloatRange(from=0.0, to=1.0) float alpha = 1.0f, androidx.ui.graphics.painter.DrawStyle style = Fill, androidx.ui.graphics.ColorFilter? colorFilter = null, androidx.ui.graphics.BlendMode blendMode = DefaultBlendMode);
+ method public kotlin.Unit? drawCircle-0EImeI8(long color, float radius = size.minDimension / 2.0, long center = this.center, @FloatRange(from=0.0, to=1.0) float alpha = 1.0f, androidx.ui.graphics.painter.DrawStyle style = Fill, androidx.ui.graphics.ColorFilter? colorFilter = null, androidx.ui.graphics.BlendMode blendMode = DefaultBlendMode);
+ method public kotlin.Unit? drawCircle-uHGJFV8(androidx.ui.graphics.Brush brush, float radius = size.minDimension / 2.0, long center = this.center, @FloatRange(from=0.0, to=1.0) float alpha = 1.0f, androidx.ui.graphics.painter.DrawStyle style = Fill, androidx.ui.graphics.ColorFilter? colorFilter = null, androidx.ui.graphics.BlendMode blendMode = DefaultBlendMode);
+ method public kotlin.Unit? drawImage-IF_VeeU(androidx.ui.graphics.ImageAsset image, long srcOffset = Offset.zero, long srcSize = Size(image.width.toFloat(), image.height.toFloat()), long dstOffset = Offset.zero, long dstSize = this.size, @FloatRange(from=0.0, to=1.0) float alpha = 1.0f, androidx.ui.graphics.painter.DrawStyle style = Fill, androidx.ui.graphics.ColorFilter? colorFilter = null, androidx.ui.graphics.BlendMode blendMode = DefaultBlendMode);
+ method public kotlin.Unit? drawImage-zcoU2q0(androidx.ui.graphics.ImageAsset image, long topLeft = Offset.zero, @FloatRange(from=0.0, to=1.0) float alpha = 1.0f, androidx.ui.graphics.painter.DrawStyle style = Fill, androidx.ui.graphics.ColorFilter? colorFilter = null, androidx.ui.graphics.BlendMode blendMode = DefaultBlendMode);
+ method public kotlin.Unit? drawLine-MfDnFlo(long color, long p1, long p2, androidx.ui.graphics.painter.Stroke stroke, @FloatRange(from=0.0, to=1.0) float alpha = 1.0f, androidx.ui.graphics.ColorFilter? colorFilter = null, androidx.ui.graphics.BlendMode blendMode = DefaultBlendMode);
+ method public kotlin.Unit? drawLine-PWBr8KI(androidx.ui.graphics.Brush brush, long p1, long p2, androidx.ui.graphics.painter.Stroke stroke, @FloatRange(from=0.0, to=1.0) float alpha = 1.0f, androidx.ui.graphics.ColorFilter? colorFilter = null, androidx.ui.graphics.BlendMode blendMode = DefaultBlendMode);
+ method public kotlin.Unit? drawOval-EPCrxCw(long color, long topLeft = Offset.zero, long size = this.size, @FloatRange(from=0.0, to=1.0) float alpha = 1.0f, androidx.ui.graphics.painter.DrawStyle style = Fill, androidx.ui.graphics.ColorFilter? colorFilter = null, androidx.ui.graphics.BlendMode blendMode = DefaultBlendMode);
+ method public kotlin.Unit? drawOval-cuGMcK0(androidx.ui.graphics.Brush brush, long topLeft = Offset.zero, long size = this.size, @FloatRange(from=0.0, to=1.0) float alpha = 1.0f, androidx.ui.graphics.painter.DrawStyle style = Fill, androidx.ui.graphics.ColorFilter? colorFilter = null, androidx.ui.graphics.BlendMode blendMode = DefaultBlendMode);
+ method public kotlin.Unit? drawPath(androidx.ui.graphics.Path path, androidx.ui.graphics.Brush brush, @FloatRange(from=0.0, to=1.0) float alpha = 1.0f, androidx.ui.graphics.painter.DrawStyle style = Fill, androidx.ui.graphics.ColorFilter? colorFilter = null, androidx.ui.graphics.BlendMode blendMode = DefaultBlendMode);
+ method public kotlin.Unit? drawPath-ZizoN6c(androidx.ui.graphics.Path path, long color, @FloatRange(from=0.0, to=1.0) float alpha = 1.0f, androidx.ui.graphics.painter.DrawStyle style = Fill, androidx.ui.graphics.ColorFilter? colorFilter = null, androidx.ui.graphics.BlendMode blendMode = DefaultBlendMode);
+ method public kotlin.Unit? drawPoints(java.util.List<androidx.ui.geometry.Offset> points, androidx.ui.graphics.PointMode pointMode, androidx.ui.graphics.Brush brush, @FloatRange(from=0.0, to=1.0) float alpha = 1.0f, androidx.ui.graphics.painter.DrawStyle style = Fill, androidx.ui.graphics.ColorFilter? colorFilter = null, androidx.ui.graphics.BlendMode blendMode = DefaultBlendMode);
+ method public kotlin.Unit? drawPoints-yiE_nf0(java.util.List<androidx.ui.geometry.Offset> points, androidx.ui.graphics.PointMode pointMode, long color, androidx.ui.graphics.painter.Stroke stroke, @FloatRange(from=0.0, to=1.0) float alpha = 1.0f, androidx.ui.graphics.ColorFilter? colorFilter = null, androidx.ui.graphics.BlendMode blendMode = DefaultBlendMode);
+ method public kotlin.Unit? drawRect-EPCrxCw(long color, long topLeft = Offset.zero, long size = this.size, @FloatRange(from=0.0, to=1.0) float alpha = 1.0f, androidx.ui.graphics.painter.DrawStyle style = Fill, androidx.ui.graphics.ColorFilter? colorFilter = null, androidx.ui.graphics.BlendMode blendMode = DefaultBlendMode);
+ method public kotlin.Unit? drawRect-cuGMcK0(androidx.ui.graphics.Brush brush, long topLeft = Offset.zero, long size = this.size, @FloatRange(from=0.0, to=1.0) float alpha = 1.0f, androidx.ui.graphics.painter.DrawStyle style = Fill, androidx.ui.graphics.ColorFilter? colorFilter = null, androidx.ui.graphics.BlendMode blendMode = DefaultBlendMode);
+ method public kotlin.Unit? drawRoundRect-5PTu5W0(androidx.ui.graphics.Brush brush, long topLeft = Offset.zero, long size = this.size, float radiusX = 0.0f, float radiusY = radiusX, @FloatRange(from=0.0, to=1.0) float alpha = 1.0f, androidx.ui.graphics.painter.DrawStyle style = Fill, androidx.ui.graphics.ColorFilter? colorFilter = null, androidx.ui.graphics.BlendMode blendMode = DefaultBlendMode);
+ method public kotlin.Unit? drawRoundRect-A8SqK14(long color, long topLeft = Offset.zero, long size = this.size, float radiusX = 0.0f, float radiusY = 0.0f, androidx.ui.graphics.painter.DrawStyle style = Fill, @FloatRange(from=0.0, to=1.0) float alpha = 1.0f, androidx.ui.graphics.ColorFilter? colorFilter = null, androidx.ui.graphics.BlendMode blendMode = DefaultBlendMode);
+ method public long getCenter();
+ method public long getSize();
+ property public final long center;
+ property public final long size;
+ field public static final androidx.ui.graphics.painter.CanvasScope.Companion! Companion;
+ field public static final float DefaultAlpha = 1.0f;
+ }
+
+ public static final class CanvasScope.Companion {
+ method public androidx.ui.graphics.BlendMode getDefaultBlendMode();
+ property public final androidx.ui.graphics.BlendMode DefaultBlendMode;
+ }
+
+ public final class CanvasScopeKt {
+ method public static inline androidx.ui.graphics.Canvas? clipPath(androidx.ui.graphics.painter.CanvasScope, androidx.ui.graphics.Path path, kotlin.jvm.functions.Function1<? super androidx.ui.graphics.painter.CanvasScope,kotlin.Unit> block);
+ method public static inline androidx.ui.graphics.Canvas? clipRect-2CUYwUY(androidx.ui.graphics.painter.CanvasScope, long topLeft = Offset.zero, long size = this.size, androidx.ui.graphics.ClipOp clipOp = androidx.ui.graphics.ClipOp.intersect, kotlin.jvm.functions.Function1<? super androidx.ui.graphics.painter.CanvasScope,kotlin.Unit> block);
+ method public static inline kotlin.Unit? drawCanvas(androidx.ui.graphics.painter.CanvasScope, kotlin.jvm.functions.Function2<? super androidx.ui.graphics.Canvas,? super androidx.ui.unit.PxSize,kotlin.Unit> block);
+ method public static inline void inset(androidx.ui.graphics.painter.CanvasScope, float left, float top, float right, float bottom, kotlin.jvm.functions.Function1<? super androidx.ui.graphics.painter.CanvasScope,kotlin.Unit> block);
+ method public static inline void inset(androidx.ui.graphics.painter.CanvasScope, float dx, float dy = dx, kotlin.jvm.functions.Function1<? super androidx.ui.graphics.painter.CanvasScope,kotlin.Unit> block);
+ method public static inline androidx.ui.graphics.Canvas? rotate(androidx.ui.graphics.painter.CanvasScope, float degrees, float pivotX = center.dx, float pivotY = center.dy, kotlin.jvm.functions.Function1<? super androidx.ui.graphics.painter.CanvasScope,kotlin.Unit> block);
+ method public static inline androidx.ui.graphics.Canvas? rotateRad(androidx.ui.graphics.painter.CanvasScope, float radians, float pivotX = center.dx, float pivotY = center.dy, kotlin.jvm.functions.Function1<? super androidx.ui.graphics.painter.CanvasScope,kotlin.Unit> block);
+ method public static inline androidx.ui.graphics.Canvas? scale(androidx.ui.graphics.painter.CanvasScope, float scaleX, float scaleY, float pivotX = center.dx, float pivotY = center.dy, kotlin.jvm.functions.Function1<? super androidx.ui.graphics.painter.CanvasScope,kotlin.Unit> block);
+ method public static inline androidx.ui.graphics.Canvas? translate(androidx.ui.graphics.painter.CanvasScope, float dx, float dy, kotlin.jvm.functions.Function1<? super androidx.ui.graphics.painter.CanvasScope,kotlin.Unit> block);
+ }
+
public final class ColorPainter extends androidx.ui.graphics.painter.Painter {
method public long component1();
method public androidx.ui.graphics.painter.ColorPainter copy-QEYXlZo(long color);
method public long getColor();
method public androidx.ui.unit.PxSize getIntrinsicSize();
- method protected void onDraw(androidx.ui.graphics.Canvas canvas, androidx.ui.unit.PxSize bounds);
+ method protected void onDraw(androidx.ui.graphics.painter.CanvasScope);
property public androidx.ui.unit.PxSize intrinsicSize;
}
+ public abstract sealed class DrawStyle {
+ }
+
+ public final class Fill extends androidx.ui.graphics.painter.DrawStyle {
+ field public static final androidx.ui.graphics.painter.Fill! INSTANCE;
+ }
+
public final class ImagePainter extends androidx.ui.graphics.painter.Painter {
- ctor public ImagePainter(androidx.ui.graphics.ImageAsset image, androidx.ui.geometry.Rect? srcBounds);
- method public androidx.ui.geometry.Rect? component2();
- method public androidx.ui.graphics.painter.ImagePainter copy(androidx.ui.graphics.ImageAsset image, androidx.ui.geometry.Rect? srcBounds);
+ method public androidx.ui.graphics.painter.ImagePainter copy-gqgapXI(androidx.ui.graphics.ImageAsset image, long srcOffset, long srcSize);
method public androidx.ui.unit.PxSize getIntrinsicSize();
- method public androidx.ui.geometry.Rect? getSrcBounds();
- method protected void onDraw(androidx.ui.graphics.Canvas canvas, androidx.ui.unit.PxSize bounds);
+ method protected void onDraw(androidx.ui.graphics.painter.CanvasScope);
property public androidx.ui.unit.PxSize intrinsicSize;
}
- public final class ImagePainterKt {
- }
-
public abstract class Painter {
ctor public Painter();
method protected boolean applyAlpha(float alpha);
method protected boolean applyColorFilter(androidx.ui.graphics.ColorFilter? colorFilter);
method protected boolean applyRtl(boolean rtl);
- method public final void draw(androidx.ui.graphics.Canvas canvas, androidx.ui.unit.PxSize bounds, float alpha = 1.0f, androidx.ui.graphics.ColorFilter? colorFilter = null, boolean rtl = false);
+ method public final void draw(androidx.ui.graphics.Canvas canvas, androidx.ui.unit.PxSize size, float alpha = 1.0f, androidx.ui.graphics.ColorFilter? colorFilter = null, boolean rtl = false);
method public abstract androidx.ui.unit.PxSize getIntrinsicSize();
- method protected abstract void onDraw(androidx.ui.graphics.Canvas canvas, androidx.ui.unit.PxSize bounds);
+ method protected abstract void onDraw(androidx.ui.graphics.painter.CanvasScope);
property public abstract androidx.ui.unit.PxSize intrinsicSize;
}
+ public final class Stroke extends androidx.ui.graphics.painter.DrawStyle {
+ ctor public Stroke(float width, float miter, androidx.ui.graphics.StrokeCap cap, androidx.ui.graphics.StrokeJoin join, android.graphics.PathEffect? pathEffect);
+ ctor public Stroke();
+ method public float component1();
+ method public float component2();
+ method public androidx.ui.graphics.StrokeCap component3();
+ method public androidx.ui.graphics.StrokeJoin component4();
+ method public android.graphics.PathEffect? component5();
+ method public androidx.ui.graphics.painter.Stroke copy(float width, float miter, androidx.ui.graphics.StrokeCap cap, androidx.ui.graphics.StrokeJoin join, android.graphics.PathEffect? pathEffect);
+ method public androidx.ui.graphics.StrokeCap getCap();
+ method public androidx.ui.graphics.StrokeJoin getJoin();
+ method public float getMiter();
+ method public android.graphics.PathEffect? getPathEffect();
+ method public float getWidth();
+ }
+
}
package androidx.ui.graphics.vector {
@@ -1144,7 +1210,7 @@
method public static androidx.ui.geometry.Rect inverseTransformRect(androidx.ui.graphics.vectormath.Matrix4 transform, androidx.ui.geometry.Rect rect);
method public static boolean isIdentity(androidx.ui.graphics.vectormath.Matrix4);
method public static boolean matrixEquals(androidx.ui.graphics.vectormath.Matrix4? a, androidx.ui.graphics.vectormath.Matrix4? b);
- method public static androidx.ui.geometry.Offset transformPoint(androidx.ui.graphics.vectormath.Matrix4, androidx.ui.geometry.Offset point);
+ method public static long transformPoint-k2M_ft0(androidx.ui.graphics.vectormath.Matrix4, long point);
method public static androidx.ui.geometry.Rect transformRect(androidx.ui.graphics.vectormath.Matrix4, androidx.ui.geometry.Rect rect);
}
diff --git a/ui/ui-graphics/api/public_plus_experimental_current.txt b/ui/ui-graphics/api/public_plus_experimental_current.txt
index a4896944..8b672ec 100644
--- a/ui/ui-graphics/api/public_plus_experimental_current.txt
+++ b/ui/ui-graphics/api/public_plus_experimental_current.txt
@@ -29,7 +29,7 @@
method public void addArc(androidx.ui.geometry.Rect oval, float startAngleDegrees, float sweepAngleDegrees);
method public void addArcRad(androidx.ui.geometry.Rect oval, float startAngleRadians, float sweepAngleRadians);
method public void addOval(androidx.ui.geometry.Rect oval);
- method public void addPath(androidx.ui.graphics.Path path, androidx.ui.geometry.Offset offset);
+ method public void addPath-m3TnucA(androidx.ui.graphics.Path path, long offset);
method public void addRRect(androidx.ui.geometry.RRect rrect);
method public void addRect(androidx.ui.geometry.Rect rect);
method public void arcTo(androidx.ui.geometry.Rect rect, float startAngleDegrees, float sweepAngleDegrees, boolean forceMoveTo);
@@ -50,7 +50,7 @@
method public void relativeQuadraticBezierTo(float x1, float y1, float x2, float y2);
method public void reset();
method public void setFillType(androidx.ui.graphics.PathFillType value);
- method public void shift(androidx.ui.geometry.Offset offset);
+ method public void shift-RIqb49o(long offset);
property public androidx.ui.graphics.PathFillType fillType;
property public boolean isConvex;
property public boolean isEmpty;
@@ -95,8 +95,8 @@
enum_constant public static final androidx.ui.graphics.BlendMode xor;
}
- public interface Brush {
- method public void applyTo(androidx.ui.graphics.Paint p);
+ public abstract sealed class Brush {
+ method public abstract void applyTo(androidx.ui.graphics.Paint p);
}
public final class BrushKt {
@@ -112,22 +112,25 @@
public interface Canvas {
method public void clipPath(androidx.ui.graphics.Path path);
- method public void clipRRect(androidx.ui.geometry.RRect rrect);
- method public void clipRect(androidx.ui.geometry.Rect rect, androidx.ui.graphics.ClipOp clipOp = androidx.ui.graphics.ClipOp.intersect);
+ method public default void clipRect(androidx.ui.geometry.Rect rect, androidx.ui.graphics.ClipOp clipOp = androidx.ui.graphics.ClipOp.intersect);
+ method public void clipRect(float left, float top, float right, float bottom, androidx.ui.graphics.ClipOp clipOp = androidx.ui.graphics.ClipOp.intersect);
method public void concat(androidx.ui.graphics.vectormath.Matrix4 matrix4);
method public void disableZ();
- method public void drawArc(androidx.ui.geometry.Rect rect, float startAngle, float sweepAngle, boolean useCenter, androidx.ui.graphics.Paint paint);
+ method public default void drawArc(androidx.ui.geometry.Rect rect, float startAngle, float sweepAngle, boolean useCenter, androidx.ui.graphics.Paint paint);
+ method public void drawArc(float left, float top, float right, float bottom, float startAngle, float sweepAngle, boolean useCenter, androidx.ui.graphics.Paint paint);
method public default void drawArcRad(androidx.ui.geometry.Rect rect, float startAngleRad, float sweepAngleRad, boolean useCenter, androidx.ui.graphics.Paint paint);
- method public void drawCircle(androidx.ui.geometry.Offset center, float radius, androidx.ui.graphics.Paint paint);
- method public void drawImage(androidx.ui.graphics.ImageAsset image, androidx.ui.geometry.Offset topLeftOffset, androidx.ui.graphics.Paint paint);
- method public void drawImageRect(androidx.ui.graphics.ImageAsset image, androidx.ui.geometry.Rect? src, androidx.ui.geometry.Rect dst, androidx.ui.graphics.Paint paint);
- method public void drawLine(androidx.ui.geometry.Offset p1, androidx.ui.geometry.Offset p2, androidx.ui.graphics.Paint paint);
- method public void drawOval(androidx.ui.geometry.Rect rect, androidx.ui.graphics.Paint paint);
+ method public void drawCircle-NfwrgZA(long center, float radius, androidx.ui.graphics.Paint paint);
+ method public void drawImage--AHD2Ng(androidx.ui.graphics.ImageAsset image, long topLeftOffset, androidx.ui.graphics.Paint paint);
+ method public void drawImageRect-btuv3no(androidx.ui.graphics.ImageAsset image, long srcOffset = Offset.zero, long srcSize = Size(image.width.toFloat(), image.height.toFloat()), long dstOffset, long dstSize, androidx.ui.graphics.Paint paint);
+ method public void drawLine-d9kBv1M(long p1, long p2, androidx.ui.graphics.Paint paint);
+ method public default void drawOval(androidx.ui.geometry.Rect rect, androidx.ui.graphics.Paint paint);
+ method public void drawOval(float left, float top, float right, float bottom, androidx.ui.graphics.Paint paint);
method public void drawPath(androidx.ui.graphics.Path path, androidx.ui.graphics.Paint paint);
method public void drawPicture(androidx.ui.graphics.Picture picture);
method public void drawPoints(androidx.ui.graphics.PointMode pointMode, java.util.List<androidx.ui.geometry.Offset> points, androidx.ui.graphics.Paint paint);
method public void drawRawPoints(androidx.ui.graphics.PointMode pointMode, float[] points, androidx.ui.graphics.Paint paint);
- method public void drawRect(androidx.ui.geometry.Rect rect, androidx.ui.graphics.Paint paint);
+ method public default void drawRect(androidx.ui.geometry.Rect rect, androidx.ui.graphics.Paint paint);
+ method public void drawRect(float left, float top, float right, float bottom, androidx.ui.graphics.Paint paint);
method public void drawRoundRect(float left, float top, float right, float bottom, float radiusX, float radiusY, androidx.ui.graphics.Paint paint);
method public void drawVertices(androidx.ui.graphics.Vertices vertices, androidx.ui.graphics.BlendMode blendMode, androidx.ui.graphics.Paint paint);
method public void enableZ();
@@ -161,7 +164,7 @@
method public static long constructor-impl(long value);
method public static long convert-impl(long $this, androidx.ui.graphics.colorspace.ColorSpace colorSpace);
method public static long copy-impl(long $this, float alpha = this.alpha, float red = this.red, float green = this.green, float blue = this.blue);
- method public static boolean equals-impl(long p, Object? p1);
+ method public static inline boolean equals-impl(long p, Object? p1);
method public static boolean equals-impl0(long p1, long p2);
method public static float getAlpha-impl(long $this);
method public static float getBlue-impl(long $this);
@@ -169,7 +172,7 @@
method public static float getGreen-impl(long $this);
method public static float getRed-impl(long $this);
method public long getValue();
- method public static int hashCode-impl(long p);
+ method public static inline int hashCode-impl(long p);
method public static String toString-impl(long $this);
field public static final androidx.ui.graphics.Color.Companion! Companion;
}
@@ -297,7 +300,9 @@
public final class OutlineKt {
method public static void addOutline(androidx.ui.graphics.Path, androidx.ui.graphics.Outline outline);
+ method public static void drawOutline(androidx.ui.graphics.painter.CanvasScope, androidx.ui.graphics.Outline outline, androidx.ui.graphics.Brush brush, @FloatRange(from=0.0, to=1.0) float alpha = 1.0f, androidx.ui.graphics.painter.DrawStyle style = Fill, androidx.ui.graphics.ColorFilter? colorFilter = null, androidx.ui.graphics.BlendMode blendMode = CanvasScope.DefaultBlendMode);
method public static void drawOutline(androidx.ui.graphics.Canvas, androidx.ui.graphics.Outline outline, androidx.ui.graphics.Paint paint);
+ method public static void drawOutline-GAv4Q-k(androidx.ui.graphics.painter.CanvasScope, androidx.ui.graphics.Outline outline, long color, @FloatRange(from=0.0, to=1.0) float alpha = 1.0f, androidx.ui.graphics.painter.DrawStyle style = Fill, androidx.ui.graphics.ColorFilter? colorFilter = null, androidx.ui.graphics.BlendMode blendMode = CanvasScope.DefaultBlendMode);
}
public final class Paint {
@@ -354,7 +359,7 @@
method public void addArc(androidx.ui.geometry.Rect oval, float startAngleDegrees, float sweepAngleDegrees);
method public void addArcRad(androidx.ui.geometry.Rect oval, float startAngleRadians, float sweepAngleRadians);
method public void addOval(androidx.ui.geometry.Rect oval);
- method public void addPath(androidx.ui.graphics.Path path, androidx.ui.geometry.Offset offset = Offset.zero);
+ method public void addPath-m3TnucA(androidx.ui.graphics.Path path, long offset = Offset.zero);
method public void addRRect(androidx.ui.geometry.RRect rrect);
method public void addRect(androidx.ui.geometry.Rect rect);
method public void arcTo(androidx.ui.geometry.Rect rect, float startAngleDegrees, float sweepAngleDegrees, boolean forceMoveTo);
@@ -375,7 +380,7 @@
method public void relativeQuadraticBezierTo(float x1, float y1, float x2, float y2);
method public void reset();
method public void setFillType(androidx.ui.graphics.PathFillType p);
- method public void shift(androidx.ui.geometry.Offset offset);
+ method public void shift-RIqb49o(long offset);
property public abstract androidx.ui.graphics.PathFillType fillType;
property public abstract boolean isConvex;
property public abstract boolean isEmpty;
@@ -440,32 +445,32 @@
public final inline class Shader {
ctor public Shader();
method public static android.graphics.Shader! constructor-impl(android.graphics.Shader nativeShader);
- method public static boolean equals-impl(android.graphics.Shader! p, Object? p1);
+ method public static inline boolean equals-impl(android.graphics.Shader! p, Object? p1);
method public static boolean equals-impl0(android.graphics.Shader p1, android.graphics.Shader p2);
method public android.graphics.Shader getNativeShader();
- method public static int hashCode-impl(android.graphics.Shader! p);
- method public static String toString-impl(android.graphics.Shader! p);
+ method public static inline int hashCode-impl(android.graphics.Shader! p);
+ method public static inline String! toString-impl(android.graphics.Shader! p);
}
- public class ShaderBrush implements androidx.ui.graphics.Brush {
- method public void applyTo(androidx.ui.graphics.Paint p);
+ public class ShaderBrush extends androidx.ui.graphics.Brush {
+ method public final void applyTo(androidx.ui.graphics.Paint p);
method public final android.graphics.Shader getShader();
}
public final class ShaderKt {
method public static android.graphics.Shader ImageShader(androidx.ui.graphics.ImageAsset image, androidx.ui.graphics.TileMode tileModeX = androidx.ui.graphics.TileMode.Clamp, androidx.ui.graphics.TileMode tileModeY = androidx.ui.graphics.TileMode.Clamp);
- method public static android.graphics.Shader LinearGradientShader(androidx.ui.geometry.Offset from, androidx.ui.geometry.Offset to, java.util.List<androidx.ui.graphics.Color> colors, java.util.List<java.lang.Float>? colorStops = null, androidx.ui.graphics.TileMode tileMode = androidx.ui.graphics.TileMode.Clamp);
- method public static android.graphics.Shader RadialGradientShader(androidx.ui.geometry.Offset center, float radius, java.util.List<androidx.ui.graphics.Color> colors, java.util.List<java.lang.Float>? colorStops = null, androidx.ui.graphics.TileMode tileMode = androidx.ui.graphics.TileMode.Clamp);
+ method public static android.graphics.Shader LinearGradientShader-BG1VTC8(long from, long to, java.util.List<androidx.ui.graphics.Color> colors, java.util.List<java.lang.Float>? colorStops = null, androidx.ui.graphics.TileMode tileMode = androidx.ui.graphics.TileMode.Clamp);
+ method public static android.graphics.Shader RadialGradientShader-nSjqbmE(long center, float radius, java.util.List<androidx.ui.graphics.Color> colors, java.util.List<java.lang.Float>? colorStops = null, androidx.ui.graphics.TileMode tileMode = androidx.ui.graphics.TileMode.Clamp);
}
public final class Shadow {
method public long component1();
- method public androidx.ui.geometry.Offset component2();
+ method public long component2();
method public float component3();
- method public androidx.ui.graphics.Shadow copy-1LPazZ4(long color, androidx.ui.geometry.Offset offset, float blurRadius);
+ method public androidx.ui.graphics.Shadow copy-1LPazZ4(long color, long offset, float blurRadius);
method public float getBlurRadius();
method public long getColor();
- method public androidx.ui.geometry.Offset getOffset();
+ method public long getOffset();
field public static final androidx.ui.graphics.Shadow.Companion! Companion;
}
@@ -482,10 +487,8 @@
method public androidx.ui.graphics.Outline createOutline(androidx.ui.unit.PxSize size, androidx.ui.unit.Density density);
}
- public final class SolidColor implements androidx.ui.graphics.Brush {
+ public final class SolidColor extends androidx.ui.graphics.Brush {
method public void applyTo(androidx.ui.graphics.Paint p);
- method public long component1();
- method public androidx.ui.graphics.SolidColor copy-QEYXlZo(long value);
method public long getValue();
}
@@ -715,39 +718,102 @@
package androidx.ui.graphics.painter {
+ public final class CanvasScope {
+ ctor public CanvasScope();
+ method public void draw(androidx.ui.graphics.Canvas canvas, androidx.ui.unit.PxSize size, kotlin.jvm.functions.Function1<? super androidx.ui.graphics.painter.CanvasScope,kotlin.Unit> block);
+ method public kotlin.Unit? drawArc-_aGsT6c(androidx.ui.graphics.Brush brush, float startAngle, float sweepAngle, boolean useCenter, long topLeft = Offset.zero, long size = this.size, @FloatRange(from=0.0, to=1.0) float alpha = 1.0f, androidx.ui.graphics.painter.DrawStyle style = Fill, androidx.ui.graphics.ColorFilter? colorFilter = null, androidx.ui.graphics.BlendMode blendMode = DefaultBlendMode);
+ method public kotlin.Unit? drawArc-eUb3Eo4(long color, float startAngle, float sweepAngle, boolean useCenter, long topLeft = Offset.zero, long size = this.size, @FloatRange(from=0.0, to=1.0) float alpha = 1.0f, androidx.ui.graphics.painter.DrawStyle style = Fill, androidx.ui.graphics.ColorFilter? colorFilter = null, androidx.ui.graphics.BlendMode blendMode = DefaultBlendMode);
+ method public kotlin.Unit? drawCircle-0EImeI8(long color, float radius = size.minDimension / 2.0, long center = this.center, @FloatRange(from=0.0, to=1.0) float alpha = 1.0f, androidx.ui.graphics.painter.DrawStyle style = Fill, androidx.ui.graphics.ColorFilter? colorFilter = null, androidx.ui.graphics.BlendMode blendMode = DefaultBlendMode);
+ method public kotlin.Unit? drawCircle-uHGJFV8(androidx.ui.graphics.Brush brush, float radius = size.minDimension / 2.0, long center = this.center, @FloatRange(from=0.0, to=1.0) float alpha = 1.0f, androidx.ui.graphics.painter.DrawStyle style = Fill, androidx.ui.graphics.ColorFilter? colorFilter = null, androidx.ui.graphics.BlendMode blendMode = DefaultBlendMode);
+ method public kotlin.Unit? drawImage-IF_VeeU(androidx.ui.graphics.ImageAsset image, long srcOffset = Offset.zero, long srcSize = Size(image.width.toFloat(), image.height.toFloat()), long dstOffset = Offset.zero, long dstSize = this.size, @FloatRange(from=0.0, to=1.0) float alpha = 1.0f, androidx.ui.graphics.painter.DrawStyle style = Fill, androidx.ui.graphics.ColorFilter? colorFilter = null, androidx.ui.graphics.BlendMode blendMode = DefaultBlendMode);
+ method public kotlin.Unit? drawImage-zcoU2q0(androidx.ui.graphics.ImageAsset image, long topLeft = Offset.zero, @FloatRange(from=0.0, to=1.0) float alpha = 1.0f, androidx.ui.graphics.painter.DrawStyle style = Fill, androidx.ui.graphics.ColorFilter? colorFilter = null, androidx.ui.graphics.BlendMode blendMode = DefaultBlendMode);
+ method public kotlin.Unit? drawLine-MfDnFlo(long color, long p1, long p2, androidx.ui.graphics.painter.Stroke stroke, @FloatRange(from=0.0, to=1.0) float alpha = 1.0f, androidx.ui.graphics.ColorFilter? colorFilter = null, androidx.ui.graphics.BlendMode blendMode = DefaultBlendMode);
+ method public kotlin.Unit? drawLine-PWBr8KI(androidx.ui.graphics.Brush brush, long p1, long p2, androidx.ui.graphics.painter.Stroke stroke, @FloatRange(from=0.0, to=1.0) float alpha = 1.0f, androidx.ui.graphics.ColorFilter? colorFilter = null, androidx.ui.graphics.BlendMode blendMode = DefaultBlendMode);
+ method public kotlin.Unit? drawOval-EPCrxCw(long color, long topLeft = Offset.zero, long size = this.size, @FloatRange(from=0.0, to=1.0) float alpha = 1.0f, androidx.ui.graphics.painter.DrawStyle style = Fill, androidx.ui.graphics.ColorFilter? colorFilter = null, androidx.ui.graphics.BlendMode blendMode = DefaultBlendMode);
+ method public kotlin.Unit? drawOval-cuGMcK0(androidx.ui.graphics.Brush brush, long topLeft = Offset.zero, long size = this.size, @FloatRange(from=0.0, to=1.0) float alpha = 1.0f, androidx.ui.graphics.painter.DrawStyle style = Fill, androidx.ui.graphics.ColorFilter? colorFilter = null, androidx.ui.graphics.BlendMode blendMode = DefaultBlendMode);
+ method public kotlin.Unit? drawPath(androidx.ui.graphics.Path path, androidx.ui.graphics.Brush brush, @FloatRange(from=0.0, to=1.0) float alpha = 1.0f, androidx.ui.graphics.painter.DrawStyle style = Fill, androidx.ui.graphics.ColorFilter? colorFilter = null, androidx.ui.graphics.BlendMode blendMode = DefaultBlendMode);
+ method public kotlin.Unit? drawPath-ZizoN6c(androidx.ui.graphics.Path path, long color, @FloatRange(from=0.0, to=1.0) float alpha = 1.0f, androidx.ui.graphics.painter.DrawStyle style = Fill, androidx.ui.graphics.ColorFilter? colorFilter = null, androidx.ui.graphics.BlendMode blendMode = DefaultBlendMode);
+ method public kotlin.Unit? drawPoints(java.util.List<androidx.ui.geometry.Offset> points, androidx.ui.graphics.PointMode pointMode, androidx.ui.graphics.Brush brush, @FloatRange(from=0.0, to=1.0) float alpha = 1.0f, androidx.ui.graphics.painter.DrawStyle style = Fill, androidx.ui.graphics.ColorFilter? colorFilter = null, androidx.ui.graphics.BlendMode blendMode = DefaultBlendMode);
+ method public kotlin.Unit? drawPoints-yiE_nf0(java.util.List<androidx.ui.geometry.Offset> points, androidx.ui.graphics.PointMode pointMode, long color, androidx.ui.graphics.painter.Stroke stroke, @FloatRange(from=0.0, to=1.0) float alpha = 1.0f, androidx.ui.graphics.ColorFilter? colorFilter = null, androidx.ui.graphics.BlendMode blendMode = DefaultBlendMode);
+ method public kotlin.Unit? drawRect-EPCrxCw(long color, long topLeft = Offset.zero, long size = this.size, @FloatRange(from=0.0, to=1.0) float alpha = 1.0f, androidx.ui.graphics.painter.DrawStyle style = Fill, androidx.ui.graphics.ColorFilter? colorFilter = null, androidx.ui.graphics.BlendMode blendMode = DefaultBlendMode);
+ method public kotlin.Unit? drawRect-cuGMcK0(androidx.ui.graphics.Brush brush, long topLeft = Offset.zero, long size = this.size, @FloatRange(from=0.0, to=1.0) float alpha = 1.0f, androidx.ui.graphics.painter.DrawStyle style = Fill, androidx.ui.graphics.ColorFilter? colorFilter = null, androidx.ui.graphics.BlendMode blendMode = DefaultBlendMode);
+ method public kotlin.Unit? drawRoundRect-5PTu5W0(androidx.ui.graphics.Brush brush, long topLeft = Offset.zero, long size = this.size, float radiusX = 0.0f, float radiusY = radiusX, @FloatRange(from=0.0, to=1.0) float alpha = 1.0f, androidx.ui.graphics.painter.DrawStyle style = Fill, androidx.ui.graphics.ColorFilter? colorFilter = null, androidx.ui.graphics.BlendMode blendMode = DefaultBlendMode);
+ method public kotlin.Unit? drawRoundRect-A8SqK14(long color, long topLeft = Offset.zero, long size = this.size, float radiusX = 0.0f, float radiusY = 0.0f, androidx.ui.graphics.painter.DrawStyle style = Fill, @FloatRange(from=0.0, to=1.0) float alpha = 1.0f, androidx.ui.graphics.ColorFilter? colorFilter = null, androidx.ui.graphics.BlendMode blendMode = DefaultBlendMode);
+ method public long getCenter();
+ method public long getSize();
+ property public final long center;
+ property public final long size;
+ field public static final androidx.ui.graphics.painter.CanvasScope.Companion! Companion;
+ field public static final float DefaultAlpha = 1.0f;
+ }
+
+ public static final class CanvasScope.Companion {
+ method public androidx.ui.graphics.BlendMode getDefaultBlendMode();
+ property public final androidx.ui.graphics.BlendMode DefaultBlendMode;
+ }
+
+ public final class CanvasScopeKt {
+ method public static inline androidx.ui.graphics.Canvas? clipPath(androidx.ui.graphics.painter.CanvasScope, androidx.ui.graphics.Path path, kotlin.jvm.functions.Function1<? super androidx.ui.graphics.painter.CanvasScope,kotlin.Unit> block);
+ method public static inline androidx.ui.graphics.Canvas? clipRect-2CUYwUY(androidx.ui.graphics.painter.CanvasScope, long topLeft = Offset.zero, long size = this.size, androidx.ui.graphics.ClipOp clipOp = androidx.ui.graphics.ClipOp.intersect, kotlin.jvm.functions.Function1<? super androidx.ui.graphics.painter.CanvasScope,kotlin.Unit> block);
+ method public static inline kotlin.Unit? drawCanvas(androidx.ui.graphics.painter.CanvasScope, kotlin.jvm.functions.Function2<? super androidx.ui.graphics.Canvas,? super androidx.ui.unit.PxSize,kotlin.Unit> block);
+ method public static inline void inset(androidx.ui.graphics.painter.CanvasScope, float left, float top, float right, float bottom, kotlin.jvm.functions.Function1<? super androidx.ui.graphics.painter.CanvasScope,kotlin.Unit> block);
+ method public static inline void inset(androidx.ui.graphics.painter.CanvasScope, float dx, float dy = dx, kotlin.jvm.functions.Function1<? super androidx.ui.graphics.painter.CanvasScope,kotlin.Unit> block);
+ method public static inline androidx.ui.graphics.Canvas? rotate(androidx.ui.graphics.painter.CanvasScope, float degrees, float pivotX = center.dx, float pivotY = center.dy, kotlin.jvm.functions.Function1<? super androidx.ui.graphics.painter.CanvasScope,kotlin.Unit> block);
+ method public static inline androidx.ui.graphics.Canvas? rotateRad(androidx.ui.graphics.painter.CanvasScope, float radians, float pivotX = center.dx, float pivotY = center.dy, kotlin.jvm.functions.Function1<? super androidx.ui.graphics.painter.CanvasScope,kotlin.Unit> block);
+ method public static inline androidx.ui.graphics.Canvas? scale(androidx.ui.graphics.painter.CanvasScope, float scaleX, float scaleY, float pivotX = center.dx, float pivotY = center.dy, kotlin.jvm.functions.Function1<? super androidx.ui.graphics.painter.CanvasScope,kotlin.Unit> block);
+ method public static inline androidx.ui.graphics.Canvas? translate(androidx.ui.graphics.painter.CanvasScope, float dx, float dy, kotlin.jvm.functions.Function1<? super androidx.ui.graphics.painter.CanvasScope,kotlin.Unit> block);
+ }
+
public final class ColorPainter extends androidx.ui.graphics.painter.Painter {
method public long component1();
method public androidx.ui.graphics.painter.ColorPainter copy-QEYXlZo(long color);
method public long getColor();
method public androidx.ui.unit.PxSize getIntrinsicSize();
- method protected void onDraw(androidx.ui.graphics.Canvas canvas, androidx.ui.unit.PxSize bounds);
+ method protected void onDraw(androidx.ui.graphics.painter.CanvasScope);
property public androidx.ui.unit.PxSize intrinsicSize;
}
+ public abstract sealed class DrawStyle {
+ }
+
+ public final class Fill extends androidx.ui.graphics.painter.DrawStyle {
+ field public static final androidx.ui.graphics.painter.Fill! INSTANCE;
+ }
+
public final class ImagePainter extends androidx.ui.graphics.painter.Painter {
- ctor public ImagePainter(androidx.ui.graphics.ImageAsset image, androidx.ui.geometry.Rect? srcBounds);
- method public androidx.ui.geometry.Rect? component2();
- method public androidx.ui.graphics.painter.ImagePainter copy(androidx.ui.graphics.ImageAsset image, androidx.ui.geometry.Rect? srcBounds);
+ method public androidx.ui.graphics.painter.ImagePainter copy-gqgapXI(androidx.ui.graphics.ImageAsset image, long srcOffset, long srcSize);
method public androidx.ui.unit.PxSize getIntrinsicSize();
- method public androidx.ui.geometry.Rect? getSrcBounds();
- method protected void onDraw(androidx.ui.graphics.Canvas canvas, androidx.ui.unit.PxSize bounds);
+ method protected void onDraw(androidx.ui.graphics.painter.CanvasScope);
property public androidx.ui.unit.PxSize intrinsicSize;
}
- public final class ImagePainterKt {
- }
-
public abstract class Painter {
ctor public Painter();
method protected boolean applyAlpha(float alpha);
method protected boolean applyColorFilter(androidx.ui.graphics.ColorFilter? colorFilter);
method protected boolean applyRtl(boolean rtl);
- method public final void draw(androidx.ui.graphics.Canvas canvas, androidx.ui.unit.PxSize bounds, float alpha = 1.0f, androidx.ui.graphics.ColorFilter? colorFilter = null, boolean rtl = false);
+ method public final void draw(androidx.ui.graphics.Canvas canvas, androidx.ui.unit.PxSize size, float alpha = 1.0f, androidx.ui.graphics.ColorFilter? colorFilter = null, boolean rtl = false);
method public abstract androidx.ui.unit.PxSize getIntrinsicSize();
- method protected abstract void onDraw(androidx.ui.graphics.Canvas canvas, androidx.ui.unit.PxSize bounds);
+ method protected abstract void onDraw(androidx.ui.graphics.painter.CanvasScope);
property public abstract androidx.ui.unit.PxSize intrinsicSize;
}
+ public final class Stroke extends androidx.ui.graphics.painter.DrawStyle {
+ ctor public Stroke(float width, float miter, androidx.ui.graphics.StrokeCap cap, androidx.ui.graphics.StrokeJoin join, android.graphics.PathEffect? pathEffect);
+ ctor public Stroke();
+ method public float component1();
+ method public float component2();
+ method public androidx.ui.graphics.StrokeCap component3();
+ method public androidx.ui.graphics.StrokeJoin component4();
+ method public android.graphics.PathEffect? component5();
+ method public androidx.ui.graphics.painter.Stroke copy(float width, float miter, androidx.ui.graphics.StrokeCap cap, androidx.ui.graphics.StrokeJoin join, android.graphics.PathEffect? pathEffect);
+ method public androidx.ui.graphics.StrokeCap getCap();
+ method public androidx.ui.graphics.StrokeJoin getJoin();
+ method public float getMiter();
+ method public android.graphics.PathEffect? getPathEffect();
+ method public float getWidth();
+ }
+
}
package androidx.ui.graphics.vector {
@@ -1144,7 +1210,7 @@
method public static androidx.ui.geometry.Rect inverseTransformRect(androidx.ui.graphics.vectormath.Matrix4 transform, androidx.ui.geometry.Rect rect);
method public static boolean isIdentity(androidx.ui.graphics.vectormath.Matrix4);
method public static boolean matrixEquals(androidx.ui.graphics.vectormath.Matrix4? a, androidx.ui.graphics.vectormath.Matrix4? b);
- method public static androidx.ui.geometry.Offset transformPoint(androidx.ui.graphics.vectormath.Matrix4, androidx.ui.geometry.Offset point);
+ method public static long transformPoint-k2M_ft0(androidx.ui.graphics.vectormath.Matrix4, long point);
method public static androidx.ui.geometry.Rect transformRect(androidx.ui.graphics.vectormath.Matrix4, androidx.ui.geometry.Rect rect);
}
diff --git a/ui/ui-graphics/api/restricted_0.1.0-dev11.txt b/ui/ui-graphics/api/restricted_0.1.0-dev11.txt
index a4896944..8b672ec 100644
--- a/ui/ui-graphics/api/restricted_0.1.0-dev11.txt
+++ b/ui/ui-graphics/api/restricted_0.1.0-dev11.txt
@@ -29,7 +29,7 @@
method public void addArc(androidx.ui.geometry.Rect oval, float startAngleDegrees, float sweepAngleDegrees);
method public void addArcRad(androidx.ui.geometry.Rect oval, float startAngleRadians, float sweepAngleRadians);
method public void addOval(androidx.ui.geometry.Rect oval);
- method public void addPath(androidx.ui.graphics.Path path, androidx.ui.geometry.Offset offset);
+ method public void addPath-m3TnucA(androidx.ui.graphics.Path path, long offset);
method public void addRRect(androidx.ui.geometry.RRect rrect);
method public void addRect(androidx.ui.geometry.Rect rect);
method public void arcTo(androidx.ui.geometry.Rect rect, float startAngleDegrees, float sweepAngleDegrees, boolean forceMoveTo);
@@ -50,7 +50,7 @@
method public void relativeQuadraticBezierTo(float x1, float y1, float x2, float y2);
method public void reset();
method public void setFillType(androidx.ui.graphics.PathFillType value);
- method public void shift(androidx.ui.geometry.Offset offset);
+ method public void shift-RIqb49o(long offset);
property public androidx.ui.graphics.PathFillType fillType;
property public boolean isConvex;
property public boolean isEmpty;
@@ -95,8 +95,8 @@
enum_constant public static final androidx.ui.graphics.BlendMode xor;
}
- public interface Brush {
- method public void applyTo(androidx.ui.graphics.Paint p);
+ public abstract sealed class Brush {
+ method public abstract void applyTo(androidx.ui.graphics.Paint p);
}
public final class BrushKt {
@@ -112,22 +112,25 @@
public interface Canvas {
method public void clipPath(androidx.ui.graphics.Path path);
- method public void clipRRect(androidx.ui.geometry.RRect rrect);
- method public void clipRect(androidx.ui.geometry.Rect rect, androidx.ui.graphics.ClipOp clipOp = androidx.ui.graphics.ClipOp.intersect);
+ method public default void clipRect(androidx.ui.geometry.Rect rect, androidx.ui.graphics.ClipOp clipOp = androidx.ui.graphics.ClipOp.intersect);
+ method public void clipRect(float left, float top, float right, float bottom, androidx.ui.graphics.ClipOp clipOp = androidx.ui.graphics.ClipOp.intersect);
method public void concat(androidx.ui.graphics.vectormath.Matrix4 matrix4);
method public void disableZ();
- method public void drawArc(androidx.ui.geometry.Rect rect, float startAngle, float sweepAngle, boolean useCenter, androidx.ui.graphics.Paint paint);
+ method public default void drawArc(androidx.ui.geometry.Rect rect, float startAngle, float sweepAngle, boolean useCenter, androidx.ui.graphics.Paint paint);
+ method public void drawArc(float left, float top, float right, float bottom, float startAngle, float sweepAngle, boolean useCenter, androidx.ui.graphics.Paint paint);
method public default void drawArcRad(androidx.ui.geometry.Rect rect, float startAngleRad, float sweepAngleRad, boolean useCenter, androidx.ui.graphics.Paint paint);
- method public void drawCircle(androidx.ui.geometry.Offset center, float radius, androidx.ui.graphics.Paint paint);
- method public void drawImage(androidx.ui.graphics.ImageAsset image, androidx.ui.geometry.Offset topLeftOffset, androidx.ui.graphics.Paint paint);
- method public void drawImageRect(androidx.ui.graphics.ImageAsset image, androidx.ui.geometry.Rect? src, androidx.ui.geometry.Rect dst, androidx.ui.graphics.Paint paint);
- method public void drawLine(androidx.ui.geometry.Offset p1, androidx.ui.geometry.Offset p2, androidx.ui.graphics.Paint paint);
- method public void drawOval(androidx.ui.geometry.Rect rect, androidx.ui.graphics.Paint paint);
+ method public void drawCircle-NfwrgZA(long center, float radius, androidx.ui.graphics.Paint paint);
+ method public void drawImage--AHD2Ng(androidx.ui.graphics.ImageAsset image, long topLeftOffset, androidx.ui.graphics.Paint paint);
+ method public void drawImageRect-btuv3no(androidx.ui.graphics.ImageAsset image, long srcOffset = Offset.zero, long srcSize = Size(image.width.toFloat(), image.height.toFloat()), long dstOffset, long dstSize, androidx.ui.graphics.Paint paint);
+ method public void drawLine-d9kBv1M(long p1, long p2, androidx.ui.graphics.Paint paint);
+ method public default void drawOval(androidx.ui.geometry.Rect rect, androidx.ui.graphics.Paint paint);
+ method public void drawOval(float left, float top, float right, float bottom, androidx.ui.graphics.Paint paint);
method public void drawPath(androidx.ui.graphics.Path path, androidx.ui.graphics.Paint paint);
method public void drawPicture(androidx.ui.graphics.Picture picture);
method public void drawPoints(androidx.ui.graphics.PointMode pointMode, java.util.List<androidx.ui.geometry.Offset> points, androidx.ui.graphics.Paint paint);
method public void drawRawPoints(androidx.ui.graphics.PointMode pointMode, float[] points, androidx.ui.graphics.Paint paint);
- method public void drawRect(androidx.ui.geometry.Rect rect, androidx.ui.graphics.Paint paint);
+ method public default void drawRect(androidx.ui.geometry.Rect rect, androidx.ui.graphics.Paint paint);
+ method public void drawRect(float left, float top, float right, float bottom, androidx.ui.graphics.Paint paint);
method public void drawRoundRect(float left, float top, float right, float bottom, float radiusX, float radiusY, androidx.ui.graphics.Paint paint);
method public void drawVertices(androidx.ui.graphics.Vertices vertices, androidx.ui.graphics.BlendMode blendMode, androidx.ui.graphics.Paint paint);
method public void enableZ();
@@ -161,7 +164,7 @@
method public static long constructor-impl(long value);
method public static long convert-impl(long $this, androidx.ui.graphics.colorspace.ColorSpace colorSpace);
method public static long copy-impl(long $this, float alpha = this.alpha, float red = this.red, float green = this.green, float blue = this.blue);
- method public static boolean equals-impl(long p, Object? p1);
+ method public static inline boolean equals-impl(long p, Object? p1);
method public static boolean equals-impl0(long p1, long p2);
method public static float getAlpha-impl(long $this);
method public static float getBlue-impl(long $this);
@@ -169,7 +172,7 @@
method public static float getGreen-impl(long $this);
method public static float getRed-impl(long $this);
method public long getValue();
- method public static int hashCode-impl(long p);
+ method public static inline int hashCode-impl(long p);
method public static String toString-impl(long $this);
field public static final androidx.ui.graphics.Color.Companion! Companion;
}
@@ -297,7 +300,9 @@
public final class OutlineKt {
method public static void addOutline(androidx.ui.graphics.Path, androidx.ui.graphics.Outline outline);
+ method public static void drawOutline(androidx.ui.graphics.painter.CanvasScope, androidx.ui.graphics.Outline outline, androidx.ui.graphics.Brush brush, @FloatRange(from=0.0, to=1.0) float alpha = 1.0f, androidx.ui.graphics.painter.DrawStyle style = Fill, androidx.ui.graphics.ColorFilter? colorFilter = null, androidx.ui.graphics.BlendMode blendMode = CanvasScope.DefaultBlendMode);
method public static void drawOutline(androidx.ui.graphics.Canvas, androidx.ui.graphics.Outline outline, androidx.ui.graphics.Paint paint);
+ method public static void drawOutline-GAv4Q-k(androidx.ui.graphics.painter.CanvasScope, androidx.ui.graphics.Outline outline, long color, @FloatRange(from=0.0, to=1.0) float alpha = 1.0f, androidx.ui.graphics.painter.DrawStyle style = Fill, androidx.ui.graphics.ColorFilter? colorFilter = null, androidx.ui.graphics.BlendMode blendMode = CanvasScope.DefaultBlendMode);
}
public final class Paint {
@@ -354,7 +359,7 @@
method public void addArc(androidx.ui.geometry.Rect oval, float startAngleDegrees, float sweepAngleDegrees);
method public void addArcRad(androidx.ui.geometry.Rect oval, float startAngleRadians, float sweepAngleRadians);
method public void addOval(androidx.ui.geometry.Rect oval);
- method public void addPath(androidx.ui.graphics.Path path, androidx.ui.geometry.Offset offset = Offset.zero);
+ method public void addPath-m3TnucA(androidx.ui.graphics.Path path, long offset = Offset.zero);
method public void addRRect(androidx.ui.geometry.RRect rrect);
method public void addRect(androidx.ui.geometry.Rect rect);
method public void arcTo(androidx.ui.geometry.Rect rect, float startAngleDegrees, float sweepAngleDegrees, boolean forceMoveTo);
@@ -375,7 +380,7 @@
method public void relativeQuadraticBezierTo(float x1, float y1, float x2, float y2);
method public void reset();
method public void setFillType(androidx.ui.graphics.PathFillType p);
- method public void shift(androidx.ui.geometry.Offset offset);
+ method public void shift-RIqb49o(long offset);
property public abstract androidx.ui.graphics.PathFillType fillType;
property public abstract boolean isConvex;
property public abstract boolean isEmpty;
@@ -440,32 +445,32 @@
public final inline class Shader {
ctor public Shader();
method public static android.graphics.Shader! constructor-impl(android.graphics.Shader nativeShader);
- method public static boolean equals-impl(android.graphics.Shader! p, Object? p1);
+ method public static inline boolean equals-impl(android.graphics.Shader! p, Object? p1);
method public static boolean equals-impl0(android.graphics.Shader p1, android.graphics.Shader p2);
method public android.graphics.Shader getNativeShader();
- method public static int hashCode-impl(android.graphics.Shader! p);
- method public static String toString-impl(android.graphics.Shader! p);
+ method public static inline int hashCode-impl(android.graphics.Shader! p);
+ method public static inline String! toString-impl(android.graphics.Shader! p);
}
- public class ShaderBrush implements androidx.ui.graphics.Brush {
- method public void applyTo(androidx.ui.graphics.Paint p);
+ public class ShaderBrush extends androidx.ui.graphics.Brush {
+ method public final void applyTo(androidx.ui.graphics.Paint p);
method public final android.graphics.Shader getShader();
}
public final class ShaderKt {
method public static android.graphics.Shader ImageShader(androidx.ui.graphics.ImageAsset image, androidx.ui.graphics.TileMode tileModeX = androidx.ui.graphics.TileMode.Clamp, androidx.ui.graphics.TileMode tileModeY = androidx.ui.graphics.TileMode.Clamp);
- method public static android.graphics.Shader LinearGradientShader(androidx.ui.geometry.Offset from, androidx.ui.geometry.Offset to, java.util.List<androidx.ui.graphics.Color> colors, java.util.List<java.lang.Float>? colorStops = null, androidx.ui.graphics.TileMode tileMode = androidx.ui.graphics.TileMode.Clamp);
- method public static android.graphics.Shader RadialGradientShader(androidx.ui.geometry.Offset center, float radius, java.util.List<androidx.ui.graphics.Color> colors, java.util.List<java.lang.Float>? colorStops = null, androidx.ui.graphics.TileMode tileMode = androidx.ui.graphics.TileMode.Clamp);
+ method public static android.graphics.Shader LinearGradientShader-BG1VTC8(long from, long to, java.util.List<androidx.ui.graphics.Color> colors, java.util.List<java.lang.Float>? colorStops = null, androidx.ui.graphics.TileMode tileMode = androidx.ui.graphics.TileMode.Clamp);
+ method public static android.graphics.Shader RadialGradientShader-nSjqbmE(long center, float radius, java.util.List<androidx.ui.graphics.Color> colors, java.util.List<java.lang.Float>? colorStops = null, androidx.ui.graphics.TileMode tileMode = androidx.ui.graphics.TileMode.Clamp);
}
public final class Shadow {
method public long component1();
- method public androidx.ui.geometry.Offset component2();
+ method public long component2();
method public float component3();
- method public androidx.ui.graphics.Shadow copy-1LPazZ4(long color, androidx.ui.geometry.Offset offset, float blurRadius);
+ method public androidx.ui.graphics.Shadow copy-1LPazZ4(long color, long offset, float blurRadius);
method public float getBlurRadius();
method public long getColor();
- method public androidx.ui.geometry.Offset getOffset();
+ method public long getOffset();
field public static final androidx.ui.graphics.Shadow.Companion! Companion;
}
@@ -482,10 +487,8 @@
method public androidx.ui.graphics.Outline createOutline(androidx.ui.unit.PxSize size, androidx.ui.unit.Density density);
}
- public final class SolidColor implements androidx.ui.graphics.Brush {
+ public final class SolidColor extends androidx.ui.graphics.Brush {
method public void applyTo(androidx.ui.graphics.Paint p);
- method public long component1();
- method public androidx.ui.graphics.SolidColor copy-QEYXlZo(long value);
method public long getValue();
}
@@ -715,39 +718,102 @@
package androidx.ui.graphics.painter {
+ public final class CanvasScope {
+ ctor public CanvasScope();
+ method public void draw(androidx.ui.graphics.Canvas canvas, androidx.ui.unit.PxSize size, kotlin.jvm.functions.Function1<? super androidx.ui.graphics.painter.CanvasScope,kotlin.Unit> block);
+ method public kotlin.Unit? drawArc-_aGsT6c(androidx.ui.graphics.Brush brush, float startAngle, float sweepAngle, boolean useCenter, long topLeft = Offset.zero, long size = this.size, @FloatRange(from=0.0, to=1.0) float alpha = 1.0f, androidx.ui.graphics.painter.DrawStyle style = Fill, androidx.ui.graphics.ColorFilter? colorFilter = null, androidx.ui.graphics.BlendMode blendMode = DefaultBlendMode);
+ method public kotlin.Unit? drawArc-eUb3Eo4(long color, float startAngle, float sweepAngle, boolean useCenter, long topLeft = Offset.zero, long size = this.size, @FloatRange(from=0.0, to=1.0) float alpha = 1.0f, androidx.ui.graphics.painter.DrawStyle style = Fill, androidx.ui.graphics.ColorFilter? colorFilter = null, androidx.ui.graphics.BlendMode blendMode = DefaultBlendMode);
+ method public kotlin.Unit? drawCircle-0EImeI8(long color, float radius = size.minDimension / 2.0, long center = this.center, @FloatRange(from=0.0, to=1.0) float alpha = 1.0f, androidx.ui.graphics.painter.DrawStyle style = Fill, androidx.ui.graphics.ColorFilter? colorFilter = null, androidx.ui.graphics.BlendMode blendMode = DefaultBlendMode);
+ method public kotlin.Unit? drawCircle-uHGJFV8(androidx.ui.graphics.Brush brush, float radius = size.minDimension / 2.0, long center = this.center, @FloatRange(from=0.0, to=1.0) float alpha = 1.0f, androidx.ui.graphics.painter.DrawStyle style = Fill, androidx.ui.graphics.ColorFilter? colorFilter = null, androidx.ui.graphics.BlendMode blendMode = DefaultBlendMode);
+ method public kotlin.Unit? drawImage-IF_VeeU(androidx.ui.graphics.ImageAsset image, long srcOffset = Offset.zero, long srcSize = Size(image.width.toFloat(), image.height.toFloat()), long dstOffset = Offset.zero, long dstSize = this.size, @FloatRange(from=0.0, to=1.0) float alpha = 1.0f, androidx.ui.graphics.painter.DrawStyle style = Fill, androidx.ui.graphics.ColorFilter? colorFilter = null, androidx.ui.graphics.BlendMode blendMode = DefaultBlendMode);
+ method public kotlin.Unit? drawImage-zcoU2q0(androidx.ui.graphics.ImageAsset image, long topLeft = Offset.zero, @FloatRange(from=0.0, to=1.0) float alpha = 1.0f, androidx.ui.graphics.painter.DrawStyle style = Fill, androidx.ui.graphics.ColorFilter? colorFilter = null, androidx.ui.graphics.BlendMode blendMode = DefaultBlendMode);
+ method public kotlin.Unit? drawLine-MfDnFlo(long color, long p1, long p2, androidx.ui.graphics.painter.Stroke stroke, @FloatRange(from=0.0, to=1.0) float alpha = 1.0f, androidx.ui.graphics.ColorFilter? colorFilter = null, androidx.ui.graphics.BlendMode blendMode = DefaultBlendMode);
+ method public kotlin.Unit? drawLine-PWBr8KI(androidx.ui.graphics.Brush brush, long p1, long p2, androidx.ui.graphics.painter.Stroke stroke, @FloatRange(from=0.0, to=1.0) float alpha = 1.0f, androidx.ui.graphics.ColorFilter? colorFilter = null, androidx.ui.graphics.BlendMode blendMode = DefaultBlendMode);
+ method public kotlin.Unit? drawOval-EPCrxCw(long color, long topLeft = Offset.zero, long size = this.size, @FloatRange(from=0.0, to=1.0) float alpha = 1.0f, androidx.ui.graphics.painter.DrawStyle style = Fill, androidx.ui.graphics.ColorFilter? colorFilter = null, androidx.ui.graphics.BlendMode blendMode = DefaultBlendMode);
+ method public kotlin.Unit? drawOval-cuGMcK0(androidx.ui.graphics.Brush brush, long topLeft = Offset.zero, long size = this.size, @FloatRange(from=0.0, to=1.0) float alpha = 1.0f, androidx.ui.graphics.painter.DrawStyle style = Fill, androidx.ui.graphics.ColorFilter? colorFilter = null, androidx.ui.graphics.BlendMode blendMode = DefaultBlendMode);
+ method public kotlin.Unit? drawPath(androidx.ui.graphics.Path path, androidx.ui.graphics.Brush brush, @FloatRange(from=0.0, to=1.0) float alpha = 1.0f, androidx.ui.graphics.painter.DrawStyle style = Fill, androidx.ui.graphics.ColorFilter? colorFilter = null, androidx.ui.graphics.BlendMode blendMode = DefaultBlendMode);
+ method public kotlin.Unit? drawPath-ZizoN6c(androidx.ui.graphics.Path path, long color, @FloatRange(from=0.0, to=1.0) float alpha = 1.0f, androidx.ui.graphics.painter.DrawStyle style = Fill, androidx.ui.graphics.ColorFilter? colorFilter = null, androidx.ui.graphics.BlendMode blendMode = DefaultBlendMode);
+ method public kotlin.Unit? drawPoints(java.util.List<androidx.ui.geometry.Offset> points, androidx.ui.graphics.PointMode pointMode, androidx.ui.graphics.Brush brush, @FloatRange(from=0.0, to=1.0) float alpha = 1.0f, androidx.ui.graphics.painter.DrawStyle style = Fill, androidx.ui.graphics.ColorFilter? colorFilter = null, androidx.ui.graphics.BlendMode blendMode = DefaultBlendMode);
+ method public kotlin.Unit? drawPoints-yiE_nf0(java.util.List<androidx.ui.geometry.Offset> points, androidx.ui.graphics.PointMode pointMode, long color, androidx.ui.graphics.painter.Stroke stroke, @FloatRange(from=0.0, to=1.0) float alpha = 1.0f, androidx.ui.graphics.ColorFilter? colorFilter = null, androidx.ui.graphics.BlendMode blendMode = DefaultBlendMode);
+ method public kotlin.Unit? drawRect-EPCrxCw(long color, long topLeft = Offset.zero, long size = this.size, @FloatRange(from=0.0, to=1.0) float alpha = 1.0f, androidx.ui.graphics.painter.DrawStyle style = Fill, androidx.ui.graphics.ColorFilter? colorFilter = null, androidx.ui.graphics.BlendMode blendMode = DefaultBlendMode);
+ method public kotlin.Unit? drawRect-cuGMcK0(androidx.ui.graphics.Brush brush, long topLeft = Offset.zero, long size = this.size, @FloatRange(from=0.0, to=1.0) float alpha = 1.0f, androidx.ui.graphics.painter.DrawStyle style = Fill, androidx.ui.graphics.ColorFilter? colorFilter = null, androidx.ui.graphics.BlendMode blendMode = DefaultBlendMode);
+ method public kotlin.Unit? drawRoundRect-5PTu5W0(androidx.ui.graphics.Brush brush, long topLeft = Offset.zero, long size = this.size, float radiusX = 0.0f, float radiusY = radiusX, @FloatRange(from=0.0, to=1.0) float alpha = 1.0f, androidx.ui.graphics.painter.DrawStyle style = Fill, androidx.ui.graphics.ColorFilter? colorFilter = null, androidx.ui.graphics.BlendMode blendMode = DefaultBlendMode);
+ method public kotlin.Unit? drawRoundRect-A8SqK14(long color, long topLeft = Offset.zero, long size = this.size, float radiusX = 0.0f, float radiusY = 0.0f, androidx.ui.graphics.painter.DrawStyle style = Fill, @FloatRange(from=0.0, to=1.0) float alpha = 1.0f, androidx.ui.graphics.ColorFilter? colorFilter = null, androidx.ui.graphics.BlendMode blendMode = DefaultBlendMode);
+ method public long getCenter();
+ method public long getSize();
+ property public final long center;
+ property public final long size;
+ field public static final androidx.ui.graphics.painter.CanvasScope.Companion! Companion;
+ field public static final float DefaultAlpha = 1.0f;
+ }
+
+ public static final class CanvasScope.Companion {
+ method public androidx.ui.graphics.BlendMode getDefaultBlendMode();
+ property public final androidx.ui.graphics.BlendMode DefaultBlendMode;
+ }
+
+ public final class CanvasScopeKt {
+ method public static inline androidx.ui.graphics.Canvas? clipPath(androidx.ui.graphics.painter.CanvasScope, androidx.ui.graphics.Path path, kotlin.jvm.functions.Function1<? super androidx.ui.graphics.painter.CanvasScope,kotlin.Unit> block);
+ method public static inline androidx.ui.graphics.Canvas? clipRect-2CUYwUY(androidx.ui.graphics.painter.CanvasScope, long topLeft = Offset.zero, long size = this.size, androidx.ui.graphics.ClipOp clipOp = androidx.ui.graphics.ClipOp.intersect, kotlin.jvm.functions.Function1<? super androidx.ui.graphics.painter.CanvasScope,kotlin.Unit> block);
+ method public static inline kotlin.Unit? drawCanvas(androidx.ui.graphics.painter.CanvasScope, kotlin.jvm.functions.Function2<? super androidx.ui.graphics.Canvas,? super androidx.ui.unit.PxSize,kotlin.Unit> block);
+ method public static inline void inset(androidx.ui.graphics.painter.CanvasScope, float left, float top, float right, float bottom, kotlin.jvm.functions.Function1<? super androidx.ui.graphics.painter.CanvasScope,kotlin.Unit> block);
+ method public static inline void inset(androidx.ui.graphics.painter.CanvasScope, float dx, float dy = dx, kotlin.jvm.functions.Function1<? super androidx.ui.graphics.painter.CanvasScope,kotlin.Unit> block);
+ method public static inline androidx.ui.graphics.Canvas? rotate(androidx.ui.graphics.painter.CanvasScope, float degrees, float pivotX = center.dx, float pivotY = center.dy, kotlin.jvm.functions.Function1<? super androidx.ui.graphics.painter.CanvasScope,kotlin.Unit> block);
+ method public static inline androidx.ui.graphics.Canvas? rotateRad(androidx.ui.graphics.painter.CanvasScope, float radians, float pivotX = center.dx, float pivotY = center.dy, kotlin.jvm.functions.Function1<? super androidx.ui.graphics.painter.CanvasScope,kotlin.Unit> block);
+ method public static inline androidx.ui.graphics.Canvas? scale(androidx.ui.graphics.painter.CanvasScope, float scaleX, float scaleY, float pivotX = center.dx, float pivotY = center.dy, kotlin.jvm.functions.Function1<? super androidx.ui.graphics.painter.CanvasScope,kotlin.Unit> block);
+ method public static inline androidx.ui.graphics.Canvas? translate(androidx.ui.graphics.painter.CanvasScope, float dx, float dy, kotlin.jvm.functions.Function1<? super androidx.ui.graphics.painter.CanvasScope,kotlin.Unit> block);
+ }
+
public final class ColorPainter extends androidx.ui.graphics.painter.Painter {
method public long component1();
method public androidx.ui.graphics.painter.ColorPainter copy-QEYXlZo(long color);
method public long getColor();
method public androidx.ui.unit.PxSize getIntrinsicSize();
- method protected void onDraw(androidx.ui.graphics.Canvas canvas, androidx.ui.unit.PxSize bounds);
+ method protected void onDraw(androidx.ui.graphics.painter.CanvasScope);
property public androidx.ui.unit.PxSize intrinsicSize;
}
+ public abstract sealed class DrawStyle {
+ }
+
+ public final class Fill extends androidx.ui.graphics.painter.DrawStyle {
+ field public static final androidx.ui.graphics.painter.Fill! INSTANCE;
+ }
+
public final class ImagePainter extends androidx.ui.graphics.painter.Painter {
- ctor public ImagePainter(androidx.ui.graphics.ImageAsset image, androidx.ui.geometry.Rect? srcBounds);
- method public androidx.ui.geometry.Rect? component2();
- method public androidx.ui.graphics.painter.ImagePainter copy(androidx.ui.graphics.ImageAsset image, androidx.ui.geometry.Rect? srcBounds);
+ method public androidx.ui.graphics.painter.ImagePainter copy-gqgapXI(androidx.ui.graphics.ImageAsset image, long srcOffset, long srcSize);
method public androidx.ui.unit.PxSize getIntrinsicSize();
- method public androidx.ui.geometry.Rect? getSrcBounds();
- method protected void onDraw(androidx.ui.graphics.Canvas canvas, androidx.ui.unit.PxSize bounds);
+ method protected void onDraw(androidx.ui.graphics.painter.CanvasScope);
property public androidx.ui.unit.PxSize intrinsicSize;
}
- public final class ImagePainterKt {
- }
-
public abstract class Painter {
ctor public Painter();
method protected boolean applyAlpha(float alpha);
method protected boolean applyColorFilter(androidx.ui.graphics.ColorFilter? colorFilter);
method protected boolean applyRtl(boolean rtl);
- method public final void draw(androidx.ui.graphics.Canvas canvas, androidx.ui.unit.PxSize bounds, float alpha = 1.0f, androidx.ui.graphics.ColorFilter? colorFilter = null, boolean rtl = false);
+ method public final void draw(androidx.ui.graphics.Canvas canvas, androidx.ui.unit.PxSize size, float alpha = 1.0f, androidx.ui.graphics.ColorFilter? colorFilter = null, boolean rtl = false);
method public abstract androidx.ui.unit.PxSize getIntrinsicSize();
- method protected abstract void onDraw(androidx.ui.graphics.Canvas canvas, androidx.ui.unit.PxSize bounds);
+ method protected abstract void onDraw(androidx.ui.graphics.painter.CanvasScope);
property public abstract androidx.ui.unit.PxSize intrinsicSize;
}
+ public final class Stroke extends androidx.ui.graphics.painter.DrawStyle {
+ ctor public Stroke(float width, float miter, androidx.ui.graphics.StrokeCap cap, androidx.ui.graphics.StrokeJoin join, android.graphics.PathEffect? pathEffect);
+ ctor public Stroke();
+ method public float component1();
+ method public float component2();
+ method public androidx.ui.graphics.StrokeCap component3();
+ method public androidx.ui.graphics.StrokeJoin component4();
+ method public android.graphics.PathEffect? component5();
+ method public androidx.ui.graphics.painter.Stroke copy(float width, float miter, androidx.ui.graphics.StrokeCap cap, androidx.ui.graphics.StrokeJoin join, android.graphics.PathEffect? pathEffect);
+ method public androidx.ui.graphics.StrokeCap getCap();
+ method public androidx.ui.graphics.StrokeJoin getJoin();
+ method public float getMiter();
+ method public android.graphics.PathEffect? getPathEffect();
+ method public float getWidth();
+ }
+
}
package androidx.ui.graphics.vector {
@@ -1144,7 +1210,7 @@
method public static androidx.ui.geometry.Rect inverseTransformRect(androidx.ui.graphics.vectormath.Matrix4 transform, androidx.ui.geometry.Rect rect);
method public static boolean isIdentity(androidx.ui.graphics.vectormath.Matrix4);
method public static boolean matrixEquals(androidx.ui.graphics.vectormath.Matrix4? a, androidx.ui.graphics.vectormath.Matrix4? b);
- method public static androidx.ui.geometry.Offset transformPoint(androidx.ui.graphics.vectormath.Matrix4, androidx.ui.geometry.Offset point);
+ method public static long transformPoint-k2M_ft0(androidx.ui.graphics.vectormath.Matrix4, long point);
method public static androidx.ui.geometry.Rect transformRect(androidx.ui.graphics.vectormath.Matrix4, androidx.ui.geometry.Rect rect);
}
diff --git a/ui/ui-graphics/api/restricted_current.txt b/ui/ui-graphics/api/restricted_current.txt
index a4896944..8b672ec 100644
--- a/ui/ui-graphics/api/restricted_current.txt
+++ b/ui/ui-graphics/api/restricted_current.txt
@@ -29,7 +29,7 @@
method public void addArc(androidx.ui.geometry.Rect oval, float startAngleDegrees, float sweepAngleDegrees);
method public void addArcRad(androidx.ui.geometry.Rect oval, float startAngleRadians, float sweepAngleRadians);
method public void addOval(androidx.ui.geometry.Rect oval);
- method public void addPath(androidx.ui.graphics.Path path, androidx.ui.geometry.Offset offset);
+ method public void addPath-m3TnucA(androidx.ui.graphics.Path path, long offset);
method public void addRRect(androidx.ui.geometry.RRect rrect);
method public void addRect(androidx.ui.geometry.Rect rect);
method public void arcTo(androidx.ui.geometry.Rect rect, float startAngleDegrees, float sweepAngleDegrees, boolean forceMoveTo);
@@ -50,7 +50,7 @@
method public void relativeQuadraticBezierTo(float x1, float y1, float x2, float y2);
method public void reset();
method public void setFillType(androidx.ui.graphics.PathFillType value);
- method public void shift(androidx.ui.geometry.Offset offset);
+ method public void shift-RIqb49o(long offset);
property public androidx.ui.graphics.PathFillType fillType;
property public boolean isConvex;
property public boolean isEmpty;
@@ -95,8 +95,8 @@
enum_constant public static final androidx.ui.graphics.BlendMode xor;
}
- public interface Brush {
- method public void applyTo(androidx.ui.graphics.Paint p);
+ public abstract sealed class Brush {
+ method public abstract void applyTo(androidx.ui.graphics.Paint p);
}
public final class BrushKt {
@@ -112,22 +112,25 @@
public interface Canvas {
method public void clipPath(androidx.ui.graphics.Path path);
- method public void clipRRect(androidx.ui.geometry.RRect rrect);
- method public void clipRect(androidx.ui.geometry.Rect rect, androidx.ui.graphics.ClipOp clipOp = androidx.ui.graphics.ClipOp.intersect);
+ method public default void clipRect(androidx.ui.geometry.Rect rect, androidx.ui.graphics.ClipOp clipOp = androidx.ui.graphics.ClipOp.intersect);
+ method public void clipRect(float left, float top, float right, float bottom, androidx.ui.graphics.ClipOp clipOp = androidx.ui.graphics.ClipOp.intersect);
method public void concat(androidx.ui.graphics.vectormath.Matrix4 matrix4);
method public void disableZ();
- method public void drawArc(androidx.ui.geometry.Rect rect, float startAngle, float sweepAngle, boolean useCenter, androidx.ui.graphics.Paint paint);
+ method public default void drawArc(androidx.ui.geometry.Rect rect, float startAngle, float sweepAngle, boolean useCenter, androidx.ui.graphics.Paint paint);
+ method public void drawArc(float left, float top, float right, float bottom, float startAngle, float sweepAngle, boolean useCenter, androidx.ui.graphics.Paint paint);
method public default void drawArcRad(androidx.ui.geometry.Rect rect, float startAngleRad, float sweepAngleRad, boolean useCenter, androidx.ui.graphics.Paint paint);
- method public void drawCircle(androidx.ui.geometry.Offset center, float radius, androidx.ui.graphics.Paint paint);
- method public void drawImage(androidx.ui.graphics.ImageAsset image, androidx.ui.geometry.Offset topLeftOffset, androidx.ui.graphics.Paint paint);
- method public void drawImageRect(androidx.ui.graphics.ImageAsset image, androidx.ui.geometry.Rect? src, androidx.ui.geometry.Rect dst, androidx.ui.graphics.Paint paint);
- method public void drawLine(androidx.ui.geometry.Offset p1, androidx.ui.geometry.Offset p2, androidx.ui.graphics.Paint paint);
- method public void drawOval(androidx.ui.geometry.Rect rect, androidx.ui.graphics.Paint paint);
+ method public void drawCircle-NfwrgZA(long center, float radius, androidx.ui.graphics.Paint paint);
+ method public void drawImage--AHD2Ng(androidx.ui.graphics.ImageAsset image, long topLeftOffset, androidx.ui.graphics.Paint paint);
+ method public void drawImageRect-btuv3no(androidx.ui.graphics.ImageAsset image, long srcOffset = Offset.zero, long srcSize = Size(image.width.toFloat(), image.height.toFloat()), long dstOffset, long dstSize, androidx.ui.graphics.Paint paint);
+ method public void drawLine-d9kBv1M(long p1, long p2, androidx.ui.graphics.Paint paint);
+ method public default void drawOval(androidx.ui.geometry.Rect rect, androidx.ui.graphics.Paint paint);
+ method public void drawOval(float left, float top, float right, float bottom, androidx.ui.graphics.Paint paint);
method public void drawPath(androidx.ui.graphics.Path path, androidx.ui.graphics.Paint paint);
method public void drawPicture(androidx.ui.graphics.Picture picture);
method public void drawPoints(androidx.ui.graphics.PointMode pointMode, java.util.List<androidx.ui.geometry.Offset> points, androidx.ui.graphics.Paint paint);
method public void drawRawPoints(androidx.ui.graphics.PointMode pointMode, float[] points, androidx.ui.graphics.Paint paint);
- method public void drawRect(androidx.ui.geometry.Rect rect, androidx.ui.graphics.Paint paint);
+ method public default void drawRect(androidx.ui.geometry.Rect rect, androidx.ui.graphics.Paint paint);
+ method public void drawRect(float left, float top, float right, float bottom, androidx.ui.graphics.Paint paint);
method public void drawRoundRect(float left, float top, float right, float bottom, float radiusX, float radiusY, androidx.ui.graphics.Paint paint);
method public void drawVertices(androidx.ui.graphics.Vertices vertices, androidx.ui.graphics.BlendMode blendMode, androidx.ui.graphics.Paint paint);
method public void enableZ();
@@ -161,7 +164,7 @@
method public static long constructor-impl(long value);
method public static long convert-impl(long $this, androidx.ui.graphics.colorspace.ColorSpace colorSpace);
method public static long copy-impl(long $this, float alpha = this.alpha, float red = this.red, float green = this.green, float blue = this.blue);
- method public static boolean equals-impl(long p, Object? p1);
+ method public static inline boolean equals-impl(long p, Object? p1);
method public static boolean equals-impl0(long p1, long p2);
method public static float getAlpha-impl(long $this);
method public static float getBlue-impl(long $this);
@@ -169,7 +172,7 @@
method public static float getGreen-impl(long $this);
method public static float getRed-impl(long $this);
method public long getValue();
- method public static int hashCode-impl(long p);
+ method public static inline int hashCode-impl(long p);
method public static String toString-impl(long $this);
field public static final androidx.ui.graphics.Color.Companion! Companion;
}
@@ -297,7 +300,9 @@
public final class OutlineKt {
method public static void addOutline(androidx.ui.graphics.Path, androidx.ui.graphics.Outline outline);
+ method public static void drawOutline(androidx.ui.graphics.painter.CanvasScope, androidx.ui.graphics.Outline outline, androidx.ui.graphics.Brush brush, @FloatRange(from=0.0, to=1.0) float alpha = 1.0f, androidx.ui.graphics.painter.DrawStyle style = Fill, androidx.ui.graphics.ColorFilter? colorFilter = null, androidx.ui.graphics.BlendMode blendMode = CanvasScope.DefaultBlendMode);
method public static void drawOutline(androidx.ui.graphics.Canvas, androidx.ui.graphics.Outline outline, androidx.ui.graphics.Paint paint);
+ method public static void drawOutline-GAv4Q-k(androidx.ui.graphics.painter.CanvasScope, androidx.ui.graphics.Outline outline, long color, @FloatRange(from=0.0, to=1.0) float alpha = 1.0f, androidx.ui.graphics.painter.DrawStyle style = Fill, androidx.ui.graphics.ColorFilter? colorFilter = null, androidx.ui.graphics.BlendMode blendMode = CanvasScope.DefaultBlendMode);
}
public final class Paint {
@@ -354,7 +359,7 @@
method public void addArc(androidx.ui.geometry.Rect oval, float startAngleDegrees, float sweepAngleDegrees);
method public void addArcRad(androidx.ui.geometry.Rect oval, float startAngleRadians, float sweepAngleRadians);
method public void addOval(androidx.ui.geometry.Rect oval);
- method public void addPath(androidx.ui.graphics.Path path, androidx.ui.geometry.Offset offset = Offset.zero);
+ method public void addPath-m3TnucA(androidx.ui.graphics.Path path, long offset = Offset.zero);
method public void addRRect(androidx.ui.geometry.RRect rrect);
method public void addRect(androidx.ui.geometry.Rect rect);
method public void arcTo(androidx.ui.geometry.Rect rect, float startAngleDegrees, float sweepAngleDegrees, boolean forceMoveTo);
@@ -375,7 +380,7 @@
method public void relativeQuadraticBezierTo(float x1, float y1, float x2, float y2);
method public void reset();
method public void setFillType(androidx.ui.graphics.PathFillType p);
- method public void shift(androidx.ui.geometry.Offset offset);
+ method public void shift-RIqb49o(long offset);
property public abstract androidx.ui.graphics.PathFillType fillType;
property public abstract boolean isConvex;
property public abstract boolean isEmpty;
@@ -440,32 +445,32 @@
public final inline class Shader {
ctor public Shader();
method public static android.graphics.Shader! constructor-impl(android.graphics.Shader nativeShader);
- method public static boolean equals-impl(android.graphics.Shader! p, Object? p1);
+ method public static inline boolean equals-impl(android.graphics.Shader! p, Object? p1);
method public static boolean equals-impl0(android.graphics.Shader p1, android.graphics.Shader p2);
method public android.graphics.Shader getNativeShader();
- method public static int hashCode-impl(android.graphics.Shader! p);
- method public static String toString-impl(android.graphics.Shader! p);
+ method public static inline int hashCode-impl(android.graphics.Shader! p);
+ method public static inline String! toString-impl(android.graphics.Shader! p);
}
- public class ShaderBrush implements androidx.ui.graphics.Brush {
- method public void applyTo(androidx.ui.graphics.Paint p);
+ public class ShaderBrush extends androidx.ui.graphics.Brush {
+ method public final void applyTo(androidx.ui.graphics.Paint p);
method public final android.graphics.Shader getShader();
}
public final class ShaderKt {
method public static android.graphics.Shader ImageShader(androidx.ui.graphics.ImageAsset image, androidx.ui.graphics.TileMode tileModeX = androidx.ui.graphics.TileMode.Clamp, androidx.ui.graphics.TileMode tileModeY = androidx.ui.graphics.TileMode.Clamp);
- method public static android.graphics.Shader LinearGradientShader(androidx.ui.geometry.Offset from, androidx.ui.geometry.Offset to, java.util.List<androidx.ui.graphics.Color> colors, java.util.List<java.lang.Float>? colorStops = null, androidx.ui.graphics.TileMode tileMode = androidx.ui.graphics.TileMode.Clamp);
- method public static android.graphics.Shader RadialGradientShader(androidx.ui.geometry.Offset center, float radius, java.util.List<androidx.ui.graphics.Color> colors, java.util.List<java.lang.Float>? colorStops = null, androidx.ui.graphics.TileMode tileMode = androidx.ui.graphics.TileMode.Clamp);
+ method public static android.graphics.Shader LinearGradientShader-BG1VTC8(long from, long to, java.util.List<androidx.ui.graphics.Color> colors, java.util.List<java.lang.Float>? colorStops = null, androidx.ui.graphics.TileMode tileMode = androidx.ui.graphics.TileMode.Clamp);
+ method public static android.graphics.Shader RadialGradientShader-nSjqbmE(long center, float radius, java.util.List<androidx.ui.graphics.Color> colors, java.util.List<java.lang.Float>? colorStops = null, androidx.ui.graphics.TileMode tileMode = androidx.ui.graphics.TileMode.Clamp);
}
public final class Shadow {
method public long component1();
- method public androidx.ui.geometry.Offset component2();
+ method public long component2();
method public float component3();
- method public androidx.ui.graphics.Shadow copy-1LPazZ4(long color, androidx.ui.geometry.Offset offset, float blurRadius);
+ method public androidx.ui.graphics.Shadow copy-1LPazZ4(long color, long offset, float blurRadius);
method public float getBlurRadius();
method public long getColor();
- method public androidx.ui.geometry.Offset getOffset();
+ method public long getOffset();
field public static final androidx.ui.graphics.Shadow.Companion! Companion;
}
@@ -482,10 +487,8 @@
method public androidx.ui.graphics.Outline createOutline(androidx.ui.unit.PxSize size, androidx.ui.unit.Density density);
}
- public final class SolidColor implements androidx.ui.graphics.Brush {
+ public final class SolidColor extends androidx.ui.graphics.Brush {
method public void applyTo(androidx.ui.graphics.Paint p);
- method public long component1();
- method public androidx.ui.graphics.SolidColor copy-QEYXlZo(long value);
method public long getValue();
}
@@ -715,39 +718,102 @@
package androidx.ui.graphics.painter {
+ public final class CanvasScope {
+ ctor public CanvasScope();
+ method public void draw(androidx.ui.graphics.Canvas canvas, androidx.ui.unit.PxSize size, kotlin.jvm.functions.Function1<? super androidx.ui.graphics.painter.CanvasScope,kotlin.Unit> block);
+ method public kotlin.Unit? drawArc-_aGsT6c(androidx.ui.graphics.Brush brush, float startAngle, float sweepAngle, boolean useCenter, long topLeft = Offset.zero, long size = this.size, @FloatRange(from=0.0, to=1.0) float alpha = 1.0f, androidx.ui.graphics.painter.DrawStyle style = Fill, androidx.ui.graphics.ColorFilter? colorFilter = null, androidx.ui.graphics.BlendMode blendMode = DefaultBlendMode);
+ method public kotlin.Unit? drawArc-eUb3Eo4(long color, float startAngle, float sweepAngle, boolean useCenter, long topLeft = Offset.zero, long size = this.size, @FloatRange(from=0.0, to=1.0) float alpha = 1.0f, androidx.ui.graphics.painter.DrawStyle style = Fill, androidx.ui.graphics.ColorFilter? colorFilter = null, androidx.ui.graphics.BlendMode blendMode = DefaultBlendMode);
+ method public kotlin.Unit? drawCircle-0EImeI8(long color, float radius = size.minDimension / 2.0, long center = this.center, @FloatRange(from=0.0, to=1.0) float alpha = 1.0f, androidx.ui.graphics.painter.DrawStyle style = Fill, androidx.ui.graphics.ColorFilter? colorFilter = null, androidx.ui.graphics.BlendMode blendMode = DefaultBlendMode);
+ method public kotlin.Unit? drawCircle-uHGJFV8(androidx.ui.graphics.Brush brush, float radius = size.minDimension / 2.0, long center = this.center, @FloatRange(from=0.0, to=1.0) float alpha = 1.0f, androidx.ui.graphics.painter.DrawStyle style = Fill, androidx.ui.graphics.ColorFilter? colorFilter = null, androidx.ui.graphics.BlendMode blendMode = DefaultBlendMode);
+ method public kotlin.Unit? drawImage-IF_VeeU(androidx.ui.graphics.ImageAsset image, long srcOffset = Offset.zero, long srcSize = Size(image.width.toFloat(), image.height.toFloat()), long dstOffset = Offset.zero, long dstSize = this.size, @FloatRange(from=0.0, to=1.0) float alpha = 1.0f, androidx.ui.graphics.painter.DrawStyle style = Fill, androidx.ui.graphics.ColorFilter? colorFilter = null, androidx.ui.graphics.BlendMode blendMode = DefaultBlendMode);
+ method public kotlin.Unit? drawImage-zcoU2q0(androidx.ui.graphics.ImageAsset image, long topLeft = Offset.zero, @FloatRange(from=0.0, to=1.0) float alpha = 1.0f, androidx.ui.graphics.painter.DrawStyle style = Fill, androidx.ui.graphics.ColorFilter? colorFilter = null, androidx.ui.graphics.BlendMode blendMode = DefaultBlendMode);
+ method public kotlin.Unit? drawLine-MfDnFlo(long color, long p1, long p2, androidx.ui.graphics.painter.Stroke stroke, @FloatRange(from=0.0, to=1.0) float alpha = 1.0f, androidx.ui.graphics.ColorFilter? colorFilter = null, androidx.ui.graphics.BlendMode blendMode = DefaultBlendMode);
+ method public kotlin.Unit? drawLine-PWBr8KI(androidx.ui.graphics.Brush brush, long p1, long p2, androidx.ui.graphics.painter.Stroke stroke, @FloatRange(from=0.0, to=1.0) float alpha = 1.0f, androidx.ui.graphics.ColorFilter? colorFilter = null, androidx.ui.graphics.BlendMode blendMode = DefaultBlendMode);
+ method public kotlin.Unit? drawOval-EPCrxCw(long color, long topLeft = Offset.zero, long size = this.size, @FloatRange(from=0.0, to=1.0) float alpha = 1.0f, androidx.ui.graphics.painter.DrawStyle style = Fill, androidx.ui.graphics.ColorFilter? colorFilter = null, androidx.ui.graphics.BlendMode blendMode = DefaultBlendMode);
+ method public kotlin.Unit? drawOval-cuGMcK0(androidx.ui.graphics.Brush brush, long topLeft = Offset.zero, long size = this.size, @FloatRange(from=0.0, to=1.0) float alpha = 1.0f, androidx.ui.graphics.painter.DrawStyle style = Fill, androidx.ui.graphics.ColorFilter? colorFilter = null, androidx.ui.graphics.BlendMode blendMode = DefaultBlendMode);
+ method public kotlin.Unit? drawPath(androidx.ui.graphics.Path path, androidx.ui.graphics.Brush brush, @FloatRange(from=0.0, to=1.0) float alpha = 1.0f, androidx.ui.graphics.painter.DrawStyle style = Fill, androidx.ui.graphics.ColorFilter? colorFilter = null, androidx.ui.graphics.BlendMode blendMode = DefaultBlendMode);
+ method public kotlin.Unit? drawPath-ZizoN6c(androidx.ui.graphics.Path path, long color, @FloatRange(from=0.0, to=1.0) float alpha = 1.0f, androidx.ui.graphics.painter.DrawStyle style = Fill, androidx.ui.graphics.ColorFilter? colorFilter = null, androidx.ui.graphics.BlendMode blendMode = DefaultBlendMode);
+ method public kotlin.Unit? drawPoints(java.util.List<androidx.ui.geometry.Offset> points, androidx.ui.graphics.PointMode pointMode, androidx.ui.graphics.Brush brush, @FloatRange(from=0.0, to=1.0) float alpha = 1.0f, androidx.ui.graphics.painter.DrawStyle style = Fill, androidx.ui.graphics.ColorFilter? colorFilter = null, androidx.ui.graphics.BlendMode blendMode = DefaultBlendMode);
+ method public kotlin.Unit? drawPoints-yiE_nf0(java.util.List<androidx.ui.geometry.Offset> points, androidx.ui.graphics.PointMode pointMode, long color, androidx.ui.graphics.painter.Stroke stroke, @FloatRange(from=0.0, to=1.0) float alpha = 1.0f, androidx.ui.graphics.ColorFilter? colorFilter = null, androidx.ui.graphics.BlendMode blendMode = DefaultBlendMode);
+ method public kotlin.Unit? drawRect-EPCrxCw(long color, long topLeft = Offset.zero, long size = this.size, @FloatRange(from=0.0, to=1.0) float alpha = 1.0f, androidx.ui.graphics.painter.DrawStyle style = Fill, androidx.ui.graphics.ColorFilter? colorFilter = null, androidx.ui.graphics.BlendMode blendMode = DefaultBlendMode);
+ method public kotlin.Unit? drawRect-cuGMcK0(androidx.ui.graphics.Brush brush, long topLeft = Offset.zero, long size = this.size, @FloatRange(from=0.0, to=1.0) float alpha = 1.0f, androidx.ui.graphics.painter.DrawStyle style = Fill, androidx.ui.graphics.ColorFilter? colorFilter = null, androidx.ui.graphics.BlendMode blendMode = DefaultBlendMode);
+ method public kotlin.Unit? drawRoundRect-5PTu5W0(androidx.ui.graphics.Brush brush, long topLeft = Offset.zero, long size = this.size, float radiusX = 0.0f, float radiusY = radiusX, @FloatRange(from=0.0, to=1.0) float alpha = 1.0f, androidx.ui.graphics.painter.DrawStyle style = Fill, androidx.ui.graphics.ColorFilter? colorFilter = null, androidx.ui.graphics.BlendMode blendMode = DefaultBlendMode);
+ method public kotlin.Unit? drawRoundRect-A8SqK14(long color, long topLeft = Offset.zero, long size = this.size, float radiusX = 0.0f, float radiusY = 0.0f, androidx.ui.graphics.painter.DrawStyle style = Fill, @FloatRange(from=0.0, to=1.0) float alpha = 1.0f, androidx.ui.graphics.ColorFilter? colorFilter = null, androidx.ui.graphics.BlendMode blendMode = DefaultBlendMode);
+ method public long getCenter();
+ method public long getSize();
+ property public final long center;
+ property public final long size;
+ field public static final androidx.ui.graphics.painter.CanvasScope.Companion! Companion;
+ field public static final float DefaultAlpha = 1.0f;
+ }
+
+ public static final class CanvasScope.Companion {
+ method public androidx.ui.graphics.BlendMode getDefaultBlendMode();
+ property public final androidx.ui.graphics.BlendMode DefaultBlendMode;
+ }
+
+ public final class CanvasScopeKt {
+ method public static inline androidx.ui.graphics.Canvas? clipPath(androidx.ui.graphics.painter.CanvasScope, androidx.ui.graphics.Path path, kotlin.jvm.functions.Function1<? super androidx.ui.graphics.painter.CanvasScope,kotlin.Unit> block);
+ method public static inline androidx.ui.graphics.Canvas? clipRect-2CUYwUY(androidx.ui.graphics.painter.CanvasScope, long topLeft = Offset.zero, long size = this.size, androidx.ui.graphics.ClipOp clipOp = androidx.ui.graphics.ClipOp.intersect, kotlin.jvm.functions.Function1<? super androidx.ui.graphics.painter.CanvasScope,kotlin.Unit> block);
+ method public static inline kotlin.Unit? drawCanvas(androidx.ui.graphics.painter.CanvasScope, kotlin.jvm.functions.Function2<? super androidx.ui.graphics.Canvas,? super androidx.ui.unit.PxSize,kotlin.Unit> block);
+ method public static inline void inset(androidx.ui.graphics.painter.CanvasScope, float left, float top, float right, float bottom, kotlin.jvm.functions.Function1<? super androidx.ui.graphics.painter.CanvasScope,kotlin.Unit> block);
+ method public static inline void inset(androidx.ui.graphics.painter.CanvasScope, float dx, float dy = dx, kotlin.jvm.functions.Function1<? super androidx.ui.graphics.painter.CanvasScope,kotlin.Unit> block);
+ method public static inline androidx.ui.graphics.Canvas? rotate(androidx.ui.graphics.painter.CanvasScope, float degrees, float pivotX = center.dx, float pivotY = center.dy, kotlin.jvm.functions.Function1<? super androidx.ui.graphics.painter.CanvasScope,kotlin.Unit> block);
+ method public static inline androidx.ui.graphics.Canvas? rotateRad(androidx.ui.graphics.painter.CanvasScope, float radians, float pivotX = center.dx, float pivotY = center.dy, kotlin.jvm.functions.Function1<? super androidx.ui.graphics.painter.CanvasScope,kotlin.Unit> block);
+ method public static inline androidx.ui.graphics.Canvas? scale(androidx.ui.graphics.painter.CanvasScope, float scaleX, float scaleY, float pivotX = center.dx, float pivotY = center.dy, kotlin.jvm.functions.Function1<? super androidx.ui.graphics.painter.CanvasScope,kotlin.Unit> block);
+ method public static inline androidx.ui.graphics.Canvas? translate(androidx.ui.graphics.painter.CanvasScope, float dx, float dy, kotlin.jvm.functions.Function1<? super androidx.ui.graphics.painter.CanvasScope,kotlin.Unit> block);
+ }
+
public final class ColorPainter extends androidx.ui.graphics.painter.Painter {
method public long component1();
method public androidx.ui.graphics.painter.ColorPainter copy-QEYXlZo(long color);
method public long getColor();
method public androidx.ui.unit.PxSize getIntrinsicSize();
- method protected void onDraw(androidx.ui.graphics.Canvas canvas, androidx.ui.unit.PxSize bounds);
+ method protected void onDraw(androidx.ui.graphics.painter.CanvasScope);
property public androidx.ui.unit.PxSize intrinsicSize;
}
+ public abstract sealed class DrawStyle {
+ }
+
+ public final class Fill extends androidx.ui.graphics.painter.DrawStyle {
+ field public static final androidx.ui.graphics.painter.Fill! INSTANCE;
+ }
+
public final class ImagePainter extends androidx.ui.graphics.painter.Painter {
- ctor public ImagePainter(androidx.ui.graphics.ImageAsset image, androidx.ui.geometry.Rect? srcBounds);
- method public androidx.ui.geometry.Rect? component2();
- method public androidx.ui.graphics.painter.ImagePainter copy(androidx.ui.graphics.ImageAsset image, androidx.ui.geometry.Rect? srcBounds);
+ method public androidx.ui.graphics.painter.ImagePainter copy-gqgapXI(androidx.ui.graphics.ImageAsset image, long srcOffset, long srcSize);
method public androidx.ui.unit.PxSize getIntrinsicSize();
- method public androidx.ui.geometry.Rect? getSrcBounds();
- method protected void onDraw(androidx.ui.graphics.Canvas canvas, androidx.ui.unit.PxSize bounds);
+ method protected void onDraw(androidx.ui.graphics.painter.CanvasScope);
property public androidx.ui.unit.PxSize intrinsicSize;
}
- public final class ImagePainterKt {
- }
-
public abstract class Painter {
ctor public Painter();
method protected boolean applyAlpha(float alpha);
method protected boolean applyColorFilter(androidx.ui.graphics.ColorFilter? colorFilter);
method protected boolean applyRtl(boolean rtl);
- method public final void draw(androidx.ui.graphics.Canvas canvas, androidx.ui.unit.PxSize bounds, float alpha = 1.0f, androidx.ui.graphics.ColorFilter? colorFilter = null, boolean rtl = false);
+ method public final void draw(androidx.ui.graphics.Canvas canvas, androidx.ui.unit.PxSize size, float alpha = 1.0f, androidx.ui.graphics.ColorFilter? colorFilter = null, boolean rtl = false);
method public abstract androidx.ui.unit.PxSize getIntrinsicSize();
- method protected abstract void onDraw(androidx.ui.graphics.Canvas canvas, androidx.ui.unit.PxSize bounds);
+ method protected abstract void onDraw(androidx.ui.graphics.painter.CanvasScope);
property public abstract androidx.ui.unit.PxSize intrinsicSize;
}
+ public final class Stroke extends androidx.ui.graphics.painter.DrawStyle {
+ ctor public Stroke(float width, float miter, androidx.ui.graphics.StrokeCap cap, androidx.ui.graphics.StrokeJoin join, android.graphics.PathEffect? pathEffect);
+ ctor public Stroke();
+ method public float component1();
+ method public float component2();
+ method public androidx.ui.graphics.StrokeCap component3();
+ method public androidx.ui.graphics.StrokeJoin component4();
+ method public android.graphics.PathEffect? component5();
+ method public androidx.ui.graphics.painter.Stroke copy(float width, float miter, androidx.ui.graphics.StrokeCap cap, androidx.ui.graphics.StrokeJoin join, android.graphics.PathEffect? pathEffect);
+ method public androidx.ui.graphics.StrokeCap getCap();
+ method public androidx.ui.graphics.StrokeJoin getJoin();
+ method public float getMiter();
+ method public android.graphics.PathEffect? getPathEffect();
+ method public float getWidth();
+ }
+
}
package androidx.ui.graphics.vector {
@@ -1144,7 +1210,7 @@
method public static androidx.ui.geometry.Rect inverseTransformRect(androidx.ui.graphics.vectormath.Matrix4 transform, androidx.ui.geometry.Rect rect);
method public static boolean isIdentity(androidx.ui.graphics.vectormath.Matrix4);
method public static boolean matrixEquals(androidx.ui.graphics.vectormath.Matrix4? a, androidx.ui.graphics.vectormath.Matrix4? b);
- method public static androidx.ui.geometry.Offset transformPoint(androidx.ui.graphics.vectormath.Matrix4, androidx.ui.geometry.Offset point);
+ method public static long transformPoint-k2M_ft0(androidx.ui.graphics.vectormath.Matrix4, long point);
method public static androidx.ui.geometry.Rect transformRect(androidx.ui.graphics.vectormath.Matrix4, androidx.ui.geometry.Rect rect);
}
diff --git a/ui/ui-graphics/samples/src/main/java/androidx/ui/graphics/samples/CanvasScopeSample.kt b/ui/ui-graphics/samples/src/main/java/androidx/ui/graphics/samples/CanvasScopeSample.kt
new file mode 100644
index 0000000..52d556a
--- /dev/null
+++ b/ui/ui-graphics/samples/src/main/java/androidx/ui/graphics/samples/CanvasScopeSample.kt
@@ -0,0 +1,63 @@
+/*
+ * Copyright 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT 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.ui.graphics.samples
+
+import androidx.annotation.Sampled
+import androidx.ui.graphics.Canvas
+import androidx.ui.graphics.Color
+import androidx.ui.graphics.ImageAsset
+import androidx.ui.graphics.painter.CanvasScope
+import androidx.ui.graphics.painter.inset
+import androidx.ui.graphics.painter.rotate
+import androidx.ui.unit.Px
+import androidx.ui.unit.PxSize
+
+/**
+ * Sample showing how to use CanvasScope to issue drawing commands into
+ * a given canvas as well as providing transformations to the drawing environment
+ */
+@Sampled
+fun canvasScopeSample() {
+ val pxSize = PxSize(Px(300.0f), Px(300.0f))
+ val imageAsset = ImageAsset(
+ pxSize.width.value.toInt(),
+ pxSize.height.value.toInt()
+ )
+
+ // create a Canvas to draw contents into the ImageAsset
+ val targetCanvas = Canvas(imageAsset)
+
+ // Create a CanvasScope from this canvas to issue drawing commands into
+ CanvasScope().draw(targetCanvas, pxSize) {
+ drawRect(color = Color.Gray) // Draw grey background
+ // Inset content by 10 pixels on the left/right sides and 12 by the
+ // top/bottom
+ inset(10.0f, 12.0f) {
+ val quadrantSize = size / 2.0f
+
+ // Draw a rectangle within the inset bounds
+ drawRect(
+ size = quadrantSize,
+ color = Color.Red
+ )
+
+ rotate(45.0f) {
+ drawRect(size = quadrantSize, color = Color.Blue)
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/ui/ui-graphics/src/androidTest/java/androidx/ui/graphics/painter/CanvasScopeTest.kt b/ui/ui-graphics/src/androidTest/java/androidx/ui/graphics/painter/CanvasScopeTest.kt
new file mode 100644
index 0000000..eea60cd
--- /dev/null
+++ b/ui/ui-graphics/src/androidTest/java/androidx/ui/graphics/painter/CanvasScopeTest.kt
@@ -0,0 +1,464 @@
+/*
+ * Copyright 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT 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.ui.graphics.painter
+
+import androidx.test.filters.SmallTest
+import androidx.ui.geometry.Offset
+import androidx.ui.geometry.Rect
+import androidx.ui.geometry.Size
+import androidx.ui.graphics.Canvas
+import androidx.ui.graphics.Color
+import androidx.ui.graphics.ImageAsset
+import androidx.ui.graphics.Paint
+import androidx.ui.graphics.SolidColor
+import androidx.ui.graphics.compositeOver
+import androidx.ui.graphics.toPixelMap
+import androidx.ui.unit.Px
+import androidx.ui.unit.PxSize
+import org.junit.Assert.assertEquals
+import org.junit.Assert.fail
+import org.junit.Test
+import org.junit.runner.RunWith
+import org.junit.runners.JUnit4
+
+@SmallTest
+@RunWith(JUnit4::class)
+class CanvasScopeTest {
+
+ private val width: Int = 100
+ private val height: Int = 100
+ private val dstSize = PxSize(Px(width.toFloat()), Px(height.toFloat()))
+
+ private fun createTestDstImage(): ImageAsset {
+ val dst = ImageAsset(width, height)
+ val dstCanvas = Canvas(dst)
+ val dstPaint = Paint().apply {
+ this.color = Color.White
+ }
+ dstCanvas.drawRect(
+ Rect.fromLTWH(0.0f, 0.0f, 200.0f, 200.0f),
+ dstPaint
+ )
+ return dst
+ }
+
+ @Test
+ fun testDrawRectColor() {
+ val img = createTestDstImage()
+ CanvasScope().draw(Canvas(img), dstSize) {
+ // Verify that the overload that consumes a color parameter
+ // fills the canvas with red color
+ drawRect(color = Color.Red)
+ }
+
+ val pixelMap = img.toPixelMap()
+ for (i in 0 until pixelMap.width) {
+ for (j in 0 until pixelMap.height) {
+ assertEquals(Color.Red, pixelMap[i, j])
+ }
+ }
+ }
+
+ @Test
+ fun testDrawRectBrushColor() {
+ val img = createTestDstImage()
+ CanvasScope().draw(Canvas(img), dstSize) {
+ // Verify that the overload that consumes a brush parameter
+ // fills the canvas with red color
+ drawRect(brush = SolidColor(Color.Red))
+ }
+
+ val pixelMap = img.toPixelMap()
+ for (i in 0 until pixelMap.width) {
+ for (j in 0 until pixelMap.height) {
+ assertEquals(Color.Red, pixelMap[i, j])
+ }
+ }
+ }
+
+ @Test
+ fun testDrawRectColorAlpha() {
+ val img = createTestDstImage()
+ CanvasScope().draw(Canvas(img), dstSize) {
+ // Verify that the overload that consumes a color parameter
+ // fills the canvas with red color
+ drawRect(color = Color.Red, alpha = 0.5f)
+ }
+
+ val expected = Color(
+ alpha = 0.5f,
+ red = Color.Red.red,
+ green = Color.Red.green,
+ blue = Color.Red.blue
+ ).compositeOver(Color.White)
+
+ val pixelMap = img.toPixelMap()
+ for (i in 0 until pixelMap.width) {
+ for (j in 0 until pixelMap.height) {
+ val result = pixelMap[i, j]
+ assertEquals(expected.red, result.red, 0.01f)
+ assertEquals(expected.green, result.green, 0.01f)
+ assertEquals(expected.blue, result.blue, 0.01f)
+ assertEquals(expected.alpha, result.alpha, 0.01f)
+ }
+ }
+ }
+
+ @Test
+ fun testDrawRectBrushColorAlpha() {
+ val img = createTestDstImage()
+ CanvasScope().draw(Canvas(img), dstSize) {
+ // Verify that the overload that consumes a brush parameter
+ // fills the canvas with red color
+ drawRect(brush = SolidColor(Color.Red), alpha = 0.5f)
+ }
+
+ val expected = Color(
+ alpha = 0.5f,
+ red = Color.Red.red,
+ green = Color.Red.green,
+ blue = Color.Red.blue
+ ).compositeOver(Color.White)
+
+ val pixelMap = img.toPixelMap()
+ for (i in 0 until pixelMap.width) {
+ for (j in 0 until pixelMap.height) {
+ val result = pixelMap[i, j]
+ assertEquals(expected.red, result.red, 0.01f)
+ assertEquals(expected.green, result.green, 0.01f)
+ assertEquals(expected.blue, result.blue, 0.01f)
+ assertEquals(expected.alpha, result.alpha, 0.01f)
+ }
+ }
+ }
+
+ @Test
+ fun testDrawTranslatedRect() {
+ val img = createTestDstImage()
+ val insetLeft = 10.0f
+ val insetTop = 12.0f
+ CanvasScope().draw(Canvas(img), dstSize) {
+ translate(insetLeft, insetTop) {
+ drawRect(color = Color.Red)
+ }
+ }
+
+ val pixelMap = img.toPixelMap()
+ for (i in 0 until pixelMap.width) {
+ for (j in 0 until pixelMap.height) {
+ val expectedColor =
+ if (i >= insetLeft && j >= insetTop) {
+ Color.Red
+ } else {
+ Color.White
+ }
+ assertEquals("Coordinate: " + i + ", " + j, expectedColor, pixelMap[i, j])
+ }
+ }
+ }
+
+ @Test
+ fun testDrawInsetRect() {
+ val img = createTestDstImage()
+ val insetLeft = 10.0f
+ val insetTop = 12.0f
+ val insetRight = 11.0f
+ val insetBottom = 13.0f
+ CanvasScope().draw(Canvas(img), dstSize) {
+ inset(insetLeft, insetTop, insetRight, insetBottom) {
+ drawRect(color = Color.Red)
+ }
+ }
+
+ val pixelMap = img.toPixelMap()
+ for (i in 0 until pixelMap.width) {
+ for (j in 0 until pixelMap.height) {
+ val expectedColor =
+ if (i >= insetLeft && i < pixelMap.width - insetRight &&
+ j >= insetTop && j < pixelMap.height - insetBottom) {
+ Color.Red
+ } else {
+ Color.White
+ }
+ assertEquals("Coordinate: " + i + ", " + j, expectedColor, pixelMap[i, j])
+ }
+ }
+ }
+
+ @Test
+ fun testInsetRestoredAfterScopedInsetDraw() {
+ val img = createTestDstImage()
+ CanvasScope().draw(Canvas(img), dstSize) {
+ // Verify that the overload that consumes a color parameter
+ // fills the canvas with red color
+ val left = 10.0f
+ val top = 30.0f
+ val right = 20.0f
+ val bottom = 12.0f
+ inset(left, top, right, bottom) {
+ drawRect(color = Color.Red)
+ assertEquals(dstSize.width.value - (left + right), size.width)
+ assertEquals(dstSize.height.value - (top + bottom), size.height)
+ }
+
+ assertEquals(dstSize.width.value, size.width)
+ assertEquals(dstSize.height.value, size.height)
+ }
+ }
+
+ @Test
+ fun testFillOverwritesOldAlpha() {
+ val img = createTestDstImage()
+ CanvasScope().draw(Canvas(img), dstSize) {
+ // Verify that the alpha parameter used in the first draw call is overridden
+ // in the subsequent call that does not specify an alpha value
+ drawRect(color = Color.Blue, alpha = 0.5f)
+ drawRect(color = Color.Red)
+ }
+
+ val pixelMap = img.toPixelMap()
+ for (i in 0 until pixelMap.width) {
+ for (j in 0 until pixelMap.height) {
+ assertEquals(Color.Red, pixelMap[i, j])
+ }
+ }
+ }
+
+ @Test
+ fun testFillOverwritesOldPaintBrushAlpha() {
+ val img = createTestDstImage()
+ CanvasScope().draw(Canvas(img), dstSize) {
+ // Verify that the alpha parameter used in the first draw call is overridden
+ // in the subsequent call that does not specify an alpha value that goes through
+ // a different code path for configuration of the underlying paint
+ drawRect(color = Color.Blue, alpha = 0.5f)
+ drawRect(brush = SolidColor(Color.Red))
+ }
+
+ val pixelMap = img.toPixelMap()
+ for (i in 0 until pixelMap.width) {
+ for (j in 0 until pixelMap.height) {
+ assertEquals(Color.Red, pixelMap[i, j])
+ }
+ }
+ }
+
+ @Test
+ fun testScaleTopLeftPivot() {
+ val canvasScope = CanvasScope()
+
+ val width = 200
+ val height = 200
+ val size = PxSize(Px(width.toFloat()), Px(height.toFloat()))
+ val imageAsset = ImageAsset(width, height)
+
+ canvasScope.draw(Canvas(imageAsset), size) {
+ drawRect(color = Color.Red)
+ scale(0.5f, 0.5f, pivotX = 0.0f, pivotY = 0.0f) {
+ drawRect(color = Color.Blue)
+ }
+ }
+
+ val pixelMap = imageAsset.toPixelMap()
+ assertEquals(Color.Blue, pixelMap[0, 0])
+ assertEquals(Color.Blue, pixelMap[99, 0])
+ assertEquals(Color.Blue, pixelMap[0, 99])
+ assertEquals(Color.Blue, pixelMap[99, 99])
+
+ assertEquals(Color.Red, pixelMap[0, 100])
+ assertEquals(Color.Red, pixelMap[100, 0])
+ assertEquals(Color.Red, pixelMap[100, 100])
+ assertEquals(Color.Red, pixelMap[100, 99])
+ assertEquals(Color.Red, pixelMap[99, 100])
+ }
+
+ @Test
+ fun testScaleCenterDefaultPivot() {
+ val canvasScope = CanvasScope()
+
+ val width = 200
+ val height = 200
+ val size = PxSize(Px(width.toFloat()), Px(height.toFloat()))
+ val imageAsset = ImageAsset(width, height)
+
+ canvasScope.draw(Canvas(imageAsset), size) {
+ drawRect(color = Color.Red)
+ scale(0.5f, 0.5f) {
+ drawRect(color = Color.Blue)
+ }
+ }
+
+ val pixelMap = imageAsset.toPixelMap()
+ val left = width / 2 - 50
+ val top = height / 2 - 50
+ val right = width / 2 + 50 - 1
+ val bottom = height / 2 + 50 - 1
+ assertEquals(Color.Blue, pixelMap[left, top])
+ assertEquals(Color.Blue, pixelMap[right, top])
+ assertEquals(Color.Blue, pixelMap[left, bottom])
+ assertEquals(Color.Blue, pixelMap[right, bottom])
+
+ assertEquals(Color.Red, pixelMap[left - 1, top - 1])
+ assertEquals(Color.Red, pixelMap[left - 1, top])
+ assertEquals(Color.Red, pixelMap[left, top - 1])
+
+ assertEquals(Color.Red, pixelMap[right + 1, top - 1])
+ assertEquals(Color.Red, pixelMap[right + 1, top])
+ assertEquals(Color.Red, pixelMap[right, top - 1])
+
+ assertEquals(Color.Red, pixelMap[left - 1, bottom + 1])
+ assertEquals(Color.Red, pixelMap[left - 1, bottom])
+ assertEquals(Color.Red, pixelMap[left, bottom + 1])
+
+ assertEquals(Color.Red, pixelMap[right + 1, bottom + 1])
+ assertEquals(Color.Red, pixelMap[right + 1, bottom])
+ assertEquals(Color.Red, pixelMap[right, bottom + 1])
+ }
+
+ @Test
+ fun testInsetNegativeWidthThrows() {
+ val canvasScope = CanvasScope()
+
+ val width = 200
+ val height = 200
+ val size = PxSize(Px(width.toFloat()), Px(height.toFloat()))
+ val imageAsset = ImageAsset(width, height)
+
+ try {
+ canvasScope.draw(Canvas(imageAsset), size) {
+ inset(100.0f, 0.0f, 100.0f, 0.0f) {
+ drawRect(color = Color.Red)
+ }
+ }
+ fail("Width must be greater than zero after applying inset")
+ } catch (e: IllegalArgumentException) {
+ // no-op
+ }
+ }
+
+ @Test
+ fun testInsetNegativeHeightThrows() {
+ val canvasScope = CanvasScope()
+
+ val width = 200
+ val height = 200
+ val size = PxSize(Px(width.toFloat()), Px(height.toFloat()))
+ val imageAsset = ImageAsset(width, height)
+
+ try {
+ canvasScope.draw(Canvas(imageAsset), size) {
+ inset(0.0f, 100.0f, 0.0f, 100.0f) {
+ drawRect(color = Color.Red)
+ }
+ }
+ fail("Height must be greater than zero after applying inset")
+ } catch (e: IllegalArgumentException) {
+ // no-op
+ }
+ }
+
+ @Test
+ fun testScaleBottomRightPivot() {
+ val canvasScope = CanvasScope()
+
+ val width = 200
+ val height = 200
+ val size = PxSize(Px(width.toFloat()), Px(height.toFloat()))
+ val imageAsset = ImageAsset(width, height)
+
+ canvasScope.draw(Canvas(imageAsset), size) {
+ drawRect(color = Color.Red)
+ scale(0.5f, 0.5f, width.toFloat(), height.toFloat()) {
+ drawRect(color = Color.Blue)
+ }
+ }
+
+ val pixelMap = imageAsset.toPixelMap()
+
+ val left = width - 100
+ val top = height - 100
+ val right = width - 1
+ val bottom = height - 1
+ assertEquals(Color.Blue, pixelMap[left, top])
+ assertEquals(Color.Blue, pixelMap[right, top])
+ assertEquals(Color.Blue, pixelMap[left, bottom])
+ assertEquals(Color.Blue, pixelMap[left, right])
+
+ assertEquals(Color.Red, pixelMap[left, top - 1])
+ assertEquals(Color.Red, pixelMap[left - 1, top])
+ assertEquals(Color.Red, pixelMap[left - 1, top - 1])
+
+ assertEquals(Color.Red, pixelMap[right, top - 1])
+ assertEquals(Color.Red, pixelMap[left - 1, bottom])
+ }
+
+ @Test
+ fun testRotationCenterPivot() {
+ val width = 200
+ val height = 200
+ val size = PxSize(Px(width.toFloat()), Px(height.toFloat()))
+ val imageAsset = ImageAsset(width, height)
+ CanvasScope().draw(Canvas(imageAsset), size) {
+ drawRect(color = Color.Red)
+ rotate(180.0f) {
+ drawRect(
+ topLeft = Offset(100.0f, 100.0f),
+ size = Size(100.0f, 100.0f),
+ color = Color.Blue
+ )
+ }
+ }
+
+ val pixelMap = imageAsset.toPixelMap()
+ assertEquals(Color.Blue, pixelMap[0, 0])
+ assertEquals(Color.Blue, pixelMap[99, 0])
+ assertEquals(Color.Blue, pixelMap[0, 99])
+ assertEquals(Color.Blue, pixelMap[99, 99])
+
+ assertEquals(Color.Red, pixelMap[0, 100])
+ assertEquals(Color.Red, pixelMap[100, 0])
+ assertEquals(Color.Red, pixelMap[100, 100])
+ assertEquals(Color.Red, pixelMap[100, 99])
+ assertEquals(Color.Red, pixelMap[99, 100])
+ }
+
+ @Test
+ fun testRotationTopLeftPivot() {
+ val width = 200
+ val height = 200
+ val size = PxSize(Px(width.toFloat()), Px(height.toFloat()))
+ val imageAsset = ImageAsset(width, height)
+ CanvasScope().draw(Canvas(imageAsset), size) {
+ drawRect(color = Color.Red)
+ rotate(-45.0f, 0.0f, 0.0f) {
+ drawRect(
+ size = Size(100.0f, 100.0f),
+ color = Color.Blue
+ )
+ }
+ }
+
+ val pixelMap = imageAsset.toPixelMap()
+ assertEquals(Color.Blue, pixelMap[2, 0])
+ assertEquals(Color.Blue, pixelMap[50, 49])
+ assertEquals(Color.Blue, pixelMap[70, 0])
+ assertEquals(Color.Blue, pixelMap[70, 68])
+
+ assertEquals(Color.Red, pixelMap[50, 51])
+ assertEquals(Color.Red, pixelMap[75, 76])
+ }
+}
\ No newline at end of file
diff --git a/ui/ui-graphics/src/androidTest/java/androidx/ui/graphics/painter/ImagePainterTest.kt b/ui/ui-graphics/src/androidTest/java/androidx/ui/graphics/painter/ImagePainterTest.kt
index 630ce2e..9269351 100644
--- a/ui/ui-graphics/src/androidTest/java/androidx/ui/graphics/painter/ImagePainterTest.kt
+++ b/ui/ui-graphics/src/androidTest/java/androidx/ui/graphics/painter/ImagePainterTest.kt
@@ -17,7 +17,9 @@
package androidx.ui.graphics.painter
import androidx.test.filters.SmallTest
+import androidx.ui.geometry.Offset
import androidx.ui.geometry.Rect
+import androidx.ui.geometry.Size
import androidx.ui.graphics.BlendMode
import androidx.ui.graphics.Canvas
import androidx.ui.graphics.Color
@@ -131,7 +133,8 @@
val canvas = Canvas(dst)
val topLeftPainter = ImagePainter(srcImage,
- Rect.fromLTWH(0.0f, 0.0f, 50.0f, 50.0f) // Top Left
+ srcOffset = Offset.zero,
+ srcSize = Size(50.0f, 50.0f)
)
val intrinsicSize = topLeftPainter.intrinsicSize
@@ -146,7 +149,8 @@
assertEquals(Color.Red, topLeftMap[49, 49])
val topRightPainter = ImagePainter(srcImage,
- Rect.fromLTWH(50.0f, 0.0f, 50.0f, 50.0f)
+ srcOffset = Offset(50.0f, 0.0f),
+ srcSize = Size(50.0f, 50.0f)
)
val topRightDst = createTestDstImage()
@@ -158,7 +162,8 @@
assertEquals(Color.Blue, topRightMap[49, 49])
val bottomLeftPainter = ImagePainter(srcImage,
- Rect.fromLTWH(0.0f, 50.0f, 50.0f, 50.0f) // Bottom left
+ srcOffset = Offset(0.0f, 50.0f),
+ srcSize = Size(50.0f, 50.0f)
)
bottomLeftPainter.draw(canvas, bottomLeftPainter.intrinsicSize)
@@ -170,7 +175,8 @@
assertEquals(Color.Blue, bottomLeftMap[49, 49])
val bottomRightPainter = ImagePainter(srcImage,
- Rect.fromLTWH(50.0f, 50.0f, 50.0f, 50.0f)
+ srcOffset = Offset(50.0f, 50.0f),
+ srcSize = Size(50.0f, 50.0f)
)
bottomRightPainter.draw(canvas, bottomRightPainter.intrinsicSize)
@@ -186,7 +192,9 @@
fun testInvalidLeftBoundThrows() {
try {
ImagePainter(createTestSrcImage(),
- Rect.fromLTWH(-1.0f, 0.0f, 10.0f, 10.0f))
+ Offset(-1.0f, 1.0f),
+ Size(10.0f, 10.0f)
+ )
fail("Left bound must be greater than or equal to zero")
} catch (e: IllegalArgumentException) {
// no-op
@@ -197,7 +205,9 @@
fun testInvalidTopBoundThrows() {
try {
ImagePainter(createTestSrcImage(),
- Rect.fromLTWH(0.0f, -1.0f, 10.0f, 10.0f))
+ Offset(0.0f, -1.0f),
+ Size(10.0f, 10.0f)
+ )
fail("Top bound must be greater than or equal to zero")
} catch (e: IllegalArgumentException) {
// no-op
@@ -209,7 +219,9 @@
try {
val image = createTestSrcImage()
ImagePainter(image,
- Rect.fromLTWH(0.0f, 0.0f, image.width + 1.0f, 10.0f))
+ Offset(0.0f, 0.0f),
+ Size(image.width + 1.0f, 10.0f)
+ )
fail("Right bound must be less than ImageAsset width")
} catch (e: IllegalArgumentException) {
// no-op
@@ -221,7 +233,9 @@
try {
val image = createTestSrcImage()
ImagePainter(image,
- Rect.fromLTWH(0.0f, 0.0f, 10.0f, image.height + 1.0f))
+ Offset(0.0f, 0.0f),
+ Size(10.0f, image.height + 1.0f)
+ )
fail("Bottom bound must be less than ImageAsset height")
} catch (e: IllegalArgumentException) {
// no-op
@@ -232,7 +246,9 @@
fun testRightLessThanLeftThrows() {
try {
ImagePainter(createTestSrcImage(),
- Rect.fromLTRB(50.0f, 0.0f, 10.0f, 10.0f))
+ Offset(50.0f, 0.0f),
+ Size(-40.0f, 10.0f)
+ )
fail("Right bound must be greater than left bound")
} catch (e: IllegalArgumentException) {
// no-op
@@ -243,7 +259,9 @@
fun testTopLessThanBottomThrows() {
try {
ImagePainter(createTestSrcImage(),
- Rect.fromLTRB(0.0f, 100.0f, 10.0f, 10.0f))
+ Offset(0.0f, 100.0f),
+ Size(-90.0f, -90.0f)
+ )
fail("Bottom bound must be larger than top bound")
} catch (e: IllegalArgumentException) {
// no-op
diff --git a/ui/ui-graphics/src/androidTest/java/androidx/ui/graphics/painter/PainterTest.kt b/ui/ui-graphics/src/androidTest/java/androidx/ui/graphics/painter/PainterTest.kt
index 35843f72..0407a9e 100644
--- a/ui/ui-graphics/src/androidTest/java/androidx/ui/graphics/painter/PainterTest.kt
+++ b/ui/ui-graphics/src/androidTest/java/androidx/ui/graphics/painter/PainterTest.kt
@@ -50,7 +50,7 @@
override val intrinsicSize: PxSize
get() = size
- override fun onDraw(canvas: Canvas, bounds: PxSize) {
+ override fun CanvasScope.onDraw() {
didDraw = true
}
}
@@ -66,21 +66,18 @@
fun testPainterRtl() {
val p = object : Painter() {
- private val paint = Paint().apply { this.color = Color.Cyan }
+ var color = Color.Black
override val intrinsicSize: PxSize
get() = size
override fun applyRtl(rtl: Boolean): Boolean {
- paint.color = if (rtl) Color.Red else Color.Cyan
+ color = if (rtl) Color.Red else Color.Cyan
return true
}
- override fun onDraw(canvas: Canvas, bounds: PxSize) {
- canvas.drawRect(
- Rect.fromLTWH(0.0f, 0.0f, 100.0f, 100.0f),
- paint
- )
+ override fun CanvasScope.onDraw() {
+ drawRect(color = color)
}
}
@@ -98,18 +95,11 @@
fun testPainterAlpha() {
val p = object : Painter() {
- val paint = Paint().apply {
- this.color = Color.Red
- }
-
override val intrinsicSize: PxSize
get() = size
- override fun onDraw(canvas: Canvas, bounds: PxSize) {
- canvas.drawRect(
- Rect.fromLTWH(0.0f, 0.0f, bounds.width.value, bounds.height.value),
- paint
- )
+ override fun CanvasScope.onDraw() {
+ drawRect(color = Color.Red)
}
}
@@ -138,12 +128,10 @@
fun testPainterCustomAlpha() {
val p = object : Painter() {
- val paint = Paint().apply {
- this.color = Color.Red
- }
+ var color = Color.Red
override fun applyAlpha(alpha: Float): Boolean {
- paint.color =
+ color =
Color(
alpha = alpha,
red = Color.Red.red,
@@ -156,15 +144,12 @@
override val intrinsicSize: PxSize
get() = size
- override fun onDraw(canvas: Canvas, bounds: PxSize) {
- canvas.drawRect(
- Rect.fromLTWH(0.0f, 0.0f, bounds.width.value, bounds.height.value),
- paint
- )
+ override fun CanvasScope.onDraw() {
+ drawRect(color = color)
}
}
- assertEquals(Color.Red, p.paint.color)
+ assertEquals(Color.Red, p.color)
val image = ImageAsset(100, 100)
val canvas = Canvas(image)
@@ -190,23 +175,18 @@
fun testColorFilter() {
val p = object : Painter() {
- val paint = Paint().apply {
- colorFilter = ColorFilter(Color.Red, BlendMode.srcIn)
- }
+ var colorFilter: ColorFilter? = ColorFilter(Color.Red, BlendMode.srcIn)
override fun applyColorFilter(colorFilter: ColorFilter?): Boolean {
- paint.colorFilter = colorFilter
+ this.colorFilter = colorFilter
return true
}
override val intrinsicSize: PxSize
get() = size
- override fun onDraw(canvas: Canvas, bounds: PxSize) {
- canvas.drawRect(
- Rect.fromLTWH(0.0f, 0.0f, bounds.width.value, bounds.height.value),
- paint
- )
+ override fun CanvasScope.onDraw() {
+ drawRect(color = Color.Black, colorFilter = colorFilter)
}
}
diff --git a/ui/ui-graphics/src/main/java/androidx/ui/graphics/AndroidCanvas.kt b/ui/ui-graphics/src/main/java/androidx/ui/graphics/AndroidCanvas.kt
index ef010da..c962b99 100644
--- a/ui/ui-graphics/src/main/java/androidx/ui/graphics/AndroidCanvas.kt
+++ b/ui/ui-graphics/src/main/java/androidx/ui/graphics/AndroidCanvas.kt
@@ -17,11 +17,9 @@
package androidx.ui.graphics
import android.graphics.Matrix
-import androidx.ui.core.toAndroidRect
-import androidx.ui.core.toAndroidRectF
import androidx.ui.geometry.Offset
-import androidx.ui.geometry.RRect
import androidx.ui.geometry.Rect
+import androidx.ui.geometry.Size
import androidx.ui.graphics.vectormath.Matrix4
import androidx.ui.graphics.vectormath.isIdentity
@@ -51,12 +49,15 @@
fun Canvas(c: android.graphics.Canvas): Canvas =
AndroidCanvas(c)
-private class AndroidCanvas(val internalCanvas: android.graphics.Canvas) :
- Canvas {
+private class AndroidCanvas(val internalCanvas: android.graphics.Canvas) : Canvas {
- private val internalPath = Path()
+ private val srcRect: android.graphics.Rect by lazy(LazyThreadSafetyMode.NONE) {
+ android.graphics.Rect()
+ }
- private val internalRectF = android.graphics.RectF()
+ private val dstRect: android.graphics.Rect by lazy(LazyThreadSafetyMode.NONE) {
+ android.graphics.Rect()
+ }
/**
* @see Canvas.save
@@ -150,30 +151,17 @@
}
}
- /**
- * @see Canvas.clipRect
- */
@SuppressWarnings("deprecation")
- override fun clipRect(rect: Rect, clipOp: ClipOp) {
- val frameworkRect = rect.toAndroidRect()
+ override fun clipRect(left: Float, top: Float, right: Float, bottom: Float, clipOp: ClipOp) {
@Suppress("DEPRECATION")
when (clipOp) {
- ClipOp.intersect -> internalCanvas.clipRect(frameworkRect)
- ClipOp.difference -> internalCanvas.clipRect(frameworkRect,
+ ClipOp.intersect -> internalCanvas.clipRect(left, top, right, bottom)
+ ClipOp.difference -> internalCanvas.clipRect(left, top, right, bottom,
android.graphics.Region.Op.DIFFERENCE)
}
}
/**
- * @see Canvas.clipRRect
- */
- override fun clipRRect(rrect: RRect) {
- internalPath.reset()
- internalPath.addRRect(rrect)
- clipPath(internalPath)
- }
-
- /**
* @see Canvas.clipPath
*/
override fun clipPath(path: Path) {
@@ -193,11 +181,8 @@
)
}
- /**
- * @see Canvas.drawRect
- */
- override fun drawRect(rect: Rect, paint: Paint) {
- internalCanvas.drawRect(rect.toAndroidRectF(), paint.asFrameworkPaint())
+ override fun drawRect(left: Float, top: Float, right: Float, bottom: Float, paint: Paint) {
+ internalCanvas.drawRect(left, top, right, bottom, paint.asFrameworkPaint())
}
override fun drawRoundRect(
@@ -220,13 +205,8 @@
)
}
- /**
- * @see Canvas.drawOval
- */
- override fun drawOval(rect: Rect, paint: Paint) {
- internalRectF.set(rect.toAndroidRect())
- internalCanvas.drawOval(internalRectF,
- paint.asFrameworkPaint())
+ override fun drawOval(left: Float, top: Float, right: Float, bottom: Float, paint: Paint) {
+ internalCanvas.drawOval(left, top, right, bottom, paint.asFrameworkPaint())
}
/**
@@ -241,19 +221,21 @@
)
}
- /**
- * @see Canvas.drawArc
- */
override fun drawArc(
- rect: Rect,
+ left: Float,
+ top: Float,
+ right: Float,
+ bottom: Float,
startAngle: Float,
sweepAngle: Float,
useCenter: Boolean,
paint: Paint
) {
- internalRectF.set(rect.toAndroidRect())
internalCanvas.drawArc(
- internalRectF,
+ left,
+ top,
+ right,
+ bottom,
startAngle,
sweepAngle,
useCenter,
@@ -283,11 +265,31 @@
/**
* @See Canvas.drawImageRect
*/
- override fun drawImageRect(image: ImageAsset, src: Rect?, dst: Rect, paint: Paint) {
+ override fun drawImageRect(
+ image: ImageAsset,
+ srcOffset: Offset,
+ srcSize: Size,
+ dstOffset: Offset,
+ dstSize: Size,
+ paint: Paint
+ ) {
+ // There is no framework API to draw a subset of a target bitmap
+ // that consumes only primitives so lazily allocate a src and dst
+ // rect to populate the dimensions and re-use across calls
internalCanvas.drawBitmap(
image.asAndroidBitmap(),
- src?.toAndroidRect(),
- dst.toAndroidRect(),
+ srcRect.apply {
+ left = srcOffset.dx.toInt()
+ top = srcOffset.dy.toInt()
+ right = (srcOffset.dx + srcSize.width).toInt()
+ bottom = (srcOffset.dy + srcSize.height).toInt()
+ },
+ dstRect.apply {
+ left = dstOffset.dx.toInt()
+ top = dstOffset.dy.toInt()
+ right = (dstOffset.dx + dstSize.width).toInt()
+ bottom = (dstOffset.dy + dstSize.height).toInt()
+ },
paint.asFrameworkPaint()
)
}
diff --git a/ui/ui-graphics/src/main/java/androidx/ui/graphics/Brush.kt b/ui/ui-graphics/src/main/java/androidx/ui/graphics/Brush.kt
index 02a793a..bccb1c8 100644
--- a/ui/ui-graphics/src/main/java/androidx/ui/graphics/Brush.kt
+++ b/ui/ui-graphics/src/main/java/androidx/ui/graphics/Brush.kt
@@ -19,13 +19,14 @@
import androidx.ui.geometry.Offset
import androidx.ui.unit.Px
-interface Brush {
- fun applyTo(p: Paint)
+sealed class Brush {
+ abstract fun applyTo(p: Paint)
}
-data class SolidColor(val value: Color) : Brush {
+class SolidColor(val value: Color) : Brush() {
override fun applyTo(p: Paint) {
- p.color = value
+ if (p.color != value) p.color = value
+ if (p.shader != null) p.shader = null
}
}
@@ -54,8 +55,7 @@
endX: Px,
endY: Px,
tileMode: TileMode = TileMode.Clamp
-): LinearGradient {
- return LinearGradient(
+) = LinearGradient(
colors,
null,
startX,
@@ -64,7 +64,6 @@
endY,
tileMode
)
-}
/**
* Creates a linear gradient with the provided colors along the given start and end coordinates.
@@ -89,8 +88,7 @@
endX: Px,
endY: Px,
tileMode: TileMode = TileMode.Clamp
-): LinearGradient {
- return LinearGradient(
+) = LinearGradient(
List<Color>(colorStops.size) { i -> colorStops[i].second },
List<Float>(colorStops.size) { i -> colorStops[i].first },
startX,
@@ -99,7 +97,6 @@
endY,
tileMode
)
-}
/**
* Creates a radial gradient with the given colors at the provided offset defined in the [ColorStop]
@@ -121,8 +118,7 @@
centerY: Float,
radius: Float,
tileMode: TileMode = TileMode.Clamp
-): RadialGradient {
- return RadialGradient(
+) = RadialGradient(
List<Color>(colorStops.size) { i -> colorStops[i].second },
List<Float>(colorStops.size) { i -> colorStops[i].first },
centerX,
@@ -130,7 +126,6 @@
radius,
tileMode
)
-}
/**
* Creates a radial gradient with the given colors evenly dispersed within the gradient
@@ -152,9 +147,7 @@
centerY: Float,
radius: Float,
tileMode: TileMode = TileMode.Clamp
-): RadialGradient {
- return RadialGradient(colors, null, centerX, centerY, radius, tileMode)
-}
+) = RadialGradient(colors, null, centerX, centerY, radius, tileMode)
/**
* Creates a vertical gradient with the given colors at the provided offset defined in the [ColorStop]
@@ -175,8 +168,7 @@
startY: Px,
endY: Px,
tileMode: TileMode = TileMode.Clamp
-): LinearGradient {
- return LinearGradient(
+) = LinearGradient(
colors,
null,
startX = Px.Zero,
@@ -185,7 +177,6 @@
endY = endY,
tileMode = tileMode
)
-}
/**
* Creates a vertical gradient with the given colors evenly dispersed within the gradient
@@ -205,8 +196,7 @@
startY: Px,
endY: Px,
tileMode: TileMode = TileMode.Clamp
-): LinearGradient {
- return LinearGradient(
+) = LinearGradient(
List<Color>(colorStops.size) { i -> colorStops[i].second },
List<Float>(colorStops.size) { i -> colorStops[i].first },
startX = Px.Zero,
@@ -215,7 +205,6 @@
endY = endY,
tileMode = tileMode
)
-}
/**
* Creates a horizontal gradient with the given colors evenly dispersed within the gradient
@@ -236,8 +225,7 @@
startX: Px,
endX: Px,
tileMode: TileMode = TileMode.Clamp
-): LinearGradient {
- return LinearGradient(
+) = LinearGradient(
colors,
null,
startX = startX,
@@ -246,7 +234,6 @@
endY = Px.Zero,
tileMode = tileMode
)
-}
/**
* Creates a horizontal gradient with the given colors dispersed at the provided offset defined in the [ColorStop]
@@ -298,7 +285,7 @@
stops,
tileMode
)
- )
+)
/**
* Brush implementation used to apply a radial gradient on a given [Paint]
@@ -318,13 +305,14 @@
stops,
tileMode
)
- )
+)
/**
* Brush implementation that wraps and applies a the provided shader to a [Paint]
*/
-open class ShaderBrush(val shader: Shader) : Brush {
- override fun applyTo(p: Paint) {
- p.shader = shader
+open class ShaderBrush(val shader: Shader) : Brush() {
+ final override fun applyTo(p: Paint) {
+ if (p.color != Color.Black) p.color = Color.Black
+ if (p.shader != shader) p.shader = shader
}
}
\ No newline at end of file
diff --git a/ui/ui-graphics/src/main/java/androidx/ui/graphics/Canvas.kt b/ui/ui-graphics/src/main/java/androidx/ui/graphics/Canvas.kt
index 064cdca..6e54b10 100644
--- a/ui/ui-graphics/src/main/java/androidx/ui/graphics/Canvas.kt
+++ b/ui/ui-graphics/src/main/java/androidx/ui/graphics/Canvas.kt
@@ -17,8 +17,8 @@
package androidx.ui.graphics
import androidx.ui.geometry.Offset
-import androidx.ui.geometry.RRect
import androidx.ui.geometry.Rect
+import androidx.ui.geometry.Size
import androidx.ui.graphics.vectormath.Matrix4
import androidx.ui.graphics.vectormath.degrees
@@ -33,7 +33,7 @@
*
* A canvas also has a current clip region which is applied to all operations.
* Initially, the clip region is infinite. It can be modified using the
- * [Canvas.clipRect], [Canvas.clipRRect], and [Canvas.clipPath] methods.
+ * [Canvas.clipRect], and [Canvas.clipPath] methods.
*
* The current transform and clip can be saved and restored using the stack
* managed by the [Canvas.save], [Canvas.saveLayer], and [Canvas.restore] methods.
@@ -100,8 +100,7 @@
*
* When a rectangular clip operation (from [Canvas.clipRect]) is not axis-aligned
* with the raster buffer, or when the clip operation is not rectalinear (e.g.
- * because it is a rounded rectangle clip created by [Canvas.clipRRect] or an
- * arbitrarily complicated path clip created by [Canvas.clipPath]), the edge of the
+ * because it is a rounded rectangle clip created by [Canvas.clipPath]), the edge of the
* clip needs to be anti-aliased.
*
* If two draw calls overlap at the edge of such a clipped region, without
@@ -243,8 +242,7 @@
*
* When a rectangular clip operation (from [clipRect]) is not axis-aligned
* with the raster buffer, or when the clip operation is not rectalinear (e.g.
- * because it is a rounded rectangle clip created by [clipRRect] or an
- * arbitrarily complicated path clip created by [clipPath]), the edge of the
+ * because it is a rounded rectangle clip created by [clipPath], the edge of the
* clip needs to be anti-aliased.
*
* If two draw calls overlap at the edge of such a clipped region, without
@@ -258,8 +256,8 @@
*
*
- * (Incidentally, rather than using [clipRRect] to draw
- * rounded rectangles like this, prefer the [drawRoundRect] method.
+ * (Incidentally, rather than using [clipPath] with a rounded rectangle defined in a path to
+ * draw rounded rectangles like this, prefer the [drawRoundRect] method.
*
* ## Performance considerations
*
@@ -350,18 +348,34 @@
* current clip.
*/
@SuppressWarnings("deprecation")
- fun clipRect(rect: Rect, clipOp: ClipOp = ClipOp.intersect)
+ fun clipRect(rect: Rect, clipOp: ClipOp = ClipOp.intersect) =
+ clipRect(rect.left, rect.top, rect.right, rect.bottom, clipOp)
/**
* Reduces the clip region to the intersection of the current clip and the
- * given rounded rectangle.
+ * given bounds.
*
- * If [Paint.isAntiAlias] is true, then the clip will be anti-aliased. If
+ * If the clip is not axis-aligned with the display device, and
+ * [Paint.isAntiAlias] is true, then the clip will be anti-aliased. If
* multiple draw commands intersect with the clip boundary, this can result
* in incorrect blending at the clip boundary. See [saveLayer] for a
- * discussion of how to address that and some examples of using [clipRRect].
+ * discussion of how to address that.
+ *
+ * Use [ClipOp.difference] to subtract the provided rectangle from the
+ * current clip.
+ *
+ * @param left Left bound of the clip region
+ * @param top Top bound of the clip region
+ * @param right Right bound of the clip region
+ * @param bottom Bottom bound of the clip region
*/
- fun clipRRect(rrect: RRect)
+ fun clipRect(
+ left: Float,
+ top: Float,
+ right: Float,
+ bottom: Float,
+ clipOp: ClipOp = ClipOp.intersect
+ )
/**
* Reduces the clip region to the intersection of the current clip and the
@@ -386,7 +400,31 @@
* Draws a rectangle with the given [Paint]. Whether the rectangle is filled
* or stroked (or both) is controlled by [Paint.style].
*/
- fun drawRect(rect: Rect, paint: Paint)
+ fun drawRect(rect: Rect, paint: Paint) = drawRect(
+ left = rect.left,
+ top = rect.top,
+ right = rect.right,
+ bottom = rect.bottom,
+ paint = paint
+ )
+
+ /**
+ * Draws a rectangle with the given [Paint]. Whether the rectangle is filled
+ * or stroked (or both) is controlled by [Paint.style].
+ *
+ * @param left The left bound of the rectangle
+ * @param top The top bound of the rectangle
+ * @param right The right bound of the rectangle
+ * @param bottom The bottom bound of the rectangle
+ * @param paint Paint used to color the rectangle with a fill or stroke
+ */
+ fun drawRect(
+ left: Float,
+ top: Float,
+ right: Float,
+ bottom: Float,
+ paint: Paint
+ )
/**
* Draws a rounded rectangle with the given [Paint]. Whether the rectangle is
@@ -407,7 +445,26 @@
* with the given [Paint]. Whether the oval is filled or stroked (or both) is
* controlled by [Paint.style].
*/
- fun drawOval(rect: Rect, paint: Paint)
+ fun drawOval(rect: Rect, paint: Paint) = drawOval(
+ left = rect.left,
+ top = rect.top,
+ right = rect.right,
+ bottom = rect.bottom,
+ paint = paint
+ )
+
+ /**
+ * Draws an axis-aligned oval that fills the given bounds provided with the given
+ * [Paint]. Whether the rectangle is filled
+ * or stroked (or both) is controlled by [Paint.style].
+ *
+ * @param left The left bound of the rectangle
+ * @param top The top bound of the rectangle
+ * @param right The right bound of the rectangle
+ * @param bottom The bottom bound of the rectangle
+ * @param paint Paint used to color the rectangle with a fill or stroke
+ */
+ fun drawOval(left: Float, top: Float, right: Float, bottom: Float, paint: Paint)
/**
* Draws a circle centered at the point given by the first argument and
@@ -435,6 +492,47 @@
sweepAngle: Float,
useCenter: Boolean,
paint: Paint
+ ) = drawArc(
+ left = rect.left,
+ top = rect.top,
+ right = rect.right,
+ bottom = rect.bottom,
+ startAngle = startAngle,
+ sweepAngle = sweepAngle,
+ useCenter = useCenter,
+ paint = paint
+ )
+
+ /**
+ * Draw an arc scaled to fit inside the given rectangle. It starts from
+ * startAngle degrees around the oval up to startAngle + sweepAngle
+ * degrees around the oval, with zero degrees being the point on
+ * the right hand side of the oval that crosses the horizontal line
+ * that intersects the center of the rectangle and with positive
+ * angles going clockwise around the oval. If useCenter is true, the arc is
+ * closed back to the center, forming a circle sector. Otherwise, the arc is
+ * not closed, forming a circle segment.
+ *
+ * This method is optimized for drawing arcs and should be faster than [Path.arcTo].
+ *
+ * @param left Left bound of the arc
+ * @param top Top bound of the arc
+ * @param right Right bound of the arc
+ * @param bottom Bottom bound of the arc
+ * @param startAngle Starting angle of the arc relative to 3 o'clock
+ * @param sweepAngle Sweep angle in degrees clockwise
+ * @param useCenter Flag indicating whether or not to include the center of the oval in the
+ * arc, and close it if it is being stroked. This will draw a wedge.
+ */
+ fun drawArc(
+ left: Float,
+ top: Float,
+ right: Float,
+ bottom: Float,
+ startAngle: Float,
+ sweepAngle: Float,
+ useCenter: Boolean,
+ paint: Paint
)
/**
@@ -480,12 +578,23 @@
* an applied filter.
*
* @param image ImageAsset to draw
- * @param src Optional rectangular section of the image to draw into the dst
- * @param dst Required rectangular region to draw contents of the [ImageAsset] into. Contents
- * of the subsection provided for [src] will be scaled to fit in the destination bounds
+ * @param srcOffset: Optional offset representing the top left offset of the source image
+ * to draw, this defaults to the origin of [image]
+ * @param srcSize: Optional dimensions of the source image to draw relative to [srcOffset],
+ * this defaults the width and height of [image]
+ * @param dstOffset: Offset representing the top left offset of the destination image
+ * to draw
+ * @param dstSize: Dimensions of the destination to draw
* @param paint Paint used to composite the [ImageAsset] pixels into the canvas
*/
- fun drawImageRect(image: ImageAsset, src: Rect?, dst: Rect, paint: Paint)
+ fun drawImageRect(
+ image: ImageAsset,
+ srcOffset: Offset = Offset.zero,
+ srcSize: Size = Size(image.width.toFloat(), image.height.toFloat()),
+ dstOffset: Offset,
+ dstSize: Size,
+ paint: Paint
+ )
/**
* Draw the given picture onto the canvas. To create a picture, see
diff --git a/ui/ui-graphics/src/main/java/androidx/ui/graphics/Outline.kt b/ui/ui-graphics/src/main/java/androidx/ui/graphics/Outline.kt
index edcd75b..a835ff7 100644
--- a/ui/ui-graphics/src/main/java/androidx/ui/graphics/Outline.kt
+++ b/ui/ui-graphics/src/main/java/androidx/ui/graphics/Outline.kt
@@ -16,8 +16,14 @@
package androidx.ui.graphics
+import androidx.annotation.FloatRange
+import androidx.ui.geometry.Offset
import androidx.ui.geometry.RRect
import androidx.ui.geometry.Rect
+import androidx.ui.geometry.Size
+import androidx.ui.graphics.painter.CanvasScope
+import androidx.ui.graphics.painter.DrawStyle
+import androidx.ui.graphics.painter.Fill
/**
* Defines a simple shape, used for bounding graphical regions.
@@ -69,6 +75,132 @@
}
/**
+ * Draws the [Outline] on a [CanvasScope].
+ *
+ * @param outline the outline to draw.
+ * @param color Color applied to the outline when it is drawn
+ * @param alpha Opacity to be applied to outline from 0.0f to 1.0f representing
+ * fully transparent to fully opaque respectively
+ * @param style Specifies whether the outline is stroked or filled in
+ * @param colorFilter: ColorFilter to apply to the [color] when drawn into the destination
+ * @param blendMode: Blending algorithm to be applied to the outline
+ */
+fun CanvasScope.drawOutline(
+ outline: Outline,
+ color: Color,
+ @FloatRange(from = 0.0, to = 1.0) alpha: Float = CanvasScope.DefaultAlpha,
+ style: DrawStyle = Fill,
+ colorFilter: ColorFilter? = null,
+ blendMode: BlendMode = CanvasScope.DefaultBlendMode
+) = drawOutlineHelper(
+ outline,
+ { rect ->
+ drawRect(color, rect.topLeft(), rect.size(), alpha, style, colorFilter, blendMode)
+ },
+ { rrect ->
+ val radius = rrect.bottomLeftRadiusX
+ drawRoundRect(
+ color = color,
+ topLeft = rrect.topLeft(),
+ size = rrect.size(),
+ radiusX = radius,
+ radiusY = radius,
+ alpha = alpha,
+ style = style,
+ colorFilter = colorFilter,
+ blendMode = blendMode
+ )
+ },
+ { path -> drawPath(path, color, alpha, style, colorFilter, blendMode) }
+ )
+
+/**
+ * Draws the [Outline] on a [CanvasScope].
+ *
+ * @param outline the outline to draw.
+ * @param brush Brush applied to the outline when it is drawn
+ * @param alpha Opacity to be applied to outline from 0.0f to 1.0f representing
+ * fully transparent to fully opaque respectively
+ * @param style Specifies whether the outline is stroked or filled in
+ * @param colorFilter: ColorFilter to apply to the [Brush] when drawn into the destination
+ * @param blendMode: Blending algorithm to be applied to the outline
+ */
+fun CanvasScope.drawOutline(
+ outline: Outline,
+ brush: Brush,
+ @FloatRange(from = 0.0, to = 1.0) alpha: Float = CanvasScope.DefaultAlpha,
+ style: DrawStyle = Fill,
+ colorFilter: ColorFilter? = null,
+ blendMode: BlendMode = CanvasScope.DefaultBlendMode
+) = drawOutlineHelper(
+ outline,
+ { rect ->
+ drawRect(brush, rect.topLeft(), rect.size(), alpha, style, colorFilter, blendMode)
+ },
+ { rrect ->
+ val radius = rrect.bottomLeftRadiusX
+ drawRoundRect(
+ brush = brush,
+ topLeft = rrect.topLeft(),
+ size = rrect.size(),
+ radiusX = radius,
+ radiusY = radius,
+ alpha = alpha,
+ style = style,
+ colorFilter = colorFilter,
+ blendMode = blendMode
+ )
+ },
+ { path -> drawPath(path, brush, alpha, style, colorFilter, blendMode) }
+ )
+
+/**
+ * Convenience method to obtain an Offset from the Rect's top and left parameters
+ */
+private fun Rect.topLeft(): Offset = Offset(left, top)
+
+/**
+ * Convenience method to obtain a Size from the Rect's width and height
+ */
+private fun Rect.size(): Size = Size(width, height)
+
+/**
+ * Convenience method to obtain an Offset from the RRect's top and left parameters
+ */
+private fun RRect.topLeft(): Offset = Offset(left, top)
+
+/**
+ * Convenience method to obtain a Size from the RRect's width and height parameters
+ */
+private fun RRect.size(): Size = Size(width, height)
+
+/**
+ * Helper method that allows for delegation of appropriate drawing call based on type of
+ * underlying outline shape
+ */
+private inline fun CanvasScope.drawOutlineHelper(
+ outline: Outline,
+ drawRectBlock: CanvasScope.(rect: Rect) -> Unit,
+ drawRoundedRectBlock: CanvasScope.(rrect: RRect) -> Unit,
+ drawPathBlock: CanvasScope.(path: Path) -> Unit
+) = when (outline) {
+ is Outline.Rectangle -> drawRectBlock(outline.rect)
+ is Outline.Rounded -> {
+ val path = outline.roundRectPath
+ // If the rounded rect has a path, then the corner radii are not the same across
+ // each of the corners, so we draw the given path.
+ // If there is no path available, then the corner radii are identical so call the
+ // Canvas primitive for drawing a rounded rectangle
+ if (path != null) {
+ drawPathBlock(path)
+ } else {
+ drawRoundedRectBlock(outline.rrect)
+ }
+ }
+ is Outline.Generic -> drawPathBlock(outline.path)
+ }
+
+/**
* Draws the [Outline] on a [Canvas].
*
* @param outline the outline to draw.
diff --git a/ui/ui-graphics/src/main/java/androidx/ui/graphics/painter/CanvasScope.kt b/ui/ui-graphics/src/main/java/androidx/ui/graphics/painter/CanvasScope.kt
new file mode 100644
index 0000000..9c149ac
--- /dev/null
+++ b/ui/ui-graphics/src/main/java/androidx/ui/graphics/painter/CanvasScope.kt
@@ -0,0 +1,1021 @@
+/*
+ * Copyright 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT 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.ui.graphics.painter
+
+import android.graphics.PathEffect
+import androidx.annotation.FloatRange
+import androidx.ui.geometry.Offset
+import androidx.ui.geometry.Size
+import androidx.ui.graphics.BlendMode
+import androidx.ui.graphics.Brush
+import androidx.ui.graphics.Canvas
+import androidx.ui.graphics.ClipOp
+import androidx.ui.graphics.Color
+import androidx.ui.graphics.ColorFilter
+import androidx.ui.graphics.ImageAsset
+import androidx.ui.graphics.Paint
+import androidx.ui.graphics.PaintingStyle
+import androidx.ui.graphics.Path
+import androidx.ui.graphics.PointMode
+import androidx.ui.graphics.StrokeCap
+import androidx.ui.graphics.StrokeJoin
+import androidx.ui.graphics.scale
+import androidx.ui.graphics.rotate
+import androidx.ui.graphics.vectormath.degrees
+import androidx.ui.unit.Px
+import androidx.ui.unit.PxSize
+
+/**
+ * Simultaneously translate the [CanvasScope] coordinate space by [left] and [top] as well as modify
+ * the dimensions of the current painting area. This provides a callback to issue more
+ * drawing instructions within the modified coordinate space. This method
+ * modifies the width of the [CanvasScope] to be equivalent to width - (left + right) as well as
+ * height to height - (top + bottom)
+ *
+ * @param left number of pixels to inset the left drawing bound
+ * @param top number of pixels to inset the top drawing bound
+ * @param right number of pixels to inset the right drawing bound
+ * @param block lambda that is called to issue drawing commands within the inset coordinate space
+ */
+inline fun CanvasScope.inset(
+ left: Float,
+ top: Float,
+ right: Float,
+ bottom: Float,
+ block: CanvasScope.() -> Unit
+) {
+ doInset(left, top, right, bottom)
+ block()
+ doInset(-left, -top, -right, -bottom)
+}
+
+/**
+ * Convenience method modifies the [CanvasScope] bounds to inset both left and right bounds by
+ * [dx] as well as the top and bottom by [dy]. If only [dx] is provided, the same inset is applied
+ * to all 4 bounds
+ *
+ * @param dx number of pixels to inset both left and right bounds
+ * @param dy Optional number of pixels to inset both top and bottom bounds, by default this also
+ * insets the top and bottom by [dx] pixels
+ * @param block lambda that is called to issue additional drawing commands within the modified
+ * coordinate space
+ */
+inline fun CanvasScope.inset(dx: Float, dy: Float = dx, block: CanvasScope.() -> Unit) =
+ inset(dx, dy, dx, dy, block)
+
+/**
+ * Translate the coordinate space by the given delta in pixels in both the x and y coordinates
+ * respectively
+ *
+ * @param dx Pixels to translate the coordinate space in the x-axis
+ * @param dy Pixels to translate the coordinate space in the y-axis
+ * @param block lambda that is called to issue drawing commands within the
+ * translated coordinate space
+ */
+inline fun CanvasScope.translate(dx: Float, dy: Float, block: CanvasScope.() -> Unit) =
+ canvas?.apply {
+ translate(dx, dy)
+ block()
+ translate(-dx, -dy)
+ }
+
+/**
+ * Add a rotation (in degrees clockwise) to the current transform at the given pivot point.
+ * The pivot coordinate remains unchanged by the rotation transformation. After the provided
+ * lambda is invoked, the rotation transformation is undone.
+ *
+ * @param degrees to rotate clockwise
+ * @param pivotX The x-coord for the pivot point, defaults to the center of the coordinate space
+ * along the x-axis
+ * @param pivotY The y-coord for the pivot point, defaults to the center of the coordinate space
+ * along the y-axis
+ * @param block lambda that is called to issue drawing commands within the rotated
+ * coordinate space
+ */
+inline fun CanvasScope.rotate(
+ degrees: Float,
+ pivotX: Float = center.dx,
+ pivotY: Float = center.dy,
+ block: CanvasScope.() -> Unit
+) = canvas?.apply {
+ rotate(degrees, pivotX, pivotY)
+ block()
+ rotate(-degrees, pivotX, pivotY)
+ }
+
+/**
+ * Add a rotation (in radians clockwise) to the current transform at the given pivot point.
+ * The pivot coordinate remains unchanged by the rotation transformation
+ *
+ * @param radians to rotate clockwise
+ * @param pivotX The x-coord for the pivot point, defaults to the center of the coordinate space
+ * along the x-axis
+ * @param pivotY The y-coord for the pivot point, defaults to the center of the coordinate space
+ * along the y-axis
+ * @param block lambda that is called to issue drawing commands within the rotated
+ * coordinate space
+ */
+inline fun CanvasScope.rotateRad(
+ radians: Float,
+ pivotX: Float = center.dx,
+ pivotY: Float = center.dy,
+ block: CanvasScope.() -> Unit
+) = rotate(degrees(radians), pivotX, pivotY, block)
+
+/**
+ * Add an axis-aligned scale to the current transform, scaling by the first
+ * argument in the horizontal direction and the second in the vertical
+ * direction at the given pivot coordinate. The pivot coordinate remains
+ * unchanged by the scale transformation.
+ *
+ * If [scaleY] is unspecified, [scaleX] will be used for the scale in both
+ * directions.
+ *
+ * @param scaleX The amount to scale in X
+ * @param scaleY The amount to scale in Y
+ * @param pivotX The x-coord for the pivot point
+ * @param pivotY The y-coord for the pivot point
+ * @param block lambda used to issue drawing commands within the scaled coordinate space
+ */
+inline fun CanvasScope.scale(
+ scaleX: Float,
+ scaleY: Float,
+ pivotX: Float = center.dx,
+ pivotY: Float = center.dy,
+ block: CanvasScope.() -> Unit
+) = canvas?.apply {
+ save()
+ scale(scaleX, scaleY, pivotX, pivotY)
+ block()
+ restore()
+ }
+
+/**
+ * Reduces the clip region to the intersection of the current clip and the
+ * given rectangle indicated by the given [Offset] from the top left as well as
+ * the dimensions of the rectangle represeted by [size].
+ *
+ * Use [ClipOp.difference] to subtract the provided rectangle from the
+ * current clip.
+ *
+ * @param topLeft Offset from the origin of the current translation to clip, defaults to 0, 0
+ * @param size Dimensions of the rectangle to clip, defaults to the current size of the drawing
+ * environment
+ * @param clipOp Clipping operation to conduct on the given bounds, defaults to [ClipOp.intersect]
+ * @param block Lambda callback with this CanvasScope as a receiver scope to issue drawing commands
+ * within the provided clip
+ */
+inline fun CanvasScope.clipRect(
+ topLeft: Offset = Offset.zero,
+ size: Size = this.size,
+ clipOp: ClipOp = ClipOp.intersect,
+ block: CanvasScope.() -> Unit
+) = canvas?.apply {
+ save()
+ clipRect(
+ topLeft.dx,
+ topLeft.dy,
+ topLeft.dx + size.width,
+ topLeft.dy + size.height,
+ clipOp
+ )
+ block()
+ restore()
+ }
+
+/**
+ * Reduces the clip region to the intersection of the current clip and the
+ * given rounded rectangle.
+ *
+ */
+inline fun CanvasScope.clipPath(path: Path, block: CanvasScope.() -> Unit) =
+ canvas?.apply {
+ save()
+ clipPath(path)
+ block()
+ restore()
+ }
+
+/**
+ * Provides access to draw directly with the underlying [Canvas] along with the current
+ * size of the [CanvasScope]. This is helpful for situations
+ * to re-use alternative drawing logic in combination with [CanvasScope]
+ *
+ * @param block Lambda callback to issue drawing commands on the provided [Canvas] and given size
+ */
+inline fun CanvasScope.drawCanvas(block: (Canvas, PxSize) -> Unit) =
+ canvas?.let {
+ block(it, PxSize(Px(size.width), Px(size.height)))
+ }
+
+/**
+ * Creates a scoped drawing environment with the provided [Canvas]. This provides a
+ * declarative, stateless API to draw shapes and paths without requiring
+ * consumers to maintain underlying [Canvas] state information.
+ * The bounds for drawing within [CanvasScope] are provided by the call to
+ * [CanvasScope.draw] and are always bound to the local translation. That is the left and
+ * top coordinates are always the origin and the right and bottom coordinates are always the
+ * specified width and height respectively. Drawing content is not clipped,
+ * so it is possible to draw outside of the specified bounds.
+ *
+ * @sample androidx.ui.graphics.samples.canvasScopeSample
+ */
+class CanvasScope {
+
+ @PublishedApi internal var canvas: Canvas? = null
+
+ /**
+ * Internal [Paint] used only for drawing filled in shapes with a color or gradient
+ * This is lazily allocated on the first drawing command that uses the [Fill] [DrawStyle]
+ * and re-used across subsequent calls
+ */
+ private val fillPaint: Paint by lazy(LazyThreadSafetyMode.NONE) {
+ Paint().apply { style = PaintingStyle.fill }
+ }
+
+ /**
+ * Internal [Paint] used only for drawing stroked shapes with a color or gradient
+ * This is lazily allocated on the first drawing command that uses the [Stroke] [DrawStyle]
+ * and re-used across subsequent calls
+ */
+ private val strokePaint: Paint by lazy(LazyThreadSafetyMode.NONE) {
+ Paint().apply { style = PaintingStyle.stroke }
+ }
+
+ /**
+ * Center of the current bounds of the drawing environment
+ */
+ val center: Offset
+ get() = Offset(size.width / 2, size.height / 2)
+
+ /**
+ * Provides the dimensions of the current drawing environment
+ */
+ var size: Size = Size.zero
+ private set
+
+ /**
+ * Draws a line between the given points using the given paint. The line is
+ * stroked.
+ *
+ * @param brush: the color or fill to be applied to the line
+ * @param p1: First point of the line to be drawn
+ * @param p2: Second point of the line to be drawn
+ * @param stroke: The stroke parameters to apply to the line
+ * @param alpha: opacity to be applied to the [brush] from 0.0f to 1.0f representing
+ * fully transparent to fully opaque respectively
+ * @param colorFilter: ColorFilter to apply to the [brush] when drawn into the destination
+ * @param blendMode: the blending algorithm to apply to the [brush]
+ */
+ fun drawLine(
+ brush: Brush,
+ p1: Offset,
+ p2: Offset,
+ stroke: Stroke,
+ @FloatRange(from = 0.0, to = 1.0) alpha: Float = DefaultAlpha,
+ colorFilter: ColorFilter? = null,
+ blendMode: BlendMode = DefaultBlendMode
+ ) = canvas?.drawLine(
+ p1,
+ p2,
+ configurePaint(brush, stroke, alpha, colorFilter, blendMode)
+ )
+
+ /**
+ * Draws a line between the given points using the given paint. The line is
+ * stroked.
+ *
+ * @param color: the color to be applied to the line
+ * @param p1: First point of the line to be drawn
+ * @param p2: Second point of the line to be drawn
+ * @param stroke: The stroke parameters to apply to the line
+ * @param alpha: opacity to be applied to the [color] from 0.0f to 1.0f representing
+ * fully transparent to fully opaque respectively
+ * @param colorFilter: ColorFilter to apply to the [color] when drawn into the destination
+ * @param blendMode: the blending algorithm to apply to the [color]
+ */
+ fun drawLine(
+ color: Color,
+ p1: Offset,
+ p2: Offset,
+ stroke: Stroke,
+ @FloatRange(from = 0.0, to = 1.0) alpha: Float = DefaultAlpha,
+ colorFilter: ColorFilter? = null,
+ blendMode: BlendMode = DefaultBlendMode
+ ) = canvas?.drawLine(
+ p1,
+ p2,
+ configurePaint(color, stroke, alpha, colorFilter, blendMode)
+ )
+
+ /**
+ * Draws a rectangle with the given offset and size. If no offset from the top left is provided,
+ * it is drawn starting from the origin of the current translation. If no size is provided,
+ * the size of the current environment is used.
+ *
+ * @param brush: The color or fill to be applied to the rectangle
+ * @param topLeft: Offset from the local origin of 0, 0 relative to the current translation
+ * @param size: Dimensions of the rectangle to draw
+ * @param alpha: Opacity to be applied to the [brush] from 0.0f to 1.0f representing
+ * fully transparent to fully opaque respectively
+ * @param style: Whether or not the rectangle is stroked or filled in
+ * @param colorFilter: ColorFilter to apply to the [brush] when drawn into the destination
+ * @param blendMode: Blending algorithm to apply to destination
+ */
+ fun drawRect(
+ brush: Brush,
+ topLeft: Offset = Offset.zero,
+ size: Size = this.size,
+ @FloatRange(from = 0.0, to = 1.0) alpha: Float = DefaultAlpha,
+ style: DrawStyle = Fill,
+ colorFilter: ColorFilter? = null,
+ blendMode: BlendMode = DefaultBlendMode
+ ) = canvas?.drawRect(
+ left = topLeft.dx,
+ top = topLeft.dy,
+ right = topLeft.dx + size.width,
+ bottom = topLeft.dy + size.height,
+ paint = configurePaint(brush, style, alpha, colorFilter, blendMode)
+ )
+
+ /**
+ * Draws a rectangle with the given offset and size. If no offset from the top left is provided,
+ * it is drawn starting from the origin of the current translation. If no size is provided,
+ * the size of the current environment is used.
+ *
+ * @param color: The color to be applied to the rectangle
+ * @param topLeft: Offset from the local origin of 0, 0 relative to the current translation
+ * @param size: Dimensions of the rectangle to draw
+ * @param alpha: Opacity to be applied to the [color] from 0.0f to 1.0f representing
+ * fully transparent to fully opaque respectively
+ * @param style: Whether or not the rectangle is stroked or filled in
+ * @param colorFilter: ColorFilter to apply to the [color] source pixels
+ * @param blendMode: Blending algorithm to apply to destination
+ */
+ fun drawRect(
+ color: Color,
+ topLeft: Offset = Offset.zero,
+ size: Size = this.size,
+ @FloatRange(from = 0.0, to = 1.0) alpha: Float = DefaultAlpha,
+ style: DrawStyle = Fill,
+ colorFilter: ColorFilter? = null,
+ blendMode: BlendMode = DefaultBlendMode
+ ) = canvas?.drawRect(
+ left = topLeft.dx,
+ top = topLeft.dy,
+ right = topLeft.dx + size.width,
+ bottom = topLeft.dy + size.height,
+ paint = configurePaint(color, style, alpha, colorFilter, blendMode)
+ )
+
+ /**
+ * Draws the given [ImageAsset] into the canvas with its top-left corner at the
+ * given [Offset]. The image is composited into the canvas using the given [Paint].
+ *
+ * @param image The [ImageAsset] to draw
+ * @param topLeft Offset from the local origin of 0, 0 relative to the current translation
+ * @param alpha Opacity to be applied to [image] from 0.0f to 1.0f representing
+ * fully transparent to fully opaque respectively
+ * @param style Specifies whether the image is to be drawn filled in or as a rectangular stroke
+ * @param colorFilter: ColorFilter to apply to the [image] when drawn into the destination
+ * @param blendMode: Blending algorithm to apply to destination
+ */
+ fun drawImage(
+ image: ImageAsset,
+ topLeft: Offset = Offset.zero,
+ @FloatRange(from = 0.0, to = 1.0) alpha: Float = DefaultAlpha,
+ style: DrawStyle = Fill,
+ colorFilter: ColorFilter? = null,
+ blendMode: BlendMode = DefaultBlendMode
+ ) = canvas?.drawImage(
+ image,
+ topLeft,
+ configurePaint(null, style, alpha, colorFilter, blendMode)
+ )
+
+ /**
+ * Draws the subset of the given image described by the `src` argument into
+ * the canvas in the axis-aligned rectangle given by the `dst` argument.
+ *
+ * If no src rect is provided, the entire image is scaled into the corresponding destination
+ * bounds
+ *
+ * @param image: The source image to draw
+ * @param srcOffset: Optional offset representing the top left offset of the source image
+ * to draw, this defaults to the origin of [image]
+ * @param srcSize: Optional dimensions of the source image to draw relative to [srcOffset],
+ * this defaults the width and height of [image]
+ * @param dstOffset: Optional offset representing the top left offset of the destination
+ * to draw the given image, this defaults to the origin of the current translation
+ * tarting top left offset in the destination to draw the image
+ * @param dstSize: Optional dimensions of the destination to draw, this defaults to the size
+ * of the current drawing environment
+ * @param alpha Opacity to be applied to [image] from 0.0f to 1.0f representing
+ * fully transparent to fully opaque respectively
+ * @param style Specifies whether the image is to be drawn filled in or as a rectangular stroke
+ * @param colorFilter: ColorFilter to apply to the [image] when drawn into the destination
+ * @param blendMode: Blending algorithm to apply to destination
+ */
+ fun drawImage(
+ image: ImageAsset,
+ srcOffset: Offset = Offset.zero,
+ srcSize: Size = Size(image.width.toFloat(), image.height.toFloat()),
+ dstOffset: Offset = Offset.zero,
+ dstSize: Size = this.size,
+ @FloatRange(from = 0.0, to = 1.0) alpha: Float = DefaultAlpha,
+ style: DrawStyle = Fill,
+ colorFilter: ColorFilter? = null,
+ blendMode: BlendMode = DefaultBlendMode
+ ) = canvas?.drawImageRect(
+ image,
+ srcOffset,
+ srcSize,
+ dstOffset,
+ dstSize,
+ configurePaint(null, style, alpha, colorFilter, blendMode)
+ )
+
+ /**
+ * Draws a rounded rectangle with the provided size, offset and radii for the x and y axis
+ * respectively. This rectangle is drawn with the provided [Brush]
+ * parameter and is filled or stroked based on the given [DrawStyle]
+ *
+ * @param brush The color or fill to be applied to the rounded rectangle
+ * @param topLeft Offset from the local origin of 0, 0 relative to the current translation
+ * @param size Dimensions of the rectangle to draw
+ * @param radiusX Corner radius of the rounded rectangle along the x-axis
+ * @param radiusY Corner radius of the rounded rectangle along the y-axis
+ * @param alpha Opacity to be applied to rounded rectangle from 0.0f to 1.0f representing
+ * fully transparent to fully opaque respectively
+ * @param style Specifies whether the rounded rectangle is stroked or filled in
+ * @param colorFilter: ColorFilter to apply to the [brush] when drawn into the destination
+ * @param blendMode: Blending algorithm to be applied to the brush
+ */
+ fun drawRoundRect(
+ brush: Brush,
+ topLeft: Offset = Offset.zero,
+ size: Size = this.size,
+ radiusX: Float = 0.0f,
+ radiusY: Float = radiusX,
+ @FloatRange(from = 0.0, to = 1.0) alpha: Float = DefaultAlpha,
+ style: DrawStyle = Fill,
+ colorFilter: ColorFilter? = null,
+ blendMode: BlendMode = DefaultBlendMode
+ ) = canvas?.drawRoundRect(
+ topLeft.dx,
+ topLeft.dy,
+ topLeft.dx + size.width,
+ topLeft.dy + size.height,
+ radiusX,
+ radiusY,
+ configurePaint(brush, style, alpha, colorFilter, blendMode)
+ )
+
+ /**
+ * Draws a rounded rectangle with the given [Paint]. Whether the rectangle is
+ * filled or stroked (or both) is controlled by [Paint.style].
+ *
+ * @param color The color to be applied to the rounded rectangle
+ * @param topLeft Offset from the local origin of 0, 0 relative to the current translation
+ * @param size Dimensions of the rectangle to draw
+ * @param radiusX Corner radius of the rounded rectangle along the x-axis
+ * @param radiusY Corner radius of the rounded rectangle along the y-axis
+ * @param alpha Opacity to be applied to rounded rectangle from 0.0f to 1.0f representing
+ * fully transparent to fully opaque respectively
+ * @param style Specifies whether the rounded rectangle is stroked or filled in
+ * @param colorFilter: ColorFilter to apply to the [color] when drawn into the destination
+ * @param blendMode: Blending algorithm to be applied to the color
+ */
+ fun drawRoundRect(
+ color: Color,
+ topLeft: Offset = Offset.zero,
+ size: Size = this.size,
+ radiusX: Float = 0.0f,
+ radiusY: Float = 0.0f,
+ style: DrawStyle = Fill,
+ @FloatRange(from = 0.0, to = 1.0) alpha: Float = DefaultAlpha,
+ colorFilter: ColorFilter? = null,
+ blendMode: BlendMode = DefaultBlendMode
+ ) = canvas?.drawRoundRect(
+ topLeft.dx,
+ topLeft.dy,
+ topLeft.dx + size.width,
+ topLeft.dy + size.height,
+ radiusX,
+ radiusY,
+ configurePaint(color, style, alpha, colorFilter, blendMode)
+ )
+
+ /**
+ * Draws a circle at the provided center coordinate and radius. If no center point is provided
+ * the center of the bounds is used.
+ *
+ * @param brush: The color or fill to be applied to the circle
+ * @param radius: The radius of the circle
+ * @param center: The center coordinate where the circle is to be drawn
+ * @param alpha: Opacity to be applied to the circle from 0.0f to 1.0f representing
+ * fully transparent to fully opaque respectively
+ * @param style: Whether or not the circle is stroked or filled in
+ * @param colorFilter: ColorFilter to apply to the [brush] when drawn into the destination
+ * @param blendMode: Blending algorithm to be applied to the brush
+ */
+ fun drawCircle(
+ brush: Brush,
+ radius: Float = size.minDimension / 2.0f,
+ center: Offset = this.center,
+ @FloatRange(from = 0.0, to = 1.0) alpha: Float = DefaultAlpha,
+ style: DrawStyle = Fill,
+ colorFilter: ColorFilter? = null,
+ blendMode: BlendMode = DefaultBlendMode
+ ) = canvas?.drawCircle(
+ center,
+ radius,
+ configurePaint(brush, style, alpha, colorFilter, blendMode)
+ )
+
+ /**
+ * Draws a circle at the provided center coordinate and radius. If no center point is provided
+ * the center of the bounds is used.
+ *
+ * @param color: The color or fill to be applied to the circle
+ * @param radius: The radius of the circle
+ * @param center: The center coordinate where the circle is to be drawn
+ * @param alpha: Opacity to be applied to the circle from 0.0f to 1.0f representing
+ * fully transparent to fully opaque respectively
+ * @param style: Whether or not the circle is stroked or filled in
+ * @param colorFilter: ColorFilter to apply to the [color] when drawn into the destination
+ * @param blendMode: Blending algorithm to be applied to the brush
+ */
+ fun drawCircle(
+ color: Color,
+ radius: Float = size.minDimension / 2.0f,
+ center: Offset = this.center,
+ @FloatRange(from = 0.0, to = 1.0) alpha: Float = DefaultAlpha,
+ style: DrawStyle = Fill,
+ colorFilter: ColorFilter? = null,
+ blendMode: BlendMode = DefaultBlendMode
+ ) = canvas?.drawCircle(
+ center,
+ radius,
+ configurePaint(color, style, alpha, colorFilter, blendMode)
+ )
+
+ /**
+ * Draws an oval with the given offset and size. If no offset from the top left is provided,
+ * it is drawn starting from the origin of the current translation. If no size is provided,
+ * the size of the current environment is used.
+ *
+ * @param brush: Color or fill to be applied to the oval
+ * @param topLeft: Offset from the local origin of 0, 0 relative to the current translation
+ * @param size: Dimensions of the rectangle to draw
+ * @param alpha: Opacity to be applied to the oval from 0.0f to 1.0f representing
+ * fully transparent to fully opaque respectively
+ * @param style: Whether or not the oval is stroked or filled in
+ * @param colorFilter: ColorFilter to apply to the [brush] when drawn into the destination
+ * @param blendMode: Blending algorithm to be applied to the brush
+ */
+ fun drawOval(
+ brush: Brush,
+ topLeft: Offset = Offset.zero,
+ size: Size = this.size,
+ @FloatRange(from = 0.0, to = 1.0) alpha: Float = DefaultAlpha,
+ style: DrawStyle = Fill,
+ colorFilter: ColorFilter? = null,
+ blendMode: BlendMode = DefaultBlendMode
+ ) = canvas?.drawOval(
+ left = topLeft.dx,
+ top = topLeft.dy,
+ right = topLeft.dx + size.width,
+ bottom = topLeft.dy + size.height,
+ paint = configurePaint(brush, style, alpha, colorFilter, blendMode)
+ )
+
+ /**
+ * Draws an oval with the given offset and size. If no offset from the top left is provided,
+ * it is drawn starting from the origin of the current translation. If no size is provided,
+ * the size of the current environment is used.
+ *
+ * @param color: Color to be applied to the oval
+ * @param topLeft: Offset from the local origin of 0, 0 relative to the current translation
+ * @param size: Dimensions of the rectangle to draw
+ * @param alpha: Opacity to be applied to the oval from 0.0f to 1.0f representing
+ * fully transparent to fully opaque respectively
+ * @param style: Whether or not the oval is stroked or filled in
+ * @param colorFilter: ColorFilter to apply to the [color] when drawn into the destination
+ * @param blendMode: Blending algorithm to be applied to the brush
+ */
+ fun drawOval(
+ color: Color,
+ topLeft: Offset = Offset.zero,
+ size: Size = this.size,
+ @FloatRange(from = 0.0, to = 1.0) alpha: Float = DefaultAlpha,
+ style: DrawStyle = Fill,
+ colorFilter: ColorFilter? = null,
+ blendMode: BlendMode = DefaultBlendMode
+ ) = canvas?.drawOval(
+ left = topLeft.dx,
+ top = topLeft.dy,
+ right = topLeft.dx + size.width,
+ bottom = topLeft.dy + size.height,
+ paint = configurePaint(color, style, alpha, colorFilter, blendMode)
+ )
+
+ /**
+ * Draw an arc scaled to fit inside the given rectangle. It starts from
+ * startAngle degrees around the oval up to startAngle + sweepAngle
+ * degrees around the oval, with zero degrees being the point on
+ * the right hand side of the oval that crosses the horizontal line
+ * that intersects the center of the rectangle and with positive
+ * angles going clockwise around the oval. If useCenter is true, the arc is
+ * closed back to the center, forming a circle sector. Otherwise, the arc is
+ * not closed, forming a circle segment.
+ *
+ * @param brush: Color or fill to be applied to the arc
+ * @param topLeft: Offset from the local origin of 0, 0 relative to the current translation
+ * @param size: Dimensions of the arc to draw
+ * @param startAngle: Starting angle in degrees. 0 represents 3 o'clock
+ * @param sweepAngle: Size of the arc in degrees that is drawn at the position provided in
+ * [startAngle]
+ * @param useCenter: Flag indicating if the arc is to close the center of the bounds
+ * @param alpha: Opacity to be applied to the arc from 0.0f to 1.0f representing
+ * fully transparent to fully opaque respectively
+ * @param style: Whether or not the arc is stroked or filled in
+ * @param colorFilter: ColorFilter to apply to the [brush] when drawn into the destination
+ * @param blendMode: Blending algorithm to be applied to the arc when it is drawn
+ */
+ fun drawArc(
+ brush: Brush,
+ startAngle: Float,
+ sweepAngle: Float,
+ useCenter: Boolean,
+ topLeft: Offset = Offset.zero,
+ size: Size = this.size,
+ @FloatRange(from = 0.0, to = 1.0) alpha: Float = DefaultAlpha,
+ style: DrawStyle = Fill,
+ colorFilter: ColorFilter? = null,
+ blendMode: BlendMode = DefaultBlendMode
+ ) = canvas?.drawArc(
+ left = topLeft.dx,
+ top = topLeft.dy,
+ right = topLeft.dx + size.width,
+ bottom = topLeft.dy + size.height,
+ startAngle = startAngle,
+ sweepAngle = sweepAngle,
+ useCenter = useCenter,
+ paint = configurePaint(brush, style, alpha, colorFilter, blendMode)
+ )
+
+ /**
+ * Draw an arc scaled to fit inside the given rectangle. It starts from
+ * startAngle degrees around the oval up to startAngle + sweepAngle
+ * degrees around the oval, with zero degrees being the point on
+ * the right hand side of the oval that crosses the horizontal line
+ * that intersects the center of the rectangle and with positive
+ * angles going clockwise around the oval. If useCenter is true, the arc is
+ * closed back to the center, forming a circle sector. Otherwise, the arc is
+ * not closed, forming a circle segment.
+ *
+ * @param color: Color to be applied to the arc
+ * @param topLeft: Offset from the local origin of 0, 0 relative to the current translation
+ * @param size: Dimensions of the arc to draw
+ * @param startAngle: Starting angle in degrees. 0 represents 3 o'clock
+ * @param sweepAngle: Size of the arc in degrees that is drawn at the position provided in
+ * [startAngle]
+ * @param useCenter: Flag indicating if the arc is to close the center of the bounds
+ * @param alpha: Opacity to be applied to the arc from 0.0f to 1.0f representing
+ * fully transparent to fully opaque respectively
+ * @param style: Whether or not the arc is stroked or filled in
+ * @param colorFilter: ColorFilter to apply to the [color] when drawn into the destination
+ * @param blendMode: Blending algorithm to be applied to the arc when it is drawn
+ */
+ fun drawArc(
+ color: Color,
+ startAngle: Float,
+ sweepAngle: Float,
+ useCenter: Boolean,
+ topLeft: Offset = Offset.zero,
+ size: Size = this.size,
+ @FloatRange(from = 0.0, to = 1.0) alpha: Float = DefaultAlpha,
+ style: DrawStyle = Fill,
+ colorFilter: ColorFilter? = null,
+ blendMode: BlendMode = DefaultBlendMode
+ ) = canvas?.drawArc(
+ left = topLeft.dx,
+ top = topLeft.dy,
+ right = topLeft.dx + size.width,
+ bottom = topLeft.dy + size.height,
+ startAngle = startAngle,
+ sweepAngle = sweepAngle,
+ useCenter = useCenter,
+ paint = configurePaint(color, style, alpha, colorFilter, blendMode)
+ )
+
+ /**
+ * Draws the given [Path] with the given [Color]. Whether this shape is
+ * filled or stroked (or both) is controlled by [DrawStyle]. If the path is
+ * filled, then subpaths within it are implicitly closed (see [Path.close]).
+ *
+ *
+ * @param path: Path to draw
+ * @param color: Color to be applied to the path
+ * @param alpha: Opacity to be applied to the path from 0.0f to 1.0f representing
+ * fully transparent to fully opaque respectively
+ * @param style: Whether or not the path is stroked or filled in
+ * @param colorFilter: ColorFilter to apply to the [color] when drawn into the destination
+ * @param blendMode: Blending algorithm to be applied to the path when it is drawn
+ */
+ fun drawPath(
+ path: Path,
+ color: Color,
+ @FloatRange(from = 0.0, to = 1.0) alpha: Float = DefaultAlpha,
+ style: DrawStyle = Fill,
+ colorFilter: ColorFilter? = null,
+ blendMode: BlendMode = DefaultBlendMode
+ ) = canvas?.drawPath(path, configurePaint(color, style, alpha, colorFilter, blendMode))
+
+ /**
+ * Draws the given [Path] with the given [Color]. Whether this shape is
+ * filled or stroked (or both) is controlled by [DrawStyle]. If the path is
+ * filled, then subpaths within it are implicitly closed (see [Path.close]).
+ *
+ * @param path: Path to draw
+ * @param brush: Brush to be applied to the path
+ * @param alpha: Opacity to be applied to the path from 0.0f to 1.0f representing
+ * fully transparent to fully opaque respectively
+ * @param style: Whether or not the path is stroked or filled in
+ * @param colorFilter: ColorFilter to apply to the [brush] when drawn into the destination
+ * @param blendMode: Blending algorithm to be applied to the path when it is drawn
+ */
+ fun drawPath(
+ path: Path,
+ brush: Brush,
+ @FloatRange(from = 0.0, to = 1.0) alpha: Float = DefaultAlpha,
+ style: DrawStyle = Fill,
+ colorFilter: ColorFilter? = null,
+ blendMode: BlendMode = DefaultBlendMode
+ ) = canvas?.drawPath(path, configurePaint(brush, style, alpha, colorFilter, blendMode))
+
+ /**
+ * Draws a sequence of points according to the given [PointMode].
+ *
+ * The `points` argument is interpreted as offsets from the origin.
+ *
+ * @param points: List of points to draw with the specified [PointMode]
+ * @param pointMode: [PointMode] used to indicate how the points are to be drawn
+ * @param color: Color to be applied to the points
+ * @param alpha: Opacity to be applied to the path from 0.0f to 1.0f representing
+ * fully transparent to fully opaque respectively
+ * @param stroke: The stroke parameters to apply to the points
+ * @param colorFilter: ColorFilter to apply to the [color] when drawn into the destination
+ * @param blendMode: Blending algorithm to be applied to the path when it is drawn
+ */
+ fun drawPoints(
+ points: List<Offset>,
+ pointMode: PointMode,
+ color: Color,
+ stroke: Stroke,
+ @FloatRange(from = 0.0, to = 1.0) alpha: Float = DefaultAlpha,
+ colorFilter: ColorFilter? = null,
+ blendMode: BlendMode = DefaultBlendMode
+ ) = canvas?.drawPoints(
+ pointMode,
+ points,
+ configurePaint(color, stroke, alpha, colorFilter,
+ blendMode)
+ )
+
+ /**
+ * Draws a sequence of points according to the given [PointMode].
+ *
+ * The `points` argument is interpreted as offsets from the origin.
+ *
+ * @param points: List of points to draw with the specified [PointMode]
+ * @param pointMode: [PointMode] used to indicate how the points are to be drawn
+ * @param brush: Brush to be applied to the points
+ * @param alpha: Opacity to be applied to the path from 0.0f to 1.0f representing
+ * fully transparent to fully opaque respectively
+ * @param style: Whether or not the path is stroked or filled in
+ * @param colorFilter: ColorFilter to apply to the [brush] when drawn into the destination
+ * @param blendMode: Blending algorithm to be applied to the path when it is drawn
+ */
+ fun drawPoints(
+ points: List<Offset>,
+ pointMode: PointMode,
+ brush: Brush,
+ @FloatRange(from = 0.0, to = 1.0) alpha: Float = DefaultAlpha,
+ style: DrawStyle = Fill,
+ colorFilter: ColorFilter? = null,
+ blendMode: BlendMode = DefaultBlendMode
+ ) = canvas?.drawPoints(
+ pointMode,
+ points,
+ configurePaint(brush, style, alpha, colorFilter,
+ blendMode)
+ )
+
+ /**
+ * Draws into the provided [Canvas] with the commands specified in the lambda with this
+ * [CanvasScope] as a receiver
+ *
+ * @param canvas target canvas to render into
+ * @param size bounds relative to the current canvas translation in which the [CanvasScope]
+ * should draw within
+ * @param block lambda that is called to issue drawing commands on this [CanvasScope]
+ */
+ fun draw(canvas: Canvas, size: PxSize, block: CanvasScope.() -> Unit) {
+ val previousSize = this.size
+ // Remember the previous canvas in case we are temporarily re-directing our drawing
+ // to a separate Layer/RenderNode only to draw that content back into the original Canvas
+ // If there is no previous canvas that was being drawin into, this ends up reseting this
+ // parameter back to null defensively
+ val previousCanvas = this.canvas
+ this.canvas = canvas
+ setSize(Size(size.width.value, size.height.value))
+ canvas.save()
+ this.block()
+ canvas.restore()
+ setSize(previousSize)
+ this.canvas = previousCanvas
+ }
+
+ /**
+ * Configures the current size of the drawing environment, this is configured as part of
+ * the [draw] call
+ */
+ @PublishedApi
+ internal fun setSize(size: Size) {
+ this.size = size
+ }
+
+ /**
+ * Internal published APIs used to support inline scoped extension methods
+ * on CanvasScope directly, without exposing the underlying stateful APIs
+ * to conduct the transformations themselves as inline methods require
+ * all methods called within them to be public
+ */
+
+ /**
+ * Simultaneously translate the coordinate space by [left] and [top] as well as modify the
+ * width and height of the current painting area. This method reduces the width by Left +
+ * right as well as height by (top + bottom)
+ */
+ @PublishedApi
+ internal fun doInset(left: Float, top: Float, right: Float, bottom: Float) =
+ canvas?.let {
+ val updatedSize = size - Offset(left + right, top + bottom)
+ require(updatedSize.width > 0 && updatedSize.height > 0) {
+ "Width and height must be greater than zero"
+ }
+ setSize(updatedSize)
+ it.translate(left, top)
+ }
+
+ /**
+ * Selects the appropriate [Paint] object based on the style
+ * and applies the underlying [DrawStyle] parameters
+ */
+ private fun selectPaint(drawStyle: DrawStyle): Paint =
+ when (drawStyle) {
+ Fill -> fillPaint
+ is Stroke -> strokePaint.apply {
+ with(drawStyle) {
+ strokeWidth = width
+ strokeCap = cap
+ strokeMiterLimit = miter
+ strokeJoin = join
+
+ // TODO b/154550525 add PathEffect to Paint if necessary
+ asFrameworkPaint().pathEffect = pathEffect
+ }
+ }
+ }
+
+ /**
+ * Helper method to configure the corresponding [Brush] along with other properties
+ * on the corresponding paint specified by [DrawStyle]
+ */
+ private fun configurePaint(
+ brush: Brush?,
+ style: DrawStyle,
+ @FloatRange(from = 0.0, to = 1.0) alpha: Float,
+ colorFilter: ColorFilter?,
+ blendMode: BlendMode
+ ): Paint = selectPaint(style).apply {
+ brush?.applyTo(this)
+ if (this.alpha != alpha) this.alpha = alpha
+ if (this.colorFilter != colorFilter) this.colorFilter = colorFilter
+ if (this.blendMode != blendMode) this.blendMode = blendMode
+ }
+
+ /**
+ * Helper method to configure the corresponding [Color] along with other properties
+ * on the corresponding paint specified by [DrawStyle]
+ */
+ private fun configurePaint(
+ color: Color,
+ style: DrawStyle,
+ @FloatRange(from = 0.0, to = 1.0) alpha: Float,
+ colorFilter: ColorFilter?,
+ blendMode: BlendMode
+ ): Paint = selectPaint(style).apply {
+ // Modulate the color alpha directly
+ // instead of configuring a separate alpha parameter
+ val targetColor = color.modulate(alpha)
+ if (this.color != targetColor) this.color = targetColor
+ if (this.shader != null) this.shader = null
+ if (this.colorFilter != colorFilter) this.colorFilter = colorFilter
+ if (this.blendMode != blendMode) this.blendMode = blendMode
+ }
+
+ /**
+ * Returns a [Color] modulated with the given alpha value
+ */
+ private fun Color.modulate(alpha: Float): Color =
+ if (alpha != 1.0f) {
+ Color(
+ alpha = this.alpha * alpha,
+ red = this.red,
+ green = this.green,
+ blue = this.blue
+ )
+ } else {
+ this
+ }
+
+ companion object {
+ /**
+ * Default alpha value used for each drawing operation
+ * This represents a fully opaque drawing operation.
+ *
+ * Note color values that have their own alpha value
+ * will draw with some transparency even if this value
+ * is used
+ */
+ const val DefaultAlpha: Float = 1.0f
+
+ /**
+ * Default blending mode used for each drawing operation.
+ * This ensures that content is drawn on top of the pixels
+ * in the destination
+ */
+ val DefaultBlendMode: BlendMode = BlendMode.srcOver
+ }
+}
+
+/**
+ * Represents how the shapes should be drawn within a [CanvasScope]
+ */
+sealed class DrawStyle
+
+/**
+ * Default [DrawStyle] indicating shapes should be drawn completely filled in with the
+ * provided color or pattern
+ */
+object Fill : DrawStyle()
+
+/**
+ * [DrawStyle] that provides information for drawing content with a stroke
+ */
+data class Stroke(
+ /**
+ * Configure the width of the stroke in pixels
+ */
+ val width: Float = 0.0f,
+
+ /**
+ * Set the paint's stroke miter value. This is used to control the behavior of miter
+ * joins when the joins angle si sharp. This value must be >= 0.
+ */
+ val miter: Float = 4.0f,
+
+ /**
+ * Return the paint's Cap, controlling how the start and end of stroked
+ * lines and paths are treated. The default is [StrokeCap.butt]
+ */
+ val cap: StrokeCap = StrokeCap.butt,
+
+ /**
+ * Set's the treatment where lines and curve segments join on a stroked path.
+ * The default is [StrokeJoin.miter]
+ */
+ val join: StrokeJoin = StrokeJoin.miter,
+
+ /**
+ * Effect to apply to the stroke, null indicates a solid stroke line is to be drawn
+ */
+ val pathEffect: PathEffect? = null
+) : DrawStyle()
\ No newline at end of file
diff --git a/ui/ui-graphics/src/main/java/androidx/ui/graphics/painter/ColorPainter.kt b/ui/ui-graphics/src/main/java/androidx/ui/graphics/painter/ColorPainter.kt
index c3f9f30..ba0334c 100644
--- a/ui/ui-graphics/src/main/java/androidx/ui/graphics/painter/ColorPainter.kt
+++ b/ui/ui-graphics/src/main/java/androidx/ui/graphics/painter/ColorPainter.kt
@@ -16,11 +16,8 @@
package androidx.ui.graphics.painter
-import androidx.ui.geometry.Rect
-import androidx.ui.graphics.Canvas
import androidx.ui.graphics.Color
import androidx.ui.graphics.ColorFilter
-import androidx.ui.graphics.Paint
import androidx.ui.unit.PxSize
import androidx.ui.unit.PxSize.Companion.UnspecifiedSize
@@ -28,28 +25,22 @@
* [Painter] implementation used to fill the provided bounds with the specified color
*/
data class ColorPainter(val color: Color) : Painter() {
- // TODO njawad replace with Brush + provide overloads for Color
- private val paint = Paint()
- init {
- paint.color = color
- }
+ private var alpha: Float = CanvasScope.DefaultAlpha
- override fun onDraw(canvas: Canvas, bounds: PxSize) {
- // TODO njawad update with more shapes/ investigate merging/replacing DrawShape.kt
- canvas.drawRect(
- Rect.fromLTWH(0.0f, 0.0f, bounds.width.value, bounds.height.value),
- paint
- )
+ private var colorFilter: ColorFilter? = null
+
+ override fun CanvasScope.onDraw() {
+ drawRect(color = color, alpha = alpha, colorFilter = colorFilter)
}
override fun applyAlpha(alpha: Float): Boolean {
- paint.alpha = alpha
+ this.alpha = alpha
return true
}
override fun applyColorFilter(colorFilter: ColorFilter?): Boolean {
- paint.colorFilter = colorFilter
+ this.colorFilter = colorFilter
return true
}
diff --git a/ui/ui-graphics/src/main/java/androidx/ui/graphics/painter/ImagePainter.kt b/ui/ui-graphics/src/main/java/androidx/ui/graphics/painter/ImagePainter.kt
index a4bb45b..8c5e856 100644
--- a/ui/ui-graphics/src/main/java/androidx/ui/graphics/painter/ImagePainter.kt
+++ b/ui/ui-graphics/src/main/java/androidx/ui/graphics/painter/ImagePainter.kt
@@ -16,58 +16,46 @@
package androidx.ui.graphics.painter
-import androidx.ui.geometry.Rect
-import androidx.ui.graphics.Canvas
+import androidx.ui.geometry.Offset
+import androidx.ui.geometry.Size
import androidx.ui.graphics.ColorFilter
import androidx.ui.graphics.ImageAsset
-import androidx.ui.graphics.Paint
import androidx.ui.unit.IntPx
import androidx.ui.unit.PxSize
-import kotlin.math.roundToInt
-
-private val EmptyPaint = Paint()
/**
* [Painter] implementation used to draw an [ImageAsset] into the provided canvas
* This implementation can handle applying alpha and [ColorFilter] to it's drawn result
*
* @param image The [ImageAsset] to draw
- * @param srcBounds Optional rectangle used to draw a subsection of the [ImageAsset]. If null is
- * provided the entire [ImageAsset] is drawn within the bounds.
- * These bounds must have the following requirements:
+ * @param srcOffset Optional offset relative to [image] used to draw a subsection of the
+ * [ImageAsset]. By default this uses the origin of [image]
+ * @param srcSize Optional dimensions representing size of the subsection of [image] to draw
+ * Both the offset and size must have the following requirements:
*
* 1) Left and top bounds must be greater than or equal to zero
- * 2) Right and bottom bounds must be greater than the left and top respectively
- * 3) Width and height of the bounds must be less than or equal to the dimensions of [image]
+ * 2) Source size must be greater than zero
+ * 3) Source size must be less than or equal to the dimensions of [image]
*/
-data class ImagePainter(private val image: ImageAsset, val srcBounds: Rect? = null) : Painter() {
+data class ImagePainter(
+ private val image: ImageAsset,
+ private val srcOffset: Offset = Offset.zero,
+ private val srcSize: Size = Size(image.width.toFloat(), image.height.toFloat())
+) : Painter() {
- private val size: PxSize = if (srcBounds != null) {
- require(
- srcBounds.left >= 0 &&
- srcBounds.top >= 0 &&
- srcBounds.right <= image.width &&
- srcBounds.bottom <= image.height &&
- srcBounds.right > srcBounds.left &&
- srcBounds.bottom > srcBounds.top
- )
- PxSize(IntPx(srcBounds.width.roundToInt()), IntPx(srcBounds.height.roundToInt()))
- } else {
- PxSize(IntPx(image.width), IntPx(image.height))
- }
+ private val size: PxSize = validateSize(srcOffset, srcSize)
- /**
- * Lazily allocated paint used to draw the [ImageAsset] if an alpha value between 0.0f and 1.0f
- * is provided or a color filter is defined on the [Painter]
- */
- private var paint: Paint? = null
+ private var alpha: Float = CanvasScope.DefaultAlpha
- override fun onDraw(canvas: Canvas, bounds: PxSize) {
- canvas.drawImageRect(
+ private var colorFilter: ColorFilter? = null
+
+ override fun CanvasScope.onDraw() {
+ drawImage(
image,
- srcBounds,
- Rect.fromLTWH(0.0f, 0.0f, bounds.width.value, bounds.height.value),
- paint ?: EmptyPaint
+ srcOffset,
+ srcSize,
+ alpha = alpha,
+ colorFilter = colorFilter
)
}
@@ -77,21 +65,24 @@
override val intrinsicSize: PxSize get() = size
override fun applyAlpha(alpha: Float): Boolean {
- obtainPaint().alpha = alpha
+ this.alpha = alpha
return true
}
override fun applyColorFilter(colorFilter: ColorFilter?): Boolean {
- obtainPaint().colorFilter = colorFilter
+ this.colorFilter = colorFilter
return true
}
- private fun obtainPaint(): Paint {
- var target = paint
- if (target == null) {
- target = Paint()
- paint = target
- }
- return target
+ private fun validateSize(srcOffset: Offset, srcSize: Size): PxSize {
+ require(
+ srcOffset.dx >= 0 &&
+ srcOffset.dy >= 0 &&
+ srcSize.width >= 0 &&
+ srcSize.height >= 0 &&
+ srcSize.width <= image.width &&
+ srcSize.height <= image.height
+ )
+ return PxSize(IntPx(srcSize.width.toInt()), IntPx(srcSize.height.toInt()))
}
}
\ No newline at end of file
diff --git a/ui/ui-graphics/src/main/java/androidx/ui/graphics/painter/Painter.kt b/ui/ui-graphics/src/main/java/androidx/ui/graphics/painter/Painter.kt
index 650862e..1513854 100644
--- a/ui/ui-graphics/src/main/java/androidx/ui/graphics/painter/Painter.kt
+++ b/ui/ui-graphics/src/main/java/androidx/ui/graphics/painter/Painter.kt
@@ -69,6 +69,8 @@
*/
private var colorFilter: ColorFilter? = null
+ private val canvasScope = CanvasScope()
+
/**
* Optional [ColorFilter] used to modify the source pixels when drawn to the destination
* The default implementation of [Painter] will render it's contents into a separate
@@ -142,6 +144,8 @@
}
}
+ private val drawLambda: CanvasScope.() -> Unit = { onDraw() }
+
/**
* Return the intrinsic size of the [Painter].
* If the there is no intrinsic size (i.e. filling bounds with an arbitrary color) return
@@ -157,7 +161,7 @@
* Implementation of drawing logic for instances of [Painter]. This is invoked
* internally within [draw] after the positioning and configuring the [Painter]
*/
- protected abstract fun onDraw(canvas: Canvas, bounds: PxSize)
+ protected abstract fun CanvasScope.onDraw()
/**
* Apply the provided alpha value returning true if it was applied successfully,
@@ -179,7 +183,7 @@
fun draw(
canvas: Canvas,
- bounds: PxSize,
+ size: PxSize,
alpha: Float = DefaultAlpha,
colorFilter: ColorFilter? = null,
rtl: Boolean = false
@@ -191,13 +195,13 @@
if (alpha > 0.0f) {
if (useLayer) {
val layerRect =
- Rect.fromLTWH(0.0f, 0.0f, bounds.width.value, bounds.height.value)
- // TODO njawad replace with RenderNode/Layer API usage
+ Rect.fromLTWH(0.0f, 0.0f, size.width.value, size.height.value)
+ // TODO (b/154550724) njawad replace with RenderNode/Layer API usage
canvas.withSaveLayer(layerRect, obtainPaint()) {
- onDraw(canvas, bounds)
+ canvasScope.draw(canvas, size, drawLambda)
}
} else {
- onDraw(canvas, bounds)
+ canvasScope.draw(canvas, size, drawLambda)
}
}
}
diff --git a/ui/ui-layout/api/0.1.0-dev11.txt b/ui/ui-layout/api/0.1.0-dev11.txt
index 8c57169..2b48689 100644
--- a/ui/ui-layout/api/0.1.0-dev11.txt
+++ b/ui/ui-layout/api/0.1.0-dev11.txt
@@ -267,10 +267,6 @@
property public final androidx.ui.layout.ConstraintSetBuilderScope.HorizontalAnchor.ConstrainedLayoutAnchor top;
}
- public final class ContainerKt {
- method @Deprecated public static void Container-ABW1B3s(androidx.ui.core.Modifier modifier = Modifier, androidx.ui.layout.InnerPadding padding = androidx.ui.layout.InnerPadding(0.dp), androidx.ui.core.Alignment alignment = Alignment.Center, boolean expanded = false, androidx.ui.layout.DpConstraints constraints = androidx.ui.layout.DpConstraints(), androidx.ui.unit.Dp? width = null, androidx.ui.unit.Dp? height = null, kotlin.jvm.functions.Function0<kotlin.Unit> children);
- }
-
public final class CrossAxisAlignment {
field public static final androidx.ui.layout.CrossAxisAlignment.Companion! Companion;
}
@@ -522,7 +518,7 @@
}
public final class TableKt {
- method public static void Table(int columns, kotlin.jvm.functions.Function1<? super java.lang.Integer,androidx.ui.core.Alignment> alignment = { Alignment.TopStart }, kotlin.jvm.functions.Function1<? super java.lang.Integer,? extends androidx.ui.layout.TableColumnWidth> columnWidth = { TableColumnWidth.<init>(1.0) }, kotlin.jvm.functions.Function1<? super androidx.ui.layout.TableChildren,kotlin.Unit> children);
+ method public static void Table(int columns, kotlin.jvm.functions.Function1<? super java.lang.Integer,androidx.ui.core.Alignment> alignment = { return Alignment.TopStart }, kotlin.jvm.functions.Function1<? super java.lang.Integer,? extends androidx.ui.layout.TableColumnWidth> columnWidth = { return TableColumnWidth.<init>(1.0) }, kotlin.jvm.functions.Function1<? super androidx.ui.layout.TableChildren,kotlin.Unit> children);
}
public final class TableMeasurable {
diff --git a/ui/ui-layout/api/current.txt b/ui/ui-layout/api/current.txt
index 8c57169..2b48689 100644
--- a/ui/ui-layout/api/current.txt
+++ b/ui/ui-layout/api/current.txt
@@ -267,10 +267,6 @@
property public final androidx.ui.layout.ConstraintSetBuilderScope.HorizontalAnchor.ConstrainedLayoutAnchor top;
}
- public final class ContainerKt {
- method @Deprecated public static void Container-ABW1B3s(androidx.ui.core.Modifier modifier = Modifier, androidx.ui.layout.InnerPadding padding = androidx.ui.layout.InnerPadding(0.dp), androidx.ui.core.Alignment alignment = Alignment.Center, boolean expanded = false, androidx.ui.layout.DpConstraints constraints = androidx.ui.layout.DpConstraints(), androidx.ui.unit.Dp? width = null, androidx.ui.unit.Dp? height = null, kotlin.jvm.functions.Function0<kotlin.Unit> children);
- }
-
public final class CrossAxisAlignment {
field public static final androidx.ui.layout.CrossAxisAlignment.Companion! Companion;
}
@@ -522,7 +518,7 @@
}
public final class TableKt {
- method public static void Table(int columns, kotlin.jvm.functions.Function1<? super java.lang.Integer,androidx.ui.core.Alignment> alignment = { Alignment.TopStart }, kotlin.jvm.functions.Function1<? super java.lang.Integer,? extends androidx.ui.layout.TableColumnWidth> columnWidth = { TableColumnWidth.<init>(1.0) }, kotlin.jvm.functions.Function1<? super androidx.ui.layout.TableChildren,kotlin.Unit> children);
+ method public static void Table(int columns, kotlin.jvm.functions.Function1<? super java.lang.Integer,androidx.ui.core.Alignment> alignment = { return Alignment.TopStart }, kotlin.jvm.functions.Function1<? super java.lang.Integer,? extends androidx.ui.layout.TableColumnWidth> columnWidth = { return TableColumnWidth.<init>(1.0) }, kotlin.jvm.functions.Function1<? super androidx.ui.layout.TableChildren,kotlin.Unit> children);
}
public final class TableMeasurable {
diff --git a/ui/ui-layout/api/public_plus_experimental_0.1.0-dev11.txt b/ui/ui-layout/api/public_plus_experimental_0.1.0-dev11.txt
index 8c57169..2b48689 100644
--- a/ui/ui-layout/api/public_plus_experimental_0.1.0-dev11.txt
+++ b/ui/ui-layout/api/public_plus_experimental_0.1.0-dev11.txt
@@ -267,10 +267,6 @@
property public final androidx.ui.layout.ConstraintSetBuilderScope.HorizontalAnchor.ConstrainedLayoutAnchor top;
}
- public final class ContainerKt {
- method @Deprecated public static void Container-ABW1B3s(androidx.ui.core.Modifier modifier = Modifier, androidx.ui.layout.InnerPadding padding = androidx.ui.layout.InnerPadding(0.dp), androidx.ui.core.Alignment alignment = Alignment.Center, boolean expanded = false, androidx.ui.layout.DpConstraints constraints = androidx.ui.layout.DpConstraints(), androidx.ui.unit.Dp? width = null, androidx.ui.unit.Dp? height = null, kotlin.jvm.functions.Function0<kotlin.Unit> children);
- }
-
public final class CrossAxisAlignment {
field public static final androidx.ui.layout.CrossAxisAlignment.Companion! Companion;
}
@@ -522,7 +518,7 @@
}
public final class TableKt {
- method public static void Table(int columns, kotlin.jvm.functions.Function1<? super java.lang.Integer,androidx.ui.core.Alignment> alignment = { Alignment.TopStart }, kotlin.jvm.functions.Function1<? super java.lang.Integer,? extends androidx.ui.layout.TableColumnWidth> columnWidth = { TableColumnWidth.<init>(1.0) }, kotlin.jvm.functions.Function1<? super androidx.ui.layout.TableChildren,kotlin.Unit> children);
+ method public static void Table(int columns, kotlin.jvm.functions.Function1<? super java.lang.Integer,androidx.ui.core.Alignment> alignment = { return Alignment.TopStart }, kotlin.jvm.functions.Function1<? super java.lang.Integer,? extends androidx.ui.layout.TableColumnWidth> columnWidth = { return TableColumnWidth.<init>(1.0) }, kotlin.jvm.functions.Function1<? super androidx.ui.layout.TableChildren,kotlin.Unit> children);
}
public final class TableMeasurable {
diff --git a/ui/ui-layout/api/public_plus_experimental_current.txt b/ui/ui-layout/api/public_plus_experimental_current.txt
index 8c57169..2b48689 100644
--- a/ui/ui-layout/api/public_plus_experimental_current.txt
+++ b/ui/ui-layout/api/public_plus_experimental_current.txt
@@ -267,10 +267,6 @@
property public final androidx.ui.layout.ConstraintSetBuilderScope.HorizontalAnchor.ConstrainedLayoutAnchor top;
}
- public final class ContainerKt {
- method @Deprecated public static void Container-ABW1B3s(androidx.ui.core.Modifier modifier = Modifier, androidx.ui.layout.InnerPadding padding = androidx.ui.layout.InnerPadding(0.dp), androidx.ui.core.Alignment alignment = Alignment.Center, boolean expanded = false, androidx.ui.layout.DpConstraints constraints = androidx.ui.layout.DpConstraints(), androidx.ui.unit.Dp? width = null, androidx.ui.unit.Dp? height = null, kotlin.jvm.functions.Function0<kotlin.Unit> children);
- }
-
public final class CrossAxisAlignment {
field public static final androidx.ui.layout.CrossAxisAlignment.Companion! Companion;
}
@@ -522,7 +518,7 @@
}
public final class TableKt {
- method public static void Table(int columns, kotlin.jvm.functions.Function1<? super java.lang.Integer,androidx.ui.core.Alignment> alignment = { Alignment.TopStart }, kotlin.jvm.functions.Function1<? super java.lang.Integer,? extends androidx.ui.layout.TableColumnWidth> columnWidth = { TableColumnWidth.<init>(1.0) }, kotlin.jvm.functions.Function1<? super androidx.ui.layout.TableChildren,kotlin.Unit> children);
+ method public static void Table(int columns, kotlin.jvm.functions.Function1<? super java.lang.Integer,androidx.ui.core.Alignment> alignment = { return Alignment.TopStart }, kotlin.jvm.functions.Function1<? super java.lang.Integer,? extends androidx.ui.layout.TableColumnWidth> columnWidth = { return TableColumnWidth.<init>(1.0) }, kotlin.jvm.functions.Function1<? super androidx.ui.layout.TableChildren,kotlin.Unit> children);
}
public final class TableMeasurable {
diff --git a/ui/ui-layout/api/restricted_0.1.0-dev11.txt b/ui/ui-layout/api/restricted_0.1.0-dev11.txt
index 8c57169..2b48689 100644
--- a/ui/ui-layout/api/restricted_0.1.0-dev11.txt
+++ b/ui/ui-layout/api/restricted_0.1.0-dev11.txt
@@ -267,10 +267,6 @@
property public final androidx.ui.layout.ConstraintSetBuilderScope.HorizontalAnchor.ConstrainedLayoutAnchor top;
}
- public final class ContainerKt {
- method @Deprecated public static void Container-ABW1B3s(androidx.ui.core.Modifier modifier = Modifier, androidx.ui.layout.InnerPadding padding = androidx.ui.layout.InnerPadding(0.dp), androidx.ui.core.Alignment alignment = Alignment.Center, boolean expanded = false, androidx.ui.layout.DpConstraints constraints = androidx.ui.layout.DpConstraints(), androidx.ui.unit.Dp? width = null, androidx.ui.unit.Dp? height = null, kotlin.jvm.functions.Function0<kotlin.Unit> children);
- }
-
public final class CrossAxisAlignment {
field public static final androidx.ui.layout.CrossAxisAlignment.Companion! Companion;
}
@@ -522,7 +518,7 @@
}
public final class TableKt {
- method public static void Table(int columns, kotlin.jvm.functions.Function1<? super java.lang.Integer,androidx.ui.core.Alignment> alignment = { Alignment.TopStart }, kotlin.jvm.functions.Function1<? super java.lang.Integer,? extends androidx.ui.layout.TableColumnWidth> columnWidth = { TableColumnWidth.<init>(1.0) }, kotlin.jvm.functions.Function1<? super androidx.ui.layout.TableChildren,kotlin.Unit> children);
+ method public static void Table(int columns, kotlin.jvm.functions.Function1<? super java.lang.Integer,androidx.ui.core.Alignment> alignment = { return Alignment.TopStart }, kotlin.jvm.functions.Function1<? super java.lang.Integer,? extends androidx.ui.layout.TableColumnWidth> columnWidth = { return TableColumnWidth.<init>(1.0) }, kotlin.jvm.functions.Function1<? super androidx.ui.layout.TableChildren,kotlin.Unit> children);
}
public final class TableMeasurable {
diff --git a/ui/ui-layout/api/restricted_current.txt b/ui/ui-layout/api/restricted_current.txt
index 8c57169..2b48689 100644
--- a/ui/ui-layout/api/restricted_current.txt
+++ b/ui/ui-layout/api/restricted_current.txt
@@ -267,10 +267,6 @@
property public final androidx.ui.layout.ConstraintSetBuilderScope.HorizontalAnchor.ConstrainedLayoutAnchor top;
}
- public final class ContainerKt {
- method @Deprecated public static void Container-ABW1B3s(androidx.ui.core.Modifier modifier = Modifier, androidx.ui.layout.InnerPadding padding = androidx.ui.layout.InnerPadding(0.dp), androidx.ui.core.Alignment alignment = Alignment.Center, boolean expanded = false, androidx.ui.layout.DpConstraints constraints = androidx.ui.layout.DpConstraints(), androidx.ui.unit.Dp? width = null, androidx.ui.unit.Dp? height = null, kotlin.jvm.functions.Function0<kotlin.Unit> children);
- }
-
public final class CrossAxisAlignment {
field public static final androidx.ui.layout.CrossAxisAlignment.Companion! Companion;
}
@@ -522,7 +518,7 @@
}
public final class TableKt {
- method public static void Table(int columns, kotlin.jvm.functions.Function1<? super java.lang.Integer,androidx.ui.core.Alignment> alignment = { Alignment.TopStart }, kotlin.jvm.functions.Function1<? super java.lang.Integer,? extends androidx.ui.layout.TableColumnWidth> columnWidth = { TableColumnWidth.<init>(1.0) }, kotlin.jvm.functions.Function1<? super androidx.ui.layout.TableChildren,kotlin.Unit> children);
+ method public static void Table(int columns, kotlin.jvm.functions.Function1<? super java.lang.Integer,androidx.ui.core.Alignment> alignment = { return Alignment.TopStart }, kotlin.jvm.functions.Function1<? super java.lang.Integer,? extends androidx.ui.layout.TableColumnWidth> columnWidth = { return TableColumnWidth.<init>(1.0) }, kotlin.jvm.functions.Function1<? super androidx.ui.layout.TableChildren,kotlin.Unit> children);
}
public final class TableMeasurable {
diff --git a/ui/ui-layout/src/main/java/androidx/ui/layout/Container.kt b/ui/ui-layout/src/main/java/androidx/ui/layout/Container.kt
deleted file mode 100644
index 2b49e7a..0000000
--- a/ui/ui-layout/src/main/java/androidx/ui/layout/Container.kt
+++ /dev/null
@@ -1,124 +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.ui.layout
-
-import androidx.compose.Composable
-import androidx.ui.core.Alignment
-import androidx.ui.core.Constraints
-import androidx.ui.core.Layout
-import androidx.ui.core.Modifier
-import androidx.ui.core.Placeable
-import androidx.ui.core.enforce
-import androidx.ui.core.hasFixedHeight
-import androidx.ui.core.hasFixedWidth
-import androidx.ui.core.offset
-import androidx.ui.unit.Dp
-import androidx.ui.unit.IntPxSize
-import androidx.ui.unit.dp
-import androidx.ui.unit.ipx
-import androidx.ui.unit.isFinite
-import androidx.ui.unit.max
-
-/**
- * A convenience composable that combines common layout composables for one child:
- * - padding: the padding to be applied to the child
- * - alignment: how to position the padded child if the [Container] is larger than the child
- * - constraints: additional Constraints to be enforced when measuring the Container
- * - width: the width to be used for the Container
- * - height: the height to be used for the Container
- *
- * When constraints, width and/or height are provided, these will be applied to the constraints
- * incoming from the [Container]'s parent, and might not always be satisfied if this is impossible.
- *
- * By default, the [Container] will try to be the size of its child (including padding), or as
- * small as possible within the incoming constraints if that is not possible. If expanded is
- * [true], the [Container] will be as large as possible for bounded incoming constraints.
- * If the padded child is smaller, regardless of the value of expanded, the provided alignment
- * will be used to position it. For unbounded incoming constraints, the [Container] will wrap
- * its child (same behavior as if expanded was [false]). Also, note that the measurement
- * information passed for the [Container] (constraints, width and height) will not be satisfied
- * if the incoming [Constraints] do not allow it.
- *
- * *DEPRECATED:* Container supports only one child and has params that conflict with Modifiers.
- * Use [androidx.ui.foundation.Box] instead which support multiply children, backgroundColor,
- * and set all desired size restrictions via [LayoutSize], [LayoutWidth], [LayoutHeight] and
- * other modifiers.
- */
-@Deprecated(
- "Use Box instead. Container supports only one child and has params that conflict with " +
- "Modifiers, Box solves these problem and have more convenience params."
-)
-@Composable
-fun Container(
- modifier: Modifier = Modifier,
- padding: InnerPadding = InnerPadding(0.dp),
- alignment: Alignment = Alignment.Center,
- expanded: Boolean = false,
- constraints: DpConstraints = DpConstraints(),
- width: Dp? = null,
- height: Dp? = null,
- children: @Composable() () -> Unit
-) {
- Layout(children, modifier) { measurables, incomingConstraints, _ ->
- val containerConstraints = Constraints(constraints)
- .copy(
- width?.toIntPx() ?: constraints.minWidth.toIntPx(),
- width?.toIntPx() ?: constraints.maxWidth.toIntPx(),
- height?.toIntPx() ?: constraints.minHeight.toIntPx(),
- height?.toIntPx() ?: constraints.maxHeight.toIntPx()
- ).enforce(incomingConstraints)
- val totalHorizontal = padding.start.toIntPx() + padding.end.toIntPx()
- val totalVertical = padding.top.toIntPx() + padding.bottom.toIntPx()
- val childConstraints = containerConstraints
- .copy(minWidth = 0.ipx, minHeight = 0.ipx)
- .offset(-totalHorizontal, -totalVertical)
- var placeable: Placeable? = null
- val containerWidth = if ((containerConstraints.hasFixedWidth || expanded) &&
- containerConstraints.maxWidth.isFinite()
- ) {
- containerConstraints.maxWidth
- } else {
- placeable = measurables.firstOrNull()?.measure(childConstraints)
- max((placeable?.width ?: 0.ipx) + totalHorizontal, containerConstraints.minWidth)
- }
- val containerHeight = if ((containerConstraints.hasFixedHeight || expanded) &&
- containerConstraints.maxHeight.isFinite()
- ) {
- containerConstraints.maxHeight
- } else {
- if (placeable == null) {
- placeable = measurables.firstOrNull()?.measure(childConstraints)
- }
- max((placeable?.height ?: 0.ipx) + totalVertical, containerConstraints.minHeight)
- }
- layout(containerWidth, containerHeight) {
- val p = placeable ?: measurables.firstOrNull()?.measure(childConstraints)
- p?.let {
- val position = alignment.align(
- IntPxSize(
- containerWidth - it.width - totalHorizontal,
- containerHeight - it.height - totalVertical
- )
- )
- it.place(
- padding.start.toIntPx() + position.x,
- padding.top.toIntPx() + position.y
- )
- }
- }
- }
-}
diff --git a/ui/ui-livedata/src/androidTest/java/androidx/ui/livedata/LiveDataAdapterTest.kt b/ui/ui-livedata/src/androidTest/java/androidx/ui/livedata/LiveDataAdapterTest.kt
index 184c724..e8ecd2d 100644
--- a/ui/ui-livedata/src/androidTest/java/androidx/ui/livedata/LiveDataAdapterTest.kt
+++ b/ui/ui-livedata/src/androidTest/java/androidx/ui/livedata/LiveDataAdapterTest.kt
@@ -168,14 +168,14 @@
}
@Test
- fun initialValueIsNeverUsedWhenWeHadRealInStarted() {
+ fun initialValueIsUpdatedWithTheRealOneRightAfterIfLifecycleIsStarted() {
val liveData = MutableLiveData<String>()
liveData.postValue("value")
- var realValue = "to-be-updated"
+ var realValue: String? = "to-be-updated"
lifecycleRegistry.currentState = Lifecycle.State.STARTED
rule.setContent {
Providers(LifecycleOwnerAmbient provides this) {
- realValue = liveData.observeAsState(null).value!!
+ realValue = liveData.observeAsState(null).value
}
}
diff --git a/ui/ui-livedata/src/main/java/androidx/ui/livedata/LiveDataAdapter.kt b/ui/ui-livedata/src/main/java/androidx/ui/livedata/LiveDataAdapter.kt
index 65cc7df..1a2af4e 100644
--- a/ui/ui-livedata/src/main/java/androidx/ui/livedata/LiveDataAdapter.kt
+++ b/ui/ui-livedata/src/main/java/androidx/ui/livedata/LiveDataAdapter.kt
@@ -17,10 +17,10 @@
package androidx.ui.livedata
import androidx.compose.Composable
-import androidx.compose.CompositionLifecycleObserver
+import androidx.compose.FrameManager
import androidx.compose.State
-import androidx.compose.mutableStateOf
-import androidx.compose.remember
+import androidx.compose.onPreCommit
+import androidx.compose.state
import androidx.lifecycle.Lifecycle
import androidx.lifecycle.LifecycleOwner
import androidx.lifecycle.LiveData
@@ -54,37 +54,11 @@
@Composable
fun <R, T : R> LiveData<T>.observeAsState(initial: R): State<R> {
val lifecycleOwner = LifecycleOwnerAmbient.current
- val observer = remember { DisposableObserver<R, T>(initial, lifecycleOwner) }
- observer.source = this
- return observer.state
-}
-
-private class DisposableObserver<R, T : R>(
- initial: R,
- private val lifecycleOwner: LifecycleOwner
-) : Observer<T>, CompositionLifecycleObserver {
-
- val state = mutableStateOf(initial)
-
- var source: LiveData<T>? = null
- set(source) {
- if (source !== field) {
- field?.removeObserver(this)
- field = source
- source?.observe(lifecycleOwner, this)
- }
- }
-
- override fun onChanged(t: T) {
- state.value = t
+ val state = state { initial }
+ onPreCommit(this, lifecycleOwner) {
+ val observer = Observer<T> { state.value = it }
+ observe(lifecycleOwner, observer)
+ onDispose { removeObserver(observer) }
}
-
- override fun onLeave() {
- // the same as onDispose()
- source = null
- }
-
- override fun onEnter() {
- // do nothing
- }
+ return state
}
diff --git a/ui/ui-material/api/0.1.0-dev11.txt b/ui/ui-material/api/0.1.0-dev11.txt
index d9d4fa3..c4d1ef3 100644
--- a/ui/ui-material/api/0.1.0-dev11.txt
+++ b/ui/ui-material/api/0.1.0-dev11.txt
@@ -191,7 +191,7 @@
public final class ScaffoldKt {
method public static void Scaffold(androidx.ui.material.ScaffoldState scaffoldState = remember({
- <init>()
+ return <init>()
}), kotlin.jvm.functions.Function0<kotlin.Unit>? topAppBar = null, kotlin.jvm.functions.Function1<? super androidx.ui.material.BottomAppBar.FabConfiguration,kotlin.Unit>? bottomAppBar = null, kotlin.jvm.functions.Function0<kotlin.Unit>? floatingActionButton = null, androidx.ui.material.Scaffold.FabPosition floatingActionButtonPosition = androidx.ui.material.Scaffold.FabPosition.End, kotlin.jvm.functions.Function0<kotlin.Unit>? drawerContent = null, kotlin.jvm.functions.Function1<? super androidx.ui.core.Modifier,kotlin.Unit> bodyContent);
}
@@ -229,7 +229,7 @@
}
public final class SurfaceKt {
- method public static void Surface-r7cpYJI(androidx.ui.core.Modifier modifier = Modifier, androidx.ui.graphics.Shape shape = RectangleShape, long color = MaterialTheme.colors.surface, long contentColor = contentColorFor(color), androidx.ui.foundation.Border? border = null, float elevation = 0.dp, kotlin.jvm.functions.Function0<kotlin.Unit> content);
+ method public static void Surface-r7cpYJI(androidx.ui.core.Modifier modifier = Modifier, androidx.ui.graphics.Shape shape = androidx.ui.graphics.RectangleShapeKt.RectangleShape, long color = MaterialTheme.colors.surface, long contentColor = contentColorFor(color), androidx.ui.foundation.Border? border = null, float elevation = 0.dp, kotlin.jvm.functions.Function0<kotlin.Unit> content);
method public static long getPrimarySurface(androidx.ui.material.ColorPalette);
}
diff --git a/ui/ui-material/api/current.txt b/ui/ui-material/api/current.txt
index d9d4fa3..c4d1ef3 100644
--- a/ui/ui-material/api/current.txt
+++ b/ui/ui-material/api/current.txt
@@ -191,7 +191,7 @@
public final class ScaffoldKt {
method public static void Scaffold(androidx.ui.material.ScaffoldState scaffoldState = remember({
- <init>()
+ return <init>()
}), kotlin.jvm.functions.Function0<kotlin.Unit>? topAppBar = null, kotlin.jvm.functions.Function1<? super androidx.ui.material.BottomAppBar.FabConfiguration,kotlin.Unit>? bottomAppBar = null, kotlin.jvm.functions.Function0<kotlin.Unit>? floatingActionButton = null, androidx.ui.material.Scaffold.FabPosition floatingActionButtonPosition = androidx.ui.material.Scaffold.FabPosition.End, kotlin.jvm.functions.Function0<kotlin.Unit>? drawerContent = null, kotlin.jvm.functions.Function1<? super androidx.ui.core.Modifier,kotlin.Unit> bodyContent);
}
@@ -229,7 +229,7 @@
}
public final class SurfaceKt {
- method public static void Surface-r7cpYJI(androidx.ui.core.Modifier modifier = Modifier, androidx.ui.graphics.Shape shape = RectangleShape, long color = MaterialTheme.colors.surface, long contentColor = contentColorFor(color), androidx.ui.foundation.Border? border = null, float elevation = 0.dp, kotlin.jvm.functions.Function0<kotlin.Unit> content);
+ method public static void Surface-r7cpYJI(androidx.ui.core.Modifier modifier = Modifier, androidx.ui.graphics.Shape shape = androidx.ui.graphics.RectangleShapeKt.RectangleShape, long color = MaterialTheme.colors.surface, long contentColor = contentColorFor(color), androidx.ui.foundation.Border? border = null, float elevation = 0.dp, kotlin.jvm.functions.Function0<kotlin.Unit> content);
method public static long getPrimarySurface(androidx.ui.material.ColorPalette);
}
diff --git a/ui/ui-material/api/public_plus_experimental_0.1.0-dev11.txt b/ui/ui-material/api/public_plus_experimental_0.1.0-dev11.txt
index d9d4fa3..c4d1ef3 100644
--- a/ui/ui-material/api/public_plus_experimental_0.1.0-dev11.txt
+++ b/ui/ui-material/api/public_plus_experimental_0.1.0-dev11.txt
@@ -191,7 +191,7 @@
public final class ScaffoldKt {
method public static void Scaffold(androidx.ui.material.ScaffoldState scaffoldState = remember({
- <init>()
+ return <init>()
}), kotlin.jvm.functions.Function0<kotlin.Unit>? topAppBar = null, kotlin.jvm.functions.Function1<? super androidx.ui.material.BottomAppBar.FabConfiguration,kotlin.Unit>? bottomAppBar = null, kotlin.jvm.functions.Function0<kotlin.Unit>? floatingActionButton = null, androidx.ui.material.Scaffold.FabPosition floatingActionButtonPosition = androidx.ui.material.Scaffold.FabPosition.End, kotlin.jvm.functions.Function0<kotlin.Unit>? drawerContent = null, kotlin.jvm.functions.Function1<? super androidx.ui.core.Modifier,kotlin.Unit> bodyContent);
}
@@ -229,7 +229,7 @@
}
public final class SurfaceKt {
- method public static void Surface-r7cpYJI(androidx.ui.core.Modifier modifier = Modifier, androidx.ui.graphics.Shape shape = RectangleShape, long color = MaterialTheme.colors.surface, long contentColor = contentColorFor(color), androidx.ui.foundation.Border? border = null, float elevation = 0.dp, kotlin.jvm.functions.Function0<kotlin.Unit> content);
+ method public static void Surface-r7cpYJI(androidx.ui.core.Modifier modifier = Modifier, androidx.ui.graphics.Shape shape = androidx.ui.graphics.RectangleShapeKt.RectangleShape, long color = MaterialTheme.colors.surface, long contentColor = contentColorFor(color), androidx.ui.foundation.Border? border = null, float elevation = 0.dp, kotlin.jvm.functions.Function0<kotlin.Unit> content);
method public static long getPrimarySurface(androidx.ui.material.ColorPalette);
}
diff --git a/ui/ui-material/api/public_plus_experimental_current.txt b/ui/ui-material/api/public_plus_experimental_current.txt
index d9d4fa3..c4d1ef3 100644
--- a/ui/ui-material/api/public_plus_experimental_current.txt
+++ b/ui/ui-material/api/public_plus_experimental_current.txt
@@ -191,7 +191,7 @@
public final class ScaffoldKt {
method public static void Scaffold(androidx.ui.material.ScaffoldState scaffoldState = remember({
- <init>()
+ return <init>()
}), kotlin.jvm.functions.Function0<kotlin.Unit>? topAppBar = null, kotlin.jvm.functions.Function1<? super androidx.ui.material.BottomAppBar.FabConfiguration,kotlin.Unit>? bottomAppBar = null, kotlin.jvm.functions.Function0<kotlin.Unit>? floatingActionButton = null, androidx.ui.material.Scaffold.FabPosition floatingActionButtonPosition = androidx.ui.material.Scaffold.FabPosition.End, kotlin.jvm.functions.Function0<kotlin.Unit>? drawerContent = null, kotlin.jvm.functions.Function1<? super androidx.ui.core.Modifier,kotlin.Unit> bodyContent);
}
@@ -229,7 +229,7 @@
}
public final class SurfaceKt {
- method public static void Surface-r7cpYJI(androidx.ui.core.Modifier modifier = Modifier, androidx.ui.graphics.Shape shape = RectangleShape, long color = MaterialTheme.colors.surface, long contentColor = contentColorFor(color), androidx.ui.foundation.Border? border = null, float elevation = 0.dp, kotlin.jvm.functions.Function0<kotlin.Unit> content);
+ method public static void Surface-r7cpYJI(androidx.ui.core.Modifier modifier = Modifier, androidx.ui.graphics.Shape shape = androidx.ui.graphics.RectangleShapeKt.RectangleShape, long color = MaterialTheme.colors.surface, long contentColor = contentColorFor(color), androidx.ui.foundation.Border? border = null, float elevation = 0.dp, kotlin.jvm.functions.Function0<kotlin.Unit> content);
method public static long getPrimarySurface(androidx.ui.material.ColorPalette);
}
diff --git a/ui/ui-material/api/restricted_0.1.0-dev11.txt b/ui/ui-material/api/restricted_0.1.0-dev11.txt
index d9d4fa3..c4d1ef3 100644
--- a/ui/ui-material/api/restricted_0.1.0-dev11.txt
+++ b/ui/ui-material/api/restricted_0.1.0-dev11.txt
@@ -191,7 +191,7 @@
public final class ScaffoldKt {
method public static void Scaffold(androidx.ui.material.ScaffoldState scaffoldState = remember({
- <init>()
+ return <init>()
}), kotlin.jvm.functions.Function0<kotlin.Unit>? topAppBar = null, kotlin.jvm.functions.Function1<? super androidx.ui.material.BottomAppBar.FabConfiguration,kotlin.Unit>? bottomAppBar = null, kotlin.jvm.functions.Function0<kotlin.Unit>? floatingActionButton = null, androidx.ui.material.Scaffold.FabPosition floatingActionButtonPosition = androidx.ui.material.Scaffold.FabPosition.End, kotlin.jvm.functions.Function0<kotlin.Unit>? drawerContent = null, kotlin.jvm.functions.Function1<? super androidx.ui.core.Modifier,kotlin.Unit> bodyContent);
}
@@ -229,7 +229,7 @@
}
public final class SurfaceKt {
- method public static void Surface-r7cpYJI(androidx.ui.core.Modifier modifier = Modifier, androidx.ui.graphics.Shape shape = RectangleShape, long color = MaterialTheme.colors.surface, long contentColor = contentColorFor(color), androidx.ui.foundation.Border? border = null, float elevation = 0.dp, kotlin.jvm.functions.Function0<kotlin.Unit> content);
+ method public static void Surface-r7cpYJI(androidx.ui.core.Modifier modifier = Modifier, androidx.ui.graphics.Shape shape = androidx.ui.graphics.RectangleShapeKt.RectangleShape, long color = MaterialTheme.colors.surface, long contentColor = contentColorFor(color), androidx.ui.foundation.Border? border = null, float elevation = 0.dp, kotlin.jvm.functions.Function0<kotlin.Unit> content);
method public static long getPrimarySurface(androidx.ui.material.ColorPalette);
}
diff --git a/ui/ui-material/api/restricted_current.txt b/ui/ui-material/api/restricted_current.txt
index d9d4fa3..c4d1ef3 100644
--- a/ui/ui-material/api/restricted_current.txt
+++ b/ui/ui-material/api/restricted_current.txt
@@ -191,7 +191,7 @@
public final class ScaffoldKt {
method public static void Scaffold(androidx.ui.material.ScaffoldState scaffoldState = remember({
- <init>()
+ return <init>()
}), kotlin.jvm.functions.Function0<kotlin.Unit>? topAppBar = null, kotlin.jvm.functions.Function1<? super androidx.ui.material.BottomAppBar.FabConfiguration,kotlin.Unit>? bottomAppBar = null, kotlin.jvm.functions.Function0<kotlin.Unit>? floatingActionButton = null, androidx.ui.material.Scaffold.FabPosition floatingActionButtonPosition = androidx.ui.material.Scaffold.FabPosition.End, kotlin.jvm.functions.Function0<kotlin.Unit>? drawerContent = null, kotlin.jvm.functions.Function1<? super androidx.ui.core.Modifier,kotlin.Unit> bodyContent);
}
@@ -229,7 +229,7 @@
}
public final class SurfaceKt {
- method public static void Surface-r7cpYJI(androidx.ui.core.Modifier modifier = Modifier, androidx.ui.graphics.Shape shape = RectangleShape, long color = MaterialTheme.colors.surface, long contentColor = contentColorFor(color), androidx.ui.foundation.Border? border = null, float elevation = 0.dp, kotlin.jvm.functions.Function0<kotlin.Unit> content);
+ method public static void Surface-r7cpYJI(androidx.ui.core.Modifier modifier = Modifier, androidx.ui.graphics.Shape shape = androidx.ui.graphics.RectangleShapeKt.RectangleShape, long color = MaterialTheme.colors.surface, long contentColor = contentColorFor(color), androidx.ui.foundation.Border? border = null, float elevation = 0.dp, kotlin.jvm.functions.Function0<kotlin.Unit> content);
method public static long getPrimarySurface(androidx.ui.material.ColorPalette);
}
diff --git a/ui/ui-material/integration-tests/material-studies/src/main/java/androidx/ui/material/studies/rally/RallyAnimatedCircle.kt b/ui/ui-material/integration-tests/material-studies/src/main/java/androidx/ui/material/studies/rally/RallyAnimatedCircle.kt
index 17b4ab1..727b7f4 100644
--- a/ui/ui-material/integration-tests/material-studies/src/main/java/androidx/ui/material/studies/rally/RallyAnimatedCircle.kt
+++ b/ui/ui-material/integration-tests/material-studies/src/main/java/androidx/ui/material/studies/rally/RallyAnimatedCircle.kt
@@ -21,16 +21,15 @@
import androidx.animation.LinearOutSlowInEasing
import androidx.animation.transitionDefinition
import androidx.compose.Composable
-import androidx.compose.remember
import androidx.ui.animation.Transition
+import androidx.ui.core.DensityAmbient
import androidx.ui.core.Modifier
-import androidx.ui.foundation.Canvas
-import androidx.ui.geometry.Rect
+import androidx.ui.foundation.Canvas2
+import androidx.ui.geometry.Offset
+import androidx.ui.geometry.Size
import androidx.ui.graphics.Color
-import androidx.ui.graphics.Paint
-import androidx.ui.graphics.PaintingStyle
+import androidx.ui.graphics.painter.Stroke
import androidx.ui.unit.dp
-import androidx.ui.unit.minDimension
private const val DividerLengthInDegrees = 1.8f
private val AngleOffset = FloatPropKey()
@@ -67,29 +66,28 @@
proportions: List<Float>,
colors: List<Color>
) {
- val strokeWidthDp = 5.dp
- val paint = remember { Paint() }
+ val stroke = Stroke(5.dp.value * DensityAmbient.current.density)
Transition(definition = CircularTransition, initState = 0, toState = 1) { state ->
- Canvas(modifier) {
- val strokeWidth = strokeWidthDp.toPx().value
- paint.style = PaintingStyle.stroke
- paint.strokeWidth = strokeWidth
- paint.isAntiAlias = true
-
- val innerRadius = (size.minDimension.value - strokeWidth) / 2
- val parentHalfWidth = size.width.value / 2
- val parentHalfHeight = size.height.value / 2
- val rect = Rect(
- parentHalfWidth - innerRadius,
- parentHalfHeight - innerRadius,
- parentHalfWidth + innerRadius,
- parentHalfHeight + innerRadius
+ Canvas2(modifier) {
+ val innerRadius = (size.minDimension - stroke.width) / 2
+ val halfSize = size / 2.0f
+ val topLeft = Offset(
+ halfSize.width - innerRadius,
+ halfSize.height - innerRadius
)
+ val size = Size(innerRadius * 2, innerRadius * 2)
var startAngle = state[Shift] - 90f
proportions.forEachIndexed { index, proportion ->
- paint.color = colors[index]
val sweep = proportion * state[AngleOffset]
- drawArc(rect, startAngle, sweep, false, paint = paint)
+ drawArc(
+ color = colors[index],
+ startAngle = startAngle,
+ sweepAngle = sweep,
+ topLeft = topLeft,
+ size = size,
+ useCenter = false,
+ style = stroke
+ )
startAngle += sweep + DividerLengthInDegrees
}
}
diff --git a/ui/ui-material/src/androidTest/java/androidx/ui/material/BottomNavigationTest.kt b/ui/ui-material/src/androidTest/java/androidx/ui/material/BottomNavigationTest.kt
index 1077cd6..fede650 100644
--- a/ui/ui-material/src/androidTest/java/androidx/ui/material/BottomNavigationTest.kt
+++ b/ui/ui-material/src/androidTest/java/androidx/ui/material/BottomNavigationTest.kt
@@ -252,28 +252,22 @@
}
// Find all items and ensure there are 3
- val items = findAll(isInMutuallyExclusiveGroup())
- items.assertCountEquals(3)
-
- // Ensure semantics match for selected state of the items
- items.forEachIndexed { index, interaction ->
- if (index == 0) {
- interaction.assertIsSelected()
- } else {
- interaction.assertIsUnselected()
+ findAll(isInMutuallyExclusiveGroup())
+ .assertCountEquals(3)
+ // Ensure semantics match for selected state of the items
+ .apply {
+ get(0).assertIsSelected()
+ get(1).assertIsUnselected()
+ get(2).assertIsUnselected()
}
- }
-
- // Click the last item
- items.last().doClick()
-
- // Now only the last item should be selected
- items.forEachIndexed { index, interaction ->
- if (index == items.lastIndex) {
- interaction.assertIsSelected()
- } else {
- interaction.assertIsUnselected()
+ // Click the last item
+ .apply {
+ get(2).doClick()
}
- }
+ .apply {
+ get(0).assertIsUnselected()
+ get(1).assertIsUnselected()
+ get(2).assertIsSelected()
+ }
}
}
diff --git a/ui/ui-material/src/androidTest/java/androidx/ui/material/CheckboxScreenshotTest.kt b/ui/ui-material/src/androidTest/java/androidx/ui/material/CheckboxScreenshotTest.kt
index ffd799b..c2310b0 100644
--- a/ui/ui-material/src/androidTest/java/androidx/ui/material/CheckboxScreenshotTest.kt
+++ b/ui/ui-material/src/androidTest/java/androidx/ui/material/CheckboxScreenshotTest.kt
@@ -21,6 +21,7 @@
import androidx.test.filters.SdkSuppress
import androidx.test.screenshot.AndroidXScreenshotTestRule
import androidx.test.screenshot.assertAgainstGolden
+import androidx.test.screenshot.matchers.MSSIMMatcher
import androidx.ui.core.Alignment
import androidx.ui.core.Modifier
import androidx.ui.layout.wrapContentSize
@@ -48,6 +49,8 @@
val wrap = Modifier.wrapContentSize(Alignment.TopStart)
+ val matcher = MSSIMMatcher(threshold = 0.96)
+
@Test
fun checkBoxTest_checked() {
composeTestRule.setMaterialContent {
@@ -55,7 +58,7 @@
}
find(isToggleable())
.captureToBitmap()
- .assertAgainstGolden(screenshotRule, "checkbox_checked")
+ .assertAgainstGolden(screenshotRule, "checkbox_checked", matcher)
}
@Test
@@ -65,7 +68,7 @@
}
find(isToggleable())
.captureToBitmap()
- .assertAgainstGolden(screenshotRule, "checkbox_unchecked")
+ .assertAgainstGolden(screenshotRule, "checkbox_unchecked", matcher)
}
@Test
@@ -87,7 +90,7 @@
find(isToggleable())
.captureToBitmap()
- .assertAgainstGolden(screenshotRule, "checkbox_animateToChecked")
+ .assertAgainstGolden(screenshotRule, "checkbox_animateToChecked", matcher)
}
@Test
@@ -109,6 +112,6 @@
find(isToggleable())
.captureToBitmap()
- .assertAgainstGolden(screenshotRule, "checkbox_animateToUnchecked")
+ .assertAgainstGolden(screenshotRule, "checkbox_animateToUnchecked", matcher)
}
}
\ No newline at end of file
diff --git a/ui/ui-material/src/androidTest/java/androidx/ui/material/FilledTextFieldTest.kt b/ui/ui-material/src/androidTest/java/androidx/ui/material/FilledTextFieldTest.kt
index 4e2ac0f..be04d26 100644
--- a/ui/ui-material/src/androidTest/java/androidx/ui/material/FilledTextFieldTest.kt
+++ b/ui/ui-material/src/androidTest/java/androidx/ui/material/FilledTextFieldTest.kt
@@ -310,7 +310,7 @@
FilledTextField(
value = "",
onValueChange = {},
- label = {},
+ label = { Text("label") },
placeholder = {
Text(text = "placeholder", modifier = Modifier.onPositioned {
placeholderPosition.value = it.globalPosition
@@ -342,6 +342,50 @@
}
@Test
+ fun testPlaceholderPosition_whenNoLabel() {
+ val placeholderSize = Ref<IntPxSize>()
+ val placeholderPosition = Ref<PxPosition>()
+ val placeholderBaseline = Ref<Px>()
+ val height = 60.dp
+ testRule.setMaterialContent {
+ Box {
+ TestTag("textField") {
+ FilledTextField(
+ value = "",
+ onValueChange = {},
+ label = {},
+ modifier = Modifier.preferredHeight(height),
+ placeholder = {
+ Text(text = "placeholder", modifier = Modifier.onPositioned {
+ placeholderPosition.value = it.globalPosition
+ placeholderSize.value = it.size
+ placeholderBaseline.value =
+ it[FirstBaseline]!!.toPx() + placeholderPosition.value!!.y
+ })
+ }
+ )
+ }
+ }
+ }
+ // click to focus
+ clickAndAdvanceClock("textField", 200)
+
+ testRule.runOnIdleComposeWithDensity {
+ // size
+ assertThat(placeholderSize.value).isNotNull()
+ assertThat(placeholderSize.value?.height).isGreaterThan(0.ipx)
+ assertThat(placeholderSize.value?.width).isGreaterThan(0.ipx)
+ // centered position
+ assertThat(placeholderPosition.value?.x).isEqualTo(
+ ExpectedPadding.toIntPx().toPx()
+ )
+ assertThat(placeholderPosition.value?.y).isEqualTo(
+ ((height.toIntPx() - placeholderSize.value!!.height) / 2f).toPx()
+ )
+ }
+ }
+
+ @Test
fun testNoPlaceholder_whenInputNotEmpty() {
val placeholderSize = Ref<IntPxSize>()
val placeholderPosition = Ref<PxPosition>()
diff --git a/ui/ui-material/src/androidTest/java/androidx/ui/material/TabTest.kt b/ui/ui-material/src/androidTest/java/androidx/ui/material/TabTest.kt
index 9557bc7..c428732 100644
--- a/ui/ui-material/src/androidTest/java/androidx/ui/material/TabTest.kt
+++ b/ui/ui-material/src/androidTest/java/androidx/ui/material/TabTest.kt
@@ -391,15 +391,14 @@
TextTabs()
}
- findAll(isInMutuallyExclusiveGroup()).apply {
- forEachIndexed { index, interaction ->
- if (index == 0) {
- interaction.assertIsSelected()
- } else {
- interaction.assertIsUnselected()
- }
+ // Only the first tab should be selected
+ findAll(isInMutuallyExclusiveGroup())
+ .assertCountEquals(3)
+ .apply {
+ get(0).assertIsSelected()
+ get(1).assertIsUnselected()
+ get(2).assertIsUnselected()
}
- }.assertCountEquals(3)
}
@Test
@@ -410,29 +409,25 @@
}
// Only the first tab should be selected
- findAll(isInMutuallyExclusiveGroup()).apply {
- forEachIndexed { index, interaction ->
- if (index == 0) {
- interaction.assertIsSelected()
- } else {
- interaction.assertIsUnselected()
- }
+ findAll(isInMutuallyExclusiveGroup())
+ .assertCountEquals(3)
+ .apply {
+ get(0).assertIsSelected()
+ get(1).assertIsUnselected()
+ get(2).assertIsUnselected()
}
- }.assertCountEquals(3)
// Click the last tab
- findAll(isInMutuallyExclusiveGroup()).last().doClick()
+ findAll(isInMutuallyExclusiveGroup())[2].doClick()
// Now only the last tab should be selected
- findAll(isInMutuallyExclusiveGroup()).apply {
- forEachIndexed { index, interaction ->
- if (index == lastIndex) {
- interaction.assertIsSelected()
- } else {
- interaction.assertIsUnselected()
- }
+ findAll(isInMutuallyExclusiveGroup())
+ .assertCountEquals(3)
+ .apply {
+ get(0).assertIsUnselected()
+ get(1).assertIsUnselected()
+ get(2).assertIsSelected()
}
- }.assertCountEquals(3)
}
@Test
@@ -442,15 +437,15 @@
ScrollingTextTabs()
}
- findAll(isInMutuallyExclusiveGroup()).apply {
- forEachIndexed { index, interaction ->
- if (index == 0) {
- interaction.assertIsSelected()
- } else {
- interaction.assertIsUnselected()
+ // Only the first tab should be selected
+ findAll(isInMutuallyExclusiveGroup())
+ .assertCountEquals(10)
+ .apply {
+ get(0).assertIsSelected()
+ (1..9).forEach {
+ get(it).assertIsUnselected()
}
}
- }.assertCountEquals(10)
}
@Test
@@ -461,28 +456,27 @@
}
// Only the first tab should be selected
- findAll(isInMutuallyExclusiveGroup()).apply {
- forEachIndexed { index, interaction ->
- if (index == 0) {
- interaction.assertIsSelected()
- } else {
- interaction.assertIsUnselected()
+ findAll(isInMutuallyExclusiveGroup())
+ .assertCountEquals(10)
+ .apply {
+ get(0).assertIsSelected()
+ (1..9).forEach {
+ get(it).assertIsUnselected()
}
}
- }.assertCountEquals(10)
// Click the second tab
findAll(isInMutuallyExclusiveGroup())[1].doClick()
// Now only the second tab should be selected
- findAll(isInMutuallyExclusiveGroup()).apply {
- forEachIndexed { index, interaction ->
- if (index == 1) {
- interaction.assertIsSelected()
- } else {
- interaction.assertIsUnselected()
+ findAll(isInMutuallyExclusiveGroup())
+ .assertCountEquals(10)
+ .apply {
+ get(0).assertIsUnselected()
+ get(1).assertIsSelected()
+ (2..9).forEach {
+ get(it).assertIsUnselected()
}
}
- }.assertCountEquals(10)
}
}
diff --git a/ui/ui-material/src/main/java/androidx/ui/material/Checkbox.kt b/ui/ui-material/src/main/java/androidx/ui/material/Checkbox.kt
index 7c9791c..951752b 100644
--- a/ui/ui-material/src/main/java/androidx/ui/material/Checkbox.kt
+++ b/ui/ui-material/src/main/java/androidx/ui/material/Checkbox.kt
@@ -23,23 +23,25 @@
import androidx.compose.remember
import androidx.ui.animation.ColorPropKey
import androidx.ui.animation.Transition
+import androidx.ui.core.DensityAmbient
import androidx.ui.core.Modifier
-import androidx.ui.core.DrawScope
import androidx.ui.foundation.Box
-import androidx.ui.foundation.Canvas
+import androidx.ui.foundation.Canvas2
import androidx.ui.foundation.ContentGravity
import androidx.ui.foundation.selection.ToggleableState
import androidx.ui.foundation.selection.TriStateToggleable
import androidx.ui.geometry.Offset
import androidx.ui.geometry.RRect
import androidx.ui.geometry.Radius
+import androidx.ui.geometry.Size
import androidx.ui.geometry.outerRect
import androidx.ui.geometry.shrink
import androidx.ui.graphics.ClipOp
import androidx.ui.graphics.Color
-import androidx.ui.graphics.Paint
-import androidx.ui.graphics.PaintingStyle
import androidx.ui.graphics.StrokeCap
+import androidx.ui.graphics.painter.CanvasScope
+import androidx.ui.graphics.painter.Stroke
+import androidx.ui.graphics.painter.clipRect
import androidx.ui.layout.padding
import androidx.ui.layout.preferredSize
import androidx.ui.material.ripple.ripple
@@ -129,43 +131,45 @@
val definition = remember(activeColor, unselectedColor) {
generateTransitionDefinition(activeColor, unselectedColor)
}
- val checkboxPaint = remember { Paint() }
Transition(definition = definition, toState = value) { state ->
- Canvas(modifier.preferredSize(CheckboxSize)) {
+ val strokeWidthPx: Float
+ val radiusPx: Float
+ with(DensityAmbient.current) {
+ strokeWidthPx = StrokeWidth.toPx().value
+ radiusPx = RadiusSize.toPx().value
+ }
+ Canvas2(modifier.preferredSize(CheckboxSize)) {
drawBox(
color = state[BoxColorProp],
innerRadiusFraction = state[InnerRadiusFractionProp],
- paint = checkboxPaint
+ radius = radiusPx,
+ strokeWidth = strokeWidthPx
)
drawCheck(
checkFraction = state[CheckFractionProp],
crossCenterGravitation = state[CenterGravitationForCheck],
- paint = checkboxPaint
+ strokeWidthPx = strokeWidthPx
)
}
}
}
-private fun DrawScope.drawBox(
+private fun CanvasScope.drawBox(
color: Color,
innerRadiusFraction: Float,
- paint: Paint
+ radius: Float,
+ strokeWidth: Float
) {
- val strokeWidth = StrokeWidth.toPx().value
val halfStrokeWidth = strokeWidth / 2.0f
- paint.style = PaintingStyle.stroke
- paint.strokeWidth = strokeWidth
- paint.isAntiAlias = true
- paint.color = color
-
- val checkboxSize = size.width.value
+ val stroke = Stroke(strokeWidth)
+ val checkboxSize = size.width
val outer = RRect(
halfStrokeWidth,
halfStrokeWidth,
checkboxSize - halfStrokeWidth,
checkboxSize - halfStrokeWidth,
- Radius.circular(RadiusSize.toPx().value)
+ Radius.circular(radius)
)
// Determine whether or not we need to offset the inset by a pixel
@@ -175,8 +179,6 @@
// TODO(malkov): this radius formula is not in material spec
- val outerRadius = RadiusSize.toPx().value
-
// If the inner region is to be filled such that it is larger than the outer stroke size
// then create a difference clip to draw the stroke outside of the rectangular region
// to be drawn within the interior rectangle. This is done to ensure that pixels do
@@ -186,41 +188,47 @@
val innerStrokeWidth = innerRadiusFraction * checkboxSize / 2
if (innerStrokeWidth > strokeWidth) {
val clipRect = outer.shrink(strokeWidth / 2 - offset).outerRect()
- save()
- clipRect(clipRect, ClipOp.difference)
- drawRoundRect(
- outer.left, outer.top, outer.right, outer.bottom, outerRadius,
- outerRadius, paint
- )
- restore()
+ val topLeft = Offset(clipRect.left, clipRect.top)
+ val size = Size(clipRect.width, clipRect.height)
+ clipRect(topLeft, size, ClipOp.difference) {
+ drawRoundRect(
+ color,
+ Offset(outer.left, outer.top),
+ Size(outer.width, outer.height),
+ radius,
+ style = stroke
+ )
+ }
- save()
- clipRect(clipRect)
- paint.strokeWidth = innerStrokeWidth
- val innerHalfStrokeWidth = paint.strokeWidth / 2
- drawRect(outer.shrink(innerHalfStrokeWidth - offset).outerRect(), paint)
- restore()
+ clipRect(topLeft, size) {
+ val innerHalfStrokeWidth = innerStrokeWidth / 2
+ val rect = outer.shrink(innerHalfStrokeWidth - offset).outerRect()
+ drawRect(
+ color = color,
+ topLeft = Offset(rect.left, rect.top),
+ size = Size(rect.width, rect.height),
+ style = Stroke(innerStrokeWidth)
+ )
+ }
} else {
drawRoundRect(
- outer.left, outer.top, outer.right, outer.bottom, outerRadius,
- outerRadius, paint
+ color,
+ topLeft = Offset(outer.left, outer.top),
+ size = Size(outer.width, outer.height),
+ radiusX = radius,
+ radiusY = radius,
+ style = stroke
)
}
}
-private fun DrawScope.drawCheck(
+private fun CanvasScope.drawCheck(
checkFraction: Float,
crossCenterGravitation: Float,
- paint: Paint
+ strokeWidthPx: Float
) {
- paint.isAntiAlias = true
- paint.style = PaintingStyle.stroke
- paint.strokeCap = StrokeCap.square
- paint.strokeWidth = StrokeWidth.toPx().value
- paint.color = CheckStrokeDefaultColor
-
- val width = size.width.value
-
+ val stroke = Stroke(width = strokeWidthPx, cap = StrokeCap.square)
+ val width = size.width
val checkCrossX = 0.4f
val checkCrossY = 0.7f
val leftX = 0.2f
@@ -244,8 +252,8 @@
width * calcMiddleValue(gravitatedCrossX, leftX, checkFraction),
width * calcMiddleValue(gravitatedCrossY, gravitatedLeftY, checkFraction)
)
- drawLine(crossPoint, leftBranch, paint)
- drawLine(crossPoint, rightBranch, paint)
+ drawLine(CheckStrokeDefaultColor, crossPoint, leftBranch, stroke)
+ drawLine(CheckStrokeDefaultColor, crossPoint, rightBranch, stroke)
}
private fun calcMiddleValue(start: Float, finish: Float, fraction: Float): Float {
diff --git a/ui/ui-material/src/main/java/androidx/ui/material/Drawer.kt b/ui/ui-material/src/main/java/androidx/ui/material/Drawer.kt
index 8574f6a..00e85b9 100644
--- a/ui/ui-material/src/main/java/androidx/ui/material/Drawer.kt
+++ b/ui/ui-material/src/main/java/androidx/ui/material/Drawer.kt
@@ -19,7 +19,6 @@
import androidx.animation.AnimatedFloat
import androidx.animation.PhysicsBuilder
import androidx.compose.Composable
-import androidx.compose.remember
import androidx.ui.core.DensityAmbient
import androidx.ui.core.Layout
import androidx.ui.core.Modifier
@@ -28,11 +27,9 @@
import androidx.ui.core.hasBoundedHeight
import androidx.ui.core.hasBoundedWidth
import androidx.ui.foundation.Box
-import androidx.ui.foundation.Canvas
+import androidx.ui.foundation.Canvas2
import androidx.ui.foundation.Clickable
import androidx.ui.foundation.gestures.DragDirection
-import androidx.ui.graphics.Paint
-import androidx.ui.graphics.PaintingStyle
import androidx.ui.layout.DpConstraints
import androidx.ui.layout.Stack
import androidx.ui.layout.fillMaxSize
@@ -43,7 +40,6 @@
import androidx.ui.unit.dp
import androidx.ui.unit.min
import androidx.ui.unit.px
-import androidx.ui.unit.toRect
import androidx.ui.util.lerp
/**
@@ -265,12 +261,9 @@
) {
// TODO: use enabled = false here when it will be available
val scrimContent = @Composable {
- val paint = remember { Paint().apply { style = PaintingStyle.fill } }
val color = MaterialTheme.colors.onSurface
- Canvas(Modifier.fillMaxSize()) {
- val scrimAlpha = fraction() * ScrimDefaultOpacity
- paint.color = color.copy(alpha = scrimAlpha)
- drawRect(size.toRect(), paint)
+ Canvas2(Modifier.fillMaxSize()) {
+ drawRect(color, alpha = fraction() * ScrimDefaultOpacity)
}
}
if (state == DrawerState.Opened) {
diff --git a/ui/ui-material/src/main/java/androidx/ui/material/ProgressIndicator.kt b/ui/ui-material/src/main/java/androidx/ui/material/ProgressIndicator.kt
index 386440d..ea4d821 100644
--- a/ui/ui-material/src/main/java/androidx/ui/material/ProgressIndicator.kt
+++ b/ui/ui-material/src/main/java/androidx/ui/material/ProgressIndicator.kt
@@ -24,20 +24,18 @@
import androidx.animation.transitionDefinition
import androidx.annotation.FloatRange
import androidx.compose.Composable
-import androidx.compose.remember
import androidx.ui.animation.Transition
import androidx.ui.core.DensityAmbient
import androidx.ui.core.Modifier
-import androidx.ui.core.DrawScope
import androidx.ui.core.LayoutDirection
-import androidx.ui.foundation.Canvas
+import androidx.ui.foundation.Canvas2
import androidx.ui.foundation.DeterminateProgressIndicator
import androidx.ui.geometry.Offset
-import androidx.ui.geometry.Rect
+import androidx.ui.geometry.Size
import androidx.ui.graphics.Color
-import androidx.ui.graphics.Paint
-import androidx.ui.graphics.PaintingStyle
import androidx.ui.graphics.StrokeCap
+import androidx.ui.graphics.painter.CanvasScope
+import androidx.ui.graphics.painter.Stroke
import androidx.ui.graphics.vectormath.degrees
import androidx.ui.layout.padding
import androidx.ui.layout.preferredSize
@@ -60,14 +58,16 @@
color: Color = MaterialTheme.colors.primary
) {
DeterminateProgressIndicator(progress = progress) {
- val paint = paint(color, StrokeCap.butt)
- val backgroundPaint = paint(
- color.copy(alpha = BackgroundOpacity),
- StrokeCap.butt
- )
- Canvas(modifier.preferredSize(LinearIndicatorWidth, LinearIndicatorHeight)) {
- drawLinearIndicatorBackground(backgroundPaint)
- drawLinearIndicator(0f, progress, paint)
+ val stroke = with(DensityAmbient.current) {
+ Stroke(
+ width = ProgressIndicatorConstants.DefaultStrokeWidth.toPx().value,
+ cap = StrokeCap.butt
+ )
+ }
+ val backgroundColor = color.copy(alpha = BackgroundOpacity)
+ Canvas2(modifier.preferredSize(LinearIndicatorWidth, LinearIndicatorHeight)) {
+ drawLinearIndicatorBackground(backgroundColor, stroke)
+ drawLinearIndicator(0f, progress, color, stroke)
}
}
}
@@ -92,30 +92,42 @@
val firstLineTail = state[FirstLineTailProp]
val secondLineHead = state[SecondLineHeadProp]
val secondLineTail = state[SecondLineTailProp]
- val paint = paint(color, StrokeCap.butt)
- val backgroundPaint = paint(
- color.copy(alpha = BackgroundOpacity),
- StrokeCap.butt
- )
- Canvas(modifier.preferredSize(LinearIndicatorWidth, LinearIndicatorHeight)) {
- drawLinearIndicatorBackground(backgroundPaint)
+ val backgroundColor = color.copy(alpha = BackgroundOpacity)
+ val stroke = with(DensityAmbient.current) {
+ Stroke(
+ width = ProgressIndicatorConstants.DefaultStrokeWidth.toPx().value,
+ cap = StrokeCap.butt
+ )
+ }
+ Canvas2(modifier.preferredSize(LinearIndicatorWidth, LinearIndicatorHeight)) {
+ drawLinearIndicatorBackground(backgroundColor, stroke)
if (firstLineHead - firstLineTail > 0) {
- drawLinearIndicator(firstLineHead, firstLineTail, paint)
+ drawLinearIndicator(
+ firstLineHead,
+ firstLineTail,
+ color,
+ stroke)
}
if ((secondLineHead - secondLineTail) > 0) {
- drawLinearIndicator(secondLineHead, secondLineTail, paint)
+ drawLinearIndicator(
+ secondLineHead,
+ secondLineTail,
+ color,
+ stroke)
}
}
}
}
-private fun DrawScope.drawLinearIndicator(
+private fun CanvasScope.drawLinearIndicator(
startFraction: Float,
endFraction: Float,
- paint: Paint
+ color: Color,
+ stroke: Stroke,
+ layoutDirection: LayoutDirection = LayoutDirection.Ltr
) {
- val width = size.width.value
- val height = size.height.value
+ val width = size.width
+ val height = size.height
// Start drawing from the vertical center of the stroke
val yOffset = height / 2
@@ -124,11 +136,14 @@
val barEnd = (if (isLtr) endFraction else 1f - startFraction) * width
// Progress line
- drawLine(Offset(barStart, yOffset), Offset(barEnd, yOffset), paint)
+ drawLine(color, Offset(barStart, yOffset), Offset(barEnd, yOffset), stroke)
}
-private fun DrawScope.drawLinearIndicatorBackground(paint: Paint) =
- drawLinearIndicator(0f, 1f, paint)
+private fun CanvasScope.drawLinearIndicatorBackground(
+ color: Color,
+ stroke: Stroke,
+ layoutDirection: LayoutDirection = LayoutDirection.Ltr
+) = drawLinearIndicator(0f, 1f, color, stroke, layoutDirection)
/**
* A determinate circular progress indicator that represents progress by drawing an arc ranging from
@@ -147,8 +162,10 @@
strokeWidth: Dp = ProgressIndicatorConstants.DefaultStrokeWidth
) {
DeterminateProgressIndicator(progress = progress) {
- val paint = paint(color, StrokeCap.butt, strokeWidth)
- Canvas(
+ val stroke = with(DensityAmbient.current) {
+ Stroke(width = strokeWidth.toPx().value, cap = StrokeCap.butt)
+ }
+ Canvas2(
modifier
.padding(CircularIndicatorPadding)
.preferredSize(CircularIndicatorDiameter)
@@ -156,7 +173,7 @@
// Start at 12 O'clock
val startAngle = 270f
val sweep = progress * 360f
- drawDeterminateCircularIndicator(startAngle, sweep, paint)
+ drawDeterminateCircularIndicator(startAngle, sweep, color, stroke)
}
}
}
@@ -174,7 +191,9 @@
color: Color = MaterialTheme.colors.primary,
strokeWidth: Dp = ProgressIndicatorConstants.DefaultStrokeWidth
) {
- val paint = paint(color, StrokeCap.square, strokeWidth)
+ val stroke = with(DensityAmbient.current) {
+ Stroke(width = strokeWidth.toPx().value, cap = StrokeCap.square)
+ }
Transition(
definition = CircularIndeterminateTransition,
initState = 0,
@@ -194,29 +213,34 @@
startAngle += StartAngleOffset + currentRotationAngleOffset
startAngle += baseRotation
- Canvas(
+ Canvas2(
modifier.padding(CircularIndicatorPadding)
.preferredSize(CircularIndicatorDiameter)
) {
- drawIndeterminateCircularIndicator(startAngle, strokeWidth, sweep, paint)
+ drawIndeterminateCircularIndicator(startAngle, strokeWidth, sweep, color, stroke)
}
}
}
-private fun DrawScope.drawCircularIndicator(startAngle: Float, sweep: Float, paint: Paint) {
- val diameter = size.width.value
+private fun CanvasScope.drawCircularIndicator(
+ startAngle: Float,
+ sweep: Float,
+ color: Color,
+ stroke: Stroke
+) {
// To draw this circle we need a rect with edges that line up with the midpoint of the stroke.
// To do this we need to remove half the stroke width from the total diameter for both sides.
- val diameterOffset = paint.strokeWidth / 2
-
- val left = diameterOffset
- val right = diameter - diameterOffset
-
- val top = diameterOffset
- val bottom = diameter - diameterOffset
-
- val rect = Rect.fromLTRB(left, top, right, bottom)
- drawArc(rect, startAngle, sweep, false, paint)
+ val diameterOffset = stroke.width / 2
+ val arcDimen = size.width - 2 * diameterOffset
+ drawArc(
+ color = color,
+ startAngle = startAngle,
+ sweepAngle = sweep,
+ useCenter = false,
+ topLeft = Offset(diameterOffset, diameterOffset),
+ size = Size(arcDimen, arcDimen),
+ style = stroke
+ )
}
/**
@@ -233,17 +257,19 @@
val DefaultStrokeWidth = 4.dp
}
-private fun DrawScope.drawDeterminateCircularIndicator(
+private fun CanvasScope.drawDeterminateCircularIndicator(
startAngle: Float,
sweep: Float,
- paint: Paint
-) = drawCircularIndicator(startAngle, sweep, paint)
+ color: Color,
+ stroke: Stroke
+) = drawCircularIndicator(startAngle, sweep, color, stroke)
-private fun DrawScope.drawIndeterminateCircularIndicator(
+private fun CanvasScope.drawIndeterminateCircularIndicator(
startAngle: Float,
strokeWidth: Dp,
sweep: Float,
- paint: Paint
+ color: Color,
+ stroke: Stroke
) {
// Length of arc is angle * radius
// Angle (radians) is length / radius
@@ -258,7 +284,7 @@
// the stroke caps get added on both ends and we draw the correct minimum length arc
val adjustedSweep = max(sweep, 0.1f)
- drawCircularIndicator(adjustedStartAngle, adjustedSweep, paint)
+ drawCircularIndicator(adjustedStartAngle, adjustedSweep, color, stroke)
}
// LinearProgressIndicator Material specs
@@ -441,20 +467,3 @@
}
}
}
-
-@Composable
-private fun paint(
- color: Color,
- strokeCap: StrokeCap,
- strokeWidth: Dp = ProgressIndicatorConstants.DefaultStrokeWidth
-): Paint = with(DensityAmbient.current) {
- remember {
- Paint().apply {
- style = PaintingStyle.stroke
- this.strokeWidth = strokeWidth.toPx().value
- }
- }.apply {
- this.color = color
- this.strokeCap = strokeCap
- }
-}
diff --git a/ui/ui-material/src/main/java/androidx/ui/material/RadioButton.kt b/ui/ui-material/src/main/java/androidx/ui/material/RadioButton.kt
index 083dbab..9727e47 100644
--- a/ui/ui-material/src/main/java/androidx/ui/material/RadioButton.kt
+++ b/ui/ui-material/src/main/java/androidx/ui/material/RadioButton.kt
@@ -23,16 +23,16 @@
import androidx.ui.animation.ColorPropKey
import androidx.ui.animation.DpPropKey
import androidx.ui.animation.Transition
+import androidx.ui.core.DensityAmbient
import androidx.ui.core.Modifier
-import androidx.ui.core.DrawScope
import androidx.ui.foundation.Box
-import androidx.ui.foundation.Canvas
+import androidx.ui.foundation.Canvas2
import androidx.ui.foundation.Text
import androidx.ui.foundation.selection.MutuallyExclusiveSetItem
import androidx.ui.geometry.Offset
import androidx.ui.graphics.Color
-import androidx.ui.graphics.Paint
-import androidx.ui.graphics.PaintingStyle
+import androidx.ui.graphics.painter.CanvasScope
+import androidx.ui.graphics.painter.Stroke
import androidx.ui.layout.Column
import androidx.ui.layout.Row
import androidx.ui.layout.Stack
@@ -42,7 +42,6 @@
import androidx.ui.material.ripple.ripple
import androidx.ui.semantics.Semantics
import androidx.ui.text.TextStyle
-import androidx.ui.unit.Dp
import androidx.ui.unit.dp
/**
@@ -198,7 +197,6 @@
onSelect: (() -> Unit)?,
color: Color = MaterialTheme.colors.secondary
) {
- val radioPaint = remember { Paint() }
Stack {
MutuallyExclusiveSetItem(
selected = selected, onClick = { if (!selected) onSelect?.invoke() },
@@ -210,13 +208,23 @@
generateTransitionDefinition(color, unselectedColor)
}
Transition(definition = definition, toState = selected) { state ->
- Canvas(Modifier.padding(RadioButtonPadding).preferredSize(RadioButtonSize)) {
+ val outerPx: Float
+ val innerPx: Float
+ val gapWidth: Float
+ val radioStroke: Stroke
+ with(DensityAmbient.current) {
+ outerPx = state[OuterRadiusProp].toPx().value
+ innerPx = state[InnerRadiusProp].toPx().value
+ gapWidth = state[GapProp].toPx().value
+ radioStroke = Stroke(RadioStrokeWidth.toPx().value)
+ }
+ Canvas2(Modifier.padding(RadioButtonPadding).preferredSize(RadioButtonSize)) {
drawRadio(
state[ColorProp],
- state[OuterRadiusProp],
- state[InnerRadiusProp],
- state[GapProp],
- radioPaint
+ outerPx,
+ innerPx,
+ gapWidth,
+ radioStroke
)
}
}
@@ -224,40 +232,28 @@
}
}
-private fun DrawScope.drawRadio(
+private fun CanvasScope.drawRadio(
color: Color,
- outerRadius: Dp,
- innerRadius: Dp,
- gap: Dp,
- paint: Paint
+ outerPx: Float,
+ innerPx: Float,
+ gapWidth: Float,
+ radioStroke: Stroke
) {
- paint.isAntiAlias = true
- paint.color = color
-
// TODO(malkov): currently Radio gravity is always CENTER but we need to be flexible
- val centerW = size.width.value / 2
- val centerH = size.height.value / 2
- val outerPx = outerRadius.toPx().value
- val innerPx = innerRadius.toPx().value
+ val centerW = center.dx
+ val centerH = center.dy
val center = Offset(centerW, centerH)
- if (gap == 0.dp) {
+ if (gapWidth == 0.0f) {
val strokeWidth = outerPx - innerPx
- paint.style = PaintingStyle.stroke
- paint.strokeWidth = strokeWidth
- drawCircle(center, outerPx - strokeWidth / 2, paint)
+ drawCircle(color, outerPx - strokeWidth / 2, center, style = Stroke(strokeWidth))
} else {
- val strokeWidth = RadioStrokeWidth.toPx().value
- paint.style = PaintingStyle.stroke
- paint.strokeWidth = strokeWidth
- drawCircle(center, outerPx - strokeWidth / 2, paint)
-
- val gapWidth = gap.toPx().value
- val circleRadius = outerPx - strokeWidth - gapWidth
+ drawCircle(color, outerPx - radioStroke.width / 2, center, style = radioStroke)
+ val circleRadius = outerPx - radioStroke.width - gapWidth
val innerCircleStrokeWidth = circleRadius - innerPx
- paint.strokeWidth = innerCircleStrokeWidth
- drawCircle(center, circleRadius - innerCircleStrokeWidth / 2, paint)
+ drawCircle(color, circleRadius - innerCircleStrokeWidth / 2, center,
+ style = Stroke(innerCircleStrokeWidth))
}
}
diff --git a/ui/ui-material/src/main/java/androidx/ui/material/Slider.kt b/ui/ui-material/src/main/java/androidx/ui/material/Slider.kt
index f691613..55533ae 100644
--- a/ui/ui-material/src/main/java/androidx/ui/material/Slider.kt
+++ b/ui/ui-material/src/main/java/androidx/ui/material/Slider.kt
@@ -34,7 +34,7 @@
import androidx.ui.core.WithConstraints
import androidx.ui.core.gesture.pressIndicatorGestureFilter
import androidx.ui.foundation.Box
-import androidx.ui.foundation.Canvas
+import androidx.ui.foundation.Canvas2
import androidx.ui.foundation.animation.FlingConfig
import androidx.ui.foundation.animation.fling
import androidx.ui.foundation.gestures.DragDirection
@@ -42,10 +42,9 @@
import androidx.ui.foundation.shape.corner.CircleShape
import androidx.ui.geometry.Offset
import androidx.ui.graphics.Color
-import androidx.ui.graphics.Paint
-import androidx.ui.graphics.PaintingStyle
import androidx.ui.graphics.PointMode
import androidx.ui.graphics.StrokeCap
+import androidx.ui.graphics.painter.Stroke
import androidx.ui.layout.Spacer
import androidx.ui.layout.Stack
import androidx.ui.layout.fillMaxSize
@@ -58,7 +57,6 @@
import androidx.ui.semantics.accessibilityValue
import androidx.ui.unit.dp
import androidx.ui.unit.px
-import androidx.ui.unit.toRect
import androidx.ui.util.lerp
import kotlin.math.abs
@@ -180,7 +178,15 @@
val thumbSize = ThumbRadius * 2
val offset = (widthDp - thumbSize) * positionFraction
val center = Modifier.gravity(Alignment.CenterStart)
- Track(center.fillMaxSize(), color, positionFraction, tickFractions)
+
+ val trackStrokeWidth: Float
+ val thumbPx: Float
+ with(DensityAmbient.current) {
+ trackStrokeWidth = TrackHeight.toPx().value
+ thumbPx = ThumbRadius.toPx().value
+ }
+ val trackStroke = Stroke(trackStrokeWidth, cap = StrokeCap.round)
+ Track(center.fillMaxSize(), color, positionFraction, tickFractions, thumbPx, trackStroke)
Box(center.padding(start = offset)) {
Surface(
shape = CircleShape,
@@ -199,38 +205,36 @@
modifier: Modifier,
color: Color,
positionFraction: Float,
- tickFractions: List<Float>
+ tickFractions: List<Float>,
+ thumbPx: Float,
+ trackStroke: Stroke
) {
val activeTickColor = MaterialTheme.colors.onPrimary.copy(alpha = TickColorAlpha)
val inactiveTickColor = color.copy(alpha = TickColorAlpha)
- val paint = remember {
- Paint().apply {
- this.isAntiAlias = true
- this.strokeCap = StrokeCap.round
- this.style = PaintingStyle.stroke
- }
- }
- Canvas(modifier) {
- paint.strokeWidth = TrackHeight.toPx().value
- val parentRect = size.toRect()
- val thumbPx = ThumbRadius.toPx().value
- val centerHeight = size.height.value / 2
- val sliderStart = Offset(parentRect.left + thumbPx, centerHeight)
- val sliderMax = Offset(parentRect.right - thumbPx, centerHeight)
- paint.color = color.copy(alpha = InactiveTrackColorAlpha)
- drawLine(sliderStart, sliderMax, paint)
+ Canvas2(modifier) {
+ val sliderStart = Offset(thumbPx, center.dy)
+ val sliderMax = Offset(size.width - thumbPx, center.dy)
+ drawLine(
+ color.copy(alpha = InactiveTrackColorAlpha),
+ sliderStart,
+ sliderMax,
+ trackStroke
+ )
val sliderValue = Offset(
sliderStart.dx + (sliderMax.dx - sliderStart.dx) * positionFraction,
- centerHeight
+ center.dy
)
- paint.color = color
- drawLine(sliderStart, sliderValue, paint)
+
+ drawLine(color, sliderStart, sliderValue, trackStroke)
tickFractions.groupBy { it > positionFraction }.forEach { (afterFraction, list) ->
- paint.color = if (afterFraction) inactiveTickColor else activeTickColor
- val points = list.map {
- Offset(Offset.lerp(sliderStart, sliderMax, it).dx, centerHeight)
- }
- drawPoints(PointMode.points, points, paint)
+ drawPoints(
+ list.map {
+ Offset(Offset.lerp(sliderStart, sliderMax, it).dx, center.dy)
+ },
+ PointMode.points,
+ if (afterFraction) inactiveTickColor else activeTickColor,
+ trackStroke
+ )
}
}
}
diff --git a/ui/ui-material/src/main/java/androidx/ui/material/Switch.kt b/ui/ui-material/src/main/java/androidx/ui/material/Switch.kt
index c6e29a0..fb00b34 100644
--- a/ui/ui-material/src/main/java/androidx/ui/material/Switch.kt
+++ b/ui/ui-material/src/main/java/androidx/ui/material/Switch.kt
@@ -21,14 +21,14 @@
import androidx.compose.Composable
import androidx.ui.core.DensityAmbient
import androidx.ui.core.Modifier
-import androidx.ui.core.DrawScope
-import androidx.ui.foundation.Canvas
+import androidx.ui.foundation.Canvas2
import androidx.ui.foundation.gestures.DragDirection
import androidx.ui.foundation.selection.Toggleable
import androidx.ui.geometry.Offset
import androidx.ui.graphics.Color
-import androidx.ui.graphics.Paint
import androidx.ui.graphics.StrokeCap
+import androidx.ui.graphics.painter.CanvasScope
+import androidx.ui.graphics.painter.Stroke
import androidx.ui.layout.Stack
import androidx.ui.layout.padding
import androidx.ui.layout.preferredSize
@@ -36,7 +36,6 @@
import androidx.ui.material.ripple.ripple
import androidx.ui.semantics.Semantics
import androidx.ui.unit.dp
-import androidx.ui.unit.px
/**
* A Switch is a two state toggleable component that provides on/off like options
@@ -110,40 +109,35 @@
} else {
MaterialTheme.colors.onSurface.copy(alpha = UncheckedTrackOpacity)
}
- Canvas(modifier.preferredSize(SwitchWidth, SwitchHeight)) {
- drawTrack(trackColor)
- drawThumb(thumbValue.value, thumbColor)
+
+ val trackStroke: Stroke
+ val trackWidth: Float
+ val thumbDiameter: Float
+ with(DensityAmbient.current) {
+ trackStroke = Stroke(width = TrackStrokeWidth.toPx().value, cap = StrokeCap.round)
+ trackWidth = TrackWidth.toPx().value
+ thumbDiameter = ThumbDiameter.toPx().value
+ }
+ Canvas2(modifier.preferredSize(SwitchWidth, SwitchHeight)) {
+ drawTrack(trackColor, trackWidth, trackStroke)
+ drawThumb(thumbValue.value, thumbDiameter, thumbColor)
}
}
-private fun DrawScope.drawTrack(trackColor: Color) {
- val paint = Paint().apply {
- isAntiAlias = true
- color = trackColor
- strokeCap = StrokeCap.round
- strokeWidth = TrackStrokeWidth.toPx().value
- }
-
- val strokeRadius = TrackStrokeWidth / 2
- val centerHeight = size.height / 2
-
+private fun CanvasScope.drawTrack(trackColor: Color, trackWidth: Float, stroke: Stroke) {
+ val strokeRadius = stroke.width / 2
drawLine(
- Offset(strokeRadius.toPx().value, centerHeight.value),
- Offset((TrackWidth - strokeRadius).toPx().value, centerHeight.value),
- paint
+ trackColor,
+ Offset(strokeRadius, center.dy),
+ Offset(trackWidth - strokeRadius, center.dy),
+ stroke
)
}
-private fun DrawScope.drawThumb(position: Float, thumbColor: Color) {
- val paint = Paint().apply {
- isAntiAlias = true
- color = thumbColor
- }
- val centerHeight = size.height / 2
- val thumbRadius = (ThumbDiameter / 2).toPx().value
- val x = position.px.value + thumbRadius
-
- drawCircle(Offset(x, centerHeight.value), thumbRadius, paint)
+private fun CanvasScope.drawThumb(position: Float, thumbDiameter: Float, thumbColor: Color) {
+ val thumbRadius = thumbDiameter / 2
+ val x = position + thumbRadius
+ drawCircle(thumbColor, thumbRadius, Offset(x, center.dy))
}
private const val CheckedTrackOpacity = 0.54f
diff --git a/ui/ui-material/src/main/java/androidx/ui/material/TextField.kt b/ui/ui-material/src/main/java/androidx/ui/material/TextField.kt
index becd1f8..41d3c51 100644
--- a/ui/ui-material/src/main/java/androidx/ui/material/TextField.kt
+++ b/ui/ui-material/src/main/java/androidx/ui/material/TextField.kt
@@ -314,7 +314,8 @@
focused = it
onFocusChange(it)
},
- focusNode = focusNode
+ focusNode = focusNode,
+ cursorColor = if (isErrorValue) errorColor else MaterialTheme.colors.primary
)
}
}
@@ -475,14 +476,14 @@
height,
textfieldPlaceable,
labelPlaceable,
+ placeholderPlaceable,
labelEndPosition,
textfieldPositionY,
animationProgress
)
} else {
- placeTextfield(width, height, textfieldPlaceable)
+ placeTextfield(width, height, textfieldPlaceable, placeholderPlaceable)
}
- placeholderPlaceable?.place(IntPx.Zero, textfieldPositionY)
}
}
}
@@ -601,13 +602,14 @@
}
/**
- * Places a text field and a label with respect to the baseline offsets
+ * Places the provided text field, placeholder and label with respect to the baseline offsets
*/
private fun Placeable.PlacementScope.placeLabelAndTextfield(
width: IntPx,
height: IntPx,
textfieldPlaceable: Placeable,
labelPlaceable: Placeable,
+ placeholderPlaceable: Placeable?,
labelEndPosition: IntPx,
textPosition: IntPx,
animationProgress: Float
@@ -624,15 +626,17 @@
labelPlaceable.place(IntPx.Zero, labelPositionY)
textfieldPlaceable.place(IntPx.Zero, textPosition)
+ placeholderPlaceable?.place(IntPx.Zero, textPosition)
}
/**
- * Places a text field center vertically
+ * Places the provided text field and placeholder center vertically
*/
private fun Placeable.PlacementScope.placeTextfield(
width: IntPx,
height: IntPx,
- textPlaceable: Placeable
+ textPlaceable: Placeable,
+ placeholderPlaceable: Placeable?
) {
val textCenterPosition = Alignment.CenterStart.align(
IntPxSize(
@@ -641,6 +645,7 @@
)
)
textPlaceable.place(IntPx.Zero, textCenterPosition.y)
+ placeholderPlaceable?.place(IntPx.Zero, textCenterPosition.y)
}
private object TextFieldTransitionScope {
diff --git a/ui/ui-platform/src/main/java/androidx/ui/core/AndroidOwner.kt b/ui/ui-platform/src/main/java/androidx/ui/core/AndroidOwner.kt
index 76b6c1e..8ba4fec 100644
--- a/ui/ui-platform/src/main/java/androidx/ui/core/AndroidOwner.kt
+++ b/ui/ui-platform/src/main/java/androidx/ui/core/AndroidOwner.kt
@@ -234,6 +234,8 @@
isFocusable = true
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
focusable = View.FOCUSABLE
+ // not to add the default focus highlight to the whole compose view
+ defaultFocusHighlightEnabled = false
}
isFocusableInTouchMode = true
clipChildren = false
diff --git a/ui/ui-platform/src/main/java/androidx/ui/core/ModifiedDrawNode.kt b/ui/ui-platform/src/main/java/androidx/ui/core/ModifiedDrawNode.kt
index df6f8bd..f6ed00f 100644
--- a/ui/ui-platform/src/main/java/androidx/ui/core/ModifiedDrawNode.kt
+++ b/ui/ui-platform/src/main/java/androidx/ui/core/ModifiedDrawNode.kt
@@ -17,8 +17,8 @@
package androidx.ui.core
import androidx.ui.geometry.Offset
-import androidx.ui.geometry.RRect
import androidx.ui.geometry.Rect
+import androidx.ui.geometry.Size
import androidx.ui.graphics.BlendMode
import androidx.ui.graphics.Canvas
import androidx.ui.graphics.ClipOp
@@ -87,9 +87,13 @@
override fun concat(matrix4: Matrix4) = canvas!!.concat(matrix4)
- override fun clipRect(rect: Rect, clipOp: ClipOp) = canvas!!.clipRect(rect, clipOp)
-
- override fun clipRRect(rrect: RRect) = canvas!!.clipRRect(rrect)
+ override fun clipRect(
+ left: Float,
+ top: Float,
+ right: Float,
+ bottom: Float,
+ clipOp: ClipOp
+ ) = canvas!!.clipRect(left, top, right, bottom, clipOp)
override fun clipPath(path: Path) = canvas!!.clipPath(path)
@@ -98,6 +102,23 @@
override fun drawRect(rect: Rect, paint: Paint) = canvas!!.drawRect(rect, paint)
+ override fun drawRect(left: Float, top: Float, right: Float, bottom: Float, paint: Paint) =
+ canvas!!.drawRect(left, top, right, bottom, paint)
+
+ override fun drawOval(left: Float, top: Float, right: Float, bottom: Float, paint: Paint) =
+ canvas!!.drawOval(left, top, right, bottom, paint)
+
+ override fun drawArc(
+ left: Float,
+ top: Float,
+ right: Float,
+ bottom: Float,
+ startAngle: Float,
+ sweepAngle: Float,
+ useCenter: Boolean,
+ paint: Paint
+ ) = canvas!!.drawArc(left, top, right, bottom, startAngle, sweepAngle, useCenter, paint)
+
override fun drawRoundRect(
left: Float,
top: Float,
@@ -113,21 +134,19 @@
override fun drawCircle(center: Offset, radius: Float, paint: Paint) =
canvas!!.drawCircle(center, radius, paint)
- override fun drawArc(
- rect: Rect,
- startAngle: Float,
- sweepAngle: Float,
- useCenter: Boolean,
- paint: Paint
- ) = canvas!!.drawArc(rect, startAngle, sweepAngle, useCenter, paint)
-
override fun drawPath(path: Path, paint: Paint) = canvas!!.drawPath(path, paint)
override fun drawImage(image: ImageAsset, topLeftOffset: Offset, paint: Paint) =
canvas!!.drawImage(image, topLeftOffset, paint)
- override fun drawImageRect(image: ImageAsset, src: Rect?, dst: Rect, paint: Paint) =
- canvas!!.drawImageRect(image, src, dst, paint)
+ override fun drawImageRect(
+ image: ImageAsset,
+ srcOffset: Offset,
+ srcSize: Size,
+ dstOffset: Offset,
+ dstSize: Size,
+ paint: Paint
+ ) = canvas!!.drawImageRect(image, srcOffset, srcSize, dstOffset, dstSize, paint)
override fun drawPicture(picture: Picture) = canvas!!.drawPicture(picture)
diff --git a/ui/ui-rxjava2/src/main/java/androidx/ui/rxjava2/RxJava2Adapter.kt b/ui/ui-rxjava2/src/main/java/androidx/ui/rxjava2/RxJava2Adapter.kt
index 3b6abe6..7955232 100644
--- a/ui/ui-rxjava2/src/main/java/androidx/ui/rxjava2/RxJava2Adapter.kt
+++ b/ui/ui-rxjava2/src/main/java/androidx/ui/rxjava2/RxJava2Adapter.kt
@@ -17,18 +17,17 @@
package androidx.ui.rxjava2
import androidx.compose.Composable
-import androidx.compose.CompositionLifecycleObserver
+import androidx.compose.Composer
import androidx.compose.FrameManager
import androidx.compose.State
-import androidx.compose.mutableStateOf
-import androidx.compose.remember
+import androidx.compose.onPreCommit
+import androidx.compose.state
import io.reactivex.Completable
import io.reactivex.Flowable
import io.reactivex.Maybe
import io.reactivex.Observable
import io.reactivex.Single
import io.reactivex.disposables.Disposable
-import io.reactivex.functions.Consumer
import io.reactivex.plugins.RxJavaPlugins
/**
@@ -62,15 +61,8 @@
* @sample androidx.ui.rxjava2.samples.ObservableWithInitialSample
*/
@Composable
-fun <R, T : R> Observable<T>.subscribeAsState(initial: R): State<R> {
- val observer = remember {
- DisposableConsumer<R, Observable<T>>(initial) {
- subscribe(it)
- }
- }
- observer.source = this
- return observer.state
-}
+fun <R, T : R> Observable<T>.subscribeAsState(initial: R): State<R> =
+ asState(initial) { subscribe(it) }
/**
* Subscribes to this [Flowable] and represents its values via [State]. Every time there would
@@ -103,15 +95,8 @@
* @sample androidx.ui.rxjava2.samples.FlowableWithInitialSample
*/
@Composable
-fun <R, T : R> Flowable<T>.subscribeAsState(initial: R): State<R> {
- val observer = remember {
- DisposableConsumer<R, Flowable<T>>(initial) {
- subscribe(it)
- }
- }
- observer.source = this
- return observer.state
-}
+fun <R, T : R> Flowable<T>.subscribeAsState(initial: R): State<R> =
+ asState(initial) { subscribe(it) }
/**
* Subscribes to this [Single] and represents its value via [State]. Once the value would be
@@ -144,15 +129,8 @@
* @sample androidx.ui.rxjava2.samples.SingleWithInitialSample
*/
@Composable
-fun <R, T : R> Single<T>.subscribeAsState(initial: R): State<R> {
- val observer = remember {
- DisposableConsumer<R, Single<T>>(initial) {
- subscribe(it)
- }
- }
- observer.source = this
- return observer.state
-}
+fun <R, T : R> Single<T>.subscribeAsState(initial: R): State<R> =
+ asState(initial) { subscribe(it) }
/**
* Subscribes to this [Maybe] and represents its value via [State]. Once the value would be
@@ -185,15 +163,8 @@
* @sample androidx.ui.rxjava2.samples.MaybeWithInitialSample
*/
@Composable
-fun <R, T : R> Maybe<T>.subscribeAsState(initial: R): State<R> {
- val observer = remember {
- DisposableConsumer<R, Maybe<T>>(initial) {
- subscribe(it)
- }
- }
- observer.source = this
- return observer.state
-}
+fun <R, T : R> Maybe<T>.subscribeAsState(initial: R): State<R> =
+ asState(initial) { subscribe(it) }
/**
* Subscribes to this [Completable] and represents its completed state via [State]. Once the
@@ -209,45 +180,34 @@
* @sample androidx.ui.rxjava2.samples.CompletableSample
*/
@Composable
-fun Completable.subscribeAsState(): State<Boolean> {
- val observer = remember {
- DisposableConsumer<Boolean, Completable>(false) { onSuccess ->
- subscribe { onSuccess.accept(true) }
- }
- }
- observer.source = this
- return observer.state
-}
+fun Completable.subscribeAsState(): State<Boolean> =
+ asState(false) { callback -> subscribe { callback(true) } }
-private class DisposableConsumer<T, F>(
+@Composable
+private inline fun <T, S> S.asState(
initial: T,
- private val subscribe: F.(onSuccess: Consumer<T>) -> Disposable
-) : Consumer<T>, CompositionLifecycleObserver {
-
- val state = mutableStateOf(initial)
-
- private var disposable: Disposable? = null
-
- override fun accept(t: T) {
- FrameManager.framed { state.value = t }
- }
-
- var source: F? = null
- set(source) {
- if (source !== field) {
- disposable?.dispose()
- disposable = null
- field = source
- disposable = source?.subscribe(this)
- }
+ crossinline subscribe: S.((T) -> Unit) -> Disposable
+): State<T> {
+ val state = state { initial }
+ onPreCommit(this) {
+ val disposable = subscribe {
+ FrameManager.framed { state.value = it }
}
-
- override fun onLeave() {
- // the same as onDispose()
- source = null
+ onDispose { disposable.dispose() }
}
-
- override fun onEnter() {
- // do nothing
- }
+ return state
}
+
+// NOTE(lmr): This API is no longer needed in any way by the compiler, but we still need this API
+// to be here to support versions of Android Studio that are still looking for it. Without it,
+// valid composable code will look broken in the IDE. Remove this after we have left some time to
+// get all versions of Studio upgraded.
+// b/152059242
+@Deprecated(
+ "This property should not be called directly. It is only used by the compiler.",
+ replaceWith = ReplaceWith("currentComposer")
+)
+internal val composer: Composer<*>
+ get() = error(
+ "This property should not be called directly. It is only used by the compiler."
+ )
diff --git a/ui/ui-saved-instance-state/api/0.1.0-dev11.txt b/ui/ui-saved-instance-state/api/0.1.0-dev11.txt
index 7e20c34..5b9b9a9 100644
--- a/ui/ui-saved-instance-state/api/0.1.0-dev11.txt
+++ b/ui/ui-saved-instance-state/api/0.1.0-dev11.txt
@@ -14,7 +14,7 @@
}
public final class SavedInstanceStateKt {
- method public static <T> androidx.compose.MutableState<T> savedInstanceState(Object![]? inputs, androidx.ui.savedinstancestate.Saver<T,?> saver = autoSaver(), String? key = null, kotlin.jvm.functions.Function2<? super T,? super T,java.lang.Boolean> areEquivalent = ReferentiallyEqual, kotlin.jvm.functions.Function0<? extends T> init);
+ method public static <T> androidx.compose.MutableState<T> savedInstanceState(Object![]? inputs, androidx.ui.savedinstancestate.Saver<T,?> saver = autoSaver(), String? key = null, kotlin.jvm.functions.Function2<? super T,? super T,java.lang.Boolean> areEquivalent = androidx.compose.MutableStateKt.ReferentiallyEqual, kotlin.jvm.functions.Function0<? extends T> init);
}
public interface Saver<Original, Saveable> {
diff --git a/ui/ui-saved-instance-state/api/current.txt b/ui/ui-saved-instance-state/api/current.txt
index 7e20c34..5b9b9a9 100644
--- a/ui/ui-saved-instance-state/api/current.txt
+++ b/ui/ui-saved-instance-state/api/current.txt
@@ -14,7 +14,7 @@
}
public final class SavedInstanceStateKt {
- method public static <T> androidx.compose.MutableState<T> savedInstanceState(Object![]? inputs, androidx.ui.savedinstancestate.Saver<T,?> saver = autoSaver(), String? key = null, kotlin.jvm.functions.Function2<? super T,? super T,java.lang.Boolean> areEquivalent = ReferentiallyEqual, kotlin.jvm.functions.Function0<? extends T> init);
+ method public static <T> androidx.compose.MutableState<T> savedInstanceState(Object![]? inputs, androidx.ui.savedinstancestate.Saver<T,?> saver = autoSaver(), String? key = null, kotlin.jvm.functions.Function2<? super T,? super T,java.lang.Boolean> areEquivalent = androidx.compose.MutableStateKt.ReferentiallyEqual, kotlin.jvm.functions.Function0<? extends T> init);
}
public interface Saver<Original, Saveable> {
diff --git a/ui/ui-saved-instance-state/api/public_plus_experimental_0.1.0-dev11.txt b/ui/ui-saved-instance-state/api/public_plus_experimental_0.1.0-dev11.txt
index 7e20c34..5b9b9a9 100644
--- a/ui/ui-saved-instance-state/api/public_plus_experimental_0.1.0-dev11.txt
+++ b/ui/ui-saved-instance-state/api/public_plus_experimental_0.1.0-dev11.txt
@@ -14,7 +14,7 @@
}
public final class SavedInstanceStateKt {
- method public static <T> androidx.compose.MutableState<T> savedInstanceState(Object![]? inputs, androidx.ui.savedinstancestate.Saver<T,?> saver = autoSaver(), String? key = null, kotlin.jvm.functions.Function2<? super T,? super T,java.lang.Boolean> areEquivalent = ReferentiallyEqual, kotlin.jvm.functions.Function0<? extends T> init);
+ method public static <T> androidx.compose.MutableState<T> savedInstanceState(Object![]? inputs, androidx.ui.savedinstancestate.Saver<T,?> saver = autoSaver(), String? key = null, kotlin.jvm.functions.Function2<? super T,? super T,java.lang.Boolean> areEquivalent = androidx.compose.MutableStateKt.ReferentiallyEqual, kotlin.jvm.functions.Function0<? extends T> init);
}
public interface Saver<Original, Saveable> {
diff --git a/ui/ui-saved-instance-state/api/public_plus_experimental_current.txt b/ui/ui-saved-instance-state/api/public_plus_experimental_current.txt
index 7e20c34..5b9b9a9 100644
--- a/ui/ui-saved-instance-state/api/public_plus_experimental_current.txt
+++ b/ui/ui-saved-instance-state/api/public_plus_experimental_current.txt
@@ -14,7 +14,7 @@
}
public final class SavedInstanceStateKt {
- method public static <T> androidx.compose.MutableState<T> savedInstanceState(Object![]? inputs, androidx.ui.savedinstancestate.Saver<T,?> saver = autoSaver(), String? key = null, kotlin.jvm.functions.Function2<? super T,? super T,java.lang.Boolean> areEquivalent = ReferentiallyEqual, kotlin.jvm.functions.Function0<? extends T> init);
+ method public static <T> androidx.compose.MutableState<T> savedInstanceState(Object![]? inputs, androidx.ui.savedinstancestate.Saver<T,?> saver = autoSaver(), String? key = null, kotlin.jvm.functions.Function2<? super T,? super T,java.lang.Boolean> areEquivalent = androidx.compose.MutableStateKt.ReferentiallyEqual, kotlin.jvm.functions.Function0<? extends T> init);
}
public interface Saver<Original, Saveable> {
diff --git a/ui/ui-saved-instance-state/api/restricted_0.1.0-dev11.txt b/ui/ui-saved-instance-state/api/restricted_0.1.0-dev11.txt
index 7e20c34..5b9b9a9 100644
--- a/ui/ui-saved-instance-state/api/restricted_0.1.0-dev11.txt
+++ b/ui/ui-saved-instance-state/api/restricted_0.1.0-dev11.txt
@@ -14,7 +14,7 @@
}
public final class SavedInstanceStateKt {
- method public static <T> androidx.compose.MutableState<T> savedInstanceState(Object![]? inputs, androidx.ui.savedinstancestate.Saver<T,?> saver = autoSaver(), String? key = null, kotlin.jvm.functions.Function2<? super T,? super T,java.lang.Boolean> areEquivalent = ReferentiallyEqual, kotlin.jvm.functions.Function0<? extends T> init);
+ method public static <T> androidx.compose.MutableState<T> savedInstanceState(Object![]? inputs, androidx.ui.savedinstancestate.Saver<T,?> saver = autoSaver(), String? key = null, kotlin.jvm.functions.Function2<? super T,? super T,java.lang.Boolean> areEquivalent = androidx.compose.MutableStateKt.ReferentiallyEqual, kotlin.jvm.functions.Function0<? extends T> init);
}
public interface Saver<Original, Saveable> {
diff --git a/ui/ui-saved-instance-state/api/restricted_current.txt b/ui/ui-saved-instance-state/api/restricted_current.txt
index 7e20c34..5b9b9a9 100644
--- a/ui/ui-saved-instance-state/api/restricted_current.txt
+++ b/ui/ui-saved-instance-state/api/restricted_current.txt
@@ -14,7 +14,7 @@
}
public final class SavedInstanceStateKt {
- method public static <T> androidx.compose.MutableState<T> savedInstanceState(Object![]? inputs, androidx.ui.savedinstancestate.Saver<T,?> saver = autoSaver(), String? key = null, kotlin.jvm.functions.Function2<? super T,? super T,java.lang.Boolean> areEquivalent = ReferentiallyEqual, kotlin.jvm.functions.Function0<? extends T> init);
+ method public static <T> androidx.compose.MutableState<T> savedInstanceState(Object![]? inputs, androidx.ui.savedinstancestate.Saver<T,?> saver = autoSaver(), String? key = null, kotlin.jvm.functions.Function2<? super T,? super T,java.lang.Boolean> areEquivalent = androidx.compose.MutableStateKt.ReferentiallyEqual, kotlin.jvm.functions.Function0<? extends T> init);
}
public interface Saver<Original, Saveable> {
diff --git a/ui/ui-test/api/0.1.0-dev11.txt b/ui/ui-test/api/0.1.0-dev11.txt
index 575bd08..fcc20c2 100644
--- a/ui/ui-test/api/0.1.0-dev11.txt
+++ b/ui/ui-test/api/0.1.0-dev11.txt
@@ -6,6 +6,7 @@
method public static void callSemanticsAction(androidx.ui.test.SemanticsNodeInteraction, androidx.ui.semantics.SemanticsPropertyKey<androidx.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function0<kotlin.Unit>>> key);
method public static androidx.ui.test.SemanticsNodeInteraction doClick(androidx.ui.test.SemanticsNodeInteraction);
method public static androidx.ui.test.SemanticsNodeInteraction doGesture(androidx.ui.test.SemanticsNodeInteraction, kotlin.jvm.functions.Function1<? super androidx.ui.test.GestureScope,kotlin.Unit> block);
+ method public static androidx.ui.test.SemanticsNodeInteraction doPartialGesture(androidx.ui.test.SemanticsNodeInteraction, kotlin.jvm.functions.Function1<? super androidx.ui.test.PartialGestureScope,kotlin.Unit> block);
method public static androidx.ui.test.SemanticsNodeInteraction doScrollTo(androidx.ui.test.SemanticsNodeInteraction);
}
@@ -23,7 +24,7 @@
public final class AssertionsKt {
method public static androidx.ui.test.SemanticsNodeInteraction assert(androidx.ui.test.SemanticsNodeInteraction, androidx.ui.test.SemanticsMatcher matcher);
- method public static <T extends java.util.Collection<? extends androidx.ui.test.SemanticsNodeInteraction>> T assertCountEquals(T, int expectedSize);
+ method public static androidx.ui.test.SemanticsNodeInteractionCollection assertCountEquals(androidx.ui.test.SemanticsNodeInteractionCollection, int expectedSize);
method public static androidx.ui.test.SemanticsNodeInteraction assertHasClickAction(androidx.ui.test.SemanticsNodeInteraction);
method public static androidx.ui.test.SemanticsNodeInteraction assertHasNoClickAction(androidx.ui.test.SemanticsNodeInteraction);
method public static androidx.ui.test.SemanticsNodeInteraction assertIsDisplayed(androidx.ui.test.SemanticsNodeInteraction);
@@ -43,13 +44,16 @@
method public static androidx.ui.test.SemanticsNodeInteraction assertValueEquals(androidx.ui.test.SemanticsNodeInteraction, String value);
}
+ public abstract sealed class BaseGestureScope {
+ }
+
public final class BitmapHelpersKt {
- method public static void assertPixelColor-9bBi3KA(android.graphics.Bitmap, long expected, int x, int y, kotlin.jvm.functions.Function1<? super androidx.ui.graphics.Color,java.lang.String> error = { color -> "Pixel(" + x + ", " + y + ") expected to be " + expected + ", but was " + color });
+ method public static void assertPixelColor-9bBi3KA(android.graphics.Bitmap, long expected, int x, int y, kotlin.jvm.functions.Function1<? super androidx.ui.graphics.Color,java.lang.String> error = { color -> return "Pixel(" + x + ", " + y + ") expected to be " + expected + ", but was " + color });
method public static void assertPixels(android.graphics.Bitmap, androidx.ui.unit.IntPxSize? expectedSize = null, kotlin.jvm.functions.Function1<? super androidx.ui.unit.IntPxPosition,androidx.ui.graphics.Color> expectedColorProvider);
- method public static void assertShape-nbwoFSQ(android.graphics.Bitmap, androidx.ui.unit.Density density, androidx.ui.graphics.Shape shape, long shapeColor, long backgroundColor, androidx.ui.graphics.Shape backgroundShape = RectangleShape, float sizeX = width.toFloat().px, float sizeY = height.toFloat().px, float shapeSizeX = sizeX, float shapeSizeY = sizeY, float centerX = width.px / 2.0, float centerY = height.px / 2.0, float shapeOverlapPixelCount = 1.px);
+ method public static void assertShape-nbwoFSQ(android.graphics.Bitmap, androidx.ui.unit.Density density, androidx.ui.graphics.Shape shape, long shapeColor, long backgroundColor, androidx.ui.graphics.Shape backgroundShape = androidx.ui.graphics.RectangleShapeKt.RectangleShape, float sizeX = width.toFloat().px, float sizeY = height.toFloat().px, float shapeSizeX = sizeX, float shapeSizeY = sizeY, float centerX = width.px / 2.0, float centerY = height.px / 2.0, float shapeOverlapPixelCount = 1.px);
method @RequiresApi(android.os.Build.VERSION_CODES.O) public static android.graphics.Bitmap captureToBitmap(androidx.ui.test.SemanticsNodeInteraction);
method @RequiresApi(android.os.Build.VERSION_CODES.O) public static android.graphics.Bitmap captureToBitmap(android.view.View);
- method public static boolean contains(androidx.ui.graphics.Path, androidx.ui.geometry.Offset offset);
+ method public static boolean contains-m3TnucA(androidx.ui.graphics.Path, long offset);
}
public final class CollectedSizes {
@@ -173,56 +177,74 @@
}
public final class FindersKt {
- method public static androidx.ui.test.SemanticsNodeInteraction find(androidx.ui.test.SemanticsMatcher selector);
- method public static java.util.List<androidx.ui.test.SemanticsNodeInteraction> findAll(androidx.ui.test.SemanticsMatcher selector);
- method public static java.util.List<androidx.ui.test.SemanticsNodeInteraction> findAllByTag(String testTag);
- method public static java.util.List<androidx.ui.test.SemanticsNodeInteraction> findAllByText(String text, boolean ignoreCase = false);
+ method public static androidx.ui.test.SemanticsNodeInteraction find(androidx.ui.test.SemanticsMatcher matcher);
+ method public static androidx.ui.test.SemanticsNodeInteractionCollection findAll(androidx.ui.test.SemanticsMatcher matcher);
+ method public static androidx.ui.test.SemanticsNodeInteractionCollection findAllByTag(String testTag);
+ method public static androidx.ui.test.SemanticsNodeInteractionCollection findAllByText(String text, boolean ignoreCase = false);
method public static androidx.ui.test.SemanticsNodeInteraction findBySubstring(String text, boolean ignoreCase = false);
method public static androidx.ui.test.SemanticsNodeInteraction findByTag(String testTag);
method public static androidx.ui.test.SemanticsNodeInteraction findByText(String text, boolean ignoreCase = false);
}
- public final class GestureScope {
+ public final class GestureScope extends androidx.ui.test.BaseGestureScope {
}
public final class GestureScopeKt {
- method public static androidx.ui.unit.PxPosition getCenter(androidx.ui.test.GestureScope);
- method public static androidx.ui.unit.PxBounds getGlobalBounds(androidx.ui.test.GestureScope);
- method public static androidx.ui.unit.IntPxSize getSize(androidx.ui.test.GestureScope);
- method public static androidx.ui.unit.PxPosition localToGlobal(androidx.ui.test.GestureScope, androidx.ui.unit.PxPosition position);
+ method public static androidx.ui.unit.PxPosition getCenter(androidx.ui.test.BaseGestureScope);
+ method public static androidx.ui.unit.PxBounds getGlobalBounds(androidx.ui.test.BaseGestureScope);
+ method public static androidx.ui.unit.IntPxSize getSize(androidx.ui.test.BaseGestureScope);
+ method public static androidx.ui.unit.PxPosition localToGlobal(androidx.ui.test.BaseGestureScope, androidx.ui.unit.PxPosition position);
+ method public static void sendCancel(androidx.ui.test.PartialGestureScope, androidx.ui.test.GestureToken token, androidx.ui.unit.PxPosition? position = null);
method public static void sendClick(androidx.ui.test.GestureScope, androidx.ui.unit.PxPosition position);
method public static void sendClick(androidx.ui.test.GestureScope);
method public static void sendDoubleClick(androidx.ui.test.GestureScope, androidx.ui.unit.PxPosition position);
method public static void sendDoubleClick(androidx.ui.test.GestureScope);
+ method public static androidx.ui.test.GestureToken sendDown(androidx.ui.test.PartialGestureScope, androidx.ui.unit.PxPosition position);
method public static void sendLongClick(androidx.ui.test.GestureScope, androidx.ui.unit.PxPosition position);
method public static void sendLongClick(androidx.ui.test.GestureScope);
+ method public static void sendMoveBy(androidx.ui.test.PartialGestureScope, androidx.ui.test.GestureToken token, androidx.ui.unit.PxPosition delta);
+ method public static void sendMoveTo(androidx.ui.test.PartialGestureScope, androidx.ui.test.GestureToken token, androidx.ui.unit.PxPosition position);
method public static void sendSwipe(androidx.ui.test.GestureScope, androidx.ui.unit.PxPosition start, androidx.ui.unit.PxPosition end, androidx.ui.unit.Duration duration = 200.milliseconds);
method public static void sendSwipeDown(androidx.ui.test.GestureScope);
method public static void sendSwipeLeft(androidx.ui.test.GestureScope);
method public static void sendSwipeRight(androidx.ui.test.GestureScope);
method public static void sendSwipeUp(androidx.ui.test.GestureScope);
method public static void sendSwipeWithVelocity(androidx.ui.test.GestureScope, androidx.ui.unit.PxPosition start, androidx.ui.unit.PxPosition end, @FloatRange(from=0.0) float endVelocity, androidx.ui.unit.Duration duration = 200.milliseconds);
+ method public static void sendUp(androidx.ui.test.PartialGestureScope, androidx.ui.test.GestureToken token, androidx.ui.unit.PxPosition? position = null);
+ }
+
+ public final class GestureToken {
}
public final class OutputKt {
method public static String dumpToString(androidx.ui.test.SemanticsNodeInteraction);
- method public static String dumpToString(java.util.Collection<androidx.ui.test.SemanticsNodeInteraction>);
+ method public static String dumpToString(androidx.ui.test.SemanticsNodeInteractionCollection);
+ }
+
+ public final class PartialGestureScope extends androidx.ui.test.BaseGestureScope {
+ }
+
+ public final class SelectionResult {
+ ctor public SelectionResult(java.util.List<androidx.ui.core.semantics.SemanticsNode> selectedNodes, String? customErrorOnNoMatch);
+ method public String? getCustomErrorOnNoMatch();
+ method public java.util.List<androidx.ui.core.semantics.SemanticsNode> getSelectedNodes();
}
public final class SelectorsKt {
- method public static java.util.List<androidx.ui.test.SemanticsNodeInteraction> ancestors(androidx.ui.test.SemanticsNodeInteraction);
+ method public static androidx.ui.test.SemanticsNodeInteractionCollection ancestors(androidx.ui.test.SemanticsNodeInteraction);
method public static androidx.ui.test.SemanticsNodeInteraction child(androidx.ui.test.SemanticsNodeInteraction);
- method public static java.util.List<androidx.ui.test.SemanticsNodeInteraction> children(androidx.ui.test.SemanticsNodeInteraction);
+ method public static androidx.ui.test.SemanticsNodeInteraction childAt(androidx.ui.test.SemanticsNodeInteraction, int index);
+ method public static androidx.ui.test.SemanticsNodeInteractionCollection children(androidx.ui.test.SemanticsNodeInteraction);
+ method public static androidx.ui.test.SemanticsNodeInteraction first(androidx.ui.test.SemanticsNodeInteractionCollection);
method public static androidx.ui.test.SemanticsNodeInteraction parent(androidx.ui.test.SemanticsNodeInteraction);
method public static androidx.ui.test.SemanticsNodeInteraction sibling(androidx.ui.test.SemanticsNodeInteraction);
- method public static java.util.List<androidx.ui.test.SemanticsNodeInteraction> siblings(androidx.ui.test.SemanticsNodeInteraction);
+ method public static androidx.ui.test.SemanticsNodeInteractionCollection siblings(androidx.ui.test.SemanticsNodeInteraction);
}
public final class SemanticsMatcher {
- ctor public SemanticsMatcher(String description, kotlin.jvm.functions.Function1<? super java.lang.Iterable<androidx.ui.core.semantics.SemanticsNode>,? extends java.lang.Iterable<androidx.ui.core.semantics.SemanticsNode>> selector);
+ ctor public SemanticsMatcher(String description, kotlin.jvm.functions.Function1<? super androidx.ui.core.semantics.SemanticsNode,java.lang.Boolean> matcher);
method public infix androidx.ui.test.SemanticsMatcher and(androidx.ui.test.SemanticsMatcher other);
method public String getDescription();
- method public Iterable<androidx.ui.core.semantics.SemanticsNode> match(Iterable<androidx.ui.core.semantics.SemanticsNode> nodes);
method public boolean matches(androidx.ui.core.semantics.SemanticsNode node);
method public boolean matchesAny(Iterable<androidx.ui.core.semantics.SemanticsNode> nodes);
method public operator androidx.ui.test.SemanticsMatcher not();
@@ -232,25 +254,36 @@
public static final class SemanticsMatcher.Companion {
method public <T> androidx.ui.test.SemanticsMatcher expectValue(androidx.ui.semantics.SemanticsPropertyKey<T> key, T? expectedValue);
- method public androidx.ui.test.SemanticsMatcher fromCondition(String description, kotlin.jvm.functions.Function1<? super androidx.ui.core.semantics.SemanticsNode,java.lang.Boolean> selector);
method public androidx.ui.test.SemanticsMatcher getAny();
method public <T> androidx.ui.test.SemanticsMatcher keyIsDefined(androidx.ui.semantics.SemanticsPropertyKey<T> key);
method public <T> androidx.ui.test.SemanticsMatcher keyNotDefined(androidx.ui.semantics.SemanticsPropertyKey<T> key);
property public final androidx.ui.test.SemanticsMatcher any;
}
- public final class SemanticsMatcherKt {
- }
-
public final class SemanticsNodeInteraction {
method public void assertDoesNotExist();
method public androidx.ui.test.SemanticsNodeInteraction assertExists(String? errorMessageOnFail = null);
method public androidx.ui.core.semantics.SemanticsNode fetchSemanticsNode(String? errorMessageOnFail = null);
}
+ public final class SemanticsNodeInteractionCollection {
+ ctor public SemanticsNodeInteractionCollection(internal androidx.ui.test.SemanticsSelector selector);
+ method public java.util.List<androidx.ui.core.semantics.SemanticsNode> fetchSemanticsNodes(String? errorMessageOnFail = null);
+ method public operator androidx.ui.test.SemanticsNodeInteraction get(int index);
+ }
+
public final class SemanticsNodeInteractionKt {
}
+ public final class SemanticsSelector {
+ ctor public SemanticsSelector(String description, boolean requiresExactlyOneNode, androidx.ui.test.SemanticsSelector? chainedInputSelector, kotlin.jvm.functions.Function1<? super java.lang.Iterable<androidx.ui.core.semantics.SemanticsNode>,androidx.ui.test.SelectionResult> selector);
+ method public String getDescription();
+ method public androidx.ui.test.SelectionResult map(Iterable<androidx.ui.core.semantics.SemanticsNode> nodes, String errorOnFail);
+ }
+
+ public final class SemanticsSelectorKt {
+ }
+
public final class SizesTestingKt {
method public static androidx.ui.layout.DpConstraints getBigTestConstraints();
method public static androidx.ui.test.CollectedSizes setContentAndCollectSizes(androidx.ui.test.ComposeTestRule, androidx.ui.layout.DpConstraints parentConstraints = BigTestConstraints, kotlin.jvm.functions.Function0<kotlin.Unit> children);
@@ -315,7 +348,7 @@
}
public final class AndroidComposeTestRuleKt {
- method public static inline <reified T extends androidx.activity.ComponentActivity> androidx.ui.test.android.AndroidComposeTestRule<T> AndroidComposeTestRule(androidx.compose.Recomposer? recomposer = null, boolean disableTransitions = false);
+ method public static inline <reified T> androidx.ui.test.android.AndroidComposeTestRule<T>! AndroidComposeTestRule(androidx.compose.Recomposer? recomposer = null, boolean disableTransitions = false);
}
public final class ComposeIdlingResourceKt {
diff --git a/ui/ui-test/api/api_lint.ignore b/ui/ui-test/api/api_lint.ignore
index 6f90707..f23a46e 100644
--- a/ui/ui-test/api/api_lint.ignore
+++ b/ui/ui-test/api/api_lint.ignore
@@ -5,5 +5,5 @@
Acronyms should not be capitalized in method names: was `assertShape-nbwoFSQ`, should this be `assertShape-nbwoFsq`?
-DocumentExceptions: androidx.ui.test.GoldenSemanticsKt#assertEquals(androidx.ui.core.semantics.SemanticsConfiguration, androidx.ui.core.semantics.SemanticsConfiguration):
- Method GoldenSemanticsKt.assertEquals appears to be throwing java.lang.AssertionError; this should be listed in the documentation; see https://android.github.io/kotlin-guides/interop.html#document-exceptions
+MissingNullability: androidx.ui.test.android.AndroidComposeTestRuleKt#AndroidComposeTestRule(androidx.compose.Recomposer, boolean):
+ Missing nullability on method `AndroidComposeTestRule` return
diff --git a/ui/ui-test/api/current.txt b/ui/ui-test/api/current.txt
index 575bd08..fcc20c2 100644
--- a/ui/ui-test/api/current.txt
+++ b/ui/ui-test/api/current.txt
@@ -6,6 +6,7 @@
method public static void callSemanticsAction(androidx.ui.test.SemanticsNodeInteraction, androidx.ui.semantics.SemanticsPropertyKey<androidx.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function0<kotlin.Unit>>> key);
method public static androidx.ui.test.SemanticsNodeInteraction doClick(androidx.ui.test.SemanticsNodeInteraction);
method public static androidx.ui.test.SemanticsNodeInteraction doGesture(androidx.ui.test.SemanticsNodeInteraction, kotlin.jvm.functions.Function1<? super androidx.ui.test.GestureScope,kotlin.Unit> block);
+ method public static androidx.ui.test.SemanticsNodeInteraction doPartialGesture(androidx.ui.test.SemanticsNodeInteraction, kotlin.jvm.functions.Function1<? super androidx.ui.test.PartialGestureScope,kotlin.Unit> block);
method public static androidx.ui.test.SemanticsNodeInteraction doScrollTo(androidx.ui.test.SemanticsNodeInteraction);
}
@@ -23,7 +24,7 @@
public final class AssertionsKt {
method public static androidx.ui.test.SemanticsNodeInteraction assert(androidx.ui.test.SemanticsNodeInteraction, androidx.ui.test.SemanticsMatcher matcher);
- method public static <T extends java.util.Collection<? extends androidx.ui.test.SemanticsNodeInteraction>> T assertCountEquals(T, int expectedSize);
+ method public static androidx.ui.test.SemanticsNodeInteractionCollection assertCountEquals(androidx.ui.test.SemanticsNodeInteractionCollection, int expectedSize);
method public static androidx.ui.test.SemanticsNodeInteraction assertHasClickAction(androidx.ui.test.SemanticsNodeInteraction);
method public static androidx.ui.test.SemanticsNodeInteraction assertHasNoClickAction(androidx.ui.test.SemanticsNodeInteraction);
method public static androidx.ui.test.SemanticsNodeInteraction assertIsDisplayed(androidx.ui.test.SemanticsNodeInteraction);
@@ -43,13 +44,16 @@
method public static androidx.ui.test.SemanticsNodeInteraction assertValueEquals(androidx.ui.test.SemanticsNodeInteraction, String value);
}
+ public abstract sealed class BaseGestureScope {
+ }
+
public final class BitmapHelpersKt {
- method public static void assertPixelColor-9bBi3KA(android.graphics.Bitmap, long expected, int x, int y, kotlin.jvm.functions.Function1<? super androidx.ui.graphics.Color,java.lang.String> error = { color -> "Pixel(" + x + ", " + y + ") expected to be " + expected + ", but was " + color });
+ method public static void assertPixelColor-9bBi3KA(android.graphics.Bitmap, long expected, int x, int y, kotlin.jvm.functions.Function1<? super androidx.ui.graphics.Color,java.lang.String> error = { color -> return "Pixel(" + x + ", " + y + ") expected to be " + expected + ", but was " + color });
method public static void assertPixels(android.graphics.Bitmap, androidx.ui.unit.IntPxSize? expectedSize = null, kotlin.jvm.functions.Function1<? super androidx.ui.unit.IntPxPosition,androidx.ui.graphics.Color> expectedColorProvider);
- method public static void assertShape-nbwoFSQ(android.graphics.Bitmap, androidx.ui.unit.Density density, androidx.ui.graphics.Shape shape, long shapeColor, long backgroundColor, androidx.ui.graphics.Shape backgroundShape = RectangleShape, float sizeX = width.toFloat().px, float sizeY = height.toFloat().px, float shapeSizeX = sizeX, float shapeSizeY = sizeY, float centerX = width.px / 2.0, float centerY = height.px / 2.0, float shapeOverlapPixelCount = 1.px);
+ method public static void assertShape-nbwoFSQ(android.graphics.Bitmap, androidx.ui.unit.Density density, androidx.ui.graphics.Shape shape, long shapeColor, long backgroundColor, androidx.ui.graphics.Shape backgroundShape = androidx.ui.graphics.RectangleShapeKt.RectangleShape, float sizeX = width.toFloat().px, float sizeY = height.toFloat().px, float shapeSizeX = sizeX, float shapeSizeY = sizeY, float centerX = width.px / 2.0, float centerY = height.px / 2.0, float shapeOverlapPixelCount = 1.px);
method @RequiresApi(android.os.Build.VERSION_CODES.O) public static android.graphics.Bitmap captureToBitmap(androidx.ui.test.SemanticsNodeInteraction);
method @RequiresApi(android.os.Build.VERSION_CODES.O) public static android.graphics.Bitmap captureToBitmap(android.view.View);
- method public static boolean contains(androidx.ui.graphics.Path, androidx.ui.geometry.Offset offset);
+ method public static boolean contains-m3TnucA(androidx.ui.graphics.Path, long offset);
}
public final class CollectedSizes {
@@ -173,56 +177,74 @@
}
public final class FindersKt {
- method public static androidx.ui.test.SemanticsNodeInteraction find(androidx.ui.test.SemanticsMatcher selector);
- method public static java.util.List<androidx.ui.test.SemanticsNodeInteraction> findAll(androidx.ui.test.SemanticsMatcher selector);
- method public static java.util.List<androidx.ui.test.SemanticsNodeInteraction> findAllByTag(String testTag);
- method public static java.util.List<androidx.ui.test.SemanticsNodeInteraction> findAllByText(String text, boolean ignoreCase = false);
+ method public static androidx.ui.test.SemanticsNodeInteraction find(androidx.ui.test.SemanticsMatcher matcher);
+ method public static androidx.ui.test.SemanticsNodeInteractionCollection findAll(androidx.ui.test.SemanticsMatcher matcher);
+ method public static androidx.ui.test.SemanticsNodeInteractionCollection findAllByTag(String testTag);
+ method public static androidx.ui.test.SemanticsNodeInteractionCollection findAllByText(String text, boolean ignoreCase = false);
method public static androidx.ui.test.SemanticsNodeInteraction findBySubstring(String text, boolean ignoreCase = false);
method public static androidx.ui.test.SemanticsNodeInteraction findByTag(String testTag);
method public static androidx.ui.test.SemanticsNodeInteraction findByText(String text, boolean ignoreCase = false);
}
- public final class GestureScope {
+ public final class GestureScope extends androidx.ui.test.BaseGestureScope {
}
public final class GestureScopeKt {
- method public static androidx.ui.unit.PxPosition getCenter(androidx.ui.test.GestureScope);
- method public static androidx.ui.unit.PxBounds getGlobalBounds(androidx.ui.test.GestureScope);
- method public static androidx.ui.unit.IntPxSize getSize(androidx.ui.test.GestureScope);
- method public static androidx.ui.unit.PxPosition localToGlobal(androidx.ui.test.GestureScope, androidx.ui.unit.PxPosition position);
+ method public static androidx.ui.unit.PxPosition getCenter(androidx.ui.test.BaseGestureScope);
+ method public static androidx.ui.unit.PxBounds getGlobalBounds(androidx.ui.test.BaseGestureScope);
+ method public static androidx.ui.unit.IntPxSize getSize(androidx.ui.test.BaseGestureScope);
+ method public static androidx.ui.unit.PxPosition localToGlobal(androidx.ui.test.BaseGestureScope, androidx.ui.unit.PxPosition position);
+ method public static void sendCancel(androidx.ui.test.PartialGestureScope, androidx.ui.test.GestureToken token, androidx.ui.unit.PxPosition? position = null);
method public static void sendClick(androidx.ui.test.GestureScope, androidx.ui.unit.PxPosition position);
method public static void sendClick(androidx.ui.test.GestureScope);
method public static void sendDoubleClick(androidx.ui.test.GestureScope, androidx.ui.unit.PxPosition position);
method public static void sendDoubleClick(androidx.ui.test.GestureScope);
+ method public static androidx.ui.test.GestureToken sendDown(androidx.ui.test.PartialGestureScope, androidx.ui.unit.PxPosition position);
method public static void sendLongClick(androidx.ui.test.GestureScope, androidx.ui.unit.PxPosition position);
method public static void sendLongClick(androidx.ui.test.GestureScope);
+ method public static void sendMoveBy(androidx.ui.test.PartialGestureScope, androidx.ui.test.GestureToken token, androidx.ui.unit.PxPosition delta);
+ method public static void sendMoveTo(androidx.ui.test.PartialGestureScope, androidx.ui.test.GestureToken token, androidx.ui.unit.PxPosition position);
method public static void sendSwipe(androidx.ui.test.GestureScope, androidx.ui.unit.PxPosition start, androidx.ui.unit.PxPosition end, androidx.ui.unit.Duration duration = 200.milliseconds);
method public static void sendSwipeDown(androidx.ui.test.GestureScope);
method public static void sendSwipeLeft(androidx.ui.test.GestureScope);
method public static void sendSwipeRight(androidx.ui.test.GestureScope);
method public static void sendSwipeUp(androidx.ui.test.GestureScope);
method public static void sendSwipeWithVelocity(androidx.ui.test.GestureScope, androidx.ui.unit.PxPosition start, androidx.ui.unit.PxPosition end, @FloatRange(from=0.0) float endVelocity, androidx.ui.unit.Duration duration = 200.milliseconds);
+ method public static void sendUp(androidx.ui.test.PartialGestureScope, androidx.ui.test.GestureToken token, androidx.ui.unit.PxPosition? position = null);
+ }
+
+ public final class GestureToken {
}
public final class OutputKt {
method public static String dumpToString(androidx.ui.test.SemanticsNodeInteraction);
- method public static String dumpToString(java.util.Collection<androidx.ui.test.SemanticsNodeInteraction>);
+ method public static String dumpToString(androidx.ui.test.SemanticsNodeInteractionCollection);
+ }
+
+ public final class PartialGestureScope extends androidx.ui.test.BaseGestureScope {
+ }
+
+ public final class SelectionResult {
+ ctor public SelectionResult(java.util.List<androidx.ui.core.semantics.SemanticsNode> selectedNodes, String? customErrorOnNoMatch);
+ method public String? getCustomErrorOnNoMatch();
+ method public java.util.List<androidx.ui.core.semantics.SemanticsNode> getSelectedNodes();
}
public final class SelectorsKt {
- method public static java.util.List<androidx.ui.test.SemanticsNodeInteraction> ancestors(androidx.ui.test.SemanticsNodeInteraction);
+ method public static androidx.ui.test.SemanticsNodeInteractionCollection ancestors(androidx.ui.test.SemanticsNodeInteraction);
method public static androidx.ui.test.SemanticsNodeInteraction child(androidx.ui.test.SemanticsNodeInteraction);
- method public static java.util.List<androidx.ui.test.SemanticsNodeInteraction> children(androidx.ui.test.SemanticsNodeInteraction);
+ method public static androidx.ui.test.SemanticsNodeInteraction childAt(androidx.ui.test.SemanticsNodeInteraction, int index);
+ method public static androidx.ui.test.SemanticsNodeInteractionCollection children(androidx.ui.test.SemanticsNodeInteraction);
+ method public static androidx.ui.test.SemanticsNodeInteraction first(androidx.ui.test.SemanticsNodeInteractionCollection);
method public static androidx.ui.test.SemanticsNodeInteraction parent(androidx.ui.test.SemanticsNodeInteraction);
method public static androidx.ui.test.SemanticsNodeInteraction sibling(androidx.ui.test.SemanticsNodeInteraction);
- method public static java.util.List<androidx.ui.test.SemanticsNodeInteraction> siblings(androidx.ui.test.SemanticsNodeInteraction);
+ method public static androidx.ui.test.SemanticsNodeInteractionCollection siblings(androidx.ui.test.SemanticsNodeInteraction);
}
public final class SemanticsMatcher {
- ctor public SemanticsMatcher(String description, kotlin.jvm.functions.Function1<? super java.lang.Iterable<androidx.ui.core.semantics.SemanticsNode>,? extends java.lang.Iterable<androidx.ui.core.semantics.SemanticsNode>> selector);
+ ctor public SemanticsMatcher(String description, kotlin.jvm.functions.Function1<? super androidx.ui.core.semantics.SemanticsNode,java.lang.Boolean> matcher);
method public infix androidx.ui.test.SemanticsMatcher and(androidx.ui.test.SemanticsMatcher other);
method public String getDescription();
- method public Iterable<androidx.ui.core.semantics.SemanticsNode> match(Iterable<androidx.ui.core.semantics.SemanticsNode> nodes);
method public boolean matches(androidx.ui.core.semantics.SemanticsNode node);
method public boolean matchesAny(Iterable<androidx.ui.core.semantics.SemanticsNode> nodes);
method public operator androidx.ui.test.SemanticsMatcher not();
@@ -232,25 +254,36 @@
public static final class SemanticsMatcher.Companion {
method public <T> androidx.ui.test.SemanticsMatcher expectValue(androidx.ui.semantics.SemanticsPropertyKey<T> key, T? expectedValue);
- method public androidx.ui.test.SemanticsMatcher fromCondition(String description, kotlin.jvm.functions.Function1<? super androidx.ui.core.semantics.SemanticsNode,java.lang.Boolean> selector);
method public androidx.ui.test.SemanticsMatcher getAny();
method public <T> androidx.ui.test.SemanticsMatcher keyIsDefined(androidx.ui.semantics.SemanticsPropertyKey<T> key);
method public <T> androidx.ui.test.SemanticsMatcher keyNotDefined(androidx.ui.semantics.SemanticsPropertyKey<T> key);
property public final androidx.ui.test.SemanticsMatcher any;
}
- public final class SemanticsMatcherKt {
- }
-
public final class SemanticsNodeInteraction {
method public void assertDoesNotExist();
method public androidx.ui.test.SemanticsNodeInteraction assertExists(String? errorMessageOnFail = null);
method public androidx.ui.core.semantics.SemanticsNode fetchSemanticsNode(String? errorMessageOnFail = null);
}
+ public final class SemanticsNodeInteractionCollection {
+ ctor public SemanticsNodeInteractionCollection(internal androidx.ui.test.SemanticsSelector selector);
+ method public java.util.List<androidx.ui.core.semantics.SemanticsNode> fetchSemanticsNodes(String? errorMessageOnFail = null);
+ method public operator androidx.ui.test.SemanticsNodeInteraction get(int index);
+ }
+
public final class SemanticsNodeInteractionKt {
}
+ public final class SemanticsSelector {
+ ctor public SemanticsSelector(String description, boolean requiresExactlyOneNode, androidx.ui.test.SemanticsSelector? chainedInputSelector, kotlin.jvm.functions.Function1<? super java.lang.Iterable<androidx.ui.core.semantics.SemanticsNode>,androidx.ui.test.SelectionResult> selector);
+ method public String getDescription();
+ method public androidx.ui.test.SelectionResult map(Iterable<androidx.ui.core.semantics.SemanticsNode> nodes, String errorOnFail);
+ }
+
+ public final class SemanticsSelectorKt {
+ }
+
public final class SizesTestingKt {
method public static androidx.ui.layout.DpConstraints getBigTestConstraints();
method public static androidx.ui.test.CollectedSizes setContentAndCollectSizes(androidx.ui.test.ComposeTestRule, androidx.ui.layout.DpConstraints parentConstraints = BigTestConstraints, kotlin.jvm.functions.Function0<kotlin.Unit> children);
@@ -315,7 +348,7 @@
}
public final class AndroidComposeTestRuleKt {
- method public static inline <reified T extends androidx.activity.ComponentActivity> androidx.ui.test.android.AndroidComposeTestRule<T> AndroidComposeTestRule(androidx.compose.Recomposer? recomposer = null, boolean disableTransitions = false);
+ method public static inline <reified T> androidx.ui.test.android.AndroidComposeTestRule<T>! AndroidComposeTestRule(androidx.compose.Recomposer? recomposer = null, boolean disableTransitions = false);
}
public final class ComposeIdlingResourceKt {
diff --git a/ui/ui-test/api/public_plus_experimental_0.1.0-dev11.txt b/ui/ui-test/api/public_plus_experimental_0.1.0-dev11.txt
index 575bd08..fcc20c2 100644
--- a/ui/ui-test/api/public_plus_experimental_0.1.0-dev11.txt
+++ b/ui/ui-test/api/public_plus_experimental_0.1.0-dev11.txt
@@ -6,6 +6,7 @@
method public static void callSemanticsAction(androidx.ui.test.SemanticsNodeInteraction, androidx.ui.semantics.SemanticsPropertyKey<androidx.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function0<kotlin.Unit>>> key);
method public static androidx.ui.test.SemanticsNodeInteraction doClick(androidx.ui.test.SemanticsNodeInteraction);
method public static androidx.ui.test.SemanticsNodeInteraction doGesture(androidx.ui.test.SemanticsNodeInteraction, kotlin.jvm.functions.Function1<? super androidx.ui.test.GestureScope,kotlin.Unit> block);
+ method public static androidx.ui.test.SemanticsNodeInteraction doPartialGesture(androidx.ui.test.SemanticsNodeInteraction, kotlin.jvm.functions.Function1<? super androidx.ui.test.PartialGestureScope,kotlin.Unit> block);
method public static androidx.ui.test.SemanticsNodeInteraction doScrollTo(androidx.ui.test.SemanticsNodeInteraction);
}
@@ -23,7 +24,7 @@
public final class AssertionsKt {
method public static androidx.ui.test.SemanticsNodeInteraction assert(androidx.ui.test.SemanticsNodeInteraction, androidx.ui.test.SemanticsMatcher matcher);
- method public static <T extends java.util.Collection<? extends androidx.ui.test.SemanticsNodeInteraction>> T assertCountEquals(T, int expectedSize);
+ method public static androidx.ui.test.SemanticsNodeInteractionCollection assertCountEquals(androidx.ui.test.SemanticsNodeInteractionCollection, int expectedSize);
method public static androidx.ui.test.SemanticsNodeInteraction assertHasClickAction(androidx.ui.test.SemanticsNodeInteraction);
method public static androidx.ui.test.SemanticsNodeInteraction assertHasNoClickAction(androidx.ui.test.SemanticsNodeInteraction);
method public static androidx.ui.test.SemanticsNodeInteraction assertIsDisplayed(androidx.ui.test.SemanticsNodeInteraction);
@@ -43,13 +44,16 @@
method public static androidx.ui.test.SemanticsNodeInteraction assertValueEquals(androidx.ui.test.SemanticsNodeInteraction, String value);
}
+ public abstract sealed class BaseGestureScope {
+ }
+
public final class BitmapHelpersKt {
- method public static void assertPixelColor-9bBi3KA(android.graphics.Bitmap, long expected, int x, int y, kotlin.jvm.functions.Function1<? super androidx.ui.graphics.Color,java.lang.String> error = { color -> "Pixel(" + x + ", " + y + ") expected to be " + expected + ", but was " + color });
+ method public static void assertPixelColor-9bBi3KA(android.graphics.Bitmap, long expected, int x, int y, kotlin.jvm.functions.Function1<? super androidx.ui.graphics.Color,java.lang.String> error = { color -> return "Pixel(" + x + ", " + y + ") expected to be " + expected + ", but was " + color });
method public static void assertPixels(android.graphics.Bitmap, androidx.ui.unit.IntPxSize? expectedSize = null, kotlin.jvm.functions.Function1<? super androidx.ui.unit.IntPxPosition,androidx.ui.graphics.Color> expectedColorProvider);
- method public static void assertShape-nbwoFSQ(android.graphics.Bitmap, androidx.ui.unit.Density density, androidx.ui.graphics.Shape shape, long shapeColor, long backgroundColor, androidx.ui.graphics.Shape backgroundShape = RectangleShape, float sizeX = width.toFloat().px, float sizeY = height.toFloat().px, float shapeSizeX = sizeX, float shapeSizeY = sizeY, float centerX = width.px / 2.0, float centerY = height.px / 2.0, float shapeOverlapPixelCount = 1.px);
+ method public static void assertShape-nbwoFSQ(android.graphics.Bitmap, androidx.ui.unit.Density density, androidx.ui.graphics.Shape shape, long shapeColor, long backgroundColor, androidx.ui.graphics.Shape backgroundShape = androidx.ui.graphics.RectangleShapeKt.RectangleShape, float sizeX = width.toFloat().px, float sizeY = height.toFloat().px, float shapeSizeX = sizeX, float shapeSizeY = sizeY, float centerX = width.px / 2.0, float centerY = height.px / 2.0, float shapeOverlapPixelCount = 1.px);
method @RequiresApi(android.os.Build.VERSION_CODES.O) public static android.graphics.Bitmap captureToBitmap(androidx.ui.test.SemanticsNodeInteraction);
method @RequiresApi(android.os.Build.VERSION_CODES.O) public static android.graphics.Bitmap captureToBitmap(android.view.View);
- method public static boolean contains(androidx.ui.graphics.Path, androidx.ui.geometry.Offset offset);
+ method public static boolean contains-m3TnucA(androidx.ui.graphics.Path, long offset);
}
public final class CollectedSizes {
@@ -173,56 +177,74 @@
}
public final class FindersKt {
- method public static androidx.ui.test.SemanticsNodeInteraction find(androidx.ui.test.SemanticsMatcher selector);
- method public static java.util.List<androidx.ui.test.SemanticsNodeInteraction> findAll(androidx.ui.test.SemanticsMatcher selector);
- method public static java.util.List<androidx.ui.test.SemanticsNodeInteraction> findAllByTag(String testTag);
- method public static java.util.List<androidx.ui.test.SemanticsNodeInteraction> findAllByText(String text, boolean ignoreCase = false);
+ method public static androidx.ui.test.SemanticsNodeInteraction find(androidx.ui.test.SemanticsMatcher matcher);
+ method public static androidx.ui.test.SemanticsNodeInteractionCollection findAll(androidx.ui.test.SemanticsMatcher matcher);
+ method public static androidx.ui.test.SemanticsNodeInteractionCollection findAllByTag(String testTag);
+ method public static androidx.ui.test.SemanticsNodeInteractionCollection findAllByText(String text, boolean ignoreCase = false);
method public static androidx.ui.test.SemanticsNodeInteraction findBySubstring(String text, boolean ignoreCase = false);
method public static androidx.ui.test.SemanticsNodeInteraction findByTag(String testTag);
method public static androidx.ui.test.SemanticsNodeInteraction findByText(String text, boolean ignoreCase = false);
}
- public final class GestureScope {
+ public final class GestureScope extends androidx.ui.test.BaseGestureScope {
}
public final class GestureScopeKt {
- method public static androidx.ui.unit.PxPosition getCenter(androidx.ui.test.GestureScope);
- method public static androidx.ui.unit.PxBounds getGlobalBounds(androidx.ui.test.GestureScope);
- method public static androidx.ui.unit.IntPxSize getSize(androidx.ui.test.GestureScope);
- method public static androidx.ui.unit.PxPosition localToGlobal(androidx.ui.test.GestureScope, androidx.ui.unit.PxPosition position);
+ method public static androidx.ui.unit.PxPosition getCenter(androidx.ui.test.BaseGestureScope);
+ method public static androidx.ui.unit.PxBounds getGlobalBounds(androidx.ui.test.BaseGestureScope);
+ method public static androidx.ui.unit.IntPxSize getSize(androidx.ui.test.BaseGestureScope);
+ method public static androidx.ui.unit.PxPosition localToGlobal(androidx.ui.test.BaseGestureScope, androidx.ui.unit.PxPosition position);
+ method public static void sendCancel(androidx.ui.test.PartialGestureScope, androidx.ui.test.GestureToken token, androidx.ui.unit.PxPosition? position = null);
method public static void sendClick(androidx.ui.test.GestureScope, androidx.ui.unit.PxPosition position);
method public static void sendClick(androidx.ui.test.GestureScope);
method public static void sendDoubleClick(androidx.ui.test.GestureScope, androidx.ui.unit.PxPosition position);
method public static void sendDoubleClick(androidx.ui.test.GestureScope);
+ method public static androidx.ui.test.GestureToken sendDown(androidx.ui.test.PartialGestureScope, androidx.ui.unit.PxPosition position);
method public static void sendLongClick(androidx.ui.test.GestureScope, androidx.ui.unit.PxPosition position);
method public static void sendLongClick(androidx.ui.test.GestureScope);
+ method public static void sendMoveBy(androidx.ui.test.PartialGestureScope, androidx.ui.test.GestureToken token, androidx.ui.unit.PxPosition delta);
+ method public static void sendMoveTo(androidx.ui.test.PartialGestureScope, androidx.ui.test.GestureToken token, androidx.ui.unit.PxPosition position);
method public static void sendSwipe(androidx.ui.test.GestureScope, androidx.ui.unit.PxPosition start, androidx.ui.unit.PxPosition end, androidx.ui.unit.Duration duration = 200.milliseconds);
method public static void sendSwipeDown(androidx.ui.test.GestureScope);
method public static void sendSwipeLeft(androidx.ui.test.GestureScope);
method public static void sendSwipeRight(androidx.ui.test.GestureScope);
method public static void sendSwipeUp(androidx.ui.test.GestureScope);
method public static void sendSwipeWithVelocity(androidx.ui.test.GestureScope, androidx.ui.unit.PxPosition start, androidx.ui.unit.PxPosition end, @FloatRange(from=0.0) float endVelocity, androidx.ui.unit.Duration duration = 200.milliseconds);
+ method public static void sendUp(androidx.ui.test.PartialGestureScope, androidx.ui.test.GestureToken token, androidx.ui.unit.PxPosition? position = null);
+ }
+
+ public final class GestureToken {
}
public final class OutputKt {
method public static String dumpToString(androidx.ui.test.SemanticsNodeInteraction);
- method public static String dumpToString(java.util.Collection<androidx.ui.test.SemanticsNodeInteraction>);
+ method public static String dumpToString(androidx.ui.test.SemanticsNodeInteractionCollection);
+ }
+
+ public final class PartialGestureScope extends androidx.ui.test.BaseGestureScope {
+ }
+
+ public final class SelectionResult {
+ ctor public SelectionResult(java.util.List<androidx.ui.core.semantics.SemanticsNode> selectedNodes, String? customErrorOnNoMatch);
+ method public String? getCustomErrorOnNoMatch();
+ method public java.util.List<androidx.ui.core.semantics.SemanticsNode> getSelectedNodes();
}
public final class SelectorsKt {
- method public static java.util.List<androidx.ui.test.SemanticsNodeInteraction> ancestors(androidx.ui.test.SemanticsNodeInteraction);
+ method public static androidx.ui.test.SemanticsNodeInteractionCollection ancestors(androidx.ui.test.SemanticsNodeInteraction);
method public static androidx.ui.test.SemanticsNodeInteraction child(androidx.ui.test.SemanticsNodeInteraction);
- method public static java.util.List<androidx.ui.test.SemanticsNodeInteraction> children(androidx.ui.test.SemanticsNodeInteraction);
+ method public static androidx.ui.test.SemanticsNodeInteraction childAt(androidx.ui.test.SemanticsNodeInteraction, int index);
+ method public static androidx.ui.test.SemanticsNodeInteractionCollection children(androidx.ui.test.SemanticsNodeInteraction);
+ method public static androidx.ui.test.SemanticsNodeInteraction first(androidx.ui.test.SemanticsNodeInteractionCollection);
method public static androidx.ui.test.SemanticsNodeInteraction parent(androidx.ui.test.SemanticsNodeInteraction);
method public static androidx.ui.test.SemanticsNodeInteraction sibling(androidx.ui.test.SemanticsNodeInteraction);
- method public static java.util.List<androidx.ui.test.SemanticsNodeInteraction> siblings(androidx.ui.test.SemanticsNodeInteraction);
+ method public static androidx.ui.test.SemanticsNodeInteractionCollection siblings(androidx.ui.test.SemanticsNodeInteraction);
}
public final class SemanticsMatcher {
- ctor public SemanticsMatcher(String description, kotlin.jvm.functions.Function1<? super java.lang.Iterable<androidx.ui.core.semantics.SemanticsNode>,? extends java.lang.Iterable<androidx.ui.core.semantics.SemanticsNode>> selector);
+ ctor public SemanticsMatcher(String description, kotlin.jvm.functions.Function1<? super androidx.ui.core.semantics.SemanticsNode,java.lang.Boolean> matcher);
method public infix androidx.ui.test.SemanticsMatcher and(androidx.ui.test.SemanticsMatcher other);
method public String getDescription();
- method public Iterable<androidx.ui.core.semantics.SemanticsNode> match(Iterable<androidx.ui.core.semantics.SemanticsNode> nodes);
method public boolean matches(androidx.ui.core.semantics.SemanticsNode node);
method public boolean matchesAny(Iterable<androidx.ui.core.semantics.SemanticsNode> nodes);
method public operator androidx.ui.test.SemanticsMatcher not();
@@ -232,25 +254,36 @@
public static final class SemanticsMatcher.Companion {
method public <T> androidx.ui.test.SemanticsMatcher expectValue(androidx.ui.semantics.SemanticsPropertyKey<T> key, T? expectedValue);
- method public androidx.ui.test.SemanticsMatcher fromCondition(String description, kotlin.jvm.functions.Function1<? super androidx.ui.core.semantics.SemanticsNode,java.lang.Boolean> selector);
method public androidx.ui.test.SemanticsMatcher getAny();
method public <T> androidx.ui.test.SemanticsMatcher keyIsDefined(androidx.ui.semantics.SemanticsPropertyKey<T> key);
method public <T> androidx.ui.test.SemanticsMatcher keyNotDefined(androidx.ui.semantics.SemanticsPropertyKey<T> key);
property public final androidx.ui.test.SemanticsMatcher any;
}
- public final class SemanticsMatcherKt {
- }
-
public final class SemanticsNodeInteraction {
method public void assertDoesNotExist();
method public androidx.ui.test.SemanticsNodeInteraction assertExists(String? errorMessageOnFail = null);
method public androidx.ui.core.semantics.SemanticsNode fetchSemanticsNode(String? errorMessageOnFail = null);
}
+ public final class SemanticsNodeInteractionCollection {
+ ctor public SemanticsNodeInteractionCollection(internal androidx.ui.test.SemanticsSelector selector);
+ method public java.util.List<androidx.ui.core.semantics.SemanticsNode> fetchSemanticsNodes(String? errorMessageOnFail = null);
+ method public operator androidx.ui.test.SemanticsNodeInteraction get(int index);
+ }
+
public final class SemanticsNodeInteractionKt {
}
+ public final class SemanticsSelector {
+ ctor public SemanticsSelector(String description, boolean requiresExactlyOneNode, androidx.ui.test.SemanticsSelector? chainedInputSelector, kotlin.jvm.functions.Function1<? super java.lang.Iterable<androidx.ui.core.semantics.SemanticsNode>,androidx.ui.test.SelectionResult> selector);
+ method public String getDescription();
+ method public androidx.ui.test.SelectionResult map(Iterable<androidx.ui.core.semantics.SemanticsNode> nodes, String errorOnFail);
+ }
+
+ public final class SemanticsSelectorKt {
+ }
+
public final class SizesTestingKt {
method public static androidx.ui.layout.DpConstraints getBigTestConstraints();
method public static androidx.ui.test.CollectedSizes setContentAndCollectSizes(androidx.ui.test.ComposeTestRule, androidx.ui.layout.DpConstraints parentConstraints = BigTestConstraints, kotlin.jvm.functions.Function0<kotlin.Unit> children);
@@ -315,7 +348,7 @@
}
public final class AndroidComposeTestRuleKt {
- method public static inline <reified T extends androidx.activity.ComponentActivity> androidx.ui.test.android.AndroidComposeTestRule<T> AndroidComposeTestRule(androidx.compose.Recomposer? recomposer = null, boolean disableTransitions = false);
+ method public static inline <reified T> androidx.ui.test.android.AndroidComposeTestRule<T>! AndroidComposeTestRule(androidx.compose.Recomposer? recomposer = null, boolean disableTransitions = false);
}
public final class ComposeIdlingResourceKt {
diff --git a/ui/ui-test/api/public_plus_experimental_current.txt b/ui/ui-test/api/public_plus_experimental_current.txt
index 575bd08..fcc20c2 100644
--- a/ui/ui-test/api/public_plus_experimental_current.txt
+++ b/ui/ui-test/api/public_plus_experimental_current.txt
@@ -6,6 +6,7 @@
method public static void callSemanticsAction(androidx.ui.test.SemanticsNodeInteraction, androidx.ui.semantics.SemanticsPropertyKey<androidx.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function0<kotlin.Unit>>> key);
method public static androidx.ui.test.SemanticsNodeInteraction doClick(androidx.ui.test.SemanticsNodeInteraction);
method public static androidx.ui.test.SemanticsNodeInteraction doGesture(androidx.ui.test.SemanticsNodeInteraction, kotlin.jvm.functions.Function1<? super androidx.ui.test.GestureScope,kotlin.Unit> block);
+ method public static androidx.ui.test.SemanticsNodeInteraction doPartialGesture(androidx.ui.test.SemanticsNodeInteraction, kotlin.jvm.functions.Function1<? super androidx.ui.test.PartialGestureScope,kotlin.Unit> block);
method public static androidx.ui.test.SemanticsNodeInteraction doScrollTo(androidx.ui.test.SemanticsNodeInteraction);
}
@@ -23,7 +24,7 @@
public final class AssertionsKt {
method public static androidx.ui.test.SemanticsNodeInteraction assert(androidx.ui.test.SemanticsNodeInteraction, androidx.ui.test.SemanticsMatcher matcher);
- method public static <T extends java.util.Collection<? extends androidx.ui.test.SemanticsNodeInteraction>> T assertCountEquals(T, int expectedSize);
+ method public static androidx.ui.test.SemanticsNodeInteractionCollection assertCountEquals(androidx.ui.test.SemanticsNodeInteractionCollection, int expectedSize);
method public static androidx.ui.test.SemanticsNodeInteraction assertHasClickAction(androidx.ui.test.SemanticsNodeInteraction);
method public static androidx.ui.test.SemanticsNodeInteraction assertHasNoClickAction(androidx.ui.test.SemanticsNodeInteraction);
method public static androidx.ui.test.SemanticsNodeInteraction assertIsDisplayed(androidx.ui.test.SemanticsNodeInteraction);
@@ -43,13 +44,16 @@
method public static androidx.ui.test.SemanticsNodeInteraction assertValueEquals(androidx.ui.test.SemanticsNodeInteraction, String value);
}
+ public abstract sealed class BaseGestureScope {
+ }
+
public final class BitmapHelpersKt {
- method public static void assertPixelColor-9bBi3KA(android.graphics.Bitmap, long expected, int x, int y, kotlin.jvm.functions.Function1<? super androidx.ui.graphics.Color,java.lang.String> error = { color -> "Pixel(" + x + ", " + y + ") expected to be " + expected + ", but was " + color });
+ method public static void assertPixelColor-9bBi3KA(android.graphics.Bitmap, long expected, int x, int y, kotlin.jvm.functions.Function1<? super androidx.ui.graphics.Color,java.lang.String> error = { color -> return "Pixel(" + x + ", " + y + ") expected to be " + expected + ", but was " + color });
method public static void assertPixels(android.graphics.Bitmap, androidx.ui.unit.IntPxSize? expectedSize = null, kotlin.jvm.functions.Function1<? super androidx.ui.unit.IntPxPosition,androidx.ui.graphics.Color> expectedColorProvider);
- method public static void assertShape-nbwoFSQ(android.graphics.Bitmap, androidx.ui.unit.Density density, androidx.ui.graphics.Shape shape, long shapeColor, long backgroundColor, androidx.ui.graphics.Shape backgroundShape = RectangleShape, float sizeX = width.toFloat().px, float sizeY = height.toFloat().px, float shapeSizeX = sizeX, float shapeSizeY = sizeY, float centerX = width.px / 2.0, float centerY = height.px / 2.0, float shapeOverlapPixelCount = 1.px);
+ method public static void assertShape-nbwoFSQ(android.graphics.Bitmap, androidx.ui.unit.Density density, androidx.ui.graphics.Shape shape, long shapeColor, long backgroundColor, androidx.ui.graphics.Shape backgroundShape = androidx.ui.graphics.RectangleShapeKt.RectangleShape, float sizeX = width.toFloat().px, float sizeY = height.toFloat().px, float shapeSizeX = sizeX, float shapeSizeY = sizeY, float centerX = width.px / 2.0, float centerY = height.px / 2.0, float shapeOverlapPixelCount = 1.px);
method @RequiresApi(android.os.Build.VERSION_CODES.O) public static android.graphics.Bitmap captureToBitmap(androidx.ui.test.SemanticsNodeInteraction);
method @RequiresApi(android.os.Build.VERSION_CODES.O) public static android.graphics.Bitmap captureToBitmap(android.view.View);
- method public static boolean contains(androidx.ui.graphics.Path, androidx.ui.geometry.Offset offset);
+ method public static boolean contains-m3TnucA(androidx.ui.graphics.Path, long offset);
}
public final class CollectedSizes {
@@ -173,56 +177,74 @@
}
public final class FindersKt {
- method public static androidx.ui.test.SemanticsNodeInteraction find(androidx.ui.test.SemanticsMatcher selector);
- method public static java.util.List<androidx.ui.test.SemanticsNodeInteraction> findAll(androidx.ui.test.SemanticsMatcher selector);
- method public static java.util.List<androidx.ui.test.SemanticsNodeInteraction> findAllByTag(String testTag);
- method public static java.util.List<androidx.ui.test.SemanticsNodeInteraction> findAllByText(String text, boolean ignoreCase = false);
+ method public static androidx.ui.test.SemanticsNodeInteraction find(androidx.ui.test.SemanticsMatcher matcher);
+ method public static androidx.ui.test.SemanticsNodeInteractionCollection findAll(androidx.ui.test.SemanticsMatcher matcher);
+ method public static androidx.ui.test.SemanticsNodeInteractionCollection findAllByTag(String testTag);
+ method public static androidx.ui.test.SemanticsNodeInteractionCollection findAllByText(String text, boolean ignoreCase = false);
method public static androidx.ui.test.SemanticsNodeInteraction findBySubstring(String text, boolean ignoreCase = false);
method public static androidx.ui.test.SemanticsNodeInteraction findByTag(String testTag);
method public static androidx.ui.test.SemanticsNodeInteraction findByText(String text, boolean ignoreCase = false);
}
- public final class GestureScope {
+ public final class GestureScope extends androidx.ui.test.BaseGestureScope {
}
public final class GestureScopeKt {
- method public static androidx.ui.unit.PxPosition getCenter(androidx.ui.test.GestureScope);
- method public static androidx.ui.unit.PxBounds getGlobalBounds(androidx.ui.test.GestureScope);
- method public static androidx.ui.unit.IntPxSize getSize(androidx.ui.test.GestureScope);
- method public static androidx.ui.unit.PxPosition localToGlobal(androidx.ui.test.GestureScope, androidx.ui.unit.PxPosition position);
+ method public static androidx.ui.unit.PxPosition getCenter(androidx.ui.test.BaseGestureScope);
+ method public static androidx.ui.unit.PxBounds getGlobalBounds(androidx.ui.test.BaseGestureScope);
+ method public static androidx.ui.unit.IntPxSize getSize(androidx.ui.test.BaseGestureScope);
+ method public static androidx.ui.unit.PxPosition localToGlobal(androidx.ui.test.BaseGestureScope, androidx.ui.unit.PxPosition position);
+ method public static void sendCancel(androidx.ui.test.PartialGestureScope, androidx.ui.test.GestureToken token, androidx.ui.unit.PxPosition? position = null);
method public static void sendClick(androidx.ui.test.GestureScope, androidx.ui.unit.PxPosition position);
method public static void sendClick(androidx.ui.test.GestureScope);
method public static void sendDoubleClick(androidx.ui.test.GestureScope, androidx.ui.unit.PxPosition position);
method public static void sendDoubleClick(androidx.ui.test.GestureScope);
+ method public static androidx.ui.test.GestureToken sendDown(androidx.ui.test.PartialGestureScope, androidx.ui.unit.PxPosition position);
method public static void sendLongClick(androidx.ui.test.GestureScope, androidx.ui.unit.PxPosition position);
method public static void sendLongClick(androidx.ui.test.GestureScope);
+ method public static void sendMoveBy(androidx.ui.test.PartialGestureScope, androidx.ui.test.GestureToken token, androidx.ui.unit.PxPosition delta);
+ method public static void sendMoveTo(androidx.ui.test.PartialGestureScope, androidx.ui.test.GestureToken token, androidx.ui.unit.PxPosition position);
method public static void sendSwipe(androidx.ui.test.GestureScope, androidx.ui.unit.PxPosition start, androidx.ui.unit.PxPosition end, androidx.ui.unit.Duration duration = 200.milliseconds);
method public static void sendSwipeDown(androidx.ui.test.GestureScope);
method public static void sendSwipeLeft(androidx.ui.test.GestureScope);
method public static void sendSwipeRight(androidx.ui.test.GestureScope);
method public static void sendSwipeUp(androidx.ui.test.GestureScope);
method public static void sendSwipeWithVelocity(androidx.ui.test.GestureScope, androidx.ui.unit.PxPosition start, androidx.ui.unit.PxPosition end, @FloatRange(from=0.0) float endVelocity, androidx.ui.unit.Duration duration = 200.milliseconds);
+ method public static void sendUp(androidx.ui.test.PartialGestureScope, androidx.ui.test.GestureToken token, androidx.ui.unit.PxPosition? position = null);
+ }
+
+ public final class GestureToken {
}
public final class OutputKt {
method public static String dumpToString(androidx.ui.test.SemanticsNodeInteraction);
- method public static String dumpToString(java.util.Collection<androidx.ui.test.SemanticsNodeInteraction>);
+ method public static String dumpToString(androidx.ui.test.SemanticsNodeInteractionCollection);
+ }
+
+ public final class PartialGestureScope extends androidx.ui.test.BaseGestureScope {
+ }
+
+ public final class SelectionResult {
+ ctor public SelectionResult(java.util.List<androidx.ui.core.semantics.SemanticsNode> selectedNodes, String? customErrorOnNoMatch);
+ method public String? getCustomErrorOnNoMatch();
+ method public java.util.List<androidx.ui.core.semantics.SemanticsNode> getSelectedNodes();
}
public final class SelectorsKt {
- method public static java.util.List<androidx.ui.test.SemanticsNodeInteraction> ancestors(androidx.ui.test.SemanticsNodeInteraction);
+ method public static androidx.ui.test.SemanticsNodeInteractionCollection ancestors(androidx.ui.test.SemanticsNodeInteraction);
method public static androidx.ui.test.SemanticsNodeInteraction child(androidx.ui.test.SemanticsNodeInteraction);
- method public static java.util.List<androidx.ui.test.SemanticsNodeInteraction> children(androidx.ui.test.SemanticsNodeInteraction);
+ method public static androidx.ui.test.SemanticsNodeInteraction childAt(androidx.ui.test.SemanticsNodeInteraction, int index);
+ method public static androidx.ui.test.SemanticsNodeInteractionCollection children(androidx.ui.test.SemanticsNodeInteraction);
+ method public static androidx.ui.test.SemanticsNodeInteraction first(androidx.ui.test.SemanticsNodeInteractionCollection);
method public static androidx.ui.test.SemanticsNodeInteraction parent(androidx.ui.test.SemanticsNodeInteraction);
method public static androidx.ui.test.SemanticsNodeInteraction sibling(androidx.ui.test.SemanticsNodeInteraction);
- method public static java.util.List<androidx.ui.test.SemanticsNodeInteraction> siblings(androidx.ui.test.SemanticsNodeInteraction);
+ method public static androidx.ui.test.SemanticsNodeInteractionCollection siblings(androidx.ui.test.SemanticsNodeInteraction);
}
public final class SemanticsMatcher {
- ctor public SemanticsMatcher(String description, kotlin.jvm.functions.Function1<? super java.lang.Iterable<androidx.ui.core.semantics.SemanticsNode>,? extends java.lang.Iterable<androidx.ui.core.semantics.SemanticsNode>> selector);
+ ctor public SemanticsMatcher(String description, kotlin.jvm.functions.Function1<? super androidx.ui.core.semantics.SemanticsNode,java.lang.Boolean> matcher);
method public infix androidx.ui.test.SemanticsMatcher and(androidx.ui.test.SemanticsMatcher other);
method public String getDescription();
- method public Iterable<androidx.ui.core.semantics.SemanticsNode> match(Iterable<androidx.ui.core.semantics.SemanticsNode> nodes);
method public boolean matches(androidx.ui.core.semantics.SemanticsNode node);
method public boolean matchesAny(Iterable<androidx.ui.core.semantics.SemanticsNode> nodes);
method public operator androidx.ui.test.SemanticsMatcher not();
@@ -232,25 +254,36 @@
public static final class SemanticsMatcher.Companion {
method public <T> androidx.ui.test.SemanticsMatcher expectValue(androidx.ui.semantics.SemanticsPropertyKey<T> key, T? expectedValue);
- method public androidx.ui.test.SemanticsMatcher fromCondition(String description, kotlin.jvm.functions.Function1<? super androidx.ui.core.semantics.SemanticsNode,java.lang.Boolean> selector);
method public androidx.ui.test.SemanticsMatcher getAny();
method public <T> androidx.ui.test.SemanticsMatcher keyIsDefined(androidx.ui.semantics.SemanticsPropertyKey<T> key);
method public <T> androidx.ui.test.SemanticsMatcher keyNotDefined(androidx.ui.semantics.SemanticsPropertyKey<T> key);
property public final androidx.ui.test.SemanticsMatcher any;
}
- public final class SemanticsMatcherKt {
- }
-
public final class SemanticsNodeInteraction {
method public void assertDoesNotExist();
method public androidx.ui.test.SemanticsNodeInteraction assertExists(String? errorMessageOnFail = null);
method public androidx.ui.core.semantics.SemanticsNode fetchSemanticsNode(String? errorMessageOnFail = null);
}
+ public final class SemanticsNodeInteractionCollection {
+ ctor public SemanticsNodeInteractionCollection(internal androidx.ui.test.SemanticsSelector selector);
+ method public java.util.List<androidx.ui.core.semantics.SemanticsNode> fetchSemanticsNodes(String? errorMessageOnFail = null);
+ method public operator androidx.ui.test.SemanticsNodeInteraction get(int index);
+ }
+
public final class SemanticsNodeInteractionKt {
}
+ public final class SemanticsSelector {
+ ctor public SemanticsSelector(String description, boolean requiresExactlyOneNode, androidx.ui.test.SemanticsSelector? chainedInputSelector, kotlin.jvm.functions.Function1<? super java.lang.Iterable<androidx.ui.core.semantics.SemanticsNode>,androidx.ui.test.SelectionResult> selector);
+ method public String getDescription();
+ method public androidx.ui.test.SelectionResult map(Iterable<androidx.ui.core.semantics.SemanticsNode> nodes, String errorOnFail);
+ }
+
+ public final class SemanticsSelectorKt {
+ }
+
public final class SizesTestingKt {
method public static androidx.ui.layout.DpConstraints getBigTestConstraints();
method public static androidx.ui.test.CollectedSizes setContentAndCollectSizes(androidx.ui.test.ComposeTestRule, androidx.ui.layout.DpConstraints parentConstraints = BigTestConstraints, kotlin.jvm.functions.Function0<kotlin.Unit> children);
@@ -315,7 +348,7 @@
}
public final class AndroidComposeTestRuleKt {
- method public static inline <reified T extends androidx.activity.ComponentActivity> androidx.ui.test.android.AndroidComposeTestRule<T> AndroidComposeTestRule(androidx.compose.Recomposer? recomposer = null, boolean disableTransitions = false);
+ method public static inline <reified T> androidx.ui.test.android.AndroidComposeTestRule<T>! AndroidComposeTestRule(androidx.compose.Recomposer? recomposer = null, boolean disableTransitions = false);
}
public final class ComposeIdlingResourceKt {
diff --git a/ui/ui-test/api/restricted_0.1.0-dev11.txt b/ui/ui-test/api/restricted_0.1.0-dev11.txt
index 76f98f3..fcc20c2 100644
--- a/ui/ui-test/api/restricted_0.1.0-dev11.txt
+++ b/ui/ui-test/api/restricted_0.1.0-dev11.txt
@@ -6,6 +6,7 @@
method public static void callSemanticsAction(androidx.ui.test.SemanticsNodeInteraction, androidx.ui.semantics.SemanticsPropertyKey<androidx.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function0<kotlin.Unit>>> key);
method public static androidx.ui.test.SemanticsNodeInteraction doClick(androidx.ui.test.SemanticsNodeInteraction);
method public static androidx.ui.test.SemanticsNodeInteraction doGesture(androidx.ui.test.SemanticsNodeInteraction, kotlin.jvm.functions.Function1<? super androidx.ui.test.GestureScope,kotlin.Unit> block);
+ method public static androidx.ui.test.SemanticsNodeInteraction doPartialGesture(androidx.ui.test.SemanticsNodeInteraction, kotlin.jvm.functions.Function1<? super androidx.ui.test.PartialGestureScope,kotlin.Unit> block);
method public static androidx.ui.test.SemanticsNodeInteraction doScrollTo(androidx.ui.test.SemanticsNodeInteraction);
}
@@ -23,7 +24,7 @@
public final class AssertionsKt {
method public static androidx.ui.test.SemanticsNodeInteraction assert(androidx.ui.test.SemanticsNodeInteraction, androidx.ui.test.SemanticsMatcher matcher);
- method public static <T extends java.util.Collection<? extends androidx.ui.test.SemanticsNodeInteraction>> T assertCountEquals(T, int expectedSize);
+ method public static androidx.ui.test.SemanticsNodeInteractionCollection assertCountEquals(androidx.ui.test.SemanticsNodeInteractionCollection, int expectedSize);
method public static androidx.ui.test.SemanticsNodeInteraction assertHasClickAction(androidx.ui.test.SemanticsNodeInteraction);
method public static androidx.ui.test.SemanticsNodeInteraction assertHasNoClickAction(androidx.ui.test.SemanticsNodeInteraction);
method public static androidx.ui.test.SemanticsNodeInteraction assertIsDisplayed(androidx.ui.test.SemanticsNodeInteraction);
@@ -43,13 +44,16 @@
method public static androidx.ui.test.SemanticsNodeInteraction assertValueEquals(androidx.ui.test.SemanticsNodeInteraction, String value);
}
+ public abstract sealed class BaseGestureScope {
+ }
+
public final class BitmapHelpersKt {
- method public static void assertPixelColor-9bBi3KA(android.graphics.Bitmap, long expected, int x, int y, kotlin.jvm.functions.Function1<? super androidx.ui.graphics.Color,java.lang.String> error = { color -> "Pixel(" + x + ", " + y + ") expected to be " + expected + ", but was " + color });
+ method public static void assertPixelColor-9bBi3KA(android.graphics.Bitmap, long expected, int x, int y, kotlin.jvm.functions.Function1<? super androidx.ui.graphics.Color,java.lang.String> error = { color -> return "Pixel(" + x + ", " + y + ") expected to be " + expected + ", but was " + color });
method public static void assertPixels(android.graphics.Bitmap, androidx.ui.unit.IntPxSize? expectedSize = null, kotlin.jvm.functions.Function1<? super androidx.ui.unit.IntPxPosition,androidx.ui.graphics.Color> expectedColorProvider);
- method public static void assertShape-nbwoFSQ(android.graphics.Bitmap, androidx.ui.unit.Density density, androidx.ui.graphics.Shape shape, long shapeColor, long backgroundColor, androidx.ui.graphics.Shape backgroundShape = RectangleShape, float sizeX = width.toFloat().px, float sizeY = height.toFloat().px, float shapeSizeX = sizeX, float shapeSizeY = sizeY, float centerX = width.px / 2.0, float centerY = height.px / 2.0, float shapeOverlapPixelCount = 1.px);
+ method public static void assertShape-nbwoFSQ(android.graphics.Bitmap, androidx.ui.unit.Density density, androidx.ui.graphics.Shape shape, long shapeColor, long backgroundColor, androidx.ui.graphics.Shape backgroundShape = androidx.ui.graphics.RectangleShapeKt.RectangleShape, float sizeX = width.toFloat().px, float sizeY = height.toFloat().px, float shapeSizeX = sizeX, float shapeSizeY = sizeY, float centerX = width.px / 2.0, float centerY = height.px / 2.0, float shapeOverlapPixelCount = 1.px);
method @RequiresApi(android.os.Build.VERSION_CODES.O) public static android.graphics.Bitmap captureToBitmap(androidx.ui.test.SemanticsNodeInteraction);
method @RequiresApi(android.os.Build.VERSION_CODES.O) public static android.graphics.Bitmap captureToBitmap(android.view.View);
- method public static boolean contains(androidx.ui.graphics.Path, androidx.ui.geometry.Offset offset);
+ method public static boolean contains-m3TnucA(androidx.ui.graphics.Path, long offset);
}
public final class CollectedSizes {
@@ -173,57 +177,74 @@
}
public final class FindersKt {
- method public static androidx.ui.test.SemanticsNodeInteraction find(androidx.ui.test.SemanticsMatcher selector);
- method public static java.util.List<androidx.ui.test.SemanticsNodeInteraction> findAll(androidx.ui.test.SemanticsMatcher selector);
- method public static java.util.List<androidx.ui.test.SemanticsNodeInteraction> findAllByTag(String testTag);
- method public static java.util.List<androidx.ui.test.SemanticsNodeInteraction> findAllByText(String text, boolean ignoreCase = false);
+ method public static androidx.ui.test.SemanticsNodeInteraction find(androidx.ui.test.SemanticsMatcher matcher);
+ method public static androidx.ui.test.SemanticsNodeInteractionCollection findAll(androidx.ui.test.SemanticsMatcher matcher);
+ method public static androidx.ui.test.SemanticsNodeInteractionCollection findAllByTag(String testTag);
+ method public static androidx.ui.test.SemanticsNodeInteractionCollection findAllByText(String text, boolean ignoreCase = false);
method public static androidx.ui.test.SemanticsNodeInteraction findBySubstring(String text, boolean ignoreCase = false);
method public static androidx.ui.test.SemanticsNodeInteraction findByTag(String testTag);
method public static androidx.ui.test.SemanticsNodeInteraction findByText(String text, boolean ignoreCase = false);
}
- public final class GestureScope {
+ public final class GestureScope extends androidx.ui.test.BaseGestureScope {
}
public final class GestureScopeKt {
- method public static androidx.ui.unit.PxPosition getCenter(androidx.ui.test.GestureScope);
- method public static androidx.ui.unit.PxBounds getGlobalBounds(androidx.ui.test.GestureScope);
- method public static androidx.ui.unit.IntPxSize getSize(androidx.ui.test.GestureScope);
- method public static androidx.ui.unit.PxPosition localToGlobal(androidx.ui.test.GestureScope, androidx.ui.unit.PxPosition position);
+ method public static androidx.ui.unit.PxPosition getCenter(androidx.ui.test.BaseGestureScope);
+ method public static androidx.ui.unit.PxBounds getGlobalBounds(androidx.ui.test.BaseGestureScope);
+ method public static androidx.ui.unit.IntPxSize getSize(androidx.ui.test.BaseGestureScope);
+ method public static androidx.ui.unit.PxPosition localToGlobal(androidx.ui.test.BaseGestureScope, androidx.ui.unit.PxPosition position);
+ method public static void sendCancel(androidx.ui.test.PartialGestureScope, androidx.ui.test.GestureToken token, androidx.ui.unit.PxPosition? position = null);
method public static void sendClick(androidx.ui.test.GestureScope, androidx.ui.unit.PxPosition position);
method public static void sendClick(androidx.ui.test.GestureScope);
method public static void sendDoubleClick(androidx.ui.test.GestureScope, androidx.ui.unit.PxPosition position);
method public static void sendDoubleClick(androidx.ui.test.GestureScope);
+ method public static androidx.ui.test.GestureToken sendDown(androidx.ui.test.PartialGestureScope, androidx.ui.unit.PxPosition position);
method public static void sendLongClick(androidx.ui.test.GestureScope, androidx.ui.unit.PxPosition position);
method public static void sendLongClick(androidx.ui.test.GestureScope);
+ method public static void sendMoveBy(androidx.ui.test.PartialGestureScope, androidx.ui.test.GestureToken token, androidx.ui.unit.PxPosition delta);
+ method public static void sendMoveTo(androidx.ui.test.PartialGestureScope, androidx.ui.test.GestureToken token, androidx.ui.unit.PxPosition position);
method public static void sendSwipe(androidx.ui.test.GestureScope, androidx.ui.unit.PxPosition start, androidx.ui.unit.PxPosition end, androidx.ui.unit.Duration duration = 200.milliseconds);
method public static void sendSwipeDown(androidx.ui.test.GestureScope);
method public static void sendSwipeLeft(androidx.ui.test.GestureScope);
method public static void sendSwipeRight(androidx.ui.test.GestureScope);
method public static void sendSwipeUp(androidx.ui.test.GestureScope);
method public static void sendSwipeWithVelocity(androidx.ui.test.GestureScope, androidx.ui.unit.PxPosition start, androidx.ui.unit.PxPosition end, @FloatRange(from=0.0) float endVelocity, androidx.ui.unit.Duration duration = 200.milliseconds);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public static void sendTouchDown(androidx.ui.test.GestureScope, androidx.ui.unit.PxPosition position);
+ method public static void sendUp(androidx.ui.test.PartialGestureScope, androidx.ui.test.GestureToken token, androidx.ui.unit.PxPosition? position = null);
+ }
+
+ public final class GestureToken {
}
public final class OutputKt {
method public static String dumpToString(androidx.ui.test.SemanticsNodeInteraction);
- method public static String dumpToString(java.util.Collection<androidx.ui.test.SemanticsNodeInteraction>);
+ method public static String dumpToString(androidx.ui.test.SemanticsNodeInteractionCollection);
+ }
+
+ public final class PartialGestureScope extends androidx.ui.test.BaseGestureScope {
+ }
+
+ public final class SelectionResult {
+ ctor public SelectionResult(java.util.List<androidx.ui.core.semantics.SemanticsNode> selectedNodes, String? customErrorOnNoMatch);
+ method public String? getCustomErrorOnNoMatch();
+ method public java.util.List<androidx.ui.core.semantics.SemanticsNode> getSelectedNodes();
}
public final class SelectorsKt {
- method public static java.util.List<androidx.ui.test.SemanticsNodeInteraction> ancestors(androidx.ui.test.SemanticsNodeInteraction);
+ method public static androidx.ui.test.SemanticsNodeInteractionCollection ancestors(androidx.ui.test.SemanticsNodeInteraction);
method public static androidx.ui.test.SemanticsNodeInteraction child(androidx.ui.test.SemanticsNodeInteraction);
- method public static java.util.List<androidx.ui.test.SemanticsNodeInteraction> children(androidx.ui.test.SemanticsNodeInteraction);
+ method public static androidx.ui.test.SemanticsNodeInteraction childAt(androidx.ui.test.SemanticsNodeInteraction, int index);
+ method public static androidx.ui.test.SemanticsNodeInteractionCollection children(androidx.ui.test.SemanticsNodeInteraction);
+ method public static androidx.ui.test.SemanticsNodeInteraction first(androidx.ui.test.SemanticsNodeInteractionCollection);
method public static androidx.ui.test.SemanticsNodeInteraction parent(androidx.ui.test.SemanticsNodeInteraction);
method public static androidx.ui.test.SemanticsNodeInteraction sibling(androidx.ui.test.SemanticsNodeInteraction);
- method public static java.util.List<androidx.ui.test.SemanticsNodeInteraction> siblings(androidx.ui.test.SemanticsNodeInteraction);
+ method public static androidx.ui.test.SemanticsNodeInteractionCollection siblings(androidx.ui.test.SemanticsNodeInteraction);
}
public final class SemanticsMatcher {
- ctor public SemanticsMatcher(String description, kotlin.jvm.functions.Function1<? super java.lang.Iterable<androidx.ui.core.semantics.SemanticsNode>,? extends java.lang.Iterable<androidx.ui.core.semantics.SemanticsNode>> selector);
+ ctor public SemanticsMatcher(String description, kotlin.jvm.functions.Function1<? super androidx.ui.core.semantics.SemanticsNode,java.lang.Boolean> matcher);
method public infix androidx.ui.test.SemanticsMatcher and(androidx.ui.test.SemanticsMatcher other);
method public String getDescription();
- method public Iterable<androidx.ui.core.semantics.SemanticsNode> match(Iterable<androidx.ui.core.semantics.SemanticsNode> nodes);
method public boolean matches(androidx.ui.core.semantics.SemanticsNode node);
method public boolean matchesAny(Iterable<androidx.ui.core.semantics.SemanticsNode> nodes);
method public operator androidx.ui.test.SemanticsMatcher not();
@@ -233,25 +254,36 @@
public static final class SemanticsMatcher.Companion {
method public <T> androidx.ui.test.SemanticsMatcher expectValue(androidx.ui.semantics.SemanticsPropertyKey<T> key, T? expectedValue);
- method public androidx.ui.test.SemanticsMatcher fromCondition(String description, kotlin.jvm.functions.Function1<? super androidx.ui.core.semantics.SemanticsNode,java.lang.Boolean> selector);
method public androidx.ui.test.SemanticsMatcher getAny();
method public <T> androidx.ui.test.SemanticsMatcher keyIsDefined(androidx.ui.semantics.SemanticsPropertyKey<T> key);
method public <T> androidx.ui.test.SemanticsMatcher keyNotDefined(androidx.ui.semantics.SemanticsPropertyKey<T> key);
property public final androidx.ui.test.SemanticsMatcher any;
}
- public final class SemanticsMatcherKt {
- }
-
public final class SemanticsNodeInteraction {
method public void assertDoesNotExist();
method public androidx.ui.test.SemanticsNodeInteraction assertExists(String? errorMessageOnFail = null);
method public androidx.ui.core.semantics.SemanticsNode fetchSemanticsNode(String? errorMessageOnFail = null);
}
+ public final class SemanticsNodeInteractionCollection {
+ ctor public SemanticsNodeInteractionCollection(internal androidx.ui.test.SemanticsSelector selector);
+ method public java.util.List<androidx.ui.core.semantics.SemanticsNode> fetchSemanticsNodes(String? errorMessageOnFail = null);
+ method public operator androidx.ui.test.SemanticsNodeInteraction get(int index);
+ }
+
public final class SemanticsNodeInteractionKt {
}
+ public final class SemanticsSelector {
+ ctor public SemanticsSelector(String description, boolean requiresExactlyOneNode, androidx.ui.test.SemanticsSelector? chainedInputSelector, kotlin.jvm.functions.Function1<? super java.lang.Iterable<androidx.ui.core.semantics.SemanticsNode>,androidx.ui.test.SelectionResult> selector);
+ method public String getDescription();
+ method public androidx.ui.test.SelectionResult map(Iterable<androidx.ui.core.semantics.SemanticsNode> nodes, String errorOnFail);
+ }
+
+ public final class SemanticsSelectorKt {
+ }
+
public final class SizesTestingKt {
method public static androidx.ui.layout.DpConstraints getBigTestConstraints();
method public static androidx.ui.test.CollectedSizes setContentAndCollectSizes(androidx.ui.test.ComposeTestRule, androidx.ui.layout.DpConstraints parentConstraints = BigTestConstraints, kotlin.jvm.functions.Function0<kotlin.Unit> children);
@@ -316,7 +348,7 @@
}
public final class AndroidComposeTestRuleKt {
- method public static inline <reified T extends androidx.activity.ComponentActivity> androidx.ui.test.android.AndroidComposeTestRule<T> AndroidComposeTestRule(androidx.compose.Recomposer? recomposer = null, boolean disableTransitions = false);
+ method public static inline <reified T> androidx.ui.test.android.AndroidComposeTestRule<T>! AndroidComposeTestRule(androidx.compose.Recomposer? recomposer = null, boolean disableTransitions = false);
}
public final class ComposeIdlingResourceKt {
diff --git a/ui/ui-test/api/restricted_current.txt b/ui/ui-test/api/restricted_current.txt
index 76f98f3..fcc20c2 100644
--- a/ui/ui-test/api/restricted_current.txt
+++ b/ui/ui-test/api/restricted_current.txt
@@ -6,6 +6,7 @@
method public static void callSemanticsAction(androidx.ui.test.SemanticsNodeInteraction, androidx.ui.semantics.SemanticsPropertyKey<androidx.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function0<kotlin.Unit>>> key);
method public static androidx.ui.test.SemanticsNodeInteraction doClick(androidx.ui.test.SemanticsNodeInteraction);
method public static androidx.ui.test.SemanticsNodeInteraction doGesture(androidx.ui.test.SemanticsNodeInteraction, kotlin.jvm.functions.Function1<? super androidx.ui.test.GestureScope,kotlin.Unit> block);
+ method public static androidx.ui.test.SemanticsNodeInteraction doPartialGesture(androidx.ui.test.SemanticsNodeInteraction, kotlin.jvm.functions.Function1<? super androidx.ui.test.PartialGestureScope,kotlin.Unit> block);
method public static androidx.ui.test.SemanticsNodeInteraction doScrollTo(androidx.ui.test.SemanticsNodeInteraction);
}
@@ -23,7 +24,7 @@
public final class AssertionsKt {
method public static androidx.ui.test.SemanticsNodeInteraction assert(androidx.ui.test.SemanticsNodeInteraction, androidx.ui.test.SemanticsMatcher matcher);
- method public static <T extends java.util.Collection<? extends androidx.ui.test.SemanticsNodeInteraction>> T assertCountEquals(T, int expectedSize);
+ method public static androidx.ui.test.SemanticsNodeInteractionCollection assertCountEquals(androidx.ui.test.SemanticsNodeInteractionCollection, int expectedSize);
method public static androidx.ui.test.SemanticsNodeInteraction assertHasClickAction(androidx.ui.test.SemanticsNodeInteraction);
method public static androidx.ui.test.SemanticsNodeInteraction assertHasNoClickAction(androidx.ui.test.SemanticsNodeInteraction);
method public static androidx.ui.test.SemanticsNodeInteraction assertIsDisplayed(androidx.ui.test.SemanticsNodeInteraction);
@@ -43,13 +44,16 @@
method public static androidx.ui.test.SemanticsNodeInteraction assertValueEquals(androidx.ui.test.SemanticsNodeInteraction, String value);
}
+ public abstract sealed class BaseGestureScope {
+ }
+
public final class BitmapHelpersKt {
- method public static void assertPixelColor-9bBi3KA(android.graphics.Bitmap, long expected, int x, int y, kotlin.jvm.functions.Function1<? super androidx.ui.graphics.Color,java.lang.String> error = { color -> "Pixel(" + x + ", " + y + ") expected to be " + expected + ", but was " + color });
+ method public static void assertPixelColor-9bBi3KA(android.graphics.Bitmap, long expected, int x, int y, kotlin.jvm.functions.Function1<? super androidx.ui.graphics.Color,java.lang.String> error = { color -> return "Pixel(" + x + ", " + y + ") expected to be " + expected + ", but was " + color });
method public static void assertPixels(android.graphics.Bitmap, androidx.ui.unit.IntPxSize? expectedSize = null, kotlin.jvm.functions.Function1<? super androidx.ui.unit.IntPxPosition,androidx.ui.graphics.Color> expectedColorProvider);
- method public static void assertShape-nbwoFSQ(android.graphics.Bitmap, androidx.ui.unit.Density density, androidx.ui.graphics.Shape shape, long shapeColor, long backgroundColor, androidx.ui.graphics.Shape backgroundShape = RectangleShape, float sizeX = width.toFloat().px, float sizeY = height.toFloat().px, float shapeSizeX = sizeX, float shapeSizeY = sizeY, float centerX = width.px / 2.0, float centerY = height.px / 2.0, float shapeOverlapPixelCount = 1.px);
+ method public static void assertShape-nbwoFSQ(android.graphics.Bitmap, androidx.ui.unit.Density density, androidx.ui.graphics.Shape shape, long shapeColor, long backgroundColor, androidx.ui.graphics.Shape backgroundShape = androidx.ui.graphics.RectangleShapeKt.RectangleShape, float sizeX = width.toFloat().px, float sizeY = height.toFloat().px, float shapeSizeX = sizeX, float shapeSizeY = sizeY, float centerX = width.px / 2.0, float centerY = height.px / 2.0, float shapeOverlapPixelCount = 1.px);
method @RequiresApi(android.os.Build.VERSION_CODES.O) public static android.graphics.Bitmap captureToBitmap(androidx.ui.test.SemanticsNodeInteraction);
method @RequiresApi(android.os.Build.VERSION_CODES.O) public static android.graphics.Bitmap captureToBitmap(android.view.View);
- method public static boolean contains(androidx.ui.graphics.Path, androidx.ui.geometry.Offset offset);
+ method public static boolean contains-m3TnucA(androidx.ui.graphics.Path, long offset);
}
public final class CollectedSizes {
@@ -173,57 +177,74 @@
}
public final class FindersKt {
- method public static androidx.ui.test.SemanticsNodeInteraction find(androidx.ui.test.SemanticsMatcher selector);
- method public static java.util.List<androidx.ui.test.SemanticsNodeInteraction> findAll(androidx.ui.test.SemanticsMatcher selector);
- method public static java.util.List<androidx.ui.test.SemanticsNodeInteraction> findAllByTag(String testTag);
- method public static java.util.List<androidx.ui.test.SemanticsNodeInteraction> findAllByText(String text, boolean ignoreCase = false);
+ method public static androidx.ui.test.SemanticsNodeInteraction find(androidx.ui.test.SemanticsMatcher matcher);
+ method public static androidx.ui.test.SemanticsNodeInteractionCollection findAll(androidx.ui.test.SemanticsMatcher matcher);
+ method public static androidx.ui.test.SemanticsNodeInteractionCollection findAllByTag(String testTag);
+ method public static androidx.ui.test.SemanticsNodeInteractionCollection findAllByText(String text, boolean ignoreCase = false);
method public static androidx.ui.test.SemanticsNodeInteraction findBySubstring(String text, boolean ignoreCase = false);
method public static androidx.ui.test.SemanticsNodeInteraction findByTag(String testTag);
method public static androidx.ui.test.SemanticsNodeInteraction findByText(String text, boolean ignoreCase = false);
}
- public final class GestureScope {
+ public final class GestureScope extends androidx.ui.test.BaseGestureScope {
}
public final class GestureScopeKt {
- method public static androidx.ui.unit.PxPosition getCenter(androidx.ui.test.GestureScope);
- method public static androidx.ui.unit.PxBounds getGlobalBounds(androidx.ui.test.GestureScope);
- method public static androidx.ui.unit.IntPxSize getSize(androidx.ui.test.GestureScope);
- method public static androidx.ui.unit.PxPosition localToGlobal(androidx.ui.test.GestureScope, androidx.ui.unit.PxPosition position);
+ method public static androidx.ui.unit.PxPosition getCenter(androidx.ui.test.BaseGestureScope);
+ method public static androidx.ui.unit.PxBounds getGlobalBounds(androidx.ui.test.BaseGestureScope);
+ method public static androidx.ui.unit.IntPxSize getSize(androidx.ui.test.BaseGestureScope);
+ method public static androidx.ui.unit.PxPosition localToGlobal(androidx.ui.test.BaseGestureScope, androidx.ui.unit.PxPosition position);
+ method public static void sendCancel(androidx.ui.test.PartialGestureScope, androidx.ui.test.GestureToken token, androidx.ui.unit.PxPosition? position = null);
method public static void sendClick(androidx.ui.test.GestureScope, androidx.ui.unit.PxPosition position);
method public static void sendClick(androidx.ui.test.GestureScope);
method public static void sendDoubleClick(androidx.ui.test.GestureScope, androidx.ui.unit.PxPosition position);
method public static void sendDoubleClick(androidx.ui.test.GestureScope);
+ method public static androidx.ui.test.GestureToken sendDown(androidx.ui.test.PartialGestureScope, androidx.ui.unit.PxPosition position);
method public static void sendLongClick(androidx.ui.test.GestureScope, androidx.ui.unit.PxPosition position);
method public static void sendLongClick(androidx.ui.test.GestureScope);
+ method public static void sendMoveBy(androidx.ui.test.PartialGestureScope, androidx.ui.test.GestureToken token, androidx.ui.unit.PxPosition delta);
+ method public static void sendMoveTo(androidx.ui.test.PartialGestureScope, androidx.ui.test.GestureToken token, androidx.ui.unit.PxPosition position);
method public static void sendSwipe(androidx.ui.test.GestureScope, androidx.ui.unit.PxPosition start, androidx.ui.unit.PxPosition end, androidx.ui.unit.Duration duration = 200.milliseconds);
method public static void sendSwipeDown(androidx.ui.test.GestureScope);
method public static void sendSwipeLeft(androidx.ui.test.GestureScope);
method public static void sendSwipeRight(androidx.ui.test.GestureScope);
method public static void sendSwipeUp(androidx.ui.test.GestureScope);
method public static void sendSwipeWithVelocity(androidx.ui.test.GestureScope, androidx.ui.unit.PxPosition start, androidx.ui.unit.PxPosition end, @FloatRange(from=0.0) float endVelocity, androidx.ui.unit.Duration duration = 200.milliseconds);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public static void sendTouchDown(androidx.ui.test.GestureScope, androidx.ui.unit.PxPosition position);
+ method public static void sendUp(androidx.ui.test.PartialGestureScope, androidx.ui.test.GestureToken token, androidx.ui.unit.PxPosition? position = null);
+ }
+
+ public final class GestureToken {
}
public final class OutputKt {
method public static String dumpToString(androidx.ui.test.SemanticsNodeInteraction);
- method public static String dumpToString(java.util.Collection<androidx.ui.test.SemanticsNodeInteraction>);
+ method public static String dumpToString(androidx.ui.test.SemanticsNodeInteractionCollection);
+ }
+
+ public final class PartialGestureScope extends androidx.ui.test.BaseGestureScope {
+ }
+
+ public final class SelectionResult {
+ ctor public SelectionResult(java.util.List<androidx.ui.core.semantics.SemanticsNode> selectedNodes, String? customErrorOnNoMatch);
+ method public String? getCustomErrorOnNoMatch();
+ method public java.util.List<androidx.ui.core.semantics.SemanticsNode> getSelectedNodes();
}
public final class SelectorsKt {
- method public static java.util.List<androidx.ui.test.SemanticsNodeInteraction> ancestors(androidx.ui.test.SemanticsNodeInteraction);
+ method public static androidx.ui.test.SemanticsNodeInteractionCollection ancestors(androidx.ui.test.SemanticsNodeInteraction);
method public static androidx.ui.test.SemanticsNodeInteraction child(androidx.ui.test.SemanticsNodeInteraction);
- method public static java.util.List<androidx.ui.test.SemanticsNodeInteraction> children(androidx.ui.test.SemanticsNodeInteraction);
+ method public static androidx.ui.test.SemanticsNodeInteraction childAt(androidx.ui.test.SemanticsNodeInteraction, int index);
+ method public static androidx.ui.test.SemanticsNodeInteractionCollection children(androidx.ui.test.SemanticsNodeInteraction);
+ method public static androidx.ui.test.SemanticsNodeInteraction first(androidx.ui.test.SemanticsNodeInteractionCollection);
method public static androidx.ui.test.SemanticsNodeInteraction parent(androidx.ui.test.SemanticsNodeInteraction);
method public static androidx.ui.test.SemanticsNodeInteraction sibling(androidx.ui.test.SemanticsNodeInteraction);
- method public static java.util.List<androidx.ui.test.SemanticsNodeInteraction> siblings(androidx.ui.test.SemanticsNodeInteraction);
+ method public static androidx.ui.test.SemanticsNodeInteractionCollection siblings(androidx.ui.test.SemanticsNodeInteraction);
}
public final class SemanticsMatcher {
- ctor public SemanticsMatcher(String description, kotlin.jvm.functions.Function1<? super java.lang.Iterable<androidx.ui.core.semantics.SemanticsNode>,? extends java.lang.Iterable<androidx.ui.core.semantics.SemanticsNode>> selector);
+ ctor public SemanticsMatcher(String description, kotlin.jvm.functions.Function1<? super androidx.ui.core.semantics.SemanticsNode,java.lang.Boolean> matcher);
method public infix androidx.ui.test.SemanticsMatcher and(androidx.ui.test.SemanticsMatcher other);
method public String getDescription();
- method public Iterable<androidx.ui.core.semantics.SemanticsNode> match(Iterable<androidx.ui.core.semantics.SemanticsNode> nodes);
method public boolean matches(androidx.ui.core.semantics.SemanticsNode node);
method public boolean matchesAny(Iterable<androidx.ui.core.semantics.SemanticsNode> nodes);
method public operator androidx.ui.test.SemanticsMatcher not();
@@ -233,25 +254,36 @@
public static final class SemanticsMatcher.Companion {
method public <T> androidx.ui.test.SemanticsMatcher expectValue(androidx.ui.semantics.SemanticsPropertyKey<T> key, T? expectedValue);
- method public androidx.ui.test.SemanticsMatcher fromCondition(String description, kotlin.jvm.functions.Function1<? super androidx.ui.core.semantics.SemanticsNode,java.lang.Boolean> selector);
method public androidx.ui.test.SemanticsMatcher getAny();
method public <T> androidx.ui.test.SemanticsMatcher keyIsDefined(androidx.ui.semantics.SemanticsPropertyKey<T> key);
method public <T> androidx.ui.test.SemanticsMatcher keyNotDefined(androidx.ui.semantics.SemanticsPropertyKey<T> key);
property public final androidx.ui.test.SemanticsMatcher any;
}
- public final class SemanticsMatcherKt {
- }
-
public final class SemanticsNodeInteraction {
method public void assertDoesNotExist();
method public androidx.ui.test.SemanticsNodeInteraction assertExists(String? errorMessageOnFail = null);
method public androidx.ui.core.semantics.SemanticsNode fetchSemanticsNode(String? errorMessageOnFail = null);
}
+ public final class SemanticsNodeInteractionCollection {
+ ctor public SemanticsNodeInteractionCollection(internal androidx.ui.test.SemanticsSelector selector);
+ method public java.util.List<androidx.ui.core.semantics.SemanticsNode> fetchSemanticsNodes(String? errorMessageOnFail = null);
+ method public operator androidx.ui.test.SemanticsNodeInteraction get(int index);
+ }
+
public final class SemanticsNodeInteractionKt {
}
+ public final class SemanticsSelector {
+ ctor public SemanticsSelector(String description, boolean requiresExactlyOneNode, androidx.ui.test.SemanticsSelector? chainedInputSelector, kotlin.jvm.functions.Function1<? super java.lang.Iterable<androidx.ui.core.semantics.SemanticsNode>,androidx.ui.test.SelectionResult> selector);
+ method public String getDescription();
+ method public androidx.ui.test.SelectionResult map(Iterable<androidx.ui.core.semantics.SemanticsNode> nodes, String errorOnFail);
+ }
+
+ public final class SemanticsSelectorKt {
+ }
+
public final class SizesTestingKt {
method public static androidx.ui.layout.DpConstraints getBigTestConstraints();
method public static androidx.ui.test.CollectedSizes setContentAndCollectSizes(androidx.ui.test.ComposeTestRule, androidx.ui.layout.DpConstraints parentConstraints = BigTestConstraints, kotlin.jvm.functions.Function0<kotlin.Unit> children);
@@ -316,7 +348,7 @@
}
public final class AndroidComposeTestRuleKt {
- method public static inline <reified T extends androidx.activity.ComponentActivity> androidx.ui.test.android.AndroidComposeTestRule<T> AndroidComposeTestRule(androidx.compose.Recomposer? recomposer = null, boolean disableTransitions = false);
+ method public static inline <reified T> androidx.ui.test.android.AndroidComposeTestRule<T>! AndroidComposeTestRule(androidx.compose.Recomposer? recomposer = null, boolean disableTransitions = false);
}
public final class ComposeIdlingResourceKt {
diff --git a/ui/ui-test/src/androidTest/AndroidManifest.xml b/ui/ui-test/src/androidTest/AndroidManifest.xml
index 86cb9d3..7ac2dec 100644
--- a/ui/ui-test/src/androidTest/AndroidManifest.xml
+++ b/ui/ui-test/src/androidTest/AndroidManifest.xml
@@ -21,7 +21,7 @@
android:theme="@style/TestTheme"/>
<activity android:name="androidx.ui.test.CustomActivity"
android:theme="@android:style/Theme.Material.NoActionBar.Fullscreen"/>
- <activity android:name="androidx.ui.test.ActivityWithActionBar" />
+ <activity android:name="androidx.ui.test.gesturescope.ActivityWithActionBar" />
<activity android:name="androidx.ui.test.MultipleActivitiesFindTest$Activity1" />
<activity android:name="androidx.ui.test.MultipleActivitiesFindTest$Activity2" />
<activity android:name="androidx.ui.test.MultipleActivitiesClickTest$Activity1" />
diff --git a/ui/ui-test/src/androidTest/java/androidx/ui/test/AnimationSynchronizationTest.kt b/ui/ui-test/src/androidTest/java/androidx/ui/test/AnimationSynchronizationTest.kt
index e68065c..7370875 100644
--- a/ui/ui-test/src/androidTest/java/androidx/ui/test/AnimationSynchronizationTest.kt
+++ b/ui/ui-test/src/androidTest/java/androidx/ui/test/AnimationSynchronizationTest.kt
@@ -24,17 +24,16 @@
import androidx.compose.Composable
import androidx.compose.State
import androidx.compose.mutableStateOf
-import androidx.compose.remember
import androidx.test.espresso.Espresso.onIdle
import androidx.test.filters.LargeTest
import androidx.ui.animation.Transition
import androidx.ui.core.Modifier
import androidx.ui.foundation.Box
-import androidx.ui.foundation.Canvas
+import androidx.ui.foundation.Canvas2
import androidx.ui.foundation.drawBackground
-import androidx.ui.geometry.Rect
+import androidx.ui.geometry.Offset
+import androidx.ui.geometry.Size
import androidx.ui.graphics.Color
-import androidx.ui.graphics.Paint
import androidx.ui.layout.fillMaxSize
import androidx.ui.test.android.ComposeIdlingResource
import com.google.common.truth.Truth.assertThat
@@ -45,7 +44,8 @@
private const val animateFromX = 0f
private const val animateToX = 50f
-private val animatedRect = Rect.fromLTWH(0f, 0f, 50f, 50f)
+
+private val rectSize = Size(50.0f, 50.0f)
@LargeTest
class AnimationSynchronizationTest {
@@ -176,8 +176,6 @@
@Composable
private fun Ui(animationState: State<AnimationStates>) {
- val paint = remember { Paint().also { it.color = Color.Cyan } }
-
hasRecomposed = true
Box(modifier = Modifier.drawBackground(Color.Yellow).fillMaxSize()) {
hasRecomposed = true
@@ -187,9 +185,9 @@
onStateChangeFinished = { animationRunning = false }
) { state ->
hasRecomposed = true
- Canvas(modifier = Modifier.fillMaxSize()) {
+ Canvas2(modifier = Modifier.fillMaxSize()) {
recordedAnimatedValues.add(state[x])
- drawRect(animatedRect.translate(state[x], 0f), paint)
+ drawRect(Color.Cyan, Offset(state[x], 0f), rectSize)
}
}
}
diff --git a/ui/ui-test/src/androidTest/java/androidx/ui/test/ErrorMessagesTest.kt b/ui/ui-test/src/androidTest/java/androidx/ui/test/ErrorMessagesTest.kt
index 124dbf8..c2867c3 100644
--- a/ui/ui-test/src/androidTest/java/androidx/ui/test/ErrorMessagesTest.kt
+++ b/ui/ui-test/src/androidTest/java/androidx/ui/test/ErrorMessagesTest.kt
@@ -208,7 +208,8 @@
expectErrorMessage("" +
"Failed to assert count of nodes.\n" +
- "Reason: Expected '3' nodes but could not find any."
+ "Reason: Expected '3' nodes but could not find any node that satisfies: " +
+ "(AccessibilityLabel = 'Toggle2' (ignoreCase: false))"
) {
findAllByText("Toggle2")
.assertCountEquals(3)
diff --git a/ui/ui-test/src/androidTest/java/androidx/ui/test/FindAllTest.kt b/ui/ui-test/src/androidTest/java/androidx/ui/test/FindAllTest.kt
index 7fd4ced..821f6f3 100644
--- a/ui/ui-test/src/androidTest/java/androidx/ui/test/FindAllTest.kt
+++ b/ui/ui-test/src/androidTest/java/androidx/ui/test/FindAllTest.kt
@@ -49,8 +49,9 @@
findAll(isOn())
.assertCountEquals(2)
- .forEach {
- it.assertIsOn()
+ .apply {
+ get(0).assertIsOn()
+ get(1).assertIsOn()
}
}
@@ -77,9 +78,13 @@
findAll(isToggleable())
.assertCountEquals(2)
- .forEach {
- it.doClick()
- it.assertIsOn()
+ .apply {
+ get(0)
+ .doClick()
+ .assertIsOn()
+ get(1)
+ .doClick()
+ .assertIsOn()
}
}
@@ -213,6 +218,6 @@
.assertIsOn()
get(1)
.assertDoesNotExist()
- }
+ }
}
}
diff --git a/ui/ui-test/src/androidTest/java/androidx/ui/test/FindersTest.kt b/ui/ui-test/src/androidTest/java/androidx/ui/test/FindersTest.kt
index 32978cb..b1e53dc 100644
--- a/ui/ui-test/src/androidTest/java/androidx/ui/test/FindersTest.kt
+++ b/ui/ui-test/src/androidTest/java/androidx/ui/test/FindersTest.kt
@@ -20,16 +20,13 @@
import androidx.test.filters.MediumTest
import androidx.ui.layout.Column
import androidx.ui.semantics.Semantics
-import androidx.ui.semantics.SemanticsProperties
import androidx.ui.semantics.SemanticsPropertyReceiver
import androidx.ui.semantics.accessibilityLabel
import androidx.ui.semantics.testTag
-import com.google.common.truth.Truth.assertThat
import org.junit.Rule
import org.junit.Test
import org.junit.runner.RunWith
import org.junit.runners.JUnit4
-import java.lang.AssertionError
@MediumTest
@RunWith(JUnit4::class)
@@ -44,8 +41,7 @@
BoundaryNode { testTag = "not_myTestTag" }
}
- val foundNodes = findAll(hasTestTag("myTestTag"))
- assertThat(foundNodes).isEmpty()
+ findAll(hasTestTag("myTestTag")).assertCountEquals(0)
}
@Test
@@ -55,9 +51,10 @@
BoundaryNode { testTag = "myTestTag2" }
}
- val foundNodes = findAll(hasTestTag("myTestTag"))
- assertThat(foundNodes.map { it.fetchSemanticsNode().config[SemanticsProperties.TestTag] })
- .containsExactly("myTestTag")
+ findAll(hasTestTag("myTestTag"))
+ .assertCountEquals(1)
+ .first()
+ .assert(hasTestTag("myTestTag"))
}
@Test
@@ -67,9 +64,12 @@
BoundaryNode { testTag = "myTestTag" }
}
- val foundNodes = findAll(hasTestTag("myTestTag"))
- assertThat(foundNodes.map { it.fetchSemanticsNode().config[SemanticsProperties.TestTag] })
- .containsExactly("myTestTag", "myTestTag")
+ findAll(hasTestTag("myTestTag"))
+ .assertCountEquals(2)
+ .apply {
+ get(0).assert(hasTestTag("myTestTag"))
+ get(1).assert(hasTestTag("myTestTag"))
+ }
}
@Test
diff --git a/ui/ui-test/src/androidTest/java/androidx/ui/test/FirstDrawTest.kt b/ui/ui-test/src/androidTest/java/androidx/ui/test/FirstDrawTest.kt
index fa112c6..015a77fb 100644
--- a/ui/ui-test/src/androidTest/java/androidx/ui/test/FirstDrawTest.kt
+++ b/ui/ui-test/src/androidTest/java/androidx/ui/test/FirstDrawTest.kt
@@ -25,7 +25,7 @@
import androidx.ui.core.Modifier
import androidx.ui.core.setContent
import androidx.ui.foundation.Box
-import androidx.ui.foundation.Canvas
+import androidx.ui.foundation.Canvas2
import androidx.ui.graphics.Color
import androidx.ui.layout.fillMaxSize
import androidx.ui.test.android.AndroidComposeTestRule
@@ -46,7 +46,7 @@
fun waitsForFirstDraw() {
var drawn = false
testRule.setContent {
- Canvas(Modifier.fillMaxSize()) {
+ Canvas2(Modifier.fillMaxSize()) {
drawn = true
}
}
@@ -61,7 +61,7 @@
fun waitsForFirstDraw_withoutOnIdle() {
var drawn = false
testRule.setContent {
- Canvas(Modifier.fillMaxSize()) {
+ Canvas2(Modifier.fillMaxSize()) {
drawn = true
}
}
@@ -104,7 +104,7 @@
outOfBoundsView.setContent(Recomposer.current()) {
// If you see this box when running the test, the test is setup incorrectly
Box(Modifier, backgroundColor = Color.Yellow)
- Canvas(Modifier) {
+ Canvas2(Modifier) {
drawn = true
}
}
diff --git a/ui/ui-test/src/androidTest/java/androidx/ui/test/IsDisplayedTests.kt b/ui/ui-test/src/androidTest/java/androidx/ui/test/IsDisplayedTests.kt
index 31fbe9c..ffd3ff6 100644
--- a/ui/ui-test/src/androidTest/java/androidx/ui/test/IsDisplayedTests.kt
+++ b/ui/ui-test/src/androidTest/java/androidx/ui/test/IsDisplayedTests.kt
@@ -24,12 +24,10 @@
import androidx.ui.core.Modifier
import androidx.ui.core.TestTag
import androidx.ui.foundation.Box
-import androidx.ui.foundation.Canvas
+import androidx.ui.foundation.Canvas2
import androidx.ui.foundation.Text
import androidx.ui.foundation.VerticalScroller
import androidx.ui.graphics.Color
-import androidx.ui.graphics.Paint
-import androidx.ui.graphics.PaintingStyle
import androidx.ui.layout.Column
import androidx.ui.layout.Row
import androidx.ui.layout.Stack
@@ -39,6 +37,7 @@
import androidx.ui.semantics.Semantics
import androidx.ui.text.TextStyle
import androidx.ui.unit.IntPx
+import androidx.ui.unit.Px
import androidx.ui.unit.dp
import androidx.ui.unit.ipx
import androidx.ui.unit.px
@@ -233,13 +232,10 @@
val drawRect = @Composable { color: Color ->
Semantics(container = true) {
- Canvas(Modifier.preferredSize(100.dp)) {
- val paint = Paint()
- paint.color = color
- paint.style = PaintingStyle.fill
- drawRect(size.toRect(), paint)
+ Canvas2(Modifier.preferredSize(100.dp)) {
+ drawRect(color)
- elementHeight = size.height
+ elementHeight = Px(size.height)
}
}
}
diff --git a/ui/ui-test/src/androidTest/java/androidx/ui/test/TestAnimationClockTest.kt b/ui/ui-test/src/androidTest/java/androidx/ui/test/TestAnimationClockTest.kt
index eebc64d..457ab16 100644
--- a/ui/ui-test/src/androidTest/java/androidx/ui/test/TestAnimationClockTest.kt
+++ b/ui/ui-test/src/androidTest/java/androidx/ui/test/TestAnimationClockTest.kt
@@ -24,17 +24,16 @@
import androidx.compose.Recomposer
import androidx.compose.State
import androidx.compose.mutableStateOf
-import androidx.compose.remember
import androidx.test.espresso.Espresso.onIdle
import androidx.test.filters.MediumTest
import androidx.ui.animation.Transition
import androidx.ui.core.Modifier
import androidx.ui.foundation.Box
-import androidx.ui.foundation.Canvas
+import androidx.ui.foundation.Canvas2
import androidx.ui.foundation.drawBackground
-import androidx.ui.geometry.Rect
+import androidx.ui.geometry.Offset
+import androidx.ui.geometry.Size
import androidx.ui.graphics.Color
-import androidx.ui.graphics.Paint
import androidx.ui.layout.fillMaxSize
import androidx.ui.test.android.ComposeIdlingResource
import com.google.common.truth.Truth.assertThat
@@ -169,9 +168,7 @@
@Composable
private fun Ui(animationState: State<AnimationStates>) {
- val paint = remember { Paint().also { it.color = Color.Cyan } }
- val rect = remember { Rect.fromLTWH(0f, 0f, 50f, 50f) }
-
+ val size = Size(50.0f, 50.0f)
hasRecomposed = true
Box(modifier = Modifier.drawBackground(Color.Yellow).fillMaxSize()) {
hasRecomposed = true
@@ -181,10 +178,10 @@
onStateChangeFinished = { animationRunning = false }
) { state ->
hasRecomposed = true
- Canvas(modifier = Modifier.fillMaxSize()) {
+ Canvas2(modifier = Modifier.fillMaxSize()) {
val xValue = state[x]
recordedAnimatedValues.add(xValue)
- drawRect(rect.translate(xValue, 0f), paint)
+ drawRect(Color.Cyan, Offset(xValue, 0.0f), size)
}
}
}
diff --git a/ui/ui-test/src/androidTest/java/androidx/ui/test/WaitingForOnCommitCallbackTest.kt b/ui/ui-test/src/androidTest/java/androidx/ui/test/WaitingForOnCommitCallbackTest.kt
new file mode 100644
index 0000000..03825af
--- /dev/null
+++ b/ui/ui-test/src/androidTest/java/androidx/ui/test/WaitingForOnCommitCallbackTest.kt
@@ -0,0 +1,57 @@
+/*
+ * Copyright 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT 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.ui.test
+
+import androidx.compose.getValue
+import androidx.compose.mutableStateOf
+import androidx.compose.onCommit
+import androidx.compose.setValue
+import androidx.test.filters.MediumTest
+import com.google.common.truth.Truth.assertThat
+import org.junit.Rule
+import org.junit.Test
+import org.junit.runner.RunWith
+import org.junit.runners.JUnit4
+import java.util.concurrent.atomic.AtomicBoolean
+
+@MediumTest
+@RunWith(JUnit4::class)
+class WaitingForOnCommitCallbackTest {
+
+ @get:Rule
+ val composeTestRule = createComposeRule()
+
+ @Test
+ fun setContentAndWaitForIdleReleasesAfterOnCommitCallback() {
+ val atomicBoolean = AtomicBoolean(false)
+ var switch by mutableStateOf(true)
+ composeTestRule.setContent {
+ onCommit(switch) {
+ atomicBoolean.set(switch)
+ }
+ }
+
+ assertThat(atomicBoolean.get()).isTrue()
+
+ runOnIdleCompose {
+ switch = false
+ }
+ waitForIdle()
+
+ assertThat(atomicBoolean.get()).isFalse()
+ }
+}
diff --git a/ui/ui-test/src/androidTest/java/androidx/ui/test/SendClickTest.kt b/ui/ui-test/src/androidTest/java/androidx/ui/test/gesturescope/SendClickTest.kt
similarity index 68%
rename from ui/ui-test/src/androidTest/java/androidx/ui/test/SendClickTest.kt
rename to ui/ui-test/src/androidTest/java/androidx/ui/test/gesturescope/SendClickTest.kt
index 143c07b..ab9d3c3 100644
--- a/ui/ui-test/src/androidTest/java/androidx/ui/test/SendClickTest.kt
+++ b/ui/ui-test/src/androidTest/java/androidx/ui/test/gesturescope/SendClickTest.kt
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package androidx.ui.test
+package androidx.ui.test.gesturescope
import android.os.Bundle
import android.view.Gravity
@@ -24,21 +24,20 @@
import androidx.compose.Recomposer
import androidx.test.filters.MediumTest
import androidx.test.rule.ActivityTestRule
-import androidx.ui.core.DensityAmbient
-import androidx.ui.core.PointerEventPass
-import androidx.ui.core.PointerInputChange
-import androidx.ui.core.TestTag
import androidx.ui.core.changedToUp
import androidx.ui.core.pointerinput.PointerInputFilter
import androidx.ui.core.pointerinput.PointerInputModifier
import androidx.ui.core.setContent
-import androidx.ui.foundation.Box
import androidx.ui.graphics.Color
import androidx.ui.layout.Column
-import androidx.ui.layout.preferredSize
-import androidx.ui.semantics.Semantics
import androidx.ui.test.android.AndroidComposeTestRule
-import androidx.ui.unit.IntPxSize
+import androidx.ui.test.doGesture
+import androidx.ui.test.findByTag
+import androidx.ui.test.runOnIdleCompose
+import androidx.ui.test.runOnUiThread
+import androidx.ui.test.sendClick
+import androidx.ui.test.util.ClickableTestBox
+import androidx.ui.test.util.RecordingFilter
import androidx.ui.unit.PxPosition
import androidx.ui.unit.px
import com.google.common.truth.Truth.assertThat
@@ -60,6 +59,17 @@
val position: PxPosition
)
+private class ClickRecorder(
+ private val componentIndex: Int,
+ private val recordedClicks: MutableList<ClickData>
+) : PointerInputModifier {
+ override val pointerInputFilter: PointerInputFilter = RecordingFilter {
+ if (it.changedToUp()) {
+ recordedClicks.add(ClickData(componentIndex, it.current.position!!))
+ }
+ }
+}
+
// The presence of an ActionBar follows from the theme set in AndroidManifest.xml
class ActivityWithActionBar : ComponentActivity() {
private lateinit var composeHolder: FrameLayout
@@ -83,58 +93,28 @@
}
}
-private fun <T : ComponentActivity> AndroidComposeTestRule<T>.setContent(
- recordedClicks: MutableList<ClickData>
-) {
+private fun AndroidComposeTestRule<*>.setContent(recordedClicks: MutableList<ClickData>) {
+ val content = @Composable {
+ Column {
+ repeat(numberOfSquares) { i ->
+ ClickableTestBox(
+ modifier = ClickRecorder(i, recordedClicks),
+ width = squareSize,
+ height = squareSize,
+ color = colors[i],
+ tag = "$tag$i"
+ )
+ }
+ }
+ }
+
val activity = activityTestRule.activity
if (activity is ActivityWithActionBar) {
runOnUiThread {
- activity.setContent { Ui(recordedClicks) }
+ activity.setContent(content)
}
} else {
- setContent { Ui(recordedClicks) }
- }
-}
-
-@Composable
-private fun Ui(recordedClicks: MutableList<ClickData>) {
- with(DensityAmbient.current) {
- Column {
- for (i in first..last) {
- TestTag(tag = "$tag$i") {
- Semantics(container = true) {
- val pointerInputModifier =
- object : PointerInputModifier {
- override val pointerInputFilter = object : PointerInputFilter() {
- override fun onPointerInput(
- changes: List<PointerInputChange>,
- pass: PointerEventPass,
- bounds: IntPxSize
- ): List<PointerInputChange> {
- if (pass == PointerEventPass.InitialDown) {
- changes.filter { it.changedToUp() }.forEach {
- recordedClicks.add(
- ClickData(i, it.current.position!!)
- )
- }
- }
- return changes
- }
-
- override fun onCancel() {
- // Do nothing
- }
- }
- }
- squareSize.toDp()
- Box(
- pointerInputModifier.preferredSize(squareSize.toDp()),
- backgroundColor = colors[i]
- )
- }
- }
- }
- }
+ setContent(content)
}
}
@@ -167,8 +147,8 @@
composeTestRule.setContent(recordedClicks)
// When I click each of the components
- findByTag("${tag}$first").doGesture { sendClick() }
- findByTag("${tag}$last").doGesture { sendClick() }
+ findByTag("$tag$first").doGesture { sendClick() }
+ findByTag("$tag$last").doGesture { sendClick() }
// Then each component has registered a click
runOnIdleCompose {
@@ -218,8 +198,8 @@
composeTestRule.setContent(recordedClicks)
// When I click each of the components
- findByTag("${tag}$first").doGesture { sendClick(config.position) }
- findByTag("${tag}$last").doGesture { sendClick(config.position) }
+ findByTag("$tag$first").doGesture { sendClick(config.position) }
+ findByTag("$tag$last").doGesture { sendClick(config.position) }
// Then each component has registered a click
runOnIdleCompose {
diff --git a/ui/ui-test/src/androidTest/java/androidx/ui/test/SendDoubleClickTest.kt b/ui/ui-test/src/androidTest/java/androidx/ui/test/gesturescope/SendDoubleClickTest.kt
similarity index 77%
rename from ui/ui-test/src/androidTest/java/androidx/ui/test/SendDoubleClickTest.kt
rename to ui/ui-test/src/androidTest/java/androidx/ui/test/gesturescope/SendDoubleClickTest.kt
index b356638..049380a 100644
--- a/ui/ui-test/src/androidTest/java/androidx/ui/test/SendDoubleClickTest.kt
+++ b/ui/ui-test/src/androidTest/java/androidx/ui/test/gesturescope/SendDoubleClickTest.kt
@@ -14,24 +14,20 @@
* limitations under the License.
*/
-package androidx.ui.test
+package androidx.ui.test.gesturescope
-import androidx.compose.Composable
import androidx.test.filters.MediumTest
-import androidx.ui.core.DensityAmbient
import androidx.ui.core.Modifier
-import androidx.ui.core.TestTag
import androidx.ui.core.gesture.doubleTapGestureFilter
-import androidx.ui.core.pointerinput.PointerInputModifier
-import androidx.ui.foundation.Box
-import androidx.ui.graphics.Color
-import androidx.ui.layout.Stack
-import androidx.ui.layout.preferredSize
-import androidx.ui.semantics.Semantics
import androidx.ui.test.android.AndroidInputDispatcher
+import androidx.ui.test.createComposeRule
+import androidx.ui.test.doGesture
+import androidx.ui.test.findByTag
+import androidx.ui.test.runOnIdleCompose
+import androidx.ui.test.sendDoubleClick
+import androidx.ui.test.util.ClickableTestBox
import androidx.ui.test.util.PointerInputRecorder
import androidx.ui.test.util.assertTimestampsAreIncreasing
-import androidx.ui.unit.Px
import androidx.ui.unit.PxPosition
import androidx.ui.unit.milliseconds
import androidx.ui.unit.px
@@ -45,27 +41,8 @@
private val width = 200.px
private val height = 200.px
private val expectedDelay = 145.milliseconds
-
private const val tag = "widget"
-@Composable
-private fun Ui(onDoubleTap: (PxPosition) -> Unit, pointerInputRecorder: PointerInputModifier) {
- Stack {
- TestTag(tag) {
- Semantics(container = true) {
- with(DensityAmbient.current) {
- Box(
- Modifier.doubleTapGestureFilter(onDoubleTap)
- .plus(pointerInputRecorder)
- .preferredSize(width.toDp(), height.toDp()),
- backgroundColor = Color.Yellow
- )
- }
- }
- }
- }
-}
-
@MediumTest
class SendDoubleClickWithoutArgumentsTest {
@@ -90,13 +67,18 @@
// Given some content
recorder = PointerInputRecorder()
composeTestRule.setContent {
- Ui(onDoubleTap = this::recordDoubleClick, pointerInputRecorder = recorder)
+ ClickableTestBox(
+ Modifier.doubleTapGestureFilter(this::recordDoubleClick).plus(recorder),
+ width = width,
+ height = height,
+ tag = tag
+ )
}
// When we inject a double click
findByTag(tag).doGesture { sendDoubleClick() }
- runOnUiThread {
+ runOnIdleCompose {
// Then we record 1 double click
assertThat(recordedDoubleClicks).hasSize(1)
// at the expected position
@@ -121,12 +103,7 @@
@MediumTest
@RunWith(Parameterized::class)
class SendDoubleClickWithArgumentsTest(private val config: TestConfig) {
- data class TestConfig(
- val x: Px,
- val y: Px
- ) {
- val position get() = PxPosition(x, y)
- }
+ data class TestConfig(val position: PxPosition)
companion object {
@JvmStatic
@@ -135,15 +112,13 @@
return mutableListOf<TestConfig>().apply {
for (x in listOf(1.px, 33.px, 99.px)) {
for (y in listOf(1.px, 33.px, 99.px)) {
- add(TestConfig(x, y))
+ add(TestConfig(PxPosition(x, y)))
}
}
}
}
}
- private val tag = "widget"
-
@get:Rule
val composeTestRule = createComposeRule(disableTransitions = true)
@@ -152,7 +127,7 @@
disableDispatchInRealTime = true
)
- private lateinit var recorder: PointerInputRecorder
+ private val recorder = PointerInputRecorder()
private val recordedDoubleClicks = mutableListOf<PxPosition>()
private val expectedClickPosition = config.position
@@ -163,15 +138,19 @@
@Test
fun testDoubleClickOnPosition() {
// Given some content
- recorder = PointerInputRecorder()
composeTestRule.setContent {
- Ui(onDoubleTap = this::recordDoubleClick, pointerInputRecorder = recorder)
+ ClickableTestBox(
+ Modifier.doubleTapGestureFilter(this::recordDoubleClick).plus(recorder),
+ width = width,
+ height = height,
+ tag = tag
+ )
}
// When we inject a double click
findByTag(tag).doGesture { sendDoubleClick(config.position) }
- runOnUiThread {
+ runOnIdleCompose {
// Then we record 1 double click
assertThat(recordedDoubleClicks).hasSize(1)
// at the expected position
diff --git a/ui/ui-test/src/androidTest/java/androidx/ui/test/SendLongClickTest.kt b/ui/ui-test/src/androidTest/java/androidx/ui/test/gesturescope/SendLongClickTest.kt
similarity index 78%
rename from ui/ui-test/src/androidTest/java/androidx/ui/test/SendLongClickTest.kt
rename to ui/ui-test/src/androidTest/java/androidx/ui/test/gesturescope/SendLongClickTest.kt
index e7b21a7..87d315f7 100644
--- a/ui/ui-test/src/androidTest/java/androidx/ui/test/SendLongClickTest.kt
+++ b/ui/ui-test/src/androidTest/java/androidx/ui/test/gesturescope/SendLongClickTest.kt
@@ -14,23 +14,22 @@
* limitations under the License.
*/
-package androidx.ui.test
+package androidx.ui.test.gesturescope
-import androidx.compose.Composable
import androidx.test.filters.MediumTest
import androidx.ui.core.Alignment
-import androidx.ui.core.DensityAmbient
import androidx.ui.core.Modifier
-import androidx.ui.core.TestTag
-import androidx.ui.core.gesture.longPressGestureFilter
import androidx.ui.core.gesture.LongPressTimeout
-import androidx.ui.foundation.Box
-import androidx.ui.graphics.Color
+import androidx.ui.core.gesture.longPressGestureFilter
import androidx.ui.layout.Stack
import androidx.ui.layout.fillMaxSize
-import androidx.ui.layout.preferredSize
import androidx.ui.layout.wrapContentSize
-import androidx.ui.semantics.Semantics
+import androidx.ui.test.createComposeRule
+import androidx.ui.test.doGesture
+import androidx.ui.test.findByTag
+import androidx.ui.test.runOnIdleCompose
+import androidx.ui.test.sendLongClick
+import androidx.ui.test.util.ClickableTestBox
import androidx.ui.test.util.PointerInputRecorder
import androidx.ui.test.util.areAlmostEqualTo
import androidx.ui.test.util.assertOnlyLastEventIsUp
@@ -51,26 +50,8 @@
private val height = 100.px
private val expectedDuration = LongPressTimeout + 100.milliseconds
-@Composable
-private fun Ui(recorder: PointerInputRecorder, onLongPress: (PxPosition) -> Unit) {
- Stack(Modifier.fillMaxSize().wrapContentSize(Alignment.BottomEnd)) {
- TestTag(tag) {
- Semantics(container = true) {
- with(DensityAmbient.current) {
- Box(
- Modifier.longPressGestureFilter(onLongPress)
- .plus(recorder)
- .preferredSize(width.toDp(), height.toDp()),
- backgroundColor = Color.Yellow
- )
- }
- }
- }
- }
-}
-
/**
- * Tests [GestureScope.sendLongClick] without arguments. Verifies that the click is in the middle
+ * Tests [sendLongClick] without arguments. Verifies that the click is in the middle
* of the component, that the gesture has a duration of 600 milliseconds and that all input
* events were on the same location.
*/
@@ -92,7 +73,16 @@
@Test
fun testLongClick() {
// Given some content
- composeTestRule.setContent { Ui(recorder, ::recordLongPress) }
+ composeTestRule.setContent {
+ Stack(Modifier.fillMaxSize().wrapContentSize(Alignment.BottomEnd)) {
+ ClickableTestBox(
+ modifier = Modifier.longPressGestureFilter(::recordLongPress).plus(recorder),
+ width = width,
+ height = height,
+ tag = tag
+ )
+ }
+ }
// When we inject a long click
findByTag(tag).doGesture { sendLongClick() }
@@ -101,7 +91,7 @@
assertThat(recordedLongClicks).hasSize(1)
// And all events are at the click location
- runOnUiThread {
+ runOnIdleCompose {
recorder.run {
assertTimestampsAreIncreasing()
assertOnlyLastEventIsUp()
@@ -113,7 +103,7 @@
}
/**
- * Tests [GestureScope.sendLongClick] with arguments. Verifies that the click is in the middle
+ * Tests [sendLongClick] with arguments. Verifies that the click is in the middle
* of the component, that the gesture has a duration of 600 milliseconds and that all input
* events were on the same location.
*/
@@ -151,7 +141,16 @@
@Test
fun testLongClick() {
// Given some content
- composeTestRule.setContent { Ui(recorder, ::recordLongPress) }
+ composeTestRule.setContent {
+ Stack(Modifier.fillMaxSize().wrapContentSize(Alignment.BottomEnd)) {
+ ClickableTestBox(
+ modifier = Modifier.longPressGestureFilter(::recordLongPress).plus(recorder),
+ width = width,
+ height = height,
+ tag = tag
+ )
+ }
+ }
// When we inject a long click
findByTag(tag).doGesture { sendLongClick(config.position) }
@@ -160,7 +159,7 @@
assertThat(recordedLongClicks).hasSize(1)
// And all events are at the click location
- runOnUiThread {
+ runOnIdleCompose {
recorder.run {
assertTimestampsAreIncreasing()
assertOnlyLastEventIsUp()
diff --git a/ui/ui-test/src/androidTest/java/androidx/ui/test/SendSwipeTest.kt b/ui/ui-test/src/androidTest/java/androidx/ui/test/gesturescope/SendSwipeTest.kt
similarity index 80%
rename from ui/ui-test/src/androidTest/java/androidx/ui/test/SendSwipeTest.kt
rename to ui/ui-test/src/androidTest/java/androidx/ui/test/gesturescope/SendSwipeTest.kt
index 8bdb5e9..c701ed9 100644
--- a/ui/ui-test/src/androidTest/java/androidx/ui/test/SendSwipeTest.kt
+++ b/ui/ui-test/src/androidTest/java/androidx/ui/test/gesturescope/SendSwipeTest.kt
@@ -14,27 +14,29 @@
* limitations under the License.
*/
-package androidx.ui.test
+package androidx.ui.test.gesturescope
import androidx.compose.Composable
import androidx.test.filters.MediumTest
import androidx.ui.core.Alignment
import androidx.ui.core.Modifier
-import androidx.ui.foundation.Box
-import androidx.ui.graphics.Color
import androidx.ui.layout.Stack
import androidx.ui.layout.fillMaxSize
-import androidx.ui.layout.preferredSize
import androidx.ui.layout.wrapContentSize
-import androidx.ui.semantics.Semantics
-import androidx.ui.semantics.testTag
+import androidx.ui.test.createComposeRule
+import androidx.ui.test.doGesture
+import androidx.ui.test.findByTag
+import androidx.ui.test.runOnIdleCompose
+import androidx.ui.test.sendSwipeDown
+import androidx.ui.test.sendSwipeLeft
+import androidx.ui.test.sendSwipeRight
+import androidx.ui.test.sendSwipeUp
+import androidx.ui.test.util.ClickableTestBox
import androidx.ui.test.util.PointerInputRecorder
import androidx.ui.test.util.assertOnlyLastEventIsUp
import androidx.ui.test.util.assertTimestampsAreIncreasing
-import androidx.ui.unit.dp
import com.google.common.collect.Ordering
import com.google.common.truth.Truth.assertThat
-import org.junit.Before
import org.junit.Rule
import org.junit.Test
import org.junit.runner.RunWith
@@ -49,30 +51,20 @@
@get:Rule
val composeTestRule = createComposeRule(disableTransitions = true)
- private lateinit var recorder: PointerInputRecorder
-
- @Before
- fun setup() {
- recorder = PointerInputRecorder()
- }
+ private val recorder = PointerInputRecorder()
@Composable
- fun Ui(alignment: Modifier) {
- Stack(Modifier.fillMaxSize() + alignment) {
- Semantics(container = true, properties = { testTag = tag }) {
- Box(
- recorder.preferredSize(100.dp),
- backgroundColor = Color.Yellow
- )
- }
+ fun Ui(alignment: Alignment) {
+ Stack(Modifier.fillMaxSize().wrapContentSize(alignment)) {
+ ClickableTestBox(modifier = recorder, tag = tag)
}
}
@Test
fun swipeUp() {
- composeTestRule.setContent { Ui(Modifier.wrapContentSize(Alignment.TopStart)) }
+ composeTestRule.setContent { Ui(Alignment.TopStart) }
findByTag(tag).doGesture { sendSwipeUp() }
- runOnUiThread {
+ runOnIdleCompose {
recorder.run {
assertTimestampsAreIncreasing()
assertOnlyLastEventIsUp()
@@ -83,9 +75,9 @@
@Test
fun swipeDown() {
- composeTestRule.setContent { Ui(Modifier.wrapContentSize(Alignment.TopEnd)) }
+ composeTestRule.setContent { Ui(Alignment.TopEnd) }
findByTag(tag).doGesture { sendSwipeDown() }
- runOnUiThread {
+ runOnIdleCompose {
recorder.run {
assertTimestampsAreIncreasing()
assertOnlyLastEventIsUp()
@@ -96,9 +88,9 @@
@Test
fun swipeLeft() {
- composeTestRule.setContent { Ui(Modifier.wrapContentSize(Alignment.BottomEnd)) }
+ composeTestRule.setContent { Ui(Alignment.BottomEnd) }
findByTag(tag).doGesture { sendSwipeLeft() }
- runOnUiThread {
+ runOnIdleCompose {
recorder.run {
assertTimestampsAreIncreasing()
assertOnlyLastEventIsUp()
@@ -109,9 +101,9 @@
@Test
fun swipeRight() {
- composeTestRule.setContent { Ui(Modifier.wrapContentSize(Alignment.BottomStart)) }
+ composeTestRule.setContent { Ui(Alignment.BottomStart) }
findByTag(tag).doGesture { sendSwipeRight() }
- runOnUiThread {
+ runOnIdleCompose {
recorder.run {
assertTimestampsAreIncreasing()
assertOnlyLastEventIsUp()
diff --git a/ui/ui-test/src/androidTest/java/androidx/ui/test/SendSwipeVelocityTest.kt b/ui/ui-test/src/androidTest/java/androidx/ui/test/gesturescope/SendSwipeVelocityTest.kt
similarity index 68%
rename from ui/ui-test/src/androidTest/java/androidx/ui/test/SendSwipeVelocityTest.kt
rename to ui/ui-test/src/androidTest/java/androidx/ui/test/gesturescope/SendSwipeVelocityTest.kt
index 7836d19..ef42a73 100644
--- a/ui/ui-test/src/androidTest/java/androidx/ui/test/SendSwipeVelocityTest.kt
+++ b/ui/ui-test/src/androidTest/java/androidx/ui/test/gesturescope/SendSwipeVelocityTest.kt
@@ -14,25 +14,21 @@
* limitations under the License.
*/
-package androidx.ui.test
+package androidx.ui.test.gesturescope
-import androidx.compose.Composable
-import androidx.compose.remember
import androidx.test.filters.MediumTest
import androidx.ui.core.Alignment
-import androidx.ui.core.DensityAmbient
import androidx.ui.core.Modifier
-import androidx.ui.foundation.Canvas
-import androidx.ui.geometry.Rect
-import androidx.ui.graphics.Color
-import androidx.ui.graphics.Paint
import androidx.ui.layout.Stack
import androidx.ui.layout.fillMaxSize
-import androidx.ui.layout.preferredSize
import androidx.ui.layout.wrapContentSize
-import androidx.ui.semantics.Semantics
-import androidx.ui.semantics.testTag
import androidx.ui.test.android.AndroidInputDispatcher
+import androidx.ui.test.createComposeRule
+import androidx.ui.test.doGesture
+import androidx.ui.test.findByTag
+import androidx.ui.test.runOnIdleCompose
+import androidx.ui.test.sendSwipeWithVelocity
+import androidx.ui.test.util.ClickableTestBox
import androidx.ui.test.util.PointerInputRecorder
import androidx.ui.test.util.assertOnlyLastEventIsUp
import androidx.ui.test.util.assertTimestampsAreIncreasing
@@ -46,7 +42,6 @@
import androidx.ui.unit.inMilliseconds
import androidx.ui.unit.px
import com.google.common.truth.Truth.assertThat
-import org.junit.Before
import org.junit.Rule
import org.junit.Test
import org.junit.rules.TestRule
@@ -67,16 +62,11 @@
val eventPeriod: Long
)
- enum class Direction(
- val x0: (Rect) -> Float,
- val y0: (Rect) -> Float,
- val x1: (Rect) -> Float,
- val y1: (Rect) -> Float
- ) {
- LeftToRight({ it.left + 1 }, ::hmiddle, { it.right - 1 }, ::hmiddle),
- RightToLeft({ it.right - 1 }, ::hmiddle, { it.left + 1 }, ::hmiddle),
- TopToBottom(::vmiddle, { it.top + 1 }, ::vmiddle, { it.bottom - 1 }),
- BottomToTop(::vmiddle, { it.bottom - 1 }, ::vmiddle, { it.top + 1 })
+ enum class Direction(val from: PxPosition, val to: PxPosition) {
+ LeftToRight(PxPosition(boxStart, boxMiddle), PxPosition(boxEnd, boxMiddle)),
+ RightToLeft(PxPosition(boxEnd, boxMiddle), PxPosition(boxStart, boxMiddle)),
+ TopToBottom(PxPosition(boxMiddle, boxStart), PxPosition(boxMiddle, boxEnd)),
+ BottomToTop(PxPosition(boxMiddle, boxEnd), PxPosition(boxMiddle, boxStart))
}
companion object {
@@ -103,18 +93,16 @@
}
}
- private fun hmiddle(bounds: Rect): Float = (bounds.left + bounds.right) / 2
- private fun vmiddle(bounds: Rect): Float = (bounds.top + bounds.bottom) / 2
-
private const val tag = "widget"
+
+ private val boxSize = 500.px
+ private val boxStart = 1.px
+ private val boxMiddle = boxSize / 2
+ private val boxEnd = boxSize - 1.px
}
- private val x0 get() = config.direction.x0(bounds)
- private val y0 get() = config.direction.y0(bounds)
- private val x1 get() = config.direction.x1(bounds)
- private val y1 get() = config.direction.y1(bounds)
- private val start get() = PxPosition(x0.px, y0.px)
- private val end get() = PxPosition(x1.px, y1.px)
+ private val start get() = config.direction.from
+ private val end get() = config.direction.to
private val duration get() = config.duration
private val velocity get() = config.velocity
private val eventPeriod get() = config.eventPeriod
@@ -140,34 +128,21 @@
eventPeriodOverride = eventPeriod
)
- private lateinit var recorder: PointerInputRecorder
- private lateinit var bounds: Rect
-
- @Before
- fun setUp() {
- recorder = PointerInputRecorder()
- }
-
- @Composable
- fun Ui() {
- val paint = remember { Paint().apply { color = Color.Yellow } }
- Stack(Modifier.fillMaxSize().wrapContentSize(Alignment.BottomEnd)) {
- Semantics(container = true, properties = { testTag = tag }) {
- with(DensityAmbient.current) {
- Canvas(recorder.preferredSize(500.px.toDp())) {
- bounds = Rect(0f, 0f, size.width.value, size.height.value)
- drawRect(bounds, paint)
- }
- }
- }
- }
- }
+ private val recorder = PointerInputRecorder()
@Test
fun swipeWithVelocity() {
- composeTestRule.setContent { Ui() }
- findByTag(tag).doGesture { sendSwipeWithVelocity(start, end, velocity, duration) }
- runOnUiThread {
+ composeTestRule.setContent {
+ Stack(Modifier.fillMaxSize().wrapContentSize(Alignment.BottomEnd)) {
+ ClickableTestBox(recorder, boxSize, boxSize, tag = tag)
+ }
+ }
+
+ findByTag(tag).doGesture {
+ sendSwipeWithVelocity(start, end, velocity, duration)
+ }
+
+ runOnIdleCompose {
recorder.run {
val durationMs = duration.inMilliseconds()
val minimumEventSize = max(2, (durationMs / eventPeriod).toInt())
diff --git a/ui/ui-test/src/androidTest/java/androidx/ui/test/AndroidInputDispatcherDelayTest.kt b/ui/ui-test/src/androidTest/java/androidx/ui/test/inputdispatcher/DelayTest.kt
similarity index 91%
rename from ui/ui-test/src/androidTest/java/androidx/ui/test/AndroidInputDispatcherDelayTest.kt
rename to ui/ui-test/src/androidTest/java/androidx/ui/test/inputdispatcher/DelayTest.kt
index 08ef615..c792d9b 100644
--- a/ui/ui-test/src/androidTest/java/androidx/ui/test/AndroidInputDispatcherDelayTest.kt
+++ b/ui/ui-test/src/androidTest/java/androidx/ui/test/inputdispatcher/DelayTest.kt
@@ -14,11 +14,12 @@
* limitations under the License.
*/
-package androidx.ui.test
+package androidx.ui.test.inputdispatcher
import android.view.MotionEvent.ACTION_DOWN
import android.view.MotionEvent.ACTION_UP
import androidx.test.filters.SmallTest
+import androidx.ui.test.InputDispatcher
import androidx.ui.test.android.AndroidInputDispatcher
import androidx.ui.test.util.MotionEventRecorder
import androidx.ui.unit.Duration
@@ -27,7 +28,6 @@
import androidx.ui.unit.milliseconds
import com.google.common.truth.Truth.assertThat
import org.junit.After
-import org.junit.Before
import org.junit.Rule
import org.junit.Test
import org.junit.rules.TestRule
@@ -42,7 +42,7 @@
*/
@SmallTest
@RunWith(Parameterized::class)
-class AndroidInputDispatcherDelayTest(private val config: TestConfig) {
+class DelayTest(private val config: TestConfig) {
data class TestConfig(
val firstDelay: Duration,
val secondDelay: Duration,
@@ -53,7 +53,12 @@
enum class Gesture(internal val function: (InputDispatcher) -> Unit) {
Click({ it.sendClick(anyPosition) }),
- Swipe({ it.sendSwipe(anyPosition, anyPosition, 100.milliseconds) })
+ Swipe({ it.sendSwipe(anyPosition, anyPosition, 100.milliseconds) }),
+ Partial({
+ val token = it.sendDown(anyPosition)
+ it.sendMove(token, anyPosition)
+ it.sendUp(token, anyPosition)
+ })
}
companion object {
@@ -89,14 +94,8 @@
disableDispatchInRealTime = true
)
- private lateinit var recorder: MotionEventRecorder
- private lateinit var subject: AndroidInputDispatcher
-
- @Before
- fun setUp() {
- recorder = MotionEventRecorder()
- subject = AndroidInputDispatcher(recorder::sendEvent)
- }
+ private val recorder = MotionEventRecorder()
+ private val subject = AndroidInputDispatcher(recorder::sendEvent)
@After
fun tearDown() {
diff --git a/ui/ui-test/src/androidTest/java/androidx/ui/test/inputdispatcher/SendCancelTest.kt b/ui/ui-test/src/androidTest/java/androidx/ui/test/inputdispatcher/SendCancelTest.kt
new file mode 100644
index 0000000..711ecb1
--- /dev/null
+++ b/ui/ui-test/src/androidTest/java/androidx/ui/test/inputdispatcher/SendCancelTest.kt
@@ -0,0 +1,126 @@
+/*
+ * Copyright 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT 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.ui.test.inputdispatcher
+
+import android.view.MotionEvent
+import androidx.test.filters.SmallTest
+import androidx.ui.test.android.AndroidInputDispatcher
+import androidx.ui.test.util.MotionEventRecorder
+import androidx.ui.test.util.assertHasValidEventTimes
+import androidx.ui.test.util.expectError
+import androidx.ui.test.util.verify
+import androidx.ui.unit.PxPosition
+import androidx.ui.unit.px
+import com.google.common.truth.Truth.assertThat
+import org.junit.After
+import org.junit.Rule
+import org.junit.Test
+import org.junit.rules.TestRule
+import org.junit.runner.RunWith
+import org.junit.runners.Parameterized
+
+/**
+ * Tests if the [AndroidInputDispatcher.sendCancel] gesture works.
+ */
+@SmallTest
+@RunWith(Parameterized::class)
+class SendCancelTest(config: TestConfig) {
+ data class TestConfig(
+ val x: Float,
+ val y: Float
+ )
+
+ companion object {
+ private const val eventPeriod = 10L
+ private val downPosition = PxPosition(5.px, 5.px)
+
+ @JvmStatic
+ @Parameterized.Parameters(name = "{0}")
+ fun createTestSet(): List<TestConfig> {
+ return listOf(0f, 10f).flatMap { x ->
+ listOf(0f, -10f).map { y ->
+ TestConfig(x, y)
+ }
+ }.plus(TestConfig(downPosition.x.value, downPosition.y.value))
+ }
+ }
+
+ @get:Rule
+ val inputDispatcherRule: TestRule = AndroidInputDispatcher.TestRule(
+ disableDispatchInRealTime = true
+ )
+
+ private val position = PxPosition(config.x.px, config.y.px)
+
+ private val recorder = MotionEventRecorder()
+ private val subject = AndroidInputDispatcher(recorder::sendEvent)
+
+ @After
+ fun tearDown() {
+ recorder.clear()
+ }
+
+ @Test
+ fun testSendCancel() {
+ val token = subject.sendDown(downPosition)
+ subject.sendCancel(token, position)
+ recorder.assertHasValidEventTimes()
+ recorder.events.apply {
+ assertThat(size).isEqualTo(2)
+ first().verify(downPosition, MotionEvent.ACTION_DOWN, 0)
+ last().verify(position, MotionEvent.ACTION_CANCEL, eventPeriod)
+ }
+ assertThat(token.lastPosition).isEqualTo(position)
+ assertThat(token.eventTime - token.downTime).isEqualTo(eventPeriod)
+ assertThat(token.finished).isTrue()
+ }
+}
+
+/**
+ * Tests if the [AndroidInputDispatcher.sendCancel] gesture throws after
+ * [AndroidInputDispatcher.sendUp] or [AndroidInputDispatcher.sendCancel] has been called.
+ */
+@SmallTest
+class SendCancelAfterFinishedTest {
+ private val downPosition = PxPosition(5.px, 5.px)
+ private val position = PxPosition(1.px, 1.px)
+
+ @get:Rule
+ val inputDispatcherRule: TestRule = AndroidInputDispatcher.TestRule(
+ disableDispatchInRealTime = true
+ )
+
+ private val subject = AndroidInputDispatcher {}
+
+ @Test
+ fun testCancelAfterUp() {
+ val token = subject.sendDown(downPosition)
+ subject.sendUp(token, downPosition)
+ expectError<IllegalArgumentException> {
+ subject.sendCancel(token, position)
+ }
+ }
+
+ @Test
+ fun testCancelAfterCancel() {
+ val token = subject.sendDown(downPosition)
+ subject.sendCancel(token, downPosition)
+ expectError<IllegalArgumentException> {
+ subject.sendCancel(token, position)
+ }
+ }
+}
diff --git a/ui/ui-test/src/androidTest/java/androidx/ui/test/AndroidInputDispatcherSendClickTest.kt b/ui/ui-test/src/androidTest/java/androidx/ui/test/inputdispatcher/SendClickTest.kt
similarity index 86%
rename from ui/ui-test/src/androidTest/java/androidx/ui/test/AndroidInputDispatcherSendClickTest.kt
rename to ui/ui-test/src/androidTest/java/androidx/ui/test/inputdispatcher/SendClickTest.kt
index e26e46c..d8ab709 100644
--- a/ui/ui-test/src/androidTest/java/androidx/ui/test/AndroidInputDispatcherSendClickTest.kt
+++ b/ui/ui-test/src/androidTest/java/androidx/ui/test/inputdispatcher/SendClickTest.kt
@@ -14,19 +14,18 @@
* limitations under the License.
*/
-package androidx.ui.test
+package androidx.ui.test.inputdispatcher
import android.view.MotionEvent
import androidx.test.filters.SmallTest
-import androidx.ui.unit.PxPosition
-import androidx.ui.unit.px
import androidx.ui.test.android.AndroidInputDispatcher
import androidx.ui.test.util.MotionEventRecorder
import androidx.ui.test.util.assertHasValidEventTimes
import androidx.ui.test.util.verify
+import androidx.ui.unit.PxPosition
+import androidx.ui.unit.px
import com.google.common.truth.Truth.assertThat
import org.junit.After
-import org.junit.Before
import org.junit.Rule
import org.junit.Test
import org.junit.rules.TestRule
@@ -38,7 +37,7 @@
*/
@SmallTest
@RunWith(Parameterized::class)
-class AndroidInputDispatcherSendClickTest(config: TestConfig) {
+class SendClickTest(config: TestConfig) {
data class TestConfig(
val x: Float,
val y: Float
@@ -64,14 +63,8 @@
private val eventPeriod = 10L
private val position = PxPosition(config.x.px, config.y.px)
- private lateinit var recorder: MotionEventRecorder
- private lateinit var subject: AndroidInputDispatcher
-
- @Before
- fun setUp() {
- recorder = MotionEventRecorder()
- subject = AndroidInputDispatcher(recorder::sendEvent)
- }
+ private val recorder = MotionEventRecorder()
+ private val subject = AndroidInputDispatcher(recorder::sendEvent)
@After
fun tearDown() {
diff --git a/ui/ui-test/src/androidTest/java/androidx/ui/test/AndroidInputDispatcherSendClickTest.kt b/ui/ui-test/src/androidTest/java/androidx/ui/test/inputdispatcher/SendDownTest.kt
similarity index 69%
copy from ui/ui-test/src/androidTest/java/androidx/ui/test/AndroidInputDispatcherSendClickTest.kt
copy to ui/ui-test/src/androidTest/java/androidx/ui/test/inputdispatcher/SendDownTest.kt
index e26e46c..dd6eef6 100644
--- a/ui/ui-test/src/androidTest/java/androidx/ui/test/AndroidInputDispatcherSendClickTest.kt
+++ b/ui/ui-test/src/androidTest/java/androidx/ui/test/inputdispatcher/SendDownTest.kt
@@ -1,5 +1,5 @@
/*
- * Copyright 2019 The Android Open Source Project
+ * Copyright 2020 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -14,19 +14,18 @@
* limitations under the License.
*/
-package androidx.ui.test
+package androidx.ui.test.inputdispatcher
import android.view.MotionEvent
import androidx.test.filters.SmallTest
-import androidx.ui.unit.PxPosition
-import androidx.ui.unit.px
import androidx.ui.test.android.AndroidInputDispatcher
import androidx.ui.test.util.MotionEventRecorder
import androidx.ui.test.util.assertHasValidEventTimes
import androidx.ui.test.util.verify
+import androidx.ui.unit.PxPosition
+import androidx.ui.unit.px
import com.google.common.truth.Truth.assertThat
import org.junit.After
-import org.junit.Before
import org.junit.Rule
import org.junit.Test
import org.junit.rules.TestRule
@@ -34,11 +33,11 @@
import org.junit.runners.Parameterized
/**
- * Tests if the [AndroidInputDispatcher.sendClick] gesture works
+ * Tests if the [AndroidInputDispatcher.sendDown] gesture works.
*/
@SmallTest
@RunWith(Parameterized::class)
-class AndroidInputDispatcherSendClickTest(config: TestConfig) {
+class SendDownTest(config: TestConfig) {
data class TestConfig(
val x: Float,
val y: Float
@@ -48,8 +47,8 @@
@JvmStatic
@Parameterized.Parameters(name = "{0}")
fun createTestSet(): List<TestConfig> {
- return listOf(0f, 10f, -10f, 1000000f).flatMap { x ->
- listOf(0f, 10f, -10f, 1000000f).map { y ->
+ return listOf(0f, 10f).flatMap { x ->
+ listOf(0f, -10f).map { y ->
TestConfig(x, y)
}
}
@@ -61,17 +60,10 @@
disableDispatchInRealTime = true
)
- private val eventPeriod = 10L
private val position = PxPosition(config.x.px, config.y.px)
- private lateinit var recorder: MotionEventRecorder
- private lateinit var subject: AndroidInputDispatcher
-
- @Before
- fun setUp() {
- recorder = MotionEventRecorder()
- subject = AndroidInputDispatcher(recorder::sendEvent)
- }
+ private val recorder = MotionEventRecorder()
+ private val subject = AndroidInputDispatcher(recorder::sendEvent)
@After
fun tearDown() {
@@ -79,13 +71,16 @@
}
@Test
- fun testClick() {
- subject.sendClick(position)
+ fun testSendDown() {
+ val token = subject.sendDown(position)
+ assertThat(token.eventTime).isEqualTo(token.downTime)
+ assertThat(token.lastPosition).isEqualTo(position)
+ assertThat(token.finished).isFalse()
+
recorder.assertHasValidEventTimes()
recorder.events.apply {
- assertThat(size).isEqualTo(2)
+ assertThat(size).isEqualTo(1)
first().verify(position, MotionEvent.ACTION_DOWN, 0)
- last().verify(position, MotionEvent.ACTION_UP, eventPeriod)
}
}
}
diff --git a/ui/ui-test/src/androidTest/java/androidx/ui/test/inputdispatcher/SendMoveTest.kt b/ui/ui-test/src/androidTest/java/androidx/ui/test/inputdispatcher/SendMoveTest.kt
new file mode 100644
index 0000000..6a5cc38
--- /dev/null
+++ b/ui/ui-test/src/androidTest/java/androidx/ui/test/inputdispatcher/SendMoveTest.kt
@@ -0,0 +1,126 @@
+/*
+ * Copyright 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT 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.ui.test.inputdispatcher
+
+import android.view.MotionEvent
+import androidx.test.filters.SmallTest
+import androidx.ui.test.android.AndroidInputDispatcher
+import androidx.ui.test.util.MotionEventRecorder
+import androidx.ui.test.util.assertHasValidEventTimes
+import androidx.ui.test.util.expectError
+import androidx.ui.test.util.verify
+import androidx.ui.unit.PxPosition
+import androidx.ui.unit.px
+import com.google.common.truth.Truth.assertThat
+import org.junit.After
+import org.junit.Rule
+import org.junit.Test
+import org.junit.rules.TestRule
+import org.junit.runner.RunWith
+import org.junit.runners.Parameterized
+
+/**
+ * Tests if the [AndroidInputDispatcher.sendMove] gesture works.
+ */
+@SmallTest
+@RunWith(Parameterized::class)
+class SendMoveTest(config: TestConfig) {
+ data class TestConfig(
+ val x: Float,
+ val y: Float
+ )
+
+ companion object {
+ private const val eventPeriod = 10L
+ private val downPosition = PxPosition(5.px, 5.px)
+
+ @JvmStatic
+ @Parameterized.Parameters(name = "{0}")
+ fun createTestSet(): List<TestConfig> {
+ return listOf(0f, 10f).flatMap { x ->
+ listOf(0f, -10f).map { y ->
+ TestConfig(x, y)
+ }
+ }.plus(TestConfig(downPosition.x.value, downPosition.y.value))
+ }
+ }
+
+ @get:Rule
+ val inputDispatcherRule: TestRule = AndroidInputDispatcher.TestRule(
+ disableDispatchInRealTime = true
+ )
+
+ private val position = PxPosition(config.x.px, config.y.px)
+
+ private val recorder = MotionEventRecorder()
+ private val subject = AndroidInputDispatcher(recorder::sendEvent)
+
+ @After
+ fun tearDown() {
+ recorder.clear()
+ }
+
+ @Test
+ fun testSendMove() {
+ val token = subject.sendDown(downPosition)
+ subject.sendMove(token, position)
+ recorder.assertHasValidEventTimes()
+ recorder.events.apply {
+ assertThat(size).isEqualTo(2)
+ first().verify(downPosition, MotionEvent.ACTION_DOWN, 0)
+ last().verify(position, MotionEvent.ACTION_MOVE, eventPeriod)
+ }
+ assertThat(token.lastPosition).isEqualTo(position)
+ assertThat(token.eventTime - token.downTime).isEqualTo(eventPeriod)
+ assertThat(token.finished).isFalse()
+ }
+}
+
+/**
+ * Tests if the [AndroidInputDispatcher.sendMove] gesture throws after
+ * [AndroidInputDispatcher.sendUp] or [AndroidInputDispatcher.sendCancel] has been called.
+ */
+@SmallTest
+class SendMoveAfterFinishedTest {
+ private val downPosition = PxPosition(5.px, 5.px)
+ private val position = PxPosition(1.px, 1.px)
+
+ @get:Rule
+ val inputDispatcherRule: TestRule = AndroidInputDispatcher.TestRule(
+ disableDispatchInRealTime = true
+ )
+
+ private val subject = AndroidInputDispatcher {}
+
+ @Test
+ fun testMoveAfterUp() {
+ val token = subject.sendDown(downPosition)
+ subject.sendUp(token, downPosition)
+ expectError<IllegalArgumentException> {
+ subject.sendMove(token, position)
+ }
+ }
+
+ @Test
+ fun testMoveAfterCancel() {
+ val token = subject.sendDown(downPosition)
+ subject.sendCancel(token, downPosition)
+ expectError<IllegalArgumentException> {
+ subject.sendMove(token, position)
+ }
+ }
+}
diff --git a/ui/ui-test/src/androidTest/java/androidx/ui/test/AndroidInputDispatcherSendSwipeFunctionTest.kt b/ui/ui-test/src/androidTest/java/androidx/ui/test/inputdispatcher/SendSwipeFunctionTest.kt
similarity index 94%
rename from ui/ui-test/src/androidTest/java/androidx/ui/test/AndroidInputDispatcherSendSwipeFunctionTest.kt
rename to ui/ui-test/src/androidTest/java/androidx/ui/test/inputdispatcher/SendSwipeFunctionTest.kt
index 3dcc4c2..44ce4c4 100644
--- a/ui/ui-test/src/androidTest/java/androidx/ui/test/AndroidInputDispatcherSendSwipeFunctionTest.kt
+++ b/ui/ui-test/src/androidTest/java/androidx/ui/test/inputdispatcher/SendSwipeFunctionTest.kt
@@ -14,17 +14,12 @@
* limitations under the License.
*/
-package androidx.ui.test
+package androidx.ui.test.inputdispatcher
import android.view.MotionEvent.ACTION_DOWN
import android.view.MotionEvent.ACTION_MOVE
import android.view.MotionEvent.ACTION_UP
import androidx.test.filters.SmallTest
-import androidx.ui.unit.Duration
-import androidx.ui.unit.PxPosition
-import androidx.ui.unit.inMilliseconds
-import androidx.ui.unit.milliseconds
-import androidx.ui.unit.px
import androidx.ui.test.android.AndroidInputDispatcher
import androidx.ui.test.util.MotionEventRecorder
import androidx.ui.test.util.assertHasValidEventTimes
@@ -34,6 +29,11 @@
import androidx.ui.test.util.relativeTime
import androidx.ui.test.util.splitsDurationEquallyInto
import androidx.ui.test.util.verify
+import androidx.ui.unit.Duration
+import androidx.ui.unit.PxPosition
+import androidx.ui.unit.inMilliseconds
+import androidx.ui.unit.milliseconds
+import androidx.ui.unit.px
import com.google.common.truth.Truth.assertThat
import org.junit.After
import org.junit.Before
@@ -108,14 +108,8 @@
disableDispatchInRealTime = true
)
- private lateinit var recorder: MotionEventRecorder
- private lateinit var subject: AndroidInputDispatcher
-
- @Before
- fun setUp() {
- recorder = MotionEventRecorder()
- subject = AndroidInputDispatcher(recorder::sendEvent)
- }
+ private val recorder = MotionEventRecorder()
+ private val subject = AndroidInputDispatcher(recorder::sendEvent)
@After
fun tearDown() {
@@ -194,14 +188,11 @@
disableDispatchInRealTime = true
)
- private lateinit var recorder: MotionEventRecorder
- private lateinit var subject: AndroidInputDispatcher
+ private val recorder = MotionEventRecorder()
+ private val subject = AndroidInputDispatcher(recorder::sendEvent)
@Before
fun setUp() {
- recorder = MotionEventRecorder()
- subject = AndroidInputDispatcher(recorder::sendEvent)
-
require(config.keyTimes.distinct() == config.keyTimes.distinct().sorted()) {
"keyTimes needs to be sorted, not ${config.keyTimes}"
}
@@ -293,14 +284,11 @@
private val keyTimes get() = config.keyTimes
private val eventPeriod = config.eventPeriod
- private lateinit var recorder: MotionEventRecorder
- private lateinit var subject: AndroidInputDispatcher
+ private val recorder = MotionEventRecorder()
+ private val subject = AndroidInputDispatcher(recorder::sendEvent)
@Before
fun setUp() {
- recorder = MotionEventRecorder()
- subject = AndroidInputDispatcher(recorder::sendEvent)
-
require(config.keyTimes.distinct() == config.keyTimes.distinct().sorted()) {
"keyTimes needs to be sorted, not ${config.keyTimes}"
}
diff --git a/ui/ui-test/src/androidTest/java/androidx/ui/test/AndroidInputDispatcherSendSwipeLineTest.kt b/ui/ui-test/src/androidTest/java/androidx/ui/test/inputdispatcher/SendSwipeLineTest.kt
similarity index 89%
rename from ui/ui-test/src/androidTest/java/androidx/ui/test/AndroidInputDispatcherSendSwipeLineTest.kt
rename to ui/ui-test/src/androidTest/java/androidx/ui/test/inputdispatcher/SendSwipeLineTest.kt
index 523a4ef..a91587c 100644
--- a/ui/ui-test/src/androidTest/java/androidx/ui/test/AndroidInputDispatcherSendSwipeLineTest.kt
+++ b/ui/ui-test/src/androidTest/java/androidx/ui/test/inputdispatcher/SendSwipeLineTest.kt
@@ -14,14 +14,10 @@
* limitations under the License.
*/
-package androidx.ui.test
+package androidx.ui.test.inputdispatcher
import android.view.MotionEvent
import androidx.test.filters.SmallTest
-import androidx.ui.unit.Duration
-import androidx.ui.unit.PxPosition
-import androidx.ui.unit.inMilliseconds
-import androidx.ui.unit.px
import androidx.ui.test.android.AndroidInputDispatcher
import androidx.ui.test.util.MotionEventRecorder
import androidx.ui.test.util.assertHasValidEventTimes
@@ -29,9 +25,12 @@
import androidx.ui.test.util.moveEvents
import androidx.ui.test.util.splitsDurationEquallyInto
import androidx.ui.test.util.verify
+import androidx.ui.unit.Duration
+import androidx.ui.unit.PxPosition
+import androidx.ui.unit.inMilliseconds
+import androidx.ui.unit.px
import com.google.common.truth.Truth.assertThat
import org.junit.After
-import org.junit.Before
import org.junit.Rule
import org.junit.Test
import org.junit.rules.TestRule
@@ -48,7 +47,7 @@
*/
@SmallTest
@RunWith(Parameterized::class)
-class AndroidInputDispatcherSendSwipeLineTest(private val config: TestConfig) {
+class SendSwipeLineTest(private val config: TestConfig) {
data class TestConfig(
val duration: Duration,
val eventPeriod: Long
@@ -75,14 +74,8 @@
private val duration get() = config.duration
private val eventPeriod = config.eventPeriod
- private lateinit var recorder: MotionEventRecorder
- private lateinit var subject: AndroidInputDispatcher
-
- @Before
- fun setUp() {
- recorder = MotionEventRecorder()
- subject = AndroidInputDispatcher(recorder::sendEvent)
- }
+ private val recorder = MotionEventRecorder()
+ private val subject = AndroidInputDispatcher(recorder::sendEvent)
@After
fun tearDown() {
diff --git a/ui/ui-test/src/androidTest/java/androidx/ui/test/inputdispatcher/SendUpTest.kt b/ui/ui-test/src/androidTest/java/androidx/ui/test/inputdispatcher/SendUpTest.kt
new file mode 100644
index 0000000..d1606c2
--- /dev/null
+++ b/ui/ui-test/src/androidTest/java/androidx/ui/test/inputdispatcher/SendUpTest.kt
@@ -0,0 +1,126 @@
+/*
+ * Copyright 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT 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.ui.test.inputdispatcher
+
+import android.view.MotionEvent
+import androidx.test.filters.SmallTest
+import androidx.ui.test.android.AndroidInputDispatcher
+import androidx.ui.test.util.MotionEventRecorder
+import androidx.ui.test.util.assertHasValidEventTimes
+import androidx.ui.test.util.expectError
+import androidx.ui.test.util.verify
+import androidx.ui.unit.PxPosition
+import androidx.ui.unit.px
+import com.google.common.truth.Truth.assertThat
+import org.junit.After
+import org.junit.Rule
+import org.junit.Test
+import org.junit.rules.TestRule
+import org.junit.runner.RunWith
+import org.junit.runners.Parameterized
+
+/**
+ * Tests if the [AndroidInputDispatcher.sendUp] gesture works.
+ */
+@SmallTest
+@RunWith(Parameterized::class)
+class SendUpTest(config: TestConfig) {
+ data class TestConfig(
+ val x: Float,
+ val y: Float
+ )
+
+ companion object {
+ private const val eventPeriod = 10L
+ private val downPosition = PxPosition(5.px, 5.px)
+
+ @JvmStatic
+ @Parameterized.Parameters(name = "{0}")
+ fun createTestSet(): List<TestConfig> {
+ return listOf(0f, 10f).flatMap { x ->
+ listOf(0f, -10f).map { y ->
+ TestConfig(x, y)
+ }
+ }.plus(TestConfig(downPosition.x.value, downPosition.y.value))
+ }
+ }
+
+ @get:Rule
+ val inputDispatcherRule: TestRule = AndroidInputDispatcher.TestRule(
+ disableDispatchInRealTime = true
+ )
+
+ private val position = PxPosition(config.x.px, config.y.px)
+
+ private val recorder = MotionEventRecorder()
+ private val subject = AndroidInputDispatcher(recorder::sendEvent)
+
+ @After
+ fun tearDown() {
+ recorder.clear()
+ }
+
+ @Test
+ fun testSendUp() {
+ val token = subject.sendDown(downPosition)
+ subject.sendUp(token, position)
+ recorder.assertHasValidEventTimes()
+ recorder.events.apply {
+ assertThat(size).isEqualTo(2)
+ first().verify(downPosition, MotionEvent.ACTION_DOWN, 0)
+ last().verify(position, MotionEvent.ACTION_UP, eventPeriod)
+ }
+ assertThat(token.lastPosition).isEqualTo(position)
+ assertThat(token.eventTime - token.downTime).isEqualTo(eventPeriod)
+ assertThat(token.finished).isTrue()
+ }
+}
+
+/**
+ * Tests if the [AndroidInputDispatcher.sendUp] gesture throws after
+ * [AndroidInputDispatcher.sendUp] or [AndroidInputDispatcher.sendCancel] has been called.
+ */
+@SmallTest
+class SendUpAfterFinishedTest {
+ private val downPosition = PxPosition(5.px, 5.px)
+ private val position = PxPosition(1.px, 1.px)
+
+ @get:Rule
+ val inputDispatcherRule: TestRule = AndroidInputDispatcher.TestRule(
+ disableDispatchInRealTime = true
+ )
+
+ private val subject = AndroidInputDispatcher {}
+
+ @Test
+ fun testUpAfterUp() {
+ val token = subject.sendDown(downPosition)
+ subject.sendUp(token, downPosition)
+ expectError<java.lang.IllegalArgumentException> {
+ subject.sendUp(token, position)
+ }
+ }
+
+ @Test
+ fun testUpAfterCancel() {
+ val token = subject.sendDown(downPosition)
+ subject.sendCancel(token, downPosition)
+ expectError<java.lang.IllegalArgumentException> {
+ subject.sendUp(token, position)
+ }
+ }
+}
diff --git a/ui/ui-test/src/androidTest/java/androidx/ui/test/partialgesturescope/SendCancelTest.kt b/ui/ui-test/src/androidTest/java/androidx/ui/test/partialgesturescope/SendCancelTest.kt
new file mode 100644
index 0000000..355ff67
--- /dev/null
+++ b/ui/ui-test/src/androidTest/java/androidx/ui/test/partialgesturescope/SendCancelTest.kt
@@ -0,0 +1,102 @@
+/*
+ * Copyright 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT 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.ui.test.partialgesturescope
+
+import androidx.test.filters.MediumTest
+import androidx.ui.test.GestureToken
+import androidx.ui.test.android.AndroidInputDispatcher
+import androidx.ui.test.createComposeRule
+import androidx.ui.test.doPartialGesture
+import androidx.ui.test.findByTag
+import androidx.ui.test.runOnIdleCompose
+import androidx.ui.test.sendCancel
+import androidx.ui.test.sendDown
+import androidx.ui.test.util.ClickableTestBox
+import androidx.ui.test.util.PointerInputRecorder
+import androidx.ui.test.util.assertTimestampsAreIncreasing
+import androidx.ui.test.util.inMilliseconds
+import androidx.ui.unit.PxPosition
+import androidx.ui.unit.px
+import com.google.common.truth.Truth.assertThat
+import org.junit.Rule
+import org.junit.Test
+import org.junit.rules.TestRule
+import org.junit.runner.RunWith
+import org.junit.runners.Parameterized
+
+private const val tag = "widget"
+
+@MediumTest
+@RunWith(Parameterized::class)
+class SendCancelTest(private val config: TestConfig) {
+ data class TestConfig(val cancelPosition: PxPosition?) {
+ val downPosition = PxPosition(1.px, 1.px)
+ }
+
+ companion object {
+ @JvmStatic
+ @Parameterized.Parameters(name = "{0}")
+ fun createTestSet(): List<TestConfig> {
+ return mutableListOf<TestConfig>().apply {
+ for (x in listOf(2.px, 99.px)) {
+ for (y in listOf(3.px, 53.px)) {
+ add(TestConfig(PxPosition(x, y)))
+ }
+ }
+ add(TestConfig(null))
+ }
+ }
+ }
+
+ @get:Rule
+ val composeTestRule = createComposeRule()
+
+ private val dispatcherRule = AndroidInputDispatcher.TestRule(disableDispatchInRealTime = true)
+ @get:Rule
+ val inputDispatcherRule: TestRule = dispatcherRule
+
+ private lateinit var recorder: PointerInputRecorder
+ private val expectedCancelPosition = config.cancelPosition ?: config.downPosition
+
+ @Test
+ fun testSendCancel() {
+ // Given some content
+ recorder = PointerInputRecorder()
+ composeTestRule.setContent {
+ ClickableTestBox(recorder, tag = tag)
+ }
+
+ // When we inject a down event followed by a cancel event
+ lateinit var token: GestureToken
+ findByTag(tag).doPartialGesture { token = sendDown(config.downPosition) }
+ findByTag(tag).doPartialGesture { sendCancel(token, config.cancelPosition) }
+
+ runOnIdleCompose {
+ recorder.run {
+ // Then we have only recorded 1 down event
+ assertTimestampsAreIncreasing()
+ assertThat(events).hasSize(1)
+
+ // But the information in the token matches the cancel event
+ assertThat(token.downTime).isEqualTo(events[0].timestamp.inMilliseconds())
+ assertThat(token.eventTime)
+ .isEqualTo(events[0].timestamp.inMilliseconds() + dispatcherRule.eventPeriod)
+ assertThat(token.lastPosition).isEqualTo(expectedCancelPosition)
+ }
+ }
+ }
+}
diff --git a/ui/ui-test/src/androidTest/java/androidx/ui/test/partialgesturescope/SendDownTest.kt b/ui/ui-test/src/androidTest/java/androidx/ui/test/partialgesturescope/SendDownTest.kt
new file mode 100644
index 0000000..ec8d112
--- /dev/null
+++ b/ui/ui-test/src/androidTest/java/androidx/ui/test/partialgesturescope/SendDownTest.kt
@@ -0,0 +1,99 @@
+/*
+ * Copyright 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT 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.ui.test.partialgesturescope
+
+import androidx.test.filters.MediumTest
+import androidx.ui.test.GestureToken
+import androidx.ui.test.android.AndroidInputDispatcher
+import androidx.ui.test.createComposeRule
+import androidx.ui.test.doPartialGesture
+import androidx.ui.test.findByTag
+import androidx.ui.test.runOnIdleCompose
+import androidx.ui.test.sendDown
+import androidx.ui.test.util.ClickableTestBox
+import androidx.ui.test.util.PointerInputRecorder
+import androidx.ui.test.util.assertTimestampsAreIncreasing
+import androidx.ui.test.util.inMilliseconds
+import androidx.ui.unit.PxPosition
+import androidx.ui.unit.px
+import com.google.common.truth.Truth.assertThat
+import org.junit.Rule
+import org.junit.Test
+import org.junit.rules.TestRule
+import org.junit.runner.RunWith
+import org.junit.runners.Parameterized
+
+private const val tag = "widget"
+
+@MediumTest
+@RunWith(Parameterized::class)
+class SendDownTest(private val config: TestConfig) {
+ data class TestConfig(val position: PxPosition)
+
+ companion object {
+ @JvmStatic
+ @Parameterized.Parameters(name = "{0}")
+ fun createTestSet(): List<TestConfig> {
+ return mutableListOf<TestConfig>().apply {
+ for (x in listOf(1.px, 99.px)) {
+ for (y in listOf(2.px, 53.px)) {
+ add(TestConfig(PxPosition(x, y)))
+ }
+ }
+ }
+ }
+ }
+
+ @get:Rule
+ val composeTestRule = createComposeRule()
+
+ @get:Rule
+ val inputDispatcherRule: TestRule = AndroidInputDispatcher.TestRule(
+ disableDispatchInRealTime = true
+ )
+
+ private lateinit var recorder: PointerInputRecorder
+ private val expectedPosition = config.position
+
+ @Test
+ fun testSendDown() {
+ // Given some content
+ recorder = PointerInputRecorder()
+ composeTestRule.setContent {
+ ClickableTestBox(recorder, tag = tag)
+ }
+
+ // When we inject a down event
+ lateinit var token: GestureToken
+ findByTag(tag).doPartialGesture { token = sendDown(config.position) }
+
+ runOnIdleCompose {
+ recorder.run {
+ // Then we have recorded 1 down event
+ assertTimestampsAreIncreasing()
+ assertThat(events).hasSize(1)
+ assertThat(events[0].down).isTrue()
+ assertThat(events[0].position).isEqualTo(expectedPosition)
+
+ // That matches the information in the token
+ assertThat(token.downTime).isEqualTo(events[0].timestamp.inMilliseconds())
+ assertThat(token.eventTime).isEqualTo(events[0].timestamp.inMilliseconds())
+ assertThat(token.lastPosition).isEqualTo(expectedPosition)
+ }
+ }
+ }
+}
diff --git a/ui/ui-test/src/androidTest/java/androidx/ui/test/partialgesturescope/SendMoveByTest.kt b/ui/ui-test/src/androidTest/java/androidx/ui/test/partialgesturescope/SendMoveByTest.kt
new file mode 100644
index 0000000..1a3d87d
--- /dev/null
+++ b/ui/ui-test/src/androidTest/java/androidx/ui/test/partialgesturescope/SendMoveByTest.kt
@@ -0,0 +1,105 @@
+/*
+ * Copyright 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT 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.ui.test.partialgesturescope
+
+import androidx.test.filters.MediumTest
+import androidx.ui.test.GestureToken
+import androidx.ui.test.android.AndroidInputDispatcher
+import androidx.ui.test.createComposeRule
+import androidx.ui.test.doPartialGesture
+import androidx.ui.test.findByTag
+import androidx.ui.test.runOnIdleCompose
+import androidx.ui.test.sendDown
+import androidx.ui.test.sendMoveBy
+import androidx.ui.test.util.ClickableTestBox
+import androidx.ui.test.util.PointerInputRecorder
+import androidx.ui.test.util.assertTimestampsAreIncreasing
+import androidx.ui.test.util.inMilliseconds
+import androidx.ui.unit.PxPosition
+import androidx.ui.unit.inMilliseconds
+import androidx.ui.unit.px
+import com.google.common.truth.Truth.assertThat
+import org.junit.Rule
+import org.junit.Test
+import org.junit.rules.TestRule
+import org.junit.runner.RunWith
+import org.junit.runners.Parameterized
+
+private const val tag = "widget"
+
+@MediumTest
+@RunWith(Parameterized::class)
+class SendMoveByTest(private val config: TestConfig) {
+ data class TestConfig(val moveByDelta: PxPosition) {
+ val downPosition = PxPosition(1.px, 1.px)
+ }
+
+ companion object {
+ @JvmStatic
+ @Parameterized.Parameters(name = "{0}")
+ fun createTestSet(): List<TestConfig> {
+ return mutableListOf<TestConfig>().apply {
+ for (x in listOf(2.px, (-100).px)) {
+ for (y in listOf(3.px, (-530).px)) {
+ add(TestConfig(PxPosition(x, y)))
+ }
+ }
+ }
+ }
+ }
+
+ @get:Rule
+ val composeTestRule = createComposeRule()
+
+ private val dispatcherRule = AndroidInputDispatcher.TestRule(disableDispatchInRealTime = true)
+ @get:Rule
+ val inputDispatcherRule: TestRule = dispatcherRule
+
+ private lateinit var recorder: PointerInputRecorder
+ private val expectedEndPosition = config.downPosition + config.moveByDelta
+
+ @Test
+ fun testSendMoveBy() {
+ // Given some content
+ recorder = PointerInputRecorder()
+ composeTestRule.setContent {
+ ClickableTestBox(recorder, tag = tag)
+ }
+
+ // When we inject a down event followed by a move event
+ lateinit var token: GestureToken
+ findByTag(tag).doPartialGesture { token = sendDown(config.downPosition) }
+ findByTag(tag).doPartialGesture { sendMoveBy(token, config.moveByDelta) }
+
+ runOnIdleCompose {
+ recorder.run {
+ // Then we have recorded 1 down event and 1 move event
+ assertTimestampsAreIncreasing()
+ assertThat(events).hasSize(2)
+ assertThat(events[1].down).isTrue()
+ assertThat(events[1].position).isEqualTo(expectedEndPosition)
+ assertThat((events[1].timestamp - events[0].timestamp).inMilliseconds())
+ .isEqualTo(dispatcherRule.eventPeriod)
+
+ // And the information in the token matches the last move event
+ assertThat(token.downTime).isEqualTo(events[0].timestamp.inMilliseconds())
+ assertThat(token.eventTime).isEqualTo(events[1].timestamp.inMilliseconds())
+ assertThat(token.lastPosition).isEqualTo(expectedEndPosition)
+ }
+ }
+ }
+}
diff --git a/ui/ui-test/src/androidTest/java/androidx/ui/test/partialgesturescope/SendMoveToTest.kt b/ui/ui-test/src/androidTest/java/androidx/ui/test/partialgesturescope/SendMoveToTest.kt
new file mode 100644
index 0000000..d0e176f
--- /dev/null
+++ b/ui/ui-test/src/androidTest/java/androidx/ui/test/partialgesturescope/SendMoveToTest.kt
@@ -0,0 +1,105 @@
+/*
+ * Copyright 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT 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.ui.test.partialgesturescope
+
+import androidx.test.filters.MediumTest
+import androidx.ui.test.GestureToken
+import androidx.ui.test.android.AndroidInputDispatcher
+import androidx.ui.test.createComposeRule
+import androidx.ui.test.doPartialGesture
+import androidx.ui.test.findByTag
+import androidx.ui.test.runOnIdleCompose
+import androidx.ui.test.sendDown
+import androidx.ui.test.sendMoveTo
+import androidx.ui.test.util.ClickableTestBox
+import androidx.ui.test.util.PointerInputRecorder
+import androidx.ui.test.util.assertTimestampsAreIncreasing
+import androidx.ui.test.util.inMilliseconds
+import androidx.ui.unit.PxPosition
+import androidx.ui.unit.inMilliseconds
+import androidx.ui.unit.px
+import com.google.common.truth.Truth.assertThat
+import org.junit.Rule
+import org.junit.Test
+import org.junit.rules.TestRule
+import org.junit.runner.RunWith
+import org.junit.runners.Parameterized
+
+private const val tag = "widget"
+
+@MediumTest
+@RunWith(Parameterized::class)
+class SendMoveToTest(private val config: TestConfig) {
+ data class TestConfig(val moveToPosition: PxPosition) {
+ val downPosition = PxPosition(1.px, 1.px)
+ }
+
+ companion object {
+ @JvmStatic
+ @Parameterized.Parameters(name = "{0}")
+ fun createTestSet(): List<TestConfig> {
+ return mutableListOf<TestConfig>().apply {
+ for (x in listOf(2.px, 99.px)) {
+ for (y in listOf(3.px, 53.px)) {
+ add(TestConfig(PxPosition(x, y)))
+ }
+ }
+ }
+ }
+ }
+
+ @get:Rule
+ val composeTestRule = createComposeRule()
+
+ private val dispatcherRule = AndroidInputDispatcher.TestRule(disableDispatchInRealTime = true)
+ @get:Rule
+ val inputDispatcherRule: TestRule = dispatcherRule
+
+ private lateinit var recorder: PointerInputRecorder
+ private val expectedEndPosition = config.moveToPosition
+
+ @Test
+ fun testSendMoveTo() {
+ // Given some content
+ recorder = PointerInputRecorder()
+ composeTestRule.setContent {
+ ClickableTestBox(recorder, tag = tag)
+ }
+
+ // When we inject a down event followed by a move event
+ lateinit var token: GestureToken
+ findByTag(tag).doPartialGesture { token = sendDown(config.downPosition) }
+ findByTag(tag).doPartialGesture { sendMoveTo(token, config.moveToPosition) }
+
+ runOnIdleCompose {
+ recorder.run {
+ // Then we have recorded 1 down event and 1 move event
+ assertTimestampsAreIncreasing()
+ assertThat(events).hasSize(2)
+ assertThat(events[1].down).isTrue()
+ assertThat(events[1].position).isEqualTo(expectedEndPosition)
+ assertThat((events[1].timestamp - events[0].timestamp).inMilliseconds())
+ .isEqualTo(dispatcherRule.eventPeriod)
+
+ // And the information in the token matches the last move event
+ assertThat(token.downTime).isEqualTo(events[0].timestamp.inMilliseconds())
+ assertThat(token.eventTime).isEqualTo(events[1].timestamp.inMilliseconds())
+ assertThat(token.lastPosition).isEqualTo(expectedEndPosition)
+ }
+ }
+ }
+}
diff --git a/ui/ui-test/src/androidTest/java/androidx/ui/test/partialgesturescope/SendUpTest.kt b/ui/ui-test/src/androidTest/java/androidx/ui/test/partialgesturescope/SendUpTest.kt
new file mode 100644
index 0000000..33b8788
--- /dev/null
+++ b/ui/ui-test/src/androidTest/java/androidx/ui/test/partialgesturescope/SendUpTest.kt
@@ -0,0 +1,106 @@
+/*
+ * Copyright 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT 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.ui.test.partialgesturescope
+
+import androidx.test.filters.MediumTest
+import androidx.ui.test.GestureToken
+import androidx.ui.test.android.AndroidInputDispatcher
+import androidx.ui.test.createComposeRule
+import androidx.ui.test.doPartialGesture
+import androidx.ui.test.findByTag
+import androidx.ui.test.runOnIdleCompose
+import androidx.ui.test.sendDown
+import androidx.ui.test.sendUp
+import androidx.ui.test.util.ClickableTestBox
+import androidx.ui.test.util.PointerInputRecorder
+import androidx.ui.test.util.assertTimestampsAreIncreasing
+import androidx.ui.test.util.inMilliseconds
+import androidx.ui.unit.PxPosition
+import androidx.ui.unit.inMilliseconds
+import androidx.ui.unit.px
+import com.google.common.truth.Truth.assertThat
+import org.junit.Rule
+import org.junit.Test
+import org.junit.rules.TestRule
+import org.junit.runner.RunWith
+import org.junit.runners.Parameterized
+
+private const val tag = "widget"
+
+@MediumTest
+@RunWith(Parameterized::class)
+class SendUpTest(private val config: TestConfig) {
+ data class TestConfig(val upPosition: PxPosition?) {
+ val downPosition: PxPosition = PxPosition(1.px, 1.px)
+ }
+
+ companion object {
+ @JvmStatic
+ @Parameterized.Parameters(name = "{0}")
+ fun createTestSet(): List<TestConfig> {
+ return mutableListOf<TestConfig>().apply {
+ for (x in listOf(2.px, 99.px)) {
+ for (y in listOf(3.px, 53.px)) {
+ add(TestConfig(PxPosition(x, y)))
+ }
+ }
+ add(TestConfig(null))
+ }
+ }
+ }
+
+ @get:Rule
+ val composeTestRule = createComposeRule()
+
+ private val dispatcherRule = AndroidInputDispatcher.TestRule(disableDispatchInRealTime = true)
+ @get:Rule
+ val inputDispatcherRule: TestRule = dispatcherRule
+
+ private lateinit var recorder: PointerInputRecorder
+ private val expectedEndPosition = config.upPosition ?: config.downPosition
+
+ @Test
+ fun testSendUp() {
+ // Given some content
+ recorder = PointerInputRecorder()
+ composeTestRule.setContent {
+ ClickableTestBox(recorder, tag = tag)
+ }
+
+ // When we inject a down event followed by an up event
+ lateinit var token: GestureToken
+ findByTag(tag).doPartialGesture { token = sendDown(config.downPosition) }
+ findByTag(tag).doPartialGesture { sendUp(token, config.upPosition) }
+
+ runOnIdleCompose {
+ recorder.run {
+ // Then we have recorded 1 down event and 1 move event
+ assertTimestampsAreIncreasing()
+ assertThat(events).hasSize(2)
+ assertThat(events[1].down).isFalse()
+ assertThat(events[1].position).isEqualTo(expectedEndPosition)
+ assertThat((events[1].timestamp - events[0].timestamp).inMilliseconds())
+ .isEqualTo(dispatcherRule.eventPeriod)
+
+ // And the information in the token matches the last move event
+ assertThat(token.downTime).isEqualTo(events[0].timestamp.inMilliseconds())
+ assertThat(token.eventTime).isEqualTo(events[1].timestamp.inMilliseconds())
+ assertThat(token.lastPosition).isEqualTo(expectedEndPosition)
+ }
+ }
+ }
+}
diff --git a/ui/ui-test/src/androidTest/java/androidx/ui/test/selectors/AddIndexSelectorTest.kt b/ui/ui-test/src/androidTest/java/androidx/ui/test/selectors/AddIndexSelectorTest.kt
new file mode 100644
index 0000000..f76ab14
--- /dev/null
+++ b/ui/ui-test/src/androidTest/java/androidx/ui/test/selectors/AddIndexSelectorTest.kt
@@ -0,0 +1,115 @@
+/*
+ * Copyright 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT 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.ui.test.selectors
+
+import androidx.test.filters.MediumTest
+import androidx.ui.test.assert
+import androidx.ui.test.childAt
+import androidx.ui.test.children
+import androidx.ui.test.createComposeRule
+import androidx.ui.test.findByTag
+import androidx.ui.test.first
+import androidx.ui.test.hasTestTag
+import androidx.ui.test.util.BoundaryNode
+import androidx.ui.test.util.expectErrorMessageStartsWith
+import org.junit.Rule
+import org.junit.Test
+import org.junit.runner.RunWith
+import org.junit.runners.JUnit4
+
+@MediumTest
+@RunWith(JUnit4::class)
+class AddIndexSelectorTest {
+
+ @get:Rule
+ val composeTestRule = createComposeRule()
+
+ @Test
+ fun getFirst() {
+ composeTestRule.setContent {
+ BoundaryNode(testTag = "Parent") {
+ BoundaryNode(testTag = "Child1")
+ BoundaryNode(testTag = "Child2")
+ }
+ }
+
+ findByTag("Parent")
+ .children()
+ .first()
+ .assert(hasTestTag("Child1"))
+ }
+
+ @Test
+ fun getAtIndex() {
+ composeTestRule.setContent {
+ BoundaryNode(testTag = "Parent") {
+ BoundaryNode(testTag = "Child1")
+ BoundaryNode(testTag = "Child2")
+ }
+ }
+
+ findByTag("Parent")
+ .childAt(1)
+ .assert(hasTestTag("Child2"))
+ }
+
+ @Test
+ fun getAtIndex_wrongIndex_fail() {
+ composeTestRule.setContent {
+ BoundaryNode(testTag = "Parent") {
+ BoundaryNode(testTag = "Child1")
+ BoundaryNode(testTag = "Child2")
+ }
+ }
+
+ expectErrorMessageStartsWith("" +
+ "Failed: assertExists.\n" +
+ "Can't retrieve node at index '2' of '(TestTag = 'Parent').children'\n" +
+ "There are '2' nodes only:") {
+ findByTag("Parent")
+ .childAt(2)
+ .assertExists()
+ }
+ }
+
+ @Test
+ fun getAtIndex_noItems() {
+ composeTestRule.setContent {
+ BoundaryNode(testTag = "Parent")
+ }
+
+ findByTag("Parent")
+ .childAt(2)
+ .assertDoesNotExist()
+ }
+
+ @Test
+ fun getAtIndex_noItems_fail() {
+ composeTestRule.setContent {
+ BoundaryNode(testTag = "Parent")
+ }
+
+ expectErrorMessageStartsWith("" +
+ "Failed: assertExists.\n" +
+ "Can't retrieve node at index '2' of '(TestTag = 'Parent').children'\n" +
+ "There are no existing nodes for that selector.") {
+ findByTag("Parent")
+ .childAt(2)
+ .assertExists()
+ }
+ }
+}
\ No newline at end of file
diff --git a/ui/ui-test/src/androidTest/java/androidx/ui/test/selectors/AncestorsSelectorTest.kt b/ui/ui-test/src/androidTest/java/androidx/ui/test/selectors/AncestorsSelectorTest.kt
index b956867..2e702b5 100644
--- a/ui/ui-test/src/androidTest/java/androidx/ui/test/selectors/AncestorsSelectorTest.kt
+++ b/ui/ui-test/src/androidTest/java/androidx/ui/test/selectors/AncestorsSelectorTest.kt
@@ -22,6 +22,7 @@
import androidx.ui.test.assertCountEquals
import androidx.ui.test.createComposeRule
import androidx.ui.test.findByTag
+import androidx.ui.test.first
import androidx.ui.test.hasTestTag
import androidx.ui.test.util.BoundaryNode
import org.junit.Rule
@@ -51,10 +52,10 @@
findByTag("NodeD")
.ancestors()
.assertCountEquals(3)
- .let {
- it[0].assert(hasTestTag("NodeC"))
- it[1].assert(hasTestTag("NodeB"))
- it[2].assert(hasTestTag("NodeA"))
+ .apply {
+ get(0).assert(hasTestTag("NodeC"))
+ get(1).assert(hasTestTag("NodeB"))
+ get(2).assert(hasTestTag("NodeA"))
}
}
@@ -75,9 +76,9 @@
.first()
.ancestors()
.assertCountEquals(2)
- .let {
- it[0].assert(hasTestTag("NodeB"))
- it[1].assert(hasTestTag("NodeA"))
+ .apply {
+ get(0).assert(hasTestTag("NodeB"))
+ get(1).assert(hasTestTag("NodeA"))
}
}
diff --git a/ui/ui-test/src/androidTest/java/androidx/ui/test/selectors/ChildrenSelectorTest.kt b/ui/ui-test/src/androidTest/java/androidx/ui/test/selectors/ChildrenSelectorTest.kt
index 9a05692..d03732d 100644
--- a/ui/ui-test/src/androidTest/java/androidx/ui/test/selectors/ChildrenSelectorTest.kt
+++ b/ui/ui-test/src/androidTest/java/androidx/ui/test/selectors/ChildrenSelectorTest.kt
@@ -48,9 +48,9 @@
findByTag("Parent")
.children()
.assertCountEquals(2)
- .let {
- it[0].assert(hasTestTag("Child1"))
- it[1].assert(hasTestTag("Child2"))
+ .apply {
+ get(0).assert(hasTestTag("Child1"))
+ get(1).assert(hasTestTag("Child2"))
}
}
diff --git a/ui/ui-test/src/androidTest/java/androidx/ui/test/selectors/SiblingsSelectorTest.kt b/ui/ui-test/src/androidTest/java/androidx/ui/test/selectors/SiblingsSelectorTest.kt
index bfd9d3a..568481b 100644
--- a/ui/ui-test/src/androidTest/java/androidx/ui/test/selectors/SiblingsSelectorTest.kt
+++ b/ui/ui-test/src/androidTest/java/androidx/ui/test/selectors/SiblingsSelectorTest.kt
@@ -76,9 +76,9 @@
findByTag("Child2")
.siblings()
.assertCountEquals(2)
- .let {
- it[0].assert(hasTestTag("Child1"))
- it[1].assert(hasTestTag("Child3"))
+ .apply {
+ get(0).assert(hasTestTag("Child1"))
+ get(1).assert(hasTestTag("Child3"))
}
}
}
\ No newline at end of file
diff --git a/ui/ui-test/src/androidTest/java/androidx/ui/test/util/ClickableTestBox.kt b/ui/ui-test/src/androidTest/java/androidx/ui/test/util/ClickableTestBox.kt
new file mode 100644
index 0000000..e6ea4f2
--- /dev/null
+++ b/ui/ui-test/src/androidTest/java/androidx/ui/test/util/ClickableTestBox.kt
@@ -0,0 +1,55 @@
+/*
+ * Copyright 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT 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.ui.test.util
+
+import androidx.compose.Composable
+import androidx.ui.core.DensityAmbient
+import androidx.ui.core.Modifier
+import androidx.ui.foundation.Box
+import androidx.ui.graphics.Color
+import androidx.ui.layout.size
+import androidx.ui.semantics.Semantics
+import androidx.ui.semantics.testTag
+import androidx.ui.test.util.ClickableTestBox.defaultColor
+import androidx.ui.test.util.ClickableTestBox.defaultSize
+import androidx.ui.test.util.ClickableTestBox.defaultTag
+import androidx.ui.unit.Px
+import androidx.ui.unit.px
+
+object ClickableTestBox {
+ val defaultSize = 100.px
+ val defaultColor = Color.Yellow
+ const val defaultTag = "ClickableTestBox"
+}
+
+@Composable
+fun ClickableTestBox(
+ modifier: Modifier = Modifier,
+ width: Px = defaultSize,
+ height: Px = defaultSize,
+ color: Color = defaultColor,
+ tag: String = defaultTag
+) {
+ Semantics(container = true, properties = { testTag = tag }) {
+ with(DensityAmbient.current) {
+ Box(
+ modifier = modifier.size(width.toDp(), height.toDp()),
+ backgroundColor = color
+ )
+ }
+ }
+}
diff --git a/ui/ui-test/src/androidTest/java/androidx/ui/test/util/Expect.kt b/ui/ui-test/src/androidTest/java/androidx/ui/test/util/Expect.kt
new file mode 100644
index 0000000..2accc7a
--- /dev/null
+++ b/ui/ui-test/src/androidTest/java/androidx/ui/test/util/Expect.kt
@@ -0,0 +1,54 @@
+/*
+ * Copyright 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT 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.ui.test.util
+
+import com.google.common.truth.Truth.assertWithMessage
+import java.io.PrintWriter
+import java.io.StringWriter
+
+/**
+ * Runs the [block] and asserts that an [AssertionError] is thrown if [expectError] is `true`, or
+ * that it is not thrown if [expectError] is `false`.
+ */
+fun expectAssertionError(expectError: Boolean, block: () -> Unit) {
+ expectError<AssertionError>(expectError, block)
+}
+
+/**
+ * Runs the [block] and asserts that a [T] is thrown if [expectError] is `true`, or that it is
+ * not thrown if [expectError] is `false`.
+ */
+inline fun <reified T : Throwable> expectError(expectError: Boolean = true, block: () -> Unit) {
+ var thrown = false
+ val errorClassName = T::class.java.simpleName
+ var errorMessage = "Expected a $errorClassName, got nothing"
+ try {
+ block()
+ } catch (t: Throwable) {
+ if (t !is T) {
+ throw t
+ }
+ thrown = true
+ StringWriter().use { sw ->
+ PrintWriter(sw).use { pw ->
+ t.printStackTrace(pw)
+ }
+ errorMessage = "Expected no $errorClassName, got:\n==============\n$sw=============="
+ }
+ }
+ assertWithMessage(errorMessage).that(thrown).isEqualTo(expectError)
+}
diff --git a/ui/ui-test/src/androidTest/java/androidx/ui/test/util/PointerInputs.kt b/ui/ui-test/src/androidTest/java/androidx/ui/test/util/PointerInputs.kt
index 3c25ab5..51b360e 100644
--- a/ui/ui-test/src/androidTest/java/androidx/ui/test/util/PointerInputs.kt
+++ b/ui/ui-test/src/androidTest/java/androidx/ui/test/util/PointerInputs.kt
@@ -27,6 +27,7 @@
import androidx.ui.unit.Duration
import androidx.ui.unit.IntPxSize
import androidx.ui.unit.PxPosition
+import androidx.ui.unit.Uptime
import com.google.common.truth.Truth.assertThat
class PointerInputRecorder : PointerInputModifier {
@@ -45,28 +46,33 @@
private val velocityTracker = VelocityTracker()
val recordedVelocity get() = velocityTracker.calculateVelocity()
- override val pointerInputFilter: PointerInputFilter =
- object : PointerInputFilter() {
- override fun onPointerInput(
- changes: List<PointerInputChange>,
- pass: PointerEventPass,
- bounds: IntPxSize
- ): List<PointerInputChange> {
- if (pass == PointerEventPass.InitialDown) {
- changes.forEach {
- _events.add(DataPoint(it.id, it.current))
- velocityTracker.addPosition(it.current.uptime!!, it.current.position!!)
- }
- }
- return changes
- }
+ override val pointerInputFilter = RecordingFilter {
+ _events.add(DataPoint(it.id, it.current))
+ velocityTracker.addPosition(it.current.uptime!!, it.current.position!!)
+ }
+}
- override fun onCancel() {
- // Do nothing
+class RecordingFilter(private val record: (PointerInputChange) -> Unit) : PointerInputFilter() {
+ override fun onPointerInput(
+ changes: List<PointerInputChange>,
+ pass: PointerEventPass,
+ bounds: IntPxSize
+ ): List<PointerInputChange> {
+ if (pass == PointerEventPass.InitialDown) {
+ changes.forEach {
+ record(it)
}
}
+ return changes
+ }
+
+ override fun onCancel() {
+ // Do nothing
+ }
}
+fun Uptime.inMilliseconds(): Long = nanoseconds / 1_000_000
+
val PointerInputRecorder.downEvents get() = events.filter { it.down }
val PointerInputRecorder.recordedDuration: Duration
diff --git a/ui/ui-test/src/androidTest/java/androidx/ui/test/util/Truth.kt b/ui/ui-test/src/androidTest/java/androidx/ui/test/util/Truth.kt
index b77c508..c09262d 100644
--- a/ui/ui-test/src/androidTest/java/androidx/ui/test/util/Truth.kt
+++ b/ui/ui-test/src/androidTest/java/androidx/ui/test/util/Truth.kt
@@ -19,9 +19,6 @@
import androidx.ui.unit.PxPosition
import com.google.common.truth.FloatSubject
import com.google.common.truth.Truth.assertThat
-import com.google.common.truth.Truth.assertWithMessage
-import java.io.PrintWriter
-import java.io.StringWriter
import kotlin.math.sign
/**
@@ -72,24 +69,3 @@
isAtMost(a + tolerance)
}
}
-
-/**
- * Runs the [block] and asserts that an [AssertionError] is thrown if [expectError] is `true`, or
- * that it is not thrown if [expectError] is `false`.
- */
-fun expectAssertionError(expectError: Boolean, block: () -> Unit) {
- var thrown = false
- var errorMessage = "Expected an AssertionError, got nothing"
- try {
- block()
- } catch (e: AssertionError) {
- thrown = true
- StringWriter().use { sw ->
- PrintWriter(sw).use { pw ->
- e.printStackTrace(pw)
- }
- errorMessage = "Expected no AssertionError, got:\n==============\n$sw=============="
- }
- }
- assertWithMessage(errorMessage).that(thrown).isEqualTo(expectError)
-}
diff --git a/ui/ui-test/src/main/java/androidx/ui/test/Actions.kt b/ui/ui-test/src/main/java/androidx/ui/test/Actions.kt
index 9a5e8ab..e71f275 100644
--- a/ui/ui-test/src/main/java/androidx/ui/test/Actions.kt
+++ b/ui/ui-test/src/main/java/androidx/ui/test/Actions.kt
@@ -84,10 +84,12 @@
* Executes the gestures specified in the given block.
*
* Example usage:
+ * ```
* findByTag("myWidget")
* .doGesture {
* sendSwipeUp()
* }
+ * ```
*/
fun SemanticsNodeInteraction.doGesture(
block: GestureScope.() -> Unit
@@ -98,6 +100,35 @@
}
/**
+ * Executes the (partial) gesture specified in the given block. The gesture doesn't need to be
+ * complete and can be resumed later. It is the responsibility of the caller to make sure partial
+ * gestures don't leave the test in an inconsistent state.
+ *
+ * When [sending the down event][sendDown], a token is returned which needs to be used in all
+ * subsequent events of this gesture.
+ *
+ * Example usage:
+ * ```
+ * lateinit var token: GestureToken
+ * findByTag("myWidget")
+ * .doPartialGesture {
+ * token = sendDown()
+ * }
+ * .assertHasClickAction()
+ * .doPartialGesture {
+ * sendUp(token)
+ * }
+ * ```
+ */
+fun SemanticsNodeInteraction.doPartialGesture(
+ block: PartialGestureScope.() -> Unit
+): SemanticsNodeInteraction {
+ val scope = PartialGestureScope(this)
+ scope.block()
+ return this
+}
+
+/**
* Provides support to call custom semantics actions on this node.
*
* This method is supposed to be used for actions with parameters.
diff --git a/ui/ui-test/src/main/java/androidx/ui/test/Assertions.kt b/ui/ui-test/src/main/java/androidx/ui/test/Assertions.kt
index b6d3d7c..e9c812b 100644
--- a/ui/ui-test/src/main/java/androidx/ui/test/Assertions.kt
+++ b/ui/ui-test/src/main/java/androidx/ui/test/Assertions.kt
@@ -183,35 +183,6 @@
assert(hasNoClickAction())
/**
- * Asserts that this collection of nodes is equal to the given [expectedSize].
- *
- * Provides a detailed error message on failure.
- *
- * @throws AssertionError if the size is not equal to [expectedSize]
- */
-// TODO: Rename to assertSizeEquals to be consistent with Collection.size
-fun <T : Collection<SemanticsNodeInteraction>> T.assertCountEquals(expectedSize: Int): T {
- if (size != expectedSize) {
- // Quite often all the elements of a collection come from the same selector. So we try to
- // distinct them hoping we get just one selector to show it to the user on failure.
- // TODO: If there is more than one selector maybe show selector per node?
- val selectors = map { it.selector }
- .distinct()
- val selector = if (selectors.size == 1) {
- selectors.first()
- } else {
- null
- }
- throw AssertionError(buildErrorMessageForCountMismatch(
- errorMessage = "Failed to assert count of nodes.",
- selector = selector,
- foundNodes = map { it.fetchSemanticsNode("") },
- expectedCount = expectedSize))
- }
- return this
-}
-
-/**
* Asserts that the provided [matcher] is satisfied for this node.
*
* @param matcher Matcher to verify.
@@ -230,6 +201,28 @@
return this
}
+/**
+ * Asserts that this collection of nodes is equal to the given [expectedSize].
+ *
+ * Provides a detailed error message on failure.
+ *
+ * @throws AssertionError if the size is not equal to [expectedSize]
+ */
+fun SemanticsNodeInteractionCollection.assertCountEquals(
+ expectedSize: Int
+): SemanticsNodeInteractionCollection {
+ val errorOnFail = "Failed to assert count of nodes."
+ val matchedNodes = fetchSemanticsNodes(errorOnFail)
+ if (matchedNodes.size != expectedSize) {
+ throw AssertionError(buildErrorMessageForCountMismatch(
+ errorMessage = errorOnFail,
+ selector = selector,
+ foundNodes = matchedNodes,
+ expectedCount = expectedSize))
+ }
+ return this
+}
+
private fun SemanticsNodeInteraction.checkIsDisplayed(): Boolean {
// hierarchy check - check layout nodes are visible
val errorMessageOnFail = "Failed to perform isDisplayed check."
diff --git a/ui/ui-test/src/main/java/androidx/ui/test/ErrorMessages.kt b/ui/ui-test/src/main/java/androidx/ui/test/ErrorMessages.kt
index 69121a3..2893ca7 100644
--- a/ui/ui-test/src/main/java/androidx/ui/test/ErrorMessages.kt
+++ b/ui/ui-test/src/main/java/androidx/ui/test/ErrorMessages.kt
@@ -33,7 +33,7 @@
*/
internal fun buildErrorMessageForCountMismatch(
errorMessage: String,
- selector: SemanticsMatcher?,
+ selector: SemanticsSelector?,
foundNodes: List<SemanticsNode>,
expectedCount: Int
): String {
@@ -94,7 +94,7 @@
*/
internal fun buildErrorMessageForNodeMissingInTree(
errorMessage: String,
- selector: SemanticsMatcher,
+ selector: SemanticsSelector,
lastSeenSemantics: String
): String {
val sb = StringBuilder()
@@ -116,18 +116,18 @@
* To see some examples, check out "ErrorMessagesTest".
*/
internal fun buildErrorMessageForMatcherFail(
- selectorMatcher: SemanticsMatcher,
+ selector: SemanticsSelector,
node: SemanticsNode,
assertionMatcher: SemanticsMatcher
): String {
return buildGeneralErrorMessage(
"Failed to assert that node satisfies the following condition: " +
- "(${assertionMatcher.description})", selectorMatcher, node)
+ "(${assertionMatcher.description})", selector, node)
}
internal fun buildGeneralErrorMessage(
errorMessage: String,
- selector: SemanticsMatcher,
+ selector: SemanticsSelector,
node: SemanticsNode
): String {
val sb = StringBuilder()
@@ -144,6 +144,30 @@
return sb.toString()
}
+internal fun buildIndexErrorMessage(
+ index: Int,
+ selector: SemanticsSelector,
+ nodes: List<SemanticsNode>
+): String {
+ val sb = StringBuilder()
+
+ sb.append("Can't retrieve node at index '$index' of '")
+ sb.append(selector.description)
+ sb.appendln("'")
+
+ if (nodes.isEmpty()) {
+ sb.appendln("There are no existing nodes for that selector.")
+ } else if (nodes.size == 1) {
+ sb.appendln("There is 1 node only:")
+ sb.appendln(nodes.toStringInfo())
+ } else {
+ sb.appendln("There are '${nodes.size}' nodes only:")
+ sb.appendln(nodes.toStringInfo())
+ }
+
+ return sb.toString()
+}
+
internal fun Collection<SemanticsNode>.toStringInfo(): String {
var sb = StringBuilder()
var i = 1
diff --git a/ui/ui-test/src/main/java/androidx/ui/test/Filters.kt b/ui/ui-test/src/main/java/androidx/ui/test/Filters.kt
index f6ca72c..4645a54 100644
--- a/ui/ui-test/src/main/java/androidx/ui/test/Filters.kt
+++ b/ui/ui-test/src/main/java/androidx/ui/test/Filters.kt
@@ -129,10 +129,10 @@
* @see SemanticsProperties.AccessibilityLabel
*/
fun hasText(text: String, ignoreCase: Boolean = false): SemanticsMatcher {
- return SemanticsMatcher.fromCondition(
+ return SemanticsMatcher(
"${SemanticsProperties.AccessibilityLabel.name} = '$text' (ignoreCase: $ignoreCase)"
) {
- config.getOrNull(SemanticsProperties.AccessibilityLabel).equals(text, ignoreCase)
+ it.config.getOrNull(SemanticsProperties.AccessibilityLabel).equals(text, ignoreCase)
}
}
@@ -147,10 +147,10 @@
*/
fun hasSubstring(substring: String, ignoreCase: Boolean = false):
SemanticsMatcher {
- return SemanticsMatcher.fromCondition(
+ return SemanticsMatcher(
"${SemanticsProperties.AccessibilityLabel.name}.contains($substring, $ignoreCase)"
) {
- config.getOrNull(SemanticsProperties.AccessibilityLabel)?.contains(substring, ignoreCase)
+ it.config.getOrNull(SemanticsProperties.AccessibilityLabel)?.contains(substring, ignoreCase)
?: false
}
}
@@ -223,8 +223,8 @@
fun hasParentThat(matcher: SemanticsMatcher): SemanticsMatcher {
// TODO(b/150292800): If this is used in assert we should print the parent's node semantics
// in the error message or say that no parent was found.
- return SemanticsMatcher.fromCondition("hasParentThat(${matcher.description})") {
- parent?.run { matcher.matches(this) } ?: false
+ return SemanticsMatcher("hasParentThat(${matcher.description})") {
+ it.parent?.run { matcher.matches(this) } ?: false
}
}
@@ -234,8 +234,8 @@
fun hasAnyChildThat(matcher: SemanticsMatcher): SemanticsMatcher {
// TODO(b/150292800): If this is used in assert we should print the children nodes semantics
// in the error message or say that no children were found.
- return SemanticsMatcher.fromCondition("hasAnyChildThat(${matcher.description})") {
- matcher.matchesAny(this.children)
+ return SemanticsMatcher("hasAnyChildThat(${matcher.description})") {
+ matcher.matchesAny(it.children)
}
}
@@ -247,10 +247,11 @@
fun hasAnySiblingThat(matcher: SemanticsMatcher): SemanticsMatcher {
// TODO(b/150292800): If this is used in assert we should print the sibling nodes semantics
// in the error message or say that no siblings were found.
- return SemanticsMatcher.fromCondition("hasAnySiblingThat(${matcher.description})"
+ return SemanticsMatcher("hasAnySiblingThat(${matcher.description})"
) {
- val node = this
- parent?.run { matcher.match(this.children).any { it.id != node.id } } ?: false
+ val node = it
+ it.parent?.run { matcher.matchesAny(this.children.filter { child -> child.id != node.id }) }
+ ?: false
}
}
@@ -268,8 +269,8 @@
fun hasAnyAncestorThat(matcher: SemanticsMatcher): SemanticsMatcher {
// TODO(b/150292800): If this is used in assert we should print the ancestor nodes semantics
// in the error message or say that no ancestors were found.
- return SemanticsMatcher.fromCondition("hasAnyAncestorThat(${matcher.description})") {
- matcher.matchesAny(ancestors)
+ return SemanticsMatcher("hasAnyAncestorThat(${matcher.description})") {
+ matcher.matchesAny(it.ancestors)
}
}
@@ -295,8 +296,8 @@
return node.children.any { checkIfSubtreeMatches(matcher, it) }
}
- return SemanticsMatcher.fromCondition("hasAnyDescendantThat(${matcher.description})") {
- checkIfSubtreeMatches(matcher, this)
+ return SemanticsMatcher("hasAnyDescendantThat(${matcher.description})") {
+ checkIfSubtreeMatches(matcher, it)
}
}
diff --git a/ui/ui-test/src/main/java/androidx/ui/test/Finders.kt b/ui/ui-test/src/main/java/androidx/ui/test/Finders.kt
index df9f45a..1dcf1c8 100644
--- a/ui/ui-test/src/main/java/androidx/ui/test/Finders.kt
+++ b/ui/ui-test/src/main/java/androidx/ui/test/Finders.kt
@@ -34,7 +34,7 @@
*
* For usage patterns see [SemanticsNodeInteraction]
*/
-fun findAllByTag(testTag: String): List<SemanticsNodeInteraction> =
+fun findAllByTag(testTag: String): SemanticsNodeInteractionCollection =
findAll(hasTestTag(testTag))
/**
@@ -62,7 +62,7 @@
*
* For usage patterns see [SemanticsNodeInteraction]
*/
-fun findAllByText(text: String, ignoreCase: Boolean = false): List<SemanticsNodeInteraction> =
+fun findAllByText(text: String, ignoreCase: Boolean = false): SemanticsNodeInteractionCollection =
findAll(hasText(text, ignoreCase))
/**
@@ -75,9 +75,8 @@
* For usage patterns see [SemanticsNodeInteraction]
* @see findAll to work with multiple elements
*/
-fun find(selector: SemanticsMatcher): SemanticsNodeInteraction {
- val matchedNodes = selector.match(getAllSemanticsNodes())
- return SemanticsNodeInteraction(matchedNodes.toList(), selector)
+fun find(matcher: SemanticsMatcher): SemanticsNodeInteraction {
+ return SemanticsNodeInteraction(SemanticsSelector(matcher))
}
/**
@@ -87,10 +86,8 @@
* instead.
* @see find
*/
-fun findAll(selector: SemanticsMatcher): List<SemanticsNodeInteraction> {
- return selector.match(getAllSemanticsNodes()).map {
- SemanticsNodeInteraction(it, selector)
- }
+fun findAll(matcher: SemanticsMatcher): SemanticsNodeInteractionCollection {
+ return SemanticsNodeInteractionCollection(SemanticsSelector(matcher))
}
internal fun getAllSemanticsNodes(): List<SemanticsNode> {
diff --git a/ui/ui-test/src/main/java/androidx/ui/test/GestureScope.kt b/ui/ui-test/src/main/java/androidx/ui/test/GestureScope.kt
index 8a7a487..0a4675b 100644
--- a/ui/ui-test/src/main/java/androidx/ui/test/GestureScope.kt
+++ b/ui/ui-test/src/main/java/androidx/ui/test/GestureScope.kt
@@ -17,7 +17,6 @@
package androidx.ui.test
import androidx.annotation.FloatRange
-import androidx.annotation.RestrictTo
import androidx.ui.core.gesture.LongPressTimeout
import androidx.ui.unit.Duration
import androidx.ui.unit.IntPxSize
@@ -34,26 +33,6 @@
import kotlin.math.sin
/**
- * An object that has an associated component in which one can inject gestures. The gestures can
- * be injected by calling methods defined on [GestureScope], such as [sendSwipeUp]. The associated
- * component is the [SemanticsNodeInteraction] found by one of the finder methods such as [findByTag].
- *
- * Example usage:
- * findByTag("myWidget")
- * .doGesture {
- * sendSwipeUp()
- * }
- */
-class GestureScope internal constructor(
- internal val semanticsNodeInteraction: SemanticsNodeInteraction
-) {
- // TODO(b/133217292): Better error: explain which gesture couldn't be performed
- // TODO: Avoid calling this multiple times as it involves synchronization.
- internal inline val semanticsNode
- get() = semanticsNodeInteraction.fetchSemanticsNode("Failed to perform a gesture.")
-}
-
-/**
* The distance of a swipe's start position from the node's edge, in terms of the node's length.
* We do not start the swipe exactly on the node's edge, but somewhat more inward, since swiping
* from the exact edge may behave in an unexpected way (e.g. may open a navigation drawer).
@@ -66,17 +45,26 @@
*/
private val doubleClickDelay = 145.milliseconds
+sealed class BaseGestureScope(
+ internal val semanticsNodeInteraction: SemanticsNodeInteraction
+) {
+ // TODO(b/133217292): Better error: explain which gesture couldn't be performed
+ // TODO: Avoid calling this multiple times as it involves synchronization.
+ internal inline val semanticsNode
+ get() = semanticsNodeInteraction.fetchSemanticsNode("Failed to perform a gesture.")
+}
+
/**
* Returns the size of the component we're interacting with
*/
-val GestureScope.size: IntPxSize
+val BaseGestureScope.size: IntPxSize
get() = semanticsNode.size
/**
* Returns the center of the component we're interacting with, in the component's local
* coordinate system, where (0.px, 0.px) is the top left corner of the component.
*/
-val GestureScope.center: PxPosition
+val BaseGestureScope.center: PxPosition
get() {
return PxPosition(size.width / 2, size.height / 2)
}
@@ -84,7 +72,7 @@
/**
* Returns the global bounds of the component we're interacting with
*/
-val GestureScope.globalBounds: PxBounds
+val BaseGestureScope.globalBounds: PxBounds
get() = semanticsNode.globalBounds
/**
@@ -92,13 +80,31 @@
*
* @param position A position in local coordinates
*/
-fun GestureScope.localToGlobal(position: PxPosition): PxPosition {
+fun BaseGestureScope.localToGlobal(position: PxPosition): PxPosition {
val bounds = globalBounds
return position + PxPosition(bounds.left, bounds.top)
}
/**
- * Performs a click gesture on the given [position] on the associated component. The [position]
+ * The receiver scope for injecting gestures on the node identified by the
+ * [semanticsNodeInteraction]. Gestures can be injected by calling methods defined on
+ * [GestureScope], such as [sendSwipeUp]. The [semanticsNodeInteraction] can be found by one of
+ * the finder methods such as [findByTag].
+ *
+ * Example usage:
+ * ```
+ * findByTag("myWidget")
+ * .doGesture {
+ * sendSwipeUp()
+ * }
+ * ```
+ */
+class GestureScope internal constructor(
+ semanticsNodeInteraction: SemanticsNodeInteraction
+) : BaseGestureScope(semanticsNodeInteraction)
+
+/**
+ * Performs a click gesture at the given [position] on the associated component. The [position]
* is in the component's local coordinate system, where (0.px, 0.px) is the top left corner of
* the component.
*
@@ -113,24 +119,6 @@
}
/**
- * Dispatches a down event on the given [position] on the associated component. The [position]
- * is in the component's local coordinate system, where (0.px, 0.px) is the top left corner of
- * the component.
- *
- * Throws [AssertionError] when the component doesn't have a bounding rectangle set
- *
- * @param position The position of the down event, in the component's local coordinate system
- *
- * @suppress
- */
-@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
-fun GestureScope.sendTouchDown(position: PxPosition) {
- semanticsNodeInteraction.sendInput {
- it.sendTouchDown(localToGlobal(position))
- }
-}
-
-/**
* Performs a click gesture on the associated component. The click is done in the middle of the
* component's bounds.
*
@@ -141,7 +129,7 @@
}
/**
- * Performs a long click gesture on the given [position] on the associated component. There will
+ * Performs a long click gesture at the given [position] on the associated component. There will
* be [LongPressTimeout] + 100 milliseconds time between the down and the up event. The
* [position] is in the component's local coordinate system, where (0.px, 0.px) is the top left
* corner of the component.
@@ -156,7 +144,7 @@
}
/**
- * Performs a long click gesture on the middle of the associated component. There will
+ * Performs a long click gesture at the middle of the associated component. There will
* be [LongPressTimeout] + 100 milliseconds time between the down and the up event.
*
* Throws [AssertionError] when the component doesn't have a bounding rectangle set
@@ -166,7 +154,7 @@
}
/**
- * Performs a double click gesture on the given [position] on the associated component. The
+ * Performs a double click gesture at the given [position] on the associated component. The
* [position] is in the component's local coordinate system, where (0.px, 0.px) is the top left
* corner of the component.
*
@@ -399,3 +387,119 @@
}
}
}
+
+/**
+ * The receiver scope for injecting partial gestures on the node identified by the
+ * [semanticsNodeInteraction]. Gestures can be injected by calling methods defined on
+ * [PartialGestureScope], such as [sendDown]. The [semanticsNodeInteraction] can be found by one
+ * of the finder methods such as [findByTag].
+ *
+ * Example usage:
+ * ```
+ * val position = PxPosition(10.px, 10.px)
+ * lateinit var token: GestureToken
+ * findByTag("myWidget")
+ * .doPartialGesture { token = sendDown(position) }
+ * .assertIsDisplayed()
+ * .doPartialGesture { sendUp(token, position) }
+ * ```
+ */
+class PartialGestureScope internal constructor(
+ semanticsNodeInteraction: SemanticsNodeInteraction
+) : BaseGestureScope(semanticsNodeInteraction)
+
+/**
+ * A token to be shared between individual motion events that form a single gesture. It is
+ * generated by the [sendDown] partial gesture, and must be passed to all subsequent events of
+ * the gesture, such as [sendMoveTo] and [sendUp].
+ */
+class GestureToken internal constructor(
+ internal val downTime: Long,
+ internal var lastPosition: PxPosition
+) {
+ internal var eventTime: Long = downTime
+ internal var finished: Boolean = false
+}
+
+/**
+ * Sends a down event at the given [position] on the associated component. The [position] is in
+ * the component's local coordinate system, where (0.px, 0.px) is the top left corner of the
+ * component. The returned token needs to be used in all subsequent events of this gesture.
+ *
+ * @param position The position of the down event, in the component's local coordinate system
+ * @return A token that identifies this gesture and must be passed to all subsequent events that
+ * are part of this gesture.
+ */
+fun PartialGestureScope.sendDown(position: PxPosition): GestureToken {
+ val globalPosition = localToGlobal(position)
+ lateinit var token: GestureToken
+ semanticsNodeInteraction.sendInput {
+ token = it.sendDown(globalPosition)
+ }
+ return token
+}
+
+/**
+ * Sends a move event at the given [position] on the associated component. The [position] is in
+ * the component's local coordinate system, where (0.px, 0.px) is the top left corner of the
+ * component.
+ *
+ * @param token The token returned from the corresponding [down event][sendDown] that started
+ * this gesture.
+ * @param position The position of the move event, in the component's local coordinate system
+ */
+fun PartialGestureScope.sendMoveTo(token: GestureToken, position: PxPosition) {
+ val globalPosition = localToGlobal(position)
+ semanticsNodeInteraction.sendInput {
+ it.sendMove(token, globalPosition)
+ }
+}
+
+/**
+ * Sends a move event on the associated component, using the last used coordinate and moving it
+ * by the given [delta].
+ *
+ * @param token The token returned from the corresponding [down event][sendDown] that started
+ * this gesture.
+ * @param delta The position for this move event, relative to the last sent event. For example,
+ * `delta = PxPosition(10.px, -10.px) will add 10.px to the last event's x-position, and subtract
+ * 10.px from the last event's y-position.
+ */
+fun PartialGestureScope.sendMoveBy(token: GestureToken, delta: PxPosition) {
+ val globalPosition = token.lastPosition + delta
+ semanticsNodeInteraction.sendInput {
+ it.sendMove(token, globalPosition)
+ }
+}
+
+/**
+ * Sends an up event at the given [position] on the associated component. If [position] is
+ * omitted, the position of the previous event is used. The [position] is in the component's
+ * local coordinate system, where (0.px, 0.px) is the top left corner of the component.
+ *
+ * @param token The token returned from the corresponding [down event][sendDown] that started
+ * this gesture.
+ * @param position The position of the up event, in the component's local coordinate system
+ */
+fun PartialGestureScope.sendUp(token: GestureToken, position: PxPosition? = null) {
+ val globalPosition = position?.let { localToGlobal(it) } ?: token.lastPosition
+ semanticsNodeInteraction.sendInput {
+ it.sendUp(token, globalPosition)
+ }
+}
+
+/**
+ * Sends a cancel event at the given [position] on the associated component. If [position] is
+ * omitted, the position of the previous event is used. The [position] is in the component's
+ * local coordinate system, where (0.px, 0.px) is the top left corner of the component.
+ *
+ * @param token The token returned from the corresponding [down event][sendDown] that started
+ * this gesture.
+ * @param position The position of the cancel event, in the component's local coordinate system
+ */
+fun PartialGestureScope.sendCancel(token: GestureToken, position: PxPosition? = null) {
+ val globalPosition = position?.let { localToGlobal(it) } ?: token.lastPosition
+ semanticsNodeInteraction.sendInput {
+ it.sendCancel(token, globalPosition)
+ }
+}
diff --git a/ui/ui-test/src/main/java/androidx/ui/test/InputDispatcher.kt b/ui/ui-test/src/main/java/androidx/ui/test/InputDispatcher.kt
index c091204..c7ac472 100644
--- a/ui/ui-test/src/main/java/androidx/ui/test/InputDispatcher.kt
+++ b/ui/ui-test/src/main/java/androidx/ui/test/InputDispatcher.kt
@@ -16,7 +16,6 @@
package androidx.ui.test
-import androidx.annotation.RestrictTo
import androidx.ui.unit.Duration
import androidx.ui.unit.PxPosition
import androidx.ui.unit.inMilliseconds
@@ -32,17 +31,6 @@
fun sendClick(position: PxPosition)
/**
- * Sends a press event at [position]. This is similar to [sendClick] however, only a down event
- * will be sent with no following up event.
- *
- * @param position The coordinate of the down event
- *
- * @suppress
- */
- @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
- fun sendTouchDown(position: PxPosition)
-
- /**
* Sends a swipe gesture from [start] to [end] with the given [duration]. This method blocks
* until all input events have been dispatched.
*
@@ -80,9 +68,83 @@
* first event time of the next gesture will be exactly [duration] later then if that gesture
* would be injected without this delay.
*
+ * Note: this does not affect the time of the next event for the _current_ partial gesture,
+ * using [sendMove], [sendUp] and [sendCancel], but it will affect the time of the _next_
+ * gesture (including partial gestures started with [sendDown]).
+ *
* @param duration The duration of the delay. Must be positive
*/
fun delay(duration: Duration)
+ /**
+ * Sends a down event at [position] and returns a [token][GestureToken] to send subsequent
+ * touch events to continue this gesture. This method blocks until the input event has been
+ * dispatched.
+ *
+ * A full gesture starts with a down event at some position (this method) that indicates a
+ * finger has started touching the screen, followed by zero or more [move][sendMove] events
+ * that indicate the finger has moved around along those positions, and is finished by an
+ * [up][sendUp] or a [cancel][sendCancel] event that indicate the finger was lifted up from
+ * the screen. As long as the gesture is incomplete, keep in mind that an imaginary finger is
+ * actively touching the screen.
+ *
+ * In the context of testing, it is not necessary to complete a gesture with an up or cancel
+ * event, if the test ends before it expects the finger to be lifted from the screen.
+ *
+ * @param position The coordinate of the down event
+ * @return A [token][GestureToken] that must be passed to all subsequent events that are part
+ * of the gesture started by this method.
+ *
+ * @see sendMove
+ * @see sendUp
+ * @see sendCancel
+ */
+ fun sendDown(position: PxPosition): GestureToken
+
+ /**
+ * Sends a move event at [position], 10 milliseconds after the previous injected event of
+ * this gesture. This method blocks until the input event has been dispatched. See [sendDown]
+ * for more information on how to make complete gestures from partial gestures.
+ *
+ * @param token The token returned from the corresponding [down event][sendDown] that started
+ * this gesture.
+ * @param position The coordinate of the move event
+ *
+ * @see sendDown
+ * @see sendUp
+ * @see sendCancel
+ */
+ fun sendMove(token: GestureToken, position: PxPosition)
+
+ /**
+ * Sends an up event at [position], 10 milliseconds after the previous injected event of this
+ * gesture. This method blocks until the input event has been dispatched. See [sendDown] for
+ * more information on how to make complete gestures from partial gestures.
+ *
+ * @param token The token returned from the corresponding [down event][sendDown] that started
+ * this gesture.
+ * @param position The coordinate of the up event
+ *
+ * @see sendDown
+ * @see sendMove
+ * @see sendCancel
+ */
+ fun sendUp(token: GestureToken, position: PxPosition)
+
+ /**
+ * Sends a cancel event at [position], 10 milliseconds after the previous injected event of
+ * this gesture. This method blocks until the input event has been dispatched. See [sendDown]
+ * for more information on how to make complete gestures from partial gestures.
+ *
+ * @param token The token returned from the corresponding [down event][sendDown] that started
+ * this gesture.
+ * @param position The coordinate of the cancel event
+ *
+ * @see sendDown
+ * @see sendMove
+ * @see sendUp
+ */
+ fun sendCancel(token: GestureToken, position: PxPosition)
+
// TODO(b/145593752): how to solve multi-touch?
}
diff --git a/ui/ui-test/src/main/java/androidx/ui/test/Output.kt b/ui/ui-test/src/main/java/androidx/ui/test/Output.kt
index 6849239..8f6f9cc 100644
--- a/ui/ui-test/src/main/java/androidx/ui/test/Output.kt
+++ b/ui/ui-test/src/main/java/androidx/ui/test/Output.kt
@@ -23,11 +23,11 @@
* collected before. So the output can change over time if the tree changes.
*/
fun SemanticsNodeInteraction.dumpToString(): String {
- val nodes = fetchSemanticsNodes()
- return if (nodes.isEmpty()) {
+ val result = fetchSemanticsNodes()
+ return if (result.selectedNodes.isEmpty()) {
"There were 0 nodes found!"
} else {
- nodes.toStringInfo()
+ result.selectedNodes.toStringInfo()
}
}
@@ -37,8 +37,8 @@
* Note that this will fetch the latest snapshot of nodes it sees in the hierarchy for the IDs it
* collected before. So the output can change over time if the tree changes.
*/
-fun Collection<SemanticsNodeInteraction>.dumpToString(): String {
- val nodes = this.flatMap { it.fetchSemanticsNodes() }
+fun SemanticsNodeInteractionCollection.dumpToString(): String {
+ val nodes = fetchSemanticsNodes()
return if (nodes.isEmpty()) {
"There were 0 nodes found!"
} else {
diff --git a/ui/ui-test/src/main/java/androidx/ui/test/Selectors.kt b/ui/ui-test/src/main/java/androidx/ui/test/Selectors.kt
index 20b7c43..81a3e4f 100644
--- a/ui/ui-test/src/main/java/androidx/ui/test/Selectors.kt
+++ b/ui/ui-test/src/main/java/androidx/ui/test/Selectors.kt
@@ -32,22 +32,18 @@
* none or more than one element is found.
*/
fun SemanticsNodeInteraction.parent(): SemanticsNodeInteraction {
- val node = fetchSemanticsNode("Failed to retrieve a parent.")
-
- val parentMatcher = selector.appendSelector("parent") { listOfNotNull(node.parent) }
- return SemanticsNodeInteraction(parentMatcher)
+ return SemanticsNodeInteraction(
+ selector.addSelectionFromSingleNode("parent") { listOfNotNull(it.parent) }
+ )
}
/**
* Returns children of this node.
*/
-fun SemanticsNodeInteraction.children(): List<SemanticsNodeInteraction> {
- val node = fetchSemanticsNode("Failed to retrieve children.")
-
- val childrenMatcher = selector.appendSelector("children") { node.children }
- return childrenMatcher.match(getAllSemanticsNodes()).map {
- SemanticsNodeInteraction(it, childrenMatcher)
- }
+fun SemanticsNodeInteraction.children(): SemanticsNodeInteractionCollection {
+ return SemanticsNodeInteractionCollection(
+ selector.addSelectionFromSingleNode("children") { it.children }
+ )
}
/**
@@ -60,13 +56,19 @@
* none or more than one element is found.
*/
fun SemanticsNodeInteraction.child(): SemanticsNodeInteraction {
- val node = fetchSemanticsNode("Failed to retrieve a child.")
-
- val childMatcher = selector.appendSelector("child") { node.children }
- return SemanticsNodeInteraction(childMatcher)
+ return SemanticsNodeInteraction(
+ selector.addSelectionFromSingleNode("child") { it.children }
+ )
}
/**
+ * Returns child of this node at the given index.
+ *
+ * This is just a shortcut for "children[index]".
+ */
+fun SemanticsNodeInteraction.childAt(index: Int): SemanticsNodeInteraction = children()[index]
+
+/**
* Returns all siblings of this node.
*
* Example: For the following tree
@@ -78,13 +80,10 @@
* Returns B1, B3
* ```
*/
-fun SemanticsNodeInteraction.siblings(): List<SemanticsNodeInteraction> {
- val node = fetchSemanticsNode("Failed to retrieve siblings.")
-
- val siblingsMatcher = selector.appendSelector("siblings") { node.siblings }
- return siblingsMatcher.match(getAllSemanticsNodes()).map {
- SemanticsNodeInteraction(it, siblingsMatcher)
- }
+fun SemanticsNodeInteraction.siblings(): SemanticsNodeInteractionCollection {
+ return SemanticsNodeInteractionCollection(
+ selector.addSelectionFromSingleNode("siblings") { it.siblings }
+ )
}
/**
@@ -97,10 +96,9 @@
* none or more than one element is found.
*/
fun SemanticsNodeInteraction.sibling(): SemanticsNodeInteraction {
- val node = fetchSemanticsNode("Failed to retrieve a sibling.")
-
- val siblingsMatcher = selector.appendSelector("sibling") { node.siblings }
- return SemanticsNodeInteraction(siblingsMatcher)
+ return SemanticsNodeInteraction(
+ selector.addSelectionFromSingleNode("sibling") { it.siblings }
+ )
}
/**
@@ -114,11 +112,19 @@
* Returns B, A
* ```
*/
-fun SemanticsNodeInteraction.ancestors(): List<SemanticsNodeInteraction> {
- val node = fetchSemanticsNode("Failed to retrieve ancestors.")
+fun SemanticsNodeInteraction.ancestors(): SemanticsNodeInteractionCollection {
+ return SemanticsNodeInteractionCollection(
+ selector.addSelectionFromSingleNode("ancestors") { it.ancestors.toList() }
+ )
+}
- val ancestorsMatcher = selector.appendSelector("ancestors") { node.ancestors }
- return ancestorsMatcher.match(getAllSemanticsNodes()).map {
- SemanticsNodeInteraction(it, ancestorsMatcher)
- }
+/**
+ * Retrieve the first node in this collection.
+ *
+ * Any subsequent operation on its result will expect exactly one element found (unless
+ * [SemanticsNodeInteraction.assertDoesNotExist] is used) and will throw [AssertionError] if
+ * no element is found.
+ */
+fun SemanticsNodeInteractionCollection.first(): SemanticsNodeInteraction {
+ return get(0)
}
\ No newline at end of file
diff --git a/ui/ui-test/src/main/java/androidx/ui/test/SemanticsMatcher.kt b/ui/ui-test/src/main/java/androidx/ui/test/SemanticsMatcher.kt
index 04e3f7f..23eae19 100644
--- a/ui/ui-test/src/main/java/androidx/ui/test/SemanticsMatcher.kt
+++ b/ui/ui-test/src/main/java/androidx/ui/test/SemanticsMatcher.kt
@@ -25,24 +25,22 @@
*/
class SemanticsMatcher(
val description: String,
- private val selector: (Iterable<SemanticsNode>) -> Iterable<SemanticsNode>
+ private val matcher: (SemanticsNode) -> Boolean
) {
companion object {
/**
* Predicate that matches anything.
*/
- val any: SemanticsMatcher = SemanticsMatcher("Any") { nodes ->
- nodes
- }
+ val any: SemanticsMatcher = SemanticsMatcher("Any") { true }
/**
* Builds a predicate that tests whether the value of the given [key] is equal to
* [expectedValue].
*/
fun <T> expectValue(key: SemanticsPropertyKey<T>, expectedValue: T): SemanticsMatcher {
- return fromCondition("${key.name} = '$expectedValue'") {
- config.getOrElseNullable(key) { null } == expectedValue
+ return SemanticsMatcher("${key.name} = '$expectedValue'") {
+ it.config.getOrElseNullable(key) { null } == expectedValue
}
}
@@ -50,8 +48,8 @@
* Builds a predicate that tests whether the given [key] is defined in semantics.
*/
fun <T> keyIsDefined(key: SemanticsPropertyKey<T>): SemanticsMatcher {
- return fromCondition("${key.name} is defined") {
- key in config
+ return SemanticsMatcher("${key.name} is defined") {
+ key in it.config
}
}
@@ -59,24 +57,8 @@
* Builds a predicate that tests whether the given [key] is NOT defined in semantics.
*/
fun <T> keyNotDefined(key: SemanticsPropertyKey<T>): SemanticsMatcher {
- return fromCondition("${key.name} is NOT defined") {
- key !in config
- }
- }
-
- /**
- * Creates a matcher that will match using a provided boolean selector.
- *
- * @param description Description of the condition being performed (will be displayed to the
- * developer when this matcher fails).
- * @param selector The filter lambda to use to build the matcher.
- */
- fun fromCondition(
- description: String,
- selector: SemanticsNode.() -> Boolean
- ): SemanticsMatcher {
- return SemanticsMatcher(description) { nodes ->
- nodes.filter { selector(it) }
+ return SemanticsMatcher("${key.name} is NOT defined") {
+ key !in it.config
}
}
}
@@ -85,48 +67,31 @@
* Returns whether the given node is matched by this matcher.
*/
fun matches(node: SemanticsNode): Boolean {
- return selector(listOf(node)).count() == 1
+ return matcher(node)
}
/**
* Returns whether at least one of the given nodes is matched by this matcher.
*/
fun matchesAny(nodes: Iterable<SemanticsNode>): Boolean {
- return selector(nodes).count() >= 1
- }
-
- /**
- * From the given nodes, returns all the nodes that got matched by this matcher.
- */
- fun match(nodes: Iterable<SemanticsNode>): Iterable<SemanticsNode> {
- return selector(nodes)
+ return nodes.any(matcher)
}
infix fun and(other: SemanticsMatcher): SemanticsMatcher {
- val desc = "($description) && (${other.description})"
- return SemanticsMatcher(desc) { nodes ->
- selector(nodes).intersect(other.selector(nodes))
+ return SemanticsMatcher("($description) && (${other.description})") {
+ matcher(it) && other.matches(it)
}
}
infix fun or(other: SemanticsMatcher): SemanticsMatcher {
- val desc = "($description) || (${other.description})"
- return SemanticsMatcher(desc) { nodes ->
- selector(nodes).union(other.selector(nodes))
+ return SemanticsMatcher("($description) || (${other.description})") {
+ matcher(it) || other.matches(it)
}
}
operator fun not(): SemanticsMatcher {
- val desc = "NOT ($description)"
- return SemanticsMatcher(desc) { nodes ->
- nodes.subtract(selector(nodes))
+ return SemanticsMatcher("NOT ($description)") {
+ !matcher(it)
}
}
-}
-
-internal fun SemanticsMatcher.appendSelector(
- description: String,
- selector: (Iterable<SemanticsNode>) -> Iterable<SemanticsNode>
-): SemanticsMatcher {
- return SemanticsMatcher("(${this.description}).$description", selector)
}
\ No newline at end of file
diff --git a/ui/ui-test/src/main/java/androidx/ui/test/SemanticsNodeInteraction.kt b/ui/ui-test/src/main/java/androidx/ui/test/SemanticsNodeInteraction.kt
index 4d1a82b..5b6af3a 100644
--- a/ui/ui-test/src/main/java/androidx/ui/test/SemanticsNodeInteraction.kt
+++ b/ui/ui-test/src/main/java/androidx/ui/test/SemanticsNodeInteraction.kt
@@ -20,34 +20,24 @@
import androidx.ui.core.semantics.SemanticsNode
import androidx.ui.test.android.AndroidInputDispatcher
-internal fun SemanticsNodeInteraction(
- node: SemanticsNode,
- selector: SemanticsMatcher
-): SemanticsNodeInteraction {
- return SemanticsNodeInteraction(listOf(node), selector)
-}
-
-internal fun SemanticsNodeInteraction(
- selector: SemanticsMatcher
-): SemanticsNodeInteraction {
- val matchedNodes = selector.match(getAllSemanticsNodes()).toList()
- return SemanticsNodeInteraction(matchedNodes, selector)
-}
-
/**
- * Represents a component with which one can interact with the hierarchy.
- * Examples of interactions include [findByTag], [isToggleable], [assertIsOn], [doClick]
+ * Represents a semantics node and the path to fetch it from the semantics tree. One can interact
+ * with this node by performing actions such as [doClick], assertions such as
+ * [assertHasClickAction], or navigate to other nodes such as [children].
+ *
+ * This is usually obtained from methods like [findByTag], [find].
*
* Example usage:
+ * ```
* findByTag("myCheckbox")
* .doClick()
* .assertIsOn()
+ * ````
*/
class SemanticsNodeInteraction internal constructor(
- nodes: List<SemanticsNode>,
- internal val selector: SemanticsMatcher
+ internal val selector: SemanticsSelector
) {
- private val nodeIds: List<Int> = nodes.map { it.id }.toList()
+ private var nodeIds: List<Int>? = null
/**
* Anytime we refresh semantics we capture it here. This is then presented to the user in case
@@ -55,10 +45,16 @@
* node before it disappeared. We dump it to string because trying to dump the node later can
* result in failure as it gets detached from its layout.
*/
- private var lastSeenSemantics: String? = nodes.firstOrNull()?.toStringInfo()
+ private var lastSeenSemantics: String? = null
- internal fun fetchSemanticsNodes(): List<SemanticsNode> {
- return getAllSemanticsNodes().filter { it.id in nodeIds }
+ internal fun fetchSemanticsNodes(errorMessageOnFail: String? = null): SelectionResult {
+ if (nodeIds == null) {
+ return selector
+ .map(getAllSemanticsNodes(), errorMessageOnFail.orEmpty())
+ .apply { nodeIds = selectedNodes.map { it.id }.toList() }
+ }
+
+ return SelectionResult(getAllSemanticsNodes().filter { it.id in nodeIds!! })
}
/**
@@ -92,12 +88,12 @@
* @throws [AssertionError] if the assert fails.
*/
fun assertDoesNotExist() {
- val nodes = fetchSemanticsNodes()
- if (nodes.isNotEmpty()) {
+ val result = fetchSemanticsNodes("Failed: assertDoesNotExist.")
+ if (result.selectedNodes.isNotEmpty()) {
throw AssertionError(buildErrorMessageForCountMismatch(
errorMessage = "Failed: assertDoesNotExist.",
selector = selector,
- foundNodes = nodes,
+ foundNodes = result.selectedNodes,
expectedCount = 0
))
}
@@ -122,13 +118,12 @@
}
private fun fetchOneOrDie(errorMessageOnFail: String? = null): SemanticsNode {
- val nodes = fetchSemanticsNodes()
+ val finalErrorMessage = errorMessageOnFail
+ ?: "Failed: assertExists."
- if (nodes.size != 1) {
- val finalErrorMessage = errorMessageOnFail
- ?: "Failed: assertExists."
-
- if (nodes.isEmpty() && lastSeenSemantics != null) {
+ val result = fetchSemanticsNodes(finalErrorMessage)
+ if (result.selectedNodes.count() != 1) {
+ if (result.selectedNodes.isEmpty() && lastSeenSemantics != null) {
// This means that node we used to have is no longer in the tree.
throw AssertionError(buildErrorMessageForNodeMissingInTree(
errorMessage = finalErrorMessage,
@@ -137,20 +132,72 @@
))
}
+ if (result.customErrorOnNoMatch != null) {
+ throw AssertionError(finalErrorMessage + "\n" + result.customErrorOnNoMatch)
+ }
+
throw AssertionError(buildErrorMessageForCountMismatch(
errorMessage = finalErrorMessage,
- foundNodes = nodes,
+ foundNodes = result.selectedNodes,
expectedCount = 1,
selector = selector
))
}
- lastSeenSemantics = nodes.first().toStringInfo()
- return nodes.first()
+ lastSeenSemantics = result.selectedNodes.first().toStringInfo()
+ return result.selectedNodes.first()
}
}
-internal var inputDispatcherFactory: (SemanticsNode) -> InputDispatcher = { node ->
+/**
+ * Represents a collection of semantics nodes and the path to fetch them from the semantics tree.
+ * One can interact with these nodes by performing assertions such as [assertCountEquals], or
+ * navigate to other nodes such as [get].
+ *
+ * This is usually obtained from methods like [findAll] or chains of [find].[children].
+ *
+ * Example usage:
+ * ```
+ * findAll(isClickable())
+ * .assertCountEquals(2)
+ * ````
+ */
+class SemanticsNodeInteractionCollection(
+ internal val selector: SemanticsSelector
+) {
+ private var nodeIds: List<Int>? = null
+
+ /**
+ * Returns the semantics nodes captured by this object.
+ *
+ * Note: Accessing this object involves synchronization with your UI. If you are accessing this
+ * multiple times in one atomic operation, it is better to cache the result instead of calling
+ * this API multiple times.
+ */
+ fun fetchSemanticsNodes(errorMessageOnFail: String? = null): List<SemanticsNode> {
+ if (nodeIds == null) {
+ return selector
+ .map(getAllSemanticsNodes(), errorMessageOnFail.orEmpty())
+ .apply { nodeIds = selectedNodes.map { it.id }.toList() }
+ .selectedNodes
+ }
+
+ return getAllSemanticsNodes().filter { it.id in nodeIds!! }
+ }
+
+ /**
+ * Retrieve node at the given index of this collection.
+ *
+ * Any subsequent operation on its result will expect exactly one element found (unless
+ * [SemanticsNodeInteraction.assertDoesNotExist] is used) and will throw [AssertionError] if
+ * none or more than one element is found.
+ */
+ operator fun get(index: Int): SemanticsNodeInteraction {
+ return SemanticsNodeInteraction(selector.addIndexSelector(index))
+ }
+}
+
+private var inputDispatcherFactory: (SemanticsNode) -> InputDispatcher = { node ->
val view = (node.componentNode.owner as AndroidOwner).view
AndroidInputDispatcher { view.dispatchTouchEvent(it) }
}
diff --git a/ui/ui-test/src/main/java/androidx/ui/test/SemanticsSelector.kt b/ui/ui-test/src/main/java/androidx/ui/test/SemanticsSelector.kt
new file mode 100644
index 0000000..34c9f49
--- /dev/null
+++ b/ui/ui-test/src/main/java/androidx/ui/test/SemanticsSelector.kt
@@ -0,0 +1,121 @@
+/*
+ * Copyright 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT 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.ui.test
+
+import androidx.ui.core.semantics.SemanticsNode
+
+/**
+ * Projects the given set of nodes to a new set of nodes.
+ *
+ * @param description Description that is displayed to the developer in error outputs.
+ * @param requiresExactlyOneNode Whether this selector should expect to receive exactly 1 node.
+ * @param chainedInputSelector Optional selector to apply before this selector gets applied.
+ * @param selector The lambda that implements the projection.
+ */
+class SemanticsSelector(
+ val description: String,
+ private val requiresExactlyOneNode: Boolean,
+ private val chainedInputSelector: SemanticsSelector? = null,
+ private val selector: (Iterable<SemanticsNode>) -> SelectionResult
+) {
+
+ /**
+ * Maps the given list of nodes to a new list of nodes.
+ *
+ * @throws AssertionError if required prerequisites to perform the selection were not satisfied.
+ */
+ fun map(nodes: Iterable<SemanticsNode>, errorOnFail: String): SelectionResult {
+ val chainedResult = chainedInputSelector?.map(nodes, errorOnFail)
+ val inputNodes = chainedResult?.selectedNodes ?: nodes
+ if (requiresExactlyOneNode && inputNodes.count() != 1) {
+ throw AssertionError(
+ chainedResult?.customErrorOnNoMatch ?: buildErrorMessageForCountMismatch(
+ errorMessage = errorOnFail,
+ foundNodes = inputNodes.toList(),
+ expectedCount = 1,
+ selector = chainedInputSelector ?: this
+ )
+ )
+ }
+ return selector(inputNodes)
+ }
+}
+
+/**
+ * Creates a new [SemanticsSelector] based on the given [SemanticsMatcher].
+ */
+internal fun SemanticsSelector(matcher: SemanticsMatcher): SemanticsSelector {
+ return SemanticsSelector(
+ matcher.description,
+ requiresExactlyOneNode = false,
+ chainedInputSelector = null
+ ) {
+ nodes -> SelectionResult(nodes.filter { matcher.matches(it) })
+ }
+}
+
+/**
+ * Result of [SemanticsSelector] projection.
+ *
+ * @param selectedNodes The result nodes found.
+ * @param customErrorOnNoMatch If the projection failed to map nodes due to wrong input (e.g.
+ * selector expected only 1 node but got multiple) it will provide a custom error exactly explaining
+ * what selection was performed and what nodes it received.
+ */
+class SelectionResult(
+ val selectedNodes: List<SemanticsNode>,
+ val customErrorOnNoMatch: String? = null
+)
+
+/**
+ * Chains the given selector to be performed after this one.
+ *
+ * The new selector will expect to receive exactly one node (otherwise will fail).
+ */
+internal fun SemanticsSelector.addSelectionFromSingleNode(
+ description: String,
+ selector: (SemanticsNode) -> List<SemanticsNode>
+): SemanticsSelector {
+ return SemanticsSelector(
+ "(${this.description}).$description",
+ requiresExactlyOneNode = true,
+ chainedInputSelector = this
+ ) {
+ nodes -> SelectionResult(selector(nodes.first()))
+ }
+}
+
+/**
+ * Chains a new selector that retrieves node from this selector at the given [index].
+ */
+internal fun SemanticsSelector.addIndexSelector(
+ index: Int
+): SemanticsSelector {
+ return SemanticsSelector(
+ "(${this.description})[$index]",
+ requiresExactlyOneNode = false,
+ chainedInputSelector = this
+ ) { nodes ->
+ val nodesList = nodes.toList()
+ if (index >= 0 && index < nodesList.size) {
+ SelectionResult(listOf(nodesList[index]))
+ } else {
+ val errorMessage = buildIndexErrorMessage(index, this, nodesList)
+ SelectionResult(emptyList(), errorMessage)
+ }
+ }
+}
\ No newline at end of file
diff --git a/ui/ui-test/src/main/java/androidx/ui/test/android/AndroidInputDispatcher.kt b/ui/ui-test/src/main/java/androidx/ui/test/android/AndroidInputDispatcher.kt
index 541ea8d..bb03972 100644
--- a/ui/ui-test/src/main/java/androidx/ui/test/android/AndroidInputDispatcher.kt
+++ b/ui/ui-test/src/main/java/androidx/ui/test/android/AndroidInputDispatcher.kt
@@ -20,9 +20,11 @@
import android.os.Looper
import android.os.SystemClock
import android.view.MotionEvent
+import android.view.MotionEvent.ACTION_CANCEL
import android.view.MotionEvent.ACTION_DOWN
import android.view.MotionEvent.ACTION_MOVE
import android.view.MotionEvent.ACTION_UP
+import androidx.ui.test.GestureToken
import androidx.ui.test.InputDispatcher
import androidx.ui.unit.Duration
import androidx.ui.unit.PxPosition
@@ -65,9 +67,14 @@
private var nextDownTime = DownTimeNotSet
/**
- * Generates the downTime of the next gesture. The gesture's [duration] is necessary to
- * facilitate chaining of gestures. Always use this method to determine the downTime of the
- * [ACTION_DOWN] event of a gesture.
+ * Generates the downTime of the next gesture with the given [duration]. The gesture's
+ * [duration] is necessary to facilitate chaining of gestures: if another gesture is made
+ * after the next one, it will start exactly [duration] after the start of the next gesture.
+ * Always use this method to determine the downTime of the [ACTION_DOWN] event of a gesture.
+ *
+ * If the duration is unknown when calling this method, use a duration of zero and update
+ * with [moveNextDownTime] when the duration is known, or use [moveNextDownTime]
+ * incrementally if the gesture unfolds gradually.
*/
private fun generateDownTime(duration: Duration): Long {
val downTime = if (nextDownTime == DownTimeNotSet) {
@@ -79,11 +86,20 @@
return downTime
}
+ /**
+ * Moves the start time of the next gesture ahead by the given [duration]. Does not affect
+ * any event time from the current gesture. Use this when the expected duration passed to
+ * [generateDownTime] has changed.
+ */
+ private fun moveNextDownTime(duration: Duration) {
+ generateDownTime(duration)
+ }
+
override fun delay(duration: Duration) {
require(duration >= Duration.Zero) {
"duration of a delay can only be positive, not $duration"
}
- generateDownTime(duration)
+ moveNextDownTime(duration)
sleepUntil(nextDownTime)
}
@@ -93,9 +109,34 @@
sendMotionEvent(downTime, downTime + eventPeriod, ACTION_UP, position)
}
- override fun sendTouchDown(position: PxPosition) {
- val downTime = generateDownTime(eventPeriod.milliseconds)
+ override fun sendDown(position: PxPosition): GestureToken {
+ val downTime = generateDownTime(0.milliseconds)
sendMotionEvent(downTime, downTime, ACTION_DOWN, position)
+ return GestureToken(downTime, position)
+ }
+
+ override fun sendMove(token: GestureToken, position: PxPosition) {
+ sendNextMotionEvent(token, ACTION_MOVE, position)
+ }
+
+ override fun sendUp(token: GestureToken, position: PxPosition) {
+ sendNextMotionEvent(token, ACTION_UP, position)
+ token.finished = true
+ }
+
+ override fun sendCancel(token: GestureToken, position: PxPosition) {
+ sendNextMotionEvent(token, ACTION_CANCEL, position)
+ token.finished = true
+ }
+
+ private fun sendNextMotionEvent(token: GestureToken, action: Int, position: PxPosition) {
+ require(!token.finished) {
+ "Can't send an event to a gesture that already had an up or cancel event"
+ }
+ moveNextDownTime(eventPeriod.milliseconds)
+ token.eventTime += eventPeriod
+ token.lastPosition = position
+ sendMotionEvent(token.downTime, token.eventTime, action, position)
}
override fun sendSwipe(
@@ -227,13 +268,17 @@
* immediately without blocking. See also [dispatchInRealTime].
* @param eventPeriodOverride If set, specifies a different period in milliseconds between
* two consecutive injected motion events injected by this [AndroidInputDispatcher]. If not
- * set, the event period of 10 milliseconds is unchanged. See also [eventPeriod].
+ * set, the event period of 10 milliseconds is unchanged.
+ *
+ * @see AndroidInputDispatcher.eventPeriod
*/
internal class TestRule(
private val disableDispatchInRealTime: Boolean = false,
private val eventPeriodOverride: Long? = null
) : org.junit.rules.TestRule {
+ val eventPeriod get() = AndroidInputDispatcher.eventPeriod
+
override fun apply(base: Statement, description: Description?): Statement {
return ModifyingStatement(base)
}
@@ -244,7 +289,7 @@
dispatchInRealTime = false
}
if (eventPeriodOverride != null) {
- eventPeriod = eventPeriodOverride
+ AndroidInputDispatcher.eventPeriod = eventPeriodOverride
}
try {
base.evaluate()
@@ -253,7 +298,7 @@
dispatchInRealTime = true
}
if (eventPeriodOverride != null) {
- eventPeriod = 10L
+ AndroidInputDispatcher.eventPeriod = 10L
}
}
}
diff --git a/ui/ui-test/src/main/java/androidx/ui/test/android/SynchronizedTreeCollector.kt b/ui/ui-test/src/main/java/androidx/ui/test/android/SynchronizedTreeCollector.kt
index 988494c..7fd58ff 100644
--- a/ui/ui-test/src/main/java/androidx/ui/test/android/SynchronizedTreeCollector.kt
+++ b/ui/ui-test/src/main/java/androidx/ui/test/android/SynchronizedTreeCollector.kt
@@ -19,11 +19,17 @@
import android.app.Activity
import android.content.Context
import android.content.ContextWrapper
+import android.view.Choreographer
+import androidx.compose.onCommit
import androidx.lifecycle.Lifecycle
import androidx.test.espresso.Espresso
import androidx.ui.core.AndroidOwner
import androidx.ui.core.semantics.SemanticsNode
import androidx.ui.core.semantics.getAllSemanticsNodes
+import androidx.ui.test.isOnUiThread
+import androidx.ui.test.runOnUiThread
+import java.util.concurrent.CountDownLatch
+import java.util.concurrent.TimeUnit
/**
* Collects all [AndroidOwner]s that are part of the currently visible window.
@@ -69,6 +75,19 @@
internal fun waitForIdle() {
registerComposeWithEspresso()
Espresso.onIdle()
+ waitForOnCommitCallbacks()
+ }
+
+ /**
+ * Waits for all scheduled [onCommit] callbacks to be executed.
+ */
+ private fun waitForOnCommitCallbacks() {
+ require(!isOnUiThread())
+ val latch = CountDownLatch(1)
+ runOnUiThread {
+ Choreographer.getInstance().postFrameCallbackDelayed({ latch.countDown() }, 1)
+ }
+ latch.await(1, TimeUnit.SECONDS)
}
}
diff --git a/ui/ui-text-core/api/0.1.0-dev11.txt b/ui/ui-text-core/api/0.1.0-dev11.txt
index e2da96a..810eb81 100644
--- a/ui/ui-text-core/api/0.1.0-dev11.txt
+++ b/ui/ui-text-core/api/0.1.0-dev11.txt
@@ -841,11 +841,11 @@
public final inline class BaselineShift {
ctor public BaselineShift();
method public static float constructor-impl(float multiplier);
- method public static boolean equals-impl(float p, Object? p1);
+ method public static inline boolean equals-impl(float p, Object? p1);
method public static boolean equals-impl0(float p1, float p2);
method public float getMultiplier();
- method public static int hashCode-impl(float p);
- method public static String toString-impl(float p);
+ method public static inline int hashCode-impl(float p);
+ method public static inline String! toString-impl(float p);
field public static final androidx.ui.text.style.BaselineShift.Companion! Companion;
}
diff --git a/ui/ui-text-core/api/api_lint.ignore b/ui/ui-text-core/api/api_lint.ignore
index 5b8d982..f6d6d03 100644
--- a/ui/ui-text-core/api/api_lint.ignore
+++ b/ui/ui-text-core/api/api_lint.ignore
@@ -11,3 +11,7 @@
MissingBuildMethod: androidx.ui.text.AnnotatedString.Builder:
androidx.ui.text.AnnotatedString.Builder does not declare a `build()` method, but builder classes are expected to
+
+
+MissingNullability: androidx.ui.text.style.BaselineShift#toString-impl(float):
+ Missing nullability on method `toString-impl` return
diff --git a/ui/ui-text-core/api/current.txt b/ui/ui-text-core/api/current.txt
index e2da96a..810eb81 100644
--- a/ui/ui-text-core/api/current.txt
+++ b/ui/ui-text-core/api/current.txt
@@ -841,11 +841,11 @@
public final inline class BaselineShift {
ctor public BaselineShift();
method public static float constructor-impl(float multiplier);
- method public static boolean equals-impl(float p, Object? p1);
+ method public static inline boolean equals-impl(float p, Object? p1);
method public static boolean equals-impl0(float p1, float p2);
method public float getMultiplier();
- method public static int hashCode-impl(float p);
- method public static String toString-impl(float p);
+ method public static inline int hashCode-impl(float p);
+ method public static inline String! toString-impl(float p);
field public static final androidx.ui.text.style.BaselineShift.Companion! Companion;
}
diff --git a/ui/ui-text-core/api/public_plus_experimental_0.1.0-dev11.txt b/ui/ui-text-core/api/public_plus_experimental_0.1.0-dev11.txt
index e2da96a..810eb81 100644
--- a/ui/ui-text-core/api/public_plus_experimental_0.1.0-dev11.txt
+++ b/ui/ui-text-core/api/public_plus_experimental_0.1.0-dev11.txt
@@ -841,11 +841,11 @@
public final inline class BaselineShift {
ctor public BaselineShift();
method public static float constructor-impl(float multiplier);
- method public static boolean equals-impl(float p, Object? p1);
+ method public static inline boolean equals-impl(float p, Object? p1);
method public static boolean equals-impl0(float p1, float p2);
method public float getMultiplier();
- method public static int hashCode-impl(float p);
- method public static String toString-impl(float p);
+ method public static inline int hashCode-impl(float p);
+ method public static inline String! toString-impl(float p);
field public static final androidx.ui.text.style.BaselineShift.Companion! Companion;
}
diff --git a/ui/ui-text-core/api/public_plus_experimental_current.txt b/ui/ui-text-core/api/public_plus_experimental_current.txt
index e2da96a..810eb81 100644
--- a/ui/ui-text-core/api/public_plus_experimental_current.txt
+++ b/ui/ui-text-core/api/public_plus_experimental_current.txt
@@ -841,11 +841,11 @@
public final inline class BaselineShift {
ctor public BaselineShift();
method public static float constructor-impl(float multiplier);
- method public static boolean equals-impl(float p, Object? p1);
+ method public static inline boolean equals-impl(float p, Object? p1);
method public static boolean equals-impl0(float p1, float p2);
method public float getMultiplier();
- method public static int hashCode-impl(float p);
- method public static String toString-impl(float p);
+ method public static inline int hashCode-impl(float p);
+ method public static inline String! toString-impl(float p);
field public static final androidx.ui.text.style.BaselineShift.Companion! Companion;
}
diff --git a/ui/ui-text-core/api/restricted_0.1.0-dev11.txt b/ui/ui-text-core/api/restricted_0.1.0-dev11.txt
index b354f19..118f48c 100644
--- a/ui/ui-text-core/api/restricted_0.1.0-dev11.txt
+++ b/ui/ui-text-core/api/restricted_0.1.0-dev11.txt
@@ -870,11 +870,11 @@
public final inline class BaselineShift {
ctor public BaselineShift();
method public static float constructor-impl(float multiplier);
- method public static boolean equals-impl(float p, Object? p1);
+ method public static inline boolean equals-impl(float p, Object? p1);
method public static boolean equals-impl0(float p1, float p2);
method public float getMultiplier();
- method public static int hashCode-impl(float p);
- method public static String toString-impl(float p);
+ method public static inline int hashCode-impl(float p);
+ method public static inline String! toString-impl(float p);
field public static final androidx.ui.text.style.BaselineShift.Companion! Companion;
}
diff --git a/ui/ui-text-core/api/restricted_current.txt b/ui/ui-text-core/api/restricted_current.txt
index b354f19..118f48c 100644
--- a/ui/ui-text-core/api/restricted_current.txt
+++ b/ui/ui-text-core/api/restricted_current.txt
@@ -870,11 +870,11 @@
public final inline class BaselineShift {
ctor public BaselineShift();
method public static float constructor-impl(float multiplier);
- method public static boolean equals-impl(float p, Object? p1);
+ method public static inline boolean equals-impl(float p, Object? p1);
method public static boolean equals-impl0(float p1, float p2);
method public float getMultiplier();
- method public static int hashCode-impl(float p);
- method public static String toString-impl(float p);
+ method public static inline int hashCode-impl(float p);
+ method public static inline String! toString-impl(float p);
field public static final androidx.ui.text.style.BaselineShift.Companion! Companion;
}
diff --git a/ui/ui-text/api/0.1.0-dev11.txt b/ui/ui-text/api/0.1.0-dev11.txt
index 72e5070..7871b83 100644
--- a/ui/ui-text/api/0.1.0-dev11.txt
+++ b/ui/ui-text/api/0.1.0-dev11.txt
@@ -11,6 +11,29 @@
method public static androidx.ui.core.HorizontalAlignmentLine getLastBaseline();
}
+ public final class TextFieldDelegate {
+ ctor public TextFieldDelegate();
+ method public static androidx.ui.input.TransformedText applyVisualFilter(androidx.ui.input.EditorValue value, androidx.ui.input.VisualTransformation? visualTransformation);
+ method public static void draw-VTazRi4(androidx.ui.graphics.Canvas canvas, androidx.ui.input.EditorValue value, androidx.ui.input.OffsetMap offsetMap, androidx.ui.text.TextLayoutResult textLayoutResult, long selectionColor);
+ method public static kotlin.Triple<androidx.ui.unit.IntPx,androidx.ui.unit.IntPx,androidx.ui.text.TextLayoutResult> layout(androidx.ui.text.TextDelegate textDelegate, androidx.ui.core.Constraints constraints, androidx.ui.core.LayoutDirection layoutDirection, androidx.ui.text.TextLayoutResult? prevResultText = null);
+ method public static void notifyFocusedRect(androidx.ui.input.EditorValue value, androidx.ui.text.TextDelegate textDelegate, androidx.ui.text.TextLayoutResult textLayoutResult, androidx.ui.core.LayoutCoordinates layoutCoordinates, androidx.ui.input.TextInputService textInputService, int token, boolean hasFocus, androidx.ui.input.OffsetMap offsetMap);
+ method public static void onBlur(androidx.ui.input.TextInputService? textInputService, int token, androidx.ui.input.EditProcessor editProcessor, boolean hasNextClient, kotlin.jvm.functions.Function1<? super androidx.ui.input.EditorValue,kotlin.Unit> onValueChange);
+ method public static int onFocus(androidx.ui.input.TextInputService? textInputService, androidx.ui.input.EditorValue value, androidx.ui.input.EditProcessor editProcessor, androidx.ui.input.KeyboardType keyboardType, androidx.ui.input.ImeAction imeAction, kotlin.jvm.functions.Function1<? super androidx.ui.input.EditorValue,kotlin.Unit> onValueChange, kotlin.jvm.functions.Function1<? super androidx.ui.input.ImeAction,kotlin.Unit> onImeActionPerformed);
+ method public static void onRelease(androidx.ui.unit.PxPosition position, androidx.ui.text.TextLayoutResult textLayoutResult, androidx.ui.input.EditProcessor editProcessor, androidx.ui.input.OffsetMap offsetMap, kotlin.jvm.functions.Function1<? super androidx.ui.input.EditorValue,kotlin.Unit> onValueChange, androidx.ui.input.TextInputService? textInputService, int token, boolean hasFocus);
+ field public static final androidx.ui.text.TextFieldDelegate.Companion! Companion;
+ }
+
+ public static final class TextFieldDelegate.Companion {
+ method public androidx.ui.input.TransformedText applyCompositionDecoration(androidx.ui.text.TextRange compositionRange, androidx.ui.input.TransformedText transformed);
+ method public androidx.ui.input.TransformedText applyVisualFilter(androidx.ui.input.EditorValue value, androidx.ui.input.VisualTransformation? visualTransformation);
+ method public void draw-VTazRi4(androidx.ui.graphics.Canvas canvas, androidx.ui.input.EditorValue value, androidx.ui.input.OffsetMap offsetMap, androidx.ui.text.TextLayoutResult textLayoutResult, long selectionColor);
+ method public kotlin.Triple<androidx.ui.unit.IntPx,androidx.ui.unit.IntPx,androidx.ui.text.TextLayoutResult> layout(androidx.ui.text.TextDelegate textDelegate, androidx.ui.core.Constraints constraints, androidx.ui.core.LayoutDirection layoutDirection, androidx.ui.text.TextLayoutResult? prevResultText = null);
+ method public void notifyFocusedRect(androidx.ui.input.EditorValue value, androidx.ui.text.TextDelegate textDelegate, androidx.ui.text.TextLayoutResult textLayoutResult, androidx.ui.core.LayoutCoordinates layoutCoordinates, androidx.ui.input.TextInputService textInputService, int token, boolean hasFocus, androidx.ui.input.OffsetMap offsetMap);
+ method public void onBlur(androidx.ui.input.TextInputService? textInputService, int token, androidx.ui.input.EditProcessor editProcessor, boolean hasNextClient, kotlin.jvm.functions.Function1<? super androidx.ui.input.EditorValue,kotlin.Unit> onValueChange);
+ method public int onFocus(androidx.ui.input.TextInputService? textInputService, androidx.ui.input.EditorValue value, androidx.ui.input.EditProcessor editProcessor, androidx.ui.input.KeyboardType keyboardType, androidx.ui.input.ImeAction imeAction, kotlin.jvm.functions.Function1<? super androidx.ui.input.EditorValue,kotlin.Unit> onValueChange, kotlin.jvm.functions.Function1<? super androidx.ui.input.ImeAction,kotlin.Unit> onImeActionPerformed);
+ method public void onRelease(androidx.ui.unit.PxPosition position, androidx.ui.text.TextLayoutResult textLayoutResult, androidx.ui.input.EditProcessor editProcessor, androidx.ui.input.OffsetMap offsetMap, kotlin.jvm.functions.Function1<? super androidx.ui.input.EditorValue,kotlin.Unit> onValueChange, androidx.ui.input.TextInputService? textInputService, int token, boolean hasFocus);
+ }
+
public final class TextFieldDelegateKt {
}
diff --git a/ui/ui-text/api/current.txt b/ui/ui-text/api/current.txt
index 72e5070..7871b83 100644
--- a/ui/ui-text/api/current.txt
+++ b/ui/ui-text/api/current.txt
@@ -11,6 +11,29 @@
method public static androidx.ui.core.HorizontalAlignmentLine getLastBaseline();
}
+ public final class TextFieldDelegate {
+ ctor public TextFieldDelegate();
+ method public static androidx.ui.input.TransformedText applyVisualFilter(androidx.ui.input.EditorValue value, androidx.ui.input.VisualTransformation? visualTransformation);
+ method public static void draw-VTazRi4(androidx.ui.graphics.Canvas canvas, androidx.ui.input.EditorValue value, androidx.ui.input.OffsetMap offsetMap, androidx.ui.text.TextLayoutResult textLayoutResult, long selectionColor);
+ method public static kotlin.Triple<androidx.ui.unit.IntPx,androidx.ui.unit.IntPx,androidx.ui.text.TextLayoutResult> layout(androidx.ui.text.TextDelegate textDelegate, androidx.ui.core.Constraints constraints, androidx.ui.core.LayoutDirection layoutDirection, androidx.ui.text.TextLayoutResult? prevResultText = null);
+ method public static void notifyFocusedRect(androidx.ui.input.EditorValue value, androidx.ui.text.TextDelegate textDelegate, androidx.ui.text.TextLayoutResult textLayoutResult, androidx.ui.core.LayoutCoordinates layoutCoordinates, androidx.ui.input.TextInputService textInputService, int token, boolean hasFocus, androidx.ui.input.OffsetMap offsetMap);
+ method public static void onBlur(androidx.ui.input.TextInputService? textInputService, int token, androidx.ui.input.EditProcessor editProcessor, boolean hasNextClient, kotlin.jvm.functions.Function1<? super androidx.ui.input.EditorValue,kotlin.Unit> onValueChange);
+ method public static int onFocus(androidx.ui.input.TextInputService? textInputService, androidx.ui.input.EditorValue value, androidx.ui.input.EditProcessor editProcessor, androidx.ui.input.KeyboardType keyboardType, androidx.ui.input.ImeAction imeAction, kotlin.jvm.functions.Function1<? super androidx.ui.input.EditorValue,kotlin.Unit> onValueChange, kotlin.jvm.functions.Function1<? super androidx.ui.input.ImeAction,kotlin.Unit> onImeActionPerformed);
+ method public static void onRelease(androidx.ui.unit.PxPosition position, androidx.ui.text.TextLayoutResult textLayoutResult, androidx.ui.input.EditProcessor editProcessor, androidx.ui.input.OffsetMap offsetMap, kotlin.jvm.functions.Function1<? super androidx.ui.input.EditorValue,kotlin.Unit> onValueChange, androidx.ui.input.TextInputService? textInputService, int token, boolean hasFocus);
+ field public static final androidx.ui.text.TextFieldDelegate.Companion! Companion;
+ }
+
+ public static final class TextFieldDelegate.Companion {
+ method public androidx.ui.input.TransformedText applyCompositionDecoration(androidx.ui.text.TextRange compositionRange, androidx.ui.input.TransformedText transformed);
+ method public androidx.ui.input.TransformedText applyVisualFilter(androidx.ui.input.EditorValue value, androidx.ui.input.VisualTransformation? visualTransformation);
+ method public void draw-VTazRi4(androidx.ui.graphics.Canvas canvas, androidx.ui.input.EditorValue value, androidx.ui.input.OffsetMap offsetMap, androidx.ui.text.TextLayoutResult textLayoutResult, long selectionColor);
+ method public kotlin.Triple<androidx.ui.unit.IntPx,androidx.ui.unit.IntPx,androidx.ui.text.TextLayoutResult> layout(androidx.ui.text.TextDelegate textDelegate, androidx.ui.core.Constraints constraints, androidx.ui.core.LayoutDirection layoutDirection, androidx.ui.text.TextLayoutResult? prevResultText = null);
+ method public void notifyFocusedRect(androidx.ui.input.EditorValue value, androidx.ui.text.TextDelegate textDelegate, androidx.ui.text.TextLayoutResult textLayoutResult, androidx.ui.core.LayoutCoordinates layoutCoordinates, androidx.ui.input.TextInputService textInputService, int token, boolean hasFocus, androidx.ui.input.OffsetMap offsetMap);
+ method public void onBlur(androidx.ui.input.TextInputService? textInputService, int token, androidx.ui.input.EditProcessor editProcessor, boolean hasNextClient, kotlin.jvm.functions.Function1<? super androidx.ui.input.EditorValue,kotlin.Unit> onValueChange);
+ method public int onFocus(androidx.ui.input.TextInputService? textInputService, androidx.ui.input.EditorValue value, androidx.ui.input.EditProcessor editProcessor, androidx.ui.input.KeyboardType keyboardType, androidx.ui.input.ImeAction imeAction, kotlin.jvm.functions.Function1<? super androidx.ui.input.EditorValue,kotlin.Unit> onValueChange, kotlin.jvm.functions.Function1<? super androidx.ui.input.ImeAction,kotlin.Unit> onImeActionPerformed);
+ method public void onRelease(androidx.ui.unit.PxPosition position, androidx.ui.text.TextLayoutResult textLayoutResult, androidx.ui.input.EditProcessor editProcessor, androidx.ui.input.OffsetMap offsetMap, kotlin.jvm.functions.Function1<? super androidx.ui.input.EditorValue,kotlin.Unit> onValueChange, androidx.ui.input.TextInputService? textInputService, int token, boolean hasFocus);
+ }
+
public final class TextFieldDelegateKt {
}
diff --git a/ui/ui-text/api/public_plus_experimental_0.1.0-dev11.txt b/ui/ui-text/api/public_plus_experimental_0.1.0-dev11.txt
index 72e5070..7871b83 100644
--- a/ui/ui-text/api/public_plus_experimental_0.1.0-dev11.txt
+++ b/ui/ui-text/api/public_plus_experimental_0.1.0-dev11.txt
@@ -11,6 +11,29 @@
method public static androidx.ui.core.HorizontalAlignmentLine getLastBaseline();
}
+ public final class TextFieldDelegate {
+ ctor public TextFieldDelegate();
+ method public static androidx.ui.input.TransformedText applyVisualFilter(androidx.ui.input.EditorValue value, androidx.ui.input.VisualTransformation? visualTransformation);
+ method public static void draw-VTazRi4(androidx.ui.graphics.Canvas canvas, androidx.ui.input.EditorValue value, androidx.ui.input.OffsetMap offsetMap, androidx.ui.text.TextLayoutResult textLayoutResult, long selectionColor);
+ method public static kotlin.Triple<androidx.ui.unit.IntPx,androidx.ui.unit.IntPx,androidx.ui.text.TextLayoutResult> layout(androidx.ui.text.TextDelegate textDelegate, androidx.ui.core.Constraints constraints, androidx.ui.core.LayoutDirection layoutDirection, androidx.ui.text.TextLayoutResult? prevResultText = null);
+ method public static void notifyFocusedRect(androidx.ui.input.EditorValue value, androidx.ui.text.TextDelegate textDelegate, androidx.ui.text.TextLayoutResult textLayoutResult, androidx.ui.core.LayoutCoordinates layoutCoordinates, androidx.ui.input.TextInputService textInputService, int token, boolean hasFocus, androidx.ui.input.OffsetMap offsetMap);
+ method public static void onBlur(androidx.ui.input.TextInputService? textInputService, int token, androidx.ui.input.EditProcessor editProcessor, boolean hasNextClient, kotlin.jvm.functions.Function1<? super androidx.ui.input.EditorValue,kotlin.Unit> onValueChange);
+ method public static int onFocus(androidx.ui.input.TextInputService? textInputService, androidx.ui.input.EditorValue value, androidx.ui.input.EditProcessor editProcessor, androidx.ui.input.KeyboardType keyboardType, androidx.ui.input.ImeAction imeAction, kotlin.jvm.functions.Function1<? super androidx.ui.input.EditorValue,kotlin.Unit> onValueChange, kotlin.jvm.functions.Function1<? super androidx.ui.input.ImeAction,kotlin.Unit> onImeActionPerformed);
+ method public static void onRelease(androidx.ui.unit.PxPosition position, androidx.ui.text.TextLayoutResult textLayoutResult, androidx.ui.input.EditProcessor editProcessor, androidx.ui.input.OffsetMap offsetMap, kotlin.jvm.functions.Function1<? super androidx.ui.input.EditorValue,kotlin.Unit> onValueChange, androidx.ui.input.TextInputService? textInputService, int token, boolean hasFocus);
+ field public static final androidx.ui.text.TextFieldDelegate.Companion! Companion;
+ }
+
+ public static final class TextFieldDelegate.Companion {
+ method public androidx.ui.input.TransformedText applyCompositionDecoration(androidx.ui.text.TextRange compositionRange, androidx.ui.input.TransformedText transformed);
+ method public androidx.ui.input.TransformedText applyVisualFilter(androidx.ui.input.EditorValue value, androidx.ui.input.VisualTransformation? visualTransformation);
+ method public void draw-VTazRi4(androidx.ui.graphics.Canvas canvas, androidx.ui.input.EditorValue value, androidx.ui.input.OffsetMap offsetMap, androidx.ui.text.TextLayoutResult textLayoutResult, long selectionColor);
+ method public kotlin.Triple<androidx.ui.unit.IntPx,androidx.ui.unit.IntPx,androidx.ui.text.TextLayoutResult> layout(androidx.ui.text.TextDelegate textDelegate, androidx.ui.core.Constraints constraints, androidx.ui.core.LayoutDirection layoutDirection, androidx.ui.text.TextLayoutResult? prevResultText = null);
+ method public void notifyFocusedRect(androidx.ui.input.EditorValue value, androidx.ui.text.TextDelegate textDelegate, androidx.ui.text.TextLayoutResult textLayoutResult, androidx.ui.core.LayoutCoordinates layoutCoordinates, androidx.ui.input.TextInputService textInputService, int token, boolean hasFocus, androidx.ui.input.OffsetMap offsetMap);
+ method public void onBlur(androidx.ui.input.TextInputService? textInputService, int token, androidx.ui.input.EditProcessor editProcessor, boolean hasNextClient, kotlin.jvm.functions.Function1<? super androidx.ui.input.EditorValue,kotlin.Unit> onValueChange);
+ method public int onFocus(androidx.ui.input.TextInputService? textInputService, androidx.ui.input.EditorValue value, androidx.ui.input.EditProcessor editProcessor, androidx.ui.input.KeyboardType keyboardType, androidx.ui.input.ImeAction imeAction, kotlin.jvm.functions.Function1<? super androidx.ui.input.EditorValue,kotlin.Unit> onValueChange, kotlin.jvm.functions.Function1<? super androidx.ui.input.ImeAction,kotlin.Unit> onImeActionPerformed);
+ method public void onRelease(androidx.ui.unit.PxPosition position, androidx.ui.text.TextLayoutResult textLayoutResult, androidx.ui.input.EditProcessor editProcessor, androidx.ui.input.OffsetMap offsetMap, kotlin.jvm.functions.Function1<? super androidx.ui.input.EditorValue,kotlin.Unit> onValueChange, androidx.ui.input.TextInputService? textInputService, int token, boolean hasFocus);
+ }
+
public final class TextFieldDelegateKt {
}
diff --git a/ui/ui-text/api/public_plus_experimental_current.txt b/ui/ui-text/api/public_plus_experimental_current.txt
index 72e5070..7871b83 100644
--- a/ui/ui-text/api/public_plus_experimental_current.txt
+++ b/ui/ui-text/api/public_plus_experimental_current.txt
@@ -11,6 +11,29 @@
method public static androidx.ui.core.HorizontalAlignmentLine getLastBaseline();
}
+ public final class TextFieldDelegate {
+ ctor public TextFieldDelegate();
+ method public static androidx.ui.input.TransformedText applyVisualFilter(androidx.ui.input.EditorValue value, androidx.ui.input.VisualTransformation? visualTransformation);
+ method public static void draw-VTazRi4(androidx.ui.graphics.Canvas canvas, androidx.ui.input.EditorValue value, androidx.ui.input.OffsetMap offsetMap, androidx.ui.text.TextLayoutResult textLayoutResult, long selectionColor);
+ method public static kotlin.Triple<androidx.ui.unit.IntPx,androidx.ui.unit.IntPx,androidx.ui.text.TextLayoutResult> layout(androidx.ui.text.TextDelegate textDelegate, androidx.ui.core.Constraints constraints, androidx.ui.core.LayoutDirection layoutDirection, androidx.ui.text.TextLayoutResult? prevResultText = null);
+ method public static void notifyFocusedRect(androidx.ui.input.EditorValue value, androidx.ui.text.TextDelegate textDelegate, androidx.ui.text.TextLayoutResult textLayoutResult, androidx.ui.core.LayoutCoordinates layoutCoordinates, androidx.ui.input.TextInputService textInputService, int token, boolean hasFocus, androidx.ui.input.OffsetMap offsetMap);
+ method public static void onBlur(androidx.ui.input.TextInputService? textInputService, int token, androidx.ui.input.EditProcessor editProcessor, boolean hasNextClient, kotlin.jvm.functions.Function1<? super androidx.ui.input.EditorValue,kotlin.Unit> onValueChange);
+ method public static int onFocus(androidx.ui.input.TextInputService? textInputService, androidx.ui.input.EditorValue value, androidx.ui.input.EditProcessor editProcessor, androidx.ui.input.KeyboardType keyboardType, androidx.ui.input.ImeAction imeAction, kotlin.jvm.functions.Function1<? super androidx.ui.input.EditorValue,kotlin.Unit> onValueChange, kotlin.jvm.functions.Function1<? super androidx.ui.input.ImeAction,kotlin.Unit> onImeActionPerformed);
+ method public static void onRelease(androidx.ui.unit.PxPosition position, androidx.ui.text.TextLayoutResult textLayoutResult, androidx.ui.input.EditProcessor editProcessor, androidx.ui.input.OffsetMap offsetMap, kotlin.jvm.functions.Function1<? super androidx.ui.input.EditorValue,kotlin.Unit> onValueChange, androidx.ui.input.TextInputService? textInputService, int token, boolean hasFocus);
+ field public static final androidx.ui.text.TextFieldDelegate.Companion! Companion;
+ }
+
+ public static final class TextFieldDelegate.Companion {
+ method public androidx.ui.input.TransformedText applyCompositionDecoration(androidx.ui.text.TextRange compositionRange, androidx.ui.input.TransformedText transformed);
+ method public androidx.ui.input.TransformedText applyVisualFilter(androidx.ui.input.EditorValue value, androidx.ui.input.VisualTransformation? visualTransformation);
+ method public void draw-VTazRi4(androidx.ui.graphics.Canvas canvas, androidx.ui.input.EditorValue value, androidx.ui.input.OffsetMap offsetMap, androidx.ui.text.TextLayoutResult textLayoutResult, long selectionColor);
+ method public kotlin.Triple<androidx.ui.unit.IntPx,androidx.ui.unit.IntPx,androidx.ui.text.TextLayoutResult> layout(androidx.ui.text.TextDelegate textDelegate, androidx.ui.core.Constraints constraints, androidx.ui.core.LayoutDirection layoutDirection, androidx.ui.text.TextLayoutResult? prevResultText = null);
+ method public void notifyFocusedRect(androidx.ui.input.EditorValue value, androidx.ui.text.TextDelegate textDelegate, androidx.ui.text.TextLayoutResult textLayoutResult, androidx.ui.core.LayoutCoordinates layoutCoordinates, androidx.ui.input.TextInputService textInputService, int token, boolean hasFocus, androidx.ui.input.OffsetMap offsetMap);
+ method public void onBlur(androidx.ui.input.TextInputService? textInputService, int token, androidx.ui.input.EditProcessor editProcessor, boolean hasNextClient, kotlin.jvm.functions.Function1<? super androidx.ui.input.EditorValue,kotlin.Unit> onValueChange);
+ method public int onFocus(androidx.ui.input.TextInputService? textInputService, androidx.ui.input.EditorValue value, androidx.ui.input.EditProcessor editProcessor, androidx.ui.input.KeyboardType keyboardType, androidx.ui.input.ImeAction imeAction, kotlin.jvm.functions.Function1<? super androidx.ui.input.EditorValue,kotlin.Unit> onValueChange, kotlin.jvm.functions.Function1<? super androidx.ui.input.ImeAction,kotlin.Unit> onImeActionPerformed);
+ method public void onRelease(androidx.ui.unit.PxPosition position, androidx.ui.text.TextLayoutResult textLayoutResult, androidx.ui.input.EditProcessor editProcessor, androidx.ui.input.OffsetMap offsetMap, kotlin.jvm.functions.Function1<? super androidx.ui.input.EditorValue,kotlin.Unit> onValueChange, androidx.ui.input.TextInputService? textInputService, int token, boolean hasFocus);
+ }
+
public final class TextFieldDelegateKt {
}
diff --git a/ui/ui-text/api/restricted_0.1.0-dev11.txt b/ui/ui-text/api/restricted_0.1.0-dev11.txt
index 72e5070..7871b83 100644
--- a/ui/ui-text/api/restricted_0.1.0-dev11.txt
+++ b/ui/ui-text/api/restricted_0.1.0-dev11.txt
@@ -11,6 +11,29 @@
method public static androidx.ui.core.HorizontalAlignmentLine getLastBaseline();
}
+ public final class TextFieldDelegate {
+ ctor public TextFieldDelegate();
+ method public static androidx.ui.input.TransformedText applyVisualFilter(androidx.ui.input.EditorValue value, androidx.ui.input.VisualTransformation? visualTransformation);
+ method public static void draw-VTazRi4(androidx.ui.graphics.Canvas canvas, androidx.ui.input.EditorValue value, androidx.ui.input.OffsetMap offsetMap, androidx.ui.text.TextLayoutResult textLayoutResult, long selectionColor);
+ method public static kotlin.Triple<androidx.ui.unit.IntPx,androidx.ui.unit.IntPx,androidx.ui.text.TextLayoutResult> layout(androidx.ui.text.TextDelegate textDelegate, androidx.ui.core.Constraints constraints, androidx.ui.core.LayoutDirection layoutDirection, androidx.ui.text.TextLayoutResult? prevResultText = null);
+ method public static void notifyFocusedRect(androidx.ui.input.EditorValue value, androidx.ui.text.TextDelegate textDelegate, androidx.ui.text.TextLayoutResult textLayoutResult, androidx.ui.core.LayoutCoordinates layoutCoordinates, androidx.ui.input.TextInputService textInputService, int token, boolean hasFocus, androidx.ui.input.OffsetMap offsetMap);
+ method public static void onBlur(androidx.ui.input.TextInputService? textInputService, int token, androidx.ui.input.EditProcessor editProcessor, boolean hasNextClient, kotlin.jvm.functions.Function1<? super androidx.ui.input.EditorValue,kotlin.Unit> onValueChange);
+ method public static int onFocus(androidx.ui.input.TextInputService? textInputService, androidx.ui.input.EditorValue value, androidx.ui.input.EditProcessor editProcessor, androidx.ui.input.KeyboardType keyboardType, androidx.ui.input.ImeAction imeAction, kotlin.jvm.functions.Function1<? super androidx.ui.input.EditorValue,kotlin.Unit> onValueChange, kotlin.jvm.functions.Function1<? super androidx.ui.input.ImeAction,kotlin.Unit> onImeActionPerformed);
+ method public static void onRelease(androidx.ui.unit.PxPosition position, androidx.ui.text.TextLayoutResult textLayoutResult, androidx.ui.input.EditProcessor editProcessor, androidx.ui.input.OffsetMap offsetMap, kotlin.jvm.functions.Function1<? super androidx.ui.input.EditorValue,kotlin.Unit> onValueChange, androidx.ui.input.TextInputService? textInputService, int token, boolean hasFocus);
+ field public static final androidx.ui.text.TextFieldDelegate.Companion! Companion;
+ }
+
+ public static final class TextFieldDelegate.Companion {
+ method public androidx.ui.input.TransformedText applyCompositionDecoration(androidx.ui.text.TextRange compositionRange, androidx.ui.input.TransformedText transformed);
+ method public androidx.ui.input.TransformedText applyVisualFilter(androidx.ui.input.EditorValue value, androidx.ui.input.VisualTransformation? visualTransformation);
+ method public void draw-VTazRi4(androidx.ui.graphics.Canvas canvas, androidx.ui.input.EditorValue value, androidx.ui.input.OffsetMap offsetMap, androidx.ui.text.TextLayoutResult textLayoutResult, long selectionColor);
+ method public kotlin.Triple<androidx.ui.unit.IntPx,androidx.ui.unit.IntPx,androidx.ui.text.TextLayoutResult> layout(androidx.ui.text.TextDelegate textDelegate, androidx.ui.core.Constraints constraints, androidx.ui.core.LayoutDirection layoutDirection, androidx.ui.text.TextLayoutResult? prevResultText = null);
+ method public void notifyFocusedRect(androidx.ui.input.EditorValue value, androidx.ui.text.TextDelegate textDelegate, androidx.ui.text.TextLayoutResult textLayoutResult, androidx.ui.core.LayoutCoordinates layoutCoordinates, androidx.ui.input.TextInputService textInputService, int token, boolean hasFocus, androidx.ui.input.OffsetMap offsetMap);
+ method public void onBlur(androidx.ui.input.TextInputService? textInputService, int token, androidx.ui.input.EditProcessor editProcessor, boolean hasNextClient, kotlin.jvm.functions.Function1<? super androidx.ui.input.EditorValue,kotlin.Unit> onValueChange);
+ method public int onFocus(androidx.ui.input.TextInputService? textInputService, androidx.ui.input.EditorValue value, androidx.ui.input.EditProcessor editProcessor, androidx.ui.input.KeyboardType keyboardType, androidx.ui.input.ImeAction imeAction, kotlin.jvm.functions.Function1<? super androidx.ui.input.EditorValue,kotlin.Unit> onValueChange, kotlin.jvm.functions.Function1<? super androidx.ui.input.ImeAction,kotlin.Unit> onImeActionPerformed);
+ method public void onRelease(androidx.ui.unit.PxPosition position, androidx.ui.text.TextLayoutResult textLayoutResult, androidx.ui.input.EditProcessor editProcessor, androidx.ui.input.OffsetMap offsetMap, kotlin.jvm.functions.Function1<? super androidx.ui.input.EditorValue,kotlin.Unit> onValueChange, androidx.ui.input.TextInputService? textInputService, int token, boolean hasFocus);
+ }
+
public final class TextFieldDelegateKt {
}
diff --git a/ui/ui-text/api/restricted_current.txt b/ui/ui-text/api/restricted_current.txt
index 72e5070..7871b83 100644
--- a/ui/ui-text/api/restricted_current.txt
+++ b/ui/ui-text/api/restricted_current.txt
@@ -11,6 +11,29 @@
method public static androidx.ui.core.HorizontalAlignmentLine getLastBaseline();
}
+ public final class TextFieldDelegate {
+ ctor public TextFieldDelegate();
+ method public static androidx.ui.input.TransformedText applyVisualFilter(androidx.ui.input.EditorValue value, androidx.ui.input.VisualTransformation? visualTransformation);
+ method public static void draw-VTazRi4(androidx.ui.graphics.Canvas canvas, androidx.ui.input.EditorValue value, androidx.ui.input.OffsetMap offsetMap, androidx.ui.text.TextLayoutResult textLayoutResult, long selectionColor);
+ method public static kotlin.Triple<androidx.ui.unit.IntPx,androidx.ui.unit.IntPx,androidx.ui.text.TextLayoutResult> layout(androidx.ui.text.TextDelegate textDelegate, androidx.ui.core.Constraints constraints, androidx.ui.core.LayoutDirection layoutDirection, androidx.ui.text.TextLayoutResult? prevResultText = null);
+ method public static void notifyFocusedRect(androidx.ui.input.EditorValue value, androidx.ui.text.TextDelegate textDelegate, androidx.ui.text.TextLayoutResult textLayoutResult, androidx.ui.core.LayoutCoordinates layoutCoordinates, androidx.ui.input.TextInputService textInputService, int token, boolean hasFocus, androidx.ui.input.OffsetMap offsetMap);
+ method public static void onBlur(androidx.ui.input.TextInputService? textInputService, int token, androidx.ui.input.EditProcessor editProcessor, boolean hasNextClient, kotlin.jvm.functions.Function1<? super androidx.ui.input.EditorValue,kotlin.Unit> onValueChange);
+ method public static int onFocus(androidx.ui.input.TextInputService? textInputService, androidx.ui.input.EditorValue value, androidx.ui.input.EditProcessor editProcessor, androidx.ui.input.KeyboardType keyboardType, androidx.ui.input.ImeAction imeAction, kotlin.jvm.functions.Function1<? super androidx.ui.input.EditorValue,kotlin.Unit> onValueChange, kotlin.jvm.functions.Function1<? super androidx.ui.input.ImeAction,kotlin.Unit> onImeActionPerformed);
+ method public static void onRelease(androidx.ui.unit.PxPosition position, androidx.ui.text.TextLayoutResult textLayoutResult, androidx.ui.input.EditProcessor editProcessor, androidx.ui.input.OffsetMap offsetMap, kotlin.jvm.functions.Function1<? super androidx.ui.input.EditorValue,kotlin.Unit> onValueChange, androidx.ui.input.TextInputService? textInputService, int token, boolean hasFocus);
+ field public static final androidx.ui.text.TextFieldDelegate.Companion! Companion;
+ }
+
+ public static final class TextFieldDelegate.Companion {
+ method public androidx.ui.input.TransformedText applyCompositionDecoration(androidx.ui.text.TextRange compositionRange, androidx.ui.input.TransformedText transformed);
+ method public androidx.ui.input.TransformedText applyVisualFilter(androidx.ui.input.EditorValue value, androidx.ui.input.VisualTransformation? visualTransformation);
+ method public void draw-VTazRi4(androidx.ui.graphics.Canvas canvas, androidx.ui.input.EditorValue value, androidx.ui.input.OffsetMap offsetMap, androidx.ui.text.TextLayoutResult textLayoutResult, long selectionColor);
+ method public kotlin.Triple<androidx.ui.unit.IntPx,androidx.ui.unit.IntPx,androidx.ui.text.TextLayoutResult> layout(androidx.ui.text.TextDelegate textDelegate, androidx.ui.core.Constraints constraints, androidx.ui.core.LayoutDirection layoutDirection, androidx.ui.text.TextLayoutResult? prevResultText = null);
+ method public void notifyFocusedRect(androidx.ui.input.EditorValue value, androidx.ui.text.TextDelegate textDelegate, androidx.ui.text.TextLayoutResult textLayoutResult, androidx.ui.core.LayoutCoordinates layoutCoordinates, androidx.ui.input.TextInputService textInputService, int token, boolean hasFocus, androidx.ui.input.OffsetMap offsetMap);
+ method public void onBlur(androidx.ui.input.TextInputService? textInputService, int token, androidx.ui.input.EditProcessor editProcessor, boolean hasNextClient, kotlin.jvm.functions.Function1<? super androidx.ui.input.EditorValue,kotlin.Unit> onValueChange);
+ method public int onFocus(androidx.ui.input.TextInputService? textInputService, androidx.ui.input.EditorValue value, androidx.ui.input.EditProcessor editProcessor, androidx.ui.input.KeyboardType keyboardType, androidx.ui.input.ImeAction imeAction, kotlin.jvm.functions.Function1<? super androidx.ui.input.EditorValue,kotlin.Unit> onValueChange, kotlin.jvm.functions.Function1<? super androidx.ui.input.ImeAction,kotlin.Unit> onImeActionPerformed);
+ method public void onRelease(androidx.ui.unit.PxPosition position, androidx.ui.text.TextLayoutResult textLayoutResult, androidx.ui.input.EditProcessor editProcessor, androidx.ui.input.OffsetMap offsetMap, kotlin.jvm.functions.Function1<? super androidx.ui.input.EditorValue,kotlin.Unit> onValueChange, androidx.ui.input.TextInputService? textInputService, int token, boolean hasFocus);
+ }
+
public final class TextFieldDelegateKt {
}
diff --git a/ui/ui-text/src/androidTest/java/androidx/ui/text/TextFieldDelegateIntegrationTest.kt b/ui/ui-text/src/androidTest/java/androidx/ui/text/TextFieldDelegateIntegrationTest.kt
index 433f5bb..bd4637b 100644
--- a/ui/ui-text/src/androidTest/java/androidx/ui/text/TextFieldDelegateIntegrationTest.kt
+++ b/ui/ui-text/src/androidTest/java/androidx/ui/text/TextFieldDelegateIntegrationTest.kt
@@ -85,73 +85,6 @@
canvas = actualCanvas,
value = EditorValue(text = "Hello, World", selection = selection),
selectionColor = selectionColor,
- hasFocus = true,
- offsetMap = OffsetMap.identityOffsetMap,
- textLayoutResult = layoutResult
- )
-
- assertThat(actualBitmap.sameAs(expectedBitmap)).isTrue()
- }
-
- @Test
- fun draw_cursor_test() {
- val cursor = TextRange(1, 1)
-
- val textDelegate = TextDelegate(
- text = AnnotatedString("Hello, World"),
- style = TextStyle.Default,
- maxLines = 2,
- density = density,
- resourceLoader = resourceLoader
- )
- val layoutResult = textDelegate.layout(Constraints.fixedWidth(1024.ipx), layoutDirection)
-
- val expectedBitmap = layoutResult.toBitmap()
- val expectedCanvas = Canvas(android.graphics.Canvas(expectedBitmap))
-
- val cursorRect = layoutResult.getCursorRect(cursor.min)
- expectedCanvas.drawRect(cursorRect, Paint().apply { this.color = Color.Black })
- TextPainter.paint(expectedCanvas, layoutResult)
-
- val actualBitmap = layoutResult.toBitmap()
- val actualCanvas = Canvas(android.graphics.Canvas(actualBitmap))
- TextFieldDelegate.draw(
- canvas = actualCanvas,
- value = EditorValue(text = "Hello, World", selection = cursor),
- selectionColor = Color.Black,
- hasFocus = true,
- offsetMap = OffsetMap.identityOffsetMap,
- textLayoutResult = layoutResult
- )
-
- assertThat(actualBitmap.sameAs(expectedBitmap)).isTrue()
- }
-
- @Test
- fun dont_draw_cursor_test() {
- val cursor = TextRange(1, 1)
-
- val textDelegate = TextDelegate(
- text = AnnotatedString("Hello, World"),
- style = TextStyle.Default,
- maxLines = 2,
- density = density,
- resourceLoader = resourceLoader
- )
- val layoutResult = textDelegate.layout(Constraints.fixedWidth(1024.ipx), layoutDirection)
-
- val expectedBitmap = layoutResult.toBitmap()
- val expectedCanvas = Canvas(android.graphics.Canvas(expectedBitmap))
-
- TextPainter.paint(expectedCanvas, layoutResult)
-
- val actualBitmap = layoutResult.toBitmap()
- val actualCanvas = Canvas(android.graphics.Canvas(actualBitmap))
- TextFieldDelegate.draw(
- canvas = actualCanvas,
- value = EditorValue(text = "Hello, World", selection = cursor),
- selectionColor = Color.Black,
- hasFocus = false,
offsetMap = OffsetMap.identityOffsetMap,
textLayoutResult = layoutResult
)
diff --git a/ui/ui-text/src/main/java/androidx/ui/text/CoreTextField.kt b/ui/ui-text/src/main/java/androidx/ui/text/CoreTextField.kt
index 7993d09..b033f5f 100644
--- a/ui/ui-text/src/main/java/androidx/ui/text/CoreTextField.kt
+++ b/ui/ui-text/src/main/java/androidx/ui/text/CoreTextField.kt
@@ -181,7 +181,6 @@
value,
offsetMap,
layoutResult,
- state.hasFocus,
DefaultSelectionColor
)
}
diff --git a/ui/ui-text/src/main/java/androidx/ui/text/TextFieldDelegate.kt b/ui/ui-text/src/main/java/androidx/ui/text/TextFieldDelegate.kt
index d07ebb6..1084566 100644
--- a/ui/ui-text/src/main/java/androidx/ui/text/TextFieldDelegate.kt
+++ b/ui/ui-text/src/main/java/androidx/ui/text/TextFieldDelegate.kt
@@ -82,7 +82,7 @@
private fun Float.toIntPx(): IntPx = ceil(this).roundToInt().ipx
-internal class TextFieldDelegate {
+class TextFieldDelegate {
companion object {
/**
* Process text layout with given constraint.
@@ -121,7 +121,6 @@
* @param canvas The target canvas.
* @param value The editor state
* @param offsetMap The offset map
- * @param hasFocus true if this composable is focused, otherwise false
* @param selectionColor The selection color
*/
@JvmStatic
@@ -130,16 +129,9 @@
value: EditorValue,
offsetMap: OffsetMap,
textLayoutResult: TextLayoutResult,
- hasFocus: Boolean,
selectionColor: Color
) {
- if (value.selection.collapsed) {
- if (hasFocus) {
- val cursorRect = textLayoutResult.getCursorRect(
- offsetMap.originalToTransformed(value.selection.min))
- canvas.drawRect(cursorRect, Paint().apply { this.color = Color.Black })
- }
- } else {
+ if (!value.selection.collapsed) {
val start = offsetMap.originalToTransformed(value.selection.min)
val end = offsetMap.originalToTransformed(value.selection.max)
if (start != end) {
diff --git a/ui/ui-tooling/src/main/java/androidx/ui/tooling/SlotTree.kt b/ui/ui-tooling/src/main/java/androidx/ui/tooling/SlotTree.kt
index 1a903aa..13a3569 100644
--- a/ui/ui-tooling/src/main/java/androidx/ui/tooling/SlotTree.kt
+++ b/ui/ui-tooling/src/main/java/androidx/ui/tooling/SlotTree.kt
@@ -111,10 +111,10 @@
val key = convertKey(groupKey)
val nodeGroup = isNode
val end = current + groupSize
+ val node = if (nodeGroup) groupNode else null
next()
val data = mutableListOf<Any?>()
val children = mutableListOf<Group>()
- val node = if (nodeGroup) next() else null
while (current < end && isGroup) {
children.add(getGroup())
}
diff --git a/ui/ui-unit/api/0.1.0-dev11.txt b/ui/ui-unit/api/0.1.0-dev11.txt
index 0ec30fa..4df20e4 100644
--- a/ui/ui-unit/api/0.1.0-dev11.txt
+++ b/ui/ui-unit/api/0.1.0-dev11.txt
@@ -50,10 +50,10 @@
method public static inline operator float div-impl(float $this, int other);
method public static inline operator float div-ipo6vVg(float $this, float other);
method public static inline operator float div-x8crYZs(float $this, float other);
- method public static boolean equals-impl(float p, Object? p1);
+ method public static inline boolean equals-impl(float p, Object? p1);
method public static boolean equals-impl0(float p1, float p2);
method public float getValue();
- method public static int hashCode-impl(float p);
+ method public static inline int hashCode-impl(float p);
method public static inline operator float minus-ipo6vVg(float $this, float other);
method public static inline operator float plus-ipo6vVg(float $this, float other);
method public static inline operator float times-impl(float $this, float other);
@@ -83,10 +83,10 @@
method public static inline operator float div-impl(float $this, float other);
method public static inline operator float div-ipo6vVg(float $this, float other);
method public static inline operator float div-x8crYZs(float $this, float other);
- method public static boolean equals-impl(float p, Object? p1);
+ method public static inline boolean equals-impl(float p, Object? p1);
method public static boolean equals-impl0(float p1, float p2);
method public float getValue();
- method public static int hashCode-impl(float p);
+ method public static inline int hashCode-impl(float p);
method public static inline operator float minus-JDqhs2g(float $this, float dimension);
method public static inline operator float plus-JDqhs2g(float $this, float dimension);
method public static inline operator float times-impl(float $this, float other);
@@ -99,10 +99,10 @@
method public static operator int compareTo-_K2iRR8(float $this, float other);
method public static float constructor-impl(float value);
method public static inline operator float div-impl(float $this, float other);
- method public static boolean equals-impl(float p, Object? p1);
+ method public static inline boolean equals-impl(float p, Object? p1);
method public static boolean equals-impl0(float p1, float p2);
method public float getValue();
- method public static int hashCode-impl(float p);
+ method public static inline int hashCode-impl(float p);
method public static inline operator float minus-_K2iRR8(float $this, float dimension);
method public static inline operator float plus-_K2iRR8(float $this, float dimension);
method public static inline operator float times-JDqhs2g(float $this, float other);
@@ -152,10 +152,10 @@
method public static inline operator float div-impl(float $this, float other);
method public static inline operator float div-ipo6vVg(float $this, float other);
method public static inline operator float div-x8crYZs(float $this, float other);
- method public static boolean equals-impl(float p, Object? p1);
+ method public static inline boolean equals-impl(float p, Object? p1);
method public static boolean equals-impl0(float p1, float p2);
method public float getValue();
- method public static int hashCode-impl(float p);
+ method public static inline int hashCode-impl(float p);
method public static inline operator float minus-x8crYZs(float $this, float other);
method public static inline operator float plus-x8crYZs(float $this, float other);
method public static inline operator float times-impl(float $this, float other);
@@ -227,10 +227,10 @@
method public static operator int div-impl(int $this, float other);
method public static operator int div-impl(int $this, double other);
method public static operator int div-impl(int $this, int other);
- method public static boolean equals-impl(int p, Object? p1);
+ method public static inline boolean equals-impl(int p, Object? p1);
method public static boolean equals-impl0(int p1, int p2);
method public int getValue();
- method public static int hashCode-impl(int p);
+ method public static inline int hashCode-impl(int p);
method public static operator int minus-gshw56o(int $this, int other);
method public static operator int plus-gshw56o(int $this, int other);
method public static inline operator int rem-impl(int $this, int other);
@@ -322,11 +322,11 @@
ctor public IntSize();
method public static long constructor-impl(internal long value);
method public static operator long div-impl(long $this, int other);
- method public static boolean equals-impl(long p, Object? p1);
+ method public static inline boolean equals-impl(long p, Object? p1);
method public static boolean equals-impl0(long p1, long p2);
method public static int getHeight-impl(long $this);
method public static int getWidth-impl(long $this);
- method public static int hashCode-impl(long p);
+ method public static inline int hashCode-impl(long p);
method public static operator long times-impl(long $this, int other);
method public static String toString-impl(long $this);
}
@@ -339,11 +339,11 @@
public final inline class Position {
ctor public Position();
method public static long constructor-impl(internal long value);
- method public static boolean equals-impl(long p, Object? p1);
+ method public static inline boolean equals-impl(long p, Object? p1);
method public static boolean equals-impl0(long p1, long p2);
method public static float getX-impl(long $this);
method public static float getY-impl(long $this);
- method public static int hashCode-impl(long p);
+ method public static inline int hashCode-impl(long p);
method public static inline operator long minus-T8eBu-w(long $this, long other);
method public static inline operator long plus-T8eBu-w(long $this, long other);
method public static String toString-impl(long $this);
@@ -359,10 +359,10 @@
method public static inline operator float div-RjPF0Mw(float $this, float other);
method public static inline operator float div-impl(float $this, float other);
method public static inline operator float div-impl(float $this, int other);
- method public static boolean equals-impl(float p, Object? p1);
+ method public static inline boolean equals-impl(float p, Object? p1);
method public static boolean equals-impl0(float p1, float p2);
method public float getValue();
- method public static int hashCode-impl(float p);
+ method public static inline int hashCode-impl(float p);
method public static inline operator float minus-NgWp0Z8(float $this, float other);
method public static inline operator float minus-gshw56o(float $this, int other);
method public static inline operator float plus-NgWp0Z8(float $this, float other);
@@ -404,10 +404,10 @@
method public static inline operator float div-RjPF0Mw(float $this, float other);
method public static inline operator float div-bji3ab4(float $this, float other);
method public static inline operator float div-impl(float $this, float other);
- method public static boolean equals-impl(float p, Object? p1);
+ method public static inline boolean equals-impl(float p, Object? p1);
method public static boolean equals-impl0(float p1, float p2);
method public float getValue();
- method public static int hashCode-impl(float p);
+ method public static inline int hashCode-impl(float p);
method public static inline operator float minus-bji3ab4(float $this, float dimension);
method public static inline operator float plus-bji3ab4(float $this, float dimension);
method public static inline operator float times-impl(float $this, float other);
@@ -420,10 +420,10 @@
method public static operator int compareTo-KGV0gLo(float $this, float other);
method public static float constructor-impl(float value);
method public static inline operator float div-impl(float $this, float other);
- method public static boolean equals-impl(float p, Object? p1);
+ method public static inline boolean equals-impl(float p, Object? p1);
method public static boolean equals-impl0(float p1, float p2);
method public float getValue();
- method public static int hashCode-impl(float p);
+ method public static inline int hashCode-impl(float p);
method public static inline operator float minus-KGV0gLo(float $this, float dimension);
method public static inline operator float plus-KGV0gLo(float $this, float dimension);
method public static inline operator float times-NgWp0Z8(float $this, float other);
@@ -465,7 +465,7 @@
method public static inline operator float times-Ndu7NvY(int, float other);
method public static inline operator float times-kxDXtn8(float, float other);
method public static androidx.ui.unit.PxBounds toBounds(androidx.ui.unit.PxSize);
- method public static inline androidx.ui.geometry.Offset toOffset(androidx.ui.unit.PxPosition);
+ method public static inline long toOffset(androidx.ui.unit.PxPosition);
method public static androidx.ui.geometry.Rect toRect(androidx.ui.unit.PxBounds);
method public static androidx.ui.geometry.Rect toRect(androidx.ui.unit.PxSize);
method public static androidx.ui.unit.PxSize toSize(androidx.ui.unit.PxBounds);
@@ -521,10 +521,10 @@
method public static inline operator float div-RjPF0Mw(float $this, float other);
method public static inline operator float div-bji3ab4(float $this, float other);
method public static inline operator float div-impl(float $this, float other);
- method public static boolean equals-impl(float p, Object? p1);
+ method public static inline boolean equals-impl(float p, Object? p1);
method public static boolean equals-impl0(float p1, float p2);
method public float getValue();
- method public static int hashCode-impl(float p);
+ method public static inline int hashCode-impl(float p);
method public static inline operator float minus-RjPF0Mw(float $this, float other);
method public static inline operator float plus-RjPF0Mw(float $this, float other);
method public static inline operator float times-NgWp0Z8(float $this, float other);
@@ -538,11 +538,11 @@
method public static inline operator long div-impl(long $this, int other);
method public static inline operator long div-impl(long $this, float other);
method public static inline operator long div-impl(long $this, double other);
- method public static boolean equals-impl(long p, Object? p1);
+ method public static inline boolean equals-impl(long p, Object? p1);
method public static boolean equals-impl0(long p1, long p2);
method public static float getHeight-impl(long $this);
method public static float getWidth-impl(long $this);
- method public static int hashCode-impl(long p);
+ method public static inline int hashCode-impl(long p);
method public static inline operator long times-impl(long $this, int other);
method public static inline operator long times-impl(long $this, float other);
method public static inline operator long times-impl(long $this, double other);
@@ -557,12 +557,12 @@
method public static inline operator long div-impl(long $this, double other);
method public static inline operator long div-impl(long $this, int other);
method public static inline operator float div-vVlMl6k(long $this, long other);
- method public static boolean equals-impl(long p, Object? p1);
+ method public static inline boolean equals-impl(long p, Object? p1);
method public static boolean equals-impl0(long p1, long p2);
method public long getPackedValue();
method public static androidx.ui.unit.TextUnitType getType-impl(long $this);
method public static float getValue-impl(long $this);
- method public static int hashCode-impl(long p);
+ method public static inline int hashCode-impl(long p);
method public static boolean isEm-impl(long $this);
method public static boolean isInherit-impl(long $this);
method public static boolean isSp-impl(long $this);
diff --git a/ui/ui-unit/api/api_lint.ignore b/ui/ui-unit/api/api_lint.ignore
index 7020459..e183b70 100644
--- a/ui/ui-unit/api/api_lint.ignore
+++ b/ui/ui-unit/api/api_lint.ignore
@@ -3,10 +3,14 @@
Acronyms should not be capitalized in method names: was `toPx-kAYDl8w`, should this be `toPx-kAyDl8w`?
AcronymName: androidx.ui.unit.DpKt#center-kAYDl8w(long):
Acronyms should not be capitalized in method names: was `center-kAYDl8w`, should this be `center-kAyDl8w`?
+AcronymName: androidx.ui.unit.DpKt#div-Y_YOLaE(double, float):
+ Acronyms should not be capitalized in method names: was `div-Y_YOLaE`, should this be `div-Y_YoLaE`?
AcronymName: androidx.ui.unit.DpKt#lerp-d5NHFfI(long, long, float):
Acronyms should not be capitalized in method names: was `lerp-d5NHFfI`, should this be `lerp-d5NhFfI`?
AcronymName: androidx.ui.unit.DpKt#times-DdskrAE(int, long):
Acronyms should not be capitalized in method names: was `times-DdskrAE`, should this be `times-DdskrAe`?
+AcronymName: androidx.ui.unit.DpKt#times-Y_YOLaE(double, float):
+ Acronyms should not be capitalized in method names: was `times-Y_YOLaE`, should this be `times-Y_YoLaE`?
AcronymName: androidx.ui.unit.DpKt#toBounds-kAYDl8w(long):
Acronyms should not be capitalized in method names: was `toBounds-kAYDl8w`, should this be `toBounds-kAyDl8w`?
AcronymName: androidx.ui.unit.IntPxBounds#copy-Q13GOEE(int, int, int, int):
diff --git a/ui/ui-unit/api/current.txt b/ui/ui-unit/api/current.txt
index 0ec30fa..4df20e4 100644
--- a/ui/ui-unit/api/current.txt
+++ b/ui/ui-unit/api/current.txt
@@ -50,10 +50,10 @@
method public static inline operator float div-impl(float $this, int other);
method public static inline operator float div-ipo6vVg(float $this, float other);
method public static inline operator float div-x8crYZs(float $this, float other);
- method public static boolean equals-impl(float p, Object? p1);
+ method public static inline boolean equals-impl(float p, Object? p1);
method public static boolean equals-impl0(float p1, float p2);
method public float getValue();
- method public static int hashCode-impl(float p);
+ method public static inline int hashCode-impl(float p);
method public static inline operator float minus-ipo6vVg(float $this, float other);
method public static inline operator float plus-ipo6vVg(float $this, float other);
method public static inline operator float times-impl(float $this, float other);
@@ -83,10 +83,10 @@
method public static inline operator float div-impl(float $this, float other);
method public static inline operator float div-ipo6vVg(float $this, float other);
method public static inline operator float div-x8crYZs(float $this, float other);
- method public static boolean equals-impl(float p, Object? p1);
+ method public static inline boolean equals-impl(float p, Object? p1);
method public static boolean equals-impl0(float p1, float p2);
method public float getValue();
- method public static int hashCode-impl(float p);
+ method public static inline int hashCode-impl(float p);
method public static inline operator float minus-JDqhs2g(float $this, float dimension);
method public static inline operator float plus-JDqhs2g(float $this, float dimension);
method public static inline operator float times-impl(float $this, float other);
@@ -99,10 +99,10 @@
method public static operator int compareTo-_K2iRR8(float $this, float other);
method public static float constructor-impl(float value);
method public static inline operator float div-impl(float $this, float other);
- method public static boolean equals-impl(float p, Object? p1);
+ method public static inline boolean equals-impl(float p, Object? p1);
method public static boolean equals-impl0(float p1, float p2);
method public float getValue();
- method public static int hashCode-impl(float p);
+ method public static inline int hashCode-impl(float p);
method public static inline operator float minus-_K2iRR8(float $this, float dimension);
method public static inline operator float plus-_K2iRR8(float $this, float dimension);
method public static inline operator float times-JDqhs2g(float $this, float other);
@@ -152,10 +152,10 @@
method public static inline operator float div-impl(float $this, float other);
method public static inline operator float div-ipo6vVg(float $this, float other);
method public static inline operator float div-x8crYZs(float $this, float other);
- method public static boolean equals-impl(float p, Object? p1);
+ method public static inline boolean equals-impl(float p, Object? p1);
method public static boolean equals-impl0(float p1, float p2);
method public float getValue();
- method public static int hashCode-impl(float p);
+ method public static inline int hashCode-impl(float p);
method public static inline operator float minus-x8crYZs(float $this, float other);
method public static inline operator float plus-x8crYZs(float $this, float other);
method public static inline operator float times-impl(float $this, float other);
@@ -227,10 +227,10 @@
method public static operator int div-impl(int $this, float other);
method public static operator int div-impl(int $this, double other);
method public static operator int div-impl(int $this, int other);
- method public static boolean equals-impl(int p, Object? p1);
+ method public static inline boolean equals-impl(int p, Object? p1);
method public static boolean equals-impl0(int p1, int p2);
method public int getValue();
- method public static int hashCode-impl(int p);
+ method public static inline int hashCode-impl(int p);
method public static operator int minus-gshw56o(int $this, int other);
method public static operator int plus-gshw56o(int $this, int other);
method public static inline operator int rem-impl(int $this, int other);
@@ -322,11 +322,11 @@
ctor public IntSize();
method public static long constructor-impl(internal long value);
method public static operator long div-impl(long $this, int other);
- method public static boolean equals-impl(long p, Object? p1);
+ method public static inline boolean equals-impl(long p, Object? p1);
method public static boolean equals-impl0(long p1, long p2);
method public static int getHeight-impl(long $this);
method public static int getWidth-impl(long $this);
- method public static int hashCode-impl(long p);
+ method public static inline int hashCode-impl(long p);
method public static operator long times-impl(long $this, int other);
method public static String toString-impl(long $this);
}
@@ -339,11 +339,11 @@
public final inline class Position {
ctor public Position();
method public static long constructor-impl(internal long value);
- method public static boolean equals-impl(long p, Object? p1);
+ method public static inline boolean equals-impl(long p, Object? p1);
method public static boolean equals-impl0(long p1, long p2);
method public static float getX-impl(long $this);
method public static float getY-impl(long $this);
- method public static int hashCode-impl(long p);
+ method public static inline int hashCode-impl(long p);
method public static inline operator long minus-T8eBu-w(long $this, long other);
method public static inline operator long plus-T8eBu-w(long $this, long other);
method public static String toString-impl(long $this);
@@ -359,10 +359,10 @@
method public static inline operator float div-RjPF0Mw(float $this, float other);
method public static inline operator float div-impl(float $this, float other);
method public static inline operator float div-impl(float $this, int other);
- method public static boolean equals-impl(float p, Object? p1);
+ method public static inline boolean equals-impl(float p, Object? p1);
method public static boolean equals-impl0(float p1, float p2);
method public float getValue();
- method public static int hashCode-impl(float p);
+ method public static inline int hashCode-impl(float p);
method public static inline operator float minus-NgWp0Z8(float $this, float other);
method public static inline operator float minus-gshw56o(float $this, int other);
method public static inline operator float plus-NgWp0Z8(float $this, float other);
@@ -404,10 +404,10 @@
method public static inline operator float div-RjPF0Mw(float $this, float other);
method public static inline operator float div-bji3ab4(float $this, float other);
method public static inline operator float div-impl(float $this, float other);
- method public static boolean equals-impl(float p, Object? p1);
+ method public static inline boolean equals-impl(float p, Object? p1);
method public static boolean equals-impl0(float p1, float p2);
method public float getValue();
- method public static int hashCode-impl(float p);
+ method public static inline int hashCode-impl(float p);
method public static inline operator float minus-bji3ab4(float $this, float dimension);
method public static inline operator float plus-bji3ab4(float $this, float dimension);
method public static inline operator float times-impl(float $this, float other);
@@ -420,10 +420,10 @@
method public static operator int compareTo-KGV0gLo(float $this, float other);
method public static float constructor-impl(float value);
method public static inline operator float div-impl(float $this, float other);
- method public static boolean equals-impl(float p, Object? p1);
+ method public static inline boolean equals-impl(float p, Object? p1);
method public static boolean equals-impl0(float p1, float p2);
method public float getValue();
- method public static int hashCode-impl(float p);
+ method public static inline int hashCode-impl(float p);
method public static inline operator float minus-KGV0gLo(float $this, float dimension);
method public static inline operator float plus-KGV0gLo(float $this, float dimension);
method public static inline operator float times-NgWp0Z8(float $this, float other);
@@ -465,7 +465,7 @@
method public static inline operator float times-Ndu7NvY(int, float other);
method public static inline operator float times-kxDXtn8(float, float other);
method public static androidx.ui.unit.PxBounds toBounds(androidx.ui.unit.PxSize);
- method public static inline androidx.ui.geometry.Offset toOffset(androidx.ui.unit.PxPosition);
+ method public static inline long toOffset(androidx.ui.unit.PxPosition);
method public static androidx.ui.geometry.Rect toRect(androidx.ui.unit.PxBounds);
method public static androidx.ui.geometry.Rect toRect(androidx.ui.unit.PxSize);
method public static androidx.ui.unit.PxSize toSize(androidx.ui.unit.PxBounds);
@@ -521,10 +521,10 @@
method public static inline operator float div-RjPF0Mw(float $this, float other);
method public static inline operator float div-bji3ab4(float $this, float other);
method public static inline operator float div-impl(float $this, float other);
- method public static boolean equals-impl(float p, Object? p1);
+ method public static inline boolean equals-impl(float p, Object? p1);
method public static boolean equals-impl0(float p1, float p2);
method public float getValue();
- method public static int hashCode-impl(float p);
+ method public static inline int hashCode-impl(float p);
method public static inline operator float minus-RjPF0Mw(float $this, float other);
method public static inline operator float plus-RjPF0Mw(float $this, float other);
method public static inline operator float times-NgWp0Z8(float $this, float other);
@@ -538,11 +538,11 @@
method public static inline operator long div-impl(long $this, int other);
method public static inline operator long div-impl(long $this, float other);
method public static inline operator long div-impl(long $this, double other);
- method public static boolean equals-impl(long p, Object? p1);
+ method public static inline boolean equals-impl(long p, Object? p1);
method public static boolean equals-impl0(long p1, long p2);
method public static float getHeight-impl(long $this);
method public static float getWidth-impl(long $this);
- method public static int hashCode-impl(long p);
+ method public static inline int hashCode-impl(long p);
method public static inline operator long times-impl(long $this, int other);
method public static inline operator long times-impl(long $this, float other);
method public static inline operator long times-impl(long $this, double other);
@@ -557,12 +557,12 @@
method public static inline operator long div-impl(long $this, double other);
method public static inline operator long div-impl(long $this, int other);
method public static inline operator float div-vVlMl6k(long $this, long other);
- method public static boolean equals-impl(long p, Object? p1);
+ method public static inline boolean equals-impl(long p, Object? p1);
method public static boolean equals-impl0(long p1, long p2);
method public long getPackedValue();
method public static androidx.ui.unit.TextUnitType getType-impl(long $this);
method public static float getValue-impl(long $this);
- method public static int hashCode-impl(long p);
+ method public static inline int hashCode-impl(long p);
method public static boolean isEm-impl(long $this);
method public static boolean isInherit-impl(long $this);
method public static boolean isSp-impl(long $this);
diff --git a/ui/ui-unit/api/public_plus_experimental_0.1.0-dev11.txt b/ui/ui-unit/api/public_plus_experimental_0.1.0-dev11.txt
index 0ec30fa..4df20e4 100644
--- a/ui/ui-unit/api/public_plus_experimental_0.1.0-dev11.txt
+++ b/ui/ui-unit/api/public_plus_experimental_0.1.0-dev11.txt
@@ -50,10 +50,10 @@
method public static inline operator float div-impl(float $this, int other);
method public static inline operator float div-ipo6vVg(float $this, float other);
method public static inline operator float div-x8crYZs(float $this, float other);
- method public static boolean equals-impl(float p, Object? p1);
+ method public static inline boolean equals-impl(float p, Object? p1);
method public static boolean equals-impl0(float p1, float p2);
method public float getValue();
- method public static int hashCode-impl(float p);
+ method public static inline int hashCode-impl(float p);
method public static inline operator float minus-ipo6vVg(float $this, float other);
method public static inline operator float plus-ipo6vVg(float $this, float other);
method public static inline operator float times-impl(float $this, float other);
@@ -83,10 +83,10 @@
method public static inline operator float div-impl(float $this, float other);
method public static inline operator float div-ipo6vVg(float $this, float other);
method public static inline operator float div-x8crYZs(float $this, float other);
- method public static boolean equals-impl(float p, Object? p1);
+ method public static inline boolean equals-impl(float p, Object? p1);
method public static boolean equals-impl0(float p1, float p2);
method public float getValue();
- method public static int hashCode-impl(float p);
+ method public static inline int hashCode-impl(float p);
method public static inline operator float minus-JDqhs2g(float $this, float dimension);
method public static inline operator float plus-JDqhs2g(float $this, float dimension);
method public static inline operator float times-impl(float $this, float other);
@@ -99,10 +99,10 @@
method public static operator int compareTo-_K2iRR8(float $this, float other);
method public static float constructor-impl(float value);
method public static inline operator float div-impl(float $this, float other);
- method public static boolean equals-impl(float p, Object? p1);
+ method public static inline boolean equals-impl(float p, Object? p1);
method public static boolean equals-impl0(float p1, float p2);
method public float getValue();
- method public static int hashCode-impl(float p);
+ method public static inline int hashCode-impl(float p);
method public static inline operator float minus-_K2iRR8(float $this, float dimension);
method public static inline operator float plus-_K2iRR8(float $this, float dimension);
method public static inline operator float times-JDqhs2g(float $this, float other);
@@ -152,10 +152,10 @@
method public static inline operator float div-impl(float $this, float other);
method public static inline operator float div-ipo6vVg(float $this, float other);
method public static inline operator float div-x8crYZs(float $this, float other);
- method public static boolean equals-impl(float p, Object? p1);
+ method public static inline boolean equals-impl(float p, Object? p1);
method public static boolean equals-impl0(float p1, float p2);
method public float getValue();
- method public static int hashCode-impl(float p);
+ method public static inline int hashCode-impl(float p);
method public static inline operator float minus-x8crYZs(float $this, float other);
method public static inline operator float plus-x8crYZs(float $this, float other);
method public static inline operator float times-impl(float $this, float other);
@@ -227,10 +227,10 @@
method public static operator int div-impl(int $this, float other);
method public static operator int div-impl(int $this, double other);
method public static operator int div-impl(int $this, int other);
- method public static boolean equals-impl(int p, Object? p1);
+ method public static inline boolean equals-impl(int p, Object? p1);
method public static boolean equals-impl0(int p1, int p2);
method public int getValue();
- method public static int hashCode-impl(int p);
+ method public static inline int hashCode-impl(int p);
method public static operator int minus-gshw56o(int $this, int other);
method public static operator int plus-gshw56o(int $this, int other);
method public static inline operator int rem-impl(int $this, int other);
@@ -322,11 +322,11 @@
ctor public IntSize();
method public static long constructor-impl(internal long value);
method public static operator long div-impl(long $this, int other);
- method public static boolean equals-impl(long p, Object? p1);
+ method public static inline boolean equals-impl(long p, Object? p1);
method public static boolean equals-impl0(long p1, long p2);
method public static int getHeight-impl(long $this);
method public static int getWidth-impl(long $this);
- method public static int hashCode-impl(long p);
+ method public static inline int hashCode-impl(long p);
method public static operator long times-impl(long $this, int other);
method public static String toString-impl(long $this);
}
@@ -339,11 +339,11 @@
public final inline class Position {
ctor public Position();
method public static long constructor-impl(internal long value);
- method public static boolean equals-impl(long p, Object? p1);
+ method public static inline boolean equals-impl(long p, Object? p1);
method public static boolean equals-impl0(long p1, long p2);
method public static float getX-impl(long $this);
method public static float getY-impl(long $this);
- method public static int hashCode-impl(long p);
+ method public static inline int hashCode-impl(long p);
method public static inline operator long minus-T8eBu-w(long $this, long other);
method public static inline operator long plus-T8eBu-w(long $this, long other);
method public static String toString-impl(long $this);
@@ -359,10 +359,10 @@
method public static inline operator float div-RjPF0Mw(float $this, float other);
method public static inline operator float div-impl(float $this, float other);
method public static inline operator float div-impl(float $this, int other);
- method public static boolean equals-impl(float p, Object? p1);
+ method public static inline boolean equals-impl(float p, Object? p1);
method public static boolean equals-impl0(float p1, float p2);
method public float getValue();
- method public static int hashCode-impl(float p);
+ method public static inline int hashCode-impl(float p);
method public static inline operator float minus-NgWp0Z8(float $this, float other);
method public static inline operator float minus-gshw56o(float $this, int other);
method public static inline operator float plus-NgWp0Z8(float $this, float other);
@@ -404,10 +404,10 @@
method public static inline operator float div-RjPF0Mw(float $this, float other);
method public static inline operator float div-bji3ab4(float $this, float other);
method public static inline operator float div-impl(float $this, float other);
- method public static boolean equals-impl(float p, Object? p1);
+ method public static inline boolean equals-impl(float p, Object? p1);
method public static boolean equals-impl0(float p1, float p2);
method public float getValue();
- method public static int hashCode-impl(float p);
+ method public static inline int hashCode-impl(float p);
method public static inline operator float minus-bji3ab4(float $this, float dimension);
method public static inline operator float plus-bji3ab4(float $this, float dimension);
method public static inline operator float times-impl(float $this, float other);
@@ -420,10 +420,10 @@
method public static operator int compareTo-KGV0gLo(float $this, float other);
method public static float constructor-impl(float value);
method public static inline operator float div-impl(float $this, float other);
- method public static boolean equals-impl(float p, Object? p1);
+ method public static inline boolean equals-impl(float p, Object? p1);
method public static boolean equals-impl0(float p1, float p2);
method public float getValue();
- method public static int hashCode-impl(float p);
+ method public static inline int hashCode-impl(float p);
method public static inline operator float minus-KGV0gLo(float $this, float dimension);
method public static inline operator float plus-KGV0gLo(float $this, float dimension);
method public static inline operator float times-NgWp0Z8(float $this, float other);
@@ -465,7 +465,7 @@
method public static inline operator float times-Ndu7NvY(int, float other);
method public static inline operator float times-kxDXtn8(float, float other);
method public static androidx.ui.unit.PxBounds toBounds(androidx.ui.unit.PxSize);
- method public static inline androidx.ui.geometry.Offset toOffset(androidx.ui.unit.PxPosition);
+ method public static inline long toOffset(androidx.ui.unit.PxPosition);
method public static androidx.ui.geometry.Rect toRect(androidx.ui.unit.PxBounds);
method public static androidx.ui.geometry.Rect toRect(androidx.ui.unit.PxSize);
method public static androidx.ui.unit.PxSize toSize(androidx.ui.unit.PxBounds);
@@ -521,10 +521,10 @@
method public static inline operator float div-RjPF0Mw(float $this, float other);
method public static inline operator float div-bji3ab4(float $this, float other);
method public static inline operator float div-impl(float $this, float other);
- method public static boolean equals-impl(float p, Object? p1);
+ method public static inline boolean equals-impl(float p, Object? p1);
method public static boolean equals-impl0(float p1, float p2);
method public float getValue();
- method public static int hashCode-impl(float p);
+ method public static inline int hashCode-impl(float p);
method public static inline operator float minus-RjPF0Mw(float $this, float other);
method public static inline operator float plus-RjPF0Mw(float $this, float other);
method public static inline operator float times-NgWp0Z8(float $this, float other);
@@ -538,11 +538,11 @@
method public static inline operator long div-impl(long $this, int other);
method public static inline operator long div-impl(long $this, float other);
method public static inline operator long div-impl(long $this, double other);
- method public static boolean equals-impl(long p, Object? p1);
+ method public static inline boolean equals-impl(long p, Object? p1);
method public static boolean equals-impl0(long p1, long p2);
method public static float getHeight-impl(long $this);
method public static float getWidth-impl(long $this);
- method public static int hashCode-impl(long p);
+ method public static inline int hashCode-impl(long p);
method public static inline operator long times-impl(long $this, int other);
method public static inline operator long times-impl(long $this, float other);
method public static inline operator long times-impl(long $this, double other);
@@ -557,12 +557,12 @@
method public static inline operator long div-impl(long $this, double other);
method public static inline operator long div-impl(long $this, int other);
method public static inline operator float div-vVlMl6k(long $this, long other);
- method public static boolean equals-impl(long p, Object? p1);
+ method public static inline boolean equals-impl(long p, Object? p1);
method public static boolean equals-impl0(long p1, long p2);
method public long getPackedValue();
method public static androidx.ui.unit.TextUnitType getType-impl(long $this);
method public static float getValue-impl(long $this);
- method public static int hashCode-impl(long p);
+ method public static inline int hashCode-impl(long p);
method public static boolean isEm-impl(long $this);
method public static boolean isInherit-impl(long $this);
method public static boolean isSp-impl(long $this);
diff --git a/ui/ui-unit/api/public_plus_experimental_current.txt b/ui/ui-unit/api/public_plus_experimental_current.txt
index 0ec30fa..4df20e4 100644
--- a/ui/ui-unit/api/public_plus_experimental_current.txt
+++ b/ui/ui-unit/api/public_plus_experimental_current.txt
@@ -50,10 +50,10 @@
method public static inline operator float div-impl(float $this, int other);
method public static inline operator float div-ipo6vVg(float $this, float other);
method public static inline operator float div-x8crYZs(float $this, float other);
- method public static boolean equals-impl(float p, Object? p1);
+ method public static inline boolean equals-impl(float p, Object? p1);
method public static boolean equals-impl0(float p1, float p2);
method public float getValue();
- method public static int hashCode-impl(float p);
+ method public static inline int hashCode-impl(float p);
method public static inline operator float minus-ipo6vVg(float $this, float other);
method public static inline operator float plus-ipo6vVg(float $this, float other);
method public static inline operator float times-impl(float $this, float other);
@@ -83,10 +83,10 @@
method public static inline operator float div-impl(float $this, float other);
method public static inline operator float div-ipo6vVg(float $this, float other);
method public static inline operator float div-x8crYZs(float $this, float other);
- method public static boolean equals-impl(float p, Object? p1);
+ method public static inline boolean equals-impl(float p, Object? p1);
method public static boolean equals-impl0(float p1, float p2);
method public float getValue();
- method public static int hashCode-impl(float p);
+ method public static inline int hashCode-impl(float p);
method public static inline operator float minus-JDqhs2g(float $this, float dimension);
method public static inline operator float plus-JDqhs2g(float $this, float dimension);
method public static inline operator float times-impl(float $this, float other);
@@ -99,10 +99,10 @@
method public static operator int compareTo-_K2iRR8(float $this, float other);
method public static float constructor-impl(float value);
method public static inline operator float div-impl(float $this, float other);
- method public static boolean equals-impl(float p, Object? p1);
+ method public static inline boolean equals-impl(float p, Object? p1);
method public static boolean equals-impl0(float p1, float p2);
method public float getValue();
- method public static int hashCode-impl(float p);
+ method public static inline int hashCode-impl(float p);
method public static inline operator float minus-_K2iRR8(float $this, float dimension);
method public static inline operator float plus-_K2iRR8(float $this, float dimension);
method public static inline operator float times-JDqhs2g(float $this, float other);
@@ -152,10 +152,10 @@
method public static inline operator float div-impl(float $this, float other);
method public static inline operator float div-ipo6vVg(float $this, float other);
method public static inline operator float div-x8crYZs(float $this, float other);
- method public static boolean equals-impl(float p, Object? p1);
+ method public static inline boolean equals-impl(float p, Object? p1);
method public static boolean equals-impl0(float p1, float p2);
method public float getValue();
- method public static int hashCode-impl(float p);
+ method public static inline int hashCode-impl(float p);
method public static inline operator float minus-x8crYZs(float $this, float other);
method public static inline operator float plus-x8crYZs(float $this, float other);
method public static inline operator float times-impl(float $this, float other);
@@ -227,10 +227,10 @@
method public static operator int div-impl(int $this, float other);
method public static operator int div-impl(int $this, double other);
method public static operator int div-impl(int $this, int other);
- method public static boolean equals-impl(int p, Object? p1);
+ method public static inline boolean equals-impl(int p, Object? p1);
method public static boolean equals-impl0(int p1, int p2);
method public int getValue();
- method public static int hashCode-impl(int p);
+ method public static inline int hashCode-impl(int p);
method public static operator int minus-gshw56o(int $this, int other);
method public static operator int plus-gshw56o(int $this, int other);
method public static inline operator int rem-impl(int $this, int other);
@@ -322,11 +322,11 @@
ctor public IntSize();
method public static long constructor-impl(internal long value);
method public static operator long div-impl(long $this, int other);
- method public static boolean equals-impl(long p, Object? p1);
+ method public static inline boolean equals-impl(long p, Object? p1);
method public static boolean equals-impl0(long p1, long p2);
method public static int getHeight-impl(long $this);
method public static int getWidth-impl(long $this);
- method public static int hashCode-impl(long p);
+ method public static inline int hashCode-impl(long p);
method public static operator long times-impl(long $this, int other);
method public static String toString-impl(long $this);
}
@@ -339,11 +339,11 @@
public final inline class Position {
ctor public Position();
method public static long constructor-impl(internal long value);
- method public static boolean equals-impl(long p, Object? p1);
+ method public static inline boolean equals-impl(long p, Object? p1);
method public static boolean equals-impl0(long p1, long p2);
method public static float getX-impl(long $this);
method public static float getY-impl(long $this);
- method public static int hashCode-impl(long p);
+ method public static inline int hashCode-impl(long p);
method public static inline operator long minus-T8eBu-w(long $this, long other);
method public static inline operator long plus-T8eBu-w(long $this, long other);
method public static String toString-impl(long $this);
@@ -359,10 +359,10 @@
method public static inline operator float div-RjPF0Mw(float $this, float other);
method public static inline operator float div-impl(float $this, float other);
method public static inline operator float div-impl(float $this, int other);
- method public static boolean equals-impl(float p, Object? p1);
+ method public static inline boolean equals-impl(float p, Object? p1);
method public static boolean equals-impl0(float p1, float p2);
method public float getValue();
- method public static int hashCode-impl(float p);
+ method public static inline int hashCode-impl(float p);
method public static inline operator float minus-NgWp0Z8(float $this, float other);
method public static inline operator float minus-gshw56o(float $this, int other);
method public static inline operator float plus-NgWp0Z8(float $this, float other);
@@ -404,10 +404,10 @@
method public static inline operator float div-RjPF0Mw(float $this, float other);
method public static inline operator float div-bji3ab4(float $this, float other);
method public static inline operator float div-impl(float $this, float other);
- method public static boolean equals-impl(float p, Object? p1);
+ method public static inline boolean equals-impl(float p, Object? p1);
method public static boolean equals-impl0(float p1, float p2);
method public float getValue();
- method public static int hashCode-impl(float p);
+ method public static inline int hashCode-impl(float p);
method public static inline operator float minus-bji3ab4(float $this, float dimension);
method public static inline operator float plus-bji3ab4(float $this, float dimension);
method public static inline operator float times-impl(float $this, float other);
@@ -420,10 +420,10 @@
method public static operator int compareTo-KGV0gLo(float $this, float other);
method public static float constructor-impl(float value);
method public static inline operator float div-impl(float $this, float other);
- method public static boolean equals-impl(float p, Object? p1);
+ method public static inline boolean equals-impl(float p, Object? p1);
method public static boolean equals-impl0(float p1, float p2);
method public float getValue();
- method public static int hashCode-impl(float p);
+ method public static inline int hashCode-impl(float p);
method public static inline operator float minus-KGV0gLo(float $this, float dimension);
method public static inline operator float plus-KGV0gLo(float $this, float dimension);
method public static inline operator float times-NgWp0Z8(float $this, float other);
@@ -465,7 +465,7 @@
method public static inline operator float times-Ndu7NvY(int, float other);
method public static inline operator float times-kxDXtn8(float, float other);
method public static androidx.ui.unit.PxBounds toBounds(androidx.ui.unit.PxSize);
- method public static inline androidx.ui.geometry.Offset toOffset(androidx.ui.unit.PxPosition);
+ method public static inline long toOffset(androidx.ui.unit.PxPosition);
method public static androidx.ui.geometry.Rect toRect(androidx.ui.unit.PxBounds);
method public static androidx.ui.geometry.Rect toRect(androidx.ui.unit.PxSize);
method public static androidx.ui.unit.PxSize toSize(androidx.ui.unit.PxBounds);
@@ -521,10 +521,10 @@
method public static inline operator float div-RjPF0Mw(float $this, float other);
method public static inline operator float div-bji3ab4(float $this, float other);
method public static inline operator float div-impl(float $this, float other);
- method public static boolean equals-impl(float p, Object? p1);
+ method public static inline boolean equals-impl(float p, Object? p1);
method public static boolean equals-impl0(float p1, float p2);
method public float getValue();
- method public static int hashCode-impl(float p);
+ method public static inline int hashCode-impl(float p);
method public static inline operator float minus-RjPF0Mw(float $this, float other);
method public static inline operator float plus-RjPF0Mw(float $this, float other);
method public static inline operator float times-NgWp0Z8(float $this, float other);
@@ -538,11 +538,11 @@
method public static inline operator long div-impl(long $this, int other);
method public static inline operator long div-impl(long $this, float other);
method public static inline operator long div-impl(long $this, double other);
- method public static boolean equals-impl(long p, Object? p1);
+ method public static inline boolean equals-impl(long p, Object? p1);
method public static boolean equals-impl0(long p1, long p2);
method public static float getHeight-impl(long $this);
method public static float getWidth-impl(long $this);
- method public static int hashCode-impl(long p);
+ method public static inline int hashCode-impl(long p);
method public static inline operator long times-impl(long $this, int other);
method public static inline operator long times-impl(long $this, float other);
method public static inline operator long times-impl(long $this, double other);
@@ -557,12 +557,12 @@
method public static inline operator long div-impl(long $this, double other);
method public static inline operator long div-impl(long $this, int other);
method public static inline operator float div-vVlMl6k(long $this, long other);
- method public static boolean equals-impl(long p, Object? p1);
+ method public static inline boolean equals-impl(long p, Object? p1);
method public static boolean equals-impl0(long p1, long p2);
method public long getPackedValue();
method public static androidx.ui.unit.TextUnitType getType-impl(long $this);
method public static float getValue-impl(long $this);
- method public static int hashCode-impl(long p);
+ method public static inline int hashCode-impl(long p);
method public static boolean isEm-impl(long $this);
method public static boolean isInherit-impl(long $this);
method public static boolean isSp-impl(long $this);
diff --git a/ui/ui-unit/api/restricted_0.1.0-dev11.txt b/ui/ui-unit/api/restricted_0.1.0-dev11.txt
index 0ec30fa..4df20e4 100644
--- a/ui/ui-unit/api/restricted_0.1.0-dev11.txt
+++ b/ui/ui-unit/api/restricted_0.1.0-dev11.txt
@@ -50,10 +50,10 @@
method public static inline operator float div-impl(float $this, int other);
method public static inline operator float div-ipo6vVg(float $this, float other);
method public static inline operator float div-x8crYZs(float $this, float other);
- method public static boolean equals-impl(float p, Object? p1);
+ method public static inline boolean equals-impl(float p, Object? p1);
method public static boolean equals-impl0(float p1, float p2);
method public float getValue();
- method public static int hashCode-impl(float p);
+ method public static inline int hashCode-impl(float p);
method public static inline operator float minus-ipo6vVg(float $this, float other);
method public static inline operator float plus-ipo6vVg(float $this, float other);
method public static inline operator float times-impl(float $this, float other);
@@ -83,10 +83,10 @@
method public static inline operator float div-impl(float $this, float other);
method public static inline operator float div-ipo6vVg(float $this, float other);
method public static inline operator float div-x8crYZs(float $this, float other);
- method public static boolean equals-impl(float p, Object? p1);
+ method public static inline boolean equals-impl(float p, Object? p1);
method public static boolean equals-impl0(float p1, float p2);
method public float getValue();
- method public static int hashCode-impl(float p);
+ method public static inline int hashCode-impl(float p);
method public static inline operator float minus-JDqhs2g(float $this, float dimension);
method public static inline operator float plus-JDqhs2g(float $this, float dimension);
method public static inline operator float times-impl(float $this, float other);
@@ -99,10 +99,10 @@
method public static operator int compareTo-_K2iRR8(float $this, float other);
method public static float constructor-impl(float value);
method public static inline operator float div-impl(float $this, float other);
- method public static boolean equals-impl(float p, Object? p1);
+ method public static inline boolean equals-impl(float p, Object? p1);
method public static boolean equals-impl0(float p1, float p2);
method public float getValue();
- method public static int hashCode-impl(float p);
+ method public static inline int hashCode-impl(float p);
method public static inline operator float minus-_K2iRR8(float $this, float dimension);
method public static inline operator float plus-_K2iRR8(float $this, float dimension);
method public static inline operator float times-JDqhs2g(float $this, float other);
@@ -152,10 +152,10 @@
method public static inline operator float div-impl(float $this, float other);
method public static inline operator float div-ipo6vVg(float $this, float other);
method public static inline operator float div-x8crYZs(float $this, float other);
- method public static boolean equals-impl(float p, Object? p1);
+ method public static inline boolean equals-impl(float p, Object? p1);
method public static boolean equals-impl0(float p1, float p2);
method public float getValue();
- method public static int hashCode-impl(float p);
+ method public static inline int hashCode-impl(float p);
method public static inline operator float minus-x8crYZs(float $this, float other);
method public static inline operator float plus-x8crYZs(float $this, float other);
method public static inline operator float times-impl(float $this, float other);
@@ -227,10 +227,10 @@
method public static operator int div-impl(int $this, float other);
method public static operator int div-impl(int $this, double other);
method public static operator int div-impl(int $this, int other);
- method public static boolean equals-impl(int p, Object? p1);
+ method public static inline boolean equals-impl(int p, Object? p1);
method public static boolean equals-impl0(int p1, int p2);
method public int getValue();
- method public static int hashCode-impl(int p);
+ method public static inline int hashCode-impl(int p);
method public static operator int minus-gshw56o(int $this, int other);
method public static operator int plus-gshw56o(int $this, int other);
method public static inline operator int rem-impl(int $this, int other);
@@ -322,11 +322,11 @@
ctor public IntSize();
method public static long constructor-impl(internal long value);
method public static operator long div-impl(long $this, int other);
- method public static boolean equals-impl(long p, Object? p1);
+ method public static inline boolean equals-impl(long p, Object? p1);
method public static boolean equals-impl0(long p1, long p2);
method public static int getHeight-impl(long $this);
method public static int getWidth-impl(long $this);
- method public static int hashCode-impl(long p);
+ method public static inline int hashCode-impl(long p);
method public static operator long times-impl(long $this, int other);
method public static String toString-impl(long $this);
}
@@ -339,11 +339,11 @@
public final inline class Position {
ctor public Position();
method public static long constructor-impl(internal long value);
- method public static boolean equals-impl(long p, Object? p1);
+ method public static inline boolean equals-impl(long p, Object? p1);
method public static boolean equals-impl0(long p1, long p2);
method public static float getX-impl(long $this);
method public static float getY-impl(long $this);
- method public static int hashCode-impl(long p);
+ method public static inline int hashCode-impl(long p);
method public static inline operator long minus-T8eBu-w(long $this, long other);
method public static inline operator long plus-T8eBu-w(long $this, long other);
method public static String toString-impl(long $this);
@@ -359,10 +359,10 @@
method public static inline operator float div-RjPF0Mw(float $this, float other);
method public static inline operator float div-impl(float $this, float other);
method public static inline operator float div-impl(float $this, int other);
- method public static boolean equals-impl(float p, Object? p1);
+ method public static inline boolean equals-impl(float p, Object? p1);
method public static boolean equals-impl0(float p1, float p2);
method public float getValue();
- method public static int hashCode-impl(float p);
+ method public static inline int hashCode-impl(float p);
method public static inline operator float minus-NgWp0Z8(float $this, float other);
method public static inline operator float minus-gshw56o(float $this, int other);
method public static inline operator float plus-NgWp0Z8(float $this, float other);
@@ -404,10 +404,10 @@
method public static inline operator float div-RjPF0Mw(float $this, float other);
method public static inline operator float div-bji3ab4(float $this, float other);
method public static inline operator float div-impl(float $this, float other);
- method public static boolean equals-impl(float p, Object? p1);
+ method public static inline boolean equals-impl(float p, Object? p1);
method public static boolean equals-impl0(float p1, float p2);
method public float getValue();
- method public static int hashCode-impl(float p);
+ method public static inline int hashCode-impl(float p);
method public static inline operator float minus-bji3ab4(float $this, float dimension);
method public static inline operator float plus-bji3ab4(float $this, float dimension);
method public static inline operator float times-impl(float $this, float other);
@@ -420,10 +420,10 @@
method public static operator int compareTo-KGV0gLo(float $this, float other);
method public static float constructor-impl(float value);
method public static inline operator float div-impl(float $this, float other);
- method public static boolean equals-impl(float p, Object? p1);
+ method public static inline boolean equals-impl(float p, Object? p1);
method public static boolean equals-impl0(float p1, float p2);
method public float getValue();
- method public static int hashCode-impl(float p);
+ method public static inline int hashCode-impl(float p);
method public static inline operator float minus-KGV0gLo(float $this, float dimension);
method public static inline operator float plus-KGV0gLo(float $this, float dimension);
method public static inline operator float times-NgWp0Z8(float $this, float other);
@@ -465,7 +465,7 @@
method public static inline operator float times-Ndu7NvY(int, float other);
method public static inline operator float times-kxDXtn8(float, float other);
method public static androidx.ui.unit.PxBounds toBounds(androidx.ui.unit.PxSize);
- method public static inline androidx.ui.geometry.Offset toOffset(androidx.ui.unit.PxPosition);
+ method public static inline long toOffset(androidx.ui.unit.PxPosition);
method public static androidx.ui.geometry.Rect toRect(androidx.ui.unit.PxBounds);
method public static androidx.ui.geometry.Rect toRect(androidx.ui.unit.PxSize);
method public static androidx.ui.unit.PxSize toSize(androidx.ui.unit.PxBounds);
@@ -521,10 +521,10 @@
method public static inline operator float div-RjPF0Mw(float $this, float other);
method public static inline operator float div-bji3ab4(float $this, float other);
method public static inline operator float div-impl(float $this, float other);
- method public static boolean equals-impl(float p, Object? p1);
+ method public static inline boolean equals-impl(float p, Object? p1);
method public static boolean equals-impl0(float p1, float p2);
method public float getValue();
- method public static int hashCode-impl(float p);
+ method public static inline int hashCode-impl(float p);
method public static inline operator float minus-RjPF0Mw(float $this, float other);
method public static inline operator float plus-RjPF0Mw(float $this, float other);
method public static inline operator float times-NgWp0Z8(float $this, float other);
@@ -538,11 +538,11 @@
method public static inline operator long div-impl(long $this, int other);
method public static inline operator long div-impl(long $this, float other);
method public static inline operator long div-impl(long $this, double other);
- method public static boolean equals-impl(long p, Object? p1);
+ method public static inline boolean equals-impl(long p, Object? p1);
method public static boolean equals-impl0(long p1, long p2);
method public static float getHeight-impl(long $this);
method public static float getWidth-impl(long $this);
- method public static int hashCode-impl(long p);
+ method public static inline int hashCode-impl(long p);
method public static inline operator long times-impl(long $this, int other);
method public static inline operator long times-impl(long $this, float other);
method public static inline operator long times-impl(long $this, double other);
@@ -557,12 +557,12 @@
method public static inline operator long div-impl(long $this, double other);
method public static inline operator long div-impl(long $this, int other);
method public static inline operator float div-vVlMl6k(long $this, long other);
- method public static boolean equals-impl(long p, Object? p1);
+ method public static inline boolean equals-impl(long p, Object? p1);
method public static boolean equals-impl0(long p1, long p2);
method public long getPackedValue();
method public static androidx.ui.unit.TextUnitType getType-impl(long $this);
method public static float getValue-impl(long $this);
- method public static int hashCode-impl(long p);
+ method public static inline int hashCode-impl(long p);
method public static boolean isEm-impl(long $this);
method public static boolean isInherit-impl(long $this);
method public static boolean isSp-impl(long $this);
diff --git a/ui/ui-unit/api/restricted_current.txt b/ui/ui-unit/api/restricted_current.txt
index 0ec30fa..4df20e4 100644
--- a/ui/ui-unit/api/restricted_current.txt
+++ b/ui/ui-unit/api/restricted_current.txt
@@ -50,10 +50,10 @@
method public static inline operator float div-impl(float $this, int other);
method public static inline operator float div-ipo6vVg(float $this, float other);
method public static inline operator float div-x8crYZs(float $this, float other);
- method public static boolean equals-impl(float p, Object? p1);
+ method public static inline boolean equals-impl(float p, Object? p1);
method public static boolean equals-impl0(float p1, float p2);
method public float getValue();
- method public static int hashCode-impl(float p);
+ method public static inline int hashCode-impl(float p);
method public static inline operator float minus-ipo6vVg(float $this, float other);
method public static inline operator float plus-ipo6vVg(float $this, float other);
method public static inline operator float times-impl(float $this, float other);
@@ -83,10 +83,10 @@
method public static inline operator float div-impl(float $this, float other);
method public static inline operator float div-ipo6vVg(float $this, float other);
method public static inline operator float div-x8crYZs(float $this, float other);
- method public static boolean equals-impl(float p, Object? p1);
+ method public static inline boolean equals-impl(float p, Object? p1);
method public static boolean equals-impl0(float p1, float p2);
method public float getValue();
- method public static int hashCode-impl(float p);
+ method public static inline int hashCode-impl(float p);
method public static inline operator float minus-JDqhs2g(float $this, float dimension);
method public static inline operator float plus-JDqhs2g(float $this, float dimension);
method public static inline operator float times-impl(float $this, float other);
@@ -99,10 +99,10 @@
method public static operator int compareTo-_K2iRR8(float $this, float other);
method public static float constructor-impl(float value);
method public static inline operator float div-impl(float $this, float other);
- method public static boolean equals-impl(float p, Object? p1);
+ method public static inline boolean equals-impl(float p, Object? p1);
method public static boolean equals-impl0(float p1, float p2);
method public float getValue();
- method public static int hashCode-impl(float p);
+ method public static inline int hashCode-impl(float p);
method public static inline operator float minus-_K2iRR8(float $this, float dimension);
method public static inline operator float plus-_K2iRR8(float $this, float dimension);
method public static inline operator float times-JDqhs2g(float $this, float other);
@@ -152,10 +152,10 @@
method public static inline operator float div-impl(float $this, float other);
method public static inline operator float div-ipo6vVg(float $this, float other);
method public static inline operator float div-x8crYZs(float $this, float other);
- method public static boolean equals-impl(float p, Object? p1);
+ method public static inline boolean equals-impl(float p, Object? p1);
method public static boolean equals-impl0(float p1, float p2);
method public float getValue();
- method public static int hashCode-impl(float p);
+ method public static inline int hashCode-impl(float p);
method public static inline operator float minus-x8crYZs(float $this, float other);
method public static inline operator float plus-x8crYZs(float $this, float other);
method public static inline operator float times-impl(float $this, float other);
@@ -227,10 +227,10 @@
method public static operator int div-impl(int $this, float other);
method public static operator int div-impl(int $this, double other);
method public static operator int div-impl(int $this, int other);
- method public static boolean equals-impl(int p, Object? p1);
+ method public static inline boolean equals-impl(int p, Object? p1);
method public static boolean equals-impl0(int p1, int p2);
method public int getValue();
- method public static int hashCode-impl(int p);
+ method public static inline int hashCode-impl(int p);
method public static operator int minus-gshw56o(int $this, int other);
method public static operator int plus-gshw56o(int $this, int other);
method public static inline operator int rem-impl(int $this, int other);
@@ -322,11 +322,11 @@
ctor public IntSize();
method public static long constructor-impl(internal long value);
method public static operator long div-impl(long $this, int other);
- method public static boolean equals-impl(long p, Object? p1);
+ method public static inline boolean equals-impl(long p, Object? p1);
method public static boolean equals-impl0(long p1, long p2);
method public static int getHeight-impl(long $this);
method public static int getWidth-impl(long $this);
- method public static int hashCode-impl(long p);
+ method public static inline int hashCode-impl(long p);
method public static operator long times-impl(long $this, int other);
method public static String toString-impl(long $this);
}
@@ -339,11 +339,11 @@
public final inline class Position {
ctor public Position();
method public static long constructor-impl(internal long value);
- method public static boolean equals-impl(long p, Object? p1);
+ method public static inline boolean equals-impl(long p, Object? p1);
method public static boolean equals-impl0(long p1, long p2);
method public static float getX-impl(long $this);
method public static float getY-impl(long $this);
- method public static int hashCode-impl(long p);
+ method public static inline int hashCode-impl(long p);
method public static inline operator long minus-T8eBu-w(long $this, long other);
method public static inline operator long plus-T8eBu-w(long $this, long other);
method public static String toString-impl(long $this);
@@ -359,10 +359,10 @@
method public static inline operator float div-RjPF0Mw(float $this, float other);
method public static inline operator float div-impl(float $this, float other);
method public static inline operator float div-impl(float $this, int other);
- method public static boolean equals-impl(float p, Object? p1);
+ method public static inline boolean equals-impl(float p, Object? p1);
method public static boolean equals-impl0(float p1, float p2);
method public float getValue();
- method public static int hashCode-impl(float p);
+ method public static inline int hashCode-impl(float p);
method public static inline operator float minus-NgWp0Z8(float $this, float other);
method public static inline operator float minus-gshw56o(float $this, int other);
method public static inline operator float plus-NgWp0Z8(float $this, float other);
@@ -404,10 +404,10 @@
method public static inline operator float div-RjPF0Mw(float $this, float other);
method public static inline operator float div-bji3ab4(float $this, float other);
method public static inline operator float div-impl(float $this, float other);
- method public static boolean equals-impl(float p, Object? p1);
+ method public static inline boolean equals-impl(float p, Object? p1);
method public static boolean equals-impl0(float p1, float p2);
method public float getValue();
- method public static int hashCode-impl(float p);
+ method public static inline int hashCode-impl(float p);
method public static inline operator float minus-bji3ab4(float $this, float dimension);
method public static inline operator float plus-bji3ab4(float $this, float dimension);
method public static inline operator float times-impl(float $this, float other);
@@ -420,10 +420,10 @@
method public static operator int compareTo-KGV0gLo(float $this, float other);
method public static float constructor-impl(float value);
method public static inline operator float div-impl(float $this, float other);
- method public static boolean equals-impl(float p, Object? p1);
+ method public static inline boolean equals-impl(float p, Object? p1);
method public static boolean equals-impl0(float p1, float p2);
method public float getValue();
- method public static int hashCode-impl(float p);
+ method public static inline int hashCode-impl(float p);
method public static inline operator float minus-KGV0gLo(float $this, float dimension);
method public static inline operator float plus-KGV0gLo(float $this, float dimension);
method public static inline operator float times-NgWp0Z8(float $this, float other);
@@ -465,7 +465,7 @@
method public static inline operator float times-Ndu7NvY(int, float other);
method public static inline operator float times-kxDXtn8(float, float other);
method public static androidx.ui.unit.PxBounds toBounds(androidx.ui.unit.PxSize);
- method public static inline androidx.ui.geometry.Offset toOffset(androidx.ui.unit.PxPosition);
+ method public static inline long toOffset(androidx.ui.unit.PxPosition);
method public static androidx.ui.geometry.Rect toRect(androidx.ui.unit.PxBounds);
method public static androidx.ui.geometry.Rect toRect(androidx.ui.unit.PxSize);
method public static androidx.ui.unit.PxSize toSize(androidx.ui.unit.PxBounds);
@@ -521,10 +521,10 @@
method public static inline operator float div-RjPF0Mw(float $this, float other);
method public static inline operator float div-bji3ab4(float $this, float other);
method public static inline operator float div-impl(float $this, float other);
- method public static boolean equals-impl(float p, Object? p1);
+ method public static inline boolean equals-impl(float p, Object? p1);
method public static boolean equals-impl0(float p1, float p2);
method public float getValue();
- method public static int hashCode-impl(float p);
+ method public static inline int hashCode-impl(float p);
method public static inline operator float minus-RjPF0Mw(float $this, float other);
method public static inline operator float plus-RjPF0Mw(float $this, float other);
method public static inline operator float times-NgWp0Z8(float $this, float other);
@@ -538,11 +538,11 @@
method public static inline operator long div-impl(long $this, int other);
method public static inline operator long div-impl(long $this, float other);
method public static inline operator long div-impl(long $this, double other);
- method public static boolean equals-impl(long p, Object? p1);
+ method public static inline boolean equals-impl(long p, Object? p1);
method public static boolean equals-impl0(long p1, long p2);
method public static float getHeight-impl(long $this);
method public static float getWidth-impl(long $this);
- method public static int hashCode-impl(long p);
+ method public static inline int hashCode-impl(long p);
method public static inline operator long times-impl(long $this, int other);
method public static inline operator long times-impl(long $this, float other);
method public static inline operator long times-impl(long $this, double other);
@@ -557,12 +557,12 @@
method public static inline operator long div-impl(long $this, double other);
method public static inline operator long div-impl(long $this, int other);
method public static inline operator float div-vVlMl6k(long $this, long other);
- method public static boolean equals-impl(long p, Object? p1);
+ method public static inline boolean equals-impl(long p, Object? p1);
method public static boolean equals-impl0(long p1, long p2);
method public long getPackedValue();
method public static androidx.ui.unit.TextUnitType getType-impl(long $this);
method public static float getValue-impl(long $this);
- method public static int hashCode-impl(long p);
+ method public static inline int hashCode-impl(long p);
method public static boolean isEm-impl(long $this);
method public static boolean isInherit-impl(long $this);
method public static boolean isSp-impl(long $this);
diff --git a/wear/wear/api/1.1.0-rc01.txt b/wear/wear/api/1.1.0-rc01.txt
new file mode 100644
index 0000000..b193e32
--- /dev/null
+++ b/wear/wear/api/1.1.0-rc01.txt
@@ -0,0 +1,340 @@
+// 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_DURATION_MILLIS = "androidx.wear.activity.extra.ANIMATION_DURATION_MILLIS";
+ 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!);
+ 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";
+ }
+
+ @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 @Deprecated public androidx.wear.widget.ConfirmationOverlay setFinishedAnimationListener(androidx.wear.widget.ConfirmationOverlay.OnAnimationFinishedListener?);
+ method @Deprecated public androidx.wear.widget.ConfirmationOverlay setMessage(String);
+ method public androidx.wear.widget.ConfirmationOverlay setMessage(CharSequence);
+ method public androidx.wear.widget.ConfirmationOverlay setOnAnimationFinishedListener(androidx.wear.widget.ConfirmationOverlay.OnAnimationFinishedListener?);
+ 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();
+ }
+
+ @IntDef({androidx.wear.widget.ConfirmationOverlay.SUCCESS_ANIMATION, androidx.wear.widget.ConfirmationOverlay.FAILURE_ANIMATION, androidx.wear.widget.ConfirmationOverlay.OPEN_ON_PHONE_ANIMATION}) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) 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/wear/api/public_plus_experimental_1.1.0-rc01.txt b/wear/wear/api/public_plus_experimental_1.1.0-rc01.txt
new file mode 100644
index 0000000..b193e32
--- /dev/null
+++ b/wear/wear/api/public_plus_experimental_1.1.0-rc01.txt
@@ -0,0 +1,340 @@
+// 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_DURATION_MILLIS = "androidx.wear.activity.extra.ANIMATION_DURATION_MILLIS";
+ 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!);
+ 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";
+ }
+
+ @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 @Deprecated public androidx.wear.widget.ConfirmationOverlay setFinishedAnimationListener(androidx.wear.widget.ConfirmationOverlay.OnAnimationFinishedListener?);
+ method @Deprecated public androidx.wear.widget.ConfirmationOverlay setMessage(String);
+ method public androidx.wear.widget.ConfirmationOverlay setMessage(CharSequence);
+ method public androidx.wear.widget.ConfirmationOverlay setOnAnimationFinishedListener(androidx.wear.widget.ConfirmationOverlay.OnAnimationFinishedListener?);
+ 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();
+ }
+
+ @IntDef({androidx.wear.widget.ConfirmationOverlay.SUCCESS_ANIMATION, androidx.wear.widget.ConfirmationOverlay.FAILURE_ANIMATION, androidx.wear.widget.ConfirmationOverlay.OPEN_ON_PHONE_ANIMATION}) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) 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/wear/api/res-1.1.0-rc01.txt b/wear/wear/api/res-1.1.0-rc01.txt
new file mode 100644
index 0000000..44b0b55
--- /dev/null
+++ b/wear/wear/api/res-1.1.0-rc01.txt
@@ -0,0 +1 @@
+style Widget_Wear_RoundSwitch
diff --git a/wear/wear/api/restricted_1.1.0-rc01.txt b/wear/wear/api/restricted_1.1.0-rc01.txt
new file mode 100644
index 0000000..a1178e5
--- /dev/null
+++ b/wear/wear/api/restricted_1.1.0-rc01.txt
@@ -0,0 +1,341 @@
+// 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_DURATION_MILLIS = "androidx.wear.activity.extra.ANIMATION_DURATION_MILLIS";
+ 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!);
+ 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";
+ }
+
+ @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 @MainThread @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) @VisibleForTesting public void hide();
+ method public androidx.wear.widget.ConfirmationOverlay setDuration(int);
+ method @Deprecated public androidx.wear.widget.ConfirmationOverlay setFinishedAnimationListener(androidx.wear.widget.ConfirmationOverlay.OnAnimationFinishedListener?);
+ method @Deprecated public androidx.wear.widget.ConfirmationOverlay setMessage(String);
+ method public androidx.wear.widget.ConfirmationOverlay setMessage(CharSequence);
+ method public androidx.wear.widget.ConfirmationOverlay setOnAnimationFinishedListener(androidx.wear.widget.ConfirmationOverlay.OnAnimationFinishedListener?);
+ 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();
+ }
+
+ @IntDef({androidx.wear.widget.ConfirmationOverlay.SUCCESS_ANIMATION, androidx.wear.widget.ConfirmationOverlay.FAILURE_ANIMATION, androidx.wear.widget.ConfirmationOverlay.OPEN_ON_PHONE_ANIMATION}) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) 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/work/workmanager-ktx/api/2.4.0-alpha03.ignore b/work/workmanager-ktx/api/2.4.0-alpha03.ignore
new file mode 100644
index 0000000..523b36f
--- /dev/null
+++ b/work/workmanager-ktx/api/2.4.0-alpha03.ignore
@@ -0,0 +1,13 @@
+// Baseline format: 1.0
+InvalidNullConversion: androidx.work.CoroutineWorker#doWork(kotlin.coroutines.Continuation<? super androidx.work.ListenableWorker.Result>):
+ Attempted to change method return from @NonNull to @Nullable: incompatible change for method androidx.work.CoroutineWorker.doWork(kotlin.coroutines.Continuation<? super androidx.work.ListenableWorker.Result>)
+InvalidNullConversion: androidx.work.OneTimeWorkRequestKt#OneTimeWorkRequestBuilder():
+ Attempted to remove @NonNull annotation from method androidx.work.OneTimeWorkRequestKt.OneTimeWorkRequestBuilder()
+InvalidNullConversion: androidx.work.PeriodicWorkRequestKt#PeriodicWorkRequestBuilder(java.time.Duration):
+ Attempted to remove @NonNull annotation from method androidx.work.PeriodicWorkRequestKt.PeriodicWorkRequestBuilder(java.time.Duration)
+InvalidNullConversion: androidx.work.PeriodicWorkRequestKt#PeriodicWorkRequestBuilder(java.time.Duration, java.time.Duration):
+ Attempted to remove @NonNull annotation from method androidx.work.PeriodicWorkRequestKt.PeriodicWorkRequestBuilder(java.time.Duration,java.time.Duration)
+InvalidNullConversion: androidx.work.PeriodicWorkRequestKt#PeriodicWorkRequestBuilder(long, java.util.concurrent.TimeUnit):
+ Attempted to remove @NonNull annotation from method androidx.work.PeriodicWorkRequestKt.PeriodicWorkRequestBuilder(long,java.util.concurrent.TimeUnit)
+InvalidNullConversion: androidx.work.PeriodicWorkRequestKt#PeriodicWorkRequestBuilder(long, java.util.concurrent.TimeUnit, long, java.util.concurrent.TimeUnit):
+ Attempted to remove @NonNull annotation from method androidx.work.PeriodicWorkRequestKt.PeriodicWorkRequestBuilder(long,java.util.concurrent.TimeUnit,long,java.util.concurrent.TimeUnit)
diff --git a/work/workmanager-ktx/api/2.4.0-alpha03.txt b/work/workmanager-ktx/api/2.4.0-alpha03.txt
index dee5846..4cb2b80 100644
--- a/work/workmanager-ktx/api/2.4.0-alpha03.txt
+++ b/work/workmanager-ktx/api/2.4.0-alpha03.txt
@@ -3,11 +3,11 @@
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.Continuation<? super androidx.work.ListenableWorker.Result> p);
+ method public abstract suspend Object? doWork(kotlin.coroutines.Continuation<? super androidx.work.ListenableWorker.Result> p);
method @Deprecated public kotlinx.coroutines.CoroutineDispatcher getCoroutineContext();
method public final void onStopped();
- method public final suspend Object! setForeground(androidx.work.ForegroundInfo foregroundInfo, kotlin.coroutines.Continuation<? super kotlin.Unit> p);
- method public final suspend Object! setProgress(androidx.work.Data data, kotlin.coroutines.Continuation<? super kotlin.Unit> p);
+ method public final suspend Object? setForeground(androidx.work.ForegroundInfo foregroundInfo, kotlin.coroutines.Continuation<? super kotlin.Unit> p);
+ method public final suspend Object? setProgress(androidx.work.Data data, kotlin.coroutines.Continuation<? super kotlin.Unit> p);
method public final com.google.common.util.concurrent.ListenableFuture<androidx.work.ListenableWorker.Result> startWork();
property @Deprecated public kotlinx.coroutines.CoroutineDispatcher coroutineContext;
}
@@ -21,19 +21,19 @@
}
public final class OneTimeWorkRequestKt {
- method public static inline <reified W extends androidx.work.ListenableWorker> androidx.work.OneTimeWorkRequest.Builder OneTimeWorkRequestBuilder();
+ method public static inline <reified W> 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 {
- method public static suspend inline Object! await(androidx.work.Operation, kotlin.coroutines.Continuation<? super androidx.work.Operation.State.SUCCESS> p);
+ method public static suspend inline Object? await(androidx.work.Operation, kotlin.coroutines.Continuation<? super androidx.work.Operation.State.SUCCESS> p);
}
public final class 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);
+ method public static inline <reified W> androidx.work.PeriodicWorkRequest.Builder! PeriodicWorkRequestBuilder(long repeatInterval, java.util.concurrent.TimeUnit repeatIntervalTimeUnit);
+ method @RequiresApi(26) public static inline <reified W> androidx.work.PeriodicWorkRequest.Builder! PeriodicWorkRequestBuilder(java.time.Duration repeatInterval);
+ method public static inline <reified W> 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> androidx.work.PeriodicWorkRequest.Builder! PeriodicWorkRequestBuilder(java.time.Duration repeatInterval, java.time.Duration flexTimeInterval);
}
}
diff --git a/work/workmanager-ktx/api/api_lint.ignore b/work/workmanager-ktx/api/api_lint.ignore
index e571196..539a475 100644
--- a/work/workmanager-ktx/api/api_lint.ignore
+++ b/work/workmanager-ktx/api/api_lint.ignore
@@ -1,7 +1,11 @@
// Baseline format: 1.0
-MissingNullability: androidx.work.CoroutineWorker#setForeground(androidx.work.ForegroundInfo, kotlin.coroutines.Continuation<? super kotlin.Unit>):
- Missing nullability on method `setForeground` return
-MissingNullability: androidx.work.CoroutineWorker#setProgress(androidx.work.Data, kotlin.coroutines.Continuation<? super kotlin.Unit>):
- Missing nullability on method `setProgress` return
-MissingNullability: androidx.work.OperationKt#await(androidx.work.Operation, kotlin.coroutines.Continuation<? super androidx.work.Operation.State.SUCCESS>):
- Missing nullability on method `await` return
+MissingNullability: androidx.work.OneTimeWorkRequestKt#OneTimeWorkRequestBuilder():
+ Missing nullability on method `OneTimeWorkRequestBuilder` return
+MissingNullability: androidx.work.PeriodicWorkRequestKt#PeriodicWorkRequestBuilder(java.time.Duration):
+ Missing nullability on method `PeriodicWorkRequestBuilder` return
+MissingNullability: androidx.work.PeriodicWorkRequestKt#PeriodicWorkRequestBuilder(java.time.Duration, java.time.Duration):
+ Missing nullability on method `PeriodicWorkRequestBuilder` return
+MissingNullability: androidx.work.PeriodicWorkRequestKt#PeriodicWorkRequestBuilder(long, java.util.concurrent.TimeUnit):
+ Missing nullability on method `PeriodicWorkRequestBuilder` return
+MissingNullability: androidx.work.PeriodicWorkRequestKt#PeriodicWorkRequestBuilder(long, java.util.concurrent.TimeUnit, long, java.util.concurrent.TimeUnit):
+ Missing nullability on method `PeriodicWorkRequestBuilder` return
diff --git a/work/workmanager-ktx/api/current.txt b/work/workmanager-ktx/api/current.txt
index dee5846..4cb2b80 100644
--- a/work/workmanager-ktx/api/current.txt
+++ b/work/workmanager-ktx/api/current.txt
@@ -3,11 +3,11 @@
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.Continuation<? super androidx.work.ListenableWorker.Result> p);
+ method public abstract suspend Object? doWork(kotlin.coroutines.Continuation<? super androidx.work.ListenableWorker.Result> p);
method @Deprecated public kotlinx.coroutines.CoroutineDispatcher getCoroutineContext();
method public final void onStopped();
- method public final suspend Object! setForeground(androidx.work.ForegroundInfo foregroundInfo, kotlin.coroutines.Continuation<? super kotlin.Unit> p);
- method public final suspend Object! setProgress(androidx.work.Data data, kotlin.coroutines.Continuation<? super kotlin.Unit> p);
+ method public final suspend Object? setForeground(androidx.work.ForegroundInfo foregroundInfo, kotlin.coroutines.Continuation<? super kotlin.Unit> p);
+ method public final suspend Object? setProgress(androidx.work.Data data, kotlin.coroutines.Continuation<? super kotlin.Unit> p);
method public final com.google.common.util.concurrent.ListenableFuture<androidx.work.ListenableWorker.Result> startWork();
property @Deprecated public kotlinx.coroutines.CoroutineDispatcher coroutineContext;
}
@@ -21,19 +21,19 @@
}
public final class OneTimeWorkRequestKt {
- method public static inline <reified W extends androidx.work.ListenableWorker> androidx.work.OneTimeWorkRequest.Builder OneTimeWorkRequestBuilder();
+ method public static inline <reified W> 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 {
- method public static suspend inline Object! await(androidx.work.Operation, kotlin.coroutines.Continuation<? super androidx.work.Operation.State.SUCCESS> p);
+ method public static suspend inline Object? await(androidx.work.Operation, kotlin.coroutines.Continuation<? super androidx.work.Operation.State.SUCCESS> p);
}
public final class 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);
+ method public static inline <reified W> androidx.work.PeriodicWorkRequest.Builder! PeriodicWorkRequestBuilder(long repeatInterval, java.util.concurrent.TimeUnit repeatIntervalTimeUnit);
+ method @RequiresApi(26) public static inline <reified W> androidx.work.PeriodicWorkRequest.Builder! PeriodicWorkRequestBuilder(java.time.Duration repeatInterval);
+ method public static inline <reified W> 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> androidx.work.PeriodicWorkRequest.Builder! PeriodicWorkRequestBuilder(java.time.Duration repeatInterval, java.time.Duration flexTimeInterval);
}
}
diff --git a/work/workmanager-ktx/api/public_plus_experimental_2.4.0-alpha03.txt b/work/workmanager-ktx/api/public_plus_experimental_2.4.0-alpha03.txt
index dee5846..4cb2b80 100644
--- a/work/workmanager-ktx/api/public_plus_experimental_2.4.0-alpha03.txt
+++ b/work/workmanager-ktx/api/public_plus_experimental_2.4.0-alpha03.txt
@@ -3,11 +3,11 @@
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.Continuation<? super androidx.work.ListenableWorker.Result> p);
+ method public abstract suspend Object? doWork(kotlin.coroutines.Continuation<? super androidx.work.ListenableWorker.Result> p);
method @Deprecated public kotlinx.coroutines.CoroutineDispatcher getCoroutineContext();
method public final void onStopped();
- method public final suspend Object! setForeground(androidx.work.ForegroundInfo foregroundInfo, kotlin.coroutines.Continuation<? super kotlin.Unit> p);
- method public final suspend Object! setProgress(androidx.work.Data data, kotlin.coroutines.Continuation<? super kotlin.Unit> p);
+ method public final suspend Object? setForeground(androidx.work.ForegroundInfo foregroundInfo, kotlin.coroutines.Continuation<? super kotlin.Unit> p);
+ method public final suspend Object? setProgress(androidx.work.Data data, kotlin.coroutines.Continuation<? super kotlin.Unit> p);
method public final com.google.common.util.concurrent.ListenableFuture<androidx.work.ListenableWorker.Result> startWork();
property @Deprecated public kotlinx.coroutines.CoroutineDispatcher coroutineContext;
}
@@ -21,19 +21,19 @@
}
public final class OneTimeWorkRequestKt {
- method public static inline <reified W extends androidx.work.ListenableWorker> androidx.work.OneTimeWorkRequest.Builder OneTimeWorkRequestBuilder();
+ method public static inline <reified W> 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 {
- method public static suspend inline Object! await(androidx.work.Operation, kotlin.coroutines.Continuation<? super androidx.work.Operation.State.SUCCESS> p);
+ method public static suspend inline Object? await(androidx.work.Operation, kotlin.coroutines.Continuation<? super androidx.work.Operation.State.SUCCESS> p);
}
public final class 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);
+ method public static inline <reified W> androidx.work.PeriodicWorkRequest.Builder! PeriodicWorkRequestBuilder(long repeatInterval, java.util.concurrent.TimeUnit repeatIntervalTimeUnit);
+ method @RequiresApi(26) public static inline <reified W> androidx.work.PeriodicWorkRequest.Builder! PeriodicWorkRequestBuilder(java.time.Duration repeatInterval);
+ method public static inline <reified W> 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> androidx.work.PeriodicWorkRequest.Builder! PeriodicWorkRequestBuilder(java.time.Duration repeatInterval, java.time.Duration flexTimeInterval);
}
}
diff --git a/work/workmanager-ktx/api/public_plus_experimental_current.txt b/work/workmanager-ktx/api/public_plus_experimental_current.txt
index dee5846..4cb2b80 100644
--- a/work/workmanager-ktx/api/public_plus_experimental_current.txt
+++ b/work/workmanager-ktx/api/public_plus_experimental_current.txt
@@ -3,11 +3,11 @@
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.Continuation<? super androidx.work.ListenableWorker.Result> p);
+ method public abstract suspend Object? doWork(kotlin.coroutines.Continuation<? super androidx.work.ListenableWorker.Result> p);
method @Deprecated public kotlinx.coroutines.CoroutineDispatcher getCoroutineContext();
method public final void onStopped();
- method public final suspend Object! setForeground(androidx.work.ForegroundInfo foregroundInfo, kotlin.coroutines.Continuation<? super kotlin.Unit> p);
- method public final suspend Object! setProgress(androidx.work.Data data, kotlin.coroutines.Continuation<? super kotlin.Unit> p);
+ method public final suspend Object? setForeground(androidx.work.ForegroundInfo foregroundInfo, kotlin.coroutines.Continuation<? super kotlin.Unit> p);
+ method public final suspend Object? setProgress(androidx.work.Data data, kotlin.coroutines.Continuation<? super kotlin.Unit> p);
method public final com.google.common.util.concurrent.ListenableFuture<androidx.work.ListenableWorker.Result> startWork();
property @Deprecated public kotlinx.coroutines.CoroutineDispatcher coroutineContext;
}
@@ -21,19 +21,19 @@
}
public final class OneTimeWorkRequestKt {
- method public static inline <reified W extends androidx.work.ListenableWorker> androidx.work.OneTimeWorkRequest.Builder OneTimeWorkRequestBuilder();
+ method public static inline <reified W> 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 {
- method public static suspend inline Object! await(androidx.work.Operation, kotlin.coroutines.Continuation<? super androidx.work.Operation.State.SUCCESS> p);
+ method public static suspend inline Object? await(androidx.work.Operation, kotlin.coroutines.Continuation<? super androidx.work.Operation.State.SUCCESS> p);
}
public final class 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);
+ method public static inline <reified W> androidx.work.PeriodicWorkRequest.Builder! PeriodicWorkRequestBuilder(long repeatInterval, java.util.concurrent.TimeUnit repeatIntervalTimeUnit);
+ method @RequiresApi(26) public static inline <reified W> androidx.work.PeriodicWorkRequest.Builder! PeriodicWorkRequestBuilder(java.time.Duration repeatInterval);
+ method public static inline <reified W> 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> androidx.work.PeriodicWorkRequest.Builder! PeriodicWorkRequestBuilder(java.time.Duration repeatInterval, java.time.Duration flexTimeInterval);
}
}
diff --git a/work/workmanager-ktx/api/restricted_2.4.0-alpha03.ignore b/work/workmanager-ktx/api/restricted_2.4.0-alpha03.ignore
new file mode 100644
index 0000000..523b36f
--- /dev/null
+++ b/work/workmanager-ktx/api/restricted_2.4.0-alpha03.ignore
@@ -0,0 +1,13 @@
+// Baseline format: 1.0
+InvalidNullConversion: androidx.work.CoroutineWorker#doWork(kotlin.coroutines.Continuation<? super androidx.work.ListenableWorker.Result>):
+ Attempted to change method return from @NonNull to @Nullable: incompatible change for method androidx.work.CoroutineWorker.doWork(kotlin.coroutines.Continuation<? super androidx.work.ListenableWorker.Result>)
+InvalidNullConversion: androidx.work.OneTimeWorkRequestKt#OneTimeWorkRequestBuilder():
+ Attempted to remove @NonNull annotation from method androidx.work.OneTimeWorkRequestKt.OneTimeWorkRequestBuilder()
+InvalidNullConversion: androidx.work.PeriodicWorkRequestKt#PeriodicWorkRequestBuilder(java.time.Duration):
+ Attempted to remove @NonNull annotation from method androidx.work.PeriodicWorkRequestKt.PeriodicWorkRequestBuilder(java.time.Duration)
+InvalidNullConversion: androidx.work.PeriodicWorkRequestKt#PeriodicWorkRequestBuilder(java.time.Duration, java.time.Duration):
+ Attempted to remove @NonNull annotation from method androidx.work.PeriodicWorkRequestKt.PeriodicWorkRequestBuilder(java.time.Duration,java.time.Duration)
+InvalidNullConversion: androidx.work.PeriodicWorkRequestKt#PeriodicWorkRequestBuilder(long, java.util.concurrent.TimeUnit):
+ Attempted to remove @NonNull annotation from method androidx.work.PeriodicWorkRequestKt.PeriodicWorkRequestBuilder(long,java.util.concurrent.TimeUnit)
+InvalidNullConversion: androidx.work.PeriodicWorkRequestKt#PeriodicWorkRequestBuilder(long, java.util.concurrent.TimeUnit, long, java.util.concurrent.TimeUnit):
+ Attempted to remove @NonNull annotation from method androidx.work.PeriodicWorkRequestKt.PeriodicWorkRequestBuilder(long,java.util.concurrent.TimeUnit,long,java.util.concurrent.TimeUnit)
diff --git a/work/workmanager-ktx/api/restricted_2.4.0-alpha03.txt b/work/workmanager-ktx/api/restricted_2.4.0-alpha03.txt
index dee5846..4cb2b80 100644
--- a/work/workmanager-ktx/api/restricted_2.4.0-alpha03.txt
+++ b/work/workmanager-ktx/api/restricted_2.4.0-alpha03.txt
@@ -3,11 +3,11 @@
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.Continuation<? super androidx.work.ListenableWorker.Result> p);
+ method public abstract suspend Object? doWork(kotlin.coroutines.Continuation<? super androidx.work.ListenableWorker.Result> p);
method @Deprecated public kotlinx.coroutines.CoroutineDispatcher getCoroutineContext();
method public final void onStopped();
- method public final suspend Object! setForeground(androidx.work.ForegroundInfo foregroundInfo, kotlin.coroutines.Continuation<? super kotlin.Unit> p);
- method public final suspend Object! setProgress(androidx.work.Data data, kotlin.coroutines.Continuation<? super kotlin.Unit> p);
+ method public final suspend Object? setForeground(androidx.work.ForegroundInfo foregroundInfo, kotlin.coroutines.Continuation<? super kotlin.Unit> p);
+ method public final suspend Object? setProgress(androidx.work.Data data, kotlin.coroutines.Continuation<? super kotlin.Unit> p);
method public final com.google.common.util.concurrent.ListenableFuture<androidx.work.ListenableWorker.Result> startWork();
property @Deprecated public kotlinx.coroutines.CoroutineDispatcher coroutineContext;
}
@@ -21,19 +21,19 @@
}
public final class OneTimeWorkRequestKt {
- method public static inline <reified W extends androidx.work.ListenableWorker> androidx.work.OneTimeWorkRequest.Builder OneTimeWorkRequestBuilder();
+ method public static inline <reified W> 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 {
- method public static suspend inline Object! await(androidx.work.Operation, kotlin.coroutines.Continuation<? super androidx.work.Operation.State.SUCCESS> p);
+ method public static suspend inline Object? await(androidx.work.Operation, kotlin.coroutines.Continuation<? super androidx.work.Operation.State.SUCCESS> p);
}
public final class 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);
+ method public static inline <reified W> androidx.work.PeriodicWorkRequest.Builder! PeriodicWorkRequestBuilder(long repeatInterval, java.util.concurrent.TimeUnit repeatIntervalTimeUnit);
+ method @RequiresApi(26) public static inline <reified W> androidx.work.PeriodicWorkRequest.Builder! PeriodicWorkRequestBuilder(java.time.Duration repeatInterval);
+ method public static inline <reified W> 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> androidx.work.PeriodicWorkRequest.Builder! PeriodicWorkRequestBuilder(java.time.Duration repeatInterval, java.time.Duration flexTimeInterval);
}
}
diff --git a/work/workmanager-ktx/api/restricted_current.txt b/work/workmanager-ktx/api/restricted_current.txt
index dee5846..4cb2b80 100644
--- a/work/workmanager-ktx/api/restricted_current.txt
+++ b/work/workmanager-ktx/api/restricted_current.txt
@@ -3,11 +3,11 @@
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.Continuation<? super androidx.work.ListenableWorker.Result> p);
+ method public abstract suspend Object? doWork(kotlin.coroutines.Continuation<? super androidx.work.ListenableWorker.Result> p);
method @Deprecated public kotlinx.coroutines.CoroutineDispatcher getCoroutineContext();
method public final void onStopped();
- method public final suspend Object! setForeground(androidx.work.ForegroundInfo foregroundInfo, kotlin.coroutines.Continuation<? super kotlin.Unit> p);
- method public final suspend Object! setProgress(androidx.work.Data data, kotlin.coroutines.Continuation<? super kotlin.Unit> p);
+ method public final suspend Object? setForeground(androidx.work.ForegroundInfo foregroundInfo, kotlin.coroutines.Continuation<? super kotlin.Unit> p);
+ method public final suspend Object? setProgress(androidx.work.Data data, kotlin.coroutines.Continuation<? super kotlin.Unit> p);
method public final com.google.common.util.concurrent.ListenableFuture<androidx.work.ListenableWorker.Result> startWork();
property @Deprecated public kotlinx.coroutines.CoroutineDispatcher coroutineContext;
}
@@ -21,19 +21,19 @@
}
public final class OneTimeWorkRequestKt {
- method public static inline <reified W extends androidx.work.ListenableWorker> androidx.work.OneTimeWorkRequest.Builder OneTimeWorkRequestBuilder();
+ method public static inline <reified W> 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 {
- method public static suspend inline Object! await(androidx.work.Operation, kotlin.coroutines.Continuation<? super androidx.work.Operation.State.SUCCESS> p);
+ method public static suspend inline Object? await(androidx.work.Operation, kotlin.coroutines.Continuation<? super androidx.work.Operation.State.SUCCESS> p);
}
public final class 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);
+ method public static inline <reified W> androidx.work.PeriodicWorkRequest.Builder! PeriodicWorkRequestBuilder(long repeatInterval, java.util.concurrent.TimeUnit repeatIntervalTimeUnit);
+ method @RequiresApi(26) public static inline <reified W> androidx.work.PeriodicWorkRequest.Builder! PeriodicWorkRequestBuilder(java.time.Duration repeatInterval);
+ method public static inline <reified W> 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> androidx.work.PeriodicWorkRequest.Builder! PeriodicWorkRequestBuilder(java.time.Duration repeatInterval, java.time.Duration flexTimeInterval);
}
}
diff --git a/work/workmanager-testing/api/2.4.0-alpha03.ignore b/work/workmanager-testing/api/2.4.0-alpha03.ignore
new file mode 100644
index 0000000..c30fe58
--- /dev/null
+++ b/work/workmanager-testing/api/2.4.0-alpha03.ignore
@@ -0,0 +1,5 @@
+// Baseline format: 1.0
+InvalidNullConversion: androidx.work.testing.TestListenableWorkerBuilderKt#TestListenableWorkerBuilder(android.content.Context, androidx.work.Data, java.util.List<? extends java.lang.String>, int, java.util.List<? extends android.net.Uri>, java.util.List<? extends java.lang.String>):
+ Attempted to remove @NonNull annotation from method androidx.work.testing.TestListenableWorkerBuilderKt.TestListenableWorkerBuilder(android.content.Context,androidx.work.Data,java.util.List<? extends java.lang.String>,int,java.util.List<? extends android.net.Uri>,java.util.List<? extends java.lang.String>)
+InvalidNullConversion: androidx.work.testing.TestWorkerBuilderKt#TestWorkerBuilder(android.content.Context, java.util.concurrent.Executor, androidx.work.Data, java.util.List<? extends java.lang.String>, int, java.util.List<? extends android.net.Uri>, java.util.List<? extends java.lang.String>):
+ Attempted to remove @NonNull annotation from method androidx.work.testing.TestWorkerBuilderKt.TestWorkerBuilder(android.content.Context,java.util.concurrent.Executor,androidx.work.Data,java.util.List<? extends java.lang.String>,int,java.util.List<? extends android.net.Uri>,java.util.List<? extends java.lang.String>)
diff --git a/work/workmanager-testing/api/2.4.0-alpha03.txt b/work/workmanager-testing/api/2.4.0-alpha03.txt
index b64dd6c3..313870f 100644
--- a/work/workmanager-testing/api/2.4.0-alpha03.txt
+++ b/work/workmanager-testing/api/2.4.0-alpha03.txt
@@ -29,7 +29,7 @@
}
public final class TestListenableWorkerBuilderKt {
- method public static inline <reified W extends androidx.work.ListenableWorker> androidx.work.testing.TestListenableWorkerBuilder<W> TestListenableWorkerBuilder(android.content.Context context, androidx.work.Data inputData = androidx.work.Data.EMPTY, java.util.List<java.lang.String> tags = emptyList(), int runAttemptCount = 1, java.util.List<? extends android.net.Uri> triggeredContentUris = emptyList(), java.util.List<java.lang.String> triggeredContentAuthorities = emptyList());
+ method public static inline <reified W> androidx.work.testing.TestListenableWorkerBuilder<W>! TestListenableWorkerBuilder(android.content.Context context, androidx.work.Data inputData = androidx.work.Data.EMPTY, java.util.List<? extends java.lang.String> tags = emptyList(), int runAttemptCount = 1, java.util.List<? extends android.net.Uri> triggeredContentUris = emptyList(), java.util.List<? extends java.lang.String> triggeredContentAuthorities = emptyList());
}
public class TestWorkerBuilder<W extends androidx.work.Worker> extends androidx.work.testing.TestListenableWorkerBuilder<W> {
@@ -38,7 +38,7 @@
}
public final class TestWorkerBuilderKt {
- method public static inline <reified W extends androidx.work.Worker> androidx.work.testing.TestWorkerBuilder<W> TestWorkerBuilder(android.content.Context context, java.util.concurrent.Executor executor, androidx.work.Data inputData = androidx.work.Data.EMPTY, java.util.List<java.lang.String> tags = emptyList(), int runAttemptCount = 1, java.util.List<? extends android.net.Uri> triggeredContentUris = emptyList(), java.util.List<java.lang.String> triggeredContentAuthorities = emptyList());
+ method public static inline <reified W> androidx.work.testing.TestWorkerBuilder<W>! TestWorkerBuilder(android.content.Context context, java.util.concurrent.Executor executor, androidx.work.Data inputData = androidx.work.Data.EMPTY, java.util.List<? extends java.lang.String> tags = emptyList(), int runAttemptCount = 1, java.util.List<? extends android.net.Uri> triggeredContentUris = emptyList(), java.util.List<? extends java.lang.String> triggeredContentAuthorities = emptyList());
}
public final class WorkManagerTestInitHelper {
diff --git a/work/workmanager-testing/api/api_lint.ignore b/work/workmanager-testing/api/api_lint.ignore
index f901350..583b20b 100644
--- a/work/workmanager-testing/api/api_lint.ignore
+++ b/work/workmanager-testing/api/api_lint.ignore
@@ -1,4 +1,10 @@
// Baseline format: 1.0
+MissingNullability: androidx.work.testing.TestListenableWorkerBuilderKt#TestListenableWorkerBuilder(android.content.Context, androidx.work.Data, java.util.List<? extends java.lang.String>, int, java.util.List<? extends android.net.Uri>, java.util.List<? extends java.lang.String>):
+ Missing nullability on method `TestListenableWorkerBuilder` return
+MissingNullability: androidx.work.testing.TestWorkerBuilderKt#TestWorkerBuilder(android.content.Context, java.util.concurrent.Executor, androidx.work.Data, java.util.List<? extends java.lang.String>, int, java.util.List<? extends android.net.Uri>, java.util.List<? extends java.lang.String>):
+ Missing nullability on method `TestWorkerBuilder` return
+
+
SetterReturnsThis: androidx.work.testing.TestListenableWorkerBuilder#setForegroundUpdater(androidx.work.ForegroundUpdater):
Methods must return the builder object (return type androidx.work.testing.TestListenableWorkerBuilder<W> instead of androidx.work.testing.TestListenableWorkerBuilder): method androidx.work.testing.TestListenableWorkerBuilder.setForegroundUpdater(androidx.work.ForegroundUpdater)
SetterReturnsThis: androidx.work.testing.TestListenableWorkerBuilder#setId(java.util.UUID):
diff --git a/work/workmanager-testing/api/current.txt b/work/workmanager-testing/api/current.txt
index b64dd6c3..313870f 100644
--- a/work/workmanager-testing/api/current.txt
+++ b/work/workmanager-testing/api/current.txt
@@ -29,7 +29,7 @@
}
public final class TestListenableWorkerBuilderKt {
- method public static inline <reified W extends androidx.work.ListenableWorker> androidx.work.testing.TestListenableWorkerBuilder<W> TestListenableWorkerBuilder(android.content.Context context, androidx.work.Data inputData = androidx.work.Data.EMPTY, java.util.List<java.lang.String> tags = emptyList(), int runAttemptCount = 1, java.util.List<? extends android.net.Uri> triggeredContentUris = emptyList(), java.util.List<java.lang.String> triggeredContentAuthorities = emptyList());
+ method public static inline <reified W> androidx.work.testing.TestListenableWorkerBuilder<W>! TestListenableWorkerBuilder(android.content.Context context, androidx.work.Data inputData = androidx.work.Data.EMPTY, java.util.List<? extends java.lang.String> tags = emptyList(), int runAttemptCount = 1, java.util.List<? extends android.net.Uri> triggeredContentUris = emptyList(), java.util.List<? extends java.lang.String> triggeredContentAuthorities = emptyList());
}
public class TestWorkerBuilder<W extends androidx.work.Worker> extends androidx.work.testing.TestListenableWorkerBuilder<W> {
@@ -38,7 +38,7 @@
}
public final class TestWorkerBuilderKt {
- method public static inline <reified W extends androidx.work.Worker> androidx.work.testing.TestWorkerBuilder<W> TestWorkerBuilder(android.content.Context context, java.util.concurrent.Executor executor, androidx.work.Data inputData = androidx.work.Data.EMPTY, java.util.List<java.lang.String> tags = emptyList(), int runAttemptCount = 1, java.util.List<? extends android.net.Uri> triggeredContentUris = emptyList(), java.util.List<java.lang.String> triggeredContentAuthorities = emptyList());
+ method public static inline <reified W> androidx.work.testing.TestWorkerBuilder<W>! TestWorkerBuilder(android.content.Context context, java.util.concurrent.Executor executor, androidx.work.Data inputData = androidx.work.Data.EMPTY, java.util.List<? extends java.lang.String> tags = emptyList(), int runAttemptCount = 1, java.util.List<? extends android.net.Uri> triggeredContentUris = emptyList(), java.util.List<? extends java.lang.String> triggeredContentAuthorities = emptyList());
}
public final class WorkManagerTestInitHelper {
diff --git a/work/workmanager-testing/api/public_plus_experimental_2.4.0-alpha03.txt b/work/workmanager-testing/api/public_plus_experimental_2.4.0-alpha03.txt
index b64dd6c3..313870f 100644
--- a/work/workmanager-testing/api/public_plus_experimental_2.4.0-alpha03.txt
+++ b/work/workmanager-testing/api/public_plus_experimental_2.4.0-alpha03.txt
@@ -29,7 +29,7 @@
}
public final class TestListenableWorkerBuilderKt {
- method public static inline <reified W extends androidx.work.ListenableWorker> androidx.work.testing.TestListenableWorkerBuilder<W> TestListenableWorkerBuilder(android.content.Context context, androidx.work.Data inputData = androidx.work.Data.EMPTY, java.util.List<java.lang.String> tags = emptyList(), int runAttemptCount = 1, java.util.List<? extends android.net.Uri> triggeredContentUris = emptyList(), java.util.List<java.lang.String> triggeredContentAuthorities = emptyList());
+ method public static inline <reified W> androidx.work.testing.TestListenableWorkerBuilder<W>! TestListenableWorkerBuilder(android.content.Context context, androidx.work.Data inputData = androidx.work.Data.EMPTY, java.util.List<? extends java.lang.String> tags = emptyList(), int runAttemptCount = 1, java.util.List<? extends android.net.Uri> triggeredContentUris = emptyList(), java.util.List<? extends java.lang.String> triggeredContentAuthorities = emptyList());
}
public class TestWorkerBuilder<W extends androidx.work.Worker> extends androidx.work.testing.TestListenableWorkerBuilder<W> {
@@ -38,7 +38,7 @@
}
public final class TestWorkerBuilderKt {
- method public static inline <reified W extends androidx.work.Worker> androidx.work.testing.TestWorkerBuilder<W> TestWorkerBuilder(android.content.Context context, java.util.concurrent.Executor executor, androidx.work.Data inputData = androidx.work.Data.EMPTY, java.util.List<java.lang.String> tags = emptyList(), int runAttemptCount = 1, java.util.List<? extends android.net.Uri> triggeredContentUris = emptyList(), java.util.List<java.lang.String> triggeredContentAuthorities = emptyList());
+ method public static inline <reified W> androidx.work.testing.TestWorkerBuilder<W>! TestWorkerBuilder(android.content.Context context, java.util.concurrent.Executor executor, androidx.work.Data inputData = androidx.work.Data.EMPTY, java.util.List<? extends java.lang.String> tags = emptyList(), int runAttemptCount = 1, java.util.List<? extends android.net.Uri> triggeredContentUris = emptyList(), java.util.List<? extends java.lang.String> triggeredContentAuthorities = emptyList());
}
public final class WorkManagerTestInitHelper {
diff --git a/work/workmanager-testing/api/public_plus_experimental_current.txt b/work/workmanager-testing/api/public_plus_experimental_current.txt
index b64dd6c3..313870f 100644
--- a/work/workmanager-testing/api/public_plus_experimental_current.txt
+++ b/work/workmanager-testing/api/public_plus_experimental_current.txt
@@ -29,7 +29,7 @@
}
public final class TestListenableWorkerBuilderKt {
- method public static inline <reified W extends androidx.work.ListenableWorker> androidx.work.testing.TestListenableWorkerBuilder<W> TestListenableWorkerBuilder(android.content.Context context, androidx.work.Data inputData = androidx.work.Data.EMPTY, java.util.List<java.lang.String> tags = emptyList(), int runAttemptCount = 1, java.util.List<? extends android.net.Uri> triggeredContentUris = emptyList(), java.util.List<java.lang.String> triggeredContentAuthorities = emptyList());
+ method public static inline <reified W> androidx.work.testing.TestListenableWorkerBuilder<W>! TestListenableWorkerBuilder(android.content.Context context, androidx.work.Data inputData = androidx.work.Data.EMPTY, java.util.List<? extends java.lang.String> tags = emptyList(), int runAttemptCount = 1, java.util.List<? extends android.net.Uri> triggeredContentUris = emptyList(), java.util.List<? extends java.lang.String> triggeredContentAuthorities = emptyList());
}
public class TestWorkerBuilder<W extends androidx.work.Worker> extends androidx.work.testing.TestListenableWorkerBuilder<W> {
@@ -38,7 +38,7 @@
}
public final class TestWorkerBuilderKt {
- method public static inline <reified W extends androidx.work.Worker> androidx.work.testing.TestWorkerBuilder<W> TestWorkerBuilder(android.content.Context context, java.util.concurrent.Executor executor, androidx.work.Data inputData = androidx.work.Data.EMPTY, java.util.List<java.lang.String> tags = emptyList(), int runAttemptCount = 1, java.util.List<? extends android.net.Uri> triggeredContentUris = emptyList(), java.util.List<java.lang.String> triggeredContentAuthorities = emptyList());
+ method public static inline <reified W> androidx.work.testing.TestWorkerBuilder<W>! TestWorkerBuilder(android.content.Context context, java.util.concurrent.Executor executor, androidx.work.Data inputData = androidx.work.Data.EMPTY, java.util.List<? extends java.lang.String> tags = emptyList(), int runAttemptCount = 1, java.util.List<? extends android.net.Uri> triggeredContentUris = emptyList(), java.util.List<? extends java.lang.String> triggeredContentAuthorities = emptyList());
}
public final class WorkManagerTestInitHelper {
diff --git a/work/workmanager-testing/api/restricted_2.4.0-alpha03.ignore b/work/workmanager-testing/api/restricted_2.4.0-alpha03.ignore
new file mode 100644
index 0000000..c30fe58
--- /dev/null
+++ b/work/workmanager-testing/api/restricted_2.4.0-alpha03.ignore
@@ -0,0 +1,5 @@
+// Baseline format: 1.0
+InvalidNullConversion: androidx.work.testing.TestListenableWorkerBuilderKt#TestListenableWorkerBuilder(android.content.Context, androidx.work.Data, java.util.List<? extends java.lang.String>, int, java.util.List<? extends android.net.Uri>, java.util.List<? extends java.lang.String>):
+ Attempted to remove @NonNull annotation from method androidx.work.testing.TestListenableWorkerBuilderKt.TestListenableWorkerBuilder(android.content.Context,androidx.work.Data,java.util.List<? extends java.lang.String>,int,java.util.List<? extends android.net.Uri>,java.util.List<? extends java.lang.String>)
+InvalidNullConversion: androidx.work.testing.TestWorkerBuilderKt#TestWorkerBuilder(android.content.Context, java.util.concurrent.Executor, androidx.work.Data, java.util.List<? extends java.lang.String>, int, java.util.List<? extends android.net.Uri>, java.util.List<? extends java.lang.String>):
+ Attempted to remove @NonNull annotation from method androidx.work.testing.TestWorkerBuilderKt.TestWorkerBuilder(android.content.Context,java.util.concurrent.Executor,androidx.work.Data,java.util.List<? extends java.lang.String>,int,java.util.List<? extends android.net.Uri>,java.util.List<? extends java.lang.String>)
diff --git a/work/workmanager-testing/api/restricted_2.4.0-alpha03.txt b/work/workmanager-testing/api/restricted_2.4.0-alpha03.txt
index b64dd6c3..313870f 100644
--- a/work/workmanager-testing/api/restricted_2.4.0-alpha03.txt
+++ b/work/workmanager-testing/api/restricted_2.4.0-alpha03.txt
@@ -29,7 +29,7 @@
}
public final class TestListenableWorkerBuilderKt {
- method public static inline <reified W extends androidx.work.ListenableWorker> androidx.work.testing.TestListenableWorkerBuilder<W> TestListenableWorkerBuilder(android.content.Context context, androidx.work.Data inputData = androidx.work.Data.EMPTY, java.util.List<java.lang.String> tags = emptyList(), int runAttemptCount = 1, java.util.List<? extends android.net.Uri> triggeredContentUris = emptyList(), java.util.List<java.lang.String> triggeredContentAuthorities = emptyList());
+ method public static inline <reified W> androidx.work.testing.TestListenableWorkerBuilder<W>! TestListenableWorkerBuilder(android.content.Context context, androidx.work.Data inputData = androidx.work.Data.EMPTY, java.util.List<? extends java.lang.String> tags = emptyList(), int runAttemptCount = 1, java.util.List<? extends android.net.Uri> triggeredContentUris = emptyList(), java.util.List<? extends java.lang.String> triggeredContentAuthorities = emptyList());
}
public class TestWorkerBuilder<W extends androidx.work.Worker> extends androidx.work.testing.TestListenableWorkerBuilder<W> {
@@ -38,7 +38,7 @@
}
public final class TestWorkerBuilderKt {
- method public static inline <reified W extends androidx.work.Worker> androidx.work.testing.TestWorkerBuilder<W> TestWorkerBuilder(android.content.Context context, java.util.concurrent.Executor executor, androidx.work.Data inputData = androidx.work.Data.EMPTY, java.util.List<java.lang.String> tags = emptyList(), int runAttemptCount = 1, java.util.List<? extends android.net.Uri> triggeredContentUris = emptyList(), java.util.List<java.lang.String> triggeredContentAuthorities = emptyList());
+ method public static inline <reified W> androidx.work.testing.TestWorkerBuilder<W>! TestWorkerBuilder(android.content.Context context, java.util.concurrent.Executor executor, androidx.work.Data inputData = androidx.work.Data.EMPTY, java.util.List<? extends java.lang.String> tags = emptyList(), int runAttemptCount = 1, java.util.List<? extends android.net.Uri> triggeredContentUris = emptyList(), java.util.List<? extends java.lang.String> triggeredContentAuthorities = emptyList());
}
public final class WorkManagerTestInitHelper {
diff --git a/work/workmanager-testing/api/restricted_current.txt b/work/workmanager-testing/api/restricted_current.txt
index b64dd6c3..313870f 100644
--- a/work/workmanager-testing/api/restricted_current.txt
+++ b/work/workmanager-testing/api/restricted_current.txt
@@ -29,7 +29,7 @@
}
public final class TestListenableWorkerBuilderKt {
- method public static inline <reified W extends androidx.work.ListenableWorker> androidx.work.testing.TestListenableWorkerBuilder<W> TestListenableWorkerBuilder(android.content.Context context, androidx.work.Data inputData = androidx.work.Data.EMPTY, java.util.List<java.lang.String> tags = emptyList(), int runAttemptCount = 1, java.util.List<? extends android.net.Uri> triggeredContentUris = emptyList(), java.util.List<java.lang.String> triggeredContentAuthorities = emptyList());
+ method public static inline <reified W> androidx.work.testing.TestListenableWorkerBuilder<W>! TestListenableWorkerBuilder(android.content.Context context, androidx.work.Data inputData = androidx.work.Data.EMPTY, java.util.List<? extends java.lang.String> tags = emptyList(), int runAttemptCount = 1, java.util.List<? extends android.net.Uri> triggeredContentUris = emptyList(), java.util.List<? extends java.lang.String> triggeredContentAuthorities = emptyList());
}
public class TestWorkerBuilder<W extends androidx.work.Worker> extends androidx.work.testing.TestListenableWorkerBuilder<W> {
@@ -38,7 +38,7 @@
}
public final class TestWorkerBuilderKt {
- method public static inline <reified W extends androidx.work.Worker> androidx.work.testing.TestWorkerBuilder<W> TestWorkerBuilder(android.content.Context context, java.util.concurrent.Executor executor, androidx.work.Data inputData = androidx.work.Data.EMPTY, java.util.List<java.lang.String> tags = emptyList(), int runAttemptCount = 1, java.util.List<? extends android.net.Uri> triggeredContentUris = emptyList(), java.util.List<java.lang.String> triggeredContentAuthorities = emptyList());
+ method public static inline <reified W> androidx.work.testing.TestWorkerBuilder<W>! TestWorkerBuilder(android.content.Context context, java.util.concurrent.Executor executor, androidx.work.Data inputData = androidx.work.Data.EMPTY, java.util.List<? extends java.lang.String> tags = emptyList(), int runAttemptCount = 1, java.util.List<? extends android.net.Uri> triggeredContentUris = emptyList(), java.util.List<? extends java.lang.String> triggeredContentAuthorities = emptyList());
}
public final class WorkManagerTestInitHelper {