Merge "Pin Room's androidx.sqlite dependency." into androidx-main
diff --git a/activity/activity-compose/api/1.4.0-beta01.txt b/activity/activity-compose/api/1.4.0-beta01.txt
new file mode 100644
index 0000000..66989c4
--- /dev/null
+++ b/activity/activity-compose/api/1.4.0-beta01.txt
@@ -0,0 +1,40 @@
+// Signature format: 4.0
+package androidx.activity.compose {
+
+ public final class ActivityComposeUtilsKt {
+ }
+
+ public final class ActivityResultRegistryKt {
+ method @androidx.compose.runtime.Composable public static <I, O> androidx.activity.compose.ManagedActivityResultLauncher<I,O> rememberLauncherForActivityResult(androidx.activity.result.contract.ActivityResultContract<I,O> contract, kotlin.jvm.functions.Function1<? super O,kotlin.Unit> onResult);
+ }
+
+ public final class BackHandlerKt {
+ method @androidx.compose.runtime.Composable public static void BackHandler(optional boolean enabled, kotlin.jvm.functions.Function0<kotlin.Unit> onBack);
+ }
+
+ public final class ComponentActivityKt {
+ method public static void setContent(androidx.activity.ComponentActivity, optional androidx.compose.runtime.CompositionContext? parent, kotlin.jvm.functions.Function0<kotlin.Unit> content);
+ }
+
+ public final class LocalActivityResultRegistryOwner {
+ method @androidx.compose.runtime.Composable public androidx.activity.result.ActivityResultRegistryOwner? getCurrent();
+ method public infix androidx.compose.runtime.ProvidedValue<androidx.activity.result.ActivityResultRegistryOwner> provides(androidx.activity.result.ActivityResultRegistryOwner registryOwner);
+ property @androidx.compose.runtime.Composable public final androidx.activity.result.ActivityResultRegistryOwner? current;
+ field public static final androidx.activity.compose.LocalActivityResultRegistryOwner INSTANCE;
+ }
+
+ public final class LocalOnBackPressedDispatcherOwner {
+ method @androidx.compose.runtime.Composable public androidx.activity.OnBackPressedDispatcherOwner? getCurrent();
+ method public infix androidx.compose.runtime.ProvidedValue<androidx.activity.OnBackPressedDispatcherOwner> provides(androidx.activity.OnBackPressedDispatcherOwner dispatcherOwner);
+ property @androidx.compose.runtime.Composable public final androidx.activity.OnBackPressedDispatcherOwner? current;
+ field public static final androidx.activity.compose.LocalOnBackPressedDispatcherOwner INSTANCE;
+ }
+
+ public final class ManagedActivityResultLauncher<I, O> extends androidx.activity.result.ActivityResultLauncher<I> {
+ method public androidx.activity.result.contract.ActivityResultContract<I,?> getContract();
+ method public void launch(I? input, androidx.core.app.ActivityOptionsCompat? options);
+ method @Deprecated public void unregister();
+ }
+
+}
+
diff --git a/activity/activity-compose/api/public_plus_experimental_1.4.0-beta01.txt b/activity/activity-compose/api/public_plus_experimental_1.4.0-beta01.txt
new file mode 100644
index 0000000..66989c4
--- /dev/null
+++ b/activity/activity-compose/api/public_plus_experimental_1.4.0-beta01.txt
@@ -0,0 +1,40 @@
+// Signature format: 4.0
+package androidx.activity.compose {
+
+ public final class ActivityComposeUtilsKt {
+ }
+
+ public final class ActivityResultRegistryKt {
+ method @androidx.compose.runtime.Composable public static <I, O> androidx.activity.compose.ManagedActivityResultLauncher<I,O> rememberLauncherForActivityResult(androidx.activity.result.contract.ActivityResultContract<I,O> contract, kotlin.jvm.functions.Function1<? super O,kotlin.Unit> onResult);
+ }
+
+ public final class BackHandlerKt {
+ method @androidx.compose.runtime.Composable public static void BackHandler(optional boolean enabled, kotlin.jvm.functions.Function0<kotlin.Unit> onBack);
+ }
+
+ public final class ComponentActivityKt {
+ method public static void setContent(androidx.activity.ComponentActivity, optional androidx.compose.runtime.CompositionContext? parent, kotlin.jvm.functions.Function0<kotlin.Unit> content);
+ }
+
+ public final class LocalActivityResultRegistryOwner {
+ method @androidx.compose.runtime.Composable public androidx.activity.result.ActivityResultRegistryOwner? getCurrent();
+ method public infix androidx.compose.runtime.ProvidedValue<androidx.activity.result.ActivityResultRegistryOwner> provides(androidx.activity.result.ActivityResultRegistryOwner registryOwner);
+ property @androidx.compose.runtime.Composable public final androidx.activity.result.ActivityResultRegistryOwner? current;
+ field public static final androidx.activity.compose.LocalActivityResultRegistryOwner INSTANCE;
+ }
+
+ public final class LocalOnBackPressedDispatcherOwner {
+ method @androidx.compose.runtime.Composable public androidx.activity.OnBackPressedDispatcherOwner? getCurrent();
+ method public infix androidx.compose.runtime.ProvidedValue<androidx.activity.OnBackPressedDispatcherOwner> provides(androidx.activity.OnBackPressedDispatcherOwner dispatcherOwner);
+ property @androidx.compose.runtime.Composable public final androidx.activity.OnBackPressedDispatcherOwner? current;
+ field public static final androidx.activity.compose.LocalOnBackPressedDispatcherOwner INSTANCE;
+ }
+
+ public final class ManagedActivityResultLauncher<I, O> extends androidx.activity.result.ActivityResultLauncher<I> {
+ method public androidx.activity.result.contract.ActivityResultContract<I,?> getContract();
+ method public void launch(I? input, androidx.core.app.ActivityOptionsCompat? options);
+ method @Deprecated public void unregister();
+ }
+
+}
+
diff --git a/wear/wear-watchface-style/api/res-current.txt b/activity/activity-compose/api/res-1.4.0-beta01.txt
similarity index 100%
copy from wear/wear-watchface-style/api/res-current.txt
copy to activity/activity-compose/api/res-1.4.0-beta01.txt
diff --git a/activity/activity-compose/api/restricted_1.4.0-beta01.txt b/activity/activity-compose/api/restricted_1.4.0-beta01.txt
new file mode 100644
index 0000000..66989c4
--- /dev/null
+++ b/activity/activity-compose/api/restricted_1.4.0-beta01.txt
@@ -0,0 +1,40 @@
+// Signature format: 4.0
+package androidx.activity.compose {
+
+ public final class ActivityComposeUtilsKt {
+ }
+
+ public final class ActivityResultRegistryKt {
+ method @androidx.compose.runtime.Composable public static <I, O> androidx.activity.compose.ManagedActivityResultLauncher<I,O> rememberLauncherForActivityResult(androidx.activity.result.contract.ActivityResultContract<I,O> contract, kotlin.jvm.functions.Function1<? super O,kotlin.Unit> onResult);
+ }
+
+ public final class BackHandlerKt {
+ method @androidx.compose.runtime.Composable public static void BackHandler(optional boolean enabled, kotlin.jvm.functions.Function0<kotlin.Unit> onBack);
+ }
+
+ public final class ComponentActivityKt {
+ method public static void setContent(androidx.activity.ComponentActivity, optional androidx.compose.runtime.CompositionContext? parent, kotlin.jvm.functions.Function0<kotlin.Unit> content);
+ }
+
+ public final class LocalActivityResultRegistryOwner {
+ method @androidx.compose.runtime.Composable public androidx.activity.result.ActivityResultRegistryOwner? getCurrent();
+ method public infix androidx.compose.runtime.ProvidedValue<androidx.activity.result.ActivityResultRegistryOwner> provides(androidx.activity.result.ActivityResultRegistryOwner registryOwner);
+ property @androidx.compose.runtime.Composable public final androidx.activity.result.ActivityResultRegistryOwner? current;
+ field public static final androidx.activity.compose.LocalActivityResultRegistryOwner INSTANCE;
+ }
+
+ public final class LocalOnBackPressedDispatcherOwner {
+ method @androidx.compose.runtime.Composable public androidx.activity.OnBackPressedDispatcherOwner? getCurrent();
+ method public infix androidx.compose.runtime.ProvidedValue<androidx.activity.OnBackPressedDispatcherOwner> provides(androidx.activity.OnBackPressedDispatcherOwner dispatcherOwner);
+ property @androidx.compose.runtime.Composable public final androidx.activity.OnBackPressedDispatcherOwner? current;
+ field public static final androidx.activity.compose.LocalOnBackPressedDispatcherOwner INSTANCE;
+ }
+
+ public final class ManagedActivityResultLauncher<I, O> extends androidx.activity.result.ActivityResultLauncher<I> {
+ method public androidx.activity.result.contract.ActivityResultContract<I,?> getContract();
+ method public void launch(I? input, androidx.core.app.ActivityOptionsCompat? options);
+ method @Deprecated public void unregister();
+ }
+
+}
+
diff --git a/activity/activity-ktx/api/1.4.0-beta01.txt b/activity/activity-ktx/api/1.4.0-beta01.txt
new file mode 100644
index 0000000..f844b35
--- /dev/null
+++ b/activity/activity-ktx/api/1.4.0-beta01.txt
@@ -0,0 +1,43 @@
+// Signature format: 4.0
+package androidx.activity {
+
+ public final class ActivityViewModelLazyKt {
+ method @MainThread public static inline <reified VM extends androidx.lifecycle.ViewModel> kotlin.Lazy<? extends VM>! viewModels(androidx.activity.ComponentActivity, optional kotlin.jvm.functions.Function0<? extends androidx.lifecycle.ViewModelProvider.Factory>? factoryProducer);
+ }
+
+ public final class OnBackPressedDispatcherKt {
+ method public static androidx.activity.OnBackPressedCallback addCallback(androidx.activity.OnBackPressedDispatcher, optional androidx.lifecycle.LifecycleOwner? owner, optional boolean enabled, kotlin.jvm.functions.Function1<? super androidx.activity.OnBackPressedCallback,kotlin.Unit> onBackPressed);
+ }
+
+ public final class PipHintTrackerKt {
+ }
+
+}
+
+package androidx.activity.contextaware {
+
+ public final class ContextAwareKt {
+ method public static suspend inline <R> Object? withContextAvailable(androidx.activity.contextaware.ContextAware, kotlin.jvm.functions.Function1<? super android.content.Context,? extends R> onContextAvailable, kotlin.coroutines.Continuation<? super R> p);
+ }
+
+}
+
+package androidx.activity.result {
+
+ public final class ActivityResultCallerKt {
+ method public static <I, O> androidx.activity.result.ActivityResultLauncher<kotlin.Unit> registerForActivityResult(androidx.activity.result.ActivityResultCaller, androidx.activity.result.contract.ActivityResultContract<I,O> contract, I? input, androidx.activity.result.ActivityResultRegistry registry, kotlin.jvm.functions.Function1<? super O,kotlin.Unit> callback);
+ method public static <I, O> androidx.activity.result.ActivityResultLauncher<kotlin.Unit> registerForActivityResult(androidx.activity.result.ActivityResultCaller, androidx.activity.result.contract.ActivityResultContract<I,O> contract, I? input, kotlin.jvm.functions.Function1<? super O,kotlin.Unit> callback);
+ }
+
+ public final class ActivityResultKt {
+ method public static operator int component1(androidx.activity.result.ActivityResult);
+ method public static operator android.content.Intent? component2(androidx.activity.result.ActivityResult);
+ }
+
+ public final class ActivityResultLauncherKt {
+ method public static void launch(androidx.activity.result.ActivityResultLauncher<java.lang.Void>, optional androidx.core.app.ActivityOptionsCompat? options);
+ method public static void launchUnit(androidx.activity.result.ActivityResultLauncher<kotlin.Unit>, optional androidx.core.app.ActivityOptionsCompat? options);
+ }
+
+}
+
diff --git a/activity/activity-ktx/api/public_plus_experimental_1.4.0-beta01.txt b/activity/activity-ktx/api/public_plus_experimental_1.4.0-beta01.txt
new file mode 100644
index 0000000..5dff406
--- /dev/null
+++ b/activity/activity-ktx/api/public_plus_experimental_1.4.0-beta01.txt
@@ -0,0 +1,44 @@
+// Signature format: 4.0
+package androidx.activity {
+
+ public final class ActivityViewModelLazyKt {
+ method @MainThread public static inline <reified VM extends androidx.lifecycle.ViewModel> kotlin.Lazy<? extends VM>! viewModels(androidx.activity.ComponentActivity, optional kotlin.jvm.functions.Function0<? extends androidx.lifecycle.ViewModelProvider.Factory>? factoryProducer);
+ }
+
+ public final class OnBackPressedDispatcherKt {
+ method public static androidx.activity.OnBackPressedCallback addCallback(androidx.activity.OnBackPressedDispatcher, optional androidx.lifecycle.LifecycleOwner? owner, optional boolean enabled, kotlin.jvm.functions.Function1<? super androidx.activity.OnBackPressedCallback,kotlin.Unit> onBackPressed);
+ }
+
+ public final class PipHintTrackerKt {
+ method @RequiresApi(android.os.Build.VERSION_CODES.O) @kotlinx.coroutines.ExperimentalCoroutinesApi public static suspend Object? trackPipAnimationHintView(android.app.Activity, android.view.View view, kotlin.coroutines.Continuation<? super kotlin.Unit> p);
+ }
+
+}
+
+package androidx.activity.contextaware {
+
+ public final class ContextAwareKt {
+ method public static suspend inline <R> Object? withContextAvailable(androidx.activity.contextaware.ContextAware, kotlin.jvm.functions.Function1<? super android.content.Context,? extends R> onContextAvailable, kotlin.coroutines.Continuation<? super R> p);
+ }
+
+}
+
+package androidx.activity.result {
+
+ public final class ActivityResultCallerKt {
+ method public static <I, O> androidx.activity.result.ActivityResultLauncher<kotlin.Unit> registerForActivityResult(androidx.activity.result.ActivityResultCaller, androidx.activity.result.contract.ActivityResultContract<I,O> contract, I? input, androidx.activity.result.ActivityResultRegistry registry, kotlin.jvm.functions.Function1<? super O,kotlin.Unit> callback);
+ method public static <I, O> androidx.activity.result.ActivityResultLauncher<kotlin.Unit> registerForActivityResult(androidx.activity.result.ActivityResultCaller, androidx.activity.result.contract.ActivityResultContract<I,O> contract, I? input, kotlin.jvm.functions.Function1<? super O,kotlin.Unit> callback);
+ }
+
+ public final class ActivityResultKt {
+ method public static operator int component1(androidx.activity.result.ActivityResult);
+ method public static operator android.content.Intent? component2(androidx.activity.result.ActivityResult);
+ }
+
+ public final class ActivityResultLauncherKt {
+ method public static void launch(androidx.activity.result.ActivityResultLauncher<java.lang.Void>, optional androidx.core.app.ActivityOptionsCompat? options);
+ method public static void launchUnit(androidx.activity.result.ActivityResultLauncher<kotlin.Unit>, optional androidx.core.app.ActivityOptionsCompat? options);
+ }
+
+}
+
diff --git a/wear/wear-complications-data-source-ktx/api/res-current.txt b/activity/activity-ktx/api/res-1.4.0-beta01.txt
similarity index 100%
copy from wear/wear-complications-data-source-ktx/api/res-current.txt
copy to activity/activity-ktx/api/res-1.4.0-beta01.txt
diff --git a/activity/activity-ktx/api/restricted_1.4.0-beta01.txt b/activity/activity-ktx/api/restricted_1.4.0-beta01.txt
new file mode 100644
index 0000000..f844b35
--- /dev/null
+++ b/activity/activity-ktx/api/restricted_1.4.0-beta01.txt
@@ -0,0 +1,43 @@
+// Signature format: 4.0
+package androidx.activity {
+
+ public final class ActivityViewModelLazyKt {
+ method @MainThread public static inline <reified VM extends androidx.lifecycle.ViewModel> kotlin.Lazy<? extends VM>! viewModels(androidx.activity.ComponentActivity, optional kotlin.jvm.functions.Function0<? extends androidx.lifecycle.ViewModelProvider.Factory>? factoryProducer);
+ }
+
+ public final class OnBackPressedDispatcherKt {
+ method public static androidx.activity.OnBackPressedCallback addCallback(androidx.activity.OnBackPressedDispatcher, optional androidx.lifecycle.LifecycleOwner? owner, optional boolean enabled, kotlin.jvm.functions.Function1<? super androidx.activity.OnBackPressedCallback,kotlin.Unit> onBackPressed);
+ }
+
+ public final class PipHintTrackerKt {
+ }
+
+}
+
+package androidx.activity.contextaware {
+
+ public final class ContextAwareKt {
+ method public static suspend inline <R> Object? withContextAvailable(androidx.activity.contextaware.ContextAware, kotlin.jvm.functions.Function1<? super android.content.Context,? extends R> onContextAvailable, kotlin.coroutines.Continuation<? super R> p);
+ }
+
+}
+
+package androidx.activity.result {
+
+ public final class ActivityResultCallerKt {
+ method public static <I, O> androidx.activity.result.ActivityResultLauncher<kotlin.Unit> registerForActivityResult(androidx.activity.result.ActivityResultCaller, androidx.activity.result.contract.ActivityResultContract<I,O> contract, I? input, androidx.activity.result.ActivityResultRegistry registry, kotlin.jvm.functions.Function1<? super O,kotlin.Unit> callback);
+ method public static <I, O> androidx.activity.result.ActivityResultLauncher<kotlin.Unit> registerForActivityResult(androidx.activity.result.ActivityResultCaller, androidx.activity.result.contract.ActivityResultContract<I,O> contract, I? input, kotlin.jvm.functions.Function1<? super O,kotlin.Unit> callback);
+ }
+
+ public final class ActivityResultKt {
+ method public static operator int component1(androidx.activity.result.ActivityResult);
+ method public static operator android.content.Intent? component2(androidx.activity.result.ActivityResult);
+ }
+
+ public final class ActivityResultLauncherKt {
+ method public static void launch(androidx.activity.result.ActivityResultLauncher<java.lang.Void>, optional androidx.core.app.ActivityOptionsCompat? options);
+ method public static void launchUnit(androidx.activity.result.ActivityResultLauncher<kotlin.Unit>, optional androidx.core.app.ActivityOptionsCompat? options);
+ }
+
+}
+
diff --git a/activity/activity/api/1.4.0-beta01.txt b/activity/activity/api/1.4.0-beta01.txt
new file mode 100644
index 0000000..dd842d8
--- /dev/null
+++ b/activity/activity/api/1.4.0-beta01.txt
@@ -0,0 +1,272 @@
+// Signature format: 4.0
+package androidx.activity {
+
+ public class ComponentActivity extends android.app.Activity implements androidx.activity.result.ActivityResultCaller androidx.activity.result.ActivityResultRegistryOwner androidx.activity.contextaware.ContextAware androidx.lifecycle.HasDefaultViewModelProviderFactory androidx.lifecycle.LifecycleOwner androidx.core.view.MenuHost androidx.activity.OnBackPressedDispatcherOwner androidx.savedstate.SavedStateRegistryOwner androidx.lifecycle.ViewModelStoreOwner {
+ ctor public ComponentActivity();
+ ctor @ContentView public ComponentActivity(@LayoutRes int);
+ method public void addMenuProvider(androidx.core.view.MenuProvider);
+ method public void addMenuProvider(androidx.core.view.MenuProvider, androidx.lifecycle.LifecycleOwner);
+ method public void addMenuProvider(androidx.core.view.MenuProvider, androidx.lifecycle.LifecycleOwner, androidx.lifecycle.Lifecycle.State);
+ method public final void addOnContextAvailableListener(androidx.activity.contextaware.OnContextAvailableListener);
+ method public final androidx.activity.result.ActivityResultRegistry getActivityResultRegistry();
+ method public androidx.lifecycle.ViewModelProvider.Factory getDefaultViewModelProviderFactory();
+ method @Deprecated public Object? getLastCustomNonConfigurationInstance();
+ method public androidx.lifecycle.Lifecycle getLifecycle();
+ method public final androidx.activity.OnBackPressedDispatcher getOnBackPressedDispatcher();
+ method public final androidx.savedstate.SavedStateRegistry getSavedStateRegistry();
+ method public androidx.lifecycle.ViewModelStore getViewModelStore();
+ method public void invalidateMenu();
+ method @Deprecated @CallSuper protected void onActivityResult(int, int, android.content.Intent?);
+ method @Deprecated @CallSuper public void onRequestPermissionsResult(int, String![], int[]);
+ method @Deprecated public Object? onRetainCustomNonConfigurationInstance();
+ method public final Object? onRetainNonConfigurationInstance();
+ method public android.content.Context? peekAvailableContext();
+ method public final <I, O> androidx.activity.result.ActivityResultLauncher<I!> registerForActivityResult(androidx.activity.result.contract.ActivityResultContract<I!,O!>, androidx.activity.result.ActivityResultRegistry, androidx.activity.result.ActivityResultCallback<O!>);
+ method public final <I, O> androidx.activity.result.ActivityResultLauncher<I!> registerForActivityResult(androidx.activity.result.contract.ActivityResultContract<I!,O!>, androidx.activity.result.ActivityResultCallback<O!>);
+ method public void removeMenuProvider(androidx.core.view.MenuProvider);
+ method public final void removeOnContextAvailableListener(androidx.activity.contextaware.OnContextAvailableListener);
+ method @Deprecated public void startActivityForResult(android.content.Intent!, int);
+ method @Deprecated public void startActivityForResult(android.content.Intent!, int, android.os.Bundle?);
+ method @Deprecated public void startIntentSenderForResult(android.content.IntentSender!, int, android.content.Intent?, int, int, int) throws android.content.IntentSender.SendIntentException;
+ method @Deprecated public void startIntentSenderForResult(android.content.IntentSender!, int, android.content.Intent?, int, int, int, android.os.Bundle?) throws android.content.IntentSender.SendIntentException;
+ }
+
+ public abstract class OnBackPressedCallback {
+ ctor public OnBackPressedCallback(boolean);
+ method @MainThread public abstract void handleOnBackPressed();
+ method @MainThread public final boolean isEnabled();
+ method @MainThread public final void remove();
+ method @MainThread public final void setEnabled(boolean);
+ }
+
+ public final class OnBackPressedDispatcher {
+ ctor public OnBackPressedDispatcher();
+ ctor public OnBackPressedDispatcher(Runnable?);
+ method @MainThread public void addCallback(androidx.activity.OnBackPressedCallback);
+ method @MainThread public void addCallback(androidx.lifecycle.LifecycleOwner, androidx.activity.OnBackPressedCallback);
+ method @MainThread public boolean hasEnabledCallbacks();
+ method @MainThread public void onBackPressed();
+ }
+
+ public interface OnBackPressedDispatcherOwner extends androidx.lifecycle.LifecycleOwner {
+ method public androidx.activity.OnBackPressedDispatcher getOnBackPressedDispatcher();
+ }
+
+}
+
+package androidx.activity.contextaware {
+
+ public interface ContextAware {
+ method public void addOnContextAvailableListener(androidx.activity.contextaware.OnContextAvailableListener);
+ method public android.content.Context? peekAvailableContext();
+ method public void removeOnContextAvailableListener(androidx.activity.contextaware.OnContextAvailableListener);
+ }
+
+ public final class ContextAwareHelper {
+ ctor public ContextAwareHelper();
+ method public void addOnContextAvailableListener(androidx.activity.contextaware.OnContextAvailableListener);
+ method public void clearAvailableContext();
+ method public void dispatchOnContextAvailable(android.content.Context);
+ method public android.content.Context? peekAvailableContext();
+ method public void removeOnContextAvailableListener(androidx.activity.contextaware.OnContextAvailableListener);
+ }
+
+ public interface OnContextAvailableListener {
+ method public void onContextAvailable(android.content.Context);
+ }
+
+}
+
+package androidx.activity.result {
+
+ public final class ActivityResult implements android.os.Parcelable {
+ ctor public ActivityResult(int, android.content.Intent?);
+ method public int describeContents();
+ method public android.content.Intent? getData();
+ method public int getResultCode();
+ method public static String resultCodeToString(int);
+ method public void writeToParcel(android.os.Parcel, int);
+ field public static final android.os.Parcelable.Creator<androidx.activity.result.ActivityResult!> CREATOR;
+ }
+
+ public interface ActivityResultCallback<O> {
+ method public void onActivityResult(O!);
+ }
+
+ public interface ActivityResultCaller {
+ method public <I, O> androidx.activity.result.ActivityResultLauncher<I!> registerForActivityResult(androidx.activity.result.contract.ActivityResultContract<I!,O!>, androidx.activity.result.ActivityResultCallback<O!>);
+ method public <I, O> androidx.activity.result.ActivityResultLauncher<I!> registerForActivityResult(androidx.activity.result.contract.ActivityResultContract<I!,O!>, androidx.activity.result.ActivityResultRegistry, androidx.activity.result.ActivityResultCallback<O!>);
+ }
+
+ public abstract class ActivityResultLauncher<I> {
+ ctor public ActivityResultLauncher();
+ method public abstract androidx.activity.result.contract.ActivityResultContract<I!,?> getContract();
+ method public void launch(I!);
+ method public abstract void launch(I!, androidx.core.app.ActivityOptionsCompat?);
+ method @MainThread public abstract void unregister();
+ }
+
+ public abstract class ActivityResultRegistry {
+ ctor public ActivityResultRegistry();
+ method @MainThread public final boolean dispatchResult(int, int, android.content.Intent?);
+ method @MainThread public final <O> boolean dispatchResult(int, O!);
+ method @MainThread public abstract <I, O> void onLaunch(int, androidx.activity.result.contract.ActivityResultContract<I!,O!>, I!, androidx.core.app.ActivityOptionsCompat?);
+ method public final void onRestoreInstanceState(android.os.Bundle?);
+ method public final void onSaveInstanceState(android.os.Bundle);
+ method public final <I, O> androidx.activity.result.ActivityResultLauncher<I!> register(String, androidx.lifecycle.LifecycleOwner, androidx.activity.result.contract.ActivityResultContract<I!,O!>, androidx.activity.result.ActivityResultCallback<O!>);
+ method public final <I, O> androidx.activity.result.ActivityResultLauncher<I!> register(String, androidx.activity.result.contract.ActivityResultContract<I!,O!>, androidx.activity.result.ActivityResultCallback<O!>);
+ }
+
+ public interface ActivityResultRegistryOwner {
+ method public androidx.activity.result.ActivityResultRegistry getActivityResultRegistry();
+ }
+
+ public final class IntentSenderRequest implements android.os.Parcelable {
+ method public int describeContents();
+ method public android.content.Intent? getFillInIntent();
+ method public int getFlagsMask();
+ method public int getFlagsValues();
+ method public android.content.IntentSender getIntentSender();
+ method public void writeToParcel(android.os.Parcel, int);
+ field public static final android.os.Parcelable.Creator<androidx.activity.result.IntentSenderRequest!> CREATOR;
+ }
+
+ public static final class IntentSenderRequest.Builder {
+ ctor public IntentSenderRequest.Builder(android.content.IntentSender);
+ ctor public IntentSenderRequest.Builder(android.app.PendingIntent);
+ method public androidx.activity.result.IntentSenderRequest build();
+ method public androidx.activity.result.IntentSenderRequest.Builder setFillInIntent(android.content.Intent?);
+ method public androidx.activity.result.IntentSenderRequest.Builder setFlags(int, int);
+ }
+
+}
+
+package androidx.activity.result.contract {
+
+ public abstract class ActivityResultContract<I, O> {
+ ctor public ActivityResultContract();
+ method public abstract android.content.Intent createIntent(android.content.Context context, I? input);
+ method public androidx.activity.result.contract.ActivityResultContract.SynchronousResult<O>? getSynchronousResult(android.content.Context context, I? input);
+ method public abstract O! parseResult(int resultCode, android.content.Intent? intent);
+ }
+
+ public static final class ActivityResultContract.SynchronousResult<T> {
+ ctor public ActivityResultContract.SynchronousResult(T? value);
+ method public T! getValue();
+ property public final T! value;
+ }
+
+ public final class ActivityResultContracts {
+ }
+
+ public static class ActivityResultContracts.CaptureVideo extends androidx.activity.result.contract.ActivityResultContract<android.net.Uri,java.lang.Boolean> {
+ ctor public ActivityResultContracts.CaptureVideo();
+ method @CallSuper public android.content.Intent createIntent(android.content.Context context, android.net.Uri input);
+ method public final androidx.activity.result.contract.ActivityResultContract.SynchronousResult<java.lang.Boolean>? getSynchronousResult(android.content.Context context, android.net.Uri input);
+ method public final Boolean parseResult(int resultCode, android.content.Intent? intent);
+ }
+
+ @RequiresApi(19) public static class ActivityResultContracts.CreateDocument extends androidx.activity.result.contract.ActivityResultContract<java.lang.String,android.net.Uri> {
+ ctor public ActivityResultContracts.CreateDocument();
+ method @CallSuper public android.content.Intent createIntent(android.content.Context context, String input);
+ method public final androidx.activity.result.contract.ActivityResultContract.SynchronousResult<android.net.Uri>? getSynchronousResult(android.content.Context context, String input);
+ method public final android.net.Uri? parseResult(int resultCode, android.content.Intent? intent);
+ }
+
+ public static class ActivityResultContracts.GetContent extends androidx.activity.result.contract.ActivityResultContract<java.lang.String,android.net.Uri> {
+ ctor public ActivityResultContracts.GetContent();
+ method @CallSuper public android.content.Intent createIntent(android.content.Context context, String input);
+ method public final androidx.activity.result.contract.ActivityResultContract.SynchronousResult<android.net.Uri>? getSynchronousResult(android.content.Context context, String input);
+ method public final android.net.Uri? parseResult(int resultCode, android.content.Intent? intent);
+ }
+
+ @RequiresApi(18) public static class ActivityResultContracts.GetMultipleContents extends androidx.activity.result.contract.ActivityResultContract<java.lang.String,java.util.List<android.net.Uri>> {
+ ctor public ActivityResultContracts.GetMultipleContents();
+ method @CallSuper public android.content.Intent createIntent(android.content.Context context, String input);
+ method public final androidx.activity.result.contract.ActivityResultContract.SynchronousResult<java.util.List<android.net.Uri>>? getSynchronousResult(android.content.Context context, String input);
+ method public final java.util.List<android.net.Uri> parseResult(int resultCode, android.content.Intent? intent);
+ }
+
+ @RequiresApi(19) public static class ActivityResultContracts.OpenDocument extends androidx.activity.result.contract.ActivityResultContract<java.lang.String[],android.net.Uri> {
+ ctor public ActivityResultContracts.OpenDocument();
+ method @CallSuper public android.content.Intent createIntent(android.content.Context context, String![] input);
+ method public final androidx.activity.result.contract.ActivityResultContract.SynchronousResult<android.net.Uri>? getSynchronousResult(android.content.Context context, String![] input);
+ method public final android.net.Uri? parseResult(int resultCode, android.content.Intent? intent);
+ }
+
+ @RequiresApi(21) public static class ActivityResultContracts.OpenDocumentTree extends androidx.activity.result.contract.ActivityResultContract<android.net.Uri,android.net.Uri> {
+ ctor public ActivityResultContracts.OpenDocumentTree();
+ method @CallSuper public android.content.Intent createIntent(android.content.Context context, android.net.Uri? input);
+ method public final androidx.activity.result.contract.ActivityResultContract.SynchronousResult<android.net.Uri>? getSynchronousResult(android.content.Context context, android.net.Uri? input);
+ method public final android.net.Uri? parseResult(int resultCode, android.content.Intent? intent);
+ }
+
+ @RequiresApi(19) public static class ActivityResultContracts.OpenMultipleDocuments extends androidx.activity.result.contract.ActivityResultContract<java.lang.String[],java.util.List<android.net.Uri>> {
+ ctor public ActivityResultContracts.OpenMultipleDocuments();
+ method @CallSuper public android.content.Intent createIntent(android.content.Context context, String![] input);
+ method public final androidx.activity.result.contract.ActivityResultContract.SynchronousResult<java.util.List<android.net.Uri>>? getSynchronousResult(android.content.Context context, String![] input);
+ method public final java.util.List<android.net.Uri> parseResult(int resultCode, android.content.Intent? intent);
+ }
+
+ public static final class ActivityResultContracts.PickContact extends androidx.activity.result.contract.ActivityResultContract<java.lang.Void,android.net.Uri> {
+ ctor public ActivityResultContracts.PickContact();
+ method public android.content.Intent createIntent(android.content.Context context, Void? input);
+ method public android.net.Uri? parseResult(int resultCode, android.content.Intent? intent);
+ }
+
+ public static final class ActivityResultContracts.RequestMultiplePermissions extends androidx.activity.result.contract.ActivityResultContract<java.lang.String[],java.util.Map<java.lang.String,java.lang.Boolean>> {
+ ctor public ActivityResultContracts.RequestMultiplePermissions();
+ method public android.content.Intent createIntent(android.content.Context context, String![] input);
+ method public androidx.activity.result.contract.ActivityResultContract.SynchronousResult<java.util.Map<java.lang.String,java.lang.Boolean>>? getSynchronousResult(android.content.Context context, String![] input);
+ method public java.util.Map<java.lang.String,java.lang.Boolean> parseResult(int resultCode, android.content.Intent? intent);
+ field public static final String ACTION_REQUEST_PERMISSIONS = "androidx.activity.result.contract.action.REQUEST_PERMISSIONS";
+ field public static final String EXTRA_PERMISSIONS = "androidx.activity.result.contract.extra.PERMISSIONS";
+ field public static final String EXTRA_PERMISSION_GRANT_RESULTS = "androidx.activity.result.contract.extra.PERMISSION_GRANT_RESULTS";
+ }
+
+ public static final class ActivityResultContracts.RequestPermission extends androidx.activity.result.contract.ActivityResultContract<java.lang.String,java.lang.Boolean> {
+ ctor public ActivityResultContracts.RequestPermission();
+ method public android.content.Intent createIntent(android.content.Context context, String input);
+ method public androidx.activity.result.contract.ActivityResultContract.SynchronousResult<java.lang.Boolean>? getSynchronousResult(android.content.Context context, String input);
+ method public Boolean parseResult(int resultCode, android.content.Intent? intent);
+ }
+
+ public static final class ActivityResultContracts.StartActivityForResult extends androidx.activity.result.contract.ActivityResultContract<android.content.Intent,androidx.activity.result.ActivityResult> {
+ ctor public ActivityResultContracts.StartActivityForResult();
+ method public android.content.Intent createIntent(android.content.Context context, android.content.Intent input);
+ method public androidx.activity.result.ActivityResult parseResult(int resultCode, android.content.Intent? intent);
+ field public static final String EXTRA_ACTIVITY_OPTIONS_BUNDLE = "androidx.activity.result.contract.extra.ACTIVITY_OPTIONS_BUNDLE";
+ }
+
+ public static final class ActivityResultContracts.StartIntentSenderForResult extends androidx.activity.result.contract.ActivityResultContract<androidx.activity.result.IntentSenderRequest,androidx.activity.result.ActivityResult> {
+ ctor public ActivityResultContracts.StartIntentSenderForResult();
+ method public android.content.Intent createIntent(android.content.Context context, androidx.activity.result.IntentSenderRequest input);
+ method public androidx.activity.result.ActivityResult parseResult(int resultCode, android.content.Intent? intent);
+ field public static final String ACTION_INTENT_SENDER_REQUEST = "androidx.activity.result.contract.action.INTENT_SENDER_REQUEST";
+ field public static final String EXTRA_INTENT_SENDER_REQUEST = "androidx.activity.result.contract.extra.INTENT_SENDER_REQUEST";
+ field public static final String EXTRA_SEND_INTENT_EXCEPTION = "androidx.activity.result.contract.extra.SEND_INTENT_EXCEPTION";
+ }
+
+ public static class ActivityResultContracts.TakePicture extends androidx.activity.result.contract.ActivityResultContract<android.net.Uri,java.lang.Boolean> {
+ ctor public ActivityResultContracts.TakePicture();
+ method @CallSuper public android.content.Intent createIntent(android.content.Context context, android.net.Uri input);
+ method public final androidx.activity.result.contract.ActivityResultContract.SynchronousResult<java.lang.Boolean>? getSynchronousResult(android.content.Context context, android.net.Uri input);
+ method public final Boolean parseResult(int resultCode, android.content.Intent? intent);
+ }
+
+ public static class ActivityResultContracts.TakePicturePreview extends androidx.activity.result.contract.ActivityResultContract<java.lang.Void,android.graphics.Bitmap> {
+ ctor public ActivityResultContracts.TakePicturePreview();
+ method @CallSuper public android.content.Intent createIntent(android.content.Context context, Void? input);
+ method public final androidx.activity.result.contract.ActivityResultContract.SynchronousResult<android.graphics.Bitmap>? getSynchronousResult(android.content.Context context, Void? input);
+ method public final android.graphics.Bitmap? parseResult(int resultCode, android.content.Intent? intent);
+ }
+
+ @Deprecated public static class ActivityResultContracts.TakeVideo extends androidx.activity.result.contract.ActivityResultContract<android.net.Uri,android.graphics.Bitmap> {
+ ctor @Deprecated public ActivityResultContracts.TakeVideo();
+ method @Deprecated @CallSuper public android.content.Intent createIntent(android.content.Context context, android.net.Uri input);
+ method @Deprecated public final androidx.activity.result.contract.ActivityResultContract.SynchronousResult<android.graphics.Bitmap>? getSynchronousResult(android.content.Context context, android.net.Uri input);
+ method @Deprecated public final android.graphics.Bitmap? parseResult(int resultCode, android.content.Intent? intent);
+ }
+
+}
+
diff --git a/activity/activity/api/current.txt b/activity/activity/api/current.txt
index 049274b..dd842d8 100644
--- a/activity/activity/api/current.txt
+++ b/activity/activity/api/current.txt
@@ -180,7 +180,7 @@
method public final android.net.Uri? parseResult(int resultCode, android.content.Intent? intent);
}
- @RequiresApi(18) public static class ActivityResultContracts.GetMultipleContents extends androidx.activity.result.contract.ActivityResultContract<java.lang.String,java.util.List<? extends android.net.Uri>> {
+ @RequiresApi(18) public static class ActivityResultContracts.GetMultipleContents extends androidx.activity.result.contract.ActivityResultContract<java.lang.String,java.util.List<android.net.Uri>> {
ctor public ActivityResultContracts.GetMultipleContents();
method @CallSuper public android.content.Intent createIntent(android.content.Context context, String input);
method public final androidx.activity.result.contract.ActivityResultContract.SynchronousResult<java.util.List<android.net.Uri>>? getSynchronousResult(android.content.Context context, String input);
@@ -201,7 +201,7 @@
method public final android.net.Uri? parseResult(int resultCode, android.content.Intent? intent);
}
- @RequiresApi(19) public static class ActivityResultContracts.OpenMultipleDocuments extends androidx.activity.result.contract.ActivityResultContract<java.lang.String[],java.util.List<? extends android.net.Uri>> {
+ @RequiresApi(19) public static class ActivityResultContracts.OpenMultipleDocuments extends androidx.activity.result.contract.ActivityResultContract<java.lang.String[],java.util.List<android.net.Uri>> {
ctor public ActivityResultContracts.OpenMultipleDocuments();
method @CallSuper public android.content.Intent createIntent(android.content.Context context, String![] input);
method public final androidx.activity.result.contract.ActivityResultContract.SynchronousResult<java.util.List<android.net.Uri>>? getSynchronousResult(android.content.Context context, String![] input);
diff --git a/activity/activity/api/public_plus_experimental_1.4.0-beta01.txt b/activity/activity/api/public_plus_experimental_1.4.0-beta01.txt
new file mode 100644
index 0000000..dd842d8
--- /dev/null
+++ b/activity/activity/api/public_plus_experimental_1.4.0-beta01.txt
@@ -0,0 +1,272 @@
+// Signature format: 4.0
+package androidx.activity {
+
+ public class ComponentActivity extends android.app.Activity implements androidx.activity.result.ActivityResultCaller androidx.activity.result.ActivityResultRegistryOwner androidx.activity.contextaware.ContextAware androidx.lifecycle.HasDefaultViewModelProviderFactory androidx.lifecycle.LifecycleOwner androidx.core.view.MenuHost androidx.activity.OnBackPressedDispatcherOwner androidx.savedstate.SavedStateRegistryOwner androidx.lifecycle.ViewModelStoreOwner {
+ ctor public ComponentActivity();
+ ctor @ContentView public ComponentActivity(@LayoutRes int);
+ method public void addMenuProvider(androidx.core.view.MenuProvider);
+ method public void addMenuProvider(androidx.core.view.MenuProvider, androidx.lifecycle.LifecycleOwner);
+ method public void addMenuProvider(androidx.core.view.MenuProvider, androidx.lifecycle.LifecycleOwner, androidx.lifecycle.Lifecycle.State);
+ method public final void addOnContextAvailableListener(androidx.activity.contextaware.OnContextAvailableListener);
+ method public final androidx.activity.result.ActivityResultRegistry getActivityResultRegistry();
+ method public androidx.lifecycle.ViewModelProvider.Factory getDefaultViewModelProviderFactory();
+ method @Deprecated public Object? getLastCustomNonConfigurationInstance();
+ method public androidx.lifecycle.Lifecycle getLifecycle();
+ method public final androidx.activity.OnBackPressedDispatcher getOnBackPressedDispatcher();
+ method public final androidx.savedstate.SavedStateRegistry getSavedStateRegistry();
+ method public androidx.lifecycle.ViewModelStore getViewModelStore();
+ method public void invalidateMenu();
+ method @Deprecated @CallSuper protected void onActivityResult(int, int, android.content.Intent?);
+ method @Deprecated @CallSuper public void onRequestPermissionsResult(int, String![], int[]);
+ method @Deprecated public Object? onRetainCustomNonConfigurationInstance();
+ method public final Object? onRetainNonConfigurationInstance();
+ method public android.content.Context? peekAvailableContext();
+ method public final <I, O> androidx.activity.result.ActivityResultLauncher<I!> registerForActivityResult(androidx.activity.result.contract.ActivityResultContract<I!,O!>, androidx.activity.result.ActivityResultRegistry, androidx.activity.result.ActivityResultCallback<O!>);
+ method public final <I, O> androidx.activity.result.ActivityResultLauncher<I!> registerForActivityResult(androidx.activity.result.contract.ActivityResultContract<I!,O!>, androidx.activity.result.ActivityResultCallback<O!>);
+ method public void removeMenuProvider(androidx.core.view.MenuProvider);
+ method public final void removeOnContextAvailableListener(androidx.activity.contextaware.OnContextAvailableListener);
+ method @Deprecated public void startActivityForResult(android.content.Intent!, int);
+ method @Deprecated public void startActivityForResult(android.content.Intent!, int, android.os.Bundle?);
+ method @Deprecated public void startIntentSenderForResult(android.content.IntentSender!, int, android.content.Intent?, int, int, int) throws android.content.IntentSender.SendIntentException;
+ method @Deprecated public void startIntentSenderForResult(android.content.IntentSender!, int, android.content.Intent?, int, int, int, android.os.Bundle?) throws android.content.IntentSender.SendIntentException;
+ }
+
+ public abstract class OnBackPressedCallback {
+ ctor public OnBackPressedCallback(boolean);
+ method @MainThread public abstract void handleOnBackPressed();
+ method @MainThread public final boolean isEnabled();
+ method @MainThread public final void remove();
+ method @MainThread public final void setEnabled(boolean);
+ }
+
+ public final class OnBackPressedDispatcher {
+ ctor public OnBackPressedDispatcher();
+ ctor public OnBackPressedDispatcher(Runnable?);
+ method @MainThread public void addCallback(androidx.activity.OnBackPressedCallback);
+ method @MainThread public void addCallback(androidx.lifecycle.LifecycleOwner, androidx.activity.OnBackPressedCallback);
+ method @MainThread public boolean hasEnabledCallbacks();
+ method @MainThread public void onBackPressed();
+ }
+
+ public interface OnBackPressedDispatcherOwner extends androidx.lifecycle.LifecycleOwner {
+ method public androidx.activity.OnBackPressedDispatcher getOnBackPressedDispatcher();
+ }
+
+}
+
+package androidx.activity.contextaware {
+
+ public interface ContextAware {
+ method public void addOnContextAvailableListener(androidx.activity.contextaware.OnContextAvailableListener);
+ method public android.content.Context? peekAvailableContext();
+ method public void removeOnContextAvailableListener(androidx.activity.contextaware.OnContextAvailableListener);
+ }
+
+ public final class ContextAwareHelper {
+ ctor public ContextAwareHelper();
+ method public void addOnContextAvailableListener(androidx.activity.contextaware.OnContextAvailableListener);
+ method public void clearAvailableContext();
+ method public void dispatchOnContextAvailable(android.content.Context);
+ method public android.content.Context? peekAvailableContext();
+ method public void removeOnContextAvailableListener(androidx.activity.contextaware.OnContextAvailableListener);
+ }
+
+ public interface OnContextAvailableListener {
+ method public void onContextAvailable(android.content.Context);
+ }
+
+}
+
+package androidx.activity.result {
+
+ public final class ActivityResult implements android.os.Parcelable {
+ ctor public ActivityResult(int, android.content.Intent?);
+ method public int describeContents();
+ method public android.content.Intent? getData();
+ method public int getResultCode();
+ method public static String resultCodeToString(int);
+ method public void writeToParcel(android.os.Parcel, int);
+ field public static final android.os.Parcelable.Creator<androidx.activity.result.ActivityResult!> CREATOR;
+ }
+
+ public interface ActivityResultCallback<O> {
+ method public void onActivityResult(O!);
+ }
+
+ public interface ActivityResultCaller {
+ method public <I, O> androidx.activity.result.ActivityResultLauncher<I!> registerForActivityResult(androidx.activity.result.contract.ActivityResultContract<I!,O!>, androidx.activity.result.ActivityResultCallback<O!>);
+ method public <I, O> androidx.activity.result.ActivityResultLauncher<I!> registerForActivityResult(androidx.activity.result.contract.ActivityResultContract<I!,O!>, androidx.activity.result.ActivityResultRegistry, androidx.activity.result.ActivityResultCallback<O!>);
+ }
+
+ public abstract class ActivityResultLauncher<I> {
+ ctor public ActivityResultLauncher();
+ method public abstract androidx.activity.result.contract.ActivityResultContract<I!,?> getContract();
+ method public void launch(I!);
+ method public abstract void launch(I!, androidx.core.app.ActivityOptionsCompat?);
+ method @MainThread public abstract void unregister();
+ }
+
+ public abstract class ActivityResultRegistry {
+ ctor public ActivityResultRegistry();
+ method @MainThread public final boolean dispatchResult(int, int, android.content.Intent?);
+ method @MainThread public final <O> boolean dispatchResult(int, O!);
+ method @MainThread public abstract <I, O> void onLaunch(int, androidx.activity.result.contract.ActivityResultContract<I!,O!>, I!, androidx.core.app.ActivityOptionsCompat?);
+ method public final void onRestoreInstanceState(android.os.Bundle?);
+ method public final void onSaveInstanceState(android.os.Bundle);
+ method public final <I, O> androidx.activity.result.ActivityResultLauncher<I!> register(String, androidx.lifecycle.LifecycleOwner, androidx.activity.result.contract.ActivityResultContract<I!,O!>, androidx.activity.result.ActivityResultCallback<O!>);
+ method public final <I, O> androidx.activity.result.ActivityResultLauncher<I!> register(String, androidx.activity.result.contract.ActivityResultContract<I!,O!>, androidx.activity.result.ActivityResultCallback<O!>);
+ }
+
+ public interface ActivityResultRegistryOwner {
+ method public androidx.activity.result.ActivityResultRegistry getActivityResultRegistry();
+ }
+
+ public final class IntentSenderRequest implements android.os.Parcelable {
+ method public int describeContents();
+ method public android.content.Intent? getFillInIntent();
+ method public int getFlagsMask();
+ method public int getFlagsValues();
+ method public android.content.IntentSender getIntentSender();
+ method public void writeToParcel(android.os.Parcel, int);
+ field public static final android.os.Parcelable.Creator<androidx.activity.result.IntentSenderRequest!> CREATOR;
+ }
+
+ public static final class IntentSenderRequest.Builder {
+ ctor public IntentSenderRequest.Builder(android.content.IntentSender);
+ ctor public IntentSenderRequest.Builder(android.app.PendingIntent);
+ method public androidx.activity.result.IntentSenderRequest build();
+ method public androidx.activity.result.IntentSenderRequest.Builder setFillInIntent(android.content.Intent?);
+ method public androidx.activity.result.IntentSenderRequest.Builder setFlags(int, int);
+ }
+
+}
+
+package androidx.activity.result.contract {
+
+ public abstract class ActivityResultContract<I, O> {
+ ctor public ActivityResultContract();
+ method public abstract android.content.Intent createIntent(android.content.Context context, I? input);
+ method public androidx.activity.result.contract.ActivityResultContract.SynchronousResult<O>? getSynchronousResult(android.content.Context context, I? input);
+ method public abstract O! parseResult(int resultCode, android.content.Intent? intent);
+ }
+
+ public static final class ActivityResultContract.SynchronousResult<T> {
+ ctor public ActivityResultContract.SynchronousResult(T? value);
+ method public T! getValue();
+ property public final T! value;
+ }
+
+ public final class ActivityResultContracts {
+ }
+
+ public static class ActivityResultContracts.CaptureVideo extends androidx.activity.result.contract.ActivityResultContract<android.net.Uri,java.lang.Boolean> {
+ ctor public ActivityResultContracts.CaptureVideo();
+ method @CallSuper public android.content.Intent createIntent(android.content.Context context, android.net.Uri input);
+ method public final androidx.activity.result.contract.ActivityResultContract.SynchronousResult<java.lang.Boolean>? getSynchronousResult(android.content.Context context, android.net.Uri input);
+ method public final Boolean parseResult(int resultCode, android.content.Intent? intent);
+ }
+
+ @RequiresApi(19) public static class ActivityResultContracts.CreateDocument extends androidx.activity.result.contract.ActivityResultContract<java.lang.String,android.net.Uri> {
+ ctor public ActivityResultContracts.CreateDocument();
+ method @CallSuper public android.content.Intent createIntent(android.content.Context context, String input);
+ method public final androidx.activity.result.contract.ActivityResultContract.SynchronousResult<android.net.Uri>? getSynchronousResult(android.content.Context context, String input);
+ method public final android.net.Uri? parseResult(int resultCode, android.content.Intent? intent);
+ }
+
+ public static class ActivityResultContracts.GetContent extends androidx.activity.result.contract.ActivityResultContract<java.lang.String,android.net.Uri> {
+ ctor public ActivityResultContracts.GetContent();
+ method @CallSuper public android.content.Intent createIntent(android.content.Context context, String input);
+ method public final androidx.activity.result.contract.ActivityResultContract.SynchronousResult<android.net.Uri>? getSynchronousResult(android.content.Context context, String input);
+ method public final android.net.Uri? parseResult(int resultCode, android.content.Intent? intent);
+ }
+
+ @RequiresApi(18) public static class ActivityResultContracts.GetMultipleContents extends androidx.activity.result.contract.ActivityResultContract<java.lang.String,java.util.List<android.net.Uri>> {
+ ctor public ActivityResultContracts.GetMultipleContents();
+ method @CallSuper public android.content.Intent createIntent(android.content.Context context, String input);
+ method public final androidx.activity.result.contract.ActivityResultContract.SynchronousResult<java.util.List<android.net.Uri>>? getSynchronousResult(android.content.Context context, String input);
+ method public final java.util.List<android.net.Uri> parseResult(int resultCode, android.content.Intent? intent);
+ }
+
+ @RequiresApi(19) public static class ActivityResultContracts.OpenDocument extends androidx.activity.result.contract.ActivityResultContract<java.lang.String[],android.net.Uri> {
+ ctor public ActivityResultContracts.OpenDocument();
+ method @CallSuper public android.content.Intent createIntent(android.content.Context context, String![] input);
+ method public final androidx.activity.result.contract.ActivityResultContract.SynchronousResult<android.net.Uri>? getSynchronousResult(android.content.Context context, String![] input);
+ method public final android.net.Uri? parseResult(int resultCode, android.content.Intent? intent);
+ }
+
+ @RequiresApi(21) public static class ActivityResultContracts.OpenDocumentTree extends androidx.activity.result.contract.ActivityResultContract<android.net.Uri,android.net.Uri> {
+ ctor public ActivityResultContracts.OpenDocumentTree();
+ method @CallSuper public android.content.Intent createIntent(android.content.Context context, android.net.Uri? input);
+ method public final androidx.activity.result.contract.ActivityResultContract.SynchronousResult<android.net.Uri>? getSynchronousResult(android.content.Context context, android.net.Uri? input);
+ method public final android.net.Uri? parseResult(int resultCode, android.content.Intent? intent);
+ }
+
+ @RequiresApi(19) public static class ActivityResultContracts.OpenMultipleDocuments extends androidx.activity.result.contract.ActivityResultContract<java.lang.String[],java.util.List<android.net.Uri>> {
+ ctor public ActivityResultContracts.OpenMultipleDocuments();
+ method @CallSuper public android.content.Intent createIntent(android.content.Context context, String![] input);
+ method public final androidx.activity.result.contract.ActivityResultContract.SynchronousResult<java.util.List<android.net.Uri>>? getSynchronousResult(android.content.Context context, String![] input);
+ method public final java.util.List<android.net.Uri> parseResult(int resultCode, android.content.Intent? intent);
+ }
+
+ public static final class ActivityResultContracts.PickContact extends androidx.activity.result.contract.ActivityResultContract<java.lang.Void,android.net.Uri> {
+ ctor public ActivityResultContracts.PickContact();
+ method public android.content.Intent createIntent(android.content.Context context, Void? input);
+ method public android.net.Uri? parseResult(int resultCode, android.content.Intent? intent);
+ }
+
+ public static final class ActivityResultContracts.RequestMultiplePermissions extends androidx.activity.result.contract.ActivityResultContract<java.lang.String[],java.util.Map<java.lang.String,java.lang.Boolean>> {
+ ctor public ActivityResultContracts.RequestMultiplePermissions();
+ method public android.content.Intent createIntent(android.content.Context context, String![] input);
+ method public androidx.activity.result.contract.ActivityResultContract.SynchronousResult<java.util.Map<java.lang.String,java.lang.Boolean>>? getSynchronousResult(android.content.Context context, String![] input);
+ method public java.util.Map<java.lang.String,java.lang.Boolean> parseResult(int resultCode, android.content.Intent? intent);
+ field public static final String ACTION_REQUEST_PERMISSIONS = "androidx.activity.result.contract.action.REQUEST_PERMISSIONS";
+ field public static final String EXTRA_PERMISSIONS = "androidx.activity.result.contract.extra.PERMISSIONS";
+ field public static final String EXTRA_PERMISSION_GRANT_RESULTS = "androidx.activity.result.contract.extra.PERMISSION_GRANT_RESULTS";
+ }
+
+ public static final class ActivityResultContracts.RequestPermission extends androidx.activity.result.contract.ActivityResultContract<java.lang.String,java.lang.Boolean> {
+ ctor public ActivityResultContracts.RequestPermission();
+ method public android.content.Intent createIntent(android.content.Context context, String input);
+ method public androidx.activity.result.contract.ActivityResultContract.SynchronousResult<java.lang.Boolean>? getSynchronousResult(android.content.Context context, String input);
+ method public Boolean parseResult(int resultCode, android.content.Intent? intent);
+ }
+
+ public static final class ActivityResultContracts.StartActivityForResult extends androidx.activity.result.contract.ActivityResultContract<android.content.Intent,androidx.activity.result.ActivityResult> {
+ ctor public ActivityResultContracts.StartActivityForResult();
+ method public android.content.Intent createIntent(android.content.Context context, android.content.Intent input);
+ method public androidx.activity.result.ActivityResult parseResult(int resultCode, android.content.Intent? intent);
+ field public static final String EXTRA_ACTIVITY_OPTIONS_BUNDLE = "androidx.activity.result.contract.extra.ACTIVITY_OPTIONS_BUNDLE";
+ }
+
+ public static final class ActivityResultContracts.StartIntentSenderForResult extends androidx.activity.result.contract.ActivityResultContract<androidx.activity.result.IntentSenderRequest,androidx.activity.result.ActivityResult> {
+ ctor public ActivityResultContracts.StartIntentSenderForResult();
+ method public android.content.Intent createIntent(android.content.Context context, androidx.activity.result.IntentSenderRequest input);
+ method public androidx.activity.result.ActivityResult parseResult(int resultCode, android.content.Intent? intent);
+ field public static final String ACTION_INTENT_SENDER_REQUEST = "androidx.activity.result.contract.action.INTENT_SENDER_REQUEST";
+ field public static final String EXTRA_INTENT_SENDER_REQUEST = "androidx.activity.result.contract.extra.INTENT_SENDER_REQUEST";
+ field public static final String EXTRA_SEND_INTENT_EXCEPTION = "androidx.activity.result.contract.extra.SEND_INTENT_EXCEPTION";
+ }
+
+ public static class ActivityResultContracts.TakePicture extends androidx.activity.result.contract.ActivityResultContract<android.net.Uri,java.lang.Boolean> {
+ ctor public ActivityResultContracts.TakePicture();
+ method @CallSuper public android.content.Intent createIntent(android.content.Context context, android.net.Uri input);
+ method public final androidx.activity.result.contract.ActivityResultContract.SynchronousResult<java.lang.Boolean>? getSynchronousResult(android.content.Context context, android.net.Uri input);
+ method public final Boolean parseResult(int resultCode, android.content.Intent? intent);
+ }
+
+ public static class ActivityResultContracts.TakePicturePreview extends androidx.activity.result.contract.ActivityResultContract<java.lang.Void,android.graphics.Bitmap> {
+ ctor public ActivityResultContracts.TakePicturePreview();
+ method @CallSuper public android.content.Intent createIntent(android.content.Context context, Void? input);
+ method public final androidx.activity.result.contract.ActivityResultContract.SynchronousResult<android.graphics.Bitmap>? getSynchronousResult(android.content.Context context, Void? input);
+ method public final android.graphics.Bitmap? parseResult(int resultCode, android.content.Intent? intent);
+ }
+
+ @Deprecated public static class ActivityResultContracts.TakeVideo extends androidx.activity.result.contract.ActivityResultContract<android.net.Uri,android.graphics.Bitmap> {
+ ctor @Deprecated public ActivityResultContracts.TakeVideo();
+ method @Deprecated @CallSuper public android.content.Intent createIntent(android.content.Context context, android.net.Uri input);
+ method @Deprecated public final androidx.activity.result.contract.ActivityResultContract.SynchronousResult<android.graphics.Bitmap>? getSynchronousResult(android.content.Context context, android.net.Uri input);
+ method @Deprecated public final android.graphics.Bitmap? parseResult(int resultCode, android.content.Intent? intent);
+ }
+
+}
+
diff --git a/activity/activity/api/public_plus_experimental_current.txt b/activity/activity/api/public_plus_experimental_current.txt
index 049274b..dd842d8 100644
--- a/activity/activity/api/public_plus_experimental_current.txt
+++ b/activity/activity/api/public_plus_experimental_current.txt
@@ -180,7 +180,7 @@
method public final android.net.Uri? parseResult(int resultCode, android.content.Intent? intent);
}
- @RequiresApi(18) public static class ActivityResultContracts.GetMultipleContents extends androidx.activity.result.contract.ActivityResultContract<java.lang.String,java.util.List<? extends android.net.Uri>> {
+ @RequiresApi(18) public static class ActivityResultContracts.GetMultipleContents extends androidx.activity.result.contract.ActivityResultContract<java.lang.String,java.util.List<android.net.Uri>> {
ctor public ActivityResultContracts.GetMultipleContents();
method @CallSuper public android.content.Intent createIntent(android.content.Context context, String input);
method public final androidx.activity.result.contract.ActivityResultContract.SynchronousResult<java.util.List<android.net.Uri>>? getSynchronousResult(android.content.Context context, String input);
@@ -201,7 +201,7 @@
method public final android.net.Uri? parseResult(int resultCode, android.content.Intent? intent);
}
- @RequiresApi(19) public static class ActivityResultContracts.OpenMultipleDocuments extends androidx.activity.result.contract.ActivityResultContract<java.lang.String[],java.util.List<? extends android.net.Uri>> {
+ @RequiresApi(19) public static class ActivityResultContracts.OpenMultipleDocuments extends androidx.activity.result.contract.ActivityResultContract<java.lang.String[],java.util.List<android.net.Uri>> {
ctor public ActivityResultContracts.OpenMultipleDocuments();
method @CallSuper public android.content.Intent createIntent(android.content.Context context, String![] input);
method public final androidx.activity.result.contract.ActivityResultContract.SynchronousResult<java.util.List<android.net.Uri>>? getSynchronousResult(android.content.Context context, String![] input);
diff --git a/wear/wear-watchface/api/res-current.txt b/activity/activity/api/res-1.4.0-beta01.txt
similarity index 100%
copy from wear/wear-watchface/api/res-current.txt
copy to activity/activity/api/res-1.4.0-beta01.txt
diff --git a/activity/activity/api/restricted_1.4.0-beta01.txt b/activity/activity/api/restricted_1.4.0-beta01.txt
new file mode 100644
index 0000000..0ce24f9
--- /dev/null
+++ b/activity/activity/api/restricted_1.4.0-beta01.txt
@@ -0,0 +1,271 @@
+// Signature format: 4.0
+package androidx.activity {
+
+ public class ComponentActivity extends androidx.core.app.ComponentActivity implements androidx.activity.result.ActivityResultCaller androidx.activity.result.ActivityResultRegistryOwner androidx.activity.contextaware.ContextAware androidx.lifecycle.HasDefaultViewModelProviderFactory androidx.lifecycle.LifecycleOwner androidx.core.view.MenuHost androidx.activity.OnBackPressedDispatcherOwner androidx.savedstate.SavedStateRegistryOwner androidx.lifecycle.ViewModelStoreOwner {
+ ctor public ComponentActivity();
+ ctor @ContentView public ComponentActivity(@LayoutRes int);
+ method public void addMenuProvider(androidx.core.view.MenuProvider);
+ method public void addMenuProvider(androidx.core.view.MenuProvider, androidx.lifecycle.LifecycleOwner);
+ method public void addMenuProvider(androidx.core.view.MenuProvider, androidx.lifecycle.LifecycleOwner, androidx.lifecycle.Lifecycle.State);
+ method public final void addOnContextAvailableListener(androidx.activity.contextaware.OnContextAvailableListener);
+ method public final androidx.activity.result.ActivityResultRegistry getActivityResultRegistry();
+ method public androidx.lifecycle.ViewModelProvider.Factory getDefaultViewModelProviderFactory();
+ method @Deprecated public Object? getLastCustomNonConfigurationInstance();
+ method public final androidx.activity.OnBackPressedDispatcher getOnBackPressedDispatcher();
+ method public final androidx.savedstate.SavedStateRegistry getSavedStateRegistry();
+ method public androidx.lifecycle.ViewModelStore getViewModelStore();
+ method public void invalidateMenu();
+ method @Deprecated @CallSuper protected void onActivityResult(int, int, android.content.Intent?);
+ method @Deprecated @CallSuper public void onRequestPermissionsResult(int, String![], int[]);
+ method @Deprecated public Object? onRetainCustomNonConfigurationInstance();
+ method public final Object? onRetainNonConfigurationInstance();
+ method public android.content.Context? peekAvailableContext();
+ method public final <I, O> androidx.activity.result.ActivityResultLauncher<I!> registerForActivityResult(androidx.activity.result.contract.ActivityResultContract<I!,O!>, androidx.activity.result.ActivityResultRegistry, androidx.activity.result.ActivityResultCallback<O!>);
+ method public final <I, O> androidx.activity.result.ActivityResultLauncher<I!> registerForActivityResult(androidx.activity.result.contract.ActivityResultContract<I!,O!>, androidx.activity.result.ActivityResultCallback<O!>);
+ method public void removeMenuProvider(androidx.core.view.MenuProvider);
+ method public final void removeOnContextAvailableListener(androidx.activity.contextaware.OnContextAvailableListener);
+ method @Deprecated public void startActivityForResult(android.content.Intent!, int);
+ method @Deprecated public void startActivityForResult(android.content.Intent!, int, android.os.Bundle?);
+ method @Deprecated public void startIntentSenderForResult(android.content.IntentSender!, int, android.content.Intent?, int, int, int) throws android.content.IntentSender.SendIntentException;
+ method @Deprecated public void startIntentSenderForResult(android.content.IntentSender!, int, android.content.Intent?, int, int, int, android.os.Bundle?) throws android.content.IntentSender.SendIntentException;
+ }
+
+ public abstract class OnBackPressedCallback {
+ ctor public OnBackPressedCallback(boolean);
+ method @MainThread public abstract void handleOnBackPressed();
+ method @MainThread public final boolean isEnabled();
+ method @MainThread public final void remove();
+ method @MainThread public final void setEnabled(boolean);
+ }
+
+ public final class OnBackPressedDispatcher {
+ ctor public OnBackPressedDispatcher();
+ ctor public OnBackPressedDispatcher(Runnable?);
+ method @MainThread public void addCallback(androidx.activity.OnBackPressedCallback);
+ method @MainThread public void addCallback(androidx.lifecycle.LifecycleOwner, androidx.activity.OnBackPressedCallback);
+ method @MainThread public boolean hasEnabledCallbacks();
+ method @MainThread public void onBackPressed();
+ }
+
+ public interface OnBackPressedDispatcherOwner extends androidx.lifecycle.LifecycleOwner {
+ method public androidx.activity.OnBackPressedDispatcher getOnBackPressedDispatcher();
+ }
+
+}
+
+package androidx.activity.contextaware {
+
+ public interface ContextAware {
+ method public void addOnContextAvailableListener(androidx.activity.contextaware.OnContextAvailableListener);
+ method public android.content.Context? peekAvailableContext();
+ method public void removeOnContextAvailableListener(androidx.activity.contextaware.OnContextAvailableListener);
+ }
+
+ public final class ContextAwareHelper {
+ ctor public ContextAwareHelper();
+ method public void addOnContextAvailableListener(androidx.activity.contextaware.OnContextAvailableListener);
+ method public void clearAvailableContext();
+ method public void dispatchOnContextAvailable(android.content.Context);
+ method public android.content.Context? peekAvailableContext();
+ method public void removeOnContextAvailableListener(androidx.activity.contextaware.OnContextAvailableListener);
+ }
+
+ public interface OnContextAvailableListener {
+ method public void onContextAvailable(android.content.Context);
+ }
+
+}
+
+package androidx.activity.result {
+
+ public final class ActivityResult implements android.os.Parcelable {
+ ctor public ActivityResult(int, android.content.Intent?);
+ method public int describeContents();
+ method public android.content.Intent? getData();
+ method public int getResultCode();
+ method public static String resultCodeToString(int);
+ method public void writeToParcel(android.os.Parcel, int);
+ field public static final android.os.Parcelable.Creator<androidx.activity.result.ActivityResult!> CREATOR;
+ }
+
+ public interface ActivityResultCallback<O> {
+ method public void onActivityResult(O!);
+ }
+
+ public interface ActivityResultCaller {
+ method public <I, O> androidx.activity.result.ActivityResultLauncher<I!> registerForActivityResult(androidx.activity.result.contract.ActivityResultContract<I!,O!>, androidx.activity.result.ActivityResultCallback<O!>);
+ method public <I, O> androidx.activity.result.ActivityResultLauncher<I!> registerForActivityResult(androidx.activity.result.contract.ActivityResultContract<I!,O!>, androidx.activity.result.ActivityResultRegistry, androidx.activity.result.ActivityResultCallback<O!>);
+ }
+
+ public abstract class ActivityResultLauncher<I> {
+ ctor public ActivityResultLauncher();
+ method public abstract androidx.activity.result.contract.ActivityResultContract<I!,?> getContract();
+ method public void launch(I!);
+ method public abstract void launch(I!, androidx.core.app.ActivityOptionsCompat?);
+ method @MainThread public abstract void unregister();
+ }
+
+ public abstract class ActivityResultRegistry {
+ ctor public ActivityResultRegistry();
+ method @MainThread public final boolean dispatchResult(int, int, android.content.Intent?);
+ method @MainThread public final <O> boolean dispatchResult(int, O!);
+ method @MainThread public abstract <I, O> void onLaunch(int, androidx.activity.result.contract.ActivityResultContract<I!,O!>, I!, androidx.core.app.ActivityOptionsCompat?);
+ method public final void onRestoreInstanceState(android.os.Bundle?);
+ method public final void onSaveInstanceState(android.os.Bundle);
+ method public final <I, O> androidx.activity.result.ActivityResultLauncher<I!> register(String, androidx.lifecycle.LifecycleOwner, androidx.activity.result.contract.ActivityResultContract<I!,O!>, androidx.activity.result.ActivityResultCallback<O!>);
+ method public final <I, O> androidx.activity.result.ActivityResultLauncher<I!> register(String, androidx.activity.result.contract.ActivityResultContract<I!,O!>, androidx.activity.result.ActivityResultCallback<O!>);
+ }
+
+ public interface ActivityResultRegistryOwner {
+ method public androidx.activity.result.ActivityResultRegistry getActivityResultRegistry();
+ }
+
+ public final class IntentSenderRequest implements android.os.Parcelable {
+ method public int describeContents();
+ method public android.content.Intent? getFillInIntent();
+ method public int getFlagsMask();
+ method public int getFlagsValues();
+ method public android.content.IntentSender getIntentSender();
+ method public void writeToParcel(android.os.Parcel, int);
+ field public static final android.os.Parcelable.Creator<androidx.activity.result.IntentSenderRequest!> CREATOR;
+ }
+
+ public static final class IntentSenderRequest.Builder {
+ ctor public IntentSenderRequest.Builder(android.content.IntentSender);
+ ctor public IntentSenderRequest.Builder(android.app.PendingIntent);
+ method public androidx.activity.result.IntentSenderRequest build();
+ method public androidx.activity.result.IntentSenderRequest.Builder setFillInIntent(android.content.Intent?);
+ method public androidx.activity.result.IntentSenderRequest.Builder setFlags(int, int);
+ }
+
+}
+
+package androidx.activity.result.contract {
+
+ public abstract class ActivityResultContract<I, O> {
+ ctor public ActivityResultContract();
+ method public abstract android.content.Intent createIntent(android.content.Context context, I? input);
+ method public androidx.activity.result.contract.ActivityResultContract.SynchronousResult<O>? getSynchronousResult(android.content.Context context, I? input);
+ method public abstract O! parseResult(int resultCode, android.content.Intent? intent);
+ }
+
+ public static final class ActivityResultContract.SynchronousResult<T> {
+ ctor public ActivityResultContract.SynchronousResult(T? value);
+ method public T! getValue();
+ property public final T! value;
+ }
+
+ public final class ActivityResultContracts {
+ }
+
+ public static class ActivityResultContracts.CaptureVideo extends androidx.activity.result.contract.ActivityResultContract<android.net.Uri,java.lang.Boolean> {
+ ctor public ActivityResultContracts.CaptureVideo();
+ method @CallSuper public android.content.Intent createIntent(android.content.Context context, android.net.Uri input);
+ method public final androidx.activity.result.contract.ActivityResultContract.SynchronousResult<java.lang.Boolean>? getSynchronousResult(android.content.Context context, android.net.Uri input);
+ method public final Boolean parseResult(int resultCode, android.content.Intent? intent);
+ }
+
+ @RequiresApi(19) public static class ActivityResultContracts.CreateDocument extends androidx.activity.result.contract.ActivityResultContract<java.lang.String,android.net.Uri> {
+ ctor public ActivityResultContracts.CreateDocument();
+ method @CallSuper public android.content.Intent createIntent(android.content.Context context, String input);
+ method public final androidx.activity.result.contract.ActivityResultContract.SynchronousResult<android.net.Uri>? getSynchronousResult(android.content.Context context, String input);
+ method public final android.net.Uri? parseResult(int resultCode, android.content.Intent? intent);
+ }
+
+ public static class ActivityResultContracts.GetContent extends androidx.activity.result.contract.ActivityResultContract<java.lang.String,android.net.Uri> {
+ ctor public ActivityResultContracts.GetContent();
+ method @CallSuper public android.content.Intent createIntent(android.content.Context context, String input);
+ method public final androidx.activity.result.contract.ActivityResultContract.SynchronousResult<android.net.Uri>? getSynchronousResult(android.content.Context context, String input);
+ method public final android.net.Uri? parseResult(int resultCode, android.content.Intent? intent);
+ }
+
+ @RequiresApi(18) public static class ActivityResultContracts.GetMultipleContents extends androidx.activity.result.contract.ActivityResultContract<java.lang.String,java.util.List<android.net.Uri>> {
+ ctor public ActivityResultContracts.GetMultipleContents();
+ method @CallSuper public android.content.Intent createIntent(android.content.Context context, String input);
+ method public final androidx.activity.result.contract.ActivityResultContract.SynchronousResult<java.util.List<android.net.Uri>>? getSynchronousResult(android.content.Context context, String input);
+ method public final java.util.List<android.net.Uri> parseResult(int resultCode, android.content.Intent? intent);
+ }
+
+ @RequiresApi(19) public static class ActivityResultContracts.OpenDocument extends androidx.activity.result.contract.ActivityResultContract<java.lang.String[],android.net.Uri> {
+ ctor public ActivityResultContracts.OpenDocument();
+ method @CallSuper public android.content.Intent createIntent(android.content.Context context, String![] input);
+ method public final androidx.activity.result.contract.ActivityResultContract.SynchronousResult<android.net.Uri>? getSynchronousResult(android.content.Context context, String![] input);
+ method public final android.net.Uri? parseResult(int resultCode, android.content.Intent? intent);
+ }
+
+ @RequiresApi(21) public static class ActivityResultContracts.OpenDocumentTree extends androidx.activity.result.contract.ActivityResultContract<android.net.Uri,android.net.Uri> {
+ ctor public ActivityResultContracts.OpenDocumentTree();
+ method @CallSuper public android.content.Intent createIntent(android.content.Context context, android.net.Uri? input);
+ method public final androidx.activity.result.contract.ActivityResultContract.SynchronousResult<android.net.Uri>? getSynchronousResult(android.content.Context context, android.net.Uri? input);
+ method public final android.net.Uri? parseResult(int resultCode, android.content.Intent? intent);
+ }
+
+ @RequiresApi(19) public static class ActivityResultContracts.OpenMultipleDocuments extends androidx.activity.result.contract.ActivityResultContract<java.lang.String[],java.util.List<android.net.Uri>> {
+ ctor public ActivityResultContracts.OpenMultipleDocuments();
+ method @CallSuper public android.content.Intent createIntent(android.content.Context context, String![] input);
+ method public final androidx.activity.result.contract.ActivityResultContract.SynchronousResult<java.util.List<android.net.Uri>>? getSynchronousResult(android.content.Context context, String![] input);
+ method public final java.util.List<android.net.Uri> parseResult(int resultCode, android.content.Intent? intent);
+ }
+
+ public static final class ActivityResultContracts.PickContact extends androidx.activity.result.contract.ActivityResultContract<java.lang.Void,android.net.Uri> {
+ ctor public ActivityResultContracts.PickContact();
+ method public android.content.Intent createIntent(android.content.Context context, Void? input);
+ method public android.net.Uri? parseResult(int resultCode, android.content.Intent? intent);
+ }
+
+ public static final class ActivityResultContracts.RequestMultiplePermissions extends androidx.activity.result.contract.ActivityResultContract<java.lang.String[],java.util.Map<java.lang.String,java.lang.Boolean>> {
+ ctor public ActivityResultContracts.RequestMultiplePermissions();
+ method public android.content.Intent createIntent(android.content.Context context, String![] input);
+ method public androidx.activity.result.contract.ActivityResultContract.SynchronousResult<java.util.Map<java.lang.String,java.lang.Boolean>>? getSynchronousResult(android.content.Context context, String![] input);
+ method public java.util.Map<java.lang.String,java.lang.Boolean> parseResult(int resultCode, android.content.Intent? intent);
+ field public static final String ACTION_REQUEST_PERMISSIONS = "androidx.activity.result.contract.action.REQUEST_PERMISSIONS";
+ field public static final String EXTRA_PERMISSIONS = "androidx.activity.result.contract.extra.PERMISSIONS";
+ field public static final String EXTRA_PERMISSION_GRANT_RESULTS = "androidx.activity.result.contract.extra.PERMISSION_GRANT_RESULTS";
+ }
+
+ public static final class ActivityResultContracts.RequestPermission extends androidx.activity.result.contract.ActivityResultContract<java.lang.String,java.lang.Boolean> {
+ ctor public ActivityResultContracts.RequestPermission();
+ method public android.content.Intent createIntent(android.content.Context context, String input);
+ method public androidx.activity.result.contract.ActivityResultContract.SynchronousResult<java.lang.Boolean>? getSynchronousResult(android.content.Context context, String input);
+ method public Boolean parseResult(int resultCode, android.content.Intent? intent);
+ }
+
+ public static final class ActivityResultContracts.StartActivityForResult extends androidx.activity.result.contract.ActivityResultContract<android.content.Intent,androidx.activity.result.ActivityResult> {
+ ctor public ActivityResultContracts.StartActivityForResult();
+ method public android.content.Intent createIntent(android.content.Context context, android.content.Intent input);
+ method public androidx.activity.result.ActivityResult parseResult(int resultCode, android.content.Intent? intent);
+ field public static final String EXTRA_ACTIVITY_OPTIONS_BUNDLE = "androidx.activity.result.contract.extra.ACTIVITY_OPTIONS_BUNDLE";
+ }
+
+ public static final class ActivityResultContracts.StartIntentSenderForResult extends androidx.activity.result.contract.ActivityResultContract<androidx.activity.result.IntentSenderRequest,androidx.activity.result.ActivityResult> {
+ ctor public ActivityResultContracts.StartIntentSenderForResult();
+ method public android.content.Intent createIntent(android.content.Context context, androidx.activity.result.IntentSenderRequest input);
+ method public androidx.activity.result.ActivityResult parseResult(int resultCode, android.content.Intent? intent);
+ field public static final String ACTION_INTENT_SENDER_REQUEST = "androidx.activity.result.contract.action.INTENT_SENDER_REQUEST";
+ field public static final String EXTRA_INTENT_SENDER_REQUEST = "androidx.activity.result.contract.extra.INTENT_SENDER_REQUEST";
+ field public static final String EXTRA_SEND_INTENT_EXCEPTION = "androidx.activity.result.contract.extra.SEND_INTENT_EXCEPTION";
+ }
+
+ public static class ActivityResultContracts.TakePicture extends androidx.activity.result.contract.ActivityResultContract<android.net.Uri,java.lang.Boolean> {
+ ctor public ActivityResultContracts.TakePicture();
+ method @CallSuper public android.content.Intent createIntent(android.content.Context context, android.net.Uri input);
+ method public final androidx.activity.result.contract.ActivityResultContract.SynchronousResult<java.lang.Boolean>? getSynchronousResult(android.content.Context context, android.net.Uri input);
+ method public final Boolean parseResult(int resultCode, android.content.Intent? intent);
+ }
+
+ public static class ActivityResultContracts.TakePicturePreview extends androidx.activity.result.contract.ActivityResultContract<java.lang.Void,android.graphics.Bitmap> {
+ ctor public ActivityResultContracts.TakePicturePreview();
+ method @CallSuper public android.content.Intent createIntent(android.content.Context context, Void? input);
+ method public final androidx.activity.result.contract.ActivityResultContract.SynchronousResult<android.graphics.Bitmap>? getSynchronousResult(android.content.Context context, Void? input);
+ method public final android.graphics.Bitmap? parseResult(int resultCode, android.content.Intent? intent);
+ }
+
+ @Deprecated public static class ActivityResultContracts.TakeVideo extends androidx.activity.result.contract.ActivityResultContract<android.net.Uri,android.graphics.Bitmap> {
+ ctor @Deprecated public ActivityResultContracts.TakeVideo();
+ method @Deprecated @CallSuper public android.content.Intent createIntent(android.content.Context context, android.net.Uri input);
+ method @Deprecated public final androidx.activity.result.contract.ActivityResultContract.SynchronousResult<android.graphics.Bitmap>? getSynchronousResult(android.content.Context context, android.net.Uri input);
+ method @Deprecated public final android.graphics.Bitmap? parseResult(int resultCode, android.content.Intent? intent);
+ }
+
+}
+
diff --git a/activity/activity/api/restricted_current.txt b/activity/activity/api/restricted_current.txt
index 8b5de84..0ce24f9 100644
--- a/activity/activity/api/restricted_current.txt
+++ b/activity/activity/api/restricted_current.txt
@@ -179,7 +179,7 @@
method public final android.net.Uri? parseResult(int resultCode, android.content.Intent? intent);
}
- @RequiresApi(18) public static class ActivityResultContracts.GetMultipleContents extends androidx.activity.result.contract.ActivityResultContract<java.lang.String,java.util.List<? extends android.net.Uri>> {
+ @RequiresApi(18) public static class ActivityResultContracts.GetMultipleContents extends androidx.activity.result.contract.ActivityResultContract<java.lang.String,java.util.List<android.net.Uri>> {
ctor public ActivityResultContracts.GetMultipleContents();
method @CallSuper public android.content.Intent createIntent(android.content.Context context, String input);
method public final androidx.activity.result.contract.ActivityResultContract.SynchronousResult<java.util.List<android.net.Uri>>? getSynchronousResult(android.content.Context context, String input);
@@ -200,7 +200,7 @@
method public final android.net.Uri? parseResult(int resultCode, android.content.Intent? intent);
}
- @RequiresApi(19) public static class ActivityResultContracts.OpenMultipleDocuments extends androidx.activity.result.contract.ActivityResultContract<java.lang.String[],java.util.List<? extends android.net.Uri>> {
+ @RequiresApi(19) public static class ActivityResultContracts.OpenMultipleDocuments extends androidx.activity.result.contract.ActivityResultContract<java.lang.String[],java.util.List<android.net.Uri>> {
ctor public ActivityResultContracts.OpenMultipleDocuments();
method @CallSuper public android.content.Intent createIntent(android.content.Context context, String![] input);
method public final androidx.activity.result.contract.ActivityResultContract.SynchronousResult<java.util.List<android.net.Uri>>? getSynchronousResult(android.content.Context context, String![] input);
diff --git a/activity/activity/src/main/java/androidx/activity/result/contract/ActivityResultContracts.kt b/activity/activity/src/main/java/androidx/activity/result/contract/ActivityResultContracts.kt
index 49fbd7c..22053db 100644
--- a/activity/activity/src/main/java/androidx/activity/result/contract/ActivityResultContracts.kt
+++ b/activity/activity/src/main/java/androidx/activity/result/contract/ActivityResultContracts.kt
@@ -411,7 +411,8 @@
* extras to the Intent created by `super.createIntent()`.
*/
@RequiresApi(18)
- open class GetMultipleContents : ActivityResultContract<String, List<Uri>>() {
+ open class GetMultipleContents :
+ ActivityResultContract<String, List<@JvmSuppressWildcards Uri>>() {
@CallSuper
override fun createIntent(context: Context, input: String): Intent {
return Intent(Intent.ACTION_GET_CONTENT)
@@ -498,7 +499,8 @@
* @see DocumentsContract
*/
@RequiresApi(19)
- open class OpenMultipleDocuments : ActivityResultContract<Array<String>, List<Uri>>() {
+ open class OpenMultipleDocuments :
+ ActivityResultContract<Array<String>, List<@JvmSuppressWildcards Uri>>() {
@CallSuper
override fun createIntent(context: Context, input: Array<String>): Intent {
return Intent(Intent.ACTION_OPEN_DOCUMENT)
diff --git a/ads/ads-identifier/api/api_lint.ignore b/ads/ads-identifier/api/api_lint.ignore
new file mode 100644
index 0000000..a514159
--- /dev/null
+++ b/ads/ads-identifier/api/api_lint.ignore
@@ -0,0 +1,3 @@
+// Baseline format: 1.0
+AsyncSuffixFuture: androidx.ads.identifier.AdvertisingIdClient#getAdvertisingIdInfo(android.content.Context):
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
diff --git a/annotation/annotation-experimental/api/current.txt b/annotation/annotation-experimental/api/current.txt
index 84b72b3..30082f6 100644
--- a/annotation/annotation-experimental/api/current.txt
+++ b/annotation/annotation-experimental/api/current.txt
@@ -7,7 +7,7 @@
}
@kotlin.annotation.Retention(kotlin.annotation.AnnotationRetention) @kotlin.annotation.Target(allowedTargets=kotlin.annotation.AnnotationTarget) public @interface RequiresOptIn {
- method public abstract androidx.annotation.RequiresOptIn.Level level();
+ method public abstract androidx.annotation.RequiresOptIn.Level level() default androidx.annotation.RequiresOptIn.Level.ERROR;
property public abstract androidx.annotation.RequiresOptIn.Level level;
}
@@ -21,7 +21,7 @@
package androidx.annotation.experimental {
@Deprecated @kotlin.annotation.Retention(kotlin.annotation.AnnotationRetention) @kotlin.annotation.Target(allowedTargets=kotlin.annotation.AnnotationTarget) public @interface Experimental {
- method @Deprecated public abstract androidx.annotation.experimental.Experimental.Level level();
+ method @Deprecated public abstract androidx.annotation.experimental.Experimental.Level level() default androidx.annotation.experimental.Experimental.Level.ERROR;
property public abstract androidx.annotation.experimental.Experimental.Level level;
}
diff --git a/annotation/annotation-experimental/api/public_plus_experimental_current.txt b/annotation/annotation-experimental/api/public_plus_experimental_current.txt
index 84b72b3..30082f6 100644
--- a/annotation/annotation-experimental/api/public_plus_experimental_current.txt
+++ b/annotation/annotation-experimental/api/public_plus_experimental_current.txt
@@ -7,7 +7,7 @@
}
@kotlin.annotation.Retention(kotlin.annotation.AnnotationRetention) @kotlin.annotation.Target(allowedTargets=kotlin.annotation.AnnotationTarget) public @interface RequiresOptIn {
- method public abstract androidx.annotation.RequiresOptIn.Level level();
+ method public abstract androidx.annotation.RequiresOptIn.Level level() default androidx.annotation.RequiresOptIn.Level.ERROR;
property public abstract androidx.annotation.RequiresOptIn.Level level;
}
@@ -21,7 +21,7 @@
package androidx.annotation.experimental {
@Deprecated @kotlin.annotation.Retention(kotlin.annotation.AnnotationRetention) @kotlin.annotation.Target(allowedTargets=kotlin.annotation.AnnotationTarget) public @interface Experimental {
- method @Deprecated public abstract androidx.annotation.experimental.Experimental.Level level();
+ method @Deprecated public abstract androidx.annotation.experimental.Experimental.Level level() default androidx.annotation.experimental.Experimental.Level.ERROR;
property public abstract androidx.annotation.experimental.Experimental.Level level;
}
diff --git a/annotation/annotation-experimental/api/restricted_current.txt b/annotation/annotation-experimental/api/restricted_current.txt
index 84b72b3..30082f6 100644
--- a/annotation/annotation-experimental/api/restricted_current.txt
+++ b/annotation/annotation-experimental/api/restricted_current.txt
@@ -7,7 +7,7 @@
}
@kotlin.annotation.Retention(kotlin.annotation.AnnotationRetention) @kotlin.annotation.Target(allowedTargets=kotlin.annotation.AnnotationTarget) public @interface RequiresOptIn {
- method public abstract androidx.annotation.RequiresOptIn.Level level();
+ method public abstract androidx.annotation.RequiresOptIn.Level level() default androidx.annotation.RequiresOptIn.Level.ERROR;
property public abstract androidx.annotation.RequiresOptIn.Level level;
}
@@ -21,7 +21,7 @@
package androidx.annotation.experimental {
@Deprecated @kotlin.annotation.Retention(kotlin.annotation.AnnotationRetention) @kotlin.annotation.Target(allowedTargets=kotlin.annotation.AnnotationTarget) public @interface Experimental {
- method @Deprecated public abstract androidx.annotation.experimental.Experimental.Level level();
+ method @Deprecated public abstract androidx.annotation.experimental.Experimental.Level level() default androidx.annotation.experimental.Experimental.Level.ERROR;
property public abstract androidx.annotation.experimental.Experimental.Level level;
}
diff --git a/annotation/annotation/api/1.3.0-beta01.txt b/annotation/annotation/api/1.3.0-beta01.txt
new file mode 100644
index 0000000..263ed26
--- /dev/null
+++ b/annotation/annotation/api/1.3.0-beta01.txt
@@ -0,0 +1,272 @@
+// Signature format: 4.0
+package androidx.annotation {
+
+ @java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.PARAMETER, java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.LOCAL_VARIABLE}) public @interface AnimRes {
+ }
+
+ @java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.PARAMETER, java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.LOCAL_VARIABLE}) public @interface AnimatorRes {
+ }
+
+ @java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.PARAMETER, java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.LOCAL_VARIABLE}) public @interface AnyRes {
+ }
+
+ @java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.CONSTRUCTOR, java.lang.annotation.ElementType.TYPE, java.lang.annotation.ElementType.PARAMETER}) public @interface AnyThread {
+ }
+
+ @java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.PARAMETER, java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.LOCAL_VARIABLE}) public @interface ArrayRes {
+ }
+
+ @java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.PARAMETER, java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.LOCAL_VARIABLE}) public @interface AttrRes {
+ }
+
+ @java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.CONSTRUCTOR, java.lang.annotation.ElementType.TYPE, java.lang.annotation.ElementType.PARAMETER}) public @interface BinderThread {
+ }
+
+ @java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.PARAMETER, java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.LOCAL_VARIABLE}) public @interface BoolRes {
+ }
+
+ @java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD}) public @interface CallSuper {
+ }
+
+ @java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD}) public @interface CheckResult {
+ method public abstract String suggest() default "";
+ }
+
+ @java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.FIELD}) public @interface ChecksSdkIntAtLeast {
+ method public abstract int api() default -1;
+ method public abstract String codename() default "";
+ method public abstract int lambda() default -1;
+ method public abstract int parameter() default -1;
+ }
+
+ @java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.PARAMETER, java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.LOCAL_VARIABLE, java.lang.annotation.ElementType.FIELD}) public @interface ColorInt {
+ }
+
+ @java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) @java.lang.annotation.Target({java.lang.annotation.ElementType.PARAMETER, java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.LOCAL_VARIABLE, java.lang.annotation.ElementType.FIELD}) public @interface ColorLong {
+ }
+
+ @java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.PARAMETER, java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.LOCAL_VARIABLE}) public @interface ColorRes {
+ }
+
+ @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.CONSTRUCTOR}) public @interface ContentView {
+ }
+
+ @java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.PARAMETER, java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.LOCAL_VARIABLE}) public @interface DimenRes {
+ }
+
+ @java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.PARAMETER, java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.LOCAL_VARIABLE, java.lang.annotation.ElementType.ANNOTATION_TYPE}) public @interface Dimension {
+ method @DimensionUnit public abstract int unit() default androidx.annotation.Dimension.PX;
+ field public static final int DP = 0; // 0x0
+ field public static final int PX = 1; // 0x1
+ field public static final int SP = 2; // 0x2
+ }
+
+ @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) @java.lang.annotation.Target({java.lang.annotation.ElementType.CONSTRUCTOR, java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.PARAMETER, java.lang.annotation.ElementType.TYPE}) public @interface Discouraged {
+ method public abstract String message();
+ }
+
+ @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) @java.lang.annotation.Target({java.lang.annotation.ElementType.TYPE, java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.PARAMETER, java.lang.annotation.ElementType.FIELD}) public @interface DisplayContext {
+ }
+
+ @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD}) public @interface DoNotInline {
+ }
+
+ @java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.PARAMETER, java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.LOCAL_VARIABLE}) public @interface DrawableRes {
+ }
+
+ @java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.PARAMETER, java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.LOCAL_VARIABLE, java.lang.annotation.ElementType.ANNOTATION_TYPE}) public @interface FloatRange {
+ method public abstract double from() default java.lang.Double.NEGATIVE_INFINITY;
+ method public abstract boolean fromInclusive() default true;
+ method public abstract double to() default java.lang.Double.POSITIVE_INFINITY;
+ method public abstract boolean toInclusive() default true;
+ }
+
+ @java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.PARAMETER, java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.LOCAL_VARIABLE}) public @interface FontRes {
+ }
+
+ @java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.PARAMETER, java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.LOCAL_VARIABLE}) public @interface FractionRes {
+ }
+
+ @java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.PARAMETER, java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.LOCAL_VARIABLE, java.lang.annotation.ElementType.FIELD}) public @interface GravityInt {
+ }
+
+ @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.METHOD}) public @interface GuardedBy {
+ method public abstract String value();
+ }
+
+ @java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) @java.lang.annotation.Target({java.lang.annotation.ElementType.PARAMETER, java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.LOCAL_VARIABLE, java.lang.annotation.ElementType.FIELD}) public @interface HalfFloat {
+ }
+
+ @java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.PARAMETER, java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.LOCAL_VARIABLE}) public @interface IdRes {
+ }
+
+ @Deprecated @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD}) public @interface InspectableProperty {
+ method @Deprecated public abstract int attributeId() default 0;
+ method @Deprecated public abstract androidx.annotation.InspectableProperty.EnumEntry[] enumMapping() default {};
+ method @Deprecated public abstract androidx.annotation.InspectableProperty.FlagEntry[] flagMapping() default {};
+ method @Deprecated public abstract boolean hasAttributeId() default true;
+ method @Deprecated public abstract String name() default "";
+ method @Deprecated public abstract androidx.annotation.InspectableProperty.ValueType valueType() default androidx.annotation.InspectableProperty.ValueType.INFERRED;
+ }
+
+ @Deprecated @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) @java.lang.annotation.Target({java.lang.annotation.ElementType.TYPE}) public static @interface InspectableProperty.EnumEntry {
+ method @Deprecated public abstract String name();
+ method @Deprecated public abstract int value();
+ }
+
+ @Deprecated @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) @java.lang.annotation.Target({java.lang.annotation.ElementType.TYPE}) public static @interface InspectableProperty.FlagEntry {
+ method @Deprecated public abstract int mask() default 0;
+ method @Deprecated public abstract String name();
+ method @Deprecated public abstract int target();
+ }
+
+ @Deprecated public enum InspectableProperty.ValueType {
+ enum_constant @Deprecated public static final androidx.annotation.InspectableProperty.ValueType COLOR;
+ enum_constant @Deprecated public static final androidx.annotation.InspectableProperty.ValueType GRAVITY;
+ enum_constant @Deprecated public static final androidx.annotation.InspectableProperty.ValueType INFERRED;
+ enum_constant @Deprecated public static final androidx.annotation.InspectableProperty.ValueType INT_ENUM;
+ enum_constant @Deprecated public static final androidx.annotation.InspectableProperty.ValueType INT_FLAG;
+ enum_constant @Deprecated public static final androidx.annotation.InspectableProperty.ValueType NONE;
+ enum_constant @Deprecated public static final androidx.annotation.InspectableProperty.ValueType RESOURCE_ID;
+ }
+
+ @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) @java.lang.annotation.Target({java.lang.annotation.ElementType.ANNOTATION_TYPE}) public @interface IntDef {
+ method public abstract boolean flag() default false;
+ method public abstract boolean open() default false;
+ method public abstract int[] value() default {};
+ }
+
+ @java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.PARAMETER, java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.LOCAL_VARIABLE, java.lang.annotation.ElementType.ANNOTATION_TYPE}) public @interface IntRange {
+ method public abstract long from() default java.lang.Long.MIN_VALUE;
+ method public abstract long to() default java.lang.Long.MAX_VALUE;
+ }
+
+ @java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.PARAMETER, java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.LOCAL_VARIABLE}) public @interface IntegerRes {
+ }
+
+ @java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.PARAMETER, java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.LOCAL_VARIABLE}) public @interface InterpolatorRes {
+ }
+
+ @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.PACKAGE, java.lang.annotation.ElementType.TYPE, java.lang.annotation.ElementType.ANNOTATION_TYPE, java.lang.annotation.ElementType.CONSTRUCTOR, java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.FIELD}) public @interface Keep {
+ }
+
+ @java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.PARAMETER, java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.LOCAL_VARIABLE}) public @interface LayoutRes {
+ }
+
+ @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) @java.lang.annotation.Target({java.lang.annotation.ElementType.ANNOTATION_TYPE}) public @interface LongDef {
+ method public abstract boolean flag() default false;
+ method public abstract boolean open() default false;
+ method public abstract long[] value() default {};
+ }
+
+ @java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.CONSTRUCTOR, java.lang.annotation.ElementType.TYPE, java.lang.annotation.ElementType.PARAMETER}) public @interface MainThread {
+ }
+
+ @java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.PARAMETER, java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.LOCAL_VARIABLE}) public @interface MenuRes {
+ }
+
+ @java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.PARAMETER, java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.LOCAL_VARIABLE}) public @interface NavigationRes {
+ }
+
+ @java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.PARAMETER, java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.LOCAL_VARIABLE, java.lang.annotation.ElementType.ANNOTATION_TYPE, java.lang.annotation.ElementType.PACKAGE}) public @interface NonNull {
+ }
+
+ @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) @java.lang.annotation.Target({java.lang.annotation.ElementType.TYPE, java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.PARAMETER, java.lang.annotation.ElementType.FIELD}) public @interface NonUiContext {
+ }
+
+ @java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.PARAMETER, java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.LOCAL_VARIABLE, java.lang.annotation.ElementType.ANNOTATION_TYPE, java.lang.annotation.ElementType.PACKAGE}) public @interface Nullable {
+ }
+
+ @java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.PARAMETER, java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.LOCAL_VARIABLE}) public @interface PluralsRes {
+ }
+
+ @Dimension(unit=androidx.annotation.Dimension.PX) @java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.PARAMETER, java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.LOCAL_VARIABLE}) public @interface Px {
+ }
+
+ @java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.PARAMETER, java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.LOCAL_VARIABLE}) public @interface RawRes {
+ }
+
+ @java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.TYPE, java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.CONSTRUCTOR, java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.PACKAGE}) public @interface RequiresApi {
+ method @IntRange(from=1) public abstract int api() default 1;
+ method @IntRange(from=1) public abstract int value() default 1;
+ }
+
+ @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) @java.lang.annotation.Target({java.lang.annotation.ElementType.TYPE, java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.CONSTRUCTOR}) public @interface RequiresFeature {
+ method public abstract String enforcement();
+ method public abstract String name();
+ }
+
+ @java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.ANNOTATION_TYPE, java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.CONSTRUCTOR, java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.PARAMETER}) public @interface RequiresPermission {
+ method public abstract String[] allOf() default {};
+ method public abstract String[] anyOf() default {};
+ method public abstract boolean conditional() default false;
+ method public abstract String value() default "";
+ }
+
+ @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.PARAMETER}) public static @interface RequiresPermission.Read {
+ method public abstract androidx.annotation.RequiresPermission value() default @androidx.annotation.RequiresPermission;
+ }
+
+ @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.PARAMETER}) public static @interface RequiresPermission.Write {
+ method public abstract androidx.annotation.RequiresPermission value() default @androidx.annotation.RequiresPermission;
+ }
+
+ @java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.ANNOTATION_TYPE, java.lang.annotation.ElementType.TYPE, java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.CONSTRUCTOR, java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.PACKAGE}) public @interface RestrictTo {
+ method public abstract androidx.annotation.RestrictTo.Scope[] value();
+ }
+
+ public enum RestrictTo.Scope {
+ enum_constant @Deprecated public static final androidx.annotation.RestrictTo.Scope GROUP_ID;
+ enum_constant public static final androidx.annotation.RestrictTo.Scope LIBRARY;
+ enum_constant public static final androidx.annotation.RestrictTo.Scope LIBRARY_GROUP;
+ enum_constant public static final androidx.annotation.RestrictTo.Scope LIBRARY_GROUP_PREFIX;
+ enum_constant public static final androidx.annotation.RestrictTo.Scope SUBCLASSES;
+ enum_constant public static final androidx.annotation.RestrictTo.Scope TESTS;
+ }
+
+ @java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.PARAMETER, java.lang.annotation.ElementType.LOCAL_VARIABLE, java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.ANNOTATION_TYPE}) public @interface Size {
+ method public abstract long max() default java.lang.Long.MAX_VALUE;
+ method public abstract long min() default java.lang.Long.MIN_VALUE;
+ method public abstract long multiple() default 1;
+ method public abstract long value() default -1;
+ }
+
+ @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) @java.lang.annotation.Target({java.lang.annotation.ElementType.ANNOTATION_TYPE}) public @interface StringDef {
+ method public abstract boolean open() default false;
+ method public abstract String[] value() default {};
+ }
+
+ @java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.PARAMETER, java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.LOCAL_VARIABLE}) public @interface StringRes {
+ }
+
+ @java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.PARAMETER, java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.LOCAL_VARIABLE}) public @interface StyleRes {
+ }
+
+ @java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.PARAMETER, java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.LOCAL_VARIABLE}) public @interface StyleableRes {
+ }
+
+ @java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.PARAMETER, java.lang.annotation.ElementType.FIELD}) public @interface TransitionRes {
+ }
+
+ @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) @java.lang.annotation.Target({java.lang.annotation.ElementType.TYPE, java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.PARAMETER, java.lang.annotation.ElementType.FIELD}) public @interface UiContext {
+ }
+
+ @java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.CONSTRUCTOR, java.lang.annotation.ElementType.TYPE, java.lang.annotation.ElementType.PARAMETER}) public @interface UiThread {
+ }
+
+ @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) public @interface VisibleForTesting {
+ method @ProductionVisibility public abstract int otherwise() default androidx.annotation.VisibleForTesting.PRIVATE;
+ field public static final int NONE = 5; // 0x5
+ field public static final int PACKAGE_PRIVATE = 3; // 0x3
+ field public static final int PRIVATE = 2; // 0x2
+ field public static final int PROTECTED = 4; // 0x4
+ }
+
+ @java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.CONSTRUCTOR, java.lang.annotation.ElementType.TYPE, java.lang.annotation.ElementType.PARAMETER}) public @interface WorkerThread {
+ }
+
+ @java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.PARAMETER, java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.LOCAL_VARIABLE}) public @interface XmlRes {
+ }
+
+}
+
diff --git a/annotation/annotation/api/public_plus_experimental_1.3.0-beta01.txt b/annotation/annotation/api/public_plus_experimental_1.3.0-beta01.txt
new file mode 100644
index 0000000..263ed26
--- /dev/null
+++ b/annotation/annotation/api/public_plus_experimental_1.3.0-beta01.txt
@@ -0,0 +1,272 @@
+// Signature format: 4.0
+package androidx.annotation {
+
+ @java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.PARAMETER, java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.LOCAL_VARIABLE}) public @interface AnimRes {
+ }
+
+ @java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.PARAMETER, java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.LOCAL_VARIABLE}) public @interface AnimatorRes {
+ }
+
+ @java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.PARAMETER, java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.LOCAL_VARIABLE}) public @interface AnyRes {
+ }
+
+ @java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.CONSTRUCTOR, java.lang.annotation.ElementType.TYPE, java.lang.annotation.ElementType.PARAMETER}) public @interface AnyThread {
+ }
+
+ @java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.PARAMETER, java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.LOCAL_VARIABLE}) public @interface ArrayRes {
+ }
+
+ @java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.PARAMETER, java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.LOCAL_VARIABLE}) public @interface AttrRes {
+ }
+
+ @java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.CONSTRUCTOR, java.lang.annotation.ElementType.TYPE, java.lang.annotation.ElementType.PARAMETER}) public @interface BinderThread {
+ }
+
+ @java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.PARAMETER, java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.LOCAL_VARIABLE}) public @interface BoolRes {
+ }
+
+ @java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD}) public @interface CallSuper {
+ }
+
+ @java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD}) public @interface CheckResult {
+ method public abstract String suggest() default "";
+ }
+
+ @java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.FIELD}) public @interface ChecksSdkIntAtLeast {
+ method public abstract int api() default -1;
+ method public abstract String codename() default "";
+ method public abstract int lambda() default -1;
+ method public abstract int parameter() default -1;
+ }
+
+ @java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.PARAMETER, java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.LOCAL_VARIABLE, java.lang.annotation.ElementType.FIELD}) public @interface ColorInt {
+ }
+
+ @java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) @java.lang.annotation.Target({java.lang.annotation.ElementType.PARAMETER, java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.LOCAL_VARIABLE, java.lang.annotation.ElementType.FIELD}) public @interface ColorLong {
+ }
+
+ @java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.PARAMETER, java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.LOCAL_VARIABLE}) public @interface ColorRes {
+ }
+
+ @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.CONSTRUCTOR}) public @interface ContentView {
+ }
+
+ @java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.PARAMETER, java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.LOCAL_VARIABLE}) public @interface DimenRes {
+ }
+
+ @java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.PARAMETER, java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.LOCAL_VARIABLE, java.lang.annotation.ElementType.ANNOTATION_TYPE}) public @interface Dimension {
+ method @DimensionUnit public abstract int unit() default androidx.annotation.Dimension.PX;
+ field public static final int DP = 0; // 0x0
+ field public static final int PX = 1; // 0x1
+ field public static final int SP = 2; // 0x2
+ }
+
+ @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) @java.lang.annotation.Target({java.lang.annotation.ElementType.CONSTRUCTOR, java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.PARAMETER, java.lang.annotation.ElementType.TYPE}) public @interface Discouraged {
+ method public abstract String message();
+ }
+
+ @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) @java.lang.annotation.Target({java.lang.annotation.ElementType.TYPE, java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.PARAMETER, java.lang.annotation.ElementType.FIELD}) public @interface DisplayContext {
+ }
+
+ @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD}) public @interface DoNotInline {
+ }
+
+ @java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.PARAMETER, java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.LOCAL_VARIABLE}) public @interface DrawableRes {
+ }
+
+ @java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.PARAMETER, java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.LOCAL_VARIABLE, java.lang.annotation.ElementType.ANNOTATION_TYPE}) public @interface FloatRange {
+ method public abstract double from() default java.lang.Double.NEGATIVE_INFINITY;
+ method public abstract boolean fromInclusive() default true;
+ method public abstract double to() default java.lang.Double.POSITIVE_INFINITY;
+ method public abstract boolean toInclusive() default true;
+ }
+
+ @java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.PARAMETER, java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.LOCAL_VARIABLE}) public @interface FontRes {
+ }
+
+ @java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.PARAMETER, java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.LOCAL_VARIABLE}) public @interface FractionRes {
+ }
+
+ @java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.PARAMETER, java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.LOCAL_VARIABLE, java.lang.annotation.ElementType.FIELD}) public @interface GravityInt {
+ }
+
+ @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.METHOD}) public @interface GuardedBy {
+ method public abstract String value();
+ }
+
+ @java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) @java.lang.annotation.Target({java.lang.annotation.ElementType.PARAMETER, java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.LOCAL_VARIABLE, java.lang.annotation.ElementType.FIELD}) public @interface HalfFloat {
+ }
+
+ @java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.PARAMETER, java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.LOCAL_VARIABLE}) public @interface IdRes {
+ }
+
+ @Deprecated @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD}) public @interface InspectableProperty {
+ method @Deprecated public abstract int attributeId() default 0;
+ method @Deprecated public abstract androidx.annotation.InspectableProperty.EnumEntry[] enumMapping() default {};
+ method @Deprecated public abstract androidx.annotation.InspectableProperty.FlagEntry[] flagMapping() default {};
+ method @Deprecated public abstract boolean hasAttributeId() default true;
+ method @Deprecated public abstract String name() default "";
+ method @Deprecated public abstract androidx.annotation.InspectableProperty.ValueType valueType() default androidx.annotation.InspectableProperty.ValueType.INFERRED;
+ }
+
+ @Deprecated @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) @java.lang.annotation.Target({java.lang.annotation.ElementType.TYPE}) public static @interface InspectableProperty.EnumEntry {
+ method @Deprecated public abstract String name();
+ method @Deprecated public abstract int value();
+ }
+
+ @Deprecated @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) @java.lang.annotation.Target({java.lang.annotation.ElementType.TYPE}) public static @interface InspectableProperty.FlagEntry {
+ method @Deprecated public abstract int mask() default 0;
+ method @Deprecated public abstract String name();
+ method @Deprecated public abstract int target();
+ }
+
+ @Deprecated public enum InspectableProperty.ValueType {
+ enum_constant @Deprecated public static final androidx.annotation.InspectableProperty.ValueType COLOR;
+ enum_constant @Deprecated public static final androidx.annotation.InspectableProperty.ValueType GRAVITY;
+ enum_constant @Deprecated public static final androidx.annotation.InspectableProperty.ValueType INFERRED;
+ enum_constant @Deprecated public static final androidx.annotation.InspectableProperty.ValueType INT_ENUM;
+ enum_constant @Deprecated public static final androidx.annotation.InspectableProperty.ValueType INT_FLAG;
+ enum_constant @Deprecated public static final androidx.annotation.InspectableProperty.ValueType NONE;
+ enum_constant @Deprecated public static final androidx.annotation.InspectableProperty.ValueType RESOURCE_ID;
+ }
+
+ @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) @java.lang.annotation.Target({java.lang.annotation.ElementType.ANNOTATION_TYPE}) public @interface IntDef {
+ method public abstract boolean flag() default false;
+ method public abstract boolean open() default false;
+ method public abstract int[] value() default {};
+ }
+
+ @java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.PARAMETER, java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.LOCAL_VARIABLE, java.lang.annotation.ElementType.ANNOTATION_TYPE}) public @interface IntRange {
+ method public abstract long from() default java.lang.Long.MIN_VALUE;
+ method public abstract long to() default java.lang.Long.MAX_VALUE;
+ }
+
+ @java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.PARAMETER, java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.LOCAL_VARIABLE}) public @interface IntegerRes {
+ }
+
+ @java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.PARAMETER, java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.LOCAL_VARIABLE}) public @interface InterpolatorRes {
+ }
+
+ @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.PACKAGE, java.lang.annotation.ElementType.TYPE, java.lang.annotation.ElementType.ANNOTATION_TYPE, java.lang.annotation.ElementType.CONSTRUCTOR, java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.FIELD}) public @interface Keep {
+ }
+
+ @java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.PARAMETER, java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.LOCAL_VARIABLE}) public @interface LayoutRes {
+ }
+
+ @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) @java.lang.annotation.Target({java.lang.annotation.ElementType.ANNOTATION_TYPE}) public @interface LongDef {
+ method public abstract boolean flag() default false;
+ method public abstract boolean open() default false;
+ method public abstract long[] value() default {};
+ }
+
+ @java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.CONSTRUCTOR, java.lang.annotation.ElementType.TYPE, java.lang.annotation.ElementType.PARAMETER}) public @interface MainThread {
+ }
+
+ @java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.PARAMETER, java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.LOCAL_VARIABLE}) public @interface MenuRes {
+ }
+
+ @java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.PARAMETER, java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.LOCAL_VARIABLE}) public @interface NavigationRes {
+ }
+
+ @java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.PARAMETER, java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.LOCAL_VARIABLE, java.lang.annotation.ElementType.ANNOTATION_TYPE, java.lang.annotation.ElementType.PACKAGE}) public @interface NonNull {
+ }
+
+ @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) @java.lang.annotation.Target({java.lang.annotation.ElementType.TYPE, java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.PARAMETER, java.lang.annotation.ElementType.FIELD}) public @interface NonUiContext {
+ }
+
+ @java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.PARAMETER, java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.LOCAL_VARIABLE, java.lang.annotation.ElementType.ANNOTATION_TYPE, java.lang.annotation.ElementType.PACKAGE}) public @interface Nullable {
+ }
+
+ @java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.PARAMETER, java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.LOCAL_VARIABLE}) public @interface PluralsRes {
+ }
+
+ @Dimension(unit=androidx.annotation.Dimension.PX) @java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.PARAMETER, java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.LOCAL_VARIABLE}) public @interface Px {
+ }
+
+ @java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.PARAMETER, java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.LOCAL_VARIABLE}) public @interface RawRes {
+ }
+
+ @java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.TYPE, java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.CONSTRUCTOR, java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.PACKAGE}) public @interface RequiresApi {
+ method @IntRange(from=1) public abstract int api() default 1;
+ method @IntRange(from=1) public abstract int value() default 1;
+ }
+
+ @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) @java.lang.annotation.Target({java.lang.annotation.ElementType.TYPE, java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.CONSTRUCTOR}) public @interface RequiresFeature {
+ method public abstract String enforcement();
+ method public abstract String name();
+ }
+
+ @java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.ANNOTATION_TYPE, java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.CONSTRUCTOR, java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.PARAMETER}) public @interface RequiresPermission {
+ method public abstract String[] allOf() default {};
+ method public abstract String[] anyOf() default {};
+ method public abstract boolean conditional() default false;
+ method public abstract String value() default "";
+ }
+
+ @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.PARAMETER}) public static @interface RequiresPermission.Read {
+ method public abstract androidx.annotation.RequiresPermission value() default @androidx.annotation.RequiresPermission;
+ }
+
+ @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.PARAMETER}) public static @interface RequiresPermission.Write {
+ method public abstract androidx.annotation.RequiresPermission value() default @androidx.annotation.RequiresPermission;
+ }
+
+ @java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.ANNOTATION_TYPE, java.lang.annotation.ElementType.TYPE, java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.CONSTRUCTOR, java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.PACKAGE}) public @interface RestrictTo {
+ method public abstract androidx.annotation.RestrictTo.Scope[] value();
+ }
+
+ public enum RestrictTo.Scope {
+ enum_constant @Deprecated public static final androidx.annotation.RestrictTo.Scope GROUP_ID;
+ enum_constant public static final androidx.annotation.RestrictTo.Scope LIBRARY;
+ enum_constant public static final androidx.annotation.RestrictTo.Scope LIBRARY_GROUP;
+ enum_constant public static final androidx.annotation.RestrictTo.Scope LIBRARY_GROUP_PREFIX;
+ enum_constant public static final androidx.annotation.RestrictTo.Scope SUBCLASSES;
+ enum_constant public static final androidx.annotation.RestrictTo.Scope TESTS;
+ }
+
+ @java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.PARAMETER, java.lang.annotation.ElementType.LOCAL_VARIABLE, java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.ANNOTATION_TYPE}) public @interface Size {
+ method public abstract long max() default java.lang.Long.MAX_VALUE;
+ method public abstract long min() default java.lang.Long.MIN_VALUE;
+ method public abstract long multiple() default 1;
+ method public abstract long value() default -1;
+ }
+
+ @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) @java.lang.annotation.Target({java.lang.annotation.ElementType.ANNOTATION_TYPE}) public @interface StringDef {
+ method public abstract boolean open() default false;
+ method public abstract String[] value() default {};
+ }
+
+ @java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.PARAMETER, java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.LOCAL_VARIABLE}) public @interface StringRes {
+ }
+
+ @java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.PARAMETER, java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.LOCAL_VARIABLE}) public @interface StyleRes {
+ }
+
+ @java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.PARAMETER, java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.LOCAL_VARIABLE}) public @interface StyleableRes {
+ }
+
+ @java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.PARAMETER, java.lang.annotation.ElementType.FIELD}) public @interface TransitionRes {
+ }
+
+ @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) @java.lang.annotation.Target({java.lang.annotation.ElementType.TYPE, java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.PARAMETER, java.lang.annotation.ElementType.FIELD}) public @interface UiContext {
+ }
+
+ @java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.CONSTRUCTOR, java.lang.annotation.ElementType.TYPE, java.lang.annotation.ElementType.PARAMETER}) public @interface UiThread {
+ }
+
+ @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) public @interface VisibleForTesting {
+ method @ProductionVisibility public abstract int otherwise() default androidx.annotation.VisibleForTesting.PRIVATE;
+ field public static final int NONE = 5; // 0x5
+ field public static final int PACKAGE_PRIVATE = 3; // 0x3
+ field public static final int PRIVATE = 2; // 0x2
+ field public static final int PROTECTED = 4; // 0x4
+ }
+
+ @java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.CONSTRUCTOR, java.lang.annotation.ElementType.TYPE, java.lang.annotation.ElementType.PARAMETER}) public @interface WorkerThread {
+ }
+
+ @java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.PARAMETER, java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.LOCAL_VARIABLE}) public @interface XmlRes {
+ }
+
+}
+
diff --git a/annotation/annotation/api/restricted_1.3.0-beta01.txt b/annotation/annotation/api/restricted_1.3.0-beta01.txt
new file mode 100644
index 0000000..263ed26
--- /dev/null
+++ b/annotation/annotation/api/restricted_1.3.0-beta01.txt
@@ -0,0 +1,272 @@
+// Signature format: 4.0
+package androidx.annotation {
+
+ @java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.PARAMETER, java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.LOCAL_VARIABLE}) public @interface AnimRes {
+ }
+
+ @java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.PARAMETER, java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.LOCAL_VARIABLE}) public @interface AnimatorRes {
+ }
+
+ @java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.PARAMETER, java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.LOCAL_VARIABLE}) public @interface AnyRes {
+ }
+
+ @java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.CONSTRUCTOR, java.lang.annotation.ElementType.TYPE, java.lang.annotation.ElementType.PARAMETER}) public @interface AnyThread {
+ }
+
+ @java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.PARAMETER, java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.LOCAL_VARIABLE}) public @interface ArrayRes {
+ }
+
+ @java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.PARAMETER, java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.LOCAL_VARIABLE}) public @interface AttrRes {
+ }
+
+ @java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.CONSTRUCTOR, java.lang.annotation.ElementType.TYPE, java.lang.annotation.ElementType.PARAMETER}) public @interface BinderThread {
+ }
+
+ @java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.PARAMETER, java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.LOCAL_VARIABLE}) public @interface BoolRes {
+ }
+
+ @java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD}) public @interface CallSuper {
+ }
+
+ @java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD}) public @interface CheckResult {
+ method public abstract String suggest() default "";
+ }
+
+ @java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.FIELD}) public @interface ChecksSdkIntAtLeast {
+ method public abstract int api() default -1;
+ method public abstract String codename() default "";
+ method public abstract int lambda() default -1;
+ method public abstract int parameter() default -1;
+ }
+
+ @java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.PARAMETER, java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.LOCAL_VARIABLE, java.lang.annotation.ElementType.FIELD}) public @interface ColorInt {
+ }
+
+ @java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) @java.lang.annotation.Target({java.lang.annotation.ElementType.PARAMETER, java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.LOCAL_VARIABLE, java.lang.annotation.ElementType.FIELD}) public @interface ColorLong {
+ }
+
+ @java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.PARAMETER, java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.LOCAL_VARIABLE}) public @interface ColorRes {
+ }
+
+ @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.CONSTRUCTOR}) public @interface ContentView {
+ }
+
+ @java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.PARAMETER, java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.LOCAL_VARIABLE}) public @interface DimenRes {
+ }
+
+ @java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.PARAMETER, java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.LOCAL_VARIABLE, java.lang.annotation.ElementType.ANNOTATION_TYPE}) public @interface Dimension {
+ method @DimensionUnit public abstract int unit() default androidx.annotation.Dimension.PX;
+ field public static final int DP = 0; // 0x0
+ field public static final int PX = 1; // 0x1
+ field public static final int SP = 2; // 0x2
+ }
+
+ @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) @java.lang.annotation.Target({java.lang.annotation.ElementType.CONSTRUCTOR, java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.PARAMETER, java.lang.annotation.ElementType.TYPE}) public @interface Discouraged {
+ method public abstract String message();
+ }
+
+ @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) @java.lang.annotation.Target({java.lang.annotation.ElementType.TYPE, java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.PARAMETER, java.lang.annotation.ElementType.FIELD}) public @interface DisplayContext {
+ }
+
+ @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD}) public @interface DoNotInline {
+ }
+
+ @java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.PARAMETER, java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.LOCAL_VARIABLE}) public @interface DrawableRes {
+ }
+
+ @java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.PARAMETER, java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.LOCAL_VARIABLE, java.lang.annotation.ElementType.ANNOTATION_TYPE}) public @interface FloatRange {
+ method public abstract double from() default java.lang.Double.NEGATIVE_INFINITY;
+ method public abstract boolean fromInclusive() default true;
+ method public abstract double to() default java.lang.Double.POSITIVE_INFINITY;
+ method public abstract boolean toInclusive() default true;
+ }
+
+ @java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.PARAMETER, java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.LOCAL_VARIABLE}) public @interface FontRes {
+ }
+
+ @java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.PARAMETER, java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.LOCAL_VARIABLE}) public @interface FractionRes {
+ }
+
+ @java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.PARAMETER, java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.LOCAL_VARIABLE, java.lang.annotation.ElementType.FIELD}) public @interface GravityInt {
+ }
+
+ @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.METHOD}) public @interface GuardedBy {
+ method public abstract String value();
+ }
+
+ @java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) @java.lang.annotation.Target({java.lang.annotation.ElementType.PARAMETER, java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.LOCAL_VARIABLE, java.lang.annotation.ElementType.FIELD}) public @interface HalfFloat {
+ }
+
+ @java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.PARAMETER, java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.LOCAL_VARIABLE}) public @interface IdRes {
+ }
+
+ @Deprecated @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD}) public @interface InspectableProperty {
+ method @Deprecated public abstract int attributeId() default 0;
+ method @Deprecated public abstract androidx.annotation.InspectableProperty.EnumEntry[] enumMapping() default {};
+ method @Deprecated public abstract androidx.annotation.InspectableProperty.FlagEntry[] flagMapping() default {};
+ method @Deprecated public abstract boolean hasAttributeId() default true;
+ method @Deprecated public abstract String name() default "";
+ method @Deprecated public abstract androidx.annotation.InspectableProperty.ValueType valueType() default androidx.annotation.InspectableProperty.ValueType.INFERRED;
+ }
+
+ @Deprecated @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) @java.lang.annotation.Target({java.lang.annotation.ElementType.TYPE}) public static @interface InspectableProperty.EnumEntry {
+ method @Deprecated public abstract String name();
+ method @Deprecated public abstract int value();
+ }
+
+ @Deprecated @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) @java.lang.annotation.Target({java.lang.annotation.ElementType.TYPE}) public static @interface InspectableProperty.FlagEntry {
+ method @Deprecated public abstract int mask() default 0;
+ method @Deprecated public abstract String name();
+ method @Deprecated public abstract int target();
+ }
+
+ @Deprecated public enum InspectableProperty.ValueType {
+ enum_constant @Deprecated public static final androidx.annotation.InspectableProperty.ValueType COLOR;
+ enum_constant @Deprecated public static final androidx.annotation.InspectableProperty.ValueType GRAVITY;
+ enum_constant @Deprecated public static final androidx.annotation.InspectableProperty.ValueType INFERRED;
+ enum_constant @Deprecated public static final androidx.annotation.InspectableProperty.ValueType INT_ENUM;
+ enum_constant @Deprecated public static final androidx.annotation.InspectableProperty.ValueType INT_FLAG;
+ enum_constant @Deprecated public static final androidx.annotation.InspectableProperty.ValueType NONE;
+ enum_constant @Deprecated public static final androidx.annotation.InspectableProperty.ValueType RESOURCE_ID;
+ }
+
+ @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) @java.lang.annotation.Target({java.lang.annotation.ElementType.ANNOTATION_TYPE}) public @interface IntDef {
+ method public abstract boolean flag() default false;
+ method public abstract boolean open() default false;
+ method public abstract int[] value() default {};
+ }
+
+ @java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.PARAMETER, java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.LOCAL_VARIABLE, java.lang.annotation.ElementType.ANNOTATION_TYPE}) public @interface IntRange {
+ method public abstract long from() default java.lang.Long.MIN_VALUE;
+ method public abstract long to() default java.lang.Long.MAX_VALUE;
+ }
+
+ @java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.PARAMETER, java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.LOCAL_VARIABLE}) public @interface IntegerRes {
+ }
+
+ @java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.PARAMETER, java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.LOCAL_VARIABLE}) public @interface InterpolatorRes {
+ }
+
+ @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.PACKAGE, java.lang.annotation.ElementType.TYPE, java.lang.annotation.ElementType.ANNOTATION_TYPE, java.lang.annotation.ElementType.CONSTRUCTOR, java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.FIELD}) public @interface Keep {
+ }
+
+ @java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.PARAMETER, java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.LOCAL_VARIABLE}) public @interface LayoutRes {
+ }
+
+ @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) @java.lang.annotation.Target({java.lang.annotation.ElementType.ANNOTATION_TYPE}) public @interface LongDef {
+ method public abstract boolean flag() default false;
+ method public abstract boolean open() default false;
+ method public abstract long[] value() default {};
+ }
+
+ @java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.CONSTRUCTOR, java.lang.annotation.ElementType.TYPE, java.lang.annotation.ElementType.PARAMETER}) public @interface MainThread {
+ }
+
+ @java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.PARAMETER, java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.LOCAL_VARIABLE}) public @interface MenuRes {
+ }
+
+ @java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.PARAMETER, java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.LOCAL_VARIABLE}) public @interface NavigationRes {
+ }
+
+ @java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.PARAMETER, java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.LOCAL_VARIABLE, java.lang.annotation.ElementType.ANNOTATION_TYPE, java.lang.annotation.ElementType.PACKAGE}) public @interface NonNull {
+ }
+
+ @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) @java.lang.annotation.Target({java.lang.annotation.ElementType.TYPE, java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.PARAMETER, java.lang.annotation.ElementType.FIELD}) public @interface NonUiContext {
+ }
+
+ @java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.PARAMETER, java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.LOCAL_VARIABLE, java.lang.annotation.ElementType.ANNOTATION_TYPE, java.lang.annotation.ElementType.PACKAGE}) public @interface Nullable {
+ }
+
+ @java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.PARAMETER, java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.LOCAL_VARIABLE}) public @interface PluralsRes {
+ }
+
+ @Dimension(unit=androidx.annotation.Dimension.PX) @java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.PARAMETER, java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.LOCAL_VARIABLE}) public @interface Px {
+ }
+
+ @java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.PARAMETER, java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.LOCAL_VARIABLE}) public @interface RawRes {
+ }
+
+ @java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.TYPE, java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.CONSTRUCTOR, java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.PACKAGE}) public @interface RequiresApi {
+ method @IntRange(from=1) public abstract int api() default 1;
+ method @IntRange(from=1) public abstract int value() default 1;
+ }
+
+ @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) @java.lang.annotation.Target({java.lang.annotation.ElementType.TYPE, java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.CONSTRUCTOR}) public @interface RequiresFeature {
+ method public abstract String enforcement();
+ method public abstract String name();
+ }
+
+ @java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.ANNOTATION_TYPE, java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.CONSTRUCTOR, java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.PARAMETER}) public @interface RequiresPermission {
+ method public abstract String[] allOf() default {};
+ method public abstract String[] anyOf() default {};
+ method public abstract boolean conditional() default false;
+ method public abstract String value() default "";
+ }
+
+ @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.PARAMETER}) public static @interface RequiresPermission.Read {
+ method public abstract androidx.annotation.RequiresPermission value() default @androidx.annotation.RequiresPermission;
+ }
+
+ @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.PARAMETER}) public static @interface RequiresPermission.Write {
+ method public abstract androidx.annotation.RequiresPermission value() default @androidx.annotation.RequiresPermission;
+ }
+
+ @java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.ANNOTATION_TYPE, java.lang.annotation.ElementType.TYPE, java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.CONSTRUCTOR, java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.PACKAGE}) public @interface RestrictTo {
+ method public abstract androidx.annotation.RestrictTo.Scope[] value();
+ }
+
+ public enum RestrictTo.Scope {
+ enum_constant @Deprecated public static final androidx.annotation.RestrictTo.Scope GROUP_ID;
+ enum_constant public static final androidx.annotation.RestrictTo.Scope LIBRARY;
+ enum_constant public static final androidx.annotation.RestrictTo.Scope LIBRARY_GROUP;
+ enum_constant public static final androidx.annotation.RestrictTo.Scope LIBRARY_GROUP_PREFIX;
+ enum_constant public static final androidx.annotation.RestrictTo.Scope SUBCLASSES;
+ enum_constant public static final androidx.annotation.RestrictTo.Scope TESTS;
+ }
+
+ @java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.PARAMETER, java.lang.annotation.ElementType.LOCAL_VARIABLE, java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.ANNOTATION_TYPE}) public @interface Size {
+ method public abstract long max() default java.lang.Long.MAX_VALUE;
+ method public abstract long min() default java.lang.Long.MIN_VALUE;
+ method public abstract long multiple() default 1;
+ method public abstract long value() default -1;
+ }
+
+ @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) @java.lang.annotation.Target({java.lang.annotation.ElementType.ANNOTATION_TYPE}) public @interface StringDef {
+ method public abstract boolean open() default false;
+ method public abstract String[] value() default {};
+ }
+
+ @java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.PARAMETER, java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.LOCAL_VARIABLE}) public @interface StringRes {
+ }
+
+ @java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.PARAMETER, java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.LOCAL_VARIABLE}) public @interface StyleRes {
+ }
+
+ @java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.PARAMETER, java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.LOCAL_VARIABLE}) public @interface StyleableRes {
+ }
+
+ @java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.PARAMETER, java.lang.annotation.ElementType.FIELD}) public @interface TransitionRes {
+ }
+
+ @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) @java.lang.annotation.Target({java.lang.annotation.ElementType.TYPE, java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.PARAMETER, java.lang.annotation.ElementType.FIELD}) public @interface UiContext {
+ }
+
+ @java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.CONSTRUCTOR, java.lang.annotation.ElementType.TYPE, java.lang.annotation.ElementType.PARAMETER}) public @interface UiThread {
+ }
+
+ @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) public @interface VisibleForTesting {
+ method @ProductionVisibility public abstract int otherwise() default androidx.annotation.VisibleForTesting.PRIVATE;
+ field public static final int NONE = 5; // 0x5
+ field public static final int PACKAGE_PRIVATE = 3; // 0x3
+ field public static final int PRIVATE = 2; // 0x2
+ field public static final int PROTECTED = 4; // 0x4
+ }
+
+ @java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.CONSTRUCTOR, java.lang.annotation.ElementType.TYPE, java.lang.annotation.ElementType.PARAMETER}) public @interface WorkerThread {
+ }
+
+ @java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.PARAMETER, java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.LOCAL_VARIABLE}) public @interface XmlRes {
+ }
+
+}
+
diff --git a/appcompat/appcompat-resources/api/1.4.0-beta01.txt b/appcompat/appcompat-resources/api/1.4.0-beta01.txt
new file mode 100644
index 0000000..b0256cf
--- /dev/null
+++ b/appcompat/appcompat-resources/api/1.4.0-beta01.txt
@@ -0,0 +1,35 @@
+// Signature format: 4.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.4.0-beta01.txt b/appcompat/appcompat-resources/api/public_plus_experimental_1.4.0-beta01.txt
new file mode 100644
index 0000000..b0256cf
--- /dev/null
+++ b/appcompat/appcompat-resources/api/public_plus_experimental_1.4.0-beta01.txt
@@ -0,0 +1,35 @@
+// Signature format: 4.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/wear/wear-complications-data-source/api/res-current.txt b/appcompat/appcompat-resources/api/res-1.4.0-beta01.txt
similarity index 100%
copy from wear/wear-complications-data-source/api/res-current.txt
copy to appcompat/appcompat-resources/api/res-1.4.0-beta01.txt
diff --git a/appcompat/appcompat-resources/api/restricted_1.4.0-beta01.txt b/appcompat/appcompat-resources/api/restricted_1.4.0-beta01.txt
new file mode 100644
index 0000000..9a7d74e
--- /dev/null
+++ b/appcompat/appcompat-resources/api/restricted_1.4.0-beta01.txt
@@ -0,0 +1,103 @@
+// Signature format: 4.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 static interface ResourceManagerInternal.ResourceManagerHooks {
+ method public android.graphics.drawable.Drawable? createDrawableFor(androidx.appcompat.widget.ResourceManagerInternal, android.content.Context, @DrawableRes int);
+ method public android.content.res.ColorStateList? getTintListForDrawableRes(android.content.Context, @DrawableRes int);
+ method public android.graphics.PorterDuff.Mode? getTintModeForDrawableRes(int);
+ method public boolean tintDrawable(android.content.Context, @DrawableRes int, android.graphics.drawable.Drawable);
+ method public boolean tintDrawableUsingColorFilter(android.content.Context, @DrawableRes int, android.graphics.drawable.Drawable);
+ }
+
+ @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 int getColor(int) throws android.content.res.Resources.NotFoundException;
+ method public android.content.res.ColorStateList! getColorStateList(int) throws android.content.res.Resources.NotFoundException;
+ method public android.graphics.drawable.Drawable! getDrawable(int) throws android.content.res.Resources.NotFoundException;
+ method @RequiresApi(15) public android.graphics.drawable.Drawable! getDrawableForDensity(int, int) throws android.content.res.Resources.NotFoundException;
+ method public android.graphics.Movie! getMovie(int) throws android.content.res.Resources.NotFoundException;
+ method public static boolean isCompatVectorFromResourcesEnabled();
+ method public static void setCompatVectorFromResourcesEnabled(boolean);
+ method public static boolean shouldBeUsed();
+ method public void updateConfiguration(android.content.res.Configuration!, android.util.DisplayMetrics!);
+ field public static final int MAX_SDK_WHERE_REQUIRED = 20; // 0x14
+ }
+
+}
+
diff --git a/appcompat/appcompat/api/1.4.0-beta01.txt b/appcompat/appcompat/api/1.4.0-beta01.txt
new file mode 100644
index 0000000..b560b02
--- /dev/null
+++ b/appcompat/appcompat/api/1.4.0-beta01.txt
@@ -0,0 +1,1018 @@
+// Signature format: 4.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();
+ ctor public AppCompatDialogFragment(@LayoutRes int);
+ }
+
+ 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 public int cellsUsed;
+ field public boolean expandable;
+ field public int extraPixels;
+ field public boolean isOverflowButton;
+ field public boolean preventEdgeOffset;
+ }
+
+ public static interface ActionMenuView.OnMenuItemClickListener {
+ method public boolean onMenuItemClick(android.view.MenuItem!);
+ }
+
+ public class AppCompatAutoCompleteTextView extends android.widget.AutoCompleteTextView implements androidx.appcompat.widget.EmojiCompatConfigurationView 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 boolean isEmojiCompatEnabled();
+ method public void setBackgroundDrawable(android.graphics.drawable.Drawable?);
+ method public void setEmojiCompatEnabled(boolean);
+ method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void setSupportBackgroundTintList(android.content.res.ColorStateList?);
+ method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void setSupportBackgroundTintMode(android.graphics.PorterDuff.Mode?);
+ method public void setTextAppearance(android.content.Context!, int);
+ }
+
+ public class AppCompatButton extends android.widget.Button implements androidx.appcompat.widget.EmojiCompatConfigurationView 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 public boolean isEmojiCompatEnabled();
+ 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 setEmojiCompatEnabled(boolean);
+ 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.appcompat.widget.EmojiCompatConfigurationView 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 boolean isEmojiCompatEnabled();
+ method public void setBackgroundDrawable(android.graphics.drawable.Drawable?);
+ method public void setEmojiCompatEnabled(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 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 implements androidx.appcompat.widget.EmojiCompatConfigurationView androidx.core.view.TintableBackgroundView {
+ 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 @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 boolean isEmojiCompatEnabled();
+ method public void setBackgroundDrawable(android.graphics.drawable.Drawable?);
+ method public void setEmojiCompatEnabled(boolean);
+ method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void setSupportBackgroundTintList(android.content.res.ColorStateList?);
+ method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void setSupportBackgroundTintMode(android.graphics.PorterDuff.Mode?);
+ method public void setTextAppearance(android.content.Context, int);
+ }
+
+ public class AppCompatEditText extends android.widget.EditText implements androidx.appcompat.widget.EmojiCompatConfigurationView androidx.core.view.OnReceiveContentViewBehavior 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 boolean isEmojiCompatEnabled();
+ method public androidx.core.view.ContentInfoCompat? onReceiveContent(androidx.core.view.ContentInfoCompat);
+ method public void setBackgroundDrawable(android.graphics.drawable.Drawable?);
+ method public void setEmojiCompatEnabled(boolean);
+ method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void setSupportBackgroundTintList(android.content.res.ColorStateList?);
+ method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void setSupportBackgroundTintMode(android.graphics.PorterDuff.Mode?);
+ method public void setTextAppearance(android.content.Context!, int);
+ }
+
+ public class 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.appcompat.widget.EmojiCompatConfigurationView 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 boolean isEmojiCompatEnabled();
+ method public void setBackgroundDrawable(android.graphics.drawable.Drawable?);
+ method public void setEmojiCompatEnabled(boolean);
+ method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void setSupportBackgroundTintList(android.content.res.ColorStateList?);
+ method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void setSupportBackgroundTintMode(android.graphics.PorterDuff.Mode?);
+ method public void setTextAppearance(android.content.Context!, int);
+ }
+
+ public class AppCompatRadioButton extends android.widget.RadioButton implements androidx.appcompat.widget.EmojiCompatConfigurationView 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 boolean isEmojiCompatEnabled();
+ method public void setBackgroundDrawable(android.graphics.drawable.Drawable?);
+ method public void setEmojiCompatEnabled(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 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.appcompat.widget.EmojiCompatConfigurationView 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 public boolean isEmojiCompatEnabled();
+ 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 setEmojiCompatEnabled(boolean);
+ 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 implements androidx.appcompat.widget.EmojiCompatConfigurationView androidx.core.view.TintableBackgroundView {
+ 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);
+ 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 boolean isEmojiCompatEnabled();
+ method public void setEmojiCompatEnabled(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?);
+ }
+
+ public interface EmojiCompatConfigurationView {
+ method public boolean isEmojiCompatEnabled();
+ method public void setEmojiCompatEnabled(boolean);
+ }
+
+ 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 @androidx.resourceinspection.annotation.Attribute("android:baselineAlignedChildIndex") public int getBaselineAlignedChildIndex();
+ method @androidx.resourceinspection.annotation.Attribute("androidx.appcompat:divider") public android.graphics.drawable.Drawable! getDividerDrawable();
+ method @androidx.resourceinspection.annotation.Attribute("androidx.appcompat:dividerPadding") public int getDividerPadding();
+ method @GravityInt @androidx.resourceinspection.annotation.Attribute("android:gravity") public int getGravity();
+ method @androidx.resourceinspection.annotation.Attribute(value="android:orientation", intMapping={@androidx.resourceinspection.annotation.Attribute.IntMap(name="horizontal", value=0), @androidx.resourceinspection.annotation.Attribute.IntMap(name="vertical", value=1)}) public int getOrientation();
+ method @androidx.resourceinspection.annotation.Attribute(value="androidx.appcompat:showDividers", intMapping={@androidx.resourceinspection.annotation.Attribute.IntMap(name="none", value=0), @androidx.resourceinspection.annotation.Attribute.IntMap(name="beginning", value=1, mask=1), @androidx.resourceinspection.annotation.Attribute.IntMap(name="middle", value=2, mask=2), @androidx.resourceinspection.annotation.Attribute.IntMap(name="end", value=4, mask=4)}) public int getShowDividers();
+ method @androidx.resourceinspection.annotation.Attribute("android:weightSum") public float getWeightSum();
+ method @androidx.resourceinspection.annotation.Attribute("android:baselineAligned") public boolean isBaselineAligned();
+ method @androidx.resourceinspection.annotation.Attribute("androidx.appcompat:measureWithLargestChild") 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(@GravityInt 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.widget.LinearLayout.LayoutParams {
+ 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!);
+ }
+
+ 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 setForceShowIcon(boolean);
+ 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 @androidx.resourceinspection.annotation.Attribute("android:imeOptions") public int getImeOptions();
+ method public int getInputType();
+ method @androidx.resourceinspection.annotation.Attribute("android:maxWidth") public int getMaxWidth();
+ method public CharSequence! getQuery();
+ method @androidx.resourceinspection.annotation.Attribute("androidx.appcompat:queryHint") public CharSequence? getQueryHint();
+ method public androidx.cursoradapter.widget.CursorAdapter! getSuggestionsAdapter();
+ method @androidx.resourceinspection.annotation.Attribute("androidx.appcompat:iconifiedByDefault") 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 implements androidx.appcompat.widget.EmojiCompatConfigurationView {
+ 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 @androidx.resourceinspection.annotation.Attribute("androidx.appcompat:showText") public boolean getShowText();
+ method @androidx.resourceinspection.annotation.Attribute("androidx.appcompat:splitTrack") public boolean getSplitTrack();
+ method @androidx.resourceinspection.annotation.Attribute("androidx.appcompat:switchMinWidth") public int getSwitchMinWidth();
+ method @androidx.resourceinspection.annotation.Attribute("androidx.appcompat:switchPadding") public int getSwitchPadding();
+ method @androidx.resourceinspection.annotation.Attribute("android:textOff") public CharSequence! getTextOff();
+ method @androidx.resourceinspection.annotation.Attribute("android:textOn") public CharSequence! getTextOn();
+ method @androidx.resourceinspection.annotation.Attribute("android:thumb") public android.graphics.drawable.Drawable! getThumbDrawable();
+ method @androidx.resourceinspection.annotation.Attribute("androidx.appcompat:thumbTextPadding") public int getThumbTextPadding();
+ method @androidx.resourceinspection.annotation.Attribute("androidx.appcompat:thumbTint") public android.content.res.ColorStateList? getThumbTintList();
+ method @androidx.resourceinspection.annotation.Attribute("androidx.appcompat:thumbTintMode") public android.graphics.PorterDuff.Mode? getThumbTintMode();
+ method @androidx.resourceinspection.annotation.Attribute("androidx.appcompat:track") public android.graphics.drawable.Drawable! getTrackDrawable();
+ method @androidx.resourceinspection.annotation.Attribute("androidx.appcompat:trackTint") public android.content.res.ColorStateList? getTrackTintList();
+ method @androidx.resourceinspection.annotation.Attribute("androidx.appcompat:trackTintMode") public android.graphics.PorterDuff.Mode? getTrackTintMode();
+ method public boolean isEmojiCompatEnabled();
+ method public void onMeasure(int, int);
+ method public void setEmojiCompatEnabled(boolean);
+ 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 implements androidx.core.view.MenuHost {
+ 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 @MainThread public void addMenuProvider(androidx.core.view.MenuProvider);
+ method @MainThread public void addMenuProvider(androidx.core.view.MenuProvider, androidx.lifecycle.LifecycleOwner);
+ method @MainThread public void addMenuProvider(androidx.core.view.MenuProvider, androidx.lifecycle.LifecycleOwner, androidx.lifecycle.Lifecycle.State);
+ 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 @androidx.resourceinspection.annotation.Attribute("androidx.appcompat:collapseContentDescription") public CharSequence? getCollapseContentDescription();
+ method @androidx.resourceinspection.annotation.Attribute("androidx.appcompat:collapseIcon") public android.graphics.drawable.Drawable? getCollapseIcon();
+ method @androidx.resourceinspection.annotation.Attribute("androidx.appcompat:contentInsetEnd") public int getContentInsetEnd();
+ method @androidx.resourceinspection.annotation.Attribute("androidx.appcompat:contentInsetEndWithActions") public int getContentInsetEndWithActions();
+ method @androidx.resourceinspection.annotation.Attribute("androidx.appcompat:contentInsetLeft") public int getContentInsetLeft();
+ method @androidx.resourceinspection.annotation.Attribute("androidx.appcompat:contentInsetRight") public int getContentInsetRight();
+ method @androidx.resourceinspection.annotation.Attribute("androidx.appcompat:contentInsetStart") public int getContentInsetStart();
+ method @androidx.resourceinspection.annotation.Attribute("androidx.appcompat:contentInsetStartWithNavigation") public int getContentInsetStartWithNavigation();
+ method public int getCurrentContentInsetEnd();
+ method public int getCurrentContentInsetLeft();
+ method public int getCurrentContentInsetRight();
+ method public int getCurrentContentInsetStart();
+ method @androidx.resourceinspection.annotation.Attribute("androidx.appcompat:logo") public android.graphics.drawable.Drawable! getLogo();
+ method @androidx.resourceinspection.annotation.Attribute("androidx.appcompat:logoDescription") public CharSequence! getLogoDescription();
+ method @androidx.resourceinspection.annotation.Attribute("androidx.appcompat:menu") public android.view.Menu! getMenu();
+ method @androidx.resourceinspection.annotation.Attribute("androidx.appcompat:navigationContentDescription") public CharSequence? getNavigationContentDescription();
+ method @androidx.resourceinspection.annotation.Attribute("androidx.appcompat:navigationIcon") public android.graphics.drawable.Drawable? getNavigationIcon();
+ method public android.graphics.drawable.Drawable? getOverflowIcon();
+ method @StyleRes @androidx.resourceinspection.annotation.Attribute("androidx.appcompat:popupTheme") public int getPopupTheme();
+ method @androidx.resourceinspection.annotation.Attribute("androidx.appcompat:subtitle") public CharSequence! getSubtitle();
+ method @androidx.resourceinspection.annotation.Attribute("androidx.appcompat:title") public CharSequence! getTitle();
+ method @androidx.resourceinspection.annotation.Attribute("androidx.appcompat:titleMarginBottom") public int getTitleMarginBottom();
+ method @androidx.resourceinspection.annotation.Attribute("androidx.appcompat:titleMarginEnd") public int getTitleMarginEnd();
+ method @androidx.resourceinspection.annotation.Attribute("androidx.appcompat:titleMarginStart") public int getTitleMarginStart();
+ method @androidx.resourceinspection.annotation.Attribute("androidx.appcompat:titleMarginTop") public int getTitleMarginTop();
+ method public boolean hasExpandedActionView();
+ method public boolean hideOverflowMenu();
+ method public void inflateMenu(@MenuRes int);
+ method @MainThread public void invalidateMenu();
+ method public boolean isOverflowMenuShowing();
+ method @MainThread public void removeMenuProvider(androidx.core.view.MenuProvider);
+ 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.4.0-beta01.txt b/appcompat/appcompat/api/public_plus_experimental_1.4.0-beta01.txt
new file mode 100644
index 0000000..b560b02
--- /dev/null
+++ b/appcompat/appcompat/api/public_plus_experimental_1.4.0-beta01.txt
@@ -0,0 +1,1018 @@
+// Signature format: 4.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();
+ ctor public AppCompatDialogFragment(@LayoutRes int);
+ }
+
+ 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 public int cellsUsed;
+ field public boolean expandable;
+ field public int extraPixels;
+ field public boolean isOverflowButton;
+ field public boolean preventEdgeOffset;
+ }
+
+ public static interface ActionMenuView.OnMenuItemClickListener {
+ method public boolean onMenuItemClick(android.view.MenuItem!);
+ }
+
+ public class AppCompatAutoCompleteTextView extends android.widget.AutoCompleteTextView implements androidx.appcompat.widget.EmojiCompatConfigurationView 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 boolean isEmojiCompatEnabled();
+ method public void setBackgroundDrawable(android.graphics.drawable.Drawable?);
+ method public void setEmojiCompatEnabled(boolean);
+ method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void setSupportBackgroundTintList(android.content.res.ColorStateList?);
+ method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void setSupportBackgroundTintMode(android.graphics.PorterDuff.Mode?);
+ method public void setTextAppearance(android.content.Context!, int);
+ }
+
+ public class AppCompatButton extends android.widget.Button implements androidx.appcompat.widget.EmojiCompatConfigurationView 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 public boolean isEmojiCompatEnabled();
+ 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 setEmojiCompatEnabled(boolean);
+ 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.appcompat.widget.EmojiCompatConfigurationView 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 boolean isEmojiCompatEnabled();
+ method public void setBackgroundDrawable(android.graphics.drawable.Drawable?);
+ method public void setEmojiCompatEnabled(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 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 implements androidx.appcompat.widget.EmojiCompatConfigurationView androidx.core.view.TintableBackgroundView {
+ 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 @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 boolean isEmojiCompatEnabled();
+ method public void setBackgroundDrawable(android.graphics.drawable.Drawable?);
+ method public void setEmojiCompatEnabled(boolean);
+ method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void setSupportBackgroundTintList(android.content.res.ColorStateList?);
+ method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void setSupportBackgroundTintMode(android.graphics.PorterDuff.Mode?);
+ method public void setTextAppearance(android.content.Context, int);
+ }
+
+ public class AppCompatEditText extends android.widget.EditText implements androidx.appcompat.widget.EmojiCompatConfigurationView androidx.core.view.OnReceiveContentViewBehavior 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 boolean isEmojiCompatEnabled();
+ method public androidx.core.view.ContentInfoCompat? onReceiveContent(androidx.core.view.ContentInfoCompat);
+ method public void setBackgroundDrawable(android.graphics.drawable.Drawable?);
+ method public void setEmojiCompatEnabled(boolean);
+ method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void setSupportBackgroundTintList(android.content.res.ColorStateList?);
+ method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void setSupportBackgroundTintMode(android.graphics.PorterDuff.Mode?);
+ method public void setTextAppearance(android.content.Context!, int);
+ }
+
+ public class 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.appcompat.widget.EmojiCompatConfigurationView 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 boolean isEmojiCompatEnabled();
+ method public void setBackgroundDrawable(android.graphics.drawable.Drawable?);
+ method public void setEmojiCompatEnabled(boolean);
+ method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void setSupportBackgroundTintList(android.content.res.ColorStateList?);
+ method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void setSupportBackgroundTintMode(android.graphics.PorterDuff.Mode?);
+ method public void setTextAppearance(android.content.Context!, int);
+ }
+
+ public class AppCompatRadioButton extends android.widget.RadioButton implements androidx.appcompat.widget.EmojiCompatConfigurationView 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 boolean isEmojiCompatEnabled();
+ method public void setBackgroundDrawable(android.graphics.drawable.Drawable?);
+ method public void setEmojiCompatEnabled(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 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.appcompat.widget.EmojiCompatConfigurationView 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 public boolean isEmojiCompatEnabled();
+ 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 setEmojiCompatEnabled(boolean);
+ 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 implements androidx.appcompat.widget.EmojiCompatConfigurationView androidx.core.view.TintableBackgroundView {
+ 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);
+ 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 boolean isEmojiCompatEnabled();
+ method public void setEmojiCompatEnabled(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?);
+ }
+
+ public interface EmojiCompatConfigurationView {
+ method public boolean isEmojiCompatEnabled();
+ method public void setEmojiCompatEnabled(boolean);
+ }
+
+ 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 @androidx.resourceinspection.annotation.Attribute("android:baselineAlignedChildIndex") public int getBaselineAlignedChildIndex();
+ method @androidx.resourceinspection.annotation.Attribute("androidx.appcompat:divider") public android.graphics.drawable.Drawable! getDividerDrawable();
+ method @androidx.resourceinspection.annotation.Attribute("androidx.appcompat:dividerPadding") public int getDividerPadding();
+ method @GravityInt @androidx.resourceinspection.annotation.Attribute("android:gravity") public int getGravity();
+ method @androidx.resourceinspection.annotation.Attribute(value="android:orientation", intMapping={@androidx.resourceinspection.annotation.Attribute.IntMap(name="horizontal", value=0), @androidx.resourceinspection.annotation.Attribute.IntMap(name="vertical", value=1)}) public int getOrientation();
+ method @androidx.resourceinspection.annotation.Attribute(value="androidx.appcompat:showDividers", intMapping={@androidx.resourceinspection.annotation.Attribute.IntMap(name="none", value=0), @androidx.resourceinspection.annotation.Attribute.IntMap(name="beginning", value=1, mask=1), @androidx.resourceinspection.annotation.Attribute.IntMap(name="middle", value=2, mask=2), @androidx.resourceinspection.annotation.Attribute.IntMap(name="end", value=4, mask=4)}) public int getShowDividers();
+ method @androidx.resourceinspection.annotation.Attribute("android:weightSum") public float getWeightSum();
+ method @androidx.resourceinspection.annotation.Attribute("android:baselineAligned") public boolean isBaselineAligned();
+ method @androidx.resourceinspection.annotation.Attribute("androidx.appcompat:measureWithLargestChild") 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(@GravityInt 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.widget.LinearLayout.LayoutParams {
+ 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!);
+ }
+
+ 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 setForceShowIcon(boolean);
+ 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 @androidx.resourceinspection.annotation.Attribute("android:imeOptions") public int getImeOptions();
+ method public int getInputType();
+ method @androidx.resourceinspection.annotation.Attribute("android:maxWidth") public int getMaxWidth();
+ method public CharSequence! getQuery();
+ method @androidx.resourceinspection.annotation.Attribute("androidx.appcompat:queryHint") public CharSequence? getQueryHint();
+ method public androidx.cursoradapter.widget.CursorAdapter! getSuggestionsAdapter();
+ method @androidx.resourceinspection.annotation.Attribute("androidx.appcompat:iconifiedByDefault") 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 implements androidx.appcompat.widget.EmojiCompatConfigurationView {
+ 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 @androidx.resourceinspection.annotation.Attribute("androidx.appcompat:showText") public boolean getShowText();
+ method @androidx.resourceinspection.annotation.Attribute("androidx.appcompat:splitTrack") public boolean getSplitTrack();
+ method @androidx.resourceinspection.annotation.Attribute("androidx.appcompat:switchMinWidth") public int getSwitchMinWidth();
+ method @androidx.resourceinspection.annotation.Attribute("androidx.appcompat:switchPadding") public int getSwitchPadding();
+ method @androidx.resourceinspection.annotation.Attribute("android:textOff") public CharSequence! getTextOff();
+ method @androidx.resourceinspection.annotation.Attribute("android:textOn") public CharSequence! getTextOn();
+ method @androidx.resourceinspection.annotation.Attribute("android:thumb") public android.graphics.drawable.Drawable! getThumbDrawable();
+ method @androidx.resourceinspection.annotation.Attribute("androidx.appcompat:thumbTextPadding") public int getThumbTextPadding();
+ method @androidx.resourceinspection.annotation.Attribute("androidx.appcompat:thumbTint") public android.content.res.ColorStateList? getThumbTintList();
+ method @androidx.resourceinspection.annotation.Attribute("androidx.appcompat:thumbTintMode") public android.graphics.PorterDuff.Mode? getThumbTintMode();
+ method @androidx.resourceinspection.annotation.Attribute("androidx.appcompat:track") public android.graphics.drawable.Drawable! getTrackDrawable();
+ method @androidx.resourceinspection.annotation.Attribute("androidx.appcompat:trackTint") public android.content.res.ColorStateList? getTrackTintList();
+ method @androidx.resourceinspection.annotation.Attribute("androidx.appcompat:trackTintMode") public android.graphics.PorterDuff.Mode? getTrackTintMode();
+ method public boolean isEmojiCompatEnabled();
+ method public void onMeasure(int, int);
+ method public void setEmojiCompatEnabled(boolean);
+ 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 implements androidx.core.view.MenuHost {
+ 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 @MainThread public void addMenuProvider(androidx.core.view.MenuProvider);
+ method @MainThread public void addMenuProvider(androidx.core.view.MenuProvider, androidx.lifecycle.LifecycleOwner);
+ method @MainThread public void addMenuProvider(androidx.core.view.MenuProvider, androidx.lifecycle.LifecycleOwner, androidx.lifecycle.Lifecycle.State);
+ 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 @androidx.resourceinspection.annotation.Attribute("androidx.appcompat:collapseContentDescription") public CharSequence? getCollapseContentDescription();
+ method @androidx.resourceinspection.annotation.Attribute("androidx.appcompat:collapseIcon") public android.graphics.drawable.Drawable? getCollapseIcon();
+ method @androidx.resourceinspection.annotation.Attribute("androidx.appcompat:contentInsetEnd") public int getContentInsetEnd();
+ method @androidx.resourceinspection.annotation.Attribute("androidx.appcompat:contentInsetEndWithActions") public int getContentInsetEndWithActions();
+ method @androidx.resourceinspection.annotation.Attribute("androidx.appcompat:contentInsetLeft") public int getContentInsetLeft();
+ method @androidx.resourceinspection.annotation.Attribute("androidx.appcompat:contentInsetRight") public int getContentInsetRight();
+ method @androidx.resourceinspection.annotation.Attribute("androidx.appcompat:contentInsetStart") public int getContentInsetStart();
+ method @androidx.resourceinspection.annotation.Attribute("androidx.appcompat:contentInsetStartWithNavigation") public int getContentInsetStartWithNavigation();
+ method public int getCurrentContentInsetEnd();
+ method public int getCurrentContentInsetLeft();
+ method public int getCurrentContentInsetRight();
+ method public int getCurrentContentInsetStart();
+ method @androidx.resourceinspection.annotation.Attribute("androidx.appcompat:logo") public android.graphics.drawable.Drawable! getLogo();
+ method @androidx.resourceinspection.annotation.Attribute("androidx.appcompat:logoDescription") public CharSequence! getLogoDescription();
+ method @androidx.resourceinspection.annotation.Attribute("androidx.appcompat:menu") public android.view.Menu! getMenu();
+ method @androidx.resourceinspection.annotation.Attribute("androidx.appcompat:navigationContentDescription") public CharSequence? getNavigationContentDescription();
+ method @androidx.resourceinspection.annotation.Attribute("androidx.appcompat:navigationIcon") public android.graphics.drawable.Drawable? getNavigationIcon();
+ method public android.graphics.drawable.Drawable? getOverflowIcon();
+ method @StyleRes @androidx.resourceinspection.annotation.Attribute("androidx.appcompat:popupTheme") public int getPopupTheme();
+ method @androidx.resourceinspection.annotation.Attribute("androidx.appcompat:subtitle") public CharSequence! getSubtitle();
+ method @androidx.resourceinspection.annotation.Attribute("androidx.appcompat:title") public CharSequence! getTitle();
+ method @androidx.resourceinspection.annotation.Attribute("androidx.appcompat:titleMarginBottom") public int getTitleMarginBottom();
+ method @androidx.resourceinspection.annotation.Attribute("androidx.appcompat:titleMarginEnd") public int getTitleMarginEnd();
+ method @androidx.resourceinspection.annotation.Attribute("androidx.appcompat:titleMarginStart") public int getTitleMarginStart();
+ method @androidx.resourceinspection.annotation.Attribute("androidx.appcompat:titleMarginTop") public int getTitleMarginTop();
+ method public boolean hasExpandedActionView();
+ method public boolean hideOverflowMenu();
+ method public void inflateMenu(@MenuRes int);
+ method @MainThread public void invalidateMenu();
+ method public boolean isOverflowMenuShowing();
+ method @MainThread public void removeMenuProvider(androidx.core.view.MenuProvider);
+ 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.4.0-beta01.txt b/appcompat/appcompat/api/res-1.4.0-beta01.txt
new file mode 100644
index 0000000..b9f58a8
--- /dev/null
+++ b/appcompat/appcompat/api/res-1.4.0-beta01.txt
@@ -0,0 +1,369 @@
+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 actionModeCloseContentDescription
+attr actionModeCloseDrawable
+attr actionModeCopyDrawable
+attr actionModeCutDrawable
+attr actionModeFindDrawable
+attr actionModePasteDrawable
+attr actionModeSelectAllDrawable
+attr actionModeShareDrawable
+attr actionModeSplitBackground
+attr actionModeStyle
+attr actionModeTheme
+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 emojiCompatEnabled
+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.4.0-beta01.txt b/appcompat/appcompat/api/restricted_1.4.0-beta01.txt
new file mode 100644
index 0000000..6055b36a
--- /dev/null
+++ b/appcompat/appcompat/api/restricted_1.4.0-beta01.txt
@@ -0,0 +1,2242 @@
+// Signature format: 4.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();
+ ctor public AppCompatDialogFragment(@LayoutRes int);
+ }
+
+ 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 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 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 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 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 public int cellsUsed;
+ field public boolean expandable;
+ field public int extraPixels;
+ field public boolean isOverflowButton;
+ field 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 boolean isShowingPopup();
+ 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?);
+ }
+
+ @androidx.resourceinspection.annotation.AppCompatShadowedAttributes public class AppCompatAutoCompleteTextView extends android.widget.AutoCompleteTextView implements androidx.appcompat.widget.EmojiCompatConfigurationView 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 boolean isEmojiCompatEnabled();
+ method public void setBackgroundDrawable(android.graphics.drawable.Drawable?);
+ method public void setEmojiCompatEnabled(boolean);
+ method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void setSupportBackgroundTintList(android.content.res.ColorStateList?);
+ method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void setSupportBackgroundTintMode(android.graphics.PorterDuff.Mode?);
+ method public void setTextAppearance(android.content.Context!, int);
+ }
+
+ @androidx.resourceinspection.annotation.AppCompatShadowedAttributes public class AppCompatButton extends android.widget.Button implements androidx.core.widget.AutoSizeableTextView androidx.appcompat.widget.EmojiCompatConfigurationView 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 public boolean isEmojiCompatEnabled();
+ 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 setEmojiCompatEnabled(boolean);
+ 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);
+ }
+
+ @androidx.resourceinspection.annotation.AppCompatShadowedAttributes public class AppCompatCheckBox extends android.widget.CheckBox implements androidx.appcompat.widget.EmojiCompatConfigurationView 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 boolean isEmojiCompatEnabled();
+ method public void setBackgroundDrawable(android.graphics.drawable.Drawable?);
+ method public void setEmojiCompatEnabled(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 setSupportButtonTintList(android.content.res.ColorStateList?);
+ method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void setSupportButtonTintMode(android.graphics.PorterDuff.Mode?);
+ }
+
+ @androidx.resourceinspection.annotation.AppCompatShadowedAttributes public class AppCompatCheckedTextView extends android.widget.CheckedTextView implements androidx.appcompat.widget.EmojiCompatConfigurationView androidx.core.view.TintableBackgroundView androidx.core.widget.TintableCheckedTextView {
+ 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 @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? getSupportCheckMarkTintList();
+ method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public android.graphics.PorterDuff.Mode? getSupportCheckMarkTintMode();
+ method public boolean isEmojiCompatEnabled();
+ method public void setBackgroundDrawable(android.graphics.drawable.Drawable?);
+ method public void setEmojiCompatEnabled(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 setSupportCheckMarkTintList(android.content.res.ColorStateList?);
+ method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void setSupportCheckMarkTintMode(android.graphics.PorterDuff.Mode?);
+ 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();
+ }
+
+ @androidx.resourceinspection.annotation.AppCompatShadowedAttributes public class AppCompatEditText extends android.widget.EditText implements androidx.appcompat.widget.EmojiCompatConfigurationView androidx.core.view.OnReceiveContentViewBehavior 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 boolean isEmojiCompatEnabled();
+ method public androidx.core.view.ContentInfoCompat? onReceiveContent(androidx.core.view.ContentInfoCompat);
+ method public void setBackgroundDrawable(android.graphics.drawable.Drawable?);
+ method public void setEmojiCompatEnabled(boolean);
+ method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void setSupportBackgroundTintList(android.content.res.ColorStateList?);
+ method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void setSupportBackgroundTintMode(android.graphics.PorterDuff.Mode?);
+ method public void setTextAppearance(android.content.Context!, int);
+ }
+
+ @androidx.resourceinspection.annotation.AppCompatShadowedAttributes 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);
+ }
+
+ @androidx.resourceinspection.annotation.AppCompatShadowedAttributes 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?);
+ }
+
+ @androidx.resourceinspection.annotation.AppCompatShadowedAttributes public class AppCompatMultiAutoCompleteTextView extends android.widget.MultiAutoCompleteTextView implements androidx.appcompat.widget.EmojiCompatConfigurationView 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 boolean isEmojiCompatEnabled();
+ method public void setBackgroundDrawable(android.graphics.drawable.Drawable?);
+ method public void setEmojiCompatEnabled(boolean);
+ method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void setSupportBackgroundTintList(android.content.res.ColorStateList?);
+ method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void setSupportBackgroundTintMode(android.graphics.PorterDuff.Mode?);
+ method public void setTextAppearance(android.content.Context!, int);
+ }
+
+ @androidx.resourceinspection.annotation.AppCompatShadowedAttributes public class AppCompatRadioButton extends android.widget.RadioButton implements androidx.appcompat.widget.EmojiCompatConfigurationView 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 boolean isEmojiCompatEnabled();
+ method public void setBackgroundDrawable(android.graphics.drawable.Drawable?);
+ method public void setEmojiCompatEnabled(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 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);
+ }
+
+ @androidx.resourceinspection.annotation.AppCompatShadowedAttributes 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?);
+ }
+
+ @androidx.resourceinspection.annotation.AppCompatShadowedAttributes public class AppCompatTextView extends android.widget.TextView implements androidx.core.widget.AutoSizeableTextView androidx.appcompat.widget.EmojiCompatConfigurationView 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 public boolean isEmojiCompatEnabled();
+ 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 setEmojiCompatEnabled(boolean);
+ 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);
+ }
+
+ @androidx.resourceinspection.annotation.AppCompatShadowedAttributes public class AppCompatToggleButton extends android.widget.ToggleButton implements androidx.appcompat.widget.EmojiCompatConfigurationView androidx.core.view.TintableBackgroundView {
+ 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);
+ 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 boolean isEmojiCompatEnabled();
+ method public void setEmojiCompatEnabled(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?);
+ }
+
+ @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);
+ }
+
+ public interface EmojiCompatConfigurationView {
+ method public boolean isEmojiCompatEnabled();
+ method public void setEmojiCompatEnabled(boolean);
+ }
+
+ @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 @androidx.resourceinspection.annotation.Attribute("android:baselineAlignedChildIndex") public int getBaselineAlignedChildIndex();
+ method @androidx.resourceinspection.annotation.Attribute("androidx.appcompat:divider") public android.graphics.drawable.Drawable! getDividerDrawable();
+ method @androidx.resourceinspection.annotation.Attribute("androidx.appcompat:dividerPadding") public int getDividerPadding();
+ method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public int getDividerWidth();
+ method @GravityInt @androidx.resourceinspection.annotation.Attribute("android:gravity") public int getGravity();
+ method @androidx.appcompat.widget.LinearLayoutCompat.OrientationMode @androidx.resourceinspection.annotation.Attribute(value="android:orientation", intMapping={@androidx.resourceinspection.annotation.Attribute.IntMap(name="horizontal", value=0), @androidx.resourceinspection.annotation.Attribute.IntMap(name="vertical", value=1)}) public int getOrientation();
+ method @androidx.appcompat.widget.LinearLayoutCompat.DividerMode @androidx.resourceinspection.annotation.Attribute(value="androidx.appcompat:showDividers", intMapping={@androidx.resourceinspection.annotation.Attribute.IntMap(name="none", value=0), @androidx.resourceinspection.annotation.Attribute.IntMap(name="beginning", value=1, mask=1), @androidx.resourceinspection.annotation.Attribute.IntMap(name="middle", value=2, mask=2), @androidx.resourceinspection.annotation.Attribute.IntMap(name="end", value=4, mask=4)}) public int getShowDividers();
+ method @androidx.resourceinspection.annotation.Attribute("android:weightSum") public float getWeightSum();
+ method @androidx.resourceinspection.annotation.Attribute("android:baselineAligned") public boolean isBaselineAligned();
+ method @androidx.resourceinspection.annotation.Attribute("androidx.appcompat:measureWithLargestChild") 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(@GravityInt 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.widget.LinearLayout.LayoutParams {
+ 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!);
+ }
+
+ @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 setForceShowIcon(boolean);
+ 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 @androidx.resourceinspection.annotation.Attribute("android:imeOptions") public int getImeOptions();
+ method public int getInputType();
+ method @androidx.resourceinspection.annotation.Attribute("android:maxWidth") public int getMaxWidth();
+ method public CharSequence! getQuery();
+ method @androidx.resourceinspection.annotation.Attribute("androidx.appcompat:queryHint") public CharSequence? getQueryHint();
+ method public androidx.cursoradapter.widget.CursorAdapter! getSuggestionsAdapter();
+ method @androidx.resourceinspection.annotation.Attribute("androidx.appcompat:iconifiedByDefault") 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 implements androidx.appcompat.widget.EmojiCompatConfigurationView {
+ 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 @androidx.resourceinspection.annotation.Attribute("androidx.appcompat:showText") public boolean getShowText();
+ method @androidx.resourceinspection.annotation.Attribute("androidx.appcompat:splitTrack") public boolean getSplitTrack();
+ method @androidx.resourceinspection.annotation.Attribute("androidx.appcompat:switchMinWidth") public int getSwitchMinWidth();
+ method @androidx.resourceinspection.annotation.Attribute("androidx.appcompat:switchPadding") public int getSwitchPadding();
+ method @androidx.resourceinspection.annotation.Attribute("android:textOff") public CharSequence! getTextOff();
+ method @androidx.resourceinspection.annotation.Attribute("android:textOn") public CharSequence! getTextOn();
+ method @androidx.resourceinspection.annotation.Attribute("android:thumb") public android.graphics.drawable.Drawable! getThumbDrawable();
+ method @androidx.resourceinspection.annotation.Attribute("androidx.appcompat:thumbTextPadding") public int getThumbTextPadding();
+ method @androidx.resourceinspection.annotation.Attribute("androidx.appcompat:thumbTint") public android.content.res.ColorStateList? getThumbTintList();
+ method @androidx.resourceinspection.annotation.Attribute("androidx.appcompat:thumbTintMode") public android.graphics.PorterDuff.Mode? getThumbTintMode();
+ method @androidx.resourceinspection.annotation.Attribute("androidx.appcompat:track") public android.graphics.drawable.Drawable! getTrackDrawable();
+ method @androidx.resourceinspection.annotation.Attribute("androidx.appcompat:trackTint") public android.content.res.ColorStateList? getTrackTintList();
+ method @androidx.resourceinspection.annotation.Attribute("androidx.appcompat:trackTintMode") public android.graphics.PorterDuff.Mode? getTrackTintMode();
+ method public boolean isEmojiCompatEnabled();
+ method public void onMeasure(int, int);
+ method public void setEmojiCompatEnabled(boolean);
+ 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 implements androidx.core.view.MenuHost {
+ 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 @MainThread public void addMenuProvider(androidx.core.view.MenuProvider);
+ method @MainThread public void addMenuProvider(androidx.core.view.MenuProvider, androidx.lifecycle.LifecycleOwner);
+ method @MainThread public void addMenuProvider(androidx.core.view.MenuProvider, androidx.lifecycle.LifecycleOwner, androidx.lifecycle.Lifecycle.State);
+ 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 @androidx.resourceinspection.annotation.Attribute("androidx.appcompat:collapseContentDescription") public CharSequence? getCollapseContentDescription();
+ method @androidx.resourceinspection.annotation.Attribute("androidx.appcompat:collapseIcon") public android.graphics.drawable.Drawable? getCollapseIcon();
+ method @androidx.resourceinspection.annotation.Attribute("androidx.appcompat:contentInsetEnd") public int getContentInsetEnd();
+ method @androidx.resourceinspection.annotation.Attribute("androidx.appcompat:contentInsetEndWithActions") public int getContentInsetEndWithActions();
+ method @androidx.resourceinspection.annotation.Attribute("androidx.appcompat:contentInsetLeft") public int getContentInsetLeft();
+ method @androidx.resourceinspection.annotation.Attribute("androidx.appcompat:contentInsetRight") public int getContentInsetRight();
+ method @androidx.resourceinspection.annotation.Attribute("androidx.appcompat:contentInsetStart") public int getContentInsetStart();
+ method @androidx.resourceinspection.annotation.Attribute("androidx.appcompat:contentInsetStartWithNavigation") public int getContentInsetStartWithNavigation();
+ method public int getCurrentContentInsetEnd();
+ method public int getCurrentContentInsetLeft();
+ method public int getCurrentContentInsetRight();
+ method public int getCurrentContentInsetStart();
+ method @androidx.resourceinspection.annotation.Attribute("androidx.appcompat:logo") public android.graphics.drawable.Drawable! getLogo();
+ method @androidx.resourceinspection.annotation.Attribute("androidx.appcompat:logoDescription") public CharSequence! getLogoDescription();
+ method @androidx.resourceinspection.annotation.Attribute("androidx.appcompat:menu") public android.view.Menu! getMenu();
+ method @androidx.resourceinspection.annotation.Attribute("androidx.appcompat:navigationContentDescription") public CharSequence? getNavigationContentDescription();
+ method @androidx.resourceinspection.annotation.Attribute("androidx.appcompat:navigationIcon") public android.graphics.drawable.Drawable? getNavigationIcon();
+ method public android.graphics.drawable.Drawable? getOverflowIcon();
+ method @StyleRes @androidx.resourceinspection.annotation.Attribute("androidx.appcompat:popupTheme") public int getPopupTheme();
+ method @androidx.resourceinspection.annotation.Attribute("androidx.appcompat:subtitle") public CharSequence! getSubtitle();
+ method @androidx.resourceinspection.annotation.Attribute("androidx.appcompat:title") public CharSequence! getTitle();
+ method @androidx.resourceinspection.annotation.Attribute("androidx.appcompat:titleMarginBottom") public int getTitleMarginBottom();
+ method @androidx.resourceinspection.annotation.Attribute("androidx.appcompat:titleMarginEnd") public int getTitleMarginEnd();
+ method @androidx.resourceinspection.annotation.Attribute("androidx.appcompat:titleMarginStart") public int getTitleMarginStart();
+ method @androidx.resourceinspection.annotation.Attribute("androidx.appcompat:titleMarginTop") 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 @MainThread public void invalidateMenu();
+ 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 @MainThread public void removeMenuProvider(androidx.core.view.MenuProvider);
+ 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 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 fa5e291..7636b19 100644
--- a/appcompat/appcompat/build.gradle
+++ b/appcompat/appcompat/build.gradle
@@ -10,7 +10,7 @@
}
dependencies {
- api("androidx.annotation:annotation:1.3.0-alpha01")
+ api(project(":annotation:annotation"))
api(project(":core:core"))
implementation(project(":emoji2:emoji2"))
diff --git a/appcompat/appcompat/src/main/java/androidx/appcompat/widget/SearchView.java b/appcompat/appcompat/src/main/java/androidx/appcompat/widget/SearchView.java
index 4cd49e1..5eb42c5 100644
--- a/appcompat/appcompat/src/main/java/androidx/appcompat/widget/SearchView.java
+++ b/appcompat/appcompat/src/main/java/androidx/appcompat/widget/SearchView.java
@@ -1594,7 +1594,7 @@
Intent queryIntent = new Intent(Intent.ACTION_SEARCH);
queryIntent.setComponent(searchActivity);
PendingIntent pending = PendingIntent.getActivity(getContext(), 0, queryIntent,
- PendingIntent.FLAG_ONE_SHOT);
+ PendingIntent.FLAG_ONE_SHOT | PendingIntent.FLAG_MUTABLE);
// Now set up the bundle that will be inserted into the pending intent
// when it's time to do the search. We always build it here (even if empty)
diff --git a/appsearch/appsearch-local-storage/api/api_lint.ignore b/appsearch/appsearch-local-storage/api/api_lint.ignore
new file mode 100644
index 0000000..b8ebde2
--- /dev/null
+++ b/appsearch/appsearch-local-storage/api/api_lint.ignore
@@ -0,0 +1,3 @@
+// Baseline format: 1.0
+AsyncSuffixFuture: androidx.appsearch.localstorage.LocalStorage#createSearchSession(androidx.appsearch.localstorage.LocalStorage.SearchContext):
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
diff --git a/appsearch/appsearch-local-storage/src/androidTest/java/androidx/appsearch/localstorage/AppSearchLoggerTest.java b/appsearch/appsearch-local-storage/src/androidTest/java/androidx/appsearch/localstorage/AppSearchLoggerTest.java
index 6d82c68..25303d8 100644
--- a/appsearch/appsearch-local-storage/src/androidTest/java/androidx/appsearch/localstorage/AppSearchLoggerTest.java
+++ b/appsearch/appsearch-local-storage/src/androidTest/java/androidx/appsearch/localstorage/AppSearchLoggerTest.java
@@ -154,7 +154,6 @@
.setDocumentSize(nativeDocumentSize)
.setTokenizationStats(PutDocumentStatsProto.TokenizationStats.newBuilder()
.setNumTokensIndexed(nativeNumTokensIndexed)
- .setExceededMaxTokenNum(nativeExceededMaxNumTokens)
.build())
.build();
PutDocumentStats.Builder pBuilder = new PutDocumentStats.Builder(PACKAGE_NAME, DATABASE);
@@ -170,7 +169,6 @@
nativeIndexMergeLatencyMillis);
assertThat(pStats.getNativeDocumentSizeBytes()).isEqualTo(nativeDocumentSize);
assertThat(pStats.getNativeNumTokensIndexed()).isEqualTo(nativeNumTokensIndexed);
- assertThat(pStats.getNativeExceededMaxNumTokens()).isEqualTo(nativeExceededMaxNumTokens);
}
@Test
diff --git a/appsearch/appsearch-local-storage/src/androidTest/java/androidx/appsearch/localstorage/stats/AppSearchStatsTest.java b/appsearch/appsearch-local-storage/src/androidTest/java/androidx/appsearch/localstorage/stats/AppSearchStatsTest.java
index 3d23c0a..c4f6d6c 100644
--- a/appsearch/appsearch-local-storage/src/androidTest/java/androidx/appsearch/localstorage/stats/AppSearchStatsTest.java
+++ b/appsearch/appsearch-local-storage/src/androidTest/java/androidx/appsearch/localstorage/stats/AppSearchStatsTest.java
@@ -96,8 +96,7 @@
.setNativeIndexLatencyMillis(nativeIndexLatencyMillis)
.setNativeIndexMergeLatencyMillis(nativeIndexMergeLatencyMillis)
.setNativeDocumentSizeBytes(nativeDocumentSize)
- .setNativeNumTokensIndexed(nativeNumTokensIndexed)
- .setNativeExceededMaxNumTokens(nativeExceededMaxNumTokens);
+ .setNativeNumTokensIndexed(nativeNumTokensIndexed);
final PutDocumentStats pStats = pStatsBuilder.build();
@@ -118,7 +117,6 @@
nativeIndexMergeLatencyMillis);
assertThat(pStats.getNativeDocumentSizeBytes()).isEqualTo(nativeDocumentSize);
assertThat(pStats.getNativeNumTokensIndexed()).isEqualTo(nativeNumTokensIndexed);
- assertThat(pStats.getNativeExceededMaxNumTokens()).isEqualTo(nativeExceededMaxNumTokens);
}
@Test
diff --git a/appsearch/appsearch-local-storage/src/main/java/androidx/appsearch/localstorage/AppSearchLoggerHelper.java b/appsearch/appsearch-local-storage/src/main/java/androidx/appsearch/localstorage/AppSearchLoggerHelper.java
index 5f19263..514b0aa 100644
--- a/appsearch/appsearch-local-storage/src/main/java/androidx/appsearch/localstorage/AppSearchLoggerHelper.java
+++ b/appsearch/appsearch-local-storage/src/main/java/androidx/appsearch/localstorage/AppSearchLoggerHelper.java
@@ -64,9 +64,7 @@
.setNativeIndexMergeLatencyMillis(fromNativeStats.getIndexMergeLatencyMs())
.setNativeDocumentSizeBytes(fromNativeStats.getDocumentSize())
.setNativeNumTokensIndexed(
- fromNativeStats.getTokenizationStats().getNumTokensIndexed())
- .setNativeExceededMaxNumTokens(
- fromNativeStats.getTokenizationStats().getExceededMaxTokenNum());
+ fromNativeStats.getTokenizationStats().getNumTokensIndexed());
}
/**
diff --git a/appsearch/appsearch-local-storage/src/main/java/androidx/appsearch/localstorage/stats/PutDocumentStats.java b/appsearch/appsearch-local-storage/src/main/java/androidx/appsearch/localstorage/stats/PutDocumentStats.java
index 3bcc5cb..c8bc687 100644
--- a/appsearch/appsearch-local-storage/src/main/java/androidx/appsearch/localstorage/stats/PutDocumentStats.java
+++ b/appsearch/appsearch-local-storage/src/main/java/androidx/appsearch/localstorage/stats/PutDocumentStats.java
@@ -65,12 +65,6 @@
/** Number of tokens added to the index. */
private final int mNativeNumTokensIndexed;
- /**
- * Whether the number of tokens to be indexed exceeded the max number of tokens per
- * document.
- */
- private final boolean mNativeExceededMaxNumTokens;
-
PutDocumentStats(@NonNull Builder builder) {
Preconditions.checkNotNull(builder);
mPackageName = builder.mPackageName;
@@ -85,7 +79,6 @@
mNativeIndexMergeLatencyMillis = builder.mNativeIndexMergeLatencyMillis;
mNativeDocumentSizeBytes = builder.mNativeDocumentSizeBytes;
mNativeNumTokensIndexed = builder.mNativeNumTokensIndexed;
- mNativeExceededMaxNumTokens = builder.mNativeExceededMaxNumTokens;
}
/** Returns calling package name. */
@@ -151,14 +144,6 @@
return mNativeNumTokensIndexed;
}
- /**
- * Returns whether the number of tokens to be indexed exceeded the max number of tokens per
- * document.
- */
- public boolean getNativeExceededMaxNumTokens() {
- return mNativeExceededMaxNumTokens;
- }
-
/** Builder for {@link PutDocumentStats}. */
public static class Builder {
@NonNull
@@ -176,7 +161,6 @@
int mNativeIndexMergeLatencyMillis;
int mNativeDocumentSizeBytes;
int mNativeNumTokensIndexed;
- boolean mNativeExceededMaxNumTokens;
/** Builder for {@link PutDocumentStats} */
public Builder(@NonNull String packageName, @NonNull String database) {
@@ -259,16 +243,6 @@
}
/**
- * Sets whether the number of tokens to be indexed exceeded the max number of tokens per
- * document.
- */
- @NonNull
- public Builder setNativeExceededMaxNumTokens(boolean nativeExceededMaxNumTokens) {
- mNativeExceededMaxNumTokens = nativeExceededMaxNumTokens;
- return this;
- }
-
- /**
* Creates a new {@link PutDocumentStats} object from the contents of this
* {@link Builder} instance.
*/
diff --git a/appsearch/appsearch-platform-storage/api/api_lint.ignore b/appsearch/appsearch-platform-storage/api/api_lint.ignore
new file mode 100644
index 0000000..0b6d021
--- /dev/null
+++ b/appsearch/appsearch-platform-storage/api/api_lint.ignore
@@ -0,0 +1,5 @@
+// Baseline format: 1.0
+AsyncSuffixFuture: androidx.appsearch.platformstorage.PlatformStorage#createGlobalSearchSession(androidx.appsearch.platformstorage.PlatformStorage.GlobalSearchContext):
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
+AsyncSuffixFuture: androidx.appsearch.platformstorage.PlatformStorage#createSearchSession(androidx.appsearch.platformstorage.PlatformStorage.SearchContext):
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
diff --git a/appsearch/appsearch-platform-storage/lint-baseline.xml b/appsearch/appsearch-platform-storage/lint-baseline.xml
index f23e084..44550f6 100644
--- a/appsearch/appsearch-platform-storage/lint-baseline.xml
+++ b/appsearch/appsearch-platform-storage/lint-baseline.xml
@@ -1,5 +1,181 @@
<?xml version="1.0" encoding="UTF-8"?>
-<issues format="6" by="lint 7.1.0-alpha03" type="baseline" client="gradle" name="AGP (7.1.0-alpha03)" variant="all" version="7.1.0-alpha03">
+<issues format="6" by="lint 7.1.0-dev" type="baseline" client="gradle" dependencies="false" name="AGP (7.1.0-dev)" variant="all" version="7.1.0-dev">
+
+ <issue
+ id="NewApi"
+ message="Call requires API level S (current min is 14): `Builder`"
+ errorLine1=" new PlatformStorage.SearchContext.Builder("
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/androidTest/java/androidx/appsearch/platformstorage/PlatformStorageTest.java"
+ line="34"
+ column="17"/>
+ </issue>
+
+ <issue
+ id="NewApi"
+ message="Call requires API level S (current min is 14): `build`"
+ errorLine1=" /*databaseName=*/"dbName").build();"
+ errorLine2=" ~~~~~">
+ <location
+ file="src/androidTest/java/androidx/appsearch/platformstorage/PlatformStorageTest.java"
+ line="36"
+ column="52"/>
+ </issue>
+
+ <issue
+ id="NewApi"
+ message="Call requires API level S (current min is 14): `getDatabaseName`"
+ errorLine1=" assertThat(searchContext.getDatabaseName()).isEqualTo("dbName");"
+ errorLine2=" ~~~~~~~~~~~~~~~">
+ <location
+ file="src/androidTest/java/androidx/appsearch/platformstorage/PlatformStorageTest.java"
+ line="38"
+ column="34"/>
+ </issue>
+
+ <issue
+ id="NewApi"
+ message="Call requires API level S (current min is 14): `Builder`"
+ errorLine1=" PlatformStorage.SearchContext searchContext = new PlatformStorage.SearchContext.Builder("
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/androidTest/java/androidx/appsearch/platformstorage/PlatformStorageTest.java"
+ line="44"
+ column="55"/>
+ </issue>
+
+ <issue
+ id="NewApi"
+ message="Call requires API level S (current min is 14): `setWorkerExecutor`"
+ errorLine1=" .setWorkerExecutor(executor)"
+ errorLine2=" ~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/androidTest/java/androidx/appsearch/platformstorage/PlatformStorageTest.java"
+ line="47"
+ column="18"/>
+ </issue>
+
+ <issue
+ id="NewApi"
+ message="Call requires API level S (current min is 14): `build`"
+ errorLine1=" .build();"
+ errorLine2=" ~~~~~">
+ <location
+ file="src/androidTest/java/androidx/appsearch/platformstorage/PlatformStorageTest.java"
+ line="48"
+ column="18"/>
+ </issue>
+
+ <issue
+ id="NewApi"
+ message="Call requires API level S (current min is 14): `getWorkerExecutor`"
+ errorLine1=" assertThat(searchContext.getWorkerExecutor()).isEqualTo(executor);"
+ errorLine2=" ~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/androidTest/java/androidx/appsearch/platformstorage/PlatformStorageTest.java"
+ line="50"
+ column="34"/>
+ </issue>
+
+ <issue
+ id="NewApi"
+ message="Call requires API level S (current min is 14): `getDatabaseName`"
+ errorLine1=" assertThat(searchContext.getDatabaseName()).isEqualTo("dbName");"
+ errorLine2=" ~~~~~~~~~~~~~~~">
+ <location
+ file="src/androidTest/java/androidx/appsearch/platformstorage/PlatformStorageTest.java"
+ line="51"
+ column="34"/>
+ </issue>
+
+ <issue
+ id="NewApi"
+ message="Call requires API level S (current min is 14): `Builder`"
+ errorLine1=" PlatformStorage.SearchContext searchContext = new PlatformStorage.SearchContext.Builder("
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/androidTest/java/androidx/appsearch/platformstorage/PlatformStorageTest.java"
+ line="56"
+ column="55"/>
+ </issue>
+
+ <issue
+ id="NewApi"
+ message="Call requires API level S (current min is 14): `build`"
+ errorLine1=" .build();"
+ errorLine2=" ~~~~~">
+ <location
+ file="src/androidTest/java/androidx/appsearch/platformstorage/PlatformStorageTest.java"
+ line="59"
+ column="18"/>
+ </issue>
+
+ <issue
+ id="NewApi"
+ message="Call requires API level S (current min is 14): `getWorkerExecutor`"
+ errorLine1=" assertThat(searchContext.getWorkerExecutor()).isNotNull();"
+ errorLine2=" ~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/androidTest/java/androidx/appsearch/platformstorage/PlatformStorageTest.java"
+ line="61"
+ column="34"/>
+ </issue>
+
+ <issue
+ id="NewApi"
+ message="Call requires API level S (current min is 14): `getDatabaseName`"
+ errorLine1=" assertThat(searchContext.getDatabaseName()).isEqualTo("dbName");"
+ errorLine2=" ~~~~~~~~~~~~~~~">
+ <location
+ file="src/androidTest/java/androidx/appsearch/platformstorage/PlatformStorageTest.java"
+ line="62"
+ column="34"/>
+ </issue>
+
+ <issue
+ id="NewApi"
+ message="Call requires API level S (current min is 14): `Builder`"
+ errorLine1=" () -> new PlatformStorage.SearchContext.Builder("
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/androidTest/java/androidx/appsearch/platformstorage/PlatformStorageTest.java"
+ line="71"
+ column="23"/>
+ </issue>
+
+ <issue
+ id="NewApi"
+ message="Call requires API level S (current min is 14): `build`"
+ errorLine1=" "testDatabaseNameEndWith/").build());"
+ errorLine2=" ~~~~~">
+ <location
+ file="src/androidTest/java/androidx/appsearch/platformstorage/PlatformStorageTest.java"
+ line="73"
+ column="53"/>
+ </issue>
+
+ <issue
+ id="NewApi"
+ message="Call requires API level S (current min is 14): `Builder`"
+ errorLine1=" () -> new PlatformStorage.SearchContext.Builder("
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/androidTest/java/androidx/appsearch/platformstorage/PlatformStorageTest.java"
+ line="76"
+ column="23"/>
+ </issue>
+
+ <issue
+ id="NewApi"
+ message="Call requires API level S (current min is 14): `build`"
+ errorLine1=" "/testDatabaseNameStartWith").build());"
+ errorLine2=" ~~~~~">
+ <location
+ file="src/androidTest/java/androidx/appsearch/platformstorage/PlatformStorageTest.java"
+ line="78"
+ column="55"/>
+ </issue>
<issue
id="WrongConstant"
@@ -239,7 +415,7 @@
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~">
<location
file="src/main/java/androidx/appsearch/platformstorage/SearchResultsImpl.java"
- line="71"
+ line="90"
column="48"/>
</issue>
diff --git a/appsearch/appsearch/api/api_lint.ignore b/appsearch/appsearch/api/api_lint.ignore
index 2f4353e..36bb389 100644
--- a/appsearch/appsearch/api/api_lint.ignore
+++ b/appsearch/appsearch/api/api_lint.ignore
@@ -1,4 +1,30 @@
// Baseline format: 1.0
+AsyncSuffixFuture: androidx.appsearch.app.AppSearchSession#getByDocumentId(androidx.appsearch.app.GetByDocumentIdRequest):
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
+AsyncSuffixFuture: androidx.appsearch.app.AppSearchSession#getNamespaces():
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
+AsyncSuffixFuture: androidx.appsearch.app.AppSearchSession#getSchema():
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
+AsyncSuffixFuture: androidx.appsearch.app.AppSearchSession#getStorageInfo():
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
+AsyncSuffixFuture: androidx.appsearch.app.AppSearchSession#put(androidx.appsearch.app.PutDocumentsRequest):
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
+AsyncSuffixFuture: androidx.appsearch.app.AppSearchSession#remove(String, androidx.appsearch.app.SearchSpec):
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
+AsyncSuffixFuture: androidx.appsearch.app.AppSearchSession#remove(androidx.appsearch.app.RemoveByDocumentIdRequest):
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
+AsyncSuffixFuture: androidx.appsearch.app.AppSearchSession#reportUsage(androidx.appsearch.app.ReportUsageRequest):
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
+AsyncSuffixFuture: androidx.appsearch.app.AppSearchSession#requestFlush():
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
+AsyncSuffixFuture: androidx.appsearch.app.AppSearchSession#setSchema(androidx.appsearch.app.SetSchemaRequest):
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
+AsyncSuffixFuture: androidx.appsearch.app.GlobalSearchSession#reportSystemUsage(androidx.appsearch.app.ReportSystemUsageRequest):
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
+AsyncSuffixFuture: androidx.appsearch.app.SearchResults#getNextPage():
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
+
+
NullableCollection: androidx.appsearch.app.GenericDocument#getPropertyDocumentArray(String):
Return type of method androidx.appsearch.app.GenericDocument.getPropertyDocumentArray(String) is a nullable collection (`androidx.appsearch.app.GenericDocument[]`); must be non-null
NullableCollection: androidx.appsearch.app.GenericDocument#getPropertyStringArray(String):
diff --git a/benchmark/benchmark-common/src/androidTest/java/androidx/benchmark/ResultWriterTest.kt b/benchmark/benchmark-common/src/androidTest/java/androidx/benchmark/ResultWriterTest.kt
index 4e863ae..02231c1d 100644
--- a/benchmark/benchmark-common/src/androidTest/java/androidx/benchmark/ResultWriterTest.kt
+++ b/benchmark/benchmark-common/src/androidTest/java/androidx/benchmark/ResultWriterTest.kt
@@ -38,6 +38,14 @@
data = listOf(100.0, 101.0, 102.0)
)
)
+ private val sampledMetricIterationData = listOf(listOf(0.0), listOf(50.0), listOf(100.0))
+ private val sampledMetricResults = listOf(
+ MetricResult(
+ name = "frameTimeMs",
+ iterationData = sampledMetricIterationData,
+ data = sampledMetricIterationData.flatten()
+ )
+ )
private val reportA = BenchmarkResult(
testName = "MethodA",
@@ -52,7 +60,10 @@
testName = "MethodB",
className = "package.Class2",
totalRunTimeNs = 900000000,
- metrics = metricResults,
+ metrics = BenchmarkResult.Measurements(
+ singleMetrics = metricResults,
+ sampledMetrics = sampledMetricResults
+ ),
repeatIterations = 100000,
thermalThrottleSleepSeconds = 90000000,
warmupIterations = 8000
@@ -113,6 +124,7 @@
]
}
},
+ "sampledMetrics": {},
"warmupIterations": 8000,
"repeatIterations": 100000,
"thermalThrottleSleepSeconds": 90000000
@@ -134,6 +146,25 @@
]
}
},
+ "sampledMetrics": {
+ "frameTimeMs": {
+ "P50": 50.0,
+ "P90": 90.0,
+ "P95": 94.99999999999999,
+ "P99": 99.0,
+ "runs": [
+ [
+ 0.0
+ ],
+ [
+ 50.0
+ ],
+ [
+ 100.0
+ ]
+ ]
+ }
+ },
"warmupIterations": 8000,
"repeatIterations": 100000,
"thermalThrottleSleepSeconds": 90000000
diff --git a/benchmark/benchmark-common/src/main/java/androidx/benchmark/BenchmarkResult.kt b/benchmark/benchmark-common/src/main/java/androidx/benchmark/BenchmarkResult.kt
index 502b189..b2119a7 100644
--- a/benchmark/benchmark-common/src/main/java/androidx/benchmark/BenchmarkResult.kt
+++ b/benchmark/benchmark-common/src/main/java/androidx/benchmark/BenchmarkResult.kt
@@ -29,15 +29,46 @@
public data class BenchmarkResult(
val className: String,
val testName: String,
- @JvmField // Suppress API lint (using JvmField instead of @Suppress to workaround b/175063229))
val totalRunTimeNs: Long,
- val metrics: List<MetricResult>,
+ val metrics: Measurements,
val repeatIterations: Int,
- @JvmField // Suppress API lint (using JvmField instead of @Suppress to workaround b/175063229))
val thermalThrottleSleepSeconds: Long,
val warmupIterations: Int
) {
+ /**
+ * Simplified constructor, without sampled metrics, for micro benchmarks.
+ */
+ constructor(
+ className: String,
+ testName: String,
+ totalRunTimeNs: Long,
+ metrics: List<MetricResult>,
+ repeatIterations: Int,
+ thermalThrottleSleepSeconds: Long,
+ warmupIterations: Int
+ ) : this(
+ className = className,
+ testName = testName,
+ totalRunTimeNs = totalRunTimeNs,
+ metrics = Measurements(
+ singleMetrics = metrics,
+ sampledMetrics = emptyList()
+ ),
+ repeatIterations = repeatIterations,
+ thermalThrottleSleepSeconds = thermalThrottleSleepSeconds,
+ warmupIterations = warmupIterations
+ )
public fun getMetricResult(which: String): MetricResult {
- return metrics.first { it.name == which }
+ return metrics.singleMetrics.first { it.name == which }
+ }
+
+ /**
+ * Final metric results from a full benchmark test, merged across multiple iterations.
+ */
+ data class Measurements(
+ val singleMetrics: List<MetricResult>,
+ val sampledMetrics: List<MetricResult>
+ ) {
+ fun isNotEmpty() = singleMetrics.isNotEmpty() || sampledMetrics.isNotEmpty()
}
}
diff --git a/benchmark/benchmark-common/src/main/java/androidx/benchmark/MetricResult.kt b/benchmark/benchmark-common/src/main/java/androidx/benchmark/MetricResult.kt
index d9d99bb..19c34ca 100644
--- a/benchmark/benchmark-common/src/main/java/androidx/benchmark/MetricResult.kt
+++ b/benchmark/benchmark-common/src/main/java/androidx/benchmark/MetricResult.kt
@@ -30,15 +30,21 @@
@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
public class MetricResult(
val name: String,
- val data: List<Double>
+ val data: List<Double>,
+ val iterationData: List<List<Double>>? = null
) {
- public val median: Double
- public val medianIndex: Int
- public val min: Double
- public val minIndex: Int
- public val max: Double
- public val maxIndex: Int
- public val standardDeviation: Double
+ val median: Double
+ val medianIndex: Int
+ val min: Double
+ val minIndex: Int
+ val max: Double
+ val maxIndex: Int
+ val standardDeviation: Double
+
+ val p50: Double
+ val p90: Double
+ val p95: Double
+ val p99: Double
init {
val values = data.sorted()
@@ -50,6 +56,11 @@
max = values.last()
median = getPercentile(values, 50)
+ p50 = getPercentile(values, 50)
+ p90 = getPercentile(values, 90)
+ p95 = getPercentile(values, 95)
+ p99 = getPercentile(values, 99)
+
minIndex = data.indexOfFirst { it == min }
maxIndex = data.indexOfFirst { it == max }
medianIndex = data.size / 2
@@ -76,6 +87,16 @@
status.putDouble("${prefix}${bundleName}_stddev", standardDeviation)
}
+ public fun putPercentilesInBundle(status: Bundle, prefix: String) {
+ // format string to be in instrumentation results format
+ val bundleName = name.toOutputMetricName()
+
+ status.putDouble("${prefix}${bundleName}_p50", p50)
+ status.putDouble("${prefix}${bundleName}_p90", p90)
+ status.putDouble("${prefix}${bundleName}_p95", p95)
+ status.putDouble("${prefix}${bundleName}_p99", p99)
+ }
+
// NOTE: Studio-generated, re-generate if members change
override fun equals(other: Any?): Boolean {
if (this === other) return true
diff --git a/benchmark/benchmark-common/src/main/java/androidx/benchmark/ResultWriter.kt b/benchmark/benchmark-common/src/main/java/androidx/benchmark/ResultWriter.kt
index 96ff17b..cce06ae 100644
--- a/benchmark/benchmark-common/src/main/java/androidx/benchmark/ResultWriter.kt
+++ b/benchmark/benchmark-common/src/main/java/androidx/benchmark/ResultWriter.kt
@@ -126,7 +126,10 @@
.name("params").paramsObject(benchmarkResult)
.name("className").value(benchmarkResult.className)
.name("totalRunTimeNs").value(benchmarkResult.totalRunTimeNs)
- .name("metrics").metricsContainerObject(benchmarkResult.metrics)
+ .name("metrics").metricsContainerObject(benchmarkResult.metrics.singleMetrics)
+ .name("sampledMetrics").sampledMetricsContainerObject(
+ benchmarkResult.metrics.sampledMetrics
+ )
.name("warmupIterations").value(benchmarkResult.warmupIterations)
.name("repeatIterations").value(benchmarkResult.repeatIterations)
.name("thermalThrottleSleepSeconds").value(benchmarkResult.thermalThrottleSleepSeconds)
@@ -136,9 +139,9 @@
private fun JsonWriter.metricResultObject(
metricResult: MetricResult
): JsonWriter {
- name("minimum").value(metricResult.min.toFloat())
- name("maximum").value(metricResult.max.toFloat())
- name("median").value(metricResult.median.toFloat())
+ name("minimum").value(metricResult.min)
+ name("maximum").value(metricResult.max)
+ name("median").value(metricResult.median)
return this
}
@@ -157,6 +160,35 @@
return endObject()
}
+ private fun JsonWriter.sampledMetricResultObject(
+ metricResult: MetricResult
+ ): JsonWriter {
+ name("P50").value(metricResult.p50)
+ name("P90").value(metricResult.p90)
+ name("P95").value(metricResult.p95)
+ name("P99").value(metricResult.p99)
+ return this
+ }
+
+ private fun JsonWriter.sampledMetricsContainerObject(
+ metricResults: List<MetricResult>
+ ): JsonWriter {
+ beginObject()
+ metricResults.forEach { metricResult ->
+ name(metricResult.name).beginObject()
+ sampledMetricResultObject(metricResult)
+ name("runs").beginArray()
+ metricResult.iterationData!!.forEach { iterationValues ->
+ beginArray()
+ iterationValues.forEach { value(it) }
+ endArray()
+ }
+ endArray()
+ endObject()
+ }
+ return endObject()
+ }
+
private fun JsonWriter.paramsObject(benchmarkResult: BenchmarkResult): JsonWriter {
beginObject()
getParams(benchmarkResult.testName).forEach { name(it.key).value(it.value) }
diff --git a/benchmark/benchmark-common/src/main/java/androidx/benchmark/perfetto/PerfettoCaptureWrapper.kt b/benchmark/benchmark-common/src/main/java/androidx/benchmark/perfetto/PerfettoCaptureWrapper.kt
index 11ebeb0..8c510cb 100644
--- a/benchmark/benchmark-common/src/main/java/androidx/benchmark/perfetto/PerfettoCaptureWrapper.kt
+++ b/benchmark/benchmark-common/src/main/java/androidx/benchmark/perfetto/PerfettoCaptureWrapper.kt
@@ -62,8 +62,8 @@
packages: List<String>,
block: () -> Unit
): String? {
- if (Build.VERSION.SDK_INT < Build.VERSION_CODES.Q) {
- return null // tracing currently not supported on this version
+ if (Build.VERSION.SDK_INT < 21) {
+ return null // tracing not supported
}
// Prior to Android 11 (R), a shell property must be set to enable perfetto tracing, see
diff --git a/benchmark/benchmark-macro-junit4/api/current.txt b/benchmark/benchmark-macro-junit4/api/current.txt
index 1c277c8..cdd2265 100644
--- a/benchmark/benchmark-macro-junit4/api/current.txt
+++ b/benchmark/benchmark-macro-junit4/api/current.txt
@@ -1,7 +1,7 @@
// Signature format: 4.0
package androidx.benchmark.macro.junit4 {
- @RequiresApi(29) public final class MacrobenchmarkRule implements org.junit.rules.TestRule {
+ @RequiresApi(23) public final class MacrobenchmarkRule implements org.junit.rules.TestRule {
ctor public MacrobenchmarkRule();
method public org.junit.runners.model.Statement apply(org.junit.runners.model.Statement base, org.junit.runner.Description description);
method public void measureRepeated(String packageName, java.util.List<? extends androidx.benchmark.macro.Metric> metrics, optional androidx.benchmark.macro.CompilationMode compilationMode, optional androidx.benchmark.macro.StartupMode? startupMode, @IntRange(from=1) int iterations, optional kotlin.jvm.functions.Function1<? super androidx.benchmark.macro.MacrobenchmarkScope,kotlin.Unit> setupBlock, kotlin.jvm.functions.Function1<? super androidx.benchmark.macro.MacrobenchmarkScope,kotlin.Unit> measureBlock);
diff --git a/benchmark/benchmark-macro-junit4/api/public_plus_experimental_current.txt b/benchmark/benchmark-macro-junit4/api/public_plus_experimental_current.txt
index 1c277c8..cdd2265 100644
--- a/benchmark/benchmark-macro-junit4/api/public_plus_experimental_current.txt
+++ b/benchmark/benchmark-macro-junit4/api/public_plus_experimental_current.txt
@@ -1,7 +1,7 @@
// Signature format: 4.0
package androidx.benchmark.macro.junit4 {
- @RequiresApi(29) public final class MacrobenchmarkRule implements org.junit.rules.TestRule {
+ @RequiresApi(23) public final class MacrobenchmarkRule implements org.junit.rules.TestRule {
ctor public MacrobenchmarkRule();
method public org.junit.runners.model.Statement apply(org.junit.runners.model.Statement base, org.junit.runner.Description description);
method public void measureRepeated(String packageName, java.util.List<? extends androidx.benchmark.macro.Metric> metrics, optional androidx.benchmark.macro.CompilationMode compilationMode, optional androidx.benchmark.macro.StartupMode? startupMode, @IntRange(from=1) int iterations, optional kotlin.jvm.functions.Function1<? super androidx.benchmark.macro.MacrobenchmarkScope,kotlin.Unit> setupBlock, kotlin.jvm.functions.Function1<? super androidx.benchmark.macro.MacrobenchmarkScope,kotlin.Unit> measureBlock);
diff --git a/benchmark/benchmark-macro-junit4/api/restricted_current.txt b/benchmark/benchmark-macro-junit4/api/restricted_current.txt
index 1c277c8..cdd2265 100644
--- a/benchmark/benchmark-macro-junit4/api/restricted_current.txt
+++ b/benchmark/benchmark-macro-junit4/api/restricted_current.txt
@@ -1,7 +1,7 @@
// Signature format: 4.0
package androidx.benchmark.macro.junit4 {
- @RequiresApi(29) public final class MacrobenchmarkRule implements org.junit.rules.TestRule {
+ @RequiresApi(23) public final class MacrobenchmarkRule implements org.junit.rules.TestRule {
ctor public MacrobenchmarkRule();
method public org.junit.runners.model.Statement apply(org.junit.runners.model.Statement base, org.junit.runner.Description description);
method public void measureRepeated(String packageName, java.util.List<? extends androidx.benchmark.macro.Metric> metrics, optional androidx.benchmark.macro.CompilationMode compilationMode, optional androidx.benchmark.macro.StartupMode? startupMode, @IntRange(from=1) int iterations, optional kotlin.jvm.functions.Function1<? super androidx.benchmark.macro.MacrobenchmarkScope,kotlin.Unit> setupBlock, kotlin.jvm.functions.Function1<? super androidx.benchmark.macro.MacrobenchmarkScope,kotlin.Unit> measureBlock);
diff --git a/benchmark/benchmark-macro-junit4/src/main/java/androidx/benchmark/macro/junit4/MacrobenchmarkRule.kt b/benchmark/benchmark-macro-junit4/src/main/java/androidx/benchmark/macro/junit4/MacrobenchmarkRule.kt
index dee3d44..6086762 100644
--- a/benchmark/benchmark-macro-junit4/src/main/java/androidx/benchmark/macro/junit4/MacrobenchmarkRule.kt
+++ b/benchmark/benchmark-macro-junit4/src/main/java/androidx/benchmark/macro/junit4/MacrobenchmarkRule.kt
@@ -33,7 +33,7 @@
/**
* JUnit rule for benchmarking large app operations like startup.
*/
-@RequiresApi(29)
+@RequiresApi(23)
public class MacrobenchmarkRule : TestRule {
private lateinit var currentDescription: Description
diff --git a/benchmark/benchmark-macro/api/current.txt b/benchmark/benchmark-macro/api/current.txt
index ab04416..3b186e6 100644
--- a/benchmark/benchmark-macro/api/current.txt
+++ b/benchmark/benchmark-macro/api/current.txt
@@ -35,6 +35,9 @@
public final class IdeSummaryStringKt {
}
+ public final class IterationResultKt {
+ }
+
public final class MacrobenchmarkKt {
}
@@ -50,9 +53,6 @@
public abstract sealed class Metric {
}
- public final class MetricKt {
- }
-
public final class MetricResultExtensionsKt {
}
diff --git a/benchmark/benchmark-macro/api/public_plus_experimental_current.txt b/benchmark/benchmark-macro/api/public_plus_experimental_current.txt
index ab04416..3b186e6 100644
--- a/benchmark/benchmark-macro/api/public_plus_experimental_current.txt
+++ b/benchmark/benchmark-macro/api/public_plus_experimental_current.txt
@@ -35,6 +35,9 @@
public final class IdeSummaryStringKt {
}
+ public final class IterationResultKt {
+ }
+
public final class MacrobenchmarkKt {
}
@@ -50,9 +53,6 @@
public abstract sealed class Metric {
}
- public final class MetricKt {
- }
-
public final class MetricResultExtensionsKt {
}
diff --git a/benchmark/benchmark-macro/api/restricted_current.txt b/benchmark/benchmark-macro/api/restricted_current.txt
index ada513d..6ae5bc9 100644
--- a/benchmark/benchmark-macro/api/restricted_current.txt
+++ b/benchmark/benchmark-macro/api/restricted_current.txt
@@ -32,15 +32,18 @@
method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public static boolean isSupportedWithVmSettings(androidx.benchmark.macro.CompilationMode);
}
+ @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public final class FrameTimingGfxInfoMetric extends androidx.benchmark.macro.Metric {
+ ctor public FrameTimingGfxInfoMetric();
+ }
+
public final class FrameTimingMetric extends androidx.benchmark.macro.Metric {
ctor public FrameTimingMetric();
}
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public final class FrameTimingTraceMetric extends androidx.benchmark.macro.Metric {
- ctor public FrameTimingTraceMetric();
+ public final class IdeSummaryStringKt {
}
- public final class IdeSummaryStringKt {
+ public final class IterationResultKt {
}
public final class MacrobenchmarkKt {
@@ -58,9 +61,6 @@
public abstract sealed class Metric {
}
- public final class MetricKt {
- }
-
public final class MetricResultExtensionsKt {
}
diff --git a/benchmark/benchmark-macro/src/androidTest/java/androidx/benchmark/macro/IdeSummaryStringTest.kt b/benchmark/benchmark-macro/src/androidTest/java/androidx/benchmark/macro/IdeSummaryStringTest.kt
index aa7cd9e..a150eee 100644
--- a/benchmark/benchmark-macro/src/androidTest/java/androidx/benchmark/macro/IdeSummaryStringTest.kt
+++ b/benchmark/benchmark-macro/src/androidTest/java/androidx/benchmark/macro/IdeSummaryStringTest.kt
@@ -16,6 +16,7 @@
package androidx.benchmark.macro
+import androidx.benchmark.BenchmarkResult
import androidx.benchmark.MetricResult
import androidx.benchmark.Outputs
import androidx.test.ext.junit.runners.AndroidJUnit4
@@ -36,7 +37,7 @@
}
@Test
- public fun minimalSample() {
+ public fun singleMinimal() {
val metricResult = MetricResult("Metric", listOf(0.0, 1.1, 2.2))
assertEquals(0, metricResult.minIndex)
@@ -46,7 +47,10 @@
val (summaryV1, summaryV2) = ideSummaryStrings(
warningLines = "",
benchmarkName = "foo",
- metricResults = listOf(metricResult),
+ measurements = BenchmarkResult.Measurements(
+ singleMetrics = listOf(metricResult),
+ sampledMetrics = emptyList()
+ ),
absoluteTracePaths = absoluteTracePaths
)
assertEquals(
@@ -69,14 +73,17 @@
}
@Test
- public fun complexSample() {
+ public fun singleComplex() {
val metric1 = MetricResult("Metric1", listOf(0.0, 1.0, 2.0))
val metric2 = MetricResult("Metric2", listOf(222.0, 111.0, 0.0))
val absoluteTracePaths = createAbsoluteTracePaths(3)
val (summaryV1, summaryV2) = ideSummaryStrings(
warningLines = "",
benchmarkName = "foo",
- metricResults = listOf(metric1, metric2),
+ measurements = BenchmarkResult.Measurements(
+ singleMetrics = listOf(metric1, metric2),
+ sampledMetrics = emptyList()
+ ),
absoluteTracePaths = absoluteTracePaths
)
assertEquals(
@@ -101,13 +108,83 @@
}
@Test
- public fun warningSample() {
+ public fun sampledMinimal() {
+ val metricResult = MetricResult("Metric1", List(101) { it.toDouble() })
+ val absoluteTracePaths = createAbsoluteTracePaths(3)
+ val (summaryV1, summaryV2) = ideSummaryStrings(
+ warningLines = "",
+ benchmarkName = "foo",
+ measurements = BenchmarkResult.Measurements(
+ singleMetrics = emptyList(),
+ sampledMetrics = listOf(metricResult)
+ ),
+ absoluteTracePaths = absoluteTracePaths
+ )
+ assertEquals(
+ """
+ |foo
+ | Metric1 P50 50.0, P90 90.0, P95 95.0, P99 99.0
+ |
+ """.trimMargin(),
+ summaryV1
+ )
+ assertEquals(
+ """
+ |foo
+ | Metric1 P50 50.0, P90 90.0, P95 95.0, P99 99.0
+ | Traces: Iteration [0](file://iter0.trace) [1](file://iter1.trace) [2](file://iter2.trace)
+ |
+ """.trimMargin(),
+ summaryV2
+ )
+ }
+
+ @Test
+ public fun complex() {
+ val single = MetricResult("Metric1", listOf(0.0, 1.0, 2.0))
+ val sampled = MetricResult("Metric2", List(101) { it.toDouble() })
+ val absoluteTracePaths = createAbsoluteTracePaths(3)
+ val (summaryV1, summaryV2) = ideSummaryStrings(
+ warningLines = "",
+ benchmarkName = "foo",
+ measurements = BenchmarkResult.Measurements(
+ singleMetrics = listOf(single),
+ sampledMetrics = listOf(sampled)
+ ),
+ absoluteTracePaths = absoluteTracePaths
+ )
+ assertEquals(
+ """
+ |foo
+ | Metric1 min 0.0, median 1.0, max 2.0
+ | Metric2 P50 50.0, P90 90.0, P95 95.0, P99 99.0
+ |
+ """.trimMargin(),
+ summaryV1
+ )
+ assertEquals(
+ """
+ |foo
+ | Metric1 [min 0.0](file://iter0.trace), [median 1.0](file://iter1.trace), [max 2.0](file://iter2.trace)
+ | Metric2 P50 50.0, P90 90.0, P95 95.0, P99 99.0
+ | Traces: Iteration [0](file://iter0.trace) [1](file://iter1.trace) [2](file://iter2.trace)
+ |
+ """.trimMargin(),
+ summaryV2
+ )
+ }
+
+ @Test
+ public fun warning() {
val metricResult = MetricResult("Metric", listOf(0.0, 1.0, 2.0))
val absoluteTracePaths = createAbsoluteTracePaths(3)
val (summaryV1, summaryV2) = ideSummaryStrings(
warningLines = "warning\nstring\n",
benchmarkName = "foo",
- metricResults = listOf(metricResult),
+ measurements = BenchmarkResult.Measurements(
+ singleMetrics = listOf(metricResult),
+ sampledMetrics = emptyList()
+ ),
absoluteTracePaths = absoluteTracePaths
)
assertEquals(
@@ -139,7 +216,10 @@
ideSummaryStrings(
warningLines = "",
benchmarkName = "foo",
- metricResults = emptyList(),
+ measurements = BenchmarkResult.Measurements(
+ singleMetrics = emptyList(),
+ sampledMetrics = emptyList()
+ ),
absoluteTracePaths = emptyList()
).first
}
diff --git a/benchmark/benchmark-macro/src/androidTest/java/androidx/benchmark/macro/MacrobenchmarkTest.kt b/benchmark/benchmark-macro/src/androidTest/java/androidx/benchmark/macro/MacrobenchmarkTest.kt
index 8efef1c..77f691f 100644
--- a/benchmark/benchmark-macro/src/androidTest/java/androidx/benchmark/macro/MacrobenchmarkTest.kt
+++ b/benchmark/benchmark-macro/src/androidTest/java/androidx/benchmark/macro/MacrobenchmarkTest.kt
@@ -65,7 +65,7 @@
assertTrue(exception.message!!.contains("Require iterations > 0"))
}
- @SdkSuppress(maxSdkVersion = 28)
+ @SdkSuppress(maxSdkVersion = 22)
@Test
fun macrobenchmarkWithStartupMode_sdkVersion() {
val exception = assertFailsWith<IllegalArgumentException> {
@@ -82,6 +82,6 @@
measureBlock = {}
)
}
- assertTrue(exception.message!!.contains("requires Android 10 (API 29) or greater"))
+ assertTrue(exception.message!!.contains("requires Android 6 (API 23) or greater"))
}
}
\ No newline at end of file
diff --git a/benchmark/benchmark-macro/src/androidTest/java/androidx/benchmark/macro/MetricResultExtensionsTest.kt b/benchmark/benchmark-macro/src/androidTest/java/androidx/benchmark/macro/MetricResultExtensionsTest.kt
index 4731e40..ec10104 100644
--- a/benchmark/benchmark-macro/src/androidTest/java/androidx/benchmark/macro/MetricResultExtensionsTest.kt
+++ b/benchmark/benchmark-macro/src/androidTest/java/androidx/benchmark/macro/MetricResultExtensionsTest.kt
@@ -21,13 +21,16 @@
import androidx.test.filters.SmallTest
import org.junit.Test
import org.junit.runner.RunWith
+import java.lang.IllegalStateException
import kotlin.test.assertEquals
+import kotlin.test.assertFailsWith
+import kotlin.test.assertTrue
@RunWith(AndroidJUnit4::class)
@SmallTest
class MetricResultExtensionsTest {
@Test
- fun mergeToMetricResults_trivial() {
+ fun mergeToSingleMetricResults_trivial() {
assertEquals(
expected = listOf(
// note, bar sorted first
@@ -36,12 +39,12 @@
),
actual = listOf(
mapOf("foo" to 0.0, "bar" to 1.0)
- ).mergeToMetricResults(tracePaths = emptyList())
+ ).mergeToSingleMetricResults()
)
}
@Test
- fun mergeToMetricResults_standard() {
+ fun mergeToSingleMetricResults_standard() {
assertEquals(
expected = listOf(
// note, bar sorted first
@@ -52,12 +55,12 @@
mapOf("foo" to 100.0, "bar" to 101.0),
mapOf("foo" to 300.0, "bar" to 301.0),
mapOf("foo" to 200.0, "bar" to 201.0),
- ).mergeToMetricResults(tracePaths = emptyList())
+ ).mergeToSingleMetricResults()
)
}
@Test
- fun mergeToMetricResults_missingKey() {
+ fun mergeToSingleMetricResults_missingKey() {
assertEquals(
expected = listOf(
MetricResult("bar", listOf(101.0, 201.0)),
@@ -67,9 +70,63 @@
mapOf("foo" to 100.0, "bar" to 101.0),
mapOf("foo" to 300.0), // bar missing! Skip this iteration!
mapOf("foo" to 200.0, "bar" to 201.0),
- ).mergeToMetricResults(
- tracePaths = listOf("trace1.trace", "trace2.trace", "trace3.trace")
- )
+ ).mergeToSingleMetricResults()
)
}
+
+ @Test
+ fun mergeToSampledMetricResults_trivial() {
+ assertEquals(
+ expected = listOf(
+ // note, bar sorted first
+ MetricResult("bar", listOf(1.0)),
+ MetricResult("foo", listOf(0.0))
+ ),
+ actual = listOf(
+ mapOf("foo" to listOf(0.0), "bar" to listOf(1.0))
+ ).mergeToSampledMetricResults()
+ )
+ }
+
+ @Test
+ fun mergeToSampledMetricResults_singleMeasurement() {
+ assertEquals(
+ expected = listOf(
+ // note, bar sorted first
+ MetricResult("bar", listOf(101.0, 301.0, 201.0)),
+ MetricResult("foo", listOf(100.0, 300.0, 200.0))
+ ),
+ actual = listOf(
+ mapOf("foo" to listOf(100.0), "bar" to listOf(101.0)),
+ mapOf("foo" to listOf(300.0), "bar" to listOf(301.0)),
+ mapOf("foo" to listOf(200.0), "bar" to listOf(201.0)),
+ ).mergeToSampledMetricResults()
+ )
+ }
+
+ @Test
+ fun mergeToSampledMetricResults_standard() {
+ assertEquals(
+ expected = listOf(
+ // note, bar sorted first
+ MetricResult("bar", List(6) { it.toDouble() }),
+ MetricResult("foo", List(6) { it.toDouble() })
+ ),
+ actual = listOf(
+ mapOf("foo" to listOf(0.0, 1.0, 2.0), "bar" to listOf(0.0)),
+ mapOf("foo" to listOf(3.0, 4.0, 5.0), "bar" to listOf(1.0, 2.0, 3.0, 4.0, 5.0)),
+ ).mergeToSampledMetricResults()
+ )
+ }
+
+ @Test
+ fun mergeToSampledMetricResults_missingKey() {
+ val exception = assertFailsWith<IllegalStateException> {
+ listOf(
+ mapOf("foo" to listOf(0.0), "bar" to listOf(0.0)),
+ mapOf("foo" to listOf(1.0)),
+ ).mergeToSampledMetricResults()
+ }
+ assertTrue(exception.message!!.contains("Iteration 1 didn't capture metric bar"))
+ }
}
diff --git a/benchmark/benchmark-macro/src/androidTest/java/androidx/benchmark/macro/StartupTimingMetricTest.kt b/benchmark/benchmark-macro/src/androidTest/java/androidx/benchmark/macro/StartupTimingMetricTest.kt
index 05fed4e..6098833 100644
--- a/benchmark/benchmark-macro/src/androidTest/java/androidx/benchmark/macro/StartupTimingMetricTest.kt
+++ b/benchmark/benchmark-macro/src/androidTest/java/androidx/benchmark/macro/StartupTimingMetricTest.kt
@@ -45,10 +45,10 @@
fun noResults() {
assumeTrue(isAbiSupported())
val packageName = "fake.package.fiction.nostartups"
- val metrics = measureStartup(packageName) {
+ val iterationResult = measureStartup(packageName) {
// Do nothing
}
- assertEquals(true, metrics.metrics.isEmpty())
+ assertEquals(true, iterationResult.singleMetrics.isEmpty())
}
@LargeTest
@@ -68,17 +68,16 @@
"androidx.benchmark.integration.macrobenchmark.target.TRIVIAL_STARTUP_ACTIVITY"
}
}
- val hasStartupMetrics = "startupMs" in metrics.metrics
+ val hasStartupMetrics = "startupMs" in metrics.singleMetrics
assertEquals(hasStartupMetrics, true)
- assertNotNull(metrics.timelineStart)
- assertNotNull(metrics.timelineEnd)
+ assertNotNull(metrics.timelineRangeNs)
}
private fun validateStartup_fullyDrawn(delay: Long) {
assumeTrue(isAbiSupported())
val packageName = "androidx.benchmark.macro.test"
val scope = MacrobenchmarkScope(packageName = packageName, launchWithClearTask = true)
- val metrics = measureStartup(packageName) {
+ val iterationResult = measureStartup(packageName) {
// Simulate a warm start, since it's our own process
scope.pressHome()
scope.startActivityAndWait(
@@ -94,11 +93,11 @@
.wait(Until.findObject(By.text(ConfigurableActivity.FULLY_DRAWN_TEXT)), 3000)
}
}
- assertTrue("startupMs" in metrics.metrics)
- assertTrue("fullyDrawnMs" in metrics.metrics)
+ assertTrue("startupMs" in iterationResult.singleMetrics)
+ assertTrue("fullyDrawnMs" in iterationResult.singleMetrics)
- val startupMs = metrics.metrics["startupMs"]!!
- val fullyDrawnMs = metrics.metrics["fullyDrawnMs"]!!
+ val startupMs = iterationResult.singleMetrics["startupMs"]!!
+ val fullyDrawnMs = iterationResult.singleMetrics["fullyDrawnMs"]!!
val startupShouldBeFaster = delay > 0
assertEquals(
@@ -106,8 +105,7 @@
startupMs < fullyDrawnMs,
"startup $startupMs, fully drawn $fullyDrawnMs"
)
- assertNotNull(metrics.timelineStart)
- assertNotNull(metrics.timelineEnd)
+ assertNotNull(iterationResult.timelineRangeNs)
}
@LargeTest
@@ -133,16 +131,16 @@
val metrics = metric.getMetrics(packageName, traceFile.absolutePath)
// check known values
- val hasStartupMetrics = "startupMs" in metrics.metrics
+ val hasStartupMetrics = "startupMs" in metrics.singleMetrics
assertEquals(hasStartupMetrics, true)
- assertEquals(54.82037, metrics.metrics["startupMs"]!!, 0.0001)
- assertEquals(4131145997215L, metrics.timelineStart)
- assertEquals(4131200817585L, metrics.timelineEnd)
+ assertEquals(54.82037, metrics.singleMetrics["startupMs"]!!, 0.0001)
+ assertEquals(4131145997215L, metrics.timelineRangeNs?.first)
+ assertEquals(4131200817585L, metrics.timelineRangeNs?.last)
}
}
@RequiresApi(29)
-internal fun measureStartup(packageName: String, measureBlock: () -> Unit): MetricsWithUiState {
+internal fun measureStartup(packageName: String, measureBlock: () -> Unit): IterationResult {
val wrapper = PerfettoCaptureWrapper()
val metric = StartupTimingMetric()
metric.configure(packageName)
diff --git a/benchmark/benchmark-macro/src/androidTest/java/androidx/benchmark/macro/perfetto/FrameTimingQueryTest.kt b/benchmark/benchmark-macro/src/androidTest/java/androidx/benchmark/macro/perfetto/FrameTimingQueryTest.kt
index df2b10f..4f6af3c 100644
--- a/benchmark/benchmark-macro/src/androidTest/java/androidx/benchmark/macro/perfetto/FrameTimingQueryTest.kt
+++ b/benchmark/benchmark-macro/src/androidTest/java/androidx/benchmark/macro/perfetto/FrameTimingQueryTest.kt
@@ -17,10 +17,9 @@
package androidx.benchmark.macro.perfetto
import androidx.benchmark.macro.createTempFileFromAsset
-import androidx.benchmark.macro.perfetto.FrameTimingQuery.FrameSubMetric.BasicFrameTime
-import androidx.benchmark.macro.perfetto.FrameTimingQuery.FrameSubMetric.FrameSlackTime
-import androidx.benchmark.macro.perfetto.FrameTimingQuery.FrameSubMetric.FrameTime
-import androidx.benchmark.macro.perfetto.FrameTimingQuery.FrameSubMetric.UiFrameTime
+import androidx.benchmark.macro.perfetto.FrameTimingQuery.SubMetric.FrameCpuTime
+import androidx.benchmark.macro.perfetto.FrameTimingQuery.SubMetric.FrameNegativeSlackTime
+import androidx.benchmark.macro.perfetto.FrameTimingQuery.SubMetric.FrameUiTime
import androidx.benchmark.perfetto.PerfettoHelper.Companion.isAbiSupported
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.MediumTest
@@ -45,8 +44,8 @@
assertEquals(
expected = mapOf(
- BasicFrameTime to listOf(9907605L, 6038595L, 4812136L, 3938490L),
- UiFrameTime to listOf(3086979L, 2868490L, 2232709L, 1889479L)
+ FrameCpuTime to listOf(9907605L, 6038595L, 4812136L, 3938490L),
+ FrameUiTime to listOf(3086979L, 2868490L, 2232709L, 1889479L)
),
actual = frameSubMetrics.mapValues {
it.value.subList(0, 4)
@@ -72,17 +71,16 @@
)
assertEquals(
expected = mapOf(
- FrameTime to listOf(15292863L, 8800138L, 6474705L, 8199845L),
- BasicFrameTime to listOf(6881407L, 5648542L, 3830261L, 4343438L),
- UiFrameTime to listOf(2965052L, 3246407L, 1562188L, 1945469L),
- FrameSlackTime to listOf(5207137L, 11699862L, 14025295L, 12300155L)
+ FrameCpuTime to listOf(6881407L, 5648542L, 3830261L, 4343438L),
+ FrameUiTime to listOf(2965052L, 3246407L, 1562188L, 1945469L),
+ FrameNegativeSlackTime to listOf(-5207137L, -11699862L, -14025295L, -12300155L)
),
actual = frameSubMetrics.mapValues {
it.value.subList(0, 4)
}
)
assertEquals(
- expected = List(4) { 96 },
+ expected = List(3) { 96 },
actual = frameSubMetrics.map { it.value.size },
message = "Expect same number of frames for each metric"
)
diff --git a/benchmark/benchmark-macro/src/androidTest/java/androidx/benchmark/macro/perfetto/PerfettoResultsParserTest.kt b/benchmark/benchmark-macro/src/androidTest/java/androidx/benchmark/macro/perfetto/PerfettoResultsParserTest.kt
index cbd09db..8a55dba 100644
--- a/benchmark/benchmark-macro/src/androidTest/java/androidx/benchmark/macro/perfetto/PerfettoResultsParserTest.kt
+++ b/benchmark/benchmark-macro/src/androidTest/java/androidx/benchmark/macro/perfetto/PerfettoResultsParserTest.kt
@@ -16,7 +16,7 @@
package androidx.benchmark.macro.perfetto
-import androidx.benchmark.macro.MetricsWithUiState
+import androidx.benchmark.macro.IterationResult
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.SmallTest
import org.junit.Test
@@ -131,10 +131,10 @@
startupJson(fullyDrawn = false),
"androidx.benchmark.macro.test"
),
- MetricsWithUiState(
- metrics = mapOf("startupMs" to 149.438504),
- timelineStart = 345883080735887,
- timelineEnd = 345883230174391
+ IterationResult(
+ singleMetrics = mapOf("startupMs" to 149.438504),
+ sampledMetrics = emptyMap(),
+ timelineRangeNs = 345883080735887..345883230174391
)
)
}
@@ -146,13 +146,13 @@
startupJson(fullyDrawn = true),
"androidx.benchmark.macro.test"
),
- MetricsWithUiState(
- metrics = mapOf(
+ IterationResult(
+ singleMetrics = mapOf(
"startupMs" to 149.438504,
"fullyDrawnMs" to 204.445333
),
- timelineStart = 345883080735887,
- timelineEnd = 345883230174391
+ sampledMetrics = emptyMap(),
+ timelineRangeNs = 345883080735887..345883230174391
)
)
}
diff --git a/benchmark/benchmark-macro/src/main/java/androidx/benchmark/macro/IdeSummaryString.kt b/benchmark/benchmark-macro/src/main/java/androidx/benchmark/macro/IdeSummaryString.kt
index 56595bb..fd1de64 100644
--- a/benchmark/benchmark-macro/src/main/java/androidx/benchmark/macro/IdeSummaryString.kt
+++ b/benchmark/benchmark-macro/src/main/java/androidx/benchmark/macro/IdeSummaryString.kt
@@ -16,9 +16,9 @@
package androidx.benchmark.macro
+import androidx.benchmark.BenchmarkResult
import androidx.benchmark.MetricResult
import androidx.benchmark.Outputs
-import java.util.Collections
/**
* Returns a pair of ideSummaryStrings - v1 (pre Arctic-fox) and v2 (Arctic-fox+)
@@ -33,48 +33,62 @@
internal fun ideSummaryStrings(
warningLines: String,
benchmarkName: String,
- metricResults: List<MetricResult>,
+ measurements: BenchmarkResult.Measurements,
absoluteTracePaths: List<String>
): Pair<String, String> {
- require(metricResults.isNotEmpty()) { "Require non-empty list of metric results." }
+ require(measurements.isNotEmpty()) { "Require non-empty list of metric results." }
+ val allMetrics = measurements.singleMetrics + measurements.sampledMetrics
- val maxLabelLength = Collections.max(metricResults.map { it.name.length })
+ val maxLabelLength = allMetrics.maxOf { it.name.length }
fun Double.toDisplayString() = "%,.1f".format(this)
// max string length of any printed min/median/max is the largest max value seen. used to pad.
- val maxValueLength = metricResults
+ val maxValueLength = allMetrics
.maxOf { it.max }
.toDisplayString().length
fun ideSummaryString(
- transform: (
+ singleTransform: (
name: String,
min: String,
median: String,
max: String,
metricResult: MetricResult
) -> String
- ): String {
- return warningLines + benchmarkName + "\n" + metricResults.joinToString("\n") {
- transform(
- it.name.padStart(maxLabelLength),
- it.min.toDisplayString().padStart(maxValueLength),
- it.median.toDisplayString().padStart(maxValueLength),
- it.max.toDisplayString().padStart(maxValueLength),
- it
- )
- } + "\n"
- }
+ ) = (
+ listOf(warningLines + benchmarkName) +
+ measurements.singleMetrics.map {
+ singleTransform(
+ it.name.padStart(maxLabelLength),
+ it.min.toDisplayString().padStart(maxValueLength),
+ it.median.toDisplayString().padStart(maxValueLength),
+ it.max.toDisplayString().padStart(maxValueLength),
+ it
+ )
+ } +
+ measurements.sampledMetrics.map {
+ val name = it.name.padStart(maxLabelLength)
+ val p50 = it.p50.toDisplayString().padStart(maxValueLength)
+ val p90 = it.p90.toDisplayString().padStart(maxValueLength)
+ val p95 = it.p95.toDisplayString().padStart(maxValueLength)
+ val p99 = it.p99.toDisplayString().padStart(maxValueLength)
+ // we don't try and link percentiles, since they're grouped across multiple iters
+ " $name P50 $p50, P90 $p90, P95 $p95, P99 $p99"
+ }
+ ).joinToString("\n") + "\n"
+
val relativeTracePaths = absoluteTracePaths.map { absolutePath ->
Outputs.relativePathFor(absolutePath)
.replace("(", "\\(")
.replace(")", "\\)")
}
return Pair(
- first = ideSummaryString { name, min, median, max, _ ->
- " $name min $min, median $median, max $max"
- },
+ first = ideSummaryString(
+ singleTransform = { name, min, median, max, _ ->
+ " $name min $min, median $median, max $max"
+ }
+ ),
second = ideSummaryString { name, min, median, max, metricResult ->
" $name" +
" [min $min](file://${relativeTracePaths[metricResult.minIndex]})," +
diff --git a/benchmark/benchmark-macro/src/main/java/androidx/benchmark/macro/IterationResult.kt b/benchmark/benchmark-macro/src/main/java/androidx/benchmark/macro/IterationResult.kt
new file mode 100644
index 0000000..be38860
--- /dev/null
+++ b/benchmark/benchmark-macro/src/main/java/androidx/benchmark/macro/IterationResult.kt
@@ -0,0 +1,66 @@
+/*
+ * Copyright 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES 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.macro
+
+import androidx.benchmark.BenchmarkResult
+
+/**
+ * Metric results from a single macrobenchmark iteration.
+ */
+internal data class IterationResult(
+ /**
+ * Results for metrics that are measured once per iteration.
+ */
+ val singleMetrics: Map<String, Double>,
+
+ /**
+ * Results for metrics that are sampled multiple times per iteration, with all samples pooled.
+ */
+ val sampledMetrics: Map<String, List<Double>>,
+
+ /**
+ * Start of iteration relevant content, if easily provided, in trace-native nano timestamps.
+ *
+ * The union of all timelineRanges for a given iteration, if any are present, will determine
+ * default zoom for that iteration's trace in Studio / Perfetto UI.
+ */
+ val timelineRangeNs: LongRange? = null
+) {
+ operator fun plus(element: IterationResult) = IterationResult(
+ singleMetrics = singleMetrics + element.singleMetrics,
+ sampledMetrics = sampledMetrics + element.sampledMetrics,
+ timelineRangeNs = listOf(
+ element.timelineRangeNs,
+ this.timelineRangeNs
+ ).mergeTimelineRangeNs()
+ )
+
+ private fun List<LongRange?>.mergeTimelineRangeNs(): LongRange? {
+ filterNotNull().run {
+ return if (isNotEmpty()) {
+ (minOf { it.first })..(maxOf { it.last })
+ } else {
+ null
+ }
+ }
+ }
+}
+
+internal fun List<IterationResult>.mergeIterationMeasurements() = BenchmarkResult.Measurements(
+ singleMetrics = this.map { it.singleMetrics }.mergeToSingleMetricResults(),
+ sampledMetrics = this.map { it.sampledMetrics }.mergeToSampledMetricResults()
+)
diff --git a/benchmark/benchmark-macro/src/main/java/androidx/benchmark/macro/Macrobenchmark.kt b/benchmark/benchmark-macro/src/main/java/androidx/benchmark/macro/Macrobenchmark.kt
index f094f2f..a0451ae 100644
--- a/benchmark/benchmark-macro/src/main/java/androidx/benchmark/macro/Macrobenchmark.kt
+++ b/benchmark/benchmark-macro/src/main/java/androidx/benchmark/macro/Macrobenchmark.kt
@@ -116,8 +116,8 @@
require(metrics.isNotEmpty()) {
"Empty list of metrics passed to metrics param, must pass at least one Metric"
}
- require(Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
- "Macrobenchmark currently requires Android 10 (API 29) or greater."
+ require(Build.VERSION.SDK_INT >= 23) {
+ "Macrobenchmark currently requires Android 6 (API 23) or greater."
}
// skip benchmark if not supported by vm settings
@@ -148,7 +148,7 @@
it.configure(packageName)
}
var isFirstRun = true
- val metricResults = List(iterations) { iteration ->
+ val measurements = List(iterations) { iteration ->
userspaceTrace("setupBlock") {
setupBlock(scope, isFirstRun)
}
@@ -179,7 +179,7 @@
tracePaths.add(tracePath)
- val metricsWithUiState = userspaceTrace("extract metrics") {
+ val iterationResult = userspaceTrace("extract metrics") {
metrics
// capture list of Map<String,Long> per metric
.map { it.getMetrics(packageName, tracePath) }
@@ -188,8 +188,8 @@
}
// append UI state to trace, so tools opening trace will highlight relevant part in UI
val uiState = UiState(
- timelineStart = metricsWithUiState.timelineStart,
- timelineEnd = metricsWithUiState.timelineEnd,
+ timelineStart = iterationResult.timelineRangeNs?.first,
+ timelineEnd = iterationResult.timelineRangeNs?.last,
highlightPackage = packageName
)
File(tracePath).apply {
@@ -202,10 +202,10 @@
Log.d(TAG, "Iteration $iteration captured $uiState")
// report just the metrics
- metricsWithUiState.metrics
- }.mergeToMetricResults(tracePaths)
+ iterationResult
+ }.mergeIterationMeasurements()
- require(metricResults.isNotEmpty()) {
+ require(measurements.isNotEmpty()) {
"""
Unable to read any metrics during benchmark (metric list: $metrics).
Check that you're performing the operations to be measured. For example, if
@@ -217,12 +217,17 @@
val (summaryV1, summaryV2) = ideSummaryStrings(
warningMessage,
uniqueName,
- metricResults,
+ measurements,
tracePaths
)
ideSummaryRecord(summaryV1 = summaryV1, summaryV2 = summaryV2)
warningMessage = "" // warning only printed once
- metricResults.forEach { it.putInBundle(bundle, suppressionState?.prefix ?: "") }
+ measurements.singleMetrics.forEach {
+ it.putInBundle(bundle, suppressionState?.prefix ?: "")
+ }
+ measurements.sampledMetrics.forEach {
+ it.putPercentilesInBundle(bundle, suppressionState?.prefix ?: "")
+ }
}
val warmupIterations = if (compilationMode is CompilationMode.SpeedProfile) {
@@ -236,7 +241,7 @@
className = className,
testName = testName,
totalRunTimeNs = System.nanoTime() - startTime,
- metrics = metricResults,
+ metrics = measurements,
repeatIterations = iterations,
thermalThrottleSleepSeconds = 0,
warmupIterations = warmupIterations
diff --git a/benchmark/benchmark-macro/src/main/java/androidx/benchmark/macro/Metric.kt b/benchmark/benchmark-macro/src/main/java/androidx/benchmark/macro/Metric.kt
index 0027638..d1128a6 100644
--- a/benchmark/benchmark-macro/src/main/java/androidx/benchmark/macro/Metric.kt
+++ b/benchmark/benchmark-macro/src/main/java/androidx/benchmark/macro/Metric.kt
@@ -19,9 +19,9 @@
import android.os.Build
import androidx.annotation.RequiresApi
import androidx.annotation.RestrictTo
-import androidx.benchmark.MetricResult
import androidx.benchmark.Shell
import androidx.benchmark.macro.perfetto.FrameTimingQuery
+import androidx.benchmark.macro.perfetto.FrameTimingQuery.SubMetric
import androidx.benchmark.macro.perfetto.PerfettoResultsParser.parseStartupResult
import androidx.benchmark.macro.perfetto.PerfettoTraceProcessor
import androidx.test.platform.app.InstrumentationRegistry
@@ -41,10 +41,16 @@
* TODO: takes package for package level filtering, but probably want a
* general config object coming into [start].
*/
- internal abstract fun getMetrics(packageName: String, tracePath: String): MetricsWithUiState
+ internal abstract fun getMetrics(packageName: String, tracePath: String): IterationResult
}
-public class FrameTimingMetric : Metric() {
+/**
+ * Legacy version of FrameTimingMetric, based on 'dumpsys gfxinfo' instead of trace data.
+ *
+ * Temporary - to be removed after transition to FrameTimingMetric
+ */
+@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP_PREFIX)
+public class FrameTimingGfxInfoMetric : Metric() {
private lateinit var packageName: String
private val helper = JankCollectionHelper()
@@ -119,8 +125,8 @@
"totalFrameCount"
)
- internal override fun getMetrics(packageName: String, tracePath: String) = MetricsWithUiState(
- metrics = helper.metrics
+ internal override fun getMetrics(packageName: String, tracePath: String) = IterationResult(
+ singleMetrics = helper.metrics
.map {
val prefix = "gfxinfo_${packageName}_"
val keyWithoutPrefix = it.key.removePrefix(prefix)
@@ -132,38 +138,41 @@
}
}
.toMap()
- .filterKeys { keyAllowList.contains(it) }
+ .filterKeys { keyAllowList.contains(it) },
+ sampledMetrics = emptyMap(),
+ timelineRangeNs = null
)
}
/**
- * WIP trace-based replacement for [FrameTimingMetric].
+ * Metric which captures timing information from frames produced by a benchmark, such as
+ * a scrolling or animation benchmark.
*/
-@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP_PREFIX)
@Suppress("CanSealedSubClassBeObject")
-public class FrameTimingTraceMetric : Metric() {
+public class FrameTimingMetric : Metric() {
internal override fun configure(packageName: String) {}
internal override fun start() {}
internal override fun stop() {}
- internal override fun getMetrics(packageName: String, tracePath: String): MetricsWithUiState {
- val frameTimesMs = FrameTimingQuery.getFrameSubMetrics(
+ internal override fun getMetrics(packageName: String, tracePath: String): IterationResult {
+ val subMetricsMsMap = FrameTimingQuery.getFrameSubMetrics(
absoluteTracePath = tracePath,
captureApiLevel = Build.VERSION.SDK_INT,
packageName = packageName
- )[FrameTimingQuery.FrameSubMetric.FrameTime]!!
- .sorted()
- .map { it / 1_000_000.0 } // Convert to ms
-
- fun percentile(percentile: Int) = MetricResult.getPercentile(frameTimesMs, percentile)
- return MetricsWithUiState(
- metrics = mapOf(
- "trace_frameTime50thPercentileMs" to percentile(50),
- "trace_frameTime90thPercentileMs" to percentile(90),
- "trace_frameTime95thPercentileMs" to percentile(95),
- "trace_frameTime99thPercentileMs" to percentile(99),
- "trace_totalFrameCount" to frameTimesMs.size.toDouble()
- )
+ )
+ .filterKeys { it == SubMetric.FrameCpuTime || it == SubMetric.FrameNegativeSlackTime }
+ .mapKeys {
+ if (it.key == SubMetric.FrameCpuTime) "frameCpuTimeMs" else "frameNegativeSlackMs"
+ }
+ .mapValues { entry ->
+ entry.value.map { timeNs ->
+ timeNs / 1_000_000.0 // Convert to ms
+ }
+ }
+ return IterationResult(
+ singleMetrics = emptyMap(),
+ sampledMetrics = subMetricsMsMap,
+ timelineRangeNs = null
)
}
}
@@ -183,36 +192,8 @@
internal override fun stop() {
}
- internal override fun getMetrics(packageName: String, tracePath: String): MetricsWithUiState {
+ internal override fun getMetrics(packageName: String, tracePath: String): IterationResult {
val json = PerfettoTraceProcessor.getJsonMetrics(tracePath, "android_startup")
return parseStartupResult(json, packageName)
}
}
-
-internal data class MetricsWithUiState(
- val metrics: Map<String, Double>,
- val timelineStart: Long? = null,
- val timelineEnd: Long? = null
-) {
- operator fun plus(element: MetricsWithUiState) = MetricsWithUiState(
- metrics = metrics + element.metrics,
- timelineStart = minOfNullable(timelineStart, element.timelineStart),
- timelineEnd = maxOfNullable(timelineEnd, element.timelineEnd)
- )
-
- companion object {
- val EMPTY = MetricsWithUiState(mapOf())
- }
-}
-
-internal fun minOfNullable(a: Long?, b: Long?): Long? {
- if (a == null) return b
- if (b == null) return a
- return minOf(a, b)
-}
-
-internal fun maxOfNullable(a: Long?, b: Long?): Long? {
- if (a == null) return b
- if (b == null) return a
- return maxOf(a, b)
-}
\ No newline at end of file
diff --git a/benchmark/benchmark-macro/src/main/java/androidx/benchmark/macro/MetricResultExtensions.kt b/benchmark/benchmark-macro/src/main/java/androidx/benchmark/macro/MetricResultExtensions.kt
index 890e0f4..364e6ae 100644
--- a/benchmark/benchmark-macro/src/main/java/androidx/benchmark/macro/MetricResultExtensions.kt
+++ b/benchmark/benchmark-macro/src/main/java/androidx/benchmark/macro/MetricResultExtensions.kt
@@ -22,9 +22,7 @@
/**
* Merge the Map<String, Long> results from each iteration into one List<MetricResult>
*/
-internal fun List<Map<String, Double>>.mergeToMetricResults(
- @Suppress("UNUSED_PARAMETER") tracePaths: List<String>
-): List<MetricResult> {
+internal fun List<Map<String, Double>>.mergeToSingleMetricResults(): List<MetricResult> {
val setOfAllKeys = flatMap { it.keys }.toSet()
// build Map<String, List<Long>>
@@ -44,4 +42,28 @@
return listResults.map { (metricName, values) ->
MetricResult(name = metricName, data = values)
}.sortedBy { it.name }
+}
+
+/**
+ * Merge the Map<String, List<Long>> results from each iteration into one List<MetricResult>
+ */
+internal fun List<Map<String, List<Double>>>.mergeToSampledMetricResults(): List<MetricResult> {
+ val setOfAllKeys = flatMap { it.keys }.toSet()
+
+ // build Map<String, List<List<Long>>>
+ val listResults = setOfAllKeys.associateWith { key ->
+ mapIndexed { index: Int, iterationSamples: Map<String, List<Double>> ->
+ iterationSamples[key]
+ ?: throw IllegalStateException("Iteration $index didn't capture metric $key")
+ }
+ }
+
+ // transform to List<MetricResult>, sorted by metric name
+ return listResults.map { (metricName, values) ->
+ MetricResult(
+ name = metricName,
+ data = values.flatten(),
+ iterationData = values
+ )
+ }.sortedBy { it.name }
}
\ No newline at end of file
diff --git a/benchmark/benchmark-macro/src/main/java/androidx/benchmark/macro/perfetto/FrameTimingQuery.kt b/benchmark/benchmark-macro/src/main/java/androidx/benchmark/macro/perfetto/FrameTimingQuery.kt
index 111329a..f4c5bf0 100644
--- a/benchmark/benchmark-macro/src/main/java/androidx/benchmark/macro/perfetto/FrameTimingQuery.kt
+++ b/benchmark/benchmark-macro/src/main/java/androidx/benchmark/macro/perfetto/FrameTimingQuery.kt
@@ -54,14 +54,13 @@
ORDER BY ts ASC
""".trimIndent()
- enum class FrameSubMetric {
- FrameTime,
- BasicFrameTime,
- UiFrameTime,
- FrameSlackTime;
+ enum class SubMetric {
+ FrameCpuTime,
+ FrameUiTime,
+ FrameNegativeSlackTime;
fun supportedOnApiLevel(apiLevel: Int): Boolean {
- return apiLevel >= 31 || this != FrameTime && this != FrameSlackTime
+ return apiLevel >= 31 || this != FrameNegativeSlackTime
}
}
@@ -83,12 +82,11 @@
val expectedSlice: Slice?,
val actualSlice: Slice?
) {
- fun get(subMetric: FrameSubMetric): Long {
+ fun get(subMetric: SubMetric): Long {
return when (subMetric) {
- FrameSubMetric.FrameTime -> actualSlice!!.dur
- FrameSubMetric.BasicFrameTime -> rtSlice.endTs - uiSlice.ts
- FrameSubMetric.UiFrameTime -> uiSlice.dur
- FrameSubMetric.FrameSlackTime -> expectedSlice!!.endTs - actualSlice!!.endTs
+ SubMetric.FrameCpuTime -> rtSlice.endTs - uiSlice.ts
+ SubMetric.FrameUiTime -> uiSlice.dur
+ SubMetric.FrameNegativeSlackTime -> actualSlice!!.endTs - expectedSlice!!.endTs
}
}
companion object {
@@ -140,7 +138,7 @@
absoluteTracePath: String,
captureApiLevel: Int,
packageName: String,
- ): Map<FrameSubMetric, List<Long>> {
+ ): Map<SubMetric, List<Long>> {
val queryResult = PerfettoTraceProcessor.rawQuery(
absoluteTracePath = absoluteTracePath,
query = getFullQuery(packageName)
@@ -199,7 +197,7 @@
}
}
- return FrameSubMetric.values()
+ return SubMetric.values()
.filter { it.supportedOnApiLevel(captureApiLevel) }
.associateWith { subMetric ->
frameData.map { frame -> frame.get(subMetric) }
diff --git a/benchmark/benchmark-macro/src/main/java/androidx/benchmark/macro/perfetto/PerfettoResultsParser.kt b/benchmark/benchmark-macro/src/main/java/androidx/benchmark/macro/perfetto/PerfettoResultsParser.kt
index 186ca26..c38d31f 100644
--- a/benchmark/benchmark-macro/src/main/java/androidx/benchmark/macro/perfetto/PerfettoResultsParser.kt
+++ b/benchmark/benchmark-macro/src/main/java/androidx/benchmark/macro/perfetto/PerfettoResultsParser.kt
@@ -16,11 +16,11 @@
package androidx.benchmark.macro.perfetto
-import androidx.benchmark.macro.MetricsWithUiState
+import androidx.benchmark.macro.IterationResult
import org.json.JSONObject
internal object PerfettoResultsParser {
- fun parseStartupResult(jsonMetricResults: String, packageName: String): MetricsWithUiState {
+ fun parseStartupResult(jsonMetricResults: String, packageName: String): IterationResult {
val json = JSONObject(jsonMetricResults)
json.optJSONObject("android_startup")?.let { androidStartup ->
androidStartup.optJSONArray("startup")?.let { startup ->
@@ -34,10 +34,10 @@
}
}
- return MetricsWithUiState.EMPTY
+ return IterationResult(emptyMap(), emptyMap(), null)
}
- private fun JSONObject.parseStartupMetricsWithUiState(): MetricsWithUiState {
+ private fun JSONObject.parseStartupMetricsWithUiState(): IterationResult {
val durMs = getJSONObject("to_first_frame").getDouble("dur_ms")
val fullyDrawnMs = optJSONObject("report_fully_drawn")?.getDouble("dur_ms")
@@ -49,10 +49,15 @@
val eventTimestamps = optJSONObject("event_timestamps")
val timelineStart = eventTimestamps?.optLong("intent_received")
val timelineEnd = eventTimestamps?.optLong("first_frame")
- return MetricsWithUiState(
- metrics = metricMap,
- timelineStart = timelineStart,
- timelineEnd = timelineEnd
+
+ return IterationResult(
+ singleMetrics = metricMap,
+ sampledMetrics = emptyMap(),
+ timelineRangeNs = if (timelineStart != null && timelineEnd != null) {
+ timelineStart..timelineEnd
+ } else {
+ null
+ }
)
}
}
diff --git a/benchmark/integration-tests/macrobenchmark/build.gradle b/benchmark/integration-tests/macrobenchmark/build.gradle
index 3d777a8..e0a8ffe 100644
--- a/benchmark/integration-tests/macrobenchmark/build.gradle
+++ b/benchmark/integration-tests/macrobenchmark/build.gradle
@@ -22,8 +22,7 @@
android {
defaultConfig {
- minSdkVersion 29
- testInstrumentationRunnerArgument "androidx.benchmark.output.enable", "true"
+ minSdkVersion 23
}
}
diff --git a/benchmark/integration-tests/macrobenchmark/src/androidTest/java/androidx/benchmark/integration/macrobenchmark/SmallListStartupBenchmark.kt b/benchmark/integration-tests/macrobenchmark/src/androidTest/java/androidx/benchmark/integration/macrobenchmark/SmallListStartupBenchmark.kt
index 98b8cfb20..a94d7da 100644
--- a/benchmark/integration-tests/macrobenchmark/src/androidTest/java/androidx/benchmark/integration/macrobenchmark/SmallListStartupBenchmark.kt
+++ b/benchmark/integration-tests/macrobenchmark/src/androidTest/java/androidx/benchmark/integration/macrobenchmark/SmallListStartupBenchmark.kt
@@ -20,6 +20,7 @@
import androidx.benchmark.macro.StartupMode
import androidx.benchmark.macro.junit4.MacrobenchmarkRule
import androidx.test.filters.LargeTest
+import androidx.test.filters.SdkSuppress
import androidx.testutils.createStartupCompilationParams
import androidx.testutils.measureStartup
import org.junit.Rule
@@ -28,6 +29,7 @@
import org.junit.runners.Parameterized
@LargeTest
+@SdkSuppress(minSdkVersion = 29)
@RunWith(Parameterized::class)
class SmallListStartupBenchmark(
private val startupMode: StartupMode,
diff --git a/benchmark/integration-tests/macrobenchmark/src/androidTest/java/androidx/benchmark/integration/macrobenchmark/TrivialListScrollBenchmark.kt b/benchmark/integration-tests/macrobenchmark/src/androidTest/java/androidx/benchmark/integration/macrobenchmark/TrivialListScrollBenchmark.kt
index 605f409..cb24edb 100644
--- a/benchmark/integration-tests/macrobenchmark/src/androidTest/java/androidx/benchmark/integration/macrobenchmark/TrivialListScrollBenchmark.kt
+++ b/benchmark/integration-tests/macrobenchmark/src/androidTest/java/androidx/benchmark/integration/macrobenchmark/TrivialListScrollBenchmark.kt
@@ -19,8 +19,8 @@
import android.content.Intent
import android.graphics.Point
import androidx.benchmark.macro.CompilationMode
+import androidx.benchmark.macro.FrameTimingGfxInfoMetric
import androidx.benchmark.macro.FrameTimingMetric
-import androidx.benchmark.macro.FrameTimingTraceMetric
import androidx.benchmark.macro.junit4.MacrobenchmarkRule
import androidx.test.filters.LargeTest
import androidx.test.platform.app.InstrumentationRegistry
@@ -53,7 +53,7 @@
fun start() {
benchmarkRule.measureRepeated(
packageName = PACKAGE_NAME,
- metrics = listOf(FrameTimingMetric(), FrameTimingTraceMetric()),
+ metrics = listOf(FrameTimingMetric(), FrameTimingGfxInfoMetric()),
compilationMode = compilationMode,
iterations = 10,
setupBlock = {
diff --git a/benchmark/integration-tests/macrobenchmark/src/androidTest/java/androidx/benchmark/integration/macrobenchmark/TrivialStartupBenchmark.kt b/benchmark/integration-tests/macrobenchmark/src/androidTest/java/androidx/benchmark/integration/macrobenchmark/TrivialStartupBenchmark.kt
index 856badf..16ca16b 100644
--- a/benchmark/integration-tests/macrobenchmark/src/androidTest/java/androidx/benchmark/integration/macrobenchmark/TrivialStartupBenchmark.kt
+++ b/benchmark/integration-tests/macrobenchmark/src/androidTest/java/androidx/benchmark/integration/macrobenchmark/TrivialStartupBenchmark.kt
@@ -20,6 +20,7 @@
import androidx.benchmark.macro.StartupMode
import androidx.benchmark.macro.junit4.MacrobenchmarkRule
import androidx.test.filters.LargeTest
+import androidx.test.filters.SdkSuppress
import androidx.testutils.createStartupCompilationParams
import androidx.testutils.measureStartup
import org.junit.Rule
@@ -28,6 +29,7 @@
import org.junit.runners.Parameterized
@LargeTest
+@SdkSuppress(minSdkVersion = 29)
@RunWith(Parameterized::class)
class TrivialStartupBenchmark(
private val startupMode: StartupMode,
diff --git a/browser/browser/api/1.4.0-beta01.txt b/browser/browser/api/1.4.0-beta01.txt
new file mode 100644
index 0000000..2f00014
--- /dev/null
+++ b/browser/browser/api/1.4.0-beta01.txt
@@ -0,0 +1,450 @@
+// Signature format: 4.0
+package androidx.browser.browseractions {
+
+ @Deprecated public class BrowserActionItem {
+ ctor @Deprecated public BrowserActionItem(String, android.app.PendingIntent, @DrawableRes int);
+ ctor @Deprecated public BrowserActionItem(String, android.app.PendingIntent);
+ method @Deprecated public android.app.PendingIntent getAction();
+ method @Deprecated public int getIconId();
+ method @Deprecated public String getTitle();
+ }
+
+ @Deprecated public class BrowserActionsIntent {
+ method @Deprecated public static String? getCreatorPackageName(android.content.Intent);
+ method @Deprecated public android.content.Intent getIntent();
+ method @Deprecated public static String? getUntrustedCreatorPackageName(android.content.Intent);
+ method @Deprecated public static void launchIntent(android.content.Context, android.content.Intent);
+ method @Deprecated public static void openBrowserAction(android.content.Context, android.net.Uri);
+ method @Deprecated public static void openBrowserAction(android.content.Context, android.net.Uri, int, java.util.ArrayList<androidx.browser.browseractions.BrowserActionItem!>, android.app.PendingIntent);
+ method @Deprecated public static java.util.List<androidx.browser.browseractions.BrowserActionItem!> parseBrowserActionItems(java.util.ArrayList<android.os.Bundle!>);
+ field @Deprecated public static final String ACTION_BROWSER_ACTIONS_OPEN = "androidx.browser.browseractions.browser_action_open";
+ field @Deprecated public static final String EXTRA_APP_ID = "androidx.browser.browseractions.APP_ID";
+ field @Deprecated public static final String EXTRA_MENU_ITEMS = "androidx.browser.browseractions.extra.MENU_ITEMS";
+ field @Deprecated public static final String EXTRA_SELECTED_ACTION_PENDING_INTENT = "androidx.browser.browseractions.extra.SELECTED_ACTION_PENDING_INTENT";
+ field @Deprecated public static final String EXTRA_TYPE = "androidx.browser.browseractions.extra.TYPE";
+ field @Deprecated public static final int ITEM_COPY = 3; // 0x3
+ field @Deprecated public static final int ITEM_DOWNLOAD = 2; // 0x2
+ field @Deprecated public static final int ITEM_INVALID_ITEM = -1; // 0xffffffff
+ field @Deprecated public static final int ITEM_OPEN_IN_INCOGNITO = 1; // 0x1
+ field @Deprecated public static final int ITEM_OPEN_IN_NEW_TAB = 0; // 0x0
+ field @Deprecated public static final int ITEM_SHARE = 4; // 0x4
+ field @Deprecated public static final String KEY_ACTION = "androidx.browser.browseractions.ACTION";
+ field @Deprecated public static final String KEY_ICON_ID = "androidx.browser.browseractions.ICON_ID";
+ field @Deprecated public static final String KEY_TITLE = "androidx.browser.browseractions.TITLE";
+ field @Deprecated public static final int MAX_CUSTOM_ITEMS = 5; // 0x5
+ field @Deprecated public static final int URL_TYPE_AUDIO = 3; // 0x3
+ field @Deprecated public static final int URL_TYPE_FILE = 4; // 0x4
+ field @Deprecated public static final int URL_TYPE_IMAGE = 1; // 0x1
+ field @Deprecated public static final int URL_TYPE_NONE = 0; // 0x0
+ field @Deprecated public static final int URL_TYPE_PLUGIN = 5; // 0x5
+ field @Deprecated public static final int URL_TYPE_VIDEO = 2; // 0x2
+ }
+
+ @Deprecated public static final class BrowserActionsIntent.Builder {
+ ctor @Deprecated public BrowserActionsIntent.Builder(android.content.Context, android.net.Uri);
+ method @Deprecated public androidx.browser.browseractions.BrowserActionsIntent build();
+ method @Deprecated public androidx.browser.browseractions.BrowserActionsIntent.Builder setCustomItems(java.util.ArrayList<androidx.browser.browseractions.BrowserActionItem!>);
+ method @Deprecated public androidx.browser.browseractions.BrowserActionsIntent.Builder setCustomItems(androidx.browser.browseractions.BrowserActionItem!...);
+ method @Deprecated public androidx.browser.browseractions.BrowserActionsIntent.Builder setOnItemSelectedAction(android.app.PendingIntent);
+ method @Deprecated public androidx.browser.browseractions.BrowserActionsIntent.Builder setUrlType(int);
+ }
+
+}
+
+package androidx.browser.customtabs {
+
+ public final class CustomTabColorSchemeParams {
+ field @ColorInt public final Integer? navigationBarColor;
+ field @ColorInt public final Integer? navigationBarDividerColor;
+ field @ColorInt public final Integer? secondaryToolbarColor;
+ field @ColorInt public final Integer? toolbarColor;
+ }
+
+ public static final class CustomTabColorSchemeParams.Builder {
+ ctor public CustomTabColorSchemeParams.Builder();
+ method public androidx.browser.customtabs.CustomTabColorSchemeParams build();
+ method public androidx.browser.customtabs.CustomTabColorSchemeParams.Builder setNavigationBarColor(@ColorInt int);
+ method public androidx.browser.customtabs.CustomTabColorSchemeParams.Builder setNavigationBarDividerColor(@ColorInt int);
+ method public androidx.browser.customtabs.CustomTabColorSchemeParams.Builder setSecondaryToolbarColor(@ColorInt int);
+ method public androidx.browser.customtabs.CustomTabColorSchemeParams.Builder setToolbarColor(@ColorInt int);
+ }
+
+ public class CustomTabsCallback {
+ ctor public CustomTabsCallback();
+ method public void extraCallback(String, android.os.Bundle?);
+ method public android.os.Bundle? extraCallbackWithResult(String, android.os.Bundle?);
+ method public void onMessageChannelReady(android.os.Bundle?);
+ method public void onNavigationEvent(int, android.os.Bundle?);
+ method public void onPostMessage(String, android.os.Bundle?);
+ method public void onRelationshipValidationResult(@androidx.browser.customtabs.CustomTabsService.Relation int, android.net.Uri, boolean, android.os.Bundle?);
+ field public static final int NAVIGATION_ABORTED = 4; // 0x4
+ field public static final int NAVIGATION_FAILED = 3; // 0x3
+ field public static final int NAVIGATION_FINISHED = 2; // 0x2
+ field public static final int NAVIGATION_STARTED = 1; // 0x1
+ field public static final int TAB_HIDDEN = 6; // 0x6
+ field public static final int TAB_SHOWN = 5; // 0x5
+ }
+
+ public class CustomTabsClient {
+ method public static boolean bindCustomTabsService(android.content.Context, String?, androidx.browser.customtabs.CustomTabsServiceConnection);
+ method public static boolean bindCustomTabsServicePreservePriority(android.content.Context, String?, androidx.browser.customtabs.CustomTabsServiceConnection);
+ method public static boolean connectAndInitialize(android.content.Context, String);
+ method public android.os.Bundle? extraCommand(String, android.os.Bundle?);
+ method public static String? getPackageName(android.content.Context, java.util.List<java.lang.String!>?);
+ method public static String? getPackageName(android.content.Context, java.util.List<java.lang.String!>?, boolean);
+ method public androidx.browser.customtabs.CustomTabsSession? newSession(androidx.browser.customtabs.CustomTabsCallback?);
+ method public androidx.browser.customtabs.CustomTabsSession? newSession(androidx.browser.customtabs.CustomTabsCallback?, int);
+ method public boolean warmup(long);
+ }
+
+ public final class CustomTabsIntent {
+ method public static androidx.browser.customtabs.CustomTabColorSchemeParams getColorSchemeParams(android.content.Intent, int);
+ method public static int getMaxToolbarItems();
+ method public void launchUrl(android.content.Context, android.net.Uri);
+ method public static android.content.Intent setAlwaysUseBrowserUI(android.content.Intent?);
+ method public static boolean shouldAlwaysUseBrowserUI(android.content.Intent);
+ field public static final int COLOR_SCHEME_DARK = 2; // 0x2
+ field public static final int COLOR_SCHEME_LIGHT = 1; // 0x1
+ field public static final int COLOR_SCHEME_SYSTEM = 0; // 0x0
+ field public static final String EXTRA_ACTION_BUTTON_BUNDLE = "android.support.customtabs.extra.ACTION_BUTTON_BUNDLE";
+ field public static final String EXTRA_CLOSE_BUTTON_ICON = "android.support.customtabs.extra.CLOSE_BUTTON_ICON";
+ field public static final String EXTRA_COLOR_SCHEME = "androidx.browser.customtabs.extra.COLOR_SCHEME";
+ field public static final String EXTRA_COLOR_SCHEME_PARAMS = "androidx.browser.customtabs.extra.COLOR_SCHEME_PARAMS";
+ field @Deprecated public static final String EXTRA_DEFAULT_SHARE_MENU_ITEM = "android.support.customtabs.extra.SHARE_MENU_ITEM";
+ field public static final String EXTRA_ENABLE_INSTANT_APPS = "android.support.customtabs.extra.EXTRA_ENABLE_INSTANT_APPS";
+ field public static final String EXTRA_ENABLE_URLBAR_HIDING = "android.support.customtabs.extra.ENABLE_URLBAR_HIDING";
+ field public static final String EXTRA_EXIT_ANIMATION_BUNDLE = "android.support.customtabs.extra.EXIT_ANIMATION_BUNDLE";
+ field public static final String EXTRA_MENU_ITEMS = "android.support.customtabs.extra.MENU_ITEMS";
+ field public static final String EXTRA_NAVIGATION_BAR_COLOR = "androidx.browser.customtabs.extra.NAVIGATION_BAR_COLOR";
+ field public static final String EXTRA_NAVIGATION_BAR_DIVIDER_COLOR = "androidx.browser.customtabs.extra.NAVIGATION_BAR_DIVIDER_COLOR";
+ field public static final String EXTRA_REMOTEVIEWS = "android.support.customtabs.extra.EXTRA_REMOTEVIEWS";
+ field public static final String EXTRA_REMOTEVIEWS_CLICKED_ID = "android.support.customtabs.extra.EXTRA_REMOTEVIEWS_CLICKED_ID";
+ field public static final String EXTRA_REMOTEVIEWS_PENDINGINTENT = "android.support.customtabs.extra.EXTRA_REMOTEVIEWS_PENDINGINTENT";
+ field public static final String EXTRA_REMOTEVIEWS_VIEW_IDS = "android.support.customtabs.extra.EXTRA_REMOTEVIEWS_VIEW_IDS";
+ field public static final String EXTRA_SECONDARY_TOOLBAR_COLOR = "android.support.customtabs.extra.SECONDARY_TOOLBAR_COLOR";
+ field public static final String EXTRA_SESSION = "android.support.customtabs.extra.SESSION";
+ field public static final String EXTRA_SHARE_STATE = "androidx.browser.customtabs.extra.SHARE_STATE";
+ field public static final String EXTRA_TINT_ACTION_BUTTON = "android.support.customtabs.extra.TINT_ACTION_BUTTON";
+ field public static final String EXTRA_TITLE_VISIBILITY_STATE = "android.support.customtabs.extra.TITLE_VISIBILITY";
+ field public static final String EXTRA_TOOLBAR_COLOR = "android.support.customtabs.extra.TOOLBAR_COLOR";
+ field public static final String EXTRA_TOOLBAR_ITEMS = "android.support.customtabs.extra.TOOLBAR_ITEMS";
+ field public static final String KEY_DESCRIPTION = "android.support.customtabs.customaction.DESCRIPTION";
+ field public static final String KEY_ICON = "android.support.customtabs.customaction.ICON";
+ field public static final String KEY_ID = "android.support.customtabs.customaction.ID";
+ field public static final String KEY_MENU_ITEM_TITLE = "android.support.customtabs.customaction.MENU_ITEM_TITLE";
+ field public static final String KEY_PENDING_INTENT = "android.support.customtabs.customaction.PENDING_INTENT";
+ field public static final int NO_TITLE = 0; // 0x0
+ field public static final int SHARE_STATE_DEFAULT = 0; // 0x0
+ field public static final int SHARE_STATE_OFF = 2; // 0x2
+ field public static final int SHARE_STATE_ON = 1; // 0x1
+ field public static final int SHOW_PAGE_TITLE = 1; // 0x1
+ field public static final int TOOLBAR_ACTION_BUTTON_ID = 0; // 0x0
+ field public final android.content.Intent intent;
+ field public final android.os.Bundle? startAnimationBundle;
+ }
+
+ public static final class CustomTabsIntent.Builder {
+ ctor public CustomTabsIntent.Builder();
+ ctor public CustomTabsIntent.Builder(androidx.browser.customtabs.CustomTabsSession?);
+ method @Deprecated public androidx.browser.customtabs.CustomTabsIntent.Builder addDefaultShareMenuItem();
+ method public androidx.browser.customtabs.CustomTabsIntent.Builder addMenuItem(String, android.app.PendingIntent);
+ method @Deprecated public androidx.browser.customtabs.CustomTabsIntent.Builder addToolbarItem(int, android.graphics.Bitmap, String, android.app.PendingIntent) throws java.lang.IllegalStateException;
+ method public androidx.browser.customtabs.CustomTabsIntent build();
+ method @Deprecated public androidx.browser.customtabs.CustomTabsIntent.Builder enableUrlBarHiding();
+ method public androidx.browser.customtabs.CustomTabsIntent.Builder setActionButton(android.graphics.Bitmap, String, android.app.PendingIntent, boolean);
+ method public androidx.browser.customtabs.CustomTabsIntent.Builder setActionButton(android.graphics.Bitmap, String, android.app.PendingIntent);
+ method public androidx.browser.customtabs.CustomTabsIntent.Builder setCloseButtonIcon(android.graphics.Bitmap);
+ method public androidx.browser.customtabs.CustomTabsIntent.Builder setColorScheme(int);
+ method public androidx.browser.customtabs.CustomTabsIntent.Builder setColorSchemeParams(int, androidx.browser.customtabs.CustomTabColorSchemeParams);
+ method public androidx.browser.customtabs.CustomTabsIntent.Builder setDefaultColorSchemeParams(androidx.browser.customtabs.CustomTabColorSchemeParams);
+ method @Deprecated public androidx.browser.customtabs.CustomTabsIntent.Builder setDefaultShareMenuItemEnabled(boolean);
+ method public androidx.browser.customtabs.CustomTabsIntent.Builder setExitAnimations(android.content.Context, @AnimRes int, @AnimRes int);
+ method public androidx.browser.customtabs.CustomTabsIntent.Builder setInstantAppsEnabled(boolean);
+ method @Deprecated public androidx.browser.customtabs.CustomTabsIntent.Builder setNavigationBarColor(@ColorInt int);
+ method @Deprecated public androidx.browser.customtabs.CustomTabsIntent.Builder setNavigationBarDividerColor(@ColorInt int);
+ method @Deprecated public androidx.browser.customtabs.CustomTabsIntent.Builder setSecondaryToolbarColor(@ColorInt int);
+ method public androidx.browser.customtabs.CustomTabsIntent.Builder setSecondaryToolbarViews(android.widget.RemoteViews, int[]?, android.app.PendingIntent?);
+ method public androidx.browser.customtabs.CustomTabsIntent.Builder setSession(androidx.browser.customtabs.CustomTabsSession);
+ method public androidx.browser.customtabs.CustomTabsIntent.Builder setShareState(int);
+ method public androidx.browser.customtabs.CustomTabsIntent.Builder setShowTitle(boolean);
+ method public androidx.browser.customtabs.CustomTabsIntent.Builder setStartAnimations(android.content.Context, @AnimRes int, @AnimRes int);
+ method @Deprecated public androidx.browser.customtabs.CustomTabsIntent.Builder setToolbarColor(@ColorInt int);
+ method public androidx.browser.customtabs.CustomTabsIntent.Builder setUrlBarHidingEnabled(boolean);
+ }
+
+ public abstract class CustomTabsService extends android.app.Service {
+ ctor public CustomTabsService();
+ method protected boolean cleanUpSession(androidx.browser.customtabs.CustomTabsSessionToken);
+ method protected abstract android.os.Bundle? extraCommand(String, android.os.Bundle?);
+ method protected abstract boolean mayLaunchUrl(androidx.browser.customtabs.CustomTabsSessionToken, android.net.Uri?, android.os.Bundle?, java.util.List<android.os.Bundle!>?);
+ method protected abstract boolean newSession(androidx.browser.customtabs.CustomTabsSessionToken);
+ method public android.os.IBinder onBind(android.content.Intent?);
+ method @androidx.browser.customtabs.CustomTabsService.Result protected abstract int postMessage(androidx.browser.customtabs.CustomTabsSessionToken, String, android.os.Bundle?);
+ method protected abstract boolean receiveFile(androidx.browser.customtabs.CustomTabsSessionToken, android.net.Uri, int, android.os.Bundle?);
+ method protected abstract boolean requestPostMessageChannel(androidx.browser.customtabs.CustomTabsSessionToken, android.net.Uri);
+ method protected abstract boolean updateVisuals(androidx.browser.customtabs.CustomTabsSessionToken, android.os.Bundle?);
+ method protected abstract boolean validateRelationship(androidx.browser.customtabs.CustomTabsSessionToken, @androidx.browser.customtabs.CustomTabsService.Relation int, android.net.Uri, android.os.Bundle?);
+ method protected abstract boolean warmup(long);
+ field public static final String ACTION_CUSTOM_TABS_CONNECTION = "android.support.customtabs.action.CustomTabsService";
+ field public static final String CATEGORY_COLOR_SCHEME_CUSTOMIZATION = "androidx.browser.customtabs.category.ColorSchemeCustomization";
+ field public static final String CATEGORY_NAVBAR_COLOR_CUSTOMIZATION = "androidx.browser.customtabs.category.NavBarColorCustomization";
+ field public static final String CATEGORY_TRUSTED_WEB_ACTIVITY_IMMERSIVE_MODE = "androidx.browser.trusted.category.ImmersiveMode";
+ field public static final String CATEGORY_WEB_SHARE_TARGET_V2 = "androidx.browser.trusted.category.WebShareTargetV2";
+ field public static final int FILE_PURPOSE_TRUSTED_WEB_ACTIVITY_SPLASH_IMAGE = 1; // 0x1
+ field public static final String KEY_SUCCESS = "androidx.browser.customtabs.SUCCESS";
+ field public static final String KEY_URL = "android.support.customtabs.otherurls.URL";
+ field public static final int RELATION_HANDLE_ALL_URLS = 2; // 0x2
+ field public static final int RELATION_USE_AS_ORIGIN = 1; // 0x1
+ field public static final int RESULT_FAILURE_DISALLOWED = -1; // 0xffffffff
+ field public static final int RESULT_FAILURE_MESSAGING_ERROR = -3; // 0xfffffffd
+ field public static final int RESULT_FAILURE_REMOTE_ERROR = -2; // 0xfffffffe
+ field public static final int RESULT_SUCCESS = 0; // 0x0
+ field public static final String TRUSTED_WEB_ACTIVITY_CATEGORY = "androidx.browser.trusted.category.TrustedWebActivities";
+ }
+
+ @IntDef({androidx.browser.customtabs.CustomTabsService.RELATION_USE_AS_ORIGIN, androidx.browser.customtabs.CustomTabsService.RELATION_HANDLE_ALL_URLS}) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) public static @interface CustomTabsService.Relation {
+ }
+
+ @IntDef({androidx.browser.customtabs.CustomTabsService.RESULT_SUCCESS, androidx.browser.customtabs.CustomTabsService.RESULT_FAILURE_DISALLOWED, androidx.browser.customtabs.CustomTabsService.RESULT_FAILURE_REMOTE_ERROR, androidx.browser.customtabs.CustomTabsService.RESULT_FAILURE_MESSAGING_ERROR}) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) public static @interface CustomTabsService.Result {
+ }
+
+ public abstract class CustomTabsServiceConnection implements android.content.ServiceConnection {
+ ctor public CustomTabsServiceConnection();
+ method public abstract void onCustomTabsServiceConnected(android.content.ComponentName, androidx.browser.customtabs.CustomTabsClient);
+ method public final void onServiceConnected(android.content.ComponentName, android.os.IBinder);
+ }
+
+ public final class CustomTabsSession {
+ method @VisibleForTesting public static androidx.browser.customtabs.CustomTabsSession createMockSessionForTesting(android.content.ComponentName);
+ method public boolean mayLaunchUrl(android.net.Uri?, android.os.Bundle?, java.util.List<android.os.Bundle!>?);
+ method @androidx.browser.customtabs.CustomTabsService.Result public int postMessage(String, android.os.Bundle?);
+ method public boolean receiveFile(android.net.Uri, int, android.os.Bundle?);
+ method public boolean requestPostMessageChannel(android.net.Uri);
+ method public boolean setActionButton(android.graphics.Bitmap, String);
+ method public boolean setSecondaryToolbarViews(android.widget.RemoteViews?, int[]?, android.app.PendingIntent?);
+ method @Deprecated public boolean setToolbarItem(int, android.graphics.Bitmap, String);
+ method public boolean validateRelationship(@androidx.browser.customtabs.CustomTabsService.Relation int, android.net.Uri, android.os.Bundle?);
+ }
+
+ public class CustomTabsSessionToken {
+ method public static androidx.browser.customtabs.CustomTabsSessionToken createMockSessionTokenForTesting();
+ method public androidx.browser.customtabs.CustomTabsCallback? getCallback();
+ method public static androidx.browser.customtabs.CustomTabsSessionToken? getSessionTokenFromIntent(android.content.Intent);
+ method public boolean isAssociatedWith(androidx.browser.customtabs.CustomTabsSession);
+ }
+
+ public class PostMessageService extends android.app.Service {
+ ctor public PostMessageService();
+ method public android.os.IBinder onBind(android.content.Intent?);
+ }
+
+ public abstract class PostMessageServiceConnection implements android.content.ServiceConnection {
+ ctor public PostMessageServiceConnection(androidx.browser.customtabs.CustomTabsSessionToken);
+ method public boolean bindSessionToPostMessageService(android.content.Context, String);
+ method public final boolean notifyMessageChannelReady(android.os.Bundle?);
+ method public void onPostMessageServiceConnected();
+ method public void onPostMessageServiceDisconnected();
+ method public final void onServiceConnected(android.content.ComponentName, android.os.IBinder);
+ method public final void onServiceDisconnected(android.content.ComponentName);
+ method public final boolean postMessage(String, android.os.Bundle?);
+ method public void unbindFromContext(android.content.Context);
+ }
+
+ public class TrustedWebUtils {
+ method public static boolean areSplashScreensSupported(android.content.Context, String, String);
+ method @Deprecated public static void launchAsTrustedWebActivity(android.content.Context, androidx.browser.customtabs.CustomTabsIntent, android.net.Uri);
+ method @WorkerThread public static boolean transferSplashImage(android.content.Context, java.io.File, String, String, androidx.browser.customtabs.CustomTabsSession);
+ field public static final String EXTRA_LAUNCH_AS_TRUSTED_WEB_ACTIVITY = "android.support.customtabs.extra.LAUNCH_AS_TRUSTED_WEB_ACTIVITY";
+ }
+
+}
+
+package androidx.browser.trusted {
+
+ public final class ScreenOrientation {
+ field public static final int ANY = 5; // 0x5
+ field public static final int DEFAULT = 0; // 0x0
+ field public static final int LANDSCAPE = 6; // 0x6
+ field public static final int LANDSCAPE_PRIMARY = 3; // 0x3
+ field public static final int LANDSCAPE_SECONDARY = 4; // 0x4
+ field public static final int NATURAL = 8; // 0x8
+ field public static final int PORTRAIT = 7; // 0x7
+ field public static final int PORTRAIT_PRIMARY = 1; // 0x1
+ field public static final int PORTRAIT_SECONDARY = 2; // 0x2
+ }
+
+ public final class Token {
+ method public static androidx.browser.trusted.Token? create(String, android.content.pm.PackageManager);
+ method public static androidx.browser.trusted.Token deserialize(byte[]);
+ method public boolean matches(String, android.content.pm.PackageManager);
+ method public byte[] serialize();
+ }
+
+ public interface TokenStore {
+ method @BinderThread public androidx.browser.trusted.Token? load();
+ method @WorkerThread public void store(androidx.browser.trusted.Token?);
+ }
+
+ public abstract class TrustedWebActivityCallback {
+ ctor public TrustedWebActivityCallback();
+ method public abstract void onExtraCallback(String, android.os.Bundle?);
+ }
+
+ public class TrustedWebActivityCallbackRemote {
+ method public void runExtraCallback(String, android.os.Bundle) throws android.os.RemoteException;
+ }
+
+ public interface TrustedWebActivityDisplayMode {
+ method public static androidx.browser.trusted.TrustedWebActivityDisplayMode fromBundle(android.os.Bundle);
+ method public android.os.Bundle toBundle();
+ field public static final String KEY_ID = "androidx.browser.trusted.displaymode.KEY_ID";
+ }
+
+ public static class TrustedWebActivityDisplayMode.DefaultMode implements androidx.browser.trusted.TrustedWebActivityDisplayMode {
+ ctor public TrustedWebActivityDisplayMode.DefaultMode();
+ method public android.os.Bundle toBundle();
+ }
+
+ public static class TrustedWebActivityDisplayMode.ImmersiveMode implements androidx.browser.trusted.TrustedWebActivityDisplayMode {
+ ctor public TrustedWebActivityDisplayMode.ImmersiveMode(boolean, int);
+ method public boolean isSticky();
+ method public int layoutInDisplayCutoutMode();
+ method public android.os.Bundle toBundle();
+ field public static final String KEY_CUTOUT_MODE = "androidx.browser.trusted.displaymode.KEY_CUTOUT_MODE";
+ field public static final String KEY_STICKY = "androidx.browser.trusted.displaymode.KEY_STICKY";
+ }
+
+ public final class TrustedWebActivityIntent {
+ method public android.content.Intent getIntent();
+ method public void launchTrustedWebActivity(android.content.Context);
+ }
+
+ public class TrustedWebActivityIntentBuilder {
+ ctor public TrustedWebActivityIntentBuilder(android.net.Uri);
+ method public androidx.browser.trusted.TrustedWebActivityIntent build(androidx.browser.customtabs.CustomTabsSession);
+ method public androidx.browser.customtabs.CustomTabsIntent buildCustomTabsIntent();
+ method public androidx.browser.trusted.TrustedWebActivityDisplayMode getDisplayMode();
+ method public android.net.Uri getUri();
+ method public androidx.browser.trusted.TrustedWebActivityIntentBuilder setAdditionalTrustedOrigins(java.util.List<java.lang.String!>);
+ method public androidx.browser.trusted.TrustedWebActivityIntentBuilder setColorScheme(int);
+ method public androidx.browser.trusted.TrustedWebActivityIntentBuilder setColorSchemeParams(int, androidx.browser.customtabs.CustomTabColorSchemeParams);
+ method public androidx.browser.trusted.TrustedWebActivityIntentBuilder setDefaultColorSchemeParams(androidx.browser.customtabs.CustomTabColorSchemeParams);
+ method public androidx.browser.trusted.TrustedWebActivityIntentBuilder setDisplayMode(androidx.browser.trusted.TrustedWebActivityDisplayMode);
+ method @Deprecated public androidx.browser.trusted.TrustedWebActivityIntentBuilder setNavigationBarColor(@ColorInt int);
+ method @Deprecated public androidx.browser.trusted.TrustedWebActivityIntentBuilder setNavigationBarDividerColor(@ColorInt int);
+ method public androidx.browser.trusted.TrustedWebActivityIntentBuilder setScreenOrientation(int);
+ method public androidx.browser.trusted.TrustedWebActivityIntentBuilder setShareParams(androidx.browser.trusted.sharing.ShareTarget, androidx.browser.trusted.sharing.ShareData);
+ method public androidx.browser.trusted.TrustedWebActivityIntentBuilder setSplashScreenParams(android.os.Bundle);
+ method @Deprecated public androidx.browser.trusted.TrustedWebActivityIntentBuilder setToolbarColor(@ColorInt int);
+ field public static final String EXTRA_ADDITIONAL_TRUSTED_ORIGINS = "android.support.customtabs.extra.ADDITIONAL_TRUSTED_ORIGINS";
+ field public static final String EXTRA_DISPLAY_MODE = "androidx.browser.trusted.extra.DISPLAY_MODE";
+ field public static final String EXTRA_SCREEN_ORIENTATION = "androidx.browser.trusted.extra.SCREEN_ORIENTATION";
+ field public static final String EXTRA_SHARE_DATA = "androidx.browser.trusted.extra.SHARE_DATA";
+ field public static final String EXTRA_SHARE_TARGET = "androidx.browser.trusted.extra.SHARE_TARGET";
+ field public static final String EXTRA_SPLASH_SCREEN_PARAMS = "androidx.browser.trusted.EXTRA_SPLASH_SCREEN_PARAMS";
+ }
+
+ public abstract class TrustedWebActivityService extends android.app.Service {
+ ctor public TrustedWebActivityService();
+ method @BinderThread public abstract androidx.browser.trusted.TokenStore getTokenStore();
+ method @BinderThread public boolean onAreNotificationsEnabled(String);
+ method @MainThread public final android.os.IBinder? onBind(android.content.Intent?);
+ method @BinderThread public void onCancelNotification(String, int);
+ method @BinderThread public android.os.Bundle? onExtraCommand(String, android.os.Bundle, androidx.browser.trusted.TrustedWebActivityCallbackRemote?);
+ method @BinderThread public android.os.Bundle onGetSmallIconBitmap();
+ method @BinderThread public int onGetSmallIconId();
+ method @BinderThread public boolean onNotifyNotificationWithChannel(String, int, android.app.Notification, String);
+ method @MainThread public final boolean onUnbind(android.content.Intent?);
+ field public static final String ACTION_TRUSTED_WEB_ACTIVITY_SERVICE = "android.support.customtabs.trusted.TRUSTED_WEB_ACTIVITY_SERVICE";
+ field public static final String KEY_SMALL_ICON_BITMAP = "android.support.customtabs.trusted.SMALL_ICON_BITMAP";
+ field public static final String KEY_SUCCESS = "androidx.browser.trusted.SUCCESS";
+ field public static final String META_DATA_NAME_SMALL_ICON = "android.support.customtabs.trusted.SMALL_ICON";
+ field public static final int SMALL_ICON_NOT_SET = -1; // 0xffffffff
+ }
+
+ public final class TrustedWebActivityServiceConnection {
+ method public boolean areNotificationsEnabled(String) throws android.os.RemoteException;
+ method public void cancel(String, int) throws android.os.RemoteException;
+ method public android.content.ComponentName getComponentName();
+ method public android.graphics.Bitmap? getSmallIconBitmap() throws android.os.RemoteException;
+ method public int getSmallIconId() throws android.os.RemoteException;
+ method public boolean notify(String, int, android.app.Notification, String) throws android.os.RemoteException;
+ method public android.os.Bundle? sendExtraCommand(String, android.os.Bundle, androidx.browser.trusted.TrustedWebActivityCallback?) throws android.os.RemoteException;
+ }
+
+ public final class TrustedWebActivityServiceConnectionPool {
+ method @MainThread public com.google.common.util.concurrent.ListenableFuture<androidx.browser.trusted.TrustedWebActivityServiceConnection!> connect(android.net.Uri, java.util.Set<androidx.browser.trusted.Token!>, java.util.concurrent.Executor);
+ method public static androidx.browser.trusted.TrustedWebActivityServiceConnectionPool create(android.content.Context);
+ method @MainThread public boolean serviceExistsForScope(android.net.Uri, java.util.Set<androidx.browser.trusted.Token!>);
+ }
+
+}
+
+package androidx.browser.trusted.sharing {
+
+ public final class ShareData {
+ ctor public ShareData(String?, String?, java.util.List<android.net.Uri!>?);
+ method public static androidx.browser.trusted.sharing.ShareData fromBundle(android.os.Bundle);
+ method public android.os.Bundle toBundle();
+ field public static final String KEY_TEXT = "androidx.browser.trusted.sharing.KEY_TEXT";
+ field public static final String KEY_TITLE = "androidx.browser.trusted.sharing.KEY_TITLE";
+ field public static final String KEY_URIS = "androidx.browser.trusted.sharing.KEY_URIS";
+ field public final String? text;
+ field public final String? title;
+ field public final java.util.List<android.net.Uri!>? uris;
+ }
+
+ public final class ShareTarget {
+ ctor public ShareTarget(String, String?, String?, androidx.browser.trusted.sharing.ShareTarget.Params);
+ method public static androidx.browser.trusted.sharing.ShareTarget? fromBundle(android.os.Bundle);
+ method public android.os.Bundle toBundle();
+ field public static final String ENCODING_TYPE_MULTIPART = "multipart/form-data";
+ field public static final String ENCODING_TYPE_URL_ENCODED = "application/x-www-form-urlencoded";
+ field public static final String KEY_ACTION = "androidx.browser.trusted.sharing.KEY_ACTION";
+ field public static final String KEY_ENCTYPE = "androidx.browser.trusted.sharing.KEY_ENCTYPE";
+ field public static final String KEY_METHOD = "androidx.browser.trusted.sharing.KEY_METHOD";
+ field public static final String KEY_PARAMS = "androidx.browser.trusted.sharing.KEY_PARAMS";
+ field public static final String METHOD_GET = "GET";
+ field public static final String METHOD_POST = "POST";
+ field public final String action;
+ field public final String? encodingType;
+ field public final String? method;
+ field public final androidx.browser.trusted.sharing.ShareTarget.Params params;
+ }
+
+ public static final class ShareTarget.FileFormField {
+ ctor public ShareTarget.FileFormField(String, java.util.List<java.lang.String!>);
+ field public static final String KEY_ACCEPTED_TYPES = "androidx.browser.trusted.sharing.KEY_ACCEPTED_TYPES";
+ field public static final String KEY_NAME = "androidx.browser.trusted.sharing.KEY_FILE_NAME";
+ field public final java.util.List<java.lang.String!> acceptedTypes;
+ field public final String name;
+ }
+
+ public static class ShareTarget.Params {
+ ctor public ShareTarget.Params(String?, String?, java.util.List<androidx.browser.trusted.sharing.ShareTarget.FileFormField!>?);
+ field public static final String KEY_FILES = "androidx.browser.trusted.sharing.KEY_FILES";
+ field public static final String KEY_TEXT = "androidx.browser.trusted.sharing.KEY_TEXT";
+ field public static final String KEY_TITLE = "androidx.browser.trusted.sharing.KEY_TITLE";
+ field public final java.util.List<androidx.browser.trusted.sharing.ShareTarget.FileFormField!>? files;
+ field public final String? text;
+ field public final String? title;
+ }
+
+}
+
+package androidx.browser.trusted.splashscreens {
+
+ public final class SplashScreenParamKey {
+ field public static final String KEY_BACKGROUND_COLOR = "androidx.browser.trusted.trusted.KEY_SPLASH_SCREEN_BACKGROUND_COLOR";
+ field public static final String KEY_FADE_OUT_DURATION_MS = "androidx.browser.trusted.KEY_SPLASH_SCREEN_FADE_OUT_DURATION";
+ field public static final String KEY_IMAGE_TRANSFORMATION_MATRIX = "androidx.browser.trusted.KEY_SPLASH_SCREEN_TRANSFORMATION_MATRIX";
+ field public static final String KEY_SCALE_TYPE = "androidx.browser.trusted.KEY_SPLASH_SCREEN_SCALE_TYPE";
+ field public static final String KEY_VERSION = "androidx.browser.trusted.KEY_SPLASH_SCREEN_VERSION";
+ }
+
+ public final class SplashScreenVersion {
+ field public static final String V1 = "androidx.browser.trusted.category.TrustedWebActivitySplashScreensV1";
+ }
+
+}
+
diff --git a/browser/browser/api/api_lint.ignore b/browser/browser/api/api_lint.ignore
index 3b0edf0..56b3ce2 100644
--- a/browser/browser/api/api_lint.ignore
+++ b/browser/browser/api/api_lint.ignore
@@ -47,6 +47,10 @@
Inconsistent extra value; expected `androidx.browser.customtabs.extra.LAUNCH_AS_TRUSTED_WEB_ACTIVITY`, was `android.support.customtabs.extra.LAUNCH_AS_TRUSTED_WEB_ACTIVITY`
+AsyncSuffixFuture: androidx.browser.trusted.TrustedWebActivityServiceConnectionPool#connect(android.net.Uri, java.util.Set<androidx.browser.trusted.Token>, java.util.concurrent.Executor):
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
+
+
AutoBoxing: androidx.browser.customtabs.CustomTabColorSchemeParams#navigationBarColor:
Must avoid boxed primitives (`java.lang.Integer`)
AutoBoxing: androidx.browser.customtabs.CustomTabColorSchemeParams#navigationBarDividerColor:
diff --git a/browser/browser/api/public_plus_experimental_1.4.0-beta01.txt b/browser/browser/api/public_plus_experimental_1.4.0-beta01.txt
new file mode 100644
index 0000000..2f00014
--- /dev/null
+++ b/browser/browser/api/public_plus_experimental_1.4.0-beta01.txt
@@ -0,0 +1,450 @@
+// Signature format: 4.0
+package androidx.browser.browseractions {
+
+ @Deprecated public class BrowserActionItem {
+ ctor @Deprecated public BrowserActionItem(String, android.app.PendingIntent, @DrawableRes int);
+ ctor @Deprecated public BrowserActionItem(String, android.app.PendingIntent);
+ method @Deprecated public android.app.PendingIntent getAction();
+ method @Deprecated public int getIconId();
+ method @Deprecated public String getTitle();
+ }
+
+ @Deprecated public class BrowserActionsIntent {
+ method @Deprecated public static String? getCreatorPackageName(android.content.Intent);
+ method @Deprecated public android.content.Intent getIntent();
+ method @Deprecated public static String? getUntrustedCreatorPackageName(android.content.Intent);
+ method @Deprecated public static void launchIntent(android.content.Context, android.content.Intent);
+ method @Deprecated public static void openBrowserAction(android.content.Context, android.net.Uri);
+ method @Deprecated public static void openBrowserAction(android.content.Context, android.net.Uri, int, java.util.ArrayList<androidx.browser.browseractions.BrowserActionItem!>, android.app.PendingIntent);
+ method @Deprecated public static java.util.List<androidx.browser.browseractions.BrowserActionItem!> parseBrowserActionItems(java.util.ArrayList<android.os.Bundle!>);
+ field @Deprecated public static final String ACTION_BROWSER_ACTIONS_OPEN = "androidx.browser.browseractions.browser_action_open";
+ field @Deprecated public static final String EXTRA_APP_ID = "androidx.browser.browseractions.APP_ID";
+ field @Deprecated public static final String EXTRA_MENU_ITEMS = "androidx.browser.browseractions.extra.MENU_ITEMS";
+ field @Deprecated public static final String EXTRA_SELECTED_ACTION_PENDING_INTENT = "androidx.browser.browseractions.extra.SELECTED_ACTION_PENDING_INTENT";
+ field @Deprecated public static final String EXTRA_TYPE = "androidx.browser.browseractions.extra.TYPE";
+ field @Deprecated public static final int ITEM_COPY = 3; // 0x3
+ field @Deprecated public static final int ITEM_DOWNLOAD = 2; // 0x2
+ field @Deprecated public static final int ITEM_INVALID_ITEM = -1; // 0xffffffff
+ field @Deprecated public static final int ITEM_OPEN_IN_INCOGNITO = 1; // 0x1
+ field @Deprecated public static final int ITEM_OPEN_IN_NEW_TAB = 0; // 0x0
+ field @Deprecated public static final int ITEM_SHARE = 4; // 0x4
+ field @Deprecated public static final String KEY_ACTION = "androidx.browser.browseractions.ACTION";
+ field @Deprecated public static final String KEY_ICON_ID = "androidx.browser.browseractions.ICON_ID";
+ field @Deprecated public static final String KEY_TITLE = "androidx.browser.browseractions.TITLE";
+ field @Deprecated public static final int MAX_CUSTOM_ITEMS = 5; // 0x5
+ field @Deprecated public static final int URL_TYPE_AUDIO = 3; // 0x3
+ field @Deprecated public static final int URL_TYPE_FILE = 4; // 0x4
+ field @Deprecated public static final int URL_TYPE_IMAGE = 1; // 0x1
+ field @Deprecated public static final int URL_TYPE_NONE = 0; // 0x0
+ field @Deprecated public static final int URL_TYPE_PLUGIN = 5; // 0x5
+ field @Deprecated public static final int URL_TYPE_VIDEO = 2; // 0x2
+ }
+
+ @Deprecated public static final class BrowserActionsIntent.Builder {
+ ctor @Deprecated public BrowserActionsIntent.Builder(android.content.Context, android.net.Uri);
+ method @Deprecated public androidx.browser.browseractions.BrowserActionsIntent build();
+ method @Deprecated public androidx.browser.browseractions.BrowserActionsIntent.Builder setCustomItems(java.util.ArrayList<androidx.browser.browseractions.BrowserActionItem!>);
+ method @Deprecated public androidx.browser.browseractions.BrowserActionsIntent.Builder setCustomItems(androidx.browser.browseractions.BrowserActionItem!...);
+ method @Deprecated public androidx.browser.browseractions.BrowserActionsIntent.Builder setOnItemSelectedAction(android.app.PendingIntent);
+ method @Deprecated public androidx.browser.browseractions.BrowserActionsIntent.Builder setUrlType(int);
+ }
+
+}
+
+package androidx.browser.customtabs {
+
+ public final class CustomTabColorSchemeParams {
+ field @ColorInt public final Integer? navigationBarColor;
+ field @ColorInt public final Integer? navigationBarDividerColor;
+ field @ColorInt public final Integer? secondaryToolbarColor;
+ field @ColorInt public final Integer? toolbarColor;
+ }
+
+ public static final class CustomTabColorSchemeParams.Builder {
+ ctor public CustomTabColorSchemeParams.Builder();
+ method public androidx.browser.customtabs.CustomTabColorSchemeParams build();
+ method public androidx.browser.customtabs.CustomTabColorSchemeParams.Builder setNavigationBarColor(@ColorInt int);
+ method public androidx.browser.customtabs.CustomTabColorSchemeParams.Builder setNavigationBarDividerColor(@ColorInt int);
+ method public androidx.browser.customtabs.CustomTabColorSchemeParams.Builder setSecondaryToolbarColor(@ColorInt int);
+ method public androidx.browser.customtabs.CustomTabColorSchemeParams.Builder setToolbarColor(@ColorInt int);
+ }
+
+ public class CustomTabsCallback {
+ ctor public CustomTabsCallback();
+ method public void extraCallback(String, android.os.Bundle?);
+ method public android.os.Bundle? extraCallbackWithResult(String, android.os.Bundle?);
+ method public void onMessageChannelReady(android.os.Bundle?);
+ method public void onNavigationEvent(int, android.os.Bundle?);
+ method public void onPostMessage(String, android.os.Bundle?);
+ method public void onRelationshipValidationResult(@androidx.browser.customtabs.CustomTabsService.Relation int, android.net.Uri, boolean, android.os.Bundle?);
+ field public static final int NAVIGATION_ABORTED = 4; // 0x4
+ field public static final int NAVIGATION_FAILED = 3; // 0x3
+ field public static final int NAVIGATION_FINISHED = 2; // 0x2
+ field public static final int NAVIGATION_STARTED = 1; // 0x1
+ field public static final int TAB_HIDDEN = 6; // 0x6
+ field public static final int TAB_SHOWN = 5; // 0x5
+ }
+
+ public class CustomTabsClient {
+ method public static boolean bindCustomTabsService(android.content.Context, String?, androidx.browser.customtabs.CustomTabsServiceConnection);
+ method public static boolean bindCustomTabsServicePreservePriority(android.content.Context, String?, androidx.browser.customtabs.CustomTabsServiceConnection);
+ method public static boolean connectAndInitialize(android.content.Context, String);
+ method public android.os.Bundle? extraCommand(String, android.os.Bundle?);
+ method public static String? getPackageName(android.content.Context, java.util.List<java.lang.String!>?);
+ method public static String? getPackageName(android.content.Context, java.util.List<java.lang.String!>?, boolean);
+ method public androidx.browser.customtabs.CustomTabsSession? newSession(androidx.browser.customtabs.CustomTabsCallback?);
+ method public androidx.browser.customtabs.CustomTabsSession? newSession(androidx.browser.customtabs.CustomTabsCallback?, int);
+ method public boolean warmup(long);
+ }
+
+ public final class CustomTabsIntent {
+ method public static androidx.browser.customtabs.CustomTabColorSchemeParams getColorSchemeParams(android.content.Intent, int);
+ method public static int getMaxToolbarItems();
+ method public void launchUrl(android.content.Context, android.net.Uri);
+ method public static android.content.Intent setAlwaysUseBrowserUI(android.content.Intent?);
+ method public static boolean shouldAlwaysUseBrowserUI(android.content.Intent);
+ field public static final int COLOR_SCHEME_DARK = 2; // 0x2
+ field public static final int COLOR_SCHEME_LIGHT = 1; // 0x1
+ field public static final int COLOR_SCHEME_SYSTEM = 0; // 0x0
+ field public static final String EXTRA_ACTION_BUTTON_BUNDLE = "android.support.customtabs.extra.ACTION_BUTTON_BUNDLE";
+ field public static final String EXTRA_CLOSE_BUTTON_ICON = "android.support.customtabs.extra.CLOSE_BUTTON_ICON";
+ field public static final String EXTRA_COLOR_SCHEME = "androidx.browser.customtabs.extra.COLOR_SCHEME";
+ field public static final String EXTRA_COLOR_SCHEME_PARAMS = "androidx.browser.customtabs.extra.COLOR_SCHEME_PARAMS";
+ field @Deprecated public static final String EXTRA_DEFAULT_SHARE_MENU_ITEM = "android.support.customtabs.extra.SHARE_MENU_ITEM";
+ field public static final String EXTRA_ENABLE_INSTANT_APPS = "android.support.customtabs.extra.EXTRA_ENABLE_INSTANT_APPS";
+ field public static final String EXTRA_ENABLE_URLBAR_HIDING = "android.support.customtabs.extra.ENABLE_URLBAR_HIDING";
+ field public static final String EXTRA_EXIT_ANIMATION_BUNDLE = "android.support.customtabs.extra.EXIT_ANIMATION_BUNDLE";
+ field public static final String EXTRA_MENU_ITEMS = "android.support.customtabs.extra.MENU_ITEMS";
+ field public static final String EXTRA_NAVIGATION_BAR_COLOR = "androidx.browser.customtabs.extra.NAVIGATION_BAR_COLOR";
+ field public static final String EXTRA_NAVIGATION_BAR_DIVIDER_COLOR = "androidx.browser.customtabs.extra.NAVIGATION_BAR_DIVIDER_COLOR";
+ field public static final String EXTRA_REMOTEVIEWS = "android.support.customtabs.extra.EXTRA_REMOTEVIEWS";
+ field public static final String EXTRA_REMOTEVIEWS_CLICKED_ID = "android.support.customtabs.extra.EXTRA_REMOTEVIEWS_CLICKED_ID";
+ field public static final String EXTRA_REMOTEVIEWS_PENDINGINTENT = "android.support.customtabs.extra.EXTRA_REMOTEVIEWS_PENDINGINTENT";
+ field public static final String EXTRA_REMOTEVIEWS_VIEW_IDS = "android.support.customtabs.extra.EXTRA_REMOTEVIEWS_VIEW_IDS";
+ field public static final String EXTRA_SECONDARY_TOOLBAR_COLOR = "android.support.customtabs.extra.SECONDARY_TOOLBAR_COLOR";
+ field public static final String EXTRA_SESSION = "android.support.customtabs.extra.SESSION";
+ field public static final String EXTRA_SHARE_STATE = "androidx.browser.customtabs.extra.SHARE_STATE";
+ field public static final String EXTRA_TINT_ACTION_BUTTON = "android.support.customtabs.extra.TINT_ACTION_BUTTON";
+ field public static final String EXTRA_TITLE_VISIBILITY_STATE = "android.support.customtabs.extra.TITLE_VISIBILITY";
+ field public static final String EXTRA_TOOLBAR_COLOR = "android.support.customtabs.extra.TOOLBAR_COLOR";
+ field public static final String EXTRA_TOOLBAR_ITEMS = "android.support.customtabs.extra.TOOLBAR_ITEMS";
+ field public static final String KEY_DESCRIPTION = "android.support.customtabs.customaction.DESCRIPTION";
+ field public static final String KEY_ICON = "android.support.customtabs.customaction.ICON";
+ field public static final String KEY_ID = "android.support.customtabs.customaction.ID";
+ field public static final String KEY_MENU_ITEM_TITLE = "android.support.customtabs.customaction.MENU_ITEM_TITLE";
+ field public static final String KEY_PENDING_INTENT = "android.support.customtabs.customaction.PENDING_INTENT";
+ field public static final int NO_TITLE = 0; // 0x0
+ field public static final int SHARE_STATE_DEFAULT = 0; // 0x0
+ field public static final int SHARE_STATE_OFF = 2; // 0x2
+ field public static final int SHARE_STATE_ON = 1; // 0x1
+ field public static final int SHOW_PAGE_TITLE = 1; // 0x1
+ field public static final int TOOLBAR_ACTION_BUTTON_ID = 0; // 0x0
+ field public final android.content.Intent intent;
+ field public final android.os.Bundle? startAnimationBundle;
+ }
+
+ public static final class CustomTabsIntent.Builder {
+ ctor public CustomTabsIntent.Builder();
+ ctor public CustomTabsIntent.Builder(androidx.browser.customtabs.CustomTabsSession?);
+ method @Deprecated public androidx.browser.customtabs.CustomTabsIntent.Builder addDefaultShareMenuItem();
+ method public androidx.browser.customtabs.CustomTabsIntent.Builder addMenuItem(String, android.app.PendingIntent);
+ method @Deprecated public androidx.browser.customtabs.CustomTabsIntent.Builder addToolbarItem(int, android.graphics.Bitmap, String, android.app.PendingIntent) throws java.lang.IllegalStateException;
+ method public androidx.browser.customtabs.CustomTabsIntent build();
+ method @Deprecated public androidx.browser.customtabs.CustomTabsIntent.Builder enableUrlBarHiding();
+ method public androidx.browser.customtabs.CustomTabsIntent.Builder setActionButton(android.graphics.Bitmap, String, android.app.PendingIntent, boolean);
+ method public androidx.browser.customtabs.CustomTabsIntent.Builder setActionButton(android.graphics.Bitmap, String, android.app.PendingIntent);
+ method public androidx.browser.customtabs.CustomTabsIntent.Builder setCloseButtonIcon(android.graphics.Bitmap);
+ method public androidx.browser.customtabs.CustomTabsIntent.Builder setColorScheme(int);
+ method public androidx.browser.customtabs.CustomTabsIntent.Builder setColorSchemeParams(int, androidx.browser.customtabs.CustomTabColorSchemeParams);
+ method public androidx.browser.customtabs.CustomTabsIntent.Builder setDefaultColorSchemeParams(androidx.browser.customtabs.CustomTabColorSchemeParams);
+ method @Deprecated public androidx.browser.customtabs.CustomTabsIntent.Builder setDefaultShareMenuItemEnabled(boolean);
+ method public androidx.browser.customtabs.CustomTabsIntent.Builder setExitAnimations(android.content.Context, @AnimRes int, @AnimRes int);
+ method public androidx.browser.customtabs.CustomTabsIntent.Builder setInstantAppsEnabled(boolean);
+ method @Deprecated public androidx.browser.customtabs.CustomTabsIntent.Builder setNavigationBarColor(@ColorInt int);
+ method @Deprecated public androidx.browser.customtabs.CustomTabsIntent.Builder setNavigationBarDividerColor(@ColorInt int);
+ method @Deprecated public androidx.browser.customtabs.CustomTabsIntent.Builder setSecondaryToolbarColor(@ColorInt int);
+ method public androidx.browser.customtabs.CustomTabsIntent.Builder setSecondaryToolbarViews(android.widget.RemoteViews, int[]?, android.app.PendingIntent?);
+ method public androidx.browser.customtabs.CustomTabsIntent.Builder setSession(androidx.browser.customtabs.CustomTabsSession);
+ method public androidx.browser.customtabs.CustomTabsIntent.Builder setShareState(int);
+ method public androidx.browser.customtabs.CustomTabsIntent.Builder setShowTitle(boolean);
+ method public androidx.browser.customtabs.CustomTabsIntent.Builder setStartAnimations(android.content.Context, @AnimRes int, @AnimRes int);
+ method @Deprecated public androidx.browser.customtabs.CustomTabsIntent.Builder setToolbarColor(@ColorInt int);
+ method public androidx.browser.customtabs.CustomTabsIntent.Builder setUrlBarHidingEnabled(boolean);
+ }
+
+ public abstract class CustomTabsService extends android.app.Service {
+ ctor public CustomTabsService();
+ method protected boolean cleanUpSession(androidx.browser.customtabs.CustomTabsSessionToken);
+ method protected abstract android.os.Bundle? extraCommand(String, android.os.Bundle?);
+ method protected abstract boolean mayLaunchUrl(androidx.browser.customtabs.CustomTabsSessionToken, android.net.Uri?, android.os.Bundle?, java.util.List<android.os.Bundle!>?);
+ method protected abstract boolean newSession(androidx.browser.customtabs.CustomTabsSessionToken);
+ method public android.os.IBinder onBind(android.content.Intent?);
+ method @androidx.browser.customtabs.CustomTabsService.Result protected abstract int postMessage(androidx.browser.customtabs.CustomTabsSessionToken, String, android.os.Bundle?);
+ method protected abstract boolean receiveFile(androidx.browser.customtabs.CustomTabsSessionToken, android.net.Uri, int, android.os.Bundle?);
+ method protected abstract boolean requestPostMessageChannel(androidx.browser.customtabs.CustomTabsSessionToken, android.net.Uri);
+ method protected abstract boolean updateVisuals(androidx.browser.customtabs.CustomTabsSessionToken, android.os.Bundle?);
+ method protected abstract boolean validateRelationship(androidx.browser.customtabs.CustomTabsSessionToken, @androidx.browser.customtabs.CustomTabsService.Relation int, android.net.Uri, android.os.Bundle?);
+ method protected abstract boolean warmup(long);
+ field public static final String ACTION_CUSTOM_TABS_CONNECTION = "android.support.customtabs.action.CustomTabsService";
+ field public static final String CATEGORY_COLOR_SCHEME_CUSTOMIZATION = "androidx.browser.customtabs.category.ColorSchemeCustomization";
+ field public static final String CATEGORY_NAVBAR_COLOR_CUSTOMIZATION = "androidx.browser.customtabs.category.NavBarColorCustomization";
+ field public static final String CATEGORY_TRUSTED_WEB_ACTIVITY_IMMERSIVE_MODE = "androidx.browser.trusted.category.ImmersiveMode";
+ field public static final String CATEGORY_WEB_SHARE_TARGET_V2 = "androidx.browser.trusted.category.WebShareTargetV2";
+ field public static final int FILE_PURPOSE_TRUSTED_WEB_ACTIVITY_SPLASH_IMAGE = 1; // 0x1
+ field public static final String KEY_SUCCESS = "androidx.browser.customtabs.SUCCESS";
+ field public static final String KEY_URL = "android.support.customtabs.otherurls.URL";
+ field public static final int RELATION_HANDLE_ALL_URLS = 2; // 0x2
+ field public static final int RELATION_USE_AS_ORIGIN = 1; // 0x1
+ field public static final int RESULT_FAILURE_DISALLOWED = -1; // 0xffffffff
+ field public static final int RESULT_FAILURE_MESSAGING_ERROR = -3; // 0xfffffffd
+ field public static final int RESULT_FAILURE_REMOTE_ERROR = -2; // 0xfffffffe
+ field public static final int RESULT_SUCCESS = 0; // 0x0
+ field public static final String TRUSTED_WEB_ACTIVITY_CATEGORY = "androidx.browser.trusted.category.TrustedWebActivities";
+ }
+
+ @IntDef({androidx.browser.customtabs.CustomTabsService.RELATION_USE_AS_ORIGIN, androidx.browser.customtabs.CustomTabsService.RELATION_HANDLE_ALL_URLS}) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) public static @interface CustomTabsService.Relation {
+ }
+
+ @IntDef({androidx.browser.customtabs.CustomTabsService.RESULT_SUCCESS, androidx.browser.customtabs.CustomTabsService.RESULT_FAILURE_DISALLOWED, androidx.browser.customtabs.CustomTabsService.RESULT_FAILURE_REMOTE_ERROR, androidx.browser.customtabs.CustomTabsService.RESULT_FAILURE_MESSAGING_ERROR}) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) public static @interface CustomTabsService.Result {
+ }
+
+ public abstract class CustomTabsServiceConnection implements android.content.ServiceConnection {
+ ctor public CustomTabsServiceConnection();
+ method public abstract void onCustomTabsServiceConnected(android.content.ComponentName, androidx.browser.customtabs.CustomTabsClient);
+ method public final void onServiceConnected(android.content.ComponentName, android.os.IBinder);
+ }
+
+ public final class CustomTabsSession {
+ method @VisibleForTesting public static androidx.browser.customtabs.CustomTabsSession createMockSessionForTesting(android.content.ComponentName);
+ method public boolean mayLaunchUrl(android.net.Uri?, android.os.Bundle?, java.util.List<android.os.Bundle!>?);
+ method @androidx.browser.customtabs.CustomTabsService.Result public int postMessage(String, android.os.Bundle?);
+ method public boolean receiveFile(android.net.Uri, int, android.os.Bundle?);
+ method public boolean requestPostMessageChannel(android.net.Uri);
+ method public boolean setActionButton(android.graphics.Bitmap, String);
+ method public boolean setSecondaryToolbarViews(android.widget.RemoteViews?, int[]?, android.app.PendingIntent?);
+ method @Deprecated public boolean setToolbarItem(int, android.graphics.Bitmap, String);
+ method public boolean validateRelationship(@androidx.browser.customtabs.CustomTabsService.Relation int, android.net.Uri, android.os.Bundle?);
+ }
+
+ public class CustomTabsSessionToken {
+ method public static androidx.browser.customtabs.CustomTabsSessionToken createMockSessionTokenForTesting();
+ method public androidx.browser.customtabs.CustomTabsCallback? getCallback();
+ method public static androidx.browser.customtabs.CustomTabsSessionToken? getSessionTokenFromIntent(android.content.Intent);
+ method public boolean isAssociatedWith(androidx.browser.customtabs.CustomTabsSession);
+ }
+
+ public class PostMessageService extends android.app.Service {
+ ctor public PostMessageService();
+ method public android.os.IBinder onBind(android.content.Intent?);
+ }
+
+ public abstract class PostMessageServiceConnection implements android.content.ServiceConnection {
+ ctor public PostMessageServiceConnection(androidx.browser.customtabs.CustomTabsSessionToken);
+ method public boolean bindSessionToPostMessageService(android.content.Context, String);
+ method public final boolean notifyMessageChannelReady(android.os.Bundle?);
+ method public void onPostMessageServiceConnected();
+ method public void onPostMessageServiceDisconnected();
+ method public final void onServiceConnected(android.content.ComponentName, android.os.IBinder);
+ method public final void onServiceDisconnected(android.content.ComponentName);
+ method public final boolean postMessage(String, android.os.Bundle?);
+ method public void unbindFromContext(android.content.Context);
+ }
+
+ public class TrustedWebUtils {
+ method public static boolean areSplashScreensSupported(android.content.Context, String, String);
+ method @Deprecated public static void launchAsTrustedWebActivity(android.content.Context, androidx.browser.customtabs.CustomTabsIntent, android.net.Uri);
+ method @WorkerThread public static boolean transferSplashImage(android.content.Context, java.io.File, String, String, androidx.browser.customtabs.CustomTabsSession);
+ field public static final String EXTRA_LAUNCH_AS_TRUSTED_WEB_ACTIVITY = "android.support.customtabs.extra.LAUNCH_AS_TRUSTED_WEB_ACTIVITY";
+ }
+
+}
+
+package androidx.browser.trusted {
+
+ public final class ScreenOrientation {
+ field public static final int ANY = 5; // 0x5
+ field public static final int DEFAULT = 0; // 0x0
+ field public static final int LANDSCAPE = 6; // 0x6
+ field public static final int LANDSCAPE_PRIMARY = 3; // 0x3
+ field public static final int LANDSCAPE_SECONDARY = 4; // 0x4
+ field public static final int NATURAL = 8; // 0x8
+ field public static final int PORTRAIT = 7; // 0x7
+ field public static final int PORTRAIT_PRIMARY = 1; // 0x1
+ field public static final int PORTRAIT_SECONDARY = 2; // 0x2
+ }
+
+ public final class Token {
+ method public static androidx.browser.trusted.Token? create(String, android.content.pm.PackageManager);
+ method public static androidx.browser.trusted.Token deserialize(byte[]);
+ method public boolean matches(String, android.content.pm.PackageManager);
+ method public byte[] serialize();
+ }
+
+ public interface TokenStore {
+ method @BinderThread public androidx.browser.trusted.Token? load();
+ method @WorkerThread public void store(androidx.browser.trusted.Token?);
+ }
+
+ public abstract class TrustedWebActivityCallback {
+ ctor public TrustedWebActivityCallback();
+ method public abstract void onExtraCallback(String, android.os.Bundle?);
+ }
+
+ public class TrustedWebActivityCallbackRemote {
+ method public void runExtraCallback(String, android.os.Bundle) throws android.os.RemoteException;
+ }
+
+ public interface TrustedWebActivityDisplayMode {
+ method public static androidx.browser.trusted.TrustedWebActivityDisplayMode fromBundle(android.os.Bundle);
+ method public android.os.Bundle toBundle();
+ field public static final String KEY_ID = "androidx.browser.trusted.displaymode.KEY_ID";
+ }
+
+ public static class TrustedWebActivityDisplayMode.DefaultMode implements androidx.browser.trusted.TrustedWebActivityDisplayMode {
+ ctor public TrustedWebActivityDisplayMode.DefaultMode();
+ method public android.os.Bundle toBundle();
+ }
+
+ public static class TrustedWebActivityDisplayMode.ImmersiveMode implements androidx.browser.trusted.TrustedWebActivityDisplayMode {
+ ctor public TrustedWebActivityDisplayMode.ImmersiveMode(boolean, int);
+ method public boolean isSticky();
+ method public int layoutInDisplayCutoutMode();
+ method public android.os.Bundle toBundle();
+ field public static final String KEY_CUTOUT_MODE = "androidx.browser.trusted.displaymode.KEY_CUTOUT_MODE";
+ field public static final String KEY_STICKY = "androidx.browser.trusted.displaymode.KEY_STICKY";
+ }
+
+ public final class TrustedWebActivityIntent {
+ method public android.content.Intent getIntent();
+ method public void launchTrustedWebActivity(android.content.Context);
+ }
+
+ public class TrustedWebActivityIntentBuilder {
+ ctor public TrustedWebActivityIntentBuilder(android.net.Uri);
+ method public androidx.browser.trusted.TrustedWebActivityIntent build(androidx.browser.customtabs.CustomTabsSession);
+ method public androidx.browser.customtabs.CustomTabsIntent buildCustomTabsIntent();
+ method public androidx.browser.trusted.TrustedWebActivityDisplayMode getDisplayMode();
+ method public android.net.Uri getUri();
+ method public androidx.browser.trusted.TrustedWebActivityIntentBuilder setAdditionalTrustedOrigins(java.util.List<java.lang.String!>);
+ method public androidx.browser.trusted.TrustedWebActivityIntentBuilder setColorScheme(int);
+ method public androidx.browser.trusted.TrustedWebActivityIntentBuilder setColorSchemeParams(int, androidx.browser.customtabs.CustomTabColorSchemeParams);
+ method public androidx.browser.trusted.TrustedWebActivityIntentBuilder setDefaultColorSchemeParams(androidx.browser.customtabs.CustomTabColorSchemeParams);
+ method public androidx.browser.trusted.TrustedWebActivityIntentBuilder setDisplayMode(androidx.browser.trusted.TrustedWebActivityDisplayMode);
+ method @Deprecated public androidx.browser.trusted.TrustedWebActivityIntentBuilder setNavigationBarColor(@ColorInt int);
+ method @Deprecated public androidx.browser.trusted.TrustedWebActivityIntentBuilder setNavigationBarDividerColor(@ColorInt int);
+ method public androidx.browser.trusted.TrustedWebActivityIntentBuilder setScreenOrientation(int);
+ method public androidx.browser.trusted.TrustedWebActivityIntentBuilder setShareParams(androidx.browser.trusted.sharing.ShareTarget, androidx.browser.trusted.sharing.ShareData);
+ method public androidx.browser.trusted.TrustedWebActivityIntentBuilder setSplashScreenParams(android.os.Bundle);
+ method @Deprecated public androidx.browser.trusted.TrustedWebActivityIntentBuilder setToolbarColor(@ColorInt int);
+ field public static final String EXTRA_ADDITIONAL_TRUSTED_ORIGINS = "android.support.customtabs.extra.ADDITIONAL_TRUSTED_ORIGINS";
+ field public static final String EXTRA_DISPLAY_MODE = "androidx.browser.trusted.extra.DISPLAY_MODE";
+ field public static final String EXTRA_SCREEN_ORIENTATION = "androidx.browser.trusted.extra.SCREEN_ORIENTATION";
+ field public static final String EXTRA_SHARE_DATA = "androidx.browser.trusted.extra.SHARE_DATA";
+ field public static final String EXTRA_SHARE_TARGET = "androidx.browser.trusted.extra.SHARE_TARGET";
+ field public static final String EXTRA_SPLASH_SCREEN_PARAMS = "androidx.browser.trusted.EXTRA_SPLASH_SCREEN_PARAMS";
+ }
+
+ public abstract class TrustedWebActivityService extends android.app.Service {
+ ctor public TrustedWebActivityService();
+ method @BinderThread public abstract androidx.browser.trusted.TokenStore getTokenStore();
+ method @BinderThread public boolean onAreNotificationsEnabled(String);
+ method @MainThread public final android.os.IBinder? onBind(android.content.Intent?);
+ method @BinderThread public void onCancelNotification(String, int);
+ method @BinderThread public android.os.Bundle? onExtraCommand(String, android.os.Bundle, androidx.browser.trusted.TrustedWebActivityCallbackRemote?);
+ method @BinderThread public android.os.Bundle onGetSmallIconBitmap();
+ method @BinderThread public int onGetSmallIconId();
+ method @BinderThread public boolean onNotifyNotificationWithChannel(String, int, android.app.Notification, String);
+ method @MainThread public final boolean onUnbind(android.content.Intent?);
+ field public static final String ACTION_TRUSTED_WEB_ACTIVITY_SERVICE = "android.support.customtabs.trusted.TRUSTED_WEB_ACTIVITY_SERVICE";
+ field public static final String KEY_SMALL_ICON_BITMAP = "android.support.customtabs.trusted.SMALL_ICON_BITMAP";
+ field public static final String KEY_SUCCESS = "androidx.browser.trusted.SUCCESS";
+ field public static final String META_DATA_NAME_SMALL_ICON = "android.support.customtabs.trusted.SMALL_ICON";
+ field public static final int SMALL_ICON_NOT_SET = -1; // 0xffffffff
+ }
+
+ public final class TrustedWebActivityServiceConnection {
+ method public boolean areNotificationsEnabled(String) throws android.os.RemoteException;
+ method public void cancel(String, int) throws android.os.RemoteException;
+ method public android.content.ComponentName getComponentName();
+ method public android.graphics.Bitmap? getSmallIconBitmap() throws android.os.RemoteException;
+ method public int getSmallIconId() throws android.os.RemoteException;
+ method public boolean notify(String, int, android.app.Notification, String) throws android.os.RemoteException;
+ method public android.os.Bundle? sendExtraCommand(String, android.os.Bundle, androidx.browser.trusted.TrustedWebActivityCallback?) throws android.os.RemoteException;
+ }
+
+ public final class TrustedWebActivityServiceConnectionPool {
+ method @MainThread public com.google.common.util.concurrent.ListenableFuture<androidx.browser.trusted.TrustedWebActivityServiceConnection!> connect(android.net.Uri, java.util.Set<androidx.browser.trusted.Token!>, java.util.concurrent.Executor);
+ method public static androidx.browser.trusted.TrustedWebActivityServiceConnectionPool create(android.content.Context);
+ method @MainThread public boolean serviceExistsForScope(android.net.Uri, java.util.Set<androidx.browser.trusted.Token!>);
+ }
+
+}
+
+package androidx.browser.trusted.sharing {
+
+ public final class ShareData {
+ ctor public ShareData(String?, String?, java.util.List<android.net.Uri!>?);
+ method public static androidx.browser.trusted.sharing.ShareData fromBundle(android.os.Bundle);
+ method public android.os.Bundle toBundle();
+ field public static final String KEY_TEXT = "androidx.browser.trusted.sharing.KEY_TEXT";
+ field public static final String KEY_TITLE = "androidx.browser.trusted.sharing.KEY_TITLE";
+ field public static final String KEY_URIS = "androidx.browser.trusted.sharing.KEY_URIS";
+ field public final String? text;
+ field public final String? title;
+ field public final java.util.List<android.net.Uri!>? uris;
+ }
+
+ public final class ShareTarget {
+ ctor public ShareTarget(String, String?, String?, androidx.browser.trusted.sharing.ShareTarget.Params);
+ method public static androidx.browser.trusted.sharing.ShareTarget? fromBundle(android.os.Bundle);
+ method public android.os.Bundle toBundle();
+ field public static final String ENCODING_TYPE_MULTIPART = "multipart/form-data";
+ field public static final String ENCODING_TYPE_URL_ENCODED = "application/x-www-form-urlencoded";
+ field public static final String KEY_ACTION = "androidx.browser.trusted.sharing.KEY_ACTION";
+ field public static final String KEY_ENCTYPE = "androidx.browser.trusted.sharing.KEY_ENCTYPE";
+ field public static final String KEY_METHOD = "androidx.browser.trusted.sharing.KEY_METHOD";
+ field public static final String KEY_PARAMS = "androidx.browser.trusted.sharing.KEY_PARAMS";
+ field public static final String METHOD_GET = "GET";
+ field public static final String METHOD_POST = "POST";
+ field public final String action;
+ field public final String? encodingType;
+ field public final String? method;
+ field public final androidx.browser.trusted.sharing.ShareTarget.Params params;
+ }
+
+ public static final class ShareTarget.FileFormField {
+ ctor public ShareTarget.FileFormField(String, java.util.List<java.lang.String!>);
+ field public static final String KEY_ACCEPTED_TYPES = "androidx.browser.trusted.sharing.KEY_ACCEPTED_TYPES";
+ field public static final String KEY_NAME = "androidx.browser.trusted.sharing.KEY_FILE_NAME";
+ field public final java.util.List<java.lang.String!> acceptedTypes;
+ field public final String name;
+ }
+
+ public static class ShareTarget.Params {
+ ctor public ShareTarget.Params(String?, String?, java.util.List<androidx.browser.trusted.sharing.ShareTarget.FileFormField!>?);
+ field public static final String KEY_FILES = "androidx.browser.trusted.sharing.KEY_FILES";
+ field public static final String KEY_TEXT = "androidx.browser.trusted.sharing.KEY_TEXT";
+ field public static final String KEY_TITLE = "androidx.browser.trusted.sharing.KEY_TITLE";
+ field public final java.util.List<androidx.browser.trusted.sharing.ShareTarget.FileFormField!>? files;
+ field public final String? text;
+ field public final String? title;
+ }
+
+}
+
+package androidx.browser.trusted.splashscreens {
+
+ public final class SplashScreenParamKey {
+ field public static final String KEY_BACKGROUND_COLOR = "androidx.browser.trusted.trusted.KEY_SPLASH_SCREEN_BACKGROUND_COLOR";
+ field public static final String KEY_FADE_OUT_DURATION_MS = "androidx.browser.trusted.KEY_SPLASH_SCREEN_FADE_OUT_DURATION";
+ field public static final String KEY_IMAGE_TRANSFORMATION_MATRIX = "androidx.browser.trusted.KEY_SPLASH_SCREEN_TRANSFORMATION_MATRIX";
+ field public static final String KEY_SCALE_TYPE = "androidx.browser.trusted.KEY_SPLASH_SCREEN_SCALE_TYPE";
+ field public static final String KEY_VERSION = "androidx.browser.trusted.KEY_SPLASH_SCREEN_VERSION";
+ }
+
+ public final class SplashScreenVersion {
+ field public static final String V1 = "androidx.browser.trusted.category.TrustedWebActivitySplashScreensV1";
+ }
+
+}
+
diff --git a/wear/wear-watchface/api/res-current.txt b/browser/browser/api/res-1.4.0-beta01.txt
similarity index 100%
copy from wear/wear-watchface/api/res-current.txt
copy to browser/browser/api/res-1.4.0-beta01.txt
diff --git a/browser/browser/api/restricted_1.4.0-beta01.txt b/browser/browser/api/restricted_1.4.0-beta01.txt
new file mode 100644
index 0000000..6f8400b
--- /dev/null
+++ b/browser/browser/api/restricted_1.4.0-beta01.txt
@@ -0,0 +1,461 @@
+// Signature format: 4.0
+package androidx.browser.browseractions {
+
+ @Deprecated public class BrowserActionItem {
+ ctor @Deprecated public BrowserActionItem(String, android.app.PendingIntent, @DrawableRes int);
+ ctor @Deprecated @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public BrowserActionItem(String, android.app.PendingIntent, android.net.Uri);
+ ctor @Deprecated public BrowserActionItem(String, android.app.PendingIntent);
+ method @Deprecated public android.app.PendingIntent getAction();
+ method @Deprecated public int getIconId();
+ method @Deprecated public String getTitle();
+ }
+
+ @Deprecated @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class BrowserActionsFallbackMenuView extends android.widget.LinearLayout {
+ ctor @Deprecated public BrowserActionsFallbackMenuView(android.content.Context, android.util.AttributeSet);
+ }
+
+ @Deprecated public class BrowserActionsIntent {
+ method @Deprecated public static String? getCreatorPackageName(android.content.Intent);
+ method @Deprecated public android.content.Intent getIntent();
+ method @Deprecated public static String? getUntrustedCreatorPackageName(android.content.Intent);
+ method @Deprecated public static void launchIntent(android.content.Context, android.content.Intent);
+ method @Deprecated public static void openBrowserAction(android.content.Context, android.net.Uri);
+ method @Deprecated public static void openBrowserAction(android.content.Context, android.net.Uri, int, java.util.ArrayList<androidx.browser.browseractions.BrowserActionItem!>, android.app.PendingIntent);
+ method @Deprecated public static java.util.List<androidx.browser.browseractions.BrowserActionItem!> parseBrowserActionItems(java.util.ArrayList<android.os.Bundle!>);
+ field @Deprecated public static final String ACTION_BROWSER_ACTIONS_OPEN = "androidx.browser.browseractions.browser_action_open";
+ field @Deprecated public static final String EXTRA_APP_ID = "androidx.browser.browseractions.APP_ID";
+ field @Deprecated public static final String EXTRA_MENU_ITEMS = "androidx.browser.browseractions.extra.MENU_ITEMS";
+ field @Deprecated public static final String EXTRA_SELECTED_ACTION_PENDING_INTENT = "androidx.browser.browseractions.extra.SELECTED_ACTION_PENDING_INTENT";
+ field @Deprecated public static final String EXTRA_TYPE = "androidx.browser.browseractions.extra.TYPE";
+ field @Deprecated public static final int ITEM_COPY = 3; // 0x3
+ field @Deprecated public static final int ITEM_DOWNLOAD = 2; // 0x2
+ field @Deprecated public static final int ITEM_INVALID_ITEM = -1; // 0xffffffff
+ field @Deprecated public static final int ITEM_OPEN_IN_INCOGNITO = 1; // 0x1
+ field @Deprecated public static final int ITEM_OPEN_IN_NEW_TAB = 0; // 0x0
+ field @Deprecated public static final int ITEM_SHARE = 4; // 0x4
+ field @Deprecated public static final String KEY_ACTION = "androidx.browser.browseractions.ACTION";
+ field @Deprecated public static final String KEY_ICON_ID = "androidx.browser.browseractions.ICON_ID";
+ field @Deprecated public static final String KEY_TITLE = "androidx.browser.browseractions.TITLE";
+ field @Deprecated public static final int MAX_CUSTOM_ITEMS = 5; // 0x5
+ field @Deprecated public static final int URL_TYPE_AUDIO = 3; // 0x3
+ field @Deprecated public static final int URL_TYPE_FILE = 4; // 0x4
+ field @Deprecated public static final int URL_TYPE_IMAGE = 1; // 0x1
+ field @Deprecated public static final int URL_TYPE_NONE = 0; // 0x0
+ field @Deprecated public static final int URL_TYPE_PLUGIN = 5; // 0x5
+ field @Deprecated public static final int URL_TYPE_VIDEO = 2; // 0x2
+ }
+
+ @Deprecated @IntDef({androidx.browser.browseractions.BrowserActionsIntent.ITEM_INVALID_ITEM, androidx.browser.browseractions.BrowserActionsIntent.ITEM_OPEN_IN_NEW_TAB, androidx.browser.browseractions.BrowserActionsIntent.ITEM_OPEN_IN_INCOGNITO, androidx.browser.browseractions.BrowserActionsIntent.ITEM_DOWNLOAD, androidx.browser.browseractions.BrowserActionsIntent.ITEM_COPY, androidx.browser.browseractions.BrowserActionsIntent.ITEM_SHARE}) @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) public static @interface BrowserActionsIntent.BrowserActionsItemId {
+ }
+
+ @Deprecated @IntDef({androidx.browser.browseractions.BrowserActionsIntent.URL_TYPE_NONE, androidx.browser.browseractions.BrowserActionsIntent.URL_TYPE_IMAGE, androidx.browser.browseractions.BrowserActionsIntent.URL_TYPE_VIDEO, androidx.browser.browseractions.BrowserActionsIntent.URL_TYPE_AUDIO, androidx.browser.browseractions.BrowserActionsIntent.URL_TYPE_FILE, androidx.browser.browseractions.BrowserActionsIntent.URL_TYPE_PLUGIN}) @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) public static @interface BrowserActionsIntent.BrowserActionsUrlType {
+ }
+
+ @Deprecated public static final class BrowserActionsIntent.Builder {
+ ctor @Deprecated public BrowserActionsIntent.Builder(android.content.Context, android.net.Uri);
+ method @Deprecated public androidx.browser.browseractions.BrowserActionsIntent build();
+ method @Deprecated public androidx.browser.browseractions.BrowserActionsIntent.Builder setCustomItems(java.util.ArrayList<androidx.browser.browseractions.BrowserActionItem!>);
+ method @Deprecated public androidx.browser.browseractions.BrowserActionsIntent.Builder setCustomItems(androidx.browser.browseractions.BrowserActionItem!...);
+ method @Deprecated public androidx.browser.browseractions.BrowserActionsIntent.Builder setOnItemSelectedAction(android.app.PendingIntent);
+ method @Deprecated public androidx.browser.browseractions.BrowserActionsIntent.Builder setUrlType(@androidx.browser.browseractions.BrowserActionsIntent.BrowserActionsUrlType int);
+ }
+
+}
+
+package androidx.browser.customtabs {
+
+ public final class CustomTabColorSchemeParams {
+ field @ColorInt public final Integer? navigationBarColor;
+ field @ColorInt public final Integer? navigationBarDividerColor;
+ field @ColorInt public final Integer? secondaryToolbarColor;
+ field @ColorInt public final Integer? toolbarColor;
+ }
+
+ public static final class CustomTabColorSchemeParams.Builder {
+ ctor public CustomTabColorSchemeParams.Builder();
+ method public androidx.browser.customtabs.CustomTabColorSchemeParams build();
+ method public androidx.browser.customtabs.CustomTabColorSchemeParams.Builder setNavigationBarColor(@ColorInt int);
+ method public androidx.browser.customtabs.CustomTabColorSchemeParams.Builder setNavigationBarDividerColor(@ColorInt int);
+ method public androidx.browser.customtabs.CustomTabColorSchemeParams.Builder setSecondaryToolbarColor(@ColorInt int);
+ method public androidx.browser.customtabs.CustomTabColorSchemeParams.Builder setToolbarColor(@ColorInt int);
+ }
+
+ public class CustomTabsCallback {
+ ctor public CustomTabsCallback();
+ method public void extraCallback(String, android.os.Bundle?);
+ method public android.os.Bundle? extraCallbackWithResult(String, android.os.Bundle?);
+ method public void onMessageChannelReady(android.os.Bundle?);
+ method public void onNavigationEvent(int, android.os.Bundle?);
+ method public void onPostMessage(String, android.os.Bundle?);
+ method public void onRelationshipValidationResult(@androidx.browser.customtabs.CustomTabsService.Relation int, android.net.Uri, boolean, android.os.Bundle?);
+ field public static final int NAVIGATION_ABORTED = 4; // 0x4
+ field public static final int NAVIGATION_FAILED = 3; // 0x3
+ field public static final int NAVIGATION_FINISHED = 2; // 0x2
+ field public static final int NAVIGATION_STARTED = 1; // 0x1
+ field public static final int TAB_HIDDEN = 6; // 0x6
+ field public static final int TAB_SHOWN = 5; // 0x5
+ }
+
+ public class CustomTabsClient {
+ method public static boolean bindCustomTabsService(android.content.Context, String?, androidx.browser.customtabs.CustomTabsServiceConnection);
+ method public static boolean bindCustomTabsServicePreservePriority(android.content.Context, String?, androidx.browser.customtabs.CustomTabsServiceConnection);
+ method public static boolean connectAndInitialize(android.content.Context, String);
+ method public android.os.Bundle? extraCommand(String, android.os.Bundle?);
+ method public static String? getPackageName(android.content.Context, java.util.List<java.lang.String!>?);
+ method public static String? getPackageName(android.content.Context, java.util.List<java.lang.String!>?, boolean);
+ method public androidx.browser.customtabs.CustomTabsSession? newSession(androidx.browser.customtabs.CustomTabsCallback?);
+ method public androidx.browser.customtabs.CustomTabsSession? newSession(androidx.browser.customtabs.CustomTabsCallback?, int);
+ method public boolean warmup(long);
+ }
+
+ public final class CustomTabsIntent {
+ method public static androidx.browser.customtabs.CustomTabColorSchemeParams getColorSchemeParams(android.content.Intent, int);
+ method public static int getMaxToolbarItems();
+ method public void launchUrl(android.content.Context, android.net.Uri);
+ method public static android.content.Intent setAlwaysUseBrowserUI(android.content.Intent?);
+ method public static boolean shouldAlwaysUseBrowserUI(android.content.Intent);
+ field public static final int COLOR_SCHEME_DARK = 2; // 0x2
+ field public static final int COLOR_SCHEME_LIGHT = 1; // 0x1
+ field public static final int COLOR_SCHEME_SYSTEM = 0; // 0x0
+ field public static final String EXTRA_ACTION_BUTTON_BUNDLE = "android.support.customtabs.extra.ACTION_BUTTON_BUNDLE";
+ field public static final String EXTRA_CLOSE_BUTTON_ICON = "android.support.customtabs.extra.CLOSE_BUTTON_ICON";
+ field public static final String EXTRA_COLOR_SCHEME = "androidx.browser.customtabs.extra.COLOR_SCHEME";
+ field public static final String EXTRA_COLOR_SCHEME_PARAMS = "androidx.browser.customtabs.extra.COLOR_SCHEME_PARAMS";
+ field @Deprecated public static final String EXTRA_DEFAULT_SHARE_MENU_ITEM = "android.support.customtabs.extra.SHARE_MENU_ITEM";
+ field public static final String EXTRA_ENABLE_INSTANT_APPS = "android.support.customtabs.extra.EXTRA_ENABLE_INSTANT_APPS";
+ field public static final String EXTRA_ENABLE_URLBAR_HIDING = "android.support.customtabs.extra.ENABLE_URLBAR_HIDING";
+ field public static final String EXTRA_EXIT_ANIMATION_BUNDLE = "android.support.customtabs.extra.EXIT_ANIMATION_BUNDLE";
+ field public static final String EXTRA_MENU_ITEMS = "android.support.customtabs.extra.MENU_ITEMS";
+ field public static final String EXTRA_NAVIGATION_BAR_COLOR = "androidx.browser.customtabs.extra.NAVIGATION_BAR_COLOR";
+ field public static final String EXTRA_NAVIGATION_BAR_DIVIDER_COLOR = "androidx.browser.customtabs.extra.NAVIGATION_BAR_DIVIDER_COLOR";
+ field public static final String EXTRA_REMOTEVIEWS = "android.support.customtabs.extra.EXTRA_REMOTEVIEWS";
+ field public static final String EXTRA_REMOTEVIEWS_CLICKED_ID = "android.support.customtabs.extra.EXTRA_REMOTEVIEWS_CLICKED_ID";
+ field public static final String EXTRA_REMOTEVIEWS_PENDINGINTENT = "android.support.customtabs.extra.EXTRA_REMOTEVIEWS_PENDINGINTENT";
+ field public static final String EXTRA_REMOTEVIEWS_VIEW_IDS = "android.support.customtabs.extra.EXTRA_REMOTEVIEWS_VIEW_IDS";
+ field public static final String EXTRA_SECONDARY_TOOLBAR_COLOR = "android.support.customtabs.extra.SECONDARY_TOOLBAR_COLOR";
+ field public static final String EXTRA_SESSION = "android.support.customtabs.extra.SESSION";
+ field public static final String EXTRA_SHARE_STATE = "androidx.browser.customtabs.extra.SHARE_STATE";
+ field public static final String EXTRA_TINT_ACTION_BUTTON = "android.support.customtabs.extra.TINT_ACTION_BUTTON";
+ field public static final String EXTRA_TITLE_VISIBILITY_STATE = "android.support.customtabs.extra.TITLE_VISIBILITY";
+ field public static final String EXTRA_TOOLBAR_COLOR = "android.support.customtabs.extra.TOOLBAR_COLOR";
+ field public static final String EXTRA_TOOLBAR_ITEMS = "android.support.customtabs.extra.TOOLBAR_ITEMS";
+ field public static final String KEY_DESCRIPTION = "android.support.customtabs.customaction.DESCRIPTION";
+ field public static final String KEY_ICON = "android.support.customtabs.customaction.ICON";
+ field public static final String KEY_ID = "android.support.customtabs.customaction.ID";
+ field public static final String KEY_MENU_ITEM_TITLE = "android.support.customtabs.customaction.MENU_ITEM_TITLE";
+ field public static final String KEY_PENDING_INTENT = "android.support.customtabs.customaction.PENDING_INTENT";
+ field public static final int NO_TITLE = 0; // 0x0
+ field public static final int SHARE_STATE_DEFAULT = 0; // 0x0
+ field public static final int SHARE_STATE_OFF = 2; // 0x2
+ field public static final int SHARE_STATE_ON = 1; // 0x1
+ field public static final int SHOW_PAGE_TITLE = 1; // 0x1
+ field public static final int TOOLBAR_ACTION_BUTTON_ID = 0; // 0x0
+ field public final android.content.Intent intent;
+ field public final android.os.Bundle? startAnimationBundle;
+ }
+
+ public static final class CustomTabsIntent.Builder {
+ ctor public CustomTabsIntent.Builder();
+ ctor public CustomTabsIntent.Builder(androidx.browser.customtabs.CustomTabsSession?);
+ method @Deprecated public androidx.browser.customtabs.CustomTabsIntent.Builder addDefaultShareMenuItem();
+ method public androidx.browser.customtabs.CustomTabsIntent.Builder addMenuItem(String, android.app.PendingIntent);
+ method @Deprecated public androidx.browser.customtabs.CustomTabsIntent.Builder addToolbarItem(int, android.graphics.Bitmap, String, android.app.PendingIntent) throws java.lang.IllegalStateException;
+ method public androidx.browser.customtabs.CustomTabsIntent build();
+ method @Deprecated public androidx.browser.customtabs.CustomTabsIntent.Builder enableUrlBarHiding();
+ method public androidx.browser.customtabs.CustomTabsIntent.Builder setActionButton(android.graphics.Bitmap, String, android.app.PendingIntent, boolean);
+ method public androidx.browser.customtabs.CustomTabsIntent.Builder setActionButton(android.graphics.Bitmap, String, android.app.PendingIntent);
+ method public androidx.browser.customtabs.CustomTabsIntent.Builder setCloseButtonIcon(android.graphics.Bitmap);
+ method public androidx.browser.customtabs.CustomTabsIntent.Builder setColorScheme(int);
+ method public androidx.browser.customtabs.CustomTabsIntent.Builder setColorSchemeParams(int, androidx.browser.customtabs.CustomTabColorSchemeParams);
+ method public androidx.browser.customtabs.CustomTabsIntent.Builder setDefaultColorSchemeParams(androidx.browser.customtabs.CustomTabColorSchemeParams);
+ method @Deprecated public androidx.browser.customtabs.CustomTabsIntent.Builder setDefaultShareMenuItemEnabled(boolean);
+ method public androidx.browser.customtabs.CustomTabsIntent.Builder setExitAnimations(android.content.Context, @AnimRes int, @AnimRes int);
+ method public androidx.browser.customtabs.CustomTabsIntent.Builder setInstantAppsEnabled(boolean);
+ method @Deprecated public androidx.browser.customtabs.CustomTabsIntent.Builder setNavigationBarColor(@ColorInt int);
+ method @Deprecated public androidx.browser.customtabs.CustomTabsIntent.Builder setNavigationBarDividerColor(@ColorInt int);
+ method @Deprecated public androidx.browser.customtabs.CustomTabsIntent.Builder setSecondaryToolbarColor(@ColorInt int);
+ method public androidx.browser.customtabs.CustomTabsIntent.Builder setSecondaryToolbarViews(android.widget.RemoteViews, int[]?, android.app.PendingIntent?);
+ method public androidx.browser.customtabs.CustomTabsIntent.Builder setSession(androidx.browser.customtabs.CustomTabsSession);
+ method public androidx.browser.customtabs.CustomTabsIntent.Builder setShareState(int);
+ method public androidx.browser.customtabs.CustomTabsIntent.Builder setShowTitle(boolean);
+ method public androidx.browser.customtabs.CustomTabsIntent.Builder setStartAnimations(android.content.Context, @AnimRes int, @AnimRes int);
+ method @Deprecated public androidx.browser.customtabs.CustomTabsIntent.Builder setToolbarColor(@ColorInt int);
+ method public androidx.browser.customtabs.CustomTabsIntent.Builder setUrlBarHidingEnabled(boolean);
+ }
+
+ public abstract class CustomTabsService extends android.app.Service {
+ ctor public CustomTabsService();
+ method protected boolean cleanUpSession(androidx.browser.customtabs.CustomTabsSessionToken);
+ method protected abstract android.os.Bundle? extraCommand(String, android.os.Bundle?);
+ method protected abstract boolean mayLaunchUrl(androidx.browser.customtabs.CustomTabsSessionToken, android.net.Uri?, android.os.Bundle?, java.util.List<android.os.Bundle!>?);
+ method protected abstract boolean newSession(androidx.browser.customtabs.CustomTabsSessionToken);
+ method public android.os.IBinder onBind(android.content.Intent?);
+ method @androidx.browser.customtabs.CustomTabsService.Result protected abstract int postMessage(androidx.browser.customtabs.CustomTabsSessionToken, String, android.os.Bundle?);
+ method protected abstract boolean receiveFile(androidx.browser.customtabs.CustomTabsSessionToken, android.net.Uri, int, android.os.Bundle?);
+ method protected abstract boolean requestPostMessageChannel(androidx.browser.customtabs.CustomTabsSessionToken, android.net.Uri);
+ method protected abstract boolean updateVisuals(androidx.browser.customtabs.CustomTabsSessionToken, android.os.Bundle?);
+ method protected abstract boolean validateRelationship(androidx.browser.customtabs.CustomTabsSessionToken, @androidx.browser.customtabs.CustomTabsService.Relation int, android.net.Uri, android.os.Bundle?);
+ method protected abstract boolean warmup(long);
+ field public static final String ACTION_CUSTOM_TABS_CONNECTION = "android.support.customtabs.action.CustomTabsService";
+ field public static final String CATEGORY_COLOR_SCHEME_CUSTOMIZATION = "androidx.browser.customtabs.category.ColorSchemeCustomization";
+ field public static final String CATEGORY_NAVBAR_COLOR_CUSTOMIZATION = "androidx.browser.customtabs.category.NavBarColorCustomization";
+ field public static final String CATEGORY_TRUSTED_WEB_ACTIVITY_IMMERSIVE_MODE = "androidx.browser.trusted.category.ImmersiveMode";
+ field public static final String CATEGORY_WEB_SHARE_TARGET_V2 = "androidx.browser.trusted.category.WebShareTargetV2";
+ field public static final int FILE_PURPOSE_TRUSTED_WEB_ACTIVITY_SPLASH_IMAGE = 1; // 0x1
+ field public static final String KEY_SUCCESS = "androidx.browser.customtabs.SUCCESS";
+ field public static final String KEY_URL = "android.support.customtabs.otherurls.URL";
+ field public static final int RELATION_HANDLE_ALL_URLS = 2; // 0x2
+ field public static final int RELATION_USE_AS_ORIGIN = 1; // 0x1
+ field public static final int RESULT_FAILURE_DISALLOWED = -1; // 0xffffffff
+ field public static final int RESULT_FAILURE_MESSAGING_ERROR = -3; // 0xfffffffd
+ field public static final int RESULT_FAILURE_REMOTE_ERROR = -2; // 0xfffffffe
+ field public static final int RESULT_SUCCESS = 0; // 0x0
+ field public static final String TRUSTED_WEB_ACTIVITY_CATEGORY = "androidx.browser.trusted.category.TrustedWebActivities";
+ }
+
+ @IntDef({androidx.browser.customtabs.CustomTabsService.RELATION_USE_AS_ORIGIN, androidx.browser.customtabs.CustomTabsService.RELATION_HANDLE_ALL_URLS}) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) public static @interface CustomTabsService.Relation {
+ }
+
+ @IntDef({androidx.browser.customtabs.CustomTabsService.RESULT_SUCCESS, androidx.browser.customtabs.CustomTabsService.RESULT_FAILURE_DISALLOWED, androidx.browser.customtabs.CustomTabsService.RESULT_FAILURE_REMOTE_ERROR, androidx.browser.customtabs.CustomTabsService.RESULT_FAILURE_MESSAGING_ERROR}) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) public static @interface CustomTabsService.Result {
+ }
+
+ public abstract class CustomTabsServiceConnection implements android.content.ServiceConnection {
+ ctor public CustomTabsServiceConnection();
+ method public abstract void onCustomTabsServiceConnected(android.content.ComponentName, androidx.browser.customtabs.CustomTabsClient);
+ method public final void onServiceConnected(android.content.ComponentName, android.os.IBinder);
+ }
+
+ public final class CustomTabsSession {
+ method @VisibleForTesting public static androidx.browser.customtabs.CustomTabsSession createMockSessionForTesting(android.content.ComponentName);
+ method public boolean mayLaunchUrl(android.net.Uri?, android.os.Bundle?, java.util.List<android.os.Bundle!>?);
+ method @androidx.browser.customtabs.CustomTabsService.Result public int postMessage(String, android.os.Bundle?);
+ method public boolean receiveFile(android.net.Uri, int, android.os.Bundle?);
+ method public boolean requestPostMessageChannel(android.net.Uri);
+ method public boolean setActionButton(android.graphics.Bitmap, String);
+ method public boolean setSecondaryToolbarViews(android.widget.RemoteViews?, int[]?, android.app.PendingIntent?);
+ method @Deprecated public boolean setToolbarItem(int, android.graphics.Bitmap, String);
+ method public boolean validateRelationship(@androidx.browser.customtabs.CustomTabsService.Relation int, android.net.Uri, android.os.Bundle?);
+ }
+
+ public class CustomTabsSessionToken {
+ method public static androidx.browser.customtabs.CustomTabsSessionToken createMockSessionTokenForTesting();
+ method public androidx.browser.customtabs.CustomTabsCallback? getCallback();
+ method public static androidx.browser.customtabs.CustomTabsSessionToken? getSessionTokenFromIntent(android.content.Intent);
+ method public boolean isAssociatedWith(androidx.browser.customtabs.CustomTabsSession);
+ }
+
+ public class PostMessageService extends android.app.Service {
+ ctor public PostMessageService();
+ method public android.os.IBinder onBind(android.content.Intent?);
+ }
+
+ public abstract class PostMessageServiceConnection implements android.content.ServiceConnection {
+ ctor public PostMessageServiceConnection(androidx.browser.customtabs.CustomTabsSessionToken);
+ method public boolean bindSessionToPostMessageService(android.content.Context, String);
+ method public final boolean notifyMessageChannelReady(android.os.Bundle?);
+ method public void onPostMessageServiceConnected();
+ method public void onPostMessageServiceDisconnected();
+ method public final void onServiceConnected(android.content.ComponentName, android.os.IBinder);
+ method public final void onServiceDisconnected(android.content.ComponentName);
+ method public final boolean postMessage(String, android.os.Bundle?);
+ method public void unbindFromContext(android.content.Context);
+ }
+
+ public class TrustedWebUtils {
+ method public static boolean areSplashScreensSupported(android.content.Context, String, String);
+ method @Deprecated public static void launchAsTrustedWebActivity(android.content.Context, androidx.browser.customtabs.CustomTabsIntent, android.net.Uri);
+ method @WorkerThread public static boolean transferSplashImage(android.content.Context, java.io.File, String, String, androidx.browser.customtabs.CustomTabsSession);
+ field public static final String EXTRA_LAUNCH_AS_TRUSTED_WEB_ACTIVITY = "android.support.customtabs.extra.LAUNCH_AS_TRUSTED_WEB_ACTIVITY";
+ }
+
+}
+
+package androidx.browser.trusted {
+
+ public final class ScreenOrientation {
+ field public static final int ANY = 5; // 0x5
+ field public static final int DEFAULT = 0; // 0x0
+ field public static final int LANDSCAPE = 6; // 0x6
+ field public static final int LANDSCAPE_PRIMARY = 3; // 0x3
+ field public static final int LANDSCAPE_SECONDARY = 4; // 0x4
+ field public static final int NATURAL = 8; // 0x8
+ field public static final int PORTRAIT = 7; // 0x7
+ field public static final int PORTRAIT_PRIMARY = 1; // 0x1
+ field public static final int PORTRAIT_SECONDARY = 2; // 0x2
+ }
+
+ public final class Token {
+ method public static androidx.browser.trusted.Token? create(String, android.content.pm.PackageManager);
+ method public static androidx.browser.trusted.Token deserialize(byte[]);
+ method public boolean matches(String, android.content.pm.PackageManager);
+ method public byte[] serialize();
+ }
+
+ public interface TokenStore {
+ method @BinderThread public androidx.browser.trusted.Token? load();
+ method @WorkerThread public void store(androidx.browser.trusted.Token?);
+ }
+
+ public abstract class TrustedWebActivityCallback {
+ ctor public TrustedWebActivityCallback();
+ method public abstract void onExtraCallback(String, android.os.Bundle?);
+ }
+
+ public class TrustedWebActivityCallbackRemote {
+ method public void runExtraCallback(String, android.os.Bundle) throws android.os.RemoteException;
+ }
+
+ public interface TrustedWebActivityDisplayMode {
+ method public static androidx.browser.trusted.TrustedWebActivityDisplayMode fromBundle(android.os.Bundle);
+ method public android.os.Bundle toBundle();
+ field public static final String KEY_ID = "androidx.browser.trusted.displaymode.KEY_ID";
+ }
+
+ public static class TrustedWebActivityDisplayMode.DefaultMode implements androidx.browser.trusted.TrustedWebActivityDisplayMode {
+ ctor public TrustedWebActivityDisplayMode.DefaultMode();
+ method public android.os.Bundle toBundle();
+ }
+
+ public static class TrustedWebActivityDisplayMode.ImmersiveMode implements androidx.browser.trusted.TrustedWebActivityDisplayMode {
+ ctor public TrustedWebActivityDisplayMode.ImmersiveMode(boolean, int);
+ method public boolean isSticky();
+ method public int layoutInDisplayCutoutMode();
+ method public android.os.Bundle toBundle();
+ field public static final String KEY_CUTOUT_MODE = "androidx.browser.trusted.displaymode.KEY_CUTOUT_MODE";
+ field public static final String KEY_STICKY = "androidx.browser.trusted.displaymode.KEY_STICKY";
+ }
+
+ public final class TrustedWebActivityIntent {
+ method public android.content.Intent getIntent();
+ method public void launchTrustedWebActivity(android.content.Context);
+ }
+
+ public class TrustedWebActivityIntentBuilder {
+ ctor public TrustedWebActivityIntentBuilder(android.net.Uri);
+ method public androidx.browser.trusted.TrustedWebActivityIntent build(androidx.browser.customtabs.CustomTabsSession);
+ method public androidx.browser.customtabs.CustomTabsIntent buildCustomTabsIntent();
+ method public androidx.browser.trusted.TrustedWebActivityDisplayMode getDisplayMode();
+ method public android.net.Uri getUri();
+ method public androidx.browser.trusted.TrustedWebActivityIntentBuilder setAdditionalTrustedOrigins(java.util.List<java.lang.String!>);
+ method public androidx.browser.trusted.TrustedWebActivityIntentBuilder setColorScheme(int);
+ method public androidx.browser.trusted.TrustedWebActivityIntentBuilder setColorSchemeParams(int, androidx.browser.customtabs.CustomTabColorSchemeParams);
+ method public androidx.browser.trusted.TrustedWebActivityIntentBuilder setDefaultColorSchemeParams(androidx.browser.customtabs.CustomTabColorSchemeParams);
+ method public androidx.browser.trusted.TrustedWebActivityIntentBuilder setDisplayMode(androidx.browser.trusted.TrustedWebActivityDisplayMode);
+ method @Deprecated public androidx.browser.trusted.TrustedWebActivityIntentBuilder setNavigationBarColor(@ColorInt int);
+ method @Deprecated public androidx.browser.trusted.TrustedWebActivityIntentBuilder setNavigationBarDividerColor(@ColorInt int);
+ method public androidx.browser.trusted.TrustedWebActivityIntentBuilder setScreenOrientation(int);
+ method public androidx.browser.trusted.TrustedWebActivityIntentBuilder setShareParams(androidx.browser.trusted.sharing.ShareTarget, androidx.browser.trusted.sharing.ShareData);
+ method public androidx.browser.trusted.TrustedWebActivityIntentBuilder setSplashScreenParams(android.os.Bundle);
+ method @Deprecated public androidx.browser.trusted.TrustedWebActivityIntentBuilder setToolbarColor(@ColorInt int);
+ field public static final String EXTRA_ADDITIONAL_TRUSTED_ORIGINS = "android.support.customtabs.extra.ADDITIONAL_TRUSTED_ORIGINS";
+ field public static final String EXTRA_DISPLAY_MODE = "androidx.browser.trusted.extra.DISPLAY_MODE";
+ field public static final String EXTRA_SCREEN_ORIENTATION = "androidx.browser.trusted.extra.SCREEN_ORIENTATION";
+ field public static final String EXTRA_SHARE_DATA = "androidx.browser.trusted.extra.SHARE_DATA";
+ field public static final String EXTRA_SHARE_TARGET = "androidx.browser.trusted.extra.SHARE_TARGET";
+ field public static final String EXTRA_SPLASH_SCREEN_PARAMS = "androidx.browser.trusted.EXTRA_SPLASH_SCREEN_PARAMS";
+ }
+
+ public abstract class TrustedWebActivityService extends android.app.Service {
+ ctor public TrustedWebActivityService();
+ method @BinderThread public abstract androidx.browser.trusted.TokenStore getTokenStore();
+ method @BinderThread public boolean onAreNotificationsEnabled(String);
+ method @MainThread public final android.os.IBinder? onBind(android.content.Intent?);
+ method @BinderThread public void onCancelNotification(String, int);
+ method @BinderThread public android.os.Bundle? onExtraCommand(String, android.os.Bundle, androidx.browser.trusted.TrustedWebActivityCallbackRemote?);
+ method @BinderThread public android.os.Bundle onGetSmallIconBitmap();
+ method @BinderThread public int onGetSmallIconId();
+ method @BinderThread public boolean onNotifyNotificationWithChannel(String, int, android.app.Notification, String);
+ method @MainThread public final boolean onUnbind(android.content.Intent?);
+ field public static final String ACTION_TRUSTED_WEB_ACTIVITY_SERVICE = "android.support.customtabs.trusted.TRUSTED_WEB_ACTIVITY_SERVICE";
+ field public static final String KEY_SMALL_ICON_BITMAP = "android.support.customtabs.trusted.SMALL_ICON_BITMAP";
+ field public static final String KEY_SUCCESS = "androidx.browser.trusted.SUCCESS";
+ field public static final String META_DATA_NAME_SMALL_ICON = "android.support.customtabs.trusted.SMALL_ICON";
+ field public static final int SMALL_ICON_NOT_SET = -1; // 0xffffffff
+ }
+
+ public final class TrustedWebActivityServiceConnection {
+ method public boolean areNotificationsEnabled(String) throws android.os.RemoteException;
+ method public void cancel(String, int) throws android.os.RemoteException;
+ method public android.content.ComponentName getComponentName();
+ method public android.graphics.Bitmap? getSmallIconBitmap() throws android.os.RemoteException;
+ method public int getSmallIconId() throws android.os.RemoteException;
+ method public boolean notify(String, int, android.app.Notification, String) throws android.os.RemoteException;
+ method public android.os.Bundle? sendExtraCommand(String, android.os.Bundle, androidx.browser.trusted.TrustedWebActivityCallback?) throws android.os.RemoteException;
+ }
+
+ public final class TrustedWebActivityServiceConnectionPool {
+ method @MainThread public com.google.common.util.concurrent.ListenableFuture<androidx.browser.trusted.TrustedWebActivityServiceConnection!> connect(android.net.Uri, java.util.Set<androidx.browser.trusted.Token!>, java.util.concurrent.Executor);
+ method public static androidx.browser.trusted.TrustedWebActivityServiceConnectionPool create(android.content.Context);
+ method @MainThread public boolean serviceExistsForScope(android.net.Uri, java.util.Set<androidx.browser.trusted.Token!>);
+ }
+
+}
+
+package androidx.browser.trusted.sharing {
+
+ public final class ShareData {
+ ctor public ShareData(String?, String?, java.util.List<android.net.Uri!>?);
+ method public static androidx.browser.trusted.sharing.ShareData fromBundle(android.os.Bundle);
+ method public android.os.Bundle toBundle();
+ field public static final String KEY_TEXT = "androidx.browser.trusted.sharing.KEY_TEXT";
+ field public static final String KEY_TITLE = "androidx.browser.trusted.sharing.KEY_TITLE";
+ field public static final String KEY_URIS = "androidx.browser.trusted.sharing.KEY_URIS";
+ field public final String? text;
+ field public final String? title;
+ field public final java.util.List<android.net.Uri!>? uris;
+ }
+
+ public final class ShareTarget {
+ ctor public ShareTarget(String, String?, String?, androidx.browser.trusted.sharing.ShareTarget.Params);
+ method public static androidx.browser.trusted.sharing.ShareTarget? fromBundle(android.os.Bundle);
+ method public android.os.Bundle toBundle();
+ field public static final String ENCODING_TYPE_MULTIPART = "multipart/form-data";
+ field public static final String ENCODING_TYPE_URL_ENCODED = "application/x-www-form-urlencoded";
+ field public static final String KEY_ACTION = "androidx.browser.trusted.sharing.KEY_ACTION";
+ field public static final String KEY_ENCTYPE = "androidx.browser.trusted.sharing.KEY_ENCTYPE";
+ field public static final String KEY_METHOD = "androidx.browser.trusted.sharing.KEY_METHOD";
+ field public static final String KEY_PARAMS = "androidx.browser.trusted.sharing.KEY_PARAMS";
+ field public static final String METHOD_GET = "GET";
+ field public static final String METHOD_POST = "POST";
+ field public final String action;
+ field public final String? encodingType;
+ field public final String? method;
+ field public final androidx.browser.trusted.sharing.ShareTarget.Params params;
+ }
+
+ public static final class ShareTarget.FileFormField {
+ ctor public ShareTarget.FileFormField(String, java.util.List<java.lang.String!>);
+ field public static final String KEY_ACCEPTED_TYPES = "androidx.browser.trusted.sharing.KEY_ACCEPTED_TYPES";
+ field public static final String KEY_NAME = "androidx.browser.trusted.sharing.KEY_FILE_NAME";
+ field public final java.util.List<java.lang.String!> acceptedTypes;
+ field public final String name;
+ }
+
+ public static class ShareTarget.Params {
+ ctor public ShareTarget.Params(String?, String?, java.util.List<androidx.browser.trusted.sharing.ShareTarget.FileFormField!>?);
+ field public static final String KEY_FILES = "androidx.browser.trusted.sharing.KEY_FILES";
+ field public static final String KEY_TEXT = "androidx.browser.trusted.sharing.KEY_TEXT";
+ field public static final String KEY_TITLE = "androidx.browser.trusted.sharing.KEY_TITLE";
+ field public final java.util.List<androidx.browser.trusted.sharing.ShareTarget.FileFormField!>? files;
+ field public final String? text;
+ field public final String? title;
+ }
+
+}
+
+package androidx.browser.trusted.splashscreens {
+
+ public final class SplashScreenParamKey {
+ field public static final String KEY_BACKGROUND_COLOR = "androidx.browser.trusted.trusted.KEY_SPLASH_SCREEN_BACKGROUND_COLOR";
+ field public static final String KEY_FADE_OUT_DURATION_MS = "androidx.browser.trusted.KEY_SPLASH_SCREEN_FADE_OUT_DURATION";
+ field public static final String KEY_IMAGE_TRANSFORMATION_MATRIX = "androidx.browser.trusted.KEY_SPLASH_SCREEN_TRANSFORMATION_MATRIX";
+ field public static final String KEY_SCALE_TYPE = "androidx.browser.trusted.KEY_SPLASH_SCREEN_SCALE_TYPE";
+ field public static final String KEY_VERSION = "androidx.browser.trusted.KEY_SPLASH_SCREEN_VERSION";
+ }
+
+ public final class SplashScreenVersion {
+ field public static final String V1 = "androidx.browser.trusted.category.TrustedWebActivitySplashScreensV1";
+ }
+
+}
+
diff --git a/buildSrc/private/src/main/kotlin/androidx/build/AndroidXComposeImplPlugin.kt b/buildSrc/private/src/main/kotlin/androidx/build/AndroidXComposeImplPlugin.kt
index 50eaf2f..c70b212 100644
--- a/buildSrc/private/src/main/kotlin/androidx/build/AndroidXComposeImplPlugin.kt
+++ b/buildSrc/private/src/main/kotlin/androidx/build/AndroidXComposeImplPlugin.kt
@@ -49,7 +49,10 @@
"plugin:androidx.compose.compiler.plugins.kotlin:sourceInformation=true"
const val composeMetricsOption =
"plugin:androidx.compose.compiler.plugins.kotlin:metricsDestination"
+const val composeReportsOption =
+ "plugin:androidx.compose.compiler.plugins.kotlin:reportsDestination"
const val enableMetricsArg = "androidx.enableComposeCompilerMetrics"
+const val enableReportsArg = "androidx.enableComposeCompilerReports"
/**
* Plugin to apply common configuration for Compose projects.
@@ -310,7 +313,7 @@
}.files
val isTipOfTreeComposeCompilerProvider = project.provider({
- conf.dependencies.first() !is ExternalModuleDependency
+ (!conf.isEmpty) && (conf.dependencies.first() !is ExternalModuleDependency)
})
project.tasks.withType(KotlinCompile::class.java).configureEach { compile ->
@@ -327,6 +330,9 @@
val enableMetrics = project
.findProperty(enableMetricsArg) == "true"
+ val enableReports = project
+ .findProperty(enableReportsArg) == "true"
+
// since metrics reports in compose compiler are a new feature, we only want to
// pass in this parameter for modules that are using the tip of tree compose
// compiler, or else we will run into an exception since the parameter will not
@@ -343,6 +349,23 @@
"$composeMetricsOption=$metricsDest"
)
}
+
+ // since metrics reports in compose compiler are a new feature, we only want to
+ // pass in this parameter for modules that are using the tip of tree compose
+ // compiler, or else we will run into an exception since the parameter will not
+ // be recognized.
+ if (isTipOfTreeComposeCompilerProvider.get() && enableReports) {
+ val libReports = project
+ .rootProject
+ .getLibraryReportsDirectory()
+ val reportsDest = File(libReports, "compose")
+ .absolutePath
+ compile.kotlinOptions.freeCompilerArgs +=
+ listOf(
+ "-P",
+ "$composeReportsOption=$reportsDest"
+ )
+ }
}
}
}
diff --git a/buildSrc/private/src/main/kotlin/androidx/build/AndroidXGradleProperties.kt b/buildSrc/private/src/main/kotlin/androidx/build/AndroidXGradleProperties.kt
index 97bdbb9..5c5d00f 100644
--- a/buildSrc/private/src/main/kotlin/androidx/build/AndroidXGradleProperties.kt
+++ b/buildSrc/private/src/main/kotlin/androidx/build/AndroidXGradleProperties.kt
@@ -59,6 +59,11 @@
const val ENABLE_COMPOSE_COMPILER_METRICS = "androidx.enableComposeCompilerMetrics"
/**
+ * Setting this property enables multiplatform builds of Compose
+ */
+const val ENABLE_COMPOSE_COMPILER_REPORTS = "androidx.enableComposeCompilerReports"
+
+/**
* Returns whether the project should generate documentation.
*/
const val ENABLE_DOCUMENTATION = "androidx.enableDocumentation"
@@ -135,6 +140,7 @@
VALIDATE_PROJECT_STRUCTURE,
COMPOSE_MPP_ENABLED,
ENABLE_COMPOSE_COMPILER_METRICS,
+ ENABLE_COMPOSE_COMPILER_REPORTS,
DISPLAY_TEST_OUTPUT,
ENABLE_DOCUMENTATION,
PROJECT_SUBSET,
diff --git a/buildSrc/private/src/main/kotlin/androidx/build/AndroidXImplPlugin.kt b/buildSrc/private/src/main/kotlin/androidx/build/AndroidXImplPlugin.kt
index c494d91..4e47d01 100644
--- a/buildSrc/private/src/main/kotlin/androidx/build/AndroidXImplPlugin.kt
+++ b/buildSrc/private/src/main/kotlin/androidx/build/AndroidXImplPlugin.kt
@@ -640,7 +640,9 @@
val taskProvider = tasks.register(
"verifyDependencyVersions",
VerifyDependencyVersionsTask::class.java
- )
+ ) { task ->
+ task.version.set(project.version.toString())
+ }
addToBuildOnServer(taskProvider)
return taskProvider
}
diff --git a/buildSrc/private/src/main/kotlin/androidx/build/AndroidXRootImplPlugin.kt b/buildSrc/private/src/main/kotlin/androidx/build/AndroidXRootImplPlugin.kt
index 9ce27e5..3c8cf70 100644
--- a/buildSrc/private/src/main/kotlin/androidx/build/AndroidXRootImplPlugin.kt
+++ b/buildSrc/private/src/main/kotlin/androidx/build/AndroidXRootImplPlugin.kt
@@ -94,7 +94,7 @@
val createArchiveTask = Release.getGlobalFullZipTask(this)
buildOnServerTask.dependsOn(createArchiveTask)
val partiallyDejetifyArchiveTask = partiallyDejetifyArchiveTask(
- createArchiveTask.flatMap { it.archiveFile }
+ getGlobalZipFile()
)
if (partiallyDejetifyArchiveTask != null)
buildOnServerTask.dependsOn(partiallyDejetifyArchiveTask)
diff --git a/buildSrc/private/src/main/kotlin/androidx/build/Jetify.kt b/buildSrc/private/src/main/kotlin/androidx/build/Jetify.kt
index 85faa23..2da4ba7 100644
--- a/buildSrc/private/src/main/kotlin/androidx/build/Jetify.kt
+++ b/buildSrc/private/src/main/kotlin/androidx/build/Jetify.kt
@@ -16,9 +16,8 @@
package androidx.build
+import java.io.File
import org.gradle.api.Project
-import org.gradle.api.file.RegularFile
-import org.gradle.api.provider.Provider
import org.gradle.api.tasks.Exec
import org.gradle.api.tasks.TaskProvider
import org.gradle.api.tasks.bundling.Zip
@@ -97,7 +96,7 @@
)
fun Project.partiallyDejetifyArchiveTask(
- archiveFile: Provider<RegularFile>
+ archiveFile: File
): TaskProvider<Exec>? {
return findProject(":jetifier:jetifier-standalone")?.let { standaloneProject ->
val stripTask = stripArchiveForPartialDejetificationTask(archiveFile)
@@ -127,7 +126,7 @@
}
fun Project.stripArchiveForPartialDejetificationTask(
- archiveFile: Provider<RegularFile>
+ archiveFile: File
): TaskProvider<Zip> {
return tasks.register("stripArchiveForPartialDejetification", Zip::class.java) {
it.dependsOn(rootProject.tasks.named(Release.FULL_ARCHIVE_TASK_NAME))
diff --git a/buildSrc/private/src/main/kotlin/androidx/build/MavenUploadHelper.kt b/buildSrc/private/src/main/kotlin/androidx/build/MavenUploadHelper.kt
index 2b0f7fdfc..7c85f8c 100644
--- a/buildSrc/private/src/main/kotlin/androidx/build/MavenUploadHelper.kt
+++ b/buildSrc/private/src/main/kotlin/androidx/build/MavenUploadHelper.kt
@@ -92,11 +92,13 @@
removePreviouslyUploadedArchives(projectArchiveDir)
}
} else {
- it.create<MavenPublication>("maven") {
- from(component)
- }
- tasks.getByName("publishMavenPublicationToMavenRepository").doFirst {
- removePreviouslyUploadedArchives(projectArchiveDir)
+ if (!project.isMultiplatformPublicationEnabled()) {
+ it.create<MavenPublication>("maven") {
+ from(component)
+ }
+ tasks.getByName("publishMavenPublicationToMavenRepository").doFirst {
+ removePreviouslyUploadedArchives(projectArchiveDir)
+ }
}
}
}
@@ -125,18 +127,20 @@
}
}
- if (project.isMultiplatformEnabled()) {
+ if (project.isMultiplatformPublicationEnabled()) {
configureMultiplatformPublication()
}
}
}
-private fun Project.configureMultiplatformPublication() {
- val multiplatformExtension = extensions.findByType<KotlinMultiplatformExtension>() ?: return
+private fun Project.isMultiplatformPublicationEnabled(): Boolean {
+ if (!project.isMultiplatformEnabled())
+ return false
+ return extensions.findByType<KotlinMultiplatformExtension>() != null
+}
- // publishMavenPublicationToMavenRepository will produce conflicting artifacts with the same
- // name as the artifacts producing by publishKotlinMultiplatformPublicationToMavenRepository
- project.tasks.findByName("publishMavenPublicationToMavenRepository")?.enabled = false
+private fun Project.configureMultiplatformPublication() {
+ val multiplatformExtension = extensions.findByType<KotlinMultiplatformExtension>()!!
multiplatformExtension.targets.all { target ->
if (target is KotlinAndroidTarget) {
diff --git a/buildSrc/private/src/main/kotlin/androidx/build/Release.kt b/buildSrc/private/src/main/kotlin/androidx/build/Release.kt
index 12a9037..3c1ed22 100644
--- a/buildSrc/private/src/main/kotlin/androidx/build/Release.kt
+++ b/buildSrc/private/src/main/kotlin/androidx/build/Release.kt
@@ -143,6 +143,8 @@
const val GROUP_ZIPS_FOLDER = "per-group-zips"
const val PROJECT_ZIPS_FOLDER = "per-project-zips"
const val GROUP_ZIP_PREFIX = "gmaven"
+ const val GLOBAL_ZIP_PREFIX = "top-of-tree-m2repository"
+
// lazily created config action params so that we don't keep re-creating them
private var configActionParams: GMavenZipTask.ConfigAction.Params? = null
@@ -257,7 +259,7 @@
getParams(
project,
project.getDistributionDirectory(),
- "top-of-tree-m2repository"
+ Release.GLOBAL_ZIP_PREFIX
).copy(
includeMetadata = true
)
@@ -377,8 +379,14 @@
getZipName(projectZipPrefix(), "") + "-${project.version}.zip"
}
-fun Project.getGroupZipPath():
- String {
- return Release.GROUP_ZIPS_FOLDER + "/" +
- getZipName(Release.GROUP_ZIP_PREFIX, project.group.toString()) + ".zip"
- }
+fun Project.getGroupZipPath(): String {
+ return Release.GROUP_ZIPS_FOLDER + "/" +
+ getZipName(Release.GROUP_ZIP_PREFIX, project.group.toString()) + ".zip"
+}
+
+fun Project.getGlobalZipFile(): File {
+ return File(
+ project.getDistributionDirectory(),
+ getZipName(Release.GLOBAL_ZIP_PREFIX, "") + ".zip"
+ )
+}
diff --git a/buildSrc/private/src/main/kotlin/androidx/build/VerifyDependencyVersionsTask.kt b/buildSrc/private/src/main/kotlin/androidx/build/VerifyDependencyVersionsTask.kt
index 728ca02..a465db6 100644
--- a/buildSrc/private/src/main/kotlin/androidx/build/VerifyDependencyVersionsTask.kt
+++ b/buildSrc/private/src/main/kotlin/androidx/build/VerifyDependencyVersionsTask.kt
@@ -20,19 +20,24 @@
import org.gradle.api.GradleException
import org.gradle.api.artifacts.Configuration
import org.gradle.api.artifacts.Dependency
+import org.gradle.api.provider.Property
+import org.gradle.api.tasks.Input
import org.gradle.api.tasks.TaskAction
/**
* Task for verifying the androidx dependency-stability-suffix rule
* (A library is only as stable as its lease stable dependency)
*/
-open class VerifyDependencyVersionsTask : DefaultTask() {
+abstract class VerifyDependencyVersionsTask : DefaultTask() {
init {
group = "Verification"
description = "Task for verifying the androidx dependency-stability-suffix rule"
}
+ @get:Input
+ abstract val version: Property<String>
+
/**
* Iterate through the dependencies of the project and ensure none of them are of an inferior
* release. This means that a beta project should not have any alpha dependencies, an rc project
@@ -53,12 +58,12 @@
// If the version is unspecified then treat as an alpha version. If the depending project's
// version is unspecified then it won't matter, and if the dependency's version is
// unspecified then any non alpha project won't be able to depend on it to ensure safety.
- val projectVersionExtra = if (project.version ==
+ val projectVersionExtra = if (version.get() ==
AndroidXExtension.DEFAULT_UNSPECIFIED_VERSION
) {
"-alpha01"
} else {
- Version(project.version.toString()).extra ?: ""
+ Version(version.get()).extra ?: ""
}
val dependencyVersionExtra = if (dependency.version!! ==
AndroidXExtension.DEFAULT_UNSPECIFIED_VERSION
@@ -70,7 +75,7 @@
val projectReleasePhase = releasePhase(projectVersionExtra)
if (projectReleasePhase < 0) {
throw GradleException(
- "Project ${project.name} has unexpected release phase " + projectVersionExtra
+ "Project has unexpected release phase " + projectVersionExtra
)
}
val dependencyReleasePhase = releasePhase(dependencyVersionExtra)
@@ -82,7 +87,7 @@
}
if (dependencyReleasePhase < projectReleasePhase) {
throw GradleException(
- "Project ${project.name} with version ${project.version} may " +
+ "Project with version ${version.get()} may " +
"not take a dependency on less-stable artifact ${dependency.group}:" +
"${dependency.name}:${dependency.version} for configuration " +
"${configuration.name}. Dependency versions must be at least as stable as " +
diff --git a/buildSrc/public/src/main/kotlin/androidx/build/BuildServerConfiguration.kt b/buildSrc/public/src/main/kotlin/androidx/build/BuildServerConfiguration.kt
index de34c58..7d1a257 100644
--- a/buildSrc/public/src/main/kotlin/androidx/build/BuildServerConfiguration.kt
+++ b/buildSrc/public/src/main/kotlin/androidx/build/BuildServerConfiguration.kt
@@ -109,6 +109,12 @@
File(getDistributionDirectory(), "librarymetrics")
/**
+ * Directory to put json metrics so they can be consumed by the metrics dashboards.
+ */
+fun Project.getLibraryReportsDirectory(): File =
+ File(getDistributionDirectory(), "libraryreports")
+
+/**
* Whether the build should force all versions to be snapshots.
*/
fun isSnapshotBuild() = System.getenv("SNAPSHOT") != null
diff --git a/buildSrc/public/src/main/kotlin/androidx/build/LibraryGroups.kt b/buildSrc/public/src/main/kotlin/androidx/build/LibraryGroups.kt
index 4954f27..3d5f224 100644
--- a/buildSrc/public/src/main/kotlin/androidx/build/LibraryGroups.kt
+++ b/buildSrc/public/src/main/kotlin/androidx/build/LibraryGroups.kt
@@ -104,6 +104,7 @@
val WEAR = LibraryGroup("androidx.wear", null)
val WEAR_COMPOSE = LibraryGroup("androidx.wear.compose", LibraryVersions.WEAR_COMPOSE)
val WEAR_TILES = LibraryGroup("androidx.wear.tiles", LibraryVersions.WEAR_TILES)
+ val WEAR_WATCHFACE = LibraryGroup("androidx.wear.watchface", LibraryVersions.WEAR_WATCHFACE)
val WEBKIT = LibraryGroup("androidx.webkit", LibraryVersions.WEBKIT)
val WINDOW = LibraryGroup("androidx.window", null)
val WORK = LibraryGroup("androidx.work", LibraryVersions.WORK)
diff --git a/buildSrc/public/src/main/kotlin/androidx/build/LibraryVersions.kt b/buildSrc/public/src/main/kotlin/androidx/build/LibraryVersions.kt
index 79a48de..aad0146 100644
--- a/buildSrc/public/src/main/kotlin/androidx/build/LibraryVersions.kt
+++ b/buildSrc/public/src/main/kotlin/androidx/build/LibraryVersions.kt
@@ -20,18 +20,18 @@
* The list of versions codes of all the libraries in this project.
*/
object LibraryVersions {
- val ACTIVITY = Version("1.4.0-alpha03")
+ val ACTIVITY = Version("1.4.0-beta01")
val ADS_IDENTIFIER = Version("1.0.0-alpha05")
- val ANNOTATION = Version("1.3.0-alpha01")
+ val ANNOTATION = Version("1.3.0-beta01")
val ANNOTATION_EXPERIMENTAL = Version("1.2.0-alpha01")
- val APPCOMPAT = Version("1.4.0-alpha04")
+ val APPCOMPAT = Version("1.4.0-beta01")
val APPSEARCH = Version("1.0.0-alpha03")
val ARCH_CORE = Version("2.2.0-alpha01")
val ASYNCLAYOUTINFLATER = Version("1.1.0-alpha01")
val AUTOFILL = Version("1.2.0-beta02")
val BENCHMARK = Version("1.1.0-alpha08")
val BIOMETRIC = Version("1.2.0-alpha03")
- val BROWSER = Version("1.4.0-alpha02")
+ val BROWSER = Version("1.4.0-beta01")
val BUILDSRC_TESTS = Version("1.0.0-alpha01")
val CAMERA = Version("1.1.0-alpha09")
val CAMERA_EXTENSIONS = Version("1.0.0-alpha29")
@@ -53,7 +53,7 @@
val CORE_GOOGLE_SHORTCUTS = Version("1.1.0-alpha02")
val CORE_REMOTEVIEWS = Version("1.0.0-alpha01")
val CORE_ROLE = Version("1.1.0-alpha02")
- val CORE_SPLASHSCREEN = Version("1.0.0-alpha01")
+ val CORE_SPLASHSCREEN = Version("1.0.0-alpha02")
val CURSORADAPTER = Version("1.1.0-alpha01")
val CUSTOMVIEW = Version("1.2.0-alpha01")
val DATASTORE = Version("1.1.0-alpha01")
@@ -83,7 +83,7 @@
val LEANBACK_TAB = Version("1.1.0-beta01")
val LEGACY = Version("1.1.0-alpha01")
val LOCALBROADCASTMANAGER = Version("1.1.0-alpha02")
- val LIFECYCLE = Version("2.4.0-rc01")
+ val LIFECYCLE = Version("2.5.0-alpha01")
val LIFECYCLE_VIEWMODEL_COMPOSE = Version("1.0.0-alpha08")
val LIFECYCLE_EXTENSIONS = Version("2.2.0")
val LOADER = Version("1.2.0-alpha01")
@@ -91,8 +91,8 @@
val MEDIA2 = Version("1.3.0-alpha01")
val MEDIAROUTER = Version("1.3.0-alpha01")
val NAVIGATION = Version("2.4.0-alpha10")
- val PAGING = Version("3.1.0-alpha05")
- val PAGING_COMPOSE = Version("1.0.0-alpha14")
+ val PAGING = Version("3.1.0-alpha04")
+ val PAGING_COMPOSE = Version("1.0.0-alpha13")
val PALETTE = Version("1.1.0-alpha01")
val PRINT = Version("1.1.0-beta01")
val PERCENTLAYOUT = Version("1.1.0-alpha01")
@@ -110,7 +110,7 @@
val SECURITY_APP_AUTHENTICATOR_TESTING = Version("1.0.0-alpha02")
val SECURITY_BIOMETRIC = Version("1.0.0-alpha01")
val SECURITY_IDENTITY_CREDENTIAL = Version("1.0.0-alpha04")
- val SHARETARGET = Version("1.2.0-beta02")
+ val SHARETARGET = Version("1.2.0-rc01")
val SLICE = Version("1.1.0-alpha02")
val SLICE_BENCHMARK = Version("1.1.0-alpha02")
val SLICE_BUILDERS_KTX = Version("1.0.0-alpha08")
@@ -133,9 +133,6 @@
val VIEWPAGER = Version("1.1.0-alpha02")
val VIEWPAGER2 = Version("1.1.0-beta02")
val WEAR = Version("1.3.0-alpha01")
- val WEAR_COMPLICATIONS_DATA = Version("1.0.0-alpha23")
- val WEAR_COMPLICATIONS_DATA_SOURCE = Version("1.0.0-alpha23")
- val WEAR_COMPLICATIONS_DATA_SOURCE_KTX = Version("1.0.0-alpha23")
val WEAR_COMPOSE = Version("1.0.0-alpha07")
val WEAR_INPUT = Version("1.2.0-alpha02")
val WEAR_INPUT_TESTING = WEAR_INPUT
@@ -144,13 +141,6 @@
val WEAR_REMOTE_INTERACTIONS = Version("1.1.0-alpha01")
val WEAR_TILES = Version("1.0.0-alpha12")
val WEAR_WATCHFACE = Version("1.0.0-alpha23")
- val WEAR_WATCHFACE_CLIENT = Version("1.0.0-alpha23")
- val WEAR_WATCHFACE_CLIENT_GUAVA = WEAR_WATCHFACE_CLIENT
- val WEAR_WATCHFACE_COMPLICATIONS_RENDERING = Version("1.0.0-alpha23")
- val WEAR_WATCHFACE_DATA = Version("1.0.0-alpha23")
- val WEAR_WATCHFACE_EDITOR = Version("1.0.0-alpha23")
- val WEAR_WATCHFACE_EDITOR_GUAVA = WEAR_WATCHFACE_EDITOR
- val WEAR_WATCHFACE_STYLE = Version("1.0.0-alpha23")
val WEBKIT = Version("1.5.0-alpha01")
val WINDOW = Version("1.0.0-beta03")
val WINDOW_EXTENSIONS = Version("1.0.0-alpha01")
diff --git a/buildSrc/public/src/main/kotlin/androidx/build/SdkResourceGenerator.kt b/buildSrc/public/src/main/kotlin/androidx/build/SdkResourceGenerator.kt
index b429ae5..dc1c1f8 100644
--- a/buildSrc/public/src/main/kotlin/androidx/build/SdkResourceGenerator.kt
+++ b/buildSrc/public/src/main/kotlin/androidx/build/SdkResourceGenerator.kt
@@ -28,10 +28,12 @@
import org.gradle.api.tasks.Input
import org.gradle.api.tasks.InputFile
import org.gradle.api.tasks.OutputFile
+import org.gradle.api.tasks.PathSensitive
+import org.gradle.api.tasks.PathSensitivity
import org.gradle.api.tasks.TaskAction
import org.gradle.kotlin.dsl.getByType
import java.io.File
-import java.io.PrintWriter
+import java.util.Properties
abstract class SdkResourceGenerator : DefaultTask() {
@get:Input
@@ -73,31 +75,38 @@
@get:Input
val rootProjectPath: String = project.rootProject.rootDir.absolutePath
- @get:Input
- lateinit var gradleVersion: String
+ @get:PathSensitive(PathSensitivity.NONE)
+ @get:InputFile
+ abstract val gradleWrapperProperties: RegularFileProperty
@get:OutputFile
abstract val outputFile: RegularFileProperty
@TaskAction
fun generateFile() {
- val writer = PrintWriter(outputFile.get().asFile)
- writer.write("prebuiltsRoot=$prebuiltsRoot\n")
- writer.write("localSupportRepo=$localSupportRepo\n")
- writer.write("compileSdkVersion=$compileSdkVersion\n")
- writer.write("buildToolsVersion=$buildToolsVersion\n")
- writer.write("minSdkVersion=$minSdkVersion\n")
- writer.write("debugKeystore=${debugKeystore.get().asFile.canonicalPath}\n")
- writer.write("agpDependency=$agpDependency\n")
- writer.write("navigationRuntime=$navigationRuntime\n")
- writer.write("kotlinStdlib=$kotlinStdlib\n")
- writer.write("gradleVersion=$gradleVersion\n")
- writer.write("kotlinVersion=$kotlinVersion\n")
- writer.write("kspVersion=$kspVersion\n")
- writer.write("rootProjectPath=$rootProjectPath\n")
- val encodedRepositoryUrls = repositoryUrls.joinToString(",")
- writer.write("repositoryUrls=$encodedRepositoryUrls\n")
- writer.close()
+ outputFile.get().asFile.writer().use { writer ->
+ writer.write("prebuiltsRoot=$prebuiltsRoot\n")
+ writer.write("localSupportRepo=$localSupportRepo\n")
+ writer.write("compileSdkVersion=$compileSdkVersion\n")
+ writer.write("buildToolsVersion=$buildToolsVersion\n")
+ writer.write("minSdkVersion=$minSdkVersion\n")
+ writer.write("debugKeystore=${debugKeystore.get().asFile.canonicalPath}\n")
+ writer.write("agpDependency=$agpDependency\n")
+ writer.write("navigationRuntime=$navigationRuntime\n")
+ writer.write("kotlinStdlib=$kotlinStdlib\n")
+
+ val gradlewPropFile = gradleWrapperProperties.asFile.get()
+ val distributionUrl = gradlewPropFile.reader().use {
+ Properties().apply { load(it) }.getProperty("distributionUrl")
+ }.let { File(gradlewPropFile.parentFile, it).canonicalPath }
+
+ writer.write("gradleDistributionUrl=$distributionUrl\n")
+ writer.write("kotlinVersion=$kotlinVersion\n")
+ writer.write("kspVersion=$kspVersion\n")
+ writer.write("rootProjectPath=$rootProjectPath\n")
+ val encodedRepositoryUrls = repositoryUrls.joinToString(",")
+ writer.write("repositoryUrls=$encodedRepositoryUrls\n")
+ }
}
companion object {
@@ -111,7 +120,9 @@
it.prebuiltsRoot = project.getPrebuiltsRoot().canonicalPath
it.debugKeystore.set(project.getKeystore())
it.localSupportRepo = project.getRepositoryDirectory().canonicalPath
- it.gradleVersion = project.gradle.gradleVersion
+ it.gradleWrapperProperties.set(
+ File(project.rootDir, "gradle/wrapper/gradle-wrapper.properties")
+ )
it.outputFile.set(File(generatedDirectory, "sdk.prop"))
// Copy repositories used for the library project so that it can replicate the same
// maven structure in test.
diff --git a/busytown/androidx.sh b/busytown/androidx.sh
index 8b295a8..dcdefc3 100755
--- a/busytown/androidx.sh
+++ b/busytown/androidx.sh
@@ -9,6 +9,7 @@
EXIT_VALUE=0
if impl/build.sh buildOnServer checkExternalLicenses listTaskOutputs validateAllProperties \
-Pandroidx.enableComposeCompilerMetrics=true \
+ -Pandroidx.enableComposeCompilerReports=true \
--profile "$@"; then
EXIT_VALUE=0
else
diff --git a/busytown/androidx_snapshot.sh b/busytown/androidx_snapshot.sh
index afad9a8..f31a420 100755
--- a/busytown/androidx_snapshot.sh
+++ b/busytown/androidx_snapshot.sh
@@ -9,6 +9,7 @@
createArchive \
-Pandroidx.enableAffectedModuleDetection=false \
-Pandroidx.enableComposeCompilerMetrics=true \
+ -Pandroidx.enableComposeCompilerReports=true \
"$@"
echo "Completing $0 at $(date)"
diff --git a/camera/camera-camera2-pipe-integration/lint-baseline.xml b/camera/camera-camera2-pipe-integration/lint-baseline.xml
new file mode 100644
index 0000000..740583b
--- /dev/null
+++ b/camera/camera-camera2-pipe-integration/lint-baseline.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<issues format="6" by="lint 7.1.0-dev" type="baseline" client="gradle" dependencies="false" name="AGP (7.1.0-dev)" variant="all" version="7.1.0-dev">
+
+ <issue
+ id="SupportAnnotationUsage"
+ message="Did you mean `@get:VisibleForTesting` ? Without `get:` this annotates the constructor parameter itself instead of the associated getter."
+ errorLine1=" @VisibleForTesting"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/main/java/androidx/camera/camera2/pipe/integration/interop/Camera2CameraControl.kt"
+ line="54"
+ column="5"/>
+ </issue>
+
+</issues>
diff --git a/camera/camera-camera2/src/main/java/androidx/camera/camera2/interop/Camera2CameraControl.java b/camera/camera-camera2/src/main/java/androidx/camera/camera2/interop/Camera2CameraControl.java
index 7a11534..6d54120 100644
--- a/camera/camera-camera2/src/main/java/androidx/camera/camera2/interop/Camera2CameraControl.java
+++ b/camera/camera-camera2/src/main/java/androidx/camera/camera2/interop/Camera2CameraControl.java
@@ -149,6 +149,7 @@
* options are set or camera is closed before the current request completes.
* Cancelling the ListenableFuture is a no-op.
*/
+ @SuppressWarnings("AsyncSuffixFuture")
@NonNull
public ListenableFuture<Void> setCaptureRequestOptions(
@NonNull CaptureRequestOptions bundle) {
@@ -181,6 +182,7 @@
* completely. The future fails with {@link CameraControl.OperationCanceledException} if newer
* options are set or camera is closed before the current request completes.
*/
+ @SuppressWarnings("AsyncSuffixFuture")
@NonNull
public ListenableFuture<Void> addCaptureRequestOptions(
@NonNull CaptureRequestOptions bundle) {
diff --git a/camera/camera-core/api/api_lint.ignore b/camera/camera-core/api/api_lint.ignore
index 6dd7abf..0f8b2c1 100644
--- a/camera/camera-core/api/api_lint.ignore
+++ b/camera/camera-core/api/api_lint.ignore
@@ -1,4 +1,18 @@
// Baseline format: 1.0
+AsyncSuffixFuture: androidx.camera.core.CameraControl#cancelFocusAndMetering():
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
+AsyncSuffixFuture: androidx.camera.core.CameraControl#enableTorch(boolean):
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
+AsyncSuffixFuture: androidx.camera.core.CameraControl#setExposureCompensationIndex(int):
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
+AsyncSuffixFuture: androidx.camera.core.CameraControl#setLinearZoom(float):
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
+AsyncSuffixFuture: androidx.camera.core.CameraControl#setZoomRatio(float):
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
+AsyncSuffixFuture: androidx.camera.core.CameraControl#startFocusAndMetering(androidx.camera.core.FocusMeteringAction):
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
+
+
BuilderSetStyle: androidx.camera.core.CameraSelector.Builder#requireLensFacing(int):
Builder methods names should use setFoo() / addFoo() / clearFoo() style: method androidx.camera.core.CameraSelector.Builder.requireLensFacing(int)
BuilderSetStyle: androidx.camera.core.CameraXConfig.Builder#fromConfig(androidx.camera.core.CameraXConfig):
diff --git a/camera/camera-core/lint-baseline.xml b/camera/camera-core/lint-baseline.xml
index debefae..2b345ec 100644
--- a/camera/camera-core/lint-baseline.xml
+++ b/camera/camera-core/lint-baseline.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<issues format="6" by="lint 7.1.0-alpha02" type="baseline" client="cli" name="Lint" variant="all" version="7.1.0-alpha02">
+<issues format="6" by="lint 7.1.0-dev" type="baseline" client="gradle" dependencies="false" name="AGP (7.1.0-dev)" variant="all" version="7.1.0-dev">
<issue
id="NewApi"
@@ -8,7 +8,7 @@
errorLine2=" ~~~~~~~~">
<location
file="src/test/java/androidx/camera/core/impl/utils/ExifTest.java"
- line="159"
+ line="160"
column="46"/>
</issue>
@@ -19,7 +19,7 @@
errorLine2=" ~~~~~~~~">
<location
file="src/test/java/androidx/camera/core/impl/utils/ExifTest.java"
- line="162"
+ line="163"
column="46"/>
</issue>
@@ -47,6 +47,17 @@
<issue
id="NewApi"
+ message="Call requires API level 26 (current min is 21): `newInstance`"
+ errorLine1=" TEST_MAX_IMAGES, TEST_IMAGE_FORMAT);"
+ errorLine2=" ~~~~~~~~~~~~~~~">
+ <location
+ file="src/test/java/androidx/camera/core/internal/compat/ImageWriterCompatTest.java"
+ line="60"
+ column="17"/>
+ </issue>
+
+ <issue
+ id="NewApi"
message="Call requires API level 22 (current min is 21): `android.os.Message#isAsynchronous`"
errorLine1=" boolean isAsyncBeforeSending = message.isAsynchronous();"
errorLine2=" ~~~~~~~~~~~~~~">
@@ -503,7 +514,7 @@
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~">
<location
file="src/main/java/androidx/camera/core/impl/CaptureConfig.java"
- line="302"
+ line="310"
column="17"/>
</issue>
diff --git a/camera/camera-core/src/androidTest/java/androidx/camera/core/ImageYuvToRgbConverterTest.java b/camera/camera-core/src/androidTest/java/androidx/camera/core/ImageProcessingUtilTest.java
similarity index 91%
rename from camera/camera-core/src/androidTest/java/androidx/camera/core/ImageYuvToRgbConverterTest.java
rename to camera/camera-core/src/androidTest/java/androidx/camera/core/ImageProcessingUtilTest.java
index d3d6615..1ddc65d 100644
--- a/camera/camera-core/src/androidTest/java/androidx/camera/core/ImageYuvToRgbConverterTest.java
+++ b/camera/camera-core/src/androidTest/java/androidx/camera/core/ImageProcessingUtilTest.java
@@ -35,7 +35,7 @@
@SmallTest
@RunWith(AndroidJUnit4.class)
-public class ImageYuvToRgbConverterTest {
+public class ImageProcessingUtilTest {
private static final int WIDTH = 8;
private static final int HEIGHT = 8;
@@ -81,7 +81,7 @@
/*incrementValue=*/false));
// Act.
- ImageProxy rgbImageProxy = ImageYuvToRgbConverter.convertYUVToRGB(mYUVImageProxy,
+ ImageProxy rgbImageProxy = ImageProcessingUtil.convertYUVToRGB(mYUVImageProxy,
mRGBImageReaderProxy, /*onePixelShiftRequested=*/false);
// Assert.
@@ -101,7 +101,7 @@
/*incrementValue=*/false));
// Act.
- ImageProxy rgbImageProxy = ImageYuvToRgbConverter.convertYUVToRGB(mYUVImageProxy,
+ ImageProxy rgbImageProxy = ImageProcessingUtil.convertYUVToRGB(mYUVImageProxy,
mRGBImageReaderProxy, /*onePixelShiftRequested=*/false);
// Assert.
@@ -121,7 +121,7 @@
/*incrementValue=*/false));
// Act.
- ImageProxy rgbImageProxy = ImageYuvToRgbConverter.convertYUVToRGB(mYUVImageProxy,
+ ImageProxy rgbImageProxy = ImageProcessingUtil.convertYUVToRGB(mYUVImageProxy,
mRGBImageReaderProxy, /*onePixelShiftRequested=*/false);
// Assert.
@@ -146,7 +146,7 @@
assertThat(mYUVImageProxy.getPlanes()[2].getBuffer().get(0)).isEqualTo(1);
// Act.
- boolean result = ImageYuvToRgbConverter.applyPixelShiftForYUV(mYUVImageProxy);
+ boolean result = ImageProcessingUtil.applyPixelShiftForYUV(mYUVImageProxy);
// Assert.
assertThat(result).isTrue();
@@ -167,7 +167,7 @@
/*incrementValue=*/false));
// Act.
- ImageProxy rgbImageProxy = ImageYuvToRgbConverter.convertYUVToRGB(mYUVImageProxy,
+ ImageProxy rgbImageProxy = ImageProcessingUtil.convertYUVToRGB(mYUVImageProxy,
mRGBImageReaderProxy, /*onePixelShiftRequested=*/false);
// Assert.
diff --git a/camera/camera-core/src/main/cpp/CMakeLists.txt b/camera/camera-core/src/main/cpp/CMakeLists.txt
index 8b3b2dd..ae2cb0b 100644
--- a/camera/camera-core/src/main/cpp/CMakeLists.txt
+++ b/camera/camera-core/src/main/cpp/CMakeLists.txt
@@ -18,12 +18,12 @@
project(camera_core_jni)
add_library(
- yuv_to_rgb_jni
+ image_processing_util_jni
SHARED
- yuv_to_rgb_jni.cc)
+ image_processing_util_jni.cc)
find_library(log-lib log)
find_library(android-lib android)
find_package(libyuv REQUIRED)
-target_link_libraries(yuv_to_rgb_jni PRIVATE ${log-lib} ${android-lib} libyuv::yuv)
+target_link_libraries(image_processing_util_jni PRIVATE ${log-lib} ${android-lib} libyuv::yuv)
diff --git a/camera/camera-core/src/main/cpp/yuv_to_rgb_jni.cc b/camera/camera-core/src/main/cpp/image_processing_util_jni.cc
similarity index 97%
rename from camera/camera-core/src/main/cpp/yuv_to_rgb_jni.cc
rename to camera/camera-core/src/main/cpp/image_processing_util_jni.cc
index 09b4799..51f20e8 100644
--- a/camera/camera-core/src/main/cpp/yuv_to_rgb_jni.cc
+++ b/camera/camera-core/src/main/cpp/image_processing_util_jni.cc
@@ -12,7 +12,7 @@
#define LOGE(...) __android_log_print(ANDROID_LOG_ERROR, "YuvToRgbJni", __VA_ARGS__)
extern "C" {
-JNIEXPORT jint Java_androidx_camera_core_ImageYuvToRgbConverter_shiftPixel(
+JNIEXPORT jint Java_androidx_camera_core_ImageProcessingUtil_shiftPixel(
JNIEnv* env,
jclass,
jobject src_y,
@@ -70,7 +70,7 @@
return 0;
}
-JNIEXPORT jint Java_androidx_camera_core_ImageYuvToRgbConverter_convertAndroid420ToABGR(
+JNIEXPORT jint Java_androidx_camera_core_ImageProcessingUtil_convertAndroid420ToABGR(
JNIEnv* env,
jclass,
jobject src_y,
diff --git a/camera/camera-core/src/main/java/androidx/camera/core/ImageAnalysisAbstractAnalyzer.java b/camera/camera-core/src/main/java/androidx/camera/core/ImageAnalysisAbstractAnalyzer.java
index 80a944e..d7dc3f1 100644
--- a/camera/camera-core/src/main/java/androidx/camera/core/ImageAnalysisAbstractAnalyzer.java
+++ b/camera/camera-core/src/main/java/androidx/camera/core/ImageAnalysisAbstractAnalyzer.java
@@ -17,8 +17,8 @@
package androidx.camera.core;
import static androidx.camera.core.ImageAnalysis.OUTPUT_IMAGE_FORMAT_RGBA_8888;
-import static androidx.camera.core.ImageYuvToRgbConverter.applyPixelShiftForYUV;
-import static androidx.camera.core.ImageYuvToRgbConverter.convertYUVToRGB;
+import static androidx.camera.core.ImageProcessingUtil.applyPixelShiftForYUV;
+import static androidx.camera.core.ImageProcessingUtil.convertYUVToRGB;
import androidx.annotation.GuardedBy;
import androidx.annotation.NonNull;
diff --git a/camera/camera-core/src/main/java/androidx/camera/core/ImageYuvToRgbConverter.java b/camera/camera-core/src/main/java/androidx/camera/core/ImageProcessingUtil.java
similarity index 94%
rename from camera/camera-core/src/main/java/androidx/camera/core/ImageYuvToRgbConverter.java
rename to camera/camera-core/src/main/java/androidx/camera/core/ImageProcessingUtil.java
index 6c4a1d4..415f150 100644
--- a/camera/camera-core/src/main/java/androidx/camera/core/ImageYuvToRgbConverter.java
+++ b/camera/camera-core/src/main/java/androidx/camera/core/ImageProcessingUtil.java
@@ -27,12 +27,12 @@
import java.nio.ByteBuffer;
/** Utility class to convert an {@link Image} from YUV to RGB. */
-final class ImageYuvToRgbConverter {
+final class ImageProcessingUtil {
- private static final String TAG = "ImageYuvToRgbConverter";
+ private static final String TAG = "ImageProcessingUtil";
static {
- System.loadLibrary("yuv_to_rgb_jni");
+ System.loadLibrary("image_processing_util_jni");
}
enum Result {
@@ -42,7 +42,7 @@
ERROR_CONVERSION, // Native conversion error.
}
- private ImageYuvToRgbConverter() {
+ private ImageProcessingUtil() {
}
/**
@@ -62,13 +62,13 @@
@NonNull ImageProxy imageProxy,
@NonNull ImageReaderProxy rgbImageReaderProxy,
boolean onePixelShiftEnabled) {
- if (!ImageYuvToRgbConverter.isSupportedYUVFormat(imageProxy)) {
+ if (!ImageProcessingUtil.isSupportedYUVFormat(imageProxy)) {
Logger.e(TAG, "Unsupported format for YUV to RGB");
return null;
}
// Convert YUV To RGB and write data to surface
- ImageYuvToRgbConverter.Result result = convertYUVToRGBInternal(
+ ImageProcessingUtil.Result result = convertYUVToRGBInternal(
imageProxy, rgbImageReaderProxy.getSurface(), onePixelShiftEnabled);
if (result == Result.ERROR_CONVERSION) {
@@ -105,12 +105,12 @@
* @return true if one pixel shift is applied successfully, otherwise false.
*/
public static boolean applyPixelShiftForYUV(@NonNull ImageProxy imageProxy) {
- if (!ImageYuvToRgbConverter.isSupportedYUVFormat(imageProxy)) {
+ if (!ImageProcessingUtil.isSupportedYUVFormat(imageProxy)) {
Logger.e(TAG, "Unsupported format for YUV to RGB");
return false;
}
- ImageYuvToRgbConverter.Result result = applyPixelShiftInternal(imageProxy);
+ ImageProcessingUtil.Result result = applyPixelShiftInternal(imageProxy);
if (result == Result.ERROR_CONVERSION) {
Logger.e(TAG, "YUV to RGB conversion failure");
diff --git a/camera/camera-extensions/src/androidTest/java/androidx/camera/extensions/ImageCaptureExtenderValidationTest.kt b/camera/camera-extensions/src/androidTest/java/androidx/camera/extensions/ImageCaptureExtenderValidationTest.kt
index 448f7bc..a0c448b 100644
--- a/camera/camera-extensions/src/androidTest/java/androidx/camera/extensions/ImageCaptureExtenderValidationTest.kt
+++ b/camera/camera-extensions/src/androidTest/java/androidx/camera/extensions/ImageCaptureExtenderValidationTest.kt
@@ -17,13 +17,14 @@
package androidx.camera.extensions
import android.content.Context
-import android.hardware.camera2.CameraAccessException
import android.hardware.camera2.CameraCharacteristics
import android.os.Build
import androidx.camera.camera2.interop.Camera2CameraInfo
import androidx.camera.core.Camera
-import androidx.camera.core.CameraInfoUnavailableException
import androidx.camera.core.CameraSelector
+import androidx.camera.core.CameraState
+import androidx.camera.core.ImageCapture
+import androidx.camera.core.impl.ImageCaptureConfig
import androidx.camera.extensions.ExtensionMode.Mode
import androidx.camera.extensions.internal.ExtensionVersion
import androidx.camera.extensions.internal.Version
@@ -32,6 +33,7 @@
import androidx.camera.testing.CameraUtil
import androidx.camera.testing.fakes.FakeLifecycleOwner
import androidx.test.core.app.ApplicationProvider
+import androidx.test.filters.LargeTest
import androidx.test.filters.SdkSuppress
import androidx.test.filters.SmallTest
import com.google.common.truth.Truth.assertThat
@@ -39,14 +41,13 @@
import kotlinx.coroutines.runBlocking
import kotlinx.coroutines.withContext
import org.junit.After
-import org.junit.Assume
+import org.junit.Assume.assumeTrue
import org.junit.Before
import org.junit.Test
import org.junit.runner.RunWith
import org.junit.runners.Parameterized
-import java.util.concurrent.ExecutionException
+import java.util.concurrent.CountDownLatch
import java.util.concurrent.TimeUnit
-import java.util.concurrent.TimeoutException
@SmallTest
@RunWith(Parameterized::class)
@@ -62,10 +63,9 @@
private lateinit var cameraCharacteristics: CameraCharacteristics
@Before
- @Throws(Exception::class)
fun setUp(): Unit = runBlocking {
- Assume.assumeTrue(CameraUtil.deviceHasCamera())
- Assume.assumeTrue(
+ assumeTrue(CameraUtil.deviceHasCamera())
+ assumeTrue(
CameraUtil.hasCameraWithLensFacing(
lensFacing
)
@@ -73,7 +73,7 @@
cameraProvider = ProcessCameraProvider.getInstance(context)[10000, TimeUnit.MILLISECONDS]
extensionsManager = ExtensionsManager.getInstance(context)[10000, TimeUnit.MILLISECONDS]
- Assume.assumeTrue(
+ assumeTrue(
extensionsManager.isExtensionAvailable(
cameraProvider,
CameraSelector.Builder().requireLensFacing(lensFacing).build(),
@@ -97,13 +97,11 @@
}
@After
- @Throws(
- InterruptedException::class,
- ExecutionException::class,
- TimeoutException::class
- )
- fun cleanUp() {
+ fun cleanUp(): Unit = runBlocking {
if (::cameraProvider.isInitialized) {
+ withContext(Dispatchers.Main) {
+ cameraProvider.unbindAll()
+ }
cameraProvider.shutdown()[10000, TimeUnit.MILLISECONDS]
}
@@ -120,14 +118,10 @@
}
@Test
- @Throws(
- CameraInfoUnavailableException::class,
- CameraAccessException::class
- )
fun getSupportedResolutionsImplementationTest() {
// getSupportedResolutions supported since version 1.1
val version = ExtensionVersion.getRuntimeVersion()
- Assume.assumeTrue(version != null && version.compareTo(Version.VERSION_1_1) >= 0)
+ assumeTrue(version != null && version.compareTo(Version.VERSION_1_1) >= 0)
// Creates the ImageCaptureExtenderImpl to retrieve the target format/resolutions pair list
// from vendor library for the target effect mode.
@@ -144,10 +138,6 @@
@Test
@SdkSuppress(maxSdkVersion = Build.VERSION_CODES.O_MR1)
- @Throws(
- CameraInfoUnavailableException::class,
- CameraAccessException::class
- )
fun returnsNullFromOnPresetSession_whenAPILevelOlderThan28() {
// Creates the ImageCaptureExtenderImpl to check that onPresetSession() returns null when
// API level is older than 28.
@@ -160,13 +150,9 @@
}
@Test
- @Throws(
- CameraInfoUnavailableException::class,
- CameraAccessException::class
- )
fun getEstimatedCaptureLatencyRangeTest() {
// getEstimatedCaptureLatencyRange supported since version 1.2
- Assume.assumeTrue(
+ assumeTrue(
ExtensionVersion.getRuntimeVersion()!!.compareTo(Version.VERSION_1_2) >= 0
)
@@ -182,4 +168,55 @@
// in vendor library, and then the test will fail.
impl.getEstimatedCaptureLatencyRange(null)
}
+
+ @LargeTest
+ @Test
+ fun returnCaptureStages_whenCaptureProcessorIsNotNull(): Unit = runBlocking {
+ val impl = ExtensionsTestUtil.createImageCaptureExtenderImpl(
+ extensionMode,
+ cameraId,
+ cameraCharacteristics
+ )
+
+ // Only runs the test when CaptureProcessor is not null
+ assumeTrue(impl.captureProcessor != null)
+
+ val lifecycleOwner = FakeLifecycleOwner()
+ lifecycleOwner.startAndResume()
+
+ val cameraSelector = CameraSelector.Builder().requireLensFacing(lensFacing).build()
+ val extensionsCameraSelector = extensionsManager.getExtensionEnabledCameraSelector(
+ cameraProvider,
+ cameraSelector,
+ extensionMode
+ )
+
+ val imageCapture = ImageCapture.Builder().build()
+
+ val countDownLatch = CountDownLatch(1)
+
+ withContext(Dispatchers.Main) {
+ val camera = cameraProvider.bindToLifecycle(
+ lifecycleOwner, extensionsCameraSelector, imageCapture
+ )
+
+ camera.cameraInfo.cameraState.observeForever { cameraState ->
+ if (cameraState.type == CameraState.Type.OPEN) {
+ countDownLatch.countDown()
+ }
+ }
+ }
+
+ // Wait for the CameraState type becomes OPEN to make sure the capture session has been
+ // created.
+ countDownLatch.await(10000, TimeUnit.MILLISECONDS)
+
+ // Retrieve the CaptureBundle from ImageCapture's config
+ val captureBundle =
+ imageCapture.currentConfig.retrieveOption(ImageCaptureConfig.OPTION_CAPTURE_BUNDLE)
+
+ // Calls CaptureBundle#getCaptureStages() will call
+ // ImageCaptureExtenderImpl#getCaptureStages(). Checks the returned value is not empty.
+ assertThat(captureBundle!!.captureStages).isNotEmpty()
+ }
}
diff --git a/camera/camera-lifecycle/api/api_lint.ignore b/camera/camera-lifecycle/api/api_lint.ignore
new file mode 100644
index 0000000..b5aaff7
--- /dev/null
+++ b/camera/camera-lifecycle/api/api_lint.ignore
@@ -0,0 +1,3 @@
+// Baseline format: 1.0
+AsyncSuffixFuture: androidx.camera.lifecycle.ProcessCameraProvider#getInstance(android.content.Context):
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
diff --git a/camera/camera-video/src/androidTest/java/androidx/camera/video/RecorderTest.kt b/camera/camera-video/src/androidTest/java/androidx/camera/video/RecorderTest.kt
index 5375e6b..5e152b4 100644
--- a/camera/camera-video/src/androidTest/java/androidx/camera/video/RecorderTest.kt
+++ b/camera/camera-video/src/androidTest/java/androidx/camera/video/RecorderTest.kt
@@ -192,10 +192,11 @@
invokeSurfaceRequest()
val file = File.createTempFile("CameraX", ".tmp").apply { deleteOnExit() }
- val activeRecording = recorder.prepareRecording(FileOutputOptions.Builder(file).build())
- .withEventListener(CameraXExecutors.directExecutor(), videoRecordEventListener)
- .withAudioEnabled()
- .start()
+ val activeRecording =
+ recorder.prepareRecording(context, FileOutputOptions.Builder(file).build())
+ .withEventListener(CameraXExecutors.directExecutor(), videoRecordEventListener)
+ .withAudioEnabled()
+ .start()
val inOrder = inOrder(videoRecordEventListener)
inOrder.verify(videoRecordEventListener, timeout(1000L))
@@ -237,7 +238,7 @@
).setContentValues(contentValues).build()
var uri: Uri = Uri.EMPTY
- val activeRecording = recorder.prepareRecording(outputOptions)
+ val activeRecording = recorder.prepareRecording(context, outputOptions)
.withEventListener(CameraXExecutors.directExecutor()) {
if (it is VideoRecordEvent.Status) {
statusSemaphore.release()
@@ -275,7 +276,7 @@
ParcelFileDescriptor.MODE_READ_WRITE
).use { pfd ->
val activeRecording = recorder
- .prepareRecording(FileDescriptorOutputOptions.Builder(pfd).build())
+ .prepareRecording(context, FileDescriptorOutputOptions.Builder(pfd).build())
.withEventListener(CameraXExecutors.directExecutor(), videoRecordEventListener)
.withAudioEnabled()
.start()
@@ -307,7 +308,7 @@
ParcelFileDescriptor.MODE_READ_WRITE
).use { pfd ->
assertThrows(IllegalStateException::class.java) {
- recorder.prepareRecording(FileDescriptorOutputOptions.Builder(pfd).build())
+ recorder.prepareRecording(context, FileDescriptorOutputOptions.Builder(pfd).build())
}
}
@@ -321,10 +322,11 @@
val file = File.createTempFile("CameraX", ".tmp").apply { deleteOnExit() }
- val activeRecording = recorder.prepareRecording(FileOutputOptions.Builder(file).build())
- .withEventListener(CameraXExecutors.directExecutor(), videoRecordEventListener)
- .withAudioEnabled()
- .start()
+ val activeRecording =
+ recorder.prepareRecording(context, FileOutputOptions.Builder(file).build())
+ .withEventListener(CameraXExecutors.directExecutor(), videoRecordEventListener)
+ .withAudioEnabled()
+ .start()
activeRecording.pause()
@@ -357,10 +359,11 @@
val file = File.createTempFile("CameraX", ".tmp").apply { deleteOnExit() }
- val activeRecording = recorder.prepareRecording(FileOutputOptions.Builder(file).build())
- .withEventListener(CameraXExecutors.directExecutor(), videoRecordEventListener)
- .withAudioEnabled()
- .start()
+ val activeRecording =
+ recorder.prepareRecording(context, FileOutputOptions.Builder(file).build())
+ .withEventListener(CameraXExecutors.directExecutor(), videoRecordEventListener)
+ .withAudioEnabled()
+ .start()
activeRecording.pause()
@@ -392,10 +395,11 @@
// Start and stop a recording to ensure recorder is idling
val inOrder = inOrder(videoRecordEventListener)
- val activeRecording1 = recorder.prepareRecording(FileOutputOptions.Builder(file1).build())
- .withEventListener(CameraXExecutors.directExecutor(), videoRecordEventListener)
- .withAudioEnabled()
- .start()
+ val activeRecording1 =
+ recorder.prepareRecording(context, FileOutputOptions.Builder(file1).build())
+ .withEventListener(CameraXExecutors.directExecutor(), videoRecordEventListener)
+ .withAudioEnabled()
+ .start()
inOrder.verify(videoRecordEventListener, timeout(1000L))
.accept(any(VideoRecordEvent.Start::class.java))
@@ -409,10 +413,11 @@
.accept(any(VideoRecordEvent.Finalize::class.java))
// First recording is now finalized. Try starting second recording paused.
- val activeRecording2 = recorder.prepareRecording(FileOutputOptions.Builder(file2).build())
- .withEventListener(CameraXExecutors.directExecutor(), videoRecordEventListener)
- .withAudioEnabled()
- .start()
+ val activeRecording2 =
+ recorder.prepareRecording(context, FileOutputOptions.Builder(file2).build())
+ .withEventListener(CameraXExecutors.directExecutor(), videoRecordEventListener)
+ .withAudioEnabled()
+ .start()
activeRecording2.pause()
@@ -437,10 +442,11 @@
val inOrder = inOrder(videoRecordEventListener)
// Start
- val activeRecording = recorder.prepareRecording(FileOutputOptions.Builder(file).build())
- .withEventListener(CameraXExecutors.directExecutor(), videoRecordEventListener)
- .withAudioEnabled()
- .start()
+ val activeRecording =
+ recorder.prepareRecording(context, FileOutputOptions.Builder(file).build())
+ .withEventListener(CameraXExecutors.directExecutor(), videoRecordEventListener)
+ .withAudioEnabled()
+ .start()
inOrder.verify(videoRecordEventListener, timeout(1000L))
.accept(any(VideoRecordEvent.Start::class.java))
@@ -534,10 +540,11 @@
)
// Start
- val activeRecording = recorder.prepareRecording(FileOutputOptions.Builder(file).build())
- .withEventListener(CameraXExecutors.directExecutor(), videoRecordEventListener)
- .withAudioEnabled()
- .start()
+ val activeRecording =
+ recorder.prepareRecording(context, FileOutputOptions.Builder(file).build())
+ .withEventListener(CameraXExecutors.directExecutor(), videoRecordEventListener)
+ .withAudioEnabled()
+ .start()
// Starting recording should move Recorder to ACTIVE stream state
inOrder.verify(streamStateObserver, timeout(1000L)).onNewData(
eq(VideoOutput.StreamState.ACTIVE)
@@ -559,9 +566,9 @@
val file = File.createTempFile("CameraX", ".tmp").apply { deleteOnExit() }
val outputOptions = FileOutputOptions.Builder(file).build()
- val activeRecording = recorder.prepareRecording(outputOptions).start()
+ val activeRecording = recorder.prepareRecording(context, outputOptions).start()
- val pendingRecording = recorder.prepareRecording(outputOptions)
+ val pendingRecording = recorder.prepareRecording(context, outputOptions)
assertThrows(java.lang.IllegalStateException::class.java) {
pendingRecording.start()
}
@@ -575,10 +582,11 @@
clearInvocations(videoRecordEventListener)
val file = File.createTempFile("CameraX", ".tmp").apply { deleteOnExit() }
- val activeRecording = recorder.prepareRecording(FileOutputOptions.Builder(file).build())
- .withEventListener(CameraXExecutors.directExecutor(), videoRecordEventListener)
- .withAudioEnabled()
- .start()
+ val activeRecording =
+ recorder.prepareRecording(context, FileOutputOptions.Builder(file).build())
+ .withEventListener(CameraXExecutors.directExecutor(), videoRecordEventListener)
+ .withAudioEnabled()
+ .start()
invokeSurfaceRequest()
@@ -603,10 +611,11 @@
recorder.onSourceStateChanged(VideoOutput.SourceState.INACTIVE)
- val activeRecording = recorder.prepareRecording(FileOutputOptions.Builder(file).build())
- .withEventListener(CameraXExecutors.directExecutor(), videoRecordEventListener)
- .withAudioEnabled()
- .start()
+ val activeRecording =
+ recorder.prepareRecording(context, FileOutputOptions.Builder(file).build())
+ .withEventListener(CameraXExecutors.directExecutor(), videoRecordEventListener)
+ .withAudioEnabled()
+ .start()
verify(videoRecordEventListener, timeout(FINALIZE_TIMEOUT))
.accept(any(VideoRecordEvent.Finalize::class.java))
@@ -625,10 +634,11 @@
clearInvocations(videoRecordEventListener)
val file = File.createTempFile("CameraX", ".tmp").apply { deleteOnExit() }
- val activeRecording = recorder.prepareRecording(FileOutputOptions.Builder(file).build())
- .withEventListener(CameraXExecutors.directExecutor(), videoRecordEventListener)
- .withAudioEnabled()
- .start()
+ val activeRecording =
+ recorder.prepareRecording(context, FileOutputOptions.Builder(file).build())
+ .withEventListener(CameraXExecutors.directExecutor(), videoRecordEventListener)
+ .withAudioEnabled()
+ .start()
activeRecording.pause()
@@ -653,10 +663,11 @@
invokeSurfaceRequest()
val file = File.createTempFile("CameraX", ".tmp").apply { deleteOnExit() }
- val activeRecording = recorder.prepareRecording(FileOutputOptions.Builder(file).build())
- .withEventListener(CameraXExecutors.directExecutor(), videoRecordEventListener)
- .withAudioEnabled()
- .start()
+ val activeRecording =
+ recorder.prepareRecording(context, FileOutputOptions.Builder(file).build())
+ .withEventListener(CameraXExecutors.directExecutor(), videoRecordEventListener)
+ .withAudioEnabled()
+ .start()
val inOrder = inOrder(videoRecordEventListener)
inOrder.verify(videoRecordEventListener, timeout(1000L))
@@ -690,10 +701,11 @@
invokeSurfaceRequest()
val file = File.createTempFile("CameraX", ".tmp").apply { deleteOnExit() }
- val activeRecording = recorder.prepareRecording(FileOutputOptions.Builder(file).build())
- .withEventListener(CameraXExecutors.directExecutor(), videoRecordEventListener)
- .withAudioEnabled()
- .start()
+ val activeRecording =
+ recorder.prepareRecording(context, FileOutputOptions.Builder(file).build())
+ .withEventListener(CameraXExecutors.directExecutor(), videoRecordEventListener)
+ .withAudioEnabled()
+ .start()
val inOrder = inOrder(videoRecordEventListener)
inOrder.verify(videoRecordEventListener, timeout(1000L))
@@ -715,10 +727,11 @@
invokeSurfaceRequest()
val file = File.createTempFile("CameraX", ".tmp").apply { deleteOnExit() }
- val activeRecording = recorder.prepareRecording(FileOutputOptions.Builder(file).build())
- .withEventListener(CameraXExecutors.directExecutor(), videoRecordEventListener)
- .withAudioEnabled()
- .start()
+ val activeRecording =
+ recorder.prepareRecording(context, FileOutputOptions.Builder(file).build())
+ .withEventListener(CameraXExecutors.directExecutor(), videoRecordEventListener)
+ .withAudioEnabled()
+ .start()
val inOrder = inOrder(videoRecordEventListener)
inOrder.verify(videoRecordEventListener, timeout(1000L))
@@ -745,10 +758,11 @@
invokeSurfaceRequest()
val file = File.createTempFile("CameraX", ".tmp").apply { deleteOnExit() }
- val activeRecording = recorder.prepareRecording(FileOutputOptions.Builder(file).build())
- .withEventListener(CameraXExecutors.directExecutor(), videoRecordEventListener)
- .withAudioEnabled()
- .start()
+ val activeRecording =
+ recorder.prepareRecording(context, FileOutputOptions.Builder(file).build())
+ .withEventListener(CameraXExecutors.directExecutor(), videoRecordEventListener)
+ .withAudioEnabled()
+ .start()
val inOrder = inOrder(videoRecordEventListener)
inOrder.verify(videoRecordEventListener, timeout(1000L))
@@ -769,10 +783,11 @@
clearInvocations(videoRecordEventListener)
val file = File.createTempFile("CameraX", ".tmp").apply { deleteOnExit() }
- val activeRecording = recorder.prepareRecording(FileOutputOptions.Builder(file).build())
- .withEventListener(CameraXExecutors.directExecutor(), videoRecordEventListener)
- .withAudioEnabled()
- .start()
+ val activeRecording =
+ recorder.prepareRecording(context, FileOutputOptions.Builder(file).build())
+ .withEventListener(CameraXExecutors.directExecutor(), videoRecordEventListener)
+ .withAudioEnabled()
+ .start()
activeRecording.pause()
activeRecording.stopSafely()
@@ -792,7 +807,8 @@
val inOrder = inOrder(videoRecordEventListener)
// Recording will be stopped by AutoCloseable.close() upon exiting use{} block
- val pendingRecording = recorder.prepareRecording(FileOutputOptions.Builder(file).build())
+ val pendingRecording =
+ recorder.prepareRecording(context, FileOutputOptions.Builder(file).build())
pendingRecording.withEventListener(
CameraXExecutors.directExecutor(),
videoRecordEventListener
@@ -816,10 +832,11 @@
invokeSurfaceRequest()
val file = File.createTempFile("CameraX", ".tmp").apply { deleteOnExit() }
- val activeRecording = recorder.prepareRecording(FileOutputOptions.Builder(file).build())
- .withEventListener(CameraXExecutors.directExecutor(), videoRecordEventListener)
- .withAudioEnabled()
- .start()
+ val activeRecording =
+ recorder.prepareRecording(context, FileOutputOptions.Builder(file).build())
+ .withEventListener(CameraXExecutors.directExecutor(), videoRecordEventListener)
+ .withAudioEnabled()
+ .start()
val inOrder = inOrder(videoRecordEventListener)
inOrder.verify(videoRecordEventListener, timeout(1000L))
@@ -846,7 +863,7 @@
val inOrder = inOrder(videoRecordEventListener)
var activeRecording: ActiveRecording? = recorder
- .prepareRecording(FileOutputOptions.Builder(file).build())
+ .prepareRecording(context, FileOutputOptions.Builder(file).build())
.withEventListener(CameraXExecutors.directExecutor(), videoRecordEventListener)
.withAudioEnabled()
.start()
@@ -879,10 +896,11 @@
invokeSurfaceRequest()
val file = File.createTempFile("CameraX", ".tmp").apply { deleteOnExit() }
- val activeRecording = recorder.prepareRecording(FileOutputOptions.Builder(file).build())
- .withEventListener(CameraXExecutors.directExecutor(), videoRecordEventListener)
- .withAudioEnabled()
- .start()
+ val activeRecording =
+ recorder.prepareRecording(context, FileOutputOptions.Builder(file).build())
+ .withEventListener(CameraXExecutors.directExecutor(), videoRecordEventListener)
+ .withAudioEnabled()
+ .start()
val inOrder = inOrder(videoRecordEventListener)
inOrder.verify(videoRecordEventListener, timeout(1000L))
@@ -933,9 +951,10 @@
invokeSurfaceRequest()
val file = File.createTempFile("CameraX", ".tmp").apply { deleteOnExit() }
- val activeRecording = recorder.prepareRecording(FileOutputOptions.Builder(file).build())
- .withEventListener(CameraXExecutors.directExecutor(), videoRecordEventListener)
- .start()
+ val activeRecording =
+ recorder.prepareRecording(context, FileOutputOptions.Builder(file).build())
+ .withEventListener(CameraXExecutors.directExecutor(), videoRecordEventListener)
+ .start()
val inOrder = inOrder(videoRecordEventListener)
inOrder.verify(videoRecordEventListener, timeout(1000L))
@@ -946,7 +965,7 @@
// Check the audio information reports state as disabled.
val captor = ArgumentCaptor.forClass(VideoRecordEvent::class.java)
verify(videoRecordEventListener, atLeastOnce()).accept(captor.capture())
- assertThat(captor.value.eventType).isEqualTo(VideoRecordEvent.EVENT_TYPE_STATUS)
+ assertThat(captor.value).isInstanceOf(VideoRecordEvent.Status::class.java)
val status = captor.value as VideoRecordEvent.Status
assertThat(status.recordingStats.audioStats.audioState)
.isEqualTo(AudioStats.AUDIO_STATE_DISABLED)
@@ -968,11 +987,13 @@
val file2 = File.createTempFile("CameraX2", ".tmp").apply { deleteOnExit() }
try {
// We explicitly do not invoke the surface request so the recorder is initializing.
- recorder.prepareRecording(FileOutputOptions.Builder(file1).build()).start().use {
- assertThrows<IllegalStateException> {
- recorder.prepareRecording(FileOutputOptions.Builder(file2).build()).start()
+ recorder.prepareRecording(context, FileOutputOptions.Builder(file1).build()).start()
+ .use {
+ assertThrows<IllegalStateException> {
+ recorder.prepareRecording(context, FileOutputOptions.Builder(file2).build())
+ .start()
+ }
}
- }
} finally {
file1.delete()
file2.delete()
@@ -990,7 +1011,7 @@
val inOrder = inOrder(videoRecordEventListener)
try {
- recorder.prepareRecording(FileOutputOptions.Builder(file1).build())
+ recorder.prepareRecording(context, FileOutputOptions.Builder(file1).build())
.withEventListener(
CameraXExecutors.directExecutor(),
videoRecordEventListener
@@ -1001,7 +1022,7 @@
.accept(any(VideoRecordEvent.Status::class.java))
}
- recorder.prepareRecording(FileOutputOptions.Builder(file2).build())
+ recorder.prepareRecording(context, FileOutputOptions.Builder(file2).build())
.withEventListener(
CameraXExecutors.directExecutor(),
videoRecordEventListener
@@ -1092,7 +1113,7 @@
.build()
val activeRecording = recorder
- .prepareRecording(outputOptions)
+ .prepareRecording(context, outputOptions)
.withEventListener(CameraXExecutors.directExecutor(), videoRecordEventListener)
.start()
@@ -1104,7 +1125,7 @@
val captor = ArgumentCaptor.forClass(VideoRecordEvent::class.java)
verify(videoRecordEventListener, atLeastOnce()).accept(captor.capture())
- assertThat(captor.value.eventType).isEqualTo(VideoRecordEvent.EVENT_TYPE_FINALIZE)
+ assertThat(captor.value).isInstanceOf(VideoRecordEvent.Finalize::class.java)
val finalize = captor.value as VideoRecordEvent.Finalize
assertThat(finalize.error).isEqualTo(ERROR_FILE_SIZE_LIMIT_REACHED)
assertThat(file.length()).isLessThan(fileSizeLimit)
diff --git a/camera/camera-video/src/androidTest/java/androidx/camera/video/VideoRecordingTest.kt b/camera/camera-video/src/androidTest/java/androidx/camera/video/VideoRecordingTest.kt
index 7ee8a9c..395dc37 100644
--- a/camera/camera-video/src/androidTest/java/androidx/camera/video/VideoRecordingTest.kt
+++ b/camera/camera-video/src/androidTest/java/androidx/camera/video/VideoRecordingTest.kt
@@ -101,22 +101,22 @@
private lateinit var finalize: VideoRecordEvent.Finalize
private val videoRecordEventListener = Consumer<VideoRecordEvent> {
- when (it.eventType) {
- VideoRecordEvent.EVENT_TYPE_START -> {
+ when (it) {
+ is VideoRecordEvent.Start -> {
// Recording start.
Log.d(TAG, "Recording start")
}
- VideoRecordEvent.EVENT_TYPE_FINALIZE -> {
+ is VideoRecordEvent.Finalize -> {
// Recording stop.
Log.d(TAG, "Recording finalize")
- finalize = it as VideoRecordEvent.Finalize
+ finalize = it
latchForVideoSaved.countDown()
}
- VideoRecordEvent.EVENT_TYPE_STATUS -> {
+ is VideoRecordEvent.Status -> {
// Make sure the recording proceed for a while.
latchForVideoRecording.countDown()
}
- VideoRecordEvent.EVENT_TYPE_PAUSE, VideoRecordEvent.EVENT_TYPE_RESUME -> {
+ is VideoRecordEvent.Pause, is VideoRecordEvent.Resume -> {
// no op for this test, skip these event now.
}
else -> {
@@ -306,7 +306,7 @@
// Act.
videoCapture.output
- .prepareRecording(FileOutputOptions.Builder(file).build())
+ .prepareRecording(context, FileOutputOptions.Builder(file).build())
.withEventListener(
CameraXExecutors.directExecutor(),
mockListener
@@ -403,7 +403,7 @@
private fun startVideoRecording(videoCapture: VideoCapture<Recorder>, file: File):
ActiveRecording {
val activeRecording = videoCapture.output
- .prepareRecording(FileOutputOptions.Builder(file).build())
+ .prepareRecording(context, FileOutputOptions.Builder(file).build())
.withEventListener(
CameraXExecutors.directExecutor(),
videoRecordEventListener
diff --git a/camera/camera-video/src/main/java/androidx/camera/video/FileDescriptorOutputOptions.java b/camera/camera-video/src/main/java/androidx/camera/video/FileDescriptorOutputOptions.java
index b1e23f7..be6d057 100644
--- a/camera/camera-video/src/main/java/androidx/camera/video/FileDescriptorOutputOptions.java
+++ b/camera/camera-video/src/main/java/androidx/camera/video/FileDescriptorOutputOptions.java
@@ -110,9 +110,9 @@
* unlimited.
*
* <p>When used to
- * {@link Recorder#prepareRecording(FileDescriptorOutputOptions) generate} recording, if the
- * specified file size limit is reached while the recording is being recorded, the
- * recording will be finalized with
+ * {@link Recorder#prepareRecording(android.content.Context, FileDescriptorOutputOptions)
+ * generate} recording, if the specified file size limit is reached while the recording
+ * is being recorded, the recording will be finalized with
* {@link VideoRecordEvent.Finalize#ERROR_FILE_SIZE_LIMIT_REACHED}.
*
* <p>If not set, defaults to {@link #FILE_SIZE_UNLIMITED}.
diff --git a/camera/camera-video/src/main/java/androidx/camera/video/FileOutputOptions.java b/camera/camera-video/src/main/java/androidx/camera/video/FileOutputOptions.java
index 65a9708..5c2a91a 100644
--- a/camera/camera-video/src/main/java/androidx/camera/video/FileOutputOptions.java
+++ b/camera/camera-video/src/main/java/androidx/camera/video/FileOutputOptions.java
@@ -106,9 +106,9 @@
* unlimited.
*
* <p>When used to
- * {@link Recorder#prepareRecording(FileOutputOptions) generate} recording, if the
- * specified file size limit is reached while the recording is being recorded, the
- * recording will be finalized with
+ * {@link Recorder#prepareRecording(android.content.Context, FileOutputOptions) generate}
+ * recording, if the specified file size limit is reached while the recording is being
+ * recorded, the recording will be finalized with
* {@link VideoRecordEvent.Finalize#ERROR_FILE_SIZE_LIMIT_REACHED}.
*
* <p>If not set, defaults to {@link #FILE_SIZE_UNLIMITED}.
diff --git a/camera/camera-video/src/main/java/androidx/camera/video/MediaStoreOutputOptions.java b/camera/camera-video/src/main/java/androidx/camera/video/MediaStoreOutputOptions.java
index 8c60c24..32df6b7f 100644
--- a/camera/camera-video/src/main/java/androidx/camera/video/MediaStoreOutputOptions.java
+++ b/camera/camera-video/src/main/java/androidx/camera/video/MediaStoreOutputOptions.java
@@ -160,9 +160,9 @@
* unlimited.
*
* <p>When used to
- * {@link Recorder#prepareRecording(MediaStoreOutputOptions) generate} recording, if the
- * specified file size limit is reached while the recording is being recorded, the
- * recording will be finalized with
+ * {@link Recorder#prepareRecording(android.content.Context, MediaStoreOutputOptions)
+ * generate} recording, if the specified file size limit is reached while the recording
+ * is being recorded, the recording will be finalized with
* {@link VideoRecordEvent.Finalize#ERROR_FILE_SIZE_LIMIT_REACHED}.
*
* <p>If not set, defaults to {@link #FILE_SIZE_UNLIMITED}.
diff --git a/camera/camera-video/src/main/java/androidx/camera/video/PendingRecording.java b/camera/camera-video/src/main/java/androidx/camera/video/PendingRecording.java
index 275b737..3fd38f2 100644
--- a/camera/camera-video/src/main/java/androidx/camera/video/PendingRecording.java
+++ b/camera/camera-video/src/main/java/androidx/camera/video/PendingRecording.java
@@ -17,11 +17,13 @@
package androidx.camera.video;
import android.Manifest;
+import android.content.Context;
import androidx.annotation.CheckResult;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.RequiresPermission;
+import androidx.camera.core.impl.utils.ContextUtil;
import androidx.core.util.Consumer;
import androidx.core.util.Preconditions;
@@ -36,10 +38,11 @@
* the controls of the {@link ActiveRecording} class returned by {@link #start()}.
*
* <p>A pending recording can be created using one of the {@link Recorder} methods for starting a
- * recording such as {@link Recorder#prepareRecording(MediaStoreOutputOptions)}.
+ * recording such as {@link Recorder#prepareRecording(Context, MediaStoreOutputOptions)}.
*/
public final class PendingRecording {
+ private final Context mContext;
private final Recorder mRecorder;
private final OutputOptions mOutputOptions;
private Consumer<VideoRecordEvent> mEventListener;
@@ -47,7 +50,11 @@
private boolean mAudioEnabled = false;
- PendingRecording(@NonNull Recorder recorder, @NonNull OutputOptions options) {
+ PendingRecording(@NonNull Context context, @NonNull Recorder recorder,
+ @NonNull OutputOptions options) {
+ // Application context is sufficient for all our needs, so store that to avoid leaking
+ // unused resources
+ mContext = ContextUtil.getApplicationContext(context);
mRecorder = recorder;
mOutputOptions = options;
}
@@ -109,10 +116,14 @@
* @return this pending recording
* @throws IllegalStateException if the {@link Recorder} this recording is associated to
* doesn't support audio.
+ * @throws SecurityException if the {@link Manifest.permission#RECORD_AUDIO} permission is
+ * not granted for the current process or calling IPC process.
*/
@RequiresPermission(Manifest.permission.RECORD_AUDIO)
@NonNull
public PendingRecording withAudioEnabled() {
+ // Check permission. Passing a null message will generate a default message in exception.
+ mContext.enforceCallingOrSelfPermission(Manifest.permission.RECORD_AUDIO, /*message=*/null);
Preconditions.checkState(mRecorder.isAudioSupported(), "The Recorder this recording is "
+ "associated to doesn't support audio.");
mAudioEnabled = true;
diff --git a/camera/camera-video/src/main/java/androidx/camera/video/Recorder.java b/camera/camera-video/src/main/java/androidx/camera/video/Recorder.java
index 16c568b..053c895 100644
--- a/camera/camera-video/src/main/java/androidx/camera/video/Recorder.java
+++ b/camera/camera-video/src/main/java/androidx/camera/video/Recorder.java
@@ -33,6 +33,7 @@
import android.Manifest;
import android.annotation.SuppressLint;
import android.content.ContentValues;
+import android.content.Context;
import android.media.MediaCodecInfo;
import android.media.MediaMuxer;
import android.net.Uri;
@@ -118,9 +119,10 @@
*
* <p>Once the recorder is attached to a video source, a new recording can be configured with one of
* the {@link PendingRecording} methods, such as
- * {@link #prepareRecording(MediaStoreOutputOptions)}. The {@link PendingRecording} class also
- * allows setting a listener with {@link PendingRecording#withEventListener(Executor, Consumer)}
- * to listen for {@link VideoRecordEvent}s such as {@link VideoRecordEvent.Start},
+ * {@link #prepareRecording(Context, MediaStoreOutputOptions)}. The {@link PendingRecording} class
+ * also allows setting a listener with
+ * {@link PendingRecording#withEventListener(Executor, Consumer)} to listen for
+ * {@link VideoRecordEvent}s such as {@link VideoRecordEvent.Start},
* {@link VideoRecordEvent.Pause}, {@link VideoRecordEvent.Resume}, and
* {@link VideoRecordEvent.Finalize}. This listener will also receive regular recording status
* updates via the {@link VideoRecordEvent.Status} event.
@@ -356,6 +358,8 @@
@VideoRecordError
int mRecordingStopError = ERROR_UNKNOWN;
@SuppressWarnings("WeakerAccess") /* synthetic accessor */
+ Throwable mRecordingStopErrorCause = null;
+ @SuppressWarnings("WeakerAccess") /* synthetic accessor */
AudioState mCachedAudioState;
@SuppressWarnings("WeakerAccess") /* synthetic accessor */
EncodedData mPendingFirstVideoData = null;
@@ -448,7 +452,7 @@
setState(State.STOPPING);
RecordingRecord finalActiveRecordingRecord = mActiveRecordingRecord;
mSequentialExecutor.execute(() -> stopInternal(finalActiveRecordingRecord,
- ERROR_SOURCE_INACTIVE));
+ ERROR_SOURCE_INACTIVE, null));
break;
case STOPPING:
// Fall-through
@@ -484,14 +488,18 @@
* returned {@link PendingRecording}. Only a single pending recording can be started per
* {@link Recorder} instance.
*
+ * @param context the context used to enforce runtime permissions, interface with the media
+ * scanner service, and attribute access to permission protected data, such as
+ * audio.
* @param fileOutputOptions the options that configures how the output will be handled.
* @return a {@link PendingRecording} that is associated with this Recorder.
* @throws IllegalStateException if the Recorder is released.
* @see FileOutputOptions
*/
@NonNull
- public PendingRecording prepareRecording(@NonNull FileOutputOptions fileOutputOptions) {
- return prepareRecordingInternal(fileOutputOptions);
+ public PendingRecording prepareRecording(@NonNull Context context,
+ @NonNull FileOutputOptions fileOutputOptions) {
+ return prepareRecordingInternal(context, fileOutputOptions);
}
/**
@@ -507,6 +515,9 @@
* returned {@link PendingRecording}. Only a single pending recording can be started per
* {@link Recorder} instance.
*
+ * @param context the context used to enforce runtime permissions, interface with the media
+ * scanner service, and attribute access to permission protected data, such as
+ * audio.
* @param fileDescriptorOutputOptions the options that configures how the output will be
* handled.
* @return a {@link PendingRecording} that is associated with this Recorder.
@@ -515,11 +526,11 @@
*/
@RequiresApi(26)
@NonNull
- public PendingRecording prepareRecording(
+ public PendingRecording prepareRecording(@NonNull Context context,
@NonNull FileDescriptorOutputOptions fileDescriptorOutputOptions) {
Preconditions.checkState(Build.VERSION.SDK_INT >= Build.VERSION_CODES.O,
"MediaMuxer doesn't accept FileDescriptor as output destination.");
- return prepareRecordingInternal(fileDescriptorOutputOptions);
+ return prepareRecordingInternal(context, fileDescriptorOutputOptions);
}
/**
@@ -532,21 +543,25 @@
* returned {@link PendingRecording}. Only a single pending recording can be started per
* {@link Recorder} instance.
*
+ * @param context the context used to enforce runtime permissions, interface with the media
+ * scanner service, and attribute access to permission protected data, such as
+ * audio.
* @param mediaStoreOutputOptions the options that configures how the output will be handled.
* @return a {@link PendingRecording} that is associated with this Recorder.
* @throws IllegalStateException if the Recorder is released.
* @see MediaStoreOutputOptions
*/
@NonNull
- public PendingRecording prepareRecording(
+ public PendingRecording prepareRecording(@NonNull Context context,
@NonNull MediaStoreOutputOptions mediaStoreOutputOptions) {
- return prepareRecordingInternal(mediaStoreOutputOptions);
+ return prepareRecordingInternal(context, mediaStoreOutputOptions);
}
@NonNull
- private PendingRecording prepareRecordingInternal(@NonNull OutputOptions options) {
+ private PendingRecording prepareRecordingInternal(@NonNull Context context,
+ @NonNull OutputOptions options) {
Preconditions.checkNotNull(options, "The OutputOptions cannot be null.");
- return new PendingRecording(this, options);
+ return new PendingRecording(context, this, options);
}
/**
@@ -819,7 +834,7 @@
setState(State.STOPPING);
RecordingRecord finalActiveRecordingRecord = mActiveRecordingRecord;
mSequentialExecutor.execute(() -> stopInternal(finalActiveRecordingRecord,
- ERROR_NONE));
+ ERROR_NONE, null));
break;
case ERROR:
// In an error state, the recording will already be finalized. Treat as a
@@ -908,7 +923,7 @@
if (shouldReset) {
resetInternal();
} else if (shouldStop) {
- stopInternal(mInProgressRecording, ERROR_NONE);
+ stopInternal(mInProgressRecording, ERROR_NONE, null);
}
}
@@ -1265,14 +1280,16 @@
Logger.d(TAG,
String.format("Initial data exceeds file size limit %d > %d", firstDataSize,
mFileSizeLimitInBytes));
- onInProgressRecordingInternalError(recordingToStart, ERROR_FILE_SIZE_LIMIT_REACHED);
+ onInProgressRecordingInternalError(recordingToStart,
+ ERROR_FILE_SIZE_LIMIT_REACHED, null);
return;
}
try {
setupMediaMuxer(recordingToStart.getOutputOptions());
} catch (IOException e) {
- onInProgressRecordingInternalError(recordingToStart, ERROR_INVALID_OUTPUT_OPTIONS);
+ onInProgressRecordingInternalError(recordingToStart, ERROR_INVALID_OUTPUT_OPTIONS,
+ e);
return;
}
@@ -1298,6 +1315,9 @@
if (options instanceof FileOutputOptions) {
FileOutputOptions fileOutputOptions = (FileOutputOptions) options;
File file = fileOutputOptions.getFile();
+ if (!OutputUtil.createParentFolder(file)) {
+ Logger.w(TAG, "Failed to create folder for " + file.getAbsolutePath());
+ }
mMediaMuxer = new MediaMuxer(file.getAbsolutePath(), muxerOutputFormat);
mOutputUri = Uri.fromFile(file);
} else if (options instanceof FileDescriptorOutputOptions) {
@@ -1335,8 +1355,7 @@
if (path == null) {
throw new IOException("Unable to get path from uri " + mOutputUri);
}
- File parentFile = new File(path).getParentFile();
- if (parentFile != null && !parentFile.mkdirs()) {
+ if (!OutputUtil.createParentFolder(new File(path))) {
Logger.w(TAG, "Failed to create folder for " + path);
}
mMediaMuxer = new MediaMuxer(path, muxerOutputFormat);
@@ -1580,7 +1599,7 @@
new FutureCallback<List<Void>>() {
@Override
public void onSuccess(@Nullable List<Void> result) {
- finalizeInProgressRecording(mRecordingStopError, null);
+ finalizeInProgressRecording(mRecordingStopError, mRecordingStopErrorCause);
}
@Override
@@ -1608,7 +1627,7 @@
Logger.d(TAG,
String.format("Reach file size limit %d > %d", newRecordingBytes,
mFileSizeLimitInBytes));
- onInProgressRecordingInternalError(recording, ERROR_FILE_SIZE_LIMIT_REACHED);
+ onInProgressRecordingInternalError(recording, ERROR_FILE_SIZE_LIMIT_REACHED, null);
return;
}
@@ -1637,7 +1656,7 @@
String.format("Reach file size limit %d > %d",
newRecordingBytes,
mFileSizeLimitInBytes));
- onInProgressRecordingInternalError(recording, ERROR_FILE_SIZE_LIMIT_REACHED);
+ onInProgressRecordingInternalError(recording, ERROR_FILE_SIZE_LIMIT_REACHED, null);
return;
}
@@ -1680,11 +1699,13 @@
@SuppressWarnings("WeakerAccess") /* synthetic accessor */
@ExecutedBy("mSequentialExecutor")
- void stopInternal(@NonNull RecordingRecord recordingToStop, @VideoRecordError int stopError) {
+ void stopInternal(@NonNull RecordingRecord recordingToStop, @VideoRecordError int stopError,
+ @Nullable Throwable errorCause) {
// Only stop recording if recording is in-progress and it is not already stopping.
if (mInProgressRecording == recordingToStop && !mInProgressRecordingStopping) {
mInProgressRecordingStopping = true;
mRecordingStopError = stopError;
+ mRecordingStopErrorCause = errorCause;
if (isAudioEnabled()) {
if (mPendingFirstAudioData != null) {
mPendingFirstAudioData.close();
@@ -1756,8 +1777,7 @@
@SuppressWarnings("WeakerAccess") /* synthetic accessor */
@ExecutedBy("mSequentialExecutor")
- void finalizeInProgressRecording(@VideoRecordError int error,
- @Nullable Throwable throwable) {
+ void finalizeInProgressRecording(@VideoRecordError int error, @Nullable Throwable throwable) {
if (mInProgressRecording == null) {
throw new AssertionError("Attempted to finalize in-progress recording, but no "
+ "recording is in progress.");
@@ -1811,6 +1831,7 @@
mRecordingDurationNs = 0L;
mFirstRecordingVideoDataTimeUs = 0L;
mRecordingStopError = ERROR_UNKNOWN;
+ mRecordingStopErrorCause = null;
mAudioErrorCause = null;
onRecordingFinalized(finalizedRecording);
@@ -1870,10 +1891,10 @@
@ExecutedBy("mSequentialExecutor")
void onInProgressRecordingInternalError(@NonNull RecordingRecord recording,
- @VideoRecordError int error) {
+ @VideoRecordError int error, @Nullable Throwable cause) {
if (recording != mInProgressRecording) {
throw new AssertionError("Internal error occurred on recording that is not the current "
- + "in-progress recorindg.");
+ + "in-progress recording.");
}
boolean needsStop = false;
@@ -1909,7 +1930,7 @@
}
if (needsStop) {
- stopInternal(recording, error);
+ stopInternal(recording, error, cause);
}
}
diff --git a/camera/camera-video/src/main/java/androidx/camera/video/VideoRecordEvent.java b/camera/camera-video/src/main/java/androidx/camera/video/VideoRecordEvent.java
index 2811f91..2929766 100644
--- a/camera/camera-video/src/main/java/androidx/camera/video/VideoRecordEvent.java
+++ b/camera/camera-video/src/main/java/androidx/camera/video/VideoRecordEvent.java
@@ -23,7 +23,6 @@
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.RestrictTo;
-import androidx.annotation.RestrictTo.Scope;
import androidx.core.util.Consumer;
import androidx.core.util.Preconditions;
@@ -38,33 +37,46 @@
* be sent to the listener set in {@link PendingRecording#withEventListener(Executor, Consumer)}.
*
* <p>There are {@link Start}, {@link Finalize}, {@link Status}, {@link Pause} and {@link Resume}
- * events. The {@link #getEventType()} can be used to check what type of event is.
+ * events.
*
- * Example: typical way to determine the event type and cast to the event class
+ * <p>Example: Below is the typical way to determine the event type and cast to the event class, if
+ * needed.
*
* <pre>{@code
*
- * VideoRecordEvent videoRecordEvent = obtainVideoRecordEvent();
- * switch (videoRecordEvent.getEventType()) {
- * case VideoRecordEvent.EVENT_TYPE_START:
- * VideoRecordEvent.Start start = (VideoRecordEvent.Start) videoRecordEvent;
- * break;
- * case VideoRecordEvent.EVENT_TYPE_FINALIZE:
- * VideoRecordEvent.Finalize finalize = (VideoRecordEvent.Finalize) videoRecordEvent;
- * break;
- * case VideoRecordEvent.EVENT_TYPE_STATUS:
- * VideoRecordEvent.Status status = (VideoRecordEvent.Status) videoRecordEvent;
- * break;
- * case VideoRecordEvent.EVENT_TYPE_PAUSE:
- * VideoRecordEvent.Pause pause = (VideoRecordEvent.Pause) videoRecordEvent;
- * break;
- * case VideoRecordEvent.EVENT_TYPE_RESUME:
- * VideoRecordEvent.Resume resume = (VideoRecordEvent.Resume) videoRecordEvent;
- * break;
- * }
+ * ActiveRecording activeRecording = recorder.prepareRecording(context, outputOptions)
+ * .withEventListener(ContextCompat.getMainExecutor(context), videoRecordEvent -> {
+ * if (videoRecordEvent instanceof VideoRecordEvent.Start) {
+ * // Handle the start of a new active recording
+ * ...
+ * } else if (videoRecordEvent instanceof VideoRecordEvent.Pause) {
+ * // Handle the case where the active recording is paused
+ * ...
+ * } else if (videoRecordEvent instanceof VideoRecordEvent.Resume) {
+ * // Handles the case where the active recording is resumed
+ * ...
+ * } else if (videoRecordEvent instanceof VideoRecordEvent.Finalize) {
+ * VideoRecordEvent.Finalize finalizeEvent =
+ * (VideoRecordEvent.Finalize) videoRecordEvent;
+ * // Handles a finalize event for the active recording, checking Finalize.getError()
+ * int error = finalizeEvent.getError();
+ * if (error != Finalize.ERROR_NONE) {
+ * ...
+ * }
+ * }
+ *
+ * // All events, including VideoRecordEvent.Status, contain RecordingStats.
+ * // This can be used to update the UI or track the recording duration.
+ * RecordingStats recordingStats = videoRecordEvent.getRecordingStats();
+ * ...
+ * }).start();
*
* }</pre>
*
+ * <p>If using Kotlin, the VideoRecordEvent class can be treated similar to a {@code sealed
+ * class}. In Kotlin, it is recommended to use a {@code when} expression rather than an {@code
+ * if}-{@code else if} chain as in the above example.
+ *
* <p>When a video recording is requested, {@link Start} event will be reported at first and
* {@link Finalize} event will be reported when the recording is finished. The stop reason can be
* obtained via {@link Finalize#getError()}. {@link Finalize#ERROR_NONE} means that the video was
@@ -79,49 +91,6 @@
*/
public abstract class VideoRecordEvent {
- /**
- * Indicates the start of recording.
- *
- * @see Start
- */
- public static final int EVENT_TYPE_START = 0;
-
- /**
- * Indicates the finalization of recording.
- *
- * @see Finalize
- */
- public static final int EVENT_TYPE_FINALIZE = 1;
-
- /**
- * The status report of the recording in progress.
- *
- * @see Status
- */
- public static final int EVENT_TYPE_STATUS = 2;
-
- /**
- * Indicates the pause event of recording.
- *
- * @see Pause
- */
- public static final int EVENT_TYPE_PAUSE = 3;
-
- /**
- * Indicates the resume event of recording.
- *
- * @see Resume
- */
- public static final int EVENT_TYPE_RESUME = 4;
-
- /** @hide */
- @IntDef({EVENT_TYPE_START, EVENT_TYPE_FINALIZE, EVENT_TYPE_STATUS, EVENT_TYPE_PAUSE,
- EVENT_TYPE_RESUME})
- @Retention(RetentionPolicy.SOURCE)
- @RestrictTo(Scope.LIBRARY)
- public @interface EventType {
- }
-
private final OutputOptions mOutputOptions;
private final RecordingStats mRecordingStats;
@@ -134,15 +103,6 @@
}
/**
- * Gets the event type.
- *
- * <p>Possible values are {@link #EVENT_TYPE_START}, {@link #EVENT_TYPE_FINALIZE},
- * {@link #EVENT_TYPE_PAUSE}, {@link #EVENT_TYPE_RESUME} and {@link #EVENT_TYPE_STATUS}.
- */
- @EventType
- public abstract int getEventType();
-
- /**
* Gets the recording status of current event.
*/
@NonNull
@@ -176,13 +136,6 @@
Start(@NonNull OutputOptions outputOptions, @NonNull RecordingStats recordingStats) {
super(outputOptions, recordingStats);
}
-
- /** {@inheritDoc} */
- @EventType
- @Override
- public int getEventType() {
- return EVENT_TYPE_START;
- }
}
@NonNull
@@ -259,7 +212,8 @@
* The recording failed due to invalid output options.
*
* <p>This error is generated when invalid output options have been used while preparing a
- * recording, such as with the {@link Recorder#prepareRecording(MediaStoreOutputOptions)}
+ * recording, such as with the
+ * {@link Recorder#prepareRecording(android.content.Context, MediaStoreOutputOptions)}
* method. The error will depend on the subclass of {@link OutputOptions} used, and more
* information about the error can be retrieved from {@link Finalize#getCause()}.
*/
@@ -324,13 +278,6 @@
mCause = cause;
}
- /** {@inheritDoc} */
- @EventType
- @Override
- public int getEventType() {
- return EVENT_TYPE_FINALIZE;
- }
-
/**
* Gets the {@link OutputResults}.
*/
@@ -389,13 +336,6 @@
Status(@NonNull OutputOptions outputOptions, @NonNull RecordingStats recordingStats) {
super(outputOptions, recordingStats);
}
-
- /** {@inheritDoc} */
- @EventType
- @Override
- public int getEventType() {
- return EVENT_TYPE_STATUS;
- }
}
@NonNull
@@ -415,13 +355,6 @@
Pause(@NonNull OutputOptions outputOptions, @NonNull RecordingStats recordingStats) {
super(outputOptions, recordingStats);
}
-
- /** {@inheritDoc} */
- @EventType
- @Override
- public int getEventType() {
- return EVENT_TYPE_PAUSE;
- }
}
@NonNull
@@ -441,12 +374,5 @@
Resume(@NonNull OutputOptions outputOptions, @NonNull RecordingStats recordingStats) {
super(outputOptions, recordingStats);
}
-
- /** {@inheritDoc} */
- @EventType
- @Override
- public int getEventType() {
- return EVENT_TYPE_RESUME;
- }
}
}
diff --git a/camera/camera-video/src/main/java/androidx/camera/video/internal/utils/OutputUtil.java b/camera/camera-video/src/main/java/androidx/camera/video/internal/utils/OutputUtil.java
index fa975f8..51cb127 100644
--- a/camera/camera-video/src/main/java/androidx/camera/video/internal/utils/OutputUtil.java
+++ b/camera/camera-video/src/main/java/androidx/camera/video/internal/utils/OutputUtil.java
@@ -24,6 +24,8 @@
import androidx.annotation.Nullable;
import androidx.camera.core.Logger;
+import java.io.File;
+
/**
* Utility class for output related operations.
*/
@@ -61,4 +63,19 @@
}
}
}
+
+ /**
+ * Creates parent folder for the input file.
+ *
+ * @param file the input file to create its parent folder
+ * @return {@code true} if the parent folder already exists or is created successfully.
+ * {@code false} if the existing parent folder path is not a folder or failed to create.
+ */
+ public static boolean createParentFolder(@NonNull File file) {
+ File parentFile = file.getParentFile();
+ if (parentFile == null) {
+ return false;
+ }
+ return parentFile.exists() ? parentFile.isDirectory() : parentFile.mkdirs();
+ }
}
diff --git a/camera/camera-video/src/test/java/androidx/camera/video/VideoRecordEventTest.kt b/camera/camera-video/src/test/java/androidx/camera/video/VideoRecordEventTest.kt
index 71c4d17..8fa89c7 100644
--- a/camera/camera-video/src/test/java/androidx/camera/video/VideoRecordEventTest.kt
+++ b/camera/camera-video/src/test/java/androidx/camera/video/VideoRecordEventTest.kt
@@ -47,7 +47,7 @@
TEST_RECORDING_STATE
)
- assertThat(event.eventType).isEqualTo(VideoRecordEvent.EVENT_TYPE_START)
+ assertThat(event).isInstanceOf(VideoRecordEvent.Start::class.java)
assertThat(event.outputOptions).isEqualTo(TEST_OUTPUT_OPTION)
assertThat(event.recordingStats).isEqualTo(TEST_RECORDING_STATE)
}
@@ -60,7 +60,7 @@
TEST_OUTPUT_RESULT
)
- assertThat(event.eventType).isEqualTo(VideoRecordEvent.EVENT_TYPE_FINALIZE)
+ assertThat(event).isInstanceOf(VideoRecordEvent.Finalize::class.java)
assertThat(event.outputOptions).isEqualTo(TEST_OUTPUT_OPTION)
assertThat(event.recordingStats).isEqualTo(TEST_RECORDING_STATE)
assertThat(event.outputResults).isEqualTo(TEST_OUTPUT_RESULT)
@@ -81,7 +81,7 @@
cause
)
- assertThat(event.eventType).isEqualTo(VideoRecordEvent.EVENT_TYPE_FINALIZE)
+ assertThat(event).isInstanceOf(VideoRecordEvent.Finalize::class.java)
assertThat(event.outputOptions).isEqualTo(TEST_OUTPUT_OPTION)
assertThat(event.recordingStats).isEqualTo(TEST_RECORDING_STATE)
assertThat(event.outputResults).isEqualTo(TEST_OUTPUT_RESULT)
@@ -110,7 +110,7 @@
TEST_RECORDING_STATE
)
- assertThat(event.eventType).isEqualTo(VideoRecordEvent.EVENT_TYPE_STATUS)
+ assertThat(event).isInstanceOf(VideoRecordEvent.Status::class.java)
assertThat(event.outputOptions).isEqualTo(TEST_OUTPUT_OPTION)
assertThat(event.recordingStats).isEqualTo(TEST_RECORDING_STATE)
}
@@ -122,7 +122,7 @@
TEST_RECORDING_STATE
)
- assertThat(event.eventType).isEqualTo(VideoRecordEvent.EVENT_TYPE_PAUSE)
+ assertThat(event).isInstanceOf(VideoRecordEvent.Pause::class.java)
assertThat(event.outputOptions).isEqualTo(TEST_OUTPUT_OPTION)
assertThat(event.recordingStats).isEqualTo(TEST_RECORDING_STATE)
}
@@ -134,7 +134,7 @@
TEST_RECORDING_STATE
)
- assertThat(event.eventType).isEqualTo(VideoRecordEvent.EVENT_TYPE_RESUME)
+ assertThat(event).isInstanceOf(VideoRecordEvent.Resume::class.java)
assertThat(event.outputOptions).isEqualTo(TEST_OUTPUT_OPTION)
assertThat(event.recordingStats).isEqualTo(TEST_RECORDING_STATE)
}
diff --git a/camera/camera-view/api/api_lint.ignore b/camera/camera-view/api/api_lint.ignore
new file mode 100644
index 0000000..c4b7e5f
--- /dev/null
+++ b/camera/camera-view/api/api_lint.ignore
@@ -0,0 +1,9 @@
+// Baseline format: 1.0
+AsyncSuffixFuture: androidx.camera.view.CameraController#enableTorch(boolean):
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
+AsyncSuffixFuture: androidx.camera.view.CameraController#getInitializationFuture():
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
+AsyncSuffixFuture: androidx.camera.view.CameraController#setLinearZoom(float):
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
+AsyncSuffixFuture: androidx.camera.view.CameraController#setZoomRatio(float):
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
diff --git a/camera/integration-tests/coretestapp/src/main/java/androidx/camera/integration/core/CameraXActivity.java b/camera/integration-tests/coretestapp/src/main/java/androidx/camera/integration/core/CameraXActivity.java
index 3c8a8f7a..e29d4a5 100644
--- a/camera/integration-tests/coretestapp/src/main/java/androidx/camera/integration/core/CameraXActivity.java
+++ b/camera/integration-tests/coretestapp/src/main/java/androidx/camera/integration/core/CameraXActivity.java
@@ -383,13 +383,13 @@
// For Android 10 or versions above, use MediaStoreOutputOptions for public
// share media storage.
pendingRecording = getVideoCapture().getOutput()
- .prepareRecording(getNewVideoOutputMediaStoreOptions());
+ .prepareRecording(this, getNewVideoOutputMediaStoreOptions());
} else {
// For Android 9 or versions below, use FileOutputOptions. Can still use
// MediaStoreOutputOptions, but there are some known issues, b/197476455 or
// b/198543058.
pendingRecording = getVideoCapture().getOutput()
- .prepareRecording(getNewVideoOutputFileOptions());
+ .prepareRecording(this, getNewVideoOutputFileOptions());
}
mActiveRecording = pendingRecording.withAudioEnabled()
.withEventListener(ContextCompat.getMainExecutor(CameraXActivity.this),
@@ -477,60 +477,54 @@
private final Consumer<VideoRecordEvent> mVideoRecordEventListener = event -> {
updateRecordingStats(event.getRecordingStats());
- switch (event.getEventType()) {
- case VideoRecordEvent.EVENT_TYPE_FINALIZE:
- VideoRecordEvent.Finalize finalize = (VideoRecordEvent.Finalize) event;
+ if (event instanceof VideoRecordEvent.Finalize) {
+ VideoRecordEvent.Finalize finalize = (VideoRecordEvent.Finalize) event;
- switch (finalize.getError()) {
- case ERROR_NONE:
- case ERROR_FILE_SIZE_LIMIT_REACHED:
- case ERROR_INSUFFICIENT_DISK:
- case ERROR_SOURCE_INACTIVE:
- Uri uri = finalize.getOutputResults().getOutputUri();
- OutputOptions outputOptions = finalize.getOutputOptions();
- String msg;
- String videoFilePath;
- if (outputOptions instanceof MediaStoreOutputOptions) {
- msg = "Saved uri " + uri;
- videoFilePath = getAbsolutePathFromUri(
- getApplicationContext().getContentResolver(),
- uri
- );
- // For OutputOptionsType is OutputOptions.OPTIONS_TYPE_MEDIA_STORE,
- // the Photo/Gallery apps on devices (API Level < Q) sometimes will
- // not show the video files saved in MediaStore, suggest to call
- // scanFile still to force scan the media file.
- // scanVideoOutputFile(new File(videoFilePath));
- } else if (outputOptions instanceof FileOutputOptions) {
- videoFilePath = ((FileOutputOptions) outputOptions)
- .getFile().getAbsolutePath();
- msg = "Saved video file: " + videoFilePath;
- scanVideoOutputFile(new File(videoFilePath));
- } else {
- throw new AssertionError("Unknown or unsupported OutputOptions type: "
- + outputOptions.getClass().getSimpleName());
- }
- // The video file path is used in tracing e2e test log. Don't remove it.
- Log.d(TAG, "Saved video file: " + videoFilePath);
+ switch (finalize.getError()) {
+ case ERROR_NONE:
+ case ERROR_FILE_SIZE_LIMIT_REACHED:
+ case ERROR_INSUFFICIENT_DISK:
+ case ERROR_SOURCE_INACTIVE:
+ Uri uri = finalize.getOutputResults().getOutputUri();
+ OutputOptions outputOptions = finalize.getOutputOptions();
+ String msg;
+ String videoFilePath;
+ if (outputOptions instanceof MediaStoreOutputOptions) {
+ msg = "Saved uri " + uri;
+ videoFilePath = getAbsolutePathFromUri(
+ getApplicationContext().getContentResolver(),
+ uri
+ );
+ // For OutputOptionsType is OutputOptions.OPTIONS_TYPE_MEDIA_STORE,
+ // the Photo/Gallery apps on devices (API Level < Q) sometimes will
+ // not show the video files saved in MediaStore, suggest to call
+ // scanFile still to force scan the media file.
+ // scanVideoOutputFile(new File(videoFilePath));
+ } else if (outputOptions instanceof FileOutputOptions) {
+ videoFilePath = ((FileOutputOptions) outputOptions)
+ .getFile().getAbsolutePath();
+ msg = "Saved video file: " + videoFilePath;
+ scanVideoOutputFile(new File(videoFilePath));
+ } else {
+ throw new AssertionError("Unknown or unsupported OutputOptions type: "
+ + outputOptions.getClass().getSimpleName());
+ }
+ // The video file path is used in tracing e2e test log. Don't remove it.
+ Log.d(TAG, "Saved video file: " + videoFilePath);
- if (finalize.getError() != ERROR_NONE) {
- msg += " with code (" + finalize.getError() + ")";
- }
- Log.d(TAG, msg, finalize.getCause());
- Toast.makeText(CameraXActivity.this, msg, Toast.LENGTH_LONG).show();
- break;
- default:
- String errMsg = "Video capture failed by (" + finalize.getError() + "): "
- + finalize.getCause();
- Log.e(TAG, errMsg, finalize.getCause());
- Toast.makeText(CameraXActivity.this, errMsg, Toast.LENGTH_LONG).show();
- }
- mRecordUi.setState(RecordUi.State.IDLE);
- break;
-
- default:
- // No-op
- break;
+ if (finalize.getError() != ERROR_NONE) {
+ msg += " with code (" + finalize.getError() + ")";
+ }
+ Log.d(TAG, msg, finalize.getCause());
+ Toast.makeText(CameraXActivity.this, msg, Toast.LENGTH_LONG).show();
+ break;
+ default:
+ String errMsg = "Video capture failed by (" + finalize.getError() + "): "
+ + finalize.getCause();
+ Log.e(TAG, errMsg, finalize.getCause());
+ Toast.makeText(CameraXActivity.this, errMsg, Toast.LENGTH_LONG).show();
+ }
+ mRecordUi.setState(RecordUi.State.IDLE);
}
};
diff --git a/car/app/app-automotive/src/main/res/drawable/car_app_no_content_view_focus_ring.xml b/car/app/app-automotive/src/main/res/drawable/car_app_no_content_view_focus_ring.xml
index ffddef4..4eeaeb4 100644
--- a/car/app/app-automotive/src/main/res/drawable/car_app_no_content_view_focus_ring.xml
+++ b/car/app/app-automotive/src/main/res/drawable/car_app_no_content_view_focus_ring.xml
@@ -14,22 +14,22 @@
limitations under the License.
-->
<inset xmlns:android="http://schemas.android.com/apk/res/android"
- android:inset="@dimen/car_app_no_content_view_focus_ring_padding">
+ android:inset="@dimen/car_app_automotive_no_content_view_focus_ring_padding">
<selector>
<item android:state_hovered="true" android:state_window_focused="true">
<shape android:shape="rectangle">
<stroke
- android:width="@dimen/car_app_focus_ring_stroke_width_hovered"
+ android:width="@dimen/car_app_automotive_focus_ring_stroke_width_hovered"
android:color="@color/default_focus_no_content"/>
- <corners android:radius="@dimen/car_app_default_no_content_focus_background_corner_radius"/>
+ <corners android:radius="@dimen/car_app_automotive_default_no_content_focus_background_corner_radius"/>
</shape>
</item>
<item android:state_focused="true" android:state_window_focused="true">
<shape android:shape="rectangle">
<stroke
- android:width="@dimen/car_app_default_focus_ring_stroke_width_focused"
+ android:width="@dimen/car_app_automotive_default_focus_ring_stroke_width_focused"
android:color="@color/default_focus_no_content"/>
- <corners android:radius="@dimen/car_app_default_no_content_focus_background_corner_radius"/>
+ <corners android:radius="@dimen/car_app_automotive_default_no_content_focus_background_corner_radius"/>
</shape>
</item>
</selector>
diff --git a/car/app/app-automotive/src/main/res/layout/error_message_view.xml b/car/app/app-automotive/src/main/res/layout/error_message_view.xml
index 6af3c3c..d5c47cd 100644
--- a/car/app/app-automotive/src/main/res/layout/error_message_view.xml
+++ b/car/app/app-automotive/src/main/res/layout/error_message_view.xml
@@ -39,8 +39,8 @@
<ImageView
android:id="@+id/message_icon"
- android:layout_width="@dimen/car_app_icon_size"
- android:layout_height="@dimen/car_app_icon_size"
+ android:layout_width="@dimen/car_app_automotive_icon_size"
+ android:layout_height="@dimen/car_app_automotive_icon_size"
android:src="@drawable/car_app_icon_error"
tools:ignore="ContentDescription" />
@@ -49,19 +49,19 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
- android:layout_marginTop="@dimen/car_app_default_padding_4"
+ android:layout_marginTop="@dimen/car_app_automotive_default_padding_4"
android:foreground="@drawable/car_app_no_content_view_focus_ring"
- android:textSize="@dimen/car_app_error_message_font_size" />
+ android:textSize="@dimen/car_app_automotive_error_message_font_size" />
<Button
android:id="@+id/action_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:layout_marginTop="@dimen/car_app_default_padding_5"
+ android:layout_marginTop="@dimen/car_app_automotive_default_padding_5"
android:background="@drawable/car_app_rounded_corner"
android:backgroundTint="@color/action_button"
android:textColor="@color/default_white"
- android:textSize="@dimen/car_app_error_message_font_size" />
+ android:textSize="@dimen/car_app_automotive_error_message_font_size" />
</LinearLayout>
</FrameLayout>
</androidx.car.app.activity.ui.ErrorMessageView>
\ No newline at end of file
diff --git a/car/app/app-automotive/src/main/res/layout/loading_view.xml b/car/app/app-automotive/src/main/res/layout/loading_view.xml
index 6762493..1dfc710 100644
--- a/car/app/app-automotive/src/main/res/layout/loading_view.xml
+++ b/car/app/app-automotive/src/main/res/layout/loading_view.xml
@@ -28,8 +28,8 @@
android:orientation="vertical">
<ImageView
android:id="@+id/app_icon"
- android:layout_width="@dimen/car_app_icon_size"
- android:layout_height="@dimen/car_app_icon_size"
+ android:layout_width="@dimen/car_app_automotive_icon_size"
+ android:layout_height="@dimen/car_app_automotive_icon_size"
android:layout_gravity="center_horizontal"/>
</LinearLayout>
</androidx.car.app.activity.ui.LoadingView>
\ No newline at end of file
diff --git a/car/app/app-automotive/src/main/res/values/dimens.xml b/car/app/app-automotive/src/main/res/values/dimens.xml
index 83e3f83..8f4e501 100644
--- a/car/app/app-automotive/src/main/res/values/dimens.xml
+++ b/car/app/app-automotive/src/main/res/values/dimens.xml
@@ -15,16 +15,16 @@
-->
<resources>
- <dimen name="car_app_default_padding_4">24dp</dimen>
- <dimen name="car_app_default_padding_5">32dp</dimen>
- <dimen name="car_app_default_focus_ring_stroke_width_focused">6dp</dimen>
- <dimen name="car_app_default_no_content_focus_background_corner_radius">16dp</dimen>
+ <dimen name="car_app_automotive_default_padding_4">24dp</dimen>
+ <dimen name="car_app_automotive_default_padding_5">32dp</dimen>
+ <dimen name="car_app_automotive_default_focus_ring_stroke_width_focused">6dp</dimen>
+ <dimen name="car_app_automotive_default_no_content_focus_background_corner_radius">16dp</dimen>
<!-- body2 -->
- <dimen name="car_app_error_message_font_size">28dp</dimen>
+ <dimen name="car_app_automotive_error_message_font_size">28dp</dimen>
- <dimen name="car_app_focus_ring_stroke_width_hovered">4dp</dimen>
- <dimen name="car_app_icon_size">64dp</dimen>
- <dimen name="car_app_no_content_view_focus_ring_padding">24dp</dimen>
- <dimen name="car_app_plain_content_container_padding">-8dp</dimen>
+ <dimen name="car_app_automotive_focus_ring_stroke_width_hovered">4dp</dimen>
+ <dimen name="car_app_automotive_icon_size">64dp</dimen>
+ <dimen name="car_app_automotive_no_content_view_focus_ring_padding">24dp</dimen>
+ <dimen name="car_app_automotive_plain_content_container_padding">-8dp</dimen>
</resources>
\ No newline at end of file
diff --git a/car/app/app-samples/github_gradle.properties b/car/app/app-samples/github_gradle.properties
new file mode 100644
index 0000000..4204531
--- /dev/null
+++ b/car/app/app-samples/github_gradle.properties
@@ -0,0 +1,33 @@
+#
+# 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.
+#
+
+# Properties that are copied from main properties file
+# We set playground properties in two steps:
+# * This file is linked into github_gradle.properties under the project and limited to
+# just copying properties from the androidx properties file without any change.
+# Its integrity is validated as part of the buildOnServer task in AndroidX.
+# (validatePlaygroundGradleProperties task)
+# * Additional settings are in playground.properties which are loaded dynamically
+# This separation is necessary to ensure gradle can read certain properties
+# at configuration time.
+
+android.useAndroidX=true
+# Disable features we do not use
+android.defaults.buildfeatures.aidl=false
+android.defaults.buildfeatures.buildconfig=false
+android.defaults.buildfeatures.renderscript=false
+android.defaults.buildfeatures.resvalues=false
+android.defaults.buildfeatures.shaders=false
diff --git a/car/app/app-samples/showcase/common/src/main/java/androidx/car/app/sample/showcase/common/navigation/routing/ArrivedDemoScreen.java b/car/app/app-samples/showcase/common/src/main/java/androidx/car/app/sample/showcase/common/navigation/routing/ArrivedDemoScreen.java
index a6fb772..78a58f9 100644
--- a/car/app/app-samples/showcase/common/src/main/java/androidx/car/app/sample/showcase/common/navigation/routing/ArrivedDemoScreen.java
+++ b/car/app/app-samples/showcase/common/src/main/java/androidx/car/app/sample/showcase/common/navigation/routing/ArrivedDemoScreen.java
@@ -45,7 +45,7 @@
new CarIcon.Builder(
IconCompat.createWithResource(
getCarContext(),
- R.drawable.ic_local_gas_station_white_48dp))
+ R.drawable.ic_place_white_24dp))
.build())
.build())
.setActionStrip(RoutingDemoModels.getActionStrip(getCarContext(), this::finish))
diff --git a/car/app/app-samples/showcase/common/src/main/java/androidx/car/app/sample/showcase/common/templates/SignInTemplateDemoScreen.java b/car/app/app-samples/showcase/common/src/main/java/androidx/car/app/sample/showcase/common/templates/SignInTemplateDemoScreen.java
index 83263c4..1d4080f 100644
--- a/car/app/app-samples/showcase/common/src/main/java/androidx/car/app/sample/showcase/common/templates/SignInTemplateDemoScreen.java
+++ b/car/app/app-samples/showcase/common/src/main/java/androidx/car/app/sample/showcase/common/templates/SignInTemplateDemoScreen.java
@@ -26,7 +26,6 @@
import androidx.car.app.CarToast;
import androidx.car.app.Screen;
import androidx.car.app.model.Action;
-import androidx.car.app.model.ActionStrip;
import androidx.car.app.model.CarColor;
import androidx.car.app.model.CarIcon;
import androidx.car.app.model.InputCallback;
@@ -174,14 +173,6 @@
.setInstructions("Enter your credentials")
.setHeaderAction(Action.BACK)
.setAdditionalText(mAdditionalText)
- .setActionStrip(
- new ActionStrip.Builder()
- .addAction(
- new Action.Builder()
- .setTitle("Next")
- .setOnClickListener(this::submitUsername)
- .build())
- .build())
.build();
}
diff --git a/car/app/app-samples/showcase/common/src/main/res/drawable/ic_place_white_24dp.xml b/car/app/app-samples/showcase/common/src/main/res/drawable/ic_place_white_24dp.xml
new file mode 100644
index 0000000..1ba39ce
--- /dev/null
+++ b/car/app/app-samples/showcase/common/src/main/res/drawable/ic_place_white_24dp.xml
@@ -0,0 +1,25 @@
+<!--
+ Copyright 2021 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+ -->
+
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+ android:width="24dp"
+ android:height="24dp"
+ android:viewportWidth="24"
+ android:viewportHeight="24">
+ <path
+ android:pathData="M12,12c-1.1,0 -2,-0.9 -2,-2s0.9,-2 2,-2 2,0.9 2,2 -0.9,2 -2,2zM18,10.2C18,6.57 15.35,4 12,4s-6,2.57 -6,6.2c0,2.34 1.95,5.44 6,9.14 4.05,-3.7 6,-6.8 6,-9.14zM12,2c4.2,0 8,3.22 8,8.2 0,3.32 -2.67,7.25 -8,11.8 -5.33,-4.55 -8,-8.48 -8,-11.8C4,5.22 7.8,2 12,2z"
+ android:fillColor="#FFFFFF"/>
+</vector>
diff --git a/car/app/app/api/public_plus_experimental_1.1.0-beta02.txt b/car/app/app/api/public_plus_experimental_1.1.0-beta02.txt
index e43b6f474..d688300 100644
--- a/car/app/app/api/public_plus_experimental_1.1.0-beta02.txt
+++ b/car/app/app/api/public_plus_experimental_1.1.0-beta02.txt
@@ -1200,6 +1200,8 @@
method public androidx.car.app.model.ActionStrip? getActionStrip();
method public androidx.car.app.model.Action? getHeaderAction();
method public androidx.car.app.model.ItemList? getItemList();
+ method @androidx.car.app.annotations.ExperimentalCarApi @androidx.car.app.annotations.RequiresCarApi(4) public androidx.car.app.model.ActionStrip? getMapActionStrip();
+ method @androidx.car.app.annotations.ExperimentalCarApi @androidx.car.app.annotations.RequiresCarApi(4) public androidx.car.app.navigation.model.PanModeDelegate? getPanModeDelegate();
method public androidx.car.app.model.CarText? getTitle();
method public boolean isLoading();
}
@@ -1211,6 +1213,8 @@
method public androidx.car.app.navigation.model.PlaceListNavigationTemplate.Builder setHeaderAction(androidx.car.app.model.Action);
method public androidx.car.app.navigation.model.PlaceListNavigationTemplate.Builder setItemList(androidx.car.app.model.ItemList);
method public androidx.car.app.navigation.model.PlaceListNavigationTemplate.Builder setLoading(boolean);
+ method @androidx.car.app.annotations.ExperimentalCarApi @androidx.car.app.annotations.RequiresCarApi(4) public androidx.car.app.navigation.model.PlaceListNavigationTemplate.Builder setMapActionStrip(androidx.car.app.model.ActionStrip);
+ method @androidx.car.app.annotations.ExperimentalCarApi @androidx.car.app.annotations.RequiresCarApi(4) public androidx.car.app.navigation.model.PlaceListNavigationTemplate.Builder setPanModeListener(androidx.car.app.navigation.model.PanModeListener);
method public androidx.car.app.navigation.model.PlaceListNavigationTemplate.Builder setTitle(CharSequence);
method public androidx.car.app.navigation.model.PlaceListNavigationTemplate.Builder setTitle(androidx.car.app.model.CarText);
}
@@ -1219,7 +1223,9 @@
method public androidx.car.app.model.ActionStrip? getActionStrip();
method public androidx.car.app.model.Action? getHeaderAction();
method public androidx.car.app.model.ItemList? getItemList();
+ method @androidx.car.app.annotations.ExperimentalCarApi @androidx.car.app.annotations.RequiresCarApi(4) public androidx.car.app.model.ActionStrip? getMapActionStrip();
method public androidx.car.app.model.Action? getNavigateAction();
+ method @androidx.car.app.annotations.ExperimentalCarApi @androidx.car.app.annotations.RequiresCarApi(4) public androidx.car.app.navigation.model.PanModeDelegate? getPanModeDelegate();
method public androidx.car.app.model.CarText? getTitle();
method public boolean isLoading();
}
@@ -1231,7 +1237,9 @@
method public androidx.car.app.navigation.model.RoutePreviewNavigationTemplate.Builder setHeaderAction(androidx.car.app.model.Action);
method public androidx.car.app.navigation.model.RoutePreviewNavigationTemplate.Builder setItemList(androidx.car.app.model.ItemList);
method public androidx.car.app.navigation.model.RoutePreviewNavigationTemplate.Builder setLoading(boolean);
+ method @androidx.car.app.annotations.ExperimentalCarApi @androidx.car.app.annotations.RequiresCarApi(4) public androidx.car.app.navigation.model.RoutePreviewNavigationTemplate.Builder setMapActionStrip(androidx.car.app.model.ActionStrip);
method public androidx.car.app.navigation.model.RoutePreviewNavigationTemplate.Builder setNavigateAction(androidx.car.app.model.Action);
+ method @androidx.car.app.annotations.ExperimentalCarApi @androidx.car.app.annotations.RequiresCarApi(4) public androidx.car.app.navigation.model.RoutePreviewNavigationTemplate.Builder setPanModeListener(androidx.car.app.navigation.model.PanModeListener);
method public androidx.car.app.navigation.model.RoutePreviewNavigationTemplate.Builder setTitle(CharSequence);
method public androidx.car.app.navigation.model.RoutePreviewNavigationTemplate.Builder setTitle(androidx.car.app.model.CarText);
}
diff --git a/car/app/app/api/public_plus_experimental_current.txt b/car/app/app/api/public_plus_experimental_current.txt
index e43b6f474..d688300 100644
--- a/car/app/app/api/public_plus_experimental_current.txt
+++ b/car/app/app/api/public_plus_experimental_current.txt
@@ -1200,6 +1200,8 @@
method public androidx.car.app.model.ActionStrip? getActionStrip();
method public androidx.car.app.model.Action? getHeaderAction();
method public androidx.car.app.model.ItemList? getItemList();
+ method @androidx.car.app.annotations.ExperimentalCarApi @androidx.car.app.annotations.RequiresCarApi(4) public androidx.car.app.model.ActionStrip? getMapActionStrip();
+ method @androidx.car.app.annotations.ExperimentalCarApi @androidx.car.app.annotations.RequiresCarApi(4) public androidx.car.app.navigation.model.PanModeDelegate? getPanModeDelegate();
method public androidx.car.app.model.CarText? getTitle();
method public boolean isLoading();
}
@@ -1211,6 +1213,8 @@
method public androidx.car.app.navigation.model.PlaceListNavigationTemplate.Builder setHeaderAction(androidx.car.app.model.Action);
method public androidx.car.app.navigation.model.PlaceListNavigationTemplate.Builder setItemList(androidx.car.app.model.ItemList);
method public androidx.car.app.navigation.model.PlaceListNavigationTemplate.Builder setLoading(boolean);
+ method @androidx.car.app.annotations.ExperimentalCarApi @androidx.car.app.annotations.RequiresCarApi(4) public androidx.car.app.navigation.model.PlaceListNavigationTemplate.Builder setMapActionStrip(androidx.car.app.model.ActionStrip);
+ method @androidx.car.app.annotations.ExperimentalCarApi @androidx.car.app.annotations.RequiresCarApi(4) public androidx.car.app.navigation.model.PlaceListNavigationTemplate.Builder setPanModeListener(androidx.car.app.navigation.model.PanModeListener);
method public androidx.car.app.navigation.model.PlaceListNavigationTemplate.Builder setTitle(CharSequence);
method public androidx.car.app.navigation.model.PlaceListNavigationTemplate.Builder setTitle(androidx.car.app.model.CarText);
}
@@ -1219,7 +1223,9 @@
method public androidx.car.app.model.ActionStrip? getActionStrip();
method public androidx.car.app.model.Action? getHeaderAction();
method public androidx.car.app.model.ItemList? getItemList();
+ method @androidx.car.app.annotations.ExperimentalCarApi @androidx.car.app.annotations.RequiresCarApi(4) public androidx.car.app.model.ActionStrip? getMapActionStrip();
method public androidx.car.app.model.Action? getNavigateAction();
+ method @androidx.car.app.annotations.ExperimentalCarApi @androidx.car.app.annotations.RequiresCarApi(4) public androidx.car.app.navigation.model.PanModeDelegate? getPanModeDelegate();
method public androidx.car.app.model.CarText? getTitle();
method public boolean isLoading();
}
@@ -1231,7 +1237,9 @@
method public androidx.car.app.navigation.model.RoutePreviewNavigationTemplate.Builder setHeaderAction(androidx.car.app.model.Action);
method public androidx.car.app.navigation.model.RoutePreviewNavigationTemplate.Builder setItemList(androidx.car.app.model.ItemList);
method public androidx.car.app.navigation.model.RoutePreviewNavigationTemplate.Builder setLoading(boolean);
+ method @androidx.car.app.annotations.ExperimentalCarApi @androidx.car.app.annotations.RequiresCarApi(4) public androidx.car.app.navigation.model.RoutePreviewNavigationTemplate.Builder setMapActionStrip(androidx.car.app.model.ActionStrip);
method public androidx.car.app.navigation.model.RoutePreviewNavigationTemplate.Builder setNavigateAction(androidx.car.app.model.Action);
+ method @androidx.car.app.annotations.ExperimentalCarApi @androidx.car.app.annotations.RequiresCarApi(4) public androidx.car.app.navigation.model.RoutePreviewNavigationTemplate.Builder setPanModeListener(androidx.car.app.navigation.model.PanModeListener);
method public androidx.car.app.navigation.model.RoutePreviewNavigationTemplate.Builder setTitle(CharSequence);
method public androidx.car.app.navigation.model.RoutePreviewNavigationTemplate.Builder setTitle(androidx.car.app.model.CarText);
}
diff --git a/car/app/app/src/main/java/androidx/car/app/model/constraints/ActionsConstraints.java b/car/app/app/src/main/java/androidx/car/app/model/constraints/ActionsConstraints.java
index b2ac358..0675d63 100644
--- a/car/app/app/src/main/java/androidx/car/app/model/constraints/ActionsConstraints.java
+++ b/car/app/app/src/main/java/androidx/car/app/model/constraints/ActionsConstraints.java
@@ -93,12 +93,12 @@
.build();
/**
- * Constraints for map action buttons in navigation templates.
+ * Constraints for map action buttons.
*
* <p>Only buttons with icons are allowed.
*/
@NonNull
- public static final ActionsConstraints ACTIONS_CONSTRAINTS_NAVIGATION_MAP =
+ public static final ActionsConstraints ACTIONS_CONSTRAINTS_MAP =
new ActionsConstraints.Builder(ACTIONS_CONSTRAINTS_CONSERVATIVE)
.setMaxActions(4)
.build();
diff --git a/car/app/app/src/main/java/androidx/car/app/navigation/model/NavigationTemplate.java b/car/app/app/src/main/java/androidx/car/app/navigation/model/NavigationTemplate.java
index a95b950..d157202 100644
--- a/car/app/app/src/main/java/androidx/car/app/navigation/model/NavigationTemplate.java
+++ b/car/app/app/src/main/java/androidx/car/app/navigation/model/NavigationTemplate.java
@@ -16,8 +16,8 @@
package androidx.car.app.navigation.model;
+import static androidx.car.app.model.constraints.ActionsConstraints.ACTIONS_CONSTRAINTS_MAP;
import static androidx.car.app.model.constraints.ActionsConstraints.ACTIONS_CONSTRAINTS_NAVIGATION;
-import static androidx.car.app.model.constraints.ActionsConstraints.ACTIONS_CONSTRAINTS_NAVIGATION_MAP;
import static androidx.car.app.model.constraints.CarColorConstraints.UNCONSTRAINED;
import static java.util.Objects.requireNonNull;
@@ -283,7 +283,6 @@
@Nullable
PanModeDelegate mPanModeDelegate;
-
/**
* Sets the navigation information to display on the template.
*
@@ -375,7 +374,7 @@
@RequiresCarApi(2)
@NonNull
public Builder setMapActionStrip(@NonNull ActionStrip actionStrip) {
- ACTIONS_CONSTRAINTS_NAVIGATION_MAP.validateOrThrow(
+ ACTIONS_CONSTRAINTS_MAP.validateOrThrow(
requireNonNull(actionStrip).getActions());
mMapActionStrip = actionStrip;
return this;
diff --git a/car/app/app/src/main/java/androidx/car/app/navigation/model/PlaceListNavigationTemplate.java b/car/app/app/src/main/java/androidx/car/app/navigation/model/PlaceListNavigationTemplate.java
index 5e15393..17c4e8d 100644
--- a/car/app/app/src/main/java/androidx/car/app/navigation/model/PlaceListNavigationTemplate.java
+++ b/car/app/app/src/main/java/androidx/car/app/navigation/model/PlaceListNavigationTemplate.java
@@ -17,17 +17,22 @@
package androidx.car.app.navigation.model;
import static androidx.car.app.model.constraints.ActionsConstraints.ACTIONS_CONSTRAINTS_HEADER;
+import static androidx.car.app.model.constraints.ActionsConstraints.ACTIONS_CONSTRAINTS_MAP;
import static androidx.car.app.model.constraints.ActionsConstraints.ACTIONS_CONSTRAINTS_SIMPLE;
import static androidx.car.app.model.constraints.RowListConstraints.ROW_LIST_CONSTRAINTS_SIMPLE;
import static java.util.Objects.requireNonNull;
+import android.annotation.SuppressLint;
+
import androidx.annotation.Keep;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.car.app.Screen;
import androidx.car.app.SurfaceCallback;
import androidx.car.app.annotations.CarProtocol;
+import androidx.car.app.annotations.ExperimentalCarApi;
+import androidx.car.app.annotations.RequiresCarApi;
import androidx.car.app.model.Action;
import androidx.car.app.model.ActionStrip;
import androidx.car.app.model.CarText;
@@ -84,6 +89,12 @@
@Keep
@Nullable
private final ActionStrip mActionStrip;
+ @Keep
+ @Nullable
+ private final ActionStrip mMapActionStrip;
+ @Keep
+ @Nullable
+ private final PanModeDelegate mPanModeDelegate;
/**
* Returns the title of the template or {@code null} if not set.
@@ -117,6 +128,29 @@
}
/**
+ * Returns the map {@link ActionStrip} for this template or {@code null} if not set.
+ *
+ * @see Builder#setMapActionStrip(ActionStrip)
+ */
+ @ExperimentalCarApi
+ @RequiresCarApi(4)
+ @Nullable
+ public ActionStrip getMapActionStrip() {
+ return mMapActionStrip;
+ }
+
+ /**
+ * Returns the {@link PanModeDelegate} that should be called when the user interacts with
+ * pan mode on this template, or {@code null} if a {@link PanModeListener} was not set.
+ */
+ @ExperimentalCarApi
+ @RequiresCarApi(4)
+ @Nullable
+ public PanModeDelegate getPanModeDelegate() {
+ return mPanModeDelegate;
+ }
+
+ /**
* Returns whether the template is loading.
*
* @see Builder#setLoading(boolean)
@@ -144,7 +178,8 @@
@Override
public int hashCode() {
- return Objects.hash(mTitle, mIsLoading, mItemList, mHeaderAction, mActionStrip);
+ return Objects.hash(mTitle, mIsLoading, mItemList, mHeaderAction, mActionStrip,
+ mMapActionStrip, mPanModeDelegate == null);
}
@Override
@@ -161,7 +196,9 @@
&& Objects.equals(mTitle, otherTemplate.mTitle)
&& Objects.equals(mItemList, otherTemplate.mItemList)
&& Objects.equals(mHeaderAction, otherTemplate.mHeaderAction)
- && Objects.equals(mActionStrip, otherTemplate.mActionStrip);
+ && Objects.equals(mActionStrip, otherTemplate.mActionStrip)
+ && Objects.equals(mMapActionStrip, otherTemplate.mMapActionStrip)
+ && Objects.equals(mPanModeDelegate == null, otherTemplate.mPanModeDelegate == null);
}
PlaceListNavigationTemplate(Builder builder) {
@@ -170,6 +207,8 @@
mItemList = builder.mItemList;
mHeaderAction = builder.mHeaderAction;
mActionStrip = builder.mActionStrip;
+ mMapActionStrip = builder.mMapActionStrip;
+ mPanModeDelegate = builder.mPanModeDelegate;
}
/** Constructs an empty instance, used by serialization code. */
@@ -179,6 +218,8 @@
mItemList = null;
mHeaderAction = null;
mActionStrip = null;
+ mMapActionStrip = null;
+ mPanModeDelegate = null;
}
/** A builder of {@link PlaceListNavigationTemplate}. */
@@ -192,6 +233,10 @@
Action mHeaderAction;
@Nullable
ActionStrip mActionStrip;
+ @Nullable
+ ActionStrip mMapActionStrip;
+ @Nullable
+ PanModeDelegate mPanModeDelegate;
/**
* Sets the title of the template.
@@ -328,6 +373,57 @@
}
/**
+ * Sets an {@link ActionStrip} with a list of map-control related actions for this
+ * template, such as pan or zoom.
+ *
+ * <p>The host will draw the buttons in an area that is associated with map controls.
+ *
+ * <p>If the app does not include the {@link Action#PAN} button in this
+ * {@link ActionStrip}, the app will not receive the user input for panning gestures from
+ * {@link SurfaceCallback} methods, and the host will exit any previously activated pan
+ * mode.
+ *
+ * <h4>Requirements</h4>
+ *
+ * This template allows up to 4 {@link Action}s in its map {@link ActionStrip}. Only
+ * {@link Action}s with icons set via {@link Action.Builder#setIcon} are allowed.
+ *
+ * @throws IllegalArgumentException if {@code actionStrip} does not meet the template's
+ * requirements
+ * @throws NullPointerException if {@code actionStrip} is {@code null}
+ */
+ @ExperimentalCarApi
+ @RequiresCarApi(4)
+ @NonNull
+ public Builder setMapActionStrip(@NonNull ActionStrip actionStrip) {
+ ACTIONS_CONSTRAINTS_MAP.validateOrThrow(
+ requireNonNull(actionStrip).getActions());
+ mMapActionStrip = actionStrip;
+ return this;
+ }
+
+ /**
+ * Sets a {@link PanModeListener} that notifies when the user enters and exits
+ * the pan mode.
+ *
+ * <p>If the app does not include the {@link Action#PAN} button in the map
+ * {@link ActionStrip}, the app will not receive the user input for panning gestures from
+ * {@link SurfaceCallback} methods, and the host will exit any previously activated pan
+ * mode.
+ *
+ * @throws NullPointerException if {@code panModeListener} is {@code null}
+ */
+ @SuppressLint({"MissingGetterMatchingBuilder", "ExecutorRegistration"})
+ @ExperimentalCarApi
+ @RequiresCarApi(4)
+ @NonNull
+ public Builder setPanModeListener(@NonNull PanModeListener panModeListener) {
+ requireNonNull(panModeListener);
+ mPanModeDelegate = PanModeDelegateImpl.create(panModeListener);
+ return this;
+ }
+
+ /**
* Constructs the template defined by this builder.
*
* <h4>Requirements</h4>
diff --git a/car/app/app/src/main/java/androidx/car/app/navigation/model/RoutePreviewNavigationTemplate.java b/car/app/app/src/main/java/androidx/car/app/navigation/model/RoutePreviewNavigationTemplate.java
index 47d711d..5077063 100644
--- a/car/app/app/src/main/java/androidx/car/app/navigation/model/RoutePreviewNavigationTemplate.java
+++ b/car/app/app/src/main/java/androidx/car/app/navigation/model/RoutePreviewNavigationTemplate.java
@@ -17,17 +17,22 @@
package androidx.car.app.navigation.model;
import static androidx.car.app.model.constraints.ActionsConstraints.ACTIONS_CONSTRAINTS_HEADER;
+import static androidx.car.app.model.constraints.ActionsConstraints.ACTIONS_CONSTRAINTS_MAP;
import static androidx.car.app.model.constraints.ActionsConstraints.ACTIONS_CONSTRAINTS_SIMPLE;
import static androidx.car.app.model.constraints.RowListConstraints.ROW_LIST_CONSTRAINTS_ROUTE_PREVIEW;
import static java.util.Objects.requireNonNull;
+import android.annotation.SuppressLint;
+
import androidx.annotation.Keep;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.car.app.Screen;
import androidx.car.app.SurfaceCallback;
import androidx.car.app.annotations.CarProtocol;
+import androidx.car.app.annotations.ExperimentalCarApi;
+import androidx.car.app.annotations.RequiresCarApi;
import androidx.car.app.model.Action;
import androidx.car.app.model.ActionStrip;
import androidx.car.app.model.CarText;
@@ -97,6 +102,12 @@
@Keep
@Nullable
private final ActionStrip mActionStrip;
+ @Keep
+ @Nullable
+ private final ActionStrip mMapActionStrip;
+ @Keep
+ @Nullable
+ private final PanModeDelegate mPanModeDelegate;
/**
* Returns the title of the template or {@code null} if not set.
@@ -130,6 +141,29 @@
}
/**
+ * Returns the map {@link ActionStrip} for this template or {@code null} if not set.
+ *
+ * @see Builder#setMapActionStrip(ActionStrip)
+ */
+ @ExperimentalCarApi
+ @RequiresCarApi(4)
+ @Nullable
+ public ActionStrip getMapActionStrip() {
+ return mMapActionStrip;
+ }
+
+ /**
+ * Returns the {@link PanModeDelegate} that should be called when the user interacts with
+ * pan mode on this template, or {@code null} if a {@link PanModeListener} was not set.
+ */
+ @ExperimentalCarApi
+ @RequiresCarApi(4)
+ @Nullable
+ public PanModeDelegate getPanModeDelegate() {
+ return mPanModeDelegate;
+ }
+
+ /**
* Returns whether the template is loading.
*
* @see Builder#setLoading(boolean)
@@ -169,7 +203,7 @@
@Override
public int hashCode() {
return Objects.hash(mTitle, mIsLoading, mNavigateAction, mItemList, mHeaderAction,
- mActionStrip);
+ mActionStrip, mMapActionStrip, mPanModeDelegate == null);
}
@Override
@@ -187,7 +221,9 @@
&& Objects.equals(mNavigateAction, otherTemplate.mNavigateAction)
&& Objects.equals(mItemList, otherTemplate.mItemList)
&& Objects.equals(mHeaderAction, otherTemplate.mHeaderAction)
- && Objects.equals(mActionStrip, otherTemplate.mActionStrip);
+ && Objects.equals(mActionStrip, otherTemplate.mActionStrip)
+ && Objects.equals(mMapActionStrip, otherTemplate.mMapActionStrip)
+ && Objects.equals(mPanModeDelegate == null, otherTemplate.mPanModeDelegate == null);
}
RoutePreviewNavigationTemplate(Builder builder) {
@@ -197,6 +233,8 @@
mItemList = builder.mItemList;
mHeaderAction = builder.mHeaderAction;
mActionStrip = builder.mActionStrip;
+ mMapActionStrip = builder.mMapActionStrip;
+ mPanModeDelegate = builder.mPanModeDelegate;
}
/** Constructs an empty instance, used by serialization code. */
@@ -207,6 +245,8 @@
mItemList = null;
mHeaderAction = null;
mActionStrip = null;
+ mMapActionStrip = null;
+ mPanModeDelegate = null;
}
/** A builder of {@link RoutePreviewNavigationTemplate}. */
@@ -222,6 +262,10 @@
Action mHeaderAction;
@Nullable
ActionStrip mActionStrip;
+ @Nullable
+ ActionStrip mMapActionStrip;
+ @Nullable
+ PanModeDelegate mPanModeDelegate;
/**
* Sets the title of the template.
@@ -379,6 +423,57 @@
}
/**
+ * Sets an {@link ActionStrip} with a list of map-control related actions for this
+ * template, such as pan or zoom.
+ *
+ * <p>The host will draw the buttons in an area that is associated with map controls.
+ *
+ * <p>If the app does not include the {@link Action#PAN} button in this
+ * {@link ActionStrip}, the app will not receive the user input for panning gestures from
+ * {@link SurfaceCallback} methods, and the host will exit any previously activated pan
+ * mode.
+ *
+ * <h4>Requirements</h4>
+ *
+ * This template allows up to 4 {@link Action}s in its map {@link ActionStrip}. Only
+ * {@link Action}s with icons set via {@link Action.Builder#setIcon} are allowed.
+ *
+ * @throws IllegalArgumentException if {@code actionStrip} does not meet the template's
+ * requirements
+ * @throws NullPointerException if {@code actionStrip} is {@code null}
+ */
+ @ExperimentalCarApi
+ @RequiresCarApi(4)
+ @NonNull
+ public Builder setMapActionStrip(@NonNull ActionStrip actionStrip) {
+ ACTIONS_CONSTRAINTS_MAP.validateOrThrow(
+ requireNonNull(actionStrip).getActions());
+ mMapActionStrip = actionStrip;
+ return this;
+ }
+
+ /**
+ * Sets a {@link PanModeListener} that notifies when the user enters and exits
+ * the pan mode.
+ *
+ * <p>If the app does not include the {@link Action#PAN} button in the map
+ * {@link ActionStrip}, the app will not receive the user input for panning gestures from
+ * {@link SurfaceCallback} methods, and the host will exit any previously activated pan
+ * mode.
+ *
+ * @throws NullPointerException if {@code panModeListener} is {@code null}
+ */
+ @SuppressLint({"MissingGetterMatchingBuilder", "ExecutorRegistration"})
+ @ExperimentalCarApi
+ @RequiresCarApi(4)
+ @NonNull
+ public Builder setPanModeListener(@NonNull PanModeListener panModeListener) {
+ requireNonNull(panModeListener);
+ mPanModeDelegate = PanModeDelegateImpl.create(panModeListener);
+ return this;
+ }
+
+ /**
* Constructs the template defined by this builder.
*
* <h4>Requirements</h4>
diff --git a/car/app/app/src/main/java/androidx/car/app/validation/HostValidator.java b/car/app/app/src/main/java/androidx/car/app/validation/HostValidator.java
index bc59c2c..2d52162 100644
--- a/car/app/app/src/main/java/androidx/car/app/validation/HostValidator.java
+++ b/car/app/app/src/main/java/androidx/car/app/validation/HostValidator.java
@@ -306,10 +306,10 @@
return false;
}
for (int i = 0; i < packageInfo.requestedPermissionsFlags.length; i++) {
- if (packageInfo.requestedPermissionsFlags[i]
- == PackageInfo.REQUESTED_PERMISSION_GRANTED
- && i < packageInfo.requestedPermissions.length
- && permission.equals(packageInfo.requestedPermissions[i])) {
+ if (((packageInfo.requestedPermissionsFlags[i]
+ & PackageInfo.REQUESTED_PERMISSION_GRANTED) != 0)
+ && i < packageInfo.requestedPermissions.length
+ && permission.equals(packageInfo.requestedPermissions[i])) {
return true;
}
}
diff --git a/car/app/app/src/test/java/androidx/car/app/navigation/model/PlaceListNavigationTemplateTest.java b/car/app/app/src/test/java/androidx/car/app/navigation/model/PlaceListNavigationTemplateTest.java
index 82764d7..fd43af8 100644
--- a/car/app/app/src/test/java/androidx/car/app/navigation/model/PlaceListNavigationTemplateTest.java
+++ b/car/app/app/src/test/java/androidx/car/app/navigation/model/PlaceListNavigationTemplateTest.java
@@ -52,6 +52,19 @@
private final DistanceSpan mDistanceSpan =
DistanceSpan.create(
Distance.create(/* displayDistance= */ 1, Distance.UNIT_KILOMETERS_P1));
+ private final ActionStrip mActionStrip =
+ new ActionStrip.Builder().addAction(TestUtils.createAction("test", null)).build();
+ private final ActionStrip mMapActionStrip =
+ new ActionStrip.Builder().addAction(
+ TestUtils.createAction(null, TestUtils.getTestCarIcon(
+ ApplicationProvider.getApplicationContext(),
+ "ic_test_1"))).build();
+
+ @Test
+ public void textButtonInMapActionStrip_throws() {
+ assertThrows(IllegalArgumentException.class,
+ () -> new PlaceListNavigationTemplate.Builder().setMapActionStrip(mActionStrip));
+ }
@Test
public void createInstance_emptyList_notLoading_Throws() {
@@ -205,10 +218,12 @@
.setItemList(itemList)
.setTitle(title)
.setActionStrip(actionStrip)
+ .setMapActionStrip(mMapActionStrip)
.build();
assertThat(template.getItemList()).isEqualTo(itemList);
assertThat(template.getActionStrip()).isEqualTo(actionStrip);
assertThat(template.getTitle().toString()).isEqualTo(title);
+ assertThat(template.getMapActionStrip()).isEqualTo(mMapActionStrip);
}
@Test
@@ -324,6 +339,8 @@
TestUtils.createItemListWithDistanceSpan(6, false, mDistanceSpan))
.setHeaderAction(Action.BACK)
.setActionStrip(new ActionStrip.Builder().addAction(Action.BACK).build())
+ .setMapActionStrip(mMapActionStrip)
+ .setPanModeListener((panModechanged) -> {})
.setTitle("title")
.build();
@@ -335,6 +352,8 @@
.setHeaderAction(Action.BACK)
.setActionStrip(
new ActionStrip.Builder().addAction(Action.BACK).build())
+ .setMapActionStrip(mMapActionStrip)
+ .setPanModeListener((panModechanged) -> {})
.setTitle("title")
.build());
}
@@ -398,6 +417,58 @@
}
@Test
+ public void notEquals_differentMapActionStrip() {
+ PlaceListNavigationTemplate template = new PlaceListNavigationTemplate.Builder()
+ .setTitle("Title")
+ .setItemList(
+ TestUtils.createItemListWithDistanceSpan(6, false, mDistanceSpan))
+ .setActionStrip(
+ mActionStrip)
+ .setMapActionStrip(mMapActionStrip)
+ .build();
+
+ assertThat(template)
+ .isNotEqualTo(
+ new PlaceListNavigationTemplate.Builder()
+ .setTitle("Title")
+ .setItemList(
+ TestUtils.createItemListWithDistanceSpan(6, false,
+ mDistanceSpan))
+ .setActionStrip(mActionStrip)
+ .setMapActionStrip(new ActionStrip.Builder().addAction(
+ TestUtils.createAction(null, TestUtils.getTestCarIcon(
+ ApplicationProvider.getApplicationContext(),
+ "ic_test_2"))).build())
+ .build());
+ }
+
+ @Test
+ public void notEquals_panModeListenerChange() {
+ PlaceListNavigationTemplate template = new PlaceListNavigationTemplate.Builder()
+ .setTitle("Title")
+ .setItemList(
+ TestUtils.createItemListWithDistanceSpan(6, false, mDistanceSpan))
+ .setActionStrip(
+ mActionStrip)
+ .setMapActionStrip(mMapActionStrip)
+ .setPanModeListener((panModechanged) -> {
+ })
+ .build();
+
+ assertThat(template)
+ .isNotEqualTo(
+ new PlaceListNavigationTemplate.Builder()
+ .setTitle("Title")
+ .setItemList(
+ TestUtils.createItemListWithDistanceSpan(6, false,
+ mDistanceSpan))
+ .setActionStrip(
+ mActionStrip)
+ .setMapActionStrip(mMapActionStrip)
+ .build());
+ }
+
+ @Test
public void notEquals_differentTitle() {
PlaceListNavigationTemplate template =
new PlaceListNavigationTemplate.Builder()
diff --git a/car/app/app/src/test/java/androidx/car/app/navigation/model/RoutePreviewNavigationTemplateTest.java b/car/app/app/src/test/java/androidx/car/app/navigation/model/RoutePreviewNavigationTemplateTest.java
index 302eec5..5705004 100644
--- a/car/app/app/src/test/java/androidx/car/app/navigation/model/RoutePreviewNavigationTemplateTest.java
+++ b/car/app/app/src/test/java/androidx/car/app/navigation/model/RoutePreviewNavigationTemplateTest.java
@@ -51,6 +51,13 @@
DistanceSpan.create(
Distance.create(/* displayDistance= */ 1, Distance.UNIT_KILOMETERS_P1));
private final Context mContext = ApplicationProvider.getApplicationContext();
+ private final ActionStrip mActionStrip =
+ new ActionStrip.Builder().addAction(TestUtils.createAction("test", null)).build();
+ private final ActionStrip mMapActionStrip =
+ new ActionStrip.Builder().addAction(
+ TestUtils.createAction(null, TestUtils.getTestCarIcon(
+ ApplicationProvider.getApplicationContext(),
+ "ic_test_1"))).build();
@Test
public void createInstance_emptyList_notLoading_Throws() {
@@ -135,6 +142,12 @@
}
@Test
+ public void textButtonInMapActionStrip_throws() {
+ assertThrows(IllegalArgumentException.class,
+ () -> new RoutePreviewNavigationTemplate.Builder().setMapActionStrip(mActionStrip));
+ }
+
+ @Test
public void createInstance() {
ItemList itemList = TestUtils.createItemListWithDistanceSpan(2, true, DISTANCE);
String title = "title";
@@ -145,6 +158,7 @@
.setNavigateAction(
new Action.Builder().setTitle("Navigate").setOnClickListener(() -> {
}).build())
+ .setMapActionStrip(mMapActionStrip)
.build();
assertThat(template.getItemList()).isEqualTo(itemList);
assertThat(template.getTitle().toString()).isEqualTo(title);
@@ -364,6 +378,9 @@
.setNavigateAction(
new Action.Builder().setTitle("drive").setOnClickListener(() -> {
}).build())
+ .setMapActionStrip(mMapActionStrip)
+ .setPanModeListener((panModechanged) -> {
+ })
.build();
assertThat(template)
@@ -379,6 +396,9 @@
new Action.Builder().setTitle("drive").setOnClickListener(
() -> {
}).build())
+ .setMapActionStrip(mMapActionStrip)
+ .setPanModeListener((panModechanged) -> {
+ })
.build());
}
@@ -459,6 +479,70 @@
}
@Test
+ public void notEquals_differentMapActionStrip() {
+ RoutePreviewNavigationTemplate template =
+ new RoutePreviewNavigationTemplate.Builder()
+ .setTitle("Title")
+ .setItemList(TestUtils.createItemListWithDistanceSpan(2, true, DISTANCE))
+ .setActionStrip(new ActionStrip.Builder().addAction(Action.BACK).build())
+ .setNavigateAction(
+ new Action.Builder().setTitle("drive").setOnClickListener(() -> {
+ }).build())
+ .setMapActionStrip(mMapActionStrip)
+ .build();
+
+ assertThat(template)
+ .isNotEqualTo(
+ new RoutePreviewNavigationTemplate.Builder()
+ .setTitle("Title")
+ .setItemList(
+ TestUtils.createItemListWithDistanceSpan(2, true, DISTANCE))
+ .setActionStrip(
+ new ActionStrip.Builder().addAction(
+ Action.APP_ICON).build())
+ .setNavigateAction(
+ new Action.Builder().setTitle("drive").setOnClickListener(
+ () -> {
+ }).build())
+ .setMapActionStrip(new ActionStrip.Builder().addAction(
+ TestUtils.createAction(null, TestUtils.getTestCarIcon(
+ ApplicationProvider.getApplicationContext(),
+ "ic_test_2"))).build())
+ .build());
+ }
+
+ @Test
+ public void notEquals_panModeListenerChange() {
+ RoutePreviewNavigationTemplate template =
+ new RoutePreviewNavigationTemplate.Builder()
+ .setTitle("Title")
+ .setItemList(TestUtils.createItemListWithDistanceSpan(2, true, DISTANCE))
+ .setActionStrip(new ActionStrip.Builder().addAction(Action.BACK).build())
+ .setNavigateAction(
+ new Action.Builder().setTitle("drive").setOnClickListener(() -> {
+ }).build())
+ .setMapActionStrip(mMapActionStrip)
+ .setPanModeListener((panModechanged) -> {
+ })
+ .build();
+
+ assertThat(template)
+ .isNotEqualTo(
+ new RoutePreviewNavigationTemplate.Builder()
+ .setTitle("Title")
+ .setItemList(
+ TestUtils.createItemListWithDistanceSpan(2, true, DISTANCE))
+ .setActionStrip(
+ new ActionStrip.Builder().addAction(Action.BACK).build())
+ .setNavigateAction(
+ new Action.Builder().setTitle("drive").setOnClickListener(
+ () -> {
+ }).build())
+ .setMapActionStrip(mMapActionStrip)
+ .build());
+ }
+
+ @Test
public void notEquals_differentTitle() {
SpannableString title = new SpannableString("Title");
title.setSpan(DISTANCE, 0, 1, 0);
diff --git a/car/app/app/src/test/java/androidx/car/app/validation/HostValidatorTest.java b/car/app/app/src/test/java/androidx/car/app/validation/HostValidatorTest.java
index 6689fa7..92c4f48 100644
--- a/car/app/app/src/test/java/androidx/car/app/validation/HostValidatorTest.java
+++ b/car/app/app/src/test/java/androidx/car/app/validation/HostValidatorTest.java
@@ -195,7 +195,13 @@
packageInfo.signatures = new Signature[] { signature };
if (permission != null) {
packageInfo.requestedPermissions = new String[] { permission };
- packageInfo.requestedPermissionsFlags = new int[] { REQUESTED_PERMISSION_GRANTED };
+
+ // Per PackageParser#generatePackageInfo, a requestedPermissionsFlag for a permission
+ // is (REQUESTED_PERMISSION_REQUIRED | REQUESTED_PERMISSION_GRANTED). Since
+ // REQUESTED_PERMISSION_REQUIRED is deprecated but still used in PackageParser, hard
+ // code the granted flag here.
+ int requestedPermissionGranted = REQUESTED_PERMISSION_GRANTED | 1;
+ packageInfo.requestedPermissionsFlags = new int[] { requestedPermissionGranted };
}
try {
when(mPackageManager.getPackageInfo(anyString(), anyInt())).thenReturn(packageInfo);
diff --git a/compose/compiler/compiler-hosted/integration-tests/src/test/java/androidx/compose/compiler/plugins/kotlin/ComposeMultiPlatformTests.kt b/compose/compiler/compiler-hosted/integration-tests/src/test/java/androidx/compose/compiler/plugins/kotlin/ComposeMultiPlatformTests.kt
index 83c433b..b5b7db5 100644
--- a/compose/compiler/compiler-hosted/integration-tests/src/test/java/androidx/compose/compiler/plugins/kotlin/ComposeMultiPlatformTests.kt
+++ b/compose/compiler/compiler-hosted/integration-tests/src/test/java/androidx/compose/compiler/plugins/kotlin/ComposeMultiPlatformTests.kt
@@ -69,4 +69,38 @@
"""
)
}
+
+ @Test
+ fun testComposableExpectDefaultParameter() = ensureSetup {
+ multiplatform(
+ """
+ import androidx.compose.runtime.Composable
+
+ @Composable
+ expect fun One(param: Int = 0)
+ """,
+ """
+ import androidx.compose.runtime.Composable
+
+ @Composable
+ actual fun One(param: Int) { }
+ """,
+ """
+ final class JvmKt%One%1 extends kotlin/jvm/internal/Lambda implements kotlin/jvm/functions/Function2 {
+ OUTERCLASS JvmKt One (ILandroidx/compose/runtime/Composer;II)V
+ final static INNERCLASS JvmKt%One%1 null null
+ final synthetic I %param
+ final synthetic I %%changed
+ final synthetic I %%default
+ <init>(III)V
+ public final invoke(Landroidx/compose/runtime/Composer;I)V
+ public synthetic bridge invoke(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
+ }
+ public final class JvmKt {
+ final static INNERCLASS JvmKt%One%1 null null
+ public final static One(ILandroidx/compose/runtime/Composer;II)V
+ }
+ """.trimIndent()
+ )
+ }
}
\ No newline at end of file
diff --git a/compose/compiler/compiler-hosted/src/main/java/androidx/compose/compiler/plugins/kotlin/BuildMetrics.kt b/compose/compiler/compiler-hosted/src/main/java/androidx/compose/compiler/plugins/kotlin/BuildMetrics.kt
index 4851232..0b0797b 100644
--- a/compose/compiler/compiler-hosted/src/main/java/androidx/compose/compiler/plugins/kotlin/BuildMetrics.kt
+++ b/compose/compiler/compiler-hosted/src/main/java/androidx/compose/compiler/plugins/kotlin/BuildMetrics.kt
@@ -99,7 +99,8 @@
fun Appendable.appendComposablesCsv()
fun Appendable.appendComposablesTxt()
fun Appendable.appendClassesTxt()
- fun saveTo(directory: String)
+ fun saveMetricsTo(directory: String)
+ fun saveReportsTo(directory: String)
fun makeFunctionMetrics(function: IrFunction): FunctionMetrics
}
@@ -115,7 +116,8 @@
override fun Appendable.appendComposablesCsv() {}
override fun Appendable.appendComposablesTxt() {}
override fun Appendable.appendClassesTxt() {}
- override fun saveTo(directory: String) {}
+ override fun saveMetricsTo(directory: String) {}
+ override fun saveReportsTo(directory: String) {}
override fun makeFunctionMetrics(function: IrFunction): FunctionMetrics = EmptyFunctionMetrics
}
@@ -391,7 +393,7 @@
}
}
- override fun saveTo(directory: String) {
+ override fun saveMetricsTo(directory: String) {
val dir = File(directory)
val prefix = name
.replace('.', '_')
@@ -400,7 +402,14 @@
File(dir, "$prefix-module.json").write {
appendModuleJson()
}
+ }
+ override fun saveReportsTo(directory: String) {
+ val dir = File(directory)
+ val prefix = name
+ .replace('.', '_')
+ .replace("<", "")
+ .replace(">", "")
File(dir, "$prefix-composables.csv").write {
appendComposablesCsv()
}
diff --git a/compose/compiler/compiler-hosted/src/main/java/androidx/compose/compiler/plugins/kotlin/ComposeIrGenerationExtension.kt b/compose/compiler/compiler-hosted/src/main/java/androidx/compose/compiler/plugins/kotlin/ComposeIrGenerationExtension.kt
index 2e21020..c559cb6 100644
--- a/compose/compiler/compiler-hosted/src/main/java/androidx/compose/compiler/plugins/kotlin/ComposeIrGenerationExtension.kt
+++ b/compose/compiler/compiler-hosted/src/main/java/androidx/compose/compiler/plugins/kotlin/ComposeIrGenerationExtension.kt
@@ -48,7 +48,8 @@
private val sourceInformationEnabled: Boolean = true,
private val intrinsicRememberEnabled: Boolean = true,
private val decoysEnabled: Boolean = false,
- private val metricsDestination: String? = null
+ private val metricsDestination: String? = null,
+ private val reportsDestination: String? = null
) : IrGenerationExtension {
var metrics: ModuleMetrics = EmptyModuleMetrics
@OptIn(ObsoleteDescriptorBasedAPI::class)
@@ -69,8 +70,11 @@
// create a symbol remapper to be used across all transforms
val symbolRemapper = ComposableSymbolRemapper()
- if (metricsDestination != null) {
- metrics = ModuleMetricsImpl(moduleFragment.name.asString(), pluginContext)
+ if (metricsDestination != null || reportsDestination != null) {
+ metrics = ModuleMetricsImpl(
+ moduleFragment.name.asString(),
+ pluginContext
+ )
}
ClassStabilityTransformer(
@@ -183,7 +187,10 @@
}
if (metricsDestination != null) {
- metrics.saveTo(metricsDestination)
+ metrics.saveMetricsTo(metricsDestination)
+ }
+ if (reportsDestination != null) {
+ metrics.saveReportsTo(reportsDestination)
}
}
}
diff --git a/compose/compiler/compiler-hosted/src/main/java/androidx/compose/compiler/plugins/kotlin/ComposePlugin.kt b/compose/compiler/compiler-hosted/src/main/java/androidx/compose/compiler/plugins/kotlin/ComposePlugin.kt
index d816b6b..1a7c26a 100644
--- a/compose/compiler/compiler-hosted/src/main/java/androidx/compose/compiler/plugins/kotlin/ComposePlugin.kt
+++ b/compose/compiler/compiler-hosted/src/main/java/androidx/compose/compiler/plugins/kotlin/ComposePlugin.kt
@@ -45,6 +45,8 @@
CompilerConfigurationKey<Boolean>("Include source information in generated code")
val METRICS_DESTINATION_KEY =
CompilerConfigurationKey<String>("Directory to save compose build metrics")
+ val REPORTS_DESTINATION_KEY =
+ CompilerConfigurationKey<String>("Directory to save compose build reports")
val INTRINSIC_REMEMBER_OPTIMIZATION_ENABLED_KEY =
CompilerConfigurationKey<Boolean>("Enable optimization to treat remember as an intrinsic")
val SUPPRESS_KOTLIN_VERSION_COMPATIBILITY_CHECK =
@@ -84,6 +86,13 @@
required = false,
allowMultipleOccurrences = false
)
+ val REPORTS_DESTINATION_OPTION = CliOption(
+ "reportsDestination",
+ "<path>",
+ "Save compose build reports to this folder",
+ required = false,
+ allowMultipleOccurrences = false
+ )
val INTRINSIC_REMEMBER_OPTIMIZATION_ENABLED_OPTION = CliOption(
"intrinsicRemember",
"<true|false>",
@@ -113,6 +122,7 @@
LIVE_LITERALS_V2_ENABLED_OPTION,
SOURCE_INFORMATION_ENABLED_OPTION,
METRICS_DESTINATION_OPTION,
+ REPORTS_DESTINATION_OPTION,
INTRINSIC_REMEMBER_OPTIMIZATION_ENABLED_OPTION,
SUPPRESS_KOTLIN_VERSION_CHECK_ENABLED_OPTION,
DECOYS_ENABLED_OPTION,
@@ -139,6 +149,10 @@
ComposeConfiguration.METRICS_DESTINATION_KEY,
value
)
+ REPORTS_DESTINATION_OPTION -> configuration.put(
+ ComposeConfiguration.REPORTS_DESTINATION_KEY,
+ value
+ )
INTRINSIC_REMEMBER_OPTIMIZATION_ENABLED_OPTION -> configuration.put(
ComposeConfiguration.INTRINSIC_REMEMBER_OPTIMIZATION_ENABLED_KEY,
value == "true"
@@ -224,6 +238,12 @@
).let {
if (it.isBlank()) null else it
}
+ val reportsDestination = configuration.get(
+ ComposeConfiguration.REPORTS_DESTINATION_KEY,
+ ""
+ ).let {
+ if (it.isBlank()) null else it
+ }
StorageComponentContainerContributor.registerExtension(
project,
@@ -252,6 +272,7 @@
intrinsicRememberEnabled = intrinsicRememberEnabled,
decoysEnabled = decoysEnabled,
metricsDestination = metricsDestination,
+ reportsDestination = reportsDestination,
)
)
DescriptorSerializerPlugin.registerExtension(
diff --git a/compose/compiler/compiler-hosted/src/main/java/androidx/compose/compiler/plugins/kotlin/lower/ComposerParamTransformer.kt b/compose/compiler/compiler-hosted/src/main/java/androidx/compose/compiler/plugins/kotlin/lower/ComposerParamTransformer.kt
index af54550..0d7b3ae 100644
--- a/compose/compiler/compiler-hosted/src/main/java/androidx/compose/compiler/plugins/kotlin/lower/ComposerParamTransformer.kt
+++ b/compose/compiler/compiler-hosted/src/main/java/androidx/compose/compiler/plugins/kotlin/lower/ComposerParamTransformer.kt
@@ -31,6 +31,7 @@
import org.jetbrains.kotlin.backend.common.ir.remapTypeParameters
import org.jetbrains.kotlin.backend.jvm.ir.isInlineClassType
import org.jetbrains.kotlin.backend.jvm.ir.isInlineParameter
+import org.jetbrains.kotlin.descriptors.CallableDescriptor
import org.jetbrains.kotlin.descriptors.Modality
import org.jetbrains.kotlin.descriptors.ModuleDescriptor
import org.jetbrains.kotlin.descriptors.PropertyGetterDescriptor
@@ -50,6 +51,7 @@
import org.jetbrains.kotlin.ir.declarations.copyAttributes
import org.jetbrains.kotlin.ir.declarations.impl.IrExternalPackageFragmentImpl
import org.jetbrains.kotlin.ir.declarations.impl.IrFunctionImpl
+import org.jetbrains.kotlin.ir.descriptors.IrBasedDeclarationDescriptor
import org.jetbrains.kotlin.ir.expressions.IrCall
import org.jetbrains.kotlin.ir.expressions.IrConstructorCall
import org.jetbrains.kotlin.ir.expressions.IrExpression
@@ -82,6 +84,7 @@
import org.jetbrains.kotlin.ir.util.functions
import org.jetbrains.kotlin.ir.util.isFakeOverride
import org.jetbrains.kotlin.ir.util.isVararg
+import org.jetbrains.kotlin.ir.util.module
import org.jetbrains.kotlin.ir.util.patchDeclarationParents
import org.jetbrains.kotlin.ir.visitors.IrElementTransformerVoid
import org.jetbrains.kotlin.ir.visitors.acceptVoid
@@ -93,6 +96,7 @@
import org.jetbrains.kotlin.platform.jvm.isJvm
import org.jetbrains.kotlin.resolve.BindingTrace
import org.jetbrains.kotlin.resolve.DescriptorUtils
+import org.jetbrains.kotlin.resolve.multiplatform.ExpectedActualResolver.findCompatibleExpectedForActual
import org.jetbrains.kotlin.util.OperatorNameConventions
import kotlin.math.min
@@ -489,13 +493,17 @@
}
private fun IrFunction.requiresDefaultParameter(): Boolean {
+ val expectDescriptor = expectDescriptor()
// we only add a default mask parameter if one of the parameters has a default
// expression. Note that if this is a "fake override" method, then only the overridden
// symbols will have the default value expressions
return this is IrSimpleFunction && (
- valueParameters.any {
- it.defaultValue != null
- } || overriddenSymbols.any { it.owner.requiresDefaultParameter() }
+ valueParameters.any { it.defaultValue != null } ||
+ (
+ expectDescriptor != null &&
+ expectDescriptor.valueParameters.any { it.declaresDefaultValue() }
+ ) ||
+ overriddenSymbols.any { it.owner.requiresDefaultParameter() }
)
}
@@ -586,7 +594,7 @@
}
// $default[n]
- if (fn.requiresDefaultParameter()) {
+ if (oldFn.requiresDefaultParameter()) {
val defaults = KtxNameConventions.DEFAULT_PARAMETER.identifier
for (i in 0 until defaultParamCount(realParams)) {
fn.addValueParameter(
@@ -686,6 +694,14 @@
return false
}
+ @OptIn(ObsoleteDescriptorBasedAPI::class)
+ private fun IrFunction.expectDescriptor(): CallableDescriptor? =
+ if (descriptor !is IrBasedDeclarationDescriptor<*>) {
+ descriptor.findCompatibleExpectedForActual(module).singleOrNull() as? CallableDescriptor
+ } else {
+ null
+ }
+
/**
* With klibs, composable functions are always deserialized from IR instead of being restored
* into stubs.
diff --git a/compose/desktop/desktop/samples/src/jvmMain/kotlin/androidx/compose/desktop/examples/example1/Main.jvm.kt b/compose/desktop/desktop/samples/src/jvmMain/kotlin/androidx/compose/desktop/examples/example1/Main.jvm.kt
index b855b16..e1d2611 100644
--- a/compose/desktop/desktop/samples/src/jvmMain/kotlin/androidx/compose/desktop/examples/example1/Main.jvm.kt
+++ b/compose/desktop/desktop/samples/src/jvmMain/kotlin/androidx/compose/desktop/examples/example1/Main.jvm.kt
@@ -18,7 +18,6 @@
import androidx.compose.animation.animateColorAsState
import androidx.compose.animation.core.TweenSpec
-import androidx.compose.desktop.DesktopMaterialTheme
import androidx.compose.foundation.ExperimentalDesktopApi
import androidx.compose.foundation.ExperimentalFoundationApi
import androidx.compose.foundation.Image
@@ -91,7 +90,8 @@
import androidx.compose.ui.input.key.isShiftPressed
import androidx.compose.ui.input.key.key
import androidx.compose.ui.input.key.onPreviewKeyEvent
-import androidx.compose.ui.input.pointer.pointerMoveFilter
+import androidx.compose.ui.input.pointer.PointerEventType
+import androidx.compose.ui.input.pointer.pointerInput
import androidx.compose.ui.platform.LocalUriHandler
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.text.Placeholder
@@ -143,7 +143,7 @@
@Composable
private fun FrameWindowScope.App() {
val uriHandler = LocalUriHandler.current
- DesktopMaterialTheme {
+ MaterialTheme {
Scaffold(
topBar = {
TopAppBar(
@@ -346,20 +346,25 @@
" }\n" +
"}",
fontFamily = italicFont,
- modifier = Modifier.padding(10.dp).pointerMoveFilter(
- onMove = {
- overText = "Move position: $it"
- false
- },
- onEnter = {
- overText = "Over enter"
- false
- },
- onExit = {
- overText = "Over exit"
- false
+ modifier = Modifier.padding(10.dp).pointerInput(Unit) {
+ awaitPointerEventScope {
+ while (true) {
+ val event = awaitPointerEvent()
+ val position = event.changes.first().position
+ when (event.type) {
+ PointerEventType.Move -> {
+ overText = "Move position: $position"
+ }
+ PointerEventType.Enter -> {
+ overText = "Over enter"
+ }
+ PointerEventType.Exit -> {
+ overText = "Over exit"
+ }
+ }
+ }
}
- )
+ }
)
}
diff --git a/compose/desktop/desktop/src/jvmMain/kotlin/androidx/compose/desktop/DesktopTheme.jvm.kt b/compose/desktop/desktop/src/jvmMain/kotlin/androidx/compose/desktop/DesktopTheme.jvm.kt
index 1e9d175..1e8384c 100644
--- a/compose/desktop/desktop/src/jvmMain/kotlin/androidx/compose/desktop/DesktopTheme.jvm.kt
+++ b/compose/desktop/desktop/src/jvmMain/kotlin/androidx/compose/desktop/DesktopTheme.jvm.kt
@@ -26,6 +26,14 @@
import androidx.compose.runtime.CompositionLocalProvider
import androidx.compose.ui.unit.dp
+@Deprecated(
+ "Use MaterialTheme",
+ replaceWith = ReplaceWith(
+ "MaterialTheme(colors, typography, shapes, content)",
+ "androidx.compose.material.MaterialTheme"
+ )
+)
+@Suppress("DEPRECATION")
@Composable
fun DesktopMaterialTheme(
colors: Colors = MaterialTheme.colors,
@@ -40,6 +48,17 @@
DesktopTheme(content = content)
}
+@Deprecated(
+ "Use CompositionLocalProvider(LocalScrollbarStyle provides scrollbar)",
+ replaceWith = ReplaceWith(
+ "CompositionLocalProvider(\n" +
+ " LocalScrollbarStyle provides scrollbar,\n" +
+ " content = content\n" +
+ ")",
+ "androidx.compose.runtime.CompositionLocalProvider",
+ "androidx.compose.foundation.LocalScrollbarStyle"
+ )
+)
@Composable
fun DesktopTheme(
scrollbar: ScrollbarStyle = ScrollbarStyle(
diff --git a/compose/foundation/foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/ScrollableTest.kt b/compose/foundation/foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/ScrollableTest.kt
index ca0aa5f..f944a6a 100644
--- a/compose/foundation/foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/ScrollableTest.kt
+++ b/compose/foundation/foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/ScrollableTest.kt
@@ -376,7 +376,6 @@
up()
}
val expected = prevAfterSomeFling + 115
- rule.mainClock.advanceTimeBy(1000)
assertThat(total).isEqualTo(expected)
}
@@ -982,6 +981,65 @@
}
@Test
+ fun scrollable_bothOrientations_proxiesPostFling() {
+ val velocityFlung = 5000f
+ val outerState = ScrollableState(consumeScrollDelta = { 0f })
+ val innerState = ScrollableState(consumeScrollDelta = { 0f })
+ val innerFlingBehavior = object : FlingBehavior {
+ override suspend fun ScrollScope.performFling(initialVelocity: Float): Float {
+ return initialVelocity
+ }
+ }
+ val parent = object : NestedScrollConnection {
+ override suspend fun onPostFling(
+ consumed: Velocity,
+ available: Velocity
+ ): Velocity {
+ assertThat(consumed.x).isEqualTo(0f)
+ assertThat(available.x).isWithin(0.1f).of(velocityFlung)
+ return available
+ }
+ }
+
+ rule.setContentAndGetScope {
+ Box {
+ Box(
+ contentAlignment = Alignment.Center,
+ modifier = Modifier
+ .size(300.dp)
+ .nestedScroll(parent)
+ .scrollable(
+ state = outerState,
+ orientation = Orientation.Vertical
+ )
+ ) {
+ Box(
+ modifier = Modifier.size(300.dp)
+ .testTag(scrollableBoxTag)
+ .scrollable(
+ state = innerState,
+ flingBehavior = innerFlingBehavior,
+ orientation = Orientation.Horizontal
+ )
+ )
+ }
+ }
+ }
+
+ rule.onNodeWithTag(scrollableBoxTag).performTouchInput {
+ this.swipeWithVelocity(
+ start = this.center,
+ end = Offset(this.center.x + 500f, this.center.y),
+ durationMillis = 300,
+ endVelocity = velocityFlung
+ )
+ }
+
+ // all assertions in callback above
+ rule.waitForIdle()
+ }
+
+ @Test
fun scrollable_interactionSource() {
val interactionSource = MutableInteractionSource()
var total = 0f
@@ -1130,7 +1188,8 @@
up()
}
assertThat(flingCalled).isEqualTo(1)
- assertThat(flingVelocity).isEqualTo(0f)
+ assertThat(flingVelocity).isLessThan(0.01f)
+ assertThat(flingVelocity).isGreaterThan(-0.01f)
}
@Test
diff --git a/compose/foundation/foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/gesture/OverScrollTest.kt b/compose/foundation/foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/gesture/OverScrollTest.kt
index 785d730..51adedd 100644
--- a/compose/foundation/foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/gesture/OverScrollTest.kt
+++ b/compose/foundation/foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/gesture/OverScrollTest.kt
@@ -231,10 +231,11 @@
up()
}
+ // ignores touch slop if overscroll animation is on progress while pointer goes down
+ assertThat(acummulatedScroll - lastAccScroll).isEqualTo(500f)
+
rule.runOnIdle {
assertThat(controller.stopAnimationCallsCount).isEqualTo(2)
- // ignores touch slop if overscroll animation is on progress while pointer goes down
- assertThat(acummulatedScroll - lastAccScroll).isEqualTo(500f)
}
}
diff --git a/compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/gestures/Draggable.kt b/compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/gestures/Draggable.kt
index 7c6a3d9..f60c979 100644
--- a/compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/gestures/Draggable.kt
+++ b/compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/gestures/Draggable.kt
@@ -41,6 +41,7 @@
import androidx.compose.ui.input.pointer.consumePositionChange
import androidx.compose.ui.input.pointer.pointerInput
import androidx.compose.ui.input.pointer.positionChange
+import androidx.compose.ui.input.pointer.util.addPointerInputChange
import androidx.compose.ui.input.pointer.util.VelocityTracker
import androidx.compose.ui.platform.debugInspectorInfo
import androidx.compose.ui.unit.Velocity
@@ -261,7 +262,12 @@
forEachGesture {
awaitPointerEventScope {
val velocityTracker = VelocityTracker()
- awaitDownAndSlop(canDragState, startImmediatelyState, orientation)?.let {
+ awaitDownAndSlop(
+ canDragState,
+ startImmediatelyState,
+ velocityTracker,
+ orientation
+ )?.let {
var isDragSuccessful = false
try {
isDragSuccessful = awaitDrag(
@@ -294,9 +300,11 @@
private suspend fun AwaitPointerEventScope.awaitDownAndSlop(
canDrag: State<(PointerInputChange) -> Boolean>,
startDragImmediately: State<() -> Boolean>,
+ velocityTracker: VelocityTracker,
orientation: Orientation
): Pair<PointerInputChange, Float>? {
val down = awaitFirstDown(requireUnconsumed = false)
+ velocityTracker.addPointerInputChange(down)
return if (!canDrag.value.invoke(down)) {
null
} else if (startDragImmediately.value.invoke()) {
@@ -305,6 +313,7 @@
} else {
var initialDelta = 0f
val postPointerSlop = { event: PointerInputChange, offset: Float ->
+ velocityTracker.addPointerInputChange(event)
event.consumePositionChange()
initialDelta = offset
}
@@ -326,7 +335,6 @@
): Boolean {
val initialDelta = dragStart.second
val startEvent = dragStart.first
- velocityTracker.addPosition(startEvent.uptimeMillis, startEvent.position)
val overSlopOffset = initialDelta.toOffset(orientation)
val adjustedStart = startEvent.position - overSlopOffset *
@@ -340,8 +348,8 @@
)
)
- val dragTick: (PointerInputChange) -> Unit = { event: PointerInputChange ->
- velocityTracker.addPosition(event.uptimeMillis, event.position)
+ val dragTick: (PointerInputChange) -> Unit = { event ->
+ velocityTracker.addPointerInputChange(event)
val delta = event.positionChange().toFloat(orientation)
event.consumePositionChange()
channel.trySend(
diff --git a/compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/gestures/Scrollable.kt b/compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/gestures/Scrollable.kt
index 7733d42..3bc3518 100644
--- a/compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/gestures/Scrollable.kt
+++ b/compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/gestures/Scrollable.kt
@@ -225,6 +225,9 @@
fun Velocity.toFloat(): Float =
if (orientation == Horizontal) this.x else this.y
+ fun Velocity.update(newValue: Float): Velocity =
+ if (orientation == Horizontal) copy(x = newValue) else copy(y = newValue)
+
fun Float.reverseIfNeeded(): Float = if (reverseDirection) this * -1 else this
fun ScrollScope.dispatchScroll(
@@ -294,8 +297,9 @@
}
with(scope) {
with(flingBehavior) {
- result = performFling(available.toFloat().reverseIfNeeded())
- .reverseIfNeeded().toVelocity()
+ result = result.update(
+ performFling(available.toFloat().reverseIfNeeded()).reverseIfNeeded()
+ )
}
}
}
diff --git a/compose/foundation/foundation/src/desktopMain/kotlin/androidx/compose/foundation/BoxWithTooltip.desktop.kt b/compose/foundation/foundation/src/desktopMain/kotlin/androidx/compose/foundation/BoxWithTooltip.desktop.kt
index 7cb4557..f7ff21a 100644
--- a/compose/foundation/foundation/src/desktopMain/kotlin/androidx/compose/foundation/BoxWithTooltip.desktop.kt
+++ b/compose/foundation/foundation/src/desktopMain/kotlin/androidx/compose/foundation/BoxWithTooltip.desktop.kt
@@ -30,10 +30,10 @@
import androidx.compose.ui.input.pointer.PointerEventPass
import androidx.compose.ui.input.pointer.PointerInputScope
import androidx.compose.ui.input.pointer.pointerInput
-import androidx.compose.ui.input.pointer.pointerMoveFilter
import androidx.compose.ui.layout.onGloballyPositioned
import androidx.compose.ui.layout.positionInWindow
import androidx.compose.ui.Modifier
+import androidx.compose.ui.input.pointer.PointerEventType
import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.DpOffset
@@ -101,23 +101,28 @@
)
parentBounds = IntRect(position, size)
}
- .pointerMoveFilter(
- onMove = {
- mousePosition.value = IntOffset(
- it.x.toInt() + parentBounds.left,
- it.y.toInt() + parentBounds.top
- )
- false
- },
- onEnter = {
- startShowing()
- false
- },
- onExit = {
- hide()
- false
+ .pointerInput(Unit) {
+ awaitPointerEventScope {
+ while (true) {
+ val event = awaitPointerEvent()
+ val position = event.changes.first().position
+ when (event.type) {
+ PointerEventType.Move -> {
+ mousePosition.value = IntOffset(
+ position.x.toInt() + parentBounds.left,
+ position.y.toInt() + parentBounds.top
+ )
+ }
+ PointerEventType.Enter -> {
+ startShowing()
+ }
+ PointerEventType.Exit -> {
+ hide()
+ }
+ }
+ }
}
- )
+ }
.pointerInput(Unit) {
detectDown {
hide()
diff --git a/compose/foundation/foundation/src/desktopMain/kotlin/androidx/compose/foundation/Scrollbar.desktop.kt b/compose/foundation/foundation/src/desktopMain/kotlin/androidx/compose/foundation/Scrollbar.desktop.kt
index adccd8d..9d63c78 100644
--- a/compose/foundation/foundation/src/desktopMain/kotlin/androidx/compose/foundation/Scrollbar.desktop.kt
+++ b/compose/foundation/foundation/src/desktopMain/kotlin/androidx/compose/foundation/Scrollbar.desktop.kt
@@ -27,6 +27,7 @@
import androidx.compose.foundation.interaction.MutableInteractionSource
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.lazy.LazyListState
+import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.runtime.Composable
import androidx.compose.runtime.CompositionLocal
import androidx.compose.runtime.DisposableEffect
@@ -44,11 +45,10 @@
import androidx.compose.ui.composed
import androidx.compose.ui.geometry.Offset
import androidx.compose.ui.graphics.Color
-import androidx.compose.ui.graphics.RectangleShape
import androidx.compose.ui.graphics.Shape
+import androidx.compose.ui.input.pointer.PointerEventType
import androidx.compose.ui.input.pointer.consumePositionChange
import androidx.compose.ui.input.pointer.pointerInput
-import androidx.compose.ui.input.pointer.pointerMoveFilter
import androidx.compose.ui.input.pointer.positionChange
import androidx.compose.ui.layout.Layout
import androidx.compose.ui.layout.MeasurePolicy
@@ -86,15 +86,15 @@
)
/**
- * Simple default [ScrollbarStyle] without hover effects and without applying MaterialTheme.
+ * Simple default [ScrollbarStyle] without applying MaterialTheme.
*/
fun defaultScrollbarStyle() = ScrollbarStyle(
minimalHeight = 16.dp,
thickness = 8.dp,
- shape = RectangleShape,
- hoverDurationMillis = 0,
+ shape = RoundedCornerShape(4.dp),
+ hoverDurationMillis = 300,
unhoverColor = Color.Black.copy(alpha = 0.12f),
- hoverColor = Color.Black.copy(alpha = 0.12f)
+ hoverColor = Color.Black.copy(alpha = 0.50f)
)
/**
@@ -253,10 +253,21 @@
)
},
modifier
- .pointerMoveFilter(
- onExit = { isHovered = false; false },
- onEnter = { isHovered = true; false }
- )
+ .pointerInput(Unit) {
+ awaitPointerEventScope {
+ while (true) {
+ val event = awaitPointerEvent()
+ when (event.type) {
+ PointerEventType.Enter -> {
+ isHovered = true
+ }
+ PointerEventType.Exit -> {
+ isHovered = false
+ }
+ }
+ }
+ }
+ }
.scrollOnPressOutsideSlider(isVertical, sliderAdapter, adapter, containerSize),
measurePolicy
)
diff --git a/compose/integration-tests/docs-snippets/src/main/java/androidx/compose/integration/docs/tooling/Tooling.kt b/compose/integration-tests/docs-snippets/src/main/java/androidx/compose/integration/docs/tooling/Tooling.kt
new file mode 100644
index 0000000..bca0385
--- /dev/null
+++ b/compose/integration-tests/docs-snippets/src/main/java/androidx/compose/integration/docs/tooling/Tooling.kt
@@ -0,0 +1,183 @@
+/*
+* Copyright 2021 The Android Open Source Project
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+// Ignore lint warnings in documentation snippets
+@file:Suppress("unused", "UNUSED_PARAMETER", "UNUSED_VARIABLE", "LocalVariableName")
+
+package androidx.compose.integration.docs.tooling
+
+import androidx.compose.animation.animateColor
+import androidx.compose.animation.core.animateDp
+import androidx.compose.animation.core.animateFloat
+import androidx.compose.animation.core.updateTransition
+import androidx.compose.foundation.background
+import androidx.compose.foundation.layout.Box
+import androidx.compose.foundation.layout.size
+import androidx.compose.foundation.selection.toggleable
+import androidx.compose.material.Surface
+import androidx.compose.material.Text
+import androidx.compose.runtime.Composable
+import androidx.compose.runtime.getValue
+import androidx.compose.runtime.mutableStateOf
+import androidx.compose.runtime.remember
+import androidx.compose.ui.Modifier
+import androidx.compose.ui.graphics.Color
+import androidx.compose.ui.res.stringResource
+import androidx.compose.ui.tooling.preview.Preview
+import androidx.compose.ui.tooling.preview.PreviewParameter
+import androidx.compose.ui.tooling.preview.PreviewParameterProvider
+import androidx.compose.ui.unit.dp
+
+/**
+ * This file lets DevRel track changes to snippets present in
+ * https://developer.android.com/jetpack/compose/tooling
+ *
+ * No action required if it's modified.
+ */
+
+private object ToolingSnippet1 {
+ @Composable
+ fun SimpleComposable() {
+ Text("Hello World")
+ }
+}
+
+private class ToolingSnippet2 {
+ @Preview
+ @Composable
+ fun ComposablePreview() {
+ SimpleComposable()
+ }
+}
+
+private class ToolingSnippet3 {
+ @Preview(showBackground = true, backgroundColor = 0xFF00FF00)
+ @Composable
+ fun WithGreenBackground() {
+ Text("Hello World")
+ }
+}
+
+private class ToolingSnippet4 {
+ @Preview(widthDp = 50, heightDp = 50)
+ @Composable
+ fun SquareComposablePreview() {
+ Box(Modifier.background(Color.Yellow)) {
+ Text("Hello World")
+ }
+ }
+}
+
+private class ToolingSnippet5 {
+ @Preview(locale = "fr-rFR")
+ @Composable
+ fun DifferentLocaleComposablePreview() {
+ Text(text = stringResource(R.string.greetings))
+ }
+}
+
+private class ToolingSnippet6 {
+ @Preview(showSystemUi = true)
+ @Composable
+ fun DecoratedComposablePreview() {
+ Text("Hello World")
+ }
+}
+
+private class ToolingSnippet7 {
+ @Preview
+ @Composable
+ fun UserProfilePreview(
+ @PreviewParameter(UserPreviewParameterProvider::class) user: User
+ ) {
+ UserProfile(user)
+ }
+
+ class UserPreviewParameterProvider : PreviewParameterProvider<User> {
+ override val values = sequenceOf(
+ User("Elise"),
+ User("Frank"),
+ User("Julia")
+ )
+ }
+}
+
+private class ToolingSnippet8 {
+ @Preview
+ @Composable
+ fun UserProfilePreview(
+ @PreviewParameter(UserPreviewParameterProvider::class, limit = 2) user: User
+ ) {
+ UserProfile(user)
+ }
+}
+
+private class ToolingSnippet9 {
+ @Preview
+ @Composable
+ fun PressedSurface() {
+ val (pressed, onPress) = remember { mutableStateOf(false) }
+ val transition = updateTransition(
+ targetState = if (pressed) SurfaceState.Pressed else SurfaceState.Released
+ )
+
+ val width by transition.animateDp { state ->
+ when (state) {
+ SurfaceState.Released -> 20.dp
+ SurfaceState.Pressed -> 50.dp
+ }
+ }
+ val surfaceColor by transition.animateColor { state ->
+ when (state) {
+ SurfaceState.Released -> Color.Blue
+ SurfaceState.Pressed -> Color.Red
+ }
+ }
+ val selectedAlpha by transition.animateFloat { state ->
+ when (state) {
+ SurfaceState.Released -> 0.5f
+ SurfaceState.Pressed -> 1f
+ }
+ }
+
+ Surface(
+ color = surfaceColor.copy(alpha = selectedAlpha),
+ modifier = Modifier
+ .toggleable(value = pressed, onValueChange = onPress)
+ .size(height = 200.dp, width = width)
+ ) {}
+ }
+}
+
+private fun SimpleComposable() {}
+private data class User(val name: String)
+
+@Composable
+private fun UserProfile(user: User) {
+ Text(user.name)
+}
+
+private class UserPreviewParameterProvider : PreviewParameterProvider<User> {
+ override val values = emptySequence<User>()
+}
+
+private enum class SurfaceState { Released, Pressed }
+
+private object R {
+ object string {
+ const val greetings = 1
+ }
+}
\ No newline at end of file
diff --git a/compose/integration-tests/macrobenchmark/build.gradle b/compose/integration-tests/macrobenchmark/build.gradle
index 4269659..68054a9 100644
--- a/compose/integration-tests/macrobenchmark/build.gradle
+++ b/compose/integration-tests/macrobenchmark/build.gradle
@@ -21,8 +21,7 @@
}
android.defaultConfig {
- minSdkVersion 28
- testInstrumentationRunnerArgument "androidx.benchmark.output.enable", "true"
+ minSdkVersion 23
}
dependencies {
diff --git a/compose/integration-tests/macrobenchmark/lint-baseline.xml b/compose/integration-tests/macrobenchmark/lint-baseline.xml
index 86830d6..b620a2b5 100644
--- a/compose/integration-tests/macrobenchmark/lint-baseline.xml
+++ b/compose/integration-tests/macrobenchmark/lint-baseline.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<issues format="6" by="lint 7.1.0-alpha02" type="baseline" client="cli" name="Lint" variant="all" version="7.1.0-alpha02">
+<issues format="6" by="lint 7.1.0-dev" type="baseline" client="gradle" dependencies="false" name="AGP (7.1.0-dev)" variant="all" version="7.1.0-dev">
<issue
id="NewApi"
@@ -47,6 +47,17 @@
<issue
id="NewApi"
+ message="Call requires API level 29 (current min is 28): `measureRepeated`"
+ errorLine1=" iterations = 10,"
+ errorLine2=" ~~">
+ <location
+ file="src/androidTest/java/androidx/compose/integration/macrobenchmark/NestedListsScrollBenchmark.kt"
+ line="58"
+ column="26"/>
+ </issue>
+
+ <issue
+ id="NewApi"
message="Call requires API level 29 (current min is 28): `MacrobenchmarkRule`"
errorLine1=" val benchmarkRule = MacrobenchmarkRule()"
errorLine2=" ~~~~~~~~~~~~~~~~~~~~">
@@ -91,6 +102,17 @@
<issue
id="NewApi"
+ message="Call requires API level 29 (current min is 28): `measureRepeated`"
+ errorLine1=" iterations = 10,"
+ errorLine2=" ~~">
+ <location
+ file="src/androidTest/java/androidx/compose/integration/macrobenchmark/TrivialListScrollBenchmark.kt"
+ line="58"
+ column="26"/>
+ </issue>
+
+ <issue
+ id="NewApi"
message="Call requires API level 29 (current min is 28): `MacrobenchmarkRule`"
errorLine1=" val benchmarkRule = MacrobenchmarkRule()"
errorLine2=" ~~~~~~~~~~~~~~~~~~~~">
diff --git a/compose/integration-tests/macrobenchmark/src/androidTest/java/androidx/compose/integration/macrobenchmark/IoSettingsStartupBenchmark.kt b/compose/integration-tests/macrobenchmark/src/androidTest/java/androidx/compose/integration/macrobenchmark/IoSettingsStartupBenchmark.kt
index 13ba40b..f4a21bb 100644
--- a/compose/integration-tests/macrobenchmark/src/androidTest/java/androidx/compose/integration/macrobenchmark/IoSettingsStartupBenchmark.kt
+++ b/compose/integration-tests/macrobenchmark/src/androidTest/java/androidx/compose/integration/macrobenchmark/IoSettingsStartupBenchmark.kt
@@ -20,6 +20,7 @@
import androidx.benchmark.macro.StartupMode
import androidx.benchmark.macro.junit4.MacrobenchmarkRule
import androidx.test.filters.LargeTest
+import androidx.test.filters.SdkSuppress
import androidx.testutils.createStartupCompilationParams
import androidx.testutils.measureStartup
import org.junit.Rule
@@ -28,6 +29,7 @@
import org.junit.runners.Parameterized
@LargeTest
+@SdkSuppress(minSdkVersion = 29)
@RunWith(Parameterized::class)
class IoSettingsStartupBenchmark(
private val startupMode: StartupMode,
diff --git a/compose/integration-tests/macrobenchmark/src/androidTest/java/androidx/compose/integration/macrobenchmark/NestedListsScrollBenchmark.kt b/compose/integration-tests/macrobenchmark/src/androidTest/java/androidx/compose/integration/macrobenchmark/NestedListsScrollBenchmark.kt
index 0390523..a90953a 100644
--- a/compose/integration-tests/macrobenchmark/src/androidTest/java/androidx/compose/integration/macrobenchmark/NestedListsScrollBenchmark.kt
+++ b/compose/integration-tests/macrobenchmark/src/androidTest/java/androidx/compose/integration/macrobenchmark/NestedListsScrollBenchmark.kt
@@ -19,9 +19,11 @@
import android.content.Intent
import android.graphics.Point
import androidx.benchmark.macro.CompilationMode
+import androidx.benchmark.macro.FrameTimingGfxInfoMetric
import androidx.benchmark.macro.FrameTimingMetric
import androidx.benchmark.macro.junit4.MacrobenchmarkRule
import androidx.test.filters.LargeTest
+import androidx.test.filters.SdkSuppress
import androidx.test.platform.app.InstrumentationRegistry
import androidx.test.uiautomator.By
import androidx.test.uiautomator.UiDevice
@@ -34,6 +36,7 @@
import org.junit.runners.Parameterized
@LargeTest
+@SdkSuppress(minSdkVersion = 29)
@RunWith(Parameterized::class)
class NestedListsScrollBenchmark(
private val compilationMode: CompilationMode
@@ -53,7 +56,7 @@
fun start() {
benchmarkRule.measureRepeated(
packageName = PACKAGE_NAME,
- metrics = listOf(FrameTimingMetric()),
+ metrics = listOf(FrameTimingMetric(), FrameTimingGfxInfoMetric()),
compilationMode = compilationMode,
iterations = 10,
setupBlock = {
diff --git a/compose/integration-tests/macrobenchmark/src/androidTest/java/androidx/compose/integration/macrobenchmark/SmallListStartupBenchmark.kt b/compose/integration-tests/macrobenchmark/src/androidTest/java/androidx/compose/integration/macrobenchmark/SmallListStartupBenchmark.kt
index 3100c8e..4e55ceb 100644
--- a/compose/integration-tests/macrobenchmark/src/androidTest/java/androidx/compose/integration/macrobenchmark/SmallListStartupBenchmark.kt
+++ b/compose/integration-tests/macrobenchmark/src/androidTest/java/androidx/compose/integration/macrobenchmark/SmallListStartupBenchmark.kt
@@ -20,6 +20,7 @@
import androidx.benchmark.macro.StartupMode
import androidx.benchmark.macro.junit4.MacrobenchmarkRule
import androidx.test.filters.LargeTest
+import androidx.test.filters.SdkSuppress
import androidx.testutils.createStartupCompilationParams
import androidx.testutils.measureStartup
import org.junit.Rule
@@ -28,6 +29,7 @@
import org.junit.runners.Parameterized
@LargeTest
+@SdkSuppress(minSdkVersion = 29)
@RunWith(Parameterized::class)
class SmallListStartupBenchmark(
private val startupMode: StartupMode,
diff --git a/compose/integration-tests/macrobenchmark/src/androidTest/java/androidx/compose/integration/macrobenchmark/TrivialListScrollBenchmark.kt b/compose/integration-tests/macrobenchmark/src/androidTest/java/androidx/compose/integration/macrobenchmark/TrivialListScrollBenchmark.kt
index 08310ca..102d4ee 100644
--- a/compose/integration-tests/macrobenchmark/src/androidTest/java/androidx/compose/integration/macrobenchmark/TrivialListScrollBenchmark.kt
+++ b/compose/integration-tests/macrobenchmark/src/androidTest/java/androidx/compose/integration/macrobenchmark/TrivialListScrollBenchmark.kt
@@ -19,6 +19,7 @@
import android.content.Intent
import android.graphics.Point
import androidx.benchmark.macro.CompilationMode
+import androidx.benchmark.macro.FrameTimingGfxInfoMetric
import androidx.benchmark.macro.FrameTimingMetric
import androidx.benchmark.macro.junit4.MacrobenchmarkRule
import androidx.test.filters.LargeTest
@@ -53,7 +54,7 @@
fun start() {
benchmarkRule.measureRepeated(
packageName = PACKAGE_NAME,
- metrics = listOf(FrameTimingMetric()),
+ metrics = listOf(FrameTimingMetric(), FrameTimingGfxInfoMetric()),
compilationMode = compilationMode,
iterations = 10,
setupBlock = {
diff --git a/compose/integration-tests/macrobenchmark/src/androidTest/java/androidx/compose/integration/macrobenchmark/TrivialStartupBenchmark.kt b/compose/integration-tests/macrobenchmark/src/androidTest/java/androidx/compose/integration/macrobenchmark/TrivialStartupBenchmark.kt
index 94f358c..ed5efcc 100644
--- a/compose/integration-tests/macrobenchmark/src/androidTest/java/androidx/compose/integration/macrobenchmark/TrivialStartupBenchmark.kt
+++ b/compose/integration-tests/macrobenchmark/src/androidTest/java/androidx/compose/integration/macrobenchmark/TrivialStartupBenchmark.kt
@@ -20,6 +20,7 @@
import androidx.benchmark.macro.StartupMode
import androidx.benchmark.macro.junit4.MacrobenchmarkRule
import androidx.test.filters.LargeTest
+import androidx.test.filters.SdkSuppress
import androidx.testutils.createStartupCompilationParams
import androidx.testutils.measureStartup
import org.junit.Rule
@@ -28,6 +29,7 @@
import org.junit.runners.Parameterized
@LargeTest
+@SdkSuppress(minSdkVersion = 29)
@RunWith(Parameterized::class)
class TrivialStartupBenchmark(
private val startupMode: StartupMode,
diff --git a/compose/integration-tests/material-catalog/OWNERS b/compose/integration-tests/material-catalog/OWNERS
new file mode 100644
index 0000000..5c55131
--- /dev/null
+++ b/compose/integration-tests/material-catalog/OWNERS
@@ -0,0 +1 @@
+nickrout@google.com
diff --git a/compose/material/material/integration-tests/material-catalog/README.md b/compose/integration-tests/material-catalog/README.md
similarity index 100%
rename from compose/material/material/integration-tests/material-catalog/README.md
rename to compose/integration-tests/material-catalog/README.md
diff --git a/compose/integration-tests/material-catalog/build.gradle b/compose/integration-tests/material-catalog/build.gradle
new file mode 100644
index 0000000..5e0a273
--- /dev/null
+++ b/compose/integration-tests/material-catalog/build.gradle
@@ -0,0 +1,81 @@
+/*
+ * Copyright 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT 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 androidx.build.BuildOnServerKt
+import androidx.build.BuildServerConfigurationKt
+import androidx.build.Publish
+
+plugins {
+ id("AndroidXPlugin")
+ id("com.android.application")
+ id("AndroidXComposePlugin")
+ id("org.jetbrains.kotlin.android")
+}
+
+android {
+ defaultConfig {
+ applicationId "androidx.compose.material.catalog"
+ versionCode 1001
+ versionName "1.0.1"
+ }
+ buildTypes {
+ release {
+ minifyEnabled true
+ shrinkResources true
+ proguardFiles getDefaultProguardFile('proguard-android-optimize.txt')
+ }
+ }
+}
+
+dependencies {
+ kotlinPlugin project(":compose:compiler:compiler")
+ implementation(libs.kotlinStdlib)
+ implementation project(":compose:runtime:runtime")
+ implementation project(":compose:ui:ui")
+ implementation project(":compose:material:material")
+ implementation project(":compose:material3:material3")
+ implementation project(":compose:material:material:integration-tests:material-catalog")
+ implementation project(":compose:material3:material3:integration-tests:material3-catalog")
+ implementation "androidx.activity:activity-compose:1.3.1"
+ implementation project(":navigation:navigation-compose")
+ implementation "com.google.accompanist:accompanist-insets:0.18.0"
+}
+
+// We want to publish a release APK of this project for the Compose Material Catalog
+def copyReleaseApk = tasks.register("copyReleaseApk", Copy) { task ->
+ android.applicationVariants.all { variant ->
+ if (variant.buildType.name == "release") {
+ task.from(variant.packageApplicationProvider.get().outputDirectory)
+ }
+ }
+ task.include("*.apk")
+ task.rename { fileName ->
+ "${project.path.substring(1).replace(':', '-')}_$fileName"
+ }
+ task.destinationDir =
+ new File(BuildServerConfigurationKt.getDistributionDirectory(project), "apks")
+ task.dependsOn(project.path + ":assembleRelease")
+}
+
+BuildOnServerKt.addToBuildOnServer(project, copyReleaseApk)
+
+androidx {
+ name = "Compose Material Catalog app"
+ publish = Publish.NONE
+ inceptionYear = "2021"
+ description = "This is a project for the Compose Material Catalog app."
+}
diff --git a/compose/material/material/integration-tests/material-catalog/icon.png b/compose/integration-tests/material-catalog/icon.png
similarity index 100%
rename from compose/material/material/integration-tests/material-catalog/icon.png
rename to compose/integration-tests/material-catalog/icon.png
Binary files differ
diff --git a/compose/integration-tests/material-catalog/src/main/AndroidManifest.xml b/compose/integration-tests/material-catalog/src/main/AndroidManifest.xml
new file mode 100644
index 0000000..4034da7
--- /dev/null
+++ b/compose/integration-tests/material-catalog/src/main/AndroidManifest.xml
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ ~ Copyright (C) 2021 The Android Open Source Project
+ ~
+ ~ Licensed under the Apache License, Version 2.0 (the "License");
+ ~ you may not use this file except in compliance with the License.
+ ~ You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing, software
+ ~ distributed under the License is distributed on an "AS IS" BASIS,
+ ~ WITHOUT 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.compose.material.catalog">
+
+ <application
+ android:label="@string/compose_material_catalog"
+ android:icon="@mipmap/ic_launcher"
+ android:theme="@style/Theme.Catalog">
+ <activity android:name=".CatalogActivity" android:exported="true">
+ <intent-filter>
+ <action android:name="android.intent.action.MAIN" />
+ <category android:name="android.intent.category.LAUNCHER" />
+ </intent-filter>
+ </activity>
+ </application>
+</manifest>
diff --git a/compose/material/material/integration-tests/material-catalog/src/main/java/androidx/compose/material/catalog/CatalogActivity.kt b/compose/integration-tests/material-catalog/src/main/java/androidx/compose/material/catalog/CatalogActivity.kt
similarity index 100%
rename from compose/material/material/integration-tests/material-catalog/src/main/java/androidx/compose/material/catalog/CatalogActivity.kt
rename to compose/integration-tests/material-catalog/src/main/java/androidx/compose/material/catalog/CatalogActivity.kt
diff --git a/wear/compose/compose-material/src/desktopMain/kotlin/androidx/wear/compose/material/TimeUpdateController.kt b/compose/integration-tests/material-catalog/src/main/java/androidx/compose/material/catalog/CatalogApp.kt
similarity index 65%
copy from wear/compose/compose-material/src/desktopMain/kotlin/androidx/wear/compose/material/TimeUpdateController.kt
copy to compose/integration-tests/material-catalog/src/main/java/androidx/compose/material/catalog/CatalogApp.kt
index d85e429..9f0ae0f 100644
--- a/wear/compose/compose-material/src/desktopMain/kotlin/androidx/wear/compose/material/TimeUpdateController.kt
+++ b/compose/integration-tests/material-catalog/src/main/java/androidx/compose/material/catalog/CatalogApp.kt
@@ -14,21 +14,17 @@
* limitations under the License.
*/
-package androidx.wear.compose.material
+package androidx.compose.material.catalog
+import androidx.compose.material.catalog.ui.theme.CatalogTheme
import androidx.compose.runtime.Composable
-import androidx.compose.runtime.State
-import androidx.compose.runtime.derivedStateOf
-import androidx.compose.runtime.remember
+import com.google.accompanist.insets.ProvideWindowInsets
@Composable
-internal actual fun currentTime(
- time: () -> Long,
- timeFormat: String
-): State<String> {
-
- val timeText = remember {
- derivedStateOf { "Test time" }
+fun CatalogApp() {
+ ProvideWindowInsets {
+ CatalogTheme {
+ NavGraph()
+ }
}
- return timeText
}
diff --git a/compose/integration-tests/material-catalog/src/main/java/androidx/compose/material/catalog/NavGraph.kt b/compose/integration-tests/material-catalog/src/main/java/androidx/compose/material/catalog/NavGraph.kt
new file mode 100644
index 0000000..21bee2a
--- /dev/null
+++ b/compose/integration-tests/material-catalog/src/main/java/androidx/compose/material/catalog/NavGraph.kt
@@ -0,0 +1,56 @@
+/*
+ * Copyright 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES 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.compose.material.catalog
+
+import androidx.compose.material.catalog.library.MaterialCatalogApp
+import androidx.compose.material.catalog.library.MaterialRoute
+import androidx.compose.material.catalog.model.MaterialSpecification
+import androidx.compose.material.catalog.model.Material3Specification
+import androidx.compose.material.catalog.model.Specifications
+import androidx.compose.material.catalog.ui.specification.Specification
+import androidx.compose.material3.catalog.library.Material3CatalogApp
+import androidx.compose.material3.catalog.library.Material3Route
+import androidx.compose.runtime.Composable
+import androidx.navigation.compose.NavHost
+import androidx.navigation.compose.composable
+import androidx.navigation.compose.rememberNavController
+
+@Composable
+fun NavGraph() {
+ val navController = rememberNavController()
+ NavHost(
+ navController = navController,
+ startDestination = SpecificationRoute
+ ) {
+ composable(SpecificationRoute) {
+ Specification(
+ specifications = Specifications,
+ onSpecificationClick = { specification ->
+ when (specification) {
+ MaterialSpecification -> navController.navigate(MaterialRoute)
+ Material3Specification -> navController.navigate(Material3Route)
+ else -> throw IllegalArgumentException("Unknown specification")
+ }
+ }
+ )
+ }
+ composable(MaterialRoute) { MaterialCatalogApp() }
+ composable(Material3Route) { Material3CatalogApp() }
+ }
+}
+
+private const val SpecificationRoute = "specification"
diff --git a/compose/integration-tests/material-catalog/src/main/java/androidx/compose/material/catalog/model/Specifications.kt b/compose/integration-tests/material-catalog/src/main/java/androidx/compose/material/catalog/model/Specifications.kt
new file mode 100644
index 0000000..9c26923
--- /dev/null
+++ b/compose/integration-tests/material-catalog/src/main/java/androidx/compose/material/catalog/model/Specifications.kt
@@ -0,0 +1,39 @@
+/*
+ * Copyright 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES 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.compose.material.catalog.model
+
+data class Specification(
+ val id: Int,
+ val name: String
+)
+
+private const val MaterialTitle = "Material"
+val MaterialSpecification = Specification(
+ id = 1,
+ name = MaterialTitle
+)
+
+private const val Material3Title = "Material You"
+val Material3Specification = Specification(
+ id = 2,
+ name = Material3Title
+)
+
+val Specifications = listOf(
+ MaterialSpecification,
+ Material3Specification
+)
diff --git a/compose/integration-tests/material-catalog/src/main/java/androidx/compose/material/catalog/ui/specification/Specification.kt b/compose/integration-tests/material-catalog/src/main/java/androidx/compose/material/catalog/ui/specification/Specification.kt
new file mode 100644
index 0000000..7e4df39
--- /dev/null
+++ b/compose/integration-tests/material-catalog/src/main/java/androidx/compose/material/catalog/ui/specification/Specification.kt
@@ -0,0 +1,58 @@
+/*
+ * Copyright 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES 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.compose.material.catalog.ui.specification
+
+import androidx.compose.foundation.ExperimentalFoundationApi
+import androidx.compose.foundation.layout.BoxWithConstraints
+import androidx.compose.foundation.layout.padding
+import androidx.compose.foundation.lazy.LazyColumn
+import androidx.compose.foundation.lazy.items
+import androidx.compose.material.catalog.R
+import androidx.compose.material.catalog.model.Specification
+import androidx.compose.runtime.Composable
+import androidx.compose.ui.Modifier
+import androidx.compose.ui.res.stringResource
+import com.google.accompanist.insets.LocalWindowInsets
+import com.google.accompanist.insets.rememberInsetsPaddingValues
+
+// TODO: Use components/values from Material3 when available
+@Composable
+@OptIn(ExperimentalFoundationApi::class)
+fun Specification(
+ specifications: List<Specification>,
+ onSpecificationClick: (specification: Specification) -> Unit
+) {
+ SpecificationScaffold(
+ topBarTitle = stringResource(id = R.string.compose_material_catalog)
+ ) { paddingValues ->
+ BoxWithConstraints(modifier = Modifier.padding(paddingValues)) {
+ LazyColumn(
+ content = {
+ items(specifications) { specification ->
+ SpecificationItem(
+ specification = specification,
+ onClick = onSpecificationClick
+ )
+ }
+ },
+ contentPadding = rememberInsetsPaddingValues(
+ insets = LocalWindowInsets.current.navigationBars
+ )
+ )
+ }
+ }
+}
diff --git a/compose/integration-tests/material-catalog/src/main/java/androidx/compose/material/catalog/ui/specification/SpecificationItem.kt b/compose/integration-tests/material-catalog/src/main/java/androidx/compose/material/catalog/ui/specification/SpecificationItem.kt
new file mode 100644
index 0000000..da3c9e9
--- /dev/null
+++ b/compose/integration-tests/material-catalog/src/main/java/androidx/compose/material/catalog/ui/specification/SpecificationItem.kt
@@ -0,0 +1,54 @@
+/*
+ * Copyright 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES 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.compose.material.catalog.ui.specification
+
+import androidx.compose.foundation.clickable
+import androidx.compose.foundation.layout.Box
+import androidx.compose.foundation.layout.fillMaxWidth
+import androidx.compose.foundation.layout.height
+import androidx.compose.foundation.layout.padding
+import androidx.compose.material.MaterialTheme
+import androidx.compose.material.Text
+import androidx.compose.material.catalog.model.Specification
+import androidx.compose.runtime.Composable
+import androidx.compose.ui.Alignment
+import androidx.compose.ui.Modifier
+import androidx.compose.ui.unit.dp
+
+// TODO: Use components/values from Material3 when available
+@Composable
+fun SpecificationItem(
+ specification: Specification,
+ onClick: (specification: Specification) -> Unit
+) {
+ Box(
+ modifier = Modifier
+ .fillMaxWidth()
+ .height(SpecificationItemHeight)
+ .clickable { onClick(specification) }
+ .padding(SpecificationItemPadding),
+ contentAlignment = Alignment.CenterStart
+ ) {
+ Text(
+ text = specification.name,
+ style = MaterialTheme.typography.body1
+ )
+ }
+}
+
+private val SpecificationItemHeight = 56.dp
+private val SpecificationItemPadding = 16.dp
diff --git a/compose/integration-tests/material-catalog/src/main/java/androidx/compose/material/catalog/ui/specification/SpecificationScaffold.kt b/compose/integration-tests/material-catalog/src/main/java/androidx/compose/material/catalog/ui/specification/SpecificationScaffold.kt
new file mode 100644
index 0000000..997d450
--- /dev/null
+++ b/compose/integration-tests/material-catalog/src/main/java/androidx/compose/material/catalog/ui/specification/SpecificationScaffold.kt
@@ -0,0 +1,35 @@
+/*
+ * Copyright 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES 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.compose.material.catalog.ui.specification
+
+import androidx.compose.foundation.layout.PaddingValues
+import androidx.compose.material.ExperimentalMaterialApi
+import androidx.compose.material.Scaffold
+import androidx.compose.runtime.Composable
+
+// TODO: Use components/values from Material3 when available
+@OptIn(ExperimentalMaterialApi::class)
+@Composable
+fun SpecificationScaffold(
+ topBarTitle: String,
+ content: @Composable (PaddingValues) -> Unit
+) {
+ Scaffold(
+ topBar = { SpecificationTopAppBar(title = topBarTitle) },
+ content = content
+ )
+}
diff --git a/compose/integration-tests/material-catalog/src/main/java/androidx/compose/material/catalog/ui/specification/SpecificationTopAppBar.kt b/compose/integration-tests/material-catalog/src/main/java/androidx/compose/material/catalog/ui/specification/SpecificationTopAppBar.kt
new file mode 100644
index 0000000..78e8987
--- /dev/null
+++ b/compose/integration-tests/material-catalog/src/main/java/androidx/compose/material/catalog/ui/specification/SpecificationTopAppBar.kt
@@ -0,0 +1,57 @@
+/*
+ * Copyright 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES 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.compose.material.catalog.ui.specification
+
+import androidx.compose.material.AppBarDefaults
+import androidx.compose.material.MaterialTheme
+import androidx.compose.material.Surface
+import androidx.compose.material.Text
+import androidx.compose.material.TopAppBar
+import androidx.compose.material.primarySurface
+import androidx.compose.runtime.Composable
+import androidx.compose.ui.Modifier
+import androidx.compose.ui.graphics.Color
+import androidx.compose.ui.text.style.TextOverflow
+import androidx.compose.ui.unit.dp
+import com.google.accompanist.insets.navigationBarsPadding
+import com.google.accompanist.insets.statusBarsPadding
+
+// TODO: Use components/values from Material3 when available
+@Composable
+fun SpecificationTopAppBar(title: String) {
+ // Wrapping in a Surface to handle window insets
+ // https://issuetracker.google.com/issues/183161866
+ Surface(
+ color = MaterialTheme.colors.primarySurface,
+ elevation = AppBarDefaults.TopAppBarElevation
+ ) {
+ TopAppBar(
+ title = {
+ Text(
+ text = title,
+ maxLines = 1,
+ overflow = TextOverflow.Ellipsis
+ )
+ },
+ backgroundColor = Color.Transparent,
+ elevation = 0.dp,
+ modifier = Modifier
+ .statusBarsPadding()
+ .navigationBarsPadding(bottom = false)
+ )
+ }
+}
diff --git a/compose/integration-tests/material-catalog/src/main/java/androidx/compose/material/catalog/ui/theme/Theme.kt b/compose/integration-tests/material-catalog/src/main/java/androidx/compose/material/catalog/ui/theme/Theme.kt
new file mode 100644
index 0000000..48fd160a
--- /dev/null
+++ b/compose/integration-tests/material-catalog/src/main/java/androidx/compose/material/catalog/ui/theme/Theme.kt
@@ -0,0 +1,34 @@
+/*
+ * Copyright 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES 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.compose.material.catalog.ui.theme
+
+import androidx.compose.foundation.isSystemInDarkTheme
+import androidx.compose.material.MaterialTheme
+import androidx.compose.material.darkColors
+import androidx.compose.material.lightColors
+import androidx.compose.runtime.Composable
+
+// TODO: Use components/values from Material3 when available
+@Composable
+fun CatalogTheme(content: @Composable () -> Unit) {
+ val darkTheme = isSystemInDarkTheme()
+ val colors = if (!darkTheme) lightColors() else darkColors()
+ MaterialTheme(
+ colors = colors,
+ content = content
+ )
+}
diff --git a/compose/material/material/integration-tests/material-catalog/src/main/res/drawable/ic_launcher_foreground.xml b/compose/integration-tests/material-catalog/src/main/res/drawable/ic_launcher_foreground.xml
similarity index 100%
rename from compose/material/material/integration-tests/material-catalog/src/main/res/drawable/ic_launcher_foreground.xml
rename to compose/integration-tests/material-catalog/src/main/res/drawable/ic_launcher_foreground.xml
diff --git a/compose/material/material/integration-tests/material-catalog/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/compose/integration-tests/material-catalog/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
similarity index 100%
rename from compose/material/material/integration-tests/material-catalog/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
rename to compose/integration-tests/material-catalog/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
diff --git a/compose/material/material/integration-tests/material-catalog/src/main/res/mipmap-hdpi/ic_launcher.png b/compose/integration-tests/material-catalog/src/main/res/mipmap-hdpi/ic_launcher.png
similarity index 100%
rename from compose/material/material/integration-tests/material-catalog/src/main/res/mipmap-hdpi/ic_launcher.png
rename to compose/integration-tests/material-catalog/src/main/res/mipmap-hdpi/ic_launcher.png
Binary files differ
diff --git a/compose/material/material/integration-tests/material-catalog/src/main/res/mipmap-mdpi/ic_launcher.png b/compose/integration-tests/material-catalog/src/main/res/mipmap-mdpi/ic_launcher.png
similarity index 100%
rename from compose/material/material/integration-tests/material-catalog/src/main/res/mipmap-mdpi/ic_launcher.png
rename to compose/integration-tests/material-catalog/src/main/res/mipmap-mdpi/ic_launcher.png
Binary files differ
diff --git a/compose/material/material/integration-tests/material-catalog/src/main/res/mipmap-xhdpi/ic_launcher.png b/compose/integration-tests/material-catalog/src/main/res/mipmap-xhdpi/ic_launcher.png
similarity index 100%
rename from compose/material/material/integration-tests/material-catalog/src/main/res/mipmap-xhdpi/ic_launcher.png
rename to compose/integration-tests/material-catalog/src/main/res/mipmap-xhdpi/ic_launcher.png
Binary files differ
diff --git a/compose/material/material/integration-tests/material-catalog/src/main/res/mipmap-xxhdpi/ic_launcher.png b/compose/integration-tests/material-catalog/src/main/res/mipmap-xxhdpi/ic_launcher.png
similarity index 100%
rename from compose/material/material/integration-tests/material-catalog/src/main/res/mipmap-xxhdpi/ic_launcher.png
rename to compose/integration-tests/material-catalog/src/main/res/mipmap-xxhdpi/ic_launcher.png
Binary files differ
diff --git a/compose/material/material/integration-tests/material-catalog/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/compose/integration-tests/material-catalog/src/main/res/mipmap-xxxhdpi/ic_launcher.png
similarity index 100%
rename from compose/material/material/integration-tests/material-catalog/src/main/res/mipmap-xxxhdpi/ic_launcher.png
rename to compose/integration-tests/material-catalog/src/main/res/mipmap-xxxhdpi/ic_launcher.png
Binary files differ
diff --git a/compose/material/material/integration-tests/material-catalog/src/main/res/values-night/themes.xml b/compose/integration-tests/material-catalog/src/main/res/values-night/themes.xml
similarity index 100%
rename from compose/material/material/integration-tests/material-catalog/src/main/res/values-night/themes.xml
rename to compose/integration-tests/material-catalog/src/main/res/values-night/themes.xml
diff --git a/compose/material/material/integration-tests/material-catalog/src/main/res/values/colors.xml b/compose/integration-tests/material-catalog/src/main/res/values/colors.xml
similarity index 100%
rename from compose/material/material/integration-tests/material-catalog/src/main/res/values/colors.xml
rename to compose/integration-tests/material-catalog/src/main/res/values/colors.xml
diff --git a/core/core-splashscreen/samples/src/main/res/drawable/foreground.xml b/compose/integration-tests/material-catalog/src/main/res/values/donottranslate-strings.xml
similarity index 75%
copy from core/core-splashscreen/samples/src/main/res/drawable/foreground.xml
copy to compose/integration-tests/material-catalog/src/main/res/values/donottranslate-strings.xml
index c46194a..bde9dc6 100644
--- a/core/core-splashscreen/samples/src/main/res/drawable/foreground.xml
+++ b/compose/integration-tests/material-catalog/src/main/res/values/donottranslate-strings.xml
@@ -1,4 +1,5 @@
-<?xml version="1.0" encoding="utf-8"?><!--
+<?xml version="1.0" encoding="utf-8"?>
+<!--
Copyright 2021 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
@@ -14,7 +15,8 @@
limitations under the License.
-->
-<inset xmlns:android="http://schemas.android.com/apk/res/android"
- android:drawable="@drawable/android"
- android:inset="25%">
-</inset>
\ No newline at end of file
+<resources>
+
+ <string name="compose_material_catalog">Compose Material Catalog</string>
+
+</resources>
diff --git a/compose/material/material/integration-tests/material-catalog/src/main/res/values/themes.xml b/compose/integration-tests/material-catalog/src/main/res/values/themes.xml
similarity index 100%
rename from compose/material/material/integration-tests/material-catalog/src/main/res/values/themes.xml
rename to compose/integration-tests/material-catalog/src/main/res/values/themes.xml
diff --git a/compose/material/material-ripple/src/androidMain/kotlin/androidx/compose/material/ripple/RippleHostView.android.kt b/compose/material/material-ripple/src/androidMain/kotlin/androidx/compose/material/ripple/RippleHostView.android.kt
index 8263ae4..ae926e8 100644
--- a/compose/material/material-ripple/src/androidMain/kotlin/androidx/compose/material/ripple/RippleHostView.android.kt
+++ b/compose/material/material-ripple/src/androidMain/kotlin/androidx/compose/material/ripple/RippleHostView.android.kt
@@ -376,7 +376,7 @@
// Note: above 28 the ripple alpha is clamped to 50%, so this might not be the
// _actual_ alpha that is used in the ripple.
alpha
- }
+ }.coerceAtMost(1f)
return color.copy(alpha = transformedAlpha)
}
diff --git a/compose/material/material/api/current.txt b/compose/material/material/api/current.txt
index 6c6bfd5..47a989b 100644
--- a/compose/material/material/api/current.txt
+++ b/compose/material/material/api/current.txt
@@ -313,6 +313,9 @@
method @androidx.compose.runtime.Composable public static void MaterialTheme(optional androidx.compose.material.Colors colors, optional androidx.compose.material.Typography typography, optional androidx.compose.material.Shapes shapes, kotlin.jvm.functions.Function0<kotlin.Unit> content);
}
+ public final class MaterialTheme_androidKt {
+ }
+
public final class MenuDefaults {
method public androidx.compose.foundation.layout.PaddingValues getDropdownMenuItemContentPadding();
property public final androidx.compose.foundation.layout.PaddingValues DropdownMenuItemContentPadding;
@@ -584,6 +587,9 @@
method public static androidx.compose.runtime.ProvidableCompositionLocal<androidx.compose.ui.text.TextStyle> getLocalTextStyle();
}
+ public final class TouchTargetKt {
+ }
+
@androidx.compose.runtime.Immutable public final class Typography {
ctor public Typography(optional androidx.compose.ui.text.font.FontFamily defaultFontFamily, optional androidx.compose.ui.text.TextStyle h1, optional androidx.compose.ui.text.TextStyle h2, optional androidx.compose.ui.text.TextStyle h3, optional androidx.compose.ui.text.TextStyle h4, optional androidx.compose.ui.text.TextStyle h5, optional androidx.compose.ui.text.TextStyle h6, optional androidx.compose.ui.text.TextStyle subtitle1, optional androidx.compose.ui.text.TextStyle subtitle2, optional androidx.compose.ui.text.TextStyle body1, optional androidx.compose.ui.text.TextStyle body2, optional androidx.compose.ui.text.TextStyle button, optional androidx.compose.ui.text.TextStyle caption, optional androidx.compose.ui.text.TextStyle overline);
method public androidx.compose.material.Typography copy(optional androidx.compose.ui.text.TextStyle h1, optional androidx.compose.ui.text.TextStyle h2, optional androidx.compose.ui.text.TextStyle h3, optional androidx.compose.ui.text.TextStyle h4, optional androidx.compose.ui.text.TextStyle h5, optional androidx.compose.ui.text.TextStyle h6, optional androidx.compose.ui.text.TextStyle subtitle1, optional androidx.compose.ui.text.TextStyle subtitle2, optional androidx.compose.ui.text.TextStyle body1, optional androidx.compose.ui.text.TextStyle body2, optional androidx.compose.ui.text.TextStyle button, optional androidx.compose.ui.text.TextStyle caption, optional androidx.compose.ui.text.TextStyle overline);
diff --git a/compose/material/material/api/public_plus_experimental_current.txt b/compose/material/material/api/public_plus_experimental_current.txt
index dd91948..08a7f21 100644
--- a/compose/material/material/api/public_plus_experimental_current.txt
+++ b/compose/material/material/api/public_plus_experimental_current.txt
@@ -435,6 +435,9 @@
method @androidx.compose.runtime.Composable public static void MaterialTheme(optional androidx.compose.material.Colors colors, optional androidx.compose.material.Typography typography, optional androidx.compose.material.Shapes shapes, kotlin.jvm.functions.Function0<kotlin.Unit> content);
}
+ public final class MaterialTheme_androidKt {
+ }
+
public final class MenuDefaults {
method public androidx.compose.foundation.layout.PaddingValues getDropdownMenuItemContentPadding();
property public final androidx.compose.foundation.layout.PaddingValues DropdownMenuItemContentPadding;
@@ -788,6 +791,10 @@
method public float computeThreshold(androidx.compose.ui.unit.Density, float fromValue, float toValue);
}
+ public final class TouchTargetKt {
+ method @androidx.compose.material.ExperimentalMaterialApi public static androidx.compose.runtime.ProvidableCompositionLocal<java.lang.Boolean> getLocalMinimumTouchTargetEnforcement();
+ }
+
@androidx.compose.runtime.Immutable public final class Typography {
ctor public Typography(optional androidx.compose.ui.text.font.FontFamily defaultFontFamily, optional androidx.compose.ui.text.TextStyle h1, optional androidx.compose.ui.text.TextStyle h2, optional androidx.compose.ui.text.TextStyle h3, optional androidx.compose.ui.text.TextStyle h4, optional androidx.compose.ui.text.TextStyle h5, optional androidx.compose.ui.text.TextStyle h6, optional androidx.compose.ui.text.TextStyle subtitle1, optional androidx.compose.ui.text.TextStyle subtitle2, optional androidx.compose.ui.text.TextStyle body1, optional androidx.compose.ui.text.TextStyle body2, optional androidx.compose.ui.text.TextStyle button, optional androidx.compose.ui.text.TextStyle caption, optional androidx.compose.ui.text.TextStyle overline);
method public androidx.compose.material.Typography copy(optional androidx.compose.ui.text.TextStyle h1, optional androidx.compose.ui.text.TextStyle h2, optional androidx.compose.ui.text.TextStyle h3, optional androidx.compose.ui.text.TextStyle h4, optional androidx.compose.ui.text.TextStyle h5, optional androidx.compose.ui.text.TextStyle h6, optional androidx.compose.ui.text.TextStyle subtitle1, optional androidx.compose.ui.text.TextStyle subtitle2, optional androidx.compose.ui.text.TextStyle body1, optional androidx.compose.ui.text.TextStyle body2, optional androidx.compose.ui.text.TextStyle button, optional androidx.compose.ui.text.TextStyle caption, optional androidx.compose.ui.text.TextStyle overline);
diff --git a/compose/material/material/api/restricted_current.txt b/compose/material/material/api/restricted_current.txt
index 6c6bfd5..47a989b 100644
--- a/compose/material/material/api/restricted_current.txt
+++ b/compose/material/material/api/restricted_current.txt
@@ -313,6 +313,9 @@
method @androidx.compose.runtime.Composable public static void MaterialTheme(optional androidx.compose.material.Colors colors, optional androidx.compose.material.Typography typography, optional androidx.compose.material.Shapes shapes, kotlin.jvm.functions.Function0<kotlin.Unit> content);
}
+ public final class MaterialTheme_androidKt {
+ }
+
public final class MenuDefaults {
method public androidx.compose.foundation.layout.PaddingValues getDropdownMenuItemContentPadding();
property public final androidx.compose.foundation.layout.PaddingValues DropdownMenuItemContentPadding;
@@ -584,6 +587,9 @@
method public static androidx.compose.runtime.ProvidableCompositionLocal<androidx.compose.ui.text.TextStyle> getLocalTextStyle();
}
+ public final class TouchTargetKt {
+ }
+
@androidx.compose.runtime.Immutable public final class Typography {
ctor public Typography(optional androidx.compose.ui.text.font.FontFamily defaultFontFamily, optional androidx.compose.ui.text.TextStyle h1, optional androidx.compose.ui.text.TextStyle h2, optional androidx.compose.ui.text.TextStyle h3, optional androidx.compose.ui.text.TextStyle h4, optional androidx.compose.ui.text.TextStyle h5, optional androidx.compose.ui.text.TextStyle h6, optional androidx.compose.ui.text.TextStyle subtitle1, optional androidx.compose.ui.text.TextStyle subtitle2, optional androidx.compose.ui.text.TextStyle body1, optional androidx.compose.ui.text.TextStyle body2, optional androidx.compose.ui.text.TextStyle button, optional androidx.compose.ui.text.TextStyle caption, optional androidx.compose.ui.text.TextStyle overline);
method public androidx.compose.material.Typography copy(optional androidx.compose.ui.text.TextStyle h1, optional androidx.compose.ui.text.TextStyle h2, optional androidx.compose.ui.text.TextStyle h3, optional androidx.compose.ui.text.TextStyle h4, optional androidx.compose.ui.text.TextStyle h5, optional androidx.compose.ui.text.TextStyle h6, optional androidx.compose.ui.text.TextStyle subtitle1, optional androidx.compose.ui.text.TextStyle subtitle2, optional androidx.compose.ui.text.TextStyle body1, optional androidx.compose.ui.text.TextStyle body2, optional androidx.compose.ui.text.TextStyle button, optional androidx.compose.ui.text.TextStyle caption, optional androidx.compose.ui.text.TextStyle overline);
diff --git a/compose/material/material/integration-tests/material-catalog/build.gradle b/compose/material/material/integration-tests/material-catalog/build.gradle
index 2d43135..e7d62f0 100644
--- a/compose/material/material/integration-tests/material-catalog/build.gradle
+++ b/compose/material/material/integration-tests/material-catalog/build.gradle
@@ -15,60 +15,27 @@
*/
-import androidx.build.BuildOnServerKt
-import androidx.build.BuildServerConfigurationKt
import androidx.build.Publish
plugins {
id("AndroidXPlugin")
- id("com.android.application")
+ id("com.android.library")
id("AndroidXComposePlugin")
id("org.jetbrains.kotlin.android")
}
-android {
- defaultConfig {
- applicationId "androidx.compose.material.catalog"
- versionCode 1001
- versionName "1.0.1"
- }
- buildTypes {
- release {
- minifyEnabled true
- shrinkResources true
- proguardFiles getDefaultProguardFile('proguard-android-optimize.txt')
- }
- }
-}
-
dependencies {
kotlinPlugin project(":compose:compiler:compiler")
implementation(libs.kotlinStdlib)
+ implementation project(":core:core")
+ implementation project(":compose:runtime:runtime")
implementation project(":compose:ui:ui")
implementation project(":compose:material:material")
implementation project(":compose:material:material:material-samples")
- implementation "androidx.activity:activity-compose:1.3.1"
implementation project(":navigation:navigation-compose")
+ implementation "com.google.accompanist:accompanist-insets:0.18.0"
}
-// We want to publish a release APK of this project for the Compose Material Catalog
-def copyReleaseApk = tasks.register("copyReleaseApk", Copy) { task ->
- android.applicationVariants.all { variant ->
- if (variant.buildType.name == "release") {
- task.from(variant.packageApplicationProvider.get().outputDirectory)
- }
- }
- task.include("*.apk")
- task.rename { fileName ->
- "${project.path.substring(1).replace(':', '-')}_$fileName"
- }
- task.destinationDir =
- new File(BuildServerConfigurationKt.getDistributionDirectory(project), "apks")
- task.dependsOn(project.path + ":assembleRelease")
-}
-
-BuildOnServerKt.addToBuildOnServer(project, copyReleaseApk)
-
androidx {
name = "Compose Material Catalog"
publish = Publish.NONE
diff --git a/compose/material/material/integration-tests/material-catalog/src/main/AndroidManifest.xml b/compose/material/material/integration-tests/material-catalog/src/main/AndroidManifest.xml
index 4034da7..a3ef31f 100644
--- a/compose/material/material/integration-tests/material-catalog/src/main/AndroidManifest.xml
+++ b/compose/material/material/integration-tests/material-catalog/src/main/AndroidManifest.xml
@@ -15,19 +15,4 @@
~ limitations under the License
-->
-<manifest
- xmlns:android="http://schemas.android.com/apk/res/android"
- package="androidx.compose.material.catalog">
-
- <application
- android:label="@string/compose_material_catalog"
- android:icon="@mipmap/ic_launcher"
- android:theme="@style/Theme.Catalog">
- <activity android:name=".CatalogActivity" android:exported="true">
- <intent-filter>
- <action android:name="android.intent.action.MAIN" />
- <category android:name="android.intent.category.LAUNCHER" />
- </intent-filter>
- </activity>
- </application>
-</manifest>
+<manifest package="androidx.compose.material.catalog.library" />
diff --git a/compose/material/material/integration-tests/material-catalog/src/main/java/androidx/compose/material/catalog/insets/Insets.kt b/compose/material/material/integration-tests/material-catalog/src/main/java/androidx/compose/material/catalog/insets/Insets.kt
deleted file mode 100644
index 0fb5516..0000000
--- a/compose/material/material/integration-tests/material-catalog/src/main/java/androidx/compose/material/catalog/insets/Insets.kt
+++ /dev/null
@@ -1,640 +0,0 @@
-/*
- * Copyright 2021 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/**
- * TODO: Move to depending on Accompanist with prebuilts when we hit a stable version
- * https://github.com/google/accompanist/blob/main/insets/src/main/java/com/google/accompanist
- * /insets/Insets.kt
- */
-
-@file:Suppress("NOTHING_TO_INLINE", "unused", "PropertyName")
-
-@file:JvmName("ComposeInsets")
-@file:JvmMultifileClass
-
-package androidx.compose.material.catalog.insets
-
-import android.annotation.SuppressLint
-import android.view.View
-import android.view.WindowInsetsAnimation
-import androidx.annotation.FloatRange
-import androidx.annotation.IntRange
-import androidx.compose.runtime.Composable
-import androidx.compose.runtime.CompositionLocalProvider
-import androidx.compose.runtime.DisposableEffect
-import androidx.compose.runtime.Stable
-import androidx.compose.runtime.getValue
-import androidx.compose.runtime.mutableStateOf
-import androidx.compose.runtime.remember
-import androidx.compose.runtime.setValue
-import androidx.compose.runtime.staticCompositionLocalOf
-import androidx.compose.ui.platform.LocalView
-import androidx.core.view.ViewCompat
-import androidx.core.view.WindowInsetsAnimationCompat
-import androidx.core.view.WindowInsetsCompat
-
-/**
- * Main holder of our inset values.
- */
-@Stable
-class WindowInsets {
- /**
- * Inset values which match [WindowInsetsCompat.Type.systemBars]
- */
- val systemBars: InsetsType = InsetsType()
-
- /**
- * Inset values which match [WindowInsetsCompat.Type.systemGestures]
- */
- val systemGestures: InsetsType = InsetsType()
-
- /**
- * Inset values which match [WindowInsetsCompat.Type.navigationBars]
- */
- val navigationBars: InsetsType = InsetsType()
-
- /**
- * Inset values which match [WindowInsetsCompat.Type.statusBars]
- */
- val statusBars: InsetsType = InsetsType()
-
- /**
- * Inset values which match [WindowInsetsCompat.Type.ime]
- */
- val ime: InsetsType = InsetsType()
-}
-
-/**
- * Represents the values for a type of insets, and stores information about the layout insets,
- * animating insets, and visibility of the insets.
- *
- * [InsetsType] instances are commonly stored in a [WindowInsets] instance.
- */
-@Stable
-@Suppress("MemberVisibilityCanBePrivate")
-class InsetsType : Insets {
- private var ongoingAnimationsCount by mutableStateOf(0)
- internal val _layoutInsets = MutableInsets()
- internal val _animatedInsets = MutableInsets()
-
- /**
- * The layout insets for this [InsetsType]. These are the insets which are defined from the
- * current window layout.
- *
- * You should not normally need to use this directly, and instead use [left], [top],
- * [right], and [bottom] to return the correct value for the current state.
- */
- val layoutInsets: Insets
- get() = _layoutInsets
-
- /**
- * The animated insets for this [InsetsType]. These are the insets which are updated from
- * any on-going animations. If there are no animations in progress, the returned [Insets] will
- * be empty.
- *
- * You should not normally need to use this directly, and instead use [left], [top],
- * [right], and [bottom] to return the correct value for the current state.
- */
- val animatedInsets: Insets
- get() = _animatedInsets
-
- /**
- * The left dimension of the insets in pixels.
- */
- override val left: Int
- get() = (if (animationInProgress) animatedInsets else layoutInsets).left
-
- /**
- * The top dimension of the insets in pixels.
- */
- override val top: Int
- get() = (if (animationInProgress) animatedInsets else layoutInsets).top
-
- /**
- * The right dimension of the insets in pixels.
- */
- override val right: Int
- get() = (if (animationInProgress) animatedInsets else layoutInsets).right
-
- /**
- * The bottom dimension of the insets in pixels.
- */
- override val bottom: Int
- get() = (if (animationInProgress) animatedInsets else layoutInsets).bottom
-
- /**
- * Whether the insets are currently visible.
- */
- var isVisible by mutableStateOf(true)
- internal set
-
- /**
- * Whether this insets type is being animated at this moment.
- */
- val animationInProgress: Boolean
- get() = ongoingAnimationsCount > 0
-
- /**
- * The progress of any ongoing animations, in the range of 0 to 1.
- * If there is no animation in progress, this will return 0.
- */
- @get:FloatRange(from = 0.0, to = 1.0)
- var animationFraction by mutableStateOf(0f)
- internal set
-
- internal fun onAnimationStart() {
- ongoingAnimationsCount++
- }
-
- internal fun onAnimationEnd() {
- ongoingAnimationsCount--
-
- if (ongoingAnimationsCount == 0) {
- // If there are no on-going animations, clear out the animated insets
- _animatedInsets.reset()
- animationFraction = 0f
- }
- }
-}
-
-@Stable
-interface Insets {
- /**
- * The left dimension of these insets in pixels.
- */
- @get:IntRange(from = 0)
- val left: Int
-
- /**
- * The top dimension of these insets in pixels.
- */
- @get:IntRange(from = 0)
- val top: Int
-
- /**
- * The right dimension of these insets in pixels.
- */
- @get:IntRange(from = 0)
- val right: Int
-
- /**
- * The bottom dimension of these insets in pixels.
- */
- @get:IntRange(from = 0)
- val bottom: Int
-
- fun copy(
- left: Int = this.left,
- top: Int = this.top,
- right: Int = this.right,
- bottom: Int = this.bottom,
- ): Insets = MutableInsets(left, top, right, bottom)
-
- operator fun minus(other: Insets): Insets = copy(
- left = this.left - other.left,
- top = this.top - other.top,
- right = this.right - other.right,
- bottom = this.bottom - other.bottom,
- )
-
- operator fun plus(other: Insets): Insets = copy(
- left = this.left + other.left,
- top = this.top + other.top,
- right = this.right + other.right,
- bottom = this.bottom + other.bottom,
- )
-}
-
-internal class MutableInsets(
- left: Int = 0,
- top: Int = 0,
- right: Int = 0,
- bottom: Int = 0,
-) : Insets {
- override var left by mutableStateOf(left)
- internal set
-
- override var top by mutableStateOf(top)
- internal set
-
- override var right by mutableStateOf(right)
- internal set
-
- override var bottom by mutableStateOf(bottom)
- internal set
-
- fun reset() {
- left = 0
- top = 0
- right = 0
- bottom = 0
- }
-}
-
-/**
- * Composition local containing the current [WindowInsets].
- */
-val LocalWindowInsets = staticCompositionLocalOf { WindowInsets() }
-
-/**
- * This class sets up the necessary listeners on the given [view] to be able to observe
- * [WindowInsetsCompat] instances dispatched by the system.
- *
- * This class is useful for when you prefer to handle the ownership of the [WindowInsets]
- * yourself. One example of this is if you find yourself using [ProvideWindowInsets] in fragments.
- *
- * It is convenient to use [ProvideWindowInsets] in fragments, but that can result in a
- * delay in the initial inset update, which results in a visual flicker.
- * See [this issue](https://github.com/google/accompanist/issues/155) for more information.
- *
- * The alternative is for fragments to manage the [WindowInsets] themselves, like so:
- *
- * ```
- * override fun onCreateView(
- * inflater: LayoutInflater,
- * container: ViewGroup?,
- * savedInstanceState: Bundle?
- * ): View = ComposeView(requireContext()).apply {
- * layoutParams = LayoutParams(MATCH_PARENT, MATCH_PARENT)
- *
- * // Create an ViewWindowInsetObserver using this view
- * val observer = ViewWindowInsetObserver(this)
- *
- * // Call start() to start listening now.
- * // The WindowInsets instance is returned to us.
- * val windowInsets = observer.start()
- *
- * setContent {
- * // Instead of calling ProvideWindowInsets, we use CompositionLocalProvider to provide
- * // the WindowInsets instance from above to LocalWindowInsets
- * CompositionLocalProvider(LocalWindowInsets provides windowInsets) {
- * /* Content */
- * }
- * }
- * }
- * ```
- *
- * @param view The view to observe [WindowInsetsCompat]s from.
- */
-class ViewWindowInsetObserver(private val view: View) {
- private val attachListener = object : View.OnAttachStateChangeListener {
- override fun onViewAttachedToWindow(v: View) = v.requestApplyInsets()
- override fun onViewDetachedFromWindow(v: View) = Unit
- }
-
- /**
- * Whether this [ViewWindowInsetObserver] is currently observing.
- */
- @Suppress("MemberVisibilityCanBePrivate")
- var isObserving: Boolean = false
- private set
-
- /**
- * Start observing window insets from [view]. Make sure to call [stop] if required.
- *
- * @param consumeWindowInsets Whether to consume any [WindowInsetsCompat]s which are
- * dispatched to the host view. Defaults to `true`.
- */
- fun start(
- consumeWindowInsets: Boolean = true
- ): WindowInsets {
- return WindowInsets().apply {
- observeInto(
- windowInsets = this,
- consumeWindowInsets = consumeWindowInsets,
- windowInsetsAnimationsEnabled = false
- )
- }
- }
-
- /**
- * Start observing window insets from [view]. Make sure to call [stop] if required.
- *
- * @param windowInsetsAnimationsEnabled Whether to listen for [WindowInsetsAnimation]s, such as
- * IME animations.
- * @param consumeWindowInsets Whether to consume any [WindowInsetsCompat]s which are
- * dispatched to the host view. Defaults to `true`.
- */
- @ExperimentalAnimatedInsets
- fun start(
- windowInsetsAnimationsEnabled: Boolean,
- consumeWindowInsets: Boolean = true,
- ): WindowInsets {
- return WindowInsets().apply {
- observeInto(
- windowInsets = this,
- consumeWindowInsets = consumeWindowInsets,
- windowInsetsAnimationsEnabled = windowInsetsAnimationsEnabled
- )
- }
- }
-
- internal fun observeInto(
- windowInsets: WindowInsets,
- consumeWindowInsets: Boolean,
- windowInsetsAnimationsEnabled: Boolean,
- ) {
- require(!isObserving) {
- "start() called, but this ViewWindowInsetObserver is already observing"
- }
-
- ViewCompat.setOnApplyWindowInsetsListener(view) { _, wic ->
- // Go through each inset type and update its layoutInsets from the
- // WindowInsetsCompat values
- windowInsets.statusBars.run {
- _layoutInsets.updateFrom(wic.getInsets(WindowInsetsCompat.Type.statusBars()))
- isVisible = wic.isVisible(WindowInsetsCompat.Type.statusBars())
- }
- windowInsets.navigationBars.run {
- _layoutInsets.updateFrom(wic.getInsets(WindowInsetsCompat.Type.navigationBars()))
- isVisible = wic.isVisible(WindowInsetsCompat.Type.navigationBars())
- }
- windowInsets.systemBars.run {
- _layoutInsets.updateFrom(wic.getInsets(WindowInsetsCompat.Type.systemBars()))
- isVisible = wic.isVisible(WindowInsetsCompat.Type.systemBars())
- }
- windowInsets.systemGestures.run {
- _layoutInsets.updateFrom(wic.getInsets(WindowInsetsCompat.Type.systemGestures()))
- isVisible = wic.isVisible(WindowInsetsCompat.Type.systemGestures())
- }
- windowInsets.ime.run {
- _layoutInsets.updateFrom(wic.getInsets(WindowInsetsCompat.Type.ime()))
- isVisible = wic.isVisible(WindowInsetsCompat.Type.ime())
- }
-
- if (consumeWindowInsets) WindowInsetsCompat.CONSUMED else wic
- }
-
- // Add an OnAttachStateChangeListener to request an inset pass each time we're attached
- // to the window
- view.addOnAttachStateChangeListener(attachListener)
-
- if (windowInsetsAnimationsEnabled) {
- ViewCompat.setWindowInsetsAnimationCallback(
- view,
- InnerWindowInsetsAnimationCallback(windowInsets)
- )
- } else {
- ViewCompat.setWindowInsetsAnimationCallback(view, null)
- }
-
- if (view.isAttachedToWindow) {
- // If the view is already attached, we can request an inset pass now
- view.requestApplyInsets()
- }
-
- isObserving = true
- }
-
- /**
- * Removes any listeners from the [view] so that we no longer observe inset changes.
- *
- * This is only required to be called from hosts which have a shorter lifetime than the [view].
- * For example, if you're using [ViewWindowInsetObserver] from a `@Composable` function,
- * you should call [stop] from an `onDispose` block, like so:
- *
- * ```
- * DisposableEffect(view) {
- * val observer = ViewWindowInsetObserver(view)
- * // ...
- * onDispose {
- * observer.stop()
- * }
- * }
- * ```
- *
- * Whereas if you're using this class from a fragment (or similar), it is not required to
- * call this function since it will live as least as longer as the view.
- */
- fun stop() {
- require(isObserving) {
- "stop() called, but this ViewWindowInsetObserver is not currently observing"
- }
- view.removeOnAttachStateChangeListener(attachListener)
- ViewCompat.setOnApplyWindowInsetsListener(view, null)
- isObserving = false
- }
-}
-
-/**
- * Applies any [WindowInsetsCompat] values to [LocalWindowInsets], which are then available
- * within [content].
- *
- * If you're using this in fragments, you may wish to take a look at
- * [ViewWindowInsetObserver] for a more optimal solution.
- *
- * @param consumeWindowInsets Whether to consume any [WindowInsetsCompat]s which are dispatched to
- * the host view. Defaults to `true`.
- */
-@SuppressLint("UnnecessaryLambdaCreation")
-@Composable
-fun ProvideWindowInsets(
- consumeWindowInsets: Boolean = true,
- content: @Composable () -> Unit,
-) {
- val view = LocalView.current
- val windowInsets = LocalWindowInsets.current
-
- DisposableEffect(view) {
- val observer = ViewWindowInsetObserver(view)
- observer.observeInto(
- windowInsets = windowInsets,
- consumeWindowInsets = consumeWindowInsets,
- windowInsetsAnimationsEnabled = false
- )
- onDispose {
- observer.stop()
- }
- }
-
- CompositionLocalProvider(LocalWindowInsets provides windowInsets) {
- content()
- }
-}
-
-/**
- * Applies any [WindowInsetsCompat] values to [LocalWindowInsets], which are then available
- * within [content].
- *
- * If you're using this in fragments, you may wish to take a look at
- * [ViewWindowInsetObserver] for a more optimal solution.
- *
- * @param windowInsetsAnimationsEnabled Whether to listen for [WindowInsetsAnimation]s, such as
- * IME animations.
- * @param consumeWindowInsets Whether to consume any [WindowInsetsCompat]s which are dispatched to
- * the host view. Defaults to `true`.
- */
-@SuppressLint("UnnecessaryLambdaCreation")
-@ExperimentalAnimatedInsets
-@Composable
-fun ProvideWindowInsets(
- windowInsetsAnimationsEnabled: Boolean,
- consumeWindowInsets: Boolean = true,
- content: @Composable () -> Unit
-) {
- val view = LocalView.current
- val windowInsets = remember { WindowInsets() }
-
- DisposableEffect(view) {
- val observer = ViewWindowInsetObserver(view)
- observer.observeInto(
- windowInsets = windowInsets,
- consumeWindowInsets = consumeWindowInsets,
- windowInsetsAnimationsEnabled = windowInsetsAnimationsEnabled
- )
- onDispose {
- observer.stop()
- }
- }
-
- CompositionLocalProvider(LocalWindowInsets provides windowInsets) {
- content()
- }
-}
-
-private class InnerWindowInsetsAnimationCallback(
- private val windowInsets: WindowInsets,
-) : WindowInsetsAnimationCompat.Callback(DISPATCH_MODE_STOP) {
- override fun onPrepare(animation: WindowInsetsAnimationCompat) {
- // Go through each type and flag that an animation has started
- if (animation.typeMask and WindowInsetsCompat.Type.ime() != 0) {
- windowInsets.ime.onAnimationStart()
- }
- if (animation.typeMask and WindowInsetsCompat.Type.statusBars() != 0) {
- windowInsets.statusBars.onAnimationStart()
- }
- if (animation.typeMask and WindowInsetsCompat.Type.navigationBars() != 0) {
- windowInsets.navigationBars.onAnimationStart()
- }
- if (animation.typeMask and WindowInsetsCompat.Type.systemBars() != 0) {
- windowInsets.systemBars.onAnimationStart()
- }
- if (animation.typeMask and WindowInsetsCompat.Type.systemGestures() != 0) {
- windowInsets.systemGestures.onAnimationStart()
- }
- }
-
- override fun onProgress(
- platformInsets: WindowInsetsCompat,
- runningAnimations: List<WindowInsetsAnimationCompat>
- ): WindowInsetsCompat {
- // Update each inset type with the given parameters
- windowInsets.ime.updateAnimation(
- platformInsets = platformInsets,
- runningAnimations = runningAnimations,
- type = WindowInsetsCompat.Type.ime()
- )
- windowInsets.statusBars.updateAnimation(
- platformInsets = platformInsets,
- runningAnimations = runningAnimations,
- type = WindowInsetsCompat.Type.statusBars()
- )
- windowInsets.navigationBars.updateAnimation(
- platformInsets = platformInsets,
- runningAnimations = runningAnimations,
- type = WindowInsetsCompat.Type.navigationBars()
- )
- windowInsets.systemBars.updateAnimation(
- platformInsets = platformInsets,
- runningAnimations = runningAnimations,
- type = WindowInsetsCompat.Type.systemBars()
- )
- windowInsets.systemBars.updateAnimation(
- platformInsets = platformInsets,
- runningAnimations = runningAnimations,
- type = WindowInsetsCompat.Type.systemGestures()
- )
- return platformInsets
- }
-
- private inline fun InsetsType.updateAnimation(
- platformInsets: WindowInsetsCompat,
- runningAnimations: List<WindowInsetsAnimationCompat>,
- type: Int,
- ) {
- // If there are animations of the given type...
- if (runningAnimations.any { it.typeMask or type != 0 }) {
- // Update our animated inset values
- _animatedInsets.updateFrom(platformInsets.getInsets(type))
- // And update the animation fraction. We use the maximum animation progress of any
- // ongoing animations for this type.
- animationFraction = runningAnimations.maxOf { it.fraction }
- }
- }
-
- override fun onEnd(animation: WindowInsetsAnimationCompat) {
- // Go through each type and flag that an animation has ended
- if (animation.typeMask and WindowInsetsCompat.Type.ime() != 0) {
- windowInsets.ime.onAnimationEnd()
- }
- if (animation.typeMask and WindowInsetsCompat.Type.statusBars() != 0) {
- windowInsets.statusBars.onAnimationEnd()
- }
- if (animation.typeMask and WindowInsetsCompat.Type.navigationBars() != 0) {
- windowInsets.navigationBars.onAnimationEnd()
- }
- if (animation.typeMask and WindowInsetsCompat.Type.systemBars() != 0) {
- windowInsets.systemBars.onAnimationEnd()
- }
- if (animation.typeMask and WindowInsetsCompat.Type.systemGestures() != 0) {
- windowInsets.systemGestures.onAnimationEnd()
- }
- }
-}
-
-/**
- * Updates our mutable state backed [InsetsType] from an Android system insets.
- */
-private fun MutableInsets.updateFrom(insets: androidx.core.graphics.Insets) {
- left = insets.left
- top = insets.top
- right = insets.right
- bottom = insets.bottom
-}
-
-/**
- * Ensures that each dimension is not less than corresponding dimension in the
- * specified [minimumValue].
- *
- * @return this if every dimension is greater than or equal to the corresponding
- * dimension value in [minimumValue], otherwise a copy of this with each dimension coerced with the
- * corresponding dimension value in [minimumValue].
- */
-fun InsetsType.coerceEachDimensionAtLeast(minimumValue: InsetsType): Insets {
- // Fast path, no need to copy if: this >= minimumValue
- if (left >= minimumValue.left && top >= minimumValue.top &&
- right >= minimumValue.right && bottom >= minimumValue.bottom
- ) {
- return this
- }
- return MutableInsets(
- left = left.coerceAtLeast(minimumValue.left),
- top = top.coerceAtLeast(minimumValue.top),
- right = right.coerceAtLeast(minimumValue.right),
- bottom = bottom.coerceAtLeast(minimumValue.bottom),
- )
-}
-
-enum class HorizontalSide { Left, Right }
-enum class VerticalSide { Top, Bottom }
-
-@RequiresOptIn(
- message = "Animated Insets support is experimental. The API may be changed in the " +
- "future."
-)
-@Retention(AnnotationRetention.BINARY)
-@Target(AnnotationTarget.CLASS, AnnotationTarget.FUNCTION)
-annotation class ExperimentalAnimatedInsets
diff --git a/compose/material/material/integration-tests/material-catalog/src/main/java/androidx/compose/material/catalog/insets/Padding.kt b/compose/material/material/integration-tests/material-catalog/src/main/java/androidx/compose/material/catalog/insets/Padding.kt
deleted file mode 100644
index c3fcfe6..0000000
--- a/compose/material/material/integration-tests/material-catalog/src/main/java/androidx/compose/material/catalog/insets/Padding.kt
+++ /dev/null
@@ -1,248 +0,0 @@
-/*
- * Copyright 2021 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/**
- * TODO: Move to depending on Accompanist with prebuilts when we hit a stable version
- * https://github.com/google/accompanist/blob/main/insets/src/main/java/com/google/accompanist
- * /insets/Padding.kt
- */
-
-@file:Suppress("NOTHING_TO_INLINE", "unused")
-
-@file:JvmName("ComposeInsets")
-@file:JvmMultifileClass
-
-package androidx.compose.material.catalog.insets
-
-import android.annotation.SuppressLint
-import androidx.compose.foundation.layout.PaddingValues
-import androidx.compose.runtime.Composable
-import androidx.compose.ui.Modifier
-import androidx.compose.ui.composed
-import androidx.compose.ui.layout.LayoutModifier
-import androidx.compose.ui.layout.Measurable
-import androidx.compose.ui.layout.MeasureResult
-import androidx.compose.ui.layout.MeasureScope
-import androidx.compose.ui.platform.LocalDensity
-import androidx.compose.ui.platform.LocalLayoutDirection
-import androidx.compose.ui.unit.Constraints
-import androidx.compose.ui.unit.Dp
-import androidx.compose.ui.unit.LayoutDirection
-import androidx.compose.ui.unit.dp
-import androidx.compose.ui.unit.offset
-
-/**
- * Selectively apply additional space which matches the width/height of any system bars present
- * on the respective edges of the screen.
- *
- * @param enabled Whether to apply padding using the system bars dimensions on the respective edges.
- * Defaults to `true`.
- */
-@SuppressLint("ModifierInspectorInfo")
-fun Modifier.systemBarsPadding(
- enabled: Boolean = true
-): Modifier = composed {
- InsetsPaddingModifier(
- insetsType = LocalWindowInsets.current.systemBars,
- applyLeft = enabled,
- applyTop = enabled,
- applyRight = enabled,
- applyBottom = enabled
- )
-}
-
-/**
- * Apply additional space which matches the height of the status bars height along the top edge
- * of the content.
- */
-@SuppressLint("ModifierInspectorInfo")
-fun Modifier.statusBarsPadding(): Modifier = composed {
- InsetsPaddingModifier(
- insetsType = LocalWindowInsets.current.statusBars,
- applyTop = true
- )
-}
-
-/**
- * Apply additional space which matches the height of the navigation bars height
- * along the [bottom] edge of the content, and additional space which matches the width of
- * the navigation bars on the respective [left] and [right] edges.
- *
- * @param bottom Whether to apply padding to the bottom edge, which matches the navigation bars
- * height (if present) at the bottom edge of the screen. Defaults to `true`.
- * @param left Whether to apply padding to the left edge, which matches the navigation bars width
- * (if present) on the left edge of the screen. Defaults to `true`.
- * @param right Whether to apply padding to the right edge, which matches the navigation bars width
- * (if present) on the right edge of the screen. Defaults to `true`.
- */
-@SuppressLint("ModifierInspectorInfo")
-fun Modifier.navigationBarsPadding(
- bottom: Boolean = true,
- left: Boolean = true,
- right: Boolean = true
-): Modifier = composed {
- InsetsPaddingModifier(
- insetsType = LocalWindowInsets.current.navigationBars,
- applyLeft = left,
- applyRight = right,
- applyBottom = bottom
- )
-}
-
-/**
- * Apply additional space which matches the height of the [WindowInsets.ime] (on-screen keyboard)
- * height along the bottom edge of the content.
- *
- * This method has no special handling for the [WindowInsets.navigationBars], which usually
- * intersect the [WindowInsets.ime]. Most apps will usually want to use the
- * [Modifier.navigationBarsWithImePadding] modifier.
- */
-@SuppressLint("ModifierInspectorInfo")
-fun Modifier.imePadding(): Modifier = composed {
- InsetsPaddingModifier(
- insetsType = LocalWindowInsets.current.ime,
- applyLeft = true,
- applyRight = true,
- applyBottom = true,
- )
-}
-
-/**
- * Apply additional space which matches the height of the [WindowInsets.ime] (on-screen keyboard)
- * height and [WindowInsets.navigationBars]. This is what apps should use to handle any insets
- * at the bottom of the screen.
- */
-@SuppressLint("ModifierInspectorInfo")
-fun Modifier.navigationBarsWithImePadding(): Modifier = composed {
- InsetsPaddingModifier(
- insetsType = LocalWindowInsets.current.ime,
- minimumInsetsType = LocalWindowInsets.current.navigationBars,
- applyLeft = true,
- applyRight = true,
- applyBottom = true,
- )
-}
-
-private data class InsetsPaddingModifier(
- private val insetsType: InsetsType,
- private val minimumInsetsType: InsetsType? = null,
- private val applyLeft: Boolean = false,
- private val applyTop: Boolean = false,
- private val applyRight: Boolean = false,
- private val applyBottom: Boolean = false,
-) : LayoutModifier {
- override fun MeasureScope.measure(
- measurable: Measurable,
- constraints: Constraints
- ): MeasureResult {
- val transformedInsets = if (minimumInsetsType != null) {
- // If we have a minimum insets, coerce each dimensions
- insetsType.coerceEachDimensionAtLeast(minimumInsetsType)
- } else insetsType
-
- val left = if (applyLeft) transformedInsets.left else 0
- val top = if (applyTop) transformedInsets.top else 0
- val right = if (applyRight) transformedInsets.right else 0
- val bottom = if (applyBottom) transformedInsets.bottom else 0
- val horizontal = left + right
- val vertical = top + bottom
-
- val placeable = measurable.measure(constraints.offset(-horizontal, -vertical))
-
- val width = (placeable.width + horizontal)
- .coerceIn(constraints.minWidth, constraints.maxWidth)
- val height = (placeable.height + vertical)
- .coerceIn(constraints.minHeight, constraints.maxHeight)
- return layout(width, height) {
- placeable.place(left, top)
- }
- }
-}
-
-/**
- * Returns the current insets converted into a [PaddingValues].
- *
- * @param start Whether to apply the inset on the start dimension.
- * @param top Whether to apply the inset on the top dimension.
- * @param end Whether to apply the inset on the end dimension.
- * @param bottom Whether to apply the inset on the bottom dimension.
- * @param additionalHorizontal Value to add to the start and end dimensions.
- * @param additionalVertical Value to add to the top and bottom dimensions.
- */
-@Composable
-inline fun InsetsType.toPaddingValues(
- start: Boolean = true,
- top: Boolean = true,
- end: Boolean = true,
- bottom: Boolean = true,
- additionalHorizontal: Dp = 0.dp,
- additionalVertical: Dp = 0.dp,
-) = toPaddingValues(
- start = start,
- top = top,
- end = end,
- bottom = bottom,
- additionalStart = additionalHorizontal,
- additionalTop = additionalVertical,
- additionalEnd = additionalHorizontal,
- additionalBottom = additionalVertical
-)
-
-/**
- * Returns the current insets converted into a [PaddingValues].
- *
- * @param start Whether to apply the inset on the start dimension.
- * @param top Whether to apply the inset on the top dimension.
- * @param end Whether to apply the inset on the end dimension.
- * @param bottom Whether to apply the inset on the bottom dimension.
- * @param additionalStart Value to add to the start dimension.
- * @param additionalTop Value to add to the top dimension.
- * @param additionalEnd Value to add to the end dimension.
- * @param additionalBottom Value to add to the bottom dimension.
- */
-@Composable
-fun InsetsType.toPaddingValues(
- start: Boolean = true,
- top: Boolean = true,
- end: Boolean = true,
- bottom: Boolean = true,
- additionalStart: Dp = 0.dp,
- additionalTop: Dp = 0.dp,
- additionalEnd: Dp = 0.dp,
- additionalBottom: Dp = 0.dp,
-): PaddingValues = with(LocalDensity.current) {
- val layoutDirection = LocalLayoutDirection.current
- PaddingValues(
- start = additionalStart + when {
- start && layoutDirection == LayoutDirection.Ltr -> this@toPaddingValues.left.toDp()
- start && layoutDirection == LayoutDirection.Rtl -> this@toPaddingValues.right.toDp()
- else -> 0.dp
- },
- top = additionalTop + when {
- top -> this@toPaddingValues.top.toDp()
- else -> 0.dp
- },
- end = additionalEnd + when {
- end && layoutDirection == LayoutDirection.Ltr -> this@toPaddingValues.right.toDp()
- end && layoutDirection == LayoutDirection.Rtl -> this@toPaddingValues.left.toDp()
- else -> 0.dp
- },
- bottom = additionalBottom + when {
- bottom -> this@toPaddingValues.bottom.toDp()
- else -> 0.dp
- }
- )
-}
diff --git a/compose/material/material/integration-tests/material-catalog/src/main/java/androidx/compose/material/catalog/insets/Size.kt b/compose/material/material/integration-tests/material-catalog/src/main/java/androidx/compose/material/catalog/insets/Size.kt
deleted file mode 100644
index 115014d..0000000
--- a/compose/material/material/integration-tests/material-catalog/src/main/java/androidx/compose/material/catalog/insets/Size.kt
+++ /dev/null
@@ -1,270 +0,0 @@
-/*
- * Copyright 2021 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/**
- * TODO: Move to depending on Accompanist with prebuilts when we hit a stable version
- * https://github.com/google/accompanist/blob/main/insets/src/main/java/com/google/accompanist
- * /insets/Size.kt
- */
-
-@file:Suppress("NOTHING_TO_INLINE", "unused")
-
-@file:JvmName("ComposeInsets")
-@file:JvmMultifileClass
-
-package androidx.compose.material.catalog.insets
-
-import android.annotation.SuppressLint
-import androidx.compose.foundation.layout.height
-import androidx.compose.ui.Modifier
-import androidx.compose.ui.composed
-import androidx.compose.ui.layout.IntrinsicMeasurable
-import androidx.compose.ui.layout.IntrinsicMeasureScope
-import androidx.compose.ui.layout.LayoutModifier
-import androidx.compose.ui.layout.Measurable
-import androidx.compose.ui.layout.MeasureResult
-import androidx.compose.ui.layout.MeasureScope
-import androidx.compose.ui.unit.Constraints
-import androidx.compose.ui.unit.Density
-import androidx.compose.ui.unit.Dp
-import androidx.compose.ui.unit.dp
-
-/**
- * Declare the height of the content to match the height of the status bars exactly.
- *
- * This is very handy when used with `Spacer` to push content below the status bars:
- * ```
- * Column {
- * Spacer(Modifier.statusBarHeight())
- *
- * // Content to be drawn below status bars (y-axis)
- * }
- * ```
- *
- * It's also useful when used to draw a scrim which matches the status bars:
- * ```
- * Spacer(
- * Modifier.statusBarHeight()
- * .fillMaxWidth()
- * .drawBackground(MaterialTheme.colors.background.copy(alpha = 0.3f)
- * )
- * ```
- *
- * Internally this matches the behavior of the [Modifier.height] modifier.
- *
- * @param additional Any additional height to add to the status bars size.
- */
-@SuppressLint("ModifierInspectorInfo")
-fun Modifier.statusBarsHeight(
- additional: Dp = 0.dp
-): Modifier = composed {
- InsetsSizeModifier(
- insetsType = LocalWindowInsets.current.statusBars,
- heightSide = VerticalSide.Top,
- additionalHeight = additional
- )
-}
-
-/**
- * Declare the preferred height of the content to match the height of the navigation bars when
- * present at the bottom of the screen.
- *
- * This is very handy when used with `Spacer` to push content below the navigation bars:
- * ```
- * Column {
- * // Content to be drawn above status bars (y-axis)
- * Spacer(Modifier.navigationBarHeight())
- * }
- * ```
- *
- * It's also useful when used to draw a scrim which matches the navigation bars:
- * ```
- * Spacer(
- * Modifier.navigationBarHeight()
- * .fillMaxWidth()
- * .drawBackground(MaterialTheme.colors.background.copy(alpha = 0.3f)
- * )
- * ```
- *
- * Internally this matches the behavior of the [Modifier.height] modifier.
- *
- * @param additional Any additional height to add to the status bars size.
- */
-@SuppressLint("ModifierInspectorInfo")
-fun Modifier.navigationBarsHeight(
- additional: Dp = 0.dp
-): Modifier = composed {
- InsetsSizeModifier(
- insetsType = LocalWindowInsets.current.navigationBars,
- heightSide = VerticalSide.Bottom,
- additionalHeight = additional
- )
-}
-
-/**
- * Declare the preferred width of the content to match the width of the navigation bars,
- * on the given [side].
- *
- * This is very handy when used with `Spacer` to push content inside from any vertical
- * navigation bars (typically when the device is in landscape):
- * ```
- * Row {
- * Spacer(Modifier.navigationBarWidth(HorizontalSide.Left))
- *
- * // Content to be inside the navigation bars (x-axis)
- *
- * Spacer(Modifier.navigationBarWidth(HorizontalSide.Right))
- * }
- * ```
- *
- * It's also useful when used to draw a scrim which matches the navigation bars:
- * ```
- * Spacer(
- * Modifier.navigationBarWidth(HorizontalSide.Left)
- * .fillMaxHeight()
- * .drawBackground(MaterialTheme.colors.background.copy(alpha = 0.3f)
- * )
- * ```
- *
- * Internally this matches the behavior of the [Modifier.height] modifier.
- *
- * @param side The navigation bar side to use as the source for the width.
- * @param additional Any additional width to add to the status bars size.
- */
-@SuppressLint("ModifierInspectorInfo")
-fun Modifier.navigationBarsWidth(
- side: HorizontalSide,
- additional: Dp = 0.dp
-): Modifier = composed {
- InsetsSizeModifier(
- insetsType = LocalWindowInsets.current.navigationBars,
- widthSide = side,
- additionalWidth = additional
- )
-}
-
-/**
- * [Modifier] class which powers the modifiers above. This is the lower level modifier which
- * supports the functionality through a number of parameters.
- *
- * We may make this public at some point. If you need this, please let us know via the
- * issue tracker.
- */
-private data class InsetsSizeModifier(
- private val insetsType: InsetsType,
- private val widthSide: HorizontalSide? = null,
- private val additionalWidth: Dp = 0.dp,
- private val heightSide: VerticalSide? = null,
- private val additionalHeight: Dp = 0.dp
-) : LayoutModifier {
- private val Density.targetConstraints: Constraints
- get() {
- val additionalWidthPx = additionalWidth.roundToPx()
- val additionalHeightPx = additionalHeight.roundToPx()
- return Constraints(
- minWidth = additionalWidthPx + when (widthSide) {
- HorizontalSide.Left -> insetsType.left
- HorizontalSide.Right -> insetsType.right
- null -> 0
- },
- minHeight = additionalHeightPx + when (heightSide) {
- VerticalSide.Top -> insetsType.top
- VerticalSide.Bottom -> insetsType.bottom
- null -> 0
- },
- maxWidth = when (widthSide) {
- HorizontalSide.Left -> insetsType.left + additionalWidthPx
- HorizontalSide.Right -> insetsType.right + additionalWidthPx
- null -> Constraints.Infinity
- },
- maxHeight = when (heightSide) {
- VerticalSide.Top -> insetsType.top + additionalHeightPx
- VerticalSide.Bottom -> insetsType.bottom + additionalHeightPx
- null -> Constraints.Infinity
- }
- )
- }
-
- override fun MeasureScope.measure(
- measurable: Measurable,
- constraints: Constraints
- ): MeasureResult {
- val wrappedConstraints = targetConstraints.let { targetConstraints ->
- val resolvedMinWidth = if (widthSide != null) {
- targetConstraints.minWidth
- } else {
- constraints.minWidth.coerceAtMost(targetConstraints.maxWidth)
- }
- val resolvedMaxWidth = if (widthSide != null) {
- targetConstraints.maxWidth
- } else {
- constraints.maxWidth.coerceAtLeast(targetConstraints.minWidth)
- }
- val resolvedMinHeight = if (heightSide != null) {
- targetConstraints.minHeight
- } else {
- constraints.minHeight.coerceAtMost(targetConstraints.maxHeight)
- }
- val resolvedMaxHeight = if (heightSide != null) {
- targetConstraints.maxHeight
- } else {
- constraints.maxHeight.coerceAtLeast(targetConstraints.minHeight)
- }
- Constraints(
- resolvedMinWidth,
- resolvedMaxWidth,
- resolvedMinHeight,
- resolvedMaxHeight
- )
- }
- val placeable = measurable.measure(wrappedConstraints)
- return layout(placeable.width, placeable.height) {
- placeable.place(0, 0)
- }
- }
-
- override fun IntrinsicMeasureScope.minIntrinsicWidth(
- measurable: IntrinsicMeasurable,
- height: Int
- ) = measurable.minIntrinsicWidth(height).let {
- val constraints = targetConstraints
- it.coerceIn(constraints.minWidth, constraints.maxWidth)
- }
-
- override fun IntrinsicMeasureScope.maxIntrinsicWidth(
- measurable: IntrinsicMeasurable,
- height: Int
- ) = measurable.maxIntrinsicWidth(height).let {
- val constraints = targetConstraints
- it.coerceIn(constraints.minWidth, constraints.maxWidth)
- }
-
- override fun IntrinsicMeasureScope.minIntrinsicHeight(
- measurable: IntrinsicMeasurable,
- width: Int
- ) = measurable.minIntrinsicHeight(width).let {
- val constraints = targetConstraints
- it.coerceIn(constraints.minHeight, constraints.maxHeight)
- }
-
- override fun IntrinsicMeasureScope.maxIntrinsicHeight(
- measurable: IntrinsicMeasurable,
- width: Int
- ) = measurable.maxIntrinsicHeight(width).let {
- val constraints = targetConstraints
- it.coerceIn(constraints.minHeight, constraints.maxHeight)
- }
-}
diff --git a/compose/material/material/integration-tests/material-catalog/src/main/java/androidx/compose/material/catalog/CatalogApp.kt b/compose/material/material/integration-tests/material-catalog/src/main/java/androidx/compose/material/catalog/library/CatalogApp.kt
similarity index 60%
rename from compose/material/material/integration-tests/material-catalog/src/main/java/androidx/compose/material/catalog/CatalogApp.kt
rename to compose/material/material/integration-tests/material-catalog/src/main/java/androidx/compose/material/catalog/library/CatalogApp.kt
index 1ffe9e4..9a7e25b 100644
--- a/compose/material/material/integration-tests/material-catalog/src/main/java/androidx/compose/material/catalog/CatalogApp.kt
+++ b/compose/material/material/integration-tests/material-catalog/src/main/java/androidx/compose/material/catalog/library/CatalogApp.kt
@@ -14,12 +14,11 @@
* limitations under the License.
*/
-package androidx.compose.material.catalog
+package androidx.compose.material.catalog.library
-import androidx.compose.material.catalog.insets.ProvideWindowInsets
-import androidx.compose.material.catalog.model.Theme
-import androidx.compose.material.catalog.model.ThemeSaver
-import androidx.compose.material.catalog.ui.theme.CatalogTheme
+import androidx.compose.material.catalog.library.model.Theme
+import androidx.compose.material.catalog.library.model.ThemeSaver
+import androidx.compose.material.catalog.library.ui.theme.CatalogTheme
import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
@@ -27,14 +26,12 @@
import androidx.compose.runtime.setValue
@Composable
-fun CatalogApp() {
- ProvideWindowInsets {
- var theme by rememberSaveable(stateSaver = ThemeSaver) { mutableStateOf(Theme()) }
- CatalogTheme(theme = theme) {
- NavGraph(
- theme = theme,
- onThemeChange = { theme = it }
- )
- }
+fun MaterialCatalogApp() {
+ var theme by rememberSaveable(stateSaver = ThemeSaver) { mutableStateOf(Theme()) }
+ CatalogTheme(theme = theme) {
+ NavGraph(
+ theme = theme,
+ onThemeChange = { theme = it }
+ )
}
}
diff --git a/compose/material/material/integration-tests/material-catalog/src/main/java/androidx/compose/material/catalog/NavGraph.kt b/compose/material/material/integration-tests/material-catalog/src/main/java/androidx/compose/material/catalog/library/NavGraph.kt
similarity index 79%
copy from compose/material/material/integration-tests/material-catalog/src/main/java/androidx/compose/material/catalog/NavGraph.kt
copy to compose/material/material/integration-tests/material-catalog/src/main/java/androidx/compose/material/catalog/library/NavGraph.kt
index 5c41cda..773458c 100644
--- a/compose/material/material/integration-tests/material-catalog/src/main/java/androidx/compose/material/catalog/NavGraph.kt
+++ b/compose/material/material/integration-tests/material-catalog/src/main/java/androidx/compose/material/catalog/library/NavGraph.kt
@@ -14,15 +14,14 @@
* limitations under the License.
*/
-package androidx.compose.material.catalog
+package androidx.compose.material.catalog.library
-import androidx.compose.material.catalog.model.Components
-import androidx.compose.material.catalog.model.Theme
-import androidx.compose.material.catalog.ui.component.Component
-import androidx.compose.material.catalog.ui.example.Example
-import androidx.compose.material.catalog.ui.home.Home
+import androidx.compose.material.catalog.library.model.Components
+import androidx.compose.material.catalog.library.model.Theme
+import androidx.compose.material.catalog.library.ui.component.Component
+import androidx.compose.material.catalog.library.ui.example.Example
+import androidx.compose.material.catalog.library.ui.home.Home
import androidx.compose.runtime.Composable
-import androidx.compose.runtime.rememberUpdatedState
import androidx.navigation.NavType
import androidx.navigation.compose.NavHost
import androidx.navigation.compose.composable
@@ -34,10 +33,6 @@
theme: Theme,
onThemeChange: (theme: Theme) -> Unit
) {
- // Using rememberUpdatedState as hoisted state is not correctly propagated to NavHost
- // https://issuetracker.google.com/issues/177338143
- val navTheme = rememberUpdatedState(theme)
- val navOnThemeChange = rememberUpdatedState(onThemeChange)
val navController = rememberNavController()
NavHost(
navController = navController,
@@ -46,8 +41,8 @@
composable(HomeRoute) {
Home(
components = Components,
- theme = navTheme.value,
- onThemeChange = navOnThemeChange.value,
+ theme = theme,
+ onThemeChange = onThemeChange,
onComponentClick = { component ->
val componentId = component.id
val route = "$ComponentRoute/$componentId"
@@ -67,8 +62,8 @@
val component = Components.first { component -> component.id == componentId }
Component(
component = component,
- theme = navTheme.value,
- onThemeChange = navOnThemeChange.value,
+ theme = theme,
+ onThemeChange = onThemeChange,
onExampleClick = { example ->
val exampleIndex = component.examples.indexOf(example)
val route = "$ExampleRoute/$componentId/$exampleIndex"
@@ -94,14 +89,15 @@
Example(
component = component,
example = example,
- theme = navTheme.value,
- onThemeChange = navOnThemeChange.value,
+ theme = theme,
+ onThemeChange = onThemeChange,
onBackClick = { navController.popBackStack() }
)
}
}
}
+const val MaterialRoute = "material"
private const val HomeRoute = "home"
private const val ComponentRoute = "component"
private const val ExampleRoute = "example"
diff --git a/compose/material/material/integration-tests/material-catalog/src/main/java/androidx/compose/material/catalog/model/Components.kt b/compose/material/material/integration-tests/material-catalog/src/main/java/androidx/compose/material/catalog/library/model/Components.kt
similarity index 96%
rename from compose/material/material/integration-tests/material-catalog/src/main/java/androidx/compose/material/catalog/model/Components.kt
rename to compose/material/material/integration-tests/material-catalog/src/main/java/androidx/compose/material/catalog/library/model/Components.kt
index fe4930ff..46f0f03 100644
--- a/compose/material/material/integration-tests/material-catalog/src/main/java/androidx/compose/material/catalog/model/Components.kt
+++ b/compose/material/material/integration-tests/material-catalog/src/main/java/androidx/compose/material/catalog/library/model/Components.kt
@@ -14,13 +14,13 @@
* limitations under the License.
*/
-package androidx.compose.material.catalog.model
+package androidx.compose.material.catalog.library.model
import androidx.annotation.DrawableRes
-import androidx.compose.material.catalog.R
-import androidx.compose.material.catalog.util.ComponentGuidelinesUrl
-import androidx.compose.material.catalog.util.DocsUrl
-import androidx.compose.material.catalog.util.MaterialSourceUrl
+import androidx.compose.material.catalog.library.R
+import androidx.compose.material.catalog.library.util.ComponentGuidelinesUrl
+import androidx.compose.material.catalog.library.util.DocsUrl
+import androidx.compose.material.catalog.library.util.MaterialSourceUrl
data class Component(
val id: Int,
diff --git a/compose/material/material/integration-tests/material-catalog/src/main/java/androidx/compose/material/catalog/model/Examples.kt b/compose/material/material/integration-tests/material-catalog/src/main/java/androidx/compose/material/catalog/library/model/Examples.kt
similarity index 99%
rename from compose/material/material/integration-tests/material-catalog/src/main/java/androidx/compose/material/catalog/model/Examples.kt
rename to compose/material/material/integration-tests/material-catalog/src/main/java/androidx/compose/material/catalog/library/model/Examples.kt
index 52633d4..de07f8a 100644
--- a/compose/material/material/integration-tests/material-catalog/src/main/java/androidx/compose/material/catalog/model/Examples.kt
+++ b/compose/material/material/integration-tests/material-catalog/src/main/java/androidx/compose/material/catalog/library/model/Examples.kt
@@ -16,9 +16,9 @@
@file:Suppress("COMPOSABLE_FUNCTION_REFERENCE")
-package androidx.compose.material.catalog.model
+package androidx.compose.material.catalog.library.model
-import androidx.compose.material.catalog.util.SampleSourceUrl
+import androidx.compose.material.catalog.library.util.SampleSourceUrl
import androidx.compose.material.samples.AlertDialogSample
import androidx.compose.material.samples.BackdropScaffoldSample
import androidx.compose.material.samples.BottomDrawerSample
diff --git a/compose/material/material/integration-tests/material-catalog/src/main/java/androidx/compose/material/catalog/model/Themes.kt b/compose/material/material/integration-tests/material-catalog/src/main/java/androidx/compose/material/catalog/library/model/Themes.kt
similarity index 98%
rename from compose/material/material/integration-tests/material-catalog/src/main/java/androidx/compose/material/catalog/model/Themes.kt
rename to compose/material/material/integration-tests/material-catalog/src/main/java/androidx/compose/material/catalog/library/model/Themes.kt
index 92a93c0..5f3e7bc 100644
--- a/compose/material/material/integration-tests/material-catalog/src/main/java/androidx/compose/material/catalog/model/Themes.kt
+++ b/compose/material/material/integration-tests/material-catalog/src/main/java/androidx/compose/material/catalog/library/model/Themes.kt
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package androidx.compose.material.catalog.model
+package androidx.compose.material.catalog.library.model
import androidx.compose.foundation.shape.CornerBasedShape
import androidx.compose.foundation.shape.CutCornerShape
diff --git a/compose/material/material/integration-tests/material-catalog/src/main/java/androidx/compose/material/catalog/ui/common/Border.kt b/compose/material/material/integration-tests/material-catalog/src/main/java/androidx/compose/material/catalog/library/ui/common/Border.kt
similarity index 97%
copy from compose/material/material/integration-tests/material-catalog/src/main/java/androidx/compose/material/catalog/ui/common/Border.kt
copy to compose/material/material/integration-tests/material-catalog/src/main/java/androidx/compose/material/catalog/library/ui/common/Border.kt
index 9d0fc08..17b94a5 100644
--- a/compose/material/material/integration-tests/material-catalog/src/main/java/androidx/compose/material/catalog/ui/common/Border.kt
+++ b/compose/material/material/integration-tests/material-catalog/src/main/java/androidx/compose/material/catalog/library/ui/common/Border.kt
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package androidx.compose.material.catalog.ui.common
+package androidx.compose.material.catalog.library.ui.common
import androidx.compose.material.LocalContentColor
import androidx.compose.material.MaterialTheme
diff --git a/compose/material/material/integration-tests/material-catalog/src/main/java/androidx/compose/material/catalog/ui/common/CatalogScaffold.kt b/compose/material/material/integration-tests/material-catalog/src/main/java/androidx/compose/material/catalog/library/ui/common/CatalogScaffold.kt
similarity index 82%
rename from compose/material/material/integration-tests/material-catalog/src/main/java/androidx/compose/material/catalog/ui/common/CatalogScaffold.kt
rename to compose/material/material/integration-tests/material-catalog/src/main/java/androidx/compose/material/catalog/library/ui/common/CatalogScaffold.kt
index 74ef95d..d86161c 100644
--- a/compose/material/material/integration-tests/material-catalog/src/main/java/androidx/compose/material/catalog/ui/common/CatalogScaffold.kt
+++ b/compose/material/material/integration-tests/material-catalog/src/main/java/androidx/compose/material/catalog/library/ui/common/CatalogScaffold.kt
@@ -14,23 +14,23 @@
* limitations under the License.
*/
-package androidx.compose.material.catalog.ui.common
+package androidx.compose.material.catalog.library.ui.common
import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.material.ExperimentalMaterialApi
import androidx.compose.material.ModalBottomSheetLayout
import androidx.compose.material.ModalBottomSheetValue
import androidx.compose.material.Scaffold
-import androidx.compose.material.catalog.model.Theme
-import androidx.compose.material.catalog.ui.theme.ThemePicker
-import androidx.compose.material.catalog.util.GuidelinesUrl
-import androidx.compose.material.catalog.util.IssueUrl
-import androidx.compose.material.catalog.util.LicensesUrl
-import androidx.compose.material.catalog.util.PrivacyUrl
-import androidx.compose.material.catalog.util.ReleasesUrl
-import androidx.compose.material.catalog.util.SourceUrl
-import androidx.compose.material.catalog.util.TermsUrl
-import androidx.compose.material.catalog.util.openUrl
+import androidx.compose.material.catalog.library.model.Theme
+import androidx.compose.material.catalog.library.ui.theme.ThemePicker
+import androidx.compose.material.catalog.library.util.GuidelinesUrl
+import androidx.compose.material.catalog.library.util.IssueUrl
+import androidx.compose.material.catalog.library.util.LicensesUrl
+import androidx.compose.material.catalog.library.util.PrivacyUrl
+import androidx.compose.material.catalog.library.util.ReleasesUrl
+import androidx.compose.material.catalog.library.util.SourceUrl
+import androidx.compose.material.catalog.library.util.TermsUrl
+import androidx.compose.material.catalog.library.util.openUrl
import androidx.compose.material.rememberModalBottomSheetState
import androidx.compose.runtime.Composable
import androidx.compose.runtime.rememberCoroutineScope
diff --git a/compose/material/material/integration-tests/material-catalog/src/main/java/androidx/compose/material/catalog/ui/common/CatalogTopAppBar.kt b/compose/material/material/integration-tests/material-catalog/src/main/java/androidx/compose/material/catalog/library/ui/common/CatalogTopAppBar.kt
similarity index 96%
rename from compose/material/material/integration-tests/material-catalog/src/main/java/androidx/compose/material/catalog/ui/common/CatalogTopAppBar.kt
rename to compose/material/material/integration-tests/material-catalog/src/main/java/androidx/compose/material/catalog/library/ui/common/CatalogTopAppBar.kt
index 0de1657..6132c51 100644
--- a/compose/material/material/integration-tests/material-catalog/src/main/java/androidx/compose/material/catalog/ui/common/CatalogTopAppBar.kt
+++ b/compose/material/material/integration-tests/material-catalog/src/main/java/androidx/compose/material/catalog/library/ui/common/CatalogTopAppBar.kt
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package androidx.compose.material.catalog.ui.common
+package androidx.compose.material.catalog.library.ui.common
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Row
@@ -28,9 +28,7 @@
import androidx.compose.material.Surface
import androidx.compose.material.Text
import androidx.compose.material.TopAppBar
-import androidx.compose.material.catalog.R
-import androidx.compose.material.catalog.insets.navigationBarsPadding
-import androidx.compose.material.catalog.insets.statusBarsPadding
+import androidx.compose.material.catalog.library.R
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.ArrowBack
import androidx.compose.material.icons.filled.MoreVert
@@ -46,6 +44,8 @@
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.style.TextOverflow
import androidx.compose.ui.unit.dp
+import com.google.accompanist.insets.navigationBarsPadding
+import com.google.accompanist.insets.statusBarsPadding
@Composable
fun CatalogTopAppBar(
diff --git a/compose/material/material/integration-tests/material-catalog/src/main/java/androidx/compose/material/catalog/ui/component/Component.kt b/compose/material/material/integration-tests/material-catalog/src/main/java/androidx/compose/material/catalog/library/ui/component/Component.kt
similarity index 86%
rename from compose/material/material/integration-tests/material-catalog/src/main/java/androidx/compose/material/catalog/ui/component/Component.kt
rename to compose/material/material/integration-tests/material-catalog/src/main/java/androidx/compose/material/catalog/library/ui/component/Component.kt
index 2fa2009..791dfa8 100644
--- a/compose/material/material/integration-tests/material-catalog/src/main/java/androidx/compose/material/catalog/ui/component/Component.kt
+++ b/compose/material/material/integration-tests/material-catalog/src/main/java/androidx/compose/material/catalog/library/ui/component/Component.kt
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package androidx.compose.material.catalog.ui.component
+package androidx.compose.material.catalog.library.ui.component
import androidx.compose.foundation.Image
import androidx.compose.foundation.layout.Box
@@ -29,14 +29,12 @@
import androidx.compose.material.LocalContentColor
import androidx.compose.material.MaterialTheme
import androidx.compose.material.Text
-import androidx.compose.material.catalog.R
-import androidx.compose.material.catalog.insets.LocalWindowInsets
-import androidx.compose.material.catalog.insets.toPaddingValues
-import androidx.compose.material.catalog.model.Component
-import androidx.compose.material.catalog.model.Example
-import androidx.compose.material.catalog.model.Theme
-import androidx.compose.material.catalog.ui.common.CatalogScaffold
-import androidx.compose.material.catalog.ui.example.ExampleItem
+import androidx.compose.material.catalog.library.R
+import androidx.compose.material.catalog.library.model.Component
+import androidx.compose.material.catalog.library.model.Example
+import androidx.compose.material.catalog.library.model.Theme
+import androidx.compose.material.catalog.library.ui.common.CatalogScaffold
+import androidx.compose.material.catalog.library.ui.example.ExampleItem
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
@@ -44,6 +42,8 @@
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.unit.dp
+import com.google.accompanist.insets.LocalWindowInsets
+import com.google.accompanist.insets.rememberInsetsPaddingValues
@Composable
fun Component(
@@ -67,7 +67,9 @@
modifier = Modifier
.padding(paddingValues)
.padding(horizontal = ComponentPadding),
- contentPadding = LocalWindowInsets.current.navigationBars.toPaddingValues()
+ contentPadding = rememberInsetsPaddingValues(
+ insets = LocalWindowInsets.current.navigationBars
+ )
) {
item {
Box(
diff --git a/compose/material/material/integration-tests/material-catalog/src/main/java/androidx/compose/material/catalog/ui/component/ComponentItem.kt b/compose/material/material/integration-tests/material-catalog/src/main/java/androidx/compose/material/catalog/library/ui/component/ComponentItem.kt
similarity index 90%
rename from compose/material/material/integration-tests/material-catalog/src/main/java/androidx/compose/material/catalog/ui/component/ComponentItem.kt
rename to compose/material/material/integration-tests/material-catalog/src/main/java/androidx/compose/material/catalog/library/ui/component/ComponentItem.kt
index 2eca34c..94e9f4d 100644
--- a/compose/material/material/integration-tests/material-catalog/src/main/java/androidx/compose/material/catalog/ui/component/ComponentItem.kt
+++ b/compose/material/material/integration-tests/material-catalog/src/main/java/androidx/compose/material/catalog/library/ui/component/ComponentItem.kt
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package androidx.compose.material.catalog.ui.component
+package androidx.compose.material.catalog.library.ui.component
import androidx.compose.foundation.Image
import androidx.compose.foundation.clickable
@@ -26,9 +26,9 @@
import androidx.compose.material.LocalContentColor
import androidx.compose.material.MaterialTheme
import androidx.compose.material.Text
-import androidx.compose.material.catalog.model.Component
-import androidx.compose.material.catalog.ui.common.compositeBorderColor
-import androidx.compose.material.catalog.ui.common.gridItemBorder
+import androidx.compose.material.catalog.library.model.Component
+import androidx.compose.material.catalog.library.ui.common.compositeBorderColor
+import androidx.compose.material.catalog.library.ui.common.gridItemBorder
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
diff --git a/compose/material/material/integration-tests/material-catalog/src/main/java/androidx/compose/material/catalog/ui/example/Example.kt b/compose/material/material/integration-tests/material-catalog/src/main/java/androidx/compose/material/catalog/library/ui/example/Example.kt
similarity index 81%
rename from compose/material/material/integration-tests/material-catalog/src/main/java/androidx/compose/material/catalog/ui/example/Example.kt
rename to compose/material/material/integration-tests/material-catalog/src/main/java/androidx/compose/material/catalog/library/ui/example/Example.kt
index d5e1172..d6021c3 100644
--- a/compose/material/material/integration-tests/material-catalog/src/main/java/androidx/compose/material/catalog/ui/example/Example.kt
+++ b/compose/material/material/integration-tests/material-catalog/src/main/java/androidx/compose/material/catalog/library/ui/example/Example.kt
@@ -14,19 +14,19 @@
* limitations under the License.
*/
-package androidx.compose.material.catalog.ui.example
+package androidx.compose.material.catalog.library.ui.example
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.padding
-import androidx.compose.material.catalog.insets.navigationBarsPadding
-import androidx.compose.material.catalog.model.Component
-import androidx.compose.material.catalog.model.Example
-import androidx.compose.material.catalog.model.Theme
-import androidx.compose.material.catalog.ui.common.CatalogScaffold
+import androidx.compose.material.catalog.library.model.Component
+import androidx.compose.material.catalog.library.model.Example
+import androidx.compose.material.catalog.library.model.Theme
+import androidx.compose.material.catalog.library.ui.common.CatalogScaffold
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
+import com.google.accompanist.insets.navigationBarsPadding
@Composable
fun Example(
diff --git a/compose/material/material/integration-tests/material-catalog/src/main/java/androidx/compose/material/catalog/ui/example/ExampleItem.kt b/compose/material/material/integration-tests/material-catalog/src/main/java/androidx/compose/material/catalog/library/ui/example/ExampleItem.kt
similarity index 91%
rename from compose/material/material/integration-tests/material-catalog/src/main/java/androidx/compose/material/catalog/ui/example/ExampleItem.kt
rename to compose/material/material/integration-tests/material-catalog/src/main/java/androidx/compose/material/catalog/library/ui/example/ExampleItem.kt
index 874afa1..3f5b455 100644
--- a/compose/material/material/integration-tests/material-catalog/src/main/java/androidx/compose/material/catalog/ui/example/ExampleItem.kt
+++ b/compose/material/material/integration-tests/material-catalog/src/main/java/androidx/compose/material/catalog/library/ui/example/ExampleItem.kt
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package androidx.compose.material.catalog.ui.example
+package androidx.compose.material.catalog.library.ui.example
import androidx.compose.foundation.BorderStroke
import androidx.compose.foundation.clickable
@@ -31,9 +31,9 @@
import androidx.compose.material.LocalContentAlpha
import androidx.compose.material.MaterialTheme
import androidx.compose.material.Text
-import androidx.compose.material.catalog.model.Example
-import androidx.compose.material.catalog.ui.common.BorderWidth
-import androidx.compose.material.catalog.ui.common.compositeBorderColor
+import androidx.compose.material.catalog.library.model.Example
+import androidx.compose.material.catalog.library.ui.common.BorderWidth
+import androidx.compose.material.catalog.library.ui.common.compositeBorderColor
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.KeyboardArrowRight
import androidx.compose.runtime.Composable
diff --git a/compose/material/material/integration-tests/material-catalog/src/main/java/androidx/compose/material/catalog/ui/home/Home.kt b/compose/material/material/integration-tests/material-catalog/src/main/java/androidx/compose/material/catalog/library/ui/home/Home.kt
similarity index 78%
rename from compose/material/material/integration-tests/material-catalog/src/main/java/androidx/compose/material/catalog/ui/home/Home.kt
rename to compose/material/material/integration-tests/material-catalog/src/main/java/androidx/compose/material/catalog/library/ui/home/Home.kt
index 5671c94..ff77567 100644
--- a/compose/material/material/integration-tests/material-catalog/src/main/java/androidx/compose/material/catalog/ui/home/Home.kt
+++ b/compose/material/material/integration-tests/material-catalog/src/main/java/androidx/compose/material/catalog/library/ui/home/Home.kt
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package androidx.compose.material.catalog.ui.home
+package androidx.compose.material.catalog.library.ui.home
import androidx.compose.foundation.ExperimentalFoundationApi
import androidx.compose.foundation.layout.BoxWithConstraints
@@ -22,17 +22,17 @@
import androidx.compose.foundation.lazy.GridCells
import androidx.compose.foundation.lazy.LazyVerticalGrid
import androidx.compose.foundation.lazy.itemsIndexed
-import androidx.compose.material.catalog.R
-import androidx.compose.material.catalog.insets.LocalWindowInsets
-import androidx.compose.material.catalog.insets.toPaddingValues
-import androidx.compose.material.catalog.model.Component
-import androidx.compose.material.catalog.model.Theme
-import androidx.compose.material.catalog.ui.common.CatalogScaffold
-import androidx.compose.material.catalog.ui.component.ComponentItem
+import androidx.compose.material.catalog.library.R
+import androidx.compose.material.catalog.library.model.Component
+import androidx.compose.material.catalog.library.model.Theme
+import androidx.compose.material.catalog.library.ui.common.CatalogScaffold
+import androidx.compose.material.catalog.library.ui.component.ComponentItem
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.unit.dp
+import com.google.accompanist.insets.LocalWindowInsets
+import com.google.accompanist.insets.rememberInsetsPaddingValues
@Composable
@OptIn(ExperimentalFoundationApi::class)
@@ -63,7 +63,9 @@
)
}
},
- contentPadding = LocalWindowInsets.current.navigationBars.toPaddingValues()
+ contentPadding = rememberInsetsPaddingValues(
+ insets = LocalWindowInsets.current.navigationBars
+ )
)
}
}
diff --git a/compose/material/material/integration-tests/material-catalog/src/main/java/androidx/compose/material/catalog/ui/theme/Theme.kt b/compose/material/material/integration-tests/material-catalog/src/main/java/androidx/compose/material/catalog/library/ui/theme/Theme.kt
similarity index 87%
rename from compose/material/material/integration-tests/material-catalog/src/main/java/androidx/compose/material/catalog/ui/theme/Theme.kt
rename to compose/material/material/integration-tests/material-catalog/src/main/java/androidx/compose/material/catalog/library/ui/theme/Theme.kt
index 36b1ad8..26974bb 100644
--- a/compose/material/material/integration-tests/material-catalog/src/main/java/androidx/compose/material/catalog/ui/theme/Theme.kt
+++ b/compose/material/material/integration-tests/material-catalog/src/main/java/androidx/compose/material/catalog/library/ui/theme/Theme.kt
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package androidx.compose.material.catalog.ui.theme
+package androidx.compose.material.catalog.library.ui.theme
import androidx.compose.animation.animateColorAsState
import androidx.compose.animation.core.animateDpAsState
@@ -22,13 +22,13 @@
import androidx.compose.material.MaterialTheme
import androidx.compose.material.Shapes
import androidx.compose.material.Typography
-import androidx.compose.material.catalog.model.Theme
-import androidx.compose.material.catalog.model.getColor
-import androidx.compose.material.catalog.model.getFontFamily
-import androidx.compose.material.catalog.model.getShape
-import androidx.compose.material.catalog.util.isLightColor
-import androidx.compose.material.catalog.util.onColor
-import androidx.compose.material.catalog.util.variantColor
+import androidx.compose.material.catalog.library.model.Theme
+import androidx.compose.material.catalog.library.model.getColor
+import androidx.compose.material.catalog.library.model.getFontFamily
+import androidx.compose.material.catalog.library.model.getShape
+import androidx.compose.material.catalog.library.util.isLightColor
+import androidx.compose.material.catalog.library.util.onColor
+import androidx.compose.material.catalog.library.util.variantColor
import androidx.compose.material.darkColors
import androidx.compose.material.lightColors
import androidx.compose.material.primarySurface
diff --git a/compose/material/material/integration-tests/material-catalog/src/main/java/androidx/compose/material/catalog/ui/theme/ThemePicker.kt b/compose/material/material/integration-tests/material-catalog/src/main/java/androidx/compose/material/catalog/library/ui/theme/ThemePicker.kt
similarity index 92%
rename from compose/material/material/integration-tests/material-catalog/src/main/java/androidx/compose/material/catalog/ui/theme/ThemePicker.kt
rename to compose/material/material/integration-tests/material-catalog/src/main/java/androidx/compose/material/catalog/library/ui/theme/ThemePicker.kt
index 918de75..48c1770 100644
--- a/compose/material/material/integration-tests/material-catalog/src/main/java/androidx/compose/material/catalog/ui/theme/ThemePicker.kt
+++ b/compose/material/material/integration-tests/material-catalog/src/main/java/androidx/compose/material/catalog/library/ui/theme/ThemePicker.kt
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package androidx.compose.material.catalog.ui.theme
+package androidx.compose.material.catalog.library.ui.theme
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.PaddingValues
@@ -39,19 +39,17 @@
import androidx.compose.material.Slider
import androidx.compose.material.Text
import androidx.compose.material.TextButton
-import androidx.compose.material.catalog.R
-import androidx.compose.material.catalog.insets.LocalWindowInsets
-import androidx.compose.material.catalog.insets.toPaddingValues
-import androidx.compose.material.catalog.model.DefaultTheme
-import androidx.compose.material.catalog.model.MaxLargeShapeCornerSize
-import androidx.compose.material.catalog.model.MaxMediumShapeCornerSize
-import androidx.compose.material.catalog.model.MaxSmallShapeCornerSize
-import androidx.compose.material.catalog.model.Theme
-import androidx.compose.material.catalog.model.ThemeColor
-import androidx.compose.material.catalog.model.ThemeFontFamily
-import androidx.compose.material.catalog.model.ThemeShapeCornerFamily
-import androidx.compose.material.catalog.model.getColor
-import androidx.compose.material.catalog.model.getFontFamily
+import androidx.compose.material.catalog.library.R
+import androidx.compose.material.catalog.library.model.DefaultTheme
+import androidx.compose.material.catalog.library.model.MaxLargeShapeCornerSize
+import androidx.compose.material.catalog.library.model.MaxMediumShapeCornerSize
+import androidx.compose.material.catalog.library.model.MaxSmallShapeCornerSize
+import androidx.compose.material.catalog.library.model.Theme
+import androidx.compose.material.catalog.library.model.ThemeColor
+import androidx.compose.material.catalog.library.model.ThemeFontFamily
+import androidx.compose.material.catalog.library.model.ThemeShapeCornerFamily
+import androidx.compose.material.catalog.library.model.getColor
+import androidx.compose.material.catalog.library.model.getFontFamily
import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
@@ -62,6 +60,8 @@
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.unit.dp
+import com.google.accompanist.insets.LocalWindowInsets
+import com.google.accompanist.insets.rememberInsetsPaddingValues
@Composable
fun ThemePicker(
@@ -70,8 +70,10 @@
) {
var themeState by remember { mutableStateOf(theme) }
LazyColumn(
- contentPadding = LocalWindowInsets.current.navigationBars.toPaddingValues(
- additionalVertical = ThemePickerPadding
+ contentPadding = rememberInsetsPaddingValues(
+ insets = LocalWindowInsets.current.navigationBars,
+ additionalTop = ThemePickerPadding,
+ additionalBottom = ThemePickerPadding
)
) {
item {
diff --git a/compose/material/material/integration-tests/material-catalog/src/main/java/androidx/compose/material/catalog/util/Color.kt b/compose/material/material/integration-tests/material-catalog/src/main/java/androidx/compose/material/catalog/library/util/Color.kt
similarity index 96%
rename from compose/material/material/integration-tests/material-catalog/src/main/java/androidx/compose/material/catalog/util/Color.kt
rename to compose/material/material/integration-tests/material-catalog/src/main/java/androidx/compose/material/catalog/library/util/Color.kt
index e90bedd..46070f9 100644
--- a/compose/material/material/integration-tests/material-catalog/src/main/java/androidx/compose/material/catalog/util/Color.kt
+++ b/compose/material/material/integration-tests/material-catalog/src/main/java/androidx/compose/material/catalog/library/util/Color.kt
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package androidx.compose.material.catalog.util
+package androidx.compose.material.catalog.library.util
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.lerp
diff --git a/compose/material/material/integration-tests/material-catalog/src/main/java/androidx/compose/material/catalog/util/Url.kt b/compose/material/material/integration-tests/material-catalog/src/main/java/androidx/compose/material/catalog/library/util/Url.kt
similarity index 97%
rename from compose/material/material/integration-tests/material-catalog/src/main/java/androidx/compose/material/catalog/util/Url.kt
rename to compose/material/material/integration-tests/material-catalog/src/main/java/androidx/compose/material/catalog/library/util/Url.kt
index e4dcb9f..fad3e2e 100644
--- a/compose/material/material/integration-tests/material-catalog/src/main/java/androidx/compose/material/catalog/util/Url.kt
+++ b/compose/material/material/integration-tests/material-catalog/src/main/java/androidx/compose/material/catalog/library/util/Url.kt
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package androidx.compose.material.catalog.util
+package androidx.compose.material.catalog.library.util
import android.content.Context
import android.content.Intent
diff --git a/compose/material/material/integration-tests/material-catalog/src/main/res/values/donottranslate-strings.xml b/compose/material/material/integration-tests/material-catalog/src/main/res/values/donottranslate-strings.xml
index d87c304..81de162 100644
--- a/compose/material/material/integration-tests/material-catalog/src/main/res/values/donottranslate-strings.xml
+++ b/compose/material/material/integration-tests/material-catalog/src/main/res/values/donottranslate-strings.xml
@@ -18,7 +18,6 @@
<resources>
<string name="compose_material">Compose Material</string>
- <string name="compose_material_catalog">Compose Material Catalog</string>
<string name="description">Description</string>
<string name="examples">Examples</string>
diff --git a/compose/material/material/samples/build.gradle b/compose/material/material/samples/build.gradle
index 51de440..e5d0925 100644
--- a/compose/material/material/samples/build.gradle
+++ b/compose/material/material/samples/build.gradle
@@ -42,9 +42,9 @@
}
androidx {
- name = "AndroidX Compose UI Material Design Components Samples"
+ name = "AndroidX Compose Material Components Samples"
type = LibraryType.SAMPLES
mavenGroup = LibraryGroups.Compose.MATERIAL
inceptionYear = "2019"
- description = "Contains the sample code for the Androidx Compose UI Material Design Components"
+ description = "Contains the sample code for the AndroidX Compose Material components."
}
diff --git a/compose/material/material/src/androidAndroidTest/kotlin/androidx/compose/material/ButtonTest.kt b/compose/material/material/src/androidAndroidTest/kotlin/androidx/compose/material/ButtonTest.kt
index 179e321..a360b83 100644
--- a/compose/material/material/src/androidAndroidTest/kotlin/androidx/compose/material/ButtonTest.kt
+++ b/compose/material/material/src/androidAndroidTest/kotlin/androidx/compose/material/ButtonTest.kt
@@ -24,11 +24,10 @@
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.requiredHeight
import androidx.compose.foundation.layout.requiredHeightIn
-import androidx.compose.foundation.layout.padding
-import androidx.compose.foundation.layout.size
import androidx.compose.foundation.layout.requiredSize
import androidx.compose.foundation.layout.requiredWidth
import androidx.compose.foundation.layout.requiredWidthIn
+import androidx.compose.foundation.layout.size
import androidx.compose.foundation.shape.CutCornerShape
import androidx.compose.runtime.Composable
import androidx.compose.runtime.CompositionLocalProvider
@@ -47,8 +46,8 @@
import androidx.compose.ui.layout.boundsInRoot
import androidx.compose.ui.layout.onGloballyPositioned
import androidx.compose.ui.platform.testTag
-import androidx.compose.ui.semantics.SemanticsProperties
import androidx.compose.ui.semantics.Role
+import androidx.compose.ui.semantics.SemanticsProperties
import androidx.compose.ui.test.SemanticsMatcher
import androidx.compose.ui.test.assert
import androidx.compose.ui.test.assertHasClickAction
@@ -364,28 +363,23 @@
fun containedButtonDisabledBackgroundIsCorrect() {
var surface = Color.Transparent
var onSurface = Color.Transparent
- val padding = 8.dp
rule.setMaterialContent {
surface = MaterialTheme.colors.surface
onSurface = MaterialTheme.colors.onSurface
- Box(Modifier.testTag("myButton")) {
- // stack allows to verify there is no shadow
- Box(Modifier.padding(padding)) {
- Button(
- onClick = {},
- enabled = false,
- shape = RectangleShape
- ) {}
- }
- }
+ Button(
+ modifier = Modifier.testTag("myButton"),
+ onClick = {},
+ enabled = false,
+ shape = RectangleShape
+ ) {}
}
rule.onNodeWithTag("myButton")
.captureToImage()
.assertShape(
density = rule.density,
- horizontalPadding = padding,
- verticalPadding = padding,
+ horizontalPadding = 0.dp,
+ verticalPadding = 0.dp,
backgroundColor = surface,
shapeColor = onSurface.copy(alpha = 0.12f).compositeOver(surface)
)
@@ -397,31 +391,26 @@
fun containedButtonWithCustomColorDisabledBackgroundIsCorrect() {
var surface = Color.Transparent
var onSurface = Color.Transparent
- val padding = 8.dp
rule.setMaterialContent {
surface = MaterialTheme.colors.surface
onSurface = MaterialTheme.colors.onSurface
- Box(Modifier.testTag("myButton")) {
- // stack allows to verify there is no shadow
- Box(Modifier.padding(padding)) {
- Button(
- onClick = {},
- enabled = false,
- colors = ButtonDefaults.buttonColors(
- backgroundColor = Color.Red
- ),
- shape = RectangleShape
- ) {}
- }
- }
+ Button(
+ modifier = Modifier.testTag("myButton"),
+ onClick = {},
+ enabled = false,
+ colors = ButtonDefaults.buttonColors(
+ backgroundColor = Color.Red
+ ),
+ shape = RectangleShape
+ ) {}
}
rule.onNodeWithTag("myButton")
.captureToImage()
.assertShape(
density = rule.density,
- horizontalPadding = padding,
- verticalPadding = padding,
+ horizontalPadding = 0.dp,
+ verticalPadding = 0.dp,
backgroundColor = surface,
shapeColor = onSurface.copy(alpha = 0.12f).compositeOver(surface)
)
@@ -432,25 +421,23 @@
@LargeTest
fun outlinedButtonDisabledBackgroundIsCorrect() {
var surface = Color.Transparent
- val padding = 8.dp
rule.setMaterialContent {
surface = MaterialTheme.colors.surface
- // stack allows to verify there is no shadow
- Box(Modifier.padding(padding)) {
- OutlinedButton(
- modifier = Modifier.testTag("myButton"),
- onClick = {},
- enabled = false,
- shape = RectangleShape,
- border = null
- ) {}
- }
+ OutlinedButton(
+ modifier = Modifier.testTag("myButton"),
+ onClick = {},
+ enabled = false,
+ shape = RectangleShape,
+ border = null
+ ) {}
}
rule.onNodeWithTag("myButton")
.captureToImage()
.assertShape(
density = rule.density,
+ horizontalPadding = 0.dp,
+ verticalPadding = 0.dp,
shape = RectangleShape,
shapeColor = surface,
backgroundColor = surface
@@ -464,21 +451,20 @@
var surface = Color.Transparent
rule.setMaterialContent {
surface = MaterialTheme.colors.surface
- // stack allows to verify there is no shadow
- Box(Modifier.padding(8.dp)) {
- TextButton(
- modifier = Modifier.testTag("myButton"),
- onClick = {},
- enabled = false,
- shape = RectangleShape
- ) {}
- }
+ TextButton(
+ modifier = Modifier.testTag("myButton"),
+ onClick = {},
+ enabled = false,
+ shape = RectangleShape
+ ) {}
}
rule.onNodeWithTag("myButton")
.captureToImage()
.assertShape(
density = rule.density,
+ horizontalPadding = 0.dp,
+ verticalPadding = 0.dp,
shape = RectangleShape,
shapeColor = surface,
backgroundColor = surface
diff --git a/compose/material/material/src/androidAndroidTest/kotlin/androidx/compose/material/CheckboxScreenshotTest.kt b/compose/material/material/src/androidAndroidTest/kotlin/androidx/compose/material/CheckboxScreenshotTest.kt
index 0c34989..36fdfc7 100644
--- a/compose/material/material/src/androidAndroidTest/kotlin/androidx/compose/material/CheckboxScreenshotTest.kt
+++ b/compose/material/material/src/androidAndroidTest/kotlin/androidx/compose/material/CheckboxScreenshotTest.kt
@@ -19,7 +19,6 @@
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.wrapContentSize
import androidx.compose.runtime.mutableStateOf
-import androidx.compose.runtime.remember
import androidx.compose.testutils.assertAgainstGolden
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
@@ -84,9 +83,18 @@
Checkbox(modifier = wrap, checked = false, onCheckedChange = { })
}
}
- rule.onNodeWithTag(wrapperTestTag).performTouchInput {
+
+ rule.onNode(isToggleable()).performTouchInput {
down(center)
}
+
+ // Advance past the tap timeout
+ rule.mainClock.advanceTimeBy(100)
+
+ // Ripples are drawn on the RenderThread, not the main (UI) thread, so we can't wait for
+ // synchronization. Instead just wait until after the ripples are finished animating.
+ Thread.sleep(300)
+
assertToggeableAgainstGolden("checkbox_pressed")
}
@@ -141,8 +149,8 @@
@Test
fun checkBoxTest_unchecked_animateToChecked() {
+ val isChecked = mutableStateOf(false)
rule.setMaterialContent {
- val isChecked = remember { mutableStateOf(false) }
Box(wrap.testTag(wrapperTestTag)) {
Checkbox(
modifier = wrap,
@@ -154,10 +162,12 @@
rule.mainClock.autoAdvance = false
- rule.onNode(isToggleable())
- // split click into (down) and (move, up) to enforce a composition in between
- .performTouchInput { down(center) }
- .performTouchInput { move(); up() }
+ // Because Ripples are drawn on the RenderThread, it is hard to synchronize them with
+ // Compose animations, so instead just manually change the value instead of triggering
+ // and trying to screenshot a ripple
+ rule.runOnIdle {
+ isChecked.value = true
+ }
rule.mainClock.advanceTimeByFrame()
rule.waitForIdle() // Wait for measure
@@ -168,8 +178,8 @@
@Test
fun checkBoxTest_checked_animateToUnchecked() {
+ val isChecked = mutableStateOf(true)
rule.setMaterialContent {
- val isChecked = remember { mutableStateOf(true) }
Box(wrap.testTag(wrapperTestTag)) {
Checkbox(
modifier = wrap,
@@ -181,10 +191,12 @@
rule.mainClock.autoAdvance = false
- rule.onNode(isToggleable())
- // split click into (down) and (move, up) to enforce a composition in between
- .performTouchInput { down(center) }
- .performTouchInput { move(); up() }
+ // Because Ripples are drawn on the RenderThread, it is hard to synchronize them with
+ // Compose animations, so instead just manually change the value instead of triggering
+ // and trying to screenshot a ripple
+ rule.runOnIdle {
+ isChecked.value = false
+ }
rule.mainClock.advanceTimeByFrame()
rule.waitForIdle() // Wait for measure
diff --git a/compose/material/material/src/androidAndroidTest/kotlin/androidx/compose/material/CheckboxUiTest.kt b/compose/material/material/src/androidAndroidTest/kotlin/androidx/compose/material/CheckboxTest.kt
similarity index 63%
rename from compose/material/material/src/androidAndroidTest/kotlin/androidx/compose/material/CheckboxUiTest.kt
rename to compose/material/material/src/androidAndroidTest/kotlin/androidx/compose/material/CheckboxTest.kt
index 5d7941d..747e558 100644
--- a/compose/material/material/src/androidAndroidTest/kotlin/androidx/compose/material/CheckboxUiTest.kt
+++ b/compose/material/material/src/androidAndroidTest/kotlin/androidx/compose/material/CheckboxTest.kt
@@ -19,6 +19,7 @@
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.requiredSize
+import androidx.compose.runtime.CompositionLocalProvider
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
@@ -62,7 +63,7 @@
@MediumTest
@RunWith(AndroidJUnit4::class)
-class CheckboxUiTest {
+class CheckboxTest {
@get:Rule
val rule = createComposeRule()
@@ -160,26 +161,138 @@
}
@Test
- fun checkBoxTest_MaterialSize_WhenChecked() {
- materialSizeTestForValue(On)
+ fun checkBoxTest_MaterialSize_WhenChecked_minimumTouchTarget() {
+ materialSizeTestForValue(
+ checkboxValue = On,
+ clickable = true,
+ minimumTouchTarget = true
+ )
}
@Test
- fun checkBoxTest_MaterialSize_WhenUnchecked() {
- materialSizeTestForValue(Off)
+ fun checkBoxTest_MaterialSize_WhenChecked_withoutMinimumTouchTarget() {
+ materialSizeTestForValue(
+ checkboxValue = On,
+ clickable = true,
+ minimumTouchTarget = false
+ )
}
@Test
- fun checkBoxTest_MaterialSize_WhenIndeterminate() {
- materialSizeTestForValue(Indeterminate)
+ fun checkBoxTest_MaterialSize_WhenUnchecked_minimumTouchTarget() {
+ materialSizeTestForValue(
+ checkboxValue = Off,
+ clickable = true,
+ minimumTouchTarget = true
+ )
}
- private fun materialSizeTestForValue(checkboxValue: ToggleableState) {
+ @Test
+ fun checkBoxTest_MaterialSize_WhenUnchecked_withoutMinimumTouchTarget() {
+ materialSizeTestForValue(
+ checkboxValue = Off,
+ clickable = true,
+ minimumTouchTarget = false
+ )
+ }
+
+ @Test
+ fun checkBoxTest_MaterialSize_WhenIndeterminate_minimumTouchTarget() {
+ materialSizeTestForValue(
+ checkboxValue = Indeterminate,
+ clickable = true,
+ minimumTouchTarget = true
+ )
+ }
+
+ @Test
+ fun checkBoxTest_MaterialSize_WhenIndeterminate_withoutMinimumTouchTarget() {
+ materialSizeTestForValue(
+ checkboxValue = Indeterminate,
+ clickable = true,
+ minimumTouchTarget = false
+ )
+ }
+
+ @Test
+ fun checkBoxTest_MaterialSize_WhenChecked_notClickable_minimumTouchTarget() {
+ materialSizeTestForValue(
+ checkboxValue = On,
+ clickable = false,
+ minimumTouchTarget = true
+ )
+ }
+
+ @Test
+ fun checkBoxTest_MaterialSize_WhenChecked_notClickable_withoutMinimumTouchTarget() {
+ materialSizeTestForValue(
+ checkboxValue = On,
+ clickable = false,
+ minimumTouchTarget = false
+ )
+ }
+
+ @Test
+ fun checkBoxTest_MaterialSize_WhenUnchecked_notClickable_minimumTouchTarget() {
+ materialSizeTestForValue(
+ checkboxValue = Off,
+ clickable = false,
+ minimumTouchTarget = true
+ )
+ }
+
+ @Test
+ fun checkBoxTest_MaterialSize_WhenUnchecked_notClickable_withoutMinimumTouchTarget() {
+ materialSizeTestForValue(
+ checkboxValue = Off,
+ clickable = false,
+ minimumTouchTarget = false
+ )
+ }
+
+ @Test
+ fun checkBoxTest_MaterialSize_WhenIndeterminate_notClickable_minimumTouchTarget() {
+ materialSizeTestForValue(
+ checkboxValue = Indeterminate,
+ clickable = false,
+ minimumTouchTarget = true
+ )
+ }
+
+ @Test
+ fun checkBoxTest_MaterialSize_WhenIndeterminate_notClickable_withoutMinimumTouchTarget() {
+ materialSizeTestForValue(
+ checkboxValue = Indeterminate,
+ clickable = false,
+ minimumTouchTarget = false
+ )
+ }
+
+ @OptIn(ExperimentalMaterialApi::class)
+ private fun materialSizeTestForValue(
+ checkboxValue: ToggleableState,
+ clickable: Boolean,
+ minimumTouchTarget: Boolean
+ ) {
rule
.setMaterialContentForSizeAssertions {
- TriStateCheckbox(state = checkboxValue, onClick = {}, enabled = false)
+ CompositionLocalProvider(
+ LocalMinimumTouchTargetEnforcement provides minimumTouchTarget
+ ) {
+ TriStateCheckbox(
+ state = checkboxValue,
+ onClick = if (clickable) { {} } else null,
+ enabled = false
+ )
+ }
}
- .assertIsSquareWithSize(2.dp * 2 + 20.dp)
+ .run {
+ if (clickable && minimumTouchTarget) {
+ assertIsSquareWithSize(48.dp)
+ } else {
+ assertIsSquareWithSize(2.dp * 2 + 20.dp)
+ }
+ }
}
@Test
diff --git a/compose/material/material/src/androidAndroidTest/kotlin/androidx/compose/material/RadioButtonScreenshotTest.kt b/compose/material/material/src/androidAndroidTest/kotlin/androidx/compose/material/RadioButtonScreenshotTest.kt
index e3ff07d..3b3c67c 100644
--- a/compose/material/material/src/androidAndroidTest/kotlin/androidx/compose/material/RadioButtonScreenshotTest.kt
+++ b/compose/material/material/src/androidAndroidTest/kotlin/androidx/compose/material/RadioButtonScreenshotTest.kt
@@ -88,6 +88,9 @@
down(center)
}
+ // Advance past the tap timeout
+ rule.mainClock.advanceTimeBy(100)
+
// Ripples are drawn on the RenderThread, not the main (UI) thread, so we can't wait for
// synchronization. Instead just wait until after the ripples are finished animating.
Thread.sleep(300)
diff --git a/compose/material/material/src/androidAndroidTest/kotlin/androidx/compose/material/RadioButtonTest.kt b/compose/material/material/src/androidAndroidTest/kotlin/androidx/compose/material/RadioButtonTest.kt
index ceea5a6..4473465 100644
--- a/compose/material/material/src/androidAndroidTest/kotlin/androidx/compose/material/RadioButtonTest.kt
+++ b/compose/material/material/src/androidAndroidTest/kotlin/androidx/compose/material/RadioButtonTest.kt
@@ -17,6 +17,7 @@
package androidx.compose.material
import androidx.compose.foundation.layout.Column
+import androidx.compose.runtime.CompositionLocalProvider
import androidx.compose.runtime.mutableStateOf
import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.testTag
@@ -204,20 +205,97 @@
}
@Test
- fun radioButton_materialSizes_whenSelected() {
- materialSizesTestForValue(selected = true)
+ fun radioButton_materialSizes_whenSelected_minimumTouchTarget() {
+ materialSizesTestForValue(
+ selected = true,
+ clickable = true,
+ minimumTouchTarget = true
+ )
}
@Test
- fun radioButton_materialSizes_whenNotSelected() {
- materialSizesTestForValue(selected = false)
+ fun radioButton_materialSizes_whenSelected_withoutMinimumTouchTarget() {
+ materialSizesTestForValue(
+ selected = true,
+ clickable = true,
+ minimumTouchTarget = false
+ )
}
- private fun materialSizesTestForValue(selected: Boolean) {
+ @Test
+ fun radioButton_materialSizes_whenNotSelected_minimumTouchTarget() {
+ materialSizesTestForValue(
+ selected = false,
+ clickable = true,
+ minimumTouchTarget = true
+ )
+ }
+
+ @Test
+ fun radioButton_materialSizes_whenNotSelected_withoutMinimumTouchTarget() {
+ materialSizesTestForValue(
+ selected = false,
+ clickable = true,
+ minimumTouchTarget = false
+ )
+ }
+
+ @Test
+ fun radioButton_materialSizes_whenSelected_notClickable_minimumTouchTarget() {
+ materialSizesTestForValue(
+ selected = true,
+ clickable = false,
+ minimumTouchTarget = true
+ )
+ }
+
+ @Test
+ fun radioButton_materialSizes_whenSelected_notClickable_withoutMinimumTouchTarget() {
+ materialSizesTestForValue(
+ selected = true,
+ clickable = false,
+ minimumTouchTarget = false
+ )
+ }
+
+ @Test
+ fun radioButton_materialSizes_whenNotSelected_notClickable_minimumTouchTarget() {
+ materialSizesTestForValue(
+ selected = false,
+ clickable = false,
+ minimumTouchTarget = true
+ )
+ }
+
+ @Test
+ fun radioButton_materialSizes_whenNotSelected_notClickable_withoutMinimumTouchTarget() {
+ materialSizesTestForValue(
+ selected = false,
+ clickable = false,
+ minimumTouchTarget = false
+ )
+ }
+
+ @OptIn(ExperimentalMaterialApi::class)
+ private fun materialSizesTestForValue(
+ selected: Boolean,
+ clickable: Boolean,
+ minimumTouchTarget: Boolean
+ ) {
rule
.setMaterialContentForSizeAssertions {
- RadioButton(selected = selected, onClick = {})
+ CompositionLocalProvider(
+ LocalMinimumTouchTargetEnforcement provides minimumTouchTarget
+ ) {
+ RadioButton(selected = selected, onClick = if (clickable) { {} } else null)
+ }
}
- .assertIsSquareWithSize(2.dp * 2 + 20.dp)
+ .run {
+ if (clickable && minimumTouchTarget) {
+ assertIsSquareWithSize(48.dp)
+ } else {
+ assertIsSquareWithSize(2.dp * 2 + 20.dp)
+ }
+ }
}
}
\ No newline at end of file
diff --git a/compose/material/material/src/androidAndroidTest/kotlin/androidx/compose/material/SnackbarTest.kt b/compose/material/material/src/androidAndroidTest/kotlin/androidx/compose/material/SnackbarTest.kt
index 7e7d35b..e1ebe2f 100644
--- a/compose/material/material/src/androidAndroidTest/kotlin/androidx/compose/material/SnackbarTest.kt
+++ b/compose/material/material/src/androidAndroidTest/kotlin/androidx/compose/material/SnackbarTest.kt
@@ -331,7 +331,7 @@
)
snackbar
- .assertHeightIsEqualTo(8.dp + buttonBounds.top + buttonBounds.height)
+ .assertHeightIsEqualTo(2.dp + buttonBounds.top + buttonBounds.height)
.assertWidthIsEqualTo(8.dp + buttonBounds.left + buttonBounds.width)
}
diff --git a/compose/material/material/src/androidAndroidTest/kotlin/androidx/compose/material/SwitchTest.kt b/compose/material/material/src/androidAndroidTest/kotlin/androidx/compose/material/SwitchTest.kt
index ce54dea..58032f1 100644
--- a/compose/material/material/src/androidAndroidTest/kotlin/androidx/compose/material/SwitchTest.kt
+++ b/compose/material/material/src/androidAndroidTest/kotlin/androidx/compose/material/SwitchTest.kt
@@ -197,13 +197,75 @@
}
@Test
- fun switch_materialSizes_whenChecked() {
- materialSizesTestForValue(true)
+ fun switch_materialSizes_whenChecked_minimumTouchTarget() {
+ materialSizesTestForValue(
+ checked = true,
+ clickable = true,
+ minimumTouchTarget = true
+ )
}
@Test
- fun switch_materialSizes_whenUnchecked() {
- materialSizesTestForValue(false)
+ fun switch_materialSizes_whenChecked_withoutMinimumTouchTarget() {
+ materialSizesTestForValue(
+ checked = true,
+ clickable = true,
+ minimumTouchTarget = false
+ )
+ }
+
+ @Test
+ fun switch_materialSizes_whenUnchecked_minimumTouchTarget() {
+ materialSizesTestForValue(
+ checked = false,
+ clickable = true,
+ minimumTouchTarget = true
+ )
+ }
+
+ @Test
+ fun switch_materialSizes_whenUnchecked_withoutMinimumTouchTarget() {
+ materialSizesTestForValue(
+ checked = false,
+ clickable = true,
+ minimumTouchTarget = false
+ )
+ }
+
+ @Test
+ fun switch_materialSizes_whenChecked_notClickable_minimumTouchTarget() {
+ materialSizesTestForValue(
+ checked = true,
+ clickable = false,
+ minimumTouchTarget = true
+ )
+ }
+
+ @Test
+ fun switch_materialSizes_whenChecked_notClickable_withoutMinimumTouchTarget() {
+ materialSizesTestForValue(
+ checked = true,
+ clickable = false,
+ minimumTouchTarget = false
+ )
+ }
+
+ @Test
+ fun switch_materialSizes_whenUnchecked_notClickable_minimumTouchTarget() {
+ materialSizesTestForValue(
+ checked = false,
+ clickable = false,
+ minimumTouchTarget = true
+ )
+ }
+
+ @Test
+ fun switch_materialSizes_whenUnchecked_notClickable_withoutMinimumTouchTarget() {
+ materialSizesTestForValue(
+ checked = false,
+ clickable = false,
+ minimumTouchTarget = false
+ )
}
@Test
@@ -323,20 +385,37 @@
rule.onNodeWithTag("2").assertIsOff()
}
- private fun materialSizesTestForValue(checked: Boolean) = with(rule.density) {
- // The padding should be 2 DP, but we round to pixels when determining layout
- val paddingInPixels = 2.dp.roundToPx()
-
- // Convert back to DP so that we have an exact DP value to work with. We don't
- // want to multiply the error by two (one for each padding), so we get the exact
- // padding based on the expected pixels consumed by the padding.
- val paddingInDp = paddingInPixels.toDp()
-
+ @OptIn(ExperimentalMaterialApi::class)
+ private fun materialSizesTestForValue(
+ checked: Boolean,
+ clickable: Boolean,
+ minimumTouchTarget: Boolean
+ ) = with(rule.density) {
rule.setMaterialContentForSizeAssertions {
- Switch(checked = checked, onCheckedChange = {}, enabled = false)
+ CompositionLocalProvider(
+ LocalMinimumTouchTargetEnforcement provides minimumTouchTarget
+ ) {
+ Switch(
+ checked = checked,
+ onCheckedChange = if (clickable) { {} } else null,
+ enabled = false
+ )
+ }
+ }.run {
+ if (clickable && minimumTouchTarget) {
+ assertIsSquareWithSize(48.dp)
+ } else {
+ // The padding should be 2 DP, but we round to pixels when determining layout
+ val paddingInPixels = 2.dp.roundToPx()
+
+ // Convert back to DP so that we have an exact DP value to work with. We don't
+ // want to multiply the error by two (one for each padding), so we get the exact
+ // padding based on the expected pixels consumed by the padding.
+ val paddingInDp = paddingInPixels.toDp()
+ assertWidthIsEqualTo(34.dp + paddingInDp * 2)
+ assertHeightIsEqualTo(20.dp + paddingInDp * 2)
+ }
}
- .assertWidthIsEqualTo(34.dp + paddingInDp * 2)
- .assertHeightIsEqualTo(20.dp + paddingInDp * 2)
}
/**
diff --git a/compose/material/material/src/androidMain/kotlin/androidx/compose/material/AndroidAlertDialog.android.kt b/compose/material/material/src/androidMain/kotlin/androidx/compose/material/AndroidAlertDialog.android.kt
index 9042e78..0c18173 100644
--- a/compose/material/material/src/androidMain/kotlin/androidx/compose/material/AndroidAlertDialog.android.kt
+++ b/compose/material/material/src/androidMain/kotlin/androidx/compose/material/AndroidAlertDialog.android.kt
@@ -77,7 +77,7 @@
onDismissRequest = onDismissRequest,
buttons = {
// TODO: move the modifiers to FlowRow when it supports a modifier parameter
- Box(Modifier.fillMaxWidth().padding(all = 8.dp)) {
+ Box(Modifier.fillMaxWidth().padding(horizontal = 8.dp, vertical = 2.dp)) {
AlertDialogFlowRow(
mainAxisSpacing = 8.dp,
crossAxisSpacing = 12.dp
diff --git a/wear/wear-complications-data-source-samples/src/main/java/androidx/wear/complications/datasource/samples/PlainComplicationText.kt b/compose/material/material/src/androidMain/kotlin/androidx/compose/material/MaterialTheme.android.kt
similarity index 74%
copy from wear/wear-complications-data-source-samples/src/main/java/androidx/wear/complications/datasource/samples/PlainComplicationText.kt
copy to compose/material/material/src/androidMain/kotlin/androidx/compose/material/MaterialTheme.android.kt
index cb807c3..a94e2a2 100644
--- a/wear/wear-complications-data-source-samples/src/main/java/androidx/wear/complications/datasource/samples/PlainComplicationText.kt
+++ b/compose/material/material/src/androidMain/kotlin/androidx/compose/material/MaterialTheme.android.kt
@@ -14,9 +14,11 @@
* limitations under the License.
*/
-package androidx.wear.complications.datasource.samples
+package androidx.compose.material
-import androidx.wear.complications.data.PlainComplicationText
+import androidx.compose.runtime.Composable
-internal fun plainText(text: CharSequence) =
- PlainComplicationText.Builder(text).build()
\ No newline at end of file
+@Composable
+internal actual fun PlatformMaterialTheme(content: @Composable () -> Unit) {
+ content()
+}
diff --git a/compose/material/material/src/commonMain/kotlin/androidx/compose/material/Checkbox.kt b/compose/material/material/src/commonMain/kotlin/androidx/compose/material/Checkbox.kt
index 354c7c8..49995ca 100644
--- a/compose/material/material/src/commonMain/kotlin/androidx/compose/material/Checkbox.kt
+++ b/compose/material/material/src/commonMain/kotlin/androidx/compose/material/Checkbox.kt
@@ -156,6 +156,7 @@
enabled = enabled,
value = state,
modifier = modifier
+ .then(if (onClick != null) { Modifier.minimumTouchTargetSize() } else { Modifier })
.then(toggleableModifier)
.padding(CheckboxDefaultPadding),
colors = colors
diff --git a/compose/material/material/src/commonMain/kotlin/androidx/compose/material/MaterialTheme.kt b/compose/material/material/src/commonMain/kotlin/androidx/compose/material/MaterialTheme.kt
index abe782c..60d2a63 100644
--- a/compose/material/material/src/commonMain/kotlin/androidx/compose/material/MaterialTheme.kt
+++ b/compose/material/material/src/commonMain/kotlin/androidx/compose/material/MaterialTheme.kt
@@ -78,10 +78,15 @@
LocalTextSelectionColors provides selectionColors,
LocalTypography provides typography
) {
- ProvideTextStyle(value = typography.body1, content = content)
+ ProvideTextStyle(value = typography.body1) {
+ PlatformMaterialTheme(content)
+ }
}
}
+@Composable
+internal expect fun PlatformMaterialTheme(content: @Composable () -> Unit)
+
/**
* Contains functions to access the current theme values provided at the call site's position in
* the hierarchy.
diff --git a/compose/material/material/src/commonMain/kotlin/androidx/compose/material/RadioButton.kt b/compose/material/material/src/commonMain/kotlin/androidx/compose/material/RadioButton.kt
index faf13a6..9d62fe9 100644
--- a/compose/material/material/src/commonMain/kotlin/androidx/compose/material/RadioButton.kt
+++ b/compose/material/material/src/commonMain/kotlin/androidx/compose/material/RadioButton.kt
@@ -104,6 +104,7 @@
}
Canvas(
modifier
+ .then(if (onClick != null) { Modifier.minimumTouchTargetSize() } else { Modifier })
.then(selectableModifier)
.wrapContentSize(Alignment.Center)
.padding(RadioButtonPadding)
diff --git a/compose/material/material/src/commonMain/kotlin/androidx/compose/material/Slider.kt b/compose/material/material/src/commonMain/kotlin/androidx/compose/material/Slider.kt
index 60cc16b..fdee814 100644
--- a/compose/material/material/src/commonMain/kotlin/androidx/compose/material/Slider.kt
+++ b/compose/material/material/src/commonMain/kotlin/androidx/compose/material/Slider.kt
@@ -154,6 +154,7 @@
}
BoxWithConstraints(
modifier
+ .minimumTouchTargetSize()
.requiredSizeIn(minWidth = ThumbRadius * 2, minHeight = ThumbRadius * 2)
.sliderSemantics(value, tickFractions, enabled, onValueChange, valueRange, steps)
.focusable(enabled, interactionSource)
diff --git a/compose/material/material/src/commonMain/kotlin/androidx/compose/material/Snackbar.kt b/compose/material/material/src/commonMain/kotlin/androidx/compose/material/Snackbar.kt
index 5f0854d..04bb5c5 100644
--- a/compose/material/material/src/commonMain/kotlin/androidx/compose/material/Snackbar.kt
+++ b/compose/material/material/src/commonMain/kotlin/androidx/compose/material/Snackbar.kt
@@ -234,15 +234,16 @@
@Composable
private fun TextOnlySnackbar(content: @Composable () -> Unit) {
- Layout(
- content,
- modifier = Modifier.padding(
- start = HorizontalSpacing,
- end = HorizontalSpacing,
- top = SnackbarVerticalPadding,
- bottom = SnackbarVerticalPadding
- )
- ) { measurables, constraints ->
+ Layout({
+ Box(
+ modifier = Modifier.padding(
+ horizontal = HorizontalSpacing,
+ vertical = SnackbarVerticalPadding
+ )
+ ) {
+ content()
+ }
+ }) { measurables, constraints ->
require(measurables.size == 1) {
"text for Snackbar expected to have exactly only one child"
}
@@ -296,14 +297,12 @@
val actionTag = "action"
Layout(
{
- Box(Modifier.layoutId(textTag)) { text() }
+ Box(Modifier.layoutId(textTag).padding(vertical = SnackbarVerticalPadding)) { text() }
Box(Modifier.layoutId(actionTag)) { action() }
},
modifier = Modifier.padding(
start = HorizontalSpacing,
- end = HorizontalSpacingButtonSide,
- top = SnackbarVerticalPadding,
- bottom = SnackbarVerticalPadding
+ end = HorizontalSpacingButtonSide
)
) { measurables, constraints ->
val buttonPlaceable = measurables.first { it.layoutId == actionTag }.measure(constraints)
@@ -339,7 +338,7 @@
}
} else {
val baselineOffset = HeightToFirstLine.roundToPx()
- textPlaceY = baselineOffset - firstTextBaseline - SnackbarVerticalPadding.roundToPx()
+ textPlaceY = baselineOffset - firstTextBaseline
val minContainerHeight = SnackbarMinHeightTwoLines.roundToPx()
val contentHeight = textPlaceY + textPlaceable.height
containerHeight = max(minContainerHeight, contentHeight)
@@ -356,9 +355,9 @@
private val HeightToFirstLine = 30.dp
private val HorizontalSpacing = 16.dp
private val HorizontalSpacingButtonSide = 8.dp
-private val SeparateButtonExtraY = 8.dp
+private val SeparateButtonExtraY = 2.dp
private val SnackbarVerticalPadding = 6.dp
private val TextEndExtraSpacing = 8.dp
-private val LongButtonVerticalOffset = 18.dp
-private val SnackbarMinHeightOneLine = 48.dp - SnackbarVerticalPadding * 2
-private val SnackbarMinHeightTwoLines = 68.dp - SnackbarVerticalPadding * 2
+private val LongButtonVerticalOffset = 12.dp
+private val SnackbarMinHeightOneLine = 48.dp
+private val SnackbarMinHeightTwoLines = 68.dp
diff --git a/compose/material/material/src/commonMain/kotlin/androidx/compose/material/Surface.kt b/compose/material/material/src/commonMain/kotlin/androidx/compose/material/Surface.kt
index c7cd8d6..e45369a 100644
--- a/compose/material/material/src/commonMain/kotlin/androidx/compose/material/Surface.kt
+++ b/compose/material/material/src/commonMain/kotlin/androidx/compose/material/Surface.kt
@@ -212,7 +212,7 @@
content: @Composable () -> Unit
) {
Surface(
- modifier = modifier,
+ modifier = modifier.minimumTouchTargetSize(),
shape = shape,
color = color,
contentColor = contentColor,
diff --git a/compose/material/material/src/commonMain/kotlin/androidx/compose/material/Switch.kt b/compose/material/material/src/commonMain/kotlin/androidx/compose/material/Switch.kt
index 9ae889b..ba46fe0 100644
--- a/compose/material/material/src/commonMain/kotlin/androidx/compose/material/Switch.kt
+++ b/compose/material/material/src/commonMain/kotlin/androidx/compose/material/Switch.kt
@@ -115,6 +115,9 @@
Box(
modifier
+ .then(
+ if (onCheckedChange != null) Modifier.minimumTouchTargetSize() else Modifier
+ )
.then(toggleableModifier)
.swipeable(
state = swipeableState,
diff --git a/compose/material/material/src/commonMain/kotlin/androidx/compose/material/TouchTarget.kt b/compose/material/material/src/commonMain/kotlin/androidx/compose/material/TouchTarget.kt
new file mode 100644
index 0000000..e0622d6
--- /dev/null
+++ b/compose/material/material/src/commonMain/kotlin/androidx/compose/material/TouchTarget.kt
@@ -0,0 +1,85 @@
+/*
+ * Copyright 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES 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.compose.material
+
+import androidx.compose.runtime.ProvidableCompositionLocal
+import androidx.compose.runtime.staticCompositionLocalOf
+import androidx.compose.ui.Modifier
+import androidx.compose.ui.composed
+import androidx.compose.ui.layout.LayoutModifier
+import androidx.compose.ui.layout.Measurable
+import androidx.compose.ui.layout.MeasureResult
+import androidx.compose.ui.layout.MeasureScope
+import androidx.compose.ui.platform.LocalViewConfiguration
+import androidx.compose.ui.unit.Constraints
+import androidx.compose.ui.unit.DpSize
+
+@OptIn(ExperimentalMaterialApi::class)
+@Suppress("ModifierInspectorInfo")
+internal fun Modifier.minimumTouchTargetSize(): Modifier = composed {
+ if (LocalMinimumTouchTargetEnforcement.current) {
+ // TODO: consider using a hardcoded value of 48.dp instead to avoid inconsistent UI if the
+ // LocalViewConfiguration changes across devices / during runtime.
+ val size = LocalViewConfiguration.current.minimumTouchTargetSize
+ MinimumTouchTargetModifier(size)
+ } else {
+ Modifier
+ }
+}
+
+/**
+ * CompositionLocal that configures whether Material components that have a visual size that is
+ * lower than the minimum touch target size for accessibility (such as [Button]) will include
+ * extra space outside the component to ensure that they are accessible. If set to false there
+ * will be no extra space, and so it is possible that if the component is placed near the edge of
+ * a layout / near to another component without any padding, there will not be enough space for
+ * an accessible touch target.
+ */
+@Suppress("EXPERIMENTAL_ANNOTATION_ON_WRONG_TARGET")
+@get:ExperimentalMaterialApi
+@ExperimentalMaterialApi
+val LocalMinimumTouchTargetEnforcement: ProvidableCompositionLocal<Boolean> =
+ staticCompositionLocalOf { true }
+
+private class MinimumTouchTargetModifier(val size: DpSize) : LayoutModifier {
+ override fun MeasureScope.measure(
+ measurable: Measurable,
+ constraints: Constraints
+ ): MeasureResult {
+
+ val placeable = measurable.measure(constraints)
+
+ // Be at least as big as the minimum dimension in both dimensions
+ val width = maxOf(placeable.width, size.width.roundToPx())
+ val height = maxOf(placeable.height, size.height.roundToPx())
+
+ return layout(width, height) {
+ val centerX = (width - placeable.width) / 2
+ val centerY = (height - placeable.height) / 2
+ placeable.place(centerX, centerY)
+ }
+ }
+
+ override fun equals(other: Any?): Boolean {
+ val otherModifier = other as? MinimumTouchTargetModifier ?: return false
+ return size == otherModifier.size
+ }
+
+ override fun hashCode(): Int {
+ return size.hashCode()
+ }
+}
diff --git a/compose/material/material/src/desktopMain/kotlin/androidx/compose/material/MaterialTheme.desktop.kt b/compose/material/material/src/desktopMain/kotlin/androidx/compose/material/MaterialTheme.desktop.kt
new file mode 100644
index 0000000..33b86ee
--- /dev/null
+++ b/compose/material/material/src/desktopMain/kotlin/androidx/compose/material/MaterialTheme.desktop.kt
@@ -0,0 +1,34 @@
+/*
+ * Copyright 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES 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.compose.material
+
+import androidx.compose.foundation.LocalScrollbarStyle
+import androidx.compose.foundation.defaultScrollbarStyle
+import androidx.compose.runtime.Composable
+import androidx.compose.runtime.CompositionLocalProvider
+
+@Composable
+internal actual fun PlatformMaterialTheme(content: @Composable () -> Unit) {
+ CompositionLocalProvider(
+ LocalScrollbarStyle provides defaultScrollbarStyle().copy(
+ shape = MaterialTheme.shapes.small,
+ unhoverColor = MaterialTheme.colors.onSurface.copy(alpha = 0.12f),
+ hoverColor = MaterialTheme.colors.onSurface.copy(alpha = 0.50f)
+ ),
+ content = content
+ )
+}
diff --git a/compose/material3/material3/api/current.txt b/compose/material3/material3/api/current.txt
index 9dcbd45..98d95fe 100644
--- a/compose/material3/material3/api/current.txt
+++ b/compose/material3/material3/api/current.txt
@@ -84,6 +84,17 @@
public final class DynamicTonalPaletteKt {
}
+ public final class IconButtonKt {
+ method @androidx.compose.runtime.Composable public static void IconButton(kotlin.jvm.functions.Function0<kotlin.Unit> onClick, optional androidx.compose.ui.Modifier modifier, optional boolean enabled, optional androidx.compose.foundation.interaction.MutableInteractionSource interactionSource, kotlin.jvm.functions.Function0<kotlin.Unit> content);
+ method @androidx.compose.runtime.Composable public static void IconToggleButton(boolean checked, kotlin.jvm.functions.Function1<? super java.lang.Boolean,kotlin.Unit> onCheckedChange, optional androidx.compose.ui.Modifier modifier, optional boolean enabled, optional androidx.compose.foundation.interaction.MutableInteractionSource interactionSource, kotlin.jvm.functions.Function0<kotlin.Unit> content);
+ }
+
+ public final class IconKt {
+ method @androidx.compose.runtime.Composable public static void Icon(androidx.compose.ui.graphics.vector.ImageVector imageVector, String? contentDescription, optional androidx.compose.ui.Modifier modifier, optional long tint);
+ method @androidx.compose.runtime.Composable public static void Icon(androidx.compose.ui.graphics.ImageBitmap bitmap, String? contentDescription, optional androidx.compose.ui.Modifier modifier, optional long tint);
+ method @androidx.compose.runtime.Composable public static void Icon(androidx.compose.ui.graphics.painter.Painter painter, String? contentDescription, optional androidx.compose.ui.Modifier modifier, optional long tint);
+ }
+
public final class MaterialTheme {
method @androidx.compose.runtime.Composable @androidx.compose.runtime.ReadOnlyComposable public androidx.compose.material3.ColorScheme getColorScheme();
method @androidx.compose.runtime.Composable @androidx.compose.runtime.ReadOnlyComposable public androidx.compose.material3.Shapes getShapes();
diff --git a/compose/material3/material3/api/public_plus_experimental_current.txt b/compose/material3/material3/api/public_plus_experimental_current.txt
index 9dcbd45..98d95fe 100644
--- a/compose/material3/material3/api/public_plus_experimental_current.txt
+++ b/compose/material3/material3/api/public_plus_experimental_current.txt
@@ -84,6 +84,17 @@
public final class DynamicTonalPaletteKt {
}
+ public final class IconButtonKt {
+ method @androidx.compose.runtime.Composable public static void IconButton(kotlin.jvm.functions.Function0<kotlin.Unit> onClick, optional androidx.compose.ui.Modifier modifier, optional boolean enabled, optional androidx.compose.foundation.interaction.MutableInteractionSource interactionSource, kotlin.jvm.functions.Function0<kotlin.Unit> content);
+ method @androidx.compose.runtime.Composable public static void IconToggleButton(boolean checked, kotlin.jvm.functions.Function1<? super java.lang.Boolean,kotlin.Unit> onCheckedChange, optional androidx.compose.ui.Modifier modifier, optional boolean enabled, optional androidx.compose.foundation.interaction.MutableInteractionSource interactionSource, kotlin.jvm.functions.Function0<kotlin.Unit> content);
+ }
+
+ public final class IconKt {
+ method @androidx.compose.runtime.Composable public static void Icon(androidx.compose.ui.graphics.vector.ImageVector imageVector, String? contentDescription, optional androidx.compose.ui.Modifier modifier, optional long tint);
+ method @androidx.compose.runtime.Composable public static void Icon(androidx.compose.ui.graphics.ImageBitmap bitmap, String? contentDescription, optional androidx.compose.ui.Modifier modifier, optional long tint);
+ method @androidx.compose.runtime.Composable public static void Icon(androidx.compose.ui.graphics.painter.Painter painter, String? contentDescription, optional androidx.compose.ui.Modifier modifier, optional long tint);
+ }
+
public final class MaterialTheme {
method @androidx.compose.runtime.Composable @androidx.compose.runtime.ReadOnlyComposable public androidx.compose.material3.ColorScheme getColorScheme();
method @androidx.compose.runtime.Composable @androidx.compose.runtime.ReadOnlyComposable public androidx.compose.material3.Shapes getShapes();
diff --git a/compose/material3/material3/api/restricted_current.txt b/compose/material3/material3/api/restricted_current.txt
index 9dcbd45..98d95fe 100644
--- a/compose/material3/material3/api/restricted_current.txt
+++ b/compose/material3/material3/api/restricted_current.txt
@@ -84,6 +84,17 @@
public final class DynamicTonalPaletteKt {
}
+ public final class IconButtonKt {
+ method @androidx.compose.runtime.Composable public static void IconButton(kotlin.jvm.functions.Function0<kotlin.Unit> onClick, optional androidx.compose.ui.Modifier modifier, optional boolean enabled, optional androidx.compose.foundation.interaction.MutableInteractionSource interactionSource, kotlin.jvm.functions.Function0<kotlin.Unit> content);
+ method @androidx.compose.runtime.Composable public static void IconToggleButton(boolean checked, kotlin.jvm.functions.Function1<? super java.lang.Boolean,kotlin.Unit> onCheckedChange, optional androidx.compose.ui.Modifier modifier, optional boolean enabled, optional androidx.compose.foundation.interaction.MutableInteractionSource interactionSource, kotlin.jvm.functions.Function0<kotlin.Unit> content);
+ }
+
+ public final class IconKt {
+ method @androidx.compose.runtime.Composable public static void Icon(androidx.compose.ui.graphics.vector.ImageVector imageVector, String? contentDescription, optional androidx.compose.ui.Modifier modifier, optional long tint);
+ method @androidx.compose.runtime.Composable public static void Icon(androidx.compose.ui.graphics.ImageBitmap bitmap, String? contentDescription, optional androidx.compose.ui.Modifier modifier, optional long tint);
+ method @androidx.compose.runtime.Composable public static void Icon(androidx.compose.ui.graphics.painter.Painter painter, String? contentDescription, optional androidx.compose.ui.Modifier modifier, optional long tint);
+ }
+
public final class MaterialTheme {
method @androidx.compose.runtime.Composable @androidx.compose.runtime.ReadOnlyComposable public androidx.compose.material3.ColorScheme getColorScheme();
method @androidx.compose.runtime.Composable @androidx.compose.runtime.ReadOnlyComposable public androidx.compose.material3.Shapes getShapes();
diff --git a/compose/material3/material3/build.gradle b/compose/material3/material3/build.gradle
index c69958d..0d1dc6f 100644
--- a/compose/material3/material3/build.gradle
+++ b/compose/material3/material3/build.gradle
@@ -39,8 +39,8 @@
implementation(libs.kotlinStdlibCommon)
api("androidx.compose.foundation:foundation:1.0.1")
- api("androidx.compose.runtime:runtime:1.0.1")
api("androidx.compose.material:material-ripple:1.0.0")
+ api("androidx.compose.runtime:runtime:1.0.1")
api("androidx.compose.ui:ui-graphics:1.0.1")
api("androidx.compose.ui:ui-text:1.0.1")
diff --git a/compose/material3/material3/integration-tests/material3-catalog/OWNERS b/compose/material3/material3/integration-tests/material3-catalog/OWNERS
new file mode 100644
index 0000000..5c55131
--- /dev/null
+++ b/compose/material3/material3/integration-tests/material3-catalog/OWNERS
@@ -0,0 +1 @@
+nickrout@google.com
diff --git a/compose/material3/material3/integration-tests/material3-catalog/build.gradle b/compose/material3/material3/integration-tests/material3-catalog/build.gradle
new file mode 100644
index 0000000..b2e7e22
--- /dev/null
+++ b/compose/material3/material3/integration-tests/material3-catalog/build.gradle
@@ -0,0 +1,44 @@
+/*
+ * Copyright 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT 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 androidx.build.Publish
+
+plugins {
+ id("AndroidXPlugin")
+ id("com.android.library")
+ id("AndroidXComposePlugin")
+ id("org.jetbrains.kotlin.android")
+}
+
+dependencies {
+ kotlinPlugin project(":compose:compiler:compiler")
+ implementation(libs.kotlinStdlib)
+ implementation project(":core:core")
+ implementation project(":compose:runtime:runtime")
+ implementation project(":compose:ui:ui")
+ implementation project(":compose:material:material")
+ implementation project(":compose:material3:material3")
+ implementation project(":compose:material3:material3:material3-samples")
+ implementation project(":navigation:navigation-compose")
+ implementation "com.google.accompanist:accompanist-insets:0.18.0"
+}
+
+androidx {
+ name = "Compose Material3 Catalog"
+ publish = Publish.NONE
+ inceptionYear = "2021"
+ description = "This is a project for the Compose Material You Catalog."
+}
diff --git a/compose/material3/material3/integration-tests/material3-catalog/src/main/AndroidManifest.xml b/compose/material3/material3/integration-tests/material3-catalog/src/main/AndroidManifest.xml
new file mode 100644
index 0000000..44b4ff8
--- /dev/null
+++ b/compose/material3/material3/integration-tests/material3-catalog/src/main/AndroidManifest.xml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ ~ Copyright (C) 2021 The Android Open Source Project
+ ~
+ ~ Licensed under the Apache License, Version 2.0 (the "License");
+ ~ you may not use this file except in compliance with the License.
+ ~ You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing, software
+ ~ distributed under the License is distributed on an "AS IS" BASIS,
+ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ~ See the License for the specific language governing permissions and
+ ~ limitations under the License
+ -->
+
+<manifest package="androidx.compose.material3.catalog.library" />
diff --git a/compose/material3/material3/integration-tests/material3-catalog/src/main/java/androidx/compose/material3/catalog/library/CatalogApp.kt b/compose/material3/material3/integration-tests/material3-catalog/src/main/java/androidx/compose/material3/catalog/library/CatalogApp.kt
new file mode 100644
index 0000000..3703e65
--- /dev/null
+++ b/compose/material3/material3/integration-tests/material3-catalog/src/main/java/androidx/compose/material3/catalog/library/CatalogApp.kt
@@ -0,0 +1,37 @@
+/*
+ * Copyright 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES 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.compose.material3.catalog.library
+
+import androidx.compose.material3.catalog.library.model.Theme
+import androidx.compose.material3.catalog.library.model.ThemeSaver
+import androidx.compose.material3.catalog.library.ui.theme.CatalogTheme
+import androidx.compose.runtime.Composable
+import androidx.compose.runtime.getValue
+import androidx.compose.runtime.mutableStateOf
+import androidx.compose.runtime.saveable.rememberSaveable
+import androidx.compose.runtime.setValue
+
+@Composable
+fun Material3CatalogApp() {
+ var theme by rememberSaveable(stateSaver = ThemeSaver) { mutableStateOf(Theme()) }
+ CatalogTheme(theme = theme) {
+ NavGraph(
+ theme = theme,
+ onThemeChange = { theme = it }
+ )
+ }
+}
diff --git a/compose/material/material/integration-tests/material-catalog/src/main/java/androidx/compose/material/catalog/NavGraph.kt b/compose/material3/material3/integration-tests/material3-catalog/src/main/java/androidx/compose/material3/catalog/library/NavGraph.kt
similarity index 79%
rename from compose/material/material/integration-tests/material-catalog/src/main/java/androidx/compose/material/catalog/NavGraph.kt
rename to compose/material3/material3/integration-tests/material3-catalog/src/main/java/androidx/compose/material3/catalog/library/NavGraph.kt
index 5c41cda..4ee4ac02 100644
--- a/compose/material/material/integration-tests/material-catalog/src/main/java/androidx/compose/material/catalog/NavGraph.kt
+++ b/compose/material3/material3/integration-tests/material3-catalog/src/main/java/androidx/compose/material3/catalog/library/NavGraph.kt
@@ -14,15 +14,14 @@
* limitations under the License.
*/
-package androidx.compose.material.catalog
+package androidx.compose.material3.catalog.library
-import androidx.compose.material.catalog.model.Components
-import androidx.compose.material.catalog.model.Theme
-import androidx.compose.material.catalog.ui.component.Component
-import androidx.compose.material.catalog.ui.example.Example
-import androidx.compose.material.catalog.ui.home.Home
+import androidx.compose.material3.catalog.library.model.Components
+import androidx.compose.material3.catalog.library.model.Theme
+import androidx.compose.material3.catalog.library.ui.component.Component
+import androidx.compose.material3.catalog.library.ui.example.Example
+import androidx.compose.material3.catalog.library.ui.home.Home
import androidx.compose.runtime.Composable
-import androidx.compose.runtime.rememberUpdatedState
import androidx.navigation.NavType
import androidx.navigation.compose.NavHost
import androidx.navigation.compose.composable
@@ -34,10 +33,6 @@
theme: Theme,
onThemeChange: (theme: Theme) -> Unit
) {
- // Using rememberUpdatedState as hoisted state is not correctly propagated to NavHost
- // https://issuetracker.google.com/issues/177338143
- val navTheme = rememberUpdatedState(theme)
- val navOnThemeChange = rememberUpdatedState(onThemeChange)
val navController = rememberNavController()
NavHost(
navController = navController,
@@ -46,8 +41,8 @@
composable(HomeRoute) {
Home(
components = Components,
- theme = navTheme.value,
- onThemeChange = navOnThemeChange.value,
+ theme = theme,
+ onThemeChange = onThemeChange,
onComponentClick = { component ->
val componentId = component.id
val route = "$ComponentRoute/$componentId"
@@ -67,8 +62,8 @@
val component = Components.first { component -> component.id == componentId }
Component(
component = component,
- theme = navTheme.value,
- onThemeChange = navOnThemeChange.value,
+ theme = theme,
+ onThemeChange = onThemeChange,
onExampleClick = { example ->
val exampleIndex = component.examples.indexOf(example)
val route = "$ExampleRoute/$componentId/$exampleIndex"
@@ -94,14 +89,15 @@
Example(
component = component,
example = example,
- theme = navTheme.value,
- onThemeChange = navOnThemeChange.value,
+ theme = theme,
+ onThemeChange = onThemeChange,
onBackClick = { navController.popBackStack() }
)
}
}
}
+const val Material3Route = "material3"
private const val HomeRoute = "home"
private const val ComponentRoute = "component"
private const val ExampleRoute = "example"
diff --git a/compose/material3/material3/integration-tests/material3-catalog/src/main/java/androidx/compose/material3/catalog/library/model/Components.kt b/compose/material3/material3/integration-tests/material3-catalog/src/main/java/androidx/compose/material3/catalog/library/model/Components.kt
new file mode 100644
index 0000000..f4f2a2c
--- /dev/null
+++ b/compose/material3/material3/integration-tests/material3-catalog/src/main/java/androidx/compose/material3/catalog/library/model/Components.kt
@@ -0,0 +1,50 @@
+/*
+ * Copyright 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES 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.compose.material3.catalog.library.model
+
+import androidx.annotation.DrawableRes
+import androidx.compose.material3.catalog.library.R
+import androidx.compose.material3.catalog.library.util.Material3SourceUrl
+
+data class Component(
+ val id: Int,
+ val name: String,
+ val description: String,
+ @DrawableRes
+ val icon: Int = R.drawable.ic_component,
+ val tintIcon: Boolean = false,
+ val guidelinesUrl: String,
+ val docsUrl: String,
+ val sourceUrl: String,
+ val examples: List<Example>
+)
+
+private val Color = Component(
+ id = 1,
+ name = "Color",
+ description = "Material You colors",
+ // No color icon
+ tintIcon = true,
+ guidelinesUrl = "", // No guidelines yet
+ docsUrl = "", // No docs yet
+ sourceUrl = "$Material3SourceUrl/ColorScheme.kt",
+ examples = ColorExamples
+)
+
+val Components = listOf(
+ Color
+)
diff --git a/compose/material3/material3/integration-tests/material3-catalog/src/main/java/androidx/compose/material3/catalog/library/model/Examples.kt b/compose/material3/material3/integration-tests/material3-catalog/src/main/java/androidx/compose/material3/catalog/library/model/Examples.kt
new file mode 100644
index 0000000..a8dbda4
--- /dev/null
+++ b/compose/material3/material3/integration-tests/material3-catalog/src/main/java/androidx/compose/material3/catalog/library/model/Examples.kt
@@ -0,0 +1,41 @@
+/*
+ * Copyright 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+@file:Suppress("COMPOSABLE_FUNCTION_REFERENCE")
+
+package androidx.compose.material3.catalog.library.model
+
+import androidx.compose.material3.catalog.library.util.SampleSourceUrl
+import androidx.compose.material3.samples.ColorSchemeSample
+import androidx.compose.runtime.Composable
+
+data class Example(
+ val name: String,
+ val description: String,
+ val sourceUrl: String,
+ val content: @Composable () -> Unit
+)
+
+private const val ColorExampleDescription = "Color examples"
+private const val ColorExampleSourceUrl = "$SampleSourceUrl/ColorSamples.kt"
+val ColorExamples =
+ listOf(
+ Example(
+ name = ::ColorSchemeSample.name,
+ description = ColorExampleDescription,
+ sourceUrl = ColorExampleSourceUrl,
+ ) { ColorSchemeSample() },
+ )
diff --git a/compose/material3/material3/integration-tests/material3-catalog/src/main/java/androidx/compose/material3/catalog/library/model/Themes.kt b/compose/material3/material3/integration-tests/material3-catalog/src/main/java/androidx/compose/material3/catalog/library/model/Themes.kt
new file mode 100644
index 0000000..710fb0d
--- /dev/null
+++ b/compose/material3/material3/integration-tests/material3-catalog/src/main/java/androidx/compose/material3/catalog/library/model/Themes.kt
@@ -0,0 +1,99 @@
+/*
+ * Copyright 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES 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.compose.material3.catalog.library.model
+
+import androidx.compose.runtime.saveable.Saver
+
+data class Theme(
+ val themeMode: ThemeMode = ThemeMode.System,
+ val colorMode: ColorMode = ColorMode.SampleDynamic,
+ val fontScale: Float = 1.0f,
+ val textDirection: TextDirection = TextDirection.System,
+)
+
+/**
+ * A class for defining layout directions.
+ *
+ * A layout direction can be left-to-right (LTR) or right-to-left (RTL).
+ */
+enum class TextDirection {
+ System,
+
+ /** Horizontal layout direction is from Left to Right. */
+ Ltr,
+
+ /** Horizontal layout direction is from Right to Left. */
+ Rtl,
+}
+
+/**
+ * Determines what color scheme should be used when viewing the catalog in the Google Material 3
+ * theme.
+ */
+enum class ColorMode {
+ /**
+ * The baseline light/dark colors schemes.
+ *
+ * This is the default behavior, and the fallback if dynamic colors are not available on the
+ * current device.
+ */
+ Baseline,
+ /**
+ * Build a color scheme from a pre-selected color palette that behaves the same as a dynamic color
+ * palette.
+ *
+ * Useful for testing dynamic color schemes on devices that don't support dynamic colors.
+ */
+ SampleDynamic,
+ /**
+ * Build a color scheme from the dynamic colors taken from the Android System.
+ *
+ * If the dynamic colors are not available, the baseline color scheme will be used as a fallback.
+ */
+ TrueDynamic,
+}
+
+enum class ThemeMode {
+ System,
+ Light,
+ Dark,
+}
+
+val ThemeSaver =
+ Saver<Theme, Map<String, Int>>(
+ save = { theme ->
+ mapOf(
+ ThemeModeKey to theme.themeMode.ordinal,
+ ColorModeKey to theme.colorMode.ordinal,
+ FontScaleKey to theme.fontScale.toInt(),
+ TextDirectionKey to theme.textDirection.ordinal,
+ )
+ },
+ restore = { map ->
+ Theme(
+ themeMode = ThemeMode.values()[map.getValue(ThemeModeKey)],
+ colorMode = ColorMode.values()[map.getValue(ColorModeKey)],
+ fontScale = map.getValue(FontScaleKey).toFloat(),
+ textDirection = TextDirection.values()[map.getValue(TextDirectionKey)],
+ )
+ }
+ )
+
+private const val ThemeModeKey = "themeMode"
+private const val ColorModeKey = "colorMode"
+private const val FontScaleKey = "fontScale"
+private const val TextDirectionKey = "textDirection"
diff --git a/compose/material/material/integration-tests/material-catalog/src/main/java/androidx/compose/material/catalog/ui/common/Border.kt b/compose/material3/material3/integration-tests/material3-catalog/src/main/java/androidx/compose/material3/catalog/library/ui/common/Border.kt
similarity index 97%
rename from compose/material/material/integration-tests/material-catalog/src/main/java/androidx/compose/material/catalog/ui/common/Border.kt
rename to compose/material3/material3/integration-tests/material3-catalog/src/main/java/androidx/compose/material3/catalog/library/ui/common/Border.kt
index 9d0fc08..85c458c 100644
--- a/compose/material/material/integration-tests/material-catalog/src/main/java/androidx/compose/material/catalog/ui/common/Border.kt
+++ b/compose/material3/material3/integration-tests/material3-catalog/src/main/java/androidx/compose/material3/catalog/library/ui/common/Border.kt
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package androidx.compose.material.catalog.ui.common
+package androidx.compose.material3.catalog.library.ui.common
import androidx.compose.material.LocalContentColor
import androidx.compose.material.MaterialTheme
diff --git a/compose/material/material/integration-tests/material-catalog/src/main/java/androidx/compose/material/catalog/ui/common/CatalogScaffold.kt b/compose/material3/material3/integration-tests/material3-catalog/src/main/java/androidx/compose/material3/catalog/library/ui/common/CatalogScaffold.kt
similarity index 81%
copy from compose/material/material/integration-tests/material-catalog/src/main/java/androidx/compose/material/catalog/ui/common/CatalogScaffold.kt
copy to compose/material3/material3/integration-tests/material3-catalog/src/main/java/androidx/compose/material3/catalog/library/ui/common/CatalogScaffold.kt
index 74ef95d..6fb21f85 100644
--- a/compose/material/material/integration-tests/material-catalog/src/main/java/androidx/compose/material/catalog/ui/common/CatalogScaffold.kt
+++ b/compose/material3/material3/integration-tests/material3-catalog/src/main/java/androidx/compose/material3/catalog/library/ui/common/CatalogScaffold.kt
@@ -14,30 +14,31 @@
* limitations under the License.
*/
-package androidx.compose.material.catalog.ui.common
+package androidx.compose.material3.catalog.library.ui.common
import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.material.ExperimentalMaterialApi
import androidx.compose.material.ModalBottomSheetLayout
import androidx.compose.material.ModalBottomSheetValue
import androidx.compose.material.Scaffold
-import androidx.compose.material.catalog.model.Theme
-import androidx.compose.material.catalog.ui.theme.ThemePicker
-import androidx.compose.material.catalog.util.GuidelinesUrl
-import androidx.compose.material.catalog.util.IssueUrl
-import androidx.compose.material.catalog.util.LicensesUrl
-import androidx.compose.material.catalog.util.PrivacyUrl
-import androidx.compose.material.catalog.util.ReleasesUrl
-import androidx.compose.material.catalog.util.SourceUrl
-import androidx.compose.material.catalog.util.TermsUrl
-import androidx.compose.material.catalog.util.openUrl
import androidx.compose.material.rememberModalBottomSheetState
+import androidx.compose.material3.catalog.library.model.Theme
+import androidx.compose.material3.catalog.library.ui.theme.ThemePicker
+import androidx.compose.material3.catalog.library.util.GuidelinesUrl
+import androidx.compose.material3.catalog.library.util.IssueUrl
+import androidx.compose.material3.catalog.library.util.LicensesUrl
+import androidx.compose.material3.catalog.library.util.PrivacyUrl
+import androidx.compose.material3.catalog.library.util.ReleasesUrl
+import androidx.compose.material3.catalog.library.util.SourceUrl
+import androidx.compose.material3.catalog.library.util.TermsUrl
+import androidx.compose.material3.catalog.library.util.openUrl
import androidx.compose.runtime.Composable
import androidx.compose.runtime.rememberCoroutineScope
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.platform.LocalContext
import kotlinx.coroutines.launch
+// TODO: Use components/values from Material3 when available
@OptIn(ExperimentalMaterialApi::class)
@Composable
fun CatalogScaffold(
diff --git a/compose/material/material/integration-tests/material-catalog/src/main/java/androidx/compose/material/catalog/ui/common/CatalogTopAppBar.kt b/compose/material3/material3/integration-tests/material3-catalog/src/main/java/androidx/compose/material3/catalog/library/ui/common/CatalogTopAppBar.kt
similarity index 95%
copy from compose/material/material/integration-tests/material-catalog/src/main/java/androidx/compose/material/catalog/ui/common/CatalogTopAppBar.kt
copy to compose/material3/material3/integration-tests/material3-catalog/src/main/java/androidx/compose/material3/catalog/library/ui/common/CatalogTopAppBar.kt
index 0de1657..7d8413a 100644
--- a/compose/material/material/integration-tests/material-catalog/src/main/java/androidx/compose/material/catalog/ui/common/CatalogTopAppBar.kt
+++ b/compose/material3/material3/integration-tests/material3-catalog/src/main/java/androidx/compose/material3/catalog/library/ui/common/CatalogTopAppBar.kt
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package androidx.compose.material.catalog.ui.common
+package androidx.compose.material3.catalog.library.ui.common
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Row
@@ -28,13 +28,11 @@
import androidx.compose.material.Surface
import androidx.compose.material.Text
import androidx.compose.material.TopAppBar
-import androidx.compose.material.catalog.R
-import androidx.compose.material.catalog.insets.navigationBarsPadding
-import androidx.compose.material.catalog.insets.statusBarsPadding
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.ArrowBack
import androidx.compose.material.icons.filled.MoreVert
import androidx.compose.material.primarySurface
+import androidx.compose.material3.catalog.library.R
import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
@@ -46,7 +44,10 @@
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.style.TextOverflow
import androidx.compose.ui.unit.dp
+import com.google.accompanist.insets.navigationBarsPadding
+import com.google.accompanist.insets.statusBarsPadding
+// TODO: Use components/values from Material3 when available
@Composable
fun CatalogTopAppBar(
title: String,
diff --git a/compose/material/material/integration-tests/material-catalog/src/main/java/androidx/compose/material/catalog/ui/component/Component.kt b/compose/material3/material3/integration-tests/material3-catalog/src/main/java/androidx/compose/material3/catalog/library/ui/component/Component.kt
similarity index 85%
copy from compose/material/material/integration-tests/material-catalog/src/main/java/androidx/compose/material/catalog/ui/component/Component.kt
copy to compose/material3/material3/integration-tests/material3-catalog/src/main/java/androidx/compose/material3/catalog/library/ui/component/Component.kt
index 2fa2009..f372e0e 100644
--- a/compose/material/material/integration-tests/material-catalog/src/main/java/androidx/compose/material/catalog/ui/component/Component.kt
+++ b/compose/material3/material3/integration-tests/material3-catalog/src/main/java/androidx/compose/material3/catalog/library/ui/component/Component.kt
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package androidx.compose.material.catalog.ui.component
+package androidx.compose.material3.catalog.library.ui.component
import androidx.compose.foundation.Image
import androidx.compose.foundation.layout.Box
@@ -29,14 +29,12 @@
import androidx.compose.material.LocalContentColor
import androidx.compose.material.MaterialTheme
import androidx.compose.material.Text
-import androidx.compose.material.catalog.R
-import androidx.compose.material.catalog.insets.LocalWindowInsets
-import androidx.compose.material.catalog.insets.toPaddingValues
-import androidx.compose.material.catalog.model.Component
-import androidx.compose.material.catalog.model.Example
-import androidx.compose.material.catalog.model.Theme
-import androidx.compose.material.catalog.ui.common.CatalogScaffold
-import androidx.compose.material.catalog.ui.example.ExampleItem
+import androidx.compose.material3.catalog.library.R
+import androidx.compose.material3.catalog.library.model.Component
+import androidx.compose.material3.catalog.library.model.Example
+import androidx.compose.material3.catalog.library.model.Theme
+import androidx.compose.material3.catalog.library.ui.common.CatalogScaffold
+import androidx.compose.material3.catalog.library.ui.example.ExampleItem
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
@@ -44,7 +42,10 @@
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.unit.dp
+import com.google.accompanist.insets.LocalWindowInsets
+import com.google.accompanist.insets.rememberInsetsPaddingValues
+// TODO: Use components/values from Material3 when available
@Composable
fun Component(
component: Component,
@@ -67,7 +68,9 @@
modifier = Modifier
.padding(paddingValues)
.padding(horizontal = ComponentPadding),
- contentPadding = LocalWindowInsets.current.navigationBars.toPaddingValues()
+ contentPadding = rememberInsetsPaddingValues(
+ insets = LocalWindowInsets.current.navigationBars
+ )
) {
item {
Box(
diff --git a/compose/material/material/integration-tests/material-catalog/src/main/java/androidx/compose/material/catalog/ui/component/ComponentItem.kt b/compose/material3/material3/integration-tests/material3-catalog/src/main/java/androidx/compose/material3/catalog/library/ui/component/ComponentItem.kt
similarity index 88%
copy from compose/material/material/integration-tests/material-catalog/src/main/java/androidx/compose/material/catalog/ui/component/ComponentItem.kt
copy to compose/material3/material3/integration-tests/material3-catalog/src/main/java/androidx/compose/material3/catalog/library/ui/component/ComponentItem.kt
index 2eca34c..2303f42 100644
--- a/compose/material/material/integration-tests/material-catalog/src/main/java/androidx/compose/material/catalog/ui/component/ComponentItem.kt
+++ b/compose/material3/material3/integration-tests/material3-catalog/src/main/java/androidx/compose/material3/catalog/library/ui/component/ComponentItem.kt
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package androidx.compose.material.catalog.ui.component
+package androidx.compose.material3.catalog.library.ui.component
import androidx.compose.foundation.Image
import androidx.compose.foundation.clickable
@@ -26,9 +26,9 @@
import androidx.compose.material.LocalContentColor
import androidx.compose.material.MaterialTheme
import androidx.compose.material.Text
-import androidx.compose.material.catalog.model.Component
-import androidx.compose.material.catalog.ui.common.compositeBorderColor
-import androidx.compose.material.catalog.ui.common.gridItemBorder
+import androidx.compose.material3.catalog.library.model.Component
+import androidx.compose.material3.catalog.library.ui.common.compositeBorderColor
+import androidx.compose.material3.catalog.library.ui.common.gridItemBorder
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
@@ -37,6 +37,7 @@
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.unit.dp
+// TODO: Use components/values from Material3 when available
@Composable
fun ComponentItem(
component: Component,
diff --git a/compose/material/material/integration-tests/material-catalog/src/main/java/androidx/compose/material/catalog/ui/example/Example.kt b/compose/material3/material3/integration-tests/material3-catalog/src/main/java/androidx/compose/material3/catalog/library/ui/example/Example.kt
similarity index 78%
copy from compose/material/material/integration-tests/material-catalog/src/main/java/androidx/compose/material/catalog/ui/example/Example.kt
copy to compose/material3/material3/integration-tests/material3-catalog/src/main/java/androidx/compose/material3/catalog/library/ui/example/Example.kt
index d5e1172..eebfb0f 100644
--- a/compose/material/material/integration-tests/material-catalog/src/main/java/androidx/compose/material/catalog/ui/example/Example.kt
+++ b/compose/material3/material3/integration-tests/material3-catalog/src/main/java/androidx/compose/material3/catalog/library/ui/example/Example.kt
@@ -14,20 +14,21 @@
* limitations under the License.
*/
-package androidx.compose.material.catalog.ui.example
+package androidx.compose.material3.catalog.library.ui.example
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.padding
-import androidx.compose.material.catalog.insets.navigationBarsPadding
-import androidx.compose.material.catalog.model.Component
-import androidx.compose.material.catalog.model.Example
-import androidx.compose.material.catalog.model.Theme
-import androidx.compose.material.catalog.ui.common.CatalogScaffold
+import androidx.compose.material3.catalog.library.model.Component
+import androidx.compose.material3.catalog.library.model.Example
+import androidx.compose.material3.catalog.library.model.Theme
+import androidx.compose.material3.catalog.library.ui.common.CatalogScaffold
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
+import com.google.accompanist.insets.navigationBarsPadding
+// TODO: Use components/values from Material3 when available
@Composable
fun Example(
component: Component,
diff --git a/compose/material/material/integration-tests/material-catalog/src/main/java/androidx/compose/material/catalog/ui/example/ExampleItem.kt b/compose/material3/material3/integration-tests/material3-catalog/src/main/java/androidx/compose/material3/catalog/library/ui/example/ExampleItem.kt
similarity index 89%
copy from compose/material/material/integration-tests/material-catalog/src/main/java/androidx/compose/material/catalog/ui/example/ExampleItem.kt
copy to compose/material3/material3/integration-tests/material3-catalog/src/main/java/androidx/compose/material3/catalog/library/ui/example/ExampleItem.kt
index 874afa1..05b8b19 100644
--- a/compose/material/material/integration-tests/material-catalog/src/main/java/androidx/compose/material/catalog/ui/example/ExampleItem.kt
+++ b/compose/material3/material3/integration-tests/material3-catalog/src/main/java/androidx/compose/material3/catalog/library/ui/example/ExampleItem.kt
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package androidx.compose.material.catalog.ui.example
+package androidx.compose.material3.catalog.library.ui.example
import androidx.compose.foundation.BorderStroke
import androidx.compose.foundation.clickable
@@ -31,17 +31,18 @@
import androidx.compose.material.LocalContentAlpha
import androidx.compose.material.MaterialTheme
import androidx.compose.material.Text
-import androidx.compose.material.catalog.model.Example
-import androidx.compose.material.catalog.ui.common.BorderWidth
-import androidx.compose.material.catalog.ui.common.compositeBorderColor
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.KeyboardArrowRight
+import androidx.compose.material3.catalog.library.model.Example
+import androidx.compose.material3.catalog.library.ui.common.BorderWidth
+import androidx.compose.material3.catalog.library.ui.common.compositeBorderColor
import androidx.compose.runtime.Composable
import androidx.compose.runtime.CompositionLocalProvider
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.unit.dp
+// TODO: Use components/values from Material3 when available
@Composable
fun ExampleItem(
example: Example,
diff --git a/compose/material/material/integration-tests/material-catalog/src/main/java/androidx/compose/material/catalog/ui/home/Home.kt b/compose/material3/material3/integration-tests/material3-catalog/src/main/java/androidx/compose/material3/catalog/library/ui/home/Home.kt
similarity index 76%
copy from compose/material/material/integration-tests/material-catalog/src/main/java/androidx/compose/material/catalog/ui/home/Home.kt
copy to compose/material3/material3/integration-tests/material3-catalog/src/main/java/androidx/compose/material3/catalog/library/ui/home/Home.kt
index 5671c94..080d976 100644
--- a/compose/material/material/integration-tests/material-catalog/src/main/java/androidx/compose/material/catalog/ui/home/Home.kt
+++ b/compose/material3/material3/integration-tests/material3-catalog/src/main/java/androidx/compose/material3/catalog/library/ui/home/Home.kt
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package androidx.compose.material.catalog.ui.home
+package androidx.compose.material3.catalog.library.ui.home
import androidx.compose.foundation.ExperimentalFoundationApi
import androidx.compose.foundation.layout.BoxWithConstraints
@@ -22,18 +22,19 @@
import androidx.compose.foundation.lazy.GridCells
import androidx.compose.foundation.lazy.LazyVerticalGrid
import androidx.compose.foundation.lazy.itemsIndexed
-import androidx.compose.material.catalog.R
-import androidx.compose.material.catalog.insets.LocalWindowInsets
-import androidx.compose.material.catalog.insets.toPaddingValues
-import androidx.compose.material.catalog.model.Component
-import androidx.compose.material.catalog.model.Theme
-import androidx.compose.material.catalog.ui.common.CatalogScaffold
-import androidx.compose.material.catalog.ui.component.ComponentItem
+import androidx.compose.material3.catalog.library.R
+import androidx.compose.material3.catalog.library.model.Component
+import androidx.compose.material3.catalog.library.model.Theme
+import androidx.compose.material3.catalog.library.ui.common.CatalogScaffold
+import androidx.compose.material3.catalog.library.ui.component.ComponentItem
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.unit.dp
+import com.google.accompanist.insets.LocalWindowInsets
+import com.google.accompanist.insets.rememberInsetsPaddingValues
+// TODO: Use components/values from Material3 when available
@Composable
@OptIn(ExperimentalFoundationApi::class)
fun Home(
@@ -43,7 +44,7 @@
onComponentClick: (component: Component) -> Unit
) {
CatalogScaffold(
- topBarTitle = stringResource(id = R.string.compose_material),
+ topBarTitle = stringResource(id = R.string.compose_material_you),
theme = theme,
onThemeChange = onThemeChange
) { paddingValues ->
@@ -63,7 +64,9 @@
)
}
},
- contentPadding = LocalWindowInsets.current.navigationBars.toPaddingValues()
+ contentPadding = rememberInsetsPaddingValues(
+ insets = LocalWindowInsets.current.navigationBars
+ )
)
}
}
diff --git a/wear/compose/compose-material/src/desktopMain/kotlin/androidx/wear/compose/material/TimeUpdateController.kt b/compose/material3/material3/integration-tests/material3-catalog/src/main/java/androidx/compose/material3/catalog/library/ui/theme/Theme.kt
similarity index 63%
copy from wear/compose/compose-material/src/desktopMain/kotlin/androidx/wear/compose/material/TimeUpdateController.kt
copy to compose/material3/material3/integration-tests/material3-catalog/src/main/java/androidx/compose/material3/catalog/library/ui/theme/Theme.kt
index d85e429..b10b1e1 100644
--- a/wear/compose/compose-material/src/desktopMain/kotlin/androidx/wear/compose/material/TimeUpdateController.kt
+++ b/compose/material3/material3/integration-tests/material3-catalog/src/main/java/androidx/compose/material3/catalog/library/ui/theme/Theme.kt
@@ -14,21 +14,18 @@
* limitations under the License.
*/
-package androidx.wear.compose.material
+package androidx.compose.material3.catalog.library.ui.theme
+import androidx.compose.material3.MaterialTheme
+import androidx.compose.material3.catalog.library.model.Theme
import androidx.compose.runtime.Composable
-import androidx.compose.runtime.State
-import androidx.compose.runtime.derivedStateOf
-import androidx.compose.runtime.remember
+// TODO: Use components/values from Material3 when available
@Composable
-internal actual fun currentTime(
- time: () -> Long,
- timeFormat: String
-): State<String> {
-
- val timeText = remember {
- derivedStateOf { "Test time" }
- }
- return timeText
+@Suppress("UNUSED_PARAMETER")
+fun CatalogTheme(
+ theme: Theme,
+ content: @Composable () -> Unit
+) {
+ MaterialTheme(content = content)
}
diff --git a/compose/material3/material3/integration-tests/material3-catalog/src/main/java/androidx/compose/material3/catalog/library/ui/theme/ThemePicker.kt b/compose/material3/material3/integration-tests/material3-catalog/src/main/java/androidx/compose/material3/catalog/library/ui/theme/ThemePicker.kt
new file mode 100644
index 0000000..f0fd19c
--- /dev/null
+++ b/compose/material3/material3/integration-tests/material3-catalog/src/main/java/androidx/compose/material3/catalog/library/ui/theme/ThemePicker.kt
@@ -0,0 +1,68 @@
+/*
+ * Copyright 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES 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.compose.material3.catalog.library.ui.theme
+
+import androidx.compose.foundation.layout.Spacer
+import androidx.compose.foundation.layout.height
+import androidx.compose.foundation.layout.padding
+import androidx.compose.foundation.lazy.LazyColumn
+import androidx.compose.material.Text
+import androidx.compose.material3.MaterialTheme
+import androidx.compose.material3.catalog.library.R
+import androidx.compose.material3.catalog.library.model.Theme
+import androidx.compose.runtime.Composable
+import androidx.compose.ui.Modifier
+import androidx.compose.ui.res.stringResource
+import androidx.compose.ui.unit.dp
+import com.google.accompanist.insets.LocalWindowInsets
+import com.google.accompanist.insets.rememberInsetsPaddingValues
+
+// TODO: Use components/values from Material3 when available
+@Composable
+@Suppress("UNUSED_PARAMETER")
+fun ThemePicker(
+ theme: Theme,
+ onThemeChange: (theme: Theme) -> Unit
+) {
+ LazyColumn(
+ contentPadding = rememberInsetsPaddingValues(
+ insets = LocalWindowInsets.current.navigationBars,
+ additionalTop = ThemePickerPadding,
+ additionalBottom = ThemePickerPadding
+ )
+ ) {
+ item {
+ Text(
+ text = stringResource(id = R.string.theming_options),
+ style = MaterialTheme.typography.bodyLarge,
+ modifier = Modifier.padding(horizontal = ThemePickerPadding)
+ )
+ Spacer(modifier = Modifier.height(ThemePickerPadding))
+ }
+ // TODO: Use values from Material3 theme model when available
+ item {
+ Text(
+ text = "Work in progress",
+ style = MaterialTheme.typography.bodyMedium,
+ modifier = Modifier.padding(horizontal = ThemePickerPadding)
+ )
+ Spacer(modifier = Modifier.height(ThemePickerPadding))
+ }
+ }
+}
+
+private val ThemePickerPadding = 16.dp
diff --git a/compose/material/material/integration-tests/material-catalog/src/main/java/androidx/compose/material/catalog/util/Url.kt b/compose/material3/material3/integration-tests/material3-catalog/src/main/java/androidx/compose/material3/catalog/library/util/Url.kt
similarity index 71%
copy from compose/material/material/integration-tests/material-catalog/src/main/java/androidx/compose/material/catalog/util/Url.kt
copy to compose/material3/material3/integration-tests/material3-catalog/src/main/java/androidx/compose/material3/catalog/library/util/Url.kt
index e4dcb9f..e5f729e 100644
--- a/compose/material/material/integration-tests/material-catalog/src/main/java/androidx/compose/material/catalog/util/Url.kt
+++ b/compose/material3/material3/integration-tests/material3-catalog/src/main/java/androidx/compose/material3/catalog/library/util/Url.kt
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package androidx.compose.material.catalog.util
+package androidx.compose.material3.catalog.library.util
import android.content.Context
import android.content.Intent
@@ -26,18 +26,16 @@
}
const val GuidelinesUrl = "https://material.io"
-const val ComponentGuidelinesUrl = "https://material.io/components"
const val ReleasesUrl = "https://developer.android.com/jetpack/androidx/releases/compose-material"
-const val DocsUrl = "https://developer.android.com/reference/kotlin/androidx/compose/" +
- "material/package-summary"
const val SourceUrl = "https://cs.android.com/androidx/platform/frameworks/support/+/" +
- "androidx-main:compose/material"
-const val MaterialSourceUrl = "https://cs.android.com/androidx/platform/frameworks/support/+/" +
- "androidx-main:compose/material/" +
- "material/src/commonMain/kotlin/androidx/compose/material"
+ "androidx-main:compose/material3"
+const val Material3SourceUrl = "https://cs.android.com/androidx/platform/frameworks/support/+/" +
+ "androidx-main:compose/material3/" +
+ "material3/src/commonMain/kotlin/androidx/compose/material3"
const val SampleSourceUrl = "https://cs.android.com/androidx/platform/frameworks/support/+/" +
- "androidx-main:compose/material/" +
- "material/samples/src/main/java/androidx/compose/material/samples"
+ "androidx-main:compose/material3/" +
+ "material3/samples/src/main/java/androidx/compose/material3/samples"
+// TODO: Update issue URL for Material3 component when available
const val IssueUrl = "https://issuetracker.google.com/issues/new?component=742043"
const val TermsUrl = "https://policies.google.com/terms"
const val PrivacyUrl = "https://policies.google.com/privacy"
diff --git a/compose/material3/material3/integration-tests/material3-catalog/src/main/res/drawable/ic_component.xml b/compose/material3/material3/integration-tests/material3-catalog/src/main/res/drawable/ic_component.xml
new file mode 100644
index 0000000..84894df
--- /dev/null
+++ b/compose/material3/material3/integration-tests/material3-catalog/src/main/res/drawable/ic_component.xml
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Copyright 2021 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+ -->
+
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+ android:width="52dp"
+ android:height="53dp"
+ android:viewportWidth="52"
+ android:viewportHeight="53">
+ <!-- Long path to avoid Icon stroke line join bevel bug -->
+ <!-- https://issuetracker.google.com/issues/182794035 -->
+ <path
+ android:fillColor="#FF000000"
+ android:pathData="M32,0L32.0002,16.0599C32.4949,16.0202 32.9951,16 33.5,16C43.7173,16
+ 52,24.2827 52,34.5C52,44.7173 43.7173,53 33.5,53C23.2827,53 15,44.7173 15,34.5C15,33.6522
+ 15.057,32.8178 15.1675,32.0002L0,32L0,0L32,0ZM33.5,18.5C32.9944,18.5 32.4944,18.5234
+ 32.0008,18.5693L32,32L17.6941,32.0004C17.5663,32.8149 17.5,33.6497 17.5,34.5C17.5,43.3366
+ 24.6634,50.5 33.5,50.5C42.3366,50.5 49.5,43.3366 49.5,34.5C49.5,25.6634 42.3366,18.5
+ 33.5,18.5ZM29.5002,2.5L2.5,2.5L2.5,29.5L15.6835,29.5003C17.5115,22.9726 22.8306,17.9035
+ 29.5002,16.4335L29.5002,2.5ZM18.2968,29.5L29.5,29.5L29.5007,19.0039C24.2157,20.3639
+ 19.9874,24.3562 18.2968,29.5Z" />
+</vector>
diff --git a/compose/material3/material3/integration-tests/material3-catalog/src/main/res/drawable/ic_palette_24dp.xml b/compose/material3/material3/integration-tests/material3-catalog/src/main/res/drawable/ic_palette_24dp.xml
new file mode 100644
index 0000000..b9e640b
--- /dev/null
+++ b/compose/material3/material3/integration-tests/material3-catalog/src/main/res/drawable/ic_palette_24dp.xml
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Copyright 2021 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+ -->
+
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+ android:width="24dp"
+ android:height="24dp"
+ android:viewportWidth="24"
+ android:viewportHeight="24">
+ <path
+ android:fillColor="#FF000000"
+ android:pathData="M12,22C6.49,22 2,17.51 2,12S6.49,2 12,2s10,4.04 10,9c0,3.31 -2.69,6
+ -6,6h-1.77c-0.28,0 -0.5,0.22 -0.5,0.5 0,0.12 0.05,0.23 0.13,0.33 0.41,0.47 0.64,1.06
+ 0.64,1.67 0,1.38 -1.12,2.5 -2.5,2.5zM12,4c-4.41,0 -8,3.59 -8,8s3.59,8 8,8c0.28,0 0.5,-0.22
+ 0.5,-0.5 0,-0.16 -0.08,-0.28 -0.14,-0.35 -0.41,-0.46 -0.63,-1.05 -0.63,-1.65 0,-1.38
+ 1.12,-2.5 2.5,-2.5L16,15c2.21,0 4,-1.79 4,-4 0,-3.86 -3.59,-7 -8,-7z" />
+ <path
+ android:fillColor="#FF000000"
+ android:pathData="M6.5,11.5m-1.5,0a1.5,1.5 0,1 1,3 0a1.5,1.5 0,1 1,-3 0" />
+ <path
+ android:fillColor="#FF000000"
+ android:pathData="M9.5,7.5m-1.5,0a1.5,1.5 0,1 1,3 0a1.5,1.5 0,1 1,-3 0" />
+ <path
+ android:fillColor="#FF000000"
+ android:pathData="M14.5,7.5m-1.5,0a1.5,1.5 0,1 1,3 0a1.5,1.5 0,1 1,-3 0" />
+ <path
+ android:fillColor="#FF000000"
+ android:pathData="M17.5,11.5m-1.5,0a1.5,1.5 0,1 1,3 0a1.5,1.5 0,1 1,-3 0" />
+</vector>
diff --git a/compose/material3/material3/integration-tests/material3-catalog/src/main/res/values/donottranslate-strings.xml b/compose/material3/material3/integration-tests/material3-catalog/src/main/res/values/donottranslate-strings.xml
new file mode 100644
index 0000000..8a20a1b
--- /dev/null
+++ b/compose/material3/material3/integration-tests/material3-catalog/src/main/res/values/donottranslate-strings.xml
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Copyright 2021 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+ -->
+
+<resources>
+
+ <string name="compose_material_you">Compose Material You</string>
+
+ <string name="description">Description</string>
+ <string name="examples">Examples</string>
+ <string name="no_examples">No examples</string>
+
+ <string name="theming_options">Theming options</string>
+
+ <string name="view_design_guidelines">View design guidelines</string>
+ <string name="view_developer_docs">View developer docs</string>
+ <string name="view_source_code">View source code</string>
+ <string name="report_an_issue">Report an issue</string>
+ <string name="terms_of_service">Terms of service</string>
+ <string name="privacy_policy">Privacy policy</string>
+ <string name="open_source_licenses">Open source licenses</string>
+
+</resources>
diff --git a/compose/material3/material3/samples/build.gradle b/compose/material3/material3/samples/build.gradle
new file mode 100644
index 0000000..58db433
--- /dev/null
+++ b/compose/material3/material3/samples/build.gradle
@@ -0,0 +1,51 @@
+/*
+ * Copyright 2019 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+import androidx.build.LibraryGroups
+import androidx.build.LibraryType
+
+plugins {
+ id("AndroidXPlugin")
+ id("com.android.library")
+ id("AndroidXComposePlugin")
+ id("org.jetbrains.kotlin.android")
+}
+
+dependencies {
+ kotlinPlugin(project(":compose:compiler:compiler"))
+
+ implementation(libs.kotlinStdlib)
+
+ compileOnly(project(":annotation:annotation-sampled"))
+
+ implementation("androidx.compose.animation:animation:1.0.0")
+ implementation("androidx.compose.foundation:foundation:1.0.0")
+ implementation("androidx.compose.foundation:foundation-layout:1.0.0")
+ implementation(project(":compose:material:material"))
+ implementation(project(":compose:material3:material3"))
+ implementation(project(":compose:runtime:runtime"))
+ implementation("androidx.compose.ui:ui:1.0.0")
+ implementation("androidx.compose.ui:ui-text:1.0.0")
+}
+
+androidx {
+ name = "AndroidX Compose Material3 Components Samples"
+ type = LibraryType.SAMPLES
+ mavenGroup = LibraryGroups.Compose.MATERIAL3
+ inceptionYear = "2021"
+ description = "Contains the sample code for the AndroidX Compose Material You components."
+}
diff --git a/compose/material3/material3/samples/src/main/AndroidManifest.xml b/compose/material3/material3/samples/src/main/AndroidManifest.xml
new file mode 100644
index 0000000..ed44259
--- /dev/null
+++ b/compose/material3/material3/samples/src/main/AndroidManifest.xml
@@ -0,0 +1,17 @@
+<!--
+ ~ Copyright (C) 2019 The Android Open Source Project
+ ~
+ ~ Licensed under the Apache License, Version 2.0 (the "License");
+ ~ you may not use this file except in compliance with the License.
+ ~ You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing, software
+ ~ distributed under the License is distributed on an "AS IS" BASIS,
+ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ~ See the License for the specific language governing permissions and
+ ~ limitations under the License
+ -->
+
+<manifest package="androidx.compose.material3.samples" />
diff --git a/compose/material3/material3/samples/src/main/java/androidx/compose/material3/samples/ColorSamples.kt b/compose/material3/material3/samples/src/main/java/androidx/compose/material3/samples/ColorSamples.kt
new file mode 100644
index 0000000..7c69291
--- /dev/null
+++ b/compose/material3/material3/samples/src/main/java/androidx/compose/material3/samples/ColorSamples.kt
@@ -0,0 +1,243 @@
+/*
+ * Copyright 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES 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.compose.material3.samples
+
+import androidx.compose.foundation.BorderStroke
+import androidx.compose.foundation.layout.Box
+import androidx.compose.foundation.layout.Column
+import androidx.compose.foundation.layout.Row
+import androidx.compose.foundation.layout.Spacer
+import androidx.compose.foundation.layout.fillMaxWidth
+import androidx.compose.foundation.layout.height
+import androidx.compose.foundation.layout.padding
+import androidx.compose.foundation.layout.width
+import androidx.compose.foundation.rememberScrollState
+import androidx.compose.foundation.verticalScroll
+import androidx.compose.material.Surface
+import androidx.compose.material.Text
+import androidx.compose.material3.MaterialTheme
+import androidx.compose.runtime.Composable
+import androidx.compose.ui.Modifier
+import androidx.compose.ui.graphics.Color
+import androidx.compose.ui.graphics.luminance
+import androidx.compose.ui.unit.dp
+
+@Composable
+fun ColorSchemeSample() {
+ val colorScheme = MaterialTheme.colorScheme
+ Row(
+ modifier = Modifier.padding(8.dp),
+ ) {
+ Column(Modifier.weight(1f).verticalScroll(rememberScrollState())) {
+ Text("Surfaces", style = MaterialTheme.typography.bodyLarge)
+ ColorTile(
+ text = "On Background",
+ color = colorScheme.onBackground,
+ )
+ ColorTile(
+ text = "Background",
+ color = colorScheme.background,
+ )
+ Spacer(modifier = Modifier.height(16.dp))
+ DoubleTile(
+ leftTile = {
+ ColorTile(
+ text = "On Surface",
+ color = colorScheme.onSurface,
+ )
+ },
+ rightTile = {
+ ColorTile(
+ text = "On Surface Variant",
+ color = colorScheme.onSurfaceVariant,
+ )
+ },
+ )
+ ColorTile(text = "Surface 0", color = colorScheme.surface)
+ ColorTile(text = "Surface 1", color = colorScheme.surface1)
+ ColorTile(text = "Surface 2", color = colorScheme.surface2)
+ ColorTile(text = "Surface 3", color = colorScheme.surface3)
+ ColorTile(text = "Surface 4", color = colorScheme.surface4)
+ ColorTile(text = "Surface 5", color = colorScheme.surface5)
+ Spacer(modifier = Modifier.height(16.dp))
+ DoubleTile(
+ leftTile = {
+ ColorTile(
+ text = "Inverse Primary",
+ color = colorScheme.inversePrimary,
+ )
+ },
+ rightTile = {
+ ColorTile(
+ text = "Inverse On Surface",
+ color = colorScheme.inverseOnSurface,
+ )
+ },
+ )
+ DoubleTile(
+ leftTile = {
+ ColorTile(
+ text = "Surface Variant",
+ color = colorScheme.surfaceVariant,
+ )
+ },
+ rightTile = {
+ ColorTile(
+ text = "Inverse Surface",
+ color = colorScheme.inverseSurface,
+ )
+ },
+ )
+ }
+ Spacer(modifier = Modifier.width(24.dp))
+ Column(Modifier.weight(1f).verticalScroll(rememberScrollState())) {
+ Text("Content", style = MaterialTheme.typography.bodyLarge)
+ DoubleTile(
+ leftTile = {
+ ColorTile(
+ text = "On Primary Container",
+ color = colorScheme.onPrimaryContainer,
+ )
+ },
+ rightTile = {
+ ColorTile(
+ text = "On Primary",
+ color = colorScheme.onPrimary,
+ )
+ },
+ )
+ DoubleTile(
+ leftTile = {
+ ColorTile(
+ text = "Primary Container",
+ color = colorScheme.primaryContainer,
+ )
+ },
+ rightTile = {
+ ColorTile(
+ text = "Primary",
+ color = colorScheme.primary,
+ )
+ },
+ )
+ Spacer(modifier = Modifier.height(16.dp))
+ DoubleTile(
+ leftTile = {
+ ColorTile(
+ text = "On Secondary Container",
+ color = colorScheme.onSecondaryContainer,
+ )
+ },
+ rightTile = {
+ ColorTile(
+ text = "On Secondary",
+ color = colorScheme.onSecondary,
+ )
+ },
+ )
+ DoubleTile(
+ leftTile = {
+ ColorTile(
+ text = "Secondary Container",
+ color = colorScheme.secondaryContainer,
+ )
+ },
+ rightTile = {
+ ColorTile(
+ text = "Secondary",
+ color = colorScheme.secondary,
+ )
+ },
+ )
+ Spacer(modifier = Modifier.height(16.dp))
+ DoubleTile(
+ leftTile = {
+ ColorTile(
+ text = "On Tertiary Container",
+ color = colorScheme.onTertiaryContainer,
+ )
+ },
+ rightTile = { Box(Modifier.fillMaxWidth()) },
+ )
+ DoubleTile(
+ leftTile = {
+ ColorTile(
+ text = "Tertiary Container",
+ color = colorScheme.tertiaryContainer,
+ )
+ },
+ rightTile = { Box(Modifier.fillMaxWidth()) },
+ )
+ Spacer(modifier = Modifier.height(16.dp))
+ Text("Utility", style = MaterialTheme.typography.bodyLarge)
+ DoubleTile(
+ leftTile = {
+ ColorTile(
+ text = "On Error",
+ color = colorScheme.onError,
+ )
+ },
+ rightTile = {
+ ColorTile(
+ text = "Outline",
+ color = colorScheme.outline,
+ )
+ }
+ )
+ DoubleTile(
+ leftTile = {
+ ColorTile(
+ text = "Error",
+ color = colorScheme.error,
+ )
+ },
+ rightTile = { Box(Modifier.fillMaxWidth()) },
+ )
+ }
+ }
+}
+
+@Composable
+private fun DoubleTile(leftTile: @Composable () -> Unit, rightTile: @Composable () -> Unit) {
+ Row(modifier = Modifier.fillMaxWidth()) {
+ Box(modifier = Modifier.weight(1f)) { leftTile() }
+ Box(modifier = Modifier.weight(1f)) { rightTile() }
+ }
+}
+
+@Composable
+private fun ColorTile(text: String, color: Color) {
+ var borderColor = Color.Transparent
+ if (color == Color.Black) {
+ borderColor = Color.White
+ } else if (color == Color.White) borderColor = Color.Black
+
+ Surface(
+ modifier = Modifier.height(48.dp).fillMaxWidth(),
+ color = color,
+ border = BorderStroke(1.dp, borderColor),
+ ) {
+ Text(
+ text,
+ Modifier.padding(4.dp),
+ style =
+ MaterialTheme.typography.bodyMedium.copy(
+ if (color.luminance() < .25) Color.White else Color.Black
+ )
+ )
+ }
+}
diff --git a/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/Icon.kt b/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/Icon.kt
new file mode 100644
index 0000000..efe155e
--- /dev/null
+++ b/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/Icon.kt
@@ -0,0 +1,148 @@
+/*
+ * Copyright 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES 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.compose.material3
+
+import androidx.compose.foundation.layout.Box
+import androidx.compose.foundation.layout.size
+import androidx.compose.material3.tokens.IconButton
+import androidx.compose.runtime.Composable
+import androidx.compose.runtime.remember
+import androidx.compose.ui.Modifier
+import androidx.compose.ui.draw.paint
+import androidx.compose.ui.geometry.Size
+import androidx.compose.ui.graphics.Color
+import androidx.compose.ui.graphics.ColorFilter
+import androidx.compose.ui.graphics.ImageBitmap
+import androidx.compose.ui.graphics.painter.BitmapPainter
+import androidx.compose.ui.graphics.painter.Painter
+import androidx.compose.ui.graphics.toolingGraphicsLayer
+import androidx.compose.ui.graphics.vector.ImageVector
+import androidx.compose.ui.graphics.vector.rememberVectorPainter
+import androidx.compose.ui.layout.ContentScale
+import androidx.compose.ui.semantics.Role
+import androidx.compose.ui.semantics.contentDescription
+import androidx.compose.ui.semantics.role
+import androidx.compose.ui.semantics.semantics
+
+/**
+ * Icon component that draws [imageVector] using [tint], defaulting to [LocalContentColor]. For a
+ * clickable icon, see [IconButton].
+ *
+ * @param imageVector [ImageVector] to draw inside this Icon
+ * @param contentDescription text used by accessibility services to describe what this icon
+ * represents. This should always be provided unless this icon is used for decorative purposes, and
+ * does not represent a meaningful action that a user can take. This text should be localized, such
+ * as by using [androidx.compose.ui.res.stringResource] or similar
+ * @param modifier optional [Modifier] for this Icon
+ * @param tint tint to be applied to [imageVector]. If [Color.Unspecified] is provided, then no tint
+ * is applied
+ */
+@Composable
+fun Icon(
+ imageVector: ImageVector,
+ contentDescription: String?,
+ modifier: Modifier = Modifier,
+ tint: Color = LocalContentColor.current
+) {
+ Icon(
+ painter = rememberVectorPainter(imageVector),
+ contentDescription = contentDescription,
+ modifier = modifier,
+ tint = tint
+ )
+}
+
+/**
+ * Icon component that draws [bitmap] using [tint], defaulting to [LocalContentColor]. For a
+ * clickable icon, see [IconButton].
+ *
+ * @param bitmap [ImageBitmap] to draw inside this Icon
+ * @param contentDescription text used by accessibility services to describe what this icon
+ * represents. This should always be provided unless this icon is used for decorative purposes, and
+ * does not represent a meaningful action that a user can take. This text should be localized, such
+ * as by using [androidx.compose.ui.res.stringResource] or similar
+ * @param modifier optional [Modifier] for this Icon
+ * @param tint tint to be applied to [bitmap]. If [Color.Unspecified] is provided, then no tint is
+ * applied
+ */
+@Composable
+fun Icon(
+ bitmap: ImageBitmap,
+ contentDescription: String?,
+ modifier: Modifier = Modifier,
+ tint: Color = LocalContentColor.current
+) {
+ val painter = remember(bitmap) { BitmapPainter(bitmap) }
+ Icon(
+ painter = painter,
+ contentDescription = contentDescription,
+ modifier = modifier,
+ tint = tint
+ )
+}
+
+/**
+ * Icon component that draws a [painter] using [tint], defaulting to [LocalContentColor]. For a
+ * clickable icon, see [IconButton].
+ *
+ * @param painter [Painter] to draw inside this Icon
+ * @param contentDescription text used by accessibility services to describe what this icon
+ * represents. This should always be provided unless this icon is used for decorative purposes, and
+ * does not represent a meaningful action that a user can take. This text should be localized, such
+ * as by using [androidx.compose.ui.res.stringResource] or similar
+ * @param modifier optional [Modifier] for this Icon
+ * @param tint tint to be applied to [painter]. If [Color.Unspecified] is provided, then no tint is
+ * applied
+ */
+@Composable
+fun Icon(
+ painter: Painter,
+ contentDescription: String?,
+ modifier: Modifier = Modifier,
+ tint: Color = LocalContentColor.current
+) {
+ val colorFilter = if (tint == Color.Unspecified) null else ColorFilter.tint(tint)
+ val semantics =
+ if (contentDescription != null) {
+ Modifier.semantics {
+ this.contentDescription = contentDescription
+ this.role = Role.Image
+ }
+ } else {
+ Modifier
+ }
+ Box(
+ modifier
+ .toolingGraphicsLayer()
+ .defaultSizeFor(painter)
+ .paint(painter, colorFilter = colorFilter, contentScale = ContentScale.Fit)
+ .then(semantics)
+ )
+}
+
+private fun Modifier.defaultSizeFor(painter: Painter) =
+ this.then(
+ if (painter.intrinsicSize == Size.Unspecified || painter.intrinsicSize.isInfinite()) {
+ DefaultIconSizeModifier
+ } else {
+ Modifier
+ }
+ )
+
+private fun Size.isInfinite() = width.isInfinite() && height.isInfinite()
+
+// Default icon size, for icons with no intrinsic size information
+private val DefaultIconSizeModifier = Modifier.size(IconButton.IconSize)
\ No newline at end of file
diff --git a/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/IconButton.kt b/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/IconButton.kt
new file mode 100644
index 0000000..00fd482
--- /dev/null
+++ b/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/IconButton.kt
@@ -0,0 +1,142 @@
+/*
+ * Copyright 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES 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.compose.material3
+
+import androidx.compose.foundation.clickable
+import androidx.compose.foundation.interaction.Interaction
+import androidx.compose.foundation.interaction.MutableInteractionSource
+import androidx.compose.foundation.layout.Box
+import androidx.compose.foundation.layout.size
+import androidx.compose.foundation.selection.toggleable
+import androidx.compose.material.ripple.rememberRipple
+import androidx.compose.material3.tokens.IconButton
+import androidx.compose.runtime.Composable
+import androidx.compose.runtime.CompositionLocalProvider
+import androidx.compose.runtime.remember
+import androidx.compose.ui.Alignment
+import androidx.compose.ui.Modifier
+import androidx.compose.ui.semantics.Role
+import androidx.compose.ui.unit.dp
+
+/**
+ * IconButton is a clickable icon, used to represent actions. An IconButton has an overall minimum
+ * touch target size of 48 x 48dp, to meet accessibility guidelines. [content] is centered inside
+ * the IconButton.
+ *
+ * This component is typically used inside an App Bar for the navigation icon / actions. See App Bar
+ * documentation for samples of this.
+ *
+ * [content] should typically be an [Icon], using an icon from
+ * [androidx.compose.material.icons.Icons]. If using a custom icon, note that the typical size for
+ * the internal icon is 24 x 24 dp.
+ *
+ * @param onClick the lambda to be invoked when this icon is pressed
+ * @param modifier optional [Modifier] for this IconButton
+ * @param enabled whether or not this IconButton will handle input events and appear enabled for
+ * semantics purposes
+ * @param interactionSource the [MutableInteractionSource] representing the stream of [Interaction]s
+ * for this IconButton. You can create and pass in your own remembered [MutableInteractionSource] if
+ * you want to observe [Interaction]s and customize the appearance / behavior of this IconButton in
+ * different [Interaction]s.
+ * @param content the content (icon) to be drawn inside the IconButton. This is typically an [Icon].
+ */
+@Composable
+fun IconButton(
+ onClick: () -> Unit,
+ modifier: Modifier = Modifier,
+ enabled: Boolean = true,
+ interactionSource: MutableInteractionSource = remember { MutableInteractionSource() },
+ content: @Composable () -> Unit
+) {
+ Box(
+ modifier =
+ modifier
+ .clickable(
+ onClick = onClick,
+ enabled = enabled,
+ role = Role.Button,
+ interactionSource = interactionSource,
+ indication = rememberRipple(bounded = false, radius = RippleRadius)
+ )
+ .then(IconButtonSizeModifier),
+ contentAlignment = Alignment.Center
+ ) {
+ val contentColor =
+ if (enabled) LocalContentColor.current
+ else
+ MaterialTheme.colorScheme
+ .fromToken(IconButton.DisabledIconColor)
+ .copy(alpha = IconButton.DisabledIconOpacity)
+ CompositionLocalProvider(LocalContentColor provides contentColor, content = content)
+ }
+}
+
+/**
+ * An [IconButton] with two states, for icons that can be toggled 'on' and 'off', such as a bookmark
+ * icon, or a navigation icon that opens a drawer.
+ *
+ * @param checked whether this IconToggleButton is currently checked
+ * @param onCheckedChange callback to be invoked when this icon is selected
+ * @param modifier optional [Modifier] for this IconToggleButton
+ * @param enabled enabled whether or not this [IconToggleButton] will handle input events and appear
+ * enabled for semantics purposes
+ * @param interactionSource the [MutableInteractionSource] representing the stream of [Interaction]s
+ * for this IconToggleButton. You can create and pass in your own remembered
+ * [MutableInteractionSource] if you want to observe [Interaction]s and customize the appearance /
+ * behavior of this IconToggleButton in different [Interaction]s.
+ * @param content the content (icon) to be drawn inside the IconToggleButton. This is typically an
+ * [Icon].
+ */
+@Composable
+fun IconToggleButton(
+ checked: Boolean,
+ onCheckedChange: (Boolean) -> Unit,
+ modifier: Modifier = Modifier,
+ enabled: Boolean = true,
+ interactionSource: MutableInteractionSource = remember { MutableInteractionSource() },
+ content: @Composable () -> Unit
+) {
+ Box(
+ modifier =
+ modifier
+ .toggleable(
+ value = checked,
+ onValueChange = onCheckedChange,
+ enabled = enabled,
+ role = Role.Checkbox,
+ interactionSource = interactionSource,
+ indication = rememberRipple(bounded = false, radius = RippleRadius)
+ )
+ .then(IconButtonSizeModifier),
+ contentAlignment = Alignment.Center
+ ) {
+ val contentColor =
+ if (enabled) LocalContentColor.current
+ else
+ MaterialTheme.colorScheme
+ .fromToken(IconButton.DisabledIconColor)
+ .copy(alpha = IconButton.DisabledIconOpacity)
+ CompositionLocalProvider(LocalContentColor provides contentColor, content = content)
+ }
+}
+
+// Default radius of an unbounded ripple in an IconButton
+private val RippleRadius = IconButton.StateLayerSize
+
+// TODO: b/149691127 investigate our strategy around accessibility touch targets, and remove
+// per-component definitions of this size.
+// Diameter of the IconButton, to allow for correct minimum touch target size for accessibility
+private val IconButtonSizeModifier = Modifier.size(48.dp)
\ No newline at end of file
diff --git a/wear/wear-complications-data-source-samples/src/main/java/androidx/wear/complications/datasource/samples/PlainComplicationText.kt b/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/tokens/IconButton.kt
similarity index 66%
copy from wear/wear-complications-data-source-samples/src/main/java/androidx/wear/complications/datasource/samples/PlainComplicationText.kt
copy to compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/tokens/IconButton.kt
index cb807c3..520f116 100644
--- a/wear/wear-complications-data-source-samples/src/main/java/androidx/wear/complications/datasource/samples/PlainComplicationText.kt
+++ b/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/tokens/IconButton.kt
@@ -13,10 +13,15 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
+// GENERATED CODE - DO NOT MODIFY BY HAND
-package androidx.wear.complications.datasource.samples
+package androidx.compose.material3.tokens
-import androidx.wear.complications.data.PlainComplicationText
+import androidx.compose.ui.unit.dp
-internal fun plainText(text: CharSequence) =
- PlainComplicationText.Builder(text).build()
\ No newline at end of file
+internal object IconButton {
+ val DisabledIconColor = ColorSchemeKey.OnSurface
+ const val DisabledIconOpacity = 0.38f
+ val IconSize = 24.0.dp
+ val StateLayerSize = 40.0.dp
+}
diff --git a/compose/runtime/runtime/api/api_lint.ignore b/compose/runtime/runtime/api/api_lint.ignore
index 7e1ec61..edb0d98 100644
--- a/compose/runtime/runtime/api/api_lint.ignore
+++ b/compose/runtime/runtime/api/api_lint.ignore
@@ -31,7 +31,3 @@
Should avoid odd sized primitives; use `int` instead of `byte` in parameter value in androidx.compose.runtime.Composer.changed(byte value)
NoByteOrShort: androidx.compose.runtime.Composer#changed(short) parameter #0:
Should avoid odd sized primitives; use `int` instead of `short` in parameter value in androidx.compose.runtime.Composer.changed(short value)
-
-
-NullableCollection: androidx.compose.runtime.snapshots.MutableSnapshot#getModified$metalava_module():
- Return type of method androidx.compose.runtime.snapshots.MutableSnapshot.getModified$metalava_module() is a nullable collection (`java.util.Set`); must be non-null
diff --git a/compose/runtime/runtime/src/commonMain/kotlin/androidx/compose/runtime/snapshots/Snapshot.kt b/compose/runtime/runtime/src/commonMain/kotlin/androidx/compose/runtime/snapshots/Snapshot.kt
index 0c1052e..db17a59 100644
--- a/compose/runtime/runtime/src/commonMain/kotlin/androidx/compose/runtime/snapshots/Snapshot.kt
+++ b/compose/runtime/runtime/src/commonMain/kotlin/androidx/compose/runtime/snapshots/Snapshot.kt
@@ -1130,7 +1130,7 @@
globalWriteObservers.toMutableList()
} else null
)?.let {
- it.firstOrNull() ?: { state: Any ->
+ it.singleOrNull() ?: { state: Any ->
it.fastForEach { it(state) }
}
}
diff --git a/compose/ui/ui-graphics/src/desktopMain/kotlin/androidx/compose/ui/graphics/DesktopCanvas.desktop.kt b/compose/ui/ui-graphics/src/desktopMain/kotlin/androidx/compose/ui/graphics/DesktopCanvas.desktop.kt
index 5fe9454..d2c73e7 100644
--- a/compose/ui/ui-graphics/src/desktopMain/kotlin/androidx/compose/ui/graphics/DesktopCanvas.desktop.kt
+++ b/compose/ui/ui-graphics/src/desktopMain/kotlin/androidx/compose/ui/graphics/DesktopCanvas.desktop.kt
@@ -30,7 +30,6 @@
import org.jetbrains.skia.Matrix44
import org.jetbrains.skia.MipmapMode
import org.jetbrains.skia.SamplingMode
-import org.jetbrains.skia.impl.getPtr
import org.jetbrains.skia.ClipMode as SkiaClipMode
import org.jetbrains.skia.RRect as SkiaRRect
import org.jetbrains.skia.Rect as SkiaRect
@@ -338,15 +337,14 @@
}
override fun drawVertices(vertices: Vertices, blendMode: BlendMode, paint: Paint) {
- org.jetbrains.skia.Canvas._nDrawVertices(
- skia._ptr,
+ skia.drawVertices(
vertices.vertexMode.toDesktopVertexMode(),
vertices.positions,
vertices.colors,
vertices.textureCoordinates,
vertices.indices,
- blendMode.toSkia().ordinal,
- getPtr(paint.asFrameworkPaint())
+ blendMode.toSkia(),
+ paint.asFrameworkPaint()
)
}
diff --git a/compose/ui/ui-graphics/src/desktopMain/kotlin/androidx/compose/ui/graphics/DesktopVertexMode.desktop.kt b/compose/ui/ui-graphics/src/desktopMain/kotlin/androidx/compose/ui/graphics/DesktopVertexMode.desktop.kt
index 42e53a4..7edff3b 100644
--- a/compose/ui/ui-graphics/src/desktopMain/kotlin/androidx/compose/ui/graphics/DesktopVertexMode.desktop.kt
+++ b/compose/ui/ui-graphics/src/desktopMain/kotlin/androidx/compose/ui/graphics/DesktopVertexMode.desktop.kt
@@ -16,9 +16,11 @@
package androidx.compose.ui.graphics
-fun VertexMode.toDesktopVertexMode(): Int = when (this) {
- VertexMode.Triangles -> 0
- VertexMode.TriangleStrip -> 1
- VertexMode.TriangleFan -> 2
- else -> 0
-}
\ No newline at end of file
+import org.jetbrains.skia.VertexMode as SkVertexMode
+
+fun VertexMode.toDesktopVertexMode(): SkVertexMode = when (this) {
+ VertexMode.Triangles -> SkVertexMode.TRIANGLES
+ VertexMode.TriangleStrip -> SkVertexMode.TRIANGLE_STRIP
+ VertexMode.TriangleFan -> SkVertexMode.TRIANGLE_FAN
+ else -> SkVertexMode.TRIANGLES
+}
diff --git a/compose/ui/ui-inspection/src/androidTest/java/androidx/compose/ui/inspection/inspector/LayoutInspectorTreeTest.kt b/compose/ui/ui-inspection/src/androidTest/java/androidx/compose/ui/inspection/inspector/LayoutInspectorTreeTest.kt
index 6370dc3..46b3aab 100644
--- a/compose/ui/ui-inspection/src/androidTest/java/androidx/compose/ui/inspection/inspector/LayoutInspectorTreeTest.kt
+++ b/compose/ui/ui-inspection/src/androidTest/java/androidx/compose/ui/inspection/inspector/LayoutInspectorTreeTest.kt
@@ -184,7 +184,7 @@
node(
name = "Column",
fileName = "LayoutInspectorTreeTest.kt",
- left = 0.0.dp, top = 0.0.dp, width = 72.0.dp, height = 78.9.dp,
+ left = 0.0.dp, top = 0.0.dp, width = 72.0.dp, height = 90.6.dp,
children = listOf("Text", "Icon", "Surface")
)
node(
@@ -203,21 +203,21 @@
name = "Surface",
fileName = "LayoutInspectorTreeTest.kt",
isRenderNode = true,
- left = 0.0.dp, top = 42.9.dp, width = 64.0.dp, height = 36.0.dp,
+ left = 0.0.dp, top = 42.9.dp, width = 64.0.dp, height = 48.0.dp,
children = listOf("Button")
)
node(
name = "Button",
fileName = "LayoutInspectorTreeTest.kt",
isRenderNode = true,
- left = 0.0.dp, top = 42.9.dp, width = 64.0.dp, height = 36.0.dp,
+ left = 0.0.dp, top = 48.3.dp, width = 64.0.dp, height = 36.0.dp,
children = listOf("Text")
)
node(
name = "Text",
isRenderNode = true,
fileName = "LayoutInspectorTreeTest.kt",
- left = 21.7.dp, top = 51.5.dp, width = 20.9.dp, height = 18.9.dp,
+ left = 21.7.dp, top = 57.dp, width = 20.9.dp, height = 18.9.dp,
)
}
}
diff --git a/compose/ui/ui-test/api/current.txt b/compose/ui/ui-test/api/current.txt
index 273f517..ad83610 100644
--- a/compose/ui/ui-test/api/current.txt
+++ b/compose/ui/ui-test/api/current.txt
@@ -240,6 +240,9 @@
property public abstract long currentTime;
}
+ public final class MouseInjectionScopeKt {
+ }
+
public final class MultiModalInjectionScope implements androidx.compose.ui.test.InjectionScope {
ctor public MultiModalInjectionScope(androidx.compose.ui.semantics.SemanticsNode node, androidx.compose.ui.test.TestContext testContext);
method public void advanceEventTime(long durationMillis);
diff --git a/compose/ui/ui-test/api/public_plus_experimental_current.txt b/compose/ui/ui-test/api/public_plus_experimental_current.txt
index dbaa608..1adda28 100644
--- a/compose/ui/ui-test/api/public_plus_experimental_current.txt
+++ b/compose/ui/ui-test/api/public_plus_experimental_current.txt
@@ -4,6 +4,7 @@
public final class ActionsKt {
method public static androidx.compose.ui.test.SemanticsNodeInteraction performClick(androidx.compose.ui.test.SemanticsNodeInteraction);
method @Deprecated public static androidx.compose.ui.test.SemanticsNodeInteraction performGesture(androidx.compose.ui.test.SemanticsNodeInteraction, kotlin.jvm.functions.Function1<? super androidx.compose.ui.test.GestureScope,kotlin.Unit> block);
+ method @androidx.compose.ui.test.ExperimentalTestApi public static androidx.compose.ui.test.SemanticsNodeInteraction performMouseInput(androidx.compose.ui.test.SemanticsNodeInteraction, kotlin.jvm.functions.Function1<? super androidx.compose.ui.test.MouseInjectionScope,kotlin.Unit> block);
method public static androidx.compose.ui.test.SemanticsNodeInteraction performMultiModalInput(androidx.compose.ui.test.SemanticsNodeInteraction, kotlin.jvm.functions.Function1<? super androidx.compose.ui.test.MultiModalInjectionScope,kotlin.Unit> block);
method public static androidx.compose.ui.test.SemanticsNodeInteraction performScrollTo(androidx.compose.ui.test.SemanticsNodeInteraction);
method public static androidx.compose.ui.test.SemanticsNodeInteraction performScrollToIndex(androidx.compose.ui.test.SemanticsNodeInteraction, int index);
@@ -251,11 +252,56 @@
property public abstract long currentTime;
}
+ @androidx.compose.ui.test.ExperimentalTestApi public final inline class MouseButton {
+ ctor public MouseButton();
+ method public int getButtonId();
+ property public final int buttonId;
+ }
+
+ @androidx.compose.ui.test.ExperimentalTestApi public static final class MouseButton.Companion {
+ method public int getPrimary();
+ method public int getSecondary();
+ method public int getTertiary();
+ property public final int Primary;
+ property public final int Secondary;
+ property public final int Tertiary;
+ }
+
+ @androidx.compose.ui.test.ExperimentalTestApi public interface MouseInjectionScope extends androidx.compose.ui.test.InjectionScope {
+ method public void cancel(optional long delayMillis);
+ method public void enter(optional long position, optional long delayMillis);
+ method public void exit(optional long position, optional long delayMillis);
+ method public long getCurrentPosition();
+ method public default void moveBy(long delta, optional long delayMillis);
+ method public void moveTo(long position, optional long delayMillis);
+ method public void press(optional int button);
+ method public void release(optional int button);
+ method public void scroll(float delta, optional int scrollWheel);
+ method public default void updatePointerBy(long delta);
+ method public void updatePointerTo(long position);
+ property public abstract long currentPosition;
+ }
+
+ public final class MouseInjectionScopeKt {
+ method @androidx.compose.ui.test.ExperimentalTestApi public static void animateAlong(androidx.compose.ui.test.MouseInjectionScope, kotlin.jvm.functions.Function1<? super java.lang.Long,androidx.compose.ui.geometry.Offset> curve, optional long durationMillis);
+ method @androidx.compose.ui.test.ExperimentalTestApi public static void animateBy(androidx.compose.ui.test.MouseInjectionScope, long delta, optional long durationMillis);
+ method @androidx.compose.ui.test.ExperimentalTestApi public static void animateTo(androidx.compose.ui.test.MouseInjectionScope, long position, optional long durationMillis);
+ method @androidx.compose.ui.test.ExperimentalTestApi public static void click(androidx.compose.ui.test.MouseInjectionScope, optional long position);
+ method @androidx.compose.ui.test.ExperimentalTestApi public static void doubleClick(androidx.compose.ui.test.MouseInjectionScope, optional long position);
+ method @androidx.compose.ui.test.ExperimentalTestApi public static void dragAndDrop(androidx.compose.ui.test.MouseInjectionScope, long start, long end, optional long durationMillis);
+ method @androidx.compose.ui.test.ExperimentalTestApi public static void longClick(androidx.compose.ui.test.MouseInjectionScope, optional long position);
+ method @androidx.compose.ui.test.ExperimentalTestApi public static void rightClick(androidx.compose.ui.test.MouseInjectionScope, optional long position);
+ method @androidx.compose.ui.test.ExperimentalTestApi public static void smoothScroll(androidx.compose.ui.test.MouseInjectionScope, float scrollAmount, optional long durationMillis, optional int scrollWheel);
+ method @androidx.compose.ui.test.ExperimentalTestApi public static void tripleClick(androidx.compose.ui.test.MouseInjectionScope, optional long position);
+ }
+
public final class MultiModalInjectionScope implements androidx.compose.ui.test.InjectionScope {
ctor public MultiModalInjectionScope(androidx.compose.ui.semantics.SemanticsNode node, androidx.compose.ui.test.TestContext testContext);
method public void advanceEventTime(long durationMillis);
+ method @androidx.compose.ui.test.ExperimentalTestApi public androidx.compose.ui.test.MouseInjectionScope getMouse();
method public androidx.compose.ui.test.TouchInjectionScope getTouch();
method public long getVisibleSize();
+ property @androidx.compose.ui.test.ExperimentalTestApi public final androidx.compose.ui.test.MouseInjectionScope Mouse;
property public final androidx.compose.ui.test.TouchInjectionScope Touch;
property public long visibleSize;
}
@@ -267,6 +313,19 @@
method public static String printToString(androidx.compose.ui.test.SemanticsNodeInteractionCollection, optional int maxDepth);
}
+ @androidx.compose.ui.test.ExperimentalTestApi public final inline class ScrollWheel {
+ ctor public ScrollWheel();
+ method public int getValue();
+ property public final int value;
+ }
+
+ @androidx.compose.ui.test.ExperimentalTestApi public static final class ScrollWheel.Companion {
+ method public int getHorizontal();
+ method public int getVertical();
+ property public final int Horizontal;
+ property public final int Vertical;
+ }
+
public final class SelectionResult {
ctor public SelectionResult(java.util.List<androidx.compose.ui.semantics.SemanticsNode> selectedNodes, optional String? customErrorOnNoMatch);
method public String? getCustomErrorOnNoMatch();
@@ -385,6 +444,8 @@
method public default void moveBy(long delta, optional long delayMillis);
method public default void moveTo(int pointerId, long position, optional long delayMillis);
method public default void moveTo(long position, optional long delayMillis);
+ method @androidx.compose.ui.test.ExperimentalTestApi public default void moveWithHistory(java.util.List<java.lang.Long> relativeHistoricalTimes, java.util.List<androidx.compose.ui.geometry.Offset> historicalCoordinates, optional long delayMillis);
+ method @androidx.compose.ui.test.ExperimentalTestApi public void moveWithHistoryMultiPointer(java.util.List<java.lang.Long> relativeHistoricalTimes, java.util.List<? extends java.util.List<androidx.compose.ui.geometry.Offset>> historicalCoordinates, optional long delayMillis);
method public void up(optional int pointerId);
method public default void updatePointerBy(int pointerId, long delta);
method public void updatePointerTo(int pointerId, long position);
diff --git a/compose/ui/ui-test/api/restricted_current.txt b/compose/ui/ui-test/api/restricted_current.txt
index 49425a7..eb314c73 100644
--- a/compose/ui/ui-test/api/restricted_current.txt
+++ b/compose/ui/ui-test/api/restricted_current.txt
@@ -241,6 +241,9 @@
property public abstract long currentTime;
}
+ public final class MouseInjectionScopeKt {
+ }
+
public final class MultiModalInjectionScope implements androidx.compose.ui.test.InjectionScope {
ctor public MultiModalInjectionScope(androidx.compose.ui.semantics.SemanticsNode node, androidx.compose.ui.test.TestContext testContext);
method public void advanceEventTime(long durationMillis);
diff --git a/compose/ui/ui-test/lint-baseline.xml b/compose/ui/ui-test/lint-baseline.xml
index 249b7e8..bb13e19 100644
--- a/compose/ui/ui-test/lint-baseline.xml
+++ b/compose/ui/ui-test/lint-baseline.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<issues format="6" by="lint 7.1.0-dev" type="baseline" client="gradle" dependencies="false" name="AGP (7.1.0-dev)" variant="all" version="7.1.0-dev">
+<issues format="6" by="lint 7.2.0-dev" type="baseline" client="gradle" dependencies="false" name="AGP (7.2.0-dev)" variant="all" version="7.2.0-dev">
<issue
id="VisibleForTests"
@@ -52,18 +52,29 @@
errorLine2=" ~~~~">
<location
file="src/androidMain/kotlin/androidx/compose/ui/test/AndroidInputDispatcher.android.kt"
- line="40"
+ line="48"
column="21"/>
</issue>
<issue
id="VisibleForTests"
message="This method should only be accessed from tests or within private scope"
+ errorLine1=" it.view.getLocationOnScreen(array)"
+ errorLine2=" ~~~~">
+ <location
+ file="src/androidMain/kotlin/androidx/compose/ui/test/AndroidInputDispatcher.android.kt"
+ line="183"
+ column="20"/>
+ </issue>
+
+ <issue
+ id="VisibleForTests"
+ message="This method should only be accessed from tests or within private scope"
errorLine1=" root.view.getLocationOnScreen(array)"
errorLine2=" ~~~~">
<location
file="src/androidMain/kotlin/androidx/compose/ui/test/AndroidInputDispatcher.android.kt"
- line="120"
+ line="254"
column="22"/>
</issue>
diff --git a/compose/ui/ui-test/src/androidAndroidTest/kotlin/androidx/compose/ui/test/injectionscope/touch/MoveWithHistoryTest.kt b/compose/ui/ui-test/src/androidAndroidTest/kotlin/androidx/compose/ui/test/injectionscope/touch/MoveWithHistoryTest.kt
new file mode 100644
index 0000000..9e60740
--- /dev/null
+++ b/compose/ui/ui-test/src/androidAndroidTest/kotlin/androidx/compose/ui/test/injectionscope/touch/MoveWithHistoryTest.kt
@@ -0,0 +1,140 @@
+/*
+ * Copyright 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES 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.compose.ui.test.injectionscope.touch
+
+import androidx.compose.foundation.ScrollState
+import androidx.compose.foundation.layout.Box
+import androidx.compose.foundation.layout.Column
+import androidx.compose.foundation.layout.fillMaxSize
+import androidx.compose.foundation.layout.requiredSize
+import androidx.compose.foundation.layout.wrapContentSize
+import androidx.compose.foundation.verticalScroll
+import androidx.compose.runtime.Composable
+import androidx.compose.testutils.WithTouchSlop
+import androidx.compose.ui.Alignment
+import androidx.compose.ui.Modifier
+import androidx.compose.ui.geometry.Offset
+import androidx.compose.ui.platform.LocalDensity
+import androidx.compose.ui.platform.testTag
+import androidx.compose.ui.test.ExperimentalTestApi
+import androidx.compose.ui.test.junit4.createComposeRule
+import androidx.compose.ui.test.onNodeWithTag
+import androidx.compose.ui.test.performTouchInput
+import androidx.compose.ui.test.util.ClickableTestBox
+import androidx.compose.ui.test.util.SinglePointerInputRecorder
+import androidx.test.ext.junit.runners.AndroidJUnit4
+import androidx.test.filters.MediumTest
+import com.google.common.truth.Truth
+import org.junit.Rule
+import org.junit.Test
+import org.junit.runner.RunWith
+import kotlin.math.roundToInt
+
+@MediumTest
+@RunWith(AndroidJUnit4::class)
+class MoveWithHistoryTest {
+ companion object {
+ private const val tag = "widget"
+ }
+
+ @get:Rule
+ val rule = createComposeRule()
+
+ private val recorder = SinglePointerInputRecorder()
+
+ @Composable
+ fun Ui(alignment: Alignment) {
+ Box(Modifier.fillMaxSize().wrapContentSize(alignment)) {
+ ClickableTestBox(modifier = recorder, tag = tag)
+ }
+ }
+
+ @Test
+ fun flingScrollableWithHistorical() {
+ val scrollState = ScrollState(initial = 0)
+
+ flingScrollableImpl(scrollState, useHistoricalEvents = true)
+
+ // Scrolled a large amount after the fling animation (caused by historical events) ends.
+ Truth.assertThat(scrollState.value).isGreaterThan(500)
+ }
+
+ @Test
+ fun flingScrollableWithoutHistorical() {
+ val scrollState = ScrollState(initial = 0)
+
+ flingScrollableImpl(scrollState, useHistoricalEvents = false)
+
+ // We expect only finger-distance scrolling for this sequence without historical events.
+ // This test is intended as a verification that the flingScrollableWithHistorical
+ // is actually testing historical events plumbing instead of accidentally passing
+ // due to fling velocity tracker implementation details.
+ Truth.assertThat(scrollState.value).isLessThan(101)
+ }
+
+ fun flingScrollableImpl(scrollState: ScrollState, useHistoricalEvents: Boolean) {
+ val touchSlop = 18f
+ rule.setContent {
+ WithTouchSlop(touchSlop) {
+ with(LocalDensity.current) {
+ // Scrollable with a viewport the size of 10 boxes
+ Column(
+ Modifier
+ .testTag("scrollable")
+ .requiredSize(100.toDp(), 1000.toDp())
+ .verticalScroll(scrollState)
+ ) {
+ repeat(100) {
+ ClickableTestBox()
+ }
+ }
+ }
+ }
+ }
+
+ Truth.assertThat(scrollState.value).isEqualTo(0)
+ // numBoxes * boxHeight - viewportHeight = 100 * 100 - 1000
+ Truth.assertThat(scrollState.maxValue).isEqualTo(9000)
+
+ val swipeDistance = 20f - touchSlop
+ rule.onNodeWithTag("scrollable").performTouchInput {
+ // Simulate a rapid back and forth gesture which only moves 20px in 100ms if you
+ // only compare beginning and end, but much faster (70px in 16ms) when the intermediate
+ // historical events are included.
+ val from = topCenter + Offset(0f, 120f)
+ val to = topCenter + Offset(0f, 100f)
+
+ val historicalTimes = listOf(-16L, -8L)
+ val historicalCoordinates = listOf(to + Offset(0f, 70f), to + Offset(0f, 35f))
+ val delayMillis = 100L
+
+ down(from)
+ updatePointerTo(0, to)
+ if (useHistoricalEvents) {
+ @OptIn(ExperimentalTestApi::class)
+ moveWithHistory(historicalTimes, historicalCoordinates, delayMillis)
+ } else {
+ move(delayMillis)
+ }
+ up()
+ }
+ // Equal to swipe distance before fling animation starts
+ Truth.assertThat(scrollState.value).isEqualTo(swipeDistance.roundToInt())
+
+ rule.waitForIdle()
+ }
+}
\ No newline at end of file
diff --git a/compose/ui/ui-test/src/androidAndroidTest/kotlin/androidx/compose/ui/test/inputdispatcher/MouseEventsTest.kt b/compose/ui/ui-test/src/androidAndroidTest/kotlin/androidx/compose/ui/test/inputdispatcher/MouseEventsTest.kt
new file mode 100644
index 0000000..8bba9a6
--- /dev/null
+++ b/compose/ui/ui-test/src/androidAndroidTest/kotlin/androidx/compose/ui/test/inputdispatcher/MouseEventsTest.kt
@@ -0,0 +1,675 @@
+/*
+ * 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.compose.ui.test.inputdispatcher
+
+import android.view.MotionEvent.ACTION_BUTTON_PRESS
+import android.view.MotionEvent.ACTION_BUTTON_RELEASE
+import android.view.MotionEvent.ACTION_CANCEL
+import android.view.MotionEvent.ACTION_DOWN
+import android.view.MotionEvent.ACTION_HOVER_ENTER
+import android.view.MotionEvent.ACTION_HOVER_EXIT
+import android.view.MotionEvent.ACTION_HOVER_MOVE
+import android.view.MotionEvent.ACTION_MOVE
+import android.view.MotionEvent.ACTION_SCROLL
+import android.view.MotionEvent.ACTION_UP
+import android.view.MotionEvent.AXIS_HSCROLL
+import android.view.MotionEvent.AXIS_VSCROLL
+import android.view.MotionEvent.BUTTON_PRIMARY
+import android.view.MotionEvent.BUTTON_SECONDARY
+import android.view.MotionEvent.BUTTON_TERTIARY
+import androidx.compose.testutils.expectError
+import androidx.compose.ui.geometry.Offset
+import androidx.compose.ui.test.AndroidInputDispatcher
+import androidx.compose.ui.test.ExperimentalTestApi
+import androidx.compose.ui.test.InputDispatcher.Companion.eventPeriodMillis
+import androidx.compose.ui.test.MouseButton
+import androidx.compose.ui.test.ScrollWheel
+import androidx.compose.ui.test.util.Touchscreen
+import androidx.compose.ui.test.util.Finger
+import androidx.compose.ui.test.util.assertHasValidEventTimes
+import androidx.compose.ui.test.util.verifyEvent
+import androidx.compose.ui.test.util.verifyMouseEvent
+import androidx.compose.ui.test.util.verifyPointer
+import androidx.test.filters.SmallTest
+import com.google.common.truth.Truth.assertThat
+import com.google.common.truth.Truth.assertWithMessage
+import org.junit.Test
+
+/**
+ * Tests if [AndroidInputDispatcher.enqueueTouchDown] works
+ */
+@SmallTest
+@OptIn(ExperimentalTestApi::class)
+class MouseEventsTest : InputDispatcherTest() {
+ companion object {
+ // Positions
+ private val position1 = Offset(1f, 1f)
+ private val position2 = Offset(2f, 2f)
+ private val position3 = Offset(3f, 3f)
+ private val position4 = Offset(4f, 4f)
+ }
+
+ @Test
+ fun oneButton_primary() {
+ oneButton(MouseButton.Primary, BUTTON_PRIMARY)
+ }
+
+ @Test
+ fun oneButton_secondary() {
+ oneButton(MouseButton.Secondary, BUTTON_SECONDARY)
+ }
+
+ @Test
+ fun oneButton_tertiary() {
+ oneButton(MouseButton.Tertiary, BUTTON_TERTIARY)
+ }
+
+ private fun oneButton(mouseButton: MouseButton, expectedButtonState: Int) {
+ // Scenario:
+ // move mouse
+ // press button
+ // move mouse
+ // release button
+ // move mouse
+
+ var expectedEvents = 0
+ subject.verifyMousePosition(Offset.Zero)
+ subject.enqueueMouseMove(position1)
+ subject.verifyMousePosition(position1)
+ expectedEvents += 2 // enter + hover
+ subject.advanceEventTime()
+ subject.enqueueMousePress(mouseButton.buttonId)
+ expectedEvents += 3 // exit + down + press
+ subject.advanceEventTime()
+ subject.enqueueMouseMove(position2)
+ subject.verifyMousePosition(position2)
+ expectedEvents += 1 // move
+ subject.advanceEventTime()
+ subject.enqueueMouseRelease(mouseButton.buttonId)
+ expectedEvents += 4 // release + up + enter + hover
+ subject.advanceEventTime()
+ subject.enqueueMouseMove(position3)
+ subject.verifyMousePosition(position3)
+ expectedEvents += 1 // hover
+ subject.sendAllSynchronous()
+
+ recorder.assertHasValidEventTimes()
+ assertThat(recorder.events).hasSize(expectedEvents)
+ val events = recorder.events.toMutableList()
+
+ // enter + hover
+ var t = 0L
+ events.removeFirst(2).let { (enterEvent, hoverEvent) ->
+ enterEvent.verifyMouseEvent(ACTION_HOVER_ENTER, t, position1, 0)
+ hoverEvent.verifyMouseEvent(ACTION_HOVER_MOVE, t, position1, 0)
+ }
+
+ // exit + down + press
+ t = 0L // down resets downTime
+ events.removeFirst(3).let { (exitEvent, downEvent, pressEvent) ->
+ exitEvent.verifyMouseEvent(ACTION_HOVER_EXIT, t, position1, expectedButtonState)
+ downEvent.verifyMouseEvent(ACTION_DOWN, t, position1, expectedButtonState)
+ pressEvent.verifyMouseEvent(ACTION_BUTTON_PRESS, t, position1, expectedButtonState)
+ }
+
+ // move
+ t += eventPeriodMillis
+ events.removeFirst(1).let { (moveEvent) ->
+ moveEvent.verifyMouseEvent(ACTION_MOVE, t, position2, expectedButtonState)
+ }
+
+ // release + up + enter + hover
+ t += eventPeriodMillis
+ events.removeFirst(4).let { (releaseEvent, upEvent, enterEvent, hoverEvent) ->
+ releaseEvent.verifyMouseEvent(ACTION_BUTTON_RELEASE, t, position2, 0)
+ upEvent.verifyMouseEvent(ACTION_UP, t, position2, 0)
+ enterEvent.verifyMouseEvent(ACTION_HOVER_ENTER, t, position2, 0)
+ hoverEvent.verifyMouseEvent(ACTION_HOVER_MOVE, t, position2, 0)
+ }
+
+ // hover
+ t += eventPeriodMillis
+ events.removeFirst(1).let { (hoverEvent) ->
+ hoverEvent.verifyMouseEvent(ACTION_HOVER_MOVE, t, position3, 0)
+ }
+ }
+
+ @Test
+ fun oneButton_cancel() {
+ // Scenario:
+ // press primary button
+ // cancel mouse gesture
+
+ var expectedEvents = 0
+ subject.enqueueMousePress(MouseButton.Primary.buttonId)
+ expectedEvents += 2 // down + press
+ subject.advanceEventTime()
+ subject.enqueueMouseCancel()
+ expectedEvents += 1 // cancel
+ subject.sendAllSynchronous()
+
+ recorder.assertHasValidEventTimes()
+ assertThat(recorder.events).hasSize(expectedEvents)
+ val events = recorder.events.toMutableList()
+
+ // down + press
+ var t = 0L
+ var buttonState = BUTTON_PRIMARY
+ events.removeFirst(2).let { (downEvent, pressEvent) ->
+ downEvent.verifyMouseEvent(ACTION_DOWN, t, Offset.Zero, buttonState)
+ pressEvent.verifyMouseEvent(ACTION_BUTTON_PRESS, t, Offset.Zero, buttonState)
+ }
+
+ // cancel
+ t += eventPeriodMillis
+ buttonState = 0
+ events.removeFirst(1).let { (cancelEvent) ->
+ cancelEvent.verifyMouseEvent(ACTION_CANCEL, t, Offset.Zero, buttonState)
+ }
+ }
+
+ @Test
+ fun twoButtons() {
+ // Scenario:
+ // press primary button
+ // move mouse
+ // press secondary button
+ // move mouse
+ // release primary button
+ // move mouse
+ // release secondary button
+ // move mouse
+ // press tertiary button
+
+ var expectedEvents = 0
+ subject.verifyMousePosition(Offset.Zero)
+ subject.enqueueMousePress(MouseButton.Primary.buttonId)
+ expectedEvents += 2 // down + press
+ subject.advanceEventTime()
+ subject.enqueueMouseMove(position1)
+ subject.verifyMousePosition(position1)
+ expectedEvents += 1 // move
+ subject.advanceEventTime()
+ subject.enqueueMousePress(MouseButton.Secondary.buttonId)
+ expectedEvents += 2 // move + press
+ subject.advanceEventTime()
+ subject.enqueueMouseMove(position2)
+ subject.verifyMousePosition(position2)
+ expectedEvents += 1 // move
+ subject.advanceEventTime()
+ subject.enqueueMouseRelease(MouseButton.Primary.buttonId)
+ expectedEvents += 2 // release + move
+ subject.advanceEventTime()
+ subject.enqueueMouseMove(position3)
+ subject.verifyMousePosition(position3)
+ expectedEvents += 1 // move
+ subject.advanceEventTime()
+ subject.enqueueMouseRelease(MouseButton.Secondary.buttonId)
+ expectedEvents += 4 // release + up + enter + hover
+ subject.advanceEventTime()
+ subject.enqueueMouseMove(position4)
+ subject.verifyMousePosition(position4)
+ expectedEvents += 1 // hover
+ subject.advanceEventTime()
+ subject.enqueueMousePress(MouseButton.Tertiary.buttonId)
+ expectedEvents += 3 // exit + down + press
+ subject.sendAllSynchronous()
+
+ recorder.assertHasValidEventTimes()
+ assertThat(recorder.events).hasSize(expectedEvents)
+ val events = recorder.events.toMutableList()
+
+ // down + press
+ var t = 0L
+ var buttonState = BUTTON_PRIMARY
+ events.removeFirst(2).let { (downEvent, pressEvent) ->
+ downEvent.verifyMouseEvent(ACTION_DOWN, t, Offset.Zero, buttonState)
+ pressEvent.verifyMouseEvent(ACTION_BUTTON_PRESS, t, Offset.Zero, buttonState)
+ }
+
+ // move
+ t += eventPeriodMillis
+ events.removeFirst(1).let { (moveEvent) ->
+ moveEvent.verifyMouseEvent(ACTION_MOVE, t, position1, buttonState)
+ }
+
+ // move + press
+ t += eventPeriodMillis
+ buttonState = BUTTON_PRIMARY or BUTTON_SECONDARY
+ events.removeFirst(2).let { (moveEvent, pressEvent) ->
+ moveEvent.verifyMouseEvent(ACTION_MOVE, t, position1, buttonState)
+ pressEvent.verifyMouseEvent(ACTION_BUTTON_PRESS, t, position1, buttonState)
+ }
+
+ // move
+ t += eventPeriodMillis
+ events.removeFirst(1).let { (moveEvent) ->
+ moveEvent.verifyMouseEvent(ACTION_MOVE, t, position2, buttonState)
+ }
+
+ // release + move
+ t += eventPeriodMillis
+ buttonState = BUTTON_SECONDARY
+ events.removeFirst(2).let { (releaseEvent, moveEvent) ->
+ releaseEvent.verifyMouseEvent(ACTION_BUTTON_RELEASE, t, position2, buttonState)
+ moveEvent.verifyMouseEvent(ACTION_MOVE, t, position2, buttonState)
+ }
+
+ // move
+ t += eventPeriodMillis
+ events.removeFirst(1).let { (moveEvent) ->
+ moveEvent.verifyMouseEvent(ACTION_MOVE, t, position3, buttonState)
+ }
+
+ // release + up + enter + hover
+ t += eventPeriodMillis
+ events.removeFirst(4).let { (releaseEvent, upEvent, enterEvent, hoverEvent) ->
+ releaseEvent.verifyMouseEvent(ACTION_BUTTON_RELEASE, t, position3, 0)
+ upEvent.verifyMouseEvent(ACTION_UP, t, position3, 0)
+ enterEvent.verifyMouseEvent(ACTION_HOVER_ENTER, t, position3, 0)
+ hoverEvent.verifyMouseEvent(ACTION_HOVER_MOVE, t, position3, 0)
+ }
+
+ // hover
+ t += eventPeriodMillis
+ events.removeFirst(1).let { (hoverEvent) ->
+ hoverEvent.verifyMouseEvent(ACTION_HOVER_MOVE, t, position4, 0)
+ }
+
+ // exit + down + press
+ t = 0L // down resets downTime
+ buttonState = BUTTON_TERTIARY
+ events.removeFirst(3).let { (exitEvent, downEvent, pressEvent) ->
+ exitEvent.verifyMouseEvent(ACTION_HOVER_EXIT, t, position4, buttonState)
+ downEvent.verifyMouseEvent(ACTION_DOWN, t, position4, buttonState)
+ pressEvent.verifyMouseEvent(ACTION_BUTTON_PRESS, t, position4, buttonState)
+ }
+ }
+
+ @Test
+ fun manualEnterExit() {
+ // Scenario:
+ // send hover enter
+ // move mouse
+ // send hover exit
+
+ var expectedEvents = 0
+ subject.verifyMousePosition(Offset.Zero)
+ subject.enqueueMouseEnter(position1)
+ subject.verifyMousePosition(position1)
+ expectedEvents += 1 // enter
+ subject.advanceEventTime()
+ subject.enqueueMouseMove(position2)
+ subject.verifyMousePosition(position2)
+ expectedEvents += 1 // move
+ subject.advanceEventTime()
+ subject.enqueueMouseExit(position3)
+ subject.verifyMousePosition(position3)
+ expectedEvents += 1 // exit
+ subject.sendAllSynchronous()
+
+ recorder.assertHasValidEventTimes()
+ assertThat(recorder.events).hasSize(expectedEvents)
+ val events = recorder.events.toMutableList()
+
+ // enter
+ var t = 0L
+ events.removeFirst(1).let { (enterEvent) ->
+ enterEvent.verifyMouseEvent(ACTION_HOVER_ENTER, t, position1, 0)
+ }
+
+ // hover
+ t += eventPeriodMillis
+ events.removeFirst(1).let { (hoverEvent) ->
+ hoverEvent.verifyMouseEvent(ACTION_HOVER_MOVE, t, position2, 0)
+ }
+
+ // exit
+ t += eventPeriodMillis
+ events.removeFirst(1).let { (exitEvent) ->
+ exitEvent.verifyMouseEvent(ACTION_HOVER_EXIT, t, position3, 0)
+ }
+ }
+
+ @Test
+ fun scroll_vertically() {
+ scrollTest(ScrollWheel.Vertical) { Pair(AXIS_VSCROLL, it) }
+ }
+
+ @Test
+ fun scroll_horizontally() {
+ scrollTest(ScrollWheel.Horizontal) { Pair(AXIS_HSCROLL, it) }
+ }
+
+ fun scrollTest(scrollWheel: ScrollWheel, scrollAxis: (Float) -> Pair<Int, Float>) {
+ // Scenario:
+ // move mouse
+ // scroll by 1f
+ // press primary button
+ // scroll by 2f
+ // release primary button
+ // scroll by 3f
+
+ var expectedEvents = 0
+ subject.verifyMousePosition(Offset.Zero)
+ subject.enqueueMouseMove(position1)
+ subject.verifyMousePosition(position1)
+ expectedEvents += 2 // enter + hover
+ subject.advanceEventTime()
+ subject.enqueueMouseScroll(1f, scrollWheel)
+ expectedEvents += 2 // hover + scroll
+ subject.advanceEventTime()
+ subject.enqueueMousePress(MouseButton.Primary.buttonId)
+ expectedEvents += 3 // exit + down + press
+ subject.advanceEventTime()
+ subject.enqueueMouseScroll(2f, scrollWheel)
+ expectedEvents += 2 // move + scroll
+ subject.advanceEventTime()
+ subject.enqueueMouseRelease(MouseButton.Primary.buttonId)
+ expectedEvents += 4 // release + up + enter + hover
+ subject.advanceEventTime()
+ subject.enqueueMouseScroll(3f, scrollWheel)
+ expectedEvents += 2 // hover + scroll
+ subject.sendAllSynchronous()
+
+ recorder.assertHasValidEventTimes()
+ assertThat(recorder.events).hasSize(expectedEvents)
+ val events = recorder.events.toMutableList()
+
+ // enter + hover
+ var t = 0L
+ var buttonState = 0
+ events.removeFirst(2).let { (enterEvent, hoverEvent) ->
+ enterEvent.verifyMouseEvent(ACTION_HOVER_ENTER, t, position1, buttonState)
+ hoverEvent.verifyMouseEvent(ACTION_HOVER_MOVE, t, position1, buttonState)
+ }
+
+ // hover + scroll
+ t += eventPeriodMillis
+ events.removeFirst(2).let { (hoverEvent, scrollEvent) ->
+ hoverEvent.verifyMouseEvent(ACTION_HOVER_MOVE, t, position1, buttonState)
+ scrollEvent.verifyMouseEvent(ACTION_SCROLL, t, position1, buttonState, scrollAxis(1f))
+ }
+
+ // exit + down + press
+ t = 0L // down resets downTime
+ buttonState = BUTTON_PRIMARY
+ events.removeFirst(3).let { (exitEvent, downEvent, pressEvent) ->
+ exitEvent.verifyMouseEvent(ACTION_HOVER_EXIT, t, position1, buttonState)
+ downEvent.verifyMouseEvent(ACTION_DOWN, t, position1, buttonState)
+ pressEvent.verifyMouseEvent(ACTION_BUTTON_PRESS, t, position1, buttonState)
+ }
+
+ // move + scroll
+ t += eventPeriodMillis
+ events.removeFirst(2).let { (moveEvent, scrollEvent) ->
+ moveEvent.verifyMouseEvent(ACTION_MOVE, t, position1, buttonState)
+ scrollEvent.verifyMouseEvent(ACTION_SCROLL, t, position1, buttonState, scrollAxis(2f))
+ }
+
+ // release + up + enter + hover
+ t += eventPeriodMillis
+ buttonState = 0
+ events.removeFirst(4).let { (releaseEvent, upEvent, enterEvent, hoverEvent) ->
+ releaseEvent.verifyMouseEvent(ACTION_BUTTON_RELEASE, t, position1, buttonState)
+ upEvent.verifyMouseEvent(ACTION_UP, t, position1, buttonState)
+ enterEvent.verifyMouseEvent(ACTION_HOVER_ENTER, t, position1, buttonState)
+ hoverEvent.verifyMouseEvent(ACTION_HOVER_MOVE, t, position1, buttonState)
+ }
+
+ // hover + scroll
+ t += eventPeriodMillis
+ events.removeFirst(2).let { (hoverEvent, scrollEvent) ->
+ hoverEvent.verifyMouseEvent(ACTION_HOVER_MOVE, t, position1, buttonState)
+ scrollEvent.verifyMouseEvent(ACTION_SCROLL, t, position1, buttonState, scrollAxis(3f))
+ }
+ }
+
+ @Test
+ fun twoButtons_cancel() {
+ // Scenario:
+ // press primary button
+ // press secondary button
+ // cancel
+
+ var expectedEvents = 0
+ subject.enqueueMousePress(MouseButton.Primary.buttonId)
+ expectedEvents += 2 // down + press
+ subject.advanceEventTime()
+ subject.enqueueMousePress(MouseButton.Secondary.buttonId)
+ expectedEvents += 2 // move + press
+ subject.advanceEventTime()
+ subject.enqueueMouseCancel()
+ expectedEvents += 1 // cancel
+ subject.sendAllSynchronous()
+
+ recorder.assertHasValidEventTimes()
+ assertThat(recorder.events).hasSize(expectedEvents)
+ val events = recorder.events.toMutableList()
+
+ // down + press
+ var t = 0L
+ var buttonState = BUTTON_PRIMARY
+ events.removeFirst(2).let { (downEvent, pressEvent) ->
+ downEvent.verifyMouseEvent(ACTION_DOWN, t, Offset.Zero, buttonState)
+ pressEvent.verifyMouseEvent(ACTION_BUTTON_PRESS, t, Offset.Zero, buttonState)
+ }
+
+ // move + press
+ t += eventPeriodMillis
+ buttonState = BUTTON_PRIMARY or BUTTON_SECONDARY
+ events.removeFirst(2).let { (moveEvent, pressEvent) ->
+ moveEvent.verifyMouseEvent(ACTION_MOVE, t, Offset.Zero, buttonState)
+ pressEvent.verifyMouseEvent(ACTION_BUTTON_PRESS, t, Offset.Zero, buttonState)
+ }
+
+ // cancel
+ t += eventPeriodMillis
+ buttonState = 0
+ events.removeFirst(1).let { (cancelEvent) ->
+ cancelEvent.verifyMouseEvent(ACTION_CANCEL, t, Offset.Zero, buttonState)
+ }
+ }
+
+ @Test
+ fun enqueueMousePress_interruptsTouch() {
+ // Scenario:
+ // finger 1 down
+ // press primary button
+
+ var expectedEvents = 0
+ subject.enqueueTouchDown(1, position1)
+ expectedEvents += 1 // down
+ subject.advanceEventTime()
+ subject.enqueueMousePress(MouseButton.Primary.buttonId)
+ expectedEvents += 3 // cancel + down + press
+ subject.sendAllSynchronous()
+
+ recorder.assertHasValidEventTimes()
+ assertThat(recorder.events).hasSize(expectedEvents)
+ val events = recorder.events.toMutableList()
+
+ // down
+ var t = 0L
+ events.removeFirst(1).let { (downEvent) ->
+ downEvent.verifyEvent(1, ACTION_DOWN, 0, t, Touchscreen)
+ downEvent.verifyPointer(1, position1, Finger)
+ }
+
+ // cancel
+ t += eventPeriodMillis
+ events.removeFirst(1).let { (cancelEvent) ->
+ cancelEvent.verifyEvent(1, ACTION_CANCEL, 0, t, Touchscreen)
+ cancelEvent.verifyPointer(1, position1, Finger)
+ }
+
+ // down + press
+ t = 0L // down resets downTime
+ val buttonState = BUTTON_PRIMARY
+ events.removeFirst(2).let { (downEvent, pressEvent) ->
+ downEvent.verifyMouseEvent(ACTION_DOWN, t, Offset.Zero, buttonState)
+ pressEvent.verifyMouseEvent(ACTION_BUTTON_PRESS, t, Offset.Zero, buttonState)
+ }
+ }
+
+ @Test
+ fun enqueueMouseMove_interruptsTouch() {
+ // Scenario:
+ // finger 1 down
+ // move mouse
+
+ var expectedEvents = 0
+ subject.enqueueTouchDown(1, position1)
+ expectedEvents += 1 // down
+ subject.advanceEventTime()
+ subject.enqueueMouseMove(position2)
+ expectedEvents += 3 // cancel + enter + hover
+ subject.sendAllSynchronous()
+
+ recorder.assertHasValidEventTimes()
+ assertThat(recorder.events).hasSize(expectedEvents)
+ val events = recorder.events.toMutableList()
+
+ // down
+ var t = 0L
+ events.removeFirst(1).let { (downEvent) ->
+ downEvent.verifyEvent(1, ACTION_DOWN, 0, t, Touchscreen)
+ downEvent.verifyPointer(1, position1, Finger)
+ }
+
+ // cancel
+ t += eventPeriodMillis
+ events.removeFirst(1).let { (cancelEvent) ->
+ cancelEvent.verifyEvent(1, ACTION_CANCEL, 0, t, Touchscreen)
+ cancelEvent.verifyPointer(1, position1, Finger)
+ }
+
+ // enter + hover
+ events.removeFirst(2).let { (enterEvent, hoverEvent) ->
+ enterEvent.verifyMouseEvent(ACTION_HOVER_ENTER, t, position2, 0)
+ hoverEvent.verifyMouseEvent(ACTION_HOVER_MOVE, t, position2, 0)
+ }
+ }
+
+ @Test
+ fun enqueueMouseScroll_interruptsTouch() {
+ // Scenario:
+ // finger 1 down
+ // scroll by 1f
+
+ var expectedEvents = 0
+ subject.enqueueTouchDown(1, position1)
+ expectedEvents += 1 // down
+ subject.advanceEventTime()
+ subject.enqueueMouseScroll(1f, ScrollWheel.Vertical)
+ expectedEvents += 4 // cancel + enter + hover + scroll
+ subject.sendAllSynchronous()
+
+ recorder.assertHasValidEventTimes()
+ assertThat(recorder.events).hasSize(expectedEvents)
+ val events = recorder.events.toMutableList()
+
+ // down
+ var t = 0L
+ events.removeFirst(1).let { (downEvent) ->
+ downEvent.verifyEvent(1, ACTION_DOWN, 0, t, Touchscreen)
+ downEvent.verifyPointer(1, position1, Finger)
+ }
+
+ // cancel
+ t += eventPeriodMillis
+ events.removeFirst(1).let { (cancelEvent) ->
+ cancelEvent.verifyEvent(1, ACTION_CANCEL, 0, t, Touchscreen)
+ cancelEvent.verifyPointer(1, position1, Finger)
+ }
+
+ // enter + hover + scroll
+ events.removeFirst(3).let { (enterEvent, hoverEvent, scrollEvent) ->
+ enterEvent.verifyMouseEvent(ACTION_HOVER_ENTER, t, Offset.Zero, 0)
+ hoverEvent.verifyMouseEvent(ACTION_HOVER_MOVE, t, Offset.Zero, 0)
+ scrollEvent.verifyMouseEvent(ACTION_SCROLL, t, Offset.Zero, 0, Pair(AXIS_VSCROLL, 1f))
+ }
+ }
+
+ @Test
+ fun enqueueMouseDown_alreadyDown() {
+ subject.enqueueMousePress(1)
+ expectError<IllegalStateException>(
+ expectedMessage = "Cannot send mouse button down event, button 1 is already pressed"
+ ) {
+ subject.enqueueMousePress(1)
+ }
+ }
+
+ @Test
+ fun enqueueMouseUp_withoutDown() {
+ expectError<IllegalStateException>(
+ expectedMessage = "Cannot send mouse button up event, button 1 is not pressed"
+ ) {
+ subject.enqueueMouseRelease(1)
+ }
+ }
+
+ @Test
+ fun enqueueMouseEnter_alreadyEntered() {
+ subject.enqueueMouseEnter(position1)
+ expectError<IllegalStateException>(
+ expectedMessage = "Cannot send mouse hover enter event, mouse is already hovering"
+ ) {
+ subject.enqueueMouseEnter(position1)
+ }
+ }
+
+ @Test
+ fun enqueueMouseEnter_buttonsDown() {
+ subject.enqueueMousePress(1)
+ expectError<IllegalStateException>(
+ expectedMessage = "Cannot send mouse hover enter event, mouse buttons are down"
+ ) {
+ subject.enqueueMouseEnter(position1)
+ }
+ }
+
+ @Test
+ fun enqueueMouseExit_notEntered() {
+ expectError<IllegalStateException>(
+ expectedMessage = "Cannot send mouse hover exit event, mouse is not hovering"
+ ) {
+ subject.enqueueMouseExit(position1)
+ }
+ }
+
+ @Test
+ fun enqueueMouseCancel_withoutDown() {
+ expectError<IllegalStateException>(
+ expectedMessage = "Cannot send mouse cancel event, no mouse buttons are pressed"
+ ) {
+ subject.enqueueMouseCancel()
+ }
+ }
+
+ private fun AndroidInputDispatcher.verifyMousePosition(expectedPosition: Offset) {
+ assertWithMessage("currentMousePosition")
+ .that(currentMousePosition).isEqualTo(expectedPosition)
+ }
+
+ private fun <E> MutableList<E>.removeFirst(n: Int): List<E> {
+ return mutableListOf<E>().also { result ->
+ repeat(n) { result.add(removeFirst()) }
+ }
+ }
+}
diff --git a/compose/ui/ui-test/src/androidAndroidTest/kotlin/androidx/compose/ui/test/util/MotionEvents.kt b/compose/ui/ui-test/src/androidAndroidTest/kotlin/androidx/compose/ui/test/util/MotionEvents.kt
index 99856ee..80f2a78 100644
--- a/compose/ui/ui-test/src/androidAndroidTest/kotlin/androidx/compose/ui/test/util/MotionEvents.kt
+++ b/compose/ui/ui-test/src/androidAndroidTest/kotlin/androidx/compose/ui/test/util/MotionEvents.kt
@@ -20,10 +20,13 @@
import android.view.MotionEvent
import androidx.compose.ui.geometry.Offset
import com.google.common.truth.Truth.assertThat
+import com.google.common.truth.Truth.assertWithMessage
import kotlin.math.abs
const val Finger = MotionEvent.TOOL_TYPE_FINGER
const val Touchscreen = InputDevice.SOURCE_TOUCHSCREEN
+const val TypeMouse = MotionEvent.TOOL_TYPE_MOUSE
+const val SourceMouse = InputDevice.SOURCE_MOUSE
internal class MotionEventRecorder {
@@ -51,9 +54,14 @@
* stream has increasing event times.
*/
internal fun MotionEventRecorder.assertHasValidEventTimes() {
- events.fold(0L) { previousTime, event ->
- assertThat(event.relativeTime).isAtLeast(previousTime)
- event.relativeTime
+ events.fold(Pair(0L, 0L)) { (lastDownTime, lastEventTime), event ->
+ assertWithMessage("monotonically increasing downTime")
+ .that(event.downTime).isAtLeast(lastDownTime)
+ assertWithMessage("monotonically increasing eventTime")
+ .that(event.eventTime).isAtLeast(lastEventTime)
+ assertWithMessage("downTime <= eventTime")
+ .that(event.downTime).isAtMost(event.eventTime)
+ Pair(event.downTime, event.eventTime)
}
}
@@ -113,6 +121,28 @@
assertThat(getToolType(index)).isEqualTo(expectedToolType)
}
+internal fun MotionEvent.verifyMouseEvent(
+ expectedAction: Int,
+ expectedRelativeTime: Long,
+ expectedPosition: Offset,
+ expectedButtonState: Int,
+ vararg expectedAxisValues: Pair<Int, Float>, // <axis, value>
+) {
+ assertWithMessage("pointerCount").that(pointerCount).isEqualTo(1)
+ assertWithMessage("pointerId").that(getPointerId(0)).isEqualTo(0)
+ assertWithMessage("actionMasked").that(actionMasked).isEqualTo(expectedAction)
+ assertWithMessage("actionIndex").that(actionIndex).isEqualTo(0)
+ assertWithMessage("relativeTime").that(relativeTime).isEqualTo(expectedRelativeTime)
+ assertWithMessage("x").that(x).isEqualTo(expectedPosition.x)
+ assertWithMessage("y").that(y).isEqualTo(expectedPosition.y)
+ assertWithMessage("buttonState").that(buttonState).isEqualTo(expectedButtonState)
+ assertWithMessage("source").that(source).isEqualTo(SourceMouse)
+ assertWithMessage("toolType").that(getToolType(0)).isEqualTo(TypeMouse)
+ expectedAxisValues.forEach { (axis, expectedValue) ->
+ assertWithMessage("axisValue($axis)").that(getAxisValue(axis)).isEqualTo(expectedValue)
+ }
+}
+
/**
* Returns a list of all events between [t0] and [t1], excluding [t0] and including [t1].
*/
diff --git a/compose/ui/ui-test/src/androidMain/kotlin/androidx/compose/ui/test/AndroidInputDispatcher.android.kt b/compose/ui/ui-test/src/androidMain/kotlin/androidx/compose/ui/test/AndroidInputDispatcher.android.kt
index 71f93f4..7d41861 100644
--- a/compose/ui/ui-test/src/androidMain/kotlin/androidx/compose/ui/test/AndroidInputDispatcher.android.kt
+++ b/compose/ui/ui-test/src/androidMain/kotlin/androidx/compose/ui/test/AndroidInputDispatcher.android.kt
@@ -18,17 +18,25 @@
import android.view.InputDevice
import android.view.MotionEvent
+import android.view.MotionEvent.ACTION_BUTTON_PRESS
+import android.view.MotionEvent.ACTION_BUTTON_RELEASE
import android.view.MotionEvent.ACTION_CANCEL
import android.view.MotionEvent.ACTION_DOWN
+import android.view.MotionEvent.ACTION_HOVER_ENTER
+import android.view.MotionEvent.ACTION_HOVER_EXIT
+import android.view.MotionEvent.ACTION_HOVER_MOVE
import android.view.MotionEvent.ACTION_MOVE
import android.view.MotionEvent.ACTION_POINTER_DOWN
import android.view.MotionEvent.ACTION_POINTER_INDEX_SHIFT
import android.view.MotionEvent.ACTION_POINTER_UP
+import android.view.MotionEvent.ACTION_SCROLL
import android.view.MotionEvent.ACTION_UP
import androidx.compose.ui.geometry.Offset
import androidx.compose.ui.node.RootForTest
import androidx.compose.ui.platform.ViewRootForTest
+private val MouseAsTouchEvents = listOf(ACTION_DOWN, ACTION_MOVE, ACTION_UP)
+
internal actual fun createInputDispatcher(
testContext: TestContext,
root: RootForTest
@@ -38,7 +46,23 @@
root::class.java.simpleName
}
val view = root.view
- return AndroidInputDispatcher(testContext, root) { view.dispatchTouchEvent(it) }
+ return AndroidInputDispatcher(testContext, root) {
+ when (it.source) {
+ InputDevice.SOURCE_TOUCHSCREEN -> {
+ view.dispatchTouchEvent(it)
+ }
+ InputDevice.SOURCE_MOUSE -> {
+ if (it.action in MouseAsTouchEvents) {
+ view.dispatchTouchEvent(it)
+ } else {
+ view.dispatchGenericMotionEvent(it)
+ }
+ }
+ else -> throw IllegalArgumentException(
+ "Can't dispatch MotionEvents with source ${it.source}"
+ )
+ }
+ }
}
internal class AndroidInputDispatcher(
@@ -63,6 +87,24 @@
enqueueTouchEvent(ACTION_MOVE, 0)
}
+ override fun PartialGesture.enqueueMoves(
+ relativeHistoricalTimes: List<Long>,
+ historicalCoordinates: List<List<Offset>>
+ ) {
+ val entries = lastPositions.entries.sortedBy { it.key }
+ val absoluteHistoricalTimes = relativeHistoricalTimes.map { currentTime + it }
+ enqueueTouchEvent(
+ downTime = downTime,
+ action = ACTION_MOVE,
+ actionIndex = 0,
+ pointerIds = List(entries.size) { entries[it].key },
+ eventTimes = absoluteHistoricalTimes + listOf(currentTime),
+ coordinates = List(entries.size) {
+ historicalCoordinates[it] + listOf(entries[it].value)
+ }
+ )
+ }
+
override fun PartialGesture.enqueueUp(pointerId: Int) {
enqueueTouchEvent(
if (lastPositions.size == 1) ACTION_UP else ACTION_POINTER_UP,
@@ -74,6 +116,45 @@
enqueueTouchEvent(ACTION_CANCEL, 0)
}
+ override fun MouseInputState.enqueuePress(buttonId: Int) {
+ enqueueMouseEvent(if (hasOneButtonPressed) ACTION_DOWN else ACTION_MOVE)
+ enqueueMouseEvent(ACTION_BUTTON_PRESS)
+ }
+
+ override fun MouseInputState.enqueueMove() {
+ enqueueMouseEvent(if (isEntered) ACTION_HOVER_MOVE else ACTION_MOVE)
+ }
+
+ override fun MouseInputState.enqueueRelease(buttonId: Int) {
+ enqueueMouseEvent(ACTION_BUTTON_RELEASE)
+ enqueueMouseEvent(if (hasNoButtonsPressed) ACTION_UP else ACTION_MOVE)
+ }
+
+ override fun MouseInputState.enqueueEnter() {
+ enqueueMouseEvent(ACTION_HOVER_ENTER)
+ }
+
+ override fun MouseInputState.enqueueExit() {
+ enqueueMouseEvent(ACTION_HOVER_EXIT)
+ }
+
+ override fun MouseInputState.enqueueCancel() {
+ enqueueMouseEvent(ACTION_CANCEL)
+ }
+
+ @OptIn(ExperimentalTestApi::class)
+ override fun MouseInputState.enqueueScroll(delta: Float, scrollWheel: ScrollWheel) {
+ enqueueMouseEvent(
+ ACTION_SCROLL,
+ delta,
+ when (scrollWheel) {
+ ScrollWheel.Horizontal -> MotionEvent.AXIS_HSCROLL
+ ScrollWheel.Vertical -> MotionEvent.AXIS_VSCROLL
+ else -> -1
+ }
+ )
+ }
+
/**
* Generates a MotionEvent with the given [action] and [actionIndex], adding all pointers that
* are currently in the gesture, and adds the MotionEvent to the batch.
@@ -85,11 +166,11 @@
val entries = lastPositions.entries.sortedBy { it.key }
enqueueTouchEvent(
downTime = downTime,
- eventTime = currentTime,
action = action,
actionIndex = actionIndex,
- coordinates = List(entries.size) { entries[it].value },
- pointerIds = List(entries.size) { entries[it].key }
+ pointerIds = List(entries.size) { entries[it].key },
+ eventTimes = listOf(currentTime),
+ coordinates = List(entries.size) { listOf(entries[it].value) }
)
}
@@ -98,55 +179,153 @@
*/
private fun enqueueTouchEvent(
downTime: Long,
- eventTime: Long,
action: Int,
actionIndex: Int,
- coordinates: List<Offset>,
- pointerIds: List<Int>
+ pointerIds: List<Int>,
+ eventTimes: List<Long>,
+ coordinates: List<List<Offset>>
) {
+ check(coordinates.size == pointerIds.size) {
+ "Coordinates size should equal pointerIds size " +
+ "(was: ${coordinates.size}, ${pointerIds.size})"
+ }
+ repeat(pointerIds.size) { pointerIndex ->
+ check(eventTimes.size == coordinates[pointerIndex].size) {
+ "Historical eventTimes size should equal coordinates[$pointerIndex] size " +
+ "(was: ${eventTimes.size}, ${coordinates[pointerIndex].size})"
+ }
+ }
+
synchronized(batchLock) {
check(acceptEvents) {
"Can't enqueue touch event (" +
"downTime=$downTime, " +
- "eventTime=$eventTime, " +
"action=$action, " +
"actionIndex=$actionIndex, " +
"pointerIds=$pointerIds, " +
+ "eventTimes=$eventTimes, " +
"coordinates=$coordinates" +
"), events have already been (or are being) dispatched or disposed"
}
- val positionInScreen = if (root != null) {
+ val positionInScreen = root?.let {
+ val array = intArrayOf(0, 0)
+ it.view.getLocationOnScreen(array)
+ Offset(array[0].toFloat(), array[1].toFloat())
+ } ?: Offset.Zero
+ val motionEvent = MotionEvent.obtain(
+ /* downTime = */ downTime,
+ /* eventTime = */ eventTimes[0],
+ /* action = */ action + (actionIndex shl ACTION_POINTER_INDEX_SHIFT),
+ /* pointerCount = */ coordinates.size,
+ /* pointerProperties = */ Array(coordinates.size) { pointerIndex ->
+ MotionEvent.PointerProperties().apply {
+ id = pointerIds[pointerIndex]
+ toolType = MotionEvent.TOOL_TYPE_FINGER
+ }
+ },
+ /* pointerCoords = */ Array(coordinates.size) { pointerIndex ->
+ MotionEvent.PointerCoords().apply {
+ x = positionInScreen.x + coordinates[pointerIndex][0].x
+ y = positionInScreen.y + coordinates[pointerIndex][0].y
+ }
+ },
+ /* metaState = */ 0,
+ /* buttonState = */ 0,
+ /* xPrecision = */ 1f,
+ /* yPrecision = */ 1f,
+ /* deviceId = */ 0,
+ /* edgeFlags = */ 0,
+ /* source = */ InputDevice.SOURCE_TOUCHSCREEN,
+ /* flags = */ 0
+ ).apply {
+ // The current time & coordinates are the last element in the lists, and need to
+ // be passed into the final addBatch call. If there are no historical events,
+ // the list sizes are 1 and we don't need to call addBatch at all.
+ for (timeIndex in 1 until eventTimes.size) {
+ addBatch(
+ /* eventTime = */ eventTimes[timeIndex],
+ /* pointerCoords = */ Array(coordinates.size) { pointerIndex ->
+ MotionEvent.PointerCoords().apply {
+ x = positionInScreen.x + coordinates[pointerIndex][timeIndex].x
+ y = positionInScreen.y + coordinates[pointerIndex][timeIndex].y
+ }
+ },
+ /* metaState = */ 0
+ )
+ }
+ offsetLocation(-positionInScreen.x, -positionInScreen.y)
+ }
+
+ batchedEvents.add(motionEvent)
+ }
+ }
+
+ private fun MouseInputState.enqueueMouseEvent(action: Int, delta: Float = 0f, axis: Int = -1) {
+ enqueueMouseEvent(
+ downTime = downTime,
+ eventTime = currentTime,
+ action = action,
+ coordinate = lastPosition,
+ buttonState = pressedButtons.fold(0) { state, buttonId -> state or buttonId },
+ axis = axis,
+ axisDelta = delta
+ )
+ }
+
+ private fun enqueueMouseEvent(
+ downTime: Long,
+ eventTime: Long,
+ action: Int,
+ coordinate: Offset,
+ buttonState: Int,
+ axis: Int = -1,
+ axisDelta: Float = 0f
+ ) {
+ synchronized(batchLock) {
+ check(acceptEvents) {
+ "Can't enqueue mouse event (" +
+ "downTime=$downTime, " +
+ "eventTime=$eventTime, " +
+ "action=$action, " +
+ "coordinate=$coordinate, " +
+ "buttonState=$buttonState, " +
+ "axis=$axis, " +
+ "axisDelta=$axisDelta" +
+ "), events have already been (or are being) dispatched or disposed"
+ }
+ val positionInScreen = root?.let {
val array = intArrayOf(0, 0)
root.view.getLocationOnScreen(array)
Offset(array[0].toFloat(), array[1].toFloat())
- } else {
- Offset.Zero
- }
+ } ?: Offset.Zero
batchedEvents.add(
MotionEvent.obtain(
/* downTime = */ downTime,
/* eventTime = */ eventTime,
- /* action = */ action + (actionIndex shl ACTION_POINTER_INDEX_SHIFT),
- /* pointerCount = */ coordinates.size,
- /* pointerProperties = */ Array(coordinates.size) {
+ /* action = */ action,
+ /* pointerCount = */ 1,
+ /* pointerProperties = */ arrayOf(
MotionEvent.PointerProperties().apply {
- id = pointerIds[it]
- toolType = MotionEvent.TOOL_TYPE_FINGER
+ id = 0
+ toolType = MotionEvent.TOOL_TYPE_MOUSE
}
- },
- /* pointerCoords = */ Array(coordinates.size) {
+ ),
+ /* pointerCoords = */ arrayOf(
MotionEvent.PointerCoords().apply {
- x = positionInScreen.x + coordinates[it].x
- y = positionInScreen.y + coordinates[it].y
+ x = positionInScreen.x + coordinate.x
+ y = positionInScreen.y + coordinate.y
+ if (axis != -1) {
+ setAxisValue(axis, axisDelta)
+ }
}
- },
+ ),
/* metaState = */ 0,
- /* buttonState = */ 0,
+ /* buttonState = */ buttonState,
/* xPrecision = */ 1f,
/* yPrecision = */ 1f,
/* deviceId = */ 0,
/* edgeFlags = */ 0,
- /* source = */ InputDevice.SOURCE_TOUCHSCREEN,
+ /* source = */ InputDevice.SOURCE_MOUSE,
/* flags = */ 0
).apply {
offsetLocation(-positionInScreen.x, -positionInScreen.y)
diff --git a/compose/ui/ui-test/src/androidMain/kotlin/androidx/compose/ui/test/Mouse.android.kt b/compose/ui/ui-test/src/androidMain/kotlin/androidx/compose/ui/test/Mouse.android.kt
new file mode 100644
index 0000000..b5ef22f
--- /dev/null
+++ b/compose/ui/ui-test/src/androidMain/kotlin/androidx/compose/ui/test/Mouse.android.kt
@@ -0,0 +1,43 @@
+// ktlint-disable filename
+
+/*
+ * Copyright 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES 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.compose.ui.test
+
+import android.view.MotionEvent
+
+@Suppress("INLINE_CLASS_DEPRECATED")
+@ExperimentalTestApi
+actual inline class MouseButton(val buttonId: Int) {
+ @ExperimentalTestApi
+ actual companion object {
+ /**
+ * The left mouse button
+ */
+ actual val Primary = MouseButton(MotionEvent.BUTTON_PRIMARY)
+
+ /**
+ * The right mouse button
+ */
+ actual val Secondary = MouseButton(MotionEvent.BUTTON_SECONDARY)
+
+ /**
+ * The middle mouse button
+ */
+ actual val Tertiary = MouseButton(MotionEvent.BUTTON_TERTIARY)
+ }
+}
diff --git a/compose/ui/ui-test/src/commonMain/kotlin/androidx/compose/ui/test/Actions.kt b/compose/ui/ui-test/src/commonMain/kotlin/androidx/compose/ui/test/Actions.kt
index e927bd4..7fcece8 100644
--- a/compose/ui/ui-test/src/commonMain/kotlin/androidx/compose/ui/test/Actions.kt
+++ b/compose/ui/ui-test/src/commonMain/kotlin/androidx/compose/ui/test/Actions.kt
@@ -292,6 +292,61 @@
}
/**
+ * Executes the mouse gesture specified in the given [block]. The gesture doesn't need to be
+ * complete and can be resumed in a later invocation of one of the `perform.*Input` methods. The
+ * event time is initialized to the current time of the [MainTestClock].
+ *
+ * Be aware that if you split a gesture over multiple invocations of `perform.*Input`, everything
+ * that happens in between will run as if the gesture is still ongoing (imagine a mouse button
+ * still being pressed).
+ *
+ * All events that are injected from the [block] are batched together and sent after [block] is
+ * complete. This method blocks while the events are injected. If an error occurs during
+ * execution of [block] or injection of the events, all (subsequent) events are dropped and the
+ * error is thrown here.
+ *
+ * Example usage:
+ * ```
+ * onNodeWithTag("myWidget")
+ * .performMouseInput {
+ * click(center)
+ * }
+ *
+ * onNodeWithTag("myWidget")
+ * // Scroll down while the primary mouse button is down:
+ * .performMouseInput {
+ * down()
+ * repeat(6) {
+ * advanceEventTime()
+ * scroll(-1f)
+ * }
+ * advanceEventTime()
+ * up()
+ * }
+ * ```
+ *
+ * @see MouseInjectionScope
+ */
+@ExperimentalTestApi
+fun SemanticsNodeInteraction.performMouseInput(
+ block: MouseInjectionScope.() -> Unit
+): SemanticsNodeInteraction {
+ val node = fetchSemanticsNode("Failed to inject mouse input.")
+ with(MultiModalInjectionScope(node, testContext)) {
+ try {
+ block.invoke(Mouse)
+ } finally {
+ try {
+ inputDispatcher.sendAllSynchronous()
+ } finally {
+ dispose()
+ }
+ }
+ }
+ return this
+}
+
+/**
* Executes the multi-modal gesture specified in the given [block]. The gesture doesn't need to be
* complete and can be resumed in a later invocation of one of the `perform.*Input` methods. The
* event time is initialized to the current time of the [MainTestClock]. If only a single
diff --git a/compose/ui/ui-test/src/commonMain/kotlin/androidx/compose/ui/test/InputDispatcher.kt b/compose/ui/ui-test/src/commonMain/kotlin/androidx/compose/ui/test/InputDispatcher.kt
index 2b44ae7..9ced828 100644
--- a/compose/ui/ui-test/src/commonMain/kotlin/androidx/compose/ui/test/InputDispatcher.kt
+++ b/compose/ui/ui-test/src/commonMain/kotlin/androidx/compose/ui/test/InputDispatcher.kt
@@ -42,6 +42,15 @@
* * [enqueueTouchUp]
* * [enqueueTouchCancel]
*
+ * Mouse input:
+ * * [currentMousePosition]
+ * * [enqueueMousePress]
+ * * [enqueueMouseMove]
+ * * [updateMousePosition]
+ * * [enqueueMouseRelease]
+ * * [enqueueMouseCancel]
+ * * [enqueueMouseScroll]
+ *
* Chaining methods:
* * [advanceEventTime]
*/
@@ -71,6 +80,12 @@
protected var partialGesture: PartialGesture? = null
/**
+ * The state of the mouse. The mouse state is always available. It starts at [Offset.Zero] in
+ * not-entered state.
+ */
+ protected var mouseInputState: MouseInputState = MouseInputState()
+
+ /**
* Indicates if a gesture is in progress or not. A gesture is in progress if at least one
* finger is (still) touching the screen.
*/
@@ -81,6 +96,7 @@
val state = testContext.states.remove(root)
if (state != null) {
partialGesture = state.partialGesture
+ mouseInputState = state.mouseInputState
}
}
@@ -88,7 +104,8 @@
if (root != null) {
testContext.states[root] =
InputDispatcherState(
- partialGesture
+ partialGesture,
+ mouseInputState
)
}
}
@@ -121,6 +138,12 @@
}
/**
+ * The current position of the mouse. If no mouse event has been sent yet, will be
+ * [Offset.Zero].
+ */
+ val currentMousePosition: Offset get() = mouseInputState.lastPosition
+
+ /**
* Generates a down touch event at [position] for the pointer with the given [pointerId].
* Starts a new touch gesture if no other [pointerId]s are down. Only possible if the
* [pointerId] is not currently being used, although pointer ids may be reused during a touch
@@ -142,6 +165,14 @@
"Cannot send DOWN event, a gesture is already in progress for pointer $pointerId"
}
+ if (mouseInputState.hasAnyButtonPressed) {
+ // If mouse buttons are down, a touch gesture cancels the mouse gesture
+ mouseInputState.enqueueCancel()
+ } else if (mouseInputState.isEntered) {
+ // If no mouse buttons were down, we may have been in hovered state
+ mouseInputState.exitHover()
+ }
+
// Send a MOVE event if pointers have changed since the last event
gesture?.flushPointerUpdates()
@@ -166,6 +197,7 @@
* @see updateTouchPointer
* @see enqueueTouchUp
* @see enqueueTouchCancel
+ * @see enqueueTouchMoves
*/
fun enqueueTouchMove() {
val gesture = checkNotNull(partialGesture) {
@@ -176,6 +208,25 @@
}
/**
+ * Enqueue the current time+coordinates as a move event, with the historical parameters
+ * preceding it (so that they are ultimately available from methods like
+ * MotionEvent.getHistoricalX).
+ *
+ * @see enqueueTouchMove
+ * @see TouchInjectionScope.moveWithHistory
+ */
+ fun enqueueTouchMoves(
+ relativeHistoricalTimes: List<Long>,
+ historicalCoordinates: List<List<Offset>>
+ ) {
+ val gesture = checkNotNull(partialGesture) {
+ "Cannot send MOVE event, no gesture is in progress"
+ }
+ gesture.enqueueMoves(relativeHistoricalTimes, historicalCoordinates)
+ gesture.hasPointerUpdates = false
+ }
+
+ /**
* Updates the position of the touch pointer with the given [pointerId] to the given
* [position], but does not generate a move touch event. Use this to move multiple pointers
* simultaneously. To generate the next move touch event, which will contain the current
@@ -239,7 +290,8 @@
}
/**
- * Generates a cancel touch event for the current touch gesture.
+ * Generates a cancel touch event for the current touch gesture. Sent automatically when
+ * mouse events are sent while a touch gesture is in progress.
*
* @see enqueueTouchDown
* @see updateTouchPointer
@@ -265,6 +317,175 @@
}
/**
+ * Generates a mouse button pressed event for the given [buttonId]. This will generate all
+ * required associated events as well, such as a down event if it is the first button being
+ * pressed and an optional hover exit event.
+ *
+ * @param buttonId The id of the mouse button. This is platform dependent, use the values
+ * defined by [MouseButton.buttonId].
+ */
+ fun enqueueMousePress(buttonId: Int) {
+ val mouse = mouseInputState
+
+ check(!mouse.isButtonPressed(buttonId)) {
+ "Cannot send mouse button down event, button $buttonId is already pressed"
+ }
+ if (partialGesture != null) {
+ enqueueTouchCancel()
+ }
+
+ val nothingWasPressed = mouse.hasNoButtonsPressed
+ mouse.setButtonBit(buttonId)
+
+ // Down time is when the _first_ button was pressed
+ if (nothingWasPressed) {
+ mouse.downTime = currentTime
+ }
+ // Exit hovering if necessary
+ if (mouse.isEntered) {
+ mouse.exitHover()
+ }
+ // down/move + press
+ mouse.enqueuePress(buttonId)
+ }
+
+ /**
+ * Generates a mouse move or hover event to the given [position]. If buttons are pressed, a
+ * move event is generated, otherwise generates a hover event.
+ *
+ * @param position The new mouse position
+ */
+ fun enqueueMouseMove(position: Offset) {
+ val mouse = mouseInputState
+
+ // TODO(fresen): synthesize ENTER and EXIT events
+ // when the mouse enters/exits the Compose host.
+
+ if (partialGesture != null) {
+ enqueueTouchCancel()
+ }
+ updateMousePosition(position)
+ // If not yet hovering and no buttons pressed, enter hover state
+ if (!mouse.isEntered && mouse.hasNoButtonsPressed) {
+ mouse.enterHover()
+ }
+ mouse.enqueueMove()
+ }
+
+ /**
+ * Updates the mouse position without sending an event. Useful if down, up or scroll events
+ * need to be injected on a different location than the preceding move event.
+ *
+ * @param position The new mouse position
+ */
+ fun updateMousePosition(position: Offset) {
+ mouseInputState.lastPosition = position
+ // Contrary to touch input, we don't need to store that the position has changed, because
+ // all events that are affected send the current position regardless.
+ }
+
+ /**
+ * Generates a mouse button released event for the given [buttonId]. This will generate all
+ * required associated events as well, such as an up and hover enter event if it is the last
+ * button being released.
+ *
+ * @param buttonId The id of the mouse button. This is platform dependent, use the values
+ * defined by [MouseButton.buttonId].
+ */
+ fun enqueueMouseRelease(buttonId: Int) {
+ val mouse = mouseInputState
+
+ check(mouse.isButtonPressed(buttonId)) {
+ "Cannot send mouse button up event, button $buttonId is not pressed"
+ }
+ check(partialGesture == null) {
+ "Touch gesture can't be in progress, mouse buttons are down"
+ }
+
+ mouse.unsetButtonBit(buttonId)
+ mouse.enqueueRelease(buttonId)
+
+ // When no buttons remaining, enter hover state immediately
+ if (mouse.hasNoButtonsPressed) {
+ mouse.enterHover()
+ mouse.enqueueMove()
+ }
+ }
+
+ /**
+ * Generates a mouse hover enter event on the given [position].
+ *
+ * @param position The new mouse position
+ */
+ fun enqueueMouseEnter(position: Offset) {
+ val mouse = mouseInputState
+
+ check(!mouse.isEntered) {
+ "Cannot send mouse hover enter event, mouse is already hovering"
+ }
+ check(mouse.hasNoButtonsPressed) {
+ "Cannot send mouse hover enter event, mouse buttons are down"
+ }
+
+ updateMousePosition(position)
+ mouse.enterHover()
+ }
+
+ /**
+ * Generates a mouse hover exit event on the given [position].
+ *
+ * @param position The new mouse position
+ */
+ fun enqueueMouseExit(position: Offset) {
+ val mouse = mouseInputState
+
+ check(mouse.isEntered) {
+ "Cannot send mouse hover exit event, mouse is not hovering"
+ }
+
+ updateMousePosition(position)
+ mouse.exitHover()
+ }
+
+ /**
+ * Generates a mouse cancel event. Can only be done if no mouse buttons are currently
+ * pressed. Sent automatically if a touch event is sent while mouse buttons are down.
+ */
+ fun enqueueMouseCancel() {
+ val mouse = mouseInputState
+ check(mouse.hasAnyButtonPressed) {
+ "Cannot send mouse cancel event, no mouse buttons are pressed"
+ }
+ mouse.clearButtonState()
+ mouse.enqueueCancel()
+ }
+
+ /**
+ * Generates a scroll event on [scrollWheel] by [delta]. Negative values correspond to
+ * rotating the scroll wheel leftward or downward, positive values correspond to rotating the
+ * scroll wheel rightward or upward.
+ */
+ // TODO(fresen): verify the sign of the horizontal scroll axis (is left negative or positive?)
+ @OptIn(ExperimentalTestApi::class)
+ fun enqueueMouseScroll(delta: Float, scrollWheel: ScrollWheel) {
+ val mouse = mouseInputState
+
+ // A scroll is always preceded by a move(/hover) event
+ enqueueMouseMove(mouse.lastPosition)
+ mouse.enqueueScroll(delta, scrollWheel)
+ }
+
+ private fun MouseInputState.enterHover() {
+ enqueueEnter()
+ isEntered = true
+ }
+
+ private fun MouseInputState.exitHover() {
+ enqueueExit()
+ isEntered = false
+ }
+
+ /**
* Sends all enqueued events and blocks while they are dispatched. If an exception is
* thrown during the process, all events that haven't yet been dispatched will be dropped.
*/
@@ -274,10 +495,30 @@
protected abstract fun PartialGesture.enqueueMove()
+ protected abstract fun PartialGesture.enqueueMoves(
+ relativeHistoricalTimes: List<Long>,
+ historicalCoordinates: List<List<Offset>>
+ )
+
protected abstract fun PartialGesture.enqueueUp(pointerId: Int)
protected abstract fun PartialGesture.enqueueCancel()
+ protected abstract fun MouseInputState.enqueuePress(buttonId: Int)
+
+ protected abstract fun MouseInputState.enqueueMove()
+
+ protected abstract fun MouseInputState.enqueueRelease(buttonId: Int)
+
+ protected abstract fun MouseInputState.enqueueEnter()
+
+ protected abstract fun MouseInputState.enqueueExit()
+
+ protected abstract fun MouseInputState.enqueueCancel()
+
+ @OptIn(ExperimentalTestApi::class)
+ protected abstract fun MouseInputState.enqueueScroll(delta: Float, scrollWheel: ScrollWheel)
+
/**
* Called when this [InputDispatcher] is about to be discarded, from
* [MultiModalInjectionScope.dispose].
@@ -308,12 +549,46 @@
}
/**
+ * The current mouse state. Contains the current mouse position, which buttons are pressed, if it
+ * is hovering over the current node and the down time of the mouse (which is the time of the
+ * last mouse down event).
+ */
+internal class MouseInputState {
+ var downTime: Long = 0
+ val pressedButtons: MutableSet<Int> = mutableSetOf()
+ var lastPosition: Offset = Offset.Zero
+ var isEntered: Boolean = false
+
+ val hasAnyButtonPressed get() = pressedButtons.isNotEmpty()
+ val hasOneButtonPressed get() = pressedButtons.size == 1
+ val hasNoButtonsPressed get() = pressedButtons.isEmpty()
+
+ fun isButtonPressed(buttonId: Int): Boolean {
+ return pressedButtons.contains(buttonId)
+ }
+
+ fun setButtonBit(buttonId: Int) {
+ pressedButtons.add(buttonId)
+ }
+
+ fun unsetButtonBit(buttonId: Int) {
+ pressedButtons.remove(buttonId)
+ }
+
+ fun clearButtonState() {
+ pressedButtons.clear()
+ }
+}
+
+/**
* The state of an [InputDispatcher], saved when the [GestureScope] is disposed and restored
* when the [GestureScope] is recreated.
*
* @param partialGesture The state of an incomplete gesture. If no gesture was in progress
* when the state of the [InputDispatcher] was saved, this will be `null`.
+ * @param mouseInputState The state of the mouse.
*/
internal data class InputDispatcherState(
- val partialGesture: PartialGesture?
+ val partialGesture: PartialGesture?,
+ val mouseInputState: MouseInputState,
)
diff --git a/compose/ui/ui-test/src/commonMain/kotlin/androidx/compose/ui/test/Mouse.kt b/compose/ui/ui-test/src/commonMain/kotlin/androidx/compose/ui/test/Mouse.kt
new file mode 100644
index 0000000..b7e2dec
--- /dev/null
+++ b/compose/ui/ui-test/src/commonMain/kotlin/androidx/compose/ui/test/Mouse.kt
@@ -0,0 +1,57 @@
+/*
+ * Copyright 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES 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.compose.ui.test
+
+/**
+ * Representation of a mouse scroll wheel axis. Only [Horizontal] and [Vertical] are supported.
+ * All methods that accept a scroll axis use [Vertical] as the default, since most mice only have
+ * a vertical scroll wheel.
+ */
+@Suppress("INLINE_CLASS_DEPRECATED")
+@ExperimentalTestApi
+inline class ScrollWheel private constructor(val value: Int) {
+ @ExperimentalTestApi
+ companion object {
+ val Horizontal = ScrollWheel(0)
+ val Vertical = ScrollWheel(1)
+ }
+}
+
+/**
+ * Representation of a mouse button with its associated [ID][buttonId] for the current platform.
+ */
+@Suppress("INLINE_CLASS_DEPRECATED")
+@ExperimentalTestApi
+expect inline class MouseButton(val buttonId: Int) {
+ @ExperimentalTestApi
+ companion object {
+ /**
+ * The primary mouse button. Typically the left mouse button.
+ */
+ val Primary: MouseButton
+
+ /**
+ * The secondary mouse button. Typically the right mouse button.
+ */
+ val Secondary: MouseButton
+
+ /**
+ * The tertiary mouse button. Typically the middle mouse button.
+ */
+ val Tertiary: MouseButton
+ }
+}
diff --git a/compose/ui/ui-test/src/commonMain/kotlin/androidx/compose/ui/test/MouseInjectionScope.kt b/compose/ui/ui-test/src/commonMain/kotlin/androidx/compose/ui/test/MouseInjectionScope.kt
new file mode 100644
index 0000000..d64a6dd
--- /dev/null
+++ b/compose/ui/ui-test/src/commonMain/kotlin/androidx/compose/ui/test/MouseInjectionScope.kt
@@ -0,0 +1,488 @@
+/*
+ * Copyright 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES 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.compose.ui.test
+
+import androidx.compose.ui.geometry.Offset
+import androidx.compose.ui.geometry.isSpecified
+import androidx.compose.ui.geometry.lerp
+import androidx.compose.ui.util.lerp
+import kotlin.math.max
+import kotlin.math.roundToInt
+
+// TODO(fresen): Remove constants after b/179281066
+
+/**
+ * The time between the button pressed and button released event in a mouse click. Determined by
+ * empirical sampling.
+ */
+private const val SingleClickDelayMillis = 60L
+
+/**
+ * The time between the last event of the first click and the first event of the second click in
+ * a double click gesture. Copied from double tap delay.
+ */
+private const val DoubleClickDelayMillis = 145L
+
+/**
+ * The time before a long press gesture attempts to win. Copied from the equivalent in touch
+ * input.
+ */
+// TODO(fresen): Verify value after mouse input is added to Compose, it may be different for mouse.
+private const val LongPressTimeoutMillis: Long = 500L
+
+/**
+ * The default duration of mouse gestures with configurable time (e.g. [animateTo]).
+ */
+private const val DefaultMouseGestureDurationMillis: Long = 300L
+
+/**
+ * The receiver scope of the mouse input injection lambda from [performMouseInput].
+ *
+ * The functions in [MouseInjectionScope] can roughly be divided into two groups: full gestures
+ * and individual mouse events. The individual mouse events are: [press], [moveTo] and friends,
+ * [release], [cancel], [scroll] and [advanceEventTime]. Full gestures are all the other
+ * functions, like [MouseInjectionScope.click], [MouseInjectionScope.doubleClick],
+ * [MouseInjectionScope.animateTo], etc. These are built on top of the individual events and
+ * serve as a good example on how you can build your own full gesture functions.
+ *
+ * A mouse move event can be sent with [moveTo] and [moveBy]. The mouse position can be updated
+ * with [updatePointerTo] and [updatePointerBy], which will not send an event and only update the
+ * position internally. This can be useful if you want to send an event that is not a move event
+ * with a location other then the current location, but without sending a preceding move event.
+ * Use [press] and [release] to send button pressed and button released events. This will also
+ * send all other necessary events that keep the stream of mouse events consistent with actual
+ * mouse input, such as a hover exit event. A [cancel] event can be sent at any time when at
+ * least one button is pressed. Use [scroll] to send a mouse scroll event.
+ *
+ * The entire event injection state is shared between all `perform.*Input` methods, meaning you
+ * can continue an unfinished mouse gesture in a subsequent invocation of [performMouseInput] or
+ * [performMultiModalInput]. Note however that while the mouse's position is retained across
+ * invocation of `perform.*Input` methods, it is always manipulated in the current node's local
+ * coordinate system. That means that two subsequent invocations of [performMouseInput] on
+ * different nodes will report a different [currentPosition], even though it is actually the same
+ * position on the screen.
+ *
+ * All events sent by these methods are batched together and sent as a whole after
+ * [performMouseInput] has executed its code block.
+ *
+ * Example usage:
+ * ```
+ * onNodeWithTag("myWidget")
+ * .performMouseInput {
+ * click(center)
+ * }
+ *
+ * onNodeWithTag("myWidget")
+ * // Scroll down while the primary mouse button is down:
+ * .performMouseInput {
+ * down()
+ * repeat(6) {
+ * advanceEventTime()
+ * scroll(-1f)
+ * }
+ * advanceEventTime()
+ * up()
+ * }
+ * ```
+ *
+ * @see InjectionScope
+ */
+@Suppress("NotCloseable")
+@ExperimentalTestApi
+interface MouseInjectionScope : InjectionScope {
+ /**
+ * Returns the current position of the mouse. The position is returned in the local
+ * coordinate system of the node with which we're interacting. (0, 0) is the top left corner
+ * of the node. If none of the move or updatePointer methods have been used yet, the mouse's
+ * position will be (0, 0) in the Compose host's coordinate system, which will be
+ * `-[topLeft]` in the node's local coordinate system.
+ */
+ val currentPosition: Offset
+
+ /**
+ * Sends a move event [delayMillis] after the last sent event on the associated node, with
+ * the position of the mouse updated to [position]. The [position] is in the node's local
+ * coordinate system, where (0, 0) is the top left corner of the node.
+ *
+ * If no mouse buttons are pressed, a hover event will be sent instead of a move event. If
+ * the mouse wasn't hovering yet, a hover enter event is sent as well.
+ *
+ * @param position The new position of the mouse, in the node's local coordinate system
+ * @param delayMillis The time between the last sent event and this event.
+ * [eventPeriodMillis] by default.
+ */
+ fun moveTo(position: Offset, delayMillis: Long = eventPeriodMillis)
+
+ /**
+ * Sends a move event [delayMillis] after the last sent event on the associated node, with
+ * the position of the mouse moved by the given [delta].
+ *
+ * If no mouse buttons are pressed, a hover event will be sent instead of a move event. If
+ * the mouse wasn't hovering yet, a hover enter event is sent as well.
+ *
+ * @param delta The position for this move event, relative to the current position of the
+ * mouse. For example, `delta = Offset(10.px, -10.px) will add 10.px to the mouse's
+ * x-position, and subtract 10.px from the mouse's y-position.
+ * @param delayMillis The time between the last sent event and this event.
+ * [eventPeriodMillis] by default.
+ */
+ fun moveBy(delta: Offset, delayMillis: Long = eventPeriodMillis) {
+ moveTo(currentPosition + delta, delayMillis)
+ }
+
+ /**
+ * Updates the position of the mouse to the given [position], but does not send a move or
+ * hover event. This can be useful to adjust the mouse position before sending for example a
+ * [press] event. The [position] is in the node's local coordinate system, where (0.px, 0.px)
+ * is the top left corner of the node.
+ *
+ * @param position The new position of the mouse, in the node's local coordinate system
+ */
+ fun updatePointerTo(position: Offset)
+
+ /**
+ * Updates the position of the mouse by the given [delta], but does not send a move or hover
+ * event. This can be useful to adjust the mouse position before sending for example a
+ * [press] event.
+ *
+ * @param delta The position for this move event, relative to the current position of the
+ * mouse. For example, `delta = Offset(10.px, -10.px) will add 10.px to the mouse's
+ * x-position, and subtract 10.px from the mouse's y-position.
+ */
+ fun updatePointerBy(delta: Offset) {
+ updatePointerTo(currentPosition + delta)
+ }
+
+ /**
+ * Sends a down and button pressed event for the given [button] on the associated node. When
+ * no buttons were down yet, this will exit hovering mode before the button is pressed. All
+ * events will be sent at the current event time.
+ *
+ * Throws an [IllegalStateException] if the [button] is already pressed.
+ *
+ * @param button The mouse button that is pressed. By default the primary mouse button.
+ */
+ fun press(button: MouseButton = MouseButton.Primary)
+
+ /**
+ * Sends a button released and up event for the given [button] on the associated node. If
+ * this was the last button to be released, the mouse will enter hovering mode and send an
+ * accompanying mouse move event after the button has been released. All events will be sent
+ * at the current event time.
+ *
+ * Throws an [IllegalStateException] if the [button] is not pressed.
+ *
+ * @param button The mouse button that is released. By default the primary mouse button.
+ */
+ fun release(button: MouseButton = MouseButton.Primary)
+
+ /**
+ * Sends a cancel event [delayMillis] after the last sent event to cancel a stream of mouse
+ * events with pressed mouse buttons. All buttons will be released as a result. A mouse
+ * cancel event can only be sent when mouse buttons are pressed.
+ *
+ * @param delayMillis The time between the last sent event and this event.
+ * [eventPeriodMillis] by default.
+ */
+ fun cancel(delayMillis: Long = eventPeriodMillis)
+
+ /**
+ * Sends a hover enter event at the given [position], [delayMillis] after the last sent event.
+ *
+ * Note that it is discouraged to manually send a hover enter event followed by a [moveTo]
+ * event. [moveTo] does this for you automatically, making sure the event times of the two
+ * events are in sync. Only use this method for special scenarios where the hover enter event
+ * is not sent as a side effect of another event.
+ *
+ * An [IllegalStateException] will be thrown when mouse buttons are down, or if the mouse is
+ * already hovering.
+ *
+ * The [position] is in the node's local coordinate system, where (0, 0) is the top left
+ * corner of the node.
+ *
+ * @param position The new position of the mouse, in the node's local coordinate system.
+ * [currentPosition] by default.
+ * @param delayMillis The time between the last sent event and this event.
+ * [eventPeriodMillis] by default.
+ */
+ fun enter(position: Offset = currentPosition, delayMillis: Long = eventPeriodMillis)
+
+ /**
+ * Sends a hover exit event at the given [position], [delayMillis] after the last sent event.
+ *
+ * Note that it is discouraged to manually send a hover exit event followed by a [moveTo]
+ * that is outside the boundaries of the Compose root or [press]ing a button. These methods
+ * do this for you automatically, making sure the event times of the two events are in sync.
+ * Only use this method for special scenarios where the hover exit event is not sent as a
+ * side effect of another event.
+ *
+ * An [IllegalStateException] will be thrown if the mouse was not hovering.
+ *
+ * The [position] is in the node's local coordinate system, where (0, 0) is the top left
+ * corner of the node.
+ *
+ * @param position The new position of the mouse, in the node's local coordinate system
+ * [currentPosition] by default.
+ * @param delayMillis The time between the last sent event and this event.
+ * [eventPeriodMillis] by default.
+ */
+ fun exit(position: Offset = currentPosition, delayMillis: Long = eventPeriodMillis)
+
+ /**
+ * Sends a scroll event with the given [delta] on the given [scrollWheel]. The event will be
+ * sent at the current event time. Negative [delta] values correspond to rotating the scroll
+ * wheel leftward or downward, positive values correspond to rotating the scroll wheel
+ * rightward or upward.
+ *
+ * @param delta The amount of scroll
+ * @param scrollWheel Which scroll wheel to rotate. Can be either [ScrollWheel.Vertical] (the
+ * default) or [ScrollWheel.Horizontal].
+ */
+ fun scroll(delta: Float, scrollWheel: ScrollWheel = ScrollWheel.Vertical)
+}
+
+/**
+ * Click on [position], or on the current mouse position if [position] is
+ * [unspecified][Offset.Unspecified]. The [position] is in the node's local coordinate system,
+ * where (0, 0) is the top left corner of the node.
+ *
+ * @param position The position where to click, in the node's local coordinate system. If
+ * omitted, the [center] of the node will be used. If [unspecified][Offset.Unspecified], clicks
+ * on the current mouse position.
+ */
+@ExperimentalTestApi
+fun MouseInjectionScope.click(position: Offset = center) {
+ if (position.isSpecified) {
+ updatePointerTo(position)
+ }
+ press(MouseButton.Primary)
+ advanceEventTime(SingleClickDelayMillis)
+ release(MouseButton.Primary)
+}
+
+/**
+ * Secondary-click on [position], or on the current mouse position if [position] is
+ * [unspecified][Offset.Unspecified]. While the secondary mouse button is not necessarily the
+ * right mouse button (e.g. on left-handed mice), this method is still called `rightClick` for
+ * it's widespread use. The [position] is in the node's local coordinate system, where (0, 0) is
+ * the top left corner of the node.
+ *
+ * @param position The position where to click, in the node's local coordinate system. If
+ * omitted, the [center] of the node will be used. If [unspecified][Offset.Unspecified], clicks
+ * on the current mouse position.
+ */
+@ExperimentalTestApi
+fun MouseInjectionScope.rightClick(position: Offset = center) {
+ if (position.isSpecified) {
+ updatePointerTo(position)
+ }
+ press(MouseButton.Secondary)
+ advanceEventTime(SingleClickDelayMillis)
+ release(MouseButton.Secondary)
+}
+
+/**
+ * Double-click on [position], or on the current mouse position if [position] is
+ * [unspecified][Offset.Unspecified]. The [position] is in the node's local coordinate system,
+ * where (0, 0) is the top left corner of the node.
+ *
+ * @param position The position where to click, in the node's local coordinate system. If
+ * omitted, the [center] of the node will be used. If [unspecified][Offset.Unspecified], clicks
+ * on the current mouse position.
+ */
+@ExperimentalTestApi
+fun MouseInjectionScope.doubleClick(position: Offset = center) {
+ click(position)
+ advanceEventTime(DoubleClickDelayMillis)
+ click(position)
+}
+
+/**
+ * Triple-click on [position], or on the current mouse position if [position] is
+ * [unspecified][Offset.Unspecified]. The [position] is in the node's local coordinate system,
+ * where (0, 0) is the top left corner of the node.
+ *
+ * @param position The position where to click, in the node's local coordinate system. If
+ * omitted, the [center] of the node will be used. If [unspecified][Offset.Unspecified], clicks
+ * on the current mouse position.
+ */
+@ExperimentalTestApi
+fun MouseInjectionScope.tripleClick(position: Offset = center) {
+ click(position)
+ advanceEventTime(DoubleClickDelayMillis)
+ click(position)
+ advanceEventTime(DoubleClickDelayMillis)
+ click(position)
+}
+
+/**
+ * Long-click on [position], or on the current mouse position if [position] is
+ * [unspecified][Offset.Unspecified]. The [position] is in the node's local coordinate system,
+ * where (0, 0) is the top left corner of the node.
+ *
+ * @param position The position where to click, in the node's local coordinate system. If
+ * omitted, the [center] of the node will be used. If [unspecified][Offset.Unspecified], clicks
+ * on the current mouse position.
+ */
+@ExperimentalTestApi
+fun MouseInjectionScope.longClick(position: Offset = center) {
+ if (position.isSpecified) {
+ updatePointerTo(position)
+ }
+ press(MouseButton.Primary)
+ advanceEventTime(LongPressTimeoutMillis + 100L)
+ release(MouseButton.Primary)
+}
+
+/**
+ * Move the mouse from the [current position][MouseInjectionScope.currentPosition] to the given
+ * [position], sending a stream of move events to get an animated path of [durationMillis]
+ * milliseconds. [Move][moveTo] the mouse to the desired start position if you want to start from
+ * a different position. The [position] is in the node's local coordinate system, where (0, 0) is
+ * the top left corner of the node.
+ *
+ * @param position The position where to move the mouse to, in the node's local coordinate system
+ * @param durationMillis The duration of the gesture. By default 300 milliseconds.
+ */
+@ExperimentalTestApi
+fun MouseInjectionScope.animateTo(
+ position: Offset,
+ durationMillis: Long = DefaultMouseGestureDurationMillis
+) {
+ val durationFloat = durationMillis.toFloat()
+ val start = currentPosition
+ animateAlong(
+ curve = { lerp(start, position, it / durationFloat) },
+ durationMillis = durationMillis
+ )
+}
+
+/**
+ * Move the mouse from the [current position][MouseInjectionScope.currentPosition] by the given
+ * [delta], sending a stream of move events to get an animated path of [durationMillis]
+ * milliseconds.
+ *
+ * @param delta The position where to move the mouse to, relative to the current position of the
+ * mouse. For example, `delta = Offset(100.px, -100.px) will move the mouse 100 pixels to the
+ * right and 100 pixels upwards.
+ * @param durationMillis The duration of the gesture. By default 300 milliseconds.
+ */
+@ExperimentalTestApi
+fun MouseInjectionScope.animateBy(
+ delta: Offset,
+ durationMillis: Long = DefaultMouseGestureDurationMillis
+) {
+ animateTo(currentPosition + delta, durationMillis)
+}
+
+/**
+ * Move the mouse along the given [curve], sending a stream of move events to get an animated
+ * path of [durationMillis] milliseconds. The mouse will initially be moved to the start of the
+ * path, `curve(0)`, if it is not already there. The positions defined by the [curve] are in the
+ * node's local coordinate system, where (0, 0) is the top left corner of the node.
+ *
+ * @param curve The function that defines the position of the mouse over time for this gesture,
+ * in the node's local coordinate system.
+ * @param durationMillis The duration of the gesture. By default 300 milliseconds.
+ */
+@ExperimentalTestApi
+fun MouseInjectionScope.animateAlong(
+ curve: (Long) -> Offset,
+ durationMillis: Long = DefaultMouseGestureDurationMillis
+) {
+ require(durationMillis > 0) {
+ "Duration is 0"
+ }
+ val start = curve(0)
+ if (start != currentPosition) {
+ // Instantly move to the start position to maintain the total durationMillis
+ moveTo(curve(0), delayMillis = 0)
+ }
+
+ var step = 0
+ // How many steps will we take in durationMillis?
+ // At least 1, and a number that will bring as as close to eventPeriod as possible
+ val steps = max(1, (durationMillis / eventPeriodMillis.toFloat()).roundToInt())
+
+ var tPrev = 0L
+ while (step++ < steps) {
+ val progress = step / steps.toFloat()
+ val t = lerp(0, durationMillis, progress)
+ moveTo(curve(t), delayMillis = t - tPrev)
+ tPrev = t
+ }
+}
+
+/**
+ * Drag and drop something from [start] to [end] in [durationMillis] milliseconds. This gesture
+ * uses the primary mouse button to drag with, and does not reset any mouse buttons prior to
+ * starting the gesture. The mouse position is [updated][MouseInjectionScope.updatePointerTo] to
+ * the start position before starting the gesture. The positions defined by the [start] and [end]
+ * are in the node's local coordinate system, where (0, 0) is the top left corner of the node.
+ *
+ * @param start The position where to press the primary mouse button and initiate the drag, in
+ * the node's local coordinate system.
+ * @param end The position where to release the primary mouse button and end the drag, in the
+ * node's local coordinate system.
+ * @param durationMillis The duration of the gesture. By default 300 milliseconds.
+ */
+@ExperimentalTestApi
+fun MouseInjectionScope.dragAndDrop(
+ start: Offset,
+ end: Offset,
+ durationMillis: Long = DefaultMouseGestureDurationMillis
+) {
+ updatePointerTo(start)
+ press(MouseButton.Primary)
+ animateTo(end, durationMillis)
+ release(MouseButton.Primary)
+}
+
+/**
+ * Rotate the mouse's [scrollWheel] by the given [scrollAmount]. The total scroll delta is
+ * linearly smoothed out over a stream of scroll events with roughly the
+ * [InjectionScope.eventPeriodMillis] between each scroll event. Negative [scrollAmount] values
+ * correspond to rotating the scroll wheel leftward or downward, positive values correspond to
+ * rotating the scroll wheel rightward or upward.
+ *
+ * @param scrollAmount The total delta to scroll the [scrollWheel] by
+ * @param durationMillis The duration of the gesture. By default 300 milliseconds.
+ * @param scrollWheel Which scroll wheel will be rotated. By default [ScrollWheel.Vertical].
+ */
+@ExperimentalTestApi
+fun MouseInjectionScope.smoothScroll(
+ scrollAmount: Float,
+ durationMillis: Long = DefaultMouseGestureDurationMillis,
+ scrollWheel: ScrollWheel = ScrollWheel.Vertical
+) {
+ var step = 0
+ // How many steps will we take in durationMillis?
+ // At least 1, and a number that will bring as as close to eventPeriod as possible
+ val steps = max(1, (durationMillis / eventPeriodMillis.toFloat()).roundToInt())
+
+ var tPrev = 0L
+ var valuePrev = 0f
+ while (step++ < steps) {
+ val progress = step / steps.toFloat()
+ val t = lerp(0, durationMillis, progress)
+ val value = lerp(0f, scrollAmount, progress)
+ advanceEventTime(t - tPrev)
+ scroll(value - valuePrev, scrollWheel)
+ tPrev = t
+ valuePrev = value
+ }
+}
diff --git a/compose/ui/ui-test/src/commonMain/kotlin/androidx/compose/ui/test/MultiModalInjectionScope.kt b/compose/ui/ui-test/src/commonMain/kotlin/androidx/compose/ui/test/MultiModalInjectionScope.kt
index 382f3e0..a70a99b 100644
--- a/compose/ui/ui-test/src/commonMain/kotlin/androidx/compose/ui/test/MultiModalInjectionScope.kt
+++ b/compose/ui/ui-test/src/commonMain/kotlin/androidx/compose/ui/test/MultiModalInjectionScope.kt
@@ -29,8 +29,8 @@
* as the frame of reference for the event's positions. How the event is injected exactly is
* platform dependent.
*
- * The functions in [MultiModalInjectionScope] are divided by modality: currently, we only have a
- * [Touch] scope. See its docs for more information.
+ * The functions in [MultiModalInjectionScope] are divided by modality: currently, we have a
+ * [Touch] scope and a [Mouse] scope. See their respective docs for more information.
*
* Note that all events generated by the gesture methods are batched together and sent as a whole
* after [performMultiModalInput] has executed its code block.
@@ -40,12 +40,16 @@
* onNodeWithTag("myWidget")
* .performMultiModalInput {
* Touch.click(center)
+ * advanceEventTime(500)
+ * @OptIn(ExperimentalTestApi::class)
+ * Mouse.dragAndDrop(topLeft, bottomRight)
* }
* ```
*
* @see InjectionScope
* @see TouchInjectionScope
*/
+// TODO(fresen): add better multi modal example when we have keyboard support
class MultiModalInjectionScope(node: SemanticsNode, testContext: TestContext) : InjectionScope {
// TODO(b/133217292): Better error: explain which gesture couldn't be performed
private var _semanticsNode: SemanticsNode? = node
@@ -93,7 +97,8 @@
/**
* Adds the given [durationMillis] to the current event time, delaying the next event by that
- * time. Only valid when a gesture has already been started, or when a finished gesture is resumed.
+ * time. Only valid when a gesture has already been started, or when a finished gesture is
+ * resumed.
*/
override fun advanceEventTime(durationMillis: Long) {
inputDispatcher.advanceEventTime(durationMillis)
@@ -105,20 +110,23 @@
_inputDispatcher = null
}
+ /**
+ * The receiver scope for touch input injection. See [TouchInjectionScope].
+ */
val Touch: TouchInjectionScope = object : TouchInjectionScope, InjectionScope by this {
override fun currentPosition(pointerId: Int): Offset? {
- val globalPosition = inputDispatcher.getCurrentTouchPosition(pointerId) ?: return null
- return rootToLocal(globalPosition)
+ val positionInRoot = inputDispatcher.getCurrentTouchPosition(pointerId) ?: return null
+ return rootToLocal(positionInRoot)
}
override fun down(pointerId: Int, position: Offset) {
- val globalPosition = localToRoot(position)
- inputDispatcher.enqueueTouchDown(pointerId, globalPosition)
+ val positionInRoot = localToRoot(position)
+ inputDispatcher.enqueueTouchDown(pointerId, positionInRoot)
}
override fun updatePointerTo(pointerId: Int, position: Offset) {
- val globalPosition = localToRoot(position)
- inputDispatcher.updateTouchPointer(pointerId, globalPosition)
+ val positionInRoot = localToRoot(position)
+ inputDispatcher.updateTouchPointer(pointerId, positionInRoot)
}
override fun move(delayMillis: Long) {
@@ -126,6 +134,27 @@
inputDispatcher.enqueueTouchMove()
}
+ @ExperimentalTestApi
+ override fun moveWithHistoryMultiPointer(
+ relativeHistoricalTimes: List<Long>,
+ historicalCoordinates: List<List<Offset>>,
+ delayMillis: Long
+ ) {
+ repeat(relativeHistoricalTimes.size) {
+ check(relativeHistoricalTimes[it] < 0) {
+ "Relative historical times should be negative, in order to be in the past" +
+ "(offset $it was: ${relativeHistoricalTimes[it]})"
+ }
+ check(relativeHistoricalTimes[it] >= -delayMillis) {
+ "Relative historical times should not be earlier than the previous event " +
+ "(offset $it was: ${relativeHistoricalTimes[it]}, ${-delayMillis})"
+ }
+ }
+
+ advanceEventTime(delayMillis)
+ inputDispatcher.enqueueTouchMoves(relativeHistoricalTimes, historicalCoordinates)
+ }
+
override fun up(pointerId: Int) {
inputDispatcher.enqueueTouchUp(pointerId)
}
@@ -135,4 +164,55 @@
inputDispatcher.enqueueTouchCancel()
}
}
+
+ /**
+ * The receiver scope for mouse input injection. See [MouseInjectionScope].
+ */
+ @Suppress("EXPERIMENTAL_ANNOTATION_ON_WRONG_TARGET")
+ @get:ExperimentalTestApi // Required to annotate Java-facing APIs
+ @ExperimentalTestApi
+ val Mouse: MouseInjectionScope = object : MouseInjectionScope, InjectionScope by this {
+ override val currentPosition: Offset
+ get() = rootToLocal(inputDispatcher.currentMousePosition)
+
+ override fun moveTo(position: Offset, delayMillis: Long) {
+ advanceEventTime(delayMillis)
+ val positionInRoot = localToRoot(position)
+ inputDispatcher.enqueueMouseMove(positionInRoot)
+ }
+
+ override fun updatePointerTo(position: Offset) {
+ val positionInRoot = localToRoot(position)
+ inputDispatcher.updateMousePosition(positionInRoot)
+ }
+
+ override fun press(button: MouseButton) {
+ inputDispatcher.enqueueMousePress(button.buttonId)
+ }
+
+ override fun release(button: MouseButton) {
+ inputDispatcher.enqueueMouseRelease(button.buttonId)
+ }
+
+ override fun enter(position: Offset, delayMillis: Long) {
+ advanceEventTime(delayMillis)
+ val positionInRoot = localToRoot(position)
+ inputDispatcher.enqueueMouseEnter(positionInRoot)
+ }
+
+ override fun exit(position: Offset, delayMillis: Long) {
+ advanceEventTime(delayMillis)
+ val positionInRoot = localToRoot(position)
+ inputDispatcher.enqueueMouseExit(positionInRoot)
+ }
+
+ override fun cancel(delayMillis: Long) {
+ advanceEventTime(delayMillis)
+ inputDispatcher.enqueueMouseCancel()
+ }
+
+ override fun scroll(delta: Float, scrollWheel: ScrollWheel) {
+ inputDispatcher.enqueueMouseScroll(delta, scrollWheel)
+ }
+ }
}
diff --git a/compose/ui/ui-test/src/commonMain/kotlin/androidx/compose/ui/test/TouchInjectionScope.kt b/compose/ui/ui-test/src/commonMain/kotlin/androidx/compose/ui/test/TouchInjectionScope.kt
index ec76435..bf35043 100644
--- a/compose/ui/ui-test/src/commonMain/kotlin/androidx/compose/ui/test/TouchInjectionScope.kt
+++ b/compose/ui/ui-test/src/commonMain/kotlin/androidx/compose/ui/test/TouchInjectionScope.kt
@@ -248,6 +248,52 @@
fun move(delayMillis: Long = eventPeriodMillis)
/**
+ * Sends a move event [delayMillis] after the last sent event without updating any of the
+ * pointer positions.
+ *
+ * This overload supports gestures with multiple pointers.
+ *
+ * @param relativeHistoricalTimes Time of each historical event, as a millisecond relative to
+ * the time the actual event is sent. For example, -10L means 10ms earlier.
+ * @param historicalCoordinates Coordinates of each historical event, in the same coordinate
+ * space as [moveTo]. The outer list must have the same size as the number of pointers in the
+ * event, and each inner list must have the same size as [relativeHistoricalTimes].
+ * @param delayMillis The time between the last sent event and this event.
+ * [eventPeriodMillis] by default.
+ */
+ @ExperimentalTestApi
+ fun moveWithHistoryMultiPointer(
+ relativeHistoricalTimes: List<Long>,
+ historicalCoordinates: List<List<Offset>>,
+ delayMillis: Long = eventPeriodMillis
+ )
+
+ /**
+ * Sends a move event [delayMillis] after the last sent event without updating any of the
+ * pointer positions.
+ *
+ * This overload is a convenience method for the common case where the gesture only has one
+ * pointer.
+ *
+ * @param relativeHistoricalTimes Time of each historical event, as a millisecond relative to
+ * the time the actual event is sent. For example, -10L means 10ms earlier.
+ * @param historicalCoordinates Coordinates of each historical event, in the same coordinate
+ * space as [moveTo]. The list must have the same size as [relativeHistoricalTimes].
+ * @param delayMillis The time between the last sent event and this event.
+ * [eventPeriodMillis] by default.
+ */
+ @ExperimentalTestApi
+ fun moveWithHistory(
+ relativeHistoricalTimes: List<Long>,
+ historicalCoordinates: List<Offset>,
+ delayMillis: Long = eventPeriodMillis
+ ) = moveWithHistoryMultiPointer(
+ relativeHistoricalTimes,
+ listOf(historicalCoordinates),
+ delayMillis
+ )
+
+ /**
* Sends an up event for the pointer with the given [pointerId], or the default pointer if
* [pointerId] is omitted, on the associated node.
*
diff --git a/compose/ui/ui-test/src/desktopMain/kotlin/androidx/compose/ui/test/DesktopInputDispatcher.desktop.kt b/compose/ui/ui-test/src/desktopMain/kotlin/androidx/compose/ui/test/DesktopInputDispatcher.desktop.kt
index 2601fb9..0c4e5c7 100644
--- a/compose/ui/ui-test/src/desktopMain/kotlin/androidx/compose/ui/test/DesktopInputDispatcher.desktop.kt
+++ b/compose/ui/ui-test/src/desktopMain/kotlin/androidx/compose/ui/test/DesktopInputDispatcher.desktop.kt
@@ -18,6 +18,7 @@
import androidx.compose.ui.input.pointer.PointerId
import androidx.compose.ui.input.pointer.TestPointerInputEventData
+import androidx.compose.ui.geometry.Offset
import androidx.compose.ui.node.RootForTest
import androidx.compose.ui.platform.DesktopRootForTest
@@ -48,6 +49,14 @@
enqueueEvent(pointerInputEvent(isMousePressed))
}
+ override fun PartialGesture.enqueueMoves(
+ relativeHistoricalTimes: List<Long>,
+ historicalCoordinates: List<List<Offset>>
+ ) {
+ // TODO: add support for historical events
+ enqueueMove()
+ }
+
override fun PartialGesture.enqueueUp(pointerId: Int) {
isMousePressed = false
enqueueEvent(pointerInputEvent(isMousePressed))
@@ -58,6 +67,35 @@
println("PartialGesture.sendCancel")
}
+ override fun MouseInputState.enqueuePress(buttonId: Int) {
+ TODO("Not yet implemented")
+ }
+
+ override fun MouseInputState.enqueueMove() {
+ TODO("Not yet implemented")
+ }
+
+ override fun MouseInputState.enqueueRelease(buttonId: Int) {
+ TODO("Not yet implemented")
+ }
+
+ override fun MouseInputState.enqueueEnter() {
+ TODO("Not yet implemented")
+ }
+
+ override fun MouseInputState.enqueueExit() {
+ TODO("Not yet implemented")
+ }
+
+ override fun MouseInputState.enqueueCancel() {
+ TODO("Not yet implemented")
+ }
+
+ @OptIn(ExperimentalTestApi::class)
+ override fun MouseInputState.enqueueScroll(delta: Float, scrollWheel: ScrollWheel) {
+ TODO("Not yet implemented")
+ }
+
private fun enqueueEvent(event: List<TestPointerInputEventData>) {
batchedEvents.add(event)
}
diff --git a/compose/ui/ui-test/src/desktopMain/kotlin/androidx/compose/ui/test/Mouse.desktop.kt b/compose/ui/ui-test/src/desktopMain/kotlin/androidx/compose/ui/test/Mouse.desktop.kt
new file mode 100644
index 0000000..96a3a0c
--- /dev/null
+++ b/compose/ui/ui-test/src/desktopMain/kotlin/androidx/compose/ui/test/Mouse.desktop.kt
@@ -0,0 +1,43 @@
+// ktlint-disable filename
+
+/*
+ * Copyright 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES 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.compose.ui.test
+
+// TODO: use constants instead of literals
+
+@Suppress("INLINE_CLASS_DEPRECATED")
+@ExperimentalTestApi
+actual inline class MouseButton(val buttonId: Int) {
+ @ExperimentalTestApi
+ actual companion object {
+ /**
+ * The left mouse button
+ */
+ actual val Primary = MouseButton(1)
+
+ /**
+ * The right mouse button
+ */
+ actual val Secondary = MouseButton(2)
+
+ /**
+ * The middle mouse button
+ */
+ actual val Tertiary = MouseButton(4)
+ }
+}
diff --git a/compose/ui/ui-text/src/desktopMain/kotlin/androidx/compose/ui/text/platform/DesktopParagraph.desktop.kt b/compose/ui/ui-text/src/desktopMain/kotlin/androidx/compose/ui/text/platform/DesktopParagraph.desktop.kt
index d3fb855..76ab25e 100644
--- a/compose/ui/ui-text/src/desktopMain/kotlin/androidx/compose/ui/text/platform/DesktopParagraph.desktop.kt
+++ b/compose/ui/ui-text/src/desktopMain/kotlin/androidx/compose/ui/text/platform/DesktopParagraph.desktop.kt
@@ -298,7 +298,7 @@
)
)
} else {
- @Suppress("UNCHECKED_CAST")
+ @Suppress("UNCHECKED_CAST", "USELESS_CAST")
para.lineMetrics as Array<LineMetrics>
}
@@ -550,7 +550,7 @@
val ps = textStyleToParagraphStyle(textStyle)
if (maxLines != Int.MAX_VALUE) {
- ps.maxLinesCount = maxLines.toLong()
+ ps.maxLinesCount = maxLines
ps.ellipsis = ellipsis
}
diff --git a/compose/ui/ui-tooling-preview/api/current.txt b/compose/ui/ui-tooling-preview/api/current.txt
index c74b634..5edf923 100644
--- a/compose/ui/ui-tooling-preview/api/current.txt
+++ b/compose/ui/ui-tooling-preview/api/current.txt
@@ -27,18 +27,18 @@
}
@kotlin.annotation.MustBeDocumented @kotlin.annotation.Repeatable @kotlin.annotation.Retention(kotlin.annotation.AnnotationRetention) @kotlin.annotation.Target(allowedTargets=kotlin.annotation.AnnotationTarget) public @interface Preview {
- method public abstract int apiLevel();
- method public abstract long backgroundColor();
- method public abstract String device();
- method public abstract float fontScale();
- method public abstract String group();
- method public abstract int heightDp();
- method public abstract String locale();
- method public abstract String name();
- method public abstract boolean showBackground();
- method public abstract boolean showSystemUi();
- method public abstract int uiMode();
- method public abstract int widthDp();
+ method public abstract int apiLevel() default -1;
+ method public abstract long backgroundColor() default 0;
+ method public abstract String device() default androidx.compose.ui.tooling.preview.Devices.DEFAULT;
+ method public abstract float fontScale() default 1.0;
+ method public abstract String group() default "";
+ method public abstract int heightDp() default -1;
+ method public abstract String locale() default "";
+ method public abstract String name() default "";
+ method public abstract boolean showBackground() default false;
+ method public abstract boolean showSystemUi() default false;
+ method public abstract int uiMode() default 0;
+ method public abstract int widthDp() default -1;
property public abstract int apiLevel;
property public abstract long backgroundColor;
property public abstract String device;
@@ -54,7 +54,7 @@
}
@java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.RUNTIME) public @interface PreviewParameter {
- method public abstract int limit();
+ method public abstract int limit() default kotlin.jvm.internal.IntCompanionObject.MAX_VALUE;
method public abstract kotlin.reflect.KClass<? extends androidx.compose.ui.tooling.preview.PreviewParameterProvider<?>> provider();
property public abstract int limit;
property public abstract kotlin.reflect.KClass<? extends androidx.compose.ui.tooling.preview.PreviewParameterProvider<?>> provider;
diff --git a/compose/ui/ui-tooling-preview/api/public_plus_experimental_current.txt b/compose/ui/ui-tooling-preview/api/public_plus_experimental_current.txt
index c74b634..5edf923 100644
--- a/compose/ui/ui-tooling-preview/api/public_plus_experimental_current.txt
+++ b/compose/ui/ui-tooling-preview/api/public_plus_experimental_current.txt
@@ -27,18 +27,18 @@
}
@kotlin.annotation.MustBeDocumented @kotlin.annotation.Repeatable @kotlin.annotation.Retention(kotlin.annotation.AnnotationRetention) @kotlin.annotation.Target(allowedTargets=kotlin.annotation.AnnotationTarget) public @interface Preview {
- method public abstract int apiLevel();
- method public abstract long backgroundColor();
- method public abstract String device();
- method public abstract float fontScale();
- method public abstract String group();
- method public abstract int heightDp();
- method public abstract String locale();
- method public abstract String name();
- method public abstract boolean showBackground();
- method public abstract boolean showSystemUi();
- method public abstract int uiMode();
- method public abstract int widthDp();
+ method public abstract int apiLevel() default -1;
+ method public abstract long backgroundColor() default 0;
+ method public abstract String device() default androidx.compose.ui.tooling.preview.Devices.DEFAULT;
+ method public abstract float fontScale() default 1.0;
+ method public abstract String group() default "";
+ method public abstract int heightDp() default -1;
+ method public abstract String locale() default "";
+ method public abstract String name() default "";
+ method public abstract boolean showBackground() default false;
+ method public abstract boolean showSystemUi() default false;
+ method public abstract int uiMode() default 0;
+ method public abstract int widthDp() default -1;
property public abstract int apiLevel;
property public abstract long backgroundColor;
property public abstract String device;
@@ -54,7 +54,7 @@
}
@java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.RUNTIME) public @interface PreviewParameter {
- method public abstract int limit();
+ method public abstract int limit() default kotlin.jvm.internal.IntCompanionObject.MAX_VALUE;
method public abstract kotlin.reflect.KClass<? extends androidx.compose.ui.tooling.preview.PreviewParameterProvider<?>> provider();
property public abstract int limit;
property public abstract kotlin.reflect.KClass<? extends androidx.compose.ui.tooling.preview.PreviewParameterProvider<?>> provider;
diff --git a/compose/ui/ui-tooling-preview/api/restricted_current.txt b/compose/ui/ui-tooling-preview/api/restricted_current.txt
index c74b634..5edf923 100644
--- a/compose/ui/ui-tooling-preview/api/restricted_current.txt
+++ b/compose/ui/ui-tooling-preview/api/restricted_current.txt
@@ -27,18 +27,18 @@
}
@kotlin.annotation.MustBeDocumented @kotlin.annotation.Repeatable @kotlin.annotation.Retention(kotlin.annotation.AnnotationRetention) @kotlin.annotation.Target(allowedTargets=kotlin.annotation.AnnotationTarget) public @interface Preview {
- method public abstract int apiLevel();
- method public abstract long backgroundColor();
- method public abstract String device();
- method public abstract float fontScale();
- method public abstract String group();
- method public abstract int heightDp();
- method public abstract String locale();
- method public abstract String name();
- method public abstract boolean showBackground();
- method public abstract boolean showSystemUi();
- method public abstract int uiMode();
- method public abstract int widthDp();
+ method public abstract int apiLevel() default -1;
+ method public abstract long backgroundColor() default 0;
+ method public abstract String device() default androidx.compose.ui.tooling.preview.Devices.DEFAULT;
+ method public abstract float fontScale() default 1.0;
+ method public abstract String group() default "";
+ method public abstract int heightDp() default -1;
+ method public abstract String locale() default "";
+ method public abstract String name() default "";
+ method public abstract boolean showBackground() default false;
+ method public abstract boolean showSystemUi() default false;
+ method public abstract int uiMode() default 0;
+ method public abstract int widthDp() default -1;
property public abstract int apiLevel;
property public abstract long backgroundColor;
property public abstract String device;
@@ -54,7 +54,7 @@
}
@java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.RUNTIME) public @interface PreviewParameter {
- method public abstract int limit();
+ method public abstract int limit() default kotlin.jvm.internal.IntCompanionObject.MAX_VALUE;
method public abstract kotlin.reflect.KClass<? extends androidx.compose.ui.tooling.preview.PreviewParameterProvider<?>> provider();
property public abstract int limit;
property public abstract kotlin.reflect.KClass<? extends androidx.compose.ui.tooling.preview.PreviewParameterProvider<?>> provider;
diff --git a/compose/ui/ui/api/current.ignore b/compose/ui/ui/api/current.ignore
index 31d5106..278f116 100644
--- a/compose/ui/ui/api/current.ignore
+++ b/compose/ui/ui/api/current.ignore
@@ -1,4 +1,10 @@
// Baseline format: 1.0
+AddedAbstractMethod: androidx.compose.ui.layout.LayoutInfo#getDensity():
+ Added method androidx.compose.ui.layout.LayoutInfo.getDensity()
+AddedAbstractMethod: androidx.compose.ui.layout.LayoutInfo#getLayoutDirection():
+ Added method androidx.compose.ui.layout.LayoutInfo.getLayoutDirection()
+
+
RemovedClass: androidx.compose.ui.graphics.vector.AnimatorKt:
Removed class androidx.compose.ui.graphics.vector.AnimatorKt
RemovedClass: androidx.compose.ui.graphics.vector.compat.XmlAnimatedVectorParser_androidKt:
diff --git a/compose/ui/ui/api/current.txt b/compose/ui/ui/api/current.txt
index 5ec9e25..f098c97 100644
--- a/compose/ui/ui/api/current.txt
+++ b/compose/ui/ui/api/current.txt
@@ -1525,6 +1525,7 @@
}
public final class VelocityTrackerKt {
+ method public static void addPointerInputChange(androidx.compose.ui.input.pointer.util.VelocityTracker, androidx.compose.ui.input.pointer.PointerInputChange event);
}
}
@@ -1644,16 +1645,20 @@
public interface LayoutInfo {
method public androidx.compose.ui.layout.LayoutCoordinates getCoordinates();
+ method public androidx.compose.ui.unit.Density getDensity();
method public int getHeight();
+ method public androidx.compose.ui.unit.LayoutDirection getLayoutDirection();
method public java.util.List<androidx.compose.ui.layout.ModifierInfo> getModifierInfo();
method public androidx.compose.ui.layout.LayoutInfo? getParentInfo();
method public int getWidth();
method public boolean isAttached();
method public boolean isPlaced();
property public abstract androidx.compose.ui.layout.LayoutCoordinates coordinates;
+ property public abstract androidx.compose.ui.unit.Density density;
property public abstract int height;
property public abstract boolean isAttached;
property public abstract boolean isPlaced;
+ property public abstract androidx.compose.ui.unit.LayoutDirection layoutDirection;
property public abstract androidx.compose.ui.layout.LayoutInfo? parentInfo;
property public abstract int width;
}
@@ -1844,6 +1849,43 @@
}
+package androidx.compose.ui.modifier {
+
+ @androidx.compose.runtime.Stable public abstract sealed class ModifierLocal<T> {
+ }
+
+ @androidx.compose.runtime.Stable public interface ModifierLocalConsumer extends androidx.compose.ui.Modifier.Element {
+ method public void onModifierLocalsUpdated(androidx.compose.ui.modifier.ModifierLocalReadScope scope);
+ }
+
+ public final class ModifierLocalConsumerKt {
+ }
+
+ public final class ModifierLocalKt {
+ method public static <T> androidx.compose.ui.modifier.ProvidableModifierLocal<T> modifierLocalOf(kotlin.jvm.functions.Function0<? extends T> defaultFactory);
+ }
+
+ @androidx.compose.runtime.Stable public interface ModifierLocalProvider<T> extends androidx.compose.ui.Modifier.Element {
+ method public androidx.compose.ui.modifier.ProvidableModifierLocal<T> getKey();
+ method public T! getValue();
+ property public abstract androidx.compose.ui.modifier.ProvidableModifierLocal<T> key;
+ property public abstract T! value;
+ }
+
+ public final class ModifierLocalProviderKt {
+ }
+
+ public interface ModifierLocalReadScope {
+ method public <T> T! getCurrent(androidx.compose.ui.modifier.ModifierLocal<T>);
+ property public abstract T! current;
+ }
+
+ @androidx.compose.runtime.Stable public final class ProvidableModifierLocal<T> extends androidx.compose.ui.modifier.ModifierLocal<T> {
+ ctor public ProvidableModifierLocal(kotlin.jvm.functions.Function0<? extends T> defaultFactory);
+ }
+
+}
+
package androidx.compose.ui.node {
public final class LayoutNodeKt {
diff --git a/compose/ui/ui/api/public_plus_experimental_current.txt b/compose/ui/ui/api/public_plus_experimental_current.txt
index 958ad34..12acb5d 100644
--- a/compose/ui/ui/api/public_plus_experimental_current.txt
+++ b/compose/ui/ui/api/public_plus_experimental_current.txt
@@ -1493,6 +1493,14 @@
property public final boolean positionChange;
}
+ @androidx.compose.runtime.Immutable @androidx.compose.ui.ExperimentalComposeUiApi public final class HistoricalChange {
+ ctor public HistoricalChange(long uptimeMillis, long position);
+ method public long getPosition();
+ method public long getUptimeMillis();
+ property public final long position;
+ property public final long uptimeMillis;
+ }
+
public final inline class PointerButtons {
ctor public PointerButtons();
}
@@ -1588,8 +1596,11 @@
@androidx.compose.runtime.Immutable public final class PointerInputChange {
ctor public PointerInputChange(long id, long uptimeMillis, long position, boolean pressed, long previousUptimeMillis, long previousPosition, boolean previousPressed, androidx.compose.ui.input.pointer.ConsumedData consumed, optional int type);
+ ctor @androidx.compose.ui.ExperimentalComposeUiApi public PointerInputChange(long id, long uptimeMillis, long position, boolean pressed, long previousUptimeMillis, long previousPosition, boolean previousPressed, androidx.compose.ui.input.pointer.ConsumedData consumed, int type, java.util.List<androidx.compose.ui.input.pointer.HistoricalChange> historical);
method public androidx.compose.ui.input.pointer.PointerInputChange copy(optional long id, optional long currentTime, optional long currentPosition, optional boolean currentPressed, optional long previousTime, optional long previousPosition, optional boolean previousPressed, optional androidx.compose.ui.input.pointer.ConsumedData consumed, optional int type);
+ method @androidx.compose.ui.ExperimentalComposeUiApi public androidx.compose.ui.input.pointer.PointerInputChange copy(optional long id, optional long currentTime, optional long currentPosition, optional boolean currentPressed, optional long previousTime, optional long previousPosition, optional boolean previousPressed, optional androidx.compose.ui.input.pointer.ConsumedData consumed, optional int type, java.util.List<androidx.compose.ui.input.pointer.HistoricalChange> historical);
method public androidx.compose.ui.input.pointer.ConsumedData getConsumed();
+ method @androidx.compose.ui.ExperimentalComposeUiApi public java.util.List<androidx.compose.ui.input.pointer.HistoricalChange> getHistorical();
method public long getId();
method public long getPosition();
method public boolean getPressed();
@@ -1599,6 +1610,7 @@
method public int getType();
method public long getUptimeMillis();
property public final androidx.compose.ui.input.pointer.ConsumedData consumed;
+ property @androidx.compose.ui.ExperimentalComposeUiApi public final java.util.List<androidx.compose.ui.input.pointer.HistoricalChange> historical;
property public final long id;
property public final long position;
property public final boolean pressed;
@@ -1695,6 +1707,7 @@
}
public final class VelocityTrackerKt {
+ method public static void addPointerInputChange(androidx.compose.ui.input.pointer.util.VelocityTracker, androidx.compose.ui.input.pointer.PointerInputChange event);
}
}
@@ -1816,16 +1829,20 @@
public interface LayoutInfo {
method public androidx.compose.ui.layout.LayoutCoordinates getCoordinates();
+ method public androidx.compose.ui.unit.Density getDensity();
method public int getHeight();
+ method public androidx.compose.ui.unit.LayoutDirection getLayoutDirection();
method public java.util.List<androidx.compose.ui.layout.ModifierInfo> getModifierInfo();
method public androidx.compose.ui.layout.LayoutInfo? getParentInfo();
method public int getWidth();
method public boolean isAttached();
method public boolean isPlaced();
property public abstract androidx.compose.ui.layout.LayoutCoordinates coordinates;
+ property public abstract androidx.compose.ui.unit.Density density;
property public abstract int height;
property public abstract boolean isAttached;
property public abstract boolean isPlaced;
+ property public abstract androidx.compose.ui.unit.LayoutDirection layoutDirection;
property public abstract androidx.compose.ui.layout.LayoutInfo? parentInfo;
property public abstract int width;
}
@@ -2028,6 +2045,45 @@
}
+package androidx.compose.ui.modifier {
+
+ @androidx.compose.runtime.Stable public abstract sealed class ModifierLocal<T> {
+ }
+
+ @androidx.compose.runtime.Stable public interface ModifierLocalConsumer extends androidx.compose.ui.Modifier.Element {
+ method public void onModifierLocalsUpdated(androidx.compose.ui.modifier.ModifierLocalReadScope scope);
+ }
+
+ public final class ModifierLocalConsumerKt {
+ method @androidx.compose.runtime.Stable @androidx.compose.ui.ExperimentalComposeUiApi public static androidx.compose.ui.Modifier modifierLocalConsumer(androidx.compose.ui.Modifier, kotlin.jvm.functions.Function1<? super androidx.compose.ui.modifier.ModifierLocalReadScope,kotlin.Unit> consumer);
+ }
+
+ public final class ModifierLocalKt {
+ method public static <T> androidx.compose.ui.modifier.ProvidableModifierLocal<T> modifierLocalOf(kotlin.jvm.functions.Function0<? extends T> defaultFactory);
+ }
+
+ @androidx.compose.runtime.Stable public interface ModifierLocalProvider<T> extends androidx.compose.ui.Modifier.Element {
+ method public androidx.compose.ui.modifier.ProvidableModifierLocal<T> getKey();
+ method public T! getValue();
+ property public abstract androidx.compose.ui.modifier.ProvidableModifierLocal<T> key;
+ property public abstract T! value;
+ }
+
+ public final class ModifierLocalProviderKt {
+ method @androidx.compose.ui.ExperimentalComposeUiApi public static <T> androidx.compose.ui.Modifier modifierLocalProvider(androidx.compose.ui.Modifier, androidx.compose.ui.modifier.ProvidableModifierLocal<T> key, kotlin.jvm.functions.Function0<? extends T> value);
+ }
+
+ public interface ModifierLocalReadScope {
+ method public <T> T! getCurrent(androidx.compose.ui.modifier.ModifierLocal<T>);
+ property public abstract T! current;
+ }
+
+ @androidx.compose.runtime.Stable public final class ProvidableModifierLocal<T> extends androidx.compose.ui.modifier.ModifierLocal<T> {
+ ctor public ProvidableModifierLocal(kotlin.jvm.functions.Function0<? extends T> defaultFactory);
+ }
+
+}
+
package androidx.compose.ui.node {
@kotlin.RequiresOptIn(message="This API is internal to library.") @kotlin.annotation.Target(allowedTargets={kotlin.annotation.AnnotationTarget, kotlin.annotation.AnnotationTarget, kotlin.annotation.AnnotationTarget, kotlin.annotation.AnnotationTarget, kotlin.annotation.AnnotationTarget}) public @interface InternalCoreApi {
diff --git a/compose/ui/ui/api/restricted_current.ignore b/compose/ui/ui/api/restricted_current.ignore
index 31d5106..278f116 100644
--- a/compose/ui/ui/api/restricted_current.ignore
+++ b/compose/ui/ui/api/restricted_current.ignore
@@ -1,4 +1,10 @@
// Baseline format: 1.0
+AddedAbstractMethod: androidx.compose.ui.layout.LayoutInfo#getDensity():
+ Added method androidx.compose.ui.layout.LayoutInfo.getDensity()
+AddedAbstractMethod: androidx.compose.ui.layout.LayoutInfo#getLayoutDirection():
+ Added method androidx.compose.ui.layout.LayoutInfo.getLayoutDirection()
+
+
RemovedClass: androidx.compose.ui.graphics.vector.AnimatorKt:
Removed class androidx.compose.ui.graphics.vector.AnimatorKt
RemovedClass: androidx.compose.ui.graphics.vector.compat.XmlAnimatedVectorParser_androidKt:
diff --git a/compose/ui/ui/api/restricted_current.txt b/compose/ui/ui/api/restricted_current.txt
index 3c9aca6..fdcfee8 100644
--- a/compose/ui/ui/api/restricted_current.txt
+++ b/compose/ui/ui/api/restricted_current.txt
@@ -1525,6 +1525,7 @@
}
public final class VelocityTrackerKt {
+ method public static void addPointerInputChange(androidx.compose.ui.input.pointer.util.VelocityTracker, androidx.compose.ui.input.pointer.PointerInputChange event);
}
}
@@ -1644,16 +1645,20 @@
public interface LayoutInfo {
method public androidx.compose.ui.layout.LayoutCoordinates getCoordinates();
+ method public androidx.compose.ui.unit.Density getDensity();
method public int getHeight();
+ method public androidx.compose.ui.unit.LayoutDirection getLayoutDirection();
method public java.util.List<androidx.compose.ui.layout.ModifierInfo> getModifierInfo();
method public androidx.compose.ui.layout.LayoutInfo? getParentInfo();
method public int getWidth();
method public boolean isAttached();
method public boolean isPlaced();
property public abstract androidx.compose.ui.layout.LayoutCoordinates coordinates;
+ property public abstract androidx.compose.ui.unit.Density density;
property public abstract int height;
property public abstract boolean isAttached;
property public abstract boolean isPlaced;
+ property public abstract androidx.compose.ui.unit.LayoutDirection layoutDirection;
property public abstract androidx.compose.ui.layout.LayoutInfo? parentInfo;
property public abstract int width;
}
@@ -1845,6 +1850,43 @@
}
+package androidx.compose.ui.modifier {
+
+ @androidx.compose.runtime.Stable public abstract sealed class ModifierLocal<T> {
+ }
+
+ @androidx.compose.runtime.Stable public interface ModifierLocalConsumer extends androidx.compose.ui.Modifier.Element {
+ method public void onModifierLocalsUpdated(androidx.compose.ui.modifier.ModifierLocalReadScope scope);
+ }
+
+ public final class ModifierLocalConsumerKt {
+ }
+
+ public final class ModifierLocalKt {
+ method public static <T> androidx.compose.ui.modifier.ProvidableModifierLocal<T> modifierLocalOf(kotlin.jvm.functions.Function0<? extends T> defaultFactory);
+ }
+
+ @androidx.compose.runtime.Stable public interface ModifierLocalProvider<T> extends androidx.compose.ui.Modifier.Element {
+ method public androidx.compose.ui.modifier.ProvidableModifierLocal<T> getKey();
+ method public T! getValue();
+ property public abstract androidx.compose.ui.modifier.ProvidableModifierLocal<T> key;
+ property public abstract T! value;
+ }
+
+ public final class ModifierLocalProviderKt {
+ }
+
+ public interface ModifierLocalReadScope {
+ method public <T> T! getCurrent(androidx.compose.ui.modifier.ModifierLocal<T>);
+ property public abstract T! current;
+ }
+
+ @androidx.compose.runtime.Stable public final class ProvidableModifierLocal<T> extends androidx.compose.ui.modifier.ModifierLocal<T> {
+ ctor public ProvidableModifierLocal(kotlin.jvm.functions.Function0<? extends T> defaultFactory);
+ }
+
+}
+
package androidx.compose.ui.node {
@kotlin.PublishedApi internal interface ComposeUiNode {
diff --git a/compose/ui/ui/build.gradle b/compose/ui/ui/build.gradle
index 1b2e4ab..8879f12 100644
--- a/compose/ui/ui/build.gradle
+++ b/compose/ui/ui/build.gradle
@@ -79,6 +79,7 @@
androidTestImplementation(libs.testRunner)
androidTestImplementation(libs.testExtJunitKtx)
androidTestImplementation(libs.testUiautomator)
+ androidTestImplementation(libs.kotlinTest)
androidTestImplementation(libs.kotlinCoroutinesTest)
androidTestImplementation(libs.espressoCore)
androidTestImplementation(libs.junit)
diff --git a/compose/ui/ui/integration-tests/ui-demos/src/main/java/androidx/compose/ui/demos/UiDemos.kt b/compose/ui/ui/integration-tests/ui-demos/src/main/java/androidx/compose/ui/demos/UiDemos.kt
index 03529af..bbc15f5 100644
--- a/compose/ui/ui/integration-tests/ui-demos/src/main/java/androidx/compose/ui/demos/UiDemos.kt
+++ b/compose/ui/ui/integration-tests/ui-demos/src/main/java/androidx/compose/ui/demos/UiDemos.kt
@@ -54,6 +54,7 @@
import androidx.compose.ui.demos.gestures.VerticalScrollerInDrawerDemo
import androidx.compose.ui.demos.scroll.BringIntoViewDemo
import androidx.compose.ui.demos.keyinput.KeyInputDemo
+import androidx.compose.ui.demos.modifier.CommunicatingModifierDemo
import androidx.compose.ui.demos.scroll.BringRectangleIntoViewDemo
import androidx.compose.ui.demos.scroll.RequestRectangleOnScreenDemo
import androidx.compose.ui.demos.viewinterop.AndroidInComposeDemos
@@ -162,9 +163,17 @@
)
)
+private val ModifierDemos = DemoCategory(
+ "Modifiers",
+ listOf(
+ ComposableDemo("Inter-Modifier Communication") { CommunicatingModifierDemo() }
+ )
+)
+
val CoreDemos = DemoCategory(
"Framework",
listOf(
+ ModifierDemos,
ComposableDemo("Explicit autofill types") { ExplicitAutofillTypesDemo() },
FocusDemos,
ComposableDemo("KeyInput") { KeyInputDemo() },
diff --git a/compose/ui/ui/integration-tests/ui-demos/src/main/java/androidx/compose/ui/demos/modifier/CommunicatingModifierDemo.kt b/compose/ui/ui/integration-tests/ui-demos/src/main/java/androidx/compose/ui/demos/modifier/CommunicatingModifierDemo.kt
new file mode 100644
index 0000000..8bc83e7f
--- /dev/null
+++ b/compose/ui/ui/integration-tests/ui-demos/src/main/java/androidx/compose/ui/demos/modifier/CommunicatingModifierDemo.kt
@@ -0,0 +1,125 @@
+/*
+ * Copyright 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES 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.compose.ui.demos.modifier
+
+import androidx.compose.foundation.background
+import androidx.compose.foundation.clickable
+import androidx.compose.foundation.layout.Box
+import androidx.compose.foundation.layout.Column
+import androidx.compose.foundation.layout.padding
+import androidx.compose.foundation.layout.size
+import androidx.compose.material.Scaffold
+import androidx.compose.material.Text
+import androidx.compose.material.rememberScaffoldState
+import androidx.compose.runtime.Composable
+import androidx.compose.runtime.getValue
+import androidx.compose.runtime.mutableStateOf
+import androidx.compose.runtime.remember
+import androidx.compose.runtime.rememberCoroutineScope
+import androidx.compose.runtime.setValue
+import androidx.compose.ui.ExperimentalComposeUiApi
+import androidx.compose.ui.Modifier
+import androidx.compose.ui.composed
+import androidx.compose.ui.graphics.Color.Companion.Blue
+import androidx.compose.ui.graphics.Color.Companion.Gray
+import androidx.compose.ui.graphics.Color.Companion.Red
+import androidx.compose.ui.modifier.modifierLocalConsumer
+import androidx.compose.ui.modifier.modifierLocalProvider
+import androidx.compose.ui.modifier.modifierLocalOf
+import androidx.compose.ui.unit.dp
+import kotlinx.coroutines.launch
+
+val ModifierLocalColor = modifierLocalOf { "Unspecified" }
+
+@OptIn(ExperimentalComposeUiApi::class)
+@Composable
+fun CommunicatingModifierDemo() {
+ val scaffoldState = rememberScaffoldState()
+
+ fun Modifier.clickToRead() = composed {
+ var name by remember { mutableStateOf("Unknown") }
+ val coroutineScope = rememberCoroutineScope()
+ Modifier
+ .modifierLocalConsumer { name = ModifierLocalColor.current }
+ .clickable {
+ coroutineScope.launch {
+ scaffoldState.snackbarHostState.showSnackbar(
+ "Consumed value provided by $name Box."
+ )
+ }
+ }
+ }
+
+ Scaffold(scaffoldState = scaffoldState) {
+ Column(
+ Modifier
+ .background(Gray)
+ .modifierLocalProvider(ModifierLocalColor) { "Gray" }
+ ) {
+ Text("Click the red box to read the parent's ModifierLocalColor")
+ Box(
+ Modifier
+ .size(100.dp)
+ .padding(5.dp)
+ .background(Red)
+ .clickToRead()
+ )
+ Text("Click the blue box to read its ModifierLocalColor")
+ Box(
+ Modifier
+ .size(100.dp)
+ .padding(5.dp)
+ .modifierLocalProvider(ModifierLocalColor) { "Blue" }
+ .background(Blue)
+ .clickToRead()
+ )
+ Text("Click the blue box to read the red box's ModifierLocalColor")
+ Box(
+ Modifier
+ .size(100.dp)
+ .padding(5.dp)
+ .background(Red)
+ .modifierLocalProvider(ModifierLocalColor) { "Red" }
+ ) {
+ Box(
+ Modifier
+ .size(50.dp)
+ .padding(5.dp)
+ .background(Blue)
+ .clickToRead()
+ )
+ }
+ Text("Click the blue box to read its ModifierLocalColor")
+ Box(
+ Modifier
+ .size(100.dp)
+ .padding(5.dp)
+ .background(Red)
+ .modifierLocalProvider(ModifierLocalColor) { "Red" }
+ ) {
+ Box(
+ Modifier
+ .size(50.dp)
+ .padding(5.dp)
+ .background(Blue)
+ .modifierLocalProvider(ModifierLocalColor) { "Blue" }
+ .clickToRead()
+ )
+ }
+ }
+ }
+}
diff --git a/compose/ui/ui/lint-baseline.xml b/compose/ui/ui/lint-baseline.xml
index e85b753..766adbc 100644
--- a/compose/ui/ui/lint-baseline.xml
+++ b/compose/ui/ui/lint-baseline.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<issues format="6" by="lint 7.1.0-alpha02" type="baseline" client="cli" name="Lint" variant="all" version="7.1.0-alpha02">
+<issues format="6" by="lint 7.2.0-dev" type="baseline" client="gradle" dependencies="false" name="AGP (7.2.0-dev)" variant="all" version="7.2.0-dev">
<issue
id="NewApi"
@@ -25,6 +25,17 @@
<issue
id="NewApi"
+ message="Field requires API level 29 (current min is 21): `setCameraDistance`"
+ errorLine1=" this.cameraDistance = cameraDistance"
+ errorLine2=" ~~~~~~~~~~~~~~">
+ <location
+ file="src/androidAndroidTest/kotlin/androidx/compose/ui/AndroidLayoutDrawTest.kt"
+ line="225"
+ column="18"/>
+ </issue>
+
+ <issue
+ id="NewApi"
message="Call requires API level 29 (current min is 21): `dumpRenderNodeData`"
errorLine1=" }.dumpRenderNodeData().cameraDistance == cameraDistance"
errorLine2=" ~~~~~~~~~~~~~~~~~~">
@@ -47,6 +58,17 @@
<issue
id="NewApi"
+ message="Field requires API level 23 (current min is 21): `setCameraDistance`"
+ errorLine1=" this.cameraDistance = cameraDistance"
+ errorLine2=" ~~~~~~~~~~~~~~">
+ <location
+ file="src/androidAndroidTest/kotlin/androidx/compose/ui/AndroidLayoutDrawTest.kt"
+ line="232"
+ column="18"/>
+ </issue>
+
+ <issue
+ id="NewApi"
message="Call requires API level 23 (current min is 21): `dumpRenderNodeData`"
errorLine1=" }.dumpRenderNodeData().cameraDistance == -cameraDistance // Camera distance is negative"
errorLine2=" ~~~~~~~~~~~~~~~~~~">
@@ -63,7 +85,7 @@
errorLine2=" ~~~~~~~~~~~~~~~~~">
<location
file="src/androidAndroidTest/kotlin/androidx/compose/ui/AndroidLayoutDrawTest.kt"
- line="3707"
+ line="3758"
column="18"/>
</issue>
@@ -223,6 +245,17 @@
<issue
id="NewApi"
+ message="Call requires API level 26 (current min is 21): `setAutofillType`"
+ errorLine1=" setAutofillType(View.AUTOFILL_TYPE_TEXT)"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/test/kotlin/androidx/compose/ui/autofill/AndroidPopulateViewStructureTest.kt"
+ line="87"
+ column="41"/>
+ </issue>
+
+ <issue
+ id="NewApi"
message="Call requires API level 26 (current min is 21): `setAutofillHints`"
errorLine1=" setAutofillHints(arrayOf(AUTOFILL_HINT_PERSON_NAME))"
errorLine2=" ~~~~~~~~~~~~~~~~">
@@ -234,6 +267,17 @@
<issue
id="NewApi"
+ message="Call requires API level 26 (current min is 21): `setAutofillHints`"
+ errorLine1=" setAutofillHints(arrayOf(AUTOFILL_HINT_PERSON_NAME))"
+ errorLine2=" ~~~~~~~">
+ <location
+ file="src/test/kotlin/androidx/compose/ui/autofill/AndroidPopulateViewStructureTest.kt"
+ line="88"
+ column="42"/>
+ </issue>
+
+ <issue
+ id="NewApi"
message="Call requires API level 26 (current min is 21): `setDimens`"
errorLine1=" setDimens(0, 0, 0, 0, 0, 0)"
errorLine2=" ~~~~~~~~~">
@@ -300,6 +344,17 @@
<issue
id="NewApi"
+ message="Call requires API level 26 (current min is 21): `setAutofillType`"
+ errorLine1=" setAutofillType(View.AUTOFILL_TYPE_TEXT)"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/test/kotlin/androidx/compose/ui/autofill/AndroidPopulateViewStructureTest.kt"
+ line="124"
+ column="41"/>
+ </issue>
+
+ <issue
+ id="NewApi"
message="Call requires API level 26 (current min is 21): `setAutofillHints`"
errorLine1=" setAutofillHints(arrayOf(AUTOFILL_HINT_PERSON_NAME))"
errorLine2=" ~~~~~~~~~~~~~~~~">
@@ -311,6 +366,17 @@
<issue
id="NewApi"
+ message="Call requires API level 26 (current min is 21): `setAutofillHints`"
+ errorLine1=" setAutofillHints(arrayOf(AUTOFILL_HINT_PERSON_NAME))"
+ errorLine2=" ~~~~~~~">
+ <location
+ file="src/test/kotlin/androidx/compose/ui/autofill/AndroidPopulateViewStructureTest.kt"
+ line="125"
+ column="42"/>
+ </issue>
+
+ <issue
+ id="NewApi"
message="Call requires API level 26 (current min is 21): `setDimens`"
errorLine1=" setDimens(0, 0, 0, 0, 0, 0)"
errorLine2=" ~~~~~~~~~">
@@ -344,6 +410,17 @@
<issue
id="NewApi"
+ message="Call requires API level 26 (current min is 21): `setAutofillType`"
+ errorLine1=" setAutofillType(View.AUTOFILL_TYPE_TEXT)"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/test/kotlin/androidx/compose/ui/autofill/AndroidPopulateViewStructureTest.kt"
+ line="133"
+ column="41"/>
+ </issue>
+
+ <issue
+ id="NewApi"
message="Call requires API level 26 (current min is 21): `setAutofillHints`"
errorLine1=" setAutofillHints(arrayOf(View.AUTOFILL_HINT_EMAIL_ADDRESS))"
errorLine2=" ~~~~~~~~~~~~~~~~">
@@ -355,6 +432,17 @@
<issue
id="NewApi"
+ message="Call requires API level 26 (current min is 21): `setAutofillHints`"
+ errorLine1=" setAutofillHints(arrayOf(View.AUTOFILL_HINT_EMAIL_ADDRESS))"
+ errorLine2=" ~~~~~~~">
+ <location
+ file="src/test/kotlin/androidx/compose/ui/autofill/AndroidPopulateViewStructureTest.kt"
+ line="134"
+ column="42"/>
+ </issue>
+
+ <issue
+ id="NewApi"
message="Call requires API level 26 (current min is 21): `setDimens`"
errorLine1=" setDimens(0, 0, 0, 0, 0, 0)"
errorLine2=" ~~~~~~~~~">
@@ -492,7 +580,7 @@
errorLine2=" ~~~~~~~~~~~~~~">
<location
file="src/androidAndroidTest/kotlin/androidx/compose/ui/draw/DrawModifierTest.kt"
- line="638"
+ line="632"
column="54"/>
</issue>
@@ -514,7 +602,7 @@
errorLine2=" ~~~~~~~~~~~~~~">
<location
file="src/androidAndroidTest/kotlin/androidx/compose/ui/draw/PainterModifierTest.kt"
- line="720"
+ line="755"
column="27"/>
</issue>
@@ -536,7 +624,7 @@
errorLine2=" ~~~~~~~~~~~~~~">
<location
file="src/androidAndroidTest/kotlin/androidx/compose/ui/graphics/vector/VectorTest.kt"
- line="481"
+ line="590"
column="36"/>
</issue>
diff --git a/compose/ui/ui/samples/src/main/java/androidx/compose/ui/samples/ModifierLocalSamples.kt b/compose/ui/ui/samples/src/main/java/androidx/compose/ui/samples/ModifierLocalSamples.kt
new file mode 100644
index 0000000..0db443d
--- /dev/null
+++ b/compose/ui/ui/samples/src/main/java/androidx/compose/ui/samples/ModifierLocalSamples.kt
@@ -0,0 +1,140 @@
+/*
+ * Copyright 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES 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.compose.ui.samples
+
+import androidx.annotation.Sampled
+import androidx.compose.foundation.clickable
+import androidx.compose.foundation.layout.Box
+import androidx.compose.runtime.Composable
+import androidx.compose.runtime.getValue
+import androidx.compose.runtime.mutableStateOf
+import androidx.compose.runtime.remember
+import androidx.compose.runtime.setValue
+import androidx.compose.ui.ExperimentalComposeUiApi
+import androidx.compose.ui.Modifier
+import androidx.compose.ui.composed
+import androidx.compose.ui.modifier.modifierLocalConsumer
+import androidx.compose.ui.modifier.modifierLocalProvider
+import androidx.compose.ui.modifier.modifierLocalOf
+
+@OptIn(ExperimentalComposeUiApi::class)
+@Sampled
+@Composable
+fun ModifierLocalParentChildCommunicationWithinLayoutNodeSample() {
+
+ // Define the type of data.
+ val ModifierLocalMessage = modifierLocalOf { "Unknown" }
+
+ Box(
+ Modifier
+ // Provide an instance associated with the data type.
+ .modifierLocalProvider(ModifierLocalMessage) { "World" }
+ .composed {
+ var message by remember { mutableStateOf("") }
+ Modifier
+ // Use the data type to read the message.
+ .modifierLocalConsumer { message = ModifierLocalMessage.current }
+ .clickable { println("Hello $message") }
+ }
+
+ )
+}
+
+@OptIn(ExperimentalComposeUiApi::class)
+@Sampled
+@Composable
+fun ModifierLocalChildParentCommunicationWithinLayoutNodeSample() {
+
+ class Sender(val onMessageReceived: (String) -> Unit) {
+ fun sendMessage(message: String) {
+ onMessageReceived(message)
+ }
+ }
+
+ // Define the type of data.
+ val ModifierLocalSender = modifierLocalOf<Sender> { error("No sender provided by parent.") }
+
+ Box(
+ Modifier
+ // Provide an instance associated with the sender type.
+ .modifierLocalProvider(ModifierLocalSender) {
+ Sender { println("Message Received: $it") }
+ }
+ .composed {
+ var sender by remember { mutableStateOf<Sender?>(null) }
+ Modifier
+ // Use the sender type to fetch an instance.
+ .modifierLocalConsumer { sender = ModifierLocalSender.current }
+ // Use this instance to send a message to the parent.
+ .clickable { sender?.sendMessage("Hello World") }
+ }
+ )
+}
+
+@OptIn(ExperimentalComposeUiApi::class)
+@Sampled
+@Composable
+fun ModifierLocalParentChildCommunicationInterLayoutNodeSample() {
+
+ // Define the type of data.
+ val ModifierLocalMessage = modifierLocalOf { "Unknown" }
+
+ Box(
+ // Provide an instance associated with the data type.
+ Modifier.modifierLocalProvider(ModifierLocalMessage) { "World" }
+ ) {
+ var message by remember { mutableStateOf("") }
+ Box(
+ Modifier
+ // Use the data type to read the message.
+ .modifierLocalConsumer { message = ModifierLocalMessage.current }
+ .clickable { println("Hello $message") }
+ )
+ }
+}
+
+@OptIn(ExperimentalComposeUiApi::class)
+@Sampled
+@Composable
+fun ModifierLocalChildParentCommunicationInterLayoutNodeSample() {
+
+ class Sender(val onMessageReceived: (String) -> Unit) {
+ fun sendMessage(message: String) {
+ onMessageReceived(message)
+ }
+ }
+
+ // Define the type of data.
+ val ModifierLocalSender = modifierLocalOf<Sender> { error("No sender provided by parent.") }
+
+ Box(
+ Modifier
+ // Provide an instance associated with the sender type.
+ .modifierLocalProvider(ModifierLocalSender) {
+ Sender { println("Message Received: $it") }
+ }
+ ) {
+ var sender by remember { mutableStateOf<Sender?>(null) }
+ Box(
+ Modifier
+ // Use the sender type to fetch an instance.
+ .modifierLocalConsumer { sender = ModifierLocalSender.current }
+ // Use this instance to send a message to the parent.
+ .clickable { sender?.sendMessage("Hello World") }
+ )
+ }
+}
\ No newline at end of file
diff --git a/compose/ui/ui/src/androidAndroidTest/kotlin/androidx/compose/ui/input/pointer/PointerInputEventProcessorTest.kt b/compose/ui/ui/src/androidAndroidTest/kotlin/androidx/compose/ui/input/pointer/PointerInputEventProcessorTest.kt
index 7b9fc21..9447687 100644
--- a/compose/ui/ui/src/androidAndroidTest/kotlin/androidx/compose/ui/input/pointer/PointerInputEventProcessorTest.kt
+++ b/compose/ui/ui/src/androidAndroidTest/kotlin/androidx/compose/ui/input/pointer/PointerInputEventProcessorTest.kt
@@ -111,6 +111,7 @@
}
@Test
+ @OptIn(ExperimentalComposeUiApi::class)
fun pointerTypePassed() {
val pointerTypes = listOf(
PointerType.Unknown,
diff --git a/compose/ui/ui/src/androidAndroidTest/kotlin/androidx/compose/ui/modifier/ModifierLocalMultiLayoutNodeTest.kt b/compose/ui/ui/src/androidAndroidTest/kotlin/androidx/compose/ui/modifier/ModifierLocalMultiLayoutNodeTest.kt
new file mode 100644
index 0000000..070ab8e
--- /dev/null
+++ b/compose/ui/ui/src/androidAndroidTest/kotlin/androidx/compose/ui/modifier/ModifierLocalMultiLayoutNodeTest.kt
@@ -0,0 +1,414 @@
+/*
+ * Copyright 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES 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.compose.ui.modifier
+
+import androidx.compose.foundation.layout.Box
+import androidx.compose.foundation.layout.size
+import androidx.compose.runtime.getValue
+import androidx.compose.runtime.mutableStateOf
+import androidx.compose.runtime.setValue
+import androidx.compose.ui.ExperimentalComposeUiApi
+import androidx.compose.ui.Modifier
+import androidx.compose.ui.test.junit4.createComposeRule
+import androidx.compose.ui.unit.dp
+import androidx.test.ext.junit.runners.AndroidJUnit4
+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
+
+@OptIn(ExperimentalComposeUiApi::class)
+@MediumTest
+@RunWith(AndroidJUnit4::class)
+class ModifierLocalMultiLayoutNodeTest {
+ @get:Rule
+ val rule = createComposeRule()
+
+ private val defaultValue = "Default Value"
+
+ @Test
+ fun doesNotReadValuesProvidedByChildren() {
+ // Arrange.
+ val localString = modifierLocalOf { defaultValue }
+ val providedValue = "Provided Value"
+ lateinit var readValue: String
+ rule.setContent {
+ Box(Modifier.modifierLocalConsumer { readValue = localString.current }) {
+ Box(Modifier.modifierLocalProvider(localString) { providedValue })
+ }
+ }
+
+ // Assert.
+ rule.runOnIdle { assertThat(readValue).isEqualTo(defaultValue) }
+ }
+
+ @Test
+ fun readsValuesProvidedByParent() {
+ // Arrange.
+ val localString = modifierLocalOf { defaultValue }
+ val providedValue = "Provided Value"
+ lateinit var readValue: String
+ rule.setContent {
+ Box(Modifier.modifierLocalProvider(localString) { providedValue }) {
+ Box(Modifier.modifierLocalConsumer { readValue = localString.current })
+ }
+ }
+
+ // Assert.
+ rule.runOnIdle { assertThat(readValue).isEqualTo(providedValue) }
+ }
+
+ @Test
+ fun readsValuesProvidedByGrandParent() {
+ // Arrange.
+ val localString = modifierLocalOf { defaultValue }
+ val providedValue = "Provided Value"
+ lateinit var readValue: String
+ rule.setContent {
+ Box(Modifier.modifierLocalProvider(localString) { providedValue }) {
+ Box(Modifier.size(100.dp)) {
+ Box(Modifier.modifierLocalConsumer { readValue = localString.current })
+ }
+ }
+ }
+
+ // Assert.
+ rule.runOnIdle { assertThat(readValue).isEqualTo(providedValue) }
+ }
+
+ @Test
+ fun parentInSameLayoutNodeTakesPrecedenceOverParentLayoutNode() {
+ // Arrange.
+ val localString = modifierLocalOf { defaultValue }
+ val providedValue1 = "Provided Value 1"
+ val providedValue2 = "Provided Value 2"
+ lateinit var readValue: String
+ rule.setContent {
+ Box(Modifier.modifierLocalProvider(localString) { providedValue1 }) {
+ Box(
+ Modifier
+ .modifierLocalProvider(localString) { providedValue2 }
+ .modifierLocalConsumer { readValue = localString.current }
+ )
+ }
+ }
+
+ // Assert.
+ rule.runOnIdle { assertThat(readValue).isEqualTo(providedValue2) }
+ }
+
+ @Test
+ fun readsValuesProvidedByNearestParent() {
+ // Arrange.
+ val localString = modifierLocalOf { defaultValue }
+ val providedValue1 = "Provided Value 1"
+ val providedValue2 = "Provided Value 2"
+ lateinit var readValue: String
+ rule.setContent {
+ Box(Modifier.modifierLocalProvider(localString) { providedValue1 }) {
+ Box(Modifier.modifierLocalProvider(localString) { providedValue2 }) {
+ Box(Modifier.modifierLocalConsumer { readValue = localString.current })
+ }
+ }
+ }
+
+ // Assert.
+ rule.runOnIdle { assertThat(readValue).isEqualTo(providedValue2) }
+ }
+
+ @Test
+ fun multipleModifierLocalsOfSameDataType() {
+ // Arrange.
+ val localString1 = modifierLocalOf { defaultValue }
+ val localString2 = modifierLocalOf { defaultValue }
+ val providedValue1 = "Provided Value 1"
+ val providedValue2 = "Provided Value 2"
+ lateinit var readValue1: String
+ lateinit var readValue2: String
+ rule.setContent {
+ Box(Modifier.modifierLocalProvider(localString1) { providedValue1 }) {
+ Box(Modifier.modifierLocalProvider(localString2) { providedValue2 }) {
+ Box(
+ Modifier.modifierLocalConsumer {
+ readValue1 = localString1.current
+ readValue2 = localString2.current
+ }
+ )
+ }
+ }
+ }
+
+ // Assert.
+ rule.runOnIdle {
+ assertThat(readValue1).isEqualTo(providedValue1)
+ assertThat(readValue2).isEqualTo(providedValue2)
+ }
+ }
+
+ @Test
+ fun multipleModifierLocalsWithDifferentDataType() {
+ // Arrange.
+ val localString = modifierLocalOf { defaultValue }
+ val localInteger = modifierLocalOf { Int.MIN_VALUE }
+ val providedString = "Provided Value"
+ val providedInteger = 100
+ lateinit var readString: String
+ var readInteger = 0
+ rule.setContent {
+ Box(Modifier.modifierLocalProvider(localString) { providedString }) {
+ Box(Modifier.modifierLocalProvider(localInteger) { providedInteger }) {
+ Box(
+ Modifier.modifierLocalConsumer {
+ readString = localString.current
+ readInteger = localInteger.current
+ }
+ )
+ }
+ }
+ }
+
+ // Assert.
+ rule.runOnIdle {
+ assertThat(readString).isEqualTo(providedString)
+ assertThat(readInteger).isEqualTo(providedInteger)
+ }
+ }
+
+ @Test
+ fun modifierLocalProviderChanged() {
+ // Arrange.
+ val localString = modifierLocalOf { defaultValue }
+ val provider1value = "Provider1"
+ val provider2value = "Provider2"
+ var useFirstProvider by mutableStateOf(true)
+ lateinit var readString: String
+ rule.setContent {
+ Box(
+ Modifier.then(
+ if (useFirstProvider) {
+ Modifier.modifierLocalProvider(localString) { provider1value }
+ } else {
+ Modifier.modifierLocalProvider(localString) { provider2value }
+ }
+ )
+ ) {
+ Box(Modifier.modifierLocalConsumer { readString = localString.current })
+ }
+ }
+
+ // Act.
+ rule.runOnIdle { useFirstProvider = false }
+
+ // Assert.
+ rule.runOnIdle { assertThat(readString).isEqualTo(provider2value) }
+ }
+
+ @Test
+ fun modifierLocalProviderValueChanged() {
+ // Arrange.
+ val localString = modifierLocalOf { defaultValue }
+ val value1 = "Value1"
+ val value2 = "Value2"
+ var useFirstValue by mutableStateOf(true)
+ lateinit var readString: String
+ rule.setContent {
+ Box(
+ Modifier.modifierLocalProvider(localString) {
+ if (useFirstValue) value1 else value2
+ }
+ ) {
+ Box(
+ Modifier.modifierLocalConsumer {
+ readString = localString.current
+ }
+ )
+ }
+ }
+
+ // Act.
+ rule.runOnIdle { useFirstValue = false }
+
+ // Assert.
+ rule.runOnIdle { assertThat(readString).isEqualTo(value2) }
+ }
+
+ @Test
+ fun modifierLocalProviderAdded() {
+ // Arrange.
+ val localString = modifierLocalOf { defaultValue }
+ val providedByParent1 = "Parent1"
+ var secondParentAdded by mutableStateOf(false)
+ val providedByParent2 = "Parent2"
+ lateinit var readString: String
+ rule.setContent {
+ Box(Modifier.modifierLocalProvider(localString) { providedByParent1 }) {
+ Box(
+ Modifier.then(
+ if (secondParentAdded) {
+ Modifier.modifierLocalProvider(localString) { providedByParent2 }
+ } else {
+ Modifier
+ }
+ )
+ ) {
+ Box(Modifier.modifierLocalConsumer { readString = localString.current })
+ }
+ }
+ }
+
+ // Act.
+ rule.runOnIdle { secondParentAdded = true }
+
+ // Assert.
+ rule.runOnIdle { assertThat(readString).isEqualTo(providedByParent2) }
+ }
+
+ @Test
+ fun modifierLocalProviderRemoved_readsDefaultValue() {
+ // Arrange.
+ val localString = modifierLocalOf { defaultValue }
+ val providedValue = "Parent"
+ var providerRemoved by mutableStateOf(false)
+ lateinit var readString: String
+ rule.setContent {
+ Box(
+ Modifier.then(
+ if (providerRemoved) {
+ Modifier
+ } else {
+ Modifier.modifierLocalProvider(localString) { providedValue }
+ }
+ )
+
+ ) {
+ Box(Modifier.modifierLocalConsumer { readString = localString.current })
+ }
+ }
+
+ // Act.
+ rule.runOnIdle { providerRemoved = true }
+
+ // Assert.
+ rule.runOnIdle { assertThat(readString).isEqualTo(defaultValue) }
+ }
+
+ @Test
+ fun modifierLocalProviderRemoved_readsPreviousParent() {
+ // Arrange.
+ val localString = modifierLocalOf { defaultValue }
+ val providedByParent1 = "Parent1"
+ var secondParentRemoved by mutableStateOf(false)
+ val providedByParent2 = "Parent2"
+ lateinit var readString: String
+ rule.setContent {
+ Box(Modifier.modifierLocalProvider(localString) { providedByParent1 }) {
+ Box(
+ Modifier.then(
+ if (secondParentRemoved) {
+ Modifier
+ } else {
+ Modifier.modifierLocalProvider(localString) { providedByParent2 }
+ }
+ )
+ ) {
+ Box(Modifier.modifierLocalConsumer { readString = localString.current })
+ }
+ }
+ }
+
+ // Act.
+ rule.runOnIdle { secondParentRemoved = true }
+
+ // Assert.
+ rule.runOnIdle { assertThat(readString).isEqualTo(providedByParent1) }
+ }
+
+ @Test
+ fun modifierLocalProviderMoved_readsDefaultValue() {
+ // Arrange.
+ val localString = modifierLocalOf { defaultValue }
+ var providerMoved by mutableStateOf(false)
+ val providedValue = "ProvidedValue"
+ val providerModifier = Modifier.modifierLocalProvider(localString) { providedValue }
+ lateinit var readString: String
+ rule.setContent {
+ Box(Modifier.then(if (providerMoved) Modifier else providerModifier)) {
+ Box(Modifier.modifierLocalConsumer { readString = localString.current }) {
+ Box(Modifier.then(if (providerMoved) providerModifier else Modifier))
+ }
+ }
+ }
+
+ // Act.
+ rule.runOnIdle { providerMoved = true }
+
+ // Assert.
+ rule.runOnIdle { assertThat(readString).isEqualTo(defaultValue) }
+ }
+
+ @Test
+ fun modifierLocalProviderMoved_readsPreviousParent() {
+ // Arrange.
+ val localString = modifierLocalOf { defaultValue }
+ val providedByParent1 = "Parent1"
+ var secondParentMoved by mutableStateOf(false)
+ val providedByParent2 = "Parent2"
+ val parent2Modifier = Modifier.modifierLocalProvider(localString) { providedByParent2 }
+ lateinit var readString: String
+ rule.setContent {
+ Box(Modifier.modifierLocalProvider(localString) { providedByParent1 }) {
+ Box(Modifier.then(if (secondParentMoved) Modifier else parent2Modifier)) {
+ Box(Modifier.modifierLocalConsumer { readString = localString.current }) {
+ Box(Modifier.then(if (secondParentMoved) parent2Modifier else Modifier))
+ }
+ }
+ }
+ }
+
+ // Act.
+ rule.runOnIdle { secondParentMoved = true }
+
+ // Assert.
+ rule.runOnIdle { assertThat(readString).isEqualTo(providedByParent1) }
+ }
+
+ @Test
+ fun modifierLocalProviderMoved_readsSameValue() {
+ // Arrange.
+ val localString = modifierLocalOf { defaultValue }
+ var providerMoved by mutableStateOf(false)
+ val providedValue = "ProvidedValue"
+ val providerModifier = Modifier.modifierLocalProvider(localString) { providedValue }
+ lateinit var readString: String
+ rule.setContent {
+ Box(Modifier.then(if (providerMoved) Modifier else providerModifier)) {
+ Box(Modifier.size(100.dp)) {
+ Box(Modifier.then(if (providerMoved) providerModifier else Modifier)) {
+ Box(Modifier.modifierLocalConsumer { readString = localString.current })
+ }
+ }
+ }
+ }
+
+ // Act.
+ rule.runOnIdle { providerMoved = true }
+
+ // Assert.
+ rule.runOnIdle { assertThat(readString).isEqualTo(providedValue) }
+ }
+}
\ No newline at end of file
diff --git a/compose/ui/ui/src/androidAndroidTest/kotlin/androidx/compose/ui/modifier/ModifierLocalProviderConsumerOrder.kt b/compose/ui/ui/src/androidAndroidTest/kotlin/androidx/compose/ui/modifier/ModifierLocalProviderConsumerOrder.kt
new file mode 100644
index 0000000..d3f5768
--- /dev/null
+++ b/compose/ui/ui/src/androidAndroidTest/kotlin/androidx/compose/ui/modifier/ModifierLocalProviderConsumerOrder.kt
@@ -0,0 +1,87 @@
+/*
+ * Copyright 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES 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.compose.ui.modifier
+
+import androidx.compose.foundation.layout.Box
+import androidx.compose.runtime.derivedStateOf
+import androidx.compose.runtime.getValue
+import androidx.compose.ui.test.junit4.createComposeRule
+import androidx.test.ext.junit.runners.AndroidJUnit4
+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
+
+@MediumTest
+@RunWith(AndroidJUnit4::class)
+class ModifierLocalProviderConsumerOrder {
+
+ @get:Rule
+ val rule = createComposeRule()
+
+ private val defaultValue = "Default Value"
+ private val key = modifierLocalOf { defaultValue }
+
+ @Test
+ fun modifierDoesNotConsumeTheValueItProduced() {
+ // Arrange.
+ val providedValue = "Provided Value"
+ lateinit var consumedValue: String
+ rule.setContent {
+ Box(
+ ProviderConsumerModifier(key, { providedValue }) {
+ consumedValue = key.current
+ }
+ )
+ }
+
+ // Assert.
+ assertThat(consumedValue).isEqualTo(defaultValue)
+ }
+
+ @Test
+ fun modifierConsumesTheValueProducedByParent() {
+ // Arrange.
+ val parentProvidedValue = "Parent Provided Value"
+ val providedValue = "Provided Value"
+ lateinit var consumedValue: String
+ rule.setContent {
+ Box(ProviderConsumerModifier(key, { parentProvidedValue }) {}) {
+ Box(
+ ProviderConsumerModifier(key, { providedValue }) {
+ consumedValue = key.current
+ }
+ )
+ }
+ }
+
+ // Assert.
+ assertThat(consumedValue).isEqualTo(parentProvidedValue)
+ }
+}
+
+class ProviderConsumerModifier<T>(
+ override val key: ProvidableModifierLocal<T>,
+ value: () -> T,
+ private val consumer: ModifierLocalReadScope.() -> Unit
+) : ModifierLocalConsumer, ModifierLocalProvider<T> {
+ override val value by derivedStateOf(value)
+ override fun onModifierLocalsUpdated(scope: ModifierLocalReadScope) {
+ consumer(scope)
+ }
+}
diff --git a/compose/ui/ui/src/androidAndroidTest/kotlin/androidx/compose/ui/modifier/ModifierLocalSameLayoutNodeTest.kt b/compose/ui/ui/src/androidAndroidTest/kotlin/androidx/compose/ui/modifier/ModifierLocalSameLayoutNodeTest.kt
new file mode 100644
index 0000000..b3c6c88
--- /dev/null
+++ b/compose/ui/ui/src/androidAndroidTest/kotlin/androidx/compose/ui/modifier/ModifierLocalSameLayoutNodeTest.kt
@@ -0,0 +1,423 @@
+/*
+ * Copyright 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES 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.compose.ui.modifier
+
+import androidx.compose.foundation.layout.Box
+import androidx.compose.foundation.layout.size
+import androidx.compose.runtime.getValue
+import androidx.compose.runtime.mutableStateOf
+import androidx.compose.runtime.setValue
+import androidx.compose.ui.ExperimentalComposeUiApi
+import androidx.compose.ui.Modifier
+import androidx.compose.ui.test.junit4.createComposeRule
+import androidx.compose.ui.unit.dp
+import androidx.test.ext.junit.runners.AndroidJUnit4
+import androidx.test.filters.MediumTest
+import kotlin.test.assertFailsWith
+import com.google.common.truth.Truth.assertThat
+import org.junit.Rule
+import org.junit.Test
+import org.junit.runner.RunWith
+
+@OptIn(ExperimentalComposeUiApi::class)
+@MediumTest
+@RunWith(AndroidJUnit4::class)
+class ModifierLocalSameLayoutNodeTest {
+
+ @get:Rule
+ val rule = createComposeRule()
+
+ private val defaultValue = "Default Value"
+
+ @Test
+ fun exceptionInsteadOfDefaultValue() {
+ // Arrange.
+ val localString = modifierLocalOf<String> { error("No default value") }
+ rule.setContent {
+ Box(
+ Modifier.modifierLocalConsumer {
+ assertFailsWith<IllegalStateException>("No default value") {
+ localString.current
+ }
+ }
+ )
+ }
+ }
+
+ @Test
+ fun defaultValue() {
+ // Arrange.
+ val localString = modifierLocalOf { defaultValue }
+ lateinit var readValue: String
+ rule.setContent {
+ Box(
+ Modifier.modifierLocalConsumer {
+ readValue = localString.current
+ }
+ )
+ }
+
+ // Assert.
+ rule.runOnIdle { assertThat(readValue).isEqualTo(defaultValue) }
+ }
+
+ @Test
+ fun doesNotReadValuesProvidedAfterThisModifier() {
+ // Arrange.
+ val localString = modifierLocalOf { defaultValue }
+ val providedValue = "Provided Value"
+ lateinit var readValue: String
+ rule.setContent {
+ Box(
+ Modifier
+ .modifierLocalConsumer { readValue = localString.current }
+ .modifierLocalProvider(localString) { providedValue }
+ )
+ }
+
+ // Assert.
+ rule.runOnIdle { assertThat(readValue).isEqualTo(defaultValue) }
+ }
+
+ @Test
+ fun readValueProvidedImmediatelyBeforeThisModifier() {
+ // Arrange.
+ val localString = modifierLocalOf { defaultValue }
+ val providedValue = "Provided Value"
+ lateinit var readValue: String
+ rule.setContent {
+ Box(
+ Modifier
+ .modifierLocalProvider(localString) { providedValue }
+ .modifierLocalConsumer { readValue = localString.current }
+ )
+ }
+
+ // Assert.
+ rule.runOnIdle { assertThat(readValue).isEqualTo(providedValue) }
+ }
+
+ @Test
+ fun readValueProvidedBeforeThisModifier() {
+ // Arrange.
+ val localString = modifierLocalOf { defaultValue }
+ val providedValue = "Provided Value"
+ lateinit var readValue: String
+ rule.setContent {
+ Box(
+ Modifier
+ .modifierLocalProvider(localString) { providedValue }
+ .size(100.dp)
+ .modifierLocalConsumer { readValue = localString.current }
+ )
+ }
+
+ // Assert.
+ rule.runOnIdle { assertThat(readValue).isEqualTo(providedValue) }
+ }
+
+ @Test
+ fun readsTheLastValueProvidedBeforeThisModifier() {
+ // Arrange.
+ val localString = modifierLocalOf { defaultValue }
+ val providedValue1 = "Provided Value 1"
+ val providedValue2 = "Provided Value 2"
+ lateinit var readValue: String
+ rule.setContent {
+ Box(
+ Modifier
+ .modifierLocalProvider(localString) { providedValue1 }
+ .modifierLocalProvider(localString) { providedValue2 }
+ .modifierLocalConsumer { readValue = localString.current }
+ )
+ }
+
+ // Assert.
+ rule.runOnIdle { assertThat(readValue).isEqualTo(providedValue2) }
+ }
+
+ @Test
+ fun multipleModifierLocalsOfSameDataType() {
+ // Arrange.
+ val localString1 = modifierLocalOf { defaultValue }
+ val localString2 = modifierLocalOf { defaultValue }
+ val providedValue1 = "Provided Value 1"
+ val providedValue2 = "Provided Value 2"
+ lateinit var readValue1: String
+ lateinit var readValue2: String
+ rule.setContent {
+ Box(
+ Modifier
+ .modifierLocalProvider(localString1) { providedValue1 }
+ .modifierLocalProvider(localString2) { providedValue2 }
+ .modifierLocalConsumer {
+ readValue1 = localString1.current
+ readValue2 = localString2.current
+ }
+ )
+ }
+
+ // Assert.
+ rule.runOnIdle {
+ assertThat(readValue1).isEqualTo(providedValue1)
+ assertThat(readValue2).isEqualTo(providedValue2)
+ }
+ }
+
+ @Test
+ fun multipleModifierLocalsWithDifferentDataType() {
+ // Arrange.
+ val localString = modifierLocalOf { defaultValue }
+ val localInteger = modifierLocalOf { Int.MIN_VALUE }
+ val providedString = "Provided Value"
+ val providedInteger = 100
+ lateinit var readString: String
+ var readInteger = 0
+ rule.setContent {
+ Box(
+ Modifier
+ .modifierLocalProvider(localString) { providedString }
+ .modifierLocalProvider(localInteger) { providedInteger }
+ .modifierLocalConsumer {
+ readString = localString.current
+ readInteger = localInteger.current
+ }
+ )
+ }
+
+ // Assert.
+ rule.runOnIdle {
+ assertThat(readString).isEqualTo(providedString)
+ assertThat(readInteger).isEqualTo(providedInteger)
+ }
+ }
+
+ @Test
+ fun modifierLocalProviderChanged() {
+ // Arrange.
+ val localString = modifierLocalOf { defaultValue }
+ val provider1value = "Provider1"
+ val provider2value = "Provider2"
+ var useFirstProvider by mutableStateOf(true)
+ lateinit var readString: String
+ rule.setContent {
+ Box(
+ Modifier
+ .then(
+ if (useFirstProvider) {
+ Modifier.modifierLocalProvider(localString) { provider1value }
+ } else {
+ Modifier.modifierLocalProvider(localString) { provider2value }
+ }
+ )
+ .modifierLocalConsumer { readString = localString.current }
+ )
+ }
+
+ // Act.
+ rule.runOnIdle { useFirstProvider = false }
+
+ // Assert.
+ rule.runOnIdle { assertThat(readString).isEqualTo(provider2value) }
+ }
+
+ @Test
+ fun modifierLocalProviderValueChanged() {
+ // Arrange.
+ val localString = modifierLocalOf { defaultValue }
+ val value1 = "Value1"
+ val value2 = "Value2"
+ var useFirstValue by mutableStateOf(true)
+ lateinit var readString: String
+ rule.setContent {
+ Box(
+ Modifier
+ .modifierLocalProvider(localString) { if (useFirstValue) value1 else value2 }
+ .modifierLocalConsumer { readString = localString.current }
+ )
+ }
+
+ // Act.
+ rule.runOnIdle { useFirstValue = false }
+
+ // Assert.
+ rule.runOnIdle { assertThat(readString).isEqualTo(value2) }
+ }
+
+ @Test
+ fun modifierLocalProviderAdded() {
+ // Arrange.
+ val localString = modifierLocalOf { defaultValue }
+ val providedByParent1 = "Parent1"
+ var secondParentAdded by mutableStateOf(false)
+ val providedByParent2 = "Parent2"
+ lateinit var readString: String
+ rule.setContent {
+ Box(
+ Modifier
+ .modifierLocalProvider(localString) { providedByParent1 }
+ .then(
+ if (secondParentAdded) {
+ Modifier.modifierLocalProvider(localString) { providedByParent2 }
+ } else {
+ Modifier
+ }
+ )
+ .modifierLocalConsumer { readString = localString.current }
+ )
+ }
+
+ // Act.
+ rule.runOnIdle { secondParentAdded = true }
+
+ // Assert.
+ rule.runOnIdle { assertThat(readString).isEqualTo(providedByParent2) }
+ }
+
+ @Test
+ fun modifierLocalProviderRemoved_readsDefaultValue() {
+ // Arrange.
+ val localString = modifierLocalOf { defaultValue }
+ val providedValue = "Parent"
+ var providerRemoved by mutableStateOf(false)
+ lateinit var readString: String
+ rule.setContent {
+ Box(
+ Modifier
+ .then(
+ if (providerRemoved) {
+ Modifier
+ } else {
+ Modifier.modifierLocalProvider(localString) { providedValue }
+ }
+ )
+ .modifierLocalConsumer { readString = localString.current }
+ )
+ }
+
+ // Act.
+ rule.runOnIdle { providerRemoved = true }
+
+ // Assert.
+ rule.runOnIdle { assertThat(readString).isEqualTo(defaultValue) }
+ }
+
+ @Test
+ fun modifierLocalProviderRemoved_readsPreviousParent() {
+ // Arrange.
+ val localString = modifierLocalOf { defaultValue }
+ val providedByParent1 = "Parent1"
+ var secondParentRemoved by mutableStateOf(false)
+ val providedByParent2 = "Parent2"
+ lateinit var readString: String
+ rule.setContent {
+ Box(
+ Modifier
+ .modifierLocalProvider(localString) { providedByParent1 }
+ .then(
+ if (secondParentRemoved) {
+ Modifier
+ } else {
+ Modifier.modifierLocalProvider(localString) { providedByParent2 }
+ }
+ )
+ .modifierLocalConsumer { readString = localString.current }
+ )
+ }
+
+ // Act.
+ rule.runOnIdle { secondParentRemoved = true }
+
+ // Assert.
+ rule.runOnIdle { assertThat(readString).isEqualTo(providedByParent1) }
+ }
+
+ @Test
+ fun modifierLocalProviderMoved_readsDefaultValue() {
+ // Arrange.
+ val localString = modifierLocalOf { defaultValue }
+ var providerMoved by mutableStateOf(false)
+ val providedValue = "ProvidedValue"
+ val providerModifier = Modifier.modifierLocalProvider(localString) { providedValue }
+ lateinit var readString: String
+ rule.setContent {
+ Box(
+ Modifier
+ .then(if (providerMoved) Modifier else providerModifier)
+ .modifierLocalConsumer { readString = localString.current }
+ .then(if (providerMoved) providerModifier else Modifier)
+ )
+ }
+
+ // Act.
+ rule.runOnIdle { providerMoved = true }
+
+ // Assert.
+ rule.runOnIdle { assertThat(readString).isEqualTo(defaultValue) }
+ }
+
+ @Test
+ fun modifierLocalProviderMoved_readsPreviousParent() {
+ // Arrange.
+ val localString = modifierLocalOf { defaultValue }
+ val providedByParent1 = "Parent1"
+ var secondParentMoved by mutableStateOf(false)
+ val providedByParent2 = "Parent2"
+ val parent2Modifier = Modifier.modifierLocalProvider(localString) { providedByParent2 }
+ lateinit var readString: String
+ rule.setContent {
+ Box(
+ Modifier
+ .modifierLocalProvider(localString) { providedByParent1 }
+ .then(if (secondParentMoved) Modifier else parent2Modifier)
+ .modifierLocalConsumer { readString = localString.current }
+ .then(if (secondParentMoved) parent2Modifier else Modifier)
+ )
+ }
+
+ // Act.
+ rule.runOnIdle { secondParentMoved = true }
+
+ // Assert.
+ rule.runOnIdle { assertThat(readString).isEqualTo(providedByParent1) }
+ }
+
+ @Test
+ fun modifierLocalProviderMoved_readsSameValue() {
+ // Arrange.
+ val localString = modifierLocalOf { defaultValue }
+ var providerMoved by mutableStateOf(false)
+ val providedValue = "ProvidedValue"
+ val providerModifier = Modifier.modifierLocalProvider(localString) { providedValue }
+ lateinit var readString: String
+ rule.setContent {
+ Box(
+ Modifier
+ .then(if (providerMoved) Modifier else providerModifier)
+ .size(100.dp)
+ .then(if (providerMoved) providerModifier else Modifier)
+ .modifierLocalConsumer { readString = localString.current }
+ )
+ }
+
+ // Act.
+ rule.runOnIdle { providerMoved = true }
+
+ // Assert.
+ rule.runOnIdle { assertThat(readString).isEqualTo(providedValue) }
+ }
+}
\ No newline at end of file
diff --git a/compose/ui/ui/src/androidMain/kotlin/androidx/compose/ui/input/pointer/MotionEventAdapter.android.kt b/compose/ui/ui/src/androidMain/kotlin/androidx/compose/ui/input/pointer/MotionEventAdapter.android.kt
index ace0b6f..caa7312 100644
--- a/compose/ui/ui/src/androidMain/kotlin/androidx/compose/ui/input/pointer/MotionEventAdapter.android.kt
+++ b/compose/ui/ui/src/androidMain/kotlin/androidx/compose/ui/input/pointer/MotionEventAdapter.android.kt
@@ -30,6 +30,7 @@
import androidx.annotation.DoNotInline
import androidx.annotation.RequiresApi
import androidx.annotation.VisibleForTesting
+import androidx.compose.ui.ExperimentalComposeUiApi
import androidx.compose.ui.geometry.Offset
/**
@@ -194,6 +195,7 @@
/**
* Creates a new PointerInputEventData.
*/
+ @OptIn(ExperimentalComposeUiApi::class)
private fun createPointerInputEventData(
positionCalculator: PositionCalculator,
motionEvent: MotionEvent,
@@ -232,13 +234,25 @@
else -> PointerType.Unknown
}
+ val historical = mutableListOf<HistoricalChange>()
+ with(motionEvent) {
+ repeat(getHistorySize()) { pos ->
+ val historicalChange = HistoricalChange(
+ getHistoricalEventTime(pos),
+ Offset(getHistoricalX(index, pos), getHistoricalY(index, pos))
+ )
+ historical.add(historicalChange)
+ }
+ }
+
return PointerInputEventData(
pointerId,
motionEvent.eventTime,
rawPosition,
position,
pressed,
- toolType
+ toolType,
+ historical
)
}
}
diff --git a/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/input/pointer/HitPathTracker.kt b/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/input/pointer/HitPathTracker.kt
index f1c9a97..f1e51280 100644
--- a/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/input/pointer/HitPathTracker.kt
+++ b/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/input/pointer/HitPathTracker.kt
@@ -18,6 +18,7 @@
import androidx.compose.runtime.collection.MutableVector
import androidx.compose.runtime.collection.mutableVectorOf
+import androidx.compose.ui.ExperimentalComposeUiApi
import androidx.compose.ui.layout.LayoutCoordinates
import androidx.compose.ui.node.InternalCoreApi
import androidx.compose.ui.util.fastForEach
@@ -327,12 +328,23 @@
coordinates = pointerInputFilter.layoutCoordinates
+ @OptIn(ExperimentalComposeUiApi::class)
for ((key, change) in changes) {
// Filter for changes that are associated with pointer ids that are relevant to this
// node
if (key in pointerIds) {
// And translate their position relative to the parent coordinates, to give us a
// change local to the PointerInputFilter's coordinates
+ val historical = mutableListOf<HistoricalChange>()
+ change.historical.fastForEach {
+ historical.add(
+ HistoricalChange(
+ it.uptimeMillis,
+ coordinates!!.localPositionOf(parentCoordinates, it.position)
+ )
+ )
+ }
+
relevantChanges[key] = change.copy(
previousPosition = coordinates!!.localPositionOf(
parentCoordinates,
@@ -341,7 +353,8 @@
currentPosition = coordinates!!.localPositionOf(
parentCoordinates,
change.position
- )
+ ),
+ historical = historical
)
}
}
diff --git a/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/input/pointer/InternalPointerInput.kt b/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/input/pointer/InternalPointerInput.kt
index 21dab8f..783debd8 100644
--- a/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/input/pointer/InternalPointerInput.kt
+++ b/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/input/pointer/InternalPointerInput.kt
@@ -16,6 +16,7 @@
package androidx.compose.ui.input.pointer
+import androidx.compose.ui.ExperimentalComposeUiApi
import androidx.compose.ui.geometry.Offset
import androidx.compose.ui.node.InternalCoreApi
@@ -36,13 +37,15 @@
*
* [positionOnScreen] is relative to the device screen. [position] is relative to the owner.
*/
+@OptIn(ExperimentalComposeUiApi::class)
internal data class PointerInputEventData(
val id: PointerId,
val uptime: Long,
val positionOnScreen: Offset,
val position: Offset,
val down: Boolean,
- val type: PointerType
+ val type: PointerType,
+ val historical: List<HistoricalChange> = mutableListOf()
)
/**
diff --git a/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/input/pointer/PointerEvent.kt b/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/input/pointer/PointerEvent.kt
index fec50ed..762748b 100644
--- a/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/input/pointer/PointerEvent.kt
+++ b/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/input/pointer/PointerEvent.kt
@@ -19,6 +19,7 @@
package androidx.compose.ui.input.pointer
import androidx.compose.runtime.Immutable
+import androidx.compose.ui.ExperimentalComposeUiApi
import androidx.compose.ui.Modifier
import androidx.compose.ui.geometry.Offset
import androidx.compose.ui.geometry.Size
@@ -379,6 +380,7 @@
* or [touch][PointerType.Touch].git
*/
@Immutable
+@OptIn(ExperimentalComposeUiApi::class)
class PointerInputChange(
val id: PointerId,
val uptimeMillis: Long,
@@ -390,6 +392,43 @@
val consumed: ConsumedData,
val type: PointerType = PointerType.Touch
) {
+ /**
+ * Optional high-frequency pointer moves in between the last two dispatched events.
+ * Can be used for extra accuracy when touchscreen rate exceeds framerate.
+ */
+ // With these experimental annotations, the API can be either cleanly removed or
+ // stabilized. It doesn't appear in current.txt; and in experimental_current.txt,
+ // it has the same effect as a primary constructor val.
+ val historical: List<HistoricalChange>
+ @ExperimentalComposeUiApi get() = _historical ?: listOf()
+ private var _historical: List<HistoricalChange>? = null
+
+ @ExperimentalComposeUiApi
+ constructor(
+ id: PointerId,
+ uptimeMillis: Long,
+ position: Offset,
+ pressed: Boolean,
+ previousUptimeMillis: Long,
+ previousPosition: Offset,
+ previousPressed: Boolean,
+ consumed: ConsumedData,
+ type: PointerType,
+ historical: List<HistoricalChange>
+ ) : this(
+ id,
+ uptimeMillis,
+ position,
+ pressed,
+ previousUptimeMillis,
+ previousPosition,
+ previousPressed,
+ consumed,
+ type
+ ) {
+ _historical = historical
+ }
+
fun copy(
id: PointerId = this.id,
currentTime: Long = this.uptimeMillis,
@@ -409,7 +448,33 @@
previousPosition,
previousPressed,
consumed,
- type
+ type,
+ this.historical
+ )
+
+ @ExperimentalComposeUiApi
+ fun copy(
+ id: PointerId = this.id,
+ currentTime: Long = this.uptimeMillis,
+ currentPosition: Offset = this.position,
+ currentPressed: Boolean = this.pressed,
+ previousTime: Long = this.previousUptimeMillis,
+ previousPosition: Offset = this.previousPosition,
+ previousPressed: Boolean = this.previousPressed,
+ consumed: ConsumedData = this.consumed,
+ type: PointerType = this.type,
+ historical: List<HistoricalChange>
+ ): PointerInputChange = PointerInputChange(
+ id,
+ currentTime,
+ currentPosition,
+ currentPressed,
+ previousTime,
+ previousPosition,
+ previousPressed,
+ consumed,
+ type,
+ historical
)
override fun toString(): String {
@@ -421,7 +486,31 @@
"previousPosition=$previousPosition, " +
"previousPressed=$previousPressed, " +
"consumed=$consumed, " +
- "type=$type)"
+ "type=$type, " +
+ "historical=$historical)"
+ }
+}
+
+/**
+ * Data structure for "historical" pointer moves.
+ *
+ * Optional high-frequency pointer moves in between the last two dispatched events:
+ * can be used for extra accuracy when touchscreen rate exceeds framerate.
+ *
+ * @param uptimeMillis The time of the historical pointer event, in milliseconds. In between
+ * the current and previous pointer event times.
+ * @param position The [Offset] of the historical pointer event, relative to the containing
+ * element.
+ */
+@Immutable
+@ExperimentalComposeUiApi
+class HistoricalChange(
+ val uptimeMillis: Long,
+ val position: Offset
+) {
+ override fun toString(): String {
+ return "HistoricalChange(uptimeMillis=$uptimeMillis, " +
+ "position=$position)"
}
}
diff --git a/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/input/pointer/PointerInputEventProcessor.kt b/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/input/pointer/PointerInputEventProcessor.kt
index ad3ee3c..6f3d1b5 100644
--- a/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/input/pointer/PointerInputEventProcessor.kt
+++ b/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/input/pointer/PointerInputEventProcessor.kt
@@ -16,6 +16,7 @@
package androidx.compose.ui.input.pointer
+import androidx.compose.ui.ExperimentalComposeUiApi
import androidx.compose.ui.geometry.Offset
import androidx.compose.ui.node.HitTestResult
import androidx.compose.ui.node.InternalCoreApi
@@ -108,7 +109,7 @@
/**
* Produces [InternalPointerEvent]s by tracking changes between [PointerInputEvent]s
*/
-@OptIn(InternalCoreApi::class)
+@OptIn(InternalCoreApi::class, ExperimentalComposeUiApi::class)
private class PointerInputChangeEventProducer {
private val previousPointerInputData: MutableMap<PointerId, PointerInputData> = mutableMapOf()
@@ -149,7 +150,8 @@
previousPosition,
previousDown,
ConsumedData(),
- it.type
+ it.type,
+ it.historical
)
if (it.down) {
previousPointerInputData[it.id] = PointerInputData(
diff --git a/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/input/pointer/util/VelocityTracker.kt b/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/input/pointer/util/VelocityTracker.kt
index 5ccbdd5..2cc81e6 100644
--- a/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/input/pointer/util/VelocityTracker.kt
+++ b/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/input/pointer/util/VelocityTracker.kt
@@ -16,7 +16,10 @@
package androidx.compose.ui.input.pointer.util
+import androidx.compose.ui.ExperimentalComposeUiApi
import androidx.compose.ui.geometry.Offset
+import androidx.compose.ui.input.pointer.PointerInputChange
+import androidx.compose.ui.util.fastForEach
import androidx.compose.ui.unit.Velocity
import kotlin.math.abs
import kotlin.math.sqrt
@@ -157,6 +160,22 @@
}
}
+/**
+ * Track the positions and timestamps inside this event change.
+ *
+ * For optimal tracking, this should be called for the DOWN event and all MOVE
+ * events, including any touch-slop-captured MOVE event.
+ *
+ * @param event Pointer change to track.
+ */
+fun VelocityTracker.addPointerInputChange(event: PointerInputChange) {
+ @OptIn(ExperimentalComposeUiApi::class)
+ event.historical.fastForEach {
+ addPosition(it.uptimeMillis, it.position)
+ }
+ addPosition(event.uptimeMillis, event.position)
+}
+
private data class PointAtTime(val point: Offset, val time: Long)
/**
diff --git a/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/layout/LayoutInfo.kt b/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/layout/LayoutInfo.kt
index ff5ab1d..1497fa8 100644
--- a/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/layout/LayoutInfo.kt
+++ b/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/layout/LayoutInfo.kt
@@ -18,6 +18,8 @@
import androidx.compose.ui.ExperimentalComposeUiApi
import androidx.compose.ui.Modifier
+import androidx.compose.ui.unit.Density
+import androidx.compose.ui.unit.LayoutDirection
/**
* The public information about the layouts used internally as nodes in the Compose UI hierarchy.
@@ -57,6 +59,16 @@
val parentInfo: LayoutInfo?
/**
+ * The density in use for this layout.
+ */
+ val density: Density
+
+ /**
+ * The layout direction in use for this layout.
+ */
+ val layoutDirection: LayoutDirection
+
+ /**
* Returns true if this layout is currently a part of the layout tree.
*/
val isAttached: Boolean
diff --git a/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/modifier/ModifierLocal.kt b/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/modifier/ModifierLocal.kt
new file mode 100644
index 0000000..db74961
--- /dev/null
+++ b/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/modifier/ModifierLocal.kt
@@ -0,0 +1,109 @@
+/*
+ * Copyright 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES 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.compose.ui.modifier
+
+import androidx.compose.runtime.Stable
+
+/**
+ * [ModifierLocal]s provide a means of inter-modifier communication. When a modifier provides a
+ * [ModifierLocal], it is available to modifiers on the right of the providing modifier for the
+ * current layout node. The provided [ModifierLocal]s are also available to layout nodes that are
+ * children of the current layout node.
+ *
+ * One must create a [ModifierLocal] instance, which cah be referenced by consumers statically.
+ * [ModifierLocal] instances themselves hold no data, and can be thought of as a type-safe
+ * identifier for the data being passed to other modifiers to the right of the providing
+ * modifier or down the tree. [ModifierLocal] factory functions take a single parameter: a
+ * factory to create a default value in cases where a [ModifierLocal] is used without a Provider.
+ * If this is a situation you would rather not handle, you can throw an error in this factory.
+ *
+ * To add a value that can be accessed by other modifiers, create an instance of a
+ * [ProvidableModifierLocal] and add it to the tree by using a [modifierLocalProvider]. Now other
+ * modifiers can access the provided value by using a [modifierLocalConsumer].
+ *
+ * @see ProvidableModifierLocal
+ * @see modifierLocalOf
+ * @see modifierLocalProvider
+ * @see modifierLocalConsumer
+ */
+@Stable
+sealed class ModifierLocal<T> private constructor(internal val defaultFactory: () -> T)
+
+/**
+ * [ProvidableModifierLocal]s are [ModifierLocal]s that can be used to provide values using a
+ * [ModifierLocalProvider].
+ *
+ * When you create an instance of a [ProvidableModifierLocal], and want to prevent users of
+ * your library from providing new values but want to allow the values to be consumed, expose a
+ * [ModifierLocal] instead.
+ *
+ * @see ModifierLocal
+ * @see modifierLocalOf
+ * @see modifierLocalProvider
+ * @see modifierLocalConsumer
+ */
+@Stable
+class ProvidableModifierLocal<T>(defaultFactory: () -> T) : ModifierLocal<T>(defaultFactory)
+
+/**
+ * Creates a [ProvidableModifierLocal] and specifies a default factory.
+ *
+ * @param defaultFactory a factory to create a default value in cases where a [ModifierLocal] is
+ * consumed without a Provider. If this is a situation you would rather not handle, you can throw
+ * an error in this factory.
+ *
+ * Here are examples where a modifier can communicate with another in the same modifier chain:
+ *
+ * Sample 1: Modifier sending a message to another to its right.
+ *
+ * @sample androidx.compose.ui.samples.ModifierLocalParentChildCommunicationWithinLayoutNodeSample
+ *
+ * Sample 2: Modifier sending a message to another to its left.
+ *
+ * @sample androidx.compose.ui.samples.ModifierLocalChildParentCommunicationWithinLayoutNodeSample
+ *
+ * Here are examples where a modifier can communicate with another across layout nodes:
+ *
+ * Sample 1: Modifier sending a message to a modifier on a child layout node.
+ *
+ * @sample androidx.compose.ui.samples.ModifierLocalParentChildCommunicationInterLayoutNodeSample
+ *
+ * Sample 2: Modifier sending a message to a modifier on a parent layout node.
+ *
+ * @sample androidx.compose.ui.samples.ModifierLocalChildParentCommunicationInterLayoutNodeSample
+ *
+ * @see ProvidableModifierLocal
+ * @see ModifierLocal
+ * @see modifierLocalProvider
+ * @see modifierLocalConsumer
+ */
+fun <T> modifierLocalOf(defaultFactory: () -> T): ProvidableModifierLocal<T> =
+ ProvidableModifierLocal(defaultFactory)
+
+/**
+ * This scope gives us access to modifier locals that are provided by other modifiers to the left
+ * of this modifier, or above this modifier in the layout tree.
+ *
+ * @see modifierLocalOf
+ */
+interface ModifierLocalReadScope {
+ /**
+ * Read a [ModifierLocal] that was provided by other modifiers to the left of this modifier,
+ * or above this modifier in the layout tree.
+ */
+ val <T> ModifierLocal<T>.current: T
+}
\ No newline at end of file
diff --git a/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/modifier/ModifierLocalConsumer.kt b/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/modifier/ModifierLocalConsumer.kt
new file mode 100644
index 0000000..9cc527d
--- /dev/null
+++ b/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/modifier/ModifierLocalConsumer.kt
@@ -0,0 +1,72 @@
+/*
+ * Copyright 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES 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.compose.ui.modifier
+
+import androidx.compose.runtime.Stable
+import androidx.compose.ui.ExperimentalComposeUiApi
+import androidx.compose.ui.Modifier
+import androidx.compose.ui.platform.InspectorInfo
+import androidx.compose.ui.platform.InspectorValueInfo
+import androidx.compose.ui.platform.debugInspectorInfo
+
+/**
+ * A Modifier that can be used to consume [ModifierLocal]s that were provided by other modifiers to
+ * the left of this modifier, or above this modifier in the layout tree.
+ */
+@Stable
+interface ModifierLocalConsumer : Modifier.Element {
+ /**
+ * This function is called whenever one of the consumed values has changed.
+ * This could be called in response to the modifier being added, removed or re-ordered.
+ */
+ fun onModifierLocalsUpdated(scope: ModifierLocalReadScope)
+}
+
+/**
+ * A Modifier that can be used to consume [ModifierLocal]s that were provided by other modifiers to
+ * the left of this modifier, or above this modifier in the layout tree.
+ */
+@Stable
+@ExperimentalComposeUiApi
+fun Modifier.modifierLocalConsumer(consumer: ModifierLocalReadScope.() -> Unit): Modifier {
+ return this.then(
+ ModifierLocalConsumerImpl(
+ consumer,
+ debugInspectorInfo {
+ name = "modifierLocalConsumer"
+ properties["consumer"] = consumer
+ }
+ )
+ )
+}
+
+@Stable
+private class ModifierLocalConsumerImpl(
+ val consumer: ModifierLocalReadScope.() -> Unit,
+ debugInspectorInfo: InspectorInfo.() -> Unit
+) : ModifierLocalConsumer, InspectorValueInfo(debugInspectorInfo) {
+
+ override fun onModifierLocalsUpdated(scope: ModifierLocalReadScope) {
+ consumer.invoke(scope)
+ }
+
+ override fun equals(other: Any?): Boolean {
+ return other is ModifierLocalConsumerImpl && other.consumer == consumer
+ }
+
+ override fun hashCode() = consumer.hashCode()
+}
\ No newline at end of file
diff --git a/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/modifier/ModifierLocalProvider.kt b/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/modifier/ModifierLocalProvider.kt
new file mode 100644
index 0000000..15a2dfc
--- /dev/null
+++ b/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/modifier/ModifierLocalProvider.kt
@@ -0,0 +1,67 @@
+/*
+ * Copyright 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES 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.compose.ui.modifier
+
+import androidx.compose.runtime.Stable
+import androidx.compose.runtime.derivedStateOf
+import androidx.compose.runtime.getValue
+import androidx.compose.ui.ExperimentalComposeUiApi
+import androidx.compose.ui.Modifier
+import androidx.compose.ui.platform.InspectorValueInfo
+import androidx.compose.ui.platform.debugInspectorInfo
+
+/**
+ * A Modifier that can be used to provide [ModifierLocal]s that can be read by other modifiers to
+ * the right of this modifier, or modifiers that are children of the layout node that this
+ * modifier is attached to.
+ */
+@Stable
+interface ModifierLocalProvider<T> : Modifier.Element {
+ /**
+ * Each [ModifierLocalProvider] stores a [ModifierLocal] instance that can be used as a key
+ * by a [ModifierLocalConsumer] to read the provided value.
+ */
+ val key: ProvidableModifierLocal<T>
+
+ /**
+ * The provided value, that can be read by modifiers on the right of this modifier, and
+ * modifiers added to children of the composable using this modifier.
+ */
+ val value: T
+}
+
+/**
+ * A Modifier that can be used to provide [ModifierLocal]s that can be read by other modifiers to
+ * the right of this modifier, or modifiers that are children of the layout node that this
+ * modifier is attached to.
+ */
+@ExperimentalComposeUiApi
+fun <T> Modifier.modifierLocalProvider(key: ProvidableModifierLocal<T>, value: () -> T): Modifier {
+ return this.then(
+ object : ModifierLocalProvider<T>,
+ InspectorValueInfo(
+ debugInspectorInfo {
+ name = "modifierLocalProvider"
+ properties["key"] = key
+ properties["value"] = value
+ }
+ ) {
+ override val key: ProvidableModifierLocal<T> = key
+ override val value by derivedStateOf(value)
+ }
+ )
+}
\ No newline at end of file
diff --git a/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/node/LayoutNode.kt b/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/node/LayoutNode.kt
index 9e3a1fd..f285a7b 100644
--- a/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/node/LayoutNode.kt
+++ b/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/node/LayoutNode.kt
@@ -50,6 +50,8 @@
import androidx.compose.ui.layout.RelocationRequesterModifier
import androidx.compose.ui.layout.Remeasurement
import androidx.compose.ui.layout.RemeasurementModifier
+import androidx.compose.ui.modifier.ModifierLocalConsumer
+import androidx.compose.ui.modifier.ModifierLocalProvider
import androidx.compose.ui.node.LayoutNode.LayoutState.LayingOut
import androidx.compose.ui.node.LayoutNode.LayoutState.Measuring
import androidx.compose.ui.node.LayoutNode.LayoutState.NeedsRelayout
@@ -86,7 +88,7 @@
// but just a holder for its children - allows us to combine some children into something we
// can subcompose in(LayoutNode) without being required to define it as a real layout - we
// don't want to define the layout strategy for such nodes, instead the children of the
- // virtual nodes will be threated as the direct children of the virtual node parent.
+ // virtual nodes will be treated as the direct children of the virtual node parent.
// This whole concept will be replaced with a proper subcomposition logic which allows to
// subcompose multiple times into the same LayoutNode and define offsets.
@@ -676,6 +678,13 @@
// DrawModifier block should be before the LayoutModifier block so that a
// Modifier that implements both DrawModifier and LayoutModifier will have
// it's draw bounds reflect the dimensions defined by the LayoutModifier.
+ // Please ensure that ModifierLocalProvider is the first item here so that
+ // other layoutNodeWrappers don't accidentally use values that they provided.
+ // Also ensure that ModifierLocalConsumer is the last item here, so that the
+ // other modifiers can access ModifierLocals read by the ModifierLocalConsumer.
+ if (mod is ModifierLocalProvider<*>) {
+ wrapper = ModifierLocalProviderNode(wrapper, mod).assignChained(toWrap)
+ }
if (mod is DrawModifier) {
wrapper = ModifiedDrawNode(wrapper, mod)
}
@@ -725,6 +734,9 @@
OnGloballyPositionedModifierWrapper(wrapper, mod).assignChained(toWrap)
getOrCreateOnPositionedCallbacks() += wrapper
}
+ if (mod is ModifierLocalConsumer) {
+ wrapper = ModifierLocalConsumerNode(wrapper, mod).assignChained(toWrap)
+ }
}
wrapper
}
diff --git a/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/node/LayoutNodeWrapper.kt b/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/node/LayoutNodeWrapper.kt
index 17e93c0..607c31b 100644
--- a/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/node/LayoutNodeWrapper.kt
+++ b/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/node/LayoutNodeWrapper.kt
@@ -42,6 +42,7 @@
import androidx.compose.ui.layout.VerticalAlignmentLine
import androidx.compose.ui.layout.findRoot
import androidx.compose.ui.layout.positionInRoot
+import androidx.compose.ui.modifier.ModifierLocal
import androidx.compose.ui.semantics.SemanticsWrapper
import androidx.compose.ui.unit.Constraints
import androidx.compose.ui.unit.Density
@@ -824,6 +825,16 @@
layer?.invalidate()
}
+ /**
+ * Called when a [ModifierLocalConsumer][androidx.compose.ui.modifier.ModifierLocalConsumer]
+ * reads a value. Ths function walks up the tree and reads any value provided by a parent. If
+ * no value is available it returns the default value associated with the specified
+ * [ModifierLocal].
+ */
+ open fun <T> onModifierLocalRead(modifierLocal: ModifierLocal<T>): T {
+ return wrappedBy?.onModifierLocalRead(modifierLocal) ?: modifierLocal.defaultFactory()
+ }
+
internal fun findCommonAncestor(other: LayoutNodeWrapper): LayoutNodeWrapper {
var ancestor1 = other.layoutNode
var ancestor2 = layoutNode
diff --git a/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/node/ModifierLocalConsumerNode.kt b/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/node/ModifierLocalConsumerNode.kt
new file mode 100644
index 0000000..8966754
--- /dev/null
+++ b/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/node/ModifierLocalConsumerNode.kt
@@ -0,0 +1,52 @@
+/*
+ * Copyright 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES 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.compose.ui.node
+
+import androidx.compose.ui.modifier.ModifierLocal
+import androidx.compose.ui.modifier.ModifierLocalConsumer
+import androidx.compose.ui.modifier.ModifierLocalReadScope
+
+internal class ModifierLocalConsumerNode(
+ wrapped: LayoutNodeWrapper,
+ modifier: ModifierLocalConsumer
+) : DelegatingLayoutNodeWrapper<ModifierLocalConsumer>(wrapped, modifier), ModifierLocalReadScope {
+
+ override fun onModifierChanged() {
+ super.onModifierChanged()
+ if (isAttached) notifyConsumerOfChanges()
+ }
+
+ override fun attach() {
+ super.attach()
+ notifyConsumerOfChanges()
+ }
+
+ override val <T> ModifierLocal<T>.current: T
+ get() = onModifierLocalRead(this)
+
+ private fun notifyConsumerOfChanges() {
+ layoutNode.requireOwner().snapshotObserver.observeReads(this, onReadValuesChanged) {
+ modifier.onModifierLocalsUpdated(this)
+ }
+ }
+
+ companion object {
+ val onReadValuesChanged: (ModifierLocalConsumerNode) -> Unit = { node ->
+ node.notifyConsumerOfChanges()
+ }
+ }
+}
\ No newline at end of file
diff --git a/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/node/ModifierLocalProviderNode.kt b/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/node/ModifierLocalProviderNode.kt
new file mode 100644
index 0000000..1e1f2d4
--- /dev/null
+++ b/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/node/ModifierLocalProviderNode.kt
@@ -0,0 +1,37 @@
+/*
+ * Copyright 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES 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.compose.ui.node
+
+import androidx.compose.ui.modifier.ModifierLocal
+import androidx.compose.ui.modifier.ModifierLocalProvider
+
+internal class ModifierLocalProviderNode <T> (
+ wrapped: LayoutNodeWrapper,
+ modifier: ModifierLocalProvider<T>
+) : DelegatingLayoutNodeWrapper<ModifierLocalProvider<T>>(wrapped, modifier) {
+
+ override fun <V> onModifierLocalRead(modifierLocal: ModifierLocal<V>): V {
+ return if (modifier.key == modifierLocal) {
+ // We need a cast because type information is erased.
+ // When we check for equality of the key it implies that the types are equal too.
+ @Suppress("UNCHECKED_CAST")
+ modifier.value as V
+ } else {
+ super.onModifierLocalRead(modifierLocal)
+ }
+ }
+}
\ No newline at end of file
diff --git a/compose/ui/ui/src/desktopMain/kotlin/androidx/compose/ui/awt/ComposeLayer.desktop.kt b/compose/ui/ui/src/desktopMain/kotlin/androidx/compose/ui/awt/ComposeLayer.desktop.kt
index 06ce4fa..acc12ff 100644
--- a/compose/ui/ui/src/desktopMain/kotlin/androidx/compose/ui/awt/ComposeLayer.desktop.kt
+++ b/compose/ui/ui/src/desktopMain/kotlin/androidx/compose/ui/awt/ComposeLayer.desktop.kt
@@ -186,12 +186,17 @@
override fun mouseEntered(event: MouseEvent) = events.post {
owners.onMouseEntered(
(event.x * density.density).toInt(),
- (event.y * density.density).toInt()
+ (event.y * density.density).toInt(),
+ event
)
}
override fun mouseExited(event: MouseEvent) = events.post {
- owners.onMouseExited()
+ owners.onMouseExited(
+ (event.x * density.density).toInt(),
+ (event.y * density.density).toInt(),
+ event
+ )
}
})
wrapped.addMouseMotionListener(object : MouseMotionAdapter() {
diff --git a/compose/ui/ui/src/desktopMain/kotlin/androidx/compose/ui/input/pointer/PointerMoveFilter.desktop.kt b/compose/ui/ui/src/desktopMain/kotlin/androidx/compose/ui/input/pointer/PointerMoveFilter.desktop.kt
index fd32a10..3130b93 100644
--- a/compose/ui/ui/src/desktopMain/kotlin/androidx/compose/ui/input/pointer/PointerMoveFilter.desktop.kt
+++ b/compose/ui/ui/src/desktopMain/kotlin/androidx/compose/ui/input/pointer/PointerMoveFilter.desktop.kt
@@ -16,11 +16,8 @@
package androidx.compose.ui.input.pointer
-import androidx.compose.runtime.remember
import androidx.compose.ui.Modifier
-import androidx.compose.ui.composed
import androidx.compose.ui.geometry.Offset
-import androidx.compose.ui.unit.IntSize
/**
* Modifier allowing to track pointer (i.e. mouse or trackpad) move events.
@@ -33,28 +30,25 @@
onMove: (position: Offset) -> Boolean = { false },
onExit: () -> Boolean = { false },
onEnter: () -> Boolean = { false },
-): Modifier = composed {
- val filter = remember(::PointerMoveEventFilter)
- filter.onEnterHandler = onEnter
- filter.onExitHandler = onExit
- filter.onMoveHandler = onMove
- MovePointerInputModifierImpl(filter)
+): Modifier = pointerInput(onMove, onExit, onEnter) {
+ awaitPointerEventScope {
+ while (true) {
+ val event = awaitPointerEvent()
+ val consumed = when (event.type) {
+ PointerEventType.Move -> {
+ onMove(event.changes.first().position)
+ }
+ PointerEventType.Enter -> {
+ onEnter()
+ }
+ PointerEventType.Exit -> {
+ onExit()
+ }
+ else -> false
+ }
+ if (consumed) {
+ event.changes.forEach { it.consumeAllChanges() }
+ }
+ }
+ }
}
-
-internal class PointerMoveEventFilter : PointerInputFilter() {
- lateinit var onEnterHandler: () -> Boolean
- lateinit var onExitHandler: () -> Boolean
- lateinit var onMoveHandler: (position: Offset) -> Boolean
-
- override fun onPointerEvent(
- pointerEvent: PointerEvent,
- pass: PointerEventPass,
- bounds: IntSize
- ) = Unit
-
- override fun onCancel() = Unit
-}
-
-private data class MovePointerInputModifierImpl(
- override val pointerInputFilter: PointerInputFilter
-) : PointerInputModifier
\ No newline at end of file
diff --git a/compose/ui/ui/src/desktopMain/kotlin/androidx/compose/ui/platform/DesktopOwner.desktop.kt b/compose/ui/ui/src/desktopMain/kotlin/androidx/compose/ui/platform/DesktopOwner.desktop.kt
index 33b32b3..f627435 100644
--- a/compose/ui/ui/src/desktopMain/kotlin/androidx/compose/ui/platform/DesktopOwner.desktop.kt
+++ b/compose/ui/ui/src/desktopMain/kotlin/androidx/compose/ui/platform/DesktopOwner.desktop.kt
@@ -49,12 +49,10 @@
import androidx.compose.ui.input.pointer.PointerInputEvent
import androidx.compose.ui.input.pointer.PointerInputEventProcessor
import androidx.compose.ui.input.pointer.PointerInputFilter
-import androidx.compose.ui.input.pointer.PointerMoveEventFilter
import androidx.compose.ui.input.pointer.PositionCalculator
import androidx.compose.ui.input.pointer.ProcessResult
import androidx.compose.ui.input.pointer.TestPointerInputEventData
import androidx.compose.ui.layout.RootMeasurePolicy
-import androidx.compose.ui.layout.boundsInWindow
import androidx.compose.ui.node.HitTestResult
import androidx.compose.ui.node.InternalCoreApi
import androidx.compose.ui.node.LayoutNode
@@ -320,7 +318,14 @@
internal fun processPointerInput(event: PointerInputEvent): ProcessResult {
measureAndLayout()
- return pointerInputEventProcessor.process(event, this)
+ return pointerInputEventProcessor.process(
+ event,
+ this,
+ isInBounds = event.pointers.all {
+ it.position.x in 0f..root.width.toFloat() &&
+ it.position.y in 0f..root.height.toFloat()
+ }
+ )
}
override fun processPointerInput(nanoTime: Long, pointers: List<TestPointerInputEventData>) {
@@ -350,78 +355,4 @@
if (isConsumed) break
}
}
-
- private var oldMoveFilters = listOf<PointerMoveEventFilter>()
- private val newMoveFilters = HitTestResult<PointerInputFilter>()
-
- internal fun onPointerMove(position: Offset) {
- // TODO: do we actually need that?
- measureAndLayout()
-
- root.hitTest(position, newMoveFilters)
- // Optimize fastpath, where no pointer move event listeners are there.
- if (newMoveFilters.isEmpty() && oldMoveFilters.isEmpty()) return
-
- // For elements in `newMoveFilters` we call on `onMoveHandler`.
- // For elements in `oldMoveFilters` but not in `newMoveFilters` we call `onExitHandler`.
- // For elements not in `oldMoveFilters` but in `newMoveFilters` we call `onEnterHandler`.
-
- var onMoveConsumed = false
- var onEnterConsumed = false
- var onExitConsumed = false
-
- for (
- filter in newMoveFilters
- .asReversed()
- .asSequence()
- .filterIsInstance<PointerMoveEventFilter>()
- ) {
- if (!onMoveConsumed) {
- val relative = position - filter.layoutCoordinates!!.boundsInWindow().topLeft
- onMoveConsumed = filter.onMoveHandler(relative)
- }
- if (!onEnterConsumed && !oldMoveFilters.contains(filter))
- onEnterConsumed = filter.onEnterHandler()
- }
-
- // TODO: is this quadratic algorithm (by number of matching filters) a problem?
- // Unlikely we'll have significant number of filters.
- for (filter in oldMoveFilters.asReversed()) {
- if (!onExitConsumed && !newMoveFilters.contains(filter))
- onExitConsumed = filter.onExitHandler()
- }
-
- oldMoveFilters = newMoveFilters.filterIsInstance<PointerMoveEventFilter>()
- newMoveFilters.clear()
- }
-
- internal fun onPointerEnter(position: Offset) {
- var onEnterConsumed = false
- // TODO: do we actually need that?
- measureAndLayout()
- root.hitTest(position, newMoveFilters)
- for (
- filter in newMoveFilters
- .asReversed()
- .asSequence()
- .filterIsInstance<PointerMoveEventFilter>()
- ) {
- if (!onEnterConsumed) {
- onEnterConsumed = filter.onEnterHandler()
- }
- }
- oldMoveFilters = newMoveFilters.filterIsInstance<PointerMoveEventFilter>()
- newMoveFilters.clear()
- }
-
- internal fun onPointerExit() {
- var onExitConsumed = false
- for (filter in oldMoveFilters.asReversed()) {
- if (!onExitConsumed) {
- onExitConsumed = filter.onExitHandler()
- }
- }
- oldMoveFilters = listOf()
- newMoveFilters.clear()
- }
}
diff --git a/compose/ui/ui/src/desktopMain/kotlin/androidx/compose/ui/platform/DesktopOwners.desktop.kt b/compose/ui/ui/src/desktopMain/kotlin/androidx/compose/ui/platform/DesktopOwners.desktop.kt
index 18d625b..48c5c27 100644
--- a/compose/ui/ui/src/desktopMain/kotlin/androidx/compose/ui/platform/DesktopOwners.desktop.kt
+++ b/compose/ui/ui/src/desktopMain/kotlin/androidx/compose/ui/platform/DesktopOwners.desktop.kt
@@ -192,13 +192,8 @@
fun onMouseMoved(x: Int, y: Int, nativeEvent: MouseEvent? = null) {
pointLocation = IntOffset(x, y)
- val currentOwner = hoveredOwner
val event = pointerInputEvent(nativeEvent, x, y, isMousePressed)
- val result = currentOwner?.processPointerInput(event)
- if (result?.anyMovementConsumed != true) {
- val position = Offset(x.toFloat(), y.toFloat())
- currentOwner?.onPointerMove(position)
- }
+ hoveredOwner?.processPointerInput(event)
}
fun onMouseScroll(x: Int, y: Int, event: MouseScrollEvent) {
@@ -206,13 +201,14 @@
hoveredOwner?.onMouseScroll(position, event)
}
- fun onMouseEntered(x: Int, y: Int) {
- val position = Offset(x.toFloat(), y.toFloat())
- hoveredOwner?.onPointerEnter(position)
+ fun onMouseEntered(x: Int, y: Int, nativeEvent: MouseEvent? = null) {
+ val event = pointerInputEvent(nativeEvent, x, y, isMousePressed)
+ hoveredOwner?.processPointerInput(event)
}
- fun onMouseExited() {
- hoveredOwner?.onPointerExit()
+ fun onMouseExited(x: Int, y: Int, nativeEvent: MouseEvent? = null) {
+ val event = pointerInputEvent(nativeEvent, x, y, isMousePressed)
+ hoveredOwner?.processPointerInput(event)
}
private fun consumeKeyEvent(event: KeyEvent): Boolean {
diff --git a/compose/ui/ui/src/desktopMain/kotlin/androidx/compose/ui/platform/TestComposeWindow.desktop.kt b/compose/ui/ui/src/desktopMain/kotlin/androidx/compose/ui/platform/TestComposeWindow.desktop.kt
index 075562b..c5abc0e3 100644
--- a/compose/ui/ui/src/desktopMain/kotlin/androidx/compose/ui/platform/TestComposeWindow.desktop.kt
+++ b/compose/ui/ui/src/desktopMain/kotlin/androidx/compose/ui/platform/TestComposeWindow.desktop.kt
@@ -29,6 +29,8 @@
import kotlinx.coroutines.cancel
import org.jetbrains.skia.Surface
import org.jetbrains.skiko.FrameDispatcher
+import java.awt.Component
+import java.awt.event.MouseEvent
import kotlin.coroutines.CoroutineContext
private val emptyDispatcher = object : CoroutineDispatcher() {
@@ -104,9 +106,7 @@
owner.setContent {
content()
}
- owner.setSize(width, height)
- owner.measureAndLayout()
- owner.draw(canvas)
+ owners.onFrame(surface.canvas, width, height, 0)
this.owner = owner
}
@@ -121,20 +121,36 @@
* Process mouse move event
*/
fun onMouseMoved(x: Int, y: Int) {
- owners.onMouseMoved(x, y)
+ owners.onMouseMoved(
+ x,
+ y,
+ MouseEvent(EventComponent, MouseEvent.MOUSE_MOVED, 0, 0, x, y, 1, false)
+ )
}
/**
* Process mouse enter event
*/
fun onMouseEntered(x: Int, y: Int) {
- owners.onMouseEntered(x, y)
+ owners.onMouseEntered(
+ x,
+ y,
+ MouseEvent(EventComponent, MouseEvent.MOUSE_MOVED, 0, 0, x, y, 1, false)
+ )
}
/**
* Process mouse exit event
*/
fun onMouseExited() {
- owners.onMouseExited()
+ owners.onMouseExited(
+ -1,
+ -1,
+ MouseEvent(EventComponent, MouseEvent.MOUSE_MOVED, 0, 0, -1, -1, 1, false)
+ )
+ }
+
+ companion object {
+ private val EventComponent = object : Component() {}
}
}
\ No newline at end of file
diff --git a/compose/ui/ui/src/desktopTest/kotlin/androidx/compose/ui/input/mouse/MouseHoverFilterTest.kt b/compose/ui/ui/src/desktopTest/kotlin/androidx/compose/ui/input/mouse/MouseHoverFilterTest.kt
index 0793543..2afa930 100644
--- a/compose/ui/ui/src/desktopTest/kotlin/androidx/compose/ui/input/mouse/MouseHoverFilterTest.kt
+++ b/compose/ui/ui/src/desktopTest/kotlin/androidx/compose/ui/input/mouse/MouseHoverFilterTest.kt
@@ -58,7 +58,10 @@
.size(10.dp, 20.dp)
)
}
-
+ window.onMouseEntered(
+ x = 0,
+ y = 0
+ )
window.onMouseMoved(
x = 10,
y = 20
diff --git a/concurrent/concurrent-futures/api/api_lint.ignore b/concurrent/concurrent-futures/api/api_lint.ignore
index 41ee2724..faa2f5c 100644
--- a/concurrent/concurrent-futures/api/api_lint.ignore
+++ b/concurrent/concurrent-futures/api/api_lint.ignore
@@ -1,4 +1,8 @@
// Baseline format: 1.0
+AsyncSuffixFuture: androidx.concurrent.futures.CallbackToFutureAdapter#getFuture(androidx.concurrent.futures.CallbackToFutureAdapter.Resolver<T>):
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
+
+
GenericException: androidx.concurrent.futures.CallbackToFutureAdapter.Resolver#attachCompleter(androidx.concurrent.futures.CallbackToFutureAdapter.Completer<T>):
Methods must not throw generic exceptions (`java.lang.Exception`)
diff --git a/core/core-appdigest/api/api_lint.ignore b/core/core-appdigest/api/api_lint.ignore
new file mode 100644
index 0000000..8ac521b1
--- /dev/null
+++ b/core/core-appdigest/api/api_lint.ignore
@@ -0,0 +1,5 @@
+// Baseline format: 1.0
+AsyncSuffixFuture: androidx.core.appdigest.Checksums#getChecksums(android.content.Context, String, boolean, int, java.util.List<java.security.cert.Certificate>, java.util.concurrent.Executor):
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
+AsyncSuffixFuture: androidx.core.appdigest.Checksums#getFileChecksums(android.content.Context, String, int, String, java.util.List<java.security.cert.Certificate>, java.util.concurrent.Executor):
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
diff --git a/core/core-appdigest/lint-baseline.xml b/core/core-appdigest/lint-baseline.xml
index 425cdb0..0ca1950 100644
--- a/core/core-appdigest/lint-baseline.xml
+++ b/core/core-appdigest/lint-baseline.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<issues format="6" by="lint 7.1.0-alpha03" type="baseline" client="gradle" name="AGP (7.1.0-alpha03)" variant="all" version="7.1.0-alpha03">
+<issues format="6" by="lint 7.2.0-dev" type="baseline" client="gradle" dependencies="false" name="AGP (7.2.0-dev)" variant="all" version="7.2.0-dev">
<issue
id="NewApi"
@@ -8,7 +8,7 @@
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
<location
file="src/androidTest/java/androidx/core/appdigest/ChecksumsTest.java"
- line="621"
+ line="1032"
column="31"/>
</issue>
@@ -19,216 +19,63 @@
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~">
<location
file="src/androidTest/java/androidx/core/appdigest/ChecksumsTest.java"
- line="637"
- column="35"/>
- </issue>
-
- <issue
- id="WrongConstant"
- message="Must be one or more of: Checksum.TYPE_WHOLE_MERKLE_ROOT_4K_SHA256, Checksum.TYPE_WHOLE_MD5, Checksum.TYPE_WHOLE_SHA1, Checksum.TYPE_WHOLE_SHA256, Checksum.TYPE_WHOLE_SHA512, Checksum.TYPE_PARTIAL_MERKLE_ROOT_1M_SHA256, Checksum.TYPE_PARTIAL_MERKLE_ROOT_1M_SHA512"
- errorLine1=" apkChecksum.getType(), apkChecksum.getValue(),"
- errorLine2=" ~~~~~~~~~~~~~~~~~~~~~">
- <location
- file="src/main/java/androidx/core/appdigest/Checksums.java"
- line="204"
- column="45"/>
- </issue>
- <issue
- id="NewApi"
- message="Field requires API level S (current min is 14): `android.content.pm.PackageManager#TRUST_ALL`"
- errorLine1=" trustedInstallers = PackageManager.TRUST_ALL;"
- errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~">
- <location
- file="src/main/java/androidx/core/appdigest/Checksums.java"
- line="180"
- column="37"/>
- </issue>
-
- <issue
- id="NewApi"
- message="Field requires API level S (current min is 14): `android.content.pm.PackageManager#TRUST_NONE`"
- errorLine1=" trustedInstallers = PackageManager.TRUST_NONE;"
- errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~">
- <location
- file="src/main/java/androidx/core/appdigest/Checksums.java"
- line="182"
- column="37"/>
- </issue>
-
- <issue
- id="NewApi"
- message="Call requires API level S (current min is 14): `android.content.pm.PackageManager#requestChecksums`"
- errorLine1=" context.getPackageManager().requestChecksums(packageName, includeSplits, required,"
- errorLine2=" ~~~~~~~~~~~~~~~~">
- <location
- file="src/main/java/androidx/core/appdigest/Checksums.java"
- line="189"
- column="41"/>
- </issue>
-
- <issue
- id="NewApi"
- message="Cast to `OnChecksumsReadyListener` requires API level 31 (current min is 14)"
- errorLine1=" trustedInstallers, new PackageManager.OnChecksumsReadyListener() {"
- errorLine2=" ^">
- <location
- file="src/main/java/androidx/core/appdigest/Checksums.java"
- line="190"
- column="40"/>
- </issue>
-
- <issue
- id="NewApi"
- message="Class requires API level S (current min is 14): `android.content.pm.PackageManager.OnChecksumsReadyListener`"
- errorLine1=" trustedInstallers, new PackageManager.OnChecksumsReadyListener() {"
- errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
- <location
- file="src/main/java/androidx/core/appdigest/Checksums.java"
- line="190"
- column="44"/>
- </issue>
-
- <issue
- id="NewApi"
- message="Call requires API level S (current min is 14): `android.content.pm.ApkChecksum#getSplitName`"
- errorLine1=" checksums[i] = new Checksum(apkChecksum.getSplitName(),"
- errorLine2=" ~~~~~~~~~~~~">
- <location
- file="src/main/java/androidx/core/appdigest/Checksums.java"
- line="203"
- column="77"/>
- </issue>
-
- <issue
- id="NewApi"
- message="Call requires API level S (current min is 14): `android.content.pm.ApkChecksum#getType`"
- errorLine1=" apkChecksum.getType(), apkChecksum.getValue(),"
- errorLine2=" ~~~~~~~">
- <location
- file="src/main/java/androidx/core/appdigest/Checksums.java"
- line="204"
- column="57"/>
- </issue>
-
- <issue
- id="NewApi"
- message="Call requires API level S (current min is 14): `android.content.pm.ApkChecksum#getValue`"
- errorLine1=" apkChecksum.getType(), apkChecksum.getValue(),"
- errorLine2=" ~~~~~~~~">
- <location
- file="src/main/java/androidx/core/appdigest/Checksums.java"
- line="204"
- column="80"/>
- </issue>
-
- <issue
- id="NewApi"
- message="Call requires API level S (current min is 14): `android.content.pm.ApkChecksum#getInstallerPackageName`"
- errorLine1=" apkChecksum.getInstallerPackageName(),"
- errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~">
- <location
- file="src/main/java/androidx/core/appdigest/Checksums.java"
- line="205"
- column="57"/>
- </issue>
-
- <issue
- id="NewApi"
- message="Call requires API level S (current min is 14): `android.content.pm.ApkChecksum#getInstallerCertificate`"
- errorLine1=" apkChecksum.getInstallerCertificate());"
- errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~">
- <location
- file="src/main/java/androidx/core/appdigest/Checksums.java"
- line="206"
- column="57"/>
- </issue>
-
- <issue
- id="NewApi"
- message="Call requires API level 29 (current min is 24): `android.app.UiAutomation#adoptShellPermissionIdentity`"
- errorLine1=" getUiAutomation().adoptShellPermissionIdentity(Manifest.permission.INSTALL_PACKAGES);"
- errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
- <location
- file="src/androidTest/java/androidx/core/appdigest/ChecksumsTest.java"
- line="621"
- column="31"/>
- </issue>
-
- <issue
- id="NewApi"
- message="Call requires API level 29 (current min is 24): `android.app.UiAutomation#dropShellPermissionIdentity`"
- errorLine1=" getUiAutomation().dropShellPermissionIdentity();"
- errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~">
- <location
- file="src/androidTest/java/androidx/core/appdigest/ChecksumsTest.java"
- line="637"
+ line="1048"
column="35"/>
</issue>
<issue
id="ClassVerificationFailure"
- message="This call references a method added in API level 31; however, the containing class androidx.core.appdigest.Checksums.ApiSImpl is reachable from earlier API levels and will fail run-time class verification."
- errorLine1=" context.getPackageManager().requestChecksums(packageName, includeSplits, required,"
- errorLine2=" ~~~~~~~~~~~~~~~~">
+ message="This call references a method added in API level 31; however, the containing class null is reachable from earlier API levels and will fail run-time class verification."
+ errorLine1=" checksums[i] = new Checksum(apkChecksum.getSplitName(),"
+ errorLine2=" ~~~~~~~~~~~~">
<location
- file="src/main/java/androidx/core/appdigest/Checksums.java"
- line="189"
- column="41"/>
+ file="src/main/java/androidx/core/appdigest/ChecksumsApiSImpl.java"
+ line="121"
+ column="73"/>
</issue>
<issue
id="ClassVerificationFailure"
message="This call references a method added in API level 31; however, the containing class null is reachable from earlier API levels and will fail run-time class verification."
- errorLine1=" checksums[i] = new Checksum(apkChecksum.getSplitName(),"
- errorLine2=" ~~~~~~~~~~~~">
+ errorLine1=" apkChecksum.getType(), apkChecksum.getValue(),"
+ errorLine2=" ~~~~~~~">
<location
- file="src/main/java/androidx/core/appdigest/Checksums.java"
- line="203"
- column="77"/>
+ file="src/main/java/androidx/core/appdigest/ChecksumsApiSImpl.java"
+ line="122"
+ column="53"/>
</issue>
<issue
id="ClassVerificationFailure"
message="This call references a method added in API level 31; however, the containing class null is reachable from earlier API levels and will fail run-time class verification."
- errorLine1=" apkChecksum.getType(), apkChecksum.getValue(),"
- errorLine2=" ~~~~~~~">
+ errorLine1=" apkChecksum.getType(), apkChecksum.getValue(),"
+ errorLine2=" ~~~~~~~~">
<location
- file="src/main/java/androidx/core/appdigest/Checksums.java"
- line="204"
- column="57"/>
+ file="src/main/java/androidx/core/appdigest/ChecksumsApiSImpl.java"
+ line="122"
+ column="76"/>
</issue>
<issue
id="ClassVerificationFailure"
message="This call references a method added in API level 31; however, the containing class null is reachable from earlier API levels and will fail run-time class verification."
- errorLine1=" apkChecksum.getType(), apkChecksum.getValue(),"
- errorLine2=" ~~~~~~~~">
+ errorLine1=" apkChecksum.getInstallerPackageName(),"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~">
<location
- file="src/main/java/androidx/core/appdigest/Checksums.java"
- line="204"
- column="80"/>
+ file="src/main/java/androidx/core/appdigest/ChecksumsApiSImpl.java"
+ line="123"
+ column="53"/>
</issue>
<issue
id="ClassVerificationFailure"
message="This call references a method added in API level 31; however, the containing class null is reachable from earlier API levels and will fail run-time class verification."
- errorLine1=" apkChecksum.getInstallerPackageName(),"
- errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~">
+ errorLine1=" apkChecksum.getInstallerCertificate());"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~">
<location
- file="src/main/java/androidx/core/appdigest/Checksums.java"
- line="205"
- column="57"/>
- </issue>
-
- <issue
- id="ClassVerificationFailure"
- message="This call references a method added in API level 31; however, the containing class null is reachable from earlier API levels and will fail run-time class verification."
- errorLine1=" apkChecksum.getInstallerCertificate());"
- errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~">
- <location
- file="src/main/java/androidx/core/appdigest/Checksums.java"
- line="206"
- column="57"/>
+ file="src/main/java/androidx/core/appdigest/ChecksumsApiSImpl.java"
+ line="124"
+ column="53"/>
</issue>
</issues>
diff --git a/core/core-splashscreen/api/res-current.txt b/core/core-splashscreen/api/res-current.txt
index f751c82..6227062 100644
--- a/core/core-splashscreen/api/res-current.txt
+++ b/core/core-splashscreen/api/res-current.txt
@@ -2,4 +2,6 @@
attr windowSplashScreenAnimatedIcon
attr windowSplashScreenAnimationDuration
attr windowSplashScreenBackground
+dimen splashscreen_icon_size
style Theme_SplashScreen
+style Theme_SplashScreen_IconBackground
diff --git a/core/core-splashscreen/build.gradle b/core/core-splashscreen/build.gradle
index d70c8a7b..d4aeb10 100644
--- a/core/core-splashscreen/build.gradle
+++ b/core/core-splashscreen/build.gradle
@@ -36,13 +36,13 @@
implementation("androidx.annotation:annotation:1.2.0")
- androidTestImplementation(project(":test:screenshot:screenshot"))
androidTestImplementation(libs.testExtJunit)
androidTestImplementation(libs.testRunner)
androidTestImplementation(libs.testRules)
androidTestImplementation(libs.testUiautomator)
androidTestImplementation(libs.truth)
androidTestImplementation(project(":appcompat:appcompat"))
+ androidTestImplementation(project(":test:screenshot:screenshot"))
}
androidx {
diff --git a/core/core-splashscreen/samples/src/main/AndroidManifest.xml b/core/core-splashscreen/samples/src/main/AndroidManifest.xml
index 935b220..d3d7463 100644
--- a/core/core-splashscreen/samples/src/main/AndroidManifest.xml
+++ b/core/core-splashscreen/samples/src/main/AndroidManifest.xml
@@ -20,6 +20,7 @@
android:icon="@drawable/ic_launcher"
android:theme="@style/Theme.App.Starting"
android:label="@string/app_name">
+
<activity android:name=".SplashScreenSampleActivity"
android:exported="true">
<intent-filter>
diff --git a/core/core-splashscreen/samples/src/main/res/drawable-v26/ic_launcher.xml b/core/core-splashscreen/samples/src/main/res/drawable-v26/ic_launcher.xml
index d4d3966..0738dc1 100644
--- a/core/core-splashscreen/samples/src/main/res/drawable-v26/ic_launcher.xml
+++ b/core/core-splashscreen/samples/src/main/res/drawable-v26/ic_launcher.xml
@@ -16,5 +16,5 @@
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@color/logo_background" />
- <foreground android:drawable="@drawable/foreground" />
+ <foreground android:drawable="@drawable/android" />
</adaptive-icon>
\ No newline at end of file
diff --git a/core/core-splashscreen/samples/src/main/res/drawable-v31/splashscreen_icon.xml b/core/core-splashscreen/samples/src/main/res/drawable-v31/splashscreen_icon.xml
index f37aee7..d52d941 100644
--- a/core/core-splashscreen/samples/src/main/res/drawable-v31/splashscreen_icon.xml
+++ b/core/core-splashscreen/samples/src/main/res/drawable-v31/splashscreen_icon.xml
@@ -20,12 +20,36 @@
<vector
android:width="108dp"
android:height="108dp"
- android:viewportHeight="1200"
- android:viewportWidth="1200">
+ android:viewportHeight="800"
+ android:viewportWidth="800">
+ <!-- DEBUG GROUP (Uncomment to check if the icon fits within the bounds)
<group
- android:translateX="200"
- android:translateY="200">
+ android:scaleY="0.6667"
+ android:scaleX="0.6667"
+ android:translateX="133"
+ android:translateY="133">
+ <path
+ android:fillColor="#0000FF"
+ android:pathData="m 0 0, 0 800, 800 0, 0 -800" />
+ <path
+ android:fillColor="#00FF00"
+ android:pathData="
+ M 0, 400
+ a 400, 400 0 1,0 800, 0
+ a 400, 400 0 1,0 -800, 0" />
+ </group>
+ END DEBUG GROUP -->
+
+ <!--
+ Scale down the icon and translate if to fit
+ within the inner 2/3 (scale <= 0.67) or the viewport.
+ -->
+ <group
+ android:translateX="160"
+ android:translateY="130"
+ android:scaleX="0.60"
+ android:scaleY="0.60">
<clip-path android:pathData="m596.328,310.906c22.484,-39.699 46.513,-78.699 68.084,-118.812 4.258,-14.364 -17.654,-23.707 -25.102,-10.703 -22.603,38.973 -45.139,77.986 -67.716,116.974 -107.224,-48.772 -235.192,-48.772 -342.415,0 -23.491,-39.715 -45.567,-80.447 -69.895,-119.56 -10.384,-10.813 -29.373,3.556 -21.753,16.461 22.277,38.562 44.614,77.091 66.914,115.64C88.641,372.042 9.442,494.721 0,625c266.667,0 533.333,0 800,0C790.261,494.557 711.967,372.81 596.328,310.906ZM216.039,511.17c-24.214,1.092 -41.724,-28.29 -29.21,-49.016 10.591,-21.768 44.808,-23.114 57.082,-2.246 14.575,21.206 -2.056,51.902 -27.872,51.263zM584.348,511.17c-24.214,1.092 -41.724,-28.29 -29.21,-49.016 10.591,-21.768 44.808,-23.114 57.082,-2.246 14.575,21.206 -2.055,51.902 -27.872,51.263z" />
<path
android:fillColor="#3ddc84"
diff --git a/core/core-splashscreen/samples/src/main/res/drawable/android.xml b/core/core-splashscreen/samples/src/main/res/drawable/android.xml
index a0207f8..6c557e1 100644
--- a/core/core-splashscreen/samples/src/main/res/drawable/android.xml
+++ b/core/core-splashscreen/samples/src/main/res/drawable/android.xml
@@ -15,12 +15,21 @@
-->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
- android:width="72dp"
- android:height="72dp"
- android:viewportHeight="800"
- android:viewportWidth="800">
- <path
- android:fillColor="#3ddc84"
- android:pathData="m596.328,310.906c22.484,-39.699 46.513,-78.699 68.084,-118.812 4.258,-14.364 -17.654,-23.707 -25.102,-10.703 -22.603,38.973 -45.139,77.986 -67.716,116.974 -107.224,-48.772 -235.192,-48.772 -342.415,0 -23.491,-39.715 -45.567,-80.447 -69.895,-119.56 -10.384,-10.813 -29.373,3.556 -21.753,16.461 22.277,38.562 44.614,77.091 66.914,115.64C88.641,372.042 9.442,494.721 -0,625c266.667,0 533.333,0 800,0C790.261,494.557 711.967,372.81 596.328,310.906ZM216.039,511.17c-24.214,1.092 -41.724,-28.29 -29.21,-49.016 10.591,-21.768 44.808,-23.114 57.082,-2.246 14.575,21.206 -2.056,51.902 -27.872,51.263zM584.348,511.17c-24.214,1.092 -41.724,-28.29 -29.21,-49.016 10.591,-21.768 44.808,-23.114 57.082,-2.246 14.575,21.206 -2.055,51.902 -27.872,51.263z"
- android:strokeWidth="1.93078" />
+ android:width="160dp"
+ android:height="160dp"
+ android:viewportHeight="432"
+ android:viewportWidth="432">
+
+ <!-- Safe zone = 66dp => 432 * (66 / 108) = 432 * 0.61 -->
+ <group
+ android:translateX="84"
+ android:translateY="84"
+ android:scaleX="0.61"
+ android:scaleY="0.61">
+
+ <path
+ android:fillColor="#3ddc84"
+ android:pathData="m322.02,167.89c12.141,-21.437 25.117,-42.497 36.765,-64.158 2.2993,-7.7566 -9.5332,-12.802 -13.555,-5.7796 -12.206,21.045 -24.375,42.112 -36.567,63.166 -57.901,-26.337 -127.00,-26.337 -184.90,0.0 -12.685,-21.446 -24.606,-43.441 -37.743,-64.562 -5.6074,-5.8390 -15.861,1.9202 -11.747,8.8889 12.030,20.823 24.092,41.629 36.134,62.446C47.866,200.90 5.0987,267.15 0.0,337.5c144.00,0.0 288.00,0.0 432.0,0.0C426.74,267.06 384.46,201.32 322.02,167.89ZM116.66,276.03c-13.076,0.58968 -22.531,-15.277 -15.773,-26.469 5.7191,-11.755 24.196,-12.482 30.824,-1.2128 7.8705,11.451 -1.1102,28.027 -15.051,27.682zM315.55,276.03c-13.076,0.58968 -22.531,-15.277 -15.773,-26.469 5.7191,-11.755 24.196,-12.482 30.824,-1.2128 7.8705,11.451 -1.1097,28.027 -15.051,27.682z"
+ android:strokeWidth="2" />
+ </group>
</vector>
\ No newline at end of file
diff --git a/core/core-splashscreen/samples/src/main/res/drawable/ic_launcher.xml b/core/core-splashscreen/samples/src/main/res/drawable/ic_launcher.xml
index 59296dc..0bccb83 100644
--- a/core/core-splashscreen/samples/src/main/res/drawable/ic_launcher.xml
+++ b/core/core-splashscreen/samples/src/main/res/drawable/ic_launcher.xml
@@ -16,5 +16,5 @@
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@color/logo_background" />
- <item android:drawable="@drawable/foreground" />
+ <item android:drawable="@drawable/android" />
</layer-list>
\ No newline at end of file
diff --git a/core/core-splashscreen/samples/src/main/res/drawable/splashscreen_icon.xml b/core/core-splashscreen/samples/src/main/res/drawable/splashscreen_icon.xml
deleted file mode 100644
index a8c4e96..0000000
--- a/core/core-splashscreen/samples/src/main/res/drawable/splashscreen_icon.xml
+++ /dev/null
@@ -1,28 +0,0 @@
-<!--
- Copyright 2021 The Android Open Source Project
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
- -->
-<vector xmlns:android="http://schemas.android.com/apk/res/android"
- android:width="108dp"
- android:height="108dp"
- android:viewportHeight="800"
- android:viewportWidth="800">
-
- <path
- android:fillColor="#3ddc84"
- android:pathData="m596.328,310.906c22.484,-39.699 46.513,-78.699 68.084,-118.812 4.258,-14.364 -17.654,-23.707 -25.102,-10.703 -22.603,38.973 -45.139,77.986 -67.716,116.974 -107.224,-48.772 -235.192,-48.772 -342.415,0 -23.491,-39.715 -45.567,-80.447 -69.895,-119.56 -10.384,-10.813 -29.373,3.556 -21.753,16.461 22.277,38.562 44.614,77.091 66.914,115.64C88.641,372.042 9.442,494.721 -0,625c266.667,0 533.333,0 800,0C790.261,494.557 711.967,372.81 596.328,310.906ZM216.039,511.17c-24.214,1.092 -41.724,-28.29 -29.21,-49.016 10.591,-21.768 44.808,-23.114 57.082,-2.246 14.575,21.206 -2.056,51.902 -27.872,51.263zM584.348,511.17c-24.214,1.092 -41.724,-28.29 -29.21,-49.016 10.591,-21.768 44.808,-23.114 57.082,-2.246 14.575,21.206 -2.055,51.902 -27.872,51.263z"
- android:strokeWidth="2" />
-
-</vector>
-
diff --git a/core/core-splashscreen/samples/src/main/res/drawable/foreground.xml b/core/core-splashscreen/samples/src/main/res/values/aliases.xml
similarity index 81%
copy from core/core-splashscreen/samples/src/main/res/drawable/foreground.xml
copy to core/core-splashscreen/samples/src/main/res/values/aliases.xml
index c46194a..d3e0bdd 100644
--- a/core/core-splashscreen/samples/src/main/res/drawable/foreground.xml
+++ b/core/core-splashscreen/samples/src/main/res/values/aliases.xml
@@ -14,7 +14,6 @@
limitations under the License.
-->
-<inset xmlns:android="http://schemas.android.com/apk/res/android"
- android:drawable="@drawable/android"
- android:inset="25%">
-</inset>
\ No newline at end of file
+<resources>
+ <drawable name="splashscreen_icon">@drawable/android</drawable>
+</resources>
\ No newline at end of file
diff --git a/core/core-splashscreen/samples/src/main/res/values/colors.xml b/core/core-splashscreen/samples/src/main/res/values/colors.xml
index da0c8fc..27c80d69 100644
--- a/core/core-splashscreen/samples/src/main/res/values/colors.xml
+++ b/core/core-splashscreen/samples/src/main/res/values/colors.xml
@@ -19,4 +19,5 @@
<color name="logo_background">#3C3C3C</color>
<color name="windowBackground">#CFCFCF</color>
<color name="splashScreenBackground">#474747</color>
+ <color name="splashscreen_icon_background">#BEC7B8</color>
</resources>
\ No newline at end of file
diff --git a/core/core-splashscreen/samples/src/main/res/values/styles.xml b/core/core-splashscreen/samples/src/main/res/values/styles.xml
index fafcea9..06982bf 100644
--- a/core/core-splashscreen/samples/src/main/res/values/styles.xml
+++ b/core/core-splashscreen/samples/src/main/res/values/styles.xml
@@ -23,10 +23,11 @@
<item name="android:windowDrawsSystemBarBackgrounds">true</item>
</style>
- <style name="Theme.App.Starting" parent="Theme.SplashScreen">
+ <style name="Theme.App.Starting" parent="Theme.SplashScreen.IconBackground">
<item name="windowSplashScreenBackground">@color/splashScreenBackground</item>
<item name="windowSplashScreenAnimatedIcon">@drawable/splashscreen_icon</item>
<item name="windowSplashScreenAnimationDuration">2000</item>
+ <item name="windowSplashScreenIconBackgroundColor">@color/splashscreen_icon_background</item>
<item name="postSplashScreenTheme">@style/Theme.App</item>
</style>
</resources>
\ No newline at end of file
diff --git a/core/core-splashscreen/src/androidTest/AndroidManifest.xml b/core/core-splashscreen/src/androidTest/AndroidManifest.xml
index 0253fc4..e1fabc9 100644
--- a/core/core-splashscreen/src/androidTest/AndroidManifest.xml
+++ b/core/core-splashscreen/src/androidTest/AndroidManifest.xml
@@ -31,10 +31,13 @@
android:name=".SplashScreenAppCompatTestActivity"
android:exported="true"
android:theme="@style/Theme.Test.Starting.AppCompat">
- <intent-filter>
- <category android:name="android.intent.category.LAUNCHER" />
- <action android:name="android.intent.action.MAIN" />
- </intent-filter>
</activity>
+
+ <activity
+ android:name=".SplashScreenWithIconBgTestActivity"
+ android:exported="true"
+ android:theme="@style/Theme.Test.Starting.IconBackground">
+ </activity>
+
</application>
</manifest>
diff --git a/core/core-splashscreen/src/androidTest/java/androidx/core/splashscreen/test/SplashScreenTestActivities.kt b/core/core-splashscreen/src/androidTest/java/androidx/core/splashscreen/test/SplashScreenTestActivities.kt
index b46d910..adf7e72 100644
--- a/core/core-splashscreen/src/androidTest/java/androidx/core/splashscreen/test/SplashScreenTestActivities.kt
+++ b/core/core-splashscreen/src/androidTest/java/androidx/core/splashscreen/test/SplashScreenTestActivities.kt
@@ -19,7 +19,7 @@
import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
-public class SplashScreenTestActivity : Activity(), SplashScreenTestControllerHolder {
+open class SplashScreenTestActivity : Activity(), SplashScreenTestControllerHolder {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
@@ -30,7 +30,9 @@
override lateinit var controller: SplashScreenTestController
}
-public class SplashScreenAppCompatTestActivity :
+class SplashScreenWithIconBgTestActivity : SplashScreenTestActivity()
+
+class SplashScreenAppCompatTestActivity :
AppCompatActivity(), SplashScreenTestControllerHolder {
override fun onCreate(savedInstanceState: Bundle?) {
diff --git a/core/core-splashscreen/src/androidTest/java/androidx/core/splashscreen/test/SplashScreenTestController.kt b/core/core-splashscreen/src/androidTest/java/androidx/core/splashscreen/test/SplashScreenTestController.kt
index 453da24..071fb7f 100644
--- a/core/core-splashscreen/src/androidTest/java/androidx/core/splashscreen/test/SplashScreenTestController.kt
+++ b/core/core-splashscreen/src/androidTest/java/androidx/core/splashscreen/test/SplashScreenTestController.kt
@@ -18,13 +18,15 @@
import android.app.Activity
import android.graphics.Bitmap
+import android.graphics.drawable.Drawable
import android.util.TypedValue
+import android.view.View
import androidx.appcompat.app.AppCompatActivity
import androidx.core.splashscreen.SplashScreen.Companion.installSplashScreen
-import androidx.core.splashscreen.R as SR
import androidx.test.runner.screenshot.Screenshot
import java.util.concurrent.CountDownLatch
import java.util.concurrent.atomic.AtomicBoolean
+import androidx.core.splashscreen.R as SR
internal const val EXTRA_ANIMATION_LISTENER = "AnimationListener"
internal const val EXTRA_SPLASHSCREEN_WAIT = "splashscreen_wait"
@@ -40,9 +42,13 @@
public var splashScreenScreenshot: Bitmap? = null
public var splashscreenIconId: Int = 0
public var splashscreenBackgroundId: Int = 0
+ public var splashscreenIconBackgroundId: Int = 0
public var finalAppTheme: Int = 0
public var duration: Int = 0
public var exitAnimationListenerLatch: CountDownLatch = CountDownLatch(1)
+ public var splashScreenView: View? = null
+ public var splashScreenIconView: View? = null
+ public var splashScreenIconViewBackground: Drawable? = null
public var drawnLatch: CountDownLatch = CountDownLatch(1)
public val isCompatActivity: Boolean
get() = activity is AppCompatActivity
@@ -68,6 +74,9 @@
theme.resolveAttribute(SR.attr.windowSplashScreenBackground, tv, true)
splashscreenBackgroundId = tv.resourceId
+ theme.resolveAttribute(SR.attr.windowSplashScreenIconBackgroundColor, tv, true)
+ splashscreenIconBackgroundId = tv.resourceId
+
theme.resolveAttribute(SR.attr.postSplashScreenTheme, tv, true)
finalAppTheme = tv.resourceId
@@ -90,11 +99,22 @@
if (useListener) {
splashScreen.setOnExitAnimationListener { splashScreenViewProvider ->
+ splashScreenView = splashScreenViewProvider.view
+ splashScreenIconView = splashScreenViewProvider.iconView
+ splashScreenIconViewBackground = splashScreenViewProvider.iconView.background
if (takeScreenShot) {
- splashScreenViewScreenShot = Screenshot.capture().bitmap
+ splashScreenViewProvider.view.postDelayed(
+ {
+ splashScreenViewScreenShot = Screenshot.capture().bitmap
+ splashScreenViewProvider.remove()
+ exitAnimationListenerLatch.countDown()
+ },
+ 100
+ )
+ } else {
+ splashScreenViewProvider.remove()
+ exitAnimationListenerLatch.countDown()
}
- exitAnimationListenerLatch.countDown()
- splashScreenViewProvider.remove()
}
}
diff --git a/core/core-splashscreen/src/androidTest/java/androidx/core/splashscreen/test/SplashScreenTestUtils.kt b/core/core-splashscreen/src/androidTest/java/androidx/core/splashscreen/test/SplashScreenTestUtils.kt
new file mode 100644
index 0000000..4d9d38d
--- /dev/null
+++ b/core/core-splashscreen/src/androidTest/java/androidx/core/splashscreen/test/SplashScreenTestUtils.kt
@@ -0,0 +1,102 @@
+/*
+ * Copyright 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package androidx.core.splashscreen.test
+
+import android.app.Instrumentation
+import android.content.ComponentName
+import android.content.Context
+import android.content.Intent
+import android.os.Bundle
+import androidx.test.core.app.ApplicationProvider
+import androidx.test.platform.app.InstrumentationRegistry
+import androidx.test.uiautomator.By
+import androidx.test.uiautomator.UiDevice
+import androidx.test.uiautomator.Until
+import org.hamcrest.core.IsNull
+import org.junit.Assert
+import kotlin.reflect.KClass
+
+private const val SPLASH_SCREEN_STYLE_ICON = 1
+private const val KEY_SPLASH_SCREEN_STYLE: String = "android.activity.splashScreenStyle"
+private const val BASIC_SAMPLE_PACKAGE: String = "androidx.core.splashscreen.test"
+private const val LAUNCH_TIMEOUT: Long = 5000
+
+/**
+ * Start an activity simulating a launch from the launcher
+ * to ensure the splash screen is shown
+ */
+fun startActivityWithSplashScreen(
+ activityClass: KClass<out SplashScreenTestControllerHolder>,
+ device: UiDevice,
+ intentModifier: ((Intent) -> Unit)? = null
+): SplashScreenTestController {
+ // Start from the home screen
+ device.pressHome()
+
+ // Wait for launcher
+ val launcherPackage: String = device.launcherPackageName
+ Assert.assertThat(launcherPackage, IsNull.notNullValue())
+ device.wait(
+ Until.hasObject(By.pkg(launcherPackage).depth(0)),
+ LAUNCH_TIMEOUT
+ )
+
+ // Launch the app
+ val context = ApplicationProvider.getApplicationContext<Context>()
+ val baseIntent = context.packageManager.getLaunchIntentForPackage(
+ BASIC_SAMPLE_PACKAGE
+ )
+ val intent = Intent(baseIntent).apply {
+ component = ComponentName(BASIC_SAMPLE_PACKAGE, activityClass.qualifiedName!!)
+ intentModifier?.invoke(this)
+ }
+
+ val monitor = object : Instrumentation.ActivityMonitor(
+ activityClass.qualifiedName!!,
+ Instrumentation.ActivityResult(0, Intent()), false
+ ) {
+ override fun onStartActivity(intent: Intent?): Instrumentation.ActivityResult? {
+ return if (intent?.component?.packageName == BASIC_SAMPLE_PACKAGE) {
+ Instrumentation.ActivityResult(0, Intent())
+ } else {
+ null
+ }
+ }
+ }
+ InstrumentationRegistry.getInstrumentation().addMonitor(monitor)
+
+ context.startActivity(
+ intent,
+ // Force the splash screen to be shown with an icon
+ Bundle().apply { putInt(KEY_SPLASH_SCREEN_STYLE, SPLASH_SCREEN_STYLE_ICON) }
+ )
+ Assert.assertTrue(
+ device.wait(
+ Until.hasObject(By.pkg(BASIC_SAMPLE_PACKAGE).depth(0)),
+ LAUNCH_TIMEOUT
+ )
+ )
+ val splashScreenTestActivity =
+ monitor.waitForActivityWithTimeout(LAUNCH_TIMEOUT) as SplashScreenTestControllerHolder?
+ if (splashScreenTestActivity == null) {
+ Assert.fail(
+ activityClass.simpleName!! + " was not launched after " +
+ "$LAUNCH_TIMEOUT ms"
+ )
+ }
+ return splashScreenTestActivity!!.controller
+}
diff --git a/core/core-splashscreen/src/androidTest/java/androidx/core/splashscreen/test/SplashScreenTests.kt b/core/core-splashscreen/src/androidTest/java/androidx/core/splashscreen/test/SplashScreenTests.kt
new file mode 100644
index 0000000..fb9f042
--- /dev/null
+++ b/core/core-splashscreen/src/androidTest/java/androidx/core/splashscreen/test/SplashScreenTests.kt
@@ -0,0 +1,56 @@
+/*
+ * Copyright 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package androidx.core.splashscreen.test
+
+import androidx.test.filters.LargeTest
+import androidx.test.internal.runner.junit4.AndroidJUnit4ClassRunner
+import androidx.test.platform.app.InstrumentationRegistry
+import androidx.test.uiautomator.UiDevice
+import com.google.common.truth.Truth
+import org.junit.Before
+import org.junit.Test
+import org.junit.runner.RunWith
+
+@LargeTest
+@RunWith(AndroidJUnit4ClassRunner::class)
+class SplashScreenTests {
+
+ private lateinit var device: UiDevice
+
+ @Before
+ fun setUp() {
+ device = UiDevice.getInstance(InstrumentationRegistry.getInstrumentation())
+ }
+
+ @Test
+ fun iconBackgroundSetForIconTheme() {
+ val splashScreen =
+ startActivityWithSplashScreen(SplashScreenWithIconBgTestActivity::class, device) {
+ it.putExtra(EXTRA_ANIMATION_LISTENER, true)
+ }
+ Truth.assertThat(splashScreen.splashScreenIconViewBackground).isNotNull()
+ }
+
+ @Test
+ fun noIconBackgroundOnDefaultTheme() {
+ val splashScreen =
+ startActivityWithSplashScreen(SplashScreenTestActivity::class, device) {
+ it.putExtra(EXTRA_ANIMATION_LISTENER, true)
+ }
+ Truth.assertThat(splashScreen.splashScreenIconViewBackground).isNull()
+ }
+}
\ No newline at end of file
diff --git a/core/core-splashscreen/src/androidTest/java/androidx/core/splashscreen/test/SplashscreenTest.kt b/core/core-splashscreen/src/androidTest/java/androidx/core/splashscreen/test/SplashscreenParametrizedTest.kt
similarity index 72%
rename from core/core-splashscreen/src/androidTest/java/androidx/core/splashscreen/test/SplashscreenTest.kt
rename to core/core-splashscreen/src/androidTest/java/androidx/core/splashscreen/test/SplashscreenParametrizedTest.kt
index f5b5e4e..acecf31 100644
--- a/core/core-splashscreen/src/androidTest/java/androidx/core/splashscreen/test/SplashscreenTest.kt
+++ b/core/core-splashscreen/src/androidTest/java/androidx/core/splashscreen/test/SplashscreenParametrizedTest.kt
@@ -16,23 +16,17 @@
package androidx.core.splashscreen.test
-import android.app.Instrumentation
-import android.content.ComponentName
-import android.content.Context
import android.content.Intent
import android.graphics.Bitmap
import android.os.Bundle
-import androidx.test.core.app.ApplicationProvider
import androidx.test.filters.LargeTest
+import androidx.test.filters.SdkSuppress
import androidx.test.platform.app.InstrumentationRegistry
import androidx.test.screenshot.matchers.MSSIMMatcher
-import androidx.test.uiautomator.By
import androidx.test.uiautomator.UiDevice
-import androidx.test.uiautomator.Until
-import org.hamcrest.core.IsNull.notNullValue
import org.junit.Assert.assertEquals
import org.junit.Assert.assertFalse
-import org.junit.Assert.assertThat
+import org.junit.Assert.assertNull
import org.junit.Assert.assertTrue
import org.junit.Assert.fail
import org.junit.Before
@@ -45,14 +39,9 @@
import java.util.concurrent.TimeUnit
import kotlin.reflect.KClass
-private const val SPLASH_SCREEN_STYLE_ICON = 1
-private const val KEY_SPLASH_SCREEN_STYLE: String = "android.activity.splashScreenStyle"
-private const val BASIC_SAMPLE_PACKAGE: String = "androidx.core.splashscreen.test"
-private const val LAUNCH_TIMEOUT: Long = 5000
-
@LargeTest
@RunWith(Parameterized::class)
-public class SplashscreenTest(
+public class SplashscreenParametrizedTest(
public val name: String,
public val activityClass: KClass<out SplashScreenTestControllerHolder>
) {
@@ -64,7 +53,7 @@
@JvmStatic
public fun data(): Iterable<Array<Any>> {
return listOf(
- arrayOf("Platform", SplashScreenTestActivity::class),
+ arrayOf("Platform", SplashScreenWithIconBgTestActivity::class),
arrayOf("AppCompat", SplashScreenAppCompatTestActivity::class)
)
}
@@ -134,6 +123,23 @@
}
@Test
+ public fun splashScreenViewRemoved() {
+ val activity = startActivityWithSplashScreen {
+ // Clear out any previous instances
+ it.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK)
+ it.putExtra(EXTRA_ANIMATION_LISTENER, true)
+ }
+ activity.exitAnimationListenerLatch.await(2, TimeUnit.SECONDS)
+ assertNull(
+ "Splash screen view was not removed from its parent",
+ activity.splashScreenView!!.parent
+ )
+ }
+
+ // The vector drawable of the starting window isn't scaled
+ // correctly pre 23
+ @SdkSuppress(minSdkVersion = 23)
+ @Test
public fun splashscreenViewScreenshotComparison() {
val activity = startActivityWithSplashScreen {
// Clear out any previous instances
@@ -165,7 +171,7 @@
afterScreenshot.width, afterScreenshot.height
)
- val matcher = MSSIMMatcher(0.90).compareBitmaps(
+ val matcher = MSSIMMatcher(0.99).compareBitmaps(
beforeBuffer, afterBuffer, afterScreenshot.width,
afterScreenshot.height
)
@@ -229,60 +235,8 @@
private fun startActivityWithSplashScreen(
intentModifier: ((Intent) -> Unit)? = null
): SplashScreenTestController {
- // Start from the home screen
- device.pressHome()
-
- // Wait for launcher
- val launcherPackage: String = device.launcherPackageName
- assertThat(launcherPackage, notNullValue())
- device.wait(
- Until.hasObject(By.pkg(launcherPackage).depth(0)),
- LAUNCH_TIMEOUT
+ return startActivityWithSplashScreen(
+ activityClass, device, intentModifier
)
-
- // Launch the app
- val context = ApplicationProvider.getApplicationContext<Context>()
- val baseIntent = context.packageManager.getLaunchIntentForPackage(
- BASIC_SAMPLE_PACKAGE
- )
- val intent = Intent(baseIntent).apply {
- component = ComponentName(BASIC_SAMPLE_PACKAGE, activityClass.qualifiedName!!)
- intentModifier?.invoke(this)
- }
-
- val monitor = object : Instrumentation.ActivityMonitor(
- activityClass.qualifiedName!!,
- Instrumentation.ActivityResult(0, Intent()), false
- ) {
- override fun onStartActivity(intent: Intent?): Instrumentation.ActivityResult? {
- return if (intent?.component?.packageName == BASIC_SAMPLE_PACKAGE) {
- Instrumentation.ActivityResult(0, Intent())
- } else {
- null
- }
- }
- }
- InstrumentationRegistry.getInstrumentation().addMonitor(monitor)
-
- context.startActivity(
- intent,
- // Force the splash screen to be shown with an icon
- Bundle().apply { putInt(KEY_SPLASH_SCREEN_STYLE, SPLASH_SCREEN_STYLE_ICON) }
- )
- assertTrue(
- device.wait(
- Until.hasObject(By.pkg(BASIC_SAMPLE_PACKAGE).depth(0)),
- LAUNCH_TIMEOUT
- )
- )
- val splashScreenTestActivity =
- monitor.waitForActivityWithTimeout(LAUNCH_TIMEOUT) as SplashScreenTestControllerHolder?
- if (splashScreenTestActivity == null) {
- fail(
- activityClass.simpleName!! + " was not launched after " +
- "$LAUNCH_TIMEOUT ms"
- )
- }
- return splashScreenTestActivity!!.controller
}
}
\ No newline at end of file
diff --git a/core/core-splashscreen/src/androidTest/res/drawable/android.xml b/core/core-splashscreen/src/androidTest/res/drawable/android.xml
index 822d8e7..c6d4fe2 100644
--- a/core/core-splashscreen/src/androidTest/res/drawable/android.xml
+++ b/core/core-splashscreen/src/androidTest/res/drawable/android.xml
@@ -15,12 +15,17 @@
-->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
- android:width="72dp"
- android:height="72dp"
- android:viewportHeight="100"
- android:viewportWidth="100">
+ android:width="200px"
+ android:height="200px"
+ android:viewportHeight="200"
+ android:viewportWidth="200">
<path
- android:fillColor="#3ddc84"
- android:pathData="m0 0 L 0 100 100 100 100 0z"
+ android:fillColor="#0000FF"
+ android:pathData="m50 50 L 50 150 150 150 150 50z"
+ android:strokeWidth="1" />
+
+ <path
+ android:fillColor="#FF0000"
+ android:pathData="m100 100 L 100 101 101 101 101 100z"
android:strokeWidth="1" />
</vector>
\ No newline at end of file
diff --git a/core/core-splashscreen/src/androidTest/res/values/colors.xml b/core/core-splashscreen/src/androidTest/res/values/colors.xml
index 306e151..c204347 100644
--- a/core/core-splashscreen/src/androidTest/res/values/colors.xml
+++ b/core/core-splashscreen/src/androidTest/res/values/colors.xml
@@ -17,4 +17,5 @@
<resources>
<color name="bg_launcher">#15FFFF</color>
+ <color name="icon_bg">#FFFF00</color>
</resources>
\ No newline at end of file
diff --git a/core/core-splashscreen/src/androidTest/res/values/styles.xml b/core/core-splashscreen/src/androidTest/res/values/styles.xml
index 743d243..d028ccc 100644
--- a/core/core-splashscreen/src/androidTest/res/values/styles.xml
+++ b/core/core-splashscreen/src/androidTest/res/values/styles.xml
@@ -21,6 +21,7 @@
<item name="android:fitsSystemWindows">false</item>
<item name="android:statusBarColor">@android:color/transparent</item>
<item name="android:navigationBarColor">@android:color/transparent</item>
+ <item name="android:windowLightStatusBar">false</item>
</style>
<style name="Theme.Test.Starting" parent="Theme.SplashScreen">
@@ -30,6 +31,14 @@
<item name="postSplashScreenTheme">@style/Theme.Test</item>
</style>
+ <style name="Theme.Test.Starting.IconBackground" parent="Theme.SplashScreen.IconBackground">
+ <item name="windowSplashScreenBackground">@color/bg_launcher</item>
+ <item name="windowSplashScreenAnimatedIcon">@drawable/android</item>
+ <item name="windowSplashScreenAnimationDuration">1234</item>
+ <item name="windowSplashScreenIconBackgroundColor">@color/icon_bg</item>
+ <item name="postSplashScreenTheme">@style/Theme.Test</item>
+ </style>
+
<!-- Themes for AppCompat Tests -->
<style name="Theme.Test.AppCompat" parent="Theme.AppCompat.Light.NoActionBar">
<item name="android:windowDrawsSystemBarBackgrounds">true</item>
@@ -44,4 +53,5 @@
<item name="windowSplashScreenAnimationDuration">1234</item>
<item name="postSplashScreenTheme">@style/Theme.Test.AppCompat</item>
</style>
+
</resources>
\ No newline at end of file
diff --git a/core/core-splashscreen/src/main/java/androidx/core/splashscreen/MaskedDrawable.kt b/core/core-splashscreen/src/main/java/androidx/core/splashscreen/MaskedDrawable.kt
new file mode 100644
index 0000000..149d225
--- /dev/null
+++ b/core/core-splashscreen/src/main/java/androidx/core/splashscreen/MaskedDrawable.kt
@@ -0,0 +1,61 @@
+/*
+ * Copyright 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package androidx.core.splashscreen
+
+import android.graphics.Canvas
+import android.graphics.ColorFilter
+import android.graphics.Path
+import android.graphics.Rect
+import android.graphics.drawable.Drawable
+
+/**
+ * A wrapper around a `drawable` that clip it to fit in a circle of diameter `maskDiameter`.
+ * @param drawable The drawable to clip
+ * @param maskDiameter The diameter of the mask used to clip the drawable.
+ */
+internal class MaskedDrawable(
+ private val drawable: Drawable,
+ private val maskDiameter: Float
+) : Drawable() {
+ private val mask = Path().apply {
+ val radius = maskDiameter / 2f
+ addCircle(0f, 0f, radius, Path.Direction.CW)
+ }
+
+ override fun draw(canvas: Canvas) {
+ canvas.clipPath(mask)
+ drawable.draw(canvas)
+ }
+
+ override fun setAlpha(alpha: Int) {
+ drawable.alpha = alpha
+ }
+
+ override fun setColorFilter(colorFilter: ColorFilter?) {
+ drawable.colorFilter = colorFilter
+ }
+
+ @Suppress("DEPRECATION")
+ override fun getOpacity() = drawable.opacity
+
+ override fun onBoundsChange(bounds: Rect?) {
+ super.onBoundsChange(bounds)
+ bounds ?: return
+ drawable.bounds = bounds
+ mask.offset(bounds.exactCenterX(), bounds.exactCenterY())
+ }
+}
\ No newline at end of file
diff --git a/core/core-splashscreen/src/main/java/androidx/core/splashscreen/SplashScreen.kt b/core/core-splashscreen/src/main/java/androidx/core/splashscreen/SplashScreen.kt
index 94c0b67..618384e 100644
--- a/core/core-splashscreen/src/main/java/androidx/core/splashscreen/SplashScreen.kt
+++ b/core/core-splashscreen/src/main/java/androidx/core/splashscreen/SplashScreen.kt
@@ -19,6 +19,8 @@
import android.annotation.SuppressLint
import android.app.Activity
import android.content.res.Resources
+import android.graphics.drawable.Drawable
+import android.os.Build
import android.os.Build.VERSION.PREVIEW_SDK_INT
import android.os.Build.VERSION.SDK_INT
import android.util.TypedValue
@@ -49,12 +51,13 @@
private val impl = when {
SDK_INT >= 31 -> Impl31(activity)
SDK_INT == 30 && PREVIEW_SDK_INT > 0 -> Impl31(activity)
- SDK_INT >= 23 -> Impl23(activity)
else -> Impl(activity)
}
public companion object {
+ private const val MASK_FACTOR = 2 / 3f
+
/**
* Creates a [SplashScreen] instance associated with this [Activity] and handles
* setting the theme to [R.attr.postSplashScreenTheme].
@@ -161,7 +164,8 @@
var finalThemeId: Int = 0
var backgroundResId: Int? = null
var backgroundColor: Int? = null
- var icon: Int = 0
+ var icon: Drawable? = null
+ var hasBackground: Boolean = false
var splashScreenWaitPredicate = KeepOnScreenCondition { false }
private var animationListener: OnExitAnimationListener? = null
@@ -185,7 +189,12 @@
true
)
) {
- icon = typedValue.resourceId
+ icon = currentTheme.getDrawable(typedValue.resourceId)
+ }
+
+ if (currentTheme.resolveAttribute(R.attr.splashScreenIconSize, typedValue, true)) {
+ hasBackground =
+ typedValue.resourceId == R.dimen.splashscreen_icon_size_with_background
}
setPostSplashScreenTheme(currentTheme, typedValue)
}
@@ -199,11 +208,6 @@
if (finalThemeId != 0) {
activity.setTheme(finalThemeId)
}
- } else {
- throw Resources.NotFoundException(
- "Cannot set AppTheme. No theme value defined for attribute " +
- activity.resources.getResourceName(R.attr.postSplashScreenTheme)
- )
}
}
@@ -229,18 +233,19 @@
val splashScreenViewProvider = SplashScreenViewProvider(activity)
val finalBackgroundResId = backgroundResId
val finalBackgroundColor = backgroundColor
+ val splashScreenView = splashScreenViewProvider.view
+
if (finalBackgroundResId != null && finalBackgroundResId != Resources.ID_NULL) {
- splashScreenViewProvider.view.setBackgroundResource(finalBackgroundResId)
+ splashScreenView.setBackgroundResource(finalBackgroundResId)
} else if (finalBackgroundColor != null) {
- splashScreenViewProvider.view.setBackgroundColor(finalBackgroundColor)
+ splashScreenView.setBackgroundColor(finalBackgroundColor)
} else {
- splashScreenViewProvider.view.background = activity.window.decorView.background
+ splashScreenView.background = activity.window.decorView.background
}
- splashScreenViewProvider.view.findViewById<ImageView>(R.id.splashscreen_icon_view)
- .setBackgroundResource(icon)
+ icon?.let { displaySplashScreenIcon(splashScreenView, it) }
- splashScreenViewProvider.view.addOnLayoutChangeListener(
+ splashScreenView.addOnLayoutChangeListener(
object : OnLayoutChangeListener {
override fun onLayoutChange(
view: View,
@@ -253,7 +258,6 @@
oldRight: Int,
oldBottom: Int
) {
- adjustInsets(view, splashScreenViewProvider)
if (!view.isAttachedToWindow) {
return
}
@@ -268,6 +272,31 @@
})
}
+ private fun displaySplashScreenIcon(splashScreenView: View, icon: Drawable) {
+ val iconView = splashScreenView.findViewById<ImageView>(R.id.splashscreen_icon_view)
+ iconView.apply {
+ val maskSize: Float
+ if (hasBackground) {
+ // If the splash screen has an icon background we need to mask both the
+ // background and foreground.
+ val iconBackgroundDrawable = context.getDrawable(R.drawable.icon_background)
+
+ val iconSize =
+ resources.getDimension(R.dimen.splashscreen_icon_size_with_background)
+ maskSize = iconSize * MASK_FACTOR
+
+ if (iconBackgroundDrawable != null) {
+ background = MaskedDrawable(iconBackgroundDrawable, maskSize)
+ }
+ } else {
+ val iconSize =
+ resources.getDimension(R.dimen.splashscreen_icon_size_no_background)
+ maskSize = iconSize * MASK_FACTOR
+ }
+ setImageDrawable(MaskedDrawable(icon, maskSize))
+ }
+ }
+
fun dispatchOnExitAnimation(splashScreenViewProvider: SplashScreenViewProvider) {
val finalListener = animationListener ?: return
animationListener = null
@@ -275,35 +304,9 @@
finalListener.onSplashScreenExit(splashScreenViewProvider)
}
}
-
- /**
- * Adjust the insets to avoid any jump between the actual splash screen and the
- * SplashScreen View
- */
- open fun adjustInsets(
- view: View,
- splashScreenViewProvider: SplashScreenViewProvider
- ) {
- // No-op
- }
}
- @Suppress("DEPRECATION")
- @RequiresApi(23)
- private class Impl23(activity: Activity) : Impl(activity) {
- override fun adjustInsets(
- view: View,
- splashScreenViewProvider: SplashScreenViewProvider
- ) {
- // Offset the icon if the insets have changed
- val rootWindowInsets = view.rootWindowInsets
- val ty =
- rootWindowInsets.systemWindowInsetTop - rootWindowInsets.systemWindowInsetBottom
- splashScreenViewProvider.iconView.translationY = -ty.toFloat() / 2f
- }
- }
-
- @RequiresApi(31) // TODO(188897399) Update to "S" once finalized
+ @RequiresApi(Build.VERSION_CODES.S)
private class Impl31(activity: Activity) : Impl(activity) {
var preDrawListener: OnPreDrawListener? = null
diff --git a/core/core-splashscreen/src/main/java/androidx/core/splashscreen/SplashScreenViewProvider.kt b/core/core-splashscreen/src/main/java/androidx/core/splashscreen/SplashScreenViewProvider.kt
index 11eda6d..a0c4e5b 100644
--- a/core/core-splashscreen/src/main/java/androidx/core/splashscreen/SplashScreenViewProvider.kt
+++ b/core/core-splashscreen/src/main/java/androidx/core/splashscreen/SplashScreenViewProvider.kt
@@ -50,6 +50,8 @@
Build.VERSION.SDK_INT >= 31 -> ViewImpl31(ctx)
Build.VERSION.SDK_INT == 30 && Build.VERSION.PREVIEW_SDK_INT > 0 -> ViewImpl31(ctx)
else -> ViewImpl(ctx)
+ }.apply {
+ createSplashScreenView()
}
/**
@@ -98,23 +100,28 @@
) as ViewGroup
}
- init {
+ open fun createSplashScreenView() {
val content = activity.findViewById<ViewGroup>(android.R.id.content)
- content.addView(_splashScreenView)
+ (content.rootView as? ViewGroup)?.addView(_splashScreenView)
}
open val splashScreenView: ViewGroup get() = _splashScreenView
open val iconView: View get() = splashScreenView.findViewById(R.id.splashscreen_icon_view)
open val iconAnimationStartMillis: Long get() = 0
open val iconAnimationDurationMillis: Long get() = 0
- open fun remove() =
- activity.findViewById<ViewGroup>(android.R.id.content).removeView(splashScreenView)
+ open fun remove() {
+ (splashScreenView.parent as? ViewGroup)?.removeView(splashScreenView)
+ }
}
@RequiresApi(31)
private class ViewImpl31(activity: Activity) : ViewImpl(activity) {
lateinit var platformView: SplashScreenView
+ override fun createSplashScreenView() {
+ // Do nothing
+ }
+
override val splashScreenView get() = platformView
override val iconView get() = platformView.iconView!!
diff --git a/core/core-splashscreen/src/main/res/drawable-v23/compat_splash_screen.xml b/core/core-splashscreen/src/main/res/drawable-v23/compat_splash_screen.xml
index 30562b0..a74589d 100644
--- a/core/core-splashscreen/src/main/res/drawable-v23/compat_splash_screen.xml
+++ b/core/core-splashscreen/src/main/res/drawable-v23/compat_splash_screen.xml
@@ -19,8 +19,26 @@
<color android:color="?attr/windowSplashScreenBackground" />
</item>
<item
- android:drawable="?attr/windowSplashScreenAnimatedIcon"
android:gravity="center"
- android:width="@dimen/splashscreen_icon_size"
- android:height="@dimen/splashscreen_icon_size" />
+ android:width="@dimen/splashscreen_icon_size_with_background"
+ android:height="@dimen/splashscreen_icon_size_with_background"
+ android:drawable="@drawable/icon_background">
+ </item>
+ <item
+ android:drawable="?windowSplashScreenAnimatedIcon"
+ android:gravity="center"
+ android:width="@dimen/splashscreen_icon_size_with_background"
+ android:height="@dimen/splashscreen_icon_size_with_background" />
+
+ <!-- We mask the outer bounds of the icon like we do on Android 12 -->
+ <item
+ android:gravity="center"
+ android:width="@dimen/splashscreen_icon_mask_size_with_background"
+ android:height="@dimen/splashscreen_icon_mask_size_with_background">
+ <shape android:shape="oval">
+ <stroke
+ android:width="@dimen/splashscreen_icon_mask_stroke_with_background"
+ android:color="?windowSplashScreenBackground" />
+ </shape>
+ </item>
</layer-list>
\ No newline at end of file
diff --git a/core/core-splashscreen/src/main/res/drawable-v23/compat_splash_screen_no_icon_background.xml b/core/core-splashscreen/src/main/res/drawable-v23/compat_splash_screen_no_icon_background.xml
new file mode 100644
index 0000000..74a5d25
--- /dev/null
+++ b/core/core-splashscreen/src/main/res/drawable-v23/compat_splash_screen_no_icon_background.xml
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="utf-8"?><!--
+ Copyright 2021 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+ -->
+
+<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
+ <item android:gravity="fill">
+ <color android:color="?attr/windowSplashScreenBackground" />
+ </item>
+ <item
+ android:drawable="?windowSplashScreenAnimatedIcon"
+ android:gravity="center"
+ android:width="@dimen/splashscreen_icon_size_no_background"
+ android:height="@dimen/splashscreen_icon_size_no_background" />
+
+ <!-- We mask the outer bounds of the icon like we do on Android 12 -->
+ <item
+ android:gravity="center"
+ android:width="@dimen/splashscreen_icon_mask_size_no_background"
+ android:height="@dimen/splashscreen_icon_mask_size_no_background">
+ <shape android:shape="oval">
+ <stroke
+ android:width="@dimen/splashscreen_icon_mask_stroke_no_background"
+ android:color="?windowSplashScreenBackground"/>
+ </shape>
+ </item>
+</layer-list>
\ No newline at end of file
diff --git a/core/core-splashscreen/samples/src/main/res/drawable/foreground.xml b/core/core-splashscreen/src/main/res/drawable/compat_splash_screen_no_icon_background.xml
similarity index 81%
rename from core/core-splashscreen/samples/src/main/res/drawable/foreground.xml
rename to core/core-splashscreen/src/main/res/drawable/compat_splash_screen_no_icon_background.xml
index c46194a..28bd4d5 100644
--- a/core/core-splashscreen/samples/src/main/res/drawable/foreground.xml
+++ b/core/core-splashscreen/src/main/res/drawable/compat_splash_screen_no_icon_background.xml
@@ -14,7 +14,5 @@
limitations under the License.
-->
-<inset xmlns:android="http://schemas.android.com/apk/res/android"
- android:drawable="@drawable/android"
- android:inset="25%">
-</inset>
\ No newline at end of file
+<color xmlns:android="http://schemas.android.com/apk/res/android"
+ android:color="?attr/windowSplashScreenBackground" />
\ No newline at end of file
diff --git a/core/core-splashscreen/samples/src/main/res/drawable/foreground.xml b/core/core-splashscreen/src/main/res/drawable/icon_background.xml
similarity index 78%
copy from core/core-splashscreen/samples/src/main/res/drawable/foreground.xml
copy to core/core-splashscreen/src/main/res/drawable/icon_background.xml
index c46194a..3015067 100644
--- a/core/core-splashscreen/samples/src/main/res/drawable/foreground.xml
+++ b/core/core-splashscreen/src/main/res/drawable/icon_background.xml
@@ -13,8 +13,6 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-
-<inset xmlns:android="http://schemas.android.com/apk/res/android"
- android:drawable="@drawable/android"
- android:inset="25%">
-</inset>
\ No newline at end of file
+<shape android:shape="oval" xmlns:android="http://schemas.android.com/apk/res/android">
+ <solid android:color="?attr/windowSplashScreenIconBackgroundColor" />
+</shape>
\ No newline at end of file
diff --git a/core/core-splashscreen/src/main/res/layout/splash_screen_view.xml b/core/core-splashscreen/src/main/res/layout/splash_screen_view.xml
index 44ab5e19..76ba5f2 100644
--- a/core/core-splashscreen/src/main/res/layout/splash_screen_view.xml
+++ b/core/core-splashscreen/src/main/res/layout/splash_screen_view.xml
@@ -17,12 +17,13 @@
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
- android:layout_height="match_parent">
+ android:layout_height="match_parent"
+ android:fitsSystemWindows="false">
<ImageView
android:id="@+id/splashscreen_icon_view"
- android:layout_width="@dimen/splashscreen_icon_size"
- android:layout_height="@dimen/splashscreen_icon_size"
- android:layout_gravity="center" />
+ android:layout_width="?attr/splashScreenIconSize"
+ android:layout_height="?attr/splashScreenIconSize"
+ android:layout_gravity="center"/>
</FrameLayout>
\ No newline at end of file
diff --git a/core/core-splashscreen/src/main/res/values-v31/styles.xml b/core/core-splashscreen/src/main/res/values-v31/styles.xml
index 7f04b15..90b4c18 100644
--- a/core/core-splashscreen/src/main/res/values-v31/styles.xml
+++ b/core/core-splashscreen/src/main/res/values-v31/styles.xml
@@ -22,5 +22,12 @@
<item name="android:windowSplashScreenAnimationDuration">
?windowSplashScreenAnimationDuration
</item>
+ <item name="android:windowSplashScreenIconBackgroundColor">@android:color/transparent</item>
+ </style>
+
+ <style name="Theme.SplashScreen.IconBackground" parent="Theme.SplashScreen">
+ <item name="android:windowSplashScreenIconBackgroundColor">
+ ?windowSplashScreenIconBackgroundColor
+ </item>
</style>
</resources>
\ No newline at end of file
diff --git a/core/core-splashscreen/src/main/res/values/attrs.xml b/core/core-splashscreen/src/main/res/values/attrs.xml
index 5bbfaa3..b7531b5 100644
--- a/core/core-splashscreen/src/main/res/values/attrs.xml
+++ b/core/core-splashscreen/src/main/res/values/attrs.xml
@@ -1,5 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
+<?xml version="1.0" encoding="utf-8"?><!--
Copyright 2021 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
@@ -22,6 +21,9 @@
directory Defaults to @drawable/ic_launcher. -->
<attr name="windowSplashScreenAnimatedIcon" format="reference" />
+ <!-- Optional color to be displayed below the icon -->
+ <attr name="windowSplashScreenIconBackgroundColor" format="color" />
+
<!-- Background color of the splash screen. Defaults to the theme's windowBackground-->
<attr name="windowSplashScreenBackground" format="color" />
@@ -30,4 +32,8 @@
<!-- Theme to apply to the Activity once the splash screen is dismissed-->
<attr name="postSplashScreenTheme" format="reference" />
+
+ <!-- The size of the splash screen icon. It varies depending on the
+ presence or not of an icon background-->
+ <attr name="splashScreenIconSize" format="dimension" />
</resources>
\ No newline at end of file
diff --git a/core/core-splashscreen/src/main/res/values/dimens.xml b/core/core-splashscreen/src/main/res/values/dimens.xml
index 7c5b998..5ceca01 100644
--- a/core/core-splashscreen/src/main/res/values/dimens.xml
+++ b/core/core-splashscreen/src/main/res/values/dimens.xml
@@ -15,6 +15,17 @@
-->
<resources>
- <dimen name="splashscreen_icon_size">160dp</dimen>
+ <!-- The size of the splash screen icon. The size varies whether
+ the windowSplashScreenIconBackgroundColor attribute is set-->
+ <dimen name="splashscreen_icon_size">?splashScreenIconSize</dimen>
+
+ <dimen name="splashscreen_icon_size_no_background">288dp</dimen>
+ <dimen name="splashscreen_icon_mask_size_no_background">410dp</dimen>
+ <dimen name="splashscreen_icon_mask_stroke_no_background">109dp</dimen>
+
+ <dimen name="splashscreen_icon_size_with_background">240dp</dimen>
+ <dimen name="splashscreen_icon_mask_size_with_background">342dp</dimen>
+ <dimen name="splashscreen_icon_mask_stroke_with_background">92dp</dimen>
+
<integer name="default_icon_animation_duration">10000</integer>
</resources>
\ No newline at end of file
diff --git a/core/core-splashscreen/src/main/res/values/public.xml b/core/core-splashscreen/src/main/res/values/public.xml
index f90eec9..cd917e9 100644
--- a/core/core-splashscreen/src/main/res/values/public.xml
+++ b/core/core-splashscreen/src/main/res/values/public.xml
@@ -19,4 +19,6 @@
<public name="windowSplashScreenAnimationDuration" type="attr" />
<public name="postSplashScreenTheme" type="attr" />
<public name="Theme.SplashScreen" type="style" />
+ <public name="Theme.SplashScreen.IconBackground" type="style" />
+ <public name="splashscreen_icon_size" type="dimen" />
</resources>
diff --git a/core/core-splashscreen/src/main/res/values/styles.xml b/core/core-splashscreen/src/main/res/values/styles.xml
index ec205a7..52335ac 100644
--- a/core/core-splashscreen/src/main/res/values/styles.xml
+++ b/core/core-splashscreen/src/main/res/values/styles.xml
@@ -17,12 +17,15 @@
<resources>
<style name="Theme.SplashScreenBase" parent="android:Theme.NoTitleBar">
- <item name="android:windowBackground">@drawable/compat_splash_screen</item>
+ <item name="android:windowBackground">
+ @drawable/compat_splash_screen_no_icon_background
+ </item>
<item name="android:opacity">opaque</item>
<item name="android:windowDrawsSystemBarBackgrounds">true</item>
<item name="android:fitsSystemWindows">false</item>
<item name="android:statusBarColor">@android:color/transparent</item>
<item name="android:navigationBarColor">@android:color/transparent</item>
+ <item name="splashScreenIconSize">@dimen/splashscreen_icon_size_no_background</item>
</style>
<style name="Theme.SplashScreen" parent="Theme.SplashScreenBase">
@@ -32,5 +35,11 @@
</item>
<item name="windowSplashScreenBackground">@android:color/background_light</item>
<item name="windowSplashScreenAnimatedIcon">@android:drawable/sym_def_app_icon</item>
+
+ </style>
+
+ <style name="Theme.SplashScreen.IconBackground" parent="Theme.SplashScreen">
+ <item name="android:windowBackground">@drawable/compat_splash_screen</item>
+ <item name="splashScreenIconSize">@dimen/splashscreen_icon_size_with_background</item>
</style>
</resources>
\ No newline at end of file
diff --git a/core/core/api/api_lint.ignore b/core/core/api/api_lint.ignore
index d3e16b5a..aeda947 100644
--- a/core/core/api/api_lint.ignore
+++ b/core/core/api/api_lint.ignore
@@ -133,6 +133,10 @@
Method should return Collection<Drawable> (or subclass) instead of raw array; was `android.graphics.drawable.Drawable[]`
+AsyncSuffixFuture: androidx.core.content.PackageManagerCompat#getUnusedAppRestrictionsStatus(android.content.Context):
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
+
+
BadFuture: androidx.core.text.PrecomputedTextCompat#getTextFuture(CharSequence, androidx.core.text.PrecomputedTextCompat.Params, java.util.concurrent.Executor):
Use ListenableFuture (library), or a combination of Consumer<T>, Executor, and CancellationSignal (platform) instead of java.util.concurrent.Future (method androidx.core.text.PrecomputedTextCompat.getTextFuture(CharSequence,androidx.core.text.PrecomputedTextCompat.Params,java.util.concurrent.Executor))
diff --git a/core/core/lint-baseline.xml b/core/core/lint-baseline.xml
index 2c24d1a..1ff06b3 100644
--- a/core/core/lint-baseline.xml
+++ b/core/core/lint-baseline.xml
@@ -1,60 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<issues format="6" by="lint 7.1.0-dev" type="baseline" client="gradle" dependencies="false" name="AGP (7.1.0-dev)" variant="all" version="7.1.0-dev">
-
- <issue
- id="NewApi"
- message="Call requires API level S (current min is 14): `android.view.ContentInfo#getClip`"
- errorLine1=" return mWrapped.getClip();"
- errorLine2=" ~~~~~~~">
- <location
- file="src/main/java/androidx/core/view/ContentInfoCompat.java"
- line="456"
- column="29"/>
- </issue>
-
- <issue
- id="NewApi"
- message="Call requires API level S (current min is 14): `android.view.ContentInfo#getSource`"
- errorLine1=" return mWrapped.getSource();"
- errorLine2=" ~~~~~~~~~">
- <location
- file="src/main/java/androidx/core/view/ContentInfoCompat.java"
- line="462"
- column="29"/>
- </issue>
-
- <issue
- id="NewApi"
- message="Call requires API level S (current min is 14): `android.view.ContentInfo#getFlags`"
- errorLine1=" return mWrapped.getFlags();"
- errorLine2=" ~~~~~~~~">
- <location
- file="src/main/java/androidx/core/view/ContentInfoCompat.java"
- line="468"
- column="29"/>
- </issue>
-
- <issue
- id="NewApi"
- message="Call requires API level S (current min is 14): `android.view.ContentInfo#getLinkUri`"
- errorLine1=" return mWrapped.getLinkUri();"
- errorLine2=" ~~~~~~~~~~">
- <location
- file="src/main/java/androidx/core/view/ContentInfoCompat.java"
- line="474"
- column="29"/>
- </issue>
-
- <issue
- id="NewApi"
- message="Call requires API level S (current min is 14): `android.view.ContentInfo#getExtras`"
- errorLine1=" return mWrapped.getExtras();"
- errorLine2=" ~~~~~~~~~">
- <location
- file="src/main/java/androidx/core/view/ContentInfoCompat.java"
- line="480"
- column="29"/>
- </issue>
+<issues format="6" by="lint 7.2.0-dev" type="baseline" client="gradle" dependencies="false" name="AGP (7.2.0-dev)" variant="all" version="7.2.0-dev">
<issue
id="NewApi"
@@ -157,39 +102,6 @@
<issue
id="NewApi"
- message="Call requires API level S (current min is 30): `new android.widget.EdgeEffect`"
- errorLine1=" return new EdgeEffect(context, attrs);"
- errorLine2=" ~~~~~~~~~~~~~~">
- <location
- file="src/main/java/androidx/core/widget/EdgeEffectCompat.java"
- line="306"
- column="24"/>
- </issue>
-
- <issue
- id="NewApi"
- message="Call requires API level S (current min is 30): `android.widget.EdgeEffect#onPullDistance`"
- errorLine1=" return edgeEffect.onPullDistance(deltaDistance, displacement);"
- errorLine2=" ~~~~~~~~~~~~~~">
- <location
- file="src/main/java/androidx/core/widget/EdgeEffectCompat.java"
- line="319"
- column="35"/>
- </issue>
-
- <issue
- id="NewApi"
- message="Call requires API level S (current min is 30): `android.widget.EdgeEffect#getDistance`"
- errorLine1=" return edgeEffect.getDistance();"
- errorLine2=" ~~~~~~~~~~~">
- <location
- file="src/main/java/androidx/core/widget/EdgeEffectCompat.java"
- line="329"
- column="35"/>
- </issue>
-
- <issue
- id="NewApi"
message="Call requires API level 19 (current min is 14): `java.lang.AutoCloseable#close`"
errorLine1=" closeable.close();"
errorLine2=" ~~~~~">
@@ -201,248 +113,6 @@
<issue
id="NewApi"
- message="Class requires API level S (current min is 14): `android.location.LocationRequest`"
- errorLine1=" LocationRequest.class, Executor.class, LocationListener.class);"
- errorLine2=" ~~~~~~~~~~~~~~~">
- <location
- file="src/main/java/androidx/core/location/LocationManagerCompat.java"
- line="254"
- column="29"/>
- </issue>
-
- <issue
- id="NewApi"
- message="Class requires API level S (current min is 14): `android.location.LocationRequest`"
- errorLine1=" LocationRequest.class, LocationListener.class, Looper.class);"
- errorLine2=" ~~~~~~~~~~~~~~~">
- <location
- file="src/main/java/androidx/core/location/LocationManagerCompat.java"
- line="273"
- column="29"/>
- </issue>
-
- <issue
- id="NewApi"
- message="Class requires API level S (current min is 14): `android.location.LocationRequest`"
- errorLine1=" LocationRequest.class, LocationListener.class, Looper.class);"
- errorLine2=" ~~~~~~~~~~~~~~~">
- <location
- file="src/main/java/androidx/core/location/LocationManagerCompat.java"
- line="324"
- column="29"/>
- </issue>
-
- <issue
- id="NewApi"
- message="Call requires API level 24 (current min is 14): `java.util.Collection#removeIf`"
- errorLine1=" transports.removeIf(reference -> reference.get() == null);"
- errorLine2=" ~~~~~~~~">
- <location
- file="src/main/java/androidx/core/location/LocationManagerCompat.java"
- line="633"
- column="28"/>
- </issue>
-
- <issue
- id="NewApi"
- message="Call requires API level S (current min is 14): `android.location.LocationListener#onLocationChanged`"
- errorLine1=" listener.onLocationChanged(locations);"
- errorLine2=" ~~~~~~~~~~~~~~~~~">
- <location
- file="src/main/java/androidx/core/location/LocationManagerCompat.java"
- line="668"
- column="26"/>
- </issue>
-
- <issue
- id="NewApi"
- message="Call requires API level S (current min is 14): `android.location.LocationListener#onFlushComplete`"
- errorLine1=" listener.onFlushComplete(requestCode);"
- errorLine2=" ~~~~~~~~~~~~~~~">
- <location
- file="src/main/java/androidx/core/location/LocationManagerCompat.java"
- line="683"
- column="26"/>
- </issue>
-
- <issue
- id="NewApi"
- message="Class requires API level S (current min is 19): `android.location.LocationRequest`"
- errorLine1=" sCreateFromDeprecatedProviderMethod = LocationRequest.class.getDeclaredMethod("
- errorLine2=" ~~~~~~~~~~~~~~~">
- <location
- file="src/main/java/androidx/core/location/LocationRequestCompat.java"
- line="234"
- column="55"/>
- </issue>
-
- <issue
- id="NewApi"
- message="Class requires API level S (current min is 19): `android.location.LocationRequest`"
- errorLine1=" (LocationRequest) sCreateFromDeprecatedProviderMethod.invoke(null, provider,"
- errorLine2=" ~~~~~~~~~~~~~~~">
- <location
- file="src/main/java/androidx/core/location/LocationRequestCompat.java"
- line="241"
- column="22"/>
- </issue>
-
- <issue
- id="NewApi"
- message="Class requires API level S (current min is 19): `android.location.LocationRequest`"
- errorLine1=" sSetQualityMethod = LocationRequest.class.getDeclaredMethod("
- errorLine2=" ~~~~~~~~~~~~~~~">
- <location
- file="src/main/java/androidx/core/location/LocationRequestCompat.java"
- line="250"
- column="37"/>
- </issue>
-
- <issue
- id="NewApi"
- message="Class requires API level S (current min is 19): `android.location.LocationRequest`"
- errorLine1=" sSetFastestIntervalMethod = LocationRequest.class.getDeclaredMethod("
- errorLine2=" ~~~~~~~~~~~~~~~">
- <location
- file="src/main/java/androidx/core/location/LocationRequestCompat.java"
- line="258"
- column="49"/>
- </issue>
-
- <issue
- id="NewApi"
- message="Class requires API level S (current min is 19): `android.location.LocationRequest`"
- errorLine1=" sSetNumUpdatesMethod = LocationRequest.class.getDeclaredMethod("
- errorLine2=" ~~~~~~~~~~~~~~~">
- <location
- file="src/main/java/androidx/core/location/LocationRequestCompat.java"
- line="268"
- column="44"/>
- </issue>
-
- <issue
- id="NewApi"
- message="Class requires API level S (current min is 19): `android.location.LocationRequest`"
- errorLine1=" sSetExpireInMethod = LocationRequest.class.getDeclaredMethod("
- errorLine2=" ~~~~~~~~~~~~~~~">
- <location
- file="src/main/java/androidx/core/location/LocationRequestCompat.java"
- line="278"
- column="42"/>
- </issue>
-
- <issue
- id="NewApi"
- message="Call requires API level S (current min is 19): `android.location.LocationRequest#getQuality`"
- errorLine1=" builder.build().toLocationRequest("test").getQuality());"
- errorLine2=" ~~~~~~~~~~">
- <location
- file="src/androidTest/java/androidx/core/location/LocationRequestCompatTest.java"
- line="102"
- column="59"/>
- </issue>
-
- <issue
- id="NewApi"
- message="Call requires API level S (current min is 19): `toLocationRequest`"
- errorLine1=" assertEquals(Long.MAX_VALUE, getExpireAt(builder.build().toLocationRequest()));"
- errorLine2=" ~~~~~~~~~~~~~~~~~">
- <location
- file="src/androidTest/java/androidx/core/location/LocationRequestCompatTest.java"
- line="105"
- column="66"/>
- </issue>
-
- <issue
- id="NewApi"
- message="Call requires API level S (current min is 19): `android.location.LocationRequest#getQuality`"
- errorLine1=" assertEquals(QUALITY_HIGH_ACCURACY, builder.build().toLocationRequest("test").getQuality());"
- errorLine2=" ~~~~~~~~~~">
- <location
- file="src/androidTest/java/androidx/core/location/LocationRequestCompatTest.java"
- line="110"
- column="87"/>
- </issue>
-
- <issue
- id="NewApi"
- message="Call requires API level S (current min is 19): `toLocationRequest`"
- errorLine1=" assertThat(getExpireAt(builder.build().toLocationRequest())).isIn("
- errorLine2=" ~~~~~~~~~~~~~~~~~">
- <location
- file="src/androidTest/java/androidx/core/location/LocationRequestCompatTest.java"
- line="126"
- column="48"/>
- </issue>
-
- <issue
- id="NewApi"
- message="Class requires API level S (current min is 14): `android.location.LocationRequest`"
- errorLine1=" sGetProviderMethod = LocationRequest.class.getDeclaredMethod("getProvider");"
- errorLine2=" ~~~~~~~~~~~~~~~">
- <location
- file="src/androidTest/java/androidx/core/location/LocationRequestCompatTest.java"
- line="186"
- column="34"/>
- </issue>
-
- <issue
- id="NewApi"
- message="Class requires API level S (current min is 14): `android.location.LocationRequest`"
- errorLine1=" sGetIntervalMethod = LocationRequest.class.getDeclaredMethod("getInterval");"
- errorLine2=" ~~~~~~~~~~~~~~~">
- <location
- file="src/androidTest/java/androidx/core/location/LocationRequestCompatTest.java"
- line="196"
- column="34"/>
- </issue>
-
- <issue
- id="NewApi"
- message="Class requires API level S (current min is 14): `android.location.LocationRequest`"
- errorLine1=" sGetFastestIntervalMethod = LocationRequest.class.getDeclaredMethod("
- errorLine2=" ~~~~~~~~~~~~~~~">
- <location
- file="src/androidTest/java/androidx/core/location/LocationRequestCompatTest.java"
- line="206"
- column="41"/>
- </issue>
-
- <issue
- id="NewApi"
- message="Class requires API level S (current min is 14): `android.location.LocationRequest`"
- errorLine1=" sGetExpireAtMethod = LocationRequest.class.getDeclaredMethod("getExpireAt");"
- errorLine2=" ~~~~~~~~~~~~~~~">
- <location
- file="src/androidTest/java/androidx/core/location/LocationRequestCompatTest.java"
- line="217"
- column="34"/>
- </issue>
-
- <issue
- id="NewApi"
- message="Class requires API level S (current min is 14): `android.location.LocationRequest`"
- errorLine1=" sGetNumUpdatesMethod = LocationRequest.class.getDeclaredMethod("getNumUpdates");"
- errorLine2=" ~~~~~~~~~~~~~~~">
- <location
- file="src/androidTest/java/androidx/core/location/LocationRequestCompatTest.java"
- line="227"
- column="36"/>
- </issue>
-
- <issue
- id="NewApi"
- message="Class requires API level S (current min is 14): `android.location.LocationRequest`"
- errorLine1=" sGetSmallestDisplacementMethod = LocationRequest.class.getDeclaredMethod("
- errorLine2=" ~~~~~~~~~~~~~~~">
- <location
- file="src/androidTest/java/androidx/core/location/LocationRequestCompatTest.java"
- line="237"
- column="46"/>
- </issue>
-
- <issue
- id="NewApi"
message="Call requires API level 26 (current min is 14): `android.app.NotificationChannel#getImportance`"
errorLine1=" boolean equality = nc1.getImportance() == nc2.getImportance()"
errorLine2=" ~~~~~~~~~~~~~">
@@ -899,7 +569,7 @@
errorLine2=" ~~~~~~~">
<location
file="src/androidTest/java/androidx/core/app/NotificationCompatTest.java"
- line="1421"
+ line="1440"
column="68"/>
</issue>
@@ -910,7 +580,7 @@
errorLine2=" ~~~~~~~">
<location
file="src/androidTest/java/androidx/core/app/NotificationCompatTest.java"
- line="1436"
+ line="1455"
column="65"/>
</issue>
@@ -921,7 +591,7 @@
errorLine2=" ~~~~~~~">
<location
file="src/androidTest/java/androidx/core/app/NotificationCompatTest.java"
- line="1452"
+ line="1471"
column="57"/>
</issue>
@@ -932,7 +602,7 @@
errorLine2=" ~~~~~~~">
<location
file="src/androidTest/java/androidx/core/app/NotificationCompatTest.java"
- line="1462"
+ line="1481"
column="54"/>
</issue>
@@ -943,7 +613,7 @@
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
<location
file="src/androidTest/java/androidx/core/app/NotificationCompatTest.java"
- line="2029"
+ line="2048"
column="17"/>
</issue>
@@ -954,7 +624,7 @@
errorLine2=" ~~~~~~~~~~~~~~~~~~~">
<location
file="src/androidTest/java/androidx/core/app/NotificationCompatTest.java"
- line="2241"
+ line="2260"
column="36"/>
</issue>
@@ -982,7 +652,7 @@
<issue
id="NewApi"
- message="Call requires API level 29 (current min is 28): `COLOR_DODGE`"
+ message="Field requires API level 29 (current min is 28): `COLOR_DODGE`"
errorLine1=" verifyPorterDuffMatchesCompat(BlendModeCompat.COLOR_DODGE, null);"
errorLine2=" ~~~~~~~~~~~">
<location
@@ -993,7 +663,7 @@
<issue
id="NewApi"
- message="Call requires API level 29 (current min is 28): `COLOR_BURN`"
+ message="Field requires API level 29 (current min is 28): `COLOR_BURN`"
errorLine1=" verifyPorterDuffMatchesCompat(BlendModeCompat.COLOR_BURN, null);"
errorLine2=" ~~~~~~~~~~">
<location
@@ -1004,7 +674,7 @@
<issue
id="NewApi"
- message="Call requires API level 29 (current min is 28): `HARD_LIGHT`"
+ message="Field requires API level 29 (current min is 28): `HARD_LIGHT`"
errorLine1=" verifyPorterDuffMatchesCompat(BlendModeCompat.HARD_LIGHT, null);"
errorLine2=" ~~~~~~~~~~">
<location
@@ -1015,7 +685,7 @@
<issue
id="NewApi"
- message="Call requires API level 29 (current min is 28): `SOFT_LIGHT`"
+ message="Field requires API level 29 (current min is 28): `SOFT_LIGHT`"
errorLine1=" verifyPorterDuffMatchesCompat(BlendModeCompat.SOFT_LIGHT, null);"
errorLine2=" ~~~~~~~~~~">
<location
@@ -1026,7 +696,7 @@
<issue
id="NewApi"
- message="Call requires API level 29 (current min is 28): `DIFFERENCE`"
+ message="Field requires API level 29 (current min is 28): `DIFFERENCE`"
errorLine1=" verifyPorterDuffMatchesCompat(BlendModeCompat.DIFFERENCE, null);"
errorLine2=" ~~~~~~~~~~">
<location
@@ -1037,7 +707,7 @@
<issue
id="NewApi"
- message="Call requires API level 29 (current min is 28): `EXCLUSION`"
+ message="Field requires API level 29 (current min is 28): `EXCLUSION`"
errorLine1=" verifyPorterDuffMatchesCompat(BlendModeCompat.EXCLUSION, null);"
errorLine2=" ~~~~~~~~~">
<location
@@ -1048,7 +718,7 @@
<issue
id="NewApi"
- message="Call requires API level 29 (current min is 28): `MULTIPLY`"
+ message="Field requires API level 29 (current min is 28): `MULTIPLY`"
errorLine1=" verifyPorterDuffMatchesCompat(BlendModeCompat.MULTIPLY, null);"
errorLine2=" ~~~~~~~~">
<location
@@ -1059,7 +729,7 @@
<issue
id="NewApi"
- message="Call requires API level 29 (current min is 28): `HUE`"
+ message="Field requires API level 29 (current min is 28): `HUE`"
errorLine1=" verifyPorterDuffMatchesCompat(BlendModeCompat.HUE, null);"
errorLine2=" ~~~">
<location
@@ -1070,7 +740,7 @@
<issue
id="NewApi"
- message="Call requires API level 29 (current min is 28): `SATURATION`"
+ message="Field requires API level 29 (current min is 28): `SATURATION`"
errorLine1=" verifyPorterDuffMatchesCompat(BlendModeCompat.SATURATION, null);"
errorLine2=" ~~~~~~~~~~">
<location
@@ -1081,7 +751,7 @@
<issue
id="NewApi"
- message="Call requires API level 29 (current min is 28): `COLOR`"
+ message="Field requires API level 29 (current min is 28): `COLOR`"
errorLine1=" verifyPorterDuffMatchesCompat(BlendModeCompat.COLOR, null);"
errorLine2=" ~~~~~">
<location
@@ -1092,7 +762,7 @@
<issue
id="NewApi"
- message="Call requires API level 29 (current min is 28): `LUMINOSITY`"
+ message="Field requires API level 29 (current min is 28): `LUMINOSITY`"
errorLine1=" verifyPorterDuffMatchesCompat(BlendModeCompat.LUMINOSITY, null);"
errorLine2=" ~~~~~~~~~~">
<location
@@ -1378,7 +1048,7 @@
<issue
id="NewApi"
- message="Call requires API level 23 (current min is 21): `scenario`"
+ message="Field requires API level 23 (current min is 21): `scenario`"
errorLine1=" scenario.onActivity {"
errorLine2=" ~~~~~~~~">
<location
@@ -1389,7 +1059,7 @@
<issue
id="NewApi"
- message="Call requires API level 23 (current min is 21): `windowInsetsController`"
+ message="Field requires API level 23 (current min is 21): `windowInsetsController`"
errorLine1=" windowInsetsController.systemBarsBehavior ="
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~">
<location
@@ -1400,7 +1070,7 @@
<issue
id="NewApi"
- message="Call requires API level 23 (current min is 21): `scenario`"
+ message="Field requires API level 23 (current min is 21): `scenario`"
errorLine1=" val decorView = scenario.withActivity { window.decorView }"
errorLine2=" ~~~~~~~~">
<location
@@ -1411,7 +1081,7 @@
<issue
id="NewApi"
- message="Call requires API level 23 (current min is 21): `scenario`"
+ message="Field requires API level 23 (current min is 21): `scenario`"
errorLine1=" scenario.onActivity {"
errorLine2=" ~~~~~~~~">
<location
@@ -1422,7 +1092,7 @@
<issue
id="NewApi"
- message="Call requires API level 23 (current min is 21): `windowInsetsController`"
+ message="Field requires API level 23 (current min is 21): `windowInsetsController`"
errorLine1=" windowInsetsController.systemBarsBehavior ="
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~">
<location
@@ -1433,7 +1103,7 @@
<issue
id="NewApi"
- message="Call requires API level 23 (current min is 21): `scenario`"
+ message="Field requires API level 23 (current min is 21): `scenario`"
errorLine1=" val decorView = scenario.withActivity { window.decorView }"
errorLine2=" ~~~~~~~~">
<location
@@ -1460,7 +1130,7 @@
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~">
<location
file="src/main/java/androidx/core/app/NotificationCompat.java"
- line="4707"
+ line="4755"
column="47"/>
</issue>
@@ -1471,7 +1141,7 @@
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
<location
file="src/main/java/androidx/core/app/NotificationCompat.java"
- line="6327"
+ line="6375"
column="31"/>
</issue>
@@ -1482,7 +1152,7 @@
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
<location
file="src/main/java/androidx/core/app/NotificationCompat.java"
- line="7360"
+ line="7408"
column="35"/>
</issue>
@@ -1790,7 +1460,7 @@
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~">
<location
file="src/main/java/androidx/core/content/res/ResourcesCompat.java"
- line="687"
+ line="704"
column="29"/>
</issue>
@@ -6912,7 +6582,7 @@
errorLine2=" ~~~~~~~">
<location
file="src/main/java/androidx/core/app/NotificationCompat.java"
- line="882"
+ line="892"
column="16"/>
</issue>
@@ -6923,7 +6593,7 @@
errorLine2=" ~~~~~~~~~~~~~~~~~">
<location
file="src/main/java/androidx/core/app/NotificationCompat.java"
- line="886"
+ line="896"
column="16"/>
</issue>
@@ -6934,7 +6604,7 @@
errorLine2=" ~~~~~~~~~~~~~~~~~">
<location
file="src/main/java/androidx/core/app/NotificationCompat.java"
- line="948"
+ line="958"
column="16"/>
</issue>
@@ -6945,7 +6615,7 @@
errorLine2=" ~~~~~~~~~~~">
<location
file="src/main/java/androidx/core/app/NotificationCompat.java"
- line="2435"
+ line="2445"
column="16"/>
</issue>
@@ -6956,7 +6626,7 @@
errorLine2=" ~~~~~~~~~~~">
<location
file="src/main/java/androidx/core/app/NotificationCompat.java"
- line="2443"
+ line="2453"
column="16"/>
</issue>
@@ -6967,7 +6637,7 @@
errorLine2=" ~~~~~~~~~~~">
<location
file="src/main/java/androidx/core/app/NotificationCompat.java"
- line="2451"
+ line="2461"
column="16"/>
</issue>
@@ -6978,7 +6648,7 @@
errorLine2=" ~~~~~~~">
<location
file="src/main/java/androidx/core/app/NotificationCompat.java"
- line="2519"
+ line="2529"
column="19"/>
</issue>
@@ -6989,7 +6659,7 @@
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
<location
file="src/main/java/androidx/core/app/NotificationCompat.java"
- line="2565"
+ line="2575"
column="27"/>
</issue>
@@ -7000,7 +6670,7 @@
errorLine2=" ~~~~~~~~~~~">
<location
file="src/main/java/androidx/core/app/NotificationCompat.java"
- line="2581"
+ line="2591"
column="16"/>
</issue>
@@ -7011,7 +6681,7 @@
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
<location
file="src/main/java/androidx/core/app/NotificationCompat.java"
- line="2581"
+ line="2591"
column="44"/>
</issue>
@@ -7022,7 +6692,7 @@
errorLine2=" ~~~~~~~~~~~">
<location
file="src/main/java/androidx/core/app/NotificationCompat.java"
- line="2589"
+ line="2599"
column="16"/>
</issue>
@@ -7033,7 +6703,7 @@
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
<location
file="src/main/java/androidx/core/app/NotificationCompat.java"
- line="2589"
+ line="2599"
column="47"/>
</issue>
@@ -7044,7 +6714,7 @@
errorLine2=" ~~~~~~~~~~~">
<location
file="src/main/java/androidx/core/app/NotificationCompat.java"
- line="2597"
+ line="2607"
column="16"/>
</issue>
@@ -7055,7 +6725,7 @@
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
<location
file="src/main/java/androidx/core/app/NotificationCompat.java"
- line="2597"
+ line="2607"
column="51"/>
</issue>
@@ -7066,7 +6736,7 @@
errorLine2=" ~~~~~~">
<location
file="src/main/java/androidx/core/app/NotificationCompat.java"
- line="2908"
+ line="2918"
column="16"/>
</issue>
@@ -7077,7 +6747,7 @@
errorLine2=" ~~~~~~~~~~~">
<location
file="src/main/java/androidx/core/app/NotificationCompat.java"
- line="2958"
+ line="2968"
column="42"/>
</issue>
@@ -7088,7 +6758,7 @@
errorLine2=" ~~~~~~~~~~~">
<location
file="src/main/java/androidx/core/app/NotificationCompat.java"
- line="2959"
+ line="2969"
column="17"/>
</issue>
@@ -7099,7 +6769,7 @@
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
<location
file="src/main/java/androidx/core/app/NotificationCompat.java"
- line="3083"
+ line="3106"
column="27"/>
</issue>
@@ -7110,7 +6780,7 @@
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
<location
file="src/main/java/androidx/core/app/NotificationCompat.java"
- line="3278"
+ line="3326"
column="27"/>
</issue>
@@ -7121,7 +6791,7 @@
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
<location
file="src/main/java/androidx/core/app/NotificationCompat.java"
- line="3622"
+ line="3670"
column="27"/>
</issue>
@@ -7132,7 +6802,7 @@
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
<location
file="src/main/java/androidx/core/app/NotificationCompat.java"
- line="4182"
+ line="4230"
column="27"/>
</issue>
@@ -7143,7 +6813,7 @@
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
<location
file="src/main/java/androidx/core/app/NotificationCompat.java"
- line="4283"
+ line="4331"
column="27"/>
</issue>
@@ -7154,7 +6824,7 @@
errorLine2=" ~~~~~~~~~~~">
<location
file="src/main/java/androidx/core/app/NotificationCompat.java"
- line="4294"
+ line="4342"
column="16"/>
</issue>
@@ -7165,7 +6835,7 @@
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
<location
file="src/main/java/androidx/core/app/NotificationCompat.java"
- line="4294"
+ line="4342"
column="44"/>
</issue>
@@ -7176,7 +6846,7 @@
errorLine2=" ~~~~~~~~~~~">
<location
file="src/main/java/androidx/core/app/NotificationCompat.java"
- line="4311"
+ line="4359"
column="16"/>
</issue>
@@ -7187,7 +6857,7 @@
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
<location
file="src/main/java/androidx/core/app/NotificationCompat.java"
- line="4311"
+ line="4359"
column="47"/>
</issue>
@@ -7198,7 +6868,7 @@
errorLine2=" ~~~~~~~~~~~">
<location
file="src/main/java/androidx/core/app/NotificationCompat.java"
- line="4332"
+ line="4380"
column="16"/>
</issue>
@@ -7209,7 +6879,7 @@
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
<location
file="src/main/java/androidx/core/app/NotificationCompat.java"
- line="4332"
+ line="4380"
column="51"/>
</issue>
@@ -7220,7 +6890,7 @@
errorLine2=" ~~~~~~~~~~~~">
<location
file="src/main/java/androidx/core/app/NotificationCompat.java"
- line="4516"
+ line="4564"
column="16"/>
</issue>
@@ -7231,7 +6901,7 @@
errorLine2=" ~~~~~~~~~~~~~">
<location
file="src/main/java/androidx/core/app/NotificationCompat.java"
- line="4521"
+ line="4569"
column="16"/>
</issue>
@@ -8111,7 +7781,7 @@
errorLine2=" ~~~~~~~~">
<location
file="src/main/java/androidx/core/content/res/ResourcesCompat.java"
- line="433"
+ line="437"
column="54"/>
</issue>
@@ -8122,7 +7792,7 @@
errorLine2=" ~~~~~~~~">
<location
file="src/main/java/androidx/core/content/res/ResourcesCompat.java"
- line="502"
+ line="506"
column="19"/>
</issue>
@@ -8133,7 +7803,7 @@
errorLine2=" ~~~~~~~~~~">
<location
file="src/main/java/androidx/core/content/res/ResourcesCompat.java"
- line="502"
+ line="506"
column="79"/>
</issue>
diff --git a/core/core/src/androidTest/java/androidx/core/view/MenuHostHelperTest.kt b/core/core/src/androidTest/java/androidx/core/view/MenuHostHelperTest.kt
index 62c526b3..344edf4 100644
--- a/core/core/src/androidTest/java/androidx/core/view/MenuHostHelperTest.kt
+++ b/core/core/src/androidTest/java/androidx/core/view/MenuHostHelperTest.kt
@@ -78,6 +78,27 @@
}
@Test
+ fun addRemoveReAddMenuProviderWithLifecycle() {
+ with(ActivityScenario.launch(TestActivityWithLifecycle::class.java)) {
+ val toolbar = Toolbar(context)
+ val menuHost = TestMenuHost(toolbar.menu, withActivity { menuInflater })
+ val lifecycleOwner = TestLifecycleOwner(Lifecycle.State.STARTED)
+
+ menuHost.addMenuProvider(menuProvider, lifecycleOwner)
+ assertThat(toolbar.menu.findItem(R.id.item1)).isNotNull()
+ assertThat(toolbar.menu.findItem(R.id.item2)).isNotNull()
+
+ menuHost.removeMenuProvider(menuProvider)
+
+ menuHost.addMenuProvider(menuProvider, lifecycleOwner)
+
+ lifecycleOwner.currentState = Lifecycle.State.DESTROYED
+ assertThat(toolbar.menu.findItem(R.id.item1)).isNull()
+ assertThat(toolbar.menu.findItem(R.id.item2)).isNull()
+ }
+ }
+
+ @Test
fun addMenuProviderWithLifecycleAndState() {
with(ActivityScenario.launch(TestActivityWithLifecycle::class.java)) {
val toolbar = Toolbar(context)
@@ -99,6 +120,35 @@
}
@Test
+ fun addMenuProviderWithLifecycleAndStateSTOPPEDAndSTARTED() {
+ with(ActivityScenario.launch(TestActivityWithLifecycle::class.java)) {
+ val toolbar = Toolbar(context)
+ val menuHost = TestMenuHost(toolbar.menu, withActivity { menuInflater })
+ val lifecycleOwner = TestLifecycleOwner(Lifecycle.State.CREATED)
+
+ menuHost.addMenuProvider(menuProvider, lifecycleOwner, Lifecycle.State.STARTED)
+ assertThat(toolbar.menu.findItem(R.id.item1)).isNull()
+ assertThat(toolbar.menu.findItem(R.id.item2)).isNull()
+
+ lifecycleOwner.currentState = Lifecycle.State.STARTED
+ assertThat(toolbar.menu.findItem(R.id.item1)).isNotNull()
+ assertThat(toolbar.menu.findItem(R.id.item2)).isNotNull()
+
+ lifecycleOwner.currentState = Lifecycle.State.CREATED
+ assertThat(toolbar.menu.findItem(R.id.item1)).isNull()
+ assertThat(toolbar.menu.findItem(R.id.item2)).isNull()
+
+ lifecycleOwner.currentState = Lifecycle.State.STARTED
+ assertThat(toolbar.menu.findItem(R.id.item1)).isNotNull()
+ assertThat(toolbar.menu.findItem(R.id.item2)).isNotNull()
+
+ lifecycleOwner.currentState = Lifecycle.State.DESTROYED
+ assertThat(toolbar.menu.findItem(R.id.item1)).isNull()
+ assertThat(toolbar.menu.findItem(R.id.item2)).isNull()
+ }
+ }
+
+ @Test
fun removeMenuProvider() {
with(ActivityScenario.launch(TestActivityWithLifecycle::class.java)) {
val toolbar = Toolbar(context)
@@ -115,6 +165,27 @@
}
@Test
+ fun removeMenuProviderWithLifecycle() {
+ with(ActivityScenario.launch(TestActivityWithLifecycle::class.java)) {
+ val toolbar = Toolbar(context)
+ val menuHost = TestMenuHost(toolbar.menu, withActivity { menuInflater })
+ val lifecycleOwner = TestLifecycleOwner(Lifecycle.State.STARTED)
+
+ menuHost.addMenuProvider(menuProvider, lifecycleOwner)
+ assertThat(toolbar.menu.findItem(R.id.item1)).isNotNull()
+ assertThat(toolbar.menu.findItem(R.id.item2)).isNotNull()
+
+ menuHost.removeMenuProvider(menuProvider)
+ assertThat(menuHost.invalidateCount).isEqualTo(2)
+
+ lifecycleOwner.currentState = Lifecycle.State.DESTROYED
+ assertThat(toolbar.menu.findItem(R.id.item1)).isNull()
+ assertThat(toolbar.menu.findItem(R.id.item2)).isNull()
+ assertThat(menuHost.invalidateCount).isEqualTo(2)
+ }
+ }
+
+ @Test
fun multipleMenuProviders() {
with(ActivityScenario.launch(TestActivityWithLifecycle::class.java)) {
val toolbar = Toolbar(context)
diff --git a/core/core/src/androidTest/java/androidx/core/view/MenuHostTest.kt b/core/core/src/androidTest/java/androidx/core/view/MenuHostTest.kt
index b732c7b..5beb280 100644
--- a/core/core/src/androidTest/java/androidx/core/view/MenuHostTest.kt
+++ b/core/core/src/androidTest/java/androidx/core/view/MenuHostTest.kt
@@ -67,7 +67,11 @@
}
class TestMenuHost(private val menu: Menu, private val menuInflater: MenuInflater) : MenuHost {
- private val menuHostHelper = MenuHostHelper { invalidateMenu() }
+ var invalidateCount = 0
+ private val menuHostHelper = MenuHostHelper {
+ invalidateMenu()
+ invalidateCount++
+ }
private fun onCreateMenu() {
menuHostHelper.onCreateMenu(menu, menuInflater)
diff --git a/core/core/src/main/java/androidx/core/content/PackageManagerCompat.java b/core/core/src/main/java/androidx/core/content/PackageManagerCompat.java
index 8b901ee..4bdf096 100644
--- a/core/core/src/main/java/androidx/core/content/PackageManagerCompat.java
+++ b/core/core/src/main/java/androidx/core/content/PackageManagerCompat.java
@@ -70,7 +70,7 @@
"android.intent.action.AUTO_REVOKE_PERMISSIONS";
/**
- * The status of Unused App Restrictions features for this app.
+ * The status of Unused App Restrictions for this app.
* @hide
*/
@IntDef({ERROR, FEATURE_NOT_AVAILABLE, DISABLED, API_30_BACKPORT, API_30, API_31})
@@ -80,8 +80,8 @@
}
/**
- * Returns the status of Unused App Restriction features for the current application, i.e.
- * whether the features are available and if so, enabled for the application.
+ * Returns the status of Unused App Restrictions for the current application.
+ * In other words, whether the features are available and if so, enabled for the application.
*
* The returned value is a ListenableFuture with an Integer corresponding to a value in
* {@link UnusedAppRestrictionsConstants}.
@@ -89,21 +89,28 @@
* The possible values are as follows:
* <ul>
* <li>{@link UnusedAppRestrictionsConstants#ERROR}: an error occurred when fetching
- * the availability and status of Unused App Restrictions features. Check the logs for
+ * the availability and status of Unused App Restrictions. Check the logs for
* the reason (e.g. if the app's target SDK version < 30 or the user is in locked device
* boot mode).</li>
* <li>{@link UnusedAppRestrictionsConstants#FEATURE_NOT_AVAILABLE}: there are no
- * available Unused App Restrictions features for this app.</li>
+ * available Unused App Restrictions for this app.</li>
* <li>{@link UnusedAppRestrictionsConstants#DISABLED}: any available Unused App
- * Restrictions features on the device are disabled for this app.</li>
+ * Restrictions on the device are disabled for this app.</li>
* <li>{@link UnusedAppRestrictionsConstants#API_30_BACKPORT}: Unused App Restrictions
- * features introduced by Android API 30 and backported to earlier (API 23-29) devices
- * are enabled for this app (i.e. permissions will be automatically reset).</li>
- * <li>{@link UnusedAppRestrictionsConstants#API_30}: API 30 Unused App Restrictions
- * are enabled for this app (i.e. permissions will be automatically reset).</li>
- * <li>{@link UnusedAppRestrictionsConstants#API_31}: API 31 Unused App
- * Restrictions are enabled for this app (i.e. this app will be hibernated and have its
- * permissions reset).</li>
+ * introduced by Android API 30, and since made available on earlier (API 23-29) devices
+ * are enabled for this app:
+ * <a href="https://developer.android.com/training/permissions/requesting?hl=hu
+ * #auto-reset-permissions-unused-apps">permission auto-reset</a>.</li>
+ * <li>{@link UnusedAppRestrictionsConstants#API_30}: Unused App Restrictions introduced
+ * by Android API 30 are enabled for this app:
+ * <a href="https://developer.android.com/training/permissions/requesting?hl=hu
+ * #auto-reset-permissions-unused-apps">permission auto-reset</a>.</li>
+ * <li>{@link UnusedAppRestrictionsConstants#API_31}: Unused App Restrictions introduced
+ * by Android API 31 are enabled for this app:
+ * <a href="https://developer.android.com/training/permissions/requesting?hl=hu
+ * #auto-reset-permissions-unused-apps">permission auto-reset</a> and
+ * <a href="https://developer.android.com/about/versions/12/behavior-changes-12#app-hibernation"
+ * >app hibernation</a>.</li>
* </ul>
*
* Compatibility behavior:
@@ -116,8 +123,8 @@
* {@link UnusedAppRestrictionsConstants#API_30}.</li>
* <li>SDK 23 through 29, if there exists an app with the Verifier role that can resolve the
* {@code Intent.ACTION_AUTO_REVOKE_PERMISSIONS} action, then this API will return
- * {@link UnusedAppRestrictionsConstants#API_30_BACKPORT} if Unused App Restrictions features
- * are enabled and {@link UnusedAppRestrictionsConstants#DISABLED} if disabled. Else, it will
+ * {@link UnusedAppRestrictionsConstants#API_30_BACKPORT} if Unused App Restrictions are
+ * enabled and {@link UnusedAppRestrictionsConstants#DISABLED} if disabled. Else, it will
* return {@link UnusedAppRestrictionsConstants#FEATURE_NOT_AVAILABLE}.
* <li>SDK 22 and below, this method always returns
* {@link UnusedAppRestrictionsConstants#FEATURE_NOT_AVAILABLE} as runtime permissions did
@@ -185,7 +192,7 @@
}
/**
- * Returns whether any unused app restriction features are available on the device.
+ * Returns whether any Unused App Restrictions are available on the device.
*
* @hide
*/
@@ -252,8 +259,8 @@
private static class Api30Impl {
private Api30Impl() {}
static boolean areUnusedAppRestrictionsEnabled(@NonNull Context context) {
- // If the app is allowlisted, that means that it is exempt from unused app restriction
- // features, and thus the features are _disabled_.
+ // If the app is allowlisted, that means that it is exempt from Unused App Restrictions,
+ // and thus the features are _disabled_.
return !context.getPackageManager().isAutoRevokeWhitelisted();
}
}
diff --git a/core/core/src/main/java/androidx/core/content/UnusedAppRestrictionsConstants.java b/core/core/src/main/java/androidx/core/content/UnusedAppRestrictionsConstants.java
index c38607a..f7eee70 100644
--- a/core/core/src/main/java/androidx/core/content/UnusedAppRestrictionsConstants.java
+++ b/core/core/src/main/java/androidx/core/content/UnusedAppRestrictionsConstants.java
@@ -25,34 +25,52 @@
/* Hide constructor */
}
- /** The status of Unused App Restrictions features could not be retrieved from this app. */
+ /**
+ * The status of Unused App Restrictions could not be retrieved from this app.
+ *
+ * Note: check the logs for the reason (e.g. if the app's target SDK version < 30 or the user
+ * is in locked device boot mode).
+ */
public static final int ERROR = 0;
- /** There are no available Unused App Restrictions features for this app. */
+ /** There are no available Unused App Restrictions for this app. */
public static final int FEATURE_NOT_AVAILABLE = 1;
/**
- * Any available Unused App Restrictions features on the device are disabled for this app (i.e.
- * this app is exempt from having its permissions automatically removed or being hibernated).
+ * Any available Unused App Restrictions on the device are disabled for this app.
+ *
+ * In other words, this app is exempt from having its permissions automatically removed
+ * or being hibernated.
*/
public static final int DISABLED = 2;
/**
- * Unused App Restrictions introduced by Android API 30 and made available on earlier (API
- * 23-29) devices are enabled for this app (i.e. permissions will be automatically reset if
- * the app is unused).
+ * Unused App Restrictions introduced by Android API 30, and since made available on earlier
+ * (API 23-29) devices are enabled for this app:
+ * <a href="https://developer.android.com/training/permissions/requesting?hl=hu
+ * #auto-reset-permissions-unused-apps">permission auto-reset</a>.
+ *
+ * Note: This value is only used on API 29 or earlier devices.
*/
public static final int API_30_BACKPORT = 3;
/**
- * Unused App Restrictions introduced by Android API 30 are enabled for this app (i.e.
- * permissions will be automatically reset if the app is unused).
+ * Unused App Restrictions introduced by Android API 30 are enabled for this app:
+ * <a href="https://developer.android.com/training/permissions/requesting?hl=hu
+ * #auto-reset-permissions-unused-apps">permission auto-reset</a>.
+ *
+ * Note: This value is only used on API 30 or later devices.
*/
public static final int API_30 = 4;
/**
- * API 31 Unused App Restrictions are enabled for this app (i.e. this app will
- * be hibernated and have its permissions reset if the app is unused).
+ * Unused App Restrictions introduced by Android API 31 are enabled for this app:
+ * <a href="https://developer.android.com/training/permissions/requesting?hl=hu
+ * #auto-reset-permissions-unused-apps">permission auto-reset</a> and
+ * <a href="https://developer.android.com/about/versions/12/behavior-changes-12#app-hibernation"
+ * >app hibernation</a>.
+ *
+ * Note: This value is only used on API 31 or later devices.
*/
public static final int API_31 = 5;
}
diff --git a/core/core/src/main/java/androidx/core/view/MenuHostHelper.java b/core/core/src/main/java/androidx/core/view/MenuHostHelper.java
index c9ed575..ba76e000 100644
--- a/core/core/src/main/java/androidx/core/view/MenuHostHelper.java
+++ b/core/core/src/main/java/androidx/core/view/MenuHostHelper.java
@@ -26,6 +26,8 @@
import androidx.lifecycle.LifecycleEventObserver;
import androidx.lifecycle.LifecycleOwner;
+import java.util.HashMap;
+import java.util.Map;
import java.util.concurrent.CopyOnWriteArrayList;
/**
@@ -35,6 +37,8 @@
private final Runnable mOnInvalidateMenuCallback;
private final CopyOnWriteArrayList<MenuProvider> mMenuProviders = new CopyOnWriteArrayList<>();
+ private final Map<MenuProvider, LifecycleContainer> mProviderToLifecycleContainers =
+ new HashMap<>();
/**
* Construct a new MenuHostHelper.
@@ -98,11 +102,16 @@
public void addMenuProvider(@NonNull MenuProvider provider, @NonNull LifecycleOwner owner) {
addMenuProvider(provider);
Lifecycle lifecycle = owner.getLifecycle();
- lifecycle.addObserver((LifecycleEventObserver) (source, event) -> {
+ LifecycleContainer lifecycleContainer = mProviderToLifecycleContainers.remove(provider);
+ if (lifecycleContainer != null) {
+ lifecycleContainer.clearObservers();
+ }
+ LifecycleEventObserver observer = (source, event) -> {
if (event == Lifecycle.Event.ON_DESTROY) {
removeMenuProvider(provider);
}
- });
+ };
+ mProviderToLifecycleContainers.put(provider, new LifecycleContainer(lifecycle, observer));
}
/**
@@ -121,15 +130,21 @@
public void addMenuProvider(@NonNull MenuProvider provider, @NonNull LifecycleOwner owner,
@NonNull Lifecycle.State state) {
Lifecycle lifecycle = owner.getLifecycle();
- lifecycle.addObserver((LifecycleEventObserver) (source, event) -> {
+ LifecycleContainer lifecycleContainer = mProviderToLifecycleContainers.remove(provider);
+ if (lifecycleContainer != null) {
+ lifecycleContainer.clearObservers();
+ }
+ LifecycleEventObserver observer = (source, event) -> {
if (event == Lifecycle.Event.upTo(state)) {
addMenuProvider(provider);
} else if (event == Lifecycle.Event.ON_DESTROY) {
removeMenuProvider(provider);
} else if (event == Lifecycle.Event.downFrom(state)) {
- removeMenuProvider(provider);
+ mMenuProviders.remove(provider);
+ mOnInvalidateMenuCallback.run();
}
- });
+ };
+ mProviderToLifecycleContainers.put(provider, new LifecycleContainer(lifecycle, observer));
}
/**
@@ -139,6 +154,26 @@
*/
public void removeMenuProvider(@NonNull MenuProvider provider) {
mMenuProviders.remove(provider);
+ LifecycleContainer lifecycleContainer = mProviderToLifecycleContainers.remove(provider);
+ if (lifecycleContainer != null) {
+ lifecycleContainer.clearObservers();
+ }
mOnInvalidateMenuCallback.run();
}
+
+ private static class LifecycleContainer {
+ final Lifecycle mLifecycle;
+ private LifecycleEventObserver mObserver;
+
+ LifecycleContainer(@NonNull Lifecycle lifecycle, @NonNull LifecycleEventObserver observer) {
+ mLifecycle = lifecycle;
+ mObserver = observer;
+ mLifecycle.addObserver(observer);
+ }
+
+ void clearObservers() {
+ mLifecycle.removeObserver(mObserver);
+ mObserver = null;
+ }
+ }
}
diff --git a/datastore/datastore-core/api/current.txt b/datastore/datastore-core/api/current.txt
index abfdd9c..d63f849d 100644
--- a/datastore/datastore-core/api/current.txt
+++ b/datastore/datastore-core/api/current.txt
@@ -1,7 +1,7 @@
// Signature format: 4.0
package androidx.datastore.core {
- public final class CorruptionException extends java.io.IOException {
+ public final class CorruptionException extends androidx.datastore.core.StorageException {
ctor public CorruptionException(String message, optional Throwable? cause);
}
@@ -32,6 +32,10 @@
property public abstract T! defaultValue;
}
+ public class StorageException extends java.io.IOException {
+ ctor public StorageException(String message, optional Throwable? cause);
+ }
+
}
package androidx.datastore.core.handlers {
diff --git a/datastore/datastore-core/api/public_plus_experimental_current.txt b/datastore/datastore-core/api/public_plus_experimental_current.txt
index abfdd9c..d63f849d 100644
--- a/datastore/datastore-core/api/public_plus_experimental_current.txt
+++ b/datastore/datastore-core/api/public_plus_experimental_current.txt
@@ -1,7 +1,7 @@
// Signature format: 4.0
package androidx.datastore.core {
- public final class CorruptionException extends java.io.IOException {
+ public final class CorruptionException extends androidx.datastore.core.StorageException {
ctor public CorruptionException(String message, optional Throwable? cause);
}
@@ -32,6 +32,10 @@
property public abstract T! defaultValue;
}
+ public class StorageException extends java.io.IOException {
+ ctor public StorageException(String message, optional Throwable? cause);
+ }
+
}
package androidx.datastore.core.handlers {
diff --git a/datastore/datastore-core/api/restricted_current.txt b/datastore/datastore-core/api/restricted_current.txt
index abfdd9c..d63f849d 100644
--- a/datastore/datastore-core/api/restricted_current.txt
+++ b/datastore/datastore-core/api/restricted_current.txt
@@ -1,7 +1,7 @@
// Signature format: 4.0
package androidx.datastore.core {
- public final class CorruptionException extends java.io.IOException {
+ public final class CorruptionException extends androidx.datastore.core.StorageException {
ctor public CorruptionException(String message, optional Throwable? cause);
}
@@ -32,6 +32,10 @@
property public abstract T! defaultValue;
}
+ public class StorageException extends java.io.IOException {
+ ctor public StorageException(String message, optional Throwable? cause);
+ }
+
}
package androidx.datastore.core.handlers {
diff --git a/datastore/datastore-core/src/main/java/androidx/datastore/core/Serializer.kt b/datastore/datastore-core/src/main/java/androidx/datastore/core/Serializer.kt
index 74ae35c..c2ca9b0 100644
--- a/datastore/datastore-core/src/main/java/androidx/datastore/core/Serializer.kt
+++ b/datastore/datastore-core/src/main/java/androidx/datastore/core/Serializer.kt
@@ -16,7 +16,6 @@
package androidx.datastore.core
-import java.io.IOException
import java.io.InputStream
import java.io.OutputStream
@@ -51,9 +50,9 @@
}
/**
- * A subclass of IOException that indicates that the file could not be de-serialized due
- * to data format corruption. This exception should not be thrown when the IOException is
- * due to a transient IO issue or permissions issue.
+ * A subclass of StorageException that indicates that the file could not be de-serialized due to
+ * data format corruption. This exception should not be thrown when the StorageException is due
+ * to a transient IO issue or permissions issue.
*/
public class CorruptionException(message: String, cause: Throwable? = null) :
- IOException(message, cause)
\ No newline at end of file
+ StorageException(message, cause)
\ No newline at end of file
diff --git a/wear/wear-complications-data-source-samples/src/main/java/androidx/wear/complications/datasource/samples/PlainComplicationText.kt b/datastore/datastore-core/src/main/java/androidx/datastore/core/StorageException.kt
similarity index 63%
copy from wear/wear-complications-data-source-samples/src/main/java/androidx/wear/complications/datasource/samples/PlainComplicationText.kt
copy to datastore/datastore-core/src/main/java/androidx/datastore/core/StorageException.kt
index cb807c3..c43f04a 100644
--- a/wear/wear-complications-data-source-samples/src/main/java/androidx/wear/complications/datasource/samples/PlainComplicationText.kt
+++ b/datastore/datastore-core/src/main/java/androidx/datastore/core/StorageException.kt
@@ -14,9 +14,15 @@
* limitations under the License.
*/
-package androidx.wear.complications.datasource.samples
+package androidx.datastore.core
-import androidx.wear.complications.data.PlainComplicationText
+import java.io.IOException
-internal fun plainText(text: CharSequence) =
- PlainComplicationText.Builder(text).build()
\ No newline at end of file
+/**
+ * Exception for storage-related errors. Defined as a subclass of {@link IOException} on Android and
+ * JRE.
+ *
+ * @param message the detail message.
+ * @param cause the cause.
+ */
+open class StorageException(message: String, cause: Throwable? = null) : IOException(message, cause)
diff --git a/development/importMaven/build.gradle.kts b/development/importMaven/build.gradle.kts
index 8dd0eaa..0495437 100644
--- a/development/importMaven/build.gradle.kts
+++ b/development/importMaven/build.gradle.kts
@@ -116,6 +116,12 @@
artifact()
}
}
+ maven {
+ url = uri("https://maven.pkg.jetbrains.space/public/p/compose/dev")
+ metadataSources {
+ artifact()
+ }
+ }
}
ivy {
diff --git a/docs-public/build.gradle b/docs-public/build.gradle
index 477ceb2..ef400dd 100644
--- a/docs-public/build.gradle
+++ b/docs-public/build.gradle
@@ -4,10 +4,10 @@
}
dependencies {
- docs("androidx.activity:activity:1.4.0-alpha01")
- docs("androidx.activity:activity-compose:1.4.0-alpha01")
- samples("androidx.activity:activity-compose-samples:1.4.0-alpha01")
- docs("androidx.activity:activity-ktx:1.4.0-alpha01")
+ docs("androidx.activity:activity:1.4.0-alpha02")
+ docs("androidx.activity:activity-compose:1.4.0-alpha02")
+ samples("androidx.activity:activity-compose-samples:1.4.0-alpha02")
+ docs("androidx.activity:activity-ktx:1.4.0-alpha02")
docs("androidx.ads:ads-identifier:1.0.0-alpha04")
docs("androidx.ads:ads-identifier-provider:1.0.0-alpha04")
docs("androidx.annotation:annotation:1.3.0-alpha01")
@@ -30,7 +30,7 @@
docs("androidx.biometric:biometric:1.2.0-alpha03")
docs("androidx.biometric:biometric-ktx:1.2.0-alpha03")
samples("androidx.biometric:biometric-ktx-samples:1.2.0-alpha03")
- docs("androidx.browser:browser:1.3.0")
+ docs("androidx.browser:browser:1.4.0-alpha01")
docs("androidx.camera:camera-camera2:1.1.0-alpha08")
docs("androidx.camera:camera-core:1.1.0-alpha08")
docs("androidx.camera:camera-extensions:1.0.0-alpha28")
@@ -44,48 +44,48 @@
docs("androidx.cardview:cardview:1.0.0")
docs("androidx.collection:collection:1.2.0-alpha01")
docs("androidx.collection:collection-ktx:1.2.0-alpha01")
- docs("androidx.compose.animation:animation:1.1.0-alpha03")
- docs("androidx.compose.animation:animation-core:1.1.0-alpha03")
- docs("androidx.compose.animation:animation-graphics:1.1.0-alpha03")
- samples("androidx.compose.animation:animation-samples:1.1.0-alpha03")
- samples("androidx.compose.animation:animation-core-samples:1.1.0-alpha03")
- samples("androidx.compose.animation:animation-graphics-samples:1.1.0-alpha03")
- docs("androidx.compose.foundation:foundation:1.1.0-alpha03")
- docs("androidx.compose.foundation:foundation-layout:1.1.0-alpha03")
- samples("androidx.compose.foundation:foundation-layout-samples:1.1.0-alpha03")
- samples("androidx.compose.foundation:foundation-samples:1.1.0-alpha03")
- docs("androidx.compose.material:material:1.1.0-alpha03")
- docs("androidx.compose.material:material-icons-core:1.1.0-alpha03")
- samples("androidx.compose.material:material-icons-core-samples:1.1.0-alpha03")
- docs("androidx.compose.material:material-ripple:1.1.0-alpha03")
- samples("androidx.compose.material:material-samples:1.1.0-alpha03")
- docs("androidx.compose.runtime:runtime:1.1.0-alpha03")
- docs("androidx.compose.runtime:runtime-livedata:1.1.0-alpha03")
- samples("androidx.compose.runtime:runtime-livedata-samples:1.1.0-alpha03")
- docs("androidx.compose.runtime:runtime-rxjava2:1.1.0-alpha03")
- samples("androidx.compose.runtime:runtime-rxjava2-samples:1.1.0-alpha03")
- docs("androidx.compose.runtime:runtime-rxjava3:1.1.0-alpha03")
- samples("androidx.compose.runtime:runtime-rxjava3-samples:1.1.0-alpha03")
- docs("androidx.compose.runtime:runtime-saveable:1.1.0-alpha03")
- samples("androidx.compose.runtime:runtime-saveable-samples:1.1.0-alpha03")
- samples("androidx.compose.runtime:runtime-samples:1.1.0-alpha03")
- docs("androidx.compose.ui:ui:1.1.0-alpha03")
- docs("androidx.compose.ui:ui-geometry:1.1.0-alpha03")
- docs("androidx.compose.ui:ui-graphics:1.1.0-alpha03")
- samples("androidx.compose.ui:ui-graphics-samples:1.1.0-alpha03")
- docs("androidx.compose.ui:ui-test:1.1.0-alpha03")
- docs("androidx.compose.ui:ui-test-junit4:1.1.0-alpha03")
- docs("androidx.compose.ui:ui-text:1.1.0-alpha03")
- samples("androidx.compose.ui:ui-text-samples:1.1.0-alpha03")
- docs("androidx.compose.ui:ui-tooling:1.1.0-alpha03")
- docs("androidx.compose.ui:ui-tooling-data:1.1.0-alpha03")
- docs("androidx.compose.ui:ui-tooling-preview:1.1.0-alpha03")
- docs("androidx.compose.ui:ui-unit:1.1.0-alpha03")
- samples("androidx.compose.ui:ui-unit-samples:1.1.0-alpha03")
- docs("androidx.compose.ui:ui-util:1.1.0-alpha03")
- docs("androidx.compose.ui:ui-viewbinding:1.1.0-alpha03")
- samples("androidx.compose.ui:ui-viewbinding-samples:1.1.0-alpha03")
- samples("androidx.compose.ui:ui-samples:1.1.0-alpha03")
+ docs("androidx.compose.animation:animation:1.1.0-alpha04")
+ docs("androidx.compose.animation:animation-core:1.1.0-alpha04")
+ docs("androidx.compose.animation:animation-graphics:1.1.0-alpha04")
+ samples("androidx.compose.animation:animation-samples:1.1.0-alpha04")
+ samples("androidx.compose.animation:animation-core-samples:1.1.0-alpha04")
+ samples("androidx.compose.animation:animation-graphics-samples:1.1.0-alpha04")
+ docs("androidx.compose.foundation:foundation:1.1.0-alpha04")
+ docs("androidx.compose.foundation:foundation-layout:1.1.0-alpha04")
+ samples("androidx.compose.foundation:foundation-layout-samples:1.1.0-alpha04")
+ samples("androidx.compose.foundation:foundation-samples:1.1.0-alpha04")
+ docs("androidx.compose.material:material:1.1.0-alpha04")
+ docs("androidx.compose.material:material-icons-core:1.1.0-alpha04")
+ samples("androidx.compose.material:material-icons-core-samples:1.1.0-alpha04")
+ docs("androidx.compose.material:material-ripple:1.1.0-alpha04")
+ samples("androidx.compose.material:material-samples:1.1.0-alpha04")
+ docs("androidx.compose.runtime:runtime:1.1.0-alpha04")
+ docs("androidx.compose.runtime:runtime-livedata:1.1.0-alpha04")
+ samples("androidx.compose.runtime:runtime-livedata-samples:1.1.0-alpha04")
+ docs("androidx.compose.runtime:runtime-rxjava2:1.1.0-alpha04")
+ samples("androidx.compose.runtime:runtime-rxjava2-samples:1.1.0-alpha04")
+ docs("androidx.compose.runtime:runtime-rxjava3:1.1.0-alpha04")
+ samples("androidx.compose.runtime:runtime-rxjava3-samples:1.1.0-alpha04")
+ docs("androidx.compose.runtime:runtime-saveable:1.1.0-alpha04")
+ samples("androidx.compose.runtime:runtime-saveable-samples:1.1.0-alpha04")
+ samples("androidx.compose.runtime:runtime-samples:1.1.0-alpha04")
+ docs("androidx.compose.ui:ui:1.1.0-alpha04")
+ docs("androidx.compose.ui:ui-geometry:1.1.0-alpha04")
+ docs("androidx.compose.ui:ui-graphics:1.1.0-alpha04")
+ samples("androidx.compose.ui:ui-graphics-samples:1.1.0-alpha04")
+ docs("androidx.compose.ui:ui-test:1.1.0-alpha04")
+ docs("androidx.compose.ui:ui-test-junit4:1.1.0-alpha04")
+ docs("androidx.compose.ui:ui-text:1.1.0-alpha04")
+ samples("androidx.compose.ui:ui-text-samples:1.1.0-alpha04")
+ docs("androidx.compose.ui:ui-tooling:1.1.0-alpha04")
+ docs("androidx.compose.ui:ui-tooling-data:1.1.0-alpha04")
+ docs("androidx.compose.ui:ui-tooling-preview:1.1.0-alpha04")
+ docs("androidx.compose.ui:ui-unit:1.1.0-alpha04")
+ samples("androidx.compose.ui:ui-unit-samples:1.1.0-alpha04")
+ docs("androidx.compose.ui:ui-util:1.1.0-alpha04")
+ docs("androidx.compose.ui:ui-viewbinding:1.1.0-alpha04")
+ samples("androidx.compose.ui:ui-viewbinding-samples:1.1.0-alpha04")
+ samples("androidx.compose.ui:ui-samples:1.1.0-alpha04")
docs("androidx.concurrent:concurrent-futures:1.1.0")
docs("androidx.concurrent:concurrent-futures-ktx:1.1.0")
docs("androidx.contentpager:contentpager:1.0.0")
@@ -94,8 +94,8 @@
docs("androidx.core:core-role:1.1.0-alpha02")
docs("androidx.core:core-animation:1.0.0-alpha02")
docs("androidx.core:core-animation-testing:1.0.0-alpha02")
- docs("androidx.core:core:1.7.0-alpha02")
- docs("androidx.core:core-ktx:1.7.0-alpha02")
+ docs("androidx.core:core:1.7.0-beta01")
+ docs("androidx.core:core-ktx:1.7.0-beta01")
docs("androidx.core:core-splashscreen:1.0.0-alpha01")
docs("androidx.cursoradapter:cursoradapter:1.0.0")
docs("androidx.customview:customview:1.1.0")
@@ -111,19 +111,19 @@
docs("androidx.drawerlayout:drawerlayout:1.1.1")
docs("androidx.dynamicanimation:dynamicanimation:1.1.0-alpha02")
docs("androidx.dynamicanimation:dynamicanimation-ktx:1.0.0-alpha03")
- docs("androidx.emoji2:emoji2:1.0.0-alpha03")
- docs("androidx.emoji2:emoji2-bundled:1.0.0-alpha03")
- docs("androidx.emoji2:emoji2-views:1.0.0-alpha03")
- docs("androidx.emoji2:emoji2-views-helper:1.0.0-alpha03")
+ docs("androidx.emoji2:emoji2:1.0.0-beta01")
+ docs("androidx.emoji2:emoji2-bundled:1.0.0-beta01")
+ docs("androidx.emoji2:emoji2-views:1.0.0-beta01")
+ docs("androidx.emoji2:emoji2-views-helper:1.0.0-beta01")
docs("androidx.emoji:emoji:1.2.0-alpha03")
docs("androidx.emoji:emoji-appcompat:1.2.0-alpha03")
docs("androidx.emoji:emoji-bundled:1.2.0-alpha03")
docs("androidx.enterprise:enterprise-feedback:1.1.0")
docs("androidx.enterprise:enterprise-feedback-testing:1.1.0")
docs("androidx.exifinterface:exifinterface:1.3.3")
- docs("androidx.fragment:fragment:1.4.0-alpha08")
- docs("androidx.fragment:fragment-ktx:1.4.0-alpha08")
- docs("androidx.fragment:fragment-testing:1.4.0-alpha08")
+ docs("androidx.fragment:fragment:1.4.0-alpha09")
+ docs("androidx.fragment:fragment-ktx:1.4.0-alpha09")
+ docs("androidx.fragment:fragment-testing:1.4.0-alpha09")
docs("androidx.gridlayout:gridlayout:1.0.0")
docs("androidx.health:health-services-client:1.0.0-alpha01")
docs("androidx.heifwriter:heifwriter:1.1.0-alpha01")
@@ -138,46 +138,46 @@
docs("androidx.leanback:leanback-paging:1.1.0-alpha08")
docs("androidx.leanback:leanback-preference:1.2.0-alpha01")
docs("androidx.leanback:leanback-tab:1.1.0-beta01")
- docs("androidx.lifecycle:lifecycle-common:2.4.0-alpha03")
- docs("androidx.lifecycle:lifecycle-common-java8:2.4.0-alpha03")
+ docs("androidx.lifecycle:lifecycle-common:2.4.0-beta01")
+ docs("androidx.lifecycle:lifecycle-common-java8:2.4.0-beta01")
docs("androidx.lifecycle:lifecycle-extensions:2.2.0")
- docs("androidx.lifecycle:lifecycle-livedata:2.4.0-alpha03")
- docs("androidx.lifecycle:lifecycle-livedata-core:2.4.0-alpha03")
- docs("androidx.lifecycle:lifecycle-livedata-core-ktx:2.4.0-alpha03")
- docs("androidx.lifecycle:lifecycle-livedata-ktx:2.4.0-alpha03")
- docs("androidx.lifecycle:lifecycle-process:2.4.0-alpha03")
- docs("androidx.lifecycle:lifecycle-reactivestreams:2.4.0-alpha03")
- docs("androidx.lifecycle:lifecycle-reactivestreams-ktx:2.4.0-alpha03")
- docs("androidx.lifecycle:lifecycle-runtime:2.4.0-alpha03")
- docs("androidx.lifecycle:lifecycle-runtime-ktx:2.4.0-alpha03")
- docs("androidx.lifecycle:lifecycle-runtime-testing:2.4.0-alpha03")
- docs("androidx.lifecycle:lifecycle-service:2.4.0-alpha03")
- docs("androidx.lifecycle:lifecycle-viewmodel:2.4.0-alpha03")
- docs("androidx.lifecycle:lifecycle-viewmodel-compose:1.0.0-alpha07")
- samples("androidx.lifecycle:lifecycle-viewmodel-compose-samples:2.4.0-alpha02")
- docs("androidx.lifecycle:lifecycle-viewmodel-ktx:2.4.0-alpha03")
- docs("androidx.lifecycle:lifecycle-viewmodel-savedstate:2.4.0-alpha03")
+ docs("androidx.lifecycle:lifecycle-livedata:2.4.0-beta01")
+ docs("androidx.lifecycle:lifecycle-livedata-core:2.4.0-beta01")
+ docs("androidx.lifecycle:lifecycle-livedata-core-ktx:2.4.0-beta01")
+ docs("androidx.lifecycle:lifecycle-livedata-ktx:2.4.0-beta01")
+ docs("androidx.lifecycle:lifecycle-process:2.4.0-beta01")
+ docs("androidx.lifecycle:lifecycle-reactivestreams:2.4.0-beta01")
+ docs("androidx.lifecycle:lifecycle-reactivestreams-ktx:2.4.0-beta01")
+ docs("androidx.lifecycle:lifecycle-runtime:2.4.0-beta01")
+ docs("androidx.lifecycle:lifecycle-runtime-ktx:2.4.0-beta01")
+ docs("androidx.lifecycle:lifecycle-runtime-testing:2.4.0-beta01")
+ docs("androidx.lifecycle:lifecycle-service:2.4.0-beta01")
+ docs("androidx.lifecycle:lifecycle-viewmodel:2.4.0-beta01")
+ docs("androidx.lifecycle:lifecycle-viewmodel-compose:2.4.0-beta01")
+ samples("androidx.lifecycle:lifecycle-viewmodel-compose-samples:2.4.0-beta01")
+ docs("androidx.lifecycle:lifecycle-viewmodel-ktx:2.4.0-beta01")
+ docs("androidx.lifecycle:lifecycle-viewmodel-savedstate:2.4.0-beta01")
docs("androidx.loader:loader:1.1.0")
docs("androidx.localbroadcastmanager:localbroadcastmanager:1.1.0-alpha01")
- docs("androidx.media2:media2-common:1.2.0-rc01")
- docs("androidx.media2:media2-player:1.2.0-rc01")
- docs("androidx.media2:media2-session:1.2.0-rc01")
- docs("androidx.media2:media2-widget:1.2.0-rc01")
- docs("androidx.media:media:1.4.1")
+ docs("androidx.media2:media2-common:1.2.0")
+ docs("androidx.media2:media2-player:1.2.0")
+ docs("androidx.media2:media2-session:1.2.0")
+ docs("androidx.media2:media2-widget:1.2.0")
+ docs("androidx.media:media:1.4.2")
docs("androidx.mediarouter:mediarouter:1.2.5")
- docs("androidx.navigation:navigation-common:2.4.0-alpha08")
- docs("androidx.navigation:navigation-common-ktx:2.4.0-alpha08")
- docs("androidx.navigation:navigation-compose:2.4.0-alpha08")
- samples("androidx.navigation:navigation-compose-samples:2.4.0-alpha08")
- docs("androidx.navigation:navigation-dynamic-features-fragment:2.4.0-alpha08")
- docs("androidx.navigation:navigation-dynamic-features-runtime:2.4.0-alpha08")
- docs("androidx.navigation:navigation-fragment:2.4.0-alpha08")
- docs("androidx.navigation:navigation-fragment-ktx:2.4.0-alpha08")
- docs("androidx.navigation:navigation-runtime:2.4.0-alpha08")
- docs("androidx.navigation:navigation-runtime-ktx:2.4.0-alpha08")
- docs("androidx.navigation:navigation-testing:2.4.0-alpha08")
- docs("androidx.navigation:navigation-ui:2.4.0-alpha08")
- docs("androidx.navigation:navigation-ui-ktx:2.4.0-alpha08")
+ docs("androidx.navigation:navigation-common:2.4.0-alpha09")
+ docs("androidx.navigation:navigation-common-ktx:2.4.0-alpha09")
+ docs("androidx.navigation:navigation-compose:2.4.0-alpha09")
+ samples("androidx.navigation:navigation-compose-samples:2.4.0-alpha09")
+ docs("androidx.navigation:navigation-dynamic-features-fragment:2.4.0-alpha09")
+ docs("androidx.navigation:navigation-dynamic-features-runtime:2.4.0-alpha09")
+ docs("androidx.navigation:navigation-fragment:2.4.0-alpha09")
+ docs("androidx.navigation:navigation-fragment-ktx:2.4.0-alpha09")
+ docs("androidx.navigation:navigation-runtime:2.4.0-alpha09")
+ docs("androidx.navigation:navigation-runtime-ktx:2.4.0-alpha09")
+ docs("androidx.navigation:navigation-testing:2.4.0-alpha09")
+ docs("androidx.navigation:navigation-ui:2.4.0-alpha09")
+ docs("androidx.navigation:navigation-ui-ktx:2.4.0-alpha09")
docs("androidx.paging:paging-common:3.1.0-alpha03")
docs("androidx.paging:paging-common-ktx:3.1.0-alpha03")
docs("androidx.paging:paging-compose:1.0.0-alpha12")
@@ -195,12 +195,12 @@
docs("androidx.preference:preference:1.1.1")
docs("androidx.preference:preference-ktx:1.1.1")
docs("androidx.print:print:1.1.0-beta01")
- docs("androidx.profileinstaller:profileinstaller:1.1.0-alpha04")
+ docs("androidx.profileinstaller:profileinstaller:1.1.0-alpha05")
docs("androidx.recommendation:recommendation:1.0.0")
- docs("androidx.recyclerview:recyclerview:1.2.1")
+ docs("androidx.recyclerview:recyclerview:1.3.0-alpha01")
docs("androidx.recyclerview:recyclerview-selection:2.0.0-alpha01")
docs("androidx.remotecallback:remotecallback:1.0.0-alpha02")
- docs("androidx.resourceinspection:resourceinspection-annotation:1.0.0-alpha03")
+ docs("androidx.resourceinspection:resourceinspection-annotation:1.0.0-beta01")
docs("androidx.room:room-common:2.4.0-alpha04")
docs("androidx.room:room-guava:2.4.0-alpha04")
docs("androidx.room:room-ktx:2.4.0-alpha04")
@@ -239,34 +239,35 @@
docs("androidx.vectordrawable:vectordrawable-seekable:1.0.0-alpha02")
docs("androidx.versionedparcelable:versionedparcelable:1.1.1")
docs("androidx.viewpager2:viewpager2:1.1.0-beta01")
- docs("androidx.viewpager:viewpager:1.0.0")
- docs("androidx.wear.compose:compose-foundation:1.0.0-alpha05")
- samples("androidx.wear.compose:compose-foundation-samples:1.0.0-alpha05")
- docs("androidx.wear.compose:compose-material:1.0.0-alpha05")
- samples("androidx.wear.compose:compose-material-samples:1.0.0-alpha05")
+ docs("androidx.viewpager:viewpager:1.1.0-alpha01")
+ docs("androidx.wear.compose:compose-foundation:1.0.0-alpha06")
+ samples("androidx.wear.compose:compose-foundation-samples:1.0.0-alpha06")
+ docs("androidx.wear.compose:compose-material:1.0.0-alpha06")
+ samples("androidx.wear.compose:compose-material-samples:1.0.0-alpha06")
docs("androidx.wear.tiles:tiles:1.0.0-alpha11")
docs("androidx.wear.tiles:tiles-renderer:1.0.0-alpha11")
docs("androidx.wear.tiles:tiles-testing:1.0.0-alpha11")
docs("androidx.wear:wear:1.2.0")
stubs(fileTree(dir: "../wear/wear_stubs/", include: ["com.google.android.wearable-stubs.jar"]))
- docs("androidx.wear:wear-complications-data:1.0.0-alpha21")
- docs("androidx.wear:wear-complications-data-source:1.0.0-alpha21")
- docs("androidx.wear:wear-complications-data-source-ktx:1.0.0-alpha21")
+ docs("androidx.wear:wear-complications-data:1.0.0-alpha22")
+ docs("androidx.wear:wear-complications-data-source:1.0.0-alpha22")
+ docs("androidx.wear:wear-complications-data-source-ktx:1.0.0-alpha22")
docs("androidx.wear:wear-ongoing:1.1.0-alpha01")
- docs("androidx.wear:wear-phone-interactions:1.0.0-rc01")
- docs("androidx.wear:wear-remote-interactions:1.0.0-rc01")
- docs("androidx.wear:wear-watchface:1.0.0-alpha21")
- docs("androidx.wear:wear-watchface-client:1.0.0-alpha21")
- docs("androidx.wear:wear-watchface-client-guava:1.0.0-alpha21")
- docs("androidx.wear:wear-watchface-complications-rendering:1.0.0-alpha21")
- docs("androidx.wear:wear-watchface-data:1.0.0-alpha21")
- docs("androidx.wear:wear-watchface-editor:1.0.0-alpha21")
- docs("androidx.wear:wear-watchface-editor-guava:1.0.0-alpha21")
- samples("androidx.wear:wear-watchface-editor-samples:1.0.0-alpha21")
- docs("androidx.wear:wear-watchface-guava:1.0.0-alpha21")
- samples("androidx.wear:wear-watchface-samples:1.0.0-alpha21")
- docs("androidx.wear:wear-watchface-style:1.0.0-alpha21")
+ docs("androidx.wear:wear-phone-interactions:1.1.0-alpha01")
+ docs("androidx.wear:wear-remote-interactions:1.0.0")
+ docs("androidx.wear:wear-watchface:1.0.0-alpha22")
+ docs("androidx.wear:wear-watchface-client:1.0.0-alpha22")
+ docs("androidx.wear:wear-watchface-client-guava:1.0.0-alpha22")
+ docs("androidx.wear:wear-watchface-complications-rendering:1.0.0-alpha22")
+ docs("androidx.wear:wear-watchface-data:1.0.0-alpha22")
+ docs("androidx.wear:wear-watchface-editor:1.0.0-alpha22")
+ docs("androidx.wear:wear-watchface-editor-guava:1.0.0-alpha22")
+ samples("androidx.wear:wear-watchface-editor-samples:1.0.0-alpha22")
+ docs("androidx.wear:wear-watchface-guava:1.0.0-alpha22")
+ samples("androidx.wear:wear-watchface-samples:1.0.0-alpha22")
+ docs("androidx.wear:wear-watchface-style:1.0.0-alpha22")
docs("androidx.wear:wear-input:1.2.0-alpha01")
+ samples("androidx.wear:wear-input-samples:1.2.0-alpha01")
docs("androidx.wear:wear-input-testing:1.2.0-alpha01")
docs("androidx.webkit:webkit:1.4.0")
docs("androidx.window:window:1.0.0-beta02")
diff --git a/docs-tip-of-tree/build.gradle b/docs-tip-of-tree/build.gradle
index a599104..c8573f4 100644
--- a/docs-tip-of-tree/build.gradle
+++ b/docs-tip-of-tree/build.gradle
@@ -259,9 +259,6 @@
docs(project(":viewpager:viewpager"))
docs(project(":wear:wear"))
stubs(fileTree(dir: "../wear/wear_stubs/", include: ["com.google.android.wearable-stubs.jar"]))
- docs(project(":wear:wear-complications-data"))
- docs(project(":wear:wear-complications-data-source"))
- samples(project(":wear:wear-complications-data-source-samples"))
docs(project(":wear:compose:compose-foundation"))
samples(project(":wear:compose:compose-foundation-samples"))
docs(project(":wear:compose:compose-material"))
@@ -275,17 +272,20 @@
docs(project(":wear:tiles:tiles"))
docs(project(":wear:tiles:tiles-proto"))
docs(project(":wear:tiles:tiles-renderer"))
- docs(project(":wear:wear-watchface"))
- docs(project(":wear:wear-watchface-complications-rendering"))
- docs(project(":wear:wear-watchface-client"))
- docs(project(":wear:wear-watchface-client-guava"))
- docs(project(":wear:wear-watchface-data"))
- docs(project(":wear:wear-watchface-editor"))
- docs(project(":wear:wear-watchface-editor-guava"))
- docs(project(":wear:wear-watchface-editor-samples"))
- docs(project(":wear:wear-watchface-guava"))
- samples(project(":wear:wear-watchface-samples"))
- docs(project(":wear:wear-watchface-style"))
+ docs(project(":wear:watchface:watchface"))
+ docs(project(":wear:watchface:watchface-complications-data"))
+ docs(project(":wear:watchface:watchface-complications-data-source"))
+ samples(project(":wear:watchface:watchface-complications-data-source-samples"))
+ docs(project(":wear:watchface:watchface-complications-rendering"))
+ docs(project(":wear:watchface:watchface-client"))
+ docs(project(":wear:watchface:watchface-client-guava"))
+ docs(project(":wear:watchface:watchface-data"))
+ docs(project(":wear:watchface:watchface-editor"))
+ docs(project(":wear:watchface:watchface-editor-guava"))
+ docs(project(":wear:watchface:watchface-editor-samples"))
+ docs(project(":wear:watchface:watchface-guava"))
+ samples(project(":wear:watchface:watchface-samples"))
+ docs(project(":wear:watchface:watchface-style"))
docs(project(":webkit:webkit"))
docs(project(":window:window"))
docs(project(":window:window-java"))
diff --git a/docs/testing.md b/docs/testing.md
index 0dbc1d6..fdb4cab 100644
--- a/docs/testing.md
+++ b/docs/testing.md
@@ -121,6 +121,27 @@
animations for a particular test or test class. For those cases, you can use the
[`AnimationDurationScaleRule`](https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:testutils/testutils-runtime/src/main/java/androidx/testutils/AnimationDurationScaleRule.kt).
+### Robolectric
+
+Robolectric tests are supported in AndroidX; however, if you targeting a
+pre-release version of the Android SDK then you may see an error like
+
+```
+java.lang.IllegalArgumentException: Package targetSdkVersion=31 > maxSdkVersion=30
+at org.robolectric.plugins.DefaultSdkPicker.configuredSdks(DefaultSdkPicker.java:118)
+at org.robolectric.plugins.DefaultSdkPicker.selectSdks(DefaultSdkPicker.java:69)
+```
+
+You can force Robolectric to run using an earlier version of the platform SDK by
+creating a `<project>/src/test/resources/robolectric.properties` file with the
+following contents:
+
+```
+# Robolectric currently doesn't support API 31, so we have to explicitly specify 30 as the target
+# sdk for now. Remove when no longer necessary.
+sdk=30
+```
+
## Using the emulator {#emulator}
You can use the emulator or a real device to run tests. If you wish to use the
diff --git a/emoji/emoji/lint-baseline.xml b/emoji/emoji/lint-baseline.xml
index e1b1de4..361399e 100644
--- a/emoji/emoji/lint-baseline.xml
+++ b/emoji/emoji/lint-baseline.xml
@@ -1,5 +1,27 @@
<?xml version="1.0" encoding="UTF-8"?>
-<issues format="6" by="lint 7.1.0-alpha02" type="baseline" client="cli" name="Lint" variant="all" version="7.1.0-alpha02">
+<issues format="6" by="lint 7.2.0-dev" type="baseline" client="gradle" dependencies="false" name="AGP (7.2.0-dev)" variant="all" version="7.2.0-dev">
+
+ <issue
+ id="NewApi"
+ message="Call requires API level 19 (current min is 14): `DefaultGlyphChecker`"
+ errorLine1=" GlyphChecker mGlyphChecker = new EmojiProcessor.DefaultGlyphChecker();"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/main/java/androidx/emoji/text/EmojiCompat.java"
+ line="971"
+ column="38"/>
+ </issue>
+
+ <issue
+ id="NewApi"
+ message="Class requires API level 19 (current min is 14): `EmojiMetadata`"
+ errorLine1=" final EmojiMetadata metadata = mock(EmojiMetadata.class);"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/androidTest/java/androidx/emoji/widget/EmojiEditableFactoryTest.java"
+ line="64"
+ column="45"/>
+ </issue>
<issue
id="NewApi"
@@ -14,6 +36,17 @@
<issue
id="NewApi"
+ message="Class requires API level 19 (current min is 14): `EmojiSpan`"
+ errorLine1=" final EmojiSpan[] spans = editable.getSpans(0, 1, EmojiSpan.class);"
+ errorLine2=" ~~~~~~~~~~~~~~~">
+ <location
+ file="src/androidTest/java/androidx/emoji/widget/EmojiEditableFactoryTest.java"
+ line="71"
+ column="59"/>
+ </issue>
+
+ <issue
+ id="NewApi"
message="Call requires API level 15 (current min is 14): `android.view.View#hasOnClickListeners`"
errorLine1=" assertTrue(extractButton.hasOnClickListeners());"
errorLine2=" ~~~~~~~~~~~~~~~~~~~">
@@ -113,6 +146,39 @@
<issue
id="NewApi"
+ message="Class requires API level 19 (current min is 14): `EmojiSpan`"
+ errorLine1=" mSpans = ((Spanned) charSequence).getSpans(0, charSequence.length(), EmojiSpan.class);"
+ errorLine2=" ~~~~~~~~~~~~~~~">
+ <location
+ file="src/androidTest/java/androidx/emoji/util/EmojiMatcher.java"
+ line="104"
+ column="82"/>
+ </issue>
+
+ <issue
+ id="NewApi"
+ message="Class requires API level 19 (current min is 14): `EmojiSpan`"
+ errorLine1=" mSpans = ((Spanned) charSequence).getSpans(0, charSequence.length(), EmojiSpan.class);"
+ errorLine2=" ~~~~~~~~~~~~~~~">
+ <location
+ file="src/androidTest/java/androidx/emoji/util/EmojiMatcher.java"
+ line="140"
+ column="82"/>
+ </issue>
+
+ <issue
+ id="NewApi"
+ message="Class requires API level 19 (current min is 14): `EmojiSpan`"
+ errorLine1=" final EmojiSpan[] spans = spanned.getSpans(0, charSequence.length(), EmojiSpan.class);"
+ errorLine2=" ~~~~~~~~~~~~~~~">
+ <location
+ file="src/androidTest/java/androidx/emoji/util/EmojiMatcher.java"
+ line="224"
+ column="82"/>
+ </issue>
+
+ <issue
+ id="NewApi"
message="Call requires API level 19 (current min is 14): `getId`"
errorLine1=" if (mResId == spans[index].getId()) {"
errorLine2=" ~~~~~">
@@ -212,6 +278,17 @@
<issue
id="NewApi"
+ message="Call requires API level 19 (current min is 14): `setEmojiReplaceStrategy`"
+ errorLine1=" mTextWatcher.setEmojiReplaceStrategy(EmojiCompat.REPLACE_STRATEGY_ALL);"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/androidTest/java/androidx/emoji/widget/EmojiTextWatcherTest.java"
+ line="105"
+ column="46"/>
+ </issue>
+
+ <issue
+ id="NewApi"
message="Call requires API level 19 (current min is 14): `onTextChanged`"
errorLine1=" mTextWatcher.onTextChanged(testString, 0, 0, 1);"
errorLine2=" ~~~~~~~~~~~~~">
@@ -333,6 +410,50 @@
<issue
id="NewApi"
+ message="Class requires API level 19 (current min is 14): `EmojiSpan`"
+ errorLine1=" final EmojiSpan span = mock(EmojiSpan.class);"
+ errorLine2=" ~~~~~~~~~~~~~~~">
+ <location
+ file="src/androidTest/java/androidx/emoji/widget/SpannableBuilderTest.java"
+ line="124"
+ column="37"/>
+ </issue>
+
+ <issue
+ id="NewApi"
+ message="Class requires API level 19 (current min is 14): `EmojiSpan`"
+ errorLine1=" EmojiSpan[] spans = spannable.getSpans(0, spannable.length(), EmojiSpan.class);"
+ errorLine2=" ~~~~~~~~~~~~~~~">
+ <location
+ file="src/androidTest/java/androidx/emoji/widget/SpannableBuilderTest.java"
+ line="135"
+ column="71"/>
+ </issue>
+
+ <issue
+ id="NewApi"
+ message="Class requires API level 19 (current min is 14): `EmojiSpan`"
+ errorLine1=" final EmojiSpan span = mock(EmojiSpan.class);"
+ errorLine2=" ~~~~~~~~~~~~~~~">
+ <location
+ file="src/androidTest/java/androidx/emoji/widget/SpannableBuilderTest.java"
+ line="188"
+ column="37"/>
+ </issue>
+
+ <issue
+ id="NewApi"
+ message="Class requires API level 19 (current min is 14): `EmojiSpan`"
+ errorLine1=" EmojiSpan[] spans = spannable.getSpans(0, spannable.length(), EmojiSpan.class);"
+ errorLine2=" ~~~~~~~~~~~~~~~">
+ <location
+ file="src/androidTest/java/androidx/emoji/widget/SpannableBuilderTest.java"
+ line="200"
+ column="71"/>
+ </issue>
+
+ <issue
+ id="NewApi"
message="Call requires API level 19 (current min is 14): `MetadataRepo`"
errorLine1=" loaderCallback.onLoaded(new MetadataRepo());"
errorLine2=" ~~~~~~~~~~~~~~~~">
@@ -607,7 +728,7 @@
errorLine2=" ~~~~~~~~~~~">
<location
file="src/main/java/androidx/emoji/text/EmojiCompat.java"
- line="302"
+ line="303"
column="19"/>
</issue>
@@ -618,7 +739,7 @@
errorLine2=" ~~~~~~~~~~~">
<location
file="src/main/java/androidx/emoji/text/EmojiCompat.java"
- line="322"
+ line="323"
column="19"/>
</issue>
@@ -629,7 +750,7 @@
errorLine2=" ~~~~~~~~~~~">
<location
file="src/main/java/androidx/emoji/text/EmojiCompat.java"
- line="337"
+ line="338"
column="19"/>
</issue>
@@ -640,7 +761,7 @@
errorLine2=" ~~~~~~~~~~~">
<location
file="src/main/java/androidx/emoji/text/EmojiCompat.java"
- line="337"
+ line="338"
column="43"/>
</issue>
@@ -651,7 +772,7 @@
errorLine2=" ~~~~~~~~~~~">
<location
file="src/main/java/androidx/emoji/text/EmojiCompat.java"
- line="352"
+ line="353"
column="19"/>
</issue>
@@ -662,7 +783,7 @@
errorLine2=" ~~~~~~~~">
<location
file="src/main/java/androidx/emoji/text/EmojiCompat.java"
- line="541"
+ line="542"
column="19"/>
</issue>
@@ -673,7 +794,7 @@
errorLine2=" ~~~~~~~~~~~~">
<location
file="src/main/java/androidx/emoji/text/EmojiCompat.java"
- line="625"
+ line="626"
column="12"/>
</issue>
@@ -684,7 +805,7 @@
errorLine2=" ~~~~~~~~~~~~">
<location
file="src/main/java/androidx/emoji/text/EmojiCompat.java"
- line="661"
+ line="662"
column="12"/>
</issue>
@@ -695,7 +816,7 @@
errorLine2=" ~~~~~~~~~~~~">
<location
file="src/main/java/androidx/emoji/text/EmojiCompat.java"
- line="696"
+ line="697"
column="12"/>
</issue>
@@ -706,7 +827,7 @@
errorLine2=" ~~~~~~~~~~~~">
<location
file="src/main/java/androidx/emoji/text/EmojiCompat.java"
- line="736"
+ line="737"
column="12"/>
</issue>
@@ -717,7 +838,7 @@
errorLine2=" ~~~~~~">
<location
file="src/main/java/androidx/emoji/text/EmojiCompat.java"
- line="979"
+ line="990"
column="16"/>
</issue>
@@ -728,7 +849,7 @@
errorLine2=" ~~~~~~">
<location
file="src/main/java/androidx/emoji/text/EmojiCompat.java"
- line="997"
+ line="1008"
column="16"/>
</issue>
@@ -739,7 +860,7 @@
errorLine2=" ~~~~~~">
<location
file="src/main/java/androidx/emoji/text/EmojiCompat.java"
- line="1014"
+ line="1025"
column="16"/>
</issue>
@@ -750,7 +871,7 @@
errorLine2=" ~~~~~~">
<location
file="src/main/java/androidx/emoji/text/EmojiCompat.java"
- line="1034"
+ line="1045"
column="16"/>
</issue>
@@ -761,7 +882,7 @@
errorLine2=" ~~~~~~">
<location
file="src/main/java/androidx/emoji/text/EmojiCompat.java"
- line="1053"
+ line="1064"
column="16"/>
</issue>
@@ -772,7 +893,7 @@
errorLine2=" ~~~~~~">
<location
file="src/main/java/androidx/emoji/text/EmojiCompat.java"
- line="1077"
+ line="1088"
column="16"/>
</issue>
@@ -783,7 +904,7 @@
errorLine2=" ~~~~~~">
<location
file="src/main/java/androidx/emoji/text/EmojiCompat.java"
- line="1088"
+ line="1099"
column="16"/>
</issue>
@@ -794,7 +915,7 @@
errorLine2=" ~~~~~~">
<location
file="src/main/java/androidx/emoji/text/EmojiCompat.java"
- line="1129"
+ line="1140"
column="16"/>
</issue>
@@ -805,7 +926,7 @@
errorLine2=" ~~~~~~~~~~~~~~~~~~">
<location
file="src/main/java/androidx/emoji/text/EmojiCompat.java"
- line="1150"
+ line="1161"
column="25"/>
</issue>
diff --git a/emoji2/emoji2-bundled/lint-baseline.xml b/emoji2/emoji2-bundled/lint-baseline.xml
index ea23657..e7fd0f7 100644
--- a/emoji2/emoji2-bundled/lint-baseline.xml
+++ b/emoji2/emoji2-bundled/lint-baseline.xml
@@ -1,5 +1,38 @@
<?xml version="1.0" encoding="UTF-8"?>
-<issues format="6" by="lint 7.1.0-alpha02" type="baseline" client="cli" name="Lint" variant="all" version="7.1.0-alpha02">
+<issues format="6" by="lint 7.2.0-dev" type="baseline" client="gradle" dependencies="false" name="AGP (7.2.0-dev)" variant="all" version="7.2.0-dev">
+
+ <issue
+ id="NewApi"
+ message="Class requires API level 19 (current min is 14): `EmojiSpan`"
+ errorLine1=" mSpans = ((Spanned) charSequence).getSpans(0, charSequence.length(), EmojiSpan.class);"
+ errorLine2=" ~~~~~~~~~~~~~~~">
+ <location
+ file="src/androidTest/java/androidx/emoji2/bundled/util/EmojiMatcher.java"
+ line="104"
+ column="82"/>
+ </issue>
+
+ <issue
+ id="NewApi"
+ message="Class requires API level 19 (current min is 14): `EmojiSpan`"
+ errorLine1=" mSpans = ((Spanned) charSequence).getSpans(0, charSequence.length(), EmojiSpan.class);"
+ errorLine2=" ~~~~~~~~~~~~~~~">
+ <location
+ file="src/androidTest/java/androidx/emoji2/bundled/util/EmojiMatcher.java"
+ line="140"
+ column="82"/>
+ </issue>
+
+ <issue
+ id="NewApi"
+ message="Class requires API level 19 (current min is 14): `EmojiSpan`"
+ errorLine1=" final EmojiSpan[] spans = spanned.getSpans(0, charSequence.length(), EmojiSpan.class);"
+ errorLine2=" ~~~~~~~~~~~~~~~">
+ <location
+ file="src/androidTest/java/androidx/emoji2/bundled/util/EmojiMatcher.java"
+ line="224"
+ column="82"/>
+ </issue>
<issue
id="NewApi"
diff --git a/emoji2/emoji2-views-helper/lint-baseline.xml b/emoji2/emoji2-views-helper/lint-baseline.xml
index ebfe397..d16cda2 100644
--- a/emoji2/emoji2-views-helper/lint-baseline.xml
+++ b/emoji2/emoji2-views-helper/lint-baseline.xml
@@ -1,5 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
-<issues format="6" by="lint 7.1.0-alpha02" type="baseline" client="cli" name="Lint" variant="all" version="7.1.0-alpha02">
+<issues format="6" by="lint 7.2.0-dev" type="baseline" client="gradle" dependencies="false" name="AGP (7.2.0-dev)" variant="all" version="7.2.0-dev">
+
+ <issue
+ id="NewApi"
+ message="Class requires API level 19 (current min is 14): `EmojiMetadata`"
+ errorLine1=" final EmojiMetadata metadata = mock(EmojiMetadata.class);"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/androidTest/java/androidx/emoji2/viewsintegration/EmojiEditableFactoryTest.java"
+ line="65"
+ column="45"/>
+ </issue>
<issue
id="NewApi"
@@ -14,79 +25,13 @@
<issue
id="NewApi"
- message="Call requires API level 19 (current min is 14): `EmojiInputFilter`"
- errorLine1=" mInputFilter = new EmojiInputFilter(textView);"
- errorLine2=" ~~~~~~~~~~~~~~~~~~~~">
+ message="Class requires API level 19 (current min is 14): `EmojiSpan`"
+ errorLine1=" final EmojiSpan[] spans = editable.getSpans(0, 1, EmojiSpan.class);"
+ errorLine2=" ~~~~~~~~~~~~~~~">
<location
- file="src/androidTest/java/androidx/emoji2/viewsintegration/EmojiInputFilterTest.java"
- line="57"
- column="24"/>
- </issue>
-
- <issue
- id="NewApi"
- message="Call requires API level 19 (current min is 14): `filter`"
- errorLine1=" assertNull(mInputFilter.filter(null, 0, 1, null, 0, 1));"
- errorLine2=" ~~~~~~">
- <location
- file="src/androidTest/java/androidx/emoji2/viewsintegration/EmojiInputFilterTest.java"
- line="62"
- column="33"/>
- </issue>
-
- <issue
- id="NewApi"
- message="Call requires API level 19 (current min is 14): `filter`"
- errorLine1=" final CharSequence result = mInputFilter.filter(testString, 0, 1, null, 0, 1);"
- errorLine2=" ~~~~~~">
- <location
- file="src/androidTest/java/androidx/emoji2/viewsintegration/EmojiInputFilterTest.java"
+ file="src/androidTest/java/androidx/emoji2/viewsintegration/EmojiEditableFactoryTest.java"
line="72"
- column="50"/>
- </issue>
-
- <issue
- id="NewApi"
- message="Call requires API level 19 (current min is 14): `filter`"
- errorLine1=" final CharSequence result = mInputFilter.filter(testString, 0, 1, null, 0, 1);"
- errorLine2=" ~~~~~~">
- <location
- file="src/androidTest/java/androidx/emoji2/viewsintegration/EmojiInputFilterTest.java"
- line="85"
- column="50"/>
- </issue>
-
- <issue
- id="NewApi"
- message="Call requires API level 19 (current min is 14): `filter`"
- errorLine1=" final CharSequence result = mInputFilter.filter(testString, 0, 1, null, 0, 1);"
- errorLine2=" ~~~~~~">
- <location
- file="src/androidTest/java/androidx/emoji2/viewsintegration/EmojiInputFilterTest.java"
- line="99"
- column="50"/>
- </issue>
-
- <issue
- id="NewApi"
- message="Call requires API level 19 (current min is 14): `filter`"
- errorLine1=" final CharSequence result = mInputFilter.filter(testString, 0, 1, null, 0, 1);"
- errorLine2=" ~~~~~~">
- <location
- file="src/androidTest/java/androidx/emoji2/viewsintegration/EmojiInputFilterTest.java"
- line="112"
- column="50"/>
- </issue>
-
- <issue
- id="NewApi"
- message="Call requires API level 19 (current min is 14): `filter`"
- errorLine1=" final CharSequence result = mInputFilter.filter(testString, 0, 1, null, 0, 1);"
- errorLine2=" ~~~~~~">
- <location
- file="src/androidTest/java/androidx/emoji2/viewsintegration/EmojiInputFilterTest.java"
- line="124"
- column="50"/>
+ column="59"/>
</issue>
<issue
diff --git a/emoji2/emoji2/build.gradle b/emoji2/emoji2/build.gradle
index d6bacab..22cb60a 100644
--- a/emoji2/emoji2/build.gradle
+++ b/emoji2/emoji2/build.gradle
@@ -26,7 +26,7 @@
api("androidx.startup:startup-runtime:1.0.0")
implementation("androidx.collection:collection:1.1.0")
implementation("androidx.annotation:annotation:1.2.0")
- implementation(project(":lifecycle:lifecycle-process"))
+ implementation("androidx.lifecycle:lifecycle-process:2.4.0-beta01")
androidTestImplementation(libs.testExtJunit)
androidTestImplementation(libs.testCore)
diff --git a/emoji2/emoji2/lint-baseline.xml b/emoji2/emoji2/lint-baseline.xml
index 4d10805..98c411b 100644
--- a/emoji2/emoji2/lint-baseline.xml
+++ b/emoji2/emoji2/lint-baseline.xml
@@ -1,103 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
-<issues format="6" by="lint 7.1.0-alpha02" type="baseline" client="cli" name="Lint" variant="all" version="7.1.0-alpha02">
+<issues format="6" by="lint 7.2.0-dev" type="baseline" client="gradle" dependencies="false" name="AGP (7.2.0-dev)" variant="all" version="7.2.0-dev">
<issue
id="NewApi"
- message="Call requires API level 24 (current min is 14): `java.util.Collection#stream`"
- errorLine1=" return result.stream().anyMatch((item) ->"
- errorLine2=" ~~~~~~">
+ message="Call requires API level 19 (current min is 14): `DefaultGlyphChecker`"
+ errorLine1=" GlyphChecker mGlyphChecker = new EmojiProcessor.DefaultGlyphChecker();"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
<location
- file="src/androidTest/java/androidx/emoji2/text/DefaultEmojiCompatConfigTest.java"
- line="77"
- column="23"/>
- </issue>
-
- <issue
- id="NewApi"
- message="Call requires API level 24 (current min is 14): `java.util.stream.Stream#anyMatch`"
- errorLine1=" return result.stream().anyMatch((item) ->"
- errorLine2=" ~~~~~~~~">
- <location
- file="src/androidTest/java/androidx/emoji2/text/DefaultEmojiCompatConfigTest.java"
- line="77"
- column="32"/>
- </issue>
-
- <issue
- id="NewApi"
- message="Field requires API level 19 (current min is 14): `android.content.pm.ResolveInfo#providerInfo`"
- errorLine1=" when(helper.getProviderInfo(eq(info))).thenReturn(info.providerInfo);"
- errorLine2=" ~~~~~~~~~~~~~~~~~">
- <location
- file="src/androidTest/java/androidx/emoji2/text/DefaultEmojiCompatConfigTest.java"
- line="217"
- column="63"/>
- </issue>
-
- <issue
- id="NewApi"
- message="Field requires API level 19 (current min is 14): `android.content.pm.ResolveInfo#providerInfo`"
- errorLine1=" info.providerInfo = new ProviderInfo();"
- errorLine2=" ~~~~~~~~~~~~~~~~~">
- <location
- file="src/androidTest/java/androidx/emoji2/text/DefaultEmojiCompatConfigTest.java"
- line="246"
- column="9"/>
- </issue>
-
- <issue
- id="NewApi"
- message="Field requires API level 19 (current min is 14): `android.content.pm.ResolveInfo#providerInfo`"
- errorLine1=" info.providerInfo.authority = authority;"
- errorLine2=" ~~~~~~~~~~~~~~~~~">
- <location
- file="src/androidTest/java/androidx/emoji2/text/DefaultEmojiCompatConfigTest.java"
- line="247"
- column="9"/>
- </issue>
-
- <issue
- id="NewApi"
- message="Field requires API level 19 (current min is 14): `android.content.pm.ResolveInfo#providerInfo`"
- errorLine1=" info.providerInfo.packageName = packageName;"
- errorLine2=" ~~~~~~~~~~~~~~~~~">
- <location
- file="src/androidTest/java/androidx/emoji2/text/DefaultEmojiCompatConfigTest.java"
- line="248"
- column="9"/>
- </issue>
-
- <issue
- id="NewApi"
- message="Field requires API level 19 (current min is 14): `android.content.pm.ResolveInfo#providerInfo`"
- errorLine1=" info.providerInfo.name = "name to make toString happy :)";"
- errorLine2=" ~~~~~~~~~~~~~~~~~">
- <location
- file="src/androidTest/java/androidx/emoji2/text/DefaultEmojiCompatConfigTest.java"
- line="249"
- column="9"/>
- </issue>
-
- <issue
- id="NewApi"
- message="Field requires API level 19 (current min is 14): `android.content.pm.ResolveInfo#providerInfo`"
- errorLine1=" info.providerInfo.applicationInfo = new ApplicationInfo();"
- errorLine2=" ~~~~~~~~~~~~~~~~~">
- <location
- file="src/androidTest/java/androidx/emoji2/text/DefaultEmojiCompatConfigTest.java"
- line="250"
- column="9"/>
- </issue>
-
- <issue
- id="NewApi"
- message="Field requires API level 19 (current min is 14): `android.content.pm.ResolveInfo#providerInfo`"
- errorLine1=" info.providerInfo.applicationInfo.flags = flags;"
- errorLine2=" ~~~~~~~~~~~~~~~~~">
- <location
- file="src/androidTest/java/androidx/emoji2/text/DefaultEmojiCompatConfigTest.java"
- line="251"
- column="9"/>
+ file="src/main/java/androidx/emoji2/text/EmojiCompat.java"
+ line="1157"
+ column="38"/>
</issue>
<issue
@@ -111,4 +23,48 @@
column="50"/>
</issue>
+ <issue
+ id="NewApi"
+ message="Class requires API level 19 (current min is 14): `EmojiSpan`"
+ errorLine1=" final EmojiSpan span = mock(EmojiSpan.class);"
+ errorLine2=" ~~~~~~~~~~~~~~~">
+ <location
+ file="src/androidTest/java/androidx/emoji2/text/SpannableBuilderTest.java"
+ line="123"
+ column="37"/>
+ </issue>
+
+ <issue
+ id="NewApi"
+ message="Class requires API level 19 (current min is 14): `EmojiSpan`"
+ errorLine1=" EmojiSpan[] spans = spannable.getSpans(0, spannable.length(), EmojiSpan.class);"
+ errorLine2=" ~~~~~~~~~~~~~~~">
+ <location
+ file="src/androidTest/java/androidx/emoji2/text/SpannableBuilderTest.java"
+ line="134"
+ column="71"/>
+ </issue>
+
+ <issue
+ id="NewApi"
+ message="Class requires API level 19 (current min is 14): `EmojiSpan`"
+ errorLine1=" final EmojiSpan span = mock(EmojiSpan.class);"
+ errorLine2=" ~~~~~~~~~~~~~~~">
+ <location
+ file="src/androidTest/java/androidx/emoji2/text/SpannableBuilderTest.java"
+ line="187"
+ column="37"/>
+ </issue>
+
+ <issue
+ id="NewApi"
+ message="Class requires API level 19 (current min is 14): `EmojiSpan`"
+ errorLine1=" EmojiSpan[] spans = spannable.getSpans(0, spannable.length(), EmojiSpan.class);"
+ errorLine2=" ~~~~~~~~~~~~~~~">
+ <location
+ file="src/androidTest/java/androidx/emoji2/text/SpannableBuilderTest.java"
+ line="199"
+ column="71"/>
+ </issue>
+
</issues>
diff --git a/fragment/fragment/lint-baseline.xml b/fragment/fragment/lint-baseline.xml
new file mode 100644
index 0000000..5edf534
--- /dev/null
+++ b/fragment/fragment/lint-baseline.xml
@@ -0,0 +1,290 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<issues format="6" by="lint 7.2.0-dev" type="baseline" client="gradle" dependencies="false" name="AGP (7.2.0-dev)" variant="all" version="7.2.0-dev">
+
+ <issue
+ id="ResourceType"
+ message="Expected resource of type animator"
+ errorLine1=" animator = AnimatorInflater.loadAnimator(context, nextAnim);"
+ errorLine2=" ~~~~~~~~">
+ <location
+ file="src/main/java/androidx/fragment/app/FragmentAnim.java"
+ line="99"
+ column="71"/>
+ </issue>
+
+ <issue
+ id="NewApi"
+ message="Field requires API level 21 (current min is 14): `getEnterTransition`"
+ errorLine1=" assertThat(fragment.enterTransition.enteringTargets).isEmpty()"
+ errorLine2=" ~~~~~~~~~~~~~~~">
+ <location
+ file="src/androidTest/java/androidx/fragment/app/FragmentTestUtil.kt"
+ line="157"
+ column="25"/>
+ </issue>
+
+ <issue
+ id="NewApi"
+ message="Field requires API level 21 (current min is 14): `getEnteringTargets`"
+ errorLine1=" assertThat(fragment.enterTransition.enteringTargets).isEmpty()"
+ errorLine2=" ~~~~~~~~~~~~~~~">
+ <location
+ file="src/androidTest/java/androidx/fragment/app/FragmentTestUtil.kt"
+ line="157"
+ column="41"/>
+ </issue>
+
+ <issue
+ id="NewApi"
+ message="Field requires API level 21 (current min is 14): `getEnterTransition`"
+ errorLine1=" assertThat(fragment.enterTransition.exitingTargets).isEmpty()"
+ errorLine2=" ~~~~~~~~~~~~~~~">
+ <location
+ file="src/androidTest/java/androidx/fragment/app/FragmentTestUtil.kt"
+ line="158"
+ column="25"/>
+ </issue>
+
+ <issue
+ id="NewApi"
+ message="Field requires API level 21 (current min is 14): `getExitingTargets`"
+ errorLine1=" assertThat(fragment.enterTransition.exitingTargets).isEmpty()"
+ errorLine2=" ~~~~~~~~~~~~~~">
+ <location
+ file="src/androidTest/java/androidx/fragment/app/FragmentTestUtil.kt"
+ line="158"
+ column="41"/>
+ </issue>
+
+ <issue
+ id="NewApi"
+ message="Field requires API level 21 (current min is 14): `getEnteringTargets`"
+ errorLine1=" assertThat(fragment.exitTransition.enteringTargets).isEmpty()"
+ errorLine2=" ~~~~~~~~~~~~~~~">
+ <location
+ file="src/androidTest/java/androidx/fragment/app/FragmentTestUtil.kt"
+ line="159"
+ column="40"/>
+ </issue>
+
+ <issue
+ id="NewApi"
+ message="Field requires API level 21 (current min is 14): `getExitTransition`"
+ errorLine1=" assertThat(fragment.exitTransition.enteringTargets).isEmpty()"
+ errorLine2=" ~~~~~~~~~~~~~~">
+ <location
+ file="src/androidTest/java/androidx/fragment/app/FragmentTestUtil.kt"
+ line="159"
+ column="25"/>
+ </issue>
+
+ <issue
+ id="NewApi"
+ message="Field requires API level 21 (current min is 14): `getExitTransition`"
+ errorLine1=" assertThat(fragment.exitTransition.exitingTargets).isEmpty()"
+ errorLine2=" ~~~~~~~~~~~~~~">
+ <location
+ file="src/androidTest/java/androidx/fragment/app/FragmentTestUtil.kt"
+ line="160"
+ column="25"/>
+ </issue>
+
+ <issue
+ id="NewApi"
+ message="Field requires API level 21 (current min is 14): `getExitingTargets`"
+ errorLine1=" assertThat(fragment.exitTransition.exitingTargets).isEmpty()"
+ errorLine2=" ~~~~~~~~~~~~~~">
+ <location
+ file="src/androidTest/java/androidx/fragment/app/FragmentTestUtil.kt"
+ line="160"
+ column="40"/>
+ </issue>
+
+ <issue
+ id="NewApi"
+ message="Field requires API level 21 (current min is 14): `getEnteringTargets`"
+ errorLine1=" assertThat(fragment.reenterTransition.enteringTargets).isEmpty()"
+ errorLine2=" ~~~~~~~~~~~~~~~">
+ <location
+ file="src/androidTest/java/androidx/fragment/app/FragmentTestUtil.kt"
+ line="162"
+ column="43"/>
+ </issue>
+
+ <issue
+ id="NewApi"
+ message="Field requires API level 21 (current min is 14): `getReenterTransition`"
+ errorLine1=" assertThat(fragment.reenterTransition.enteringTargets).isEmpty()"
+ errorLine2=" ~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/androidTest/java/androidx/fragment/app/FragmentTestUtil.kt"
+ line="162"
+ column="25"/>
+ </issue>
+
+ <issue
+ id="NewApi"
+ message="Field requires API level 21 (current min is 14): `getExitingTargets`"
+ errorLine1=" assertThat(fragment.reenterTransition.exitingTargets).isEmpty()"
+ errorLine2=" ~~~~~~~~~~~~~~">
+ <location
+ file="src/androidTest/java/androidx/fragment/app/FragmentTestUtil.kt"
+ line="163"
+ column="43"/>
+ </issue>
+
+ <issue
+ id="NewApi"
+ message="Field requires API level 21 (current min is 14): `getReenterTransition`"
+ errorLine1=" assertThat(fragment.reenterTransition.exitingTargets).isEmpty()"
+ errorLine2=" ~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/androidTest/java/androidx/fragment/app/FragmentTestUtil.kt"
+ line="163"
+ column="25"/>
+ </issue>
+
+ <issue
+ id="NewApi"
+ message="Field requires API level 21 (current min is 14): `getEnteringTargets`"
+ errorLine1=" assertThat(fragment.returnTransition.enteringTargets).isEmpty()"
+ errorLine2=" ~~~~~~~~~~~~~~~">
+ <location
+ file="src/androidTest/java/androidx/fragment/app/FragmentTestUtil.kt"
+ line="164"
+ column="42"/>
+ </issue>
+
+ <issue
+ id="NewApi"
+ message="Field requires API level 21 (current min is 14): `getReturnTransition`"
+ errorLine1=" assertThat(fragment.returnTransition.enteringTargets).isEmpty()"
+ errorLine2=" ~~~~~~~~~~~~~~~~">
+ <location
+ file="src/androidTest/java/androidx/fragment/app/FragmentTestUtil.kt"
+ line="164"
+ column="25"/>
+ </issue>
+
+ <issue
+ id="NewApi"
+ message="Field requires API level 21 (current min is 14): `getExitingTargets`"
+ errorLine1=" assertThat(fragment.returnTransition.exitingTargets).isEmpty()"
+ errorLine2=" ~~~~~~~~~~~~~~">
+ <location
+ file="src/androidTest/java/androidx/fragment/app/FragmentTestUtil.kt"
+ line="165"
+ column="42"/>
+ </issue>
+
+ <issue
+ id="NewApi"
+ message="Field requires API level 21 (current min is 14): `getReturnTransition`"
+ errorLine1=" assertThat(fragment.returnTransition.exitingTargets).isEmpty()"
+ errorLine2=" ~~~~~~~~~~~~~~~~">
+ <location
+ file="src/androidTest/java/androidx/fragment/app/FragmentTestUtil.kt"
+ line="165"
+ column="25"/>
+ </issue>
+
+ <issue
+ id="NewApi"
+ message="Field requires API level 21 (current min is 14): `getEnteringTargets`"
+ errorLine1=" assertThat(fragment.sharedElementEnter.enteringTargets).isEmpty()"
+ errorLine2=" ~~~~~~~~~~~~~~~">
+ <location
+ file="src/androidTest/java/androidx/fragment/app/FragmentTestUtil.kt"
+ line="167"
+ column="44"/>
+ </issue>
+
+ <issue
+ id="NewApi"
+ message="Field requires API level 21 (current min is 14): `getSharedElementEnter`"
+ errorLine1=" assertThat(fragment.sharedElementEnter.enteringTargets).isEmpty()"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/androidTest/java/androidx/fragment/app/FragmentTestUtil.kt"
+ line="167"
+ column="25"/>
+ </issue>
+
+ <issue
+ id="NewApi"
+ message="Field requires API level 21 (current min is 14): `getExitingTargets`"
+ errorLine1=" assertThat(fragment.sharedElementEnter.exitingTargets).isEmpty()"
+ errorLine2=" ~~~~~~~~~~~~~~">
+ <location
+ file="src/androidTest/java/androidx/fragment/app/FragmentTestUtil.kt"
+ line="168"
+ column="44"/>
+ </issue>
+
+ <issue
+ id="NewApi"
+ message="Field requires API level 21 (current min is 14): `getSharedElementEnter`"
+ errorLine1=" assertThat(fragment.sharedElementEnter.exitingTargets).isEmpty()"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/androidTest/java/androidx/fragment/app/FragmentTestUtil.kt"
+ line="168"
+ column="25"/>
+ </issue>
+
+ <issue
+ id="NewApi"
+ message="Field requires API level 21 (current min is 14): `getEnteringTargets`"
+ errorLine1=" assertThat(fragment.sharedElementReturn.enteringTargets).isEmpty()"
+ errorLine2=" ~~~~~~~~~~~~~~~">
+ <location
+ file="src/androidTest/java/androidx/fragment/app/FragmentTestUtil.kt"
+ line="169"
+ column="45"/>
+ </issue>
+
+ <issue
+ id="NewApi"
+ message="Field requires API level 21 (current min is 14): `getSharedElementReturn`"
+ errorLine1=" assertThat(fragment.sharedElementReturn.enteringTargets).isEmpty()"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/androidTest/java/androidx/fragment/app/FragmentTestUtil.kt"
+ line="169"
+ column="25"/>
+ </issue>
+
+ <issue
+ id="NewApi"
+ message="Field requires API level 21 (current min is 14): `getExitingTargets`"
+ errorLine1=" assertThat(fragment.sharedElementReturn.exitingTargets).isEmpty()"
+ errorLine2=" ~~~~~~~~~~~~~~">
+ <location
+ file="src/androidTest/java/androidx/fragment/app/FragmentTestUtil.kt"
+ line="170"
+ column="45"/>
+ </issue>
+
+ <issue
+ id="NewApi"
+ message="Field requires API level 21 (current min is 14): `getSharedElementReturn`"
+ errorLine1=" assertThat(fragment.sharedElementReturn.exitingTargets).isEmpty()"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/androidTest/java/androidx/fragment/app/FragmentTestUtil.kt"
+ line="170"
+ column="25"/>
+ </issue>
+
+ <issue
+ id="NewApi"
+ message="Call requires API level 21 (current min is 14): `TransitionFragment`"
+ errorLine1=" val fragment = TransitionFragment()"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/androidTest/java/androidx/fragment/app/FragmentTransitionTest.kt"
+ line="1682"
+ column="20"/>
+ </issue>
+
+</issues>
diff --git a/fragment/fragment/src/main/java/androidx/fragment/app/DialogFragment.java b/fragment/fragment/src/main/java/androidx/fragment/app/DialogFragment.java
index 4bb9d7f..d30bf10 100644
--- a/fragment/fragment/src/main/java/androidx/fragment/app/DialogFragment.java
+++ b/fragment/fragment/src/main/java/androidx/fragment/app/DialogFragment.java
@@ -677,6 +677,26 @@
}
}
+ /**
+ * {@inheritDoc}
+ *
+ * @deprecated use {@link #onCreateDialog} for code touching the dialog created by
+ * {@link #onCreateDialog}, {@link #onViewCreated(View, Bundle)} for code touching the
+ * view created by {@link #onCreateView} and {@link #onCreate(Bundle)} for other initialization.
+ * To get a callback specifically when a Fragment activity's
+ * {@link Activity#onCreate(Bundle)} is called, register a
+ * {@link androidx.lifecycle.LifecycleObserver} on the Activity's
+ * {@link Lifecycle} in {@link #onAttach(Context)}, removing it when it receives the
+ * {@link Lifecycle.State#CREATED} callback.
+ */
+ @SuppressWarnings("deprecation")
+ @MainThread
+ @Override
+ @Deprecated
+ public void onActivityCreated(@Nullable Bundle savedInstanceState) {
+ super.onActivityCreated(savedInstanceState);
+ }
+
@MainThread
@Override
public void onStart() {
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 84350e4..c85001a 100644
--- a/fragment/fragment/src/main/java/androidx/fragment/app/Fragment.java
+++ b/fragment/fragment/src/main/java/androidx/fragment/app/Fragment.java
@@ -2023,7 +2023,8 @@
* a previous saved state, this is the state.
*
* @deprecated use {@link #onViewCreated(View, Bundle)} for code touching
- * the Fragment's view and {@link #onCreate(Bundle)} for other initialization.
+ * the view created by {@link #onCreateView} and {@link #onCreate(Bundle)} for other
+ * initialization.
* To get a callback specifically when a Fragment activity's
* {@link Activity#onCreate(Bundle)} is called, register a
* {@link androidx.lifecycle.LifecycleObserver} on the Activity's
diff --git a/glance/glance-appwidget/api/current.txt b/glance/glance-appwidget/api/current.txt
index 0c6b8b6..4efd29b 100644
--- a/glance/glance-appwidget/api/current.txt
+++ b/glance/glance-appwidget/api/current.txt
@@ -32,6 +32,9 @@
public interface GlanceId {
}
+ public final class RemoteLazyListViewsTranslatorKt {
+ }
+
public final class RemoteViewsTranslatorKt {
}
@@ -55,3 +58,32 @@
}
+package androidx.glance.appwidget.layout {
+
+ @androidx.glance.appwidget.layout.LazyScopeMarker public interface LazyItemScope {
+ }
+
+ public final class LazyListKt {
+ method @androidx.compose.runtime.Composable public static void LazyColumn(optional androidx.glance.Modifier modifier, optional int horizontalAlignment, kotlin.jvm.functions.Function1<? super androidx.glance.appwidget.layout.LazyListScope,kotlin.Unit> content);
+ method public static inline <T> void items(androidx.glance.appwidget.layout.LazyListScope, java.util.List<? extends T> items, optional kotlin.jvm.functions.Function1<? super T,java.lang.Long> itemId, kotlin.jvm.functions.Function2<? super androidx.glance.appwidget.layout.LazyItemScope,? super T,kotlin.Unit> itemContent);
+ method public static inline <T> void items(androidx.glance.appwidget.layout.LazyListScope, T![] items, optional kotlin.jvm.functions.Function1<? super T,java.lang.Long> itemId, kotlin.jvm.functions.Function2<? super androidx.glance.appwidget.layout.LazyItemScope,? super T,kotlin.Unit> itemContent);
+ method public static inline <T> void itemsIndexed(androidx.glance.appwidget.layout.LazyListScope, java.util.List<? extends T> items, optional kotlin.jvm.functions.Function2<? super java.lang.Integer,? super T,java.lang.Long> itemId, kotlin.jvm.functions.Function3<? super androidx.glance.appwidget.layout.LazyItemScope,? super java.lang.Integer,? super T,kotlin.Unit> itemContent);
+ method public static inline <T> void itemsIndexed(androidx.glance.appwidget.layout.LazyListScope, T![] items, optional kotlin.jvm.functions.Function2<? super java.lang.Integer,? super T,java.lang.Long> itemId, kotlin.jvm.functions.Function3<? super androidx.glance.appwidget.layout.LazyItemScope,? super java.lang.Integer,? super T,kotlin.Unit> itemContent);
+ }
+
+ @androidx.glance.appwidget.layout.LazyScopeMarker public interface LazyListScope {
+ method public void item(optional long itemId, kotlin.jvm.functions.Function1<? super androidx.glance.appwidget.layout.LazyItemScope,kotlin.Unit> content);
+ method public void items(int count, optional kotlin.jvm.functions.Function1<? super java.lang.Integer,java.lang.Long> itemId, kotlin.jvm.functions.Function2<? super androidx.glance.appwidget.layout.LazyItemScope,? super java.lang.Integer,kotlin.Unit> itemContent);
+ field public static final androidx.glance.appwidget.layout.LazyListScope.Companion Companion;
+ field public static final long UnspecifiedItemId = -9223372036854775808L; // 0x8000000000000000L
+ }
+
+ public static final class LazyListScope.Companion {
+ field public static final long UnspecifiedItemId = -9223372036854775808L; // 0x8000000000000000L
+ }
+
+ @kotlin.DslMarker public @interface LazyScopeMarker {
+ }
+
+}
+
diff --git a/glance/glance-appwidget/api/public_plus_experimental_current.txt b/glance/glance-appwidget/api/public_plus_experimental_current.txt
index 0c6b8b6..4efd29b 100644
--- a/glance/glance-appwidget/api/public_plus_experimental_current.txt
+++ b/glance/glance-appwidget/api/public_plus_experimental_current.txt
@@ -32,6 +32,9 @@
public interface GlanceId {
}
+ public final class RemoteLazyListViewsTranslatorKt {
+ }
+
public final class RemoteViewsTranslatorKt {
}
@@ -55,3 +58,32 @@
}
+package androidx.glance.appwidget.layout {
+
+ @androidx.glance.appwidget.layout.LazyScopeMarker public interface LazyItemScope {
+ }
+
+ public final class LazyListKt {
+ method @androidx.compose.runtime.Composable public static void LazyColumn(optional androidx.glance.Modifier modifier, optional int horizontalAlignment, kotlin.jvm.functions.Function1<? super androidx.glance.appwidget.layout.LazyListScope,kotlin.Unit> content);
+ method public static inline <T> void items(androidx.glance.appwidget.layout.LazyListScope, java.util.List<? extends T> items, optional kotlin.jvm.functions.Function1<? super T,java.lang.Long> itemId, kotlin.jvm.functions.Function2<? super androidx.glance.appwidget.layout.LazyItemScope,? super T,kotlin.Unit> itemContent);
+ method public static inline <T> void items(androidx.glance.appwidget.layout.LazyListScope, T![] items, optional kotlin.jvm.functions.Function1<? super T,java.lang.Long> itemId, kotlin.jvm.functions.Function2<? super androidx.glance.appwidget.layout.LazyItemScope,? super T,kotlin.Unit> itemContent);
+ method public static inline <T> void itemsIndexed(androidx.glance.appwidget.layout.LazyListScope, java.util.List<? extends T> items, optional kotlin.jvm.functions.Function2<? super java.lang.Integer,? super T,java.lang.Long> itemId, kotlin.jvm.functions.Function3<? super androidx.glance.appwidget.layout.LazyItemScope,? super java.lang.Integer,? super T,kotlin.Unit> itemContent);
+ method public static inline <T> void itemsIndexed(androidx.glance.appwidget.layout.LazyListScope, T![] items, optional kotlin.jvm.functions.Function2<? super java.lang.Integer,? super T,java.lang.Long> itemId, kotlin.jvm.functions.Function3<? super androidx.glance.appwidget.layout.LazyItemScope,? super java.lang.Integer,? super T,kotlin.Unit> itemContent);
+ }
+
+ @androidx.glance.appwidget.layout.LazyScopeMarker public interface LazyListScope {
+ method public void item(optional long itemId, kotlin.jvm.functions.Function1<? super androidx.glance.appwidget.layout.LazyItemScope,kotlin.Unit> content);
+ method public void items(int count, optional kotlin.jvm.functions.Function1<? super java.lang.Integer,java.lang.Long> itemId, kotlin.jvm.functions.Function2<? super androidx.glance.appwidget.layout.LazyItemScope,? super java.lang.Integer,kotlin.Unit> itemContent);
+ field public static final androidx.glance.appwidget.layout.LazyListScope.Companion Companion;
+ field public static final long UnspecifiedItemId = -9223372036854775808L; // 0x8000000000000000L
+ }
+
+ public static final class LazyListScope.Companion {
+ field public static final long UnspecifiedItemId = -9223372036854775808L; // 0x8000000000000000L
+ }
+
+ @kotlin.DslMarker public @interface LazyScopeMarker {
+ }
+
+}
+
diff --git a/glance/glance-appwidget/api/restricted_current.txt b/glance/glance-appwidget/api/restricted_current.txt
index 0c6b8b6..4efd29b 100644
--- a/glance/glance-appwidget/api/restricted_current.txt
+++ b/glance/glance-appwidget/api/restricted_current.txt
@@ -32,6 +32,9 @@
public interface GlanceId {
}
+ public final class RemoteLazyListViewsTranslatorKt {
+ }
+
public final class RemoteViewsTranslatorKt {
}
@@ -55,3 +58,32 @@
}
+package androidx.glance.appwidget.layout {
+
+ @androidx.glance.appwidget.layout.LazyScopeMarker public interface LazyItemScope {
+ }
+
+ public final class LazyListKt {
+ method @androidx.compose.runtime.Composable public static void LazyColumn(optional androidx.glance.Modifier modifier, optional int horizontalAlignment, kotlin.jvm.functions.Function1<? super androidx.glance.appwidget.layout.LazyListScope,kotlin.Unit> content);
+ method public static inline <T> void items(androidx.glance.appwidget.layout.LazyListScope, java.util.List<? extends T> items, optional kotlin.jvm.functions.Function1<? super T,java.lang.Long> itemId, kotlin.jvm.functions.Function2<? super androidx.glance.appwidget.layout.LazyItemScope,? super T,kotlin.Unit> itemContent);
+ method public static inline <T> void items(androidx.glance.appwidget.layout.LazyListScope, T![] items, optional kotlin.jvm.functions.Function1<? super T,java.lang.Long> itemId, kotlin.jvm.functions.Function2<? super androidx.glance.appwidget.layout.LazyItemScope,? super T,kotlin.Unit> itemContent);
+ method public static inline <T> void itemsIndexed(androidx.glance.appwidget.layout.LazyListScope, java.util.List<? extends T> items, optional kotlin.jvm.functions.Function2<? super java.lang.Integer,? super T,java.lang.Long> itemId, kotlin.jvm.functions.Function3<? super androidx.glance.appwidget.layout.LazyItemScope,? super java.lang.Integer,? super T,kotlin.Unit> itemContent);
+ method public static inline <T> void itemsIndexed(androidx.glance.appwidget.layout.LazyListScope, T![] items, optional kotlin.jvm.functions.Function2<? super java.lang.Integer,? super T,java.lang.Long> itemId, kotlin.jvm.functions.Function3<? super androidx.glance.appwidget.layout.LazyItemScope,? super java.lang.Integer,? super T,kotlin.Unit> itemContent);
+ }
+
+ @androidx.glance.appwidget.layout.LazyScopeMarker public interface LazyListScope {
+ method public void item(optional long itemId, kotlin.jvm.functions.Function1<? super androidx.glance.appwidget.layout.LazyItemScope,kotlin.Unit> content);
+ method public void items(int count, optional kotlin.jvm.functions.Function1<? super java.lang.Integer,java.lang.Long> itemId, kotlin.jvm.functions.Function2<? super androidx.glance.appwidget.layout.LazyItemScope,? super java.lang.Integer,kotlin.Unit> itemContent);
+ field public static final androidx.glance.appwidget.layout.LazyListScope.Companion Companion;
+ field public static final long UnspecifiedItemId = -9223372036854775808L; // 0x8000000000000000L
+ }
+
+ public static final class LazyListScope.Companion {
+ field public static final long UnspecifiedItemId = -9223372036854775808L; // 0x8000000000000000L
+ }
+
+ @kotlin.DslMarker public @interface LazyScopeMarker {
+ }
+
+}
+
diff --git a/glance/glance-appwidget/integration-tests/demos/src/main/java/androidx/glance/appwidget/demos/ResponsiveAppWidget.kt b/glance/glance-appwidget/integration-tests/demos/src/main/java/androidx/glance/appwidget/demos/ResponsiveAppWidget.kt
index a868eb4..9529287 100644
--- a/glance/glance-appwidget/integration-tests/demos/src/main/java/androidx/glance/appwidget/demos/ResponsiveAppWidget.kt
+++ b/glance/glance-appwidget/integration-tests/demos/src/main/java/androidx/glance/appwidget/demos/ResponsiveAppWidget.kt
@@ -55,14 +55,14 @@
Text(
"Responsive",
style = TextStyle(
- size = 15.sp, fontWeight = FontWeight.Bold,
+ fontSize = 15.sp, fontWeight = FontWeight.Bold,
textDecoration = TextDecoration.Underline
)
)
Text(
" layout",
style = TextStyle(
- size = 15.sp, fontWeight = FontWeight.Medium,
+ fontSize = 15.sp, fontWeight = FontWeight.Medium,
textDecoration = TextDecoration.Underline
)
)
diff --git a/glance/glance-appwidget/src/androidAndroidTest/kotlin/androidx/glance/appwidget/AppWidgetHostRule.kt b/glance/glance-appwidget/src/androidAndroidTest/kotlin/androidx/glance/appwidget/AppWidgetHostRule.kt
index 14857e8..07a8aea 100644
--- a/glance/glance-appwidget/src/androidAndroidTest/kotlin/androidx/glance/appwidget/AppWidgetHostRule.kt
+++ b/glance/glance-appwidget/src/androidAndroidTest/kotlin/androidx/glance/appwidget/AppWidgetHostRule.kt
@@ -31,13 +31,13 @@
import androidx.test.ext.junit.rules.ActivityScenarioRule
import androidx.test.filters.SdkSuppress
import androidx.test.platform.app.InstrumentationRegistry
-import org.junit.Assert
import org.junit.rules.RuleChain
import org.junit.rules.TestRule
import org.junit.runner.Description
import org.junit.runners.model.Statement
import java.util.concurrent.CountDownLatch
import java.util.concurrent.TimeUnit
+import kotlin.test.fail
@SdkSuppress(minSdkVersion = 29)
class AppWidgetHostRule(
@@ -161,7 +161,11 @@
}
}
- private fun runAndWaitForChildren(action: () -> Unit) {
+ fun runAndObserveUntilDraw(
+ condition: String = "Expected condition to be met within 5 seconds",
+ run: () -> Unit = {},
+ test: () -> Boolean
+ ) {
val latch = CountDownLatch(1)
val onDrawListener = ViewTreeObserver.OnDrawListener {
if (mHostView.childCount > 0) latch.countDown()
@@ -170,14 +174,18 @@
mHostView.viewTreeObserver.addOnDrawListener(onDrawListener)
}
- action()
+ run()
val countedDown = latch.await(5, TimeUnit.SECONDS)
mActivityRule.scenario.onActivity {
mHostView.viewTreeObserver.removeOnDrawListener(onDrawListener)
}
- if (!countedDown && mHostView.childCount == 0) {
- Assert.fail("Expected new children on HostView within 5 seconds")
+ if (!countedDown && !test()) fail(condition)
+ }
+
+ private fun runAndWaitForChildren(action: () -> Unit) {
+ runAndObserveUntilDraw("Expected new children on HostView within 5 seconds", action) {
+ mHostView.childCount > 0
}
}
}
diff --git a/glance/glance-appwidget/src/androidAndroidTest/kotlin/androidx/glance/appwidget/LazyColumnTest.kt b/glance/glance-appwidget/src/androidAndroidTest/kotlin/androidx/glance/appwidget/LazyColumnTest.kt
new file mode 100644
index 0000000..1be45f5
--- /dev/null
+++ b/glance/glance-appwidget/src/androidAndroidTest/kotlin/androidx/glance/appwidget/LazyColumnTest.kt
@@ -0,0 +1,269 @@
+/*
+ * Copyright 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES 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.glance.appwidget
+
+import android.os.Build
+import android.view.View
+import android.view.ViewGroup
+import android.widget.ListView
+import android.widget.RelativeLayout
+import android.widget.TextView
+import androidx.glance.Modifier
+import androidx.glance.appwidget.layout.LazyColumn
+import androidx.glance.appwidget.layout.ReservedItemIdRangeEnd
+import androidx.glance.layout.Text
+import androidx.glance.layout.padding
+import androidx.glance.unit.Dp
+import androidx.glance.unit.dp
+import androidx.test.filters.FlakyTest
+import androidx.test.filters.MediumTest
+import androidx.test.filters.SdkSuppress
+import com.google.common.truth.Truth.assertThat
+import org.junit.Rule
+import org.junit.Test
+import kotlin.test.assertIs
+
+@SdkSuppress(minSdkVersion = 29)
+@MediumTest
+class LazyColumnTest {
+ @get:Rule
+ val mHostRule = AppWidgetHostRule()
+
+ @Test
+ fun modifier_modifiesColumn() {
+ TestGlanceAppWidget.uiDefinition = {
+ LazyColumn(modifier = Modifier.padding(5.dp, 6.dp, 7.dp, 8.dp)) {
+ item { Text("1") }
+ item { Text("2") }
+ }
+ }
+
+ mHostRule.startHost()
+
+ waitForListViewChildren { list ->
+ fun Dp.toPx() = toPixels(list.context.resources.displayMetrics)
+ assertThat(list.paddingStart).isEqualTo(5.dp.toPx())
+ assertThat(list.paddingTop).isEqualTo(6.dp.toPx())
+ assertThat(list.paddingEnd).isEqualTo(7.dp.toPx())
+ assertThat(list.paddingBottom).isEqualTo(8.dp.toPx())
+ }
+ }
+
+ @FlakyTest
+ @Test
+ fun item_withoutItemIds_createsNonStableList() {
+ TestGlanceAppWidget.uiDefinition = {
+ LazyColumn {
+ item { Text("First row") }
+ item { Text("Second row") }
+ }
+
+ LazyColumn {
+ item { Text("First row") }
+ item { Text("Second row") }
+ }
+ }
+
+ mHostRule.startHost()
+
+ waitForListViewChildren { list ->
+ val adapter = list.adapter!!
+ assertThat(adapter.hasStableIds()).isFalse()
+ assertThat(adapter.count).isEqualTo(2)
+ assertThat(adapter.getItemId(0)).isEqualTo(ReservedItemIdRangeEnd)
+ assertThat(adapter.getItemId(1)).isEqualTo(ReservedItemIdRangeEnd - 1)
+ }
+ }
+
+ @FlakyTest
+ @Test
+ fun item_withItemIds_createsStableList() {
+ TestGlanceAppWidget.uiDefinition = {
+ LazyColumn {
+ item { Text("First row") }
+ item(1L) { Text("Second row") }
+ }
+ }
+
+ mHostRule.startHost()
+
+ waitForListViewChildren { list ->
+ val adapter = list.adapter!!
+ assertThat(adapter.hasStableIds()).isTrue()
+ assertThat(adapter.count).isEqualTo(2)
+ assertThat(adapter.getItemId(0)).isEqualTo(ReservedItemIdRangeEnd)
+ assertThat(adapter.getItemId(1)).isEqualTo(1L)
+ }
+ }
+
+ @FlakyTest
+ @Test
+ fun items_withoutItemIds_createsNonStableList() {
+ TestGlanceAppWidget.uiDefinition = {
+ LazyColumn {
+ items(count = 3) { index -> Text("Row $index") }
+ }
+ }
+
+ mHostRule.startHost()
+
+ waitForListViewChildren { list ->
+ val adapter = list.adapter!!
+ assertThat(adapter.count).isEqualTo(3)
+ assertThat(adapter.hasStableIds()).isFalse()
+ assertThat(adapter.getItemId(0)).isEqualTo(ReservedItemIdRangeEnd)
+ assertThat(adapter.getItemId(1)).isEqualTo(ReservedItemIdRangeEnd - 1)
+ assertThat(adapter.getItemId(2)).isEqualTo(ReservedItemIdRangeEnd - 2)
+ }
+ }
+
+ @FlakyTest
+ @Test
+ fun items_withItemIds_createsStableList() {
+ TestGlanceAppWidget.uiDefinition = {
+ LazyColumn {
+ items(count = 3, itemId = { it * 2L }) { index -> Text("Row $index") }
+ item { Text("Row 3") }
+ }
+ }
+
+ mHostRule.startHost()
+
+ waitForListViewChildren { list ->
+ val adapter = list.adapter!!
+ assertThat(adapter.count).isEqualTo(4)
+ assertThat(adapter.hasStableIds()).isTrue()
+ assertThat(adapter.getItemId(0)).isEqualTo(0L)
+ assertThat(adapter.getItemId(1)).isEqualTo(2L)
+ assertThat(adapter.getItemId(2)).isEqualTo(4L)
+ assertThat(adapter.getItemId(3)).isEqualTo(ReservedItemIdRangeEnd)
+ }
+ }
+
+ @Test
+ fun itemContent_nonStableList_translatesChildren() {
+ TestGlanceAppWidget.uiDefinition = {
+ LazyColumn {
+ item { Text("Row 0") }
+ item { Text("Row 1") }
+ items(2) { index -> Text("Row ${index + 2}") }
+ }
+ }
+
+ mHostRule.startHost()
+
+ waitForListViewChildren { list ->
+ val textView1 = list.getListChildAt<TextView>(0)
+ val textView2 = list.getListChildAt<TextView>(1)
+ val textView3 = list.getListChildAt<TextView>(2)
+ val textView4 = list.getListChildAt<TextView>(3)
+ assertThat(textView1.text.toString()).isEqualTo("Row 0")
+ assertThat(textView2.text.toString()).isEqualTo("Row 1")
+ assertThat(textView3.text.toString()).isEqualTo("Row 2")
+ assertThat(textView4.text.toString()).isEqualTo("Row 3")
+ }
+ }
+
+ @Test
+ fun itemContent_stableList_translatesChildren() {
+ TestGlanceAppWidget.uiDefinition = {
+ LazyColumn {
+ item(itemId = 1L) { Text("Row 0") }
+ item(itemId = 1L) { Text("Row 1") }
+ items(count = 2, itemId = { it + 2L }) { index -> Text("Row ${index + 2}") }
+ }
+ }
+
+ mHostRule.startHost()
+
+ waitForListViewChildren { list ->
+ val textView1 = list.getListChildAt<TextView>(0)
+ val textView2 = list.getListChildAt<TextView>(1)
+ val textView3 = list.getListChildAt<TextView>(2)
+ val textView4 = list.getListChildAt<TextView>(3)
+ assertThat(textView1.text.toString()).isEqualTo("Row 0")
+ assertThat(textView2.text.toString()).isEqualTo("Row 1")
+ assertThat(textView3.text.toString()).isEqualTo("Row 2")
+ assertThat(textView4.text.toString()).isEqualTo("Row 3")
+ }
+ }
+
+ @Test
+ fun itemContent_emptyItem() {
+ TestGlanceAppWidget.uiDefinition = {
+ LazyColumn {
+ item { }
+ }
+ }
+
+ mHostRule.startHost()
+
+ waitForListViewChildren { list ->
+ val row = list.getListChildAt<RelativeLayout>(0)
+ assertThat(row.childCount).isEqualTo(0)
+ }
+ }
+
+ @Test
+ fun itemContent_multipleViews() {
+ TestGlanceAppWidget.uiDefinition = {
+ LazyColumn {
+ item {
+ Text("Row item 0")
+ Text("Row item 1")
+ }
+ }
+ }
+
+ mHostRule.startHost()
+
+ waitForListViewChildren { list ->
+ val row = list.getListChildAt<RelativeLayout>(0)
+ val rowItem0 = assertIs<TextView>(row.getChildAt(0))
+ val rowItem1 = assertIs<TextView>(row.getChildAt(1))
+ assertThat(rowItem0.text.toString()).isEqualTo("Row item 0")
+ assertThat(rowItem1.text.toString()).isEqualTo("Row item 1")
+ }
+ }
+
+ private fun waitForListViewChildren(action: (list: ListView) -> Unit = {}) {
+ mHostRule.onHostView { }
+
+ mHostRule.runAndObserveUntilDraw(condition = "ListView did not load in time") {
+ mHostRule.mHostView.let { host ->
+ val list = host.findViewByType<ListView>()
+ host.childCount > 0 &&
+ list?.let { it.childCount > 0 && it.adapter != null } ?: false
+ }
+ }
+
+ mHostRule.onHostView {
+ action(mHostRule.mHostView.findViewByType<ListView>()!!)
+ }
+ }
+
+ private inline fun <reified V : View> ListView.getListChildAt(position: Int): V {
+ return assertIs<V>(
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
+ this.getChildAt(position)
+ } else {
+ // Pre-S, a RemoteViewsAdapter is used which adds an extra wrapper FrameLayout
+ (this.getChildAt(position) as ViewGroup).getChildAt(0)
+ }
+ )
+ }
+}
diff --git a/glance/glance-appwidget/src/androidMain/kotlin/androidx/glance/appwidget/ApplyModifiers.kt b/glance/glance-appwidget/src/androidMain/kotlin/androidx/glance/appwidget/ApplyModifiers.kt
index 4646a40..4d02cc1 100644
--- a/glance/glance-appwidget/src/androidMain/kotlin/androidx/glance/appwidget/ApplyModifiers.kt
+++ b/glance/glance-appwidget/src/androidMain/kotlin/androidx/glance/appwidget/ApplyModifiers.kt
@@ -25,6 +25,7 @@
import android.util.TypedValue
import android.view.View
import android.widget.RemoteViews
+import androidx.annotation.IdRes
import androidx.glance.GlanceInternalApi
import androidx.glance.Modifier
import androidx.glance.action.Action
@@ -36,7 +37,8 @@
private fun applyAction(
rv: RemoteViews,
action: Action,
- context: Context
+ context: Context,
+ @IdRes viewId: Int
) {
when (action) {
is LaunchActivityAction -> {
@@ -48,7 +50,7 @@
intent,
PendingIntent.FLAG_MUTABLE
)
- rv.setOnClickPendingIntent(R.id.glanceView, pendingIntent)
+ rv.setOnClickPendingIntent(viewId, pendingIntent)
}
else -> throw IllegalArgumentException("Unrecognized action type.")
}
@@ -57,7 +59,8 @@
private fun applyPadding(
rv: RemoteViews,
modifier: PaddingModifier,
- resources: Resources
+ resources: Resources,
+ @IdRes viewId: Int
) {
val displayMetrics = resources.displayMetrics
val isRtl = modifier.rtlAware &&
@@ -65,7 +68,7 @@
val start = modifier.start.toPixels(displayMetrics)
val end = modifier.end.toPixels(displayMetrics)
rv.setViewPadding(
- R.id.glanceView,
+ viewId,
if (isRtl) end else start,
modifier.top.toPixels(displayMetrics),
if (isRtl) start else end,
@@ -73,11 +76,16 @@
)
}
-internal fun applyModifiers(context: Context, rv: RemoteViews, modifiers: Modifier) {
+internal fun applyModifiers(
+ context: Context,
+ rv: RemoteViews,
+ modifiers: Modifier,
+ @IdRes viewId: Int = R.id.glanceView
+) {
modifiers.foldOut(Unit) { modifier, _ ->
when (modifier) {
- is ActionModifier -> applyAction(rv, modifier.action, context)
- is PaddingModifier -> applyPadding(rv, modifier, context.resources)
+ is ActionModifier -> applyAction(rv, modifier.action, context, viewId)
+ is PaddingModifier -> applyPadding(rv, modifier, context.resources, viewId)
}
}
}
diff --git a/glance/glance-appwidget/src/androidMain/kotlin/androidx/glance/appwidget/RemoteLazyListViewsTranslator.kt b/glance/glance-appwidget/src/androidMain/kotlin/androidx/glance/appwidget/RemoteLazyListViewsTranslator.kt
new file mode 100644
index 0000000..63fa61c
--- /dev/null
+++ b/glance/glance-appwidget/src/androidMain/kotlin/androidx/glance/appwidget/RemoteLazyListViewsTranslator.kt
@@ -0,0 +1,101 @@
+@file:OptIn(GlanceInternalApi::class)
+/*
+ * Copyright 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES 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.glance.appwidget
+
+import android.widget.RemoteViews
+import androidx.annotation.IdRes
+import androidx.annotation.LayoutRes
+import androidx.core.widget.RemoteViewsCompat
+import androidx.glance.GlanceInternalApi
+import androidx.glance.appwidget.layout.EmittableLazyColumn
+import androidx.glance.appwidget.layout.EmittableLazyList
+import androidx.glance.appwidget.layout.EmittableLazyListItem
+import androidx.glance.appwidget.layout.ReservedItemIdRangeEnd
+import androidx.glance.layout.EmittableBox
+
+@OptIn(GlanceInternalApi::class)
+internal fun translateEmittableLazyColumn(
+ translationContext: TranslationContext,
+ element: EmittableLazyColumn,
+): RemoteViews {
+ val listLayout = requireNotNull(listLayouts.getOrNull(translationContext.listCount)) {
+ """
+ Glance widgets only support ${listLayouts.size} lazy lists per widget. If you need more
+ lists provide a non-composable [RemoteViews].
+ """.trimIndent()
+ }
+ translationContext.listCount++
+ return translateEmittableLazyList(
+ translationContext,
+ element,
+ listLayout.viewId,
+ listLayout.layoutId
+ )
+}
+
+@OptIn(GlanceInternalApi::class)
+private fun translateEmittableLazyList(
+ translationContext: TranslationContext,
+ element: EmittableLazyList,
+ @IdRes viewId: Int,
+ @LayoutRes layoutId: Int
+): RemoteViews = remoteViews(translationContext, layoutId)
+ .also { rv ->
+ val items = RemoteViewsCompat.RemoteCollectionItems.Builder().apply {
+ element.children.fold(false) { previous, itemEmittable ->
+ val itemId = (itemEmittable as EmittableLazyListItem).itemId
+ addItem(itemId, translateChild(translationContext, itemEmittable))
+ // If the user specifies any explicit ids, we assume the list to be stable
+ previous || (itemId > ReservedItemIdRangeEnd)
+ }.let { setHasStableIds(it) }
+ // TODO(b/198618359): assign an explicit view type count
+ }.build()
+ RemoteViewsCompat.setRemoteAdapter(
+ translationContext.context,
+ rv,
+ translationContext.appWidgetId,
+ viewId,
+ items
+ )
+ applyModifiers(translationContext.context, rv, element.modifier, viewId)
+ }
+
+/**
+ * Translates a list item either to its immediate only child, or a column layout wrapping all its
+ * children.
+ */
+internal fun translateEmittableLazyListItem(
+ translationContext: TranslationContext,
+ element: EmittableLazyListItem
+): RemoteViews =
+ if (element.children.size == 1) {
+ translateChild(translationContext, element.children.single())
+ } else {
+ translateChild(
+ translationContext,
+ EmittableBox().also { it.children.addAll(element.children) }
+ )
+ }
+
+private data class LazyListLayout(@IdRes val viewId: Int, @LayoutRes val layoutId: Int)
+
+private val listLayouts: List<LazyListLayout> = listOf(
+ LazyListLayout(R.id.glanceListView1, R.layout.list_layout_1),
+ LazyListLayout(R.id.glanceListView2, R.layout.list_layout_2),
+ LazyListLayout(R.id.glanceListView2, R.layout.list_layout_3),
+)
diff --git a/glance/glance-appwidget/src/androidMain/kotlin/androidx/glance/appwidget/RemoteViewsTranslator.kt b/glance/glance-appwidget/src/androidMain/kotlin/androidx/glance/appwidget/RemoteViewsTranslator.kt
index 518932b..9ec50cb 100644
--- a/glance/glance-appwidget/src/androidMain/kotlin/androidx/glance/appwidget/RemoteViewsTranslator.kt
+++ b/glance/glance-appwidget/src/androidMain/kotlin/androidx/glance/appwidget/RemoteViewsTranslator.kt
@@ -37,6 +37,8 @@
import androidx.core.widget.setRelativeLayoutGravity
import androidx.glance.Emittable
import androidx.glance.GlanceInternalApi
+import androidx.glance.appwidget.layout.EmittableLazyColumn
+import androidx.glance.appwidget.layout.EmittableLazyListItem
import androidx.glance.layout.Alignment
import androidx.glance.layout.EmittableBox
import androidx.glance.layout.EmittableColumn
@@ -63,9 +65,13 @@
)
}
-private data class TranslationContext(val context: Context, val appWidgetId: Int)
+internal data class TranslationContext(
+ val context: Context,
+ val appWidgetId: Int,
+ var listCount: Int = 0
+)
-private fun translateChild(
+internal fun translateChild(
translationContext: TranslationContext,
element: Emittable
): RemoteViews {
@@ -74,11 +80,13 @@
is EmittableRow -> translateEmittableRow(translationContext, element)
is EmittableColumn -> translateEmittableColumn(translationContext, element)
is EmittableText -> translateEmittableText(translationContext, element)
+ is EmittableLazyListItem -> translateEmittableLazyListItem(translationContext, element)
+ is EmittableLazyColumn -> translateEmittableLazyColumn(translationContext, element)
else -> throw IllegalArgumentException("Unknown element type ${element::javaClass}")
}
}
-private fun remoteViews(translationContext: TranslationContext, @LayoutRes layoutId: Int) =
+internal fun remoteViews(translationContext: TranslationContext, @LayoutRes layoutId: Int) =
RemoteViews(translationContext.context.packageName, layoutId)
private fun Alignment.Horizontal.toGravity(): Int =
@@ -155,7 +163,9 @@
}
val content = SpannableString(text)
val length = content.length
- style.size?.let { setTextViewTextSize(R.id.glanceView, TypedValue.COMPLEX_UNIT_SP, it.value) }
+ style.fontSize?.let {
+ setTextViewTextSize(R.id.glanceView, TypedValue.COMPLEX_UNIT_SP, it.value)
+ }
val spans = mutableListOf<ParcelableSpan>()
style.textDecoration?.let {
if (TextDecoration.LineThrough in it) {
@@ -185,7 +195,7 @@
// Sets the emittables as children to the view. This first remove any previously added view, the
// add a view per child, with a stable id if of Android S+. Currently the stable id is the index
// of the child in the iterable.
-private fun RemoteViews.setChildren(
+internal fun RemoteViews.setChildren(
translationContext: TranslationContext,
viewId: Int,
children: Iterable<Emittable>
diff --git a/glance/glance-appwidget/src/androidMain/kotlin/androidx/glance/appwidget/layout/LazyList.kt b/glance/glance-appwidget/src/androidMain/kotlin/androidx/glance/appwidget/layout/LazyList.kt
new file mode 100644
index 0000000..99d3683
--- /dev/null
+++ b/glance/glance-appwidget/src/androidMain/kotlin/androidx/glance/appwidget/layout/LazyList.kt
@@ -0,0 +1,251 @@
+@file:OptIn(GlanceInternalApi::class)
+/*
+ * Copyright 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES 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.glance.appwidget.layout
+
+import androidx.annotation.VisibleForTesting
+import androidx.compose.runtime.Composable
+import androidx.compose.runtime.ComposeNode
+import androidx.glance.Applier
+import androidx.glance.EmittableWithChildren
+import androidx.glance.GlanceInternalApi
+import androidx.glance.Modifier
+import androidx.glance.layout.Alignment
+
+/**
+ * A vertical scrolling list that only lays out the currently visible items. The [content] block
+ * defines a DSL which allows you to emit different list items.
+ *
+ * @param modifier the modifier to apply to this layout
+ * @param horizontalAlignment the horizontal alignment applied to the items.
+ * @param content a block which describes the content. Inside this block you can use methods like
+ * [LazyListScope.item] to add a single item or [LazyListScope.items] to add a list of items.
+ *
+ * TODO(b/198618359): apply modifiers for column and column items, support alignment, click handling
+ */
+@Composable
+public fun LazyColumn(
+ modifier: Modifier = Modifier,
+ horizontalAlignment: Alignment.Horizontal = Alignment.Start,
+ content: LazyListScope.() -> Unit
+) {
+ ComposeNode<EmittableLazyColumn, Applier>(
+ factory = ::EmittableLazyColumn,
+ update = {
+ this.set(modifier) { this.modifier = it }
+ this.set(horizontalAlignment) { this.horizontalAlignment = it }
+ },
+ content = applyListScope(content)
+ )
+}
+
+private fun applyListScope(content: LazyListScope.() -> Unit): @Composable () -> Unit {
+ var nextImplicitItemId = ReservedItemIdRangeEnd
+ val itemList = mutableListOf<Pair<Long?, @Composable LazyItemScope.() -> Unit>>()
+ val listScopeImpl = object : LazyListScope {
+ override fun item(itemId: Long, content: @Composable LazyItemScope.() -> Unit) {
+ require(itemId == LazyListScope.UnspecifiedItemId || itemId > ReservedItemIdRangeEnd) {
+ """
+ You may not specify item ids less than $ReservedItemIdRangeEnd in a Glance
+ widget. These are reserved.
+ """.trimIndent()
+ }
+ itemList.add(itemId to content)
+ }
+
+ override fun items(
+ count: Int,
+ itemId: ((index: Int) -> Long),
+ itemContent: @Composable LazyItemScope.(index: Int) -> Unit
+ ) {
+ repeat(count) { index ->
+ item(itemId(index)) { itemContent(index) }
+ }
+ }
+ }
+ listScopeImpl.apply(content)
+ return {
+ itemList.forEach { (itemId, composable) ->
+ val id = itemId.takeIf { it != LazyListScope.UnspecifiedItemId } ?: nextImplicitItemId--
+ check(id != LazyListScope.UnspecifiedItemId) { "Implicit list item ids exhausted." }
+ LazyListItem(id) {
+ object : LazyItemScope { }.apply { composable() }
+ }
+ }
+ }
+}
+
+@OptIn(GlanceInternalApi::class)
+@Composable
+private fun LazyListItem(
+ itemId: Long,
+ content: @Composable () -> Unit
+) {
+ ComposeNode<EmittableLazyListItem, Applier>(
+ factory = ::EmittableLazyListItem,
+ update = {
+ this.set(itemId) { this.itemId = it }
+ },
+ content = content
+ )
+}
+
+/**
+ * Values between -2^63 and -2^62 are reserved for list items whose id has not been explicitly
+ * defined.
+ */
+@VisibleForTesting
+internal const val ReservedItemIdRangeEnd = -0x4_000_000_000_000_000L
+
+@DslMarker
+annotation class LazyScopeMarker
+
+/**
+ * Receiver scope being used by the item content parameter of [LazyColumn].
+ */
+@LazyScopeMarker
+interface LazyItemScope
+
+/**
+ * Receiver scope which is used by [LazyColumn].
+ */
+@LazyScopeMarker
+interface LazyListScope {
+ /**
+ * Adds a single item.
+ *
+ * @param itemId a stable and unique id representing the item. The value may not be less than
+ * or equal to -2^62, as these values are reserved by the Glance API. Specifying the list
+ * item ids will maintain the scroll position through app widget updates in Android S and
+ * higher devices.
+ * @param content the content of the item
+ */
+ fun item(itemId: Long = UnspecifiedItemId, content: @Composable LazyItemScope.() -> Unit)
+
+ /**
+ * Adds a [count] of items.
+ *
+ * @param count the count of items
+ * @param itemId a factory of stable and unique ids representing the item. The value may not be
+ * less than or equal to -2^62, as these values are reserved by the Glance API. Specifying
+ * the list item ids will maintain the scroll position through app widget updates in Android
+ * S and higher devices.
+ * @param itemContent the content displayed by a single item
+ */
+ fun items(
+ count: Int,
+ itemId: ((index: Int) -> Long) = { UnspecifiedItemId },
+ itemContent: @Composable LazyItemScope.(index: Int) -> Unit
+ )
+
+ companion object {
+ const val UnspecifiedItemId = Long.MIN_VALUE
+ }
+}
+
+/**
+ * Adds a list of items.
+ *
+ * @param items the data list
+ * @param itemId a factory of stable and unique ids representing the item. The value may not be
+ * less than or equal to -2^62, as these values are reserved by the Glance API. Specifying
+ * the list item ids will maintain the scroll position through app widget updates in Android
+ * S and higher devices.
+ * @param itemContent the content displayed by a single item
+ */
+inline fun <T> LazyListScope.items(
+ items: List<T>,
+ crossinline itemId: ((item: T) -> Long) = { LazyListScope.UnspecifiedItemId },
+ crossinline itemContent: @Composable LazyItemScope.(item: T) -> Unit
+) = items(items.size, { index: Int -> itemId(items[index]) }) {
+ itemContent(items[it])
+}
+
+/**
+ * Adds a list of items where the content of an item is aware of its index.
+ *
+ * @param items the data list
+ * @param itemId a factory of stable and unique ids representing the item. The value may not be
+ * less than or equal to -2^62, as these values are reserved by the Glance API. Specifying
+ * the list item ids will maintain the scroll position through app widget updates in Android
+ * S and higher devices.
+ * @param itemContent the content displayed by a single item
+ */
+inline fun <T> LazyListScope.itemsIndexed(
+ items: List<T>,
+ crossinline itemId: ((index: Int, item: T) -> Long) =
+ { _, _ -> LazyListScope.UnspecifiedItemId },
+ crossinline itemContent: @Composable LazyItemScope.(index: Int, item: T) -> Unit
+) = items(items.size, { index: Int -> itemId(index, items[index]) }) {
+ itemContent(it, items[it])
+}
+
+/**
+ * Adds an array of items.
+ *
+ * @param items the data array
+ * @param itemId a factory of stable and unique list item ids. Using the same itemId for multiple
+ * items in the array is not allowed. When you specify the itemId, the scroll position will be
+ * maintained based on the itemId, which means if you add/remove items before the current visible
+ * item the item with the given itemId will be kept as the first visible one.
+ * @param itemContent the content displayed by a single item
+ */
+inline fun <T> LazyListScope.items(
+ items: Array<T>,
+ noinline itemId: ((item: T) -> Long) = { LazyListScope.UnspecifiedItemId },
+ crossinline itemContent: @Composable LazyItemScope.(item: T) -> Unit
+) = items(items.size, { index: Int -> itemId(items[index]) }) {
+ itemContent(items[it])
+}
+
+/**
+ * Adds a array of items where the content of an item is aware of its index.
+ *
+ * @param items the data array
+ * @param itemId a factory of stable and unique list item ids. Using the same itemId for multiple
+ * items in the array is not allowed. When you specify the itemId the scroll position will be
+ * maintained based on the itemId, which means if you add/remove items before the current visible
+ * item the item with the given itemId will be kept as the first visible one.
+ * @param itemContent the content displayed by a single item
+ */
+inline fun <T> LazyListScope.itemsIndexed(
+ items: Array<T>,
+ noinline itemId: ((index: Int, item: T) -> Long) = { _, _ -> LazyListScope.UnspecifiedItemId },
+ crossinline itemContent: @Composable LazyItemScope.(index: Int, item: T) -> Unit
+) = items(items.size, { index: Int -> itemId(index, items[index]) }) {
+ itemContent(it, items[it])
+}
+
+@OptIn(GlanceInternalApi::class)
+internal abstract class EmittableLazyList : EmittableWithChildren() {
+ override var modifier: Modifier = Modifier
+ public var horizontalAlignment: Alignment.Horizontal = Alignment.Start
+
+ override fun toString() =
+ "EmittableLazyList(modifier=$modifier, children=[\n${childrenToString()}\n])"
+}
+
+@OptIn(GlanceInternalApi::class)
+internal class EmittableLazyListItem : EmittableWithChildren() {
+ override var modifier: Modifier = Modifier
+ var itemId: Long = 0
+
+ override fun toString() =
+ "EmittableLazyListItem(modifier=$modifier, children=[\n${childrenToString()}\n])"
+}
+
+internal class EmittableLazyColumn : EmittableLazyList()
diff --git a/core/core-splashscreen/samples/src/main/res/drawable/foreground.xml b/glance/glance-appwidget/src/androidMain/res/layout/list_item_layout.xml
similarity index 73%
copy from core/core-splashscreen/samples/src/main/res/drawable/foreground.xml
copy to glance/glance-appwidget/src/androidMain/res/layout/list_item_layout.xml
index c46194a..d580dbf 100644
--- a/core/core-splashscreen/samples/src/main/res/drawable/foreground.xml
+++ b/glance/glance-appwidget/src/androidMain/res/layout/list_item_layout.xml
@@ -14,7 +14,8 @@
limitations under the License.
-->
-<inset xmlns:android="http://schemas.android.com/apk/res/android"
- android:drawable="@drawable/android"
- android:inset="25%">
-</inset>
\ No newline at end of file
+<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:id="@id/glanceView"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:orientation="vertical" />
diff --git a/core/core-splashscreen/samples/src/main/res/drawable/foreground.xml b/glance/glance-appwidget/src/androidMain/res/layout/list_layout_1.xml
similarity index 76%
copy from core/core-splashscreen/samples/src/main/res/drawable/foreground.xml
copy to glance/glance-appwidget/src/androidMain/res/layout/list_layout_1.xml
index c46194a..8bc0820 100644
--- a/core/core-splashscreen/samples/src/main/res/drawable/foreground.xml
+++ b/glance/glance-appwidget/src/androidMain/res/layout/list_layout_1.xml
@@ -14,7 +14,7 @@
limitations under the License.
-->
-<inset xmlns:android="http://schemas.android.com/apk/res/android"
- android:drawable="@drawable/android"
- android:inset="25%">
-</inset>
\ No newline at end of file
+<ListView xmlns:android="http://schemas.android.com/apk/res/android"
+ android:id="@id/glanceListView1"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent" />
diff --git a/core/core-splashscreen/samples/src/main/res/drawable/foreground.xml b/glance/glance-appwidget/src/androidMain/res/layout/list_layout_2.xml
similarity index 76%
copy from core/core-splashscreen/samples/src/main/res/drawable/foreground.xml
copy to glance/glance-appwidget/src/androidMain/res/layout/list_layout_2.xml
index c46194a..86afc60 100644
--- a/core/core-splashscreen/samples/src/main/res/drawable/foreground.xml
+++ b/glance/glance-appwidget/src/androidMain/res/layout/list_layout_2.xml
@@ -14,7 +14,7 @@
limitations under the License.
-->
-<inset xmlns:android="http://schemas.android.com/apk/res/android"
- android:drawable="@drawable/android"
- android:inset="25%">
-</inset>
\ No newline at end of file
+<ListView xmlns:android="http://schemas.android.com/apk/res/android"
+ android:id="@id/glanceListView2"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent" />
diff --git a/core/core-splashscreen/samples/src/main/res/drawable/foreground.xml b/glance/glance-appwidget/src/androidMain/res/layout/list_layout_3.xml
similarity index 76%
copy from core/core-splashscreen/samples/src/main/res/drawable/foreground.xml
copy to glance/glance-appwidget/src/androidMain/res/layout/list_layout_3.xml
index c46194a..5446ac9 100644
--- a/core/core-splashscreen/samples/src/main/res/drawable/foreground.xml
+++ b/glance/glance-appwidget/src/androidMain/res/layout/list_layout_3.xml
@@ -14,7 +14,7 @@
limitations under the License.
-->
-<inset xmlns:android="http://schemas.android.com/apk/res/android"
- android:drawable="@drawable/android"
- android:inset="25%">
-</inset>
\ No newline at end of file
+<ListView xmlns:android="http://schemas.android.com/apk/res/android"
+ android:id="@id/glanceListView3"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent" />
diff --git a/glance/glance-appwidget/src/androidMain/res/values/ids.xml b/glance/glance-appwidget/src/androidMain/res/values/ids.xml
index ddee48c..91c9e91 100644
--- a/glance/glance-appwidget/src/androidMain/res/values/ids.xml
+++ b/glance/glance-appwidget/src/androidMain/res/values/ids.xml
@@ -16,4 +16,7 @@
<resources>
<id name="glanceView"/>
-</resources>
\ No newline at end of file
+ <id name="glanceListView1"/>
+ <id name="glanceListView2"/>
+ <id name="glanceListView3"/>
+</resources>
diff --git a/glance/glance-appwidget/src/test/kotlin/androidx/glance/appwidget/RemoteViewsTranslatorKtTest.kt b/glance/glance-appwidget/src/test/kotlin/androidx/glance/appwidget/RemoteViewsTranslatorKtTest.kt
index c23d50f..1dfcb22 100644
--- a/glance/glance-appwidget/src/test/kotlin/androidx/glance/appwidget/RemoteViewsTranslatorKtTest.kt
+++ b/glance/glance-appwidget/src/test/kotlin/androidx/glance/appwidget/RemoteViewsTranslatorKtTest.kt
@@ -30,13 +30,17 @@
import android.util.TypedValue
import android.view.Gravity
import android.view.View
+import android.view.ViewGroup
import android.widget.LinearLayout
+import android.widget.ListView
import android.widget.RelativeLayout
import android.widget.RemoteViews
import android.widget.TextView
import androidx.compose.runtime.Composable
import androidx.glance.GlanceInternalApi
import androidx.glance.Modifier
+import androidx.glance.appwidget.layout.LazyColumn
+import androidx.glance.appwidget.layout.ReservedItemIdRangeEnd
import androidx.glance.layout.Alignment
import androidx.glance.layout.Box
import androidx.glance.layout.Column
@@ -62,7 +66,9 @@
import org.junit.runner.RunWith
import org.robolectric.RobolectricTestRunner
import org.robolectric.annotation.Config
+import java.lang.IllegalArgumentException
import java.util.Locale
+import kotlin.test.assertFailsWith
import kotlin.test.assertIs
@OptIn(GlanceInternalApi::class, ExperimentalCoroutinesApi::class)
@@ -491,7 +497,7 @@
val rv = runAndTranslate {
Text(
"test",
- style = TextStyle(fontWeight = FontWeight.Medium, size = 12.sp),
+ style = TextStyle(fontWeight = FontWeight.Medium, fontSize = 12.sp),
)
}
val view = context.applyRemoteViews(rv)
@@ -587,6 +593,88 @@
}
}
+ @Test
+ fun canTranslateLazyColumn_emptyList() = fakeCoroutineScope.runBlockingTest {
+ val rv = runAndTranslate {
+ LazyColumn { }
+ }
+
+ assertIs<ListView>(context.applyRemoteViews(rv))
+ }
+
+ @Test
+ fun canTranslateLazyColumn_withItem() = fakeCoroutineScope.runBlockingTest {
+ val rv = runAndTranslate {
+ LazyColumn {
+ item { Text("First") }
+ item { Row { Text("Second") } }
+ }
+ }
+
+ assertIs<ListView>(context.applyRemoteViews(rv))
+ }
+
+ @Test
+ fun canTranslateLazyColumn_withMultiChildItem() = fakeCoroutineScope.runBlockingTest {
+ val rv = runAndTranslate {
+ LazyColumn {
+ item {
+ Text("First")
+ Text("Second")
+ }
+ }
+ }
+
+ assertIs<ListView>(context.applyRemoteViews(rv))
+ }
+
+ @Test
+ fun canTranslateLazyColumn_withMaximumUnreservedItemId() = fakeCoroutineScope.runBlockingTest {
+ runAndTranslate {
+ LazyColumn {
+ item(ReservedItemIdRangeEnd + 1) { Text("First") }
+ }
+ }
+ }
+
+ @Test
+ fun cannotTranslateLazyColumn_failsWithReservedItemId() = fakeCoroutineScope.runBlockingTest {
+ assertFailsWith<IllegalArgumentException> {
+ runAndTranslate {
+ LazyColumn {
+ item(ReservedItemIdRangeEnd) { Text("First") }
+ }
+ }
+ }
+ }
+
+ @Test
+ fun canTranslateLazyColumn_maximumLists() = fakeCoroutineScope.runBlockingTest {
+ val rv = runAndTranslate {
+ LazyColumn { }
+ LazyColumn { }
+ LazyColumn { }
+ }
+
+ val rootLayout = assertIs<ViewGroup>(context.applyRemoteViews(rv))
+ assertThat(rootLayout.childCount).isEqualTo(3)
+ assertThat(rootLayout.getChildAt(0).id).isEqualTo(R.id.glanceListView1)
+ assertThat(rootLayout.getChildAt(1).id).isEqualTo(R.id.glanceListView2)
+ assertThat(rootLayout.getChildAt(2).id).isEqualTo(R.id.glanceListView3)
+ }
+
+ @Test
+ fun cannotTranslateLazyColumn_tooManyLists() = fakeCoroutineScope.runBlockingTest {
+ assertFailsWith<IllegalArgumentException> {
+ runAndTranslate {
+ LazyColumn { }
+ LazyColumn { }
+ LazyColumn { }
+ LazyColumn { }
+ }
+ }
+ }
+
// Check there is a single span, that it's of the correct type and passes the [check].
private inline fun <reified T> SpannedString.checkSingleSpan(check: (T) -> Unit) {
val spans = getSpans(0, length, Any::class.java)
@@ -633,4 +721,4 @@
private fun Dp.toPixels() = toPixels(displayMetrics)
private fun Sp.toPixels() =
TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_SP, value, displayMetrics).toInt()
-}
\ No newline at end of file
+}
diff --git a/glance/glance-appwidget/src/test/kotlin/androidx/glance/appwidget/layout/LazyColumnTest.kt b/glance/glance-appwidget/src/test/kotlin/androidx/glance/appwidget/layout/LazyColumnTest.kt
new file mode 100644
index 0000000..e511555
--- /dev/null
+++ b/glance/glance-appwidget/src/test/kotlin/androidx/glance/appwidget/layout/LazyColumnTest.kt
@@ -0,0 +1,255 @@
+/*
+ * Copyright 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES 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.glance.appwidget.layout
+
+import androidx.glance.GlanceInternalApi
+import androidx.glance.appwidget.runTestingComposition
+import androidx.glance.layout.EmittableRow
+import androidx.glance.layout.EmittableText
+import androidx.glance.layout.Row
+import androidx.glance.layout.Text
+import com.google.common.truth.Truth.assertThat
+import kotlinx.coroutines.ExperimentalCoroutinesApi
+import kotlinx.coroutines.test.TestCoroutineScope
+import kotlinx.coroutines.test.runBlockingTest
+import org.junit.Before
+import org.junit.Test
+import kotlin.test.assertIs
+
+@OptIn(GlanceInternalApi::class, ExperimentalCoroutinesApi::class)
+class LazyColumnTest {
+ private lateinit var fakeCoroutineScope: TestCoroutineScope
+
+ @Before
+ fun setUp() {
+ fakeCoroutineScope = TestCoroutineScope()
+ }
+
+ @Test
+ fun emptyLazyColumn_addsLazyColumnToTree() = fakeCoroutineScope.runBlockingTest {
+ val root = runTestingComposition {
+ LazyColumn { }
+ }
+
+ val column = assertIs<EmittableLazyColumn>(root.children.single())
+ assertThat(column.children).isEmpty()
+ }
+
+ @Test
+ fun items_createsListItemsEachWithChild() = fakeCoroutineScope.runBlockingTest {
+ val root = runTestingComposition {
+ LazyColumn {
+ items(2, { it * 2L }) { index -> Text("Item $index") }
+ item(4L) { Text("Item 2") }
+ item(6L) { Text("Item 3") }
+ }
+ }
+
+ val column = assertIs<EmittableLazyColumn>(root.children.single())
+ val listItems = assertAre<EmittableLazyListItem>(column.children)
+ assertThat(listItems).hasSize(4)
+ assertThat(column.getTextAtChild(0)).isEqualTo("Item 0")
+ assertThat(column.getTextAtChild(1)).isEqualTo("Item 1")
+ assertThat(column.getTextAtChild(2)).isEqualTo("Item 2")
+ assertThat(column.getTextAtChild(3)).isEqualTo("Item 3")
+ }
+
+ @Test
+ fun item_multipleChildren_createsListItemWithChildren() = fakeCoroutineScope.runBlockingTest {
+ val root = runTestingComposition {
+ LazyColumn {
+ item {
+ Text("First")
+ Row { Text("Second") }
+ }
+ }
+ }
+
+ val column = assertIs<EmittableLazyColumn>(root.children.single())
+ val listItem = assertIs<EmittableLazyListItem>(column.children.single())
+ assertThat(listItem.children).hasSize(2)
+ assertIs<EmittableText>(listItem.children[0])
+ assertIs<EmittableRow>(listItem.children[1])
+ }
+
+ @Test
+ fun items_withItemId_addsChildrenWithIds() = fakeCoroutineScope.runBlockingTest {
+ val root = runTestingComposition {
+ LazyColumn {
+ items(2, { it * 2L }) { index -> Text("Item $index") }
+ item(4L) { Text("Item 2") }
+ item(6L) { Text("Item 3") }
+ }
+ }
+
+ val column = assertIs<EmittableLazyColumn>(root.children.single())
+ val listItems = assertAre<EmittableLazyListItem>(column.children)
+ assertThat(listItems[0].itemId).isEqualTo(0L)
+ assertThat(listItems[1].itemId).isEqualTo(2L)
+ assertThat(listItems[2].itemId).isEqualTo(4L)
+ assertThat(listItems[3].itemId).isEqualTo(6L)
+ }
+
+ @Test
+ fun items_withoutItemId_addsItemsWithConsecutiveReservedIds() =
+ fakeCoroutineScope.runBlockingTest {
+ val root = runTestingComposition {
+ LazyColumn {
+ items(2) { index -> Text("Item $index") }
+ item { Text("Item 2") }
+ }
+ }
+
+ val column = assertIs<EmittableLazyColumn>(root.children.single())
+ val listItems = assertAre<EmittableLazyListItem>(column.children)
+ assertThat(listItems[0].itemId).isEqualTo(ReservedItemIdRangeEnd)
+ assertThat(listItems[1].itemId).isEqualTo(ReservedItemIdRangeEnd - 1)
+ assertThat(listItems[2].itemId).isEqualTo(ReservedItemIdRangeEnd - 2)
+ }
+
+ @Test
+ fun items_someWithItemIds_addsChildrenWithIds() = fakeCoroutineScope.runBlockingTest {
+ val root = runTestingComposition {
+ LazyColumn {
+ items(1, { 5L }) { Text("Item 0") }
+ item { Text("Item 1") }
+ items(1) { Text("Item 2") }
+ item(6L) { Text("Item 3") }
+ }
+ }
+
+ val column = assertIs<EmittableLazyColumn>(root.children.single())
+ val listItems = assertAre<EmittableLazyListItem>(column.children)
+ assertThat(listItems[0].itemId).isEqualTo(5L)
+ assertThat(listItems[1].itemId).isEqualTo(ReservedItemIdRangeEnd)
+ assertThat(listItems[2].itemId).isEqualTo(ReservedItemIdRangeEnd - 1)
+ assertThat(listItems[3].itemId).isEqualTo(6L)
+ }
+
+ @Test
+ fun items_listItemsWithoutItemIds_addsChildren() = fakeCoroutineScope.runBlockingTest {
+ val root = runTestingComposition {
+ LazyColumn {
+ items(people) { person ->
+ Text(person.name)
+ }
+ }
+ }
+
+ val column = assertIs<EmittableLazyColumn>(root.children.single())
+ val listItems = assertAre<EmittableLazyListItem>(column.children)
+ assertThat(listItems[0].itemId).isEqualTo(ReservedItemIdRangeEnd)
+ assertThat(listItems[1].itemId).isEqualTo(ReservedItemIdRangeEnd - 1)
+ assertThat(column.getTextAtChild(0)).isEqualTo("Alice")
+ assertThat(column.getTextAtChild(1)).isEqualTo("Bob")
+ }
+
+ @Test
+ fun items_listItemsWithItemIds_addsChildren() = fakeCoroutineScope.runBlockingTest {
+ val root = runTestingComposition {
+ LazyColumn {
+ items(people, itemId = { person -> person.userId }) { person ->
+ Text(person.name)
+ }
+ }
+ }
+
+ val column = assertIs<EmittableLazyColumn>(root.children.single())
+ val listItems = assertAre<EmittableLazyListItem>(column.children)
+ assertThat(listItems[0].itemId).isEqualTo(101)
+ assertThat(listItems[1].itemId).isEqualTo(202)
+ assertThat(column.getTextAtChild(0)).isEqualTo("Alice")
+ assertThat(column.getTextAtChild(1)).isEqualTo("Bob")
+ }
+
+ @Test
+ fun itemsIndexed_listItems_addsChildren() = fakeCoroutineScope.runBlockingTest {
+ val root = runTestingComposition {
+ LazyColumn {
+ itemsIndexed(people) { index, person ->
+ Text("${index + 1} - ${person.name}")
+ }
+ }
+ }
+
+ val column = assertIs<EmittableLazyColumn>(root.children.single())
+ assertThat(column.getTextAtChild(0)).isEqualTo("1 - Alice")
+ assertThat(column.getTextAtChild(1)).isEqualTo("2 - Bob")
+ }
+
+ @Test
+ fun items_arrayItemsWithoutItemIds_addsChildren() = fakeCoroutineScope.runBlockingTest {
+ val root = runTestingComposition {
+ LazyColumn {
+ items(people.toTypedArray()) { person ->
+ Text(person.name)
+ }
+ }
+ }
+
+ val column = assertIs<EmittableLazyColumn>(root.children.single())
+ val listItems = assertAre<EmittableLazyListItem>(column.children)
+ assertThat(listItems[0].itemId).isEqualTo(ReservedItemIdRangeEnd)
+ assertThat(listItems[1].itemId).isEqualTo(ReservedItemIdRangeEnd - 1)
+ assertThat(column.getTextAtChild(0)).isEqualTo("Alice")
+ assertThat(column.getTextAtChild(1)).isEqualTo("Bob")
+ }
+
+ @Test
+ fun items_arrayItemsWithItemIds_addsChildren() = fakeCoroutineScope.runBlockingTest {
+ val root = runTestingComposition {
+ LazyColumn {
+ items(people.toTypedArray(), itemId = { person -> person.userId }) { person ->
+ Text(person.name)
+ }
+ }
+ }
+
+ val column = assertIs<EmittableLazyColumn>(root.children.single())
+ val listItems = assertAre<EmittableLazyListItem>(column.children)
+ assertThat(listItems[0].itemId).isEqualTo(101)
+ assertThat(listItems[1].itemId).isEqualTo(202)
+ assertThat(column.getTextAtChild(0)).isEqualTo("Alice")
+ assertThat(column.getTextAtChild(1)).isEqualTo("Bob")
+ }
+
+ @Test
+ fun itemsIndexed_arrayItems_addsChildren() = fakeCoroutineScope.runBlockingTest {
+ val root = runTestingComposition {
+ LazyColumn {
+ itemsIndexed(people.toTypedArray()) { index, person ->
+ Text("${index + 1} - ${person.name}")
+ }
+ }
+ }
+
+ val column = assertIs<EmittableLazyColumn>(root.children.single())
+ assertThat(column.getTextAtChild(0)).isEqualTo("1 - Alice")
+ assertThat(column.getTextAtChild(1)).isEqualTo("2 - Bob")
+ }
+
+ private fun EmittableLazyColumn.getTextAtChild(index: Int): String =
+ assertIs<EmittableText>((children[index] as EmittableLazyListItem).children.first()).text
+
+ private companion object {
+ data class Person(val name: String, val userId: Long)
+ val people = listOf(Person("Alice", userId = 101), Person("Bob", userId = 202))
+ }
+}
+
+private inline fun <reified T> assertAre(items: Iterable<Any>) =
+ items.map { assertIs<T>(it) }.toList()
diff --git a/glance/glance-wear/api/api_lint.ignore b/glance/glance-wear/api/api_lint.ignore
new file mode 100644
index 0000000..49ff21e
--- /dev/null
+++ b/glance/glance-wear/api/api_lint.ignore
@@ -0,0 +1,5 @@
+// Baseline format: 1.0
+AsyncSuffixFuture: androidx.glance.wear.GlanceTileService#onResourcesRequest(androidx.wear.tiles.RequestBuilders.ResourcesRequest):
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
+AsyncSuffixFuture: androidx.glance.wear.GlanceTileService#onTileRequest(androidx.wear.tiles.RequestBuilders.TileRequest):
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
diff --git a/glance/glance-wear/api/current.txt b/glance/glance-wear/api/current.txt
index a371ff1..77dea36 100644
--- a/glance/glance-wear/api/current.txt
+++ b/glance/glance-wear/api/current.txt
@@ -34,12 +34,22 @@
}
public final class CurvedRowKt {
- method @androidx.compose.runtime.Composable public static void CurvedRow(optional androidx.glance.Modifier modifier, optional float anchor, optional int anchorType, optional int radialAlignment, kotlin.jvm.functions.Function1<? super androidx.glance.wear.layout.CurvedRowScope,kotlin.Unit> content);
+ method @androidx.compose.runtime.Composable public static void CurvedRow(optional androidx.glance.Modifier modifier, optional float anchorDegrees, optional int anchorType, optional int radialAlignment, kotlin.jvm.functions.Function1<? super androidx.glance.wear.layout.CurvedRowScope,kotlin.Unit> content);
}
public final class CurvedRowScope {
ctor public CurvedRowScope();
- method @androidx.compose.runtime.Composable public void CurvedText(String text, optional androidx.glance.Modifier modifier, optional androidx.glance.layout.TextStyle? textStyle);
+ method @androidx.compose.runtime.Composable public void CurvedText(String text, optional androidx.glance.Modifier modifier, optional androidx.glance.wear.layout.CurvedTextStyle? textStyle);
+ }
+
+ @androidx.compose.runtime.Immutable public final class CurvedTextStyle {
+ ctor public CurvedTextStyle(optional androidx.glance.unit.Sp? fontSize, optional androidx.glance.layout.FontWeight? fontWeight, optional androidx.glance.layout.FontStyle? fontStyle);
+ method public androidx.glance.unit.Sp? getFontSize();
+ method public androidx.glance.layout.FontStyle? getFontStyle();
+ method public androidx.glance.layout.FontWeight? getFontWeight();
+ property public final androidx.glance.unit.Sp? fontSize;
+ property public final androidx.glance.layout.FontStyle? fontStyle;
+ property public final androidx.glance.layout.FontWeight? fontWeight;
}
public final inline class RadialAlignment {
diff --git a/glance/glance-wear/api/public_plus_experimental_current.txt b/glance/glance-wear/api/public_plus_experimental_current.txt
index a371ff1..77dea36 100644
--- a/glance/glance-wear/api/public_plus_experimental_current.txt
+++ b/glance/glance-wear/api/public_plus_experimental_current.txt
@@ -34,12 +34,22 @@
}
public final class CurvedRowKt {
- method @androidx.compose.runtime.Composable public static void CurvedRow(optional androidx.glance.Modifier modifier, optional float anchor, optional int anchorType, optional int radialAlignment, kotlin.jvm.functions.Function1<? super androidx.glance.wear.layout.CurvedRowScope,kotlin.Unit> content);
+ method @androidx.compose.runtime.Composable public static void CurvedRow(optional androidx.glance.Modifier modifier, optional float anchorDegrees, optional int anchorType, optional int radialAlignment, kotlin.jvm.functions.Function1<? super androidx.glance.wear.layout.CurvedRowScope,kotlin.Unit> content);
}
public final class CurvedRowScope {
ctor public CurvedRowScope();
- method @androidx.compose.runtime.Composable public void CurvedText(String text, optional androidx.glance.Modifier modifier, optional androidx.glance.layout.TextStyle? textStyle);
+ method @androidx.compose.runtime.Composable public void CurvedText(String text, optional androidx.glance.Modifier modifier, optional androidx.glance.wear.layout.CurvedTextStyle? textStyle);
+ }
+
+ @androidx.compose.runtime.Immutable public final class CurvedTextStyle {
+ ctor public CurvedTextStyle(optional androidx.glance.unit.Sp? fontSize, optional androidx.glance.layout.FontWeight? fontWeight, optional androidx.glance.layout.FontStyle? fontStyle);
+ method public androidx.glance.unit.Sp? getFontSize();
+ method public androidx.glance.layout.FontStyle? getFontStyle();
+ method public androidx.glance.layout.FontWeight? getFontWeight();
+ property public final androidx.glance.unit.Sp? fontSize;
+ property public final androidx.glance.layout.FontStyle? fontStyle;
+ property public final androidx.glance.layout.FontWeight? fontWeight;
}
public final inline class RadialAlignment {
diff --git a/glance/glance-wear/api/restricted_current.txt b/glance/glance-wear/api/restricted_current.txt
index a371ff1..77dea36 100644
--- a/glance/glance-wear/api/restricted_current.txt
+++ b/glance/glance-wear/api/restricted_current.txt
@@ -34,12 +34,22 @@
}
public final class CurvedRowKt {
- method @androidx.compose.runtime.Composable public static void CurvedRow(optional androidx.glance.Modifier modifier, optional float anchor, optional int anchorType, optional int radialAlignment, kotlin.jvm.functions.Function1<? super androidx.glance.wear.layout.CurvedRowScope,kotlin.Unit> content);
+ method @androidx.compose.runtime.Composable public static void CurvedRow(optional androidx.glance.Modifier modifier, optional float anchorDegrees, optional int anchorType, optional int radialAlignment, kotlin.jvm.functions.Function1<? super androidx.glance.wear.layout.CurvedRowScope,kotlin.Unit> content);
}
public final class CurvedRowScope {
ctor public CurvedRowScope();
- method @androidx.compose.runtime.Composable public void CurvedText(String text, optional androidx.glance.Modifier modifier, optional androidx.glance.layout.TextStyle? textStyle);
+ method @androidx.compose.runtime.Composable public void CurvedText(String text, optional androidx.glance.Modifier modifier, optional androidx.glance.wear.layout.CurvedTextStyle? textStyle);
+ }
+
+ @androidx.compose.runtime.Immutable public final class CurvedTextStyle {
+ ctor public CurvedTextStyle(optional androidx.glance.unit.Sp? fontSize, optional androidx.glance.layout.FontWeight? fontWeight, optional androidx.glance.layout.FontStyle? fontStyle);
+ method public androidx.glance.unit.Sp? getFontSize();
+ method public androidx.glance.layout.FontStyle? getFontStyle();
+ method public androidx.glance.layout.FontWeight? getFontWeight();
+ property public final androidx.glance.unit.Sp? fontSize;
+ property public final androidx.glance.layout.FontStyle? fontStyle;
+ property public final androidx.glance.layout.FontWeight? fontWeight;
}
public final inline class RadialAlignment {
diff --git a/glance/glance-wear/build.gradle b/glance/glance-wear/build.gradle
index ba4ea33..dbb2474 100644
--- a/glance/glance-wear/build.gradle
+++ b/glance/glance-wear/build.gradle
@@ -60,6 +60,14 @@
androidTestImplementation(libs.testRunner)
androidTestImplementation(libs.testRules)
androidTestImplementation(libs.kotlinCoroutinesTest)
+
+ // I'm not 100% sure why, but androidTestImplementation doesn't appear to use the standard
+ // results of a project build. This leads to it not using the shadow configuration from
+ // tiles-proto, and thus failing to find the protobuf classes at runtime.
+ //
+ // This line forces the androidTest to use the properly shaded proto library on the runtime
+ // classpath.
+ androidTestRuntimeOnly(project(path: ":wear:tiles:tiles-proto", configuration: "shadow"))
}
android {
diff --git a/glance/glance-wear/src/androidAndroidTest/kotlin/androidx/glance/wear/ScreenshotTests.kt b/glance/glance-wear/src/androidAndroidTest/kotlin/androidx/glance/wear/ScreenshotTests.kt
index 41c9c3a..c9bac96 100644
--- a/glance/glance-wear/src/androidAndroidTest/kotlin/androidx/glance/wear/ScreenshotTests.kt
+++ b/glance/glance-wear/src/androidAndroidTest/kotlin/androidx/glance/wear/ScreenshotTests.kt
@@ -47,6 +47,7 @@
import androidx.glance.unit.sp
import androidx.glance.wear.layout.AnchorType
import androidx.glance.wear.layout.CurvedRow
+import androidx.glance.wear.layout.CurvedTextStyle
import androidx.glance.wear.layout.RadialAlignment
import androidx.glance.wear.layout.background
import androidx.test.core.app.ApplicationProvider.getApplicationContext
@@ -127,11 +128,11 @@
CurvedRow(
modifier = Modifier.background(Color.Blue),
radialAlignment = RadialAlignment.Center,
- anchor = -90f,
+ anchorDegrees = -90f,
anchorType = AnchorType.Center
) {
CurvedText(text = "Hello World")
- CurvedText(text = "This is a test!", textStyle = TextStyle(size = 24.sp))
+ CurvedText(text = "This is a test!", textStyle = CurvedTextStyle(fontSize = 24.sp))
}
}
diff --git a/glance/glance-wear/src/androidMain/kotlin/androidx/glance/wear/GlanceTileService.kt b/glance/glance-wear/src/androidMain/kotlin/androidx/glance/wear/GlanceTileService.kt
index 7cf9605..e5c0a38 100644
--- a/glance/glance-wear/src/androidMain/kotlin/androidx/glance/wear/GlanceTileService.kt
+++ b/glance/glance-wear/src/androidMain/kotlin/androidx/glance/wear/GlanceTileService.kt
@@ -118,6 +118,12 @@
@Composable
public abstract fun Content()
+ /**
+ * Called by the system to fetch a tile from this [GlanceTileService].
+ *
+ * Note that this call exists due to this class extending [TileService]; this should not be
+ * called directly.
+ */
final override fun onTileRequest(
requestParams: RequestBuilders.TileRequest
): ListenableFuture<TileBuilders.Tile> = coroutineScope.future {
@@ -138,6 +144,12 @@
).build()
}
+ /**
+ * Called by the system to fetch a resources bundle from this [GlanceTileService].
+ *
+ * Note that this call exists due to this class extending [TileService]; this should not be
+ * called directly.
+ */
final override fun onResourcesRequest(
requestParams: RequestBuilders.ResourcesRequest
): ListenableFuture<ResourceBuilders.Resources> = coroutineScope.future {
diff --git a/glance/glance-wear/src/androidMain/kotlin/androidx/glance/wear/WearCompositionTranslator.kt b/glance/glance-wear/src/androidMain/kotlin/androidx/glance/wear/WearCompositionTranslator.kt
index a66d987..479c8f8 100644
--- a/glance/glance-wear/src/androidMain/kotlin/androidx/glance/wear/WearCompositionTranslator.kt
+++ b/glance/glance-wear/src/androidMain/kotlin/androidx/glance/wear/WearCompositionTranslator.kt
@@ -36,6 +36,7 @@
import androidx.glance.layout.WidthModifier
import androidx.glance.wear.layout.AnchorType
import androidx.glance.wear.layout.BackgroundModifier
+import androidx.glance.wear.layout.CurvedTextStyle
import androidx.glance.wear.layout.EmittableCurvedRow
import androidx.glance.wear.layout.EmittableCurvedText
import androidx.glance.wear.layout.RadialAlignment
@@ -199,7 +200,7 @@
private fun translateTextStyle(style: TextStyle): LayoutElementBuilders.FontStyle {
val fontStyleBuilder = LayoutElementBuilders.FontStyle.Builder()
- style.size?.let { fontStyleBuilder.setSize(sp(it.value)) }
+ style.fontSize?.let { fontStyleBuilder.setSize(sp(it.value)) }
style.fontStyle?.let { fontStyleBuilder.setItalic(it == FontStyle.Italic) }
style.fontWeight?.let {
fontStyleBuilder.setWeight(
@@ -218,6 +219,25 @@
return fontStyleBuilder.build()
}
+private fun translateTextStyle(style: CurvedTextStyle): LayoutElementBuilders.FontStyle {
+ val fontStyleBuilder = LayoutElementBuilders.FontStyle.Builder()
+
+ style.fontSize?.let { fontStyleBuilder.setSize(sp(it.value)) }
+ style.fontStyle?.let { fontStyleBuilder.setItalic(it == FontStyle.Italic) }
+ style.fontWeight?.let {
+ fontStyleBuilder.setWeight(
+ when (it) {
+ FontWeight.Normal -> FONT_WEIGHT_NORMAL
+ FontWeight.Medium -> FONT_WEIGHT_MEDIUM
+ FontWeight.Bold -> FONT_WEIGHT_BOLD
+ else -> throw IllegalArgumentException("Unknown font weight $it")
+ }
+ )
+ }
+
+ return fontStyleBuilder.build()
+}
+
private fun translateEmittableText(element: EmittableText): LayoutElementBuilders.LayoutElement {
// Does it have a width or height set? If so, we need to wrap it in a Box.
val width = element.modifier.getWidth()
@@ -250,7 +270,7 @@
// Note: Wear Tiles uses 0 degrees = 12 o clock, but Glance / Wear Compose use 0 degrees = 3
// o clock. Tiles supports wraparound etc though, so just add on the 90 degrees here.
val arcBuilder = LayoutElementBuilders.Arc.Builder()
- .setAnchorAngle(degrees(element.anchor + 90f))
+ .setAnchorAngle(degrees(element.anchorDegrees + 90f))
.setAnchorType(element.anchorType.toProto())
.setVerticalAlign(element.radialAlignment.toProto())
diff --git a/glance/glance-wear/src/androidMain/kotlin/androidx/glance/wear/layout/CurvedRow.kt b/glance/glance-wear/src/androidMain/kotlin/androidx/glance/wear/layout/CurvedRow.kt
index 2407386..43d6c04 100644
--- a/glance/glance-wear/src/androidMain/kotlin/androidx/glance/wear/layout/CurvedRow.kt
+++ b/glance/glance-wear/src/androidMain/kotlin/androidx/glance/wear/layout/CurvedRow.kt
@@ -19,12 +19,16 @@
import androidx.compose.runtime.Composable
import androidx.compose.runtime.ComposeNode
+import androidx.compose.runtime.Immutable
import androidx.glance.Applier
import androidx.glance.Emittable
import androidx.glance.EmittableWithChildren
import androidx.glance.GlanceInternalApi
import androidx.glance.Modifier
+import androidx.glance.layout.FontStyle
+import androidx.glance.layout.FontWeight
import androidx.glance.layout.TextStyle
+import androidx.glance.unit.Sp
/**
* The alignment of a [CurvedRow]'s elements, with respect to its anchor angle. This specifies how
@@ -101,7 +105,7 @@
internal class EmittableCurvedRow : EmittableWithChildren() {
override var modifier: Modifier = Modifier
- var anchor: Float = 270f
+ var anchorDegrees: Float = 270f
var anchorType: AnchorType = AnchorType.Center
var radialAlignment: RadialAlignment = RadialAlignment.Center
}
@@ -109,12 +113,12 @@
internal class EmittableCurvedText : Emittable {
override var modifier: Modifier = Modifier
var text: String = ""
- var textStyle: TextStyle? = null
+ var textStyle: CurvedTextStyle? = null
}
/**
* A curved container. This container will fill itself to a circle, which fits inside its parent
- * container, and all of its children will be placed on that circle. The parameters [anchor]
+ * container, and all of its children will be placed on that circle. The parameters [anchorDegrees]
* and [anchorType] can be used to specify where to draw children within this circle. Each
* child will then be placed, one after the other, clockwise around the circle.
*
@@ -123,12 +127,12 @@
* CurvedRow. Any other element will be drawn normally, at a tangent to the circle.
*
* @param modifier Modifiers for this container.
- * @param anchor The angle for the anchor in degrees, used with [anchorType] to determine
+ * @param anchorDegrees The angle for the anchor in degrees, used with [anchorType] to determine
* where to draw children. Note that 0 degrees is the 3 o'clock position on a device, and the
* angle sweeps clockwise. Values do not have to be clamped to the range 0-360; values less
* than 0 degrees will sweep anti-clockwise (i.e. -90 degrees is equivalent to 270 degrees),
* and values >360 will be be placed at X mod 360 degrees.
- * @param anchorType Alignment of the contents of this container relative to [anchor].
+ * @param anchorType Alignment of the contents of this container relative to [anchorDegrees].
* @param radialAlignment specifies where to lay down children that are thinner than the
* CurvedRow, either closer to the center (INNER), apart from the center (OUTER) or in the middle
* point (CENTER).
@@ -137,7 +141,7 @@
@Composable
public fun CurvedRow(
modifier: Modifier = Modifier,
- anchor: Float = 270f,
+ anchorDegrees: Float = 270f,
anchorType: AnchorType = AnchorType.Center,
radialAlignment: RadialAlignment = RadialAlignment.Center,
content: @Composable CurvedRowScope.() -> Unit
@@ -146,7 +150,7 @@
factory = ::EmittableCurvedRow,
update = {
this.set(modifier) { this.modifier = it }
- this.set(anchor) { this.anchor = it }
+ this.set(anchorDegrees) { this.anchorDegrees = it }
this.set(anchorType) { this.anchorType = it }
this.set(radialAlignment) { this.radialAlignment = it }
},
@@ -154,6 +158,39 @@
)
}
+/**
+ * Description of a text style for the [CurvedRowScope.CurvedText] composable.
+ */
+@Immutable
+public class CurvedTextStyle(
+ public val fontSize: Sp? = null,
+ public val fontWeight: FontWeight? = null,
+ public val fontStyle: FontStyle? = null
+) {
+ override fun equals(other: Any?): Boolean {
+ if (this === other) return true
+ if (javaClass != other?.javaClass) return false
+
+ other as TextStyle
+
+ if (fontSize != other.fontSize) return false
+ if (fontWeight != other.fontWeight) return false
+ if (fontStyle != other.fontStyle) return false
+
+ return true
+ }
+
+ override fun hashCode(): Int {
+ var result = fontSize.hashCode()
+ result = 31 * result + fontWeight.hashCode()
+ result = 31 * result + fontStyle.hashCode()
+ return result
+ }
+
+ override fun toString() =
+ "TextStyle(size=$fontSize, fontWeight=$fontWeight, fontStyle=$fontStyle)"
+}
+
/** A scope for elements which can only be contained within a [CurvedRow]. */
class CurvedRowScope {
/**
@@ -167,7 +204,7 @@
public fun CurvedText(
text: String,
modifier: Modifier = Modifier,
- textStyle: TextStyle? = null
+ textStyle: CurvedTextStyle? = null
) {
ComposeNode<EmittableCurvedText, Applier>(
factory = ::EmittableCurvedText,
diff --git a/glance/glance-wear/src/test/kotlin/androidx/glance/wear/WearCompositionTranslatorTest.kt b/glance/glance-wear/src/test/kotlin/androidx/glance/wear/WearCompositionTranslatorTest.kt
index 5c40dad..2ee6f2c 100644
--- a/glance/glance-wear/src/test/kotlin/androidx/glance/wear/WearCompositionTranslatorTest.kt
+++ b/glance/glance-wear/src/test/kotlin/androidx/glance/wear/WearCompositionTranslatorTest.kt
@@ -39,6 +39,7 @@
import androidx.glance.unit.sp
import androidx.glance.wear.layout.AnchorType
import androidx.glance.wear.layout.CurvedRow
+import androidx.glance.wear.layout.CurvedTextStyle
import androidx.glance.wear.layout.RadialAlignment
import androidx.glance.wear.layout.background
import androidx.wear.tiles.DimensionBuilders
@@ -270,7 +271,7 @@
fun canInflateText() = fakeCoroutineScope.runBlockingTest {
val content = runAndTranslate {
val style = TextStyle(
- size = 16.sp,
+ fontSize = 16.sp,
fontWeight = FontWeight.Bold,
fontStyle = FontStyle.Italic,
textDecoration = TextDecoration.Underline
@@ -314,7 +315,7 @@
fun canTranslateCurvedRow() = fakeCoroutineScope.runBlockingTest {
val content = runAndTranslate {
CurvedRow(
- anchor = 20f,
+ anchorDegrees = 20f,
radialAlignment = RadialAlignment.Inner,
anchorType = AnchorType.End,
modifier = Modifier.padding(20.dp)
@@ -335,7 +336,7 @@
fun curvedRowWithSizeInflatesInBox() = fakeCoroutineScope.runBlockingTest {
val content = runAndTranslate {
CurvedRow(
- anchor = 20f,
+ anchorDegrees = 20f,
radialAlignment = RadialAlignment.Inner,
anchorType = AnchorType.End,
modifier = Modifier.padding(20.dp).size(10.dp)
@@ -361,8 +362,8 @@
@Test
fun canTranslateCurvedText() = fakeCoroutineScope.runBlockingTest {
val content = runAndTranslate {
- val style = TextStyle(
- size = 16.sp,
+ val style = CurvedTextStyle(
+ fontSize = 16.sp,
fontWeight = FontWeight.Bold,
fontStyle = FontStyle.Italic,
)
diff --git a/glance/glance-wear/src/test/kotlin/androidx/glance/wear/layout/CurvedRowTest.kt b/glance/glance-wear/src/test/kotlin/androidx/glance/wear/layout/CurvedRowTest.kt
index 7f0c5e6..0cf7f19 100644
--- a/glance/glance-wear/src/test/kotlin/androidx/glance/wear/layout/CurvedRowTest.kt
+++ b/glance/glance-wear/src/test/kotlin/androidx/glance/wear/layout/CurvedRowTest.kt
@@ -20,10 +20,9 @@
import androidx.glance.Modifier
import androidx.glance.findModifier
import androidx.glance.layout.PaddingModifier
-import androidx.glance.layout.TextDecoration
-import androidx.glance.layout.TextStyle
import androidx.glance.layout.padding
import androidx.glance.unit.dp
+import androidx.glance.unit.sp
import androidx.glance.wear.runTestingComposition
import com.google.common.truth.Truth.assertThat
import kotlinx.coroutines.ExperimentalCoroutinesApi
@@ -46,7 +45,7 @@
val root = runTestingComposition {
CurvedRow(
modifier = Modifier.padding(1.dp),
- anchor = 5f,
+ anchorDegrees = 5f,
anchorType = AnchorType.End,
radialAlignment = RadialAlignment.Center
) {}
@@ -56,7 +55,7 @@
val arc = root.children[0] as EmittableCurvedRow
assertThat(arc.children).hasSize(0)
- assertThat(arc.anchor).isEqualTo(5f)
+ assertThat(arc.anchorDegrees).isEqualTo(5f)
assertThat(arc.anchorType).isEqualTo(AnchorType.End)
assertThat(arc.radialAlignment).isEqualTo(RadialAlignment.Center)
assertThat(arc.modifier.findModifier<PaddingModifier>()).isNotNull()
@@ -69,7 +68,7 @@
CurvedText(
text = "Hello World",
modifier = Modifier.padding(5.dp),
- textStyle = TextStyle(textDecoration = TextDecoration.Underline)
+ textStyle = CurvedTextStyle(fontSize = 24.sp)
)
}
}
@@ -80,6 +79,6 @@
assertThat(arcText.text).isEqualTo("Hello World")
assertThat(arcText.modifier.findModifier<PaddingModifier>()).isNotNull()
assertThat(arcText.textStyle).isNotNull()
- assertThat(arcText.textStyle!!.textDecoration).isEqualTo(TextDecoration.Underline)
+ assertThat(arcText.textStyle!!.fontSize).isEqualTo(24.sp)
}
}
diff --git a/glance/glance/api/current.txt b/glance/glance/api/current.txt
index 189768c..f303ec2 100644
--- a/glance/glance/api/current.txt
+++ b/glance/glance/api/current.txt
@@ -204,14 +204,14 @@
}
@androidx.compose.runtime.Immutable public final class TextStyle {
- ctor public TextStyle(optional androidx.glance.unit.Sp? size, optional androidx.glance.layout.FontWeight? fontWeight, optional androidx.glance.layout.FontStyle? fontStyle, optional androidx.glance.layout.TextDecoration? textDecoration);
+ ctor public TextStyle(optional androidx.glance.unit.Sp? fontSize, optional androidx.glance.layout.FontWeight? fontWeight, optional androidx.glance.layout.FontStyle? fontStyle, optional androidx.glance.layout.TextDecoration? textDecoration);
+ method public androidx.glance.unit.Sp? getFontSize();
method public androidx.glance.layout.FontStyle? getFontStyle();
method public androidx.glance.layout.FontWeight? getFontWeight();
- method public androidx.glance.unit.Sp? getSize();
method public androidx.glance.layout.TextDecoration? getTextDecoration();
+ property public final androidx.glance.unit.Sp? fontSize;
property public final androidx.glance.layout.FontStyle? fontStyle;
property public final androidx.glance.layout.FontWeight? fontWeight;
- property public final androidx.glance.unit.Sp? size;
property public final androidx.glance.layout.TextDecoration? textDecoration;
}
diff --git a/glance/glance/api/public_plus_experimental_current.txt b/glance/glance/api/public_plus_experimental_current.txt
index ac80b4a..cc036c9 100644
--- a/glance/glance/api/public_plus_experimental_current.txt
+++ b/glance/glance/api/public_plus_experimental_current.txt
@@ -328,14 +328,14 @@
}
@androidx.compose.runtime.Immutable public final class TextStyle {
- ctor public TextStyle(optional androidx.glance.unit.Sp? size, optional androidx.glance.layout.FontWeight? fontWeight, optional androidx.glance.layout.FontStyle? fontStyle, optional androidx.glance.layout.TextDecoration? textDecoration);
+ ctor public TextStyle(optional androidx.glance.unit.Sp? fontSize, optional androidx.glance.layout.FontWeight? fontWeight, optional androidx.glance.layout.FontStyle? fontStyle, optional androidx.glance.layout.TextDecoration? textDecoration);
+ method public androidx.glance.unit.Sp? getFontSize();
method public androidx.glance.layout.FontStyle? getFontStyle();
method public androidx.glance.layout.FontWeight? getFontWeight();
- method public androidx.glance.unit.Sp? getSize();
method public androidx.glance.layout.TextDecoration? getTextDecoration();
+ property public final androidx.glance.unit.Sp? fontSize;
property public final androidx.glance.layout.FontStyle? fontStyle;
property public final androidx.glance.layout.FontWeight? fontWeight;
- property public final androidx.glance.unit.Sp? size;
property public final androidx.glance.layout.TextDecoration? textDecoration;
}
diff --git a/glance/glance/api/restricted_current.txt b/glance/glance/api/restricted_current.txt
index 189768c..f303ec2 100644
--- a/glance/glance/api/restricted_current.txt
+++ b/glance/glance/api/restricted_current.txt
@@ -204,14 +204,14 @@
}
@androidx.compose.runtime.Immutable public final class TextStyle {
- ctor public TextStyle(optional androidx.glance.unit.Sp? size, optional androidx.glance.layout.FontWeight? fontWeight, optional androidx.glance.layout.FontStyle? fontStyle, optional androidx.glance.layout.TextDecoration? textDecoration);
+ ctor public TextStyle(optional androidx.glance.unit.Sp? fontSize, optional androidx.glance.layout.FontWeight? fontWeight, optional androidx.glance.layout.FontStyle? fontStyle, optional androidx.glance.layout.TextDecoration? textDecoration);
+ method public androidx.glance.unit.Sp? getFontSize();
method public androidx.glance.layout.FontStyle? getFontStyle();
method public androidx.glance.layout.FontWeight? getFontWeight();
- method public androidx.glance.unit.Sp? getSize();
method public androidx.glance.layout.TextDecoration? getTextDecoration();
+ property public final androidx.glance.unit.Sp? fontSize;
property public final androidx.glance.layout.FontStyle? fontStyle;
property public final androidx.glance.layout.FontWeight? fontWeight;
- property public final androidx.glance.unit.Sp? size;
property public final androidx.glance.layout.TextDecoration? textDecoration;
}
diff --git a/glance/glance/src/androidMain/kotlin/androidx/glance/layout/Text.kt b/glance/glance/src/androidMain/kotlin/androidx/glance/layout/Text.kt
index 86160e2..170dcde 100644
--- a/glance/glance/src/androidMain/kotlin/androidx/glance/layout/Text.kt
+++ b/glance/glance/src/androidMain/kotlin/androidx/glance/layout/Text.kt
@@ -48,7 +48,7 @@
*/
@Immutable
public class TextStyle(
- public val size: Sp? = null,
+ public val fontSize: Sp? = null,
public val fontWeight: FontWeight? = null,
public val fontStyle: FontStyle? = null,
public val textDecoration: TextDecoration? = null
@@ -59,7 +59,7 @@
other as TextStyle
- if (size != other.size) return false
+ if (fontSize != other.fontSize) return false
if (fontWeight != other.fontWeight) return false
if (fontStyle != other.fontStyle) return false
if (textDecoration != other.textDecoration) return false
@@ -68,7 +68,7 @@
}
override fun hashCode(): Int {
- var result = size.hashCode()
+ var result = fontSize.hashCode()
result = 31 * result + fontWeight.hashCode()
result = 31 * result + fontStyle.hashCode()
result = 31 * result + textDecoration.hashCode()
@@ -76,7 +76,7 @@
}
override fun toString() =
- "TextStyle(size=$size, fontWeight=$fontWeight, fontStyle=$fontStyle, " +
+ "TextStyle(size=$fontSize, fontWeight=$fontWeight, fontStyle=$fontStyle, " +
"textDecoration=$textDecoration)"
}
diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml
index 981dffc..cf725f0 100644
--- a/gradle/libs.versions.toml
+++ b/gradle/libs.versions.toml
@@ -30,7 +30,7 @@
ksp = "1.5.30-1.0.0"
leakcanary = "2.2"
mockito = "2.25.0"
-skiko = "0.4.7"
+skiko = "0.4.10"
sqldelight = "1.3.0"
wire = "3.6.0"
diff --git a/health/health-services-client/api/api_lint.ignore b/health/health-services-client/api/api_lint.ignore
index 79594d7..184c6f9 100644
--- a/health/health-services-client/api/api_lint.ignore
+++ b/health/health-services-client/api/api_lint.ignore
@@ -1,5 +1,57 @@
// Baseline format: 1.0
+AsyncSuffixFuture: androidx.health.services.client.ExerciseClient#addGoalToActiveExercise(androidx.health.services.client.data.ExerciseGoal):
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
+AsyncSuffixFuture: androidx.health.services.client.ExerciseClient#clearUpdateListener(androidx.health.services.client.ExerciseUpdateListener):
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
+AsyncSuffixFuture: androidx.health.services.client.ExerciseClient#endExercise():
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
+AsyncSuffixFuture: androidx.health.services.client.ExerciseClient#flushExercise():
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
+AsyncSuffixFuture: androidx.health.services.client.ExerciseClient#getCapabilities():
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
+AsyncSuffixFuture: androidx.health.services.client.ExerciseClient#getCurrentExerciseInfo():
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
+AsyncSuffixFuture: androidx.health.services.client.ExerciseClient#markLap():
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
+AsyncSuffixFuture: androidx.health.services.client.ExerciseClient#overrideAutoPauseAndResumeForActiveExercise(boolean):
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
+AsyncSuffixFuture: androidx.health.services.client.ExerciseClient#pauseExercise():
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
+AsyncSuffixFuture: androidx.health.services.client.ExerciseClient#prepareExercise(androidx.health.services.client.data.WarmUpConfig):
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
+AsyncSuffixFuture: androidx.health.services.client.ExerciseClient#removeGoalFromActiveExercise(androidx.health.services.client.data.ExerciseGoal):
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
+AsyncSuffixFuture: androidx.health.services.client.ExerciseClient#resumeExercise():
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
+AsyncSuffixFuture: androidx.health.services.client.ExerciseClient#setUpdateListener(androidx.health.services.client.ExerciseUpdateListener):
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
+AsyncSuffixFuture: androidx.health.services.client.ExerciseClient#setUpdateListener(androidx.health.services.client.ExerciseUpdateListener, java.util.concurrent.Executor):
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
+AsyncSuffixFuture: androidx.health.services.client.ExerciseClient#startExercise(androidx.health.services.client.data.ExerciseConfig):
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
+AsyncSuffixFuture: androidx.health.services.client.MeasureClient#getCapabilities():
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
+AsyncSuffixFuture: androidx.health.services.client.MeasureClient#registerCallback(androidx.health.services.client.data.DataType, androidx.health.services.client.MeasureCallback):
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
+AsyncSuffixFuture: androidx.health.services.client.MeasureClient#registerCallback(androidx.health.services.client.data.DataType, androidx.health.services.client.MeasureCallback, java.util.concurrent.Executor):
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
+AsyncSuffixFuture: androidx.health.services.client.MeasureClient#unregisterCallback(androidx.health.services.client.data.DataType, androidx.health.services.client.MeasureCallback):
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
+AsyncSuffixFuture: androidx.health.services.client.PassiveMonitoringClient#flush():
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
+AsyncSuffixFuture: androidx.health.services.client.PassiveMonitoringClient#getCapabilities():
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
+AsyncSuffixFuture: androidx.health.services.client.PassiveMonitoringClient#registerDataCallback(androidx.health.services.client.data.PassiveMonitoringConfig):
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
+AsyncSuffixFuture: androidx.health.services.client.PassiveMonitoringClient#registerDataCallback(androidx.health.services.client.data.PassiveMonitoringConfig, androidx.health.services.client.PassiveMonitoringCallback):
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
+AsyncSuffixFuture: androidx.health.services.client.PassiveMonitoringClient#registerPassiveGoalCallback(androidx.health.services.client.data.PassiveGoal, android.content.ComponentName):
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
+AsyncSuffixFuture: androidx.health.services.client.PassiveMonitoringClient#unregisterDataCallback():
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
+AsyncSuffixFuture: androidx.health.services.client.PassiveMonitoringClient#unregisterPassiveGoalCallback(androidx.health.services.client.data.PassiveGoal):
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
+
+
ExecutorRegistration: androidx.health.services.client.ExerciseClient#clearUpdateListener(androidx.health.services.client.ExerciseUpdateListener):
Registration methods should have overload that accepts delivery Executor: `clearUpdateListener`
-ExecutorRegistration: androidx.health.services.client.PassiveMonitoringClient#registerDataCallback(androidx.health.services.client.data.PassiveMonitoringConfig, androidx.health.services.client.PassiveMonitoringCallback):
- Registration methods should have overload that accepts delivery Executor: `registerDataCallback`
\ No newline at end of file
diff --git a/health/health-services-client/lint-baseline.xml b/health/health-services-client/lint-baseline.xml
index c44cc29..1f39e14 100644
--- a/health/health-services-client/lint-baseline.xml
+++ b/health/health-services-client/lint-baseline.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<issues format="6" by="lint 7.1.0-alpha08" type="baseline" client="gradle" dependencies="false" name="AGP (7.1.0-alpha08)" variant="all" version="7.1.0-alpha08">
+<issues format="6" by="lint 7.1.0-dev" type="baseline" client="gradle" dependencies="false" name="AGP (7.1.0-dev)" variant="all" version="7.1.0-dev">
<issue
id="BanKeepAnnotation"
@@ -101,6 +101,17 @@
</issue>
<issue
+ id="VisibleForTests"
+ message="This method should only be accessed from tests or within private scope"
+ errorLine1=" get() = ServiceBackedMeasureClient.getClient(applicationContext)"
+ errorLine2=" ~~~~~~~~~">
+ <location
+ file="src/main/java/androidx/health/services/client/impl/ServiceBackedHealthServicesClient.kt"
+ line="51"
+ column="44"/>
+ </issue>
+
+ <issue
id="SyntheticAccessor"
message="Access to `private` field `mCurrentVersion` of class `Client` requires synthetic accessor"
errorLine1=" mCurrentVersion ="
diff --git a/inspection/inspection-gradle-plugin/src/main/kotlin/androidx/inspection/gradle/GenerateInspectionPlatformVersionTask.kt b/inspection/inspection-gradle-plugin/src/main/kotlin/androidx/inspection/gradle/GenerateInspectionPlatformVersionTask.kt
index ae79e7d..cc08045 100644
--- a/inspection/inspection-gradle-plugin/src/main/kotlin/androidx/inspection/gradle/GenerateInspectionPlatformVersionTask.kt
+++ b/inspection/inspection-gradle-plugin/src/main/kotlin/androidx/inspection/gradle/GenerateInspectionPlatformVersionTask.kt
@@ -25,6 +25,7 @@
import org.gradle.api.attributes.Attribute
import org.gradle.api.file.DirectoryProperty
import org.gradle.api.file.FileCollection
+import org.gradle.api.provider.Property
import org.gradle.api.tasks.Input
import org.gradle.api.tasks.InputFiles
import org.gradle.api.tasks.Internal
@@ -68,12 +69,15 @@
}?.version
return if (projectDep) {
- "${project.project(":inspection:inspection").version}"
+ inspectionProjectVersion.get()
} else prebuiltVersion ?: throw GradleException(
"Inspector must have a dependency on androidx.inspection"
)
}
+ @get:Internal
+ abstract val inspectionProjectVersion: Property<String>
+
@TaskAction
fun exec() {
val file = File(outputDir.asFile.get(), "META-INF/androidx_inspection.min_version")
@@ -95,5 +99,10 @@
}
}.artifacts
it.outputDir.set(taskWorkingDir(variant, "inspectionVersion"))
+ it.inspectionProjectVersion.set(
+ project.provider({
+ project.project(":inspection:inspection").version.toString()
+ })
+ )
}
}
diff --git a/jetifier/jetifier/migration.config b/jetifier/jetifier/migration.config
index 0b0ff3f..ae9f741 100644
--- a/jetifier/jetifier/migration.config
+++ b/jetifier/jetifier/migration.config
@@ -255,10 +255,6 @@
"to": "androidx/core/{0}"
},
{
- "from": "android/arch/lifecycle/(.*)",
- "to": "androidx/lifecycle/{0}"
- },
- {
"from": "android/support/constraint/solver/(.*)",
"to": "androidx/constraintlayout/solver/{0}"
},
@@ -517,35 +513,7 @@
"to": "ignore"
},
{
- "from": "androidx/lifecycle/LifecycleObserver(.*)",
- "to": "ignore"
- },
- {
- "from": "androidx/lifecycle/ProcessLifecycleOwner(.*)",
- "to": "ignore"
- },
- {
- "from": "androidx/lifecycle/ProcessLifecycleOwnerInitializer(.*)",
- "to": "ignore"
- },
- {
- "from": "androidx/lifecycle/LifecycleDispatcher(.*)",
- "to": "ignore"
- },
- {
- "from": "androidx/lifecycle/EmptyActivityLifecycleCallbacks(.*)",
- "to": "ignore"
- },
- {
- "from": "androidx/lifecycle/ReportFragment(.*)",
- "to": "ignore"
- },
- {
- "from": "androidx/lifecycle/LifecycleOwner(.*)",
- "to": "ignore"
- },
- {
- "from": "androidx/lifecycle/Lifecycle(.*)",
+ "from": "androidx/lifecycle/(.*)",
"to": "ignore"
},
{
@@ -1371,11 +1339,11 @@
"to": "androidx/lifecycle/process"
},
{
- "from": "android/arch/lifecycle/service",
+ "from": "androidx/lifecycle/service",
"to": "androidx/lifecycle/service"
},
{
- "from": "android/arch/lifecycle/viewmodel/savedstate",
+ "from": "androidx/lifecycle/viewmodel/savedstate",
"to": "androidx/lifecycle/viewmodel/savedstate"
},
{
@@ -1459,23 +1427,23 @@
"to": "androidx/room/migration"
},
{
- "from": "android/arch/lifecycle/extensions",
+ "from": "androidx/lifecycle/extensions",
"to": "androidx/lifecycle/extensions"
},
{
- "from": "android/arch/lifecycle/runtime",
+ "from": "androidx/lifecycle/runtime",
"to": "androidx/lifecycle/runtime"
},
{
- "from": "android/arch/lifecycle/testing",
+ "from": "androidx/lifecycle/testing",
"to": "androidx/lifecycle/testing"
},
{
- "from": "android/arch/lifecycle/livedata/core",
+ "from": "androidx/lifecycle/livedata/core",
"to": "androidx/lifecycle/livedata/core"
},
{
- "from": "android/arch/lifecycle",
+ "from": "androidx/lifecycle",
"to": "androidx/lifecycle"
},
{
@@ -1483,15 +1451,15 @@
"to": "androidx/work"
},
{
- "from": "android/arch/lifecycle/viewmodel",
+ "from": "androidx/lifecycle/viewmodel",
"to": "androidx/lifecycle/viewmodel"
},
{
- "from": "android/arch/lifecycle/livedata",
+ "from": "androidx/lifecycle/livedata",
"to": "androidx/lifecycle/livedata"
},
{
- "from": "android/arch/lifecycle/reactivestreams",
+ "from": "androidx/lifecycle/reactivestreams",
"to": "androidx/lifecycle/reactivestreams"
},
{
@@ -2894,9 +2862,9 @@
},
{
"from": {
- "groupId": "android.arch.lifecycle",
- "artifactId": "common",
- "version": "1.1.1"
+ "groupId": "androidx.lifecycle",
+ "artifactId": "lifecycle-common",
+ "version": "{newLifecycleVersion}"
},
"to": {
"groupId": "androidx.lifecycle",
@@ -2906,9 +2874,9 @@
},
{
"from": {
- "groupId": "android.arch.lifecycle",
- "artifactId": "livedata-core-ktx",
- "version": "1.1.1"
+ "groupId": "androidx.lifecycle",
+ "artifactId": "lifecycle-livedata-core-ktx",
+ "version": "{newLifecycleVersion}"
},
"to": {
"groupId": "androidx.lifecycle",
@@ -2930,9 +2898,9 @@
},
{
"from": {
- "groupId": "android.arch.lifecycle",
- "artifactId": "common-java8",
- "version": "1.1.1"
+ "groupId": "androidx.lifecycle",
+ "artifactId": "lifecycle-common-java8",
+ "version": "{newLifecycleVersion}"
},
"to": {
"groupId": "androidx.lifecycle",
@@ -2942,9 +2910,9 @@
},
{
"from": {
- "groupId": "android.arch.lifecycle",
- "artifactId": "compiler",
- "version": "1.1.1"
+ "groupId": "androidx.lifecycle",
+ "artifactId": "lifecycle-compiler",
+ "version": "{newLifecycleVersion}"
},
"to": {
"groupId": "androidx.lifecycle",
@@ -2954,9 +2922,9 @@
},
{
"from": {
- "groupId": "android.arch.lifecycle",
+ "groupId": "androidx.lifecycle",
"artifactId": "lifecycle-viewmodel-savedstate",
- "version": "1.1.1"
+ "version": "{newLifecycleVersion}"
},
"to": {
"groupId": "androidx.lifecycle",
@@ -2966,9 +2934,9 @@
},
{
"from": {
- "groupId": "android.arch.lifecycle",
- "artifactId": "extensions",
- "version": "1.1.1"
+ "groupId": "androidx.lifecycle",
+ "artifactId": "lifecycle-extensions",
+ "version": "{newLifecycleVersion}"
},
"to": {
"groupId": "androidx.lifecycle",
@@ -2978,9 +2946,9 @@
},
{
"from": {
- "groupId": "android.arch.lifecycle",
- "artifactId": "reactivestreams",
- "version": "1.1.1"
+ "groupId": "androidx.lifecycle",
+ "artifactId": "lifecycle-reactivestreams",
+ "version": "{newLifecycleVersion}"
},
"to": {
"groupId": "androidx.lifecycle",
@@ -2990,9 +2958,9 @@
},
{
"from": {
- "groupId": "android.arch.lifecycle",
- "artifactId": "runtime",
- "version": "1.1.1"
+ "groupId": "androidx.lifecycle",
+ "artifactId": "lifecycle-runtime",
+ "version": "{newLifecycleVersion}"
},
"to": {
"groupId": "androidx.lifecycle",
@@ -3002,9 +2970,9 @@
},
{
"from": {
- "groupId": "android.arch.lifecycle",
- "artifactId": "runtime-testing",
- "version": "1.1.1"
+ "groupId": "androidx.lifecycle",
+ "artifactId": "lifecycle-runtime-testing",
+ "version": "{newLifecycleVersion}"
},
"to": {
"groupId": "androidx.lifecycle",
@@ -3014,9 +2982,9 @@
},
{
"from": {
- "groupId": "android.arch.lifecycle",
+ "groupId": "androidx.lifecycle",
"artifactId": "lifecycle-reactivestreams-ktx",
- "version": "1.1.1"
+ "version": "{newLifecycleVersion}"
},
"to": {
"groupId": "androidx.lifecycle",
@@ -3026,9 +2994,9 @@
},
{
"from": {
- "groupId": "android.arch.lifecycle",
+ "groupId": "androidx.lifecycle",
"artifactId": "lifecycle-service",
- "version": "1.1.1"
+ "version": "{newLifecycleVersion}"
},
"to": {
"groupId": "androidx.lifecycle",
@@ -3038,9 +3006,9 @@
},
{
"from": {
- "groupId": "android.arch.lifecycle",
+ "groupId": "androidx.lifecycle",
"artifactId": "lifecycle-viewmodel-ktx",
- "version": "1.1.1"
+ "version": "{newLifecycleVersion}"
},
"to": {
"groupId": "androidx.lifecycle",
@@ -3050,9 +3018,9 @@
},
{
"from": {
- "groupId": "android.arch.lifecycle",
+ "groupId": "androidx.lifecycle",
"artifactId": "lifecycle-runtime-ktx",
- "version": "1.1.1"
+ "version": "{newLifecycleVersion}"
},
"to": {
"groupId": "androidx.lifecycle",
@@ -3098,9 +3066,9 @@
},
{
"from": {
- "groupId": "android.arch.lifecycle",
- "artifactId": "viewmodel",
- "version": "1.1.1"
+ "groupId": "androidx.lifecycle",
+ "artifactId": "lifecycle-viewmodel",
+ "version": "{newLifecycleVersion}"
},
"to": {
"groupId": "androidx.lifecycle",
@@ -3110,9 +3078,9 @@
},
{
"from": {
- "groupId": "android.arch.lifecycle",
- "artifactId": "livedata",
- "version": "1.1.1"
+ "groupId": "androidx.lifecycle",
+ "artifactId": "lifecycle-livedata",
+ "version": "{newLifecycleVersion}"
},
"to": {
"groupId": "androidx.lifecycle",
@@ -3122,9 +3090,9 @@
},
{
"from": {
- "groupId": "android.arch.lifecycle",
- "artifactId": "livedata-ktx",
- "version": "1.1.1"
+ "groupId": "androidx.lifecycle",
+ "artifactId": "lifecycle-livedata-ktx",
+ "version": "{newLifecycleVersion}"
},
"to": {
"groupId": "androidx.lifecycle",
@@ -3134,9 +3102,9 @@
},
{
"from": {
- "groupId": "android.arch.lifecycle",
- "artifactId": "livedata-core",
- "version": "1.1.1"
+ "groupId": "androidx.lifecycle",
+ "artifactId": "lifecycle-livedata-core",
+ "version": "{newLifecycleVersion}"
},
"to": {
"groupId": "androidx.lifecycle",
@@ -3887,52 +3855,6 @@
},
"map": {
"types": {
- "android/arch/lifecycle/AndroidViewModel": "androidx/lifecycle/AndroidViewModel",
- "android/arch/lifecycle/ClassesInfoCache": "androidx/lifecycle/ClassesInfoCache",
- "android/arch/lifecycle/CompositeGeneratedAdaptersObserver": "androidx/lifecycle/CompositeGeneratedAdaptersObserver",
- "android/arch/lifecycle/ComputableLiveData": "androidx/lifecycle/ComputableLiveData",
- "android/arch/lifecycle/DefaultLifecycleObserver": "androidx/lifecycle/DefaultLifecycleObserver",
- "android/arch/lifecycle/Elements_extKt": "androidx/lifecycle/Elements_extKt",
- "android/arch/lifecycle/ErrorMessages": "androidx/lifecycle/ErrorMessages",
- "android/arch/lifecycle/FullLifecycleObserver": "androidx/lifecycle/FullLifecycleObserver",
- "android/arch/lifecycle/FullLifecycleObserverAdapter": "androidx/lifecycle/FullLifecycleObserverAdapter",
- "android/arch/lifecycle/GeneratedAdapter": "androidx/lifecycle/GeneratedAdapter",
- "android/arch/lifecycle/GenericLifecycleObserver": "androidx/lifecycle/GenericLifecycleObserver",
- "android/arch/lifecycle/HolderFragment": "androidx/lifecycle/HolderFragment",
- "android/arch/lifecycle/Input_collectorKt": "androidx/lifecycle/Input_collectorKt",
- "android/arch/lifecycle/LifecycleProcessor": "androidx/lifecycle/LifecycleProcessor",
- "android/arch/lifecycle/LifecycleRegistry": "androidx/lifecycle/LifecycleRegistry",
- "android/arch/lifecycle/LifecycleRegistryOwner": "androidx/lifecycle/LifecycleRegistryOwner",
- "android/arch/lifecycle/LifecycleService": "androidx/lifecycle/LifecycleService",
- "android/arch/lifecycle/LifecycleEventObserver": "androidx/lifecycle/LifecycleEventObserver",
- "android/arch/lifecycle/Lifecycling": "androidx/lifecycle/Lifecycling",
- "android/arch/lifecycle/LiveData": "androidx/lifecycle/LiveData",
- "android/arch/lifecycle/LiveDataReactiveStreams": "androidx/lifecycle/LiveDataReactiveStreams",
- "android/arch/lifecycle/MediatorLiveData": "androidx/lifecycle/MediatorLiveData",
- "android/arch/lifecycle/MethodCallsLogger": "androidx/lifecycle/MethodCallsLogger",
- "android/arch/lifecycle/MutableLiveData": "androidx/lifecycle/MutableLiveData",
- "android/arch/lifecycle/Observer": "androidx/lifecycle/Observer",
- "android/arch/lifecycle/ObserversCollector": "androidx/lifecycle/ObserversCollector",
- "android/arch/lifecycle/OnLifecycleEvent": "androidx/lifecycle/OnLifecycleEvent",
- "android/arch/lifecycle/ReflectiveGenericLifecycleObserver": "androidx/lifecycle/ReflectiveGenericLifecycleObserver",
- "android/arch/lifecycle/ServiceLifecycleDispatcher": "androidx/lifecycle/ServiceLifecycleDispatcher",
- "android/arch/lifecycle/SingleGeneratedAdapterObserver": "androidx/lifecycle/SingleGeneratedAdapterObserver",
- "android/arch/lifecycle/TransformationKt": "androidx/lifecycle/TransformationKt",
- "android/arch/lifecycle/Transformations": "androidx/lifecycle/Transformations",
- "android/arch/lifecycle/Validator": "androidx/lifecycle/Validator",
- "android/arch/lifecycle/ViewModel": "androidx/lifecycle/ViewModel",
- "android/arch/lifecycle/ViewModelProvider": "androidx/lifecycle/ViewModelProvider",
- "android/arch/lifecycle/ViewModelProviders": "androidx/lifecycle/ViewModelProviders",
- "android/arch/lifecycle/ViewModelStore": "androidx/lifecycle/ViewModelStore",
- "android/arch/lifecycle/ViewModelStoreOwner": "androidx/lifecycle/ViewModelStoreOwner",
- "android/arch/lifecycle/ViewModelStores": "androidx/lifecycle/ViewModelStores",
- "android/arch/lifecycle/WriterKt": "androidx/lifecycle/WriterKt",
- "android/arch/lifecycle/model/AdapterClass": "androidx/lifecycle/model/AdapterClass",
- "android/arch/lifecycle/model/AdapterClassKt": "androidx/lifecycle/model/AdapterClassKt",
- "android/arch/lifecycle/model/EventMethod": "androidx/lifecycle/model/EventMethod",
- "android/arch/lifecycle/model/EventMethodCall": "androidx/lifecycle/model/EventMethodCall",
- "android/arch/lifecycle/model/InputModel": "androidx/lifecycle/model/InputModel",
- "android/arch/lifecycle/model/LifecycleObserverInfo": "androidx/lifecycle/model/LifecycleObserverInfo",
"android/databinding/BaseObservable": "androidx/databinding/BaseObservable",
"android/databinding/BaseObservableField": "androidx/databinding/BaseObservableField",
"android/databinding/Bindable": "androidx/databinding/Bindable",
diff --git a/lifecycle/integration-tests/incrementality/src/test/kotlin/androidx/lifecycle/IncrementalAnnotationProcessingTest.kt b/lifecycle/integration-tests/incrementality/src/test/kotlin/androidx/lifecycle/IncrementalAnnotationProcessingTest.kt
index 2653a72..ffbb447 100644
--- a/lifecycle/integration-tests/incrementality/src/test/kotlin/androidx/lifecycle/IncrementalAnnotationProcessingTest.kt
+++ b/lifecycle/integration-tests/incrementality/src/test/kotlin/androidx/lifecycle/IncrementalAnnotationProcessingTest.kt
@@ -66,7 +66,7 @@
private lateinit var minSdkVersion: String
private lateinit var debugKeystore: String
private lateinit var agpDependency: String
- private lateinit var gradleVersion: String
+ private lateinit var gradleDistributionUrl: String
private lateinit var supportRepo: String
@Before
@@ -116,7 +116,8 @@
setupAndroidManifest()
addSource()
- projectConnection = GradleConnector.newConnector().useGradleVersion(gradleVersion)
+ projectConnection = GradleConnector.newConnector()
+ .useDistribution(File(gradleDistributionUrl).toURI())
.forProjectDirectory(projectRoot).connect()
}
@@ -389,7 +390,7 @@
minSdkVersion = properties.getProperty("minSdkVersion")
debugKeystore = properties.getProperty("debugKeystore")
agpDependency = properties.getProperty("agpDependency")
- gradleVersion = properties.getProperty("gradleVersion")
+ gradleDistributionUrl = properties.getProperty("gradleDistributionUrl")
supportRepo = properties.getProperty("localSupportRepo")
}
}
diff --git a/media2/media2-common/api/api_lint.ignore b/media2/media2-common/api/api_lint.ignore
index 072b6d9f..051bfc9 100644
--- a/media2/media2-common/api/api_lint.ignore
+++ b/media2/media2-common/api/api_lint.ignore
@@ -1,4 +1,48 @@
// Baseline format: 1.0
+AsyncSuffixFuture: androidx.media2.common.SessionPlayer#addPlaylistItem(int, androidx.media2.common.MediaItem):
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
+AsyncSuffixFuture: androidx.media2.common.SessionPlayer#deselectTrack(androidx.media2.common.SessionPlayer.TrackInfo):
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
+AsyncSuffixFuture: androidx.media2.common.SessionPlayer#movePlaylistItem(int, int):
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
+AsyncSuffixFuture: androidx.media2.common.SessionPlayer#pause():
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
+AsyncSuffixFuture: androidx.media2.common.SessionPlayer#play():
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
+AsyncSuffixFuture: androidx.media2.common.SessionPlayer#prepare():
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
+AsyncSuffixFuture: androidx.media2.common.SessionPlayer#removePlaylistItem(int):
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
+AsyncSuffixFuture: androidx.media2.common.SessionPlayer#replacePlaylistItem(int, androidx.media2.common.MediaItem):
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
+AsyncSuffixFuture: androidx.media2.common.SessionPlayer#seekTo(long):
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
+AsyncSuffixFuture: androidx.media2.common.SessionPlayer#selectTrack(androidx.media2.common.SessionPlayer.TrackInfo):
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
+AsyncSuffixFuture: androidx.media2.common.SessionPlayer#setAudioAttributes(androidx.media.AudioAttributesCompat):
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
+AsyncSuffixFuture: androidx.media2.common.SessionPlayer#setMediaItem(androidx.media2.common.MediaItem):
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
+AsyncSuffixFuture: androidx.media2.common.SessionPlayer#setPlaybackSpeed(float):
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
+AsyncSuffixFuture: androidx.media2.common.SessionPlayer#setPlaylist(java.util.List<androidx.media2.common.MediaItem>, androidx.media2.common.MediaMetadata):
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
+AsyncSuffixFuture: androidx.media2.common.SessionPlayer#setRepeatMode(int):
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
+AsyncSuffixFuture: androidx.media2.common.SessionPlayer#setShuffleMode(int):
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
+AsyncSuffixFuture: androidx.media2.common.SessionPlayer#setSurface(android.view.Surface):
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
+AsyncSuffixFuture: androidx.media2.common.SessionPlayer#skipToNextPlaylistItem():
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
+AsyncSuffixFuture: androidx.media2.common.SessionPlayer#skipToPlaylistItem(int):
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
+AsyncSuffixFuture: androidx.media2.common.SessionPlayer#skipToPreviousPlaylistItem():
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
+AsyncSuffixFuture: androidx.media2.common.SessionPlayer#updatePlaylistMetadata(androidx.media2.common.MediaMetadata):
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
+
+
BuilderSetStyle: androidx.media2.common.MediaMetadata.Builder#putBitmap(String, android.graphics.Bitmap):
Builder methods names should use setFoo() / addFoo() / clearFoo() style: method androidx.media2.common.MediaMetadata.Builder.putBitmap(String,android.graphics.Bitmap)
BuilderSetStyle: androidx.media2.common.MediaMetadata.Builder#putFloat(String, float):
diff --git a/media2/media2-player/api/api_lint.ignore b/media2/media2-player/api/api_lint.ignore
index bc67ff2..1e12661 100644
--- a/media2/media2-player/api/api_lint.ignore
+++ b/media2/media2-player/api/api_lint.ignore
@@ -1,4 +1,60 @@
// Baseline format: 1.0
+AsyncSuffixFuture: androidx.media2.player.MediaPlayer#addPlaylistItem(int, androidx.media2.common.MediaItem):
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
+AsyncSuffixFuture: androidx.media2.player.MediaPlayer#attachAuxEffect(int):
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
+AsyncSuffixFuture: androidx.media2.player.MediaPlayer#deselectTrack(androidx.media2.common.SessionPlayer.TrackInfo):
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
+AsyncSuffixFuture: androidx.media2.player.MediaPlayer#movePlaylistItem(int, int):
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
+AsyncSuffixFuture: androidx.media2.player.MediaPlayer#pause():
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
+AsyncSuffixFuture: androidx.media2.player.MediaPlayer#play():
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
+AsyncSuffixFuture: androidx.media2.player.MediaPlayer#prepare():
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
+AsyncSuffixFuture: androidx.media2.player.MediaPlayer#removePlaylistItem(int):
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
+AsyncSuffixFuture: androidx.media2.player.MediaPlayer#replacePlaylistItem(int, androidx.media2.common.MediaItem):
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
+AsyncSuffixFuture: androidx.media2.player.MediaPlayer#seekTo(long):
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
+AsyncSuffixFuture: androidx.media2.player.MediaPlayer#seekTo(long, int):
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
+AsyncSuffixFuture: androidx.media2.player.MediaPlayer#selectTrack(androidx.media2.common.SessionPlayer.TrackInfo):
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
+AsyncSuffixFuture: androidx.media2.player.MediaPlayer#setAudioAttributes(androidx.media.AudioAttributesCompat):
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
+AsyncSuffixFuture: androidx.media2.player.MediaPlayer#setAudioSessionId(int):
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
+AsyncSuffixFuture: androidx.media2.player.MediaPlayer#setAuxEffectSendLevel(float):
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
+AsyncSuffixFuture: androidx.media2.player.MediaPlayer#setMediaItem(androidx.media2.common.MediaItem):
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
+AsyncSuffixFuture: androidx.media2.player.MediaPlayer#setPlaybackParams(androidx.media2.player.PlaybackParams):
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
+AsyncSuffixFuture: androidx.media2.player.MediaPlayer#setPlaybackSpeed(float):
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
+AsyncSuffixFuture: androidx.media2.player.MediaPlayer#setPlayerVolume(float):
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
+AsyncSuffixFuture: androidx.media2.player.MediaPlayer#setPlaylist(java.util.List<androidx.media2.common.MediaItem>, androidx.media2.common.MediaMetadata):
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
+AsyncSuffixFuture: androidx.media2.player.MediaPlayer#setRepeatMode(int):
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
+AsyncSuffixFuture: androidx.media2.player.MediaPlayer#setShuffleMode(int):
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
+AsyncSuffixFuture: androidx.media2.player.MediaPlayer#setSurface(android.view.Surface):
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
+AsyncSuffixFuture: androidx.media2.player.MediaPlayer#skipToNextPlaylistItem():
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
+AsyncSuffixFuture: androidx.media2.player.MediaPlayer#skipToPlaylistItem(int):
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
+AsyncSuffixFuture: androidx.media2.player.MediaPlayer#skipToPreviousPlaylistItem():
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
+AsyncSuffixFuture: androidx.media2.player.MediaPlayer#updatePlaylistMetadata(androidx.media2.common.MediaMetadata):
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
+
+
AutoBoxing: androidx.media2.player.PlaybackParams#getAudioFallbackMode():
Must avoid boxed primitives (`java.lang.Integer`)
AutoBoxing: androidx.media2.player.PlaybackParams#getPitch():
diff --git a/media2/media2-session/api/api_lint.ignore b/media2/media2-session/api/api_lint.ignore
index 82f5bb9..a8726c6 100644
--- a/media2/media2-session/api/api_lint.ignore
+++ b/media2/media2-session/api/api_lint.ignore
@@ -1,4 +1,82 @@
// Baseline format: 1.0
+AsyncSuffixFuture: androidx.media2.session.MediaBrowser#getChildren(String, int, int, androidx.media2.session.MediaLibraryService.LibraryParams):
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
+AsyncSuffixFuture: androidx.media2.session.MediaBrowser#getItem(String):
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
+AsyncSuffixFuture: androidx.media2.session.MediaBrowser#getLibraryRoot(androidx.media2.session.MediaLibraryService.LibraryParams):
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
+AsyncSuffixFuture: androidx.media2.session.MediaBrowser#getSearchResult(String, int, int, androidx.media2.session.MediaLibraryService.LibraryParams):
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
+AsyncSuffixFuture: androidx.media2.session.MediaBrowser#search(String, androidx.media2.session.MediaLibraryService.LibraryParams):
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
+AsyncSuffixFuture: androidx.media2.session.MediaBrowser#subscribe(String, androidx.media2.session.MediaLibraryService.LibraryParams):
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
+AsyncSuffixFuture: androidx.media2.session.MediaBrowser#unsubscribe(String):
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
+AsyncSuffixFuture: androidx.media2.session.MediaController#addPlaylistItem(int, String):
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
+AsyncSuffixFuture: androidx.media2.session.MediaController#adjustVolume(int, int):
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
+AsyncSuffixFuture: androidx.media2.session.MediaController#deselectTrack(androidx.media2.common.SessionPlayer.TrackInfo):
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
+AsyncSuffixFuture: androidx.media2.session.MediaController#fastForward():
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
+AsyncSuffixFuture: androidx.media2.session.MediaController#movePlaylistItem(int, int):
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
+AsyncSuffixFuture: androidx.media2.session.MediaController#pause():
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
+AsyncSuffixFuture: androidx.media2.session.MediaController#play():
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
+AsyncSuffixFuture: androidx.media2.session.MediaController#prepare():
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
+AsyncSuffixFuture: androidx.media2.session.MediaController#removePlaylistItem(int):
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
+AsyncSuffixFuture: androidx.media2.session.MediaController#replacePlaylistItem(int, String):
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
+AsyncSuffixFuture: androidx.media2.session.MediaController#rewind():
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
+AsyncSuffixFuture: androidx.media2.session.MediaController#seekTo(long):
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
+AsyncSuffixFuture: androidx.media2.session.MediaController#selectTrack(androidx.media2.common.SessionPlayer.TrackInfo):
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
+AsyncSuffixFuture: androidx.media2.session.MediaController#sendCustomCommand(androidx.media2.session.SessionCommand, android.os.Bundle):
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
+AsyncSuffixFuture: androidx.media2.session.MediaController#setMediaItem(String):
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
+AsyncSuffixFuture: androidx.media2.session.MediaController#setMediaUri(android.net.Uri, android.os.Bundle):
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
+AsyncSuffixFuture: androidx.media2.session.MediaController#setPlaybackSpeed(float):
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
+AsyncSuffixFuture: androidx.media2.session.MediaController#setPlaylist(java.util.List<java.lang.String>, androidx.media2.common.MediaMetadata):
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
+AsyncSuffixFuture: androidx.media2.session.MediaController#setRating(String, androidx.media2.common.Rating):
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
+AsyncSuffixFuture: androidx.media2.session.MediaController#setRepeatMode(int):
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
+AsyncSuffixFuture: androidx.media2.session.MediaController#setShuffleMode(int):
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
+AsyncSuffixFuture: androidx.media2.session.MediaController#setSurface(android.view.Surface):
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
+AsyncSuffixFuture: androidx.media2.session.MediaController#setVolumeTo(int, int):
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
+AsyncSuffixFuture: androidx.media2.session.MediaController#skipBackward():
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
+AsyncSuffixFuture: androidx.media2.session.MediaController#skipForward():
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
+AsyncSuffixFuture: androidx.media2.session.MediaController#skipToNextPlaylistItem():
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
+AsyncSuffixFuture: androidx.media2.session.MediaController#skipToPlaylistItem(int):
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
+AsyncSuffixFuture: androidx.media2.session.MediaController#skipToPreviousPlaylistItem():
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
+AsyncSuffixFuture: androidx.media2.session.MediaController#updatePlaylistMetadata(androidx.media2.common.MediaMetadata):
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
+AsyncSuffixFuture: androidx.media2.session.MediaSession#sendCustomCommand(androidx.media2.session.MediaSession.ControllerInfo, androidx.media2.session.SessionCommand, android.os.Bundle):
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
+AsyncSuffixFuture: androidx.media2.session.MediaSession#setCustomLayout(androidx.media2.session.MediaSession.ControllerInfo, java.util.List<androidx.media2.session.MediaSession.CommandButton>):
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
+
+
BadFuture: androidx.media2.session.RemoteSessionPlayer#adjustVolume(int):
Use ListenableFuture (library), or a combination of Consumer<T>, Executor, and CancellationSignal (platform) instead of java.util.concurrent.Future (method androidx.media2.session.RemoteSessionPlayer.adjustVolume(int))
BadFuture: androidx.media2.session.RemoteSessionPlayer#setVolume(int):
diff --git a/mediarouter/mediarouter/api/api_lint.ignore b/mediarouter/mediarouter/api/api_lint.ignore
index 4be53a4..deee53e 100644
--- a/mediarouter/mediarouter/api/api_lint.ignore
+++ b/mediarouter/mediarouter/api/api_lint.ignore
@@ -53,6 +53,10 @@
Inconsistent extra value; expected `androidx.mediarouter.media.extra.HTTP_STATUS_CODE`, was `android.media.status.extra.HTTP_STATUS_CODE`
+AsyncSuffixFuture: androidx.mediarouter.media.MediaRouter.OnPrepareTransferListener#onPrepareTransfer(androidx.mediarouter.media.MediaRouter.RouteInfo, androidx.mediarouter.media.MediaRouter.RouteInfo):
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
+
+
ExecutorRegistration: androidx.mediarouter.media.MediaRouteProvider#setCallback(androidx.mediarouter.media.MediaRouteProvider.Callback):
Registration methods should have overload that accepts delivery Executor: `setCallback`
ExecutorRegistration: androidx.mediarouter.media.MediaRouter#addCallback(androidx.mediarouter.media.MediaRouteSelector, androidx.mediarouter.media.MediaRouter.Callback, int):
diff --git a/navigation/navigation-compose/api/current.txt b/navigation/navigation-compose/api/current.txt
index 808b1ed..d46757e 100644
--- a/navigation/navigation-compose/api/current.txt
+++ b/navigation/navigation-compose/api/current.txt
@@ -35,7 +35,7 @@
public final class NavHostControllerKt {
method @androidx.compose.runtime.Composable public static androidx.compose.runtime.State<androidx.navigation.NavBackStackEntry> currentBackStackEntryAsState(androidx.navigation.NavController);
- method @androidx.compose.runtime.Composable public static androidx.navigation.NavHostController rememberNavController();
+ method @androidx.compose.runtime.Composable public static androidx.navigation.NavHostController rememberNavController(androidx.navigation.Navigator<? extends androidx.navigation.NavDestination>... navigators);
}
public final class NavHostKt {
diff --git a/navigation/navigation-compose/api/public_plus_experimental_current.txt b/navigation/navigation-compose/api/public_plus_experimental_current.txt
index 808b1ed..d46757e 100644
--- a/navigation/navigation-compose/api/public_plus_experimental_current.txt
+++ b/navigation/navigation-compose/api/public_plus_experimental_current.txt
@@ -35,7 +35,7 @@
public final class NavHostControllerKt {
method @androidx.compose.runtime.Composable public static androidx.compose.runtime.State<androidx.navigation.NavBackStackEntry> currentBackStackEntryAsState(androidx.navigation.NavController);
- method @androidx.compose.runtime.Composable public static androidx.navigation.NavHostController rememberNavController();
+ method @androidx.compose.runtime.Composable public static androidx.navigation.NavHostController rememberNavController(androidx.navigation.Navigator<? extends androidx.navigation.NavDestination>... navigators);
}
public final class NavHostKt {
diff --git a/navigation/navigation-compose/api/restricted_current.txt b/navigation/navigation-compose/api/restricted_current.txt
index 808b1ed..d46757e 100644
--- a/navigation/navigation-compose/api/restricted_current.txt
+++ b/navigation/navigation-compose/api/restricted_current.txt
@@ -35,7 +35,7 @@
public final class NavHostControllerKt {
method @androidx.compose.runtime.Composable public static androidx.compose.runtime.State<androidx.navigation.NavBackStackEntry> currentBackStackEntryAsState(androidx.navigation.NavController);
- method @androidx.compose.runtime.Composable public static androidx.navigation.NavHostController rememberNavController();
+ method @androidx.compose.runtime.Composable public static androidx.navigation.NavHostController rememberNavController(androidx.navigation.Navigator<? extends androidx.navigation.NavDestination>... navigators);
}
public final class NavHostKt {
diff --git a/navigation/navigation-compose/src/androidTest/java/androidx/navigation/compose/NavHostControllerTest.kt b/navigation/navigation-compose/src/androidTest/java/androidx/navigation/compose/NavHostControllerTest.kt
index 2e6ec8f..f51b862 100644
--- a/navigation/navigation-compose/src/androidTest/java/androidx/navigation/compose/NavHostControllerTest.kt
+++ b/navigation/navigation-compose/src/androidTest/java/androidx/navigation/compose/NavHostControllerTest.kt
@@ -16,18 +16,15 @@
package androidx.navigation.compose
-import androidx.compose.runtime.Composable
import androidx.compose.runtime.State
import androidx.compose.runtime.mutableStateOf
-import androidx.compose.ui.platform.LocalContext
+import androidx.compose.runtime.remember
import androidx.compose.ui.test.junit4.createComposeRule
import androidx.navigation.NavBackStackEntry
import androidx.navigation.NavController
import androidx.navigation.NavHostController
import androidx.navigation.createGraph
import androidx.navigation.get
-import androidx.navigation.plusAssign
-import androidx.navigation.testing.TestNavHostController
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.LargeTest
import androidx.testutils.TestNavigator
@@ -48,7 +45,7 @@
fun testCurrentBackStackEntrySetGraph() {
var currentBackStackEntry: State<NavBackStackEntry?> = mutableStateOf(null)
composeTestRule.setContent {
- val navController = createNavController()
+ val navController = rememberNavController(remember { TestNavigator() })
navController.graph = navController.createGraph(startDestination = FIRST_DESTINATION) {
test(FIRST_DESTINATION)
@@ -67,7 +64,7 @@
var currentBackStackEntry: State<NavBackStackEntry?> = mutableStateOf(null)
lateinit var navController: NavController
composeTestRule.setContent {
- navController = createNavController()
+ navController = rememberNavController(remember { TestNavigator() })
navController.graph = navController.createGraph(startDestination = FIRST_DESTINATION) {
test(FIRST_DESTINATION)
@@ -93,9 +90,9 @@
@Test
fun testCurrentBackStackEntryPop() {
var currentBackStackEntry: State<NavBackStackEntry?> = mutableStateOf(null)
- lateinit var navController: TestNavHostController
+ lateinit var navController: NavHostController
composeTestRule.setContent {
- navController = createNavController()
+ navController = rememberNavController(remember { TestNavigator() })
navController.graph = navController.createGraph(startDestination = FIRST_DESTINATION) {
test(FIRST_DESTINATION)
@@ -106,7 +103,7 @@
}
composeTestRule.runOnUiThread {
- navController.setCurrentDestination(SECOND_DESTINATION)
+ navController.navigate(SECOND_DESTINATION)
navController.popBackStack()
}
@@ -120,7 +117,7 @@
var currentBackStackEntry: State<NavBackStackEntry?> = mutableStateOf(null)
lateinit var navController: NavController
composeTestRule.setContent {
- navController = createNavController()
+ navController = rememberNavController(remember { TestNavigator() })
navController.graph = navController.createGraph(startDestination = FIRST_DESTINATION) {
test(FIRST_DESTINATION)
@@ -156,7 +153,7 @@
var currentBackStackEntry: State<NavBackStackEntry?> = mutableStateOf(null)
lateinit var navController: NavController
composeTestRule.setContent {
- navController = createNavController()
+ navController = rememberNavController(remember { TestNavigator() })
navController.graph = navController.createGraph(startDestination = FIRST_DESTINATION) {
test(FIRST_DESTINATION)
@@ -227,7 +224,7 @@
fun testGetBackStackEntry() {
lateinit var navController: NavController
composeTestRule.setContent {
- navController = createNavController()
+ navController = rememberNavController(remember { TestNavigator() })
navController.graph = navController.createGraph(startDestination = FIRST_DESTINATION) {
test(FIRST_DESTINATION)
@@ -256,7 +253,7 @@
fun testGetBackStackEntryNoEntryFound() {
lateinit var navController: NavController
composeTestRule.setContent {
- navController = createNavController()
+ navController = rememberNavController(remember { TestNavigator() })
navController.graph = navController.createGraph(startDestination = FIRST_DESTINATION) {
test(FIRST_DESTINATION)
@@ -279,14 +276,6 @@
)
}
}
-
- @Composable
- private fun createNavController(): TestNavHostController {
- val navController = TestNavHostController(LocalContext.current)
- val navigator = TestNavigator()
- navController.navigatorProvider += navigator
- return navController
- }
}
private const val FIRST_DESTINATION = "first"
diff --git a/navigation/navigation-compose/src/androidTest/java/androidx/navigation/compose/NavHostTest.kt b/navigation/navigation-compose/src/androidTest/java/androidx/navigation/compose/NavHostTest.kt
index 49bb74d..d7f6d91 100644
--- a/navigation/navigation-compose/src/androidTest/java/androidx/navigation/compose/NavHostTest.kt
+++ b/navigation/navigation-compose/src/androidTest/java/androidx/navigation/compose/NavHostTest.kt
@@ -485,6 +485,13 @@
composeTestRule.onNodeWithText(first).assertExists()
composeTestRule.onNodeWithText(second).assertExists()
+ assertThat(navController.visibleEntries.value)
+ .containsExactly(
+ firstEntry,
+ navController.currentBackStackEntry
+ )
+ .inOrder()
+
composeTestRule.mainClock.autoAdvance = true
composeTestRule.runOnIdle {
diff --git a/navigation/navigation-compose/src/main/java/androidx/navigation/compose/NavHostController.kt b/navigation/navigation-compose/src/main/java/androidx/navigation/compose/NavHostController.kt
index 21ee09d..92d04f4 100644
--- a/navigation/navigation-compose/src/main/java/androidx/navigation/compose/NavHostController.kt
+++ b/navigation/navigation-compose/src/main/java/androidx/navigation/compose/NavHostController.kt
@@ -29,7 +29,9 @@
import androidx.compose.ui.platform.LocalContext
import androidx.navigation.NavBackStackEntry
import androidx.navigation.NavController
+import androidx.navigation.NavDestination
import androidx.navigation.NavHostController
+import androidx.navigation.Navigator
/**
* Gets the current navigation back stack entry as a [MutableState]. When the given navController
@@ -58,16 +60,24 @@
/**
* Creates a NavHostController that handles the adding of the [ComposeNavigator] and
- * [DialogNavigator]. Additional [androidx.navigation.Navigator] instances should be added
- * in a [androidx.compose.runtime.SideEffect] block.
+ * [DialogNavigator]. Additional [Navigator] instances can be passed through [navigators] to
+ * be applied to the returned NavController. Note that each [Navigator] must be separately
+ * remembered before being passed in here: any changes to those inputs will cause the
+ * NavController to be recreated.
*
* @see NavHost
*/
@Composable
-public fun rememberNavController(): NavHostController {
+public fun rememberNavController(
+ vararg navigators: Navigator<out NavDestination>
+): NavHostController {
val context = LocalContext.current
- return rememberSaveable(saver = NavControllerSaver(context)) {
+ return rememberSaveable(inputs = navigators, saver = NavControllerSaver(context)) {
createNavController(context)
+ }.apply {
+ for (navigator in navigators) {
+ navigatorProvider.addNavigator(navigator)
+ }
}
}
diff --git a/navigation/navigation-runtime/api/current.txt b/navigation/navigation-runtime/api/current.txt
index 9499aad..1b18046 100644
--- a/navigation/navigation-runtime/api/current.txt
+++ b/navigation/navigation-runtime/api/current.txt
@@ -104,6 +104,7 @@
method public androidx.navigation.NavigatorProvider getNavigatorProvider();
method public androidx.navigation.NavBackStackEntry? getPreviousBackStackEntry();
method public androidx.lifecycle.ViewModelStoreOwner getViewModelStoreOwner(@IdRes int navGraphId);
+ method public final kotlinx.coroutines.flow.StateFlow<java.util.List<androidx.navigation.NavBackStackEntry>> getVisibleEntries();
method @MainThread public boolean handleDeepLink(android.content.Intent? intent);
method @MainThread public void navigate(@IdRes int resId);
method @MainThread public void navigate(@IdRes int resId, android.os.Bundle? args);
@@ -142,6 +143,7 @@
property public androidx.navigation.NavInflater navInflater;
property public androidx.navigation.NavigatorProvider navigatorProvider;
property public androidx.navigation.NavBackStackEntry? previousBackStackEntry;
+ property public final kotlinx.coroutines.flow.StateFlow<java.util.List<androidx.navigation.NavBackStackEntry>> visibleEntries;
field public static final androidx.navigation.NavController.Companion Companion;
field public static final String KEY_DEEP_LINK_INTENT = "android-support-nav:controller:deepLinkIntent";
}
diff --git a/navigation/navigation-runtime/api/public_plus_experimental_current.txt b/navigation/navigation-runtime/api/public_plus_experimental_current.txt
index 9499aad..1b18046 100644
--- a/navigation/navigation-runtime/api/public_plus_experimental_current.txt
+++ b/navigation/navigation-runtime/api/public_plus_experimental_current.txt
@@ -104,6 +104,7 @@
method public androidx.navigation.NavigatorProvider getNavigatorProvider();
method public androidx.navigation.NavBackStackEntry? getPreviousBackStackEntry();
method public androidx.lifecycle.ViewModelStoreOwner getViewModelStoreOwner(@IdRes int navGraphId);
+ method public final kotlinx.coroutines.flow.StateFlow<java.util.List<androidx.navigation.NavBackStackEntry>> getVisibleEntries();
method @MainThread public boolean handleDeepLink(android.content.Intent? intent);
method @MainThread public void navigate(@IdRes int resId);
method @MainThread public void navigate(@IdRes int resId, android.os.Bundle? args);
@@ -142,6 +143,7 @@
property public androidx.navigation.NavInflater navInflater;
property public androidx.navigation.NavigatorProvider navigatorProvider;
property public androidx.navigation.NavBackStackEntry? previousBackStackEntry;
+ property public final kotlinx.coroutines.flow.StateFlow<java.util.List<androidx.navigation.NavBackStackEntry>> visibleEntries;
field public static final androidx.navigation.NavController.Companion Companion;
field public static final String KEY_DEEP_LINK_INTENT = "android-support-nav:controller:deepLinkIntent";
}
diff --git a/navigation/navigation-runtime/api/restricted_current.txt b/navigation/navigation-runtime/api/restricted_current.txt
index 9499aad..1b18046 100644
--- a/navigation/navigation-runtime/api/restricted_current.txt
+++ b/navigation/navigation-runtime/api/restricted_current.txt
@@ -104,6 +104,7 @@
method public androidx.navigation.NavigatorProvider getNavigatorProvider();
method public androidx.navigation.NavBackStackEntry? getPreviousBackStackEntry();
method public androidx.lifecycle.ViewModelStoreOwner getViewModelStoreOwner(@IdRes int navGraphId);
+ method public final kotlinx.coroutines.flow.StateFlow<java.util.List<androidx.navigation.NavBackStackEntry>> getVisibleEntries();
method @MainThread public boolean handleDeepLink(android.content.Intent? intent);
method @MainThread public void navigate(@IdRes int resId);
method @MainThread public void navigate(@IdRes int resId, android.os.Bundle? args);
@@ -142,6 +143,7 @@
property public androidx.navigation.NavInflater navInflater;
property public androidx.navigation.NavigatorProvider navigatorProvider;
property public androidx.navigation.NavBackStackEntry? previousBackStackEntry;
+ property public final kotlinx.coroutines.flow.StateFlow<java.util.List<androidx.navigation.NavBackStackEntry>> visibleEntries;
field public static final androidx.navigation.NavController.Companion Companion;
field public static final String KEY_DEEP_LINK_INTENT = "android-support-nav:controller:deepLinkIntent";
}
diff --git a/navigation/navigation-runtime/src/androidTest/java/androidx/navigation/NavBackStackEntryLifecycleTest.kt b/navigation/navigation-runtime/src/androidTest/java/androidx/navigation/NavBackStackEntryLifecycleTest.kt
index 3010d9a..c77a771 100644
--- a/navigation/navigation-runtime/src/androidTest/java/androidx/navigation/NavBackStackEntryLifecycleTest.kt
+++ b/navigation/navigation-runtime/src/androidTest/java/androidx/navigation/NavBackStackEntryLifecycleTest.kt
@@ -31,6 +31,11 @@
import androidx.testutils.TestNavigator
import androidx.testutils.test
import com.google.common.truth.Truth.assertWithMessage
+import kotlinx.coroutines.flow.collect
+import kotlinx.coroutines.flow.onEach
+import kotlinx.coroutines.flow.take
+import kotlinx.coroutines.flow.withIndex
+import kotlinx.coroutines.runBlocking
import org.junit.Test
import org.junit.runner.RunWith
import org.mockito.Mockito.inOrder
@@ -102,6 +107,33 @@
.isEqualTo(Lifecycle.State.DESTROYED)
}
+ @UiThreadTest
+ @Test
+ @Suppress("DEPRECATION", "EXPERIMENTAL_API_USAGE")
+ fun visibleEntriesFlow() = runBlocking {
+ val navController = createNavController()
+ navController.graph = navController.createGraph(startDestination = 1) {
+ test(1)
+ test(2)
+ test(3)
+ }
+
+ navController.visibleEntries
+ .take(navController.graph.count())
+ .withIndex()
+ .onEach { (index, list) ->
+ val expectedDestination = index + 1
+ assertWithMessage("Flow emitted unexpected back stack entry (wrong destination)")
+ .that(list)
+ .containsExactly(navController.currentBackStackEntry)
+
+ if (expectedDestination < navController.graph.count()) {
+ navController.navigate(expectedDestination + 1)
+ }
+ }
+ .collect()
+ }
+
/**
* Test that navigating from a sibling to a FloatingWindow sibling leaves the previous
* destination started.
diff --git a/navigation/navigation-runtime/src/main/java/androidx/navigation/NavController.kt b/navigation/navigation-runtime/src/main/java/androidx/navigation/NavController.kt
index 36d5ee2..5cc2805 100644
--- a/navigation/navigation-runtime/src/main/java/androidx/navigation/NavController.kt
+++ b/navigation/navigation-runtime/src/main/java/androidx/navigation/NavController.kt
@@ -40,12 +40,14 @@
import androidx.lifecycle.ViewModelStore
import androidx.lifecycle.ViewModelStoreOwner
import androidx.navigation.NavDestination.Companion.createRoute
-import androidx.navigation.NavDestination.Companion.hierarchy
import androidx.navigation.NavGraph.Companion.findStartDestination
import kotlinx.coroutines.channels.BufferOverflow
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.MutableSharedFlow
+import kotlinx.coroutines.flow.MutableStateFlow
+import kotlinx.coroutines.flow.StateFlow
import kotlinx.coroutines.flow.asSharedFlow
+import kotlinx.coroutines.flow.asStateFlow
import java.util.concurrent.CopyOnWriteArrayList
import java.util.concurrent.atomic.AtomicInteger
@@ -109,6 +111,30 @@
*/
@get:RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
public open val backQueue: ArrayDeque<NavBackStackEntry> = ArrayDeque()
+
+ private val _visibleEntries: MutableStateFlow<List<NavBackStackEntry>> =
+ MutableStateFlow(emptyList())
+
+ /**
+ * A [StateFlow] that will emit the currently visible [NavBackStackEntries][NavBackStackEntry]
+ * whenever they change. If there is no visible [NavBackStackEntry], this will be set to an
+ * empty list.
+ *
+ * - `CREATED` entries are listed first and include all entries that have been popped from
+ * the back stack and are in the process of completing their exit transition
+ * - `STARTED` entries on the back stack are next and include all entries that are running
+ * their enter transition and entries whose destination is partially covered by a
+ * `FloatingWindow` destination
+ * - The last entry in the list is the topmost entry in the back stack and is in the `RESUMED`
+ * state only if its enter transition has completed. Otherwise it too will be `STARTED`.
+ *
+ * Note that the `Lifecycle` of any entry cannot be higher than the containing
+ * Activity/Fragment - if the Activity is not `RESUMED`, no entry will be `RESUMED`, no matter
+ * what the transition state is.
+ */
+ public val visibleEntries: StateFlow<List<NavBackStackEntry>> =
+ _visibleEntries.asStateFlow()
+
private val childToParentEntries = mutableMapOf<NavBackStackEntry, NavBackStackEntry>()
private val parentToChildCount = mutableMapOf<NavBackStackEntry, AtomicInteger>()
@@ -315,8 +341,10 @@
viewModel?.clear(entry.id)
}
updateBackStackLifecycle()
+ _visibleEntries.tryEmit(populateVisibleEntries())
} else if (!this@NavControllerNavigatorState.isNavigating) {
updateBackStackLifecycle()
+ _visibleEntries.tryEmit(populateVisibleEntries())
}
// else, updateBackStackLifecycle() will be called after any ongoing navigate() call
// completes
@@ -866,6 +894,7 @@
}
_currentBackStackEntryFlow.tryEmit(backStackEntry)
}
+ _visibleEntries.tryEmit(populateVisibleEntries())
}
return lastBackStackEntry != null
}
@@ -950,6 +979,26 @@
}
}
+ internal fun populateVisibleEntries(): List<NavBackStackEntry> {
+ val entries = mutableListOf<NavBackStackEntry>()
+ // Add any transitioning entries that are not at least STARTED
+ navigatorState.values.forEach { state ->
+ entries += state.transitionsInProgress.value.filter { entry ->
+ !entries.contains(entry) &&
+ !entry.lifecycle.currentState.isAtLeast(Lifecycle.State.STARTED)
+ }
+ }
+ // Add any STARTED entries from the backQueue. This will include the topmost
+ // non-FloatingWindow destination plus every FloatingWindow destination above it.
+ entries += backQueue.filter { entry ->
+ !entries.contains(entry) &&
+ entry.lifecycle.currentState.isAtLeast(Lifecycle.State.STARTED)
+ }
+ return entries.filter {
+ it.destination !is NavGraph
+ }
+ }
+
/**
* The [inflater][NavInflater] for this controller.
*
diff --git a/navigation/navigation-safe-args-generator/src/main/kotlin/androidx/navigation/safe/args/generator/kotlin/KotlinNavWriter.kt b/navigation/navigation-safe-args-generator/src/main/kotlin/androidx/navigation/safe/args/generator/kotlin/KotlinNavWriter.kt
index 1439810..57cac57 100644
--- a/navigation/navigation-safe-args-generator/src/main/kotlin/androidx/navigation/safe/args/generator/kotlin/KotlinNavWriter.kt
+++ b/navigation/navigation-safe-args-generator/src/main/kotlin/androidx/navigation/safe/args/generator/kotlin/KotlinNavWriter.kt
@@ -267,9 +267,12 @@
)
}
endControlFlow()
- return@map tempVal
- }
- addStatement("return·%T(${tempVariables.joinToString(", ") { it }})", className)
+ arg
+ }.sortedBy { it.defaultValue != null }
+ addStatement(
+ "return·%T(${tempVariables.joinToString(", ") { "__${it.sanitizedName}" }})",
+ className
+ )
}.build()
val toSavedStateHandleFunSpec = FunSpec.builder("toSavedStateHandle").apply {
@@ -328,9 +331,12 @@
)
}
endControlFlow()
- return@map tempVal
- }
- addStatement("return·%T(${tempVariables.joinToString(", ") { it }})", className)
+ arg
+ }.sortedBy { it.defaultValue != null }
+ addStatement(
+ "return·%T(${tempVariables.joinToString(", ") { "__${it.sanitizedName}" }})",
+ className
+ )
}.build()
val typeSpec = TypeSpec.classBuilder(className)
diff --git a/navigation/navigation-safe-args-generator/src/test/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
index 95ca60f..90bfdeb 100644
--- a/navigation/navigation-safe-args-generator/src/test/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
@@ -168,8 +168,8 @@
} else {
__enumArg = AccessMode.READ
}
- return MainFragmentArgs(__main, __optional, __reference, __referenceZeroDefaultValue,
- __floatArg, __floatArrayArg, __objectArrayArg, __boolArg, __optionalParcelable, __enumArg)
+ return MainFragmentArgs(__main, __floatArrayArg, __objectArrayArg, __optional, __reference,
+ __referenceZeroDefaultValue, __floatArg, __boolArg, __optionalParcelable, __enumArg)
}
@JvmStatic
@@ -261,8 +261,8 @@
} else {
__enumArg = AccessMode.READ
}
- return MainFragmentArgs(__main, __optional, __reference, __referenceZeroDefaultValue,
- __floatArg, __floatArrayArg, __objectArrayArg, __boolArg, __optionalParcelable, __enumArg)
+ return MainFragmentArgs(__main, __floatArrayArg, __objectArrayArg, __optional, __reference,
+ __referenceZeroDefaultValue, __floatArg, __boolArg, __optionalParcelable, __enumArg)
}
}
}
diff --git a/paging/paging-common/lint-baseline.xml b/paging/paging-common/lint-baseline.xml
new file mode 100644
index 0000000..271727a
--- /dev/null
+++ b/paging/paging-common/lint-baseline.xml
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<issues format="6" by="lint 7.1.0-dev" type="baseline" client="gradle" dependencies="false" name="AGP (7.1.0-dev)" variant="all" version="7.1.0-dev">
+
+ <issue
+ id="SupportAnnotationUsage"
+ message="Did you mean `@get:VisibleForTesting` ? Without `get:` this annotates the constructor parameter itself instead of the associated getter."
+ errorLine1=" @VisibleForTesting(otherwise = VisibleForTesting.PRIVATE)"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/main/kotlin/androidx/paging/PageFetcher.kt"
+ line="212"
+ column="9"/>
+ </issue>
+
+ <issue
+ id="SupportAnnotationUsage"
+ message="Did you mean `@get:RestrictTo` ? Without `get:` this annotates the constructor parameter itself instead of the associated getter."
+ errorLine1=" @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/main/kotlin/androidx/paging/PagedList.kt"
+ line="125"
+ column="5"/>
+ </issue>
+
+</issues>
diff --git a/paging/paging-common/src/main/kotlin/androidx/paging/CombinedLoadStates.kt b/paging/paging-common/src/main/kotlin/androidx/paging/CombinedLoadStates.kt
index fa88573..349f058 100644
--- a/paging/paging-common/src/main/kotlin/androidx/paging/CombinedLoadStates.kt
+++ b/paging/paging-common/src/main/kotlin/androidx/paging/CombinedLoadStates.kt
@@ -18,6 +18,9 @@
/**
* Collection of pagination [LoadState]s for both a [PagingSource], and [RemoteMediator].
+ *
+ * Note: The [LoadType] [REFRESH][LoadType.REFRESH] always has [LoadState.endOfPaginationReached]
+ * set to `false`.
*/
public class CombinedLoadStates(
/**
diff --git a/paging/paging-common/src/main/kotlin/androidx/paging/FlowExt.kt b/paging/paging-common/src/main/kotlin/androidx/paging/FlowExt.kt
index 460d414..a43c89b 100644
--- a/paging/paging-common/src/main/kotlin/androidx/paging/FlowExt.kt
+++ b/paging/paging-common/src/main/kotlin/androidx/paging/FlowExt.kt
@@ -16,6 +16,11 @@
package androidx.paging
+import androidx.paging.CombineSource.INITIAL
+import androidx.paging.CombineSource.OTHER
+import androidx.paging.CombineSource.RECEIVER
+import kotlinx.coroutines.CompletableDeferred
+import kotlinx.coroutines.Job
import kotlinx.coroutines.channels.SendChannel
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.FlowCollector
@@ -23,6 +28,11 @@
import kotlinx.coroutines.flow.collectLatest
import kotlinx.coroutines.flow.emitAll
import kotlinx.coroutines.flow.flow
+import kotlinx.coroutines.launch
+import kotlinx.coroutines.sync.Mutex
+import kotlinx.coroutines.sync.withLock
+import kotlinx.coroutines.yield
+import java.util.concurrent.atomic.AtomicInteger
/**
* This File includes custom flow operators that we implement to avoid using experimental APIs
@@ -98,4 +108,114 @@
override suspend fun emit(value: T) {
channel.send(value)
}
+}
+
+/**
+ * Similar to [kotlinx.coroutines.flow.combine], except it never batches reads from its Flows, so
+ * [transform] is always guaranteed to get called for every emission from either Flow after the
+ * initial call (which waits for the first emission from both Flows).
+ *
+ * The emissions for both Flows are also guaranteed to get buffered, so if one Flow emits
+ * multiple times before the other does, [transform] will get called for each emission from the
+ * first Flow instead of just once with the latest values.
+ *
+ * @param transform The transform to apply on each update. This is first called after awaiting an
+ * initial emission from both Flows, and then is guaranteed to be called for every emission from
+ * either Flow.
+ *
+ * For convenience, [CombineSource] is also passed to the transform, which indicates the
+ * origin of the update with the following possible values:
+ * * [INITIAL]: Initial emission from both Flows
+ * * [RECEIVER]: Triggered by new emission from receiver
+ * * [OTHER]: Triggered by new emission from [otherFlow]
+ */
+internal suspend inline fun <T1, T2, R> Flow<T1>.combineWithoutBatching(
+ otherFlow: Flow<T2>,
+ crossinline transform: suspend (T1, T2, updateFrom: CombineSource) -> R,
+): Flow<R> {
+ return simpleChannelFlow {
+ val incompleteFlows = AtomicInteger(2)
+ val unbatchedFlowCombiner = UnbatchedFlowCombiner<T1, T2> { t1, t2, updateFrom ->
+ send(transform(t1, t2, updateFrom))
+ }
+ val parentJob = Job()
+ arrayOf(this@combineWithoutBatching, otherFlow).forEachIndexed { index, flow ->
+ launch(parentJob) {
+ try {
+ flow.collect { value ->
+ unbatchedFlowCombiner.onNext(index, value)
+
+ // Make this more fair, giving the other flow a chance to emit.
+ yield()
+ }
+ } finally {
+ if (incompleteFlows.decrementAndGet() == 0) {
+ close()
+ }
+ }
+ }
+ }
+
+ awaitClose { parentJob.cancel() }
+ }
+}
+
+/**
+ * Helper class for [UnbatchedFlowCombiner], which handles dispatching the combined values in the
+ * correct order, and with [CombineSource].
+ *
+ * NOTE: This implementation relies on the fact that [onNext] is called in-order for emissions
+ * from the same Flow. This means that concurrently calling [onNext] with the same index will not
+ * work.
+ *
+ * @see combineWithoutBatching
+ */
+internal class UnbatchedFlowCombiner<T1, T2>(
+ private val send: suspend (t1: T1, t2: T2, updateFrom: CombineSource) -> Unit
+) {
+ private val initialDispatched = CompletableDeferred<Unit>()
+ private val lock = Mutex()
+ private val valueReceived = Array(2) { CompletableDeferred<Unit>() }
+ private val values = Array<Any?>(2) { NULL }
+
+ suspend fun onNext(index: Int, value: Any?) {
+ // Allow the first value to dispatch immediately, but for subsequent values, we should
+ // wait until the other flow emits, so that we don't overwrite the previous value.
+ if (valueReceived[index].isCompleted) {
+ // NOTE: We use a separate Completable here because just awaiting
+ // valueReceived[1 - index] could potentially allow multiple calls to onNext from the
+ // same Flow to trigger out of order.
+ initialDispatched.await()
+ } else {
+ valueReceived[index].complete(Unit)
+ }
+
+ lock.withLock {
+ val isInitial = values.any { it === NULL }
+ values[index] = value
+
+ if (values.none { it === NULL }) {
+ val updateFrom = when {
+ isInitial -> INITIAL
+ index == 0 -> RECEIVER
+ else -> OTHER
+ }
+
+ @Suppress("UNCHECKED_CAST")
+ send(values[0] as T1, values[1] as T2, updateFrom)
+ initialDispatched.complete(Unit)
+ }
+ }
+ }
+}
+
+/**
+ * Used to indicate which Flow emission triggered the transform block in [combineWithoutBatching].
+ *
+ * @see combineWithoutBatching
+ */
+internal enum class CombineSource {
+ INITIAL,
+ RECEIVER,
+ OTHER,
}
\ No newline at end of file
diff --git a/paging/paging-common/src/main/kotlin/androidx/paging/LoadState.kt b/paging/paging-common/src/main/kotlin/androidx/paging/LoadState.kt
index 11c5d59..d554721 100644
--- a/paging/paging-common/src/main/kotlin/androidx/paging/LoadState.kt
+++ b/paging/paging-common/src/main/kotlin/androidx/paging/LoadState.kt
@@ -28,6 +28,9 @@
* 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.
*
+ * Note: The [LoadType] [REFRESH][LoadType.REFRESH] always has [LoadState.endOfPaginationReached]
+ * set to `false`.
+ *
* @see LoadType
*/
public sealed class LoadState(
diff --git a/paging/paging-common/src/main/kotlin/androidx/paging/PageFetcher.kt b/paging/paging-common/src/main/kotlin/androidx/paging/PageFetcher.kt
index 37ecac5..593a41b 100644
--- a/paging/paging-common/src/main/kotlin/androidx/paging/PageFetcher.kt
+++ b/paging/paging-common/src/main/kotlin/androidx/paging/PageFetcher.kt
@@ -17,19 +17,23 @@
package androidx.paging
import androidx.annotation.VisibleForTesting
+import androidx.paging.CombineSource.RECEIVER
+import androidx.paging.PageEvent.Drop
+import androidx.paging.PageEvent.Insert
+import androidx.paging.PageEvent.LoadStateUpdate
import androidx.paging.RemoteMediator.InitializeAction.LAUNCH_INITIAL_REFRESH
+import kotlinx.coroutines.Job
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.collect
import kotlinx.coroutines.flow.filterNotNull
import kotlinx.coroutines.flow.onStart
-import kotlinx.coroutines.launch
internal class PageFetcher<Key : Any, Value : Any>(
private val pagingSourceFactory: suspend () -> PagingSource<Key, Value>,
private val initialKey: Key?,
private val config: PagingConfig,
@OptIn(ExperimentalPagingApi::class)
- private val remoteMediator: RemoteMediator<Key, Value>? = null
+ remoteMediator: RemoteMediator<Key, Value>? = null
) {
/**
* Channel of refresh signals that would trigger a new instance of [PageFetcherSnapshot].
@@ -46,10 +50,11 @@
// The object built by paging builder can maintain the scope so that on rotation we don't stop
// the paging.
val flow: Flow<PagingData<Value>> = simpleChannelFlow {
- @OptIn(androidx.paging.ExperimentalPagingApi::class)
+ @OptIn(ExperimentalPagingApi::class)
val remoteMediatorAccessor = remoteMediator?.let {
RemoteMediatorAccessor(this, it)
}
+
refreshEvents
.flow
.onStart {
@@ -87,6 +92,7 @@
?: initialKey
previousGeneration?.snapshot?.close()
+ previousGeneration?.job?.cancel()
GenerationInfo(
snapshot = PageFetcherSnapshot(
@@ -102,78 +108,20 @@
previousPagingState = previousPagingState,
),
state = previousPagingState,
+ job = Job(),
)
}
.filterNotNull()
.simpleMapLatest { generation ->
val downstreamFlow = generation.snapshot
- .injectRemoteEvents(remoteMediatorAccessor)
+ .injectRemoteEvents(generation.job, remoteMediatorAccessor)
PagingData(
flow = downstreamFlow,
receiver = PagerUiReceiver(generation.snapshot, retryEvents)
)
}
- .collect { send(it) }
- }
-
- // TODO(b/195028524) add logic to inject the correct source states upon new generation
- private fun PageFetcherSnapshot<Key, Value>.injectRemoteEvents(
- accessor: RemoteMediatorAccessor<Key, Value>?
- ): Flow<PageEvent<Value>> {
- if (accessor == null) return pageEventFlow
-
- return simpleChannelFlow<PageEvent<Value>> {
- val sourceStates = MutableLoadStateCollection()
- var mediatorStates = LoadStates.IDLE
-
- launch {
- var prev = LoadStates.IDLE
- accessor.state.collect { newStates ->
- if (prev != newStates) {
- mediatorStates = newStates
- send(
- PageEvent.LoadStateUpdate(
- source = sourceStates.snapshot(),
- mediator = mediatorStates
- )
- )
- }
- prev = newStates
- }
- }
-
- this@injectRemoteEvents.pageEventFlow.collect { event ->
- when (event) {
- is PageEvent.Insert -> {
- sourceStates.set(event.sourceLoadStates)
- mediatorStates = accessor.state.value
- send(
- event.copy(
- sourceLoadStates = event.sourceLoadStates,
- mediatorLoadStates = mediatorStates
- )
- )
- }
- is PageEvent.Drop -> {
- sourceStates.set(
- type = event.loadType,
- state = LoadState.NotLoading.Incomplete
- )
- send(event)
- }
- is PageEvent.LoadStateUpdate -> {
- sourceStates.set(event.source)
- send(
- PageEvent.LoadStateUpdate(
- source = event.source,
- mediator = mediatorStates
- )
- )
- }
- }
- }
- }
+ .collect(::send)
}
fun refresh() {
@@ -184,6 +132,56 @@
refreshEvents.send(false)
}
+ private fun PageFetcherSnapshot<Key, Value>.injectRemoteEvents(
+ job: Job,
+ accessor: RemoteMediatorAccessor<Key, Value>?
+ ): Flow<PageEvent<Value>> {
+ if (accessor == null) return pageEventFlow
+
+ val sourceStates = MutableLoadStateCollection()
+ // We wrap this in a cancelableChannelFlow to allow co-operative cancellation, otherwise
+ // RemoteMediatorAccessor's StateFlow will keep this Flow running on old generations.
+ return cancelableChannelFlow(job) {
+ accessor.state
+ // Note: Combine waits for PageFetcherSnapshot to emit an event before sending
+ // anything. This avoids sending the initial idle state, since it would cause
+ // load state flickering on rapid invalidation.
+ .combineWithoutBatching(pageEventFlow) { remoteState, sourceEvent, updateFrom ->
+ if (updateFrom != RECEIVER) {
+ when (sourceEvent) {
+ is Insert -> {
+ sourceStates.set(sourceEvent.sourceLoadStates)
+ sourceEvent.copy(
+ sourceLoadStates = sourceEvent.sourceLoadStates,
+ mediatorLoadStates = remoteState,
+ )
+ }
+ is Drop -> {
+ sourceStates.set(
+ type = sourceEvent.loadType,
+ state = LoadState.NotLoading.Incomplete
+ )
+ sourceEvent
+ }
+ is LoadStateUpdate -> {
+ sourceStates.set(sourceEvent.source)
+ LoadStateUpdate(
+ source = sourceEvent.source,
+ mediator = remoteState,
+ )
+ }
+ }
+ } else {
+ LoadStateUpdate(
+ source = sourceStates.snapshot(),
+ mediator = remoteState,
+ )
+ }
+ }
+ .collect { send(it) }
+ }
+ }
+
private suspend fun generateNewPagingSource(
previousPagingSource: PagingSource<Key, Value>?
): PagingSource<Key, Value> {
@@ -226,6 +224,7 @@
private class GenerationInfo<Key : Any, Value : Any>(
val snapshot: PageFetcherSnapshot<Key, Value>,
- val state: PagingState<Key, Value>?
+ val state: PagingState<Key, Value>?,
+ val job: Job,
)
}
diff --git a/paging/paging-common/src/main/kotlin/androidx/paging/PageFetcherSnapshot.kt b/paging/paging-common/src/main/kotlin/androidx/paging/PageFetcherSnapshot.kt
index 180f454..0675ade 100644
--- a/paging/paging-common/src/main/kotlin/androidx/paging/PageFetcherSnapshot.kt
+++ b/paging/paging-common/src/main/kotlin/androidx/paging/PageFetcherSnapshot.kt
@@ -43,6 +43,7 @@
import kotlinx.coroutines.flow.filter
import kotlinx.coroutines.flow.flowOf
import kotlinx.coroutines.flow.map
+import kotlinx.coroutines.flow.onStart
import kotlinx.coroutines.launch
import java.util.concurrent.atomic.AtomicBoolean
@@ -77,7 +78,9 @@
private val pageEventChannelFlowJob = Job()
- val pageEventFlow: Flow<PageEvent<Value>> = cancelableChannelFlow(pageEventChannelFlowJob) {
+ val pageEventFlow: Flow<PageEvent<Value>> = cancelableChannelFlow<PageEvent<Value>>(
+ pageEventChannelFlowJob
+ ) {
check(pageEventChCollected.compareAndSet(false, true)) {
"Attempt to collect twice from pageEventFlow, which is an illegal operation. Did you " +
"forget to call Flow<PagingData<*>>.cachedIn(coroutineScope)?"
@@ -163,6 +166,12 @@
if (stateHolder.withLock { state -> state.sourceLoadStates.get(REFRESH) } !is Error) {
startConsumingHints()
}
+ }.onStart {
+ // Immediately emit the initial load state when creating a new generation to give
+ // PageFetcher a real event from source side as soon as possible. This allows PageFetcher
+ // to operate on this stream in a way that waits for a real event (for example, by using
+ // Flow.combine) without the consequence of getting "stuck".
+ emit(LoadStateUpdate(stateHolder.withLock { it.sourceLoadStates.snapshot() }))
}
@Suppress("SuspendFunctionOnCoroutineScope")
@@ -274,12 +283,12 @@
val params = loadParams(REFRESH, initialKey)
when (val result = pagingSource.load(params)) {
is Page<Key, Value> -> {
+ // Atomically update load states + pages while still holding the mutex, otherwise
+ // remote state can race here and lead to confusing load states.
val insertApplied = stateHolder.withLock { state ->
- state.insert(0, REFRESH, result)
- }
+ val insertApplied = state.insert(0, REFRESH, result)
- // Update loadStates which are sent along with this load's Insert PageEvent.
- stateHolder.withLock { state ->
+ // Update loadStates which are sent along with this load's Insert PageEvent.
state.sourceLoadStates.set(
type = REFRESH,
state = NotLoading.Incomplete
@@ -296,6 +305,8 @@
state = NotLoading.Complete
)
}
+
+ insertApplied
}
// Send insert event after load state updates, so that endOfPaginationReached is
diff --git a/paging/paging-common/src/main/kotlin/androidx/paging/PageFetcherSnapshotState.kt b/paging/paging-common/src/main/kotlin/androidx/paging/PageFetcherSnapshotState.kt
index dfd7eeb..209142b 100644
--- a/paging/paging-common/src/main/kotlin/androidx/paging/PageFetcherSnapshotState.kt
+++ b/paging/paging-common/src/main/kotlin/androidx/paging/PageFetcherSnapshotState.kt
@@ -18,6 +18,7 @@
import androidx.annotation.CheckResult
import androidx.paging.LoadState.NotLoading
+import androidx.paging.LoadState.Loading
import androidx.paging.LoadType.APPEND
import androidx.paging.LoadType.PREPEND
import androidx.paging.LoadType.REFRESH
@@ -104,8 +105,17 @@
*/
internal val failedHintsByLoadType = mutableMapOf<LoadType, ViewportHint>()
- // only the local load states
- internal var sourceLoadStates = MutableLoadStateCollection()
+ // Only track the local load states, remote states are injected from PageFetcher. This class
+ // only tracks state within a single generation from source side.
+ internal var sourceLoadStates = MutableLoadStateCollection().apply {
+ // Synchronously initialize REFRESH with Loading.
+ // NOTE: It is important that we do this synchronously on init, since PageFetcherSnapshot
+ // expects to send this initial state immediately. It is always correct for a new
+ // generation to immediately begin loading refresh, so rather than start with NotLoading
+ // then updating to Loading, we simply start with Loading immediately to create less
+ // churn downstream.
+ set(REFRESH, Loading)
+ }
private set
fun consumePrependGenerationIdAsFlow(): Flow<Int> {
diff --git a/paging/paging-common/src/main/kotlin/androidx/paging/RemoteMediatorAccessor.kt b/paging/paging-common/src/main/kotlin/androidx/paging/RemoteMediatorAccessor.kt
index 0c6bd29..0d04153 100644
--- a/paging/paging-common/src/main/kotlin/androidx/paging/RemoteMediatorAccessor.kt
+++ b/paging/paging-common/src/main/kotlin/androidx/paging/RemoteMediatorAccessor.kt
@@ -119,7 +119,10 @@
// b) it might be blocked due to refresh being required first -> Incomplete
// c) it might have never run -> Incomplete
return when (blockState) {
- COMPLETED -> LoadState.NotLoading.Complete
+ COMPLETED -> when (loadType) {
+ LoadType.REFRESH -> LoadState.NotLoading.Incomplete
+ else -> LoadState.NotLoading.Complete
+ }
REQUIRES_REFRESH -> LoadState.NotLoading.Incomplete
UNBLOCKED -> LoadState.NotLoading.Incomplete
}
diff --git a/paging/paging-common/src/test/kotlin/androidx/paging/FlowExtTest.kt b/paging/paging-common/src/test/kotlin/androidx/paging/FlowExtTest.kt
new file mode 100644
index 0000000..441ce4b
--- /dev/null
+++ b/paging/paging-common/src/test/kotlin/androidx/paging/FlowExtTest.kt
@@ -0,0 +1,411 @@
+/*
+ * Copyright 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package androidx.paging
+
+import androidx.paging.CombineSource.INITIAL
+import androidx.paging.CombineSource.OTHER
+import androidx.paging.CombineSource.RECEIVER
+import com.google.common.truth.Truth.assertThat
+import kotlinx.coroutines.ExperimentalCoroutinesApi
+import kotlinx.coroutines.channels.Channel
+import kotlinx.coroutines.channels.Channel.Factory.BUFFERED
+import kotlinx.coroutines.delay
+import kotlinx.coroutines.flow.collect
+import kotlinx.coroutines.flow.combine
+import kotlinx.coroutines.flow.consumeAsFlow
+import kotlinx.coroutines.flow.emptyFlow
+import kotlinx.coroutines.flow.first
+import kotlinx.coroutines.flow.flow
+import kotlinx.coroutines.flow.flowOf
+import kotlinx.coroutines.flow.onEach
+import kotlinx.coroutines.flow.toList
+import kotlinx.coroutines.launch
+import kotlinx.coroutines.runBlocking
+import kotlinx.coroutines.test.TestCoroutineScope
+import kotlinx.coroutines.test.runBlockingTest
+import kotlinx.coroutines.yield
+import org.junit.Test
+import kotlin.random.Random
+
+@OptIn(ExperimentalCoroutinesApi::class)
+class FlowExtTest {
+ val testScope = TestCoroutineScope()
+
+ @Test
+ fun scan_basic() = testScope.runBlockingTest {
+ val arguments = mutableListOf<Pair<Int, Int>>()
+ assertThat(
+ flowOf(1, 2, 3).simpleScan(0) { acc, value ->
+ arguments.add(acc to value)
+ value + acc
+ }.toList()
+ ).containsExactly(
+ 0, 1, 3, 6
+ ).inOrder()
+ assertThat(arguments).containsExactly(
+ 0 to 1,
+ 1 to 2,
+ 3 to 3
+ ).inOrder()
+ }
+
+ @Test
+ fun scan_initialValue() = testScope.runBlockingTest {
+ assertThat(
+ emptyFlow<Int>().simpleScan("x") { _, value ->
+ "$value"
+ }.toList()
+ ).containsExactly("x")
+ }
+
+ @Test
+ fun runningReduce_basic() = testScope.runBlockingTest {
+ assertThat(
+ flowOf(1, 2, 3, 4).simpleRunningReduce { acc, value ->
+ acc + value
+ }.toList()
+ ).containsExactly(1, 3, 6, 10)
+ }
+
+ @Test
+ fun runningReduce_empty() = testScope.runBlockingTest {
+ assertThat(
+ emptyFlow<Int>().simpleRunningReduce { acc, value ->
+ acc + value
+ }.toList()
+ ).isEmpty()
+ }
+
+ @Test
+ fun mapLatest() = testScope.runBlockingTest {
+ assertThat(
+ flowOf(1, 2, 3, 4)
+ .onEach {
+ delay(1)
+ }
+ .simpleMapLatest { value ->
+ delay(value.toLong())
+ "$value-$value"
+ }.toList()
+ ).containsExactly(
+ "1-1", "4-4"
+ ).inOrder()
+ }
+
+ @Test
+ fun mapLatest_empty() = testScope.runBlockingTest {
+ assertThat(
+ emptyFlow<Int>().simpleMapLatest { value ->
+ "$value-$value"
+ }.toList()
+ ).isEmpty()
+ }
+
+ @Test
+ fun flatMapLatest() = testScope.runBlockingTest {
+ assertThat(
+ flowOf(1, 2, 3, 4)
+ .onEach {
+ delay(1)
+ }
+ .simpleFlatMapLatest { value ->
+ flow {
+ repeat(value) {
+ emit(value)
+ }
+ }
+ }.toList()
+ ).containsExactly(
+ 1, 2, 2, 3, 3, 3, 4, 4, 4, 4
+ ).inOrder()
+ }
+
+ @Test
+ fun flatMapLatest_empty() = testScope.runBlockingTest {
+ assertThat(
+ emptyFlow<Int>()
+ .simpleFlatMapLatest {
+ flowOf(it)
+ }.toList()
+ ).isEmpty()
+ }
+
+ @Test
+ fun combineWithoutBatching_buffersEmissions() = testScope.runBlockingTest {
+ val flow1 = Channel<Int>(BUFFERED)
+ val flow2 = Channel<String>(BUFFERED)
+
+ val result = mutableListOf<String>()
+ launch {
+ flow1.consumeAsFlow()
+ .combineWithoutBatching(flow2.consumeAsFlow()) { first, second, _ ->
+ "$first$second"
+ }
+ .collect(result::add)
+ }
+
+ flow1.send(1)
+ advanceUntilIdle()
+ assertThat(result).isEmpty()
+
+ flow1.send(2)
+ advanceUntilIdle()
+ assertThat(result).isEmpty()
+
+ flow2.send("A")
+ advanceUntilIdle()
+ assertThat(result).containsExactly("1A", "2A")
+
+ // This should automatically propagate cancellation to the launched collector.
+ flow1.close()
+ flow2.close()
+ }
+
+ @Test
+ fun combineWithoutBatching_doesNotBatchOnSlowTransform() = testScope.runBlockingTest {
+ val flow1 = flowOf(1, 2, 3)
+ val flow2 = flowOf("A", "B", "C")
+ val slowTransform: suspend (Int, String) -> String = { num: Int, letter: String ->
+ delay(10)
+ "$num$letter"
+ }
+
+ val batchedCombine = flow1
+ .combine(flow2, slowTransform)
+ .toList()
+ advanceUntilIdle()
+ assertThat(batchedCombine).containsExactly("1A", "3B", "3C")
+
+ val unbatchedCombine = flow1
+ .combineWithoutBatching(flow2) { num, letter, _ -> slowTransform(num, letter) }
+ .toList()
+ advanceUntilIdle()
+ assertThat(unbatchedCombine).containsExactly("1A", "2A", "2B", "3B", "3C")
+ }
+
+ @Test
+ fun combineWithoutBatching_updateFrom() = testScope.runBlockingTest {
+ val flow1 = Channel<Int>(BUFFERED)
+ val flow2 = Channel<Int>(BUFFERED)
+
+ val result = mutableListOf<CombineSource>()
+ launch {
+ flow1.consumeAsFlow()
+ .combineWithoutBatching(flow2.consumeAsFlow()) { _, _, updateFrom ->
+ result.add(updateFrom)
+ }
+ .collect { }
+ }
+
+ flow1.send(1)
+ advanceUntilIdle()
+ assertThat(result).isEmpty()
+
+ flow1.send(1)
+ advanceUntilIdle()
+ assertThat(result).isEmpty()
+
+ flow2.send(2)
+ advanceUntilIdle()
+ assertThat(result).containsExactly(INITIAL, RECEIVER)
+
+ flow1.send(1)
+ flow2.send(2)
+ advanceUntilIdle()
+ assertThat(result).containsExactly(INITIAL, RECEIVER, RECEIVER, OTHER)
+
+ // This should automatically propagate cancellation to the launched collector.
+ flow1.close()
+ flow2.close()
+ }
+
+ @Test
+ fun combineWithoutBatching_collectorCancellationPropagates() = testScope.runBlockingTest {
+ val flow1Emissions = mutableListOf<Int>()
+ val flow1 = flowOf(1, 2, 3).onEach(flow1Emissions::add)
+ val flow2Emissions = mutableListOf<String>()
+ val flow2 = flowOf("A", "B", "C").onEach(flow2Emissions::add)
+ val result = mutableListOf<Unit>()
+
+ flow1
+ .combineWithoutBatching(flow2) { _, _, _ ->
+ result.add(Unit)
+ }
+ .first()
+
+ advanceUntilIdle()
+
+ // We can't guarantee whether cancellation will propagate before or after the second item
+ // is emitted, but we should never get the third.
+ assertThat(flow1Emissions.size).isIn(1..2)
+ assertThat(flow2Emissions.size).isIn(1..2)
+ assertThat(result.size).isIn(1..2)
+ }
+
+ @Test
+ fun combineWithoutBatching_stressTest() {
+ val flow1 = flow {
+ repeat(1000) {
+ if (Random.nextBoolean()) {
+ delay(1)
+ }
+ emit(it)
+ }
+ }
+ val flow2 = flow {
+ repeat(1000) {
+ if (Random.nextBoolean()) {
+ delay(1)
+ }
+ emit(it)
+ }
+ }
+
+ repeat(10) {
+ val result = runBlocking {
+ flow1.combineWithoutBatching(flow2) { first, second, _ -> first to second }
+ .toList()
+ }
+
+ // Never emit the same values twice.
+ assertThat(result).containsNoDuplicates()
+
+ // Assert order of emissions
+ result.scan(0 to 0) { acc, next ->
+ assertThat(next.first).isAtLeast(acc.first)
+ assertThat(next.second).isAtLeast(acc.second)
+ next
+ }
+
+ // Check we don't miss any emissions
+ assertThat(result).hasSize(1999)
+ }
+ }
+
+ class UnbatchedFlowCombinerTest {
+ private data class SendResult<T1, T2>(
+ val receiverValue: T1,
+ val otherValue: T2,
+ val updateFrom: CombineSource,
+ )
+
+ @Test
+ fun onNext_receiverBuffers() = runBlockingTest {
+ val result = mutableListOf<SendResult<Int, Int>>()
+ val combiner = UnbatchedFlowCombiner<Int, Int> { a, b, c ->
+ result.add(SendResult(a, b, c))
+ }
+
+ combiner.onNext(index = 0, value = 0)
+ val job = launch {
+ repeat(9) { receiverValue ->
+ combiner.onNext(index = 0, value = receiverValue + 1)
+ }
+ }
+
+ // Ensure subsequent calls to onNext from receiver suspends forever until onNext
+ // is called for the other Flow.
+ advanceUntilIdle()
+ assertThat(job.isCompleted).isFalse()
+ // No events should be received until we receive an event from the other Flow.
+ assertThat(result).isEmpty()
+
+ combiner.onNext(index = 1, value = 0)
+
+ advanceUntilIdle()
+ assertThat(job.isCompleted).isTrue()
+ assertThat(result).containsExactly(
+ SendResult(0, 0, INITIAL),
+ SendResult(1, 0, RECEIVER),
+ SendResult(2, 0, RECEIVER),
+ SendResult(3, 0, RECEIVER),
+ SendResult(4, 0, RECEIVER),
+ SendResult(5, 0, RECEIVER),
+ SendResult(6, 0, RECEIVER),
+ SendResult(7, 0, RECEIVER),
+ SendResult(8, 0, RECEIVER),
+ SendResult(9, 0, RECEIVER),
+ )
+ }
+
+ @Test
+ fun onNext_otherBuffers() = runBlockingTest {
+ val result = mutableListOf<SendResult<Int, Int>>()
+ val combiner = UnbatchedFlowCombiner<Int, Int> { a, b, c ->
+ result.add(SendResult(a, b, c))
+ }
+
+ combiner.onNext(index = 1, value = 0)
+ val job = launch {
+ repeat(9) { receiverValue ->
+ combiner.onNext(index = 1, value = receiverValue + 1)
+ }
+ }
+
+ // Ensure subsequent calls to onNext from receiver suspends forever until onNext
+ // is called for the other Flow.
+ advanceUntilIdle()
+ assertThat(job.isCompleted).isFalse()
+ // No events should be received until we receive an event from the other Flow.
+ assertThat(result).isEmpty()
+
+ combiner.onNext(index = 0, value = 0)
+
+ advanceUntilIdle()
+ assertThat(job.isCompleted).isTrue()
+ assertThat(result).containsExactly(
+ SendResult(0, 0, INITIAL),
+ SendResult(0, 1, OTHER),
+ SendResult(0, 2, OTHER),
+ SendResult(0, 3, OTHER),
+ SendResult(0, 4, OTHER),
+ SendResult(0, 5, OTHER),
+ SendResult(0, 6, OTHER),
+ SendResult(0, 7, OTHER),
+ SendResult(0, 8, OTHER),
+ SendResult(0, 9, OTHER),
+ )
+ }
+
+ @Test
+ fun onNext_initialDispatchesFirst() = runBlockingTest {
+ val result = mutableListOf<SendResult<Int, Int>>()
+ val combiner = UnbatchedFlowCombiner<Int, Int> { a, b, c ->
+ // Give a chance for other calls to onNext to run.
+ yield()
+ result.add(SendResult(a, b, c))
+ }
+
+ launch {
+ repeat(1000) { value ->
+ combiner.onNext(index = 0, value = value)
+ }
+ }
+
+ repeat(1) { value ->
+ launch {
+ combiner.onNext(index = 1, value = value)
+ }
+ }
+
+ advanceUntilIdle()
+ assertThat(result.first()).isEqualTo(
+ SendResult(0, 0, INITIAL),
+ )
+ }
+ }
+}
\ No newline at end of file
diff --git a/paging/paging-common/src/test/kotlin/androidx/paging/PageFetcherSnapshotStateTest.kt b/paging/paging-common/src/test/kotlin/androidx/paging/PageFetcherSnapshotStateTest.kt
index 252477a..47980f4 100644
--- a/paging/paging-common/src/test/kotlin/androidx/paging/PageFetcherSnapshotStateTest.kt
+++ b/paging/paging-common/src/test/kotlin/androidx/paging/PageFetcherSnapshotStateTest.kt
@@ -16,11 +16,11 @@
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.LoadType.REFRESH
-import androidx.paging.LoadState.NotLoading
-import androidx.paging.LoadState.Loading
import androidx.paging.PagingSource.LoadResult.Page
import androidx.paging.PagingSource.LoadResult.Page.Companion.COUNT_UNDEFINED
import com.google.common.truth.Truth.assertThat
@@ -463,26 +463,26 @@
val config = PagingConfig(pageSize = 2)
val state = PageFetcherSnapshotState.Holder<Int, Int>(config = config).withLock { it }
- // assert initial IDLE state
- assertThat(state.sourceLoadStates.snapshot()).isEqualTo(LoadStates.IDLE)
-
- state.sourceLoadStates.set(APPEND, NotLoading.Complete)
+ // assert initial state
+ assertThat(state.sourceLoadStates.snapshot()).isEqualTo(loadStates(refresh = Loading))
// assert APPEND state is updated
- assertThat(state.sourceLoadStates.snapshot()).isEqualTo(
- loadStates(append = NotLoading.Complete)
- )
-
- state.sourceLoadStates.set(REFRESH, Loading)
-
- // assert REFRESH state is incrementally updated
+ state.sourceLoadStates.set(APPEND, NotLoading.Complete)
assertThat(state.sourceLoadStates.snapshot()).isEqualTo(
loadStates(
refresh = Loading,
- append = NotLoading.Complete,
+ append = NotLoading.Complete
)
)
+ // assert REFRESH state is incrementally updated
+ state.sourceLoadStates.set(REFRESH, NotLoading.Incomplete)
+ assertThat(state.sourceLoadStates.snapshot()).isEqualTo(
+ loadStates(
+ refresh = NotLoading.Incomplete,
+ append = NotLoading.Complete,
+ )
+ )
assertThat(state.sourceLoadStates.get(APPEND)).isEqualTo(NotLoading.Complete)
}
diff --git a/paging/paging-common/src/test/kotlin/androidx/paging/PageFetcherSnapshotTest.kt b/paging/paging-common/src/test/kotlin/androidx/paging/PageFetcherSnapshotTest.kt
index a0189bd..f8150f0 100644
--- a/paging/paging-common/src/test/kotlin/androidx/paging/PageFetcherSnapshotTest.kt
+++ b/paging/paging-common/src/test/kotlin/androidx/paging/PageFetcherSnapshotTest.kt
@@ -53,6 +53,7 @@
import kotlinx.coroutines.runBlocking
import kotlinx.coroutines.test.TestCoroutineScope
import kotlinx.coroutines.test.runBlockingTest
+import kotlinx.coroutines.withContext
import kotlinx.coroutines.yield
import org.junit.Test
import org.junit.runner.RunWith
@@ -1412,7 +1413,6 @@
assertThat(pageEvents.newEvents()).containsExactly(
localLoadStateUpdate<Int>(appendLocal = Loading),
localLoadStateUpdate<Int>(appendLocal = Error(LOAD_ERROR)),
-
)
// This hint should be ignored even though in the non-error state it would
@@ -2106,14 +2106,14 @@
val expected = listOf(
listOf(
- remoteLoadStateUpdate<Int>(
- refreshRemote = Loading
+ remoteLoadStateUpdate(
+ refreshLocal = Loading,
),
- remoteLoadStateUpdate<Int>(
+ remoteLoadStateUpdate(
refreshLocal = Loading,
refreshRemote = Loading,
),
- remoteLoadStateUpdate<Int>(
+ remoteLoadStateUpdate(
refreshLocal = Loading,
refreshRemote = Error(EXCEPTION),
),
@@ -2268,11 +2268,124 @@
}
@Test
+ fun sourceOnlyInitialLoadState() = testScope.runBlockingTest {
+ @OptIn(ExperimentalPagingApi::class)
+ val config = PagingConfig(
+ pageSize = 1,
+ prefetchDistance = 2,
+ enablePlaceholders = true,
+ initialLoadSize = 1,
+ maxSize = 5
+ )
+ val pager = PageFetcher(
+ initialKey = 0,
+ pagingSourceFactory = { TestPagingSource(items = listOf(0)) },
+ config = config,
+ )
+
+ val state = collectFetcherState(pager)
+ assertThat(state.newEvents()).containsExactly(
+ localLoadStateUpdate<Int>(
+ refreshLocal = Loading
+ ),
+ )
+
+ advanceUntilIdle()
+
+ assertThat(state.newEvents()).containsExactly(
+ localRefresh(
+ pages = listOf(
+ TransformablePage(data = listOf(0)),
+ ),
+ source = loadStates(
+ refresh = NotLoading.Incomplete,
+ prepend = NotLoading.Complete,
+ append = NotLoading.Complete,
+ ),
+ ),
+ )
+
+ state.job.cancel()
+ }
+
+ @Test
+ fun remoteInitialLoadState() = testScope.runBlockingTest {
+ @OptIn(ExperimentalPagingApi::class)
+ val remoteMediator = RemoteMediatorMock().apply {
+ initializeResult = RemoteMediator.InitializeAction.LAUNCH_INITIAL_REFRESH
+ loadCallback = { _, _ ->
+ withContext(coroutineContext) {
+ delay(50)
+ RemoteMediator.MediatorResult.Success(true)
+ }
+ }
+ }
+
+ @OptIn(ExperimentalPagingApi::class)
+ val config = PagingConfig(
+ pageSize = 1,
+ prefetchDistance = 2,
+ enablePlaceholders = true,
+ initialLoadSize = 1,
+ maxSize = 5
+ )
+ val pager = PageFetcher(
+ initialKey = 0,
+ pagingSourceFactory = { TestPagingSource(items = listOf(0), loadDelay = 100) },
+ config = config,
+ remoteMediator = remoteMediator,
+ )
+
+ val state = collectFetcherState(pager)
+ advanceTimeBy(1)
+
+ assertThat(state.newEvents()).containsExactly(
+ remoteLoadStateUpdate<Int>(
+ refreshLocal = Loading
+ ),
+ remoteLoadStateUpdate<Int>(
+ refreshRemote = Loading,
+ refreshLocal = Loading,
+ ),
+ )
+
+ advanceUntilIdle()
+
+ assertThat(state.newEvents()).containsExactly(
+ remoteLoadStateUpdate<Int>(
+ refreshRemote = NotLoading.Incomplete,
+ prependRemote = NotLoading.Complete,
+ appendRemote = NotLoading.Complete,
+ refreshLocal = Loading,
+ ),
+ remoteRefresh(
+ pages = listOf(
+ TransformablePage(data = listOf(0))
+ ),
+ source = loadStates(
+ refresh = NotLoading.Incomplete,
+ prepend = NotLoading.Complete,
+ append = NotLoading.Complete,
+ ),
+ mediator = loadStates(
+ refresh = NotLoading.Incomplete,
+ prepend = NotLoading.Complete,
+ append = NotLoading.Complete,
+ )
+ ),
+ )
+
+ state.job.cancel()
+ }
+
+ @Test
fun remoteMediator_remoteRefreshEndOfPaginationReached() = testScope.runBlockingTest {
@OptIn(ExperimentalPagingApi::class)
val remoteMediator = RemoteMediatorMock().apply {
initializeResult = RemoteMediator.InitializeAction.LAUNCH_INITIAL_REFRESH
- loadCallback = { _, _ -> RemoteMediator.MediatorResult.Success(true) }
+ loadCallback = { _, _ ->
+ RemoteMediator.MediatorResult.Success(true)
+ }
}
val config = PagingConfig(
@@ -2295,7 +2408,7 @@
assertThat(state.newEvents()).containsExactly(
remoteLoadStateUpdate<Int>(
- refreshRemote = Loading
+ refreshLocal = Loading,
),
remoteLoadStateUpdate<Int>(
refreshLocal = Loading,
@@ -2303,7 +2416,7 @@
),
remoteLoadStateUpdate<Int>(
refreshLocal = Loading,
- refreshRemote = NotLoading.Complete,
+ refreshRemote = NotLoading.Incomplete,
prependRemote = NotLoading.Complete,
appendRemote = NotLoading.Complete,
),
@@ -2321,7 +2434,7 @@
prepend = NotLoading.Complete,
),
mediator = loadStates(
- refresh = NotLoading.Complete,
+ refresh = NotLoading.Incomplete,
append = NotLoading.Complete,
prepend = NotLoading.Complete,
),
@@ -2371,13 +2484,20 @@
placeholdersAfter = 99,
source = loadStates(prepend = NotLoading.Complete)
),
- remoteLoadStateUpdate<Int>(
+ remoteLoadStateUpdate(
prependLocal = NotLoading.Complete,
prependRemote = Loading,
),
),
listOf(
- remoteLoadStateUpdate(refreshLocal = Loading),
+ remoteLoadStateUpdate(
+ refreshLocal = Loading,
+ prependRemote = Loading,
+ ),
+ remoteLoadStateUpdate(
+ refreshLocal = Loading,
+ prependRemote = NotLoading.Incomplete,
+ ),
remoteRefresh(
pages = listOf(
TransformablePage(
@@ -2560,7 +2680,7 @@
fetcher.assertEventByGeneration(
listOf(
listOf(
- remoteLoadStateUpdate<Int>(refreshLocal = Loading),
+ remoteLoadStateUpdate(refreshLocal = Loading),
remoteRefresh(
pages = listOf(
TransformablePage(
@@ -2571,13 +2691,20 @@
placeholdersBefore = 99,
source = loadStates(append = NotLoading.Complete)
),
- remoteLoadStateUpdate<Int>(
+ remoteLoadStateUpdate(
appendLocal = NotLoading.Complete,
appendRemote = Loading
),
),
listOf(
- remoteLoadStateUpdate<Int>(refreshLocal = Loading),
+ remoteLoadStateUpdate(
+ refreshLocal = Loading,
+ appendRemote = Loading,
+ ),
+ remoteLoadStateUpdate(
+ refreshLocal = Loading,
+ appendRemote = NotLoading.Incomplete,
+ ),
remoteRefresh(
pages = listOf(
TransformablePage(
@@ -2725,7 +2852,7 @@
}
@Test
- fun remoteMediator_initialRefreshSuccess() = testScope.runBlockingTest {
+ fun remoteMediator_immediateInvalidation() = testScope.runBlockingTest {
@OptIn(ExperimentalPagingApi::class)
val remoteMediator = object : RemoteMediatorMock() {
override suspend fun initialize(): InitializeAction {
@@ -2756,29 +2883,113 @@
config = config,
remoteMediator = remoteMediator
)
- pager.assertEventByGeneration(
- listOf(
- listOf<PageEvent<Int>>(
- remoteLoadStateUpdate<Int>(
- refreshRemote = Loading,
- ),
- remoteLoadStateUpdate<Int>(refreshRemote = NotLoading.Incomplete),
- ),
- listOf(
- remoteLoadStateUpdate<Int>(refreshLocal = Loading),
- remoteRefresh(
- pages = listOf(
- TransformablePage(
- originalPageOffset = 0,
- data = listOf(50)
- )
- ),
- placeholdersBefore = 50,
- placeholdersAfter = 49,
- ),
- )
- )
+ val fetcherState = collectFetcherState(pager)
+ advanceUntilIdle()
+
+ assertThat(fetcherState.pageEventLists).hasSize(2)
+ assertThat(fetcherState.pageEventLists[0]).containsExactly(
+ remoteLoadStateUpdate<Int>(
+ refreshLocal = Loading,
+ ),
+ remoteLoadStateUpdate<Int>(
+ refreshLocal = Loading,
+ refreshRemote = Loading,
+ ),
)
+ assertThat(fetcherState.pageEventLists[1]).containsExactly(
+ remoteLoadStateUpdate<Int>(
+ refreshLocal = Loading,
+ refreshRemote = Loading,
+ ),
+ remoteLoadStateUpdate<Int>(refreshLocal = Loading),
+ remoteRefresh(
+ pages = listOf(
+ TransformablePage(
+ originalPageOffset = 0,
+ data = listOf(50)
+ )
+ ),
+ placeholdersBefore = 50,
+ placeholdersAfter = 49,
+ ),
+ )
+
+ fetcherState.job.cancel()
+ }
+
+ @Test
+ fun remoteMediator_initialRefreshSuccess() = testScope.runBlockingTest {
+ @OptIn(ExperimentalPagingApi::class)
+ val remoteMediator = object : RemoteMediatorMock() {
+ override suspend fun initialize(): InitializeAction {
+ super.initialize()
+ return InitializeAction.LAUNCH_INITIAL_REFRESH
+ }
+
+ override suspend fun load(
+ loadType: LoadType,
+ state: PagingState<Int, Int>
+ ): MediatorResult {
+ super.load(loadType, state)
+
+ // Wait for advanceUntilIdle()
+ delay(1)
+
+ currentPagingSource!!.invalidate()
+ return MediatorResult.Success(endOfPaginationReached = false)
+ }
+ }
+
+ val config = PagingConfig(
+ pageSize = 1,
+ prefetchDistance = 2,
+ enablePlaceholders = true,
+ initialLoadSize = 1,
+ maxSize = 5
+ )
+ val pager = PageFetcher(
+ initialKey = 50,
+ pagingSourceFactory = pagingSourceFactory,
+ config = config,
+ remoteMediator = remoteMediator
+ )
+ val fetcherState = collectFetcherState(pager)
+ advanceUntilIdle()
+
+ assertThat(fetcherState.pageEventLists.size).isEqualTo(2)
+ assertThat(fetcherState.pageEventLists[0]).containsExactly(
+ remoteLoadStateUpdate<Int>(
+ refreshLocal = Loading,
+ refreshRemote = Loading,
+ ),
+ remoteLoadStateUpdate<Int>(
+ refreshLocal = Loading,
+ refreshRemote = NotLoading.Incomplete,
+ ),
+ )
+ assertThat(fetcherState.pageEventLists[1]).containsExactly(
+ // Invalidate happens before RemoteMediator returns.
+ remoteLoadStateUpdate<Int>(
+ refreshLocal = Loading,
+ refreshRemote = Loading,
+ ),
+ remoteLoadStateUpdate<Int>(
+ refreshLocal = Loading,
+ refreshRemote = NotLoading.Incomplete,
+ ),
+ remoteRefresh(
+ pages = listOf(
+ TransformablePage(
+ originalPageOffset = 0,
+ data = listOf(50)
+ )
+ ),
+ placeholdersBefore = 50,
+ placeholdersAfter = 49,
+ ),
+ )
+
+ fetcherState.job.cancel()
}
@Test
@@ -2829,7 +3040,7 @@
assertThat(fetcherState.newEvents()).containsExactly(
remoteLoadStateUpdate<Int>(
- refreshRemote = Loading
+ refreshLocal = Loading,
),
remoteLoadStateUpdate<Int>(
refreshLocal = Loading,
@@ -2860,7 +3071,7 @@
appendLocal = NotLoading.Complete,
prependRemote = NotLoading.Complete,
appendRemote = NotLoading.Complete,
- refreshRemote = NotLoading.Complete
+ refreshRemote = NotLoading.Incomplete,
),
)
@@ -3429,7 +3640,7 @@
return eventsByGeneration
}
- internal suspend fun <T : Any> PageFetcher<*, T>.assertEventByGeneration(
+ private suspend fun <T : Any> PageFetcher<*, T>.assertEventByGeneration(
expected: List<List<PageEvent<T>>>
) {
val total = expected.sumOf { it.size }
diff --git a/paging/paging-common/src/test/kotlin/androidx/paging/PageFetcherTest.kt b/paging/paging-common/src/test/kotlin/androidx/paging/PageFetcherTest.kt
index bb31bd1..b70fc21 100644
--- a/paging/paging-common/src/test/kotlin/androidx/paging/PageFetcherTest.kt
+++ b/paging/paging-common/src/test/kotlin/androidx/paging/PageFetcherTest.kt
@@ -30,6 +30,7 @@
import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.Job
import kotlinx.coroutines.async
+import kotlinx.coroutines.channels.Channel
import kotlinx.coroutines.delay
import kotlinx.coroutines.flow.collect
import kotlinx.coroutines.flow.collectIndexed
@@ -43,7 +44,6 @@
import org.junit.Test
import org.junit.runner.RunWith
import org.junit.runners.JUnit4
-import java.util.ArrayList
import kotlin.test.assertEquals
import kotlin.test.assertFailsWith
import kotlin.test.assertNotEquals
@@ -1108,6 +1108,8 @@
val remoteMediator = RemoteMediatorMock().apply {
initializeResult = LAUNCH_INITIAL_REFRESH
loadCallback = { _, _ ->
+ // Wait for advanceUntilIdle()
+ delay(1)
RemoteMediator.MediatorResult.Success(endOfPaginationReached = true)
}
}
@@ -1123,7 +1125,7 @@
assertThat(fetcherState.newEvents()).containsExactly(
remoteLoadStateUpdate<Int>(
- refreshRemote = Loading
+ refreshLocal = Loading,
),
remoteLoadStateUpdate<Int>(
refreshLocal = Loading,
@@ -1132,7 +1134,7 @@
// all remote States should be updated within single LoadStateUpdate
remoteLoadStateUpdate<Int>(
refreshLocal = Loading,
- refreshRemote = NotLoading.Complete,
+ refreshRemote = NotLoading.Incomplete,
prependRemote = NotLoading.Complete,
appendRemote = NotLoading.Complete,
),
@@ -1143,16 +1145,22 @@
advanceUntilIdle()
assertThat(fetcherState.newEvents()).containsExactly(
- // all remote States should be updated within single LoadStateUpdate
- // the second gen refreshRemote.Loading was sent in previous PagingData
+ // Remote state carried over from previous generation.
remoteLoadStateUpdate<Int>(
refreshLocal = Loading,
- refreshRemote = NotLoading.Complete,
+ refreshRemote = NotLoading.Incomplete,
prependRemote = NotLoading.Complete,
appendRemote = NotLoading.Complete,
),
remoteLoadStateUpdate<Int>(
- refreshRemote = NotLoading.Complete,
+ refreshLocal = Loading,
+ refreshRemote = Loading,
+ prependRemote = NotLoading.Complete,
+ appendRemote = NotLoading.Complete,
+ ),
+ remoteLoadStateUpdate<Int>(
+ refreshLocal = Loading,
+ refreshRemote = NotLoading.Incomplete,
prependRemote = NotLoading.Complete,
appendRemote = NotLoading.Complete,
),
@@ -1162,6 +1170,274 @@
fetcherState.job.cancel()
}
+ /**
+ * Check that rapid remote events are not dropped and don't cause redundant events.
+ */
+ @Test
+ fun injectRemoteEvents_fastRemoteEvents() = testScope.runBlockingTest {
+ @OptIn(ExperimentalPagingApi::class)
+ val remoteMediator = RemoteMediatorMock().apply {
+ initializeResult = LAUNCH_INITIAL_REFRESH
+ loadCallback = { _, _ ->
+ RemoteMediator.MediatorResult.Success(endOfPaginationReached = true)
+ }
+ }
+ val pageFetcher = PageFetcher(
+ pagingSourceFactory = { TestPagingSource(items = emptyList()) },
+ initialKey = 0,
+ config = config,
+ remoteMediator = remoteMediator
+ )
+ val fetcherState = collectFetcherState(pageFetcher)
+
+ advanceUntilIdle()
+
+ assertThat(fetcherState.newEvents()).containsExactly(
+ remoteLoadStateUpdate<Int>(
+ refreshLocal = Loading,
+ refreshRemote = NotLoading.Incomplete,
+ ),
+ remoteLoadStateUpdate<Int>(
+ refreshLocal = Loading,
+ refreshRemote = Loading,
+ ),
+ remoteLoadStateUpdate<Int>(
+ refreshLocal = Loading,
+ refreshRemote = NotLoading.Incomplete,
+ prependRemote = NotLoading.Complete,
+ appendRemote = NotLoading.Complete,
+ ),
+ remoteRefresh<Int>(
+ source = loadStates(
+ append = NotLoading.Complete,
+ prepend = NotLoading.Complete,
+ ),
+ mediator = loadStates(
+ refresh = NotLoading.Incomplete,
+ append = NotLoading.Complete,
+ prepend = NotLoading.Complete,
+ ),
+ ),
+ )
+ fetcherState.job.cancel()
+ }
+
+ @Test
+ fun injectRemoteEvents_remoteLoadAcrossGenerations() = testScope.runBlockingTest {
+ val neverEmitCh = Channel<Int>()
+ var generation = 0
+
+ @OptIn(ExperimentalPagingApi::class)
+ val pageFetcher = PageFetcher(
+ pagingSourceFactory = {
+ generation++
+ object : PagingSource<Int, Int>() {
+ override suspend fun load(params: LoadParams<Int>): LoadResult<Int, Int> {
+ // Wait for advanceUntilIdle()
+ delay(1)
+
+ return when (generation) {
+ 1 -> Page(
+ data = listOf(),
+ prevKey = null,
+ nextKey = null
+ )
+ else -> Page(
+ data = listOf(3, 4, 5),
+ prevKey = 2,
+ nextKey = 6
+ )
+ }
+ }
+
+ override fun getRefreshKey(state: PagingState<Int, Int>): Int? = null
+ }
+ },
+ initialKey = 0,
+ config = config,
+ remoteMediator = object : RemoteMediator<Int, Int>() {
+ override suspend fun initialize(): InitializeAction = SKIP_INITIAL_REFRESH
+
+ override suspend fun load(
+ loadType: LoadType,
+ state: PagingState<Int, Int>
+ ): MediatorResult {
+ // Wait for advanceUntilIdle()
+ delay(1)
+
+ if (loadType == REFRESH) {
+ return MediatorResult.Success(endOfPaginationReached = false)
+ }
+
+ neverEmitCh.receiveCatching()
+ return MediatorResult.Error(Exception("Unexpected"))
+ }
+ }
+ )
+ val fetcherState = collectFetcherState(pageFetcher)
+
+ assertThat(fetcherState.newEvents()).containsExactly(
+ remoteLoadStateUpdate<Int>(
+ source = loadStates(
+ refresh = Loading,
+ ),
+ ),
+ )
+
+ // Let initial source refresh complete and kick off remote prepend / append.
+ advanceUntilIdle()
+
+ // First generation loads empty list and triggers remote loads.
+ assertThat(fetcherState.newEvents()).containsExactly(
+ remoteRefresh(
+ pages = listOf(
+ TransformablePage(data = listOf())
+ ),
+ source = loadStates(
+ prepend = NotLoading.Complete,
+ append = NotLoading.Complete,
+ ),
+ ),
+ remoteLoadStateUpdate<Int>(
+ source = loadStates(
+ prepend = NotLoading.Complete,
+ append = NotLoading.Complete,
+ ),
+ mediator = loadStates(
+ prepend = Loading,
+ ),
+ ),
+ remoteLoadStateUpdate<Int>(
+ source = loadStates(
+ prepend = NotLoading.Complete,
+ append = NotLoading.Complete,
+ ),
+ mediator = loadStates(
+ prepend = Loading,
+ append = Loading,
+ ),
+ ),
+ )
+
+ // Trigger remote + source refresh in a new generation.
+ pageFetcher.refresh()
+
+ assertThat(fetcherState.newEvents()).containsExactly(
+ remoteLoadStateUpdate<Int>(
+ source = loadStates(refresh = Loading),
+ mediator = loadStates(
+ prepend = Loading,
+ append = Loading,
+ ),
+ ),
+ )
+
+ // Let remote and source refresh finish.
+ advanceUntilIdle()
+
+ // Second generation loads some data and has more to load from source.
+ assertThat(fetcherState.newEvents()).containsExactly(
+ remoteLoadStateUpdate<Int>(
+ source = loadStates(refresh = Loading),
+ mediator = loadStates(
+ refresh = Loading,
+ prepend = Loading,
+ append = Loading,
+ ),
+ ),
+ remoteLoadStateUpdate<Int>(
+ source = loadStates(refresh = Loading),
+ mediator = loadStates(
+ prepend = Loading,
+ append = Loading,
+ )
+ ),
+ remoteRefresh(
+ pages = listOf(TransformablePage(data = listOf(3, 4, 5))),
+ mediator = loadStates(
+ prepend = Loading,
+ append = Loading,
+ ),
+ ),
+ )
+
+ // Trigger remote + source refresh in a third generation.
+ pageFetcher.refresh()
+
+ // Start of third generation should have the exact same load states as before, so we
+ // should only get new events for kicking off new loads.
+ assertThat(fetcherState.newEvents()).containsExactly(
+ remoteLoadStateUpdate<Int>(
+ source = loadStates(refresh = Loading),
+ mediator = loadStates(
+ prepend = Loading,
+ append = Loading,
+ ),
+ ),
+ )
+
+ // Let remote and source refresh finish.
+ advanceUntilIdle()
+
+ assertThat(fetcherState.newEvents()).containsExactly(
+ remoteLoadStateUpdate<Int>(
+ source = loadStates(refresh = Loading),
+ mediator = loadStates(
+ refresh = Loading,
+ prepend = Loading,
+ append = Loading,
+ ),
+ ),
+ remoteLoadStateUpdate<Int>(
+ source = loadStates(refresh = Loading),
+ mediator = loadStates(
+ prepend = Loading,
+ append = Loading,
+ )
+ ),
+ remoteRefresh(
+ pages = listOf(TransformablePage(data = listOf(3, 4, 5))),
+ mediator = loadStates(
+ prepend = Loading,
+ append = Loading,
+ ),
+ ),
+ )
+
+ neverEmitCh.close()
+ fetcherState.job.cancel()
+ }
+
+ @Test
+ fun injectRemoteEvents_doesNotKeepOldGenerationActive() = testScope.runBlockingTest {
+ @OptIn(ExperimentalPagingApi::class)
+ val remoteMediator = RemoteMediatorMock().apply {
+ initializeResult = LAUNCH_INITIAL_REFRESH
+ loadCallback = { _, _ ->
+ RemoteMediator.MediatorResult.Success(endOfPaginationReached = true)
+ }
+ }
+ val pageFetcher = PageFetcher(
+ pagingSourceFactory = { TestPagingSource(items = emptyList()) },
+ initialKey = 0,
+ config = config,
+ remoteMediator = remoteMediator
+ )
+ val fetcherState = collectFetcherState(pageFetcher)
+ advanceUntilIdle()
+
+ // Clear out all events.
+ val firstGenerationEventCount = fetcherState.pageEventLists[0].size
+
+ // Let new generation and some new remote events emit.
+ pageFetcher.refresh()
+ advanceUntilIdle()
+
+ assertThat(firstGenerationEventCount).isEqualTo(fetcherState.pageEventLists[0].size)
+
+ fetcherState.job.cancel()
+ }
+
companion object {
internal val EMPTY_SOURCE_REFRESH =
localRefresh<Int>(
@@ -1178,7 +1454,7 @@
prepend = NotLoading.Complete,
),
mediator = loadStates(
- refresh = NotLoading.Complete,
+ refresh = NotLoading.Incomplete,
append = NotLoading.Complete,
prepend = NotLoading.Complete,
),
@@ -1194,13 +1470,13 @@
private var lastPageEventListIndex = -1
var lastIndex = -1
- fun newEvents(): List<PageEvent<T>>? {
+ fun newEvents(): List<PageEvent<T>> {
if (lastPageEventListIndex != pageEventLists.lastIndex) {
lastPageEventListIndex = pageEventLists.lastIndex
lastIndex = -1
}
- val pageEvents = pageEventLists.lastOrNull()?.toMutableList() ?: listOf<PageEvent<T>>()
+ val pageEvents = pageEventLists.lastOrNull()?.toMutableList() ?: listOf()
return pageEvents.drop(lastIndex + 1).also {
lastIndex = pageEvents.lastIndex
}
@@ -1215,7 +1491,9 @@
fetcher.flow.collectIndexed { index, pagingData ->
pagingDataList.add(index, pagingData)
pageEventLists.add(index, ArrayList())
- launch { pagingData.flow.toList(pageEventLists[index]) }
+ launch {
+ pagingData.flow.toList(pageEventLists[index])
+ }
}
}
diff --git a/paging/paging-common/src/test/kotlin/androidx/paging/PagingDataDifferTest.kt b/paging/paging-common/src/test/kotlin/androidx/paging/PagingDataDifferTest.kt
index 4da721a..104b0c4 100644
--- a/paging/paging-common/src/test/kotlin/androidx/paging/PagingDataDifferTest.kt
+++ b/paging/paging-common/src/test/kotlin/androidx/paging/PagingDataDifferTest.kt
@@ -1257,13 +1257,12 @@
advanceTimeBy(600)
assertThat(differ.newCombinedLoadStates()).containsExactly(
- // remote starts loading
- remoteLoadStatesOf(
- refresh = Loading,
- refreshRemote = Loading,
- ),
// local starts loading
remoteLoadStatesOf(
+ refreshLocal = Loading,
+ ),
+ // remote starts loading
+ remoteLoadStatesOf(
refresh = Loading,
refreshLocal = Loading,
refreshRemote = Loading,
@@ -1284,11 +1283,6 @@
advanceTimeBy(600)
assertThat(differ.newCombinedLoadStates()).containsExactly(
- // local state is simultaneously reset by the remote mediator state update
- remoteLoadStatesOf(
- refresh = Loading,
- refreshRemote = Loading,
- ),
// local starts second refresh while mediator continues remote refresh from before
remoteLoadStatesOf(
refresh = Loading,
diff --git a/paging/paging-common/src/test/kotlin/androidx/paging/RemoteMediatorAccessorTest.kt b/paging/paging-common/src/test/kotlin/androidx/paging/RemoteMediatorAccessorTest.kt
index b9ce456..3863aee 100644
--- a/paging/paging-common/src/test/kotlin/androidx/paging/RemoteMediatorAccessorTest.kt
+++ b/paging/paging-common/src/test/kotlin/androidx/paging/RemoteMediatorAccessorTest.kt
@@ -229,7 +229,7 @@
// they are waiting for refresh.
assertThat(remoteMediatorAccessor.state.value).isEqualTo(
LoadStates(
- refresh = LoadState.NotLoading.Complete,
+ refresh = LoadState.NotLoading.Incomplete,
prepend = LoadState.NotLoading.Complete,
append = LoadState.NotLoading.Complete
)
diff --git a/paging/paging-common/src/test/kotlin/androidx/paging/SimpleFlowExtTest.kt b/paging/paging-common/src/test/kotlin/androidx/paging/SimpleFlowExtTest.kt
deleted file mode 100644
index 0a16d77..0000000
--- a/paging/paging-common/src/test/kotlin/androidx/paging/SimpleFlowExtTest.kt
+++ /dev/null
@@ -1,133 +0,0 @@
-/*
- * Copyright 2021 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package androidx.paging
-
-import com.google.common.truth.Truth.assertThat
-import kotlinx.coroutines.ExperimentalCoroutinesApi
-import kotlinx.coroutines.delay
-import kotlinx.coroutines.flow.emptyFlow
-import kotlinx.coroutines.flow.flow
-import kotlinx.coroutines.flow.flowOf
-import kotlinx.coroutines.flow.onEach
-import kotlinx.coroutines.flow.toList
-import kotlinx.coroutines.test.TestCoroutineScope
-import kotlinx.coroutines.test.runBlockingTest
-import org.junit.Test
-
-@OptIn(ExperimentalCoroutinesApi::class)
-class SimpleFlowExtTest {
- val testScope = TestCoroutineScope()
-
- @Test
- fun scan_basic() = testScope.runBlockingTest {
- val arguments = mutableListOf<Pair<Int, Int>>()
- assertThat(
- flowOf(1, 2, 3).simpleScan(0) { acc, value ->
- arguments.add(acc to value)
- value + acc
- }.toList()
- ).containsExactly(
- 0, 1, 3, 6
- ).inOrder()
- assertThat(arguments).containsExactly(
- 0 to 1,
- 1 to 2,
- 3 to 3
- ).inOrder()
- }
-
- @Test
- fun scan_initialValue() = testScope.runBlockingTest {
- assertThat(
- emptyFlow<Int>().simpleScan("x") { _, value ->
- "$value"
- }.toList()
- ).containsExactly("x")
- }
-
- @Test
- fun runningReduce_basic() = testScope.runBlockingTest {
- assertThat(
- flowOf(1, 2, 3, 4).simpleRunningReduce { acc, value ->
- acc + value
- }.toList()
- ).containsExactly(1, 3, 6, 10)
- }
-
- @Test
- fun runningReduce_empty() = testScope.runBlockingTest {
- assertThat(
- emptyFlow<Int>().simpleRunningReduce { acc, value ->
- acc + value
- }.toList()
- ).isEmpty()
- }
-
- @Test
- fun mapLatest() = testScope.runBlockingTest {
- assertThat(
- flowOf(1, 2, 3, 4)
- .onEach {
- delay(1)
- }
- .simpleMapLatest { value ->
- delay(value.toLong())
- "$value-$value"
- }.toList()
- ).containsExactly(
- "1-1", "4-4"
- ).inOrder()
- }
-
- @Test
- fun mapLatest_empty() = testScope.runBlockingTest {
- assertThat(
- emptyFlow<Int>().simpleMapLatest { value ->
- "$value-$value"
- }.toList()
- ).isEmpty()
- }
-
- @Test
- fun flatMapLatest() = testScope.runBlockingTest {
- assertThat(
- flowOf(1, 2, 3, 4)
- .onEach {
- delay(1)
- }
- .simpleFlatMapLatest { value ->
- flow {
- repeat(value) {
- emit(value)
- }
- }
- }.toList()
- ).containsExactly(
- 1, 2, 2, 3, 3, 3, 4, 4, 4, 4
- ).inOrder()
- }
-
- @Test
- fun flatMapLatest_empty() = testScope.runBlockingTest {
- assertThat(
- emptyFlow<Int>()
- .simpleFlatMapLatest {
- flowOf(it)
- }.toList()
- ).isEmpty()
- }
-}
\ No newline at end of file
diff --git a/paging/paging-guava/api/api_lint.ignore b/paging/paging-guava/api/api_lint.ignore
new file mode 100644
index 0000000..b8469c9
--- /dev/null
+++ b/paging/paging-guava/api/api_lint.ignore
@@ -0,0 +1,3 @@
+// Baseline format: 1.0
+AsyncSuffixFuture: androidx.paging.ListenableFuturePagingSource#loadFuture(androidx.paging.PagingSource.LoadParams<Key>):
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
diff --git a/paging/paging-guava/src/main/java/androidx/paging/ListenableFutureRemoteMediator.kt b/paging/paging-guava/src/main/java/androidx/paging/ListenableFutureRemoteMediator.kt
index 982a4e9..a28145c 100644
--- a/paging/paging-guava/src/main/java/androidx/paging/ListenableFutureRemoteMediator.kt
+++ b/paging/paging-guava/src/main/java/androidx/paging/ListenableFutureRemoteMediator.kt
@@ -61,6 +61,7 @@
* @return [MediatorResult] signifying what [LoadState] to be passed to the UI, and whether
* there's more data available.
*/
+ @Suppress("AsyncSuffixFuture")
abstract fun loadFuture(
loadType: LoadType,
state: PagingState<Key, Value>
@@ -79,6 +80,7 @@
* * [SKIP_INITIAL_REFRESH][InitializeAction.SKIP_INITIAL_REFRESH] to wait for a
* refresh request from the UI before dispatching a [load] with load type [LoadType.REFRESH].
*/
+ @Suppress("AsyncSuffixFuture")
open fun initializeFuture(): ListenableFuture<InitializeAction> {
return Futures.immediateFuture(LAUNCH_INITIAL_REFRESH)
}
diff --git a/playground-common/playground.properties b/playground-common/playground.properties
index bf01123..b8e90bc 100644
--- a/playground-common/playground.properties
+++ b/playground-common/playground.properties
@@ -27,6 +27,6 @@
# Disable docs
androidx.enableDocumentation=false
androidx.playground.snapshotBuildId=7680668
-androidx.playground.metalavaBuildId=7659017
+androidx.playground.metalavaBuildId=7743859
androidx.playground.dokkaBuildId=7472101
androidx.studio.type=playground
diff --git a/preference/preference/api/api_lint.ignore b/preference/preference/api/api_lint.ignore
index 99fff15..2f6c3aa 100644
--- a/preference/preference/api/api_lint.ignore
+++ b/preference/preference/api/api_lint.ignore
@@ -130,7 +130,7 @@
MissingNullability: androidx.preference.DropDownPreference#createAdapter():
Missing nullability on method `createAdapter` return
MissingNullability: androidx.preference.DropDownPreference#onBindViewHolder(androidx.preference.PreferenceViewHolder) parameter #0:
- Missing nullability on parameter `view` in method `onBindViewHolder`
+ Missing nullability on parameter `holder` in method `onBindViewHolder`
MissingNullability: androidx.preference.EditTextPreference#EditTextPreference(android.content.Context) parameter #0:
Missing nullability on parameter `context` in method `EditTextPreference`
MissingNullability: androidx.preference.EditTextPreference#EditTextPreference(android.content.Context, android.util.AttributeSet) parameter #0:
@@ -658,7 +658,7 @@
MissingNullability: androidx.preference.SeekBarPreference#SeekBarPreference(android.content.Context, android.util.AttributeSet, int, int) parameter #1:
Missing nullability on parameter `attrs` in method `SeekBarPreference`
MissingNullability: androidx.preference.SeekBarPreference#onBindViewHolder(androidx.preference.PreferenceViewHolder) parameter #0:
- Missing nullability on parameter `view` in method `onBindViewHolder`
+ Missing nullability on parameter `holder` in method `onBindViewHolder`
MissingNullability: androidx.preference.SeekBarPreference#onGetDefaultValue(android.content.res.TypedArray, int):
Missing nullability on method `onGetDefaultValue` return
MissingNullability: androidx.preference.SeekBarPreference#onGetDefaultValue(android.content.res.TypedArray, int) parameter #0:
diff --git a/profileinstaller/profileinstaller/src/main/java/androidx/profileinstaller/DeviceProfileWriter.java b/profileinstaller/profileinstaller/src/main/java/androidx/profileinstaller/DeviceProfileWriter.java
index fe73629..23ef5e8 100644
--- a/profileinstaller/profileinstaller/src/main/java/androidx/profileinstaller/DeviceProfileWriter.java
+++ b/profileinstaller/profileinstaller/src/main/java/androidx/profileinstaller/DeviceProfileWriter.java
@@ -264,8 +264,9 @@
return ProfileVersion.V001_N;
case Build.VERSION_CODES.O:
- case Build.VERSION_CODES.O_MR1:
return ProfileVersion.V005_O;
+ case Build.VERSION_CODES.O_MR1:
+ return ProfileVersion.V009_O_MR1;
case Build.VERSION_CODES.P:
case Build.VERSION_CODES.Q:
diff --git a/recyclerview/recyclerview/api/current.txt b/recyclerview/recyclerview/api/current.txt
index e1ffd69..55ccf87 100644
--- a/recyclerview/recyclerview/api/current.txt
+++ b/recyclerview/recyclerview/api/current.txt
@@ -79,6 +79,7 @@
method public boolean addAdapter(int, androidx.recyclerview.widget.RecyclerView.Adapter<? extends androidx.recyclerview.widget.RecyclerView.ViewHolder>);
method public java.util.List<? extends androidx.recyclerview.widget.RecyclerView.Adapter<? extends androidx.recyclerview.widget.RecyclerView.ViewHolder>> getAdapters();
method public int getItemCount();
+ method public android.util.Pair<androidx.recyclerview.widget.RecyclerView.Adapter<? extends androidx.recyclerview.widget.RecyclerView.ViewHolder>!,java.lang.Integer!> getWrappedAdapterAndPosition(int);
method public void onBindViewHolder(androidx.recyclerview.widget.RecyclerView.ViewHolder, int);
method public androidx.recyclerview.widget.RecyclerView.ViewHolder onCreateViewHolder(android.view.ViewGroup, int);
method public boolean onFailedToRecycleView(androidx.recyclerview.widget.RecyclerView.ViewHolder);
diff --git a/recyclerview/recyclerview/api/public_plus_experimental_current.txt b/recyclerview/recyclerview/api/public_plus_experimental_current.txt
index e1ffd69..55ccf87 100644
--- a/recyclerview/recyclerview/api/public_plus_experimental_current.txt
+++ b/recyclerview/recyclerview/api/public_plus_experimental_current.txt
@@ -79,6 +79,7 @@
method public boolean addAdapter(int, androidx.recyclerview.widget.RecyclerView.Adapter<? extends androidx.recyclerview.widget.RecyclerView.ViewHolder>);
method public java.util.List<? extends androidx.recyclerview.widget.RecyclerView.Adapter<? extends androidx.recyclerview.widget.RecyclerView.ViewHolder>> getAdapters();
method public int getItemCount();
+ method public android.util.Pair<androidx.recyclerview.widget.RecyclerView.Adapter<? extends androidx.recyclerview.widget.RecyclerView.ViewHolder>!,java.lang.Integer!> getWrappedAdapterAndPosition(int);
method public void onBindViewHolder(androidx.recyclerview.widget.RecyclerView.ViewHolder, int);
method public androidx.recyclerview.widget.RecyclerView.ViewHolder onCreateViewHolder(android.view.ViewGroup, int);
method public boolean onFailedToRecycleView(androidx.recyclerview.widget.RecyclerView.ViewHolder);
diff --git a/recyclerview/recyclerview/api/restricted_current.txt b/recyclerview/recyclerview/api/restricted_current.txt
index 5240856..c12f53e 100644
--- a/recyclerview/recyclerview/api/restricted_current.txt
+++ b/recyclerview/recyclerview/api/restricted_current.txt
@@ -79,6 +79,7 @@
method public boolean addAdapter(int, androidx.recyclerview.widget.RecyclerView.Adapter<? extends androidx.recyclerview.widget.RecyclerView.ViewHolder>);
method public java.util.List<? extends androidx.recyclerview.widget.RecyclerView.Adapter<? extends androidx.recyclerview.widget.RecyclerView.ViewHolder>> getAdapters();
method public int getItemCount();
+ method public android.util.Pair<androidx.recyclerview.widget.RecyclerView.Adapter<? extends androidx.recyclerview.widget.RecyclerView.ViewHolder>!,java.lang.Integer!> getWrappedAdapterAndPosition(int);
method public void onBindViewHolder(androidx.recyclerview.widget.RecyclerView.ViewHolder, int);
method public androidx.recyclerview.widget.RecyclerView.ViewHolder onCreateViewHolder(android.view.ViewGroup, int);
method public boolean onFailedToRecycleView(androidx.recyclerview.widget.RecyclerView.ViewHolder);
diff --git a/recyclerview/recyclerview/src/androidTest/java/androidx/recyclerview/widget/ConcatAdapterTest.kt b/recyclerview/recyclerview/src/androidTest/java/androidx/recyclerview/widget/ConcatAdapterTest.kt
index 8c12195..be28ecd 100644
--- a/recyclerview/recyclerview/src/androidTest/java/androidx/recyclerview/widget/ConcatAdapterTest.kt
+++ b/recyclerview/recyclerview/src/androidTest/java/androidx/recyclerview/widget/ConcatAdapterTest.kt
@@ -44,6 +44,7 @@
import androidx.test.filters.SmallTest
import com.google.common.truth.Truth.assertThat
import com.google.common.truth.Truth.assertWithMessage
+import org.junit.Assert.fail
import org.junit.Before
import org.junit.Test
import org.junit.runner.RunWith
@@ -1406,7 +1407,7 @@
}
@Test
- public fun builderDefaults() {
+ fun builderDefaults() {
val defaultBuilder = Builder().build()
assertThat(defaultBuilder.isolateViewTypes).isEqualTo(
ConcatAdapter.Config.DEFAULT.isolateViewTypes
@@ -1416,6 +1417,31 @@
)
}
+ @Test
+ fun getWrappedAdapterAndPositionTest() {
+ val adapter1 = NestedTestAdapter(10)
+ val adapter2 = NestedTestAdapter(10)
+ val concatAdapter = ConcatAdapter(adapter1, adapter2)
+ val result0 = concatAdapter.getWrappedAdapterAndPosition(0)
+ assertThat(result0.first).isEqualTo(adapter1)
+ assertThat(result0.second).isEqualTo(0)
+ val result5 = concatAdapter.getWrappedAdapterAndPosition(5)
+ assertThat(result5.first).isEqualTo(adapter1)
+ assertThat(result5.second).isEqualTo(5)
+ val result10 = concatAdapter.getWrappedAdapterAndPosition(10)
+ assertThat(result10.first).isEqualTo(adapter2)
+ assertThat(result10.second).isEqualTo(0)
+ val result15 = concatAdapter.getWrappedAdapterAndPosition(15)
+ assertThat(result15.first).isEqualTo(adapter2)
+ assertThat(result15.second).isEqualTo(5)
+ try {
+ val result20 = concatAdapter.getWrappedAdapterAndPosition(20)
+ fail("Should throw exception on invalid position, instead got $result20")
+ } catch (e: IllegalArgumentException) {
+ // Expected, pass
+ }
+ }
+
private var itemCounter = 0
private fun produceItem(): TestItem = (itemCounter++).let {
TestItem(id = it, value = it)
diff --git a/recyclerview/recyclerview/src/main/java/androidx/recyclerview/widget/ConcatAdapter.java b/recyclerview/recyclerview/src/main/java/androidx/recyclerview/widget/ConcatAdapter.java
index e2bb204..45b719f 100644
--- a/recyclerview/recyclerview/src/main/java/androidx/recyclerview/widget/ConcatAdapter.java
+++ b/recyclerview/recyclerview/src/main/java/androidx/recyclerview/widget/ConcatAdapter.java
@@ -18,6 +18,7 @@
import static androidx.recyclerview.widget.ConcatAdapter.Config.StableIdMode.NO_STABLE_IDS;
+import android.util.Pair;
import android.view.ViewGroup;
import androidx.annotation.NonNull;
@@ -286,10 +287,10 @@
* If the given {@link Adapter} is not part of this {@link ConcatAdapter},
* {@link RecyclerView#NO_POSITION} is returned.
*
- * @param adapter The adapter which is a sub adapter of this ConcatAdapter or itself.
- * @param viewHolder The view holder whose local position in the given adapter will be returned.
+ * @param adapter The adapter which is a sub adapter of this ConcatAdapter or itself.
+ * @param viewHolder The view holder whose local position in the given adapter will be
+ * returned.
* @param localPosition The position of the given {@link ViewHolder} in this {@link Adapter}.
- *
* @return The local position of the given {@link ViewHolder} in the given {@link Adapter} or
* {@link RecyclerView#NO_POSITION} if the {@link ViewHolder} is not bound to an item or the
* given {@link Adapter} is not part of this ConcatAdapter.
@@ -302,6 +303,28 @@
return mController.getLocalAdapterPosition(adapter, viewHolder, localPosition);
}
+
+ /**
+ * Retrieve the adapter and local position for a given position in this {@code ConcatAdapter}.
+ *
+ * This allows for retrieving wrapped adapter information in situations where you don't have a
+ * {@link ViewHolder}, such as within a
+ * {@link androidx.recyclerview.widget.GridLayoutManager.SpanSizeLookup} in which you want to
+ * look up information from the source adapter.
+ *
+ * @param globalPosition The position in this {@code ConcatAdapter}.
+ * @return a Pair with the first element set to the wrapped {@code Adapter} containing that
+ * position and the second element set to the local position in the wrapped adapter
+ * @throws IllegalArgumentException if the specified {@code globalPosition} does not
+ * correspond to a valid element of this adapter. That is, if {@code globalPosition} is less
+ * than 0 or greater than the total number of items in the {@code ConcatAdapter}
+ */
+ @NonNull
+ public Pair<Adapter<? extends ViewHolder>, Integer> getWrappedAdapterAndPosition(int
+ globalPosition) {
+ return mController.getWrappedAdapterAndPosition(globalPosition);
+ }
+
/**
* The configuration object for a {@link ConcatAdapter}.
*/
diff --git a/recyclerview/recyclerview/src/main/java/androidx/recyclerview/widget/ConcatAdapterController.java b/recyclerview/recyclerview/src/main/java/androidx/recyclerview/widget/ConcatAdapterController.java
index 1d20c06..d31540c 100644
--- a/recyclerview/recyclerview/src/main/java/androidx/recyclerview/widget/ConcatAdapterController.java
+++ b/recyclerview/recyclerview/src/main/java/androidx/recyclerview/widget/ConcatAdapterController.java
@@ -25,6 +25,7 @@
import static androidx.recyclerview.widget.RecyclerView.NO_POSITION;
import android.util.Log;
+import android.util.Pair;
import android.view.ViewGroup;
import androidx.annotation.NonNull;
@@ -325,6 +326,15 @@
return wrapper.onCreateViewHolder(parent, globalViewType);
}
+ public Pair<Adapter<? extends ViewHolder>, Integer> getWrappedAdapterAndPosition(
+ int globalPosition) {
+ WrapperAndLocalPosition wrapper = findWrapperAndLocalPosition(globalPosition);
+ Pair<Adapter<? extends ViewHolder>, Integer> pair = new Pair<>(wrapper.mWrapper.adapter,
+ wrapper.mLocalPosition);
+ releaseWrapperAndLocalPosition(wrapper);
+ return pair;
+ }
+
/**
* Always call {@link #releaseWrapperAndLocalPosition(WrapperAndLocalPosition)} when you are
* done with it
diff --git a/room/integration-tests/testapp/src/androidTest/java/androidx/room/integration/testapp/test/DefaultDaoMethodsTest.java b/room/integration-tests/testapp/src/androidTest/java/androidx/room/integration/testapp/test/DefaultDaoMethodsTest.java
new file mode 100644
index 0000000..c9ce25c
--- /dev/null
+++ b/room/integration-tests/testapp/src/androidTest/java/androidx/room/integration/testapp/test/DefaultDaoMethodsTest.java
@@ -0,0 +1,147 @@
+/*
+ * Copyright 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package androidx.room.integration.testapp.test;
+
+import static com.google.common.truth.Truth.assertThat;
+
+import androidx.room.Dao;
+import androidx.room.Database;
+import androidx.room.Entity;
+import androidx.room.Insert;
+import androidx.room.OnConflictStrategy;
+import androidx.room.PrimaryKey;
+import androidx.room.Query;
+import androidx.room.Room;
+import androidx.room.RoomDatabase;
+import androidx.room.Transaction;
+import androidx.room.Update;
+import androidx.test.core.app.ApplicationProvider;
+import androidx.test.ext.junit.runners.AndroidJUnit4;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+@RunWith(AndroidJUnit4.class)
+public class DefaultDaoMethodsTest {
+ interface BaseDefaultDao<T> {
+ @Insert(onConflict = OnConflictStrategy.IGNORE)
+ long insert(T obj);
+ @Update
+ void update(T obj);
+
+ @Transaction
+ default void upsert(T obj) {
+ long id = insert(obj);
+ if (id == -1L) {
+ update(obj);
+ }
+ }
+ }
+
+ @Dao
+ abstract static class AbstractEntityDao implements BaseDefaultDao<DefaultEntity> {
+ @Query("SELECT COUNT(*) FROM DefaultEntity")
+ abstract int count();
+ @Query("SELECT * FROM DefaultEntity WHERE id = :id")
+ abstract DefaultEntity load(long id);
+ }
+
+ @Dao
+ interface InterfaceEntityDao extends BaseDefaultDao<DefaultEntity> {
+ @Query("SELECT COUNT(*) FROM DefaultEntity")
+ int count();
+ @Query("SELECT * FROM DefaultEntity WHERE id = :id")
+ DefaultEntity load(long id);
+ }
+
+ @Entity
+ static class DefaultEntity {
+ @PrimaryKey(autoGenerate = true)
+ public long id;
+ public String value;
+
+ DefaultEntity(long id, String value) {
+ this.id = id;
+ this.value = value;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) return true;
+ if (!(o instanceof DefaultEntity)) return false;
+ DefaultEntity that = (DefaultEntity) o;
+ return id == that.id && value.equals(that.value);
+ }
+
+ @Override
+ public int hashCode() {
+ return (int) id;
+ }
+ }
+
+ @Database(
+ version = 1,
+ exportSchema = false,
+ entities = {DefaultEntity.class}
+ )
+ abstract static class DefaultsDb extends RoomDatabase {
+ abstract AbstractEntityDao abstractDao();
+ abstract InterfaceEntityDao interfaceDao();
+ }
+
+ private DefaultsDb mDb;
+ @Before
+ public void init() {
+ mDb = Room.inMemoryDatabaseBuilder(
+ ApplicationProvider.getApplicationContext(),
+ DefaultsDb.class
+ ).build();
+ }
+
+ @Test
+ public void abstractDao() {
+ DefaultEntity entity = new DefaultEntity(0, "v1");
+ mDb.abstractDao().insert(entity);
+ entity = mDb.abstractDao().load(1);
+ assertThat(entity).isNotNull();
+ entity.value = "v2";
+ mDb.abstractDao().upsert(entity);
+ assertThat(mDb.abstractDao().count()).isEqualTo(1);
+ assertThat(
+ mDb.abstractDao().load(1)
+ ).isEqualTo(
+ new DefaultEntity(1, "v2")
+ );
+ }
+
+ @Test
+ public void interfaceDao() {
+ DefaultEntity entity = new DefaultEntity(0, "v1");
+ mDb.interfaceDao().insert(entity);
+ entity = mDb.interfaceDao().load(1);
+ assertThat(entity).isNotNull();
+ entity.value = "v2";
+ mDb.interfaceDao().upsert(entity);
+ assertThat(mDb.interfaceDao().count()).isEqualTo(1);
+ assertThat(
+ mDb.interfaceDao().load(1)
+ ).isEqualTo(
+ new DefaultEntity(1, "v2")
+ );
+ }
+}
diff --git a/room/room-common/api/current.txt b/room/room-common/api/current.txt
index 2cd806f..74796f1 100644
--- a/room/room-common/api/current.txt
+++ b/room/room-common/api/current.txt
@@ -7,6 +7,17 @@
method public abstract int to();
}
+ @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({}) public @interface BuiltInTypeConverters {
+ method public abstract androidx.room.BuiltInTypeConverters.State enums() default androidx.room.BuiltInTypeConverters.State.INHERITED;
+ method public abstract androidx.room.BuiltInTypeConverters.State uuid() default androidx.room.BuiltInTypeConverters.State.INHERITED;
+ }
+
+ public enum BuiltInTypeConverters.State {
+ enum_constant public static final androidx.room.BuiltInTypeConverters.State DISABLED;
+ enum_constant public static final androidx.room.BuiltInTypeConverters.State ENABLED;
+ enum_constant public static final androidx.room.BuiltInTypeConverters.State INHERITED;
+ }
+
@java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.METHOD}) public @interface ColumnInfo {
method @androidx.room.ColumnInfo.Collate public abstract int collate() default androidx.room.ColumnInfo.UNSPECIFIED;
method public abstract String defaultValue() default androidx.room.ColumnInfo.VALUE_UNSPECIFIED;
@@ -252,7 +263,8 @@
}
@java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.PARAMETER, java.lang.annotation.ElementType.TYPE, java.lang.annotation.ElementType.FIELD}) public @interface TypeConverters {
- method public abstract Class<?>[] value();
+ method public abstract androidx.room.BuiltInTypeConverters builtInTypeConverters() default @androidx.room.BuiltInTypeConverters;
+ method public abstract Class<?>[] value() default {};
}
@java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) public @interface Update {
diff --git a/room/room-common/api/public_plus_experimental_current.txt b/room/room-common/api/public_plus_experimental_current.txt
index 2cd806f..74796f1 100644
--- a/room/room-common/api/public_plus_experimental_current.txt
+++ b/room/room-common/api/public_plus_experimental_current.txt
@@ -7,6 +7,17 @@
method public abstract int to();
}
+ @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({}) public @interface BuiltInTypeConverters {
+ method public abstract androidx.room.BuiltInTypeConverters.State enums() default androidx.room.BuiltInTypeConverters.State.INHERITED;
+ method public abstract androidx.room.BuiltInTypeConverters.State uuid() default androidx.room.BuiltInTypeConverters.State.INHERITED;
+ }
+
+ public enum BuiltInTypeConverters.State {
+ enum_constant public static final androidx.room.BuiltInTypeConverters.State DISABLED;
+ enum_constant public static final androidx.room.BuiltInTypeConverters.State ENABLED;
+ enum_constant public static final androidx.room.BuiltInTypeConverters.State INHERITED;
+ }
+
@java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.METHOD}) public @interface ColumnInfo {
method @androidx.room.ColumnInfo.Collate public abstract int collate() default androidx.room.ColumnInfo.UNSPECIFIED;
method public abstract String defaultValue() default androidx.room.ColumnInfo.VALUE_UNSPECIFIED;
@@ -252,7 +263,8 @@
}
@java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.PARAMETER, java.lang.annotation.ElementType.TYPE, java.lang.annotation.ElementType.FIELD}) public @interface TypeConverters {
- method public abstract Class<?>[] value();
+ method public abstract androidx.room.BuiltInTypeConverters builtInTypeConverters() default @androidx.room.BuiltInTypeConverters;
+ method public abstract Class<?>[] value() default {};
}
@java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) public @interface Update {
diff --git a/room/room-common/api/restricted_current.txt b/room/room-common/api/restricted_current.txt
index 9cbd3b8..51036df 100644
--- a/room/room-common/api/restricted_current.txt
+++ b/room/room-common/api/restricted_current.txt
@@ -7,6 +7,17 @@
method public abstract int to();
}
+ @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({}) public @interface BuiltInTypeConverters {
+ method public abstract androidx.room.BuiltInTypeConverters.State enums() default androidx.room.BuiltInTypeConverters.State.INHERITED;
+ method public abstract androidx.room.BuiltInTypeConverters.State uuid() default androidx.room.BuiltInTypeConverters.State.INHERITED;
+ }
+
+ public enum BuiltInTypeConverters.State {
+ enum_constant public static final androidx.room.BuiltInTypeConverters.State DISABLED;
+ enum_constant public static final androidx.room.BuiltInTypeConverters.State ENABLED;
+ enum_constant public static final androidx.room.BuiltInTypeConverters.State INHERITED;
+ }
+
@java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.METHOD}) public @interface ColumnInfo {
method @androidx.room.ColumnInfo.Collate public abstract int collate() default androidx.room.ColumnInfo.UNSPECIFIED;
method public abstract String defaultValue() default androidx.room.ColumnInfo.VALUE_UNSPECIFIED;
@@ -261,7 +272,8 @@
}
@java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.PARAMETER, java.lang.annotation.ElementType.TYPE, java.lang.annotation.ElementType.FIELD}) public @interface TypeConverters {
- method public abstract Class<?>[] value();
+ method public abstract androidx.room.BuiltInTypeConverters builtInTypeConverters() default @androidx.room.BuiltInTypeConverters;
+ method public abstract Class<?>[] value() default {};
}
@java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) public @interface Update {
diff --git a/room/room-common/src/main/java/androidx/room/BuiltInTypeConverters.java b/room/room-common/src/main/java/androidx/room/BuiltInTypeConverters.java
new file mode 100644
index 0000000..5e206a4
--- /dev/null
+++ b/room/room-common/src/main/java/androidx/room/BuiltInTypeConverters.java
@@ -0,0 +1,74 @@
+/*
+ * Copyright 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package androidx.room;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * Flags to turn on/off extra type converters provided by Room.
+ *
+ * For certain commonly used types (enums, UUID), Room provides automatic type converters. By
+ * default, these type converters are enabled but have lower priority than user provided type
+ * converters.
+ *
+ * You can set these flags in the {@link TypeConverters} annotation to turn them off / on. It
+ * might be useful if you want to have more strict control over how these types are saved into
+ * the database.
+ */
+@Target({})
+@Retention(RetentionPolicy.CLASS)
+public @interface BuiltInTypeConverters {
+ /**
+ * Controls whether Room can generate a TypeConverter for enum types and use their
+ * {@code name()} in the database.
+ *
+ * By default, it is set to {@link State#INHERITED} (on by default unless set to another
+ * value in a higher scope).
+ */
+ State enums() default State.INHERITED;
+
+ /**
+ * Controls whether Room can generate a TypeConverter for {@link java.util.UUID} and use its
+ * {@code byte[]} representation while saving it into database.
+ *
+ * By default, it is set to {@link State#INHERITED} (on by default unless set to another
+ * value in a higher scope).
+ */
+ State uuid() default State.INHERITED;
+
+ /**
+ * Control flags for built in converters.
+ */
+ enum State {
+ /**
+ * Room can use the built in converter.
+ */
+ ENABLED,
+ /**
+ * Room cannot use the built in converter.
+ */
+ DISABLED,
+ /**
+ * The value is inherited from the higher scope. See {@link TypeConverters} documentation
+ * to learn more about {@code TypeConverter} scoping.
+ * If this value is never set, it defaults to {@link #ENABLED}.
+ */
+ INHERITED
+ }
+}
diff --git a/room/room-common/src/main/java/androidx/room/TypeConverters.java b/room/room-common/src/main/java/androidx/room/TypeConverters.java
index e4c99dd..04ea7c7 100644
--- a/room/room-common/src/main/java/androidx/room/TypeConverters.java
+++ b/room/room-common/src/main/java/androidx/room/TypeConverters.java
@@ -51,5 +51,11 @@
*
* @return The list of classes that contains the converter methods.
*/
- Class<?>[] value();
+ Class<?>[] value() default {};
+
+ /**
+ * Configure whether Room can use various built in converters for common types.
+ * See {@link BuiltInTypeConverters} for details.
+ */
+ BuiltInTypeConverters builtInTypeConverters() default @BuiltInTypeConverters;
}
diff --git a/room/room-common/src/test/java/androidx/room/AnnotationRetentionPolicyTest.kt b/room/room-common/src/test/java/androidx/room/AnnotationRetentionPolicyTest.kt
index 09a2707..55c1c81 100644
--- a/room/room-common/src/test/java/androidx/room/AnnotationRetentionPolicyTest.kt
+++ b/room/room-common/src/test/java/androidx/room/AnnotationRetentionPolicyTest.kt
@@ -18,6 +18,7 @@
import com.google.common.reflect.ClassPath
import org.junit.Test
+import java.lang.annotation.Retention
import java.lang.annotation.RetentionPolicy
/** Test to make sure annotations have the correct retention policy. */
@@ -34,7 +35,7 @@
// For Room to be incremental, all annotations need to have CLASS retention policy.
annotations.forEach {
- val retentionPolicy = it.getAnnotation(java.lang.annotation.Retention::class.java).value
+ val retentionPolicy = it.getAnnotation(Retention::class.java)?.value
assert(retentionPolicy == RetentionPolicy.CLASS) {
"Expected ${it.name} annotation to have retention policy CLASS" +
" but it is $retentionPolicy"
diff --git a/room/room-compiler-processing-testing/src/main/java/androidx/room/compiler/processing/util/CompilationResultSubject.kt b/room/room-compiler-processing-testing/src/main/java/androidx/room/compiler/processing/util/CompilationResultSubject.kt
index 6562478..6af7d8d 100644
--- a/room/room-compiler-processing-testing/src/main/java/androidx/room/compiler/processing/util/CompilationResultSubject.kt
+++ b/room/room-compiler-processing-testing/src/main/java/androidx/room/compiler/processing/util/CompilationResultSubject.kt
@@ -238,7 +238,7 @@
* @see hasWarning
* @see hasNote
*/
- fun hasError(expected: String): DiagnosticMessageSubject {
+ fun hasError(expected: String): DiagnosticMessagesSubject {
shouldSucceed = false
return hasDiagnosticWithMessage(
kind = Diagnostic.Kind.ERROR,
@@ -255,7 +255,7 @@
* @see hasWarningContaining
* @see hasNoteContaining
*/
- fun hasErrorContaining(expected: String): DiagnosticMessageSubject {
+ fun hasErrorContaining(expected: String): DiagnosticMessagesSubject {
shouldSucceed = false
return hasDiagnosticWithMessage(
kind = Diagnostic.Kind.ERROR,
@@ -374,21 +374,19 @@
expected: String,
acceptPartialMatch: Boolean,
buildErrorMessage: () -> String
- ): DiagnosticMessageSubject {
+ ): DiagnosticMessagesSubject {
val diagnostics = compilationResult.diagnosticsOfKind(kind)
- var diagnostic = diagnostics.firstOrNull {
- it.msg == expected
- }
- if (diagnostic == null && acceptPartialMatch) {
- diagnostic = diagnostics.firstOrNull {
+ val matches = diagnostics.filter {
+ if (acceptPartialMatch) {
it.msg.contains(expected)
+ } else {
+ it.msg == expected
}
}
- diagnostic?.let {
- return DiagnosticMessageSubject.assertThat(it)
+ if (matches.isEmpty()) {
+ failWithActual(simpleFact(buildErrorMessage()))
}
- failWithActual(simpleFact(buildErrorMessage()))
- error("unreachable")
+ return DiagnosticMessagesSubject.assertThat(matches)
}
/**
diff --git a/room/room-compiler-processing-testing/src/main/java/androidx/room/compiler/processing/util/DiagnosticMessageSubject.kt b/room/room-compiler-processing-testing/src/main/java/androidx/room/compiler/processing/util/DiagnosticMessageSubject.kt
deleted file mode 100644
index ba817ef..0000000
--- a/room/room-compiler-processing-testing/src/main/java/androidx/room/compiler/processing/util/DiagnosticMessageSubject.kt
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
- * Copyright 2021 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package androidx.room.compiler.processing.util
-
-import com.google.common.truth.Fact.simpleFact
-import com.google.common.truth.FailureMetadata
-import com.google.common.truth.Subject
-import com.google.common.truth.Subject.Factory
-import com.google.common.truth.Truth
-
-/**
- * Truth subject for diagnostic messages
- */
-class DiagnosticMessageSubject internal constructor(
- failureMetadata: FailureMetadata,
- private val diagnosticMessage: DiagnosticMessage,
-) : Subject<DiagnosticMessageSubject, DiagnosticMessage>(
- failureMetadata, diagnosticMessage
-) {
- private val lineContent by lazy {
- val location = diagnosticMessage.location ?: return@lazy null
- location.source?.contents?.lines()?.getOrNull(
- location.line - 1
- )
- }
-
- /**
- * Checks the location of the diagnostic message against the given [lineNumber].
- */
- fun onLine(lineNumber: Int) = apply {
- if (diagnosticMessage.location?.line != lineNumber) {
- failWithActual(
- simpleFact(
- "expected line $lineNumber but it was ${diagnosticMessage.location}"
- )
- )
- }
- }
-
- /**
- * Checks the contents of the line from the original file against the given [content].
- */
- fun onLineContaining(content: String) = apply {
- if (lineContent == null) {
- failWithActual(
- simpleFact("Cannot validate line content due to missing location information")
- )
- }
- if (lineContent?.contains(content) != true) {
- failWithActual(
- simpleFact("expected line content with $content but was $lineContent")
- )
- }
- }
-
- /**
- * Checks the contents of the source where the diagnostic message was reported on, against
- * the given [source].
- */
- fun onSource(source: Source) = apply {
- if (diagnosticMessage.location?.source != source) {
- failWithActual(
- simpleFact(
- """
- Expected diagnostic to be on $source but found it on
- ${diagnosticMessage.location?.source}
- """.trimIndent()
- )
- )
- }
- }
-
- companion object {
- private val FACTORY =
- Factory<DiagnosticMessageSubject, DiagnosticMessage> { metadata, actual ->
- DiagnosticMessageSubject(metadata, actual)
- }
-
- fun assertThat(
- diagnosticMessage: DiagnosticMessage
- ): DiagnosticMessageSubject {
- return Truth.assertAbout(FACTORY).that(
- diagnosticMessage
- )
- }
- }
-}
\ No newline at end of file
diff --git a/room/room-compiler-processing-testing/src/main/java/androidx/room/compiler/processing/util/DiagnosticMessagesSubject.kt b/room/room-compiler-processing-testing/src/main/java/androidx/room/compiler/processing/util/DiagnosticMessagesSubject.kt
new file mode 100644
index 0000000..d3372e2
--- /dev/null
+++ b/room/room-compiler-processing-testing/src/main/java/androidx/room/compiler/processing/util/DiagnosticMessagesSubject.kt
@@ -0,0 +1,132 @@
+/*
+ * Copyright 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package androidx.room.compiler.processing.util
+
+import com.google.common.truth.Fact.simpleFact
+import com.google.common.truth.FailureMetadata
+import com.google.common.truth.Subject
+import com.google.common.truth.Subject.Factory
+import com.google.common.truth.Truth
+
+/**
+ * Truth subject for diagnostic messages
+ */
+class DiagnosticMessagesSubject internal constructor(
+ failureMetadata: FailureMetadata,
+ private val diagnosticMessages: List<DiagnosticMessage>,
+) : Subject<DiagnosticMessagesSubject, List<DiagnosticMessage>>(
+ failureMetadata, diagnosticMessages
+) {
+
+ private val lineContents by lazy {
+ diagnosticMessages.mapNotNull {
+ it.location?.let { location ->
+ location.source?.contents?.lines()?.getOrNull(
+ location.line - 1
+ )
+ }
+ }
+ }
+
+ private val locations by lazy {
+ diagnosticMessages.mapNotNull { it.location }
+ }
+
+ /**
+ * Checks the location of the diagnostic message against the given [lineNumber].
+ *
+ * Note that if there are multiple messages, any match will be sufficient.
+ */
+ fun onLine(lineNumber: Int) = apply {
+ if (locations.none {
+ it.line == lineNumber
+ }
+ ) {
+ failWithActual(
+ simpleFact(
+ "expected line $lineNumber but it was " +
+ locations.joinToString(",")
+ )
+ )
+ }
+ }
+
+ /**
+ * Checks the number of messages in the subject.
+ */
+ fun hasCount(expected: Int) = apply {
+ if (diagnosticMessages.size != expected) {
+ failWithActual(
+ simpleFact("expected $expected messages, found ${diagnosticMessages.size}")
+ )
+ }
+ }
+
+ /**
+ * Checks the contents of the line from the original file against the given [content].
+ */
+ fun onLineContaining(content: String) = apply {
+ if (lineContents.isEmpty()) {
+ failWithActual(
+ simpleFact("Cannot validate line content due to missing location information")
+ )
+ }
+ if (lineContents.none {
+ it.contains(content)
+ }
+ ) {
+ failWithActual(
+ simpleFact(
+ "expected line content with $content but was " +
+ lineContents.joinToString("\n")
+ )
+ )
+ }
+ }
+
+ /**
+ * Checks the contents of the source where the diagnostic message was reported on, against
+ * the given [source].
+ */
+ fun onSource(source: Source) = apply {
+ if (locations.none { it.source == source }) {
+ failWithActual(
+ simpleFact(
+ """
+ Expected diagnostic to be on $source but found it on
+ ${locations.joinToString(",")}
+ """.trimIndent()
+ )
+ )
+ }
+ }
+
+ companion object {
+ private val FACTORY =
+ Factory<DiagnosticMessagesSubject, List<DiagnosticMessage>> { metadata, actual ->
+ DiagnosticMessagesSubject(metadata, actual)
+ }
+
+ fun assertThat(
+ diagnosticMessages: List<DiagnosticMessage>
+ ): DiagnosticMessagesSubject {
+ return Truth.assertAbout(FACTORY).that(
+ diagnosticMessages
+ )
+ }
+ }
+}
\ No newline at end of file
diff --git a/room/room-compiler-processing/src/main/java/androidx/room/compiler/processing/XAnnotation.kt b/room/room-compiler-processing/src/main/java/androidx/room/compiler/processing/XAnnotation.kt
index fcb81d0..1787f38 100644
--- a/room/room-compiler-processing/src/main/java/androidx/room/compiler/processing/XAnnotation.kt
+++ b/room/room-compiler-processing/src/main/java/androidx/room/compiler/processing/XAnnotation.kt
@@ -106,6 +106,32 @@
}
/**
+ * Returns the value of the given [methodName], throwing an exception if the method is not
+ * found or if the given type [T] does not match the actual type.
+ *
+ * This uses a non-reified type and takes in a Class so it is callable by Java users.
+ *
+ * Note that non primitive types are wrapped by interfaces in order to allow them to be
+ * represented by the process:
+ * - "Class" types are represented with [XType]
+ * - Annotations are represented with [XAnnotation]
+ * - Enums are represented with [XEnumEntry]
+ *
+ * For convenience, wrapper functions are provided for these types, eg [XAnnotation.getAsType]
+ */
+fun <T> XAnnotation.get(methodName: String, clazz: Class<T>): T {
+ val argument = annotationValues.firstOrNull { it.name == methodName }
+ ?: error("No property named $methodName was found in annotation $name")
+
+ if (!clazz.isInstance(argument.value)) {
+ error("Value of $methodName of type ${argument.value?.javaClass} cannot be cast to $clazz")
+ }
+
+ @Suppress("UNCHECKED_CAST")
+ return argument.value as T
+}
+
+/**
* Get a representation of this [XAnnotation] as a [XAnnotationBox]. This is helpful for converting
* to [XAnnotationBox] after getting annotations with [XAnnotated.getAllAnnotations].
*
diff --git a/room/room-compiler-processing/src/main/java/androidx/room/compiler/processing/javac/JavacMethodElement.kt b/room/room-compiler-processing/src/main/java/androidx/room/compiler/processing/javac/JavacMethodElement.kt
index e4fffe6..8122cc0 100644
--- a/room/room-compiler-processing/src/main/java/androidx/room/compiler/processing/javac/JavacMethodElement.kt
+++ b/room/room-compiler-processing/src/main/java/androidx/room/compiler/processing/javac/JavacMethodElement.kt
@@ -20,7 +20,6 @@
import androidx.room.compiler.processing.XMethodType
import androidx.room.compiler.processing.XType
import androidx.room.compiler.processing.XTypeElement
-import androidx.room.compiler.processing.XVariableElement
import androidx.room.compiler.processing.javac.kotlin.KmFunction
import com.google.auto.common.MoreElements
import com.google.auto.common.MoreTypes
@@ -28,6 +27,7 @@
import javax.lang.model.element.ExecutableElement
import javax.lang.model.element.Modifier
import javax.lang.model.element.TypeElement
+import javax.lang.model.type.TypeVariable
internal class JavacMethodElement(
env: JavacProcessingEnv,
@@ -117,22 +117,32 @@
override fun hasKotlinDefaultImpl(): Boolean {
fun paramsMatch(
- ourParams: List<XVariableElement>,
- theirParams: List<XVariableElement>
+ ourParams: List<JavacMethodParameter>,
+ theirParams: List<JavacMethodParameter>
): Boolean {
if (ourParams.size != theirParams.size - 1) {
return false
}
- ourParams.forEachIndexed { i, variableElement ->
+ return (ourParams.indices).all { paramIndex ->
// Plus 1 to their index because their first param is a self object.
- if (!theirParams[i + 1].type.isSameType(
- variableElement.type
- )
- ) {
- return false
+ // We specifically use `asType` here instead of XVariableElement.type because
+ // we want to ignore the containing type (so that generics etc are NOT resolved to
+ // the containing type)
+ val theirParamType = theirParams[paramIndex + 1].element.asType()
+ val ourParamType = ourParams[paramIndex].element.asType()
+ if (env.typeUtils.isSameType(ourParamType, theirParamType)) {
+ true
+ } else {
+ // if isSameType returns false, check for generics. b/199888180
+ val ourTypeVar = ourParamType as? TypeVariable
+ val theirTypeVar = theirParamType as? TypeVariable
+ ourTypeVar != null && theirTypeVar != null &&
+ env.typeUtils.isSameType(
+ ourTypeVar.lowerBound,
+ theirTypeVar.lowerBound
+ )
}
}
- return true
}
return kotlinDefaultImplClass?.getDeclaredMethods()?.any {
it.name == this.name && paramsMatch(parameters, it.parameters)
diff --git a/room/room-compiler-processing/src/main/java/androidx/room/compiler/processing/javac/JavacTypeElement.kt b/room/room-compiler-processing/src/main/java/androidx/room/compiler/processing/javac/JavacTypeElement.kt
index f6ee048..61630af 100644
--- a/room/room-compiler-processing/src/main/java/androidx/room/compiler/processing/javac/JavacTypeElement.kt
+++ b/room/room-compiler-processing/src/main/java/androidx/room/compiler/processing/javac/JavacTypeElement.kt
@@ -20,7 +20,6 @@
import androidx.room.compiler.processing.XEnumTypeElement
import androidx.room.compiler.processing.XFieldElement
import androidx.room.compiler.processing.XHasModifiers
-import androidx.room.compiler.processing.XMethodElement
import androidx.room.compiler.processing.XTypeElement
import androidx.room.compiler.processing.javac.kotlin.KotlinMetadataElement
import com.google.auto.common.MoreElements
@@ -111,7 +110,7 @@
}
}
- override fun getDeclaredMethods(): List<XMethodElement> {
+ override fun getDeclaredMethods(): List<JavacMethodElement> {
return _declaredMethods
}
diff --git a/room/room-compiler-processing/src/main/java/androidx/room/compiler/processing/ksp/KspClassFileUtility.kt b/room/room-compiler-processing/src/main/java/androidx/room/compiler/processing/ksp/KspClassFileUtility.kt
index 0eb125b..88e192a 100644
--- a/room/room-compiler-processing/src/main/java/androidx/room/compiler/processing/ksp/KspClassFileUtility.kt
+++ b/room/room-compiler-processing/src/main/java/androidx/room/compiler/processing/ksp/KspClassFileUtility.kt
@@ -17,6 +17,7 @@
package androidx.room.compiler.processing.ksp
import androidx.room.compiler.processing.XProcessingConfig
+import com.google.devtools.ksp.symbol.ClassKind
import com.google.devtools.ksp.symbol.KSClassDeclaration
import com.google.devtools.ksp.symbol.Origin
import java.lang.reflect.InvocationHandler
@@ -111,7 +112,13 @@
val binarySource = typeReferences.binaryClassMethod.invoke(descriptorSrc)
?: return null
- val fieldNameComparator = MemberNameComparator(getName)
+ val fieldNameComparator = MemberNameComparator(
+ getName = getName,
+ // we can do strict mode only in classes. For Interfaces, private methods won't
+ // show up in the binary.
+ strictMode = XProcessingConfig.STRICT_MODE &&
+ ksClassDeclaration.classKind != ClassKind.INTERFACE
+ )
val invocationHandler = InvocationHandler { _, method, args ->
if (method.name == type.visitorName) {
val nameAsString = typeReferences.asStringMethod.invoke(args[0])
@@ -206,7 +213,8 @@
}
private class MemberNameComparator<T>(
- val getName: T.() -> String
+ val getName: T.() -> String,
+ val strictMode: Boolean
) : Comparator<T> {
private var nextOrder: Int = 0
private var sealed: Boolean = false
@@ -233,8 +241,8 @@
* new ID.
*/
private fun getOrder(name: String) = orders.getOrPut(name) {
- if (sealed && XProcessingConfig.STRICT_MODE) {
- error("expected to find field $name but it is non-existent")
+ if (sealed && strictMode) {
+ error("expected to find field/method $name but it is non-existent")
}
nextOrder++
}
diff --git a/room/room-compiler-processing/src/test/java/androidx/room/compiler/processing/XAnnotationTest.kt b/room/room-compiler-processing/src/test/java/androidx/room/compiler/processing/XAnnotationTest.kt
index 1ed0c7e..6fd9043 100644
--- a/room/room-compiler-processing/src/test/java/androidx/room/compiler/processing/XAnnotationTest.kt
+++ b/room/room-compiler-processing/src/test/java/androidx/room/compiler/processing/XAnnotationTest.kt
@@ -838,6 +838,32 @@
}
}
+ @Test
+ fun readPrimitiveAnnotationValueUsingClass() {
+ val source = Source.java(
+ "foo.bar.Baz",
+ """
+ package foo.bar;
+ import androidx.room.compiler.processing.testcode.JavaAnnotationWithDefaults;
+ @JavaAnnotationWithDefaults(stringVal = "test")
+ public class Baz {
+ }
+ """.trimIndent()
+ )
+ runTest(
+ sources = listOf(source)
+ ) { invocation ->
+ val element = invocation.processingEnv.requireTypeElement("foo.bar.Baz")
+ val annotation =
+ element.requireAnnotation(ClassName.get(JavaAnnotationWithDefaults::class.java))
+
+ // Even though not necessary for calling from Kotlin, use the version that passes
+ // in a Class to test it.
+ assertThat(annotation.get("stringVal", String::class.java)).isEqualTo("test")
+ assertThat(annotation.get("intVal", Int::class.javaObjectType)).isEqualTo(3)
+ }
+ }
+
// helper function to read what we need
private fun XAnnotated.getSuppressValues(): List<String>? {
return this.findAnnotation<TestSuppressWarnings>()
diff --git a/room/room-compiler-processing/src/test/java/androidx/room/compiler/processing/XExecutableElementTest.kt b/room/room-compiler-processing/src/test/java/androidx/room/compiler/processing/XExecutableElementTest.kt
index 1c8c910..f55ec49 100644
--- a/room/room-compiler-processing/src/test/java/androidx/room/compiler/processing/XExecutableElementTest.kt
+++ b/room/room-compiler-processing/src/test/java/androidx/room/compiler/processing/XExecutableElementTest.kt
@@ -36,6 +36,7 @@
import org.junit.Test
import org.junit.runner.RunWith
import org.junit.runners.JUnit4
+import java.io.File
import java.io.IOException
import java.lang.IllegalStateException
@@ -124,13 +125,22 @@
}
@Test
- fun kotlinDefaultImpl() {
+ fun kotlinDefaultImpl_src() {
+ kotlinDefaultImpl(preCompiled = false)
+ }
+
+ @Test
+ fun kotlinDefaultImpl_lib() {
+ kotlinDefaultImpl(preCompiled = true)
+ }
+
+ private fun kotlinDefaultImpl(preCompiled: Boolean) {
val subject = Source.kotlin(
"Baz.kt",
"""
package foo.bar
- interface Baz {
+ interface Base {
fun noDefault()
fun withDefault(): Int {
return 3
@@ -145,42 +155,160 @@
return ""
}
}
+
+ interface Sub : Base
""".trimIndent()
)
+ val (sources, classpath) = if (preCompiled) {
+ emptyList<Source>() to compileFiles(listOf(subject))
+ } else {
+ listOf(subject) to emptyList<File>()
+ }
runProcessorTest(
- sources = listOf(subject)
+ sources = sources,
+ classpath = classpath
) { invocation ->
- val element = invocation.processingEnv.requireTypeElement("foo.bar.Baz")
- element.getDeclaredMethod("noDefault").let { method ->
- assertThat(method.hasKotlinDefaultImpl()).isFalse()
- }
- element.getDeclaredMethod("withDefault").let { method ->
- assertThat(method.hasKotlinDefaultImpl()).isTrue()
- }
- element.getDeclaredMethods().first {
- it.name == "nameMatch" && it.parameters.isEmpty()
- }.let { nameMatchWithoutDefault ->
- assertThat(nameMatchWithoutDefault.hasKotlinDefaultImpl()).isFalse()
- }
-
- element.getDeclaredMethods().first {
- it.name == "nameMatch" && it.parameters.size == 1
- }.let { nameMatchWithoutDefault ->
- assertThat(nameMatchWithoutDefault.hasKotlinDefaultImpl()).isTrue()
- }
-
- element.getDeclaredMethod("withDefaultWithParams").let { method ->
- assertThat(method.hasKotlinDefaultImpl()).isTrue()
- }
-
- element.getDeclaredMethod("withDefaultWithTypeArgs").let { method ->
- assertThat(method.hasKotlinDefaultImpl()).isTrue()
- }
- // private functions in interfaces don't appear in kapt stubs
- if (invocation.isKsp) {
- element.getDeclaredMethod("privateWithDefault").let { method ->
+ listOf("Base", "Sub").forEach { className ->
+ val element = invocation.processingEnv.requireTypeElement("foo.bar.$className")
+ element.getMethod("noDefault").let { method ->
assertThat(method.hasKotlinDefaultImpl()).isFalse()
}
+ element.getMethod("withDefault").let { method ->
+ assertThat(method.hasKotlinDefaultImpl()).isTrue()
+ }
+ element.getAllMethods().first {
+ it.name == "nameMatch" && it.parameters.isEmpty()
+ }.let { nameMatchWithoutDefault ->
+ assertThat(nameMatchWithoutDefault.hasKotlinDefaultImpl()).isFalse()
+ }
+
+ element.getAllMethods().first {
+ it.name == "nameMatch" && it.parameters.size == 1
+ }.let { nameMatchWithoutDefault ->
+ assertThat(nameMatchWithoutDefault.hasKotlinDefaultImpl()).isTrue()
+ }
+
+ element.getMethod("withDefaultWithParams").let { method ->
+ assertThat(method.hasKotlinDefaultImpl()).isTrue()
+ }
+
+ element.getMethod("withDefaultWithTypeArgs").let { method ->
+ assertThat(method.hasKotlinDefaultImpl()).isTrue()
+ }
+ // private functions in interfaces don't appear in kapt stubs
+ if (invocation.isKsp && className == "Base") {
+ element.getMethod("privateWithDefault").let { method ->
+ assertThat(method.hasKotlinDefaultImpl()).isFalse()
+ }
+ }
+ }
+ }
+ }
+
+ @Test
+ fun kotlinDefaultImpl_typeParams_src() {
+ kotlinDefaultImpl_typeParams(preCompiled = false)
+ }
+
+ @Test
+ fun kotlinDefaultImpl_typeParams_lib() {
+ kotlinDefaultImpl_typeParams(preCompiled = true)
+ }
+
+ private fun kotlinDefaultImpl_typeParams(preCompiled: Boolean) {
+ val subject = Source.kotlin(
+ "Baz.kt",
+ """
+ package foo.bar
+
+ interface Base<T1, T2> {
+ fun noDefault(t : T1)
+ fun withDefault_noArg(): Int {
+ return 3
+ }
+ fun nameMatch()
+ fun nameMatch(param:T1) {}
+ fun withDefaultWithParams(param1:T1, param2:T2) {}
+ fun withDefaultWithTypeArgs(param1: List<String>): String {
+ return param1.first()
+ }
+ private fun privateWithDefault(): String {
+ return ""
+ }
+ }
+
+ interface Sub : Base<Int, String>
+
+ interface Base2<T1, T2, in T3, out T4, T5 : Number> {
+
+ fun withDefaultWithInProjectionType(param1: T3) {}
+
+ fun withDefaultWithOutProjectionType(): T4? {
+ return null
+ }
+
+ fun withDefaultWithSubtypeArg(param: T5) { }
+ }
+
+ interface Sub2 : Base2<Int, String, Number, Number, Long>
+
+ """.trimIndent()
+ )
+ val (sources, classpath) = if (preCompiled) {
+ emptyList<Source>() to compileFiles(listOf(subject))
+ } else {
+ listOf(subject) to emptyList<File>()
+ }
+ runProcessorTest(
+ sources = sources,
+ classpath = classpath
+ ) { invocation ->
+ listOf("Base", "Sub").forEach { className ->
+ val element = invocation.processingEnv.requireTypeElement("foo.bar.$className")
+ element.getMethod("noDefault").let { method ->
+ assertThat(method.hasKotlinDefaultImpl()).isFalse()
+ }
+ element.getMethod("withDefault_noArg").let { method ->
+ assertThat(method.hasKotlinDefaultImpl()).isTrue()
+ }
+ element.getAllMethods().first {
+ it.name == "nameMatch" && it.parameters.isEmpty()
+ }.let { nameMatchWithoutDefault ->
+ assertThat(nameMatchWithoutDefault.hasKotlinDefaultImpl()).isFalse()
+ }
+
+ element.getAllMethods().first {
+ it.name == "nameMatch" && it.parameters.size == 1
+ }.let { nameMatchWithoutDefault ->
+ assertThat(nameMatchWithoutDefault.hasKotlinDefaultImpl()).isTrue()
+ }
+
+ element.getMethod("withDefaultWithParams").let { method ->
+ assertThat(method.hasKotlinDefaultImpl()).isTrue()
+ }
+
+ element.getMethod("withDefaultWithTypeArgs").let { method ->
+ assertThat(method.hasKotlinDefaultImpl()).isTrue()
+ }
+ // private functions in interfaces don't appear in kapt stubs
+ if (invocation.isKsp && className == "Base") {
+ element.getMethod("privateWithDefault").let { method ->
+ assertThat(method.hasKotlinDefaultImpl()).isFalse()
+ }
+ }
+ }
+
+ listOf("Base2", "Sub2").forEach { className ->
+ val element = invocation.processingEnv.requireTypeElement("foo.bar.$className")
+ element.getMethod("withDefaultWithInProjectionType").let { method ->
+ assertThat(method.hasKotlinDefaultImpl()).isTrue()
+ }
+ element.getMethod("withDefaultWithOutProjectionType").let { method ->
+ assertThat(method.hasKotlinDefaultImpl()).isTrue()
+ }
+ element.getMethod("withDefaultWithSubtypeArg").let { method ->
+ assertThat(method.hasKotlinDefaultImpl()).isTrue()
+ }
}
}
}
diff --git a/room/room-compiler/build.gradle b/room/room-compiler/build.gradle
index 23485270..483b1cac 100644
--- a/room/room-compiler/build.gradle
+++ b/room/room-compiler/build.gradle
@@ -109,6 +109,7 @@
testImplementation(libs.jsr250)
testImplementation(libs.mockitoCore)
testImplementation(libs.antlr4)
+ testImplementation(libs.kotlinCompilerEmbeddable)
testImplementation(fileTree(
dir: "${SdkHelperKt.getSdkPath(project)}/platforms/$SupportConfig.COMPILE_SDK_VERSION/",
include : "android.jar"
diff --git a/room/room-compiler/src/main/kotlin/androidx/room/processor/Context.kt b/room/room-compiler/src/main/kotlin/androidx/room/processor/Context.kt
index 9d1d2bb..10b6ce8 100644
--- a/room/room-compiler/src/main/kotlin/androidx/room/processor/Context.kt
+++ b/room/room-compiler/src/main/kotlin/androidx/room/processor/Context.kt
@@ -17,18 +17,18 @@
package androidx.room.processor
import androidx.room.RewriteQueriesToDropUnusedColumns
+import androidx.room.compiler.processing.XElement
+import androidx.room.compiler.processing.XProcessingEnv
+import androidx.room.compiler.processing.XType
import androidx.room.log.RLog
import androidx.room.parser.expansion.ProjectionExpander
import androidx.room.parser.optimization.RemoveUnusedColumnQueryRewriter
import androidx.room.preconditions.Checks
-import androidx.room.compiler.processing.XElement
-import androidx.room.compiler.processing.XProcessingEnv
-import androidx.room.compiler.processing.XType
import androidx.room.processor.cache.Cache
import androidx.room.solver.TypeAdapterStore
import androidx.room.verifier.DatabaseVerifier
+import androidx.room.vo.BuiltInConverterFlags
import androidx.room.vo.Warning
-import java.util.LinkedHashSet
class Context private constructor(
val processingEnv: XProcessingEnv,
@@ -36,7 +36,7 @@
private val typeConverters: CustomConverterProcessor.ProcessResult,
private val inheritedAdapterStore: TypeAdapterStore?,
val cache: Cache,
- private val canRewriteQueriesToDropUnusedColumns: Boolean
+ private val canRewriteQueriesToDropUnusedColumns: Boolean,
) {
val checker: Checks = Checks(logger)
val COMMON_TYPES = CommonTypes(processingEnv)
@@ -45,7 +45,10 @@
if (inheritedAdapterStore != null) {
TypeAdapterStore.copy(this, inheritedAdapterStore)
} else {
- TypeAdapterStore.create(this, typeConverters.converters)
+ TypeAdapterStore.create(
+ this, typeConverters.builtInConverterFlags,
+ typeConverters.converters
+ )
}
}
@@ -89,7 +92,12 @@
logger = RLog(processingEnv.messager, emptySet(), null),
typeConverters = CustomConverterProcessor.ProcessResult.EMPTY,
inheritedAdapterStore = null,
- cache = Cache(null, LinkedHashSet(), emptySet()),
+ cache = Cache(
+ parent = null,
+ converters = LinkedHashSet(),
+ suppressedWarnings = emptySet(),
+ builtInConverterFlags = BuiltInConverterFlags.DEFAULT
+ ),
canRewriteQueriesToDropUnusedColumns = false
)
@@ -136,7 +144,12 @@
fun fork(element: XElement, forceSuppressedWarnings: Set<Warning> = emptySet()): Context {
val suppressedWarnings = SuppressWarningProcessor.getSuppressedWarnings(element)
val processConvertersResult = CustomConverterProcessor.findConverters(this, element)
- val canReUseAdapterStore = processConvertersResult.classes.isEmpty()
+ val subBuiltInConverterFlags = typeConverters.builtInConverterFlags.withNext(
+ processConvertersResult.builtInConverterFlags
+ )
+ val canReUseAdapterStore =
+ subBuiltInConverterFlags == typeConverters.builtInConverterFlags &&
+ processConvertersResult.classes.isEmpty()
// order here is important since the sub context should give priority to new converters.
val subTypeConverters = if (canReUseAdapterStore) {
this.typeConverters
@@ -145,7 +158,12 @@
}
val subSuppressedWarnings =
forceSuppressedWarnings + suppressedWarnings + logger.suppressedWarnings
- val subCache = Cache(cache, subTypeConverters.classes, subSuppressedWarnings)
+ val subCache = Cache(
+ parent = cache,
+ converters = subTypeConverters.classes,
+ suppressedWarnings = subSuppressedWarnings,
+ builtInConverterFlags = subBuiltInConverterFlags
+ )
val subCanRemoveUnusedColumns = canRewriteQueriesToDropUnusedColumns ||
element.hasRemoveUnusedColumnsAnnotation()
val subContext = Context(
@@ -177,8 +195,8 @@
}
enum class BooleanProcessorOptions(val argName: String, private val defaultValue: Boolean) {
- INCREMENTAL("room.incremental", true),
- EXPAND_PROJECTION("room.expandProjection", false);
+ INCREMENTAL("room.incremental", defaultValue = true),
+ EXPAND_PROJECTION("room.expandProjection", defaultValue = false);
/**
* Returns the value of this option passed through the [XProcessingEnv]. If the value
diff --git a/room/room-compiler/src/main/kotlin/androidx/room/processor/CustomConverterProcessor.kt b/room/room-compiler/src/main/kotlin/androidx/room/processor/CustomConverterProcessor.kt
index 7512abf..499657e 100644
--- a/room/room-compiler/src/main/kotlin/androidx/room/processor/CustomConverterProcessor.kt
+++ b/room/room-compiler/src/main/kotlin/androidx/room/processor/CustomConverterProcessor.kt
@@ -16,6 +16,7 @@
package androidx.room.processor
+import androidx.room.BuiltInTypeConverters
import androidx.room.ProvidedTypeConverter
import androidx.room.TypeConverter
import androidx.room.TypeConverters
@@ -32,6 +33,7 @@
import androidx.room.processor.ProcessorErrors.TYPE_CONVERTER_MUST_RECEIVE_1_PARAM
import androidx.room.processor.ProcessorErrors.TYPE_CONVERTER_UNBOUND_GENERIC
import androidx.room.solver.types.CustomTypeConverterWrapper
+import androidx.room.vo.BuiltInConverterFlags
import androidx.room.vo.CustomTypeConverter
import java.util.LinkedHashSet
@@ -61,7 +63,19 @@
}
}
reportDuplicates(context, converters)
- ProcessResult(classes, converters.map(::CustomTypeConverterWrapper))
+ val builtInStates = it
+ .getAsAnnotationBox<BuiltInTypeConverters>("builtInTypeConverters")
+ .let {
+ BuiltInConverterFlags(
+ enums = it.value.enums,
+ uuid = it.value.uuid
+ )
+ }
+ ProcessResult(
+ classes = classes,
+ converters = converters.map(::CustomTypeConverterWrapper),
+ builtInConverterFlags = builtInStates
+ )
} ?: ProcessResult.EMPTY
}
@@ -69,13 +83,19 @@
converters
.groupBy { it.from.typeName to it.to.typeName }
.filterValues { it.size > 1 }
- .values.forEach {
- it.forEach { converter ->
- context.logger.e(
- converter.method,
- ProcessorErrors
- .duplicateTypeConverters(it.minus(converter))
- )
+ .values.forEach { possiblyDuplicateConverters ->
+ possiblyDuplicateConverters.forEach { converter ->
+ val duplicates = possiblyDuplicateConverters.filter { duplicate ->
+ duplicate !== converter &&
+ duplicate.from.isSameType(converter.from) &&
+ duplicate.to.isSameType(converter.to)
+ }
+ if (duplicates.isNotEmpty()) {
+ context.logger.e(
+ converter.method,
+ ProcessorErrors.duplicateTypeConverters(duplicates)
+ )
+ }
}
}
}
@@ -160,15 +180,26 @@
*/
open class ProcessResult(
val classes: LinkedHashSet<XType>,
- val converters: List<CustomTypeConverterWrapper>
+ val converters: List<CustomTypeConverterWrapper>,
+ val builtInConverterFlags: BuiltInConverterFlags
) {
- object EMPTY : ProcessResult(LinkedHashSet(), emptyList())
+ object EMPTY : ProcessResult(
+ classes = LinkedHashSet(),
+ converters = emptyList(),
+ builtInConverterFlags = BuiltInConverterFlags.DEFAULT
+ )
operator fun plus(other: ProcessResult): ProcessResult {
val newClasses = LinkedHashSet<XType>()
newClasses.addAll(classes)
newClasses.addAll(other.classes)
- return ProcessResult(newClasses, converters + other.converters)
+ return ProcessResult(
+ classes = newClasses,
+ converters = converters + other.converters,
+ builtInConverterFlags = other.builtInConverterFlags.withNext(
+ builtInConverterFlags
+ )
+ )
}
}
}
diff --git a/room/room-compiler/src/main/kotlin/androidx/room/processor/DaoProcessor.kt b/room/room-compiler/src/main/kotlin/androidx/room/processor/DaoProcessor.kt
index 6b6ca43..5c300d8 100644
--- a/room/room-compiler/src/main/kotlin/androidx/room/processor/DaoProcessor.kt
+++ b/room/room-compiler/src/main/kotlin/androidx/room/processor/DaoProcessor.kt
@@ -137,7 +137,8 @@
}.map {
TransactionMethodProcessor(
baseContext = context,
- containing = declaredType,
+ containingElement = element,
+ containingType = declaredType,
executableElement = it
).process()
}
diff --git a/room/room-compiler/src/main/kotlin/androidx/room/processor/TransactionMethodProcessor.kt b/room/room-compiler/src/main/kotlin/androidx/room/processor/TransactionMethodProcessor.kt
index 6d13d26..acf8ec6 100644
--- a/room/room-compiler/src/main/kotlin/androidx/room/processor/TransactionMethodProcessor.kt
+++ b/room/room-compiler/src/main/kotlin/androidx/room/processor/TransactionMethodProcessor.kt
@@ -22,19 +22,21 @@
import androidx.room.ext.RxJava3TypeNames
import androidx.room.compiler.processing.XMethodElement
import androidx.room.compiler.processing.XType
+import androidx.room.compiler.processing.XTypeElement
import androidx.room.ext.KotlinTypeNames
import androidx.room.vo.TransactionMethod
class TransactionMethodProcessor(
baseContext: Context,
- val containing: XType,
+ val containingElement: XTypeElement,
+ val containingType: XType,
val executableElement: XMethodElement
) {
val context = baseContext.fork(executableElement)
fun process(): TransactionMethod {
- val delegate = MethodProcessorDelegate.createFor(context, containing, executableElement)
+ val delegate = MethodProcessorDelegate.createFor(context, containingType, executableElement)
val hasKotlinDefaultImpl = executableElement.hasKotlinDefaultImpl()
context.checker.check(
executableElement.isOverrideableIgnoringContainer() &&
@@ -58,7 +60,13 @@
val callType = when {
executableElement.isJavaDefault() ->
- TransactionMethod.CallType.DEFAULT_JAVA8
+ if (containingElement.isInterface()) {
+ // if the dao is an interface, call via the Dao interface
+ TransactionMethod.CallType.DEFAULT_JAVA8
+ } else {
+ // if the dao is an abstract class, call via the class itself
+ TransactionMethod.CallType.INHERITED_DEFAULT_JAVA8
+ }
hasKotlinDefaultImpl ->
TransactionMethod.CallType.DEFAULT_KOTLIN
else ->
diff --git a/room/room-compiler/src/main/kotlin/androidx/room/processor/cache/Cache.kt b/room/room-compiler/src/main/kotlin/androidx/room/processor/cache/Cache.kt
index 268d0ce..469e6bf 100644
--- a/room/room-compiler/src/main/kotlin/androidx/room/processor/cache/Cache.kt
+++ b/room/room-compiler/src/main/kotlin/androidx/room/processor/cache/Cache.kt
@@ -21,6 +21,7 @@
import androidx.room.compiler.processing.XElement
import androidx.room.compiler.processing.XType
import androidx.room.processor.FieldProcessor
+import androidx.room.vo.BuiltInConverterFlags
import androidx.room.vo.EmbeddedField
import androidx.room.vo.Entity
import androidx.room.vo.Pojo
@@ -36,7 +37,8 @@
class Cache(
val parent: Cache?,
val converters: LinkedHashSet<XType>,
- val suppressedWarnings: Set<Warning>
+ val suppressedWarnings: Set<Warning>,
+ val builtInConverterFlags: BuiltInConverterFlags
) {
val entities: Bucket<EntityKey, Entity> = Bucket(parent?.entities)
val pojos: Bucket<PojoKey, Pojo> = Bucket(parent?.pojos)
@@ -44,7 +46,7 @@
inner class Bucket<K, T>(source: Bucket<K, T>?) {
private val entries: MutableMap<FullKey<K>, T> = source?.entries ?: mutableMapOf()
fun get(key: K, calculate: () -> T): T {
- val fullKey = FullKey(converters, suppressedWarnings, key)
+ val fullKey = FullKey(converters, suppressedWarnings, builtInConverterFlags, key)
return entries.getOrPut(
fullKey,
{
@@ -76,6 +78,7 @@
private data class FullKey<T>(
val converters: LinkedHashSet<XType>,
val suppressedWarnings: Set<Warning>,
+ val builtInConverterFlags: BuiltInConverterFlags,
val key: T
)
}
diff --git a/room/room-compiler/src/main/kotlin/androidx/room/solver/TypeAdapterStore.kt b/room/room-compiler/src/main/kotlin/androidx/room/solver/TypeAdapterStore.kt
index 0da457f..db3b91e 100644
--- a/room/room-compiler/src/main/kotlin/androidx/room/solver/TypeAdapterStore.kt
+++ b/room/room-compiler/src/main/kotlin/androidx/room/solver/TypeAdapterStore.kt
@@ -99,8 +99,10 @@
import androidx.room.solver.types.StringColumnTypeAdapter
import androidx.room.solver.types.TypeConverter
import androidx.room.solver.types.UuidColumnTypeAdapter
+import androidx.room.vo.BuiltInConverterFlags
import androidx.room.vo.MapInfo
import androidx.room.vo.ShortcutQueryParameter
+import androidx.room.vo.isEnabled
import com.google.common.annotations.VisibleForTesting
import com.google.common.collect.ImmutableList
import com.google.common.collect.ImmutableListMultimap
@@ -121,7 +123,9 @@
*/
private val columnTypeAdapters: List<ColumnTypeAdapter>,
- private val typeConverterStore: TypeConverterStore
+ private val typeConverterStore: TypeConverterStore,
+
+ private val builtInConverterFlags: BuiltInConverterFlags
) {
companion object {
@@ -129,14 +133,18 @@
return TypeAdapterStore(
context = context,
columnTypeAdapters = store.columnTypeAdapters,
- typeConverterStore = store.typeConverterStore
+ typeConverterStore = store.typeConverterStore,
+ builtInConverterFlags = store.builtInConverterFlags
)
}
- fun create(context: Context, vararg extras: Any): TypeAdapterStore {
+ fun create(
+ context: Context,
+ builtInConverterFlags: BuiltInConverterFlags,
+ vararg extras: Any
+ ): TypeAdapterStore {
val adapters = arrayListOf<ColumnTypeAdapter>()
val converters = arrayListOf<TypeConverter>()
-
fun addAny(extra: Any?) {
when (extra) {
is TypeConverter -> converters.add(extra)
@@ -169,7 +177,8 @@
.forEach(::addTypeConverter)
return TypeAdapterStore(
context = context, columnTypeAdapters = adapters,
- typeConverterStore = TypeConverterStore(converters)
+ typeConverterStore = TypeConverterStore(converters),
+ builtInConverterFlags = builtInConverterFlags
)
}
}
@@ -351,8 +360,10 @@
private fun createDefaultTypeAdapter(type: XType): ColumnTypeAdapter? {
val typeElement = type.typeElement
return when {
- typeElement?.isEnum() == true -> EnumColumnTypeAdapter(typeElement)
- type.isUUID() -> UuidColumnTypeAdapter(type)
+ builtInConverterFlags.enums.isEnabled() &&
+ typeElement?.isEnum() == true -> EnumColumnTypeAdapter(typeElement)
+ builtInConverterFlags.uuid.isEnabled() &&
+ type.isUUID() -> UuidColumnTypeAdapter(type)
else -> null
}
}
diff --git a/room/room-compiler/src/main/kotlin/androidx/room/solver/transaction/result/TransactionMethodAdapter.kt b/room/room-compiler/src/main/kotlin/androidx/room/solver/transaction/result/TransactionMethodAdapter.kt
index a393201..f5f5dbb 100644
--- a/room/room-compiler/src/main/kotlin/androidx/room/solver/transaction/result/TransactionMethodAdapter.kt
+++ b/room/room-compiler/src/main/kotlin/androidx/room/solver/transaction/result/TransactionMethodAdapter.kt
@@ -56,7 +56,8 @@
append("return ")
}
when (callType) {
- TransactionMethod.CallType.CONCRETE -> {
+ TransactionMethod.CallType.CONCRETE,
+ TransactionMethod.CallType.INHERITED_DEFAULT_JAVA8 -> {
append("$T.super.$N(")
params.add(daoImplName)
params.add(methodName)
diff --git a/room/room-compiler/src/main/kotlin/androidx/room/vo/BuiltInConverterFlags.kt b/room/room-compiler/src/main/kotlin/androidx/room/vo/BuiltInConverterFlags.kt
new file mode 100644
index 0000000..06d76b8
--- /dev/null
+++ b/room/room-compiler/src/main/kotlin/androidx/room/vo/BuiltInConverterFlags.kt
@@ -0,0 +1,52 @@
+/*
+ * Copyright 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package androidx.room.vo
+
+import androidx.room.BuiltInTypeConverters
+
+data class BuiltInConverterFlags(
+ val enums: BuiltInTypeConverters.State,
+ val uuid: BuiltInTypeConverters.State
+) {
+
+ /**
+ * Returns the combination of `this` flags with the [next] flags.
+ * Notice that order is important here as the [next] gets priority when it defines any flag.
+ */
+ fun withNext(next: BuiltInConverterFlags) = BuiltInConverterFlags(
+ enums = enums + next.enums,
+ uuid = uuid + next.uuid
+ )
+
+ companion object {
+ val DEFAULT = BuiltInConverterFlags(
+ enums = BuiltInTypeConverters.State.INHERITED,
+ uuid = BuiltInTypeConverters.State.INHERITED
+ )
+ }
+}
+
+fun BuiltInTypeConverters.State.isEnabled() = this != BuiltInTypeConverters.State.DISABLED
+
+private operator fun BuiltInTypeConverters.State.plus(
+ other: BuiltInTypeConverters.State
+): BuiltInTypeConverters.State {
+ return when (other) {
+ BuiltInTypeConverters.State.INHERITED -> this
+ else -> other
+ }
+}
\ No newline at end of file
diff --git a/room/room-compiler/src/main/kotlin/androidx/room/vo/TransactionMethod.kt b/room/room-compiler/src/main/kotlin/androidx/room/vo/TransactionMethod.kt
index e70470b..480a505 100644
--- a/room/room-compiler/src/main/kotlin/androidx/room/vo/TransactionMethod.kt
+++ b/room/room-compiler/src/main/kotlin/androidx/room/vo/TransactionMethod.kt
@@ -28,6 +28,25 @@
val methodBinder: TransactionMethodBinder
) {
enum class CallType {
- CONCRETE, DEFAULT_JAVA8, DEFAULT_KOTLIN
+ /**
+ * Directly call the method, it has an implementation
+ */
+ CONCRETE,
+
+ /**
+ * It has a default implementation and the default implementation is in the DAO
+ */
+ DEFAULT_JAVA8,
+
+ /**
+ * Has DefaultImpl generated by kotlin
+ */
+ DEFAULT_KOTLIN,
+
+ /**
+ * It has a default implementation which is not declared in the dao, rather, it inherits
+ * it from a super.
+ */
+ INHERITED_DEFAULT_JAVA8
}
}
diff --git a/room/room-compiler/src/test/kotlin/androidx/room/processor/CustomConverterProcessorTest.kt b/room/room-compiler/src/test/kotlin/androidx/room/processor/CustomConverterProcessorTest.kt
index e2dea31..7347cf1 100644
--- a/room/room-compiler/src/test/kotlin/androidx/room/processor/CustomConverterProcessorTest.kt
+++ b/room/room-compiler/src/test/kotlin/androidx/room/processor/CustomConverterProcessorTest.kt
@@ -279,6 +279,42 @@
}
@Test
+ fun checkDuplicates_nullability() {
+ val source = Source.kotlin(
+ "MyConverter.kt",
+ """
+ package ${CONVERTER.packageName()}
+ import androidx.room.*
+ class ${CONVERTER.simpleName()} {
+ @TypeConverter
+ fun nonNulls(input: Int): String {
+ TODO()
+ }
+ @TypeConverter
+ fun nullableInput(input: Int?): String {
+ TODO()
+ }
+ @TypeConverter
+ fun nullableOutput(input: Int): String? {
+ TODO()
+ }
+ }
+ """.trimIndent()
+ )
+ singleClass(
+ source
+ ) { _, invocation ->
+ invocation.assertCompilationResult {
+ if (invocation.isKsp) {
+ // no error
+ } else {
+ hasErrorContaining("Multiple methods define the same")
+ }
+ }
+ }
+ }
+
+ @Test
fun invalidConverterType() {
val source = Source.java(
"foo.bar.Container",
diff --git a/room/room-compiler/src/test/kotlin/androidx/room/processor/TransactionMethodProcessorTest.kt b/room/room-compiler/src/test/kotlin/androidx/room/processor/TransactionMethodProcessorTest.kt
index 1f74462..104394f 100644
--- a/room/room-compiler/src/test/kotlin/androidx/room/processor/TransactionMethodProcessorTest.kt
+++ b/room/room-compiler/src/test/kotlin/androidx/room/processor/TransactionMethodProcessorTest.kt
@@ -305,7 +305,8 @@
}.first { it.second.isNotEmpty() }
val processor = TransactionMethodProcessor(
baseContext = invocation.context,
- containing = owner.type,
+ containingElement = owner,
+ containingType = owner.type,
executableElement = methods.first()
)
val processed = processor.process()
diff --git a/room/room-compiler/src/test/kotlin/androidx/room/solver/BasicColumnTypeAdaptersTest.kt b/room/room-compiler/src/test/kotlin/androidx/room/solver/BasicColumnTypeAdaptersTest.kt
index 61c98a5..6c2c5fc 100644
--- a/room/room-compiler/src/test/kotlin/androidx/room/solver/BasicColumnTypeAdaptersTest.kt
+++ b/room/room-compiler/src/test/kotlin/androidx/room/solver/BasicColumnTypeAdaptersTest.kt
@@ -21,6 +21,7 @@
import androidx.room.compiler.processing.util.runProcessorTest
import androidx.room.compiler.processing.writeTo
import androidx.room.processor.Context
+import androidx.room.vo.BuiltInConverterFlags
import com.squareup.javapoet.ClassName
import com.squareup.javapoet.FieldSpec
import com.squareup.javapoet.JavaFile
@@ -102,7 +103,10 @@
runProcessorTest { invocation ->
val scope = testCodeGenScope()
val type = invocation.processingEnv.requireType(input)
- val adapter = TypeAdapterStore.create(Context(invocation.processingEnv))
+ val adapter = TypeAdapterStore.create(
+ Context(invocation.processingEnv),
+ BuiltInConverterFlags.DEFAULT
+ )
.findColumnTypeAdapter(
out = type,
affinity = null,
@@ -130,12 +134,14 @@
runProcessorTest { invocation ->
val scope = testCodeGenScope()
val boxedType = invocation.processingEnv.requireType(input).boxed()
- val adapter = TypeAdapterStore.create(Context(invocation.processingEnv))
- .findColumnTypeAdapter(
- out = boxedType,
- affinity = null,
- skipDefaultConverter = false
- )!!
+ val adapter = TypeAdapterStore.create(
+ Context(invocation.processingEnv),
+ BuiltInConverterFlags.DEFAULT
+ ).findColumnTypeAdapter(
+ out = boxedType,
+ affinity = null,
+ skipDefaultConverter = false
+ )!!
adapter.bindToStmt("st", "6", "inp", scope)
val expected = if (invocation.isKsp && !input.isAlwaysCheckedForNull()) {
bindCode
@@ -163,7 +169,10 @@
runProcessorTest { invocation ->
val scope = testCodeGenScope()
val nullableType = invocation.processingEnv.requireType(input).makeNullable()
- val adapter = TypeAdapterStore.create(Context(invocation.processingEnv))
+ val adapter = TypeAdapterStore.create(
+ Context(invocation.processingEnv),
+ BuiltInConverterFlags.DEFAULT
+ )
.findColumnTypeAdapter(
out = nullableType,
affinity = null,
@@ -212,12 +221,14 @@
runProcessorTest { invocation ->
val scope = testCodeGenScope()
val type = invocation.processingEnv.requireType(input)
- val adapter = TypeAdapterStore.create(Context(invocation.processingEnv))
- .findColumnTypeAdapter(
- out = type,
- affinity = null,
- skipDefaultConverter = false
- )!!
+ val adapter = TypeAdapterStore.create(
+ Context(invocation.processingEnv),
+ BuiltInConverterFlags.DEFAULT
+ ).findColumnTypeAdapter(
+ out = type,
+ affinity = null,
+ skipDefaultConverter = false
+ )!!
val expected = if (input.isAlwaysCheckedForNull()) {
"""
if (crs.isNull(9)) {
@@ -240,12 +251,14 @@
runProcessorTest { invocation ->
val scope = testCodeGenScope()
val boxedType = invocation.processingEnv.requireType(input).boxed()
- val adapter = TypeAdapterStore.create(Context(invocation.processingEnv))
- .findColumnTypeAdapter(
- out = boxedType,
- affinity = null,
- skipDefaultConverter = false
- )!!
+ val adapter = TypeAdapterStore.create(
+ Context(invocation.processingEnv),
+ BuiltInConverterFlags.DEFAULT
+ ).findColumnTypeAdapter(
+ out = boxedType,
+ affinity = null,
+ skipDefaultConverter = false
+ )!!
adapter.readFromCursor("out", "crs", "9", scope)
val expected = if (invocation.isKsp && !input.isAlwaysCheckedForNull()) {
cursorCode
@@ -273,8 +286,10 @@
runProcessorTest { invocation ->
val scope = testCodeGenScope()
val nullableType = invocation.processingEnv.requireType(input).makeNullable()
- val adapter = TypeAdapterStore.create(Context(invocation.processingEnv))
- .findColumnTypeAdapter(nullableType, null, false)!!
+ val adapter = TypeAdapterStore.create(
+ Context(invocation.processingEnv),
+ BuiltInConverterFlags.DEFAULT
+ ).findColumnTypeAdapter(nullableType, null, false)!!
adapter.readFromCursor("out", "crs", "9", scope)
assertThat(
scope.generate().toString().trim(),
diff --git a/room/room-compiler/src/test/kotlin/androidx/room/solver/BuiltInConverterFlagsTest.kt b/room/room-compiler/src/test/kotlin/androidx/room/solver/BuiltInConverterFlagsTest.kt
new file mode 100644
index 0000000..6592175
--- /dev/null
+++ b/room/room-compiler/src/test/kotlin/androidx/room/solver/BuiltInConverterFlagsTest.kt
@@ -0,0 +1,234 @@
+/*
+ * Copyright 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package androidx.room.solver
+
+import androidx.room.BuiltInTypeConverters
+import androidx.room.BuiltInTypeConverters.State.DISABLED
+import androidx.room.BuiltInTypeConverters.State.ENABLED
+import androidx.room.Database
+import androidx.room.DatabaseProcessingStep
+import androidx.room.compiler.processing.util.Source
+import androidx.room.compiler.processing.util.XTestInvocation
+import androidx.room.compiler.processing.util.runProcessorTest
+import androidx.room.processor.ProcessorErrors.CANNOT_FIND_COLUMN_TYPE_ADAPTER
+import androidx.room.processor.ProcessorErrors.CANNOT_FIND_CURSOR_READER
+import org.junit.Test
+import org.junit.runner.RunWith
+import org.junit.runners.JUnit4
+
+@RunWith(JUnit4::class)
+class BuiltInConverterFlagsTest {
+
+ @Test
+ fun enums_disabledInDb() {
+ compile(
+ dbAnnotation = createTypeConvertersCode(
+ enums = DISABLED
+ )
+ ) {
+ hasError(CANNOT_FIND_COLUMN_TYPE_ADAPTER, "val myEnum: MyEnum")
+ hasError(CANNOT_FIND_CURSOR_READER, "val myEnum: MyEnum")
+ hasErrorCount(2)
+ }
+ }
+
+ @Test
+ fun uuid_disabledInDb() {
+ compile(
+ dbAnnotation = createTypeConvertersCode(
+ uuid = DISABLED
+ )
+ ) {
+ hasError(CANNOT_FIND_COLUMN_TYPE_ADAPTER, "val uuid: UUID")
+ hasError(CANNOT_FIND_CURSOR_READER, "val uuid: UUID")
+ hasErrorCount(2)
+ }
+ }
+
+ @Test
+ fun all_disabledInDb_enabledInDao_enabledInEntity() {
+ compile(
+ dbAnnotation = createTypeConvertersCode(
+ enums = DISABLED,
+ uuid = DISABLED
+ ),
+ daoAnnotation = createTypeConvertersCode(
+ enums = ENABLED,
+ uuid = ENABLED
+ ),
+ entityAnnotation = createTypeConvertersCode(
+ enums = ENABLED,
+ uuid = ENABLED
+ )
+ ) {
+ // success
+ }
+ }
+
+ @Test
+ fun all_disabledInEntity() {
+ compile(
+ entityAnnotation = createTypeConvertersCode(
+ enums = DISABLED,
+ uuid = DISABLED
+ )
+ ) {
+ hasError(CANNOT_FIND_COLUMN_TYPE_ADAPTER, "val uuid: UUID")
+ hasError(CANNOT_FIND_COLUMN_TYPE_ADAPTER, "val myEnum: MyEnum")
+ // even though it is enabled in dao or db, since pojo processing will visit the pojo,
+ // we'll still get erros for these because entity disabled them
+ hasError(CANNOT_FIND_CURSOR_READER, "val uuid: UUID")
+ hasError(CANNOT_FIND_CURSOR_READER, "val myEnum: MyEnum")
+ hasErrorCount(4)
+ }
+ }
+
+ @Test
+ fun all_disabledInDb_disabledInDao_enabledInEntity() {
+ compile(
+ dbAnnotation = createTypeConvertersCode(
+ enums = DISABLED,
+ uuid = DISABLED
+ ),
+ daoAnnotation = createTypeConvertersCode(
+ enums = DISABLED,
+ uuid = DISABLED
+ ),
+ entityAnnotation = createTypeConvertersCode(
+ enums = ENABLED,
+ uuid = ENABLED
+ )
+ ) {
+ // success since we only fetch full objects.
+ }
+ }
+
+ @Test
+ fun all_undefined() {
+ compile {
+ // success
+ }
+ }
+
+ /**
+ * KAPT does not have proper error lines so we only test message contents there
+ */
+ private fun XTestInvocation.hasError(
+ msg: String,
+ lineContent: String
+ ) {
+ assertCompilationResult {
+ if (isKsp) {
+ hasErrorContaining(msg).onLineContaining(lineContent)
+ } else {
+ hasErrorContaining(msg)
+ }
+ }
+ }
+
+ private fun XTestInvocation.hasErrorCount(
+ expected: Int
+ ) = assertCompilationResult {
+ hasErrorCount(expected)
+ }
+
+ fun compile(
+ entityAnnotation: String = "",
+ daoAnnotation: String = "",
+ dbAnnotation: String = "",
+ assertion: XTestInvocation.() -> Unit
+ ) {
+ val source = buildSource(
+ entityAnnotation = entityAnnotation,
+ daoAnnotation = daoAnnotation,
+ dbAnnotation = dbAnnotation
+ )
+ runProcessorTest(
+ sources = listOf(source)
+ ) { invocation ->
+ val subject = invocation.processingEnv.requireTypeElement("MyDatabase")
+ DatabaseProcessingStep().process(
+ env = invocation.processingEnv,
+ elementsByAnnotation = mapOf(
+ Database::class.qualifiedName!! to setOf(subject)
+ )
+ )
+ invocation.assertCompilationResult {
+ generatedSourceFileWithPath("MyDatabase_Impl.java")
+ generatedSourceFileWithPath("MyDao_Impl.java")
+ }
+ assertion.invoke(invocation)
+ }
+ }
+
+ private fun buildSource(
+ entityAnnotation: String = "",
+ daoAnnotation: String = "",
+ dbAnnotation: String = "",
+ ): Source {
+ return Source.kotlin(
+ "Foo.kt",
+ """
+ import androidx.room.*
+ import java.util.UUID
+ enum class MyEnum {
+ VAL_1,
+ VAL_2
+ }
+
+ $entityAnnotation
+ @Entity
+ data class MyEntity(
+ @PrimaryKey
+ val id:Int,
+ val uuid: UUID,
+ val myEnum: MyEnum
+ )
+
+ $daoAnnotation
+ @Dao
+ interface MyDao {
+ @Query("SELECT * FROM MyEntity")
+ fun entities(): List<MyEntity>
+ }
+
+ $dbAnnotation
+ @Database(version = 1, entities = [MyEntity::class], exportSchema = false)
+ abstract class MyDatabase : RoomDatabase() {
+ abstract val myDao: MyDao
+ }
+ """.trimIndent()
+ )
+ }
+
+ private fun createTypeConvertersCode(
+ enums: BuiltInTypeConverters.State? = null,
+ uuid: BuiltInTypeConverters.State? = null
+ ): String {
+ val builtIns = listOfNotNull(
+ enums?.let { "enums = BuiltInTypeConverters.State.${enums.name}" },
+ uuid?.let { "uuid = BuiltInTypeConverters.State.${uuid.name}" },
+ ).joinToString(",")
+ return if (builtIns.isBlank()) {
+ ""
+ } else {
+ "@TypeConverters(" +
+ "builtInTypeConverters = BuiltInTypeConverters($builtIns)" +
+ ")"
+ }
+ }
+}
\ No newline at end of file
diff --git a/room/room-compiler/src/test/kotlin/androidx/room/solver/TypeAdapterStoreTest.kt b/room/room-compiler/src/test/kotlin/androidx/room/solver/TypeAdapterStoreTest.kt
index 2875115..8919793 100644
--- a/room/room-compiler/src/test/kotlin/androidx/room/solver/TypeAdapterStoreTest.kt
+++ b/room/room-compiler/src/test/kotlin/androidx/room/solver/TypeAdapterStoreTest.kt
@@ -63,6 +63,7 @@
import androidx.room.solver.types.TypeConverter
import androidx.room.solver.types.UuidColumnTypeAdapter
import androidx.room.testing.context
+import androidx.room.vo.BuiltInConverterFlags
import androidx.room.vo.ReadQueryMethod
import com.google.common.truth.Truth.assertThat
import com.squareup.javapoet.CodeBlock
@@ -143,7 +144,10 @@
@Test
fun testDirect() {
runProcessorTest { invocation ->
- val store = TypeAdapterStore.create(Context(invocation.processingEnv))
+ val store = TypeAdapterStore.create(
+ Context(invocation.processingEnv),
+ BuiltInConverterFlags.DEFAULT
+ )
val primitiveType = invocation.processingEnv.requireType(TypeName.INT)
val adapter = store.findColumnTypeAdapter(
primitiveType,
@@ -158,7 +162,8 @@
fun testJavaLangBoolean() {
runProcessorTest { invocation ->
val store = TypeAdapterStore.create(
- Context(invocation.processingEnv)
+ Context(invocation.processingEnv),
+ BuiltInConverterFlags.DEFAULT
)
val boolean = invocation
.processingEnv
@@ -198,7 +203,10 @@
runProcessorTest(
sources = listOf(enumSrc)
) { invocation ->
- val store = TypeAdapterStore.create(Context(invocation.processingEnv))
+ val store = TypeAdapterStore.create(
+ Context(invocation.processingEnv),
+ BuiltInConverterFlags.DEFAULT
+ )
val enum = invocation
.processingEnv
.requireType("foo.bar.Fruit")
@@ -211,7 +219,10 @@
@Test
fun testJavaUtilUUIDCompilesWithoutError() {
runProcessorTest { invocation ->
- val store = TypeAdapterStore.create(Context(invocation.processingEnv))
+ val store = TypeAdapterStore.create(
+ Context(invocation.processingEnv),
+ BuiltInConverterFlags.DEFAULT
+ )
val uuid = invocation
.processingEnv
.requireType(UUID::class.typeName)
@@ -229,7 +240,10 @@
@Test
fun testVia1TypeAdapter() {
runProcessorTest { invocation ->
- val store = TypeAdapterStore.create(Context(invocation.processingEnv))
+ val store = TypeAdapterStore.create(
+ Context(invocation.processingEnv),
+ BuiltInConverterFlags.DEFAULT
+ )
val booleanType = invocation.processingEnv.requireType(TypeName.BOOLEAN)
val adapter = store.findColumnTypeAdapter(
booleanType,
@@ -301,6 +315,7 @@
).process().map(::CustomTypeConverterWrapper)
val store = TypeAdapterStore.create(
context,
+ BuiltInConverterFlags.DEFAULT,
converters
)
val pointType = invocation.processingEnv.requireType("foo.bar.Point")
@@ -346,6 +361,7 @@
runProcessorTest { invocation ->
val store = TypeAdapterStore.create(
invocation.context,
+ BuiltInConverterFlags.DEFAULT,
dateTypeConverters(invocation.processingEnv)
)
val tDate = invocation.processingEnv.requireType("java.util.Date").makeNullable()
@@ -376,7 +392,9 @@
runProcessorTest { invocation ->
val binders = createIntListToStringBinders(invocation)
val store = TypeAdapterStore.create(
- Context(invocation.processingEnv), binders[0],
+ Context(invocation.processingEnv),
+ BuiltInConverterFlags.DEFAULT,
+ binders[0],
binders[1]
)
@@ -416,7 +434,11 @@
fun testOneWayConversion() {
runProcessorTest { invocation ->
val binders = createIntListToStringBinders(invocation)
- val store = TypeAdapterStore.create(Context(invocation.processingEnv), binders[0])
+ val store = TypeAdapterStore.create(
+ Context(invocation.processingEnv),
+ BuiltInConverterFlags.DEFAULT,
+ binders[0]
+ )
val adapter = store.findColumnTypeAdapter(
binders[0].from,
null,
@@ -934,7 +956,8 @@
fun findQueryParameterAdapter_collections() {
runProcessorTest { invocation ->
val store = TypeAdapterStore.create(
- context = invocation.context
+ context = invocation.context,
+ builtInConverterFlags = BuiltInConverterFlags.DEFAULT
)
val javacCollectionTypes = listOf(
"java.util.Set",
@@ -1007,6 +1030,7 @@
).process().map(::CustomTypeConverterWrapper)
val typeAdapterStore = TypeAdapterStore.create(
context = invocation.context,
+ builtInConverterFlags = BuiltInConverterFlags.DEFAULT,
extras = converters.toTypedArray()
)
val subject = invocation.processingEnv.requireTypeElement("Subject")
diff --git a/room/room-compiler/src/test/kotlin/androidx/room/solver/TypeConverterStoreTest.kt b/room/room-compiler/src/test/kotlin/androidx/room/solver/TypeConverterStoreTest.kt
index c56b944..001b1b2 100644
--- a/room/room-compiler/src/test/kotlin/androidx/room/solver/TypeConverterStoreTest.kt
+++ b/room/room-compiler/src/test/kotlin/androidx/room/solver/TypeConverterStoreTest.kt
@@ -23,6 +23,7 @@
import androidx.room.solver.types.CustomTypeConverterWrapper
import androidx.room.solver.types.TypeConverter
import androidx.room.testing.context
+import androidx.room.vo.BuiltInConverterFlags
import com.google.common.truth.Truth.assertThat
import org.junit.Test
import org.junit.runner.RunWith
@@ -67,6 +68,7 @@
.process()
val store = TypeAdapterStore.create(
invocation.context,
+ BuiltInConverterFlags.DEFAULT,
converters.map(::CustomTypeConverterWrapper)
)
diff --git a/room/room-compiler/src/test/kotlin/androidx/room/writer/DefaultsInDaoTest.kt b/room/room-compiler/src/test/kotlin/androidx/room/writer/DefaultsInDaoTest.kt
new file mode 100644
index 0000000..938ef61
--- /dev/null
+++ b/room/room-compiler/src/test/kotlin/androidx/room/writer/DefaultsInDaoTest.kt
@@ -0,0 +1,138 @@
+/*
+ * Copyright 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package androidx.room.writer
+
+import androidx.room.compiler.processing.XTypeElement
+import androidx.room.compiler.processing.util.Source
+import androidx.room.compiler.processing.util.runKaptTest
+import androidx.room.ext.RoomTypeNames
+import androidx.room.processor.DaoProcessor
+import androidx.room.testing.context
+import com.google.common.truth.StringSubject
+import createVerifierFromEntitiesAndViews
+import org.jetbrains.kotlin.config.JvmDefaultMode
+import org.junit.Test
+import org.junit.runner.RunWith
+import org.junit.runners.JUnit4
+
+/**
+ * Tests that we generate the right calls for default method implementations.
+ *
+ * The assertions in these tests are more for visual inspection. The real test is that this code
+ * compiles properly because when we generate the wrong code, it won't compile :).
+ *
+ * For Java default method tests, we have DefaultDaoMethodsTest in TestApp.
+ */
+@RunWith(JUnit4::class)
+class DefaultsInDaoTest {
+ @Test
+ fun abstractDao() {
+ val source = Source.kotlin(
+ "Foo.kt",
+ """
+ import androidx.room.*
+ class User
+ interface BaseDao<T> {
+ @Transaction
+ fun upsert(obj: T) {
+ TODO("")
+ }
+ }
+
+ @Dao
+ abstract class SubjectDao : BaseDao<User>
+ """.trimIndent()
+ )
+ compileInEachDefaultsMode(source) { _, generated ->
+ generated.contains("public void upsert(final User obj)")
+ generated.contains("SubjectDao_Impl.super.upsert(")
+ generated.doesNotContain("SubjectDao.super.upsert")
+ generated.doesNotContain("this.upsert")
+ }
+ }
+
+ @Test
+ fun interfaceDao() {
+ val source = Source.kotlin(
+ "Foo.kt",
+ """
+ import androidx.room.*
+ class User
+ interface BaseDao<T> {
+ @Transaction
+ fun upsert(obj: T) {
+ TODO("")
+ }
+ }
+
+ @Dao
+ interface SubjectDao : BaseDao<User>
+ """.trimIndent()
+ )
+ compileInEachDefaultsMode(source) { mode, generated ->
+ generated.contains("public void upsert(final User obj)")
+ if (mode == JvmDefaultMode.ALL_INCOMPATIBLE) {
+ generated.contains("SubjectDao.super.upsert(")
+ } else {
+ generated.contains("SubjectDao.DefaultImpls.upsert(SubjectDao_Impl.this")
+ }
+
+ generated.doesNotContain("SubjectDao_Impl.super.upsert")
+ generated.doesNotContain("this.upsert")
+ }
+ }
+
+ private fun compileInEachDefaultsMode(
+ source: Source,
+ handler: (JvmDefaultMode, StringSubject) -> Unit
+ ) {
+ listOf(
+ JvmDefaultMode.ENABLE,
+ JvmDefaultMode.ENABLE_WITH_DEFAULT_IMPLS,
+ JvmDefaultMode.ALL_INCOMPATIBLE
+ ).forEach { jvmDefaultMode ->
+ // TODO should run these with KSP as well. https://github.com/google/ksp/issues/627
+ runKaptTest(
+ sources = listOf(source),
+ kotlincArguments = listOf("-Xjvm-default=${jvmDefaultMode.description}")
+ ) { invocation ->
+ invocation.roundEnv
+ .getElementsAnnotatedWith(
+ androidx.room.Dao::class.qualifiedName!!
+ ).filterIsInstance<XTypeElement>()
+ .forEach { dao ->
+ val db = invocation.context.processingEnv
+ .requireTypeElement(RoomTypeNames.ROOM_DB)
+ val dbType = db.type
+ val parser = DaoProcessor(
+ baseContext = invocation.context,
+ element = dao,
+ dbType = dbType,
+ dbVerifier = createVerifierFromEntitiesAndViews(invocation)
+ )
+ val parsedDao = parser.process()
+ DaoWriter(parsedDao, db, invocation.processingEnv)
+ .write(invocation.processingEnv)
+ invocation.assertCompilationResult {
+ val relativePath = parsedDao.implTypeName.simpleName() + ".java"
+ handler(jvmDefaultMode, generatedSourceFileWithPath(relativePath))
+ }
+ }
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/room/room-runtime/lint-baseline.xml b/room/room-runtime/lint-baseline.xml
index 38b7a51..652ae67 100644
--- a/room/room-runtime/lint-baseline.xml
+++ b/room/room-runtime/lint-baseline.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<issues format="6" by="lint 7.1.0-alpha06" type="baseline" client="gradle" dependencies="false" name="AGP (7.1.0-alpha06)" variant="all" version="7.1.0-alpha06">
+<issues format="6" by="lint 7.2.0-dev" type="baseline" client="gradle" dependencies="false" name="AGP (7.2.0-dev)" variant="all" version="7.2.0-dev">
<issue
id="NewApi"
@@ -14,6 +14,17 @@
<issue
id="NewApi"
+ message="Field requires API level 24 (current min is 14): `getWritableDatabase`"
+ errorLine1=" autoClosingRoomOpenHelper.writableDatabase"
+ errorLine2=" ~~~~~~~~~~~~~~~~">
+ <location
+ file="src/androidTest/java/androidx/room/AutoClosingRoomOpenHelperFactoryTest.kt"
+ line="85"
+ column="35"/>
+ </issue>
+
+ <issue
+ id="NewApi"
message="Call requires API level 24 (current min is 14): `getWritableDatabase`"
errorLine1=" autoClosingRoomOpenHelper.writableDatabase"
errorLine2=" ~~~~~~~~~~~~~~~~">
@@ -25,6 +36,17 @@
<issue
id="NewApi"
+ message="Field requires API level 24 (current min is 14): `getWritableDatabase`"
+ errorLine1=" autoClosingRoomOpenHelper.writableDatabase"
+ errorLine2=" ~~~~~~~~~~~~~~~~">
+ <location
+ file="src/androidTest/java/androidx/room/AutoClosingRoomOpenHelperFactoryTest.kt"
+ line="98"
+ column="35"/>
+ </issue>
+
+ <issue
+ id="NewApi"
message="Call requires API level 24 (current min is 14): `getWritableDatabase`"
errorLine1=" val db = autoClosingRoomOpenHelper.writableDatabase"
errorLine2=" ~~~~~~~~~~~~~~~~">
@@ -36,6 +58,17 @@
<issue
id="NewApi"
+ message="Field requires API level 24 (current min is 14): `getWritableDatabase`"
+ errorLine1=" val db = autoClosingRoomOpenHelper.writableDatabase"
+ errorLine2=" ~~~~~~~~~~~~~~~~">
+ <location
+ file="src/androidTest/java/androidx/room/AutoClosingRoomOpenHelperFactoryTest.kt"
+ line="144"
+ column="44"/>
+ </issue>
+
+ <issue
+ id="NewApi"
message="Call requires API level 24 (current min is 14): `getWritableDatabase`"
errorLine1=" .writableDatabase.query("select * from nonexistanttable")"
errorLine2=" ~~~~~~~~~~~~~~~~">
@@ -47,6 +80,17 @@
<issue
id="NewApi"
+ message="Field requires API level 24 (current min is 14): `getWritableDatabase`"
+ errorLine1=" .writableDatabase.query("select * from nonexistanttable")"
+ errorLine2=" ~~~~~~~~~~~~~~~~">
+ <location
+ file="src/androidTest/java/androidx/room/AutoClosingRoomOpenHelperTest.kt"
+ line="88"
+ column="18"/>
+ </issue>
+
+ <issue
+ id="NewApi"
message="Call requires API level 24 (current min is 14): `getWritableDatabase`"
errorLine1=" autoClosingRoomOpenHelper.writableDatabase.execSQL("create table user (idk int)")"
errorLine2=" ~~~~~~~~~~~~~~~~">
@@ -58,6 +102,17 @@
<issue
id="NewApi"
+ message="Field requires API level 24 (current min is 14): `getWritableDatabase`"
+ errorLine1=" autoClosingRoomOpenHelper.writableDatabase.execSQL("create table user (idk int)")"
+ errorLine2=" ~~~~~~~~~~~~~~~~">
+ <location
+ file="src/androidTest/java/androidx/room/AutoClosingRoomOpenHelperTest.kt"
+ line="97"
+ column="35"/>
+ </issue>
+
+ <issue
+ id="NewApi"
message="Call requires API level 24 (current min is 14): `getWritableDatabase`"
errorLine1=" autoClosingRoomOpenHelper.writableDatabase.query("select * from user")"
errorLine2=" ~~~~~~~~~~~~~~~~">
@@ -69,6 +124,17 @@
<issue
id="NewApi"
+ message="Field requires API level 24 (current min is 14): `getWritableDatabase`"
+ errorLine1=" autoClosingRoomOpenHelper.writableDatabase.query("select * from user")"
+ errorLine2=" ~~~~~~~~~~~~~~~~">
+ <location
+ file="src/androidTest/java/androidx/room/AutoClosingRoomOpenHelperTest.kt"
+ line="100"
+ column="39"/>
+ </issue>
+
+ <issue
+ id="NewApi"
message="Call requires API level 24 (current min is 14): `getWritableDatabase`"
errorLine1=" autoClosingRoomOpenHelper.writableDatabase.beginTransaction()"
errorLine2=" ~~~~~~~~~~~~~~~~">
@@ -80,6 +146,17 @@
<issue
id="NewApi"
+ message="Field requires API level 24 (current min is 14): `getWritableDatabase`"
+ errorLine1=" autoClosingRoomOpenHelper.writableDatabase.beginTransaction()"
+ errorLine2=" ~~~~~~~~~~~~~~~~">
+ <location
+ file="src/androidTest/java/androidx/room/AutoClosingRoomOpenHelperTest.kt"
+ line="109"
+ column="35"/>
+ </issue>
+
+ <issue
+ id="NewApi"
message="Call requires API level 24 (current min is 14): `getWritableDatabase`"
errorLine1=" autoClosingRoomOpenHelper.writableDatabase.endTransaction()"
errorLine2=" ~~~~~~~~~~~~~~~~">
@@ -91,6 +168,17 @@
<issue
id="NewApi"
+ message="Field requires API level 24 (current min is 14): `getWritableDatabase`"
+ errorLine1=" autoClosingRoomOpenHelper.writableDatabase.endTransaction()"
+ errorLine2=" ~~~~~~~~~~~~~~~~">
+ <location
+ file="src/androidTest/java/androidx/room/AutoClosingRoomOpenHelperTest.kt"
+ line="111"
+ column="35"/>
+ </issue>
+
+ <issue
+ id="NewApi"
message="Call requires API level 24 (current min is 16): `getWritableDatabase`"
errorLine1=" assertThat(autoClosingRoomOpenHelper.writableDatabase.isWriteAheadLoggingEnabled).isTrue()"
errorLine2=" ~~~~~~~~~~~~~~~~">
@@ -102,6 +190,17 @@
<issue
id="NewApi"
+ message="Field requires API level 24 (current min is 16): `getWritableDatabase`"
+ errorLine1=" assertThat(autoClosingRoomOpenHelper.writableDatabase.isWriteAheadLoggingEnabled).isTrue()"
+ errorLine2=" ~~~~~~~~~~~~~~~~">
+ <location
+ file="src/androidTest/java/androidx/room/AutoClosingRoomOpenHelperTest.kt"
+ line="121"
+ column="46"/>
+ </issue>
+
+ <issue
+ id="NewApi"
message="Call requires API level 24 (current min is 16): `getWritableDatabase`"
errorLine1=" assertThat(autoClosingRoomOpenHelper.writableDatabase.isWriteAheadLoggingEnabled).isTrue()"
errorLine2=" ~~~~~~~~~~~~~~~~">
@@ -113,6 +212,17 @@
<issue
id="NewApi"
+ message="Field requires API level 24 (current min is 16): `getWritableDatabase`"
+ errorLine1=" assertThat(autoClosingRoomOpenHelper.writableDatabase.isWriteAheadLoggingEnabled).isTrue()"
+ errorLine2=" ~~~~~~~~~~~~~~~~">
+ <location
+ file="src/androidTest/java/androidx/room/AutoClosingRoomOpenHelperTest.kt"
+ line="125"
+ column="46"/>
+ </issue>
+
+ <issue
+ id="NewApi"
message="Call requires API level 24 (current min is 14): `getWritableDatabase`"
errorLine1=" autoClosingRoomOpenHelper.writableDatabase.enableWriteAheadLogging()"
errorLine2=" ~~~~~~~~~~~~~~~~">
@@ -124,6 +234,17 @@
<issue
id="NewApi"
+ message="Field requires API level 24 (current min is 14): `getWritableDatabase`"
+ errorLine1=" autoClosingRoomOpenHelper.writableDatabase.enableWriteAheadLogging()"
+ errorLine2=" ~~~~~~~~~~~~~~~~">
+ <location
+ file="src/androidTest/java/androidx/room/AutoClosingRoomOpenHelperTest.kt"
+ line="133"
+ column="39"/>
+ </issue>
+
+ <issue
+ id="NewApi"
message="Call requires API level 16 (current min is 14): `disableWriteAheadLogging`"
errorLine1=" autoClosingRoomOpenHelper.writableDatabase.disableWriteAheadLogging()"
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~">
@@ -146,6 +267,17 @@
<issue
id="NewApi"
+ message="Field requires API level 24 (current min is 14): `getWritableDatabase`"
+ errorLine1=" autoClosingRoomOpenHelper.writableDatabase.disableWriteAheadLogging()"
+ errorLine2=" ~~~~~~~~~~~~~~~~">
+ <location
+ file="src/androidTest/java/androidx/room/AutoClosingRoomOpenHelperTest.kt"
+ line="137"
+ column="39"/>
+ </issue>
+
+ <issue
+ id="NewApi"
message="Call requires API level 24 (current min is 14): `getWritableDatabase`"
errorLine1=" autoClosingRoomOpenHelper.writableDatabase"
errorLine2=" ~~~~~~~~~~~~~~~~">
@@ -157,6 +289,17 @@
<issue
id="NewApi"
+ message="Field requires API level 24 (current min is 14): `getWritableDatabase`"
+ errorLine1=" autoClosingRoomOpenHelper.writableDatabase"
+ errorLine2=" ~~~~~~~~~~~~~~~~">
+ <location
+ file="src/androidTest/java/androidx/room/AutoClosingRoomOpenHelperTest.kt"
+ line="161"
+ column="35"/>
+ </issue>
+
+ <issue
+ id="NewApi"
message="Call requires API level 24 (current min is 14): `getWritableDatabase`"
errorLine1=" autoClosingRoomOpenHelper.writableDatabase"
errorLine2=" ~~~~~~~~~~~~~~~~">
@@ -168,6 +311,17 @@
<issue
id="NewApi"
+ message="Field requires API level 24 (current min is 14): `getWritableDatabase`"
+ errorLine1=" autoClosingRoomOpenHelper.writableDatabase"
+ errorLine2=" ~~~~~~~~~~~~~~~~">
+ <location
+ file="src/androidTest/java/androidx/room/AutoClosingRoomOpenHelperTest.kt"
+ line="166"
+ column="35"/>
+ </issue>
+
+ <issue
+ id="NewApi"
message="Call requires API level 24 (current min is 14): `getWritableDatabase`"
errorLine1=" val db = autoClosingRoomOpenHelper.writableDatabase"
errorLine2=" ~~~~~~~~~~~~~~~~">
@@ -179,6 +333,17 @@
<issue
id="NewApi"
+ message="Field requires API level 24 (current min is 14): `getWritableDatabase`"
+ errorLine1=" val db = autoClosingRoomOpenHelper.writableDatabase"
+ errorLine2=" ~~~~~~~~~~~~~~~~">
+ <location
+ file="src/androidTest/java/androidx/room/AutoClosingRoomOpenHelperTest.kt"
+ line="175"
+ column="44"/>
+ </issue>
+
+ <issue
+ id="NewApi"
message="Call requires API level 24 (current min is 14): `getWritableDatabase`"
errorLine1=" val db = autoClosingRoomOpenHelper.writableDatabase"
errorLine2=" ~~~~~~~~~~~~~~~~">
@@ -190,6 +355,17 @@
<issue
id="NewApi"
+ message="Field requires API level 24 (current min is 14): `getWritableDatabase`"
+ errorLine1=" val db = autoClosingRoomOpenHelper.writableDatabase"
+ errorLine2=" ~~~~~~~~~~~~~~~~">
+ <location
+ file="src/androidTest/java/androidx/room/AutoClosingRoomOpenHelperTest.kt"
+ line="189"
+ column="44"/>
+ </issue>
+
+ <issue
+ id="NewApi"
message="Call requires API level 24 (current min is 14): `getWritableDatabase`"
errorLine1=" val db = autoClosingRoomOpenHelper.writableDatabase"
errorLine2=" ~~~~~~~~~~~~~~~~">
@@ -201,7 +377,18 @@
<issue
id="NewApi"
- message="Call requires API level 16 (current min is 14): `WRITE_AHEAD_LOGGING`"
+ message="Field requires API level 24 (current min is 14): `getWritableDatabase`"
+ errorLine1=" val db = autoClosingRoomOpenHelper.writableDatabase"
+ errorLine2=" ~~~~~~~~~~~~~~~~">
+ <location
+ file="src/androidTest/java/androidx/room/AutoClosingRoomOpenHelperTest.kt"
+ line="209"
+ column="44"/>
+ </issue>
+
+ <issue
+ id="NewApi"
+ message="Field requires API level 16 (current min is 14): `WRITE_AHEAD_LOGGING`"
errorLine1=" .setJournalMode(RoomDatabase.JournalMode.WRITE_AHEAD_LOGGING).build();"
errorLine2=" ~~~~~~~~~~~~~~~~~~~">
<location
@@ -212,7 +399,7 @@
<issue
id="NewApi"
- message="Call requires API level 16 (current min is 14): `WRITE_AHEAD_LOGGING`"
+ message="Field requires API level 16 (current min is 14): `WRITE_AHEAD_LOGGING`"
errorLine1=" assertThat(config.journalMode, is(RoomDatabase.JournalMode.WRITE_AHEAD_LOGGING));"
errorLine2=" ~~~~~~~~~~~~~~~~~~~">
<location
diff --git a/settings.gradle b/settings.gradle
index ce4e620..161833b 100644
--- a/settings.gradle
+++ b/settings.gradle
@@ -5,6 +5,13 @@
maven {
url = new File(buildscript.sourceFile.parent + "/../../prebuilts/androidx/external").getCanonicalFile()
}
+ if (System.getenv("ALLOW_PUBLIC_REPOS") != null || System.getProperty("ALLOW_PUBLIC_REPOS") != null) {
+ mavenCentral()
+ google()
+ maven {
+ url = "https://plugins.gradle.org/m2/"
+ }
+ }
}
}
@@ -322,6 +329,7 @@
includeProject(":compose:integration-tests:docs-snippets", "compose/integration-tests/docs-snippets", [BuildType.COMPOSE])
includeProject(":compose:integration-tests:macrobenchmark", "compose/integration-tests/macrobenchmark", [BuildType.COMPOSE])
includeProject(":compose:integration-tests:macrobenchmark-target", "compose/integration-tests/macrobenchmark-target", [BuildType.COMPOSE])
+includeProject(":compose:integration-tests:material-catalog", "compose/integration-tests/material-catalog", [BuildType.COMPOSE])
includeProject(":compose:lint", "compose/lint", [BuildType.COMPOSE])
includeProject(":compose:lint:internal-lint-checks", "compose/lint/internal-lint-checks", [BuildType.COMPOSE, BuildType.MAIN])
includeProject(":compose:lint:common", "compose/lint/common", [BuildType.COMPOSE, BuildType.MAIN])
@@ -343,7 +351,9 @@
includeProject(":compose:material:material:icons:generator", "compose/material/material/icons/generator", [BuildType.COMPOSE])
includeProject(":compose:material:material:integration-tests:material-demos", "compose/material/material/integration-tests/material-demos", [BuildType.COMPOSE])
includeProject(":compose:material:material:integration-tests:material-catalog", "compose/material/material/integration-tests/material-catalog", [BuildType.COMPOSE])
+includeProject(":compose:material3:material3:integration-tests:material3-catalog", "compose/material3/material3/integration-tests/material3-catalog", [BuildType.COMPOSE])
includeProject(":compose:material:material:material-samples", "compose/material/material/samples", [BuildType.COMPOSE])
+includeProject(":compose:material3:material3:material3-samples", "compose/material3/material3/samples", [BuildType.COMPOSE])
includeProject(":compose:runtime", "compose/runtime", [BuildType.COMPOSE, BuildType.MAIN])
includeProject(":compose:runtime:runtime", "compose/runtime/runtime", [BuildType.COMPOSE, BuildType.MAIN])
includeProject(":compose:runtime:runtime-lint", "compose/runtime/runtime-lint", [BuildType.COMPOSE, BuildType.MAIN])
@@ -642,10 +652,6 @@
includeProject(":viewpager2:viewpager2", "viewpager2/viewpager2", [BuildType.MAIN])
includeProject(":viewpager:viewpager", "viewpager/viewpager", [BuildType.MAIN])
includeProject(":wear:wear", "wear/wear", [BuildType.MAIN, BuildType.WEAR])
-includeProject(":wear:wear-complications-data", "wear/wear-complications-data", [BuildType.MAIN, BuildType.WEAR])
-includeProject(":wear:wear-complications-data-source", "wear/wear-complications-data-source", [BuildType.MAIN, BuildType.WEAR])
-includeProject(":wear:wear-complications-data-source-ktx", "wear/wear-complications-data-source-ktx", [BuildType.MAIN, BuildType.WEAR])
-includeProject(":wear:wear-complications-data-source-samples", "wear/wear-complications-data-source-samples", [BuildType.MAIN, BuildType.WEAR])
includeProject(":wear:benchmark:integration-tests:macrobenchmark-target", "wear/benchmark/integration-tests/macrobenchmark-target", [BuildType.MAIN, BuildType.COMPOSE])
includeProject(":wear:benchmark:integration-tests:macrobenchmark", "wear/benchmark/integration-tests/macrobenchmark", [BuildType.MAIN, BuildType.COMPOSE])
includeProject(":wear:compose:compose-foundation", "wear/compose/compose-foundation", [BuildType.COMPOSE])
@@ -669,21 +675,25 @@
includeProject(":wear:tiles:tiles-proto", "wear/tiles/tiles-proto", [BuildType.MAIN, BuildType.WEAR])
includeProject(":wear:tiles:tiles-renderer", "wear/tiles/tiles-renderer", [BuildType.MAIN, BuildType.WEAR])
includeProject(":wear:tiles:tiles-testing", "wear/tiles/tiles-testing", [BuildType.MAIN, BuildType.WEAR])
-includeProject(":wear:wear-watchface", "wear/wear-watchface", [BuildType.MAIN, BuildType.WEAR])
-includeProject(":wear:wear-watchface-complications-rendering", "wear/wear-watchface-complications-rendering", [BuildType.MAIN, BuildType.WEAR])
-includeProject(":wear:wear-watchface-client", "wear/wear-watchface-client", [BuildType.MAIN, BuildType.WEAR])
-includeProject(":wear:wear-watchface-client-guava", "wear/wear-watchface-client-guava", [BuildType.MAIN, BuildType.WEAR])
-includeProject(":wear:wear-watchface-data", "wear/wear-watchface-data", [BuildType.MAIN, BuildType.WEAR])
-includeProject(":wear:wear-watchface-editor", "wear/wear-watchface-editor", [BuildType.MAIN, BuildType.WEAR])
-includeProject(":wear:wear-watchface-editor-guava", "wear/wear-watchface-editor-guava", [BuildType.MAIN, BuildType.WEAR])
-includeProject(":wear:wear-watchface-editor-samples", "wear/wear-watchface-editor/samples", [BuildType.MAIN, BuildType.WEAR])
-includeProject(":wear:wear-watchface-guava", "wear/wear-watchface-guava", [BuildType.MAIN, BuildType.WEAR])
-includeProject(":wear:wear-watchface-samples", "wear/wear-watchface/samples", [BuildType.MAIN, BuildType.WEAR])
-includeProject(":wear:wear-watchface-samples-app", "wear/wear-watchface/samples/app", [BuildType.MAIN, BuildType.WEAR])
-includeProject(":wear:wear-watchface-samples-minimal", "wear/wear-watchface/samples/minimal", [BuildType.MAIN, BuildType.WEAR])
-includeProject(":wear:wear-watchface-samples-minimal-complications", "wear/wear-watchface-samples-minimal-complications", [BuildType.MAIN, BuildType.WEAR])
-includeProject(":wear:wear-watchface-samples-minimal-style", "wear/wear-watchface-samples-minimal-style", [BuildType.MAIN, BuildType.WEAR])
-includeProject(":wear:wear-watchface-style", "wear/wear-watchface-style", [BuildType.MAIN, BuildType.WEAR])
+includeProject(":wear:watchface:watchface", "wear/watchface/watchface", [BuildType.MAIN, BuildType.WEAR])
+includeProject(":wear:watchface:watchface-complications-data", "wear/watchface/watchface-complications-data", [BuildType.MAIN, BuildType.WEAR])
+includeProject(":wear:watchface:watchface-complications-data-source", "wear/watchface/watchface-complications-data-source", [BuildType.MAIN, BuildType.WEAR])
+includeProject(":wear:watchface:watchface-complications-data-source-ktx", "wear/watchface/watchface-complications-data-source-ktx", [BuildType.MAIN, BuildType.WEAR])
+includeProject(":wear:watchface:watchface-complications-data-source-samples", "wear/watchface/watchface-complications-data-source-samples", [BuildType.MAIN, BuildType.WEAR])
+includeProject(":wear:watchface:watchface-complications-rendering", "wear/watchface/watchface-complications-rendering", [BuildType.MAIN, BuildType.WEAR])
+includeProject(":wear:watchface:watchface-client", "wear/watchface/watchface-client", [BuildType.MAIN, BuildType.WEAR])
+includeProject(":wear:watchface:watchface-client-guava", "wear/watchface/watchface-client-guava", [BuildType.MAIN, BuildType.WEAR])
+includeProject(":wear:watchface:watchface-data", "wear/watchface/watchface-data", [BuildType.MAIN, BuildType.WEAR])
+includeProject(":wear:watchface:watchface-editor", "wear/watchface/watchface-editor", [BuildType.MAIN, BuildType.WEAR])
+includeProject(":wear:watchface:watchface-editor-guava", "wear/watchface/watchface-editor-guava", [BuildType.MAIN, BuildType.WEAR])
+includeProject(":wear:watchface:watchface-editor-samples", "wear/watchface/watchface-editor/samples", [BuildType.MAIN, BuildType.WEAR])
+includeProject(":wear:watchface:watchface-guava", "wear/watchface/watchface-guava", [BuildType.MAIN, BuildType.WEAR])
+includeProject(":wear:watchface:watchface-samples", "wear/watchface/watchface/samples", [BuildType.MAIN, BuildType.WEAR])
+includeProject(":wear:watchface:watchface-samples-app", "wear/watchface/watchface/samples/app", [BuildType.MAIN, BuildType.WEAR])
+includeProject(":wear:watchface:watchface-samples-minimal", "wear/watchface/watchface/samples/minimal", [BuildType.MAIN, BuildType.WEAR])
+includeProject(":wear:watchface:watchface-samples-minimal-complications", "wear/watchface/watchface-samples-minimal-complications", [BuildType.MAIN, BuildType.WEAR])
+includeProject(":wear:watchface:watchface-samples-minimal-style", "wear/watchface/watchface-samples-minimal-style", [BuildType.MAIN, BuildType.WEAR])
+includeProject(":wear:watchface:watchface-style", "wear/watchface/watchface-style", [BuildType.MAIN, BuildType.WEAR])
includeProject(":webkit:integration-tests:testapp", "webkit/integration-tests/testapp", [BuildType.MAIN])
includeProject(":webkit:webkit", "webkit/webkit", [BuildType.MAIN])
includeProject(":window:window", "window/window", [BuildType.MAIN, BuildType.FLAN])
diff --git a/sharetarget/integration-tests/testapp/build.gradle b/sharetarget/integration-tests/testapp/build.gradle
index 40934d8..6f1bc4f 100644
--- a/sharetarget/integration-tests/testapp/build.gradle
+++ b/sharetarget/integration-tests/testapp/build.gradle
@@ -20,8 +20,8 @@
}
dependencies {
- api("androidx.core:core:1.3.2")
+ api("androidx.core:core:1.6.0")
api(project(":sharetarget:sharetarget"))
- api("androidx.appcompat:appcompat:1.2.0")
+ api("androidx.appcompat:appcompat:1.3.1")
api(libs.constraintLayout)
}
diff --git a/sharetarget/sharetarget/build.gradle b/sharetarget/sharetarget/build.gradle
index 8ef5b8a..ddbe003 100644
--- a/sharetarget/sharetarget/build.gradle
+++ b/sharetarget/sharetarget/build.gradle
@@ -23,7 +23,7 @@
}
dependencies {
- api("androidx.core:core:1.3.2")
+ api("androidx.core:core:1.6.0")
api("androidx.collection:collection:1.1.0")
api(libs.guavaListenableFuture)
implementation("androidx.concurrent:concurrent-futures:1.0.0")
diff --git a/sharetarget/sharetarget/lint-baseline.xml b/sharetarget/sharetarget/lint-baseline.xml
index d9a42bd..d0df713 100644
--- a/sharetarget/sharetarget/lint-baseline.xml
+++ b/sharetarget/sharetarget/lint-baseline.xml
@@ -1,5 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
-<issues format="6" by="lint 7.1.0-alpha02" type="baseline" client="cli" name="Lint" variant="all" version="7.1.0-alpha02">
+<issues format="6" by="lint 7.2.0-dev" type="baseline" client="gradle" dependencies="false" name="AGP (7.2.0-dev)" variant="all" version="7.2.0-dev">
+
+ <issue
+ id="NewApi"
+ message="Class requires API level 19 (current min is 14): `ShortcutInfoCompatSaverImpl`"
+ errorLine1=" mShortcutSaver = mock(ShortcutInfoCompatSaverImpl.class);"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/androidTest/java/androidx/sharetarget/ChooserTargetServiceCompatTest.java"
+ line="62"
+ column="31"/>
+ </issue>
<issue
id="NewApi"
diff --git a/slidingpanelayout/slidingpanelayout/src/androidTest/java/androidx/slidingpanelayout/widget/FoldTest.kt b/slidingpanelayout/slidingpanelayout/src/androidTest/java/androidx/slidingpanelayout/widget/FoldTest.kt
index f1f3428..500fe4a 100644
--- a/slidingpanelayout/slidingpanelayout/src/androidTest/java/androidx/slidingpanelayout/widget/FoldTest.kt
+++ b/slidingpanelayout/slidingpanelayout/src/androidTest/java/androidx/slidingpanelayout/widget/FoldTest.kt
@@ -70,8 +70,7 @@
with(ActivityScenario.launch(TestActivity::class.java)) {
withActivity {
val testFeature = FoldingFeature(activity = this, orientation = VERTICAL)
- val info = WindowLayoutInfo.Builder().setDisplayFeatures(listOf(testFeature))
- .build()
+ val info = WindowLayoutInfo(listOf(testFeature))
rule.overrideWindowLayoutInfo(info)
testFeature.bounds
}
@@ -114,7 +113,7 @@
with(ActivityScenario.launch(TestActivity::class.java)) {
withActivity {
val feature = FoldingFeature(activity = this, orientation = VERTICAL)
- val info = WindowLayoutInfo.Builder().setDisplayFeatures(listOf(feature)).build()
+ val info = WindowLayoutInfo(listOf(feature))
rule.overrideWindowLayoutInfo(info)
WindowMetricsCalculator.getOrCreate().computeCurrentWindowMetrics(this).bounds
}
@@ -144,9 +143,8 @@
state = FLAT,
orientation = VERTICAL
)
- val halfOpenInfo = WindowLayoutInfo.Builder()
- .setDisplayFeatures(listOf(halfOpenFeature)).build()
- val flatInfo = WindowLayoutInfo.Builder().setDisplayFeatures(listOf(flat)).build()
+ val halfOpenInfo = WindowLayoutInfo(listOf(halfOpenFeature))
+ val flatInfo = WindowLayoutInfo(listOf(flat))
rule.overrideWindowLayoutInfo(halfOpenInfo)
rule.overrideWindowLayoutInfo(flatInfo)
}
diff --git a/slidingpanelayout/slidingpanelayout/src/androidTest/java/androidx/slidingpanelayout/widget/FoldingFeatureObserverTest.kt b/slidingpanelayout/slidingpanelayout/src/androidTest/java/androidx/slidingpanelayout/widget/FoldingFeatureObserverTest.kt
index af83b42..479e724 100644
--- a/slidingpanelayout/slidingpanelayout/src/androidTest/java/androidx/slidingpanelayout/widget/FoldingFeatureObserverTest.kt
+++ b/slidingpanelayout/slidingpanelayout/src/androidTest/java/androidx/slidingpanelayout/widget/FoldingFeatureObserverTest.kt
@@ -41,7 +41,7 @@
activityScenarioRule.scenario.onActivity { activity ->
val observer = FoldingFeatureObserver(activity.windowInfoRepository(), Runnable::run)
val expected = FoldingFeature(activity = activity)
- val info = WindowLayoutInfo.Builder().setDisplayFeatures(listOf(expected)).build()
+ val info = WindowLayoutInfo(listOf(expected))
observer.setOnFoldingFeatureChangeListener(listener)
windowInfoPublisherRule.overrideWindowLayoutInfo(info)
@@ -56,7 +56,7 @@
activityScenarioRule.scenario.onActivity { activity ->
val observer = FoldingFeatureObserver(activity.windowInfoRepository(), Runnable::run)
val expected = FoldingFeature(activity = activity)
- val info = WindowLayoutInfo.Builder().setDisplayFeatures(listOf(expected)).build()
+ val info = WindowLayoutInfo(listOf(expected))
observer.setOnFoldingFeatureChangeListener(listener)
observer.registerLayoutStateChangeCallback()
@@ -72,7 +72,7 @@
activityScenarioRule.scenario.onActivity { activity ->
val observer = FoldingFeatureObserver(activity.windowInfoRepository(), Runnable::run)
val expected = FoldingFeature(activity = activity)
- val info = WindowLayoutInfo.Builder().setDisplayFeatures(listOf(expected)).build()
+ val info = WindowLayoutInfo(listOf(expected))
observer.setOnFoldingFeatureChangeListener(listener)
observer.registerLayoutStateChangeCallback()
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 8258f9f..56cc30b 100644
--- a/testutils/testutils-paging/src/main/java/androidx/paging/TestPagingSource.kt
+++ b/testutils/testutils-paging/src/main/java/androidx/paging/TestPagingSource.kt
@@ -61,7 +61,7 @@
return withContext(loadDispatcher) { getLoadResult(params) }
}
- private suspend fun getLoadResult(params: LoadParams<Int>): LoadResult<Int, Int> {
+ private fun getLoadResult(params: LoadParams<Int>): LoadResult<Int, Int> {
val key = params.key ?: 0
val isPrepend = params is LoadParams.Prepend
diff --git a/textclassifier/integration-tests/testapp/lint-baseline.xml b/textclassifier/integration-tests/testapp/lint-baseline.xml
index d36e58b..7c4ecdc 100644
--- a/textclassifier/integration-tests/testapp/lint-baseline.xml
+++ b/textclassifier/integration-tests/testapp/lint-baseline.xml
@@ -1,5 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
-<issues format="6" by="lint 7.1.0-alpha02" type="baseline" client="cli" name="Lint" variant="all" version="7.1.0-alpha02">
+<issues format="6" by="lint 7.2.0-dev" type="baseline" client="gradle" dependencies="false" name="AGP (7.2.0-dev)" variant="all" version="7.2.0-dev">
+
+ <issue
+ id="NewApi"
+ message="Class requires API level 23 (current min is 19): `MainActivity`"
+ errorLine1=" new ActivityTestRule<>(MainActivity.class);"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/androidTest/java/androidx/textclassifier/integration/testapp/MainActivityTest.java"
+ line="43"
+ column="36"/>
+ </issue>
<issue
id="SyntheticAccessor"
diff --git a/textclassifier/textclassifier/lint-baseline.xml b/textclassifier/textclassifier/lint-baseline.xml
index c00c3c9..f2d0cf5 100644
--- a/textclassifier/textclassifier/lint-baseline.xml
+++ b/textclassifier/textclassifier/lint-baseline.xml
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
-<issues format="6" by="lint 7.1.0-dev" type="baseline" client="gradle" name="AGP (7.1.0-dev)" variant="all" version="7.1.0-dev">
+<issues format="6" by="lint 7.2.0-dev" type="baseline" client="gradle" dependencies="false" name="AGP (7.2.0-dev)" variant="all" version="7.2.0-dev">
<issue
id="NewApi"
- message="Call requires API level 23 (current min is 14): `FLOATING_TOOLBAR_TAG`"
+ message="Field requires API level 23 (current min is 14): `FLOATING_TOOLBAR_TAG`"
errorLine1=" final Object tag = FloatingToolbar.FLOATING_TOOLBAR_TAG;"
errorLine2=" ~~~~~~~~~~~~~~~~~~~~">
<location
@@ -14,7 +14,7 @@
<issue
id="NewApi"
- message="Call requires API level 23 (current min is 14): `MAIN_PANEL_TAG`"
+ message="Field requires API level 23 (current min is 14): `MAIN_PANEL_TAG`"
errorLine1=" final Object tag = FloatingToolbar.MAIN_PANEL_TAG;"
errorLine2=" ~~~~~~~~~~~~~~">
<location
@@ -25,7 +25,7 @@
<issue
id="NewApi"
- message="Call requires API level 23 (current min is 14): `OVERFLOW_PANEL_TAG`"
+ message="Field requires API level 23 (current min is 14): `OVERFLOW_PANEL_TAG`"
errorLine1=" final Object tag = FloatingToolbar.OVERFLOW_PANEL_TAG;"
errorLine2=" ~~~~~~~~~~~~~~~~~~">
<location
@@ -36,7 +36,7 @@
<issue
id="NewApi"
- message="Call requires API level 23 (current min is 14): `FLOATING_TOOLBAR_TAG`"
+ message="Field requires API level 23 (current min is 14): `FLOATING_TOOLBAR_TAG`"
errorLine1=" final Object tag = FloatingToolbar.FLOATING_TOOLBAR_TAG;"
errorLine2=" ~~~~~~~~~~~~~~~~~~~~">
<location
@@ -47,7 +47,7 @@
<issue
id="WrongConstant"
- message="Must be one of: ConversationAction.TYPE_VIEW_CALENDAR, ConversationAction.TYPE_VIEW_MAP, ConversationAction.TYPE_TRACK_FLIGHT, ConversationAction.TYPE_OPEN_URL, ConversationAction.TYPE_SEND_SMS, ConversationAction.TYPE_CALL_PHONE, ConversationAction.TYPE_SEND_EMAIL, ConversationAction.TYPE_TEXT_REPLY, ConversationAction.TYPE_CREATE_REMINDER, ConversationAction.TYPE_SHARE_LOCATION, ConversationAction.TYPE_ADD_CONTACT, ConversationAction.TYPE_COPY"
+ message="Must be one of: ConversationAction.TYPE_VIEW_CALENDAR, ConversationAction.TYPE_VIEW_MAP, ConversationAction.TYPE_TRACK_FLIGHT, ConversationAction.TYPE_OPEN_URL, ConversationAction.TYPE_SEND_SMS, ConversationAction.TYPE_CALL_PHONE, ConversationAction.TYPE_SEND_EMAIL, ConversationAction.TYPE_TEXT_REPLY, ConversationAction.TYPE_CREATE_REMINDER, ConversationAction.TYPE_SHARE_LOCATION, ConversationAction.TYPE_ADD_CONTACT, ConversationAction.TYPE_COPY, but could be ConversationAction.TYPE_VIEW_CALENDAR, ConversationAction.TYPE_VIEW_MAP, ConversationAction.TYPE_TRACK_FLIGHT, ConversationAction.TYPE_OPEN_URL, ConversationAction.TYPE_SEND_SMS, ConversationAction.TYPE_CALL_PHONE, ConversationAction.TYPE_SEND_EMAIL, ConversationAction.TYPE_TEXT_REPLY, ConversationAction.TYPE_CREATE_REMINDER, ConversationAction.TYPE_SHARE_LOCATION"
errorLine1=" return new ConversationAction.Builder(conversationAction.getType())"
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
<location
diff --git a/vectordrawable/integration-tests/testapp/lint-baseline.xml b/vectordrawable/integration-tests/testapp/lint-baseline.xml
index b8cad8e..497c209 100644
--- a/vectordrawable/integration-tests/testapp/lint-baseline.xml
+++ b/vectordrawable/integration-tests/testapp/lint-baseline.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<issues format="6" by="lint 7.1.0-alpha02" type="baseline" client="cli" name="Lint" variant="all" version="7.1.0-alpha02">
+<issues format="6" by="lint 7.1.0-dev" type="baseline" client="gradle" dependencies="false" name="AGP (7.1.0-dev)" variant="all" version="7.1.0-dev">
<issue
id="NewApi"
diff --git a/wear/compose/compose-foundation/api/current.txt b/wear/compose/compose-foundation/api/current.txt
index fb15cdf..2307358 100644
--- a/wear/compose/compose-foundation/api/current.txt
+++ b/wear/compose/compose-foundation/api/current.txt
@@ -14,25 +14,15 @@
property public final float Start;
}
- @androidx.compose.runtime.Stable public final class ArcPaddingValues {
- ctor public ArcPaddingValues(float outer, float inner, float start, float end);
- method public float getEnd();
- method public float getInner();
- method public float getOuter();
- method public float getStart();
- property public final float end;
- property public final float inner;
- property public final float outer;
- property public final float start;
- field public static final androidx.wear.compose.foundation.ArcPaddingValues.Companion Companion;
- }
-
- public static final class ArcPaddingValues.Companion {
- method public androidx.wear.compose.foundation.ArcPaddingValues getZero();
- property public final androidx.wear.compose.foundation.ArcPaddingValues Zero;
+ @androidx.compose.runtime.Stable public interface ArcPaddingValues {
+ method public float calculateEndPadding();
+ method public float calculateInnerPadding();
+ method public float calculateOuterPadding();
+ method public float calculateStartPadding();
}
public final class BasicCurvedTextKt {
+ method public static androidx.wear.compose.foundation.ArcPaddingValues ArcPaddingValues(optional float outer, optional float inner, optional float start, optional float end);
method public static androidx.wear.compose.foundation.ArcPaddingValues ArcPaddingValues(float all);
method public static androidx.wear.compose.foundation.ArcPaddingValues ArcPaddingValues(optional float radial, optional float angular);
method @androidx.compose.runtime.Composable public static void BasicCurvedText(androidx.wear.compose.foundation.CurvedRowScope, String text, androidx.wear.compose.foundation.CurvedTextStyle style, optional androidx.compose.ui.Modifier modifier, optional boolean clockwise, optional androidx.wear.compose.foundation.ArcPaddingValues contentArcPadding);
diff --git a/wear/compose/compose-foundation/api/public_plus_experimental_current.txt b/wear/compose/compose-foundation/api/public_plus_experimental_current.txt
index fb15cdf..2307358 100644
--- a/wear/compose/compose-foundation/api/public_plus_experimental_current.txt
+++ b/wear/compose/compose-foundation/api/public_plus_experimental_current.txt
@@ -14,25 +14,15 @@
property public final float Start;
}
- @androidx.compose.runtime.Stable public final class ArcPaddingValues {
- ctor public ArcPaddingValues(float outer, float inner, float start, float end);
- method public float getEnd();
- method public float getInner();
- method public float getOuter();
- method public float getStart();
- property public final float end;
- property public final float inner;
- property public final float outer;
- property public final float start;
- field public static final androidx.wear.compose.foundation.ArcPaddingValues.Companion Companion;
- }
-
- public static final class ArcPaddingValues.Companion {
- method public androidx.wear.compose.foundation.ArcPaddingValues getZero();
- property public final androidx.wear.compose.foundation.ArcPaddingValues Zero;
+ @androidx.compose.runtime.Stable public interface ArcPaddingValues {
+ method public float calculateEndPadding();
+ method public float calculateInnerPadding();
+ method public float calculateOuterPadding();
+ method public float calculateStartPadding();
}
public final class BasicCurvedTextKt {
+ method public static androidx.wear.compose.foundation.ArcPaddingValues ArcPaddingValues(optional float outer, optional float inner, optional float start, optional float end);
method public static androidx.wear.compose.foundation.ArcPaddingValues ArcPaddingValues(float all);
method public static androidx.wear.compose.foundation.ArcPaddingValues ArcPaddingValues(optional float radial, optional float angular);
method @androidx.compose.runtime.Composable public static void BasicCurvedText(androidx.wear.compose.foundation.CurvedRowScope, String text, androidx.wear.compose.foundation.CurvedTextStyle style, optional androidx.compose.ui.Modifier modifier, optional boolean clockwise, optional androidx.wear.compose.foundation.ArcPaddingValues contentArcPadding);
diff --git a/wear/compose/compose-foundation/api/restricted_current.txt b/wear/compose/compose-foundation/api/restricted_current.txt
index fb15cdf..2307358 100644
--- a/wear/compose/compose-foundation/api/restricted_current.txt
+++ b/wear/compose/compose-foundation/api/restricted_current.txt
@@ -14,25 +14,15 @@
property public final float Start;
}
- @androidx.compose.runtime.Stable public final class ArcPaddingValues {
- ctor public ArcPaddingValues(float outer, float inner, float start, float end);
- method public float getEnd();
- method public float getInner();
- method public float getOuter();
- method public float getStart();
- property public final float end;
- property public final float inner;
- property public final float outer;
- property public final float start;
- field public static final androidx.wear.compose.foundation.ArcPaddingValues.Companion Companion;
- }
-
- public static final class ArcPaddingValues.Companion {
- method public androidx.wear.compose.foundation.ArcPaddingValues getZero();
- property public final androidx.wear.compose.foundation.ArcPaddingValues Zero;
+ @androidx.compose.runtime.Stable public interface ArcPaddingValues {
+ method public float calculateEndPadding();
+ method public float calculateInnerPadding();
+ method public float calculateOuterPadding();
+ method public float calculateStartPadding();
}
public final class BasicCurvedTextKt {
+ method public static androidx.wear.compose.foundation.ArcPaddingValues ArcPaddingValues(optional float outer, optional float inner, optional float start, optional float end);
method public static androidx.wear.compose.foundation.ArcPaddingValues ArcPaddingValues(float all);
method public static androidx.wear.compose.foundation.ArcPaddingValues ArcPaddingValues(optional float radial, optional float angular);
method @androidx.compose.runtime.Composable public static void BasicCurvedText(androidx.wear.compose.foundation.CurvedRowScope, String text, androidx.wear.compose.foundation.CurvedTextStyle style, optional androidx.compose.ui.Modifier modifier, optional boolean clockwise, optional androidx.wear.compose.foundation.ArcPaddingValues contentArcPadding);
diff --git a/wear/compose/compose-foundation/src/androidAndroidTest/kotlin/androidx/wear/compose/foundation/CurvedRowTest.kt b/wear/compose/compose-foundation/src/androidAndroidTest/kotlin/androidx/wear/compose/foundation/CurvedRowTest.kt
index c0298d5..52f3c30 100644
--- a/wear/compose/compose-foundation/src/androidAndroidTest/kotlin/androidx/wear/compose/foundation/CurvedRowTest.kt
+++ b/wear/compose/compose-foundation/src/androidAndroidTest/kotlin/androidx/wear/compose/foundation/CurvedRowTest.kt
@@ -98,7 +98,7 @@
repeat(3) { ix ->
Box(
modifier = Modifier
- .size(40.dp)
+ .size(30.dp)
.onGloballyPositioned { coords[ix] = it }
)
}
@@ -142,13 +142,13 @@
) {
Box(
modifier = Modifier
- .size(40.dp)
+ .size(30.dp)
.onGloballyPositioned { smallBoxCoords = it }
.radialAlignment(radialAlignment)
)
Box(
modifier = Modifier
- .size(60.dp)
+ .size(45.dp)
.onGloballyPositioned { bigBoxCoords = it }
)
}
diff --git a/wear/compose/compose-foundation/src/commonMain/kotlin/androidx/wear/compose/foundation/BasicCurvedText.kt b/wear/compose/compose-foundation/src/commonMain/kotlin/androidx/wear/compose/foundation/BasicCurvedText.kt
index bcc5388..6a4bc0a 100644
--- a/wear/compose/compose-foundation/src/commonMain/kotlin/androidx/wear/compose/foundation/BasicCurvedText.kt
+++ b/wear/compose/compose-foundation/src/commonMain/kotlin/androidx/wear/compose/foundation/BasicCurvedText.kt
@@ -36,6 +36,9 @@
import androidx.compose.ui.layout.MeasureScope
import androidx.compose.ui.layout.ParentDataModifier
import androidx.compose.ui.platform.LocalDensity
+import androidx.compose.ui.semantics.semantics
+import androidx.compose.ui.semantics.text
+import androidx.compose.ui.text.AnnotatedString
import androidx.compose.ui.unit.Constraints
import androidx.compose.ui.unit.Density
import androidx.compose.ui.unit.Dp
@@ -43,6 +46,34 @@
import kotlin.math.ceil
/**
+ * Apply additional space along each edge of the content in [Dp].
+ * See the [ArcPaddingValues] factories for convenient ways to
+ * build [ArcPaddingValues].
+ */
+@Stable
+interface ArcPaddingValues {
+ /**
+ * Padding in the outward direction from the center of the [CurvedRow]
+ */
+ fun calculateOuterPadding(): Dp
+
+ /**
+ * Padding in the inwards direction towards the center of the [CurvedRow]
+ */
+ fun calculateInnerPadding(): Dp
+
+ /**
+ * Padding added at the start of the component.
+ */
+ fun calculateStartPadding(): Dp
+
+ /**
+ * Padding added at the end of the component.
+ */
+ fun calculateEndPadding(): Dp
+}
+
+/**
* Apply additional space along each edge of the content in [Dp]. Note that the start and end
* edges will be determined by the direction (clockwise or counterclockwise)
*
@@ -52,10 +83,31 @@
* @param start Padding added at the start of the component.
* @param end Padding added at the end of the component.
*/
+fun ArcPaddingValues(
+ outer: Dp = 0.dp,
+ inner: Dp = 0.dp,
+ start: Dp = 0.dp,
+ end: Dp = 0.dp
+): ArcPaddingValues =
+ ArcPaddingValuesImpl(outer, inner, start, end)
+
+/**
+ * Apply [all] dp of additional space along each edge of the content.
+ */
+fun ArcPaddingValues(all: Dp): ArcPaddingValues = ArcPaddingValuesImpl(all, all, all, all)
+
+/**
+ * Apply [radial] dp of additional space on the edges towards and away from the center, and
+ * [angular] dp before and after the component.
+ */
+fun ArcPaddingValues(radial: Dp = 0.dp, angular: Dp = 0.dp): ArcPaddingValues =
+ ArcPaddingValuesImpl(radial, radial, angular, angular)
+
@Stable
-class ArcPaddingValues(val outer: Dp, val inner: Dp, val start: Dp, val end: Dp) {
+internal class ArcPaddingValuesImpl(val outer: Dp, val inner: Dp, val start: Dp, val end: Dp) :
+ ArcPaddingValues {
override fun equals(other: Any?): Boolean {
- return other is ArcPaddingValues &&
+ return other is ArcPaddingValuesImpl &&
outer == other.outer &&
inner == other.inner &&
start == other.start &&
@@ -66,31 +118,16 @@
31 + end.hashCode()
override fun toString(): String {
- return "ArcPaddingValues(outer=$outer, inner=$inner, start=$start, end=$end)"
+ return "ArcPaddingValuesImpl(outer=$outer, inner=$inner, start=$start, end=$end)"
}
- companion object {
- /**
- * An arc padding value with zero magnitude.
- */
- @Stable
- val Zero = ArcPaddingValues(0.dp, 0.dp, 0.dp, 0.dp)
- }
+ override fun calculateOuterPadding() = outer
+ override fun calculateInnerPadding() = inner
+ override fun calculateStartPadding() = start
+ override fun calculateEndPadding() = end
}
/**
- * Apply [all] dp of additional space along each edge of the content.
- */
-fun ArcPaddingValues(all: Dp) = ArcPaddingValues(all, all, all, all)
-
-/**
- * Apply [radial] dp of additional space on the edges towards and away from the center, and
- * [angular] dp before and after the component.
- */
-fun ArcPaddingValues(radial: Dp = 0.dp, angular: Dp = 0.dp) =
- ArcPaddingValues(radial, radial, angular, angular)
-
-/**
* CurvedText is a component allowing developers to easily write curved text following
* the curvature a circle (usually at the edge of a circular screen).
* CurvedText can be only created within the CurvedRow to ensure the best experience, like being
@@ -123,10 +160,10 @@
val arcPaddingPx = with(LocalDensity.current) {
remember(contentArcPadding) {
ArcPaddingPx(
- contentArcPadding.outer.toPx(),
- contentArcPadding.inner.toPx(),
- contentArcPadding.start.toPx(),
- contentArcPadding.end.toPx()
+ contentArcPadding.calculateOuterPadding().toPx(),
+ contentArcPadding.calculateInnerPadding().toPx(),
+ contentArcPadding.calculateStartPadding().toPx(),
+ contentArcPadding.calculateEndPadding().toPx()
)
}
}
@@ -134,6 +171,7 @@
Layout(
modifier = modifier
+ .semantics { this.text = AnnotatedString(text) }
.then(CurvedTextModifier())
.graphicsLayer()
.drawBehind {
diff --git a/wear/compose/compose-material/api/current.txt b/wear/compose/compose-material/api/current.txt
index 9fd1da2..a92dace 100644
--- a/wear/compose/compose-material/api/current.txt
+++ b/wear/compose/compose-material/api/current.txt
@@ -132,6 +132,13 @@
method public static androidx.compose.runtime.ProvidableCompositionLocal<androidx.compose.ui.graphics.Color> getLocalContentColor();
}
+ public final class CurvedTextKt {
+ method @androidx.compose.runtime.Composable public static void CurvedText(androidx.wear.compose.foundation.CurvedRowScope, String text, optional androidx.compose.ui.Modifier modifier, optional long color, optional long background, optional long fontSize, optional androidx.wear.compose.foundation.CurvedTextStyle style, optional boolean clockwise, optional androidx.wear.compose.foundation.ArcPaddingValues contentArcPadding);
+ }
+
+ public final class DefaultTimeSourceKt {
+ }
+
public final class IconKt {
method @androidx.compose.runtime.Composable public static void Icon(androidx.compose.ui.graphics.vector.ImageVector imageVector, String? contentDescription, optional androidx.compose.ui.Modifier modifier, optional long tint);
method @androidx.compose.runtime.Composable public static void Icon(androidx.compose.ui.graphics.ImageBitmap bitmap, String? contentDescription, optional androidx.compose.ui.Modifier modifier, optional long tint);
@@ -291,9 +298,6 @@
public final class TimeTextKt {
}
- public final class TimeUpdateControllerKt {
- }
-
@androidx.compose.runtime.Stable public interface ToggleButtonColors {
method @androidx.compose.runtime.Composable public androidx.compose.runtime.State<androidx.compose.ui.graphics.Color> backgroundColor(boolean enabled, boolean checked);
method @androidx.compose.runtime.Composable public androidx.compose.runtime.State<androidx.compose.ui.graphics.Color> contentColor(boolean enabled, boolean checked);
diff --git a/wear/compose/compose-material/api/public_plus_experimental_current.txt b/wear/compose/compose-material/api/public_plus_experimental_current.txt
index 34ebffe..4acf37b 100644
--- a/wear/compose/compose-material/api/public_plus_experimental_current.txt
+++ b/wear/compose/compose-material/api/public_plus_experimental_current.txt
@@ -132,6 +132,13 @@
method public static androidx.compose.runtime.ProvidableCompositionLocal<androidx.compose.ui.graphics.Color> getLocalContentColor();
}
+ public final class CurvedTextKt {
+ method @androidx.compose.runtime.Composable public static void CurvedText(androidx.wear.compose.foundation.CurvedRowScope, String text, optional androidx.compose.ui.Modifier modifier, optional long color, optional long background, optional long fontSize, optional androidx.wear.compose.foundation.CurvedTextStyle style, optional boolean clockwise, optional androidx.wear.compose.foundation.ArcPaddingValues contentArcPadding);
+ }
+
+ public final class DefaultTimeSourceKt {
+ }
+
@kotlin.RequiresOptIn(message="This Wear Material API is experimental and is likely to change or to be removed in" + " the future.") public @interface ExperimentalWearMaterialApi {
}
@@ -327,7 +334,7 @@
}
public final class SwipeToDismissBoxKt {
- method @androidx.compose.runtime.Composable @androidx.wear.compose.material.ExperimentalWearMaterialApi public static void SwipeToDismissBox(androidx.wear.compose.material.SwipeToDismissBoxState state, optional androidx.compose.ui.Modifier modifier, optional long scrimColor, optional Object backgroundKey, optional Object contentKey, optional boolean hasBackground, kotlin.jvm.functions.Function2<? super androidx.compose.foundation.layout.BoxScope,? super java.lang.Boolean,kotlin.Unit> content);
+ method @androidx.compose.runtime.Composable @androidx.wear.compose.material.ExperimentalWearMaterialApi public static void SwipeToDismissBox(androidx.wear.compose.material.SwipeToDismissBoxState state, optional androidx.compose.ui.Modifier modifier, optional long backgroundScrimColor, optional long contentScrimColor, optional Object backgroundKey, optional Object contentKey, optional boolean hasBackground, kotlin.jvm.functions.Function2<? super androidx.compose.foundation.layout.BoxScope,? super java.lang.Boolean,kotlin.Unit> content);
method @androidx.compose.runtime.Composable @androidx.wear.compose.material.ExperimentalWearMaterialApi public static androidx.wear.compose.material.SwipeToDismissBoxState rememberSwipeToDismissBoxState(optional androidx.compose.animation.core.AnimationSpec<java.lang.Float> animationSpec, optional kotlin.jvm.functions.Function1<? super androidx.wear.compose.material.SwipeDismissTarget,java.lang.Boolean> confirmStateChange);
}
@@ -393,12 +400,18 @@
method public float computeThreshold(androidx.compose.ui.unit.Density, float fromValue, float toValue);
}
+ @androidx.wear.compose.material.ExperimentalWearMaterialApi public interface TimeSource {
+ method @androidx.compose.runtime.Composable public String getCurrentTime();
+ property @androidx.compose.runtime.Composable public abstract String currentTime;
+ }
+
@androidx.wear.compose.material.ExperimentalWearMaterialApi public final class TimeTextDefaults {
- method @androidx.compose.runtime.Composable public void CurvedTextSeparator(androidx.wear.compose.foundation.CurvedRowScope, optional androidx.wear.compose.foundation.CurvedTextStyle curvedTextStyle, optional androidx.wear.compose.foundation.ArcPaddingValues contentArcPadding);
+ method @androidx.compose.runtime.Composable public void CurvedTextSeparator(androidx.wear.compose.foundation.CurvedRowScope, optional androidx.compose.ui.Modifier modifier, optional androidx.wear.compose.foundation.CurvedTextStyle curvedTextStyle, optional androidx.wear.compose.foundation.ArcPaddingValues contentArcPadding);
method @androidx.compose.runtime.Composable public void TextSeparator(optional androidx.compose.ui.Modifier modifier, optional androidx.compose.ui.text.TextStyle textStyle, optional androidx.compose.foundation.layout.PaddingValues contentPadding);
method public androidx.compose.foundation.layout.PaddingValues getContentPadding();
method @androidx.compose.runtime.Composable public androidx.wear.compose.foundation.CurvedTextStyle timeCurvedTextStyle(optional long color, optional long background, optional long fontSize);
method @androidx.compose.runtime.Composable public String timeFormat();
+ method public androidx.wear.compose.material.TimeSource timeSource(String timeFormat);
method @androidx.compose.runtime.Composable public androidx.compose.ui.text.TextStyle timeTextStyle(optional long color, optional long background, optional long fontSize);
property public final androidx.compose.foundation.layout.PaddingValues ContentPadding;
field public static final androidx.wear.compose.material.TimeTextDefaults INSTANCE;
@@ -407,10 +420,7 @@
}
public final class TimeTextKt {
- method @androidx.compose.runtime.Composable @androidx.wear.compose.material.ExperimentalWearMaterialApi public static void TimeText(optional androidx.compose.ui.Modifier modifier, optional kotlin.jvm.functions.Function0<java.lang.Long> timeMillis, optional String timeFormat, optional androidx.compose.ui.text.TextStyle timeTextStyle, optional androidx.compose.foundation.layout.PaddingValues contentPadding, optional kotlin.jvm.functions.Function0<kotlin.Unit>? leadingLinearContent, optional kotlin.jvm.functions.Function1<? super androidx.wear.compose.foundation.CurvedRowScope,kotlin.Unit>? leadingCurvedContent, optional kotlin.jvm.functions.Function0<kotlin.Unit>? trailingLinearContent, optional kotlin.jvm.functions.Function1<? super androidx.wear.compose.foundation.CurvedRowScope,kotlin.Unit>? trailingCurvedContent, optional kotlin.jvm.functions.Function0<kotlin.Unit> textLinearSeparator, optional kotlin.jvm.functions.Function1<? super androidx.wear.compose.foundation.CurvedRowScope,kotlin.Unit> textCurvedSeparator);
- }
-
- public final class TimeUpdateControllerKt {
+ method @androidx.compose.runtime.Composable @androidx.wear.compose.material.ExperimentalWearMaterialApi public static void TimeText(optional androidx.compose.ui.Modifier modifier, optional androidx.wear.compose.material.TimeSource timeSource, optional androidx.compose.ui.text.TextStyle timeTextStyle, optional androidx.compose.foundation.layout.PaddingValues contentPadding, optional kotlin.jvm.functions.Function0<kotlin.Unit>? leadingLinearContent, optional kotlin.jvm.functions.Function1<? super androidx.wear.compose.foundation.CurvedRowScope,kotlin.Unit>? leadingCurvedContent, optional kotlin.jvm.functions.Function0<kotlin.Unit>? trailingLinearContent, optional kotlin.jvm.functions.Function1<? super androidx.wear.compose.foundation.CurvedRowScope,kotlin.Unit>? trailingCurvedContent, optional kotlin.jvm.functions.Function0<kotlin.Unit> textLinearSeparator, optional kotlin.jvm.functions.Function1<? super androidx.wear.compose.foundation.CurvedRowScope,kotlin.Unit> textCurvedSeparator);
}
@androidx.compose.runtime.Stable public interface ToggleButtonColors {
diff --git a/wear/compose/compose-material/api/restricted_current.txt b/wear/compose/compose-material/api/restricted_current.txt
index 9fd1da2..a92dace 100644
--- a/wear/compose/compose-material/api/restricted_current.txt
+++ b/wear/compose/compose-material/api/restricted_current.txt
@@ -132,6 +132,13 @@
method public static androidx.compose.runtime.ProvidableCompositionLocal<androidx.compose.ui.graphics.Color> getLocalContentColor();
}
+ public final class CurvedTextKt {
+ method @androidx.compose.runtime.Composable public static void CurvedText(androidx.wear.compose.foundation.CurvedRowScope, String text, optional androidx.compose.ui.Modifier modifier, optional long color, optional long background, optional long fontSize, optional androidx.wear.compose.foundation.CurvedTextStyle style, optional boolean clockwise, optional androidx.wear.compose.foundation.ArcPaddingValues contentArcPadding);
+ }
+
+ public final class DefaultTimeSourceKt {
+ }
+
public final class IconKt {
method @androidx.compose.runtime.Composable public static void Icon(androidx.compose.ui.graphics.vector.ImageVector imageVector, String? contentDescription, optional androidx.compose.ui.Modifier modifier, optional long tint);
method @androidx.compose.runtime.Composable public static void Icon(androidx.compose.ui.graphics.ImageBitmap bitmap, String? contentDescription, optional androidx.compose.ui.Modifier modifier, optional long tint);
@@ -291,9 +298,6 @@
public final class TimeTextKt {
}
- public final class TimeUpdateControllerKt {
- }
-
@androidx.compose.runtime.Stable public interface ToggleButtonColors {
method @androidx.compose.runtime.Composable public androidx.compose.runtime.State<androidx.compose.ui.graphics.Color> backgroundColor(boolean enabled, boolean checked);
method @androidx.compose.runtime.Composable public androidx.compose.runtime.State<androidx.compose.ui.graphics.Color> contentColor(boolean enabled, boolean checked);
diff --git a/wear/compose/compose-material/samples/src/main/java/androidx/wear/compose/material/samples/CurvedTextSample.kt b/wear/compose/compose-material/samples/src/main/java/androidx/wear/compose/material/samples/CurvedTextSample.kt
new file mode 100644
index 0000000..e82c4d7
--- /dev/null
+++ b/wear/compose/compose-material/samples/src/main/java/androidx/wear/compose/material/samples/CurvedTextSample.kt
@@ -0,0 +1,49 @@
+/*
+ * Copyright 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES 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.wear.compose.material.samples
+
+import androidx.annotation.Sampled
+import androidx.compose.runtime.Composable
+import androidx.compose.runtime.CompositionLocalProvider
+import androidx.compose.ui.graphics.Color
+import androidx.compose.ui.text.TextStyle
+import androidx.compose.ui.unit.sp
+import androidx.wear.compose.foundation.CurvedRow
+import androidx.wear.compose.material.CurvedText
+import androidx.wear.compose.material.LocalContentAlpha
+import androidx.wear.compose.material.LocalContentColor
+import androidx.wear.compose.material.ProvideTextStyle
+
+@Sampled
+@Composable
+fun CurvedTextDemo() {
+ CurvedRow() {
+ CurvedText("Default")
+ CurvedText("Red", color = Color.Red)
+ CurvedText("White On Green", color = Color.White, background = Color.Green)
+ CurvedText("Big", fontSize = 24.sp)
+ ProvideTextStyle(value = TextStyle(color = Color.Green, background = Color.White)) {
+ CurvedText("Green On White")
+ }
+ CompositionLocalProvider(
+ LocalContentColor provides Color.Cyan,
+ LocalContentAlpha provides 0.5f
+ ) {
+ CurvedText("Cyan 50%")
+ }
+ }
+}
diff --git a/wear/compose/compose-material/samples/src/main/java/androidx/wear/compose/material/samples/ScaffoldSample.kt b/wear/compose/compose-material/samples/src/main/java/androidx/wear/compose/material/samples/ScaffoldSample.kt
index bf262ad..a9012ca 100644
--- a/wear/compose/compose-material/samples/src/main/java/androidx/wear/compose/material/samples/ScaffoldSample.kt
+++ b/wear/compose/compose-material/samples/src/main/java/androidx/wear/compose/material/samples/ScaffoldSample.kt
@@ -26,16 +26,18 @@
import androidx.compose.ui.unit.dp
import androidx.wear.compose.material.Chip
import androidx.wear.compose.material.ChipDefaults
+import androidx.wear.compose.material.ExperimentalWearMaterialApi
import androidx.wear.compose.material.PositionIndicator
import androidx.wear.compose.material.Scaffold
import androidx.wear.compose.material.ScalingLazyColumn
import androidx.wear.compose.material.Text
+import androidx.wear.compose.material.TimeText
import androidx.wear.compose.material.Vignette
import androidx.wear.compose.material.VignettePosition
import androidx.wear.compose.material.rememberScalingLazyListState
@SuppressLint("UnrememberedMutableState")
-@OptIn(ExperimentalAnimationApi::class)
+@OptIn(ExperimentalAnimationApi::class, ExperimentalWearMaterialApi::class)
@Sampled
@Composable
fun SimpleScaffoldWithScrollIndicator() {
@@ -57,7 +59,7 @@
}
},
timeText = {
- Text("12:30pm")
+ TimeText()
}
) {
ScalingLazyColumn(
diff --git a/wear/compose/compose-material/samples/src/main/java/androidx/wear/compose/material/samples/TimeTextSample.kt b/wear/compose/compose-material/samples/src/main/java/androidx/wear/compose/material/samples/TimeTextSample.kt
index c1a0f8e..0f02b23 100644
--- a/wear/compose/compose-material/samples/src/main/java/androidx/wear/compose/material/samples/TimeTextSample.kt
+++ b/wear/compose/compose-material/samples/src/main/java/androidx/wear/compose/material/samples/TimeTextSample.kt
@@ -79,5 +79,5 @@
@Sampled
@Composable
fun TimeTextWithFullDateAndTimeFormat() {
- TimeText(timeFormat = "yyyy-MM-dd hh:mm")
+ TimeText(timeSource = TimeTextDefaults.timeSource("yyyy-MM-dd hh:mm"))
}
\ No newline at end of file
diff --git a/wear/compose/compose-material/src/androidAndroidTest/kotlin/androidx/wear/compose/material/ConfigurableShapeScreen.kt b/wear/compose/compose-material/src/androidAndroidTest/kotlin/androidx/wear/compose/material/ConfigurableShapeScreen.kt
new file mode 100644
index 0000000..7df6527
--- /dev/null
+++ b/wear/compose/compose-material/src/androidAndroidTest/kotlin/androidx/wear/compose/material/ConfigurableShapeScreen.kt
@@ -0,0 +1,47 @@
+/*
+ * Copyright 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES 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.wear.compose.material
+
+import android.content.res.Configuration
+import androidx.compose.runtime.Composable
+import androidx.compose.runtime.CompositionLocalProvider
+import androidx.compose.ui.platform.LocalConfiguration
+
+/**
+ * Helper function which changes [Configuration.isScreenRound] result by changing
+ * [Configuration.screenLayout] field and allows to mock square and round behaviour
+ * @param isRound mocks shape either to round or not round (square) form
+ */
+@Composable
+fun ConfiguredShapeScreen(
+ isRound: Boolean,
+ content: @Composable () -> Unit
+) {
+ val newConfiguration = Configuration(LocalConfiguration.current)
+ newConfiguration.screenLayout = newConfiguration.screenLayout and
+ Configuration.SCREENLAYOUT_ROUND_MASK.inv() or
+ if (isRound) {
+ Configuration.SCREENLAYOUT_ROUND_YES
+ } else {
+ Configuration.SCREENLAYOUT_ROUND_NO
+ }
+
+ CompositionLocalProvider(
+ LocalConfiguration provides newConfiguration,
+ content = content
+ )
+}
diff --git a/wear/compose/compose-material/src/androidAndroidTest/kotlin/androidx/wear/compose/material/MaterialTest.kt b/wear/compose/compose-material/src/androidAndroidTest/kotlin/androidx/wear/compose/material/MaterialTest.kt
index 97a06b4..36f78ec 100644
--- a/wear/compose/compose-material/src/androidAndroidTest/kotlin/androidx/wear/compose/material/MaterialTest.kt
+++ b/wear/compose/compose-material/src/androidAndroidTest/kotlin/androidx/wear/compose/material/MaterialTest.kt
@@ -111,7 +111,7 @@
return textLayoutResults[0].layoutInput.style
}
-fun assertTextStyleEquals(expectedStyle: TextStyle, actualStyle: TextStyle) {
+fun assertTextTypographyEquals(expectedStyle: TextStyle, actualStyle: TextStyle) {
Assert.assertEquals(expectedStyle.fontSize, actualStyle.fontSize)
Assert.assertEquals(expectedStyle.fontFamily, actualStyle.fontFamily)
Assert.assertEquals(expectedStyle.letterSpacing, actualStyle.letterSpacing)
@@ -187,12 +187,11 @@
internal fun SemanticsNodeInteraction.assertHeightIsEqualTo(
expectedHeight: Dp,
tolerance: Dp = Dp(0.5f)
-):
- SemanticsNodeInteraction {
- return withUnclippedBoundsInRoot {
- it.height.assertIsEqualTo(expectedHeight, "height", tolerance)
- }
+): SemanticsNodeInteraction {
+ return withUnclippedBoundsInRoot {
+ it.height.assertIsEqualTo(expectedHeight, "height", tolerance)
}
+}
private fun SemanticsNodeInteraction.withUnclippedBoundsInRoot(
assertion: (DpRect) -> Unit
diff --git a/wear/compose/compose-material/src/androidAndroidTest/kotlin/androidx/wear/compose/material/MaterialThemeTest.kt b/wear/compose/compose-material/src/androidAndroidTest/kotlin/androidx/wear/compose/material/MaterialThemeTest.kt
index 32c54d7..34a6906 100644
--- a/wear/compose/compose-material/src/androidAndroidTest/kotlin/androidx/wear/compose/material/MaterialThemeTest.kt
+++ b/wear/compose/compose-material/src/androidAndroidTest/kotlin/androidx/wear/compose/material/MaterialThemeTest.kt
@@ -103,7 +103,7 @@
)
}
- assertTextStyleEquals(expectedStyle!!, rule.textStyleOf("Test"))
+ assertTextTypographyEquals(expectedStyle!!, rule.textStyleOf("Test"))
}
@Test
@@ -126,7 +126,7 @@
}
}
- assertTextStyleEquals(override, rule.textStyleOf("Test"))
+ assertTextTypographyEquals(override, rule.textStyleOf("Test"))
}
@Test
@@ -334,9 +334,9 @@
}
}
- assertTextStyleEquals(initialStyle, rule.textStyleOf("Test"))
+ assertTextTypographyEquals(initialStyle, rule.textStyleOf("Test"))
rule.onNodeWithTag("button").performClick()
- assertTextStyleEquals(overrideTextStyle, rule.textStyleOf("Test"))
+ assertTextTypographyEquals(overrideTextStyle, rule.textStyleOf("Test"))
}
private fun verifyBackgroundColorIsDynamic(
@@ -449,8 +449,8 @@
}
}
- assertTextStyleEquals(initialStyle, rule.textStyleOf("Test"))
+ assertTextTypographyEquals(initialStyle, rule.textStyleOf("Test"))
rule.onNodeWithTag("button").performClick()
- assertTextStyleEquals(overrideTextStyle, rule.textStyleOf("Test"))
+ assertTextTypographyEquals(overrideTextStyle, rule.textStyleOf("Test"))
}
}
\ No newline at end of file
diff --git a/wear/compose/compose-material/src/androidAndroidTest/kotlin/androidx/wear/compose/material/SwipeToDismissBoxScreenshotTest.kt b/wear/compose/compose-material/src/androidAndroidTest/kotlin/androidx/wear/compose/material/SwipeToDismissBoxScreenshotTest.kt
new file mode 100644
index 0000000..0d23297
--- /dev/null
+++ b/wear/compose/compose-material/src/androidAndroidTest/kotlin/androidx/wear/compose/material/SwipeToDismissBoxScreenshotTest.kt
@@ -0,0 +1,113 @@
+/*
+ * Copyright 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES 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.wear.compose.material
+
+import android.os.Build
+import androidx.compose.foundation.layout.Box
+import androidx.compose.foundation.layout.size
+import androidx.compose.runtime.CompositionLocalProvider
+import androidx.compose.testutils.assertAgainstGolden
+import androidx.compose.ui.Alignment
+import androidx.compose.ui.Modifier
+import androidx.compose.ui.geometry.Offset
+import androidx.compose.ui.graphics.Color
+import androidx.compose.ui.platform.LocalLayoutDirection
+import androidx.compose.ui.platform.testTag
+import androidx.compose.ui.test.ExperimentalTestApi
+import androidx.compose.ui.test.captureToImage
+import androidx.compose.ui.test.junit4.createComposeRule
+import androidx.compose.ui.test.onNodeWithTag
+import androidx.compose.ui.test.performTouchInput
+import androidx.compose.ui.unit.LayoutDirection
+import androidx.compose.ui.unit.dp
+import androidx.test.ext.junit.runners.AndroidJUnit4
+import androidx.test.filters.MediumTest
+import androidx.test.filters.SdkSuppress
+import androidx.test.screenshot.AndroidXScreenshotTestRule
+import org.junit.Rule
+import org.junit.Test
+import org.junit.rules.TestName
+import org.junit.runner.RunWith
+
+@MediumTest
+@RunWith(AndroidJUnit4::class)
+@SdkSuppress(minSdkVersion = Build.VERSION_CODES.O)
+@OptIn(ExperimentalTestApi::class, ExperimentalWearMaterialApi::class)
+class SwipeToDismissBoxScreenshotTest {
+
+ @get:Rule
+ val rule = createComposeRule()
+
+ @get:Rule
+ val screenshotRule = AndroidXScreenshotTestRule(SCREENSHOT_GOLDEN_PATH)
+
+ @get:Rule
+ val testName = TestName()
+
+ @Test
+ fun swiped_to_right_25_percent_ltr() {
+ verifySwipedScreenshot(LayoutDirection.Ltr, 0.25f)
+ }
+
+ @Test
+ fun swiped_to_right_25_percent_rtl() {
+ verifySwipedScreenshot(LayoutDirection.Rtl, 0.25f)
+ }
+
+ @Test
+ fun swiped_to_right_50_percent_ltr() {
+ verifySwipedScreenshot(LayoutDirection.Ltr, 0.5f)
+ }
+
+ @Test
+ fun swiped_to_right_50_percent_rtl() {
+ verifySwipedScreenshot(LayoutDirection.Rtl, 0.5f)
+ }
+
+ private fun verifySwipedScreenshot(
+ layoutDirection: LayoutDirection,
+ swipedPercentage: Float,
+ ) {
+ rule.setContentWithTheme {
+ CompositionLocalProvider(LocalLayoutDirection provides layoutDirection) {
+ val state = rememberSwipeToDismissBoxState()
+ SwipeToDismissBox(
+ modifier = Modifier.testTag(TEST_TAG).size(106.dp),
+ state = state
+ ) { isBackground ->
+ if (isBackground) {
+ Box(modifier = Modifier.align(Alignment.Center)) {
+ Text(color = Color.White, text = "Background")
+ }
+ } else {
+ Box(modifier = Modifier.align(Alignment.Center)) {
+ Text(color = Color.White, text = "Foreground")
+ }
+ }
+ }
+ }
+ }
+ rule.onNodeWithTag(TEST_TAG).performTouchInput {
+ down(Offset(x = 0f, y = height / 2f))
+ moveTo(Offset(x = width * swipedPercentage, y = height / 2f))
+ }
+
+ rule.onNodeWithTag(TEST_TAG)
+ .captureToImage()
+ .assertAgainstGolden(screenshotRule, testName.methodName)
+ }
+}
\ No newline at end of file
diff --git a/wear/compose/compose-material/src/androidAndroidTest/kotlin/androidx/wear/compose/material/SwipeToDismissBoxTest.kt b/wear/compose/compose-material/src/androidAndroidTest/kotlin/androidx/wear/compose/material/SwipeToDismissBoxTest.kt
index f888497..b8de966 100644
--- a/wear/compose/compose-material/src/androidAndroidTest/kotlin/androidx/wear/compose/material/SwipeToDismissBoxTest.kt
+++ b/wear/compose/compose-material/src/androidAndroidTest/kotlin/androidx/wear/compose/material/SwipeToDismissBoxTest.kt
@@ -67,7 +67,7 @@
state = state,
modifier = Modifier.testTag(TEST_TAG)
) {
- Text("Test")
+ Text("Testing")
}
}
diff --git a/wear/compose/compose-material/src/androidAndroidTest/kotlin/androidx/wear/compose/material/TimeTextTest.kt b/wear/compose/compose-material/src/androidAndroidTest/kotlin/androidx/wear/compose/material/TimeTextTest.kt
new file mode 100644
index 0000000..535e985
--- /dev/null
+++ b/wear/compose/compose-material/src/androidAndroidTest/kotlin/androidx/wear/compose/material/TimeTextTest.kt
@@ -0,0 +1,475 @@
+/*
+ * Copyright 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES 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.wear.compose.material
+
+import android.text.format.DateFormat
+import androidx.compose.runtime.Composable
+import androidx.compose.runtime.mutableStateOf
+import androidx.compose.ui.Modifier
+import androidx.compose.ui.graphics.Color
+import androidx.compose.ui.platform.testTag
+import androidx.compose.ui.test.assertCountEquals
+import androidx.compose.ui.test.assertIsDisplayed
+import androidx.compose.ui.test.junit4.createComposeRule
+import androidx.compose.ui.test.onAllNodesWithTag
+import androidx.compose.ui.test.onNodeWithTag
+import androidx.compose.ui.test.onNodeWithText
+import androidx.compose.ui.text.TextStyle
+import androidx.compose.ui.unit.sp
+import androidx.wear.compose.foundation.BasicCurvedText
+import androidx.wear.compose.material.TimeTextDefaults.CurvedTextSeparator
+import org.junit.Assert.assertEquals
+import org.junit.Rule
+import org.junit.Test
+import java.util.Calendar
+
+@ExperimentalWearMaterialApi
+class TimeTextTest {
+ @get:Rule
+ val rule = createComposeRule()
+
+ @Test
+ fun supports_testtag() {
+ rule.setContentWithTheme {
+ TimeText(
+ modifier = Modifier.testTag(TEST_TAG)
+ )
+ }
+
+ rule.onNodeWithTag(TEST_TAG).assertExists()
+ }
+
+ @Test
+ fun updates_clock_when_source_changes_on_square_device() {
+ val timeState = mutableStateOf("Unchanged")
+
+ rule.setContentWithTheme {
+ ConfiguredShapeScreen(false) {
+ TimeText(
+ modifier = Modifier.testTag(TEST_TAG),
+ timeSource = object : TimeSource {
+ override val currentTime: String
+ @Composable
+ get() = timeState.value
+ },
+ )
+ }
+ }
+ timeState.value = "Changed"
+ rule.onNodeWithText("Changed").assertIsDisplayed()
+ }
+
+ @Test
+ fun updates_clock_when_source_changes_on_round_device() {
+ val timeState = mutableStateOf("Unchanged")
+
+ rule.setContentWithTheme {
+ ConfiguredShapeScreen(true) {
+ TimeText(
+ modifier = Modifier.testTag(TEST_TAG),
+ timeSource = object : TimeSource {
+ override val currentTime: String
+ @Composable
+ get() = timeState.value
+ },
+ )
+ }
+ }
+ timeState.value = "Changed"
+ rule.onNodeWithText("Changed").assertIsDisplayed()
+ }
+
+ @Test
+ fun supports_leading_linear_text_only_on_square_device() {
+ rule.setContentWithTheme {
+ ConfiguredShapeScreen(false) {
+ TimeText(
+ leadingLinearContent = {
+ Text(
+ modifier = Modifier.testTag(LINEAR_ITEM_TAG),
+ text = "Leading content",
+ )
+ },
+ leadingCurvedContent = {
+ BasicCurvedText(
+ modifier = Modifier.testTag(CURVED_ITEM_TAG),
+ text = "Leading content",
+ style = TimeTextDefaults.timeCurvedTextStyle()
+ )
+ }
+ )
+ }
+ }
+
+ rule.onNodeWithTag(LINEAR_ITEM_TAG).assertExists()
+ rule.onNodeWithTag(CURVED_ITEM_TAG).assertDoesNotExist()
+ }
+
+ @Test
+ fun supports_leading_curved_text_only_on_round_device() {
+ rule.setContentWithTheme {
+ ConfiguredShapeScreen(true) {
+ TimeText(
+ leadingLinearContent = {
+ Text(
+ modifier = Modifier.testTag(LINEAR_ITEM_TAG),
+ text = "Leading content",
+ )
+ },
+ leadingCurvedContent = {
+ BasicCurvedText(
+ modifier = Modifier.testTag(CURVED_ITEM_TAG),
+ text = "Leading content",
+ style = TimeTextDefaults.timeCurvedTextStyle()
+ )
+ }
+ )
+ }
+ }
+ rule.onNodeWithTag(LINEAR_ITEM_TAG).assertDoesNotExist()
+ rule.onNodeWithTag(CURVED_ITEM_TAG).assertExists()
+ }
+
+ @Test
+ fun supports_trailing_linear_text_only_on_square_device() {
+ rule.setContentWithTheme {
+ ConfiguredShapeScreen(false) {
+ TimeText(
+ trailingLinearContent = {
+ Text(
+ modifier = Modifier.testTag(LINEAR_ITEM_TAG),
+ text = "Trailing content",
+ )
+ },
+ trailingCurvedContent = {
+ BasicCurvedText(
+ modifier = Modifier.testTag(CURVED_ITEM_TAG),
+ text = "Trailing content",
+ style = TimeTextDefaults.timeCurvedTextStyle()
+ )
+ }
+ )
+ }
+ }
+ rule.onNodeWithTag(LINEAR_ITEM_TAG).assertExists()
+ rule.onNodeWithTag(CURVED_ITEM_TAG).assertDoesNotExist()
+ }
+
+ @Test
+ fun supports_trailing_curved_text_only_on_round_device() {
+ rule.setContentWithTheme {
+ ConfiguredShapeScreen(true) {
+ TimeText(
+ trailingLinearContent = {
+ Text(
+ modifier = Modifier.testTag(LINEAR_ITEM_TAG),
+ text = "Leading content",
+ )
+ },
+ trailingCurvedContent = {
+ BasicCurvedText(
+ modifier = Modifier.testTag(CURVED_ITEM_TAG),
+ text = "Leading content",
+ style = TimeTextDefaults.timeCurvedTextStyle()
+ )
+ }
+ )
+ }
+ }
+ rule.onNodeWithTag(LINEAR_ITEM_TAG).assertDoesNotExist()
+ rule.onNodeWithTag(CURVED_ITEM_TAG).assertExists()
+ }
+
+ @Test
+ fun omits_separator_with_only_time_on_square_device() {
+ rule.setContentWithTheme {
+ ConfiguredShapeScreen(false) {
+ TimeText(
+ textLinearSeparator = {
+ TimeTextDefaults.TextSeparator(
+ modifier = Modifier.testTag(LINEAR_SEPARATOR_ITEM_TAG)
+ )
+ },
+ textCurvedSeparator = {
+ CurvedTextSeparator(
+ modifier = Modifier.testTag(CURVED_SEPARATOR_ITEM_TAG)
+ )
+ }
+ )
+ }
+ }
+ rule.onNodeWithTag(LINEAR_SEPARATOR_ITEM_TAG).assertDoesNotExist()
+ rule.onNodeWithTag(CURVED_SEPARATOR_ITEM_TAG).assertDoesNotExist()
+ }
+
+ @Test
+ fun omits_separator_with_only_time_on_round_device() {
+ rule.setContentWithTheme {
+ ConfiguredShapeScreen(true) {
+ TimeText(
+ textLinearSeparator = {
+ TimeTextDefaults.TextSeparator(
+ modifier = Modifier.testTag(LINEAR_SEPARATOR_ITEM_TAG)
+ )
+ },
+ textCurvedSeparator = {
+ CurvedTextSeparator(
+ modifier = Modifier.testTag(CURVED_SEPARATOR_ITEM_TAG)
+ )
+ }
+ )
+ }
+ }
+ rule.onNodeWithTag(LINEAR_SEPARATOR_ITEM_TAG).assertDoesNotExist()
+ rule.onNodeWithTag(CURVED_SEPARATOR_ITEM_TAG).assertDoesNotExist()
+ }
+
+ @Test
+ fun shows_only_leading_linear_separator_on_square_device() {
+ rule.setContentWithTheme {
+ ConfiguredShapeScreen(false) {
+ TimeText(
+ leadingLinearContent = {
+ Text(
+ text = "Leading content",
+ )
+ },
+ textLinearSeparator = {
+ TimeTextDefaults.TextSeparator(
+ modifier = Modifier.testTag(LINEAR_SEPARATOR_ITEM_TAG)
+ )
+ },
+ textCurvedSeparator = {
+ CurvedTextSeparator(
+ modifier = Modifier.testTag(CURVED_SEPARATOR_ITEM_TAG)
+ )
+ }
+ )
+ }
+ }
+ rule.onNodeWithTag(LINEAR_SEPARATOR_ITEM_TAG).assertExists()
+ rule.onAllNodesWithTag(LINEAR_SEPARATOR_ITEM_TAG).assertCountEquals(1)
+
+ rule.onNodeWithTag(CURVED_SEPARATOR_ITEM_TAG).assertDoesNotExist()
+ }
+
+ @Test
+ fun shows_only_leading_curved_separator_on_round_device() {
+ rule.setContentWithTheme {
+ ConfiguredShapeScreen(true) {
+ TimeText(
+ leadingCurvedContent = {
+ Text(
+ text = "Leading content",
+ )
+ },
+ textLinearSeparator = {
+ TimeTextDefaults.TextSeparator(
+ modifier = Modifier.testTag(LINEAR_SEPARATOR_ITEM_TAG)
+ )
+ },
+ textCurvedSeparator = {
+ CurvedTextSeparator(
+ modifier = Modifier.testTag(CURVED_SEPARATOR_ITEM_TAG)
+ )
+ }
+ )
+ }
+ }
+ rule.onNodeWithTag(LINEAR_SEPARATOR_ITEM_TAG).assertDoesNotExist()
+ rule.onNodeWithTag(CURVED_SEPARATOR_ITEM_TAG).assertExists()
+ rule.onAllNodesWithTag(CURVED_SEPARATOR_ITEM_TAG).assertCountEquals(1)
+ }
+
+ @Test
+ fun shows_only_trailing_linear_separator_on_square_device() {
+ rule.setContentWithTheme {
+ ConfiguredShapeScreen(false) {
+ TimeText(
+ trailingLinearContent = {
+ Text(
+ text = "Trailing content",
+ )
+ },
+ textLinearSeparator = {
+ TimeTextDefaults.TextSeparator(
+ modifier = Modifier.testTag(LINEAR_SEPARATOR_ITEM_TAG)
+ )
+ },
+ textCurvedSeparator = {
+ CurvedTextSeparator(
+ modifier = Modifier.testTag(CURVED_SEPARATOR_ITEM_TAG)
+ )
+ }
+ )
+ }
+ }
+ rule.onNodeWithTag(LINEAR_SEPARATOR_ITEM_TAG).assertExists()
+ rule.onAllNodesWithTag(LINEAR_SEPARATOR_ITEM_TAG).assertCountEquals(1)
+
+ rule.onNodeWithTag(CURVED_SEPARATOR_ITEM_TAG).assertDoesNotExist()
+ }
+
+ @Test
+ fun shows_only_trailing_curved_separator_on_round_device() {
+ rule.setContentWithTheme {
+ ConfiguredShapeScreen(true) {
+ TimeText(
+ trailingCurvedContent = {
+ BasicCurvedText(
+ text = "Trailing content",
+ style = TimeTextDefaults.timeCurvedTextStyle()
+ )
+ },
+ textLinearSeparator = {
+ TimeTextDefaults.TextSeparator(
+ modifier = Modifier.testTag(LINEAR_SEPARATOR_ITEM_TAG)
+ )
+ },
+ textCurvedSeparator = {
+ CurvedTextSeparator(
+ modifier = Modifier.testTag(CURVED_SEPARATOR_ITEM_TAG)
+ )
+ }
+ )
+ }
+ }
+ rule.onNodeWithTag(LINEAR_SEPARATOR_ITEM_TAG).assertDoesNotExist()
+ rule.onNodeWithTag(CURVED_SEPARATOR_ITEM_TAG).assertExists()
+ rule.onAllNodesWithTag(CURVED_SEPARATOR_ITEM_TAG).assertCountEquals(1)
+ }
+
+ @Test
+ fun shows_leading_and_trailing_linear_separators_on_square_device() {
+ rule.setContentWithTheme {
+ ConfiguredShapeScreen(false) {
+ TimeText(
+ leadingLinearContent = {
+ Text(
+ text = "Leading content",
+ )
+ },
+ trailingLinearContent = {
+ Text(
+ text = "Trailing content",
+ )
+ },
+ textLinearSeparator = {
+ TimeTextDefaults.TextSeparator(
+ modifier = Modifier.testTag(LINEAR_SEPARATOR_ITEM_TAG)
+ )
+ },
+ textCurvedSeparator = {
+ CurvedTextSeparator(
+ modifier = Modifier.testTag(CURVED_SEPARATOR_ITEM_TAG)
+ )
+ }
+ )
+ }
+ }
+ rule.onAllNodesWithTag(LINEAR_SEPARATOR_ITEM_TAG).assertCountEquals(2)
+ rule.onNodeWithTag(CURVED_SEPARATOR_ITEM_TAG).assertDoesNotExist()
+ }
+
+ @Test
+ fun shows_leading_and_trailing_curved_separators_on_round_device() {
+ rule.setContentWithTheme {
+ ConfiguredShapeScreen(true) {
+ TimeText(
+ leadingCurvedContent = {
+ BasicCurvedText(
+ text = "Leading content",
+ style = TimeTextDefaults.timeCurvedTextStyle()
+ )
+ },
+ trailingCurvedContent = {
+ BasicCurvedText(
+ text = "Trailing content",
+ style = TimeTextDefaults.timeCurvedTextStyle()
+ )
+ },
+ textLinearSeparator = {
+ TimeTextDefaults.TextSeparator(
+ modifier = Modifier.testTag(LINEAR_SEPARATOR_ITEM_TAG)
+ )
+ },
+ textCurvedSeparator = {
+ CurvedTextSeparator(
+ modifier = Modifier.testTag(CURVED_SEPARATOR_ITEM_TAG)
+ )
+ }
+ )
+ }
+ }
+ rule.onNodeWithTag(LINEAR_SEPARATOR_ITEM_TAG).assertDoesNotExist()
+ rule.onAllNodesWithTag(CURVED_SEPARATOR_ITEM_TAG).assertCountEquals(2)
+ }
+
+ // TODO: currently testing on round device is problematic as there're no appropriate semantics
+ // for CurvedText
+ @Test
+ fun changes_timeTextStyle_on_square_device() {
+ val timeState = mutableStateOf("testState")
+
+ val testTextStyle = TextStyle(
+ color = Color.Green,
+ background = Color.Black,
+ fontSize = 20.sp
+ )
+ rule.setContentWithTheme {
+ ConfiguredShapeScreen(false) {
+ TimeText(
+ timeSource = object : TimeSource {
+ override val currentTime: String
+ @Composable
+ get() = timeState.value
+ },
+ timeTextStyle = testTextStyle
+ )
+ }
+ }
+ val actualStyle = rule.textStyleOf(timeState.value)
+ assertEquals(testTextStyle.color, actualStyle.color)
+ assertEquals(testTextStyle.background, actualStyle.background)
+ assertEquals(testTextStyle.fontSize, actualStyle.fontSize)
+ }
+}
+
+@ExperimentalWearMaterialApi
+class TimeSourceTest {
+ @get:Rule
+ val rule = createComposeRule()
+
+ @Test
+ fun formats_current_time() {
+ val currentTimeInMillis = 1631544258000L // 2021-09-13 14:44:18
+ val format = "HH:mm:ss"
+ val currentCalendar = Calendar.getInstance().apply { timeInMillis = currentTimeInMillis }
+ val convertedTime = DateFormat.format(format, currentCalendar).toString()
+
+ var actualTime: String? = null
+ rule.setContentWithTheme {
+ actualTime = currentTime({ currentTimeInMillis }, format).value
+ }
+ assertEquals(convertedTime, actualTime)
+ }
+}
+
+private const val LINEAR_ITEM_TAG = "LINEAR_ITEM_TAG"
+private const val CURVED_ITEM_TAG = "CURVED_ITEM_TAG"
+private const val LINEAR_SEPARATOR_ITEM_TAG = "LINEAR_SEPARATOR_ITEM_TAG"
+private const val CURVED_SEPARATOR_ITEM_TAG = "CURVED_SEPARATOR_ITEM_TAG"
\ No newline at end of file
diff --git a/wear/compose/compose-material/src/androidMain/kotlin/androidx/wear/compose/material/TimeUpdateController.kt b/wear/compose/compose-material/src/androidMain/kotlin/androidx/wear/compose/material/DefaultTimeSource.kt
similarity index 88%
rename from wear/compose/compose-material/src/androidMain/kotlin/androidx/wear/compose/material/TimeUpdateController.kt
rename to wear/compose/compose-material/src/androidMain/kotlin/androidx/wear/compose/material/DefaultTimeSource.kt
index 5b01cdd..6b81cb5 100644
--- a/wear/compose/compose-material/src/androidMain/kotlin/androidx/wear/compose/material/TimeUpdateController.kt
+++ b/wear/compose/compose-material/src/androidMain/kotlin/androidx/wear/compose/material/DefaultTimeSource.kt
@@ -21,6 +21,7 @@
import android.content.Intent
import android.content.IntentFilter
import android.text.format.DateFormat
+import androidx.annotation.VisibleForTesting
import androidx.compose.runtime.Composable
import androidx.compose.runtime.DisposableEffect
import androidx.compose.runtime.State
@@ -34,8 +35,18 @@
import java.util.Calendar
import java.util.Locale
+@ExperimentalWearMaterialApi
+internal actual class DefaultTimeSource actual constructor(timeFormat: String) : TimeSource {
+ private val _timeFormat = timeFormat
+
+ override val currentTime: String
+ @Composable
+ get() = currentTime({ currentTimeMillis() }, _timeFormat).value
+}
+
@Composable
-internal actual fun currentTime(
+@VisibleForTesting(otherwise = VisibleForTesting.PRIVATE)
+internal fun currentTime(
time: () -> Long,
timeFormat: String
): State<String> {
diff --git a/wear/compose/compose-material/src/androidMain/kotlin/androidx/wear/compose/material/Resources.android.kt b/wear/compose/compose-material/src/androidMain/kotlin/androidx/wear/compose/material/Resources.android.kt
index c336fe1..38b945e 100644
--- a/wear/compose/compose-material/src/androidMain/kotlin/androidx/wear/compose/material/Resources.android.kt
+++ b/wear/compose/compose-material/src/androidMain/kotlin/androidx/wear/compose/material/Resources.android.kt
@@ -19,13 +19,12 @@
import android.text.format.DateFormat
import androidx.compose.runtime.Composable
import androidx.compose.ui.graphics.painter.Painter
+import androidx.compose.ui.platform.LocalConfiguration
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.res.painterResource
@Composable
-internal actual fun isRoundDevice(): Boolean {
- return LocalContext.current.resources.configuration.isScreenRound
-}
+internal actual fun isRoundDevice(): Boolean = LocalConfiguration.current.isScreenRound
@Composable
internal actual fun imageResource(res: String): Painter {
diff --git a/wear/compose/compose-material/src/commonMain/kotlin/androidx/wear/compose/material/CurvedText.kt b/wear/compose/compose-material/src/commonMain/kotlin/androidx/wear/compose/material/CurvedText.kt
new file mode 100644
index 0000000..86b779e
--- /dev/null
+++ b/wear/compose/compose-material/src/commonMain/kotlin/androidx/wear/compose/material/CurvedText.kt
@@ -0,0 +1,100 @@
+/*
+ * Copyright 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES 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.wear.compose.material
+
+import androidx.compose.runtime.Composable
+import androidx.compose.ui.Modifier
+import androidx.compose.ui.graphics.Color
+import androidx.compose.ui.graphics.takeOrElse
+import androidx.compose.ui.text.TextStyle
+import androidx.compose.ui.unit.Dp
+import androidx.compose.ui.unit.TextUnit
+import androidx.compose.ui.unit.dp
+import androidx.wear.compose.foundation.ArcPaddingValues
+import androidx.wear.compose.foundation.BasicCurvedText
+import androidx.wear.compose.foundation.CurvedTextStyle
+import androidx.wear.compose.foundation.CurvedRowScope
+
+/**
+ * CurvedText is a component allowing developers to easily write curved text following
+ * the curvature a circle (usually at the edge of a circular screen).
+ * CurvedText can be only created within the CurvedRow to ensure the best experience, like being
+ * able to specify to positioning.
+ *
+ * The default [style] uses the [LocalTextStyle] provided by the [MaterialTheme] / components,
+ * converting it to a [CurvedTextStyle]. Note that not all parameters are used by [CurvedText].
+ *
+ * If you are setting your own style, you may want to consider first retrieving [LocalTextStyle],
+ * and using [TextStyle.copy] to keep any theme defined attributes, only modifying the specific
+ * attributes you want to override, then convert to [CurvedTextStyle]
+ *
+ * For ease of use, commonly used parameters from [CurvedTextStyle] are also present here. The
+ * order of precedence is as follows:
+ * - If a parameter is explicitly set here (i.e, it is _not_ `null` or [TextUnit.Unspecified]),
+ * then this parameter will always be used.
+ * - If a parameter is _not_ set, (`null` or [TextUnit.Unspecified]), then the corresponding value
+ * from [style] will be used instead.
+ *
+ * Additionally, for [color], if [color] is not set, and [style] does not have a color, then
+ * [LocalContentColor] will be used with an alpha of [LocalContentAlpha]- this allows this
+ * [CurvedText] or element containing this [CurvedText] to adapt to different background colors and
+ * still maintain contrast and accessibility.
+ *
+ * @sample androidx.wear.compose.material.samples.CurvedTextDemo
+ *
+ * @param text The text to display
+ * @param color [Color] to apply to the text. If [Color.Unspecified], and [style] has no color set,
+ * this will be [LocalContentColor].
+ * @param fontSize The size of glyphs to use when painting the text. See [TextStyle.fontSize].
+ * @param style Specified the style to use.
+ * @param background The background color for the text.
+ * @param clockwise The direction the text follows (default is true). Usually text at the top of the
+ * screen goes clockwise, and text at the bottom goes counterclockwise.
+ * @param contentArcPadding Allows to specify additional space along each "edge" of the content in
+ * [Dp] see [ArcPaddingValues]
+ */
+@Composable
+fun CurvedRowScope.CurvedText(
+ text: String,
+ modifier: Modifier = Modifier,
+ color: Color = Color.Unspecified,
+ background: Color = Color.Unspecified,
+ fontSize: TextUnit = TextUnit.Unspecified,
+ style: CurvedTextStyle = CurvedTextStyle(LocalTextStyle.current),
+ clockwise: Boolean = true,
+ contentArcPadding: ArcPaddingValues = ArcPaddingValues(0.dp),
+) {
+ val textColor = color.takeOrElse {
+ style.color.takeOrElse {
+ LocalContentColor.current.copy(alpha = LocalContentAlpha.current)
+ }
+ }
+ val mergedStyle = style.merge(
+ CurvedTextStyle(
+ color = textColor,
+ fontSize = fontSize,
+ background = background
+ )
+ )
+ BasicCurvedText(
+ text = text,
+ style = mergedStyle,
+ modifier = modifier,
+ clockwise = clockwise,
+ contentArcPadding = contentArcPadding
+ )
+}
\ No newline at end of file
diff --git a/wear/compose/compose-material/src/commonMain/kotlin/androidx/wear/compose/material/Scaffold.kt b/wear/compose/compose-material/src/commonMain/kotlin/androidx/wear/compose/material/Scaffold.kt
index af57916..df52ff1 100644
--- a/wear/compose/compose-material/src/commonMain/kotlin/androidx/wear/compose/material/Scaffold.kt
+++ b/wear/compose/compose-material/src/commonMain/kotlin/androidx/wear/compose/material/Scaffold.kt
@@ -58,7 +58,6 @@
modifier: Modifier = Modifier,
vignette: @Composable (() -> Unit)? = null,
positionIndicator: @Composable (() -> Unit)? = null,
- // TODO(b/196386195): Replace this with default TimeText when it has been committed
timeText: @Composable (() -> Unit)? = null,
content: @Composable () -> Unit
) {
diff --git a/wear/compose/compose-material/src/commonMain/kotlin/androidx/wear/compose/material/SwipeToDismissBox.kt b/wear/compose/compose-material/src/commonMain/kotlin/androidx/wear/compose/material/SwipeToDismissBox.kt
index 7a492e6..200a3b4 100644
--- a/wear/compose/compose-material/src/commonMain/kotlin/androidx/wear/compose/material/SwipeToDismissBox.kt
+++ b/wear/compose/compose-material/src/commonMain/kotlin/androidx/wear/compose/material/SwipeToDismissBox.kt
@@ -16,27 +16,36 @@
package androidx.wear.compose.material
+import androidx.compose.animation.core.Animatable
import androidx.compose.animation.core.AnimationSpec
+import androidx.compose.animation.core.SpringSpec
import androidx.compose.foundation.background
import androidx.compose.foundation.gestures.Orientation
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.BoxScope
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.offset
+import androidx.compose.foundation.shape.CircleShape
import androidx.compose.runtime.Composable
+import androidx.compose.runtime.LaunchedEffect
+import androidx.compose.runtime.Stable
import androidx.compose.runtime.getValue
import androidx.compose.runtime.key
import androidx.compose.runtime.mutableStateOf
-import androidx.compose.runtime.setValue
import androidx.compose.runtime.remember
import androidx.compose.runtime.saveable.Saver
import androidx.compose.runtime.saveable.rememberSaveable
-import androidx.compose.runtime.Stable
+import androidx.compose.runtime.setValue
import androidx.compose.ui.Modifier
+import androidx.compose.ui.draw.alpha
+import androidx.compose.ui.draw.clip
+import androidx.compose.ui.draw.scale
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.layout.onSizeChanged
import androidx.compose.ui.unit.IntOffset
+import kotlin.math.PI
import kotlin.math.roundToInt
+import kotlin.math.sin
/**
* Wear Material [SwipeToDismissBox] that handles the swipe-to-dismiss gesture. Takes a single
@@ -51,10 +60,9 @@
*
* @param state State containing information about ongoing swipe or animation.
* @param modifier Optional [Modifier] for this component.
- * @param scrimColor Optional [Color] used for the scrim over the background and
- * content composables during the swipe gesture. The alpha on the color is ignored,
- * instead being set individually for each of the background and content layers in order to
- * indicate to the user which state will result if the gesture is released.
+ * @param backgroundScrimColor Color for background scrim
+ * @param contentScrimColor Optional [Color] used for the scrim over the
+ * content composable during the swipe gesture.
* @param backgroundKey Optional [key] which identifies the content currently composed in
* the [content] block when isBackground == true. Provide the backgroundKey if your background
* content will be displayed as a foreground after the swipe animation ends
@@ -74,7 +82,8 @@
fun SwipeToDismissBox(
state: SwipeToDismissBoxState,
modifier: Modifier = Modifier,
- scrimColor: Color = MaterialTheme.colors.surface,
+ backgroundScrimColor: Color = MaterialTheme.colors.background,
+ contentScrimColor: Color = contentColorFor(backgroundScrimColor),
backgroundKey: Any = SwipeToDismissBoxDefaults.BackgroundKey,
contentKey: Any = SwipeToDismissBoxDefaults.ContentKey,
hasBackground: Boolean = true,
@@ -96,19 +105,65 @@
)
) {
val offsetPx = state.offset.value.roundToInt()
- // This temporary variable added to workaround an error
- // thrown by the compose runtime - see b/199136503, avoids "Invalid Start Index" exception.
- val pxModifier = Modifier.offset { IntOffset(offsetPx, 0) }.fillMaxSize()
+ val dismissAnimatable = remember { Animatable(0f) }
+
+ LaunchedEffect(state.isAnimationRunning) {
+ if (state.targetValue == SwipeDismissTarget.Dismissal) {
+ dismissAnimatable.animateTo(1f, SpringSpec())
+ } else {
+ // because SwipeToDismiss remains alive, it worth resetting animation to 0
+ // when [targetValue] becomes [Original] again
+ dismissAnimatable.snapTo(0f)
+ }
+ }
+
+ val squeezeMotion = SqueezeMotion(offsetPx, maxWidth)
+
+ val contentForegroundModifier =
+ Modifier.offset { IntOffset(squeezeMotion.contentOffset, 0) }
+ .fillMaxSize()
+ .scale(squeezeMotion.scale(dismissAnimatable.value))
+ .then(
+ if (isRoundDevice() && squeezeMotion.contentOffset > 0) {
+ Modifier.clip(CircleShape)
+ } else {
+ Modifier
+ }
+ )
+ .alpha(1 - dismissAnimatable.value)
+ .background(backgroundScrimColor)
+
+ val contentBackgroundModifier = Modifier.fillMaxSize()
+
+ val scrimForegroundModifier = Modifier.background(
+ contentScrimColor.copy(alpha = squeezeMotion.contentScrimAlpha)
+ ).fillMaxSize()
+
+ val scrimBackgroundModifier = Modifier.matchParentSize()
+ .background(
+ backgroundScrimColor
+ .copy(
+ alpha = squeezeMotion.backgroundScrimAlpha(
+ dismissAnimatable.value
+ )
+ )
+ )
+
repeat(2) {
val isBackground = it == 0
- // TODO(b/193606660): Add animations that follow after swipe confirmation.
- val scrimAlpha =
- if (state.targetValue == SwipeDismissTarget.Original) {
- if (isBackground) SwipeStartedBackgroundAlpha else SwipeStartedContentAlpha
- } else {
- if (isBackground) SwipeConfirmedBackgroundAlpha else SwipeConfirmedContentAlpha
- }
- val contentModifier = if (isBackground) Modifier.fillMaxSize() else pxModifier
+
+ val contentModifier = if (isBackground) {
+ contentBackgroundModifier
+ } else {
+ contentForegroundModifier
+ }
+
+ val scrimModifier = if (isBackground) {
+ scrimBackgroundModifier
+ } else {
+ scrimForegroundModifier
+ }
+
key(if (isBackground) backgroundKey else contentKey) {
if (!isBackground || (hasBackground && offsetPx > 0)) {
Box(contentModifier) {
@@ -117,11 +172,7 @@
// within the content composable has the same call stack which is used
// as part of the hash identity for saveable state.
content(isBackground)
- Box(
- modifier = Modifier
- .matchParentSize()
- .background(scrimColor.copy(alpha = scrimAlpha))
- )
+ Box(modifier = scrimModifier)
}
}
}
@@ -129,12 +180,79 @@
}
}
+/**
+ * A class which is responsible for squeezing animation and all computations related to it
+ */
+private class SqueezeMotion(
+ private val offsetPx: Int,
+ private val maxWidth: Float
+) {
+ private val scaleDelta = 0.2f
+ private val dismissScaleDelta = 0.05f
+ private val offsetFactor = scaleDelta / 2
+ private val contentScrimMaxAlpha = 0.07f
+ private val backgroundScrimMinAlpha = 0.65f
+
+ private val progress = calculateProgress(offsetPx.toFloat(), maxWidth)
+
+ /**
+ * [scale] can change from 1 to 1-[scaleDelta] - [dismissScaleDelta]
+ * As [progress] goes from 0 to 1 and [finalAnimationProgress] from 0 to 1,
+ * [scale] decreases accordingly up to a 1 - [scaleDelta] - [dismissScaleDelta]
+ */
+ fun scale(finalAnimationProgress: Float): Float =
+ (1.0 - progress * scaleDelta - finalAnimationProgress * dismissScaleDelta).toFloat()
+
+ /**
+ * As [progress] goes from 0 to 1, [contentOffset] changes from 0 to maxWidth
+ * mutiplied by [offsetFactor].
+ * If [offsetPx] negative ( <= 0) it remains the same.
+ * This helps to have a resistance animation if page is swiped to the opposite
+ * direction.
+ */
+ val contentOffset: Int
+ get() = if (offsetPx > 0)
+ (maxWidth * progress * offsetFactor).toInt()
+ else
+ offsetPx
+
+ /**
+ * As [progress] goes from 0 to 1, [contentScrimAlpha] changes from 0%
+ * to [contentScrimMaxAlpha].
+ */
+ val contentScrimAlpha: Float
+ get() = contentScrimMaxAlpha * progress
+
+ /**
+ * As [progress] goes from 0 to 1, [backgroundScrimAlpha] is decreasing from 100% to
+ * [backgroundScrimMinAlpha] value. [finalAnimationProgress] makes background completely
+ * transparent by changing its value from [backgroundScrimMinAlpha] to 0.
+ */
+ fun backgroundScrimAlpha(finalAnimationProgress: Float): Float =
+ 1 - (1 - backgroundScrimMinAlpha) * progress -
+ backgroundScrimMinAlpha * finalAnimationProgress
+
+ /**
+ * Computes a progress, which is in range from 0 to 1. As offset value changes from 0 to basis,
+ * the progress changes by sin function
+ */
+ private fun calculateProgress(
+ offset: Float,
+ basis: Float
+ ): Float = if (offset > 0)
+ sin((offset / basis).coerceIn(-1f, 1f) * PI.toFloat() / 2)
+ else 0f
+}
+
@Stable
/**
* State for [SwipeToDismissBox].
*
* TODO(b/194492134): extend API to include shortcuts for status and actions like dismissing
* the screen.
+ *
+ * @param animationSpec The default animation that will be used to animate to a new state.
+ * @param confirmStateChange Optional callback invoked to confirm or veto a pending state change.
*/
@ExperimentalWearMaterialApi
class SwipeToDismissBoxState(
diff --git a/wear/compose/compose-material/src/commonMain/kotlin/androidx/wear/compose/material/TimeText.kt b/wear/compose/compose-material/src/commonMain/kotlin/androidx/wear/compose/material/TimeText.kt
index 5a3ec39..bd8576f 100644
--- a/wear/compose/compose-material/src/commonMain/kotlin/androidx/wear/compose/material/TimeText.kt
+++ b/wear/compose/compose-material/src/commonMain/kotlin/androidx/wear/compose/material/TimeText.kt
@@ -22,8 +22,6 @@
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.padding
import androidx.compose.runtime.Composable
-import androidx.compose.runtime.State
-import androidx.compose.runtime.getValue
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
@@ -37,6 +35,7 @@
import androidx.wear.compose.foundation.CurvedTextStyle
import androidx.wear.compose.material.TimeTextDefaults.CurvedTextSeparator
import androidx.wear.compose.material.TimeTextDefaults.TextSeparator
+import androidx.wear.compose.material.TimeTextDefaults.timeFormat
/**
* Layout to show the current time and a label at the top of the screen.
@@ -55,12 +54,8 @@
* The full customization for square and round devices can be checked here:
* @sample androidx.wear.compose.material.samples.TimeTextWithCustomSeparator
*
- * Clock format can also be replaced by changing [timeFormat]:
- * @sample androidx.wear.compose.material.samples.TimeTextWithFullDateAndTimeFormat
- *
* @param modifier Current modifier.
- * @param timeMillis Retrieves the current time in milliseconds.
- * @param timeFormat Format for showing time.
+ * @param timeSource [TimeSource] which retrieves the current time.
* @param timeTextStyle Optional textStyle for the time text itself
* @param contentPadding The spacing values between the container and the content
* @param leadingLinearContent a slot before the time which is used only on Square screens
@@ -74,8 +69,7 @@
@Composable
fun TimeText(
modifier: Modifier = Modifier,
- timeMillis: () -> Long = { currentTimeMillis() },
- timeFormat: String = TimeTextDefaults.timeFormat(),
+ timeSource: TimeSource = TimeTextDefaults.timeSource(timeFormat()),
timeTextStyle: TextStyle = TimeTextDefaults.timeTextStyle(),
contentPadding: PaddingValues = TimeTextDefaults.ContentPadding,
leadingLinearContent: (@Composable () -> Unit)? = null,
@@ -84,11 +78,11 @@
trailingCurvedContent: (@Composable CurvedRowScope.() -> Unit)? = null,
textLinearSeparator: @Composable () -> Unit = { TextSeparator(textStyle = timeTextStyle) },
textCurvedSeparator: @Composable CurvedRowScope.() -> Unit = {
- this.CurvedTextSeparator(CurvedTextStyle(timeTextStyle))
+ CurvedTextSeparator(curvedTextStyle = CurvedTextStyle(timeTextStyle))
},
) {
- val timeText by currentTime(timeMillis, timeFormat)
+ val timeText = timeSource.currentTime
if (isRoundDevice()) {
CurvedRow(modifier.padding(contentPadding)) {
@@ -98,7 +92,7 @@
}
BasicCurvedText(
text = timeText,
- CurvedTextStyle(timeTextStyle)
+ style = CurvedTextStyle(timeTextStyle)
)
trailingCurvedContent?.let {
textCurvedSeparator()
@@ -200,8 +194,8 @@
/**
* A default implementation of Separator shown between trailing/leading content and the time
* on square screens
- * @param textStyle A [TextStyle] for the separator
* @param modifier A default modifier for the separator
+ * @param textStyle A [TextStyle] for the separator
* @param contentPadding The spacing values between the container and the separator
*/
@Composable
@@ -220,24 +214,44 @@
/**
* A default implementation of Separator shown between trailing/leading content and the time
* on round screens
+ * @param modifier Current modifier.
* @param curvedTextStyle A [CurvedTextStyle] for the separator
* @param contentArcPadding A [ArcPaddingValues] for the separator text
*/
@Composable
public fun CurvedRowScope.CurvedTextSeparator(
+ modifier: Modifier = Modifier,
curvedTextStyle: CurvedTextStyle = timeCurvedTextStyle(),
contentArcPadding: ArcPaddingValues = ArcPaddingValues(angular = 4.dp)
) {
BasicCurvedText(
+ modifier = modifier,
text = "·",
contentArcPadding = contentArcPadding,
style = curvedTextStyle
)
}
+
+ /**
+ * A default implementation of [TimeSource].
+ * @param timeFormat Param for formatting time
+ */
+ fun timeSource(timeFormat: String): TimeSource = DefaultTimeSource(timeFormat)
}
-@Composable
-internal expect fun currentTime(
- time: () -> Long,
- timeFormat: String
-): State<String>
+@ExperimentalWearMaterialApi
+internal expect class DefaultTimeSource(timeFormat: String) : TimeSource
+
+/**
+ * An interface which is responsible for retrieving time and formatting it.
+ */
+@ExperimentalWearMaterialApi
+public interface TimeSource {
+
+ /**
+ * A method responsible for returning updated time string.
+ * @return Formatted time string.
+ */
+ val currentTime: String
+ @Composable get
+}
diff --git a/wear/compose/compose-material/src/desktopMain/kotlin/androidx/wear/compose/material/TimeUpdateController.kt b/wear/compose/compose-material/src/desktopMain/kotlin/androidx/wear/compose/material/DefaultTimeSource.kt
similarity index 67%
rename from wear/compose/compose-material/src/desktopMain/kotlin/androidx/wear/compose/material/TimeUpdateController.kt
rename to wear/compose/compose-material/src/desktopMain/kotlin/androidx/wear/compose/material/DefaultTimeSource.kt
index d85e429..8bcb6a3 100644
--- a/wear/compose/compose-material/src/desktopMain/kotlin/androidx/wear/compose/material/TimeUpdateController.kt
+++ b/wear/compose/compose-material/src/desktopMain/kotlin/androidx/wear/compose/material/DefaultTimeSource.kt
@@ -17,18 +17,11 @@
package androidx.wear.compose.material
import androidx.compose.runtime.Composable
-import androidx.compose.runtime.State
-import androidx.compose.runtime.derivedStateOf
-import androidx.compose.runtime.remember
-@Composable
-internal actual fun currentTime(
- time: () -> Long,
- timeFormat: String
-): State<String> {
+@ExperimentalWearMaterialApi
+internal actual class DefaultTimeSource actual constructor(timeFormat: String) : TimeSource {
- val timeText = remember {
- derivedStateOf { "Test time" }
- }
- return timeText
+ override val currentTime: String
+ @Composable
+ get() = "Test time"
}
diff --git a/wear/compose/compose-navigation/src/main/java/androidx/wear/compose/navigation/SwipeDismissableNavHostController.kt b/wear/compose/compose-navigation/src/main/java/androidx/wear/compose/navigation/SwipeDismissableNavHostController.kt
index 9d9bea4..7be26ad 100644
--- a/wear/compose/compose-navigation/src/main/java/androidx/wear/compose/navigation/SwipeDismissableNavHostController.kt
+++ b/wear/compose/compose-navigation/src/main/java/androidx/wear/compose/navigation/SwipeDismissableNavHostController.kt
@@ -20,7 +20,6 @@
import androidx.compose.runtime.remember
import androidx.navigation.NavHostController
import androidx.navigation.compose.rememberNavController
-import androidx.navigation.plusAssign
import androidx.wear.compose.material.ExperimentalWearMaterialApi
/**
@@ -30,7 +29,5 @@
@Composable
@ExperimentalWearMaterialApi
public fun rememberSwipeDismissableNavController(): NavHostController {
- return rememberNavController().apply {
- navigatorProvider += remember(this) { WearNavigator() }
- }
+ return rememberNavController(remember { WearNavigator() })
}
diff --git a/wear/compose/integration-tests/demos/src/main/java/androidx/wear/compose/integration/demos/CurvedRowDemo.kt b/wear/compose/integration-tests/demos/src/main/java/androidx/wear/compose/integration/demos/CurvedRowDemo.kt
index 2cafab1..3fb525d 100644
--- a/wear/compose/integration-tests/demos/src/main/java/androidx/wear/compose/integration/demos/CurvedRowDemo.kt
+++ b/wear/compose/integration-tests/demos/src/main/java/androidx/wear/compose/integration/demos/CurvedRowDemo.kt
@@ -163,7 +163,7 @@
}
@Composable
-fun CurvedTextDemo() {
+fun BasicCurvedTextDemo() {
CurvedRow(modifier = Modifier.fillMaxSize()) {
SeparatorBlock()
BasicCurvedText(
diff --git a/wear/compose/integration-tests/demos/src/main/java/androidx/wear/compose/integration/demos/FoundationDemos.kt b/wear/compose/integration-tests/demos/src/main/java/androidx/wear/compose/integration/demos/FoundationDemos.kt
index 97e04ab..54102a5 100644
--- a/wear/compose/integration-tests/demos/src/main/java/androidx/wear/compose/integration/demos/FoundationDemos.kt
+++ b/wear/compose/integration-tests/demos/src/main/java/androidx/wear/compose/integration/demos/FoundationDemos.kt
@@ -25,7 +25,7 @@
ComposableDemo("Curved Row") { CurvedRowDemo() },
ComposableDemo("Simple") { SimpleCurvedRow() },
ComposableDemo("Alignment") { CurvedRowAlignmentDemo() },
- ComposableDemo("Curved Text") { CurvedTextDemo() },
+ ComposableDemo("Curved Text") { BasicCurvedTextDemo() },
ComposableDemo("Curved and Normal Text") { CurvedAndNormalText() },
),
)
diff --git a/wear/compose/integration-tests/demos/src/main/java/androidx/wear/compose/integration/demos/MaterialDemos.kt b/wear/compose/integration-tests/demos/src/main/java/androidx/wear/compose/integration/demos/MaterialDemos.kt
index 482acbe..8079ed5 100644
--- a/wear/compose/integration-tests/demos/src/main/java/androidx/wear/compose/integration/demos/MaterialDemos.kt
+++ b/wear/compose/integration-tests/demos/src/main/java/androidx/wear/compose/integration/demos/MaterialDemos.kt
@@ -19,6 +19,7 @@
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.wear.compose.material.ExperimentalWearMaterialApi
+import androidx.wear.compose.material.samples.CurvedTextDemo
import androidx.wear.compose.material.samples.ScalingLazyColumnWithHeaders
import androidx.wear.compose.material.samples.ScalingLazyColumnWithHeadersReversed
import androidx.wear.compose.material.samples.SimpleScaffoldWithScrollIndicator
@@ -70,6 +71,9 @@
ComposableDemo("Clock with full date and time format") {
TimeTextWithFullDateAndTimeFormat()
},
+ ComposableDemo("Clock with padding") {
+ TimeTextWithPadding()
+ },
)
),
DemoCategory(
@@ -119,5 +123,6 @@
},
)
),
+ ComposableDemo("Curved Text") { CurvedTextDemo() },
),
)
diff --git a/wear/compose/integration-tests/demos/src/main/java/androidx/wear/compose/integration/demos/TimeTextDemo.kt b/wear/compose/integration-tests/demos/src/main/java/androidx/wear/compose/integration/demos/TimeTextDemo.kt
index 4a042d2..fbaf6253 100644
--- a/wear/compose/integration-tests/demos/src/main/java/androidx/wear/compose/integration/demos/TimeTextDemo.kt
+++ b/wear/compose/integration-tests/demos/src/main/java/androidx/wear/compose/integration/demos/TimeTextDemo.kt
@@ -16,8 +16,10 @@
package androidx.wear.compose.integration.demos
+import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.runtime.Composable
import androidx.compose.ui.graphics.Color
+import androidx.compose.ui.unit.dp
import androidx.wear.compose.foundation.BasicCurvedText
import androidx.wear.compose.material.ExperimentalWearMaterialApi
import androidx.wear.compose.material.Text
@@ -98,3 +100,35 @@
}
)
}
+
+@OptIn(ExperimentalWearMaterialApi::class)
+@Composable
+fun TimeTextWithPadding() {
+ TimeText(
+ leadingLinearContent = {
+ Text(
+ text = "Leading content",
+ style = TimeTextDefaults.timeTextStyle(color = Color.Green)
+ )
+ },
+ leadingCurvedContent = {
+ BasicCurvedText(
+ text = "Leading content",
+ style = TimeTextDefaults.timeCurvedTextStyle(color = Color.Green)
+ )
+ },
+ trailingLinearContent = {
+ Text(
+ text = "Trailing content",
+ style = TimeTextDefaults.timeTextStyle(color = Color.Yellow)
+ )
+ },
+ trailingCurvedContent = {
+ BasicCurvedText(
+ text = "Trailing content",
+ style = TimeTextDefaults.timeCurvedTextStyle(color = Color.Yellow)
+ )
+ },
+ contentPadding = PaddingValues(8.dp)
+ )
+}
diff --git a/wear/compose/integration-tests/navigation/build.gradle b/wear/compose/integration-tests/navigation/build.gradle
index b4e3232..9c93c22 100644
--- a/wear/compose/integration-tests/navigation/build.gradle
+++ b/wear/compose/integration-tests/navigation/build.gradle
@@ -47,13 +47,12 @@
dependencies {
kotlinPlugin(project(":compose:compiler:compiler"))
- implementation 'androidx.wear:wear:1.1.0'
+ implementation(project(":activity:activity-compose"))
implementation(project(":compose:ui:ui"))
implementation(project(':compose:integration-tests:demos:common'))
implementation(project(":compose:foundation:foundation"))
implementation(project(":compose:foundation:foundation-layout"))
implementation(project(":compose:runtime:runtime"))
- implementation(project(":navigation:navigation-compose"))
implementation(project(':wear:compose:compose-material'))
implementation(project(':wear:compose:compose-foundation'))
implementation(project(":wear:compose:compose-foundation-samples"))
diff --git a/wear/tiles/tiles-renderer/api/api_lint.ignore b/wear/tiles/tiles-renderer/api/api_lint.ignore
new file mode 100644
index 0000000..93c6574
--- /dev/null
+++ b/wear/tiles/tiles-renderer/api/api_lint.ignore
@@ -0,0 +1,29 @@
+// Baseline format: 1.0
+AsyncSuffixFuture: androidx.wear.tiles.client.TileClient#requestApiVersion():
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
+AsyncSuffixFuture: androidx.wear.tiles.client.TileClient#requestResources(androidx.wear.tiles.RequestBuilders.ResourcesRequest):
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
+AsyncSuffixFuture: androidx.wear.tiles.client.TileClient#requestTile(androidx.wear.tiles.RequestBuilders.TileRequest):
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
+AsyncSuffixFuture: androidx.wear.tiles.client.TileClient#sendOnTileAddedEvent():
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
+AsyncSuffixFuture: androidx.wear.tiles.client.TileClient#sendOnTileEnterEvent():
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
+AsyncSuffixFuture: androidx.wear.tiles.client.TileClient#sendOnTileLeaveEvent():
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
+AsyncSuffixFuture: androidx.wear.tiles.client.TileClient#sendOnTileRemovedEvent():
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
+AsyncSuffixFuture: androidx.wear.tiles.connection.DefaultTileClient#requestApiVersion():
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
+AsyncSuffixFuture: androidx.wear.tiles.connection.DefaultTileClient#requestResources(androidx.wear.tiles.RequestBuilders.ResourcesRequest):
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
+AsyncSuffixFuture: androidx.wear.tiles.connection.DefaultTileClient#requestTile(androidx.wear.tiles.RequestBuilders.TileRequest):
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
+AsyncSuffixFuture: androidx.wear.tiles.connection.DefaultTileClient#sendOnTileAddedEvent():
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
+AsyncSuffixFuture: androidx.wear.tiles.connection.DefaultTileClient#sendOnTileEnterEvent():
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
+AsyncSuffixFuture: androidx.wear.tiles.connection.DefaultTileClient#sendOnTileLeaveEvent():
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
+AsyncSuffixFuture: androidx.wear.tiles.connection.DefaultTileClient#sendOnTileRemovedEvent():
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
diff --git a/wear/tiles/tiles-renderer/build.gradle b/wear/tiles/tiles-renderer/build.gradle
index a8e8769..94f0ce9 100644
--- a/wear/tiles/tiles-renderer/build.gradle
+++ b/wear/tiles/tiles-renderer/build.gradle
@@ -37,11 +37,10 @@
implementation "androidx.wear:wear:1.2.0-beta01"
implementation(project(":wear:tiles:tiles"))
- implementation(project(path: ":wear:tiles:tiles-proto", configuration: "shadow"))
+ implementation(project(":wear:tiles:tiles-proto"))
implementation(libs.kotlinCoroutinesCore)
implementation(libs.kotlinCoroutinesAndroid)
- androidTestImplementation(project(path: ":wear:tiles:tiles-proto"))
androidTestImplementation(project(":test:screenshot:screenshot"))
androidTestImplementation(libs.testExtJunit)
androidTestImplementation(libs.testCore)
@@ -49,6 +48,14 @@
androidTestImplementation(libs.testRules)
androidTestImplementation("com.google.protobuf:protobuf-java:3.10.0")
+ // I'm not 100% sure why, but androidTestImplementation doesn't appear to use the standard
+ // results of a project build. This leads to it not using the shadow configuration from
+ // tiles-proto, and thus failing to find the protobuf classes at runtime.
+ //
+ // This line forces the androidTest to use the properly shaded proto library on the runtime
+ // classpath.
+ androidTestRuntimeOnly(project(path: ":wear:tiles:tiles-proto", configuration: "shadow"))
+
testImplementation(libs.testExtJunit)
testImplementation(libs.testExtTruth)
testImplementation(libs.testCore)
diff --git a/wear/tiles/tiles-renderer/src/main/java/androidx/wear/tiles/manager/UpdateScheduler.java b/wear/tiles/tiles-renderer/src/main/java/androidx/wear/tiles/manager/UpdateScheduler.java
index efcc923..f1f3431 100644
--- a/wear/tiles/tiles-renderer/src/main/java/androidx/wear/tiles/manager/UpdateScheduler.java
+++ b/wear/tiles/tiles-renderer/src/main/java/androidx/wear/tiles/manager/UpdateScheduler.java
@@ -25,8 +25,6 @@
import androidx.annotation.MainThread;
import androidx.annotation.VisibleForTesting;
-import java.lang.ref.WeakReference;
-
class UpdateScheduler implements AlarmManager.OnAlarmListener {
private static final String TAG = "UpdateScheduler";
@@ -35,7 +33,7 @@
private final AlarmManager mAlarmManager;
private final Clock mClock;
- private WeakReference<UpdateReceiver> mUpdateReceiver;
+ private UpdateReceiver mUpdateReceiver;
private boolean mUpdatesEnabled = false;
private long mScheduledUpdateTimeMillis = NO_SCHEDULED_UPDATE;
@@ -53,7 +51,7 @@
/** Sets the receiver for update notifications. */
@MainThread
public void setUpdateReceiver(UpdateReceiver receiver) {
- this.mUpdateReceiver = new WeakReference<>(receiver);
+ this.mUpdateReceiver = receiver;
}
/**
@@ -160,7 +158,7 @@
private void fireUpdate() {
mLastUpdateRealtimeMillis = mClock.getElapsedTimeMillis();
- UpdateReceiver receiver = mUpdateReceiver.get();
+ UpdateReceiver receiver = mUpdateReceiver;
// Reset state now, as acceptUpdate may re-schedule an alarm.
mScheduledUpdateTimeMillis = Long.MAX_VALUE;
diff --git a/wear/tiles/tiles-testing/api/api_lint.ignore b/wear/tiles/tiles-testing/api/api_lint.ignore
new file mode 100644
index 0000000..0af6fa5
--- /dev/null
+++ b/wear/tiles/tiles-testing/api/api_lint.ignore
@@ -0,0 +1,15 @@
+// Baseline format: 1.0
+AsyncSuffixFuture: androidx.wear.tiles.testing.TestTileClient#requestApiVersion():
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
+AsyncSuffixFuture: androidx.wear.tiles.testing.TestTileClient#requestResources(androidx.wear.tiles.RequestBuilders.ResourcesRequest):
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
+AsyncSuffixFuture: androidx.wear.tiles.testing.TestTileClient#requestTile(androidx.wear.tiles.RequestBuilders.TileRequest):
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
+AsyncSuffixFuture: androidx.wear.tiles.testing.TestTileClient#sendOnTileAddedEvent():
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
+AsyncSuffixFuture: androidx.wear.tiles.testing.TestTileClient#sendOnTileEnterEvent():
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
+AsyncSuffixFuture: androidx.wear.tiles.testing.TestTileClient#sendOnTileLeaveEvent():
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
+AsyncSuffixFuture: androidx.wear.tiles.testing.TestTileClient#sendOnTileRemovedEvent():
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
diff --git a/wear/tiles/tiles/api/api_lint.ignore b/wear/tiles/tiles/api/api_lint.ignore
new file mode 100644
index 0000000..219d959
--- /dev/null
+++ b/wear/tiles/tiles/api/api_lint.ignore
@@ -0,0 +1,5 @@
+// Baseline format: 1.0
+AsyncSuffixFuture: androidx.wear.tiles.TileService#onResourcesRequest(androidx.wear.tiles.RequestBuilders.ResourcesRequest):
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
+AsyncSuffixFuture: androidx.wear.tiles.TileService#onTileRequest(androidx.wear.tiles.RequestBuilders.TileRequest):
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
diff --git a/wear/tiles/tiles/src/main/AndroidManifest.xml b/wear/tiles/tiles/src/main/AndroidManifest.xml
index 262aeeb..6f94c07 100644
--- a/wear/tiles/tiles/src/main/AndroidManifest.xml
+++ b/wear/tiles/tiles/src/main/AndroidManifest.xml
@@ -1,2 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
-<manifest package="androidx.wear.tiles" />
\ No newline at end of file
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+ package="androidx.wear.tiles">
+ <queries>
+ <intent>
+ <action android:name="androidx.wear.tiles.action.BIND_UPDATE_REQUESTER" />
+ </intent>
+ </queries>
+</manifest>
\ No newline at end of file
diff --git a/wear/watchface/OWNERS b/wear/watchface/OWNERS
new file mode 100644
index 0000000..6d5a3b2
--- /dev/null
+++ b/wear/watchface/OWNERS
@@ -0,0 +1,2 @@
+alexclarke@google.com
+jnichol@google.com
\ No newline at end of file
diff --git a/wear/watchface/watchface-client-guava/api/api_lint.ignore b/wear/watchface/watchface-client-guava/api/api_lint.ignore
new file mode 100644
index 0000000..fe4686d
--- /dev/null
+++ b/wear/watchface/watchface-client-guava/api/api_lint.ignore
@@ -0,0 +1,7 @@
+// Baseline format: 1.0
+AsyncSuffixFuture: androidx.wear.watchface.client.ListenableWatchFaceControlClient#createWatchFaceControlClient(android.content.Context, String):
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
+AsyncSuffixFuture: androidx.wear.watchface.client.ListenableWatchFaceControlClient#listenableGetOrCreateInteractiveWatchFaceClient(String, androidx.wear.watchface.client.DeviceConfig, androidx.wear.watchface.client.WatchUiState, androidx.wear.watchface.style.UserStyleData, java.util.Map<java.lang.Integer,? extends androidx.wear.complications.data.ComplicationData>):
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
+AsyncSuffixFuture: androidx.wear.watchface.client.ListenableWatchFaceControlClient.Companion#createWatchFaceControlClient(android.content.Context, String):
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
diff --git a/wear/wear-watchface-client-guava/api/current.txt b/wear/watchface/watchface-client-guava/api/current.txt
similarity index 87%
rename from wear/wear-watchface-client-guava/api/current.txt
rename to wear/watchface/watchface-client-guava/api/current.txt
index aecf59b..5115180 100644
--- a/wear/wear-watchface-client-guava/api/current.txt
+++ b/wear/watchface/watchface-client-guava/api/current.txt
@@ -9,8 +9,8 @@
method public java.util.Map<java.lang.Integer,androidx.wear.watchface.client.DefaultComplicationDataSourcePolicyAndType> getDefaultComplicationDataSourcePoliciesAndType(android.content.ComponentName watchFaceName);
method public androidx.wear.watchface.client.EditorServiceClient getEditorServiceClient();
method public androidx.wear.watchface.client.InteractiveWatchFaceClient? getInteractiveWatchFaceClientInstance(String instanceId);
- method public suspend Object? getOrCreateInteractiveWatchFaceClient(String id, androidx.wear.watchface.client.DeviceConfig deviceConfig, androidx.wear.watchface.client.WatchUiState watchUiState, androidx.wear.watchface.style.UserStyleData? userStyle, java.util.Map<java.lang.Integer,? extends androidx.wear.complications.data.ComplicationData>? slotIdToComplicationData, kotlin.coroutines.Continuation<? super androidx.wear.watchface.client.InteractiveWatchFaceClient> p);
- method public com.google.common.util.concurrent.ListenableFuture<androidx.wear.watchface.client.InteractiveWatchFaceClient> listenableGetOrCreateInteractiveWatchFaceClient(String id, androidx.wear.watchface.client.DeviceConfig deviceConfig, androidx.wear.watchface.client.WatchUiState watchUiState, androidx.wear.watchface.style.UserStyleData? userStyle, java.util.Map<java.lang.Integer,? extends androidx.wear.complications.data.ComplicationData>? slotIdToComplicationData);
+ method public suspend Object? getOrCreateInteractiveWatchFaceClient(String id, androidx.wear.watchface.client.DeviceConfig deviceConfig, androidx.wear.watchface.client.WatchUiState watchUiState, androidx.wear.watchface.style.UserStyleData? userStyle, java.util.Map<java.lang.Integer,? extends androidx.wear.watchface.complications.data.ComplicationData>? slotIdToComplicationData, kotlin.coroutines.Continuation<? super androidx.wear.watchface.client.InteractiveWatchFaceClient> p);
+ method public com.google.common.util.concurrent.ListenableFuture<androidx.wear.watchface.client.InteractiveWatchFaceClient> listenableGetOrCreateInteractiveWatchFaceClient(String id, androidx.wear.watchface.client.DeviceConfig deviceConfig, androidx.wear.watchface.client.WatchUiState watchUiState, androidx.wear.watchface.style.UserStyleData? userStyle, java.util.Map<java.lang.Integer,? extends androidx.wear.watchface.complications.data.ComplicationData>? slotIdToComplicationData);
field public static final androidx.wear.watchface.client.ListenableWatchFaceControlClient.Companion Companion;
}
diff --git a/wear/wear-watchface-client-guava/api/public_plus_experimental_current.txt b/wear/watchface/watchface-client-guava/api/public_plus_experimental_current.txt
similarity index 90%
rename from wear/wear-watchface-client-guava/api/public_plus_experimental_current.txt
rename to wear/watchface/watchface-client-guava/api/public_plus_experimental_current.txt
index 1df615a..030cf28 100644
--- a/wear/wear-watchface-client-guava/api/public_plus_experimental_current.txt
+++ b/wear/watchface/watchface-client-guava/api/public_plus_experimental_current.txt
@@ -9,8 +9,8 @@
method public java.util.Map<java.lang.Integer,androidx.wear.watchface.client.DefaultComplicationDataSourcePolicyAndType> getDefaultComplicationDataSourcePoliciesAndType(android.content.ComponentName watchFaceName);
method public androidx.wear.watchface.client.EditorServiceClient getEditorServiceClient();
method public androidx.wear.watchface.client.InteractiveWatchFaceClient? getInteractiveWatchFaceClientInstance(String instanceId);
- method public suspend Object? getOrCreateInteractiveWatchFaceClient(String id, androidx.wear.watchface.client.DeviceConfig deviceConfig, androidx.wear.watchface.client.WatchUiState watchUiState, androidx.wear.watchface.style.UserStyleData? userStyle, java.util.Map<java.lang.Integer,? extends androidx.wear.complications.data.ComplicationData>? slotIdToComplicationData, kotlin.coroutines.Continuation<? super androidx.wear.watchface.client.InteractiveWatchFaceClient> p);
- method public com.google.common.util.concurrent.ListenableFuture<androidx.wear.watchface.client.InteractiveWatchFaceClient> listenableGetOrCreateInteractiveWatchFaceClient(String id, androidx.wear.watchface.client.DeviceConfig deviceConfig, androidx.wear.watchface.client.WatchUiState watchUiState, androidx.wear.watchface.style.UserStyleData? userStyle, java.util.Map<java.lang.Integer,? extends androidx.wear.complications.data.ComplicationData>? slotIdToComplicationData);
+ method public suspend Object? getOrCreateInteractiveWatchFaceClient(String id, androidx.wear.watchface.client.DeviceConfig deviceConfig, androidx.wear.watchface.client.WatchUiState watchUiState, androidx.wear.watchface.style.UserStyleData? userStyle, java.util.Map<java.lang.Integer,? extends androidx.wear.watchface.complications.data.ComplicationData>? slotIdToComplicationData, kotlin.coroutines.Continuation<? super androidx.wear.watchface.client.InteractiveWatchFaceClient> p);
+ method public com.google.common.util.concurrent.ListenableFuture<androidx.wear.watchface.client.InteractiveWatchFaceClient> listenableGetOrCreateInteractiveWatchFaceClient(String id, androidx.wear.watchface.client.DeviceConfig deviceConfig, androidx.wear.watchface.client.WatchUiState watchUiState, androidx.wear.watchface.style.UserStyleData? userStyle, java.util.Map<java.lang.Integer,? extends androidx.wear.watchface.complications.data.ComplicationData>? slotIdToComplicationData);
field public static final androidx.wear.watchface.client.ListenableWatchFaceControlClient.Companion Companion;
}
diff --git a/wear/wear-watchface-client-guava/api/res-current.txt b/wear/watchface/watchface-client-guava/api/res-current.txt
similarity index 100%
rename from wear/wear-watchface-client-guava/api/res-current.txt
rename to wear/watchface/watchface-client-guava/api/res-current.txt
diff --git a/wear/wear-watchface-client-guava/api/restricted_current.txt b/wear/watchface/watchface-client-guava/api/restricted_current.txt
similarity index 87%
rename from wear/wear-watchface-client-guava/api/restricted_current.txt
rename to wear/watchface/watchface-client-guava/api/restricted_current.txt
index aecf59b..5115180 100644
--- a/wear/wear-watchface-client-guava/api/restricted_current.txt
+++ b/wear/watchface/watchface-client-guava/api/restricted_current.txt
@@ -9,8 +9,8 @@
method public java.util.Map<java.lang.Integer,androidx.wear.watchface.client.DefaultComplicationDataSourcePolicyAndType> getDefaultComplicationDataSourcePoliciesAndType(android.content.ComponentName watchFaceName);
method public androidx.wear.watchface.client.EditorServiceClient getEditorServiceClient();
method public androidx.wear.watchface.client.InteractiveWatchFaceClient? getInteractiveWatchFaceClientInstance(String instanceId);
- method public suspend Object? getOrCreateInteractiveWatchFaceClient(String id, androidx.wear.watchface.client.DeviceConfig deviceConfig, androidx.wear.watchface.client.WatchUiState watchUiState, androidx.wear.watchface.style.UserStyleData? userStyle, java.util.Map<java.lang.Integer,? extends androidx.wear.complications.data.ComplicationData>? slotIdToComplicationData, kotlin.coroutines.Continuation<? super androidx.wear.watchface.client.InteractiveWatchFaceClient> p);
- method public com.google.common.util.concurrent.ListenableFuture<androidx.wear.watchface.client.InteractiveWatchFaceClient> listenableGetOrCreateInteractiveWatchFaceClient(String id, androidx.wear.watchface.client.DeviceConfig deviceConfig, androidx.wear.watchface.client.WatchUiState watchUiState, androidx.wear.watchface.style.UserStyleData? userStyle, java.util.Map<java.lang.Integer,? extends androidx.wear.complications.data.ComplicationData>? slotIdToComplicationData);
+ method public suspend Object? getOrCreateInteractiveWatchFaceClient(String id, androidx.wear.watchface.client.DeviceConfig deviceConfig, androidx.wear.watchface.client.WatchUiState watchUiState, androidx.wear.watchface.style.UserStyleData? userStyle, java.util.Map<java.lang.Integer,? extends androidx.wear.watchface.complications.data.ComplicationData>? slotIdToComplicationData, kotlin.coroutines.Continuation<? super androidx.wear.watchface.client.InteractiveWatchFaceClient> p);
+ method public com.google.common.util.concurrent.ListenableFuture<androidx.wear.watchface.client.InteractiveWatchFaceClient> listenableGetOrCreateInteractiveWatchFaceClient(String id, androidx.wear.watchface.client.DeviceConfig deviceConfig, androidx.wear.watchface.client.WatchUiState watchUiState, androidx.wear.watchface.style.UserStyleData? userStyle, java.util.Map<java.lang.Integer,? extends androidx.wear.watchface.complications.data.ComplicationData>? slotIdToComplicationData);
field public static final androidx.wear.watchface.client.ListenableWatchFaceControlClient.Companion Companion;
}
diff --git a/wear/wear-watchface-client-guava/build.gradle b/wear/watchface/watchface-client-guava/build.gradle
similarity index 89%
rename from wear/wear-watchface-client-guava/build.gradle
rename to wear/watchface/watchface-client-guava/build.gradle
index 88de01c..085d1926 100644
--- a/wear/wear-watchface-client-guava/build.gradle
+++ b/wear/watchface/watchface-client-guava/build.gradle
@@ -27,11 +27,11 @@
}
dependencies {
- api(project(":wear:wear-watchface-client"))
+ api(project(":wear:watchface:watchface-client"))
api(libs.kotlinCoroutinesGuava)
implementation("androidx.concurrent:concurrent-futures:1.0.0")
- androidTestImplementation project(":wear:wear-watchface-samples")
+ androidTestImplementation project(":wear:watchface:watchface-samples")
androidTestImplementation(libs.testExtJunit)
androidTestImplementation(libs.testCore)
androidTestImplementation(libs.testRunner)
@@ -51,8 +51,7 @@
androidx {
name = "Android Wear Watchface Client Guava"
type = LibraryType.PUBLISHED_LIBRARY
- mavenGroup = LibraryGroups.WEAR
- mavenVersion = LibraryVersions.WEAR_WATCHFACE_CLIENT_GUAVA
+ mavenGroup = LibraryGroups.WEAR_WATCHFACE
inceptionYear = "2021"
description = "Guava wrappers for the Androidx Wear Watchface library"
}
diff --git a/wear/watchface/watchface-client-guava/lint-baseline.xml b/wear/watchface/watchface-client-guava/lint-baseline.xml
new file mode 100644
index 0000000..875be5e
--- /dev/null
+++ b/wear/watchface/watchface-client-guava/lint-baseline.xml
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<issues format="6" by="lint 7.2.0-dev" type="baseline" client="gradle" dependencies="false" name="AGP (7.2.0-dev)" variant="all" version="7.2.0-dev">
+
+ <issue
+ id="NewApi"
+ message="Call requires API level 27 (current min is 26): `WatchFaceControlService`"
+ errorLine1=" private val realService = object : WatchFaceControlService() {"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/androidTest/java/androidx/wear/watchface/client/guava/ListenableWatchFaceMetadataClientTest.kt"
+ line="46"
+ column="31"/>
+ </issue>
+
+ <issue
+ id="NewApi"
+ message="Extending WatchFaceControlService requires API level 27 (current min is 26): `WatchFaceControlService`"
+ errorLine1=" private val realService = object : WatchFaceControlService() {"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/androidTest/java/androidx/wear/watchface/client/guava/ListenableWatchFaceMetadataClientTest.kt"
+ line="46"
+ column="40"/>
+ </issue>
+
+</issues>
diff --git a/wear/wear-watchface-client-guava/src/androidTest/AndroidManifest.xml b/wear/watchface/watchface-client-guava/src/androidTest/AndroidManifest.xml
similarity index 100%
rename from wear/wear-watchface-client-guava/src/androidTest/AndroidManifest.xml
rename to wear/watchface/watchface-client-guava/src/androidTest/AndroidManifest.xml
diff --git a/wear/wear-watchface-client-guava/src/androidTest/java/androidx/wear/watchface/client/guava/ListenableWatchFaceControlClientTest.kt b/wear/watchface/watchface-client-guava/src/androidTest/java/androidx/wear/watchface/client/guava/ListenableWatchFaceControlClientTest.kt
similarity index 100%
rename from wear/wear-watchface-client-guava/src/androidTest/java/androidx/wear/watchface/client/guava/ListenableWatchFaceControlClientTest.kt
rename to wear/watchface/watchface-client-guava/src/androidTest/java/androidx/wear/watchface/client/guava/ListenableWatchFaceControlClientTest.kt
diff --git a/wear/wear-watchface-client-guava/src/androidTest/java/androidx/wear/watchface/client/guava/ListenableWatchFaceMetadataClientTest.kt b/wear/watchface/watchface-client-guava/src/androidTest/java/androidx/wear/watchface/client/guava/ListenableWatchFaceMetadataClientTest.kt
similarity index 100%
rename from wear/wear-watchface-client-guava/src/androidTest/java/androidx/wear/watchface/client/guava/ListenableWatchFaceMetadataClientTest.kt
rename to wear/watchface/watchface-client-guava/src/androidTest/java/androidx/wear/watchface/client/guava/ListenableWatchFaceMetadataClientTest.kt
diff --git a/wear/wear-watchface-client-guava/src/main/AndroidManifest.xml b/wear/watchface/watchface-client-guava/src/main/AndroidManifest.xml
similarity index 100%
rename from wear/wear-watchface-client-guava/src/main/AndroidManifest.xml
rename to wear/watchface/watchface-client-guava/src/main/AndroidManifest.xml
diff --git a/wear/wear-watchface-client-guava/src/main/java/androidx/wear/watchface/client/ListenableWatchFaceControlClient.kt b/wear/watchface/watchface-client-guava/src/main/java/androidx/wear/watchface/client/ListenableWatchFaceControlClient.kt
similarity index 97%
rename from wear/wear-watchface-client-guava/src/main/java/androidx/wear/watchface/client/ListenableWatchFaceControlClient.kt
rename to wear/watchface/watchface-client-guava/src/main/java/androidx/wear/watchface/client/ListenableWatchFaceControlClient.kt
index dc33854d..d1f4dbb 100644
--- a/wear/wear-watchface-client-guava/src/main/java/androidx/wear/watchface/client/ListenableWatchFaceControlClient.kt
+++ b/wear/watchface/watchface-client-guava/src/main/java/androidx/wear/watchface/client/ListenableWatchFaceControlClient.kt
@@ -19,8 +19,8 @@
import android.content.ComponentName
import android.content.Context
import androidx.concurrent.futures.ResolvableFuture
-import androidx.wear.complications.data.ComplicationData
-import androidx.wear.utility.AsyncTraceEvent
+import androidx.wear.watchface.complications.data.ComplicationData
+import androidx.wear.watchface.utility.AsyncTraceEvent
import androidx.wear.watchface.client.WatchFaceControlClient.ServiceNotBoundException
import androidx.wear.watchface.style.UserStyleData
import com.google.common.util.concurrent.ListenableFuture
@@ -144,6 +144,7 @@
* @param slotIdToComplicationData The initial [androidx.wear.watchface.ComplicationSlot] data,
* or `null` if unavailable.
*/
+ @Suppress("AsyncSuffixFuture")
public open fun listenableGetOrCreateInteractiveWatchFaceClient(
id: String,
deviceConfig: DeviceConfig,
diff --git a/wear/wear-watchface-client-guava/src/main/java/androidx/wear/watchface/client/ListenableWatchFaceMetadataClient.kt b/wear/watchface/watchface-client-guava/src/main/java/androidx/wear/watchface/client/ListenableWatchFaceMetadataClient.kt
similarity index 98%
rename from wear/wear-watchface-client-guava/src/main/java/androidx/wear/watchface/client/ListenableWatchFaceMetadataClient.kt
rename to wear/watchface/watchface-client-guava/src/main/java/androidx/wear/watchface/client/ListenableWatchFaceMetadataClient.kt
index 5894779..fc42326 100644
--- a/wear/wear-watchface-client-guava/src/main/java/androidx/wear/watchface/client/ListenableWatchFaceMetadataClient.kt
+++ b/wear/watchface/watchface-client-guava/src/main/java/androidx/wear/watchface/client/ListenableWatchFaceMetadataClient.kt
@@ -42,6 +42,7 @@
* control service can not be bound or a [ServiceStartFailureException] if the watch face
* dies during startup.
*/
+ @Suppress("AsyncSuffixFuture")
@JvmStatic
public fun createListenableWatchFaceMetadataClient(
context: Context,
diff --git a/wear/wear-watchface-client/api/current.txt b/wear/watchface/watchface-client/api/current.txt
similarity index 80%
rename from wear/wear-watchface-client/api/current.txt
rename to wear/watchface/watchface-client/api/current.txt
index 407e165..2e43260 100644
--- a/wear/wear-watchface-client/api/current.txt
+++ b/wear/watchface/watchface-client/api/current.txt
@@ -2,35 +2,35 @@
package androidx.wear.watchface.client {
public final class ComplicationSlotState {
- ctor public ComplicationSlotState(android.graphics.Rect bounds, int boundsType, java.util.List<? extends androidx.wear.complications.data.ComplicationType> supportedTypes, androidx.wear.complications.DefaultComplicationDataSourcePolicy defaultDataSourcePolicy, androidx.wear.complications.data.ComplicationType defaultDataSourceType, boolean isEnabled, boolean isInitiallyEnabled, androidx.wear.complications.data.ComplicationType currentType, boolean fixedComplicationDataSource, android.os.Bundle complicationConfigExtras);
+ ctor public ComplicationSlotState(android.graphics.Rect bounds, int boundsType, java.util.List<? extends androidx.wear.watchface.complications.data.ComplicationType> supportedTypes, androidx.wear.watchface.complications.DefaultComplicationDataSourcePolicy defaultDataSourcePolicy, androidx.wear.watchface.complications.data.ComplicationType defaultDataSourceType, boolean isEnabled, boolean isInitiallyEnabled, androidx.wear.watchface.complications.data.ComplicationType currentType, boolean fixedComplicationDataSource, android.os.Bundle complicationConfigExtras);
method public android.graphics.Rect getBounds();
method public int getBoundsType();
method public android.os.Bundle getComplicationConfigExtras();
- method public androidx.wear.complications.data.ComplicationType getCurrentType();
- method public androidx.wear.complications.DefaultComplicationDataSourcePolicy getDefaultDataSourcePolicy();
- method public androidx.wear.complications.data.ComplicationType getDefaultDataSourceType();
+ method public androidx.wear.watchface.complications.data.ComplicationType getCurrentType();
+ method public androidx.wear.watchface.complications.DefaultComplicationDataSourcePolicy getDefaultDataSourcePolicy();
+ method public androidx.wear.watchface.complications.data.ComplicationType getDefaultDataSourceType();
method public boolean getFixedComplicationDataSource();
- method public java.util.List<androidx.wear.complications.data.ComplicationType> getSupportedTypes();
+ method public java.util.List<androidx.wear.watchface.complications.data.ComplicationType> getSupportedTypes();
method public boolean isEnabled();
method public boolean isInitiallyEnabled();
property public final android.graphics.Rect bounds;
property public final int boundsType;
property public final android.os.Bundle complicationConfigExtras;
- property public final androidx.wear.complications.data.ComplicationType currentType;
- property public final androidx.wear.complications.DefaultComplicationDataSourcePolicy defaultDataSourcePolicy;
- property public final androidx.wear.complications.data.ComplicationType defaultDataSourceType;
+ property public final androidx.wear.watchface.complications.data.ComplicationType currentType;
+ property public final androidx.wear.watchface.complications.DefaultComplicationDataSourcePolicy defaultDataSourcePolicy;
+ property public final androidx.wear.watchface.complications.data.ComplicationType defaultDataSourceType;
property public final boolean fixedComplicationDataSource;
property public final boolean isEnabled;
property public final boolean isInitiallyEnabled;
- property public final java.util.List<androidx.wear.complications.data.ComplicationType> supportedTypes;
+ property public final java.util.List<androidx.wear.watchface.complications.data.ComplicationType> supportedTypes;
}
public final class DefaultComplicationDataSourcePolicyAndType {
- ctor public DefaultComplicationDataSourcePolicyAndType(androidx.wear.complications.DefaultComplicationDataSourcePolicy policy, androidx.wear.complications.data.ComplicationType type);
- method public androidx.wear.complications.DefaultComplicationDataSourcePolicy getPolicy();
- method public androidx.wear.complications.data.ComplicationType getType();
- property public final androidx.wear.complications.DefaultComplicationDataSourcePolicy policy;
- property public final androidx.wear.complications.data.ComplicationType type;
+ ctor public DefaultComplicationDataSourcePolicyAndType(androidx.wear.watchface.complications.DefaultComplicationDataSourcePolicy policy, androidx.wear.watchface.complications.data.ComplicationType type);
+ method public androidx.wear.watchface.complications.DefaultComplicationDataSourcePolicy getPolicy();
+ method public androidx.wear.watchface.complications.data.ComplicationType getType();
+ property public final androidx.wear.watchface.complications.DefaultComplicationDataSourcePolicy policy;
+ property public final androidx.wear.watchface.complications.data.ComplicationType type;
}
public final class DeviceConfig {
@@ -59,12 +59,12 @@
}
public final class EditorState {
- method public java.util.Map<java.lang.Integer,androidx.wear.complications.data.ComplicationData> getPreviewComplicationsData();
+ method public java.util.Map<java.lang.Integer,androidx.wear.watchface.complications.data.ComplicationData> getPreviewComplicationsData();
method public android.graphics.Bitmap? getPreviewImage();
method public boolean getShouldCommitChanges();
method public androidx.wear.watchface.style.UserStyleData getUserStyle();
method public androidx.wear.watchface.client.WatchFaceId getWatchFaceId();
- property public final java.util.Map<java.lang.Integer,androidx.wear.complications.data.ComplicationData> previewComplicationsData;
+ property public final java.util.Map<java.lang.Integer,androidx.wear.watchface.complications.data.ComplicationData> previewComplicationsData;
property public final android.graphics.Bitmap? previewImage;
property public final boolean shouldCommitChanges;
property public final androidx.wear.watchface.style.UserStyleData userStyle;
@@ -82,8 +82,8 @@
method @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public androidx.wear.watchface.style.UserStyleSchema getUserStyleSchema();
method @AnyThread public boolean isConnectionAlive();
method @AnyThread public void removeClientDisconnectListener(androidx.wear.watchface.client.HeadlessWatchFaceClient.ClientDisconnectListener listener);
- method @RequiresApi(27) @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public android.graphics.Bitmap? renderComplicationToBitmap(int complicationSlotId, androidx.wear.watchface.RenderParameters renderParameters, java.time.Instant instant, androidx.wear.complications.data.ComplicationData complicationData, androidx.wear.watchface.style.UserStyle? userStyle) throws android.os.RemoteException;
- method @RequiresApi(27) @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public android.graphics.Bitmap renderWatchFaceToBitmap(androidx.wear.watchface.RenderParameters renderParameters, java.time.Instant instant, androidx.wear.watchface.style.UserStyle? userStyle, java.util.Map<java.lang.Integer,? extends androidx.wear.complications.data.ComplicationData>? slotIdToComplicationData) throws android.os.RemoteException;
+ method @RequiresApi(27) @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public android.graphics.Bitmap? renderComplicationToBitmap(int complicationSlotId, androidx.wear.watchface.RenderParameters renderParameters, java.time.Instant instant, androidx.wear.watchface.complications.data.ComplicationData complicationData, androidx.wear.watchface.style.UserStyle? userStyle) throws android.os.RemoteException;
+ method @RequiresApi(27) @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public android.graphics.Bitmap renderWatchFaceToBitmap(androidx.wear.watchface.RenderParameters renderParameters, java.time.Instant instant, androidx.wear.watchface.style.UserStyle? userStyle, java.util.Map<java.lang.Integer,? extends androidx.wear.watchface.complications.data.ComplicationData>? slotIdToComplicationData) throws android.os.RemoteException;
method public android.os.Bundle toBundle();
property @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public abstract java.util.Map<java.lang.Integer,androidx.wear.watchface.client.ComplicationSlotState> complicationSlotsState;
property @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public abstract java.time.Instant previewReferenceInstant;
@@ -102,7 +102,7 @@
public interface InteractiveWatchFaceClient extends java.lang.AutoCloseable {
method @AnyThread public void addClientDisconnectListener(androidx.wear.watchface.client.InteractiveWatchFaceClient.ClientDisconnectListener listener, java.util.concurrent.Executor executor);
- method public void addWatchFaceReadyListener(androidx.wear.watchface.client.InteractiveWatchFaceClient.WatchFaceReadyListener listener, java.util.concurrent.Executor executor);
+ method public void addWatchFaceReadyListener(java.util.concurrent.Executor executor, androidx.wear.watchface.client.InteractiveWatchFaceClient.OnWatchFaceReadyListener listener);
method @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public default Integer? getComplicationIdAt(@Px int x, @Px int y) throws android.os.RemoteException;
method @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public java.util.Map<java.lang.Integer,androidx.wear.watchface.client.ComplicationSlotState> getComplicationSlotsState();
method @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public java.util.List<androidx.wear.watchface.ContentDescriptionLabel> getContentDescriptionLabels();
@@ -112,11 +112,11 @@
method @AnyThread public boolean isConnectionAlive();
method @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public void performAmbientTick() throws android.os.RemoteException;
method @AnyThread public void removeClientDisconnectListener(androidx.wear.watchface.client.InteractiveWatchFaceClient.ClientDisconnectListener listener);
- method public void removeWatchFaceReadyListener(androidx.wear.watchface.client.InteractiveWatchFaceClient.WatchFaceReadyListener listener);
- method @RequiresApi(27) @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public android.graphics.Bitmap renderWatchFaceToBitmap(androidx.wear.watchface.RenderParameters renderParameters, java.time.Instant instant, androidx.wear.watchface.style.UserStyle? userStyle, java.util.Map<java.lang.Integer,? extends androidx.wear.complications.data.ComplicationData>? idAndComplicationData) throws android.os.RemoteException;
+ method public void removeWatchFaceReadyListener(androidx.wear.watchface.client.InteractiveWatchFaceClient.OnWatchFaceReadyListener listener);
+ method @RequiresApi(27) @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public android.graphics.Bitmap renderWatchFaceToBitmap(androidx.wear.watchface.RenderParameters renderParameters, java.time.Instant instant, androidx.wear.watchface.style.UserStyle? userStyle, java.util.Map<java.lang.Integer,? extends androidx.wear.watchface.complications.data.ComplicationData>? idAndComplicationData) throws android.os.RemoteException;
method @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public void sendTouchEvent(@Px int xPosition, @Px int yPosition, @androidx.wear.watchface.TapType int tapType) throws android.os.RemoteException;
method @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public void setWatchUiState(androidx.wear.watchface.client.WatchUiState watchUiState) throws android.os.RemoteException;
- method @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public void updateComplicationData(java.util.Map<java.lang.Integer,? extends androidx.wear.complications.data.ComplicationData> slotIdToComplicationData) throws android.os.RemoteException;
+ method @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public void updateComplicationData(java.util.Map<java.lang.Integer,? extends androidx.wear.watchface.complications.data.ComplicationData> slotIdToComplicationData) throws android.os.RemoteException;
method @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public void updateWatchFaceInstance(String newInstanceId, androidx.wear.watchface.style.UserStyle userStyle) throws android.os.RemoteException;
method @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public void updateWatchFaceInstance(String newInstanceId, androidx.wear.watchface.style.UserStyleData userStyle) throws android.os.RemoteException;
property @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public abstract java.util.Map<java.lang.Integer,androidx.wear.watchface.client.ComplicationSlotState> complicationSlotsState;
@@ -140,7 +140,7 @@
field public static final int TAP_TYPE_UP = 2; // 0x2
}
- public static fun interface InteractiveWatchFaceClient.WatchFaceReadyListener {
+ public static fun interface InteractiveWatchFaceClient.OnWatchFaceReadyListener {
method public void onWatchFaceReady();
}
@@ -150,7 +150,7 @@
method @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public java.util.Map<java.lang.Integer,androidx.wear.watchface.client.DefaultComplicationDataSourcePolicyAndType> getDefaultComplicationDataSourcePoliciesAndType(android.content.ComponentName watchFaceName) throws android.os.RemoteException;
method @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public androidx.wear.watchface.client.EditorServiceClient getEditorServiceClient() throws android.os.RemoteException;
method @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public androidx.wear.watchface.client.InteractiveWatchFaceClient? getInteractiveWatchFaceClientInstance(String instanceId) throws android.os.RemoteException;
- method @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public suspend Object? getOrCreateInteractiveWatchFaceClient(String id, androidx.wear.watchface.client.DeviceConfig deviceConfig, androidx.wear.watchface.client.WatchUiState watchUiState, androidx.wear.watchface.style.UserStyleData? userStyle, java.util.Map<java.lang.Integer,? extends androidx.wear.complications.data.ComplicationData>? slotIdToComplicationData, kotlin.coroutines.Continuation<? super androidx.wear.watchface.client.InteractiveWatchFaceClient> p) throws android.os.RemoteException;
+ method @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public suspend Object? getOrCreateInteractiveWatchFaceClient(String id, androidx.wear.watchface.client.DeviceConfig deviceConfig, androidx.wear.watchface.client.WatchUiState watchUiState, androidx.wear.watchface.style.UserStyleData? userStyle, java.util.Map<java.lang.Integer,? extends androidx.wear.watchface.complications.data.ComplicationData>? slotIdToComplicationData, kotlin.coroutines.Continuation<? super androidx.wear.watchface.client.InteractiveWatchFaceClient> p) throws android.os.RemoteException;
field public static final androidx.wear.watchface.client.WatchFaceControlClient.Companion Companion;
}
diff --git a/wear/wear-watchface-client/api/public_plus_experimental_current.txt b/wear/watchface/watchface-client/api/public_plus_experimental_current.txt
similarity index 77%
rename from wear/wear-watchface-client/api/public_plus_experimental_current.txt
rename to wear/watchface/watchface-client/api/public_plus_experimental_current.txt
index 66f9f1f..a76ae35 100644
--- a/wear/wear-watchface-client/api/public_plus_experimental_current.txt
+++ b/wear/watchface/watchface-client/api/public_plus_experimental_current.txt
@@ -2,55 +2,55 @@
package androidx.wear.watchface.client {
@androidx.wear.watchface.client.WatchFaceClientExperimental public final class ComplicationSlotMetadata {
- ctor public ComplicationSlotMetadata(androidx.wear.complications.ComplicationSlotBounds? bounds, int boundsType, java.util.List<? extends androidx.wear.complications.data.ComplicationType> supportedTypes, androidx.wear.complications.DefaultComplicationDataSourcePolicy defaultDataSourcePolicy, androidx.wear.complications.data.ComplicationType defaultDataSourceType, boolean isInitiallyEnabled, boolean fixedComplicationDataSource, android.os.Bundle complicationConfigExtras);
- method public androidx.wear.complications.ComplicationSlotBounds? getBounds();
+ ctor public ComplicationSlotMetadata(androidx.wear.watchface.complications.ComplicationSlotBounds? bounds, int boundsType, java.util.List<? extends androidx.wear.watchface.complications.data.ComplicationType> supportedTypes, androidx.wear.watchface.complications.DefaultComplicationDataSourcePolicy defaultDataSourcePolicy, androidx.wear.watchface.complications.data.ComplicationType defaultDataSourceType, boolean isInitiallyEnabled, boolean fixedComplicationDataSource, android.os.Bundle complicationConfigExtras);
+ method public androidx.wear.watchface.complications.ComplicationSlotBounds? getBounds();
method public int getBoundsType();
method public android.os.Bundle getComplicationConfigExtras();
- method public androidx.wear.complications.DefaultComplicationDataSourcePolicy getDefaultDataSourcePolicy();
- method public androidx.wear.complications.data.ComplicationType getDefaultDataSourceType();
+ method public androidx.wear.watchface.complications.DefaultComplicationDataSourcePolicy getDefaultDataSourcePolicy();
+ method public androidx.wear.watchface.complications.data.ComplicationType getDefaultDataSourceType();
method public boolean getFixedComplicationDataSource();
- method public java.util.List<androidx.wear.complications.data.ComplicationType> getSupportedTypes();
+ method public java.util.List<androidx.wear.watchface.complications.data.ComplicationType> getSupportedTypes();
method public boolean isInitiallyEnabled();
- property public final androidx.wear.complications.ComplicationSlotBounds? bounds;
+ property public final androidx.wear.watchface.complications.ComplicationSlotBounds? bounds;
property public final int boundsType;
property public final android.os.Bundle complicationConfigExtras;
- property public final androidx.wear.complications.DefaultComplicationDataSourcePolicy defaultDataSourcePolicy;
- property public final androidx.wear.complications.data.ComplicationType defaultDataSourceType;
+ property public final androidx.wear.watchface.complications.DefaultComplicationDataSourcePolicy defaultDataSourcePolicy;
+ property public final androidx.wear.watchface.complications.data.ComplicationType defaultDataSourceType;
property public final boolean fixedComplicationDataSource;
property public final boolean isInitiallyEnabled;
- property public final java.util.List<androidx.wear.complications.data.ComplicationType> supportedTypes;
+ property public final java.util.List<androidx.wear.watchface.complications.data.ComplicationType> supportedTypes;
}
public final class ComplicationSlotState {
- ctor public ComplicationSlotState(android.graphics.Rect bounds, int boundsType, java.util.List<? extends androidx.wear.complications.data.ComplicationType> supportedTypes, androidx.wear.complications.DefaultComplicationDataSourcePolicy defaultDataSourcePolicy, androidx.wear.complications.data.ComplicationType defaultDataSourceType, boolean isEnabled, boolean isInitiallyEnabled, androidx.wear.complications.data.ComplicationType currentType, boolean fixedComplicationDataSource, android.os.Bundle complicationConfigExtras);
+ ctor public ComplicationSlotState(android.graphics.Rect bounds, int boundsType, java.util.List<? extends androidx.wear.watchface.complications.data.ComplicationType> supportedTypes, androidx.wear.watchface.complications.DefaultComplicationDataSourcePolicy defaultDataSourcePolicy, androidx.wear.watchface.complications.data.ComplicationType defaultDataSourceType, boolean isEnabled, boolean isInitiallyEnabled, androidx.wear.watchface.complications.data.ComplicationType currentType, boolean fixedComplicationDataSource, android.os.Bundle complicationConfigExtras);
method public android.graphics.Rect getBounds();
method public int getBoundsType();
method public android.os.Bundle getComplicationConfigExtras();
- method public androidx.wear.complications.data.ComplicationType getCurrentType();
- method public androidx.wear.complications.DefaultComplicationDataSourcePolicy getDefaultDataSourcePolicy();
- method public androidx.wear.complications.data.ComplicationType getDefaultDataSourceType();
+ method public androidx.wear.watchface.complications.data.ComplicationType getCurrentType();
+ method public androidx.wear.watchface.complications.DefaultComplicationDataSourcePolicy getDefaultDataSourcePolicy();
+ method public androidx.wear.watchface.complications.data.ComplicationType getDefaultDataSourceType();
method public boolean getFixedComplicationDataSource();
- method public java.util.List<androidx.wear.complications.data.ComplicationType> getSupportedTypes();
+ method public java.util.List<androidx.wear.watchface.complications.data.ComplicationType> getSupportedTypes();
method public boolean isEnabled();
method public boolean isInitiallyEnabled();
property public final android.graphics.Rect bounds;
property public final int boundsType;
property public final android.os.Bundle complicationConfigExtras;
- property public final androidx.wear.complications.data.ComplicationType currentType;
- property public final androidx.wear.complications.DefaultComplicationDataSourcePolicy defaultDataSourcePolicy;
- property public final androidx.wear.complications.data.ComplicationType defaultDataSourceType;
+ property public final androidx.wear.watchface.complications.data.ComplicationType currentType;
+ property public final androidx.wear.watchface.complications.DefaultComplicationDataSourcePolicy defaultDataSourcePolicy;
+ property public final androidx.wear.watchface.complications.data.ComplicationType defaultDataSourceType;
property public final boolean fixedComplicationDataSource;
property public final boolean isEnabled;
property public final boolean isInitiallyEnabled;
- property public final java.util.List<androidx.wear.complications.data.ComplicationType> supportedTypes;
+ property public final java.util.List<androidx.wear.watchface.complications.data.ComplicationType> supportedTypes;
}
public final class DefaultComplicationDataSourcePolicyAndType {
- ctor public DefaultComplicationDataSourcePolicyAndType(androidx.wear.complications.DefaultComplicationDataSourcePolicy policy, androidx.wear.complications.data.ComplicationType type);
- method public androidx.wear.complications.DefaultComplicationDataSourcePolicy getPolicy();
- method public androidx.wear.complications.data.ComplicationType getType();
- property public final androidx.wear.complications.DefaultComplicationDataSourcePolicy policy;
- property public final androidx.wear.complications.data.ComplicationType type;
+ ctor public DefaultComplicationDataSourcePolicyAndType(androidx.wear.watchface.complications.DefaultComplicationDataSourcePolicy policy, androidx.wear.watchface.complications.data.ComplicationType type);
+ method public androidx.wear.watchface.complications.DefaultComplicationDataSourcePolicy getPolicy();
+ method public androidx.wear.watchface.complications.data.ComplicationType getType();
+ property public final androidx.wear.watchface.complications.DefaultComplicationDataSourcePolicy policy;
+ property public final androidx.wear.watchface.complications.data.ComplicationType type;
}
public final class DeviceConfig {
@@ -79,12 +79,12 @@
}
public final class EditorState {
- method public java.util.Map<java.lang.Integer,androidx.wear.complications.data.ComplicationData> getPreviewComplicationsData();
+ method public java.util.Map<java.lang.Integer,androidx.wear.watchface.complications.data.ComplicationData> getPreviewComplicationsData();
method public android.graphics.Bitmap? getPreviewImage();
method public boolean getShouldCommitChanges();
method public androidx.wear.watchface.style.UserStyleData getUserStyle();
method public androidx.wear.watchface.client.WatchFaceId getWatchFaceId();
- property public final java.util.Map<java.lang.Integer,androidx.wear.complications.data.ComplicationData> previewComplicationsData;
+ property public final java.util.Map<java.lang.Integer,androidx.wear.watchface.complications.data.ComplicationData> previewComplicationsData;
property public final android.graphics.Bitmap? previewImage;
property public final boolean shouldCommitChanges;
property public final androidx.wear.watchface.style.UserStyleData userStyle;
@@ -102,8 +102,8 @@
method @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public androidx.wear.watchface.style.UserStyleSchema getUserStyleSchema();
method @AnyThread public boolean isConnectionAlive();
method @AnyThread public void removeClientDisconnectListener(androidx.wear.watchface.client.HeadlessWatchFaceClient.ClientDisconnectListener listener);
- method @RequiresApi(27) @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public android.graphics.Bitmap? renderComplicationToBitmap(int complicationSlotId, androidx.wear.watchface.RenderParameters renderParameters, java.time.Instant instant, androidx.wear.complications.data.ComplicationData complicationData, androidx.wear.watchface.style.UserStyle? userStyle) throws android.os.RemoteException;
- method @RequiresApi(27) @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public android.graphics.Bitmap renderWatchFaceToBitmap(androidx.wear.watchface.RenderParameters renderParameters, java.time.Instant instant, androidx.wear.watchface.style.UserStyle? userStyle, java.util.Map<java.lang.Integer,? extends androidx.wear.complications.data.ComplicationData>? slotIdToComplicationData) throws android.os.RemoteException;
+ method @RequiresApi(27) @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public android.graphics.Bitmap? renderComplicationToBitmap(int complicationSlotId, androidx.wear.watchface.RenderParameters renderParameters, java.time.Instant instant, androidx.wear.watchface.complications.data.ComplicationData complicationData, androidx.wear.watchface.style.UserStyle? userStyle) throws android.os.RemoteException;
+ method @RequiresApi(27) @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public android.graphics.Bitmap renderWatchFaceToBitmap(androidx.wear.watchface.RenderParameters renderParameters, java.time.Instant instant, androidx.wear.watchface.style.UserStyle? userStyle, java.util.Map<java.lang.Integer,? extends androidx.wear.watchface.complications.data.ComplicationData>? slotIdToComplicationData) throws android.os.RemoteException;
method public android.os.Bundle toBundle();
property @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public abstract java.util.Map<java.lang.Integer,androidx.wear.watchface.client.ComplicationSlotState> complicationSlotsState;
property @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public abstract java.time.Instant previewReferenceInstant;
@@ -122,7 +122,7 @@
public interface InteractiveWatchFaceClient extends java.lang.AutoCloseable {
method @AnyThread public void addClientDisconnectListener(androidx.wear.watchface.client.InteractiveWatchFaceClient.ClientDisconnectListener listener, java.util.concurrent.Executor executor);
- method public void addWatchFaceReadyListener(androidx.wear.watchface.client.InteractiveWatchFaceClient.WatchFaceReadyListener listener, java.util.concurrent.Executor executor);
+ method public void addWatchFaceReadyListener(java.util.concurrent.Executor executor, androidx.wear.watchface.client.InteractiveWatchFaceClient.OnWatchFaceReadyListener listener);
method @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public default Integer? getComplicationIdAt(@Px int x, @Px int y) throws android.os.RemoteException;
method @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public java.util.Map<java.lang.Integer,androidx.wear.watchface.client.ComplicationSlotState> getComplicationSlotsState();
method @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public java.util.List<androidx.wear.watchface.ContentDescriptionLabel> getContentDescriptionLabels();
@@ -132,11 +132,11 @@
method @AnyThread public boolean isConnectionAlive();
method @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public void performAmbientTick() throws android.os.RemoteException;
method @AnyThread public void removeClientDisconnectListener(androidx.wear.watchface.client.InteractiveWatchFaceClient.ClientDisconnectListener listener);
- method public void removeWatchFaceReadyListener(androidx.wear.watchface.client.InteractiveWatchFaceClient.WatchFaceReadyListener listener);
- method @RequiresApi(27) @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public android.graphics.Bitmap renderWatchFaceToBitmap(androidx.wear.watchface.RenderParameters renderParameters, java.time.Instant instant, androidx.wear.watchface.style.UserStyle? userStyle, java.util.Map<java.lang.Integer,? extends androidx.wear.complications.data.ComplicationData>? idAndComplicationData) throws android.os.RemoteException;
+ method public void removeWatchFaceReadyListener(androidx.wear.watchface.client.InteractiveWatchFaceClient.OnWatchFaceReadyListener listener);
+ method @RequiresApi(27) @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public android.graphics.Bitmap renderWatchFaceToBitmap(androidx.wear.watchface.RenderParameters renderParameters, java.time.Instant instant, androidx.wear.watchface.style.UserStyle? userStyle, java.util.Map<java.lang.Integer,? extends androidx.wear.watchface.complications.data.ComplicationData>? idAndComplicationData) throws android.os.RemoteException;
method @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public void sendTouchEvent(@Px int xPosition, @Px int yPosition, @androidx.wear.watchface.TapType int tapType) throws android.os.RemoteException;
method @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public void setWatchUiState(androidx.wear.watchface.client.WatchUiState watchUiState) throws android.os.RemoteException;
- method @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public void updateComplicationData(java.util.Map<java.lang.Integer,? extends androidx.wear.complications.data.ComplicationData> slotIdToComplicationData) throws android.os.RemoteException;
+ method @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public void updateComplicationData(java.util.Map<java.lang.Integer,? extends androidx.wear.watchface.complications.data.ComplicationData> slotIdToComplicationData) throws android.os.RemoteException;
method @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public void updateWatchFaceInstance(String newInstanceId, androidx.wear.watchface.style.UserStyle userStyle) throws android.os.RemoteException;
method @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public void updateWatchFaceInstance(String newInstanceId, androidx.wear.watchface.style.UserStyleData userStyle) throws android.os.RemoteException;
property @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public abstract java.util.Map<java.lang.Integer,androidx.wear.watchface.client.ComplicationSlotState> complicationSlotsState;
@@ -160,7 +160,7 @@
field public static final int TAP_TYPE_UP = 2; // 0x2
}
- public static fun interface InteractiveWatchFaceClient.WatchFaceReadyListener {
+ public static fun interface InteractiveWatchFaceClient.OnWatchFaceReadyListener {
method public void onWatchFaceReady();
}
@@ -173,7 +173,7 @@
method @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public java.util.Map<java.lang.Integer,androidx.wear.watchface.client.DefaultComplicationDataSourcePolicyAndType> getDefaultComplicationDataSourcePoliciesAndType(android.content.ComponentName watchFaceName) throws android.os.RemoteException;
method @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public androidx.wear.watchface.client.EditorServiceClient getEditorServiceClient() throws android.os.RemoteException;
method @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public androidx.wear.watchface.client.InteractiveWatchFaceClient? getInteractiveWatchFaceClientInstance(String instanceId) throws android.os.RemoteException;
- method @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public suspend Object? getOrCreateInteractiveWatchFaceClient(String id, androidx.wear.watchface.client.DeviceConfig deviceConfig, androidx.wear.watchface.client.WatchUiState watchUiState, androidx.wear.watchface.style.UserStyleData? userStyle, java.util.Map<java.lang.Integer,? extends androidx.wear.complications.data.ComplicationData>? slotIdToComplicationData, kotlin.coroutines.Continuation<? super androidx.wear.watchface.client.InteractiveWatchFaceClient> p) throws android.os.RemoteException;
+ method @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public suspend Object? getOrCreateInteractiveWatchFaceClient(String id, androidx.wear.watchface.client.DeviceConfig deviceConfig, androidx.wear.watchface.client.WatchUiState watchUiState, androidx.wear.watchface.style.UserStyleData? userStyle, java.util.Map<java.lang.Integer,? extends androidx.wear.watchface.complications.data.ComplicationData>? slotIdToComplicationData, kotlin.coroutines.Continuation<? super androidx.wear.watchface.client.InteractiveWatchFaceClient> p) throws android.os.RemoteException;
field public static final androidx.wear.watchface.client.WatchFaceControlClient.Companion Companion;
}
diff --git a/wear/wear-watchface-client/api/res-current.txt b/wear/watchface/watchface-client/api/res-current.txt
similarity index 100%
rename from wear/wear-watchface-client/api/res-current.txt
rename to wear/watchface/watchface-client/api/res-current.txt
diff --git a/wear/wear-watchface-client/api/current.txt b/wear/watchface/watchface-client/api/restricted_current.txt
similarity index 80%
copy from wear/wear-watchface-client/api/current.txt
copy to wear/watchface/watchface-client/api/restricted_current.txt
index 407e165..a54e7a4 100644
--- a/wear/wear-watchface-client/api/current.txt
+++ b/wear/watchface/watchface-client/api/restricted_current.txt
@@ -2,35 +2,35 @@
package androidx.wear.watchface.client {
public final class ComplicationSlotState {
- ctor public ComplicationSlotState(android.graphics.Rect bounds, int boundsType, java.util.List<? extends androidx.wear.complications.data.ComplicationType> supportedTypes, androidx.wear.complications.DefaultComplicationDataSourcePolicy defaultDataSourcePolicy, androidx.wear.complications.data.ComplicationType defaultDataSourceType, boolean isEnabled, boolean isInitiallyEnabled, androidx.wear.complications.data.ComplicationType currentType, boolean fixedComplicationDataSource, android.os.Bundle complicationConfigExtras);
+ ctor public ComplicationSlotState(android.graphics.Rect bounds, @androidx.wear.watchface.ComplicationSlotBoundsType int boundsType, java.util.List<? extends androidx.wear.watchface.complications.data.ComplicationType> supportedTypes, androidx.wear.watchface.complications.DefaultComplicationDataSourcePolicy defaultDataSourcePolicy, androidx.wear.watchface.complications.data.ComplicationType defaultDataSourceType, boolean isEnabled, boolean isInitiallyEnabled, androidx.wear.watchface.complications.data.ComplicationType currentType, boolean fixedComplicationDataSource, android.os.Bundle complicationConfigExtras);
method public android.graphics.Rect getBounds();
method public int getBoundsType();
method public android.os.Bundle getComplicationConfigExtras();
- method public androidx.wear.complications.data.ComplicationType getCurrentType();
- method public androidx.wear.complications.DefaultComplicationDataSourcePolicy getDefaultDataSourcePolicy();
- method public androidx.wear.complications.data.ComplicationType getDefaultDataSourceType();
+ method public androidx.wear.watchface.complications.data.ComplicationType getCurrentType();
+ method public androidx.wear.watchface.complications.DefaultComplicationDataSourcePolicy getDefaultDataSourcePolicy();
+ method public androidx.wear.watchface.complications.data.ComplicationType getDefaultDataSourceType();
method public boolean getFixedComplicationDataSource();
- method public java.util.List<androidx.wear.complications.data.ComplicationType> getSupportedTypes();
+ method public java.util.List<androidx.wear.watchface.complications.data.ComplicationType> getSupportedTypes();
method public boolean isEnabled();
method public boolean isInitiallyEnabled();
property public final android.graphics.Rect bounds;
property public final int boundsType;
property public final android.os.Bundle complicationConfigExtras;
- property public final androidx.wear.complications.data.ComplicationType currentType;
- property public final androidx.wear.complications.DefaultComplicationDataSourcePolicy defaultDataSourcePolicy;
- property public final androidx.wear.complications.data.ComplicationType defaultDataSourceType;
+ property public final androidx.wear.watchface.complications.data.ComplicationType currentType;
+ property public final androidx.wear.watchface.complications.DefaultComplicationDataSourcePolicy defaultDataSourcePolicy;
+ property public final androidx.wear.watchface.complications.data.ComplicationType defaultDataSourceType;
property public final boolean fixedComplicationDataSource;
property public final boolean isEnabled;
property public final boolean isInitiallyEnabled;
- property public final java.util.List<androidx.wear.complications.data.ComplicationType> supportedTypes;
+ property public final java.util.List<androidx.wear.watchface.complications.data.ComplicationType> supportedTypes;
}
public final class DefaultComplicationDataSourcePolicyAndType {
- ctor public DefaultComplicationDataSourcePolicyAndType(androidx.wear.complications.DefaultComplicationDataSourcePolicy policy, androidx.wear.complications.data.ComplicationType type);
- method public androidx.wear.complications.DefaultComplicationDataSourcePolicy getPolicy();
- method public androidx.wear.complications.data.ComplicationType getType();
- property public final androidx.wear.complications.DefaultComplicationDataSourcePolicy policy;
- property public final androidx.wear.complications.data.ComplicationType type;
+ ctor public DefaultComplicationDataSourcePolicyAndType(androidx.wear.watchface.complications.DefaultComplicationDataSourcePolicy policy, androidx.wear.watchface.complications.data.ComplicationType type);
+ method public androidx.wear.watchface.complications.DefaultComplicationDataSourcePolicy getPolicy();
+ method public androidx.wear.watchface.complications.data.ComplicationType getType();
+ property public final androidx.wear.watchface.complications.DefaultComplicationDataSourcePolicy policy;
+ property public final androidx.wear.watchface.complications.data.ComplicationType type;
}
public final class DeviceConfig {
@@ -59,12 +59,12 @@
}
public final class EditorState {
- method public java.util.Map<java.lang.Integer,androidx.wear.complications.data.ComplicationData> getPreviewComplicationsData();
+ method public java.util.Map<java.lang.Integer,androidx.wear.watchface.complications.data.ComplicationData> getPreviewComplicationsData();
method public android.graphics.Bitmap? getPreviewImage();
method public boolean getShouldCommitChanges();
method public androidx.wear.watchface.style.UserStyleData getUserStyle();
method public androidx.wear.watchface.client.WatchFaceId getWatchFaceId();
- property public final java.util.Map<java.lang.Integer,androidx.wear.complications.data.ComplicationData> previewComplicationsData;
+ property public final java.util.Map<java.lang.Integer,androidx.wear.watchface.complications.data.ComplicationData> previewComplicationsData;
property public final android.graphics.Bitmap? previewImage;
property public final boolean shouldCommitChanges;
property public final androidx.wear.watchface.style.UserStyleData userStyle;
@@ -82,8 +82,8 @@
method @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public androidx.wear.watchface.style.UserStyleSchema getUserStyleSchema();
method @AnyThread public boolean isConnectionAlive();
method @AnyThread public void removeClientDisconnectListener(androidx.wear.watchface.client.HeadlessWatchFaceClient.ClientDisconnectListener listener);
- method @RequiresApi(27) @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public android.graphics.Bitmap? renderComplicationToBitmap(int complicationSlotId, androidx.wear.watchface.RenderParameters renderParameters, java.time.Instant instant, androidx.wear.complications.data.ComplicationData complicationData, androidx.wear.watchface.style.UserStyle? userStyle) throws android.os.RemoteException;
- method @RequiresApi(27) @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public android.graphics.Bitmap renderWatchFaceToBitmap(androidx.wear.watchface.RenderParameters renderParameters, java.time.Instant instant, androidx.wear.watchface.style.UserStyle? userStyle, java.util.Map<java.lang.Integer,? extends androidx.wear.complications.data.ComplicationData>? slotIdToComplicationData) throws android.os.RemoteException;
+ method @RequiresApi(27) @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public android.graphics.Bitmap? renderComplicationToBitmap(int complicationSlotId, androidx.wear.watchface.RenderParameters renderParameters, java.time.Instant instant, androidx.wear.watchface.complications.data.ComplicationData complicationData, androidx.wear.watchface.style.UserStyle? userStyle) throws android.os.RemoteException;
+ method @RequiresApi(27) @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public android.graphics.Bitmap renderWatchFaceToBitmap(androidx.wear.watchface.RenderParameters renderParameters, java.time.Instant instant, androidx.wear.watchface.style.UserStyle? userStyle, java.util.Map<java.lang.Integer,? extends androidx.wear.watchface.complications.data.ComplicationData>? slotIdToComplicationData) throws android.os.RemoteException;
method public android.os.Bundle toBundle();
property @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public abstract java.util.Map<java.lang.Integer,androidx.wear.watchface.client.ComplicationSlotState> complicationSlotsState;
property @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public abstract java.time.Instant previewReferenceInstant;
@@ -102,7 +102,7 @@
public interface InteractiveWatchFaceClient extends java.lang.AutoCloseable {
method @AnyThread public void addClientDisconnectListener(androidx.wear.watchface.client.InteractiveWatchFaceClient.ClientDisconnectListener listener, java.util.concurrent.Executor executor);
- method public void addWatchFaceReadyListener(androidx.wear.watchface.client.InteractiveWatchFaceClient.WatchFaceReadyListener listener, java.util.concurrent.Executor executor);
+ method public void addWatchFaceReadyListener(java.util.concurrent.Executor executor, androidx.wear.watchface.client.InteractiveWatchFaceClient.OnWatchFaceReadyListener listener);
method @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public default Integer? getComplicationIdAt(@Px int x, @Px int y) throws android.os.RemoteException;
method @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public java.util.Map<java.lang.Integer,androidx.wear.watchface.client.ComplicationSlotState> getComplicationSlotsState();
method @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public java.util.List<androidx.wear.watchface.ContentDescriptionLabel> getContentDescriptionLabels();
@@ -112,11 +112,11 @@
method @AnyThread public boolean isConnectionAlive();
method @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public void performAmbientTick() throws android.os.RemoteException;
method @AnyThread public void removeClientDisconnectListener(androidx.wear.watchface.client.InteractiveWatchFaceClient.ClientDisconnectListener listener);
- method public void removeWatchFaceReadyListener(androidx.wear.watchface.client.InteractiveWatchFaceClient.WatchFaceReadyListener listener);
- method @RequiresApi(27) @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public android.graphics.Bitmap renderWatchFaceToBitmap(androidx.wear.watchface.RenderParameters renderParameters, java.time.Instant instant, androidx.wear.watchface.style.UserStyle? userStyle, java.util.Map<java.lang.Integer,? extends androidx.wear.complications.data.ComplicationData>? idAndComplicationData) throws android.os.RemoteException;
+ method public void removeWatchFaceReadyListener(androidx.wear.watchface.client.InteractiveWatchFaceClient.OnWatchFaceReadyListener listener);
+ method @RequiresApi(27) @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public android.graphics.Bitmap renderWatchFaceToBitmap(androidx.wear.watchface.RenderParameters renderParameters, java.time.Instant instant, androidx.wear.watchface.style.UserStyle? userStyle, java.util.Map<java.lang.Integer,? extends androidx.wear.watchface.complications.data.ComplicationData>? idAndComplicationData) throws android.os.RemoteException;
method @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public void sendTouchEvent(@Px int xPosition, @Px int yPosition, @androidx.wear.watchface.TapType int tapType) throws android.os.RemoteException;
method @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public void setWatchUiState(androidx.wear.watchface.client.WatchUiState watchUiState) throws android.os.RemoteException;
- method @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public void updateComplicationData(java.util.Map<java.lang.Integer,? extends androidx.wear.complications.data.ComplicationData> slotIdToComplicationData) throws android.os.RemoteException;
+ method @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public void updateComplicationData(java.util.Map<java.lang.Integer,? extends androidx.wear.watchface.complications.data.ComplicationData> slotIdToComplicationData) throws android.os.RemoteException;
method @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public void updateWatchFaceInstance(String newInstanceId, androidx.wear.watchface.style.UserStyle userStyle) throws android.os.RemoteException;
method @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public void updateWatchFaceInstance(String newInstanceId, androidx.wear.watchface.style.UserStyleData userStyle) throws android.os.RemoteException;
property @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public abstract java.util.Map<java.lang.Integer,androidx.wear.watchface.client.ComplicationSlotState> complicationSlotsState;
@@ -140,7 +140,7 @@
field public static final int TAP_TYPE_UP = 2; // 0x2
}
- public static fun interface InteractiveWatchFaceClient.WatchFaceReadyListener {
+ public static fun interface InteractiveWatchFaceClient.OnWatchFaceReadyListener {
method public void onWatchFaceReady();
}
@@ -150,7 +150,7 @@
method @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public java.util.Map<java.lang.Integer,androidx.wear.watchface.client.DefaultComplicationDataSourcePolicyAndType> getDefaultComplicationDataSourcePoliciesAndType(android.content.ComponentName watchFaceName) throws android.os.RemoteException;
method @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public androidx.wear.watchface.client.EditorServiceClient getEditorServiceClient() throws android.os.RemoteException;
method @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public androidx.wear.watchface.client.InteractiveWatchFaceClient? getInteractiveWatchFaceClientInstance(String instanceId) throws android.os.RemoteException;
- method @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public suspend Object? getOrCreateInteractiveWatchFaceClient(String id, androidx.wear.watchface.client.DeviceConfig deviceConfig, androidx.wear.watchface.client.WatchUiState watchUiState, androidx.wear.watchface.style.UserStyleData? userStyle, java.util.Map<java.lang.Integer,? extends androidx.wear.complications.data.ComplicationData>? slotIdToComplicationData, kotlin.coroutines.Continuation<? super androidx.wear.watchface.client.InteractiveWatchFaceClient> p) throws android.os.RemoteException;
+ method @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public suspend Object? getOrCreateInteractiveWatchFaceClient(String id, androidx.wear.watchface.client.DeviceConfig deviceConfig, androidx.wear.watchface.client.WatchUiState watchUiState, androidx.wear.watchface.style.UserStyleData? userStyle, java.util.Map<java.lang.Integer,? extends androidx.wear.watchface.complications.data.ComplicationData>? slotIdToComplicationData, kotlin.coroutines.Continuation<? super androidx.wear.watchface.client.InteractiveWatchFaceClient> p) throws android.os.RemoteException;
field public static final androidx.wear.watchface.client.WatchFaceControlClient.Companion Companion;
}
diff --git a/wear/wear-watchface-client/build.gradle b/wear/watchface/watchface-client/build.gradle
similarity index 87%
rename from wear/wear-watchface-client/build.gradle
rename to wear/watchface/watchface-client/build.gradle
index 732cae8..f20ada4 100644
--- a/wear/wear-watchface-client/build.gradle
+++ b/wear/watchface/watchface-client/build.gradle
@@ -27,14 +27,14 @@
dependencies {
api("androidx.annotation:annotation:1.1.0")
- api(project(":wear:wear-watchface"))
- api(project(":wear:wear-watchface-data"))
- api(project(":wear:wear-watchface-style"))
- api(project(":wear:wear-complications-data"))
+ api(project(":wear:watchface:watchface"))
+ api(project(":wear:watchface:watchface-data"))
+ api(project(":wear:watchface:watchface-style"))
+ api(project(":wear:watchface:watchface-complications-data"))
api(libs.kotlinCoroutinesAndroid)
androidTestImplementation(project(":test:screenshot:screenshot"))
- androidTestImplementation(project(":wear:wear-watchface-samples"))
+ androidTestImplementation(project(":wear:watchface:watchface-samples"))
androidTestImplementation(libs.testExtJunit)
androidTestImplementation(libs.testCore)
androidTestImplementation(libs.testRunner)
@@ -73,8 +73,7 @@
androidx {
name = "Android Wear Watchface Client"
publish = Publish.SNAPSHOT_AND_RELEASE
- mavenGroup = LibraryGroups.WEAR
- mavenVersion = LibraryVersions.WEAR_WATCHFACE_CLIENT
+ mavenGroup = LibraryGroups.WEAR_WATCHFACE
inceptionYear = "2020"
description = "Client library for controlling androidx watchfaces"
}
diff --git a/wear/watchface/watchface-client/lint-baseline.xml b/wear/watchface/watchface-client/lint-baseline.xml
new file mode 100644
index 0000000..32ce6d3
--- /dev/null
+++ b/wear/watchface/watchface-client/lint-baseline.xml
@@ -0,0 +1,59 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<issues format="6" by="lint 7.2.0-dev" type="baseline" client="gradle" dependencies="false" name="AGP (7.2.0-dev)" variant="all" version="7.2.0-dev">
+
+ <issue
+ id="NewApi"
+ message="Call requires API level 30 (current min is 26): `WatchFaceId`"
+ errorLine1=" WatchFaceId(watchFaceInstanceId ?: ""),"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/main/java/androidx/wear/watchface/client/EditorState.kt"
+ line="94"
+ column="9"/>
+ </issue>
+
+ <issue
+ id="NewApi"
+ message="Call requires API level 27 (current min is 26): `WatchFaceControlService`"
+ errorLine1=" private val realService = object : WatchFaceControlService() {"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/androidTest/java/androidx/wear/watchface/client/test/WatchFaceControlTestService.kt"
+ line="43"
+ column="31"/>
+ </issue>
+
+ <issue
+ id="NewApi"
+ message="Extending WatchFaceControlService requires API level 27 (current min is 26): `WatchFaceControlService`"
+ errorLine1=" private val realService = object : WatchFaceControlService() {"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/androidTest/java/androidx/wear/watchface/client/test/WatchFaceControlTestService.kt"
+ line="43"
+ column="40"/>
+ </issue>
+
+ <issue
+ id="NewApi"
+ message="Call requires API level 27 (current min is 26): `IWatchFaceInstanceServiceStub`"
+ errorLine1=" object : IWatchFaceInstanceServiceStub(this, Handler(Looper.getMainLooper())) {"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/androidTest/java/androidx/wear/watchface/client/test/WatchFaceControlTestService.kt"
+ line="45"
+ column="13"/>
+ </issue>
+
+ <issue
+ id="NewApi"
+ message="Extending IWatchFaceInstanceServiceStub requires API level 27 (current min is 26): `IWatchFaceInstanceServiceStub`"
+ errorLine1=" object : IWatchFaceInstanceServiceStub(this, Handler(Looper.getMainLooper())) {"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/androidTest/java/androidx/wear/watchface/client/test/WatchFaceControlTestService.kt"
+ line="45"
+ column="22"/>
+ </issue>
+
+</issues>
diff --git a/wear/wear-watchface-client/src/androidTest/AndroidManifest.xml b/wear/watchface/watchface-client/src/androidTest/AndroidManifest.xml
similarity index 100%
rename from wear/wear-watchface-client/src/androidTest/AndroidManifest.xml
rename to wear/watchface/watchface-client/src/androidTest/AndroidManifest.xml
diff --git a/wear/wear-watchface-client/src/androidTest/java/androidx/wear/watchface/client/test/EditorServiceClientTest.kt b/wear/watchface/watchface-client/src/androidTest/java/androidx/wear/watchface/client/test/EditorServiceClientTest.kt
similarity index 100%
rename from wear/wear-watchface-client/src/androidTest/java/androidx/wear/watchface/client/test/EditorServiceClientTest.kt
rename to wear/watchface/watchface-client/src/androidTest/java/androidx/wear/watchface/client/test/EditorServiceClientTest.kt
diff --git a/wear/wear-watchface-client/src/androidTest/java/androidx/wear/watchface/client/test/SerializationTest.kt b/wear/watchface/watchface-client/src/androidTest/java/androidx/wear/watchface/client/test/SerializationTest.kt
similarity index 96%
rename from wear/wear-watchface-client/src/androidTest/java/androidx/wear/watchface/client/test/SerializationTest.kt
rename to wear/watchface/watchface-client/src/androidTest/java/androidx/wear/watchface/client/test/SerializationTest.kt
index 8d8b84a..e27eae2 100644
--- a/wear/wear-watchface-client/src/androidTest/java/androidx/wear/watchface/client/test/SerializationTest.kt
+++ b/wear/watchface/watchface-client/src/androidTest/java/androidx/wear/watchface/client/test/SerializationTest.kt
@@ -24,11 +24,11 @@
import androidx.test.core.app.ApplicationProvider
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.MediumTest
-import androidx.wear.complications.SystemDataSources
-import androidx.wear.complications.data.ComplicationType
-import androidx.wear.complications.data.LongTextComplicationData
-import androidx.wear.complications.data.ShortTextComplicationData
-import androidx.wear.complications.data.toApiComplicationData
+import androidx.wear.watchface.complications.SystemDataSources
+import androidx.wear.watchface.complications.data.ComplicationType
+import androidx.wear.watchface.complications.data.LongTextComplicationData
+import androidx.wear.watchface.complications.data.ShortTextComplicationData
+import androidx.wear.watchface.complications.data.toApiComplicationData
import androidx.wear.watchface.DrawMode
import androidx.wear.watchface.RenderParameters
import androidx.wear.watchface.client.ComplicationSlotState
diff --git a/wear/wear-watchface-client/src/androidTest/java/androidx/wear/watchface/client/test/WatchFaceControlClientTest.kt b/wear/watchface/watchface-client/src/androidTest/java/androidx/wear/watchface/client/test/WatchFaceControlClientTest.kt
similarity index 97%
rename from wear/wear-watchface-client/src/androidTest/java/androidx/wear/watchface/client/test/WatchFaceControlClientTest.kt
rename to wear/watchface/watchface-client/src/androidTest/java/androidx/wear/watchface/client/test/WatchFaceControlClientTest.kt
index 804a1bb..3a20108 100644
--- a/wear/wear-watchface-client/src/androidTest/java/androidx/wear/watchface/client/test/WatchFaceControlClientTest.kt
+++ b/wear/watchface/watchface-client/src/androidTest/java/androidx/wear/watchface/client/test/WatchFaceControlClientTest.kt
@@ -35,15 +35,15 @@
import androidx.test.filters.MediumTest
import androidx.test.screenshot.AndroidXScreenshotTestRule
import androidx.test.screenshot.assertAgainstGolden
-import androidx.wear.complications.ComplicationSlotBounds
-import androidx.wear.complications.DefaultComplicationDataSourcePolicy
-import androidx.wear.complications.SystemDataSources
-import androidx.wear.complications.data.ComplicationText
-import androidx.wear.complications.data.ComplicationType
-import androidx.wear.complications.data.LongTextComplicationData
-import androidx.wear.complications.data.PlainComplicationText
-import androidx.wear.complications.data.RangedValueComplicationData
-import androidx.wear.complications.data.ShortTextComplicationData
+import androidx.wear.watchface.complications.ComplicationSlotBounds
+import androidx.wear.watchface.complications.DefaultComplicationDataSourcePolicy
+import androidx.wear.watchface.complications.SystemDataSources
+import androidx.wear.watchface.complications.data.ComplicationText
+import androidx.wear.watchface.complications.data.ComplicationType
+import androidx.wear.watchface.complications.data.LongTextComplicationData
+import androidx.wear.watchface.complications.data.PlainComplicationText
+import androidx.wear.watchface.complications.data.RangedValueComplicationData
+import androidx.wear.watchface.complications.data.ShortTextComplicationData
import androidx.wear.watchface.CanvasType
import androidx.wear.watchface.ComplicationSlot
import androidx.wear.watchface.ComplicationSlotBoundsType
@@ -1131,8 +1131,8 @@
try {
val wfReady = CompletableDeferred<Unit>()
interactiveInstance.addWatchFaceReadyListener(
- { wfReady.complete(Unit) },
- { runnable -> runnable.run() }
+ { runnable -> runnable.run() },
+ { wfReady.complete(Unit) }
)
assertThat(wfReady.isCompleted).isFalse()
@@ -1183,10 +1183,10 @@
try {
var listenerCalled = false
val listener =
- InteractiveWatchFaceClient.WatchFaceReadyListener { listenerCalled = true }
+ InteractiveWatchFaceClient.OnWatchFaceReadyListener { listenerCalled = true }
interactiveInstance.addWatchFaceReadyListener(
- listener,
- { runnable -> runnable.run() }
+ { runnable -> runnable.run() },
+ listener
)
interactiveInstance.removeWatchFaceReadyListener(listener)
assertThat(listenerCalled).isFalse()
@@ -1237,8 +1237,8 @@
try {
val wfReady = CompletableDeferred<Unit>()
interactiveInstance.addWatchFaceReadyListener(
- { wfReady.complete(Unit) },
- { runnable -> runnable.run() }
+ { runnable -> runnable.run() },
+ { wfReady.complete(Unit) }
)
assertThat(wfReady.isCompleted).isFalse()
diff --git a/wear/wear-watchface-client/src/androidTest/java/androidx/wear/watchface/client/test/WatchFaceControlTestService.kt b/wear/watchface/watchface-client/src/androidTest/java/androidx/wear/watchface/client/test/WatchFaceControlTestService.kt
similarity index 100%
rename from wear/wear-watchface-client/src/androidTest/java/androidx/wear/watchface/client/test/WatchFaceControlTestService.kt
rename to wear/watchface/watchface-client/src/androidTest/java/androidx/wear/watchface/client/test/WatchFaceControlTestService.kt
diff --git a/wear/wear-watchface-client/src/androidTest/java/androidx/wear/watchface/client/test/WatchFaceMetadataServiceTest.kt b/wear/watchface/watchface-client/src/androidTest/java/androidx/wear/watchface/client/test/WatchFaceMetadataServiceTest.kt
similarity index 97%
rename from wear/wear-watchface-client/src/androidTest/java/androidx/wear/watchface/client/test/WatchFaceMetadataServiceTest.kt
rename to wear/watchface/watchface-client/src/androidTest/java/androidx/wear/watchface/client/test/WatchFaceMetadataServiceTest.kt
index 061359a..f81a2d4 100644
--- a/wear/wear-watchface-client/src/androidTest/java/androidx/wear/watchface/client/test/WatchFaceMetadataServiceTest.kt
+++ b/wear/watchface/watchface-client/src/androidTest/java/androidx/wear/watchface/client/test/WatchFaceMetadataServiceTest.kt
@@ -23,8 +23,8 @@
import androidx.test.core.app.ApplicationProvider
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.MediumTest
-import androidx.wear.complications.SystemDataSources
-import androidx.wear.complications.data.ComplicationType
+import androidx.wear.watchface.complications.SystemDataSources
+import androidx.wear.watchface.complications.data.ComplicationType
import androidx.wear.watchface.client.WatchFaceClientExperimental
import androidx.wear.watchface.client.WatchFaceMetadataClient
import androidx.wear.watchface.control.WatchFaceControlService
diff --git a/wear/wear-watchface-client/src/androidTest/res/raw/complication_render_params b/wear/watchface/watchface-client/src/androidTest/res/raw/complication_render_params
similarity index 100%
rename from wear/wear-watchface-client/src/androidTest/res/raw/complication_render_params
rename to wear/watchface/watchface-client/src/androidTest/res/raw/complication_render_params
diff --git a/wear/wear-watchface-client/src/androidTest/res/raw/complication_state b/wear/watchface/watchface-client/src/androidTest/res/raw/complication_state
similarity index 100%
rename from wear/wear-watchface-client/src/androidTest/res/raw/complication_state
rename to wear/watchface/watchface-client/src/androidTest/res/raw/complication_state
diff --git a/wear/wear-watchface-client/src/androidTest/res/raw/editor_state b/wear/watchface/watchface-client/src/androidTest/res/raw/editor_state
similarity index 100%
rename from wear/wear-watchface-client/src/androidTest/res/raw/editor_state
rename to wear/watchface/watchface-client/src/androidTest/res/raw/editor_state
diff --git a/wear/wear-watchface-client/src/androidTest/res/raw/headless_watchface_instance_params b/wear/watchface/watchface-client/src/androidTest/res/raw/headless_watchface_instance_params
similarity index 100%
rename from wear/wear-watchface-client/src/androidTest/res/raw/headless_watchface_instance_params
rename to wear/watchface/watchface-client/src/androidTest/res/raw/headless_watchface_instance_params
diff --git a/wear/wear-watchface-client/src/androidTest/res/raw/wallpaper_interactive_watchface_instance_params b/wear/watchface/watchface-client/src/androidTest/res/raw/wallpaper_interactive_watchface_instance_params
similarity index 100%
rename from wear/wear-watchface-client/src/androidTest/res/raw/wallpaper_interactive_watchface_instance_params
rename to wear/watchface/watchface-client/src/androidTest/res/raw/wallpaper_interactive_watchface_instance_params
diff --git a/wear/wear-watchface-client/src/androidTest/res/raw/watch_face_render_params b/wear/watchface/watchface-client/src/androidTest/res/raw/watch_face_render_params
similarity index 100%
rename from wear/wear-watchface-client/src/androidTest/res/raw/watch_face_render_params
rename to wear/watchface/watchface-client/src/androidTest/res/raw/watch_face_render_params
diff --git a/wear/wear-watchface-client/src/main/AndroidManifest.xml b/wear/watchface/watchface-client/src/main/AndroidManifest.xml
similarity index 100%
rename from wear/wear-watchface-client/src/main/AndroidManifest.xml
rename to wear/watchface/watchface-client/src/main/AndroidManifest.xml
diff --git a/wear/wear-watchface-client/src/main/java/androidx/wear/watchface/client/BindHelper.kt b/wear/watchface/watchface-client/src/main/java/androidx/wear/watchface/client/BindHelper.kt
similarity index 100%
rename from wear/wear-watchface-client/src/main/java/androidx/wear/watchface/client/BindHelper.kt
rename to wear/watchface/watchface-client/src/main/java/androidx/wear/watchface/client/BindHelper.kt
diff --git a/wear/wear-watchface-client/src/main/java/androidx/wear/watchface/client/ComplicationSlotState.kt b/wear/watchface/watchface-client/src/main/java/androidx/wear/watchface/client/ComplicationSlotState.kt
similarity index 94%
rename from wear/wear-watchface-client/src/main/java/androidx/wear/watchface/client/ComplicationSlotState.kt
rename to wear/watchface/watchface-client/src/main/java/androidx/wear/watchface/client/ComplicationSlotState.kt
index 103a99b..135bb6a 100644
--- a/wear/wear-watchface-client/src/main/java/androidx/wear/watchface/client/ComplicationSlotState.kt
+++ b/wear/watchface/watchface-client/src/main/java/androidx/wear/watchface/client/ComplicationSlotState.kt
@@ -19,9 +19,9 @@
import android.graphics.Rect
import android.os.Bundle
import androidx.annotation.RestrictTo
-import androidx.wear.complications.DefaultComplicationDataSourcePolicy
-import androidx.wear.complications.data.ComplicationData
-import androidx.wear.complications.data.ComplicationType
+import androidx.wear.watchface.complications.DefaultComplicationDataSourcePolicy
+import androidx.wear.watchface.complications.data.ComplicationData
+import androidx.wear.watchface.complications.data.ComplicationType
import androidx.wear.watchface.ComplicationSlot
import androidx.wear.watchface.ComplicationSlotBoundsType
import androidx.wear.watchface.data.ComplicationStateWireFormat
diff --git a/wear/wear-watchface-client/src/main/java/androidx/wear/watchface/client/DeviceConfig.kt b/wear/watchface/watchface-client/src/main/java/androidx/wear/watchface/client/DeviceConfig.kt
similarity index 100%
rename from wear/wear-watchface-client/src/main/java/androidx/wear/watchface/client/DeviceConfig.kt
rename to wear/watchface/watchface-client/src/main/java/androidx/wear/watchface/client/DeviceConfig.kt
diff --git a/wear/wear-watchface-client/src/main/java/androidx/wear/watchface/client/EditorServiceClient.kt b/wear/watchface/watchface-client/src/main/java/androidx/wear/watchface/client/EditorServiceClient.kt
similarity index 100%
rename from wear/wear-watchface-client/src/main/java/androidx/wear/watchface/client/EditorServiceClient.kt
rename to wear/watchface/watchface-client/src/main/java/androidx/wear/watchface/client/EditorServiceClient.kt
diff --git a/wear/wear-watchface-client/src/main/java/androidx/wear/watchface/client/EditorState.kt b/wear/watchface/watchface-client/src/main/java/androidx/wear/watchface/client/EditorState.kt
similarity index 96%
rename from wear/wear-watchface-client/src/main/java/androidx/wear/watchface/client/EditorState.kt
rename to wear/watchface/watchface-client/src/main/java/androidx/wear/watchface/client/EditorState.kt
index 4b0ffe4..bf9ab79 100644
--- a/wear/wear-watchface-client/src/main/java/androidx/wear/watchface/client/EditorState.kt
+++ b/wear/watchface/watchface-client/src/main/java/androidx/wear/watchface/client/EditorState.kt
@@ -21,8 +21,8 @@
import android.support.wearable.watchface.SharedMemoryImage
import androidx.annotation.RequiresApi
import androidx.annotation.RestrictTo
-import androidx.wear.complications.data.ComplicationData
-import androidx.wear.complications.data.toApiComplicationData
+import androidx.wear.watchface.complications.data.ComplicationData
+import androidx.wear.watchface.complications.data.toApiComplicationData
import androidx.wear.watchface.editor.data.EditorStateWireFormat
import androidx.wear.watchface.style.UserStyle
import androidx.wear.watchface.style.UserStyleData
diff --git a/wear/wear-watchface-client/src/main/java/androidx/wear/watchface/client/HeadlessWatchFaceClient.kt b/wear/watchface/watchface-client/src/main/java/androidx/wear/watchface/client/HeadlessWatchFaceClient.kt
similarity index 98%
rename from wear/wear-watchface-client/src/main/java/androidx/wear/watchface/client/HeadlessWatchFaceClient.kt
rename to wear/watchface/watchface-client/src/main/java/androidx/wear/watchface/client/HeadlessWatchFaceClient.kt
index 1079820..525c1fa 100644
--- a/wear/wear-watchface-client/src/main/java/androidx/wear/watchface/client/HeadlessWatchFaceClient.kt
+++ b/wear/watchface/watchface-client/src/main/java/androidx/wear/watchface/client/HeadlessWatchFaceClient.kt
@@ -22,8 +22,8 @@
import android.support.wearable.watchface.SharedMemoryImage
import androidx.annotation.AnyThread
import androidx.annotation.RequiresApi
-import androidx.wear.complications.data.ComplicationData
-import androidx.wear.utility.TraceEvent
+import androidx.wear.watchface.complications.data.ComplicationData
+import androidx.wear.watchface.utility.TraceEvent
import androidx.wear.watchface.ComplicationSlot
import androidx.wear.watchface.ComplicationSlotsManager
import androidx.wear.watchface.RenderParameters
diff --git a/wear/wear-watchface-client/src/main/java/androidx/wear/watchface/client/InteractiveWatchFaceClient.kt b/wear/watchface/watchface-client/src/main/java/androidx/wear/watchface/client/InteractiveWatchFaceClient.kt
similarity index 93%
rename from wear/wear-watchface-client/src/main/java/androidx/wear/watchface/client/InteractiveWatchFaceClient.kt
rename to wear/watchface/watchface-client/src/main/java/androidx/wear/watchface/client/InteractiveWatchFaceClient.kt
index 149e9ec..8f28d48 100644
--- a/wear/wear-watchface-client/src/main/java/androidx/wear/watchface/client/InteractiveWatchFaceClient.kt
+++ b/wear/watchface/watchface-client/src/main/java/androidx/wear/watchface/client/InteractiveWatchFaceClient.kt
@@ -24,9 +24,9 @@
import androidx.annotation.AnyThread
import androidx.annotation.Px
import androidx.annotation.RequiresApi
-import androidx.wear.complications.data.ComplicationData
-import androidx.wear.complications.data.toApiComplicationText
-import androidx.wear.utility.TraceEvent
+import androidx.wear.watchface.complications.data.ComplicationData
+import androidx.wear.watchface.complications.data.toApiComplicationText
+import androidx.wear.watchface.utility.TraceEvent
import androidx.wear.watchface.ComplicationSlot
import androidx.wear.watchface.ComplicationSlotsManager
import androidx.wear.watchface.ContentDescriptionLabel
@@ -215,10 +215,10 @@
/**
* Interface passed to [addWatchFaceReadyListener] which calls
- * [WatchFaceReadyListener.onWatchFaceReady] when the watch face is ready to render. Use
- * [addWatchFaceReadyListener] to register a WatchFaceReadyListener.
+ * [OnWatchFaceReadyListener.onWatchFaceReady] when the watch face is ready to render. Use
+ * [addWatchFaceReadyListener] to register a OnWatchFaceReadyListener.
*/
- public fun interface WatchFaceReadyListener {
+ public fun interface OnWatchFaceReadyListener {
/**
* Called when the watchface is ready to render.
*
@@ -229,18 +229,21 @@
}
/**
- * Registers a [WatchFaceReadyListener] which gets called when the watch face is ready to
+ * Registers a [OnWatchFaceReadyListener] which gets called when the watch face is ready to
* render.
*
* Note in the event of the watch face disconnecting (e.g. due to a crash) the listener will
* never get called. Use [ClientDisconnectListener] to observe disconnects.
+ *
+ * @param executor The [Executor] on which to run [OnWatchFaceReadyListener].
+ * @param listener The [OnWatchFaceReadyListener] to run when the watchface is ready to render.
*/
- public fun addWatchFaceReadyListener(listener: WatchFaceReadyListener, executor: Executor)
+ public fun addWatchFaceReadyListener(executor: Executor, listener: OnWatchFaceReadyListener)
/**
* Stops listening for events registered by [addWatchFaceReadyListener].
*/
- public fun removeWatchFaceReadyListener(listener: WatchFaceReadyListener)
+ public fun removeWatchFaceReadyListener(listener: OnWatchFaceReadyListener)
}
/** Controls a stateful remote interactive watch face. */
@@ -252,7 +255,7 @@
private val disconnectListeners =
HashMap<InteractiveWatchFaceClient.ClientDisconnectListener, Executor>()
private val readyListeners =
- HashMap<InteractiveWatchFaceClient.WatchFaceReadyListener, Executor>()
+ HashMap<InteractiveWatchFaceClient.OnWatchFaceReadyListener, Executor>()
private var watchfaceReadyListenerRegistered = false
init {
@@ -435,7 +438,7 @@
}
internal fun onWatchFaceReady() {
- var listenerCopy: HashMap<InteractiveWatchFaceClient.WatchFaceReadyListener, Executor>
+ var listenerCopy: HashMap<InteractiveWatchFaceClient.OnWatchFaceReadyListener, Executor>
synchronized(lock) {
listenerCopy = HashMap(readyListeners)
@@ -449,8 +452,8 @@
}
override fun addWatchFaceReadyListener(
- listener: InteractiveWatchFaceClient.WatchFaceReadyListener,
- executor: Executor
+ executor: Executor,
+ listener: InteractiveWatchFaceClient.OnWatchFaceReadyListener
) {
synchronized(lock) {
require(!readyListeners.contains(listener)) {
@@ -462,7 +465,7 @@
}
override fun removeWatchFaceReadyListener(
- listener: InteractiveWatchFaceClient.WatchFaceReadyListener
+ listener: InteractiveWatchFaceClient.OnWatchFaceReadyListener
) {
synchronized(lock) {
readyListeners.remove(listener)
diff --git a/wear/wear-watchface-client/src/main/java/androidx/wear/watchface/client/WatchFaceClientExperimental.kt b/wear/watchface/watchface-client/src/main/java/androidx/wear/watchface/client/WatchFaceClientExperimental.kt
similarity index 100%
rename from wear/wear-watchface-client/src/main/java/androidx/wear/watchface/client/WatchFaceClientExperimental.kt
rename to wear/watchface/watchface-client/src/main/java/androidx/wear/watchface/client/WatchFaceClientExperimental.kt
diff --git a/wear/wear-watchface-client/src/main/java/androidx/wear/watchface/client/WatchFaceControlClient.kt b/wear/watchface/watchface-client/src/main/java/androidx/wear/watchface/client/WatchFaceControlClient.kt
similarity index 97%
rename from wear/wear-watchface-client/src/main/java/androidx/wear/watchface/client/WatchFaceControlClient.kt
rename to wear/watchface/watchface-client/src/main/java/androidx/wear/watchface/client/WatchFaceControlClient.kt
index ba77278..d5f53af 100644
--- a/wear/wear-watchface-client/src/main/java/androidx/wear/watchface/client/WatchFaceControlClient.kt
+++ b/wear/watchface/watchface-client/src/main/java/androidx/wear/watchface/client/WatchFaceControlClient.kt
@@ -24,11 +24,11 @@
import android.os.RemoteException
import androidx.annotation.Px
import androidx.annotation.RestrictTo
-import androidx.wear.complications.DefaultComplicationDataSourcePolicy
-import androidx.wear.complications.data.ComplicationData
-import androidx.wear.complications.data.ComplicationType
-import androidx.wear.utility.AsyncTraceEvent
-import androidx.wear.utility.TraceEvent
+import androidx.wear.watchface.complications.DefaultComplicationDataSourcePolicy
+import androidx.wear.watchface.complications.data.ComplicationData
+import androidx.wear.watchface.complications.data.ComplicationType
+import androidx.wear.watchface.utility.AsyncTraceEvent
+import androidx.wear.watchface.utility.TraceEvent
import androidx.wear.watchface.control.IInteractiveWatchFace
import androidx.wear.watchface.control.IPendingInteractiveWatchFace
import androidx.wear.watchface.control.IWatchFaceControlService
diff --git a/wear/wear-watchface-client/src/main/java/androidx/wear/watchface/client/WatchFaceMetadataClient.kt b/wear/watchface/watchface-client/src/main/java/androidx/wear/watchface/client/WatchFaceMetadataClient.kt
similarity index 97%
rename from wear/wear-watchface-client/src/main/java/androidx/wear/watchface/client/WatchFaceMetadataClient.kt
rename to wear/watchface/watchface-client/src/main/java/androidx/wear/watchface/client/WatchFaceMetadataClient.kt
index 7028eb3..aa84999 100644
--- a/wear/wear-watchface-client/src/main/java/androidx/wear/watchface/client/WatchFaceMetadataClient.kt
+++ b/wear/watchface/watchface-client/src/main/java/androidx/wear/watchface/client/WatchFaceMetadataClient.kt
@@ -25,11 +25,11 @@
import android.os.IBinder
import android.os.RemoteException
import androidx.annotation.RestrictTo
-import androidx.wear.complications.ComplicationSlotBounds
-import androidx.wear.complications.DefaultComplicationDataSourcePolicy
-import androidx.wear.complications.data.ComplicationType
-import androidx.wear.utility.AsyncTraceEvent
-import androidx.wear.utility.TraceEvent
+import androidx.wear.watchface.complications.ComplicationSlotBounds
+import androidx.wear.watchface.complications.DefaultComplicationDataSourcePolicy
+import androidx.wear.watchface.complications.data.ComplicationType
+import androidx.wear.watchface.utility.AsyncTraceEvent
+import androidx.wear.watchface.utility.TraceEvent
import androidx.wear.watchface.client.WatchFaceControlClient.Companion.createWatchFaceControlClient
import androidx.wear.watchface.control.IWatchFaceControlService
import androidx.wear.watchface.control.WatchFaceControlService
diff --git a/wear/wear-watchface-client/src/main/java/androidx/wear/watchface/client/WatchUiState.kt b/wear/watchface/watchface-client/src/main/java/androidx/wear/watchface/client/WatchUiState.kt
similarity index 100%
rename from wear/wear-watchface-client/src/main/java/androidx/wear/watchface/client/WatchUiState.kt
rename to wear/watchface/watchface-client/src/main/java/androidx/wear/watchface/client/WatchUiState.kt
diff --git a/wear/wear-watchface-client/src/test/java/androidx/wear/watchface/client/WatchFaceIdTest.kt b/wear/watchface/watchface-client/src/test/java/androidx/wear/watchface/client/WatchFaceIdTest.kt
similarity index 100%
rename from wear/wear-watchface-client/src/test/java/androidx/wear/watchface/client/WatchFaceIdTest.kt
rename to wear/watchface/watchface-client/src/test/java/androidx/wear/watchface/client/WatchFaceIdTest.kt
diff --git a/wear/wear-watchface-client/src/test/resources/robolectric.properties b/wear/watchface/watchface-client/src/test/resources/robolectric.properties
similarity index 100%
rename from wear/wear-watchface-client/src/test/resources/robolectric.properties
rename to wear/watchface/watchface-client/src/test/resources/robolectric.properties
diff --git a/wear/watchface/watchface-complications-data-source-ktx/api/current.txt b/wear/watchface/watchface-complications-data-source-ktx/api/current.txt
new file mode 100644
index 0000000..eabce2c
--- /dev/null
+++ b/wear/watchface/watchface-complications-data-source-ktx/api/current.txt
@@ -0,0 +1,11 @@
+// Signature format: 4.0
+package androidx.wear.watchface.complications.datasource {
+
+ public abstract class SuspendingComplicationDataSourceService extends androidx.wear.watchface.complications.datasource.ComplicationDataSourceService {
+ ctor public SuspendingComplicationDataSourceService();
+ method public final void onComplicationRequest(androidx.wear.watchface.complications.datasource.ComplicationRequest request, androidx.wear.watchface.complications.datasource.ComplicationDataSourceService.ComplicationRequestListener listener);
+ method @UiThread public abstract suspend Object? onComplicationRequest(androidx.wear.watchface.complications.datasource.ComplicationRequest request, kotlin.coroutines.Continuation<? super androidx.wear.watchface.complications.data.ComplicationData> p);
+ }
+
+}
+
diff --git a/wear/watchface/watchface-complications-data-source-ktx/api/public_plus_experimental_current.txt b/wear/watchface/watchface-complications-data-source-ktx/api/public_plus_experimental_current.txt
new file mode 100644
index 0000000..eabce2c
--- /dev/null
+++ b/wear/watchface/watchface-complications-data-source-ktx/api/public_plus_experimental_current.txt
@@ -0,0 +1,11 @@
+// Signature format: 4.0
+package androidx.wear.watchface.complications.datasource {
+
+ public abstract class SuspendingComplicationDataSourceService extends androidx.wear.watchface.complications.datasource.ComplicationDataSourceService {
+ ctor public SuspendingComplicationDataSourceService();
+ method public final void onComplicationRequest(androidx.wear.watchface.complications.datasource.ComplicationRequest request, androidx.wear.watchface.complications.datasource.ComplicationDataSourceService.ComplicationRequestListener listener);
+ method @UiThread public abstract suspend Object? onComplicationRequest(androidx.wear.watchface.complications.datasource.ComplicationRequest request, kotlin.coroutines.Continuation<? super androidx.wear.watchface.complications.data.ComplicationData> p);
+ }
+
+}
+
diff --git a/wear/wear-complications-data-source-ktx/api/res-current.txt b/wear/watchface/watchface-complications-data-source-ktx/api/res-current.txt
similarity index 100%
rename from wear/wear-complications-data-source-ktx/api/res-current.txt
rename to wear/watchface/watchface-complications-data-source-ktx/api/res-current.txt
diff --git a/wear/watchface/watchface-complications-data-source-ktx/api/restricted_current.txt b/wear/watchface/watchface-complications-data-source-ktx/api/restricted_current.txt
new file mode 100644
index 0000000..eabce2c
--- /dev/null
+++ b/wear/watchface/watchface-complications-data-source-ktx/api/restricted_current.txt
@@ -0,0 +1,11 @@
+// Signature format: 4.0
+package androidx.wear.watchface.complications.datasource {
+
+ public abstract class SuspendingComplicationDataSourceService extends androidx.wear.watchface.complications.datasource.ComplicationDataSourceService {
+ ctor public SuspendingComplicationDataSourceService();
+ method public final void onComplicationRequest(androidx.wear.watchface.complications.datasource.ComplicationRequest request, androidx.wear.watchface.complications.datasource.ComplicationDataSourceService.ComplicationRequestListener listener);
+ method @UiThread public abstract suspend Object? onComplicationRequest(androidx.wear.watchface.complications.datasource.ComplicationRequest request, kotlin.coroutines.Continuation<? super androidx.wear.watchface.complications.data.ComplicationData> p);
+ }
+
+}
+
diff --git a/wear/wear-complications-data-source-ktx/build.gradle b/wear/watchface/watchface-complications-data-source-ktx/build.gradle
similarity index 90%
rename from wear/wear-complications-data-source-ktx/build.gradle
rename to wear/watchface/watchface-complications-data-source-ktx/build.gradle
index 7608bd3..cb5bd1b 100644
--- a/wear/wear-complications-data-source-ktx/build.gradle
+++ b/wear/watchface/watchface-complications-data-source-ktx/build.gradle
@@ -25,7 +25,7 @@
dependencies {
implementation("androidx.core:core:1.1.0")
- api(project(":wear:wear-complications-data-source"))
+ api(project(":wear:watchface:watchface-complications-data-source"))
api(libs.kotlinStdlib)
testImplementation(libs.testCore)
testImplementation(libs.testRunner)
@@ -47,8 +47,7 @@
androidx {
name = "Android Wear Complications Data Source Ktx"
publish = Publish.SNAPSHOT_AND_RELEASE
- mavenGroup = LibraryGroups.WEAR
- mavenVersion = LibraryVersions.WEAR_COMPLICATIONS_DATA_SOURCE_KTX
+ mavenGroup = LibraryGroups.WEAR_WATCHFACE
inceptionYear = "2021"
description = "Kotlin suspend wrapper for Android Wear Complications Data Source"
}
diff --git a/wear/wear-complications-data-source-ktx/src/main/AndroidManifest.xml b/wear/watchface/watchface-complications-data-source-ktx/src/main/AndroidManifest.xml
similarity index 77%
copy from wear/wear-complications-data-source-ktx/src/main/AndroidManifest.xml
copy to wear/watchface/watchface-complications-data-source-ktx/src/main/AndroidManifest.xml
index 5e7a162..425c576 100644
--- a/wear/wear-complications-data-source-ktx/src/main/AndroidManifest.xml
+++ b/wear/watchface/watchface-complications-data-source-ktx/src/main/AndroidManifest.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
- package="androidx.wear.complications.datasource.ktx">
+ package="androidx.wear.watchface.complications.datasource.ktx">
<application>
<uses-library android:name="com.google.android.wearable" android:required="false" />
</application>
diff --git a/wear/wear-complications-data-source-ktx/src/main/java/androidx/wear/complications/datasource/SuspendingComplicationDataSourceService.kt b/wear/watchface/watchface-complications-data-source-ktx/src/main/java/androidx/wear/watchface/complications/datasource/SuspendingComplicationDataSourceService.kt
similarity index 93%
rename from wear/wear-complications-data-source-ktx/src/main/java/androidx/wear/complications/datasource/SuspendingComplicationDataSourceService.kt
rename to wear/watchface/watchface-complications-data-source-ktx/src/main/java/androidx/wear/watchface/complications/datasource/SuspendingComplicationDataSourceService.kt
index c608815..a001bfa 100644
--- a/wear/wear-complications-data-source-ktx/src/main/java/androidx/wear/complications/datasource/SuspendingComplicationDataSourceService.kt
+++ b/wear/watchface/watchface-complications-data-source-ktx/src/main/java/androidx/wear/watchface/complications/datasource/SuspendingComplicationDataSourceService.kt
@@ -14,10 +14,10 @@
* limitations under the License.
*/
-package androidx.wear.complications.datasource
+package androidx.wear.watchface.complications.datasource
import androidx.annotation.UiThread
-import androidx.wear.complications.data.ComplicationData
+import androidx.wear.watchface.complications.data.ComplicationData
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.SupervisorJob
diff --git a/wear/wear-complications-data-source-ktx/src/test/java/androidx/wear/complications/datasource/SuspendingComplicationDataSourceServiceTest.kt b/wear/watchface/watchface-complications-data-source-ktx/src/test/java/androidx/wear/watchface/complications/datasource/SuspendingComplicationDataSourceServiceTest.kt
similarity index 85%
rename from wear/wear-complications-data-source-ktx/src/test/java/androidx/wear/complications/datasource/SuspendingComplicationDataSourceServiceTest.kt
rename to wear/watchface/watchface-complications-data-source-ktx/src/test/java/androidx/wear/watchface/complications/datasource/SuspendingComplicationDataSourceServiceTest.kt
index bb821ade2..7774558 100644
--- a/wear/wear-complications-data-source-ktx/src/test/java/androidx/wear/complications/datasource/SuspendingComplicationDataSourceServiceTest.kt
+++ b/wear/watchface/watchface-complications-data-source-ktx/src/test/java/androidx/wear/watchface/complications/datasource/SuspendingComplicationDataSourceServiceTest.kt
@@ -14,15 +14,15 @@
* limitations under the License.
*/
-package androidx.wear.complications.datasource
+package androidx.wear.watchface.complications.datasource
import android.content.Context
import androidx.test.core.app.ApplicationProvider
-import androidx.wear.complications.data.ComplicationData
-import androidx.wear.complications.data.ComplicationText
-import androidx.wear.complications.data.ComplicationType
-import androidx.wear.complications.data.PlainComplicationText
-import androidx.wear.complications.data.ShortTextComplicationData
+import androidx.wear.watchface.complications.data.ComplicationData
+import androidx.wear.watchface.complications.data.ComplicationText
+import androidx.wear.watchface.complications.data.ComplicationType
+import androidx.wear.watchface.complications.data.PlainComplicationText
+import androidx.wear.watchface.complications.data.ShortTextComplicationData
import com.google.common.truth.Truth.assertThat
import org.junit.Test
import org.junit.runner.RunWith
@@ -52,8 +52,8 @@
return InstrumentationConfiguration.Builder(super.createClassLoaderConfig(method))
.doNotInstrumentPackage("android.support.wearable.complications")
.doNotInstrumentPackage("android.support.wearable.watchface")
- .doNotInstrumentPackage("androidx.wear.complications")
- .doNotInstrumentPackage("androidx.wear.complications.datasource")
+ .doNotInstrumentPackage("androidx.wear.watchface.complications")
+ .doNotInstrumentPackage("androidx.wear.watchface.complications.datasource")
.doNotInstrumentPackage("androidx.wear.watchface")
.build()
}
diff --git a/wear/wear-complications-data-source-ktx/src/test/resources/robolectric.properties b/wear/watchface/watchface-complications-data-source-ktx/src/test/resources/robolectric.properties
similarity index 100%
rename from wear/wear-complications-data-source-ktx/src/test/resources/robolectric.properties
rename to wear/watchface/watchface-complications-data-source-ktx/src/test/resources/robolectric.properties
diff --git a/wear/wear-complications-data-source-samples/build.gradle b/wear/watchface/watchface-complications-data-source-samples/build.gradle
similarity index 92%
rename from wear/wear-complications-data-source-samples/build.gradle
rename to wear/watchface/watchface-complications-data-source-samples/build.gradle
index 2690093..501ba62 100644
--- a/wear/wear-complications-data-source-samples/build.gradle
+++ b/wear/watchface/watchface-complications-data-source-samples/build.gradle
@@ -22,7 +22,7 @@
dependencies {
implementation("androidx.core:core:1.1.0")
- api(project(":wear:wear-complications-data-source"))
+ api(project(":wear:watchface:watchface-complications-data-source"))
api(libs.guavaAndroid)
api(libs.kotlinStdlib)
}
diff --git a/wear/wear-complications-data-source-samples/src/main/AndroidManifest.xml b/wear/watchface/watchface-complications-data-source-samples/src/main/AndroidManifest.xml
similarity index 89%
rename from wear/wear-complications-data-source-samples/src/main/AndroidManifest.xml
rename to wear/watchface/watchface-complications-data-source-samples/src/main/AndroidManifest.xml
index 93db297..01cc7e1 100644
--- a/wear/wear-complications-data-source-samples/src/main/AndroidManifest.xml
+++ b/wear/watchface/watchface-complications-data-source-samples/src/main/AndroidManifest.xml
@@ -15,14 +15,14 @@
limitations under the License.
-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
- package="androidx.wear.complications.datasource.samples">
+ package="androidx.wear.watchface.complications.datasource.samples">
<application
android:label="@string/app_name"
android:icon="@drawable/circle"
android:theme="@style/Theme.AppCompat.Light.NoActionBar">
<service
android:name=
- "androidx.wear.complications.datasource.samples.AsynchronousDataSourceService"
+ "androidx.wear.watchface.complications.datasource.samples.AsynchronousDataSourceService"
android:label="@string/asynchronous_data_source_name"
android:exported="true"
android:icon="@drawable/circle"
@@ -41,7 +41,7 @@
<service
android:name=
- "androidx.wear.complications.datasource.samples.BackgroundDataSourceService"
+ "androidx.wear.watchface.complications.datasource.samples.BackgroundDataSourceService"
android:label="@string/background_data_source_name"
android:exported="true"
android:icon="@drawable/circle"
@@ -60,7 +60,7 @@
<service
android:name=
- "androidx.wear.complications.datasource.samples.SynchronousDataSourceService"
+ "androidx.wear.watchface.complications.datasource.samples.SynchronousDataSourceService"
android:label="@string/synchronous_data_source_name"
android:exported="true"
android:icon="@drawable/circle"
diff --git a/wear/wear-complications-data-source-samples/src/main/java/androidx/wear/complications/datasource/samples/AsynchronousDataSourceService.kt b/wear/watchface/watchface-complications-data-source-samples/src/main/java/androidx/wear/watchface/complications/datasource/samples/AsynchronousDataSourceService.kt
similarity index 85%
rename from wear/wear-complications-data-source-samples/src/main/java/androidx/wear/complications/datasource/samples/AsynchronousDataSourceService.kt
rename to wear/watchface/watchface-complications-data-source-samples/src/main/java/androidx/wear/watchface/complications/datasource/samples/AsynchronousDataSourceService.kt
index 7fafd62..fff0351 100644
--- a/wear/wear-complications-data-source-samples/src/main/java/androidx/wear/complications/datasource/samples/AsynchronousDataSourceService.kt
+++ b/wear/watchface/watchface-complications-data-source-samples/src/main/java/androidx/wear/watchface/complications/datasource/samples/AsynchronousDataSourceService.kt
@@ -14,18 +14,18 @@
* limitations under the License.
*/
-package androidx.wear.complications.datasource.samples
+package androidx.wear.watchface.complications.datasource.samples
import android.graphics.Color
import android.text.SpannableString
import android.text.Spanned
import android.text.style.ForegroundColorSpan
-import androidx.wear.complications.datasource.ComplicationDataSourceService
-import androidx.wear.complications.datasource.ComplicationRequest
-import androidx.wear.complications.data.ComplicationText
-import androidx.wear.complications.data.ComplicationType
-import androidx.wear.complications.data.LongTextComplicationData
-import androidx.wear.complications.data.ShortTextComplicationData
+import androidx.wear.watchface.complications.datasource.ComplicationDataSourceService
+import androidx.wear.watchface.complications.datasource.ComplicationRequest
+import androidx.wear.watchface.complications.data.ComplicationText
+import androidx.wear.watchface.complications.data.ComplicationType
+import androidx.wear.watchface.complications.data.LongTextComplicationData
+import androidx.wear.watchface.complications.data.ShortTextComplicationData
import java.util.concurrent.Executors
/** A minimal complication data source which reports the ID of the complication asynchronously. */
diff --git a/wear/wear-complications-data-source-samples/src/main/java/androidx/wear/complications/datasource/samples/BackgroundDataSourceService.kt b/wear/watchface/watchface-complications-data-source-samples/src/main/java/androidx/wear/watchface/complications/datasource/samples/BackgroundDataSourceService.kt
similarity index 82%
rename from wear/wear-complications-data-source-samples/src/main/java/androidx/wear/complications/datasource/samples/BackgroundDataSourceService.kt
rename to wear/watchface/watchface-complications-data-source-samples/src/main/java/androidx/wear/watchface/complications/datasource/samples/BackgroundDataSourceService.kt
index 928a337..7fa3f3e 100644
--- a/wear/wear-complications-data-source-samples/src/main/java/androidx/wear/complications/datasource/samples/BackgroundDataSourceService.kt
+++ b/wear/watchface/watchface-complications-data-source-samples/src/main/java/androidx/wear/watchface/complications/datasource/samples/BackgroundDataSourceService.kt
@@ -14,18 +14,18 @@
* limitations under the License.
*/
-package androidx.wear.complications.datasource.samples
+package androidx.wear.watchface.complications.datasource.samples
import android.content.ComponentName
import android.os.Handler
import android.os.Looper
-import androidx.wear.complications.datasource.ComplicationDataSourceService
-import androidx.wear.complications.datasource.ComplicationRequest
-import androidx.wear.complications.datasource.ComplicationDataSourceUpdateRequester
-import androidx.wear.complications.data.ComplicationText
-import androidx.wear.complications.data.ComplicationType
-import androidx.wear.complications.data.LongTextComplicationData
-import androidx.wear.complications.data.ShortTextComplicationData
+import androidx.wear.watchface.complications.datasource.ComplicationDataSourceService
+import androidx.wear.watchface.complications.datasource.ComplicationRequest
+import androidx.wear.watchface.complications.datasource.ComplicationDataSourceUpdateRequester
+import androidx.wear.watchface.complications.data.ComplicationText
+import androidx.wear.watchface.complications.data.ComplicationType
+import androidx.wear.watchface.complications.data.LongTextComplicationData
+import androidx.wear.watchface.complications.data.ShortTextComplicationData
const val UPDATE_CADEANCE_MS = 10000L
diff --git a/wear/wear-complications-data-source-samples/src/main/java/androidx/wear/complications/datasource/samples/PlainComplicationText.kt b/wear/watchface/watchface-complications-data-source-samples/src/main/java/androidx/wear/watchface/complications/datasource/samples/PlainComplicationText.kt
similarity index 83%
rename from wear/wear-complications-data-source-samples/src/main/java/androidx/wear/complications/datasource/samples/PlainComplicationText.kt
rename to wear/watchface/watchface-complications-data-source-samples/src/main/java/androidx/wear/watchface/complications/datasource/samples/PlainComplicationText.kt
index cb807c3..249a921 100644
--- a/wear/wear-complications-data-source-samples/src/main/java/androidx/wear/complications/datasource/samples/PlainComplicationText.kt
+++ b/wear/watchface/watchface-complications-data-source-samples/src/main/java/androidx/wear/watchface/complications/datasource/samples/PlainComplicationText.kt
@@ -14,9 +14,9 @@
* limitations under the License.
*/
-package androidx.wear.complications.datasource.samples
+package androidx.wear.watchface.complications.datasource.samples
-import androidx.wear.complications.data.PlainComplicationText
+import androidx.wear.watchface.complications.data.PlainComplicationText
internal fun plainText(text: CharSequence) =
PlainComplicationText.Builder(text).build()
\ No newline at end of file
diff --git a/wear/wear-complications-data-source-samples/src/main/java/androidx/wear/complications/datasource/samples/SynchronousDataSourceService.kt b/wear/watchface/watchface-complications-data-source-samples/src/main/java/androidx/wear/watchface/complications/datasource/samples/SynchronousDataSourceService.kt
similarity index 79%
rename from wear/wear-complications-data-source-samples/src/main/java/androidx/wear/complications/datasource/samples/SynchronousDataSourceService.kt
rename to wear/watchface/watchface-complications-data-source-samples/src/main/java/androidx/wear/watchface/complications/datasource/samples/SynchronousDataSourceService.kt
index 875b325..a29137e 100644
--- a/wear/wear-complications-data-source-samples/src/main/java/androidx/wear/complications/datasource/samples/SynchronousDataSourceService.kt
+++ b/wear/watchface/watchface-complications-data-source-samples/src/main/java/androidx/wear/watchface/complications/datasource/samples/SynchronousDataSourceService.kt
@@ -14,14 +14,14 @@
* limitations under the License.
*/
-package androidx.wear.complications.datasource.samples
+package androidx.wear.watchface.complications.datasource.samples
-import androidx.wear.complications.datasource.ComplicationDataSourceService
-import androidx.wear.complications.datasource.ComplicationRequest
-import androidx.wear.complications.data.ComplicationText
-import androidx.wear.complications.data.ComplicationType
-import androidx.wear.complications.data.LongTextComplicationData
-import androidx.wear.complications.data.ShortTextComplicationData
+import androidx.wear.watchface.complications.datasource.ComplicationDataSourceService
+import androidx.wear.watchface.complications.datasource.ComplicationRequest
+import androidx.wear.watchface.complications.data.ComplicationText
+import androidx.wear.watchface.complications.data.ComplicationType
+import androidx.wear.watchface.complications.data.LongTextComplicationData
+import androidx.wear.watchface.complications.data.ShortTextComplicationData
/** A minimal complication data source which reports the ID of the complication immediately. */
class SynchronousDataSourceService : ComplicationDataSourceService() {
diff --git a/wear/wear-complications-data-source-samples/src/main/res/drawable/circle.xml b/wear/watchface/watchface-complications-data-source-samples/src/main/res/drawable/circle.xml
similarity index 100%
rename from wear/wear-complications-data-source-samples/src/main/res/drawable/circle.xml
rename to wear/watchface/watchface-complications-data-source-samples/src/main/res/drawable/circle.xml
diff --git a/wear/wear-complications-data-source-samples/src/main/res/values/strings.xml b/wear/watchface/watchface-complications-data-source-samples/src/main/res/values/strings.xml
similarity index 100%
rename from wear/wear-complications-data-source-samples/src/main/res/values/strings.xml
rename to wear/watchface/watchface-complications-data-source-samples/src/main/res/values/strings.xml
diff --git a/wear/watchface/watchface-complications-data-source/api/current.txt b/wear/watchface/watchface-complications-data-source/api/current.txt
new file mode 100644
index 0000000..9ab81f6
--- /dev/null
+++ b/wear/watchface/watchface-complications-data-source/api/current.txt
@@ -0,0 +1,50 @@
+// Signature format: 4.0
+package androidx.wear.watchface.complications.datasource {
+
+ public abstract class ComplicationDataSourceService extends android.app.Service {
+ ctor public ComplicationDataSourceService();
+ method public abstract androidx.wear.watchface.complications.data.ComplicationData? getPreviewData(androidx.wear.watchface.complications.data.ComplicationType type);
+ method public final android.os.IBinder? onBind(android.content.Intent intent);
+ method @UiThread public void onComplicationActivated(int complicationInstanceId, androidx.wear.watchface.complications.data.ComplicationType type);
+ method @UiThread public void onComplicationDeactivated(int complicationInstanceId);
+ method @UiThread public abstract void onComplicationRequest(androidx.wear.watchface.complications.datasource.ComplicationRequest request, androidx.wear.watchface.complications.datasource.ComplicationDataSourceService.ComplicationRequestListener listener);
+ field public static final String ACTION_COMPLICATION_UPDATE_REQUEST = "android.support.wearable.complications.ACTION_COMPLICATION_UPDATE_REQUEST";
+ field public static final String CATEGORY_DATA_SOURCE_CONFIG = "android.support.wearable.complications.category.PROVIDER_CONFIG";
+ field public static final androidx.wear.watchface.complications.datasource.ComplicationDataSourceService.Companion Companion;
+ field public static final String EXTRA_CONFIG_COMPLICATION_ID = "android.support.wearable.complications.EXTRA_CONFIG_COMPLICATION_ID";
+ field public static final String EXTRA_CONFIG_COMPLICATION_TYPE = "android.support.wearable.complications.EXTRA_CONFIG_COMPLICATION_TYPE";
+ field public static final String EXTRA_CONFIG_DATA_SOURCE_COMPONENT = "android.support.wearable.complications.EXTRA_CONFIG_PROVIDER_COMPONENT";
+ field public static final String METADATA_KEY_DATA_SOURCE_CONFIG_ACTION = "android.support.wearable.complications.PROVIDER_CONFIG_ACTION";
+ field public static final String METADATA_KEY_SAFE_WATCH_FACES = "android.support.wearable.complications.SAFE_WATCH_FACES";
+ field public static final String METADATA_KEY_SUPPORTED_TYPES = "android.support.wearable.complications.SUPPORTED_TYPES";
+ field public static final String METADATA_KEY_UPDATE_PERIOD_SECONDS = "android.support.wearable.complications.UPDATE_PERIOD_SECONDS";
+ }
+
+ public static final class ComplicationDataSourceService.Companion {
+ }
+
+ public static interface ComplicationDataSourceService.ComplicationRequestListener {
+ method @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public void onComplicationData(androidx.wear.watchface.complications.data.ComplicationData? complicationData) throws android.os.RemoteException;
+ }
+
+ public interface ComplicationDataSourceUpdateRequester {
+ method public default static androidx.wear.watchface.complications.datasource.ComplicationDataSourceUpdateRequester create(android.content.Context context, android.content.ComponentName complicationDataSourceComponent);
+ method public void requestUpdate(int... complicationInstanceIds);
+ method public void requestUpdateAll();
+ field public static final androidx.wear.watchface.complications.datasource.ComplicationDataSourceUpdateRequester.Companion Companion;
+ }
+
+ public static final class ComplicationDataSourceUpdateRequester.Companion {
+ method public androidx.wear.watchface.complications.datasource.ComplicationDataSourceUpdateRequester create(android.content.Context context, android.content.ComponentName complicationDataSourceComponent);
+ }
+
+ public final class ComplicationRequest {
+ ctor public ComplicationRequest(int complicationInstanceId, androidx.wear.watchface.complications.data.ComplicationType complicationType);
+ method public int getComplicationInstanceId();
+ method public androidx.wear.watchface.complications.data.ComplicationType getComplicationType();
+ property public final int complicationInstanceId;
+ property public final androidx.wear.watchface.complications.data.ComplicationType complicationType;
+ }
+
+}
+
diff --git a/wear/watchface/watchface-complications-data-source/api/public_plus_experimental_current.txt b/wear/watchface/watchface-complications-data-source/api/public_plus_experimental_current.txt
new file mode 100644
index 0000000..9ab81f6
--- /dev/null
+++ b/wear/watchface/watchface-complications-data-source/api/public_plus_experimental_current.txt
@@ -0,0 +1,50 @@
+// Signature format: 4.0
+package androidx.wear.watchface.complications.datasource {
+
+ public abstract class ComplicationDataSourceService extends android.app.Service {
+ ctor public ComplicationDataSourceService();
+ method public abstract androidx.wear.watchface.complications.data.ComplicationData? getPreviewData(androidx.wear.watchface.complications.data.ComplicationType type);
+ method public final android.os.IBinder? onBind(android.content.Intent intent);
+ method @UiThread public void onComplicationActivated(int complicationInstanceId, androidx.wear.watchface.complications.data.ComplicationType type);
+ method @UiThread public void onComplicationDeactivated(int complicationInstanceId);
+ method @UiThread public abstract void onComplicationRequest(androidx.wear.watchface.complications.datasource.ComplicationRequest request, androidx.wear.watchface.complications.datasource.ComplicationDataSourceService.ComplicationRequestListener listener);
+ field public static final String ACTION_COMPLICATION_UPDATE_REQUEST = "android.support.wearable.complications.ACTION_COMPLICATION_UPDATE_REQUEST";
+ field public static final String CATEGORY_DATA_SOURCE_CONFIG = "android.support.wearable.complications.category.PROVIDER_CONFIG";
+ field public static final androidx.wear.watchface.complications.datasource.ComplicationDataSourceService.Companion Companion;
+ field public static final String EXTRA_CONFIG_COMPLICATION_ID = "android.support.wearable.complications.EXTRA_CONFIG_COMPLICATION_ID";
+ field public static final String EXTRA_CONFIG_COMPLICATION_TYPE = "android.support.wearable.complications.EXTRA_CONFIG_COMPLICATION_TYPE";
+ field public static final String EXTRA_CONFIG_DATA_SOURCE_COMPONENT = "android.support.wearable.complications.EXTRA_CONFIG_PROVIDER_COMPONENT";
+ field public static final String METADATA_KEY_DATA_SOURCE_CONFIG_ACTION = "android.support.wearable.complications.PROVIDER_CONFIG_ACTION";
+ field public static final String METADATA_KEY_SAFE_WATCH_FACES = "android.support.wearable.complications.SAFE_WATCH_FACES";
+ field public static final String METADATA_KEY_SUPPORTED_TYPES = "android.support.wearable.complications.SUPPORTED_TYPES";
+ field public static final String METADATA_KEY_UPDATE_PERIOD_SECONDS = "android.support.wearable.complications.UPDATE_PERIOD_SECONDS";
+ }
+
+ public static final class ComplicationDataSourceService.Companion {
+ }
+
+ public static interface ComplicationDataSourceService.ComplicationRequestListener {
+ method @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public void onComplicationData(androidx.wear.watchface.complications.data.ComplicationData? complicationData) throws android.os.RemoteException;
+ }
+
+ public interface ComplicationDataSourceUpdateRequester {
+ method public default static androidx.wear.watchface.complications.datasource.ComplicationDataSourceUpdateRequester create(android.content.Context context, android.content.ComponentName complicationDataSourceComponent);
+ method public void requestUpdate(int... complicationInstanceIds);
+ method public void requestUpdateAll();
+ field public static final androidx.wear.watchface.complications.datasource.ComplicationDataSourceUpdateRequester.Companion Companion;
+ }
+
+ public static final class ComplicationDataSourceUpdateRequester.Companion {
+ method public androidx.wear.watchface.complications.datasource.ComplicationDataSourceUpdateRequester create(android.content.Context context, android.content.ComponentName complicationDataSourceComponent);
+ }
+
+ public final class ComplicationRequest {
+ ctor public ComplicationRequest(int complicationInstanceId, androidx.wear.watchface.complications.data.ComplicationType complicationType);
+ method public int getComplicationInstanceId();
+ method public androidx.wear.watchface.complications.data.ComplicationType getComplicationType();
+ property public final int complicationInstanceId;
+ property public final androidx.wear.watchface.complications.data.ComplicationType complicationType;
+ }
+
+}
+
diff --git a/wear/wear-complications-data-source/api/res-current.txt b/wear/watchface/watchface-complications-data-source/api/res-current.txt
similarity index 100%
rename from wear/wear-complications-data-source/api/res-current.txt
rename to wear/watchface/watchface-complications-data-source/api/res-current.txt
diff --git a/wear/watchface/watchface-complications-data-source/api/restricted_current.txt b/wear/watchface/watchface-complications-data-source/api/restricted_current.txt
new file mode 100644
index 0000000..9ab81f6
--- /dev/null
+++ b/wear/watchface/watchface-complications-data-source/api/restricted_current.txt
@@ -0,0 +1,50 @@
+// Signature format: 4.0
+package androidx.wear.watchface.complications.datasource {
+
+ public abstract class ComplicationDataSourceService extends android.app.Service {
+ ctor public ComplicationDataSourceService();
+ method public abstract androidx.wear.watchface.complications.data.ComplicationData? getPreviewData(androidx.wear.watchface.complications.data.ComplicationType type);
+ method public final android.os.IBinder? onBind(android.content.Intent intent);
+ method @UiThread public void onComplicationActivated(int complicationInstanceId, androidx.wear.watchface.complications.data.ComplicationType type);
+ method @UiThread public void onComplicationDeactivated(int complicationInstanceId);
+ method @UiThread public abstract void onComplicationRequest(androidx.wear.watchface.complications.datasource.ComplicationRequest request, androidx.wear.watchface.complications.datasource.ComplicationDataSourceService.ComplicationRequestListener listener);
+ field public static final String ACTION_COMPLICATION_UPDATE_REQUEST = "android.support.wearable.complications.ACTION_COMPLICATION_UPDATE_REQUEST";
+ field public static final String CATEGORY_DATA_SOURCE_CONFIG = "android.support.wearable.complications.category.PROVIDER_CONFIG";
+ field public static final androidx.wear.watchface.complications.datasource.ComplicationDataSourceService.Companion Companion;
+ field public static final String EXTRA_CONFIG_COMPLICATION_ID = "android.support.wearable.complications.EXTRA_CONFIG_COMPLICATION_ID";
+ field public static final String EXTRA_CONFIG_COMPLICATION_TYPE = "android.support.wearable.complications.EXTRA_CONFIG_COMPLICATION_TYPE";
+ field public static final String EXTRA_CONFIG_DATA_SOURCE_COMPONENT = "android.support.wearable.complications.EXTRA_CONFIG_PROVIDER_COMPONENT";
+ field public static final String METADATA_KEY_DATA_SOURCE_CONFIG_ACTION = "android.support.wearable.complications.PROVIDER_CONFIG_ACTION";
+ field public static final String METADATA_KEY_SAFE_WATCH_FACES = "android.support.wearable.complications.SAFE_WATCH_FACES";
+ field public static final String METADATA_KEY_SUPPORTED_TYPES = "android.support.wearable.complications.SUPPORTED_TYPES";
+ field public static final String METADATA_KEY_UPDATE_PERIOD_SECONDS = "android.support.wearable.complications.UPDATE_PERIOD_SECONDS";
+ }
+
+ public static final class ComplicationDataSourceService.Companion {
+ }
+
+ public static interface ComplicationDataSourceService.ComplicationRequestListener {
+ method @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public void onComplicationData(androidx.wear.watchface.complications.data.ComplicationData? complicationData) throws android.os.RemoteException;
+ }
+
+ public interface ComplicationDataSourceUpdateRequester {
+ method public default static androidx.wear.watchface.complications.datasource.ComplicationDataSourceUpdateRequester create(android.content.Context context, android.content.ComponentName complicationDataSourceComponent);
+ method public void requestUpdate(int... complicationInstanceIds);
+ method public void requestUpdateAll();
+ field public static final androidx.wear.watchface.complications.datasource.ComplicationDataSourceUpdateRequester.Companion Companion;
+ }
+
+ public static final class ComplicationDataSourceUpdateRequester.Companion {
+ method public androidx.wear.watchface.complications.datasource.ComplicationDataSourceUpdateRequester create(android.content.Context context, android.content.ComponentName complicationDataSourceComponent);
+ }
+
+ public final class ComplicationRequest {
+ ctor public ComplicationRequest(int complicationInstanceId, androidx.wear.watchface.complications.data.ComplicationType complicationType);
+ method public int getComplicationInstanceId();
+ method public androidx.wear.watchface.complications.data.ComplicationType getComplicationType();
+ property public final int complicationInstanceId;
+ property public final androidx.wear.watchface.complications.data.ComplicationType complicationType;
+ }
+
+}
+
diff --git a/wear/wear-complications-data-source/build.gradle b/wear/watchface/watchface-complications-data-source/build.gradle
similarity index 91%
rename from wear/wear-complications-data-source/build.gradle
rename to wear/watchface/watchface-complications-data-source/build.gradle
index ac9d00d..c51b5c7 100644
--- a/wear/wear-complications-data-source/build.gradle
+++ b/wear/watchface/watchface-complications-data-source/build.gradle
@@ -26,7 +26,7 @@
dependencies {
api("androidx.annotation:annotation:1.1.0")
- api(project(":wear:wear-complications-data"))
+ api(project(":wear:watchface:watchface-complications-data"))
implementation("androidx.core:core:1.1.0")
implementation("androidx.preference:preference:1.1.0")
@@ -54,8 +54,7 @@
androidx {
name = "Android Wear Complications Data Source"
publish = Publish.SNAPSHOT_AND_RELEASE
- mavenGroup = LibraryGroups.WEAR
- mavenVersion = LibraryVersions.WEAR_COMPLICATIONS_DATA_SOURCE
+ mavenGroup = LibraryGroups.WEAR_WATCHFACE
inceptionYear = "2020"
description = "Android Wear Complications Data Source"
}
diff --git a/wear/wear-complications-data-source-ktx/src/main/AndroidManifest.xml b/wear/watchface/watchface-complications-data-source/src/main/AndroidManifest.xml
similarity index 78%
rename from wear/wear-complications-data-source-ktx/src/main/AndroidManifest.xml
rename to wear/watchface/watchface-complications-data-source/src/main/AndroidManifest.xml
index 5e7a162..310c9bd 100644
--- a/wear/wear-complications-data-source-ktx/src/main/AndroidManifest.xml
+++ b/wear/watchface/watchface-complications-data-source/src/main/AndroidManifest.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
- package="androidx.wear.complications.datasource.ktx">
+ package="androidx.wear.watchface.complications.datasource">
<application>
<uses-library android:name="com.google.android.wearable" android:required="false" />
</application>
diff --git a/wear/wear-complications-data-source/src/main/java/androidx/wear/complications/datasource/ComplicationDataSourceService.kt b/wear/watchface/watchface-complications-data-source/src/main/java/androidx/wear/watchface/complications/datasource/ComplicationDataSourceService.kt
similarity index 94%
rename from wear/wear-complications-data-source/src/main/java/androidx/wear/complications/datasource/ComplicationDataSourceService.kt
rename to wear/watchface/watchface-complications-data-source/src/main/java/androidx/wear/watchface/complications/datasource/ComplicationDataSourceService.kt
index 066a1e8..0d1c7e2 100644
--- a/wear/wear-complications-data-source/src/main/java/androidx/wear/complications/datasource/ComplicationDataSourceService.kt
+++ b/wear/watchface/watchface-complications-data-source/src/main/java/androidx/wear/watchface/complications/datasource/ComplicationDataSourceService.kt
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package androidx.wear.complications.datasource
+package androidx.wear.watchface.complications.datasource
import android.annotation.SuppressLint
import android.app.Activity
@@ -29,9 +29,10 @@
import android.support.wearable.complications.IComplicationProvider
import androidx.annotation.RestrictTo
import androidx.annotation.UiThread
-import androidx.wear.complications.data.ComplicationData
-import androidx.wear.complications.data.ComplicationType
-import androidx.wear.complications.data.ComplicationType.Companion.fromWireType
+import androidx.wear.watchface.complications.data.ComplicationData
+import androidx.wear.watchface.complications.data.ComplicationType
+import androidx.wear.watchface.complications.data.ComplicationType.Companion.fromWireType
+import androidx.wear.watchface.complications.data.TimeRange
/**
* Data associated with complication request in [ComplicationDataSourceService.onComplicationRequest].
@@ -242,6 +243,20 @@
"TYPE_EMPTY. Use TYPE_NO_DATA instead."
}
+ require(
+ dataType == ComplicationType.NO_DATA ||
+ dataType == complicationType
+ ) {
+ "Preview data should match the requested type. " +
+ "Expected $complicationType got $dataType."
+ }
+
+ if (complicationData != null) {
+ require(complicationData.validTimeRange == TimeRange.ALWAYS) {
+ "Preview data should have time range set to ALWAYS."
+ }
+ }
+
// When no update is needed, the complicationData is going to be
// null.
iComplicationManager.updateComplicationData(
diff --git a/wear/wear-complications-data-source/src/main/java/androidx/wear/complications/datasource/ComplicationDataSourceUpdateRequester.kt b/wear/watchface/watchface-complications-data-source/src/main/java/androidx/wear/watchface/complications/datasource/ComplicationDataSourceUpdateRequester.kt
similarity index 97%
rename from wear/wear-complications-data-source/src/main/java/androidx/wear/complications/datasource/ComplicationDataSourceUpdateRequester.kt
rename to wear/watchface/watchface-complications-data-source/src/main/java/androidx/wear/watchface/complications/datasource/ComplicationDataSourceUpdateRequester.kt
index 48d30d9..baf32ae 100644
--- a/wear/wear-complications-data-source/src/main/java/androidx/wear/complications/datasource/ComplicationDataSourceUpdateRequester.kt
+++ b/wear/watchface/watchface-complications-data-source/src/main/java/androidx/wear/watchface/complications/datasource/ComplicationDataSourceUpdateRequester.kt
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package androidx.wear.complications.datasource
+package androidx.wear.watchface.complications.datasource
import android.annotation.SuppressLint
import android.app.PendingIntent
@@ -21,7 +21,7 @@
import android.content.Context
import android.content.Intent
import androidx.annotation.RestrictTo
-import androidx.wear.complications.ComplicationDataSourceUpdateRequesterConstants
+import androidx.wear.watchface.complications.ComplicationDataSourceUpdateRequesterConstants
/**
* Allows complication complication data source to request update calls from the system. This
diff --git a/wear/wear-complications-data-source/src/test/java/androidx/wear/complications/ComplicationDataSourceServiceTest.java b/wear/watchface/watchface-complications-data-source/src/test/java/androidx/wear/watchface/complications/ComplicationDataSourceServiceTest.java
similarity index 69%
rename from wear/wear-complications-data-source/src/test/java/androidx/wear/complications/ComplicationDataSourceServiceTest.java
rename to wear/watchface/watchface-complications-data-source/src/test/java/androidx/wear/watchface/complications/ComplicationDataSourceServiceTest.java
index 2df46b6..c984170 100644
--- a/wear/wear-complications-data-source/src/test/java/androidx/wear/complications/ComplicationDataSourceServiceTest.java
+++ b/wear/watchface/watchface-complications-data-source/src/test/java/androidx/wear/watchface/complications/ComplicationDataSourceServiceTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2020 The Android Open Source Project
+ * Copyright 2021 The Android Open 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,11 +14,12 @@
* limitations under the License.
*/
-package androidx.wear.complications;
+package androidx.wear.watchface.complications;
import static com.google.common.truth.Truth.assertThat;
import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertThrows;
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.verify;
@@ -30,13 +31,14 @@
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
-import androidx.wear.complications.data.ComplicationData;
-import androidx.wear.complications.data.ComplicationText;
-import androidx.wear.complications.data.ComplicationType;
-import androidx.wear.complications.data.LongTextComplicationData;
-import androidx.wear.complications.data.PlainComplicationText;
-import androidx.wear.complications.datasource.ComplicationDataSourceService;
-import androidx.wear.complications.datasource.ComplicationRequest;
+import androidx.wear.watchface.complications.data.ComplicationData;
+import androidx.wear.watchface.complications.data.ComplicationText;
+import androidx.wear.watchface.complications.data.ComplicationType;
+import androidx.wear.watchface.complications.data.LongTextComplicationData;
+import androidx.wear.watchface.complications.data.PlainComplicationText;
+import androidx.wear.watchface.complications.data.TimeRange;
+import androidx.wear.watchface.complications.datasource.ComplicationDataSourceService;
+import androidx.wear.watchface.complications.datasource.ComplicationRequest;
import org.jetbrains.annotations.NotNull;
import org.junit.Before;
@@ -48,6 +50,8 @@
import org.robolectric.annotation.internal.DoNotInstrument;
import org.robolectric.shadows.ShadowLooper;
+import java.time.Instant;
+
/** Tests for {@link ComplicationDataSourceService}. */
@RunWith(ComplicationsTestRunner.class)
@DoNotInstrument
@@ -68,6 +72,7 @@
private IComplicationProvider.Stub mComplicationProvider;
private IComplicationProvider.Stub mNoUpdateComplicationProvider;
+ private IComplicationProvider.Stub mWrongComplicationProvider;
private ComplicationDataSourceService mTestService = new ComplicationDataSourceService() {
@@ -102,6 +107,37 @@
}
};
+ private ComplicationDataSourceService mTestServiceNotValidTimeRange =
+ new ComplicationDataSourceService() {
+
+ @Override
+ public void onComplicationRequest(
+ @NotNull ComplicationRequest request,
+ @NonNull ComplicationRequestListener listener) {
+ try {
+ listener.onComplicationData(
+ new LongTextComplicationData.Builder(
+ new PlainComplicationText.Builder(
+ "hello " + request.getComplicationInstanceId()
+ ).build(),
+ ComplicationText.EMPTY
+ ).build()
+ );
+ } catch (RemoteException e) {
+ Log.e(TAG, "onComplicationRequest failed with error: ", e);
+ }
+ }
+
+ @Nullable
+ @Override
+ public ComplicationData getPreviewData(@NonNull ComplicationType type) {
+ return new LongTextComplicationData.Builder(
+ new PlainComplicationText.Builder("hello preview").build(),
+ ComplicationText.EMPTY
+ ).setValidTimeRange(TimeRange.between(Instant.now(), Instant.now())).build();
+ }
+ };
+
private ComplicationDataSourceService mNoUpdateTestService =
new ComplicationDataSourceService() {
@@ -139,6 +175,11 @@
(IComplicationProvider.Stub) mNoUpdateTestService.onBind(
new Intent(
ComplicationDataSourceService.ACTION_COMPLICATION_UPDATE_REQUEST));
+
+ mWrongComplicationProvider =
+ (IComplicationProvider.Stub) mTestServiceNotValidTimeRange.onBind(
+ new Intent(
+ ComplicationDataSourceService.ACTION_COMPLICATION_UPDATE_REQUEST));
}
@Test
@@ -158,6 +199,22 @@
}
@Test
+ public void testOnComplicationRequestWrongType() throws Exception {
+ int id = 123;
+ mComplicationProvider.onUpdate(
+ id, ComplicationType.SHORT_TEXT.toWireComplicationType(), mLocalManager);
+ assertThrows(IllegalArgumentException.class, ShadowLooper::runUiThreadTasks);
+ }
+
+ @Test
+ public void testOnComplicationRequestWrongValidTimeRange() throws Exception {
+ int id = 123;
+ mWrongComplicationProvider.onUpdate(
+ id, ComplicationType.SHORT_TEXT.toWireComplicationType(), mLocalManager);
+ assertThrows(IllegalArgumentException.class, ShadowLooper::runUiThreadTasks);
+ }
+
+ @Test
public void testOnComplicationRequestNoUpdateRequired() throws Exception {
int id = 123;
mNoUpdateComplicationProvider.onUpdate(
diff --git a/wear/wear-complications-data-source/src/test/java/androidx/wear/complications/ComplicationsTestRunner.java b/wear/watchface/watchface-complications-data-source/src/test/java/androidx/wear/watchface/complications/ComplicationsTestRunner.java
similarity index 89%
rename from wear/wear-complications-data-source/src/test/java/androidx/wear/complications/ComplicationsTestRunner.java
rename to wear/watchface/watchface-complications-data-source/src/test/java/androidx/wear/watchface/complications/ComplicationsTestRunner.java
index 8746135..7971b33 100644
--- a/wear/wear-complications-data-source/src/test/java/androidx/wear/complications/ComplicationsTestRunner.java
+++ b/wear/watchface/watchface-complications-data-source/src/test/java/androidx/wear/watchface/complications/ComplicationsTestRunner.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2020 The Android Open Source Project
+ * Copyright 2021 The Android Open 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,7 +14,7 @@
* limitations under the License.
*/
-package androidx.wear.complications;
+package androidx.wear.watchface.complications;
import androidx.annotation.NonNull;
@@ -35,7 +35,7 @@
return new InstrumentationConfiguration.Builder(super.createClassLoaderConfig(method))
.doNotInstrumentPackage("android.support.wearable.complications")
.doNotInstrumentPackage("android.support.wearable.watchface")
- .doNotInstrumentPackage("androidx.wear.complications")
+ .doNotInstrumentPackage("androidx.wear.watchface.complications")
.doNotInstrumentPackage("androidx.wear.watchface")
.build();
}
diff --git a/wear/wear-complications-data-source/src/test/resources/robolectric.properties b/wear/watchface/watchface-complications-data-source/src/test/resources/robolectric.properties
similarity index 100%
rename from wear/wear-complications-data-source/src/test/resources/robolectric.properties
rename to wear/watchface/watchface-complications-data-source/src/test/resources/robolectric.properties
diff --git a/wear/watchface/watchface-complications-data/api/api_lint.ignore b/wear/watchface/watchface-complications-data/api/api_lint.ignore
new file mode 100644
index 0000000..36ca3c6
--- /dev/null
+++ b/wear/watchface/watchface-complications-data/api/api_lint.ignore
@@ -0,0 +1,11 @@
+// Baseline format: 1.0
+MissingGetterMatchingBuilder: androidx.wear.watchface.complications.data.TimeDifferenceComplicationText.Builder#setDisplayAsNow(boolean):
+ androidx.wear.watchface.complications.data.TimeDifferenceComplicationText does not declare a `isDisplayAsNow()` method matching method androidx.wear.watchface.complications.data.TimeDifferenceComplicationText.Builder.setDisplayAsNow(boolean)
+MissingGetterMatchingBuilder: androidx.wear.watchface.complications.data.TimeDifferenceComplicationText.Builder#setText(CharSequence):
+ androidx.wear.watchface.complications.data.TimeDifferenceComplicationText does not declare a `getText()` method matching method androidx.wear.watchface.complications.data.TimeDifferenceComplicationText.Builder.setText(CharSequence)
+MissingGetterMatchingBuilder: androidx.wear.watchface.complications.data.TimeFormatComplicationText.Builder#setStyle(androidx.wear.watchface.complications.data.TimeFormatStyle):
+ androidx.wear.watchface.complications.data.TimeFormatComplicationText does not declare a `getStyle()` method matching method androidx.wear.watchface.complications.data.TimeFormatComplicationText.Builder.setStyle(androidx.wear.watchface.complications.data.TimeFormatStyle)
+MissingGetterMatchingBuilder: androidx.wear.watchface.complications.data.TimeFormatComplicationText.Builder#setText(CharSequence):
+ androidx.wear.watchface.complications.data.TimeFormatComplicationText does not declare a `getText()` method matching method androidx.wear.watchface.complications.data.TimeFormatComplicationText.Builder.setText(CharSequence)
+MissingGetterMatchingBuilder: androidx.wear.watchface.complications.data.TimeFormatComplicationText.Builder#setTimeZone(android.icu.util.TimeZone):
+ androidx.wear.watchface.complications.data.TimeFormatComplicationText does not declare a `getTimeZone()` method matching method androidx.wear.watchface.complications.data.TimeFormatComplicationText.Builder.setTimeZone(android.icu.util.TimeZone)
diff --git a/wear/watchface/watchface-complications-data/api/current.txt b/wear/watchface/watchface-complications-data/api/current.txt
new file mode 100644
index 0000000..d5b166a
--- /dev/null
+++ b/wear/watchface/watchface-complications-data/api/current.txt
@@ -0,0 +1,399 @@
+// Signature format: 4.0
+package androidx.wear.watchface.complications {
+
+ public final class ComplicationDataSourceInfo {
+ ctor public ComplicationDataSourceInfo(String appName, String name, android.graphics.drawable.Icon icon, androidx.wear.watchface.complications.data.ComplicationType type, android.content.ComponentName? componentName);
+ method public String getAppName();
+ method public android.content.ComponentName? getComponentName();
+ method public androidx.wear.watchface.complications.data.ComplicationData getFallbackPreviewData();
+ method public android.graphics.drawable.Icon getIcon();
+ method public String getName();
+ method public androidx.wear.watchface.complications.data.ComplicationType getType();
+ property public final String appName;
+ property public final android.content.ComponentName? componentName;
+ property public final androidx.wear.watchface.complications.data.ComplicationData fallbackPreviewData;
+ property public final android.graphics.drawable.Icon icon;
+ property public final String name;
+ property public final androidx.wear.watchface.complications.data.ComplicationType type;
+ }
+
+ public final class ComplicationDataSourceInfoRetriever implements java.lang.AutoCloseable {
+ ctor public ComplicationDataSourceInfoRetriever(android.content.Context context);
+ method public void close();
+ method @kotlin.jvm.Throws(exceptionClasses=ServiceDisconnectedException::class) public suspend Object? retrieveComplicationDataSourceInfo(android.content.ComponentName watchFaceComponent, int[] watchFaceComplicationIds, kotlin.coroutines.Continuation<? super androidx.wear.watchface.complications.ComplicationDataSourceInfoRetriever.Result[]> p) throws androidx.wear.watchface.complications.ComplicationDataSourceInfoRetriever.ServiceDisconnectedException;
+ method @RequiresApi(android.os.Build.VERSION_CODES.R) @kotlin.jvm.Throws(exceptionClasses=ServiceDisconnectedException::class) public suspend Object? retrievePreviewComplicationData(android.content.ComponentName complicationDataSourceComponent, androidx.wear.watchface.complications.data.ComplicationType complicationType, kotlin.coroutines.Continuation<? super androidx.wear.watchface.complications.data.ComplicationData> p) throws androidx.wear.watchface.complications.ComplicationDataSourceInfoRetriever.ServiceDisconnectedException;
+ }
+
+ public static final class ComplicationDataSourceInfoRetriever.Result {
+ method public androidx.wear.watchface.complications.ComplicationDataSourceInfo? getInfo();
+ method public int getSlotId();
+ property public final androidx.wear.watchface.complications.ComplicationDataSourceInfo? info;
+ property public final int slotId;
+ }
+
+ public static final class ComplicationDataSourceInfoRetriever.ServiceDisconnectedException extends java.lang.Exception {
+ ctor public ComplicationDataSourceInfoRetriever.ServiceDisconnectedException();
+ }
+
+ public final class ComplicationDataSourceInfoRetrieverKt {
+ }
+
+ public final class ComplicationSlotBounds {
+ ctor public ComplicationSlotBounds(java.util.Map<androidx.wear.watchface.complications.data.ComplicationType,? extends android.graphics.RectF> perComplicationTypeBounds);
+ ctor public ComplicationSlotBounds(android.graphics.RectF bounds);
+ method public java.util.Map<androidx.wear.watchface.complications.data.ComplicationType,android.graphics.RectF> getPerComplicationTypeBounds();
+ property public final java.util.Map<androidx.wear.watchface.complications.data.ComplicationType,android.graphics.RectF> perComplicationTypeBounds;
+ }
+
+ public final class DefaultComplicationDataSourcePolicy {
+ ctor public DefaultComplicationDataSourcePolicy();
+ ctor public DefaultComplicationDataSourcePolicy(int systemProvider);
+ ctor public DefaultComplicationDataSourcePolicy(android.content.ComponentName dataSource, int systemDataSourceFallback);
+ ctor public DefaultComplicationDataSourcePolicy(android.content.ComponentName primaryDataSource, android.content.ComponentName secondaryDataSource, int systemDataSourceFallback);
+ method public android.content.ComponentName? getPrimaryDataSource();
+ method public android.content.ComponentName? getSecondaryDataSource();
+ method public int getSystemDataSourceFallback();
+ method public boolean isEmpty();
+ property public final android.content.ComponentName? primaryDataSource;
+ property public final android.content.ComponentName? secondaryDataSource;
+ property public final int systemDataSourceFallback;
+ }
+
+ public final class SystemDataSources {
+ field public static final androidx.wear.watchface.complications.SystemDataSources.Companion Companion;
+ field public static final int DATA_SOURCE_APP_SHORTCUT = 6; // 0x6
+ field public static final int DATA_SOURCE_DATE = 2; // 0x2
+ field public static final int DATA_SOURCE_DAY_AND_DATE = 16; // 0x10
+ field public static final int DATA_SOURCE_DAY_OF_WEEK = 13; // 0xd
+ field public static final int DATA_SOURCE_FAVORITE_CONTACT = 14; // 0xe
+ field public static final int DATA_SOURCE_NEXT_EVENT = 9; // 0x9
+ field public static final int DATA_SOURCE_STEP_COUNT = 4; // 0x4
+ field public static final int DATA_SOURCE_SUNRISE_SUNSET = 12; // 0xc
+ field public static final int DATA_SOURCE_TIME_AND_DATE = 3; // 0x3
+ field public static final int DATA_SOURCE_UNREAD_NOTIFICATION_COUNT = 7; // 0x7
+ field public static final int DATA_SOURCE_WATCH_BATTERY = 1; // 0x1
+ field public static final int DATA_SOURCE_WORLD_CLOCK = 5; // 0x5
+ field public static final int NO_DATA_SOURCE = -1; // 0xffffffff
+ }
+
+ public static final class SystemDataSources.Companion {
+ }
+
+}
+
+package androidx.wear.watchface.complications.data {
+
+ public abstract sealed class ComplicationData {
+ method public final android.app.PendingIntent? getTapAction();
+ method public final androidx.wear.watchface.complications.data.ComplicationType getType();
+ method public final androidx.wear.watchface.complications.data.TimeRange getValidTimeRange();
+ property public final android.app.PendingIntent? tapAction;
+ property public final androidx.wear.watchface.complications.data.ComplicationType type;
+ property public final androidx.wear.watchface.complications.data.TimeRange validTimeRange;
+ }
+
+ public interface ComplicationText {
+ method public java.time.Instant getNextChangeTime(java.time.Instant afterInstant);
+ method public CharSequence getTextAt(android.content.res.Resources resources, java.time.Instant instant);
+ method public boolean isAlwaysEmpty();
+ method public boolean returnsSameText(java.time.Instant firstInstant, java.time.Instant secondInstant);
+ field public static final androidx.wear.watchface.complications.data.ComplicationText.Companion Companion;
+ field public static final androidx.wear.watchface.complications.data.ComplicationText EMPTY;
+ }
+
+ public static final class ComplicationText.Companion {
+ }
+
+ public enum ComplicationType {
+ enum_constant public static final androidx.wear.watchface.complications.data.ComplicationType EMPTY;
+ enum_constant public static final androidx.wear.watchface.complications.data.ComplicationType LONG_TEXT;
+ enum_constant public static final androidx.wear.watchface.complications.data.ComplicationType MONOCHROMATIC_IMAGE;
+ enum_constant public static final androidx.wear.watchface.complications.data.ComplicationType NOT_CONFIGURED;
+ enum_constant public static final androidx.wear.watchface.complications.data.ComplicationType NO_DATA;
+ enum_constant public static final androidx.wear.watchface.complications.data.ComplicationType NO_PERMISSION;
+ enum_constant public static final androidx.wear.watchface.complications.data.ComplicationType PHOTO_IMAGE;
+ enum_constant public static final androidx.wear.watchface.complications.data.ComplicationType RANGED_VALUE;
+ enum_constant public static final androidx.wear.watchface.complications.data.ComplicationType SHORT_TEXT;
+ enum_constant public static final androidx.wear.watchface.complications.data.ComplicationType SMALL_IMAGE;
+ }
+
+ public final class CountDownTimeReference {
+ ctor public CountDownTimeReference(java.time.Instant instant);
+ method public java.time.Instant getInstant();
+ property public final java.time.Instant instant;
+ }
+
+ public final class CountUpTimeReference {
+ ctor public CountUpTimeReference(java.time.Instant instant);
+ method public java.time.Instant getInstant();
+ property public final java.time.Instant instant;
+ }
+
+ public final class DataKt {
+ }
+
+ public final class EmptyComplicationData extends androidx.wear.watchface.complications.data.ComplicationData {
+ ctor public EmptyComplicationData();
+ field public static final androidx.wear.watchface.complications.data.ComplicationType TYPE;
+ }
+
+ public final class LongTextComplicationData extends androidx.wear.watchface.complications.data.ComplicationData {
+ method public androidx.wear.watchface.complications.data.ComplicationText? getContentDescription();
+ method public androidx.wear.watchface.complications.data.MonochromaticImage? getMonochromaticImage();
+ method public androidx.wear.watchface.complications.data.SmallImage? getSmallImage();
+ method public androidx.wear.watchface.complications.data.ComplicationText getText();
+ method public androidx.wear.watchface.complications.data.ComplicationText? getTitle();
+ property public final androidx.wear.watchface.complications.data.ComplicationText? contentDescription;
+ property public final androidx.wear.watchface.complications.data.MonochromaticImage? monochromaticImage;
+ property public final androidx.wear.watchface.complications.data.SmallImage? smallImage;
+ property public final androidx.wear.watchface.complications.data.ComplicationText text;
+ property public final androidx.wear.watchface.complications.data.ComplicationText? title;
+ field public static final androidx.wear.watchface.complications.data.ComplicationType TYPE;
+ }
+
+ public static final class LongTextComplicationData.Builder {
+ ctor public LongTextComplicationData.Builder(androidx.wear.watchface.complications.data.ComplicationText text, androidx.wear.watchface.complications.data.ComplicationText contentDescription);
+ method public androidx.wear.watchface.complications.data.LongTextComplicationData build();
+ method public androidx.wear.watchface.complications.data.LongTextComplicationData.Builder setMonochromaticImage(androidx.wear.watchface.complications.data.MonochromaticImage? icon);
+ method public androidx.wear.watchface.complications.data.LongTextComplicationData.Builder setSmallImage(androidx.wear.watchface.complications.data.SmallImage? smallImage);
+ method public androidx.wear.watchface.complications.data.LongTextComplicationData.Builder setTapAction(android.app.PendingIntent? tapAction);
+ method public androidx.wear.watchface.complications.data.LongTextComplicationData.Builder setTitle(androidx.wear.watchface.complications.data.ComplicationText? title);
+ method public androidx.wear.watchface.complications.data.LongTextComplicationData.Builder setValidTimeRange(androidx.wear.watchface.complications.data.TimeRange? validTimeRange);
+ }
+
+ public final class MonochromaticImage {
+ method public android.graphics.drawable.Icon? getAmbientImage();
+ method public android.graphics.drawable.Icon getImage();
+ property public final android.graphics.drawable.Icon? ambientImage;
+ property public final android.graphics.drawable.Icon image;
+ }
+
+ public static final class MonochromaticImage.Builder {
+ ctor public MonochromaticImage.Builder(android.graphics.drawable.Icon image);
+ method public androidx.wear.watchface.complications.data.MonochromaticImage build();
+ method public androidx.wear.watchface.complications.data.MonochromaticImage.Builder setAmbientImage(android.graphics.drawable.Icon? ambientImage);
+ }
+
+ public final class MonochromaticImageComplicationData extends androidx.wear.watchface.complications.data.ComplicationData {
+ method public androidx.wear.watchface.complications.data.ComplicationText? getContentDescription();
+ method public androidx.wear.watchface.complications.data.MonochromaticImage getMonochromaticImage();
+ property public final androidx.wear.watchface.complications.data.ComplicationText? contentDescription;
+ property public final androidx.wear.watchface.complications.data.MonochromaticImage monochromaticImage;
+ field public static final androidx.wear.watchface.complications.data.ComplicationType TYPE;
+ }
+
+ public static final class MonochromaticImageComplicationData.Builder {
+ ctor public MonochromaticImageComplicationData.Builder(androidx.wear.watchface.complications.data.MonochromaticImage monochromaticImage, androidx.wear.watchface.complications.data.ComplicationText contentDescription);
+ method public androidx.wear.watchface.complications.data.MonochromaticImageComplicationData build();
+ method public androidx.wear.watchface.complications.data.MonochromaticImageComplicationData.Builder setTapAction(android.app.PendingIntent? tapAction);
+ method public androidx.wear.watchface.complications.data.MonochromaticImageComplicationData.Builder setValidTimeRange(androidx.wear.watchface.complications.data.TimeRange? validTimeRange);
+ }
+
+ public final class NoDataComplicationData extends androidx.wear.watchface.complications.data.ComplicationData {
+ ctor public NoDataComplicationData();
+ field public static final androidx.wear.watchface.complications.data.ComplicationType TYPE;
+ }
+
+ public final class NoPermissionComplicationData extends androidx.wear.watchface.complications.data.ComplicationData {
+ method public androidx.wear.watchface.complications.data.MonochromaticImage? getMonochromaticImage();
+ method public androidx.wear.watchface.complications.data.ComplicationText? getText();
+ method public androidx.wear.watchface.complications.data.ComplicationText? getTitle();
+ property public final androidx.wear.watchface.complications.data.MonochromaticImage? monochromaticImage;
+ property public final androidx.wear.watchface.complications.data.ComplicationText? text;
+ property public final androidx.wear.watchface.complications.data.ComplicationText? title;
+ field public static final androidx.wear.watchface.complications.data.ComplicationType TYPE;
+ }
+
+ public static final class NoPermissionComplicationData.Builder {
+ ctor public NoPermissionComplicationData.Builder();
+ method public androidx.wear.watchface.complications.data.NoPermissionComplicationData build();
+ method public androidx.wear.watchface.complications.data.NoPermissionComplicationData.Builder setMonochromaticImage(androidx.wear.watchface.complications.data.MonochromaticImage? monochromaticImage);
+ method public androidx.wear.watchface.complications.data.NoPermissionComplicationData.Builder setText(androidx.wear.watchface.complications.data.ComplicationText? text);
+ method public androidx.wear.watchface.complications.data.NoPermissionComplicationData.Builder setTitle(androidx.wear.watchface.complications.data.ComplicationText? title);
+ }
+
+ public final class NotConfiguredComplicationData extends androidx.wear.watchface.complications.data.ComplicationData {
+ ctor public NotConfiguredComplicationData();
+ field public static final androidx.wear.watchface.complications.data.ComplicationType TYPE;
+ }
+
+ public final class PhotoImageComplicationData extends androidx.wear.watchface.complications.data.ComplicationData {
+ method public androidx.wear.watchface.complications.data.ComplicationText? getContentDescription();
+ method public android.graphics.drawable.Icon getPhotoImage();
+ property public final androidx.wear.watchface.complications.data.ComplicationText? contentDescription;
+ property public final android.graphics.drawable.Icon photoImage;
+ field public static final androidx.wear.watchface.complications.data.ComplicationType TYPE;
+ }
+
+ public static final class PhotoImageComplicationData.Builder {
+ ctor public PhotoImageComplicationData.Builder(android.graphics.drawable.Icon photoImage, androidx.wear.watchface.complications.data.ComplicationText contentDescription);
+ method public androidx.wear.watchface.complications.data.PhotoImageComplicationData build();
+ method public androidx.wear.watchface.complications.data.PhotoImageComplicationData.Builder setTapAction(android.app.PendingIntent? tapAction);
+ method public androidx.wear.watchface.complications.data.PhotoImageComplicationData.Builder setValidTimeRange(androidx.wear.watchface.complications.data.TimeRange? validTimeRange);
+ }
+
+ public final class PlainComplicationText implements androidx.wear.watchface.complications.data.ComplicationText {
+ }
+
+ public static final class PlainComplicationText.Builder {
+ ctor public PlainComplicationText.Builder(CharSequence text);
+ method public androidx.wear.watchface.complications.data.PlainComplicationText build();
+ }
+
+ public final class RangedValueComplicationData extends androidx.wear.watchface.complications.data.ComplicationData {
+ method public androidx.wear.watchface.complications.data.ComplicationText? getContentDescription();
+ method public float getMax();
+ method public float getMin();
+ method public androidx.wear.watchface.complications.data.MonochromaticImage? getMonochromaticImage();
+ method public androidx.wear.watchface.complications.data.ComplicationText? getText();
+ method public androidx.wear.watchface.complications.data.ComplicationText? getTitle();
+ method public float getValue();
+ property public final androidx.wear.watchface.complications.data.ComplicationText? contentDescription;
+ property public final float max;
+ property public final float min;
+ property public final androidx.wear.watchface.complications.data.MonochromaticImage? monochromaticImage;
+ property public final androidx.wear.watchface.complications.data.ComplicationText? text;
+ property public final androidx.wear.watchface.complications.data.ComplicationText? title;
+ property public final float value;
+ field public static final androidx.wear.watchface.complications.data.ComplicationType TYPE;
+ }
+
+ public static final class RangedValueComplicationData.Builder {
+ ctor public RangedValueComplicationData.Builder(float value, float min, float max, androidx.wear.watchface.complications.data.ComplicationText contentDescription);
+ method public androidx.wear.watchface.complications.data.RangedValueComplicationData build();
+ method public androidx.wear.watchface.complications.data.RangedValueComplicationData.Builder setMonochromaticImage(androidx.wear.watchface.complications.data.MonochromaticImage? monochromaticImage);
+ method public androidx.wear.watchface.complications.data.RangedValueComplicationData.Builder setTapAction(android.app.PendingIntent? tapAction);
+ method public androidx.wear.watchface.complications.data.RangedValueComplicationData.Builder setText(androidx.wear.watchface.complications.data.ComplicationText? text);
+ method public androidx.wear.watchface.complications.data.RangedValueComplicationData.Builder setTitle(androidx.wear.watchface.complications.data.ComplicationText? title);
+ method public androidx.wear.watchface.complications.data.RangedValueComplicationData.Builder setValidTimeRange(androidx.wear.watchface.complications.data.TimeRange? validTimeRange);
+ }
+
+ public final class ShortTextComplicationData extends androidx.wear.watchface.complications.data.ComplicationData {
+ method public androidx.wear.watchface.complications.data.ComplicationText? getContentDescription();
+ method public androidx.wear.watchface.complications.data.MonochromaticImage? getMonochromaticImage();
+ method public androidx.wear.watchface.complications.data.ComplicationText getText();
+ method public androidx.wear.watchface.complications.data.ComplicationText? getTitle();
+ property public final androidx.wear.watchface.complications.data.ComplicationText? contentDescription;
+ property public final androidx.wear.watchface.complications.data.MonochromaticImage? monochromaticImage;
+ property public final androidx.wear.watchface.complications.data.ComplicationText text;
+ property public final androidx.wear.watchface.complications.data.ComplicationText? title;
+ field public static final int MAX_TEXT_LENGTH;
+ field public static final androidx.wear.watchface.complications.data.ComplicationType TYPE;
+ }
+
+ public static final class ShortTextComplicationData.Builder {
+ ctor public ShortTextComplicationData.Builder(androidx.wear.watchface.complications.data.ComplicationText text, androidx.wear.watchface.complications.data.ComplicationText contentDescription);
+ method public androidx.wear.watchface.complications.data.ShortTextComplicationData build();
+ method public androidx.wear.watchface.complications.data.ShortTextComplicationData.Builder setMonochromaticImage(androidx.wear.watchface.complications.data.MonochromaticImage? monochromaticImage);
+ method public androidx.wear.watchface.complications.data.ShortTextComplicationData.Builder setTapAction(android.app.PendingIntent? tapAction);
+ method public androidx.wear.watchface.complications.data.ShortTextComplicationData.Builder setTitle(androidx.wear.watchface.complications.data.ComplicationText? title);
+ method public androidx.wear.watchface.complications.data.ShortTextComplicationData.Builder setValidTimeRange(androidx.wear.watchface.complications.data.TimeRange? validTimeRange);
+ }
+
+ public final class SmallImage {
+ method public android.graphics.drawable.Icon? getAmbientImage();
+ method public android.graphics.drawable.Icon getImage();
+ method public androidx.wear.watchface.complications.data.SmallImageType getType();
+ property public final android.graphics.drawable.Icon? ambientImage;
+ property public final android.graphics.drawable.Icon image;
+ property public final androidx.wear.watchface.complications.data.SmallImageType type;
+ }
+
+ public static final class SmallImage.Builder {
+ ctor public SmallImage.Builder(android.graphics.drawable.Icon image, androidx.wear.watchface.complications.data.SmallImageType type);
+ method public androidx.wear.watchface.complications.data.SmallImage build();
+ method public androidx.wear.watchface.complications.data.SmallImage.Builder setAmbientImage(android.graphics.drawable.Icon? ambientImage);
+ }
+
+ public final class SmallImageComplicationData extends androidx.wear.watchface.complications.data.ComplicationData {
+ method public androidx.wear.watchface.complications.data.ComplicationText? getContentDescription();
+ method public androidx.wear.watchface.complications.data.SmallImage getSmallImage();
+ property public final androidx.wear.watchface.complications.data.ComplicationText? contentDescription;
+ property public final androidx.wear.watchface.complications.data.SmallImage smallImage;
+ field public static final androidx.wear.watchface.complications.data.ComplicationType TYPE;
+ }
+
+ public static final class SmallImageComplicationData.Builder {
+ ctor public SmallImageComplicationData.Builder(androidx.wear.watchface.complications.data.SmallImage smallImage, androidx.wear.watchface.complications.data.ComplicationText contentDescription);
+ method public androidx.wear.watchface.complications.data.SmallImageComplicationData build();
+ method public androidx.wear.watchface.complications.data.SmallImageComplicationData.Builder setTapAction(android.app.PendingIntent? tapAction);
+ method public androidx.wear.watchface.complications.data.SmallImageComplicationData.Builder setValidTimeRange(androidx.wear.watchface.complications.data.TimeRange? validTimeRange);
+ }
+
+ public enum SmallImageType {
+ enum_constant public static final androidx.wear.watchface.complications.data.SmallImageType ICON;
+ enum_constant public static final androidx.wear.watchface.complications.data.SmallImageType PHOTO;
+ }
+
+ public final class TextKt {
+ }
+
+ public final class TimeDifferenceComplicationText implements androidx.wear.watchface.complications.data.ComplicationText {
+ method public java.util.concurrent.TimeUnit? getMinimumTimeUnit();
+ }
+
+ public static final class TimeDifferenceComplicationText.Builder {
+ ctor public TimeDifferenceComplicationText.Builder(androidx.wear.watchface.complications.data.TimeDifferenceStyle style, androidx.wear.watchface.complications.data.CountUpTimeReference countUpTimeReference);
+ ctor public TimeDifferenceComplicationText.Builder(androidx.wear.watchface.complications.data.TimeDifferenceStyle style, androidx.wear.watchface.complications.data.CountDownTimeReference countDownTimeReference);
+ method public androidx.wear.watchface.complications.data.TimeDifferenceComplicationText build();
+ method public androidx.wear.watchface.complications.data.TimeDifferenceComplicationText.Builder setDisplayAsNow(boolean displayAsNow);
+ method public androidx.wear.watchface.complications.data.TimeDifferenceComplicationText.Builder setMinimumTimeUnit(java.util.concurrent.TimeUnit? minimumUnit);
+ method public androidx.wear.watchface.complications.data.TimeDifferenceComplicationText.Builder setText(CharSequence? text);
+ }
+
+ public enum TimeDifferenceStyle {
+ enum_constant public static final androidx.wear.watchface.complications.data.TimeDifferenceStyle SHORT_DUAL_UNIT;
+ enum_constant public static final androidx.wear.watchface.complications.data.TimeDifferenceStyle SHORT_SINGLE_UNIT;
+ enum_constant public static final androidx.wear.watchface.complications.data.TimeDifferenceStyle SHORT_WORDS_SINGLE_UNIT;
+ enum_constant public static final androidx.wear.watchface.complications.data.TimeDifferenceStyle STOPWATCH;
+ enum_constant public static final androidx.wear.watchface.complications.data.TimeDifferenceStyle WORDS_SINGLE_UNIT;
+ }
+
+ public final class TimeFormatComplicationText implements androidx.wear.watchface.complications.data.ComplicationText {
+ }
+
+ public static final class TimeFormatComplicationText.Builder {
+ ctor public TimeFormatComplicationText.Builder(String format);
+ method public androidx.wear.watchface.complications.data.TimeFormatComplicationText build();
+ method public androidx.wear.watchface.complications.data.TimeFormatComplicationText.Builder setStyle(androidx.wear.watchface.complications.data.TimeFormatStyle style);
+ method public androidx.wear.watchface.complications.data.TimeFormatComplicationText.Builder setText(CharSequence text);
+ method public androidx.wear.watchface.complications.data.TimeFormatComplicationText.Builder setTimeZone(android.icu.util.TimeZone timeZone);
+ }
+
+ public enum TimeFormatStyle {
+ enum_constant public static final androidx.wear.watchface.complications.data.TimeFormatStyle DEFAULT;
+ enum_constant public static final androidx.wear.watchface.complications.data.TimeFormatStyle LOWER_CASE;
+ enum_constant public static final androidx.wear.watchface.complications.data.TimeFormatStyle UPPER_CASE;
+ }
+
+ public final class TimeRange {
+ method public static androidx.wear.watchface.complications.data.TimeRange after(java.time.Instant startInstant);
+ method public static androidx.wear.watchface.complications.data.TimeRange before(java.time.Instant endInstant);
+ method public static androidx.wear.watchface.complications.data.TimeRange between(java.time.Instant startInstant, java.time.Instant endInstant);
+ method public operator boolean contains(java.time.Instant dateTimeMillis);
+ method public java.time.Instant getEndDateTimeMillis();
+ method public java.time.Instant getStartDateTimeMillis();
+ property public final java.time.Instant endDateTimeMillis;
+ property public final java.time.Instant startDateTimeMillis;
+ field public static final androidx.wear.watchface.complications.data.TimeRange ALWAYS;
+ field public static final androidx.wear.watchface.complications.data.TimeRange.Companion Companion;
+ }
+
+ public static final class TimeRange.Companion {
+ method public androidx.wear.watchface.complications.data.TimeRange after(java.time.Instant startInstant);
+ method public androidx.wear.watchface.complications.data.TimeRange before(java.time.Instant endInstant);
+ method public androidx.wear.watchface.complications.data.TimeRange between(java.time.Instant startInstant, java.time.Instant endInstant);
+ }
+
+ public final class TypeKt {
+ }
+
+}
+
+package androidx.wear.watchface.utility {
+
+ public final class TraceEventKt {
+ }
+
+}
+
diff --git a/wear/watchface/watchface-complications-data/api/public_plus_experimental_current.txt b/wear/watchface/watchface-complications-data/api/public_plus_experimental_current.txt
new file mode 100644
index 0000000..d5b166a
--- /dev/null
+++ b/wear/watchface/watchface-complications-data/api/public_plus_experimental_current.txt
@@ -0,0 +1,399 @@
+// Signature format: 4.0
+package androidx.wear.watchface.complications {
+
+ public final class ComplicationDataSourceInfo {
+ ctor public ComplicationDataSourceInfo(String appName, String name, android.graphics.drawable.Icon icon, androidx.wear.watchface.complications.data.ComplicationType type, android.content.ComponentName? componentName);
+ method public String getAppName();
+ method public android.content.ComponentName? getComponentName();
+ method public androidx.wear.watchface.complications.data.ComplicationData getFallbackPreviewData();
+ method public android.graphics.drawable.Icon getIcon();
+ method public String getName();
+ method public androidx.wear.watchface.complications.data.ComplicationType getType();
+ property public final String appName;
+ property public final android.content.ComponentName? componentName;
+ property public final androidx.wear.watchface.complications.data.ComplicationData fallbackPreviewData;
+ property public final android.graphics.drawable.Icon icon;
+ property public final String name;
+ property public final androidx.wear.watchface.complications.data.ComplicationType type;
+ }
+
+ public final class ComplicationDataSourceInfoRetriever implements java.lang.AutoCloseable {
+ ctor public ComplicationDataSourceInfoRetriever(android.content.Context context);
+ method public void close();
+ method @kotlin.jvm.Throws(exceptionClasses=ServiceDisconnectedException::class) public suspend Object? retrieveComplicationDataSourceInfo(android.content.ComponentName watchFaceComponent, int[] watchFaceComplicationIds, kotlin.coroutines.Continuation<? super androidx.wear.watchface.complications.ComplicationDataSourceInfoRetriever.Result[]> p) throws androidx.wear.watchface.complications.ComplicationDataSourceInfoRetriever.ServiceDisconnectedException;
+ method @RequiresApi(android.os.Build.VERSION_CODES.R) @kotlin.jvm.Throws(exceptionClasses=ServiceDisconnectedException::class) public suspend Object? retrievePreviewComplicationData(android.content.ComponentName complicationDataSourceComponent, androidx.wear.watchface.complications.data.ComplicationType complicationType, kotlin.coroutines.Continuation<? super androidx.wear.watchface.complications.data.ComplicationData> p) throws androidx.wear.watchface.complications.ComplicationDataSourceInfoRetriever.ServiceDisconnectedException;
+ }
+
+ public static final class ComplicationDataSourceInfoRetriever.Result {
+ method public androidx.wear.watchface.complications.ComplicationDataSourceInfo? getInfo();
+ method public int getSlotId();
+ property public final androidx.wear.watchface.complications.ComplicationDataSourceInfo? info;
+ property public final int slotId;
+ }
+
+ public static final class ComplicationDataSourceInfoRetriever.ServiceDisconnectedException extends java.lang.Exception {
+ ctor public ComplicationDataSourceInfoRetriever.ServiceDisconnectedException();
+ }
+
+ public final class ComplicationDataSourceInfoRetrieverKt {
+ }
+
+ public final class ComplicationSlotBounds {
+ ctor public ComplicationSlotBounds(java.util.Map<androidx.wear.watchface.complications.data.ComplicationType,? extends android.graphics.RectF> perComplicationTypeBounds);
+ ctor public ComplicationSlotBounds(android.graphics.RectF bounds);
+ method public java.util.Map<androidx.wear.watchface.complications.data.ComplicationType,android.graphics.RectF> getPerComplicationTypeBounds();
+ property public final java.util.Map<androidx.wear.watchface.complications.data.ComplicationType,android.graphics.RectF> perComplicationTypeBounds;
+ }
+
+ public final class DefaultComplicationDataSourcePolicy {
+ ctor public DefaultComplicationDataSourcePolicy();
+ ctor public DefaultComplicationDataSourcePolicy(int systemProvider);
+ ctor public DefaultComplicationDataSourcePolicy(android.content.ComponentName dataSource, int systemDataSourceFallback);
+ ctor public DefaultComplicationDataSourcePolicy(android.content.ComponentName primaryDataSource, android.content.ComponentName secondaryDataSource, int systemDataSourceFallback);
+ method public android.content.ComponentName? getPrimaryDataSource();
+ method public android.content.ComponentName? getSecondaryDataSource();
+ method public int getSystemDataSourceFallback();
+ method public boolean isEmpty();
+ property public final android.content.ComponentName? primaryDataSource;
+ property public final android.content.ComponentName? secondaryDataSource;
+ property public final int systemDataSourceFallback;
+ }
+
+ public final class SystemDataSources {
+ field public static final androidx.wear.watchface.complications.SystemDataSources.Companion Companion;
+ field public static final int DATA_SOURCE_APP_SHORTCUT = 6; // 0x6
+ field public static final int DATA_SOURCE_DATE = 2; // 0x2
+ field public static final int DATA_SOURCE_DAY_AND_DATE = 16; // 0x10
+ field public static final int DATA_SOURCE_DAY_OF_WEEK = 13; // 0xd
+ field public static final int DATA_SOURCE_FAVORITE_CONTACT = 14; // 0xe
+ field public static final int DATA_SOURCE_NEXT_EVENT = 9; // 0x9
+ field public static final int DATA_SOURCE_STEP_COUNT = 4; // 0x4
+ field public static final int DATA_SOURCE_SUNRISE_SUNSET = 12; // 0xc
+ field public static final int DATA_SOURCE_TIME_AND_DATE = 3; // 0x3
+ field public static final int DATA_SOURCE_UNREAD_NOTIFICATION_COUNT = 7; // 0x7
+ field public static final int DATA_SOURCE_WATCH_BATTERY = 1; // 0x1
+ field public static final int DATA_SOURCE_WORLD_CLOCK = 5; // 0x5
+ field public static final int NO_DATA_SOURCE = -1; // 0xffffffff
+ }
+
+ public static final class SystemDataSources.Companion {
+ }
+
+}
+
+package androidx.wear.watchface.complications.data {
+
+ public abstract sealed class ComplicationData {
+ method public final android.app.PendingIntent? getTapAction();
+ method public final androidx.wear.watchface.complications.data.ComplicationType getType();
+ method public final androidx.wear.watchface.complications.data.TimeRange getValidTimeRange();
+ property public final android.app.PendingIntent? tapAction;
+ property public final androidx.wear.watchface.complications.data.ComplicationType type;
+ property public final androidx.wear.watchface.complications.data.TimeRange validTimeRange;
+ }
+
+ public interface ComplicationText {
+ method public java.time.Instant getNextChangeTime(java.time.Instant afterInstant);
+ method public CharSequence getTextAt(android.content.res.Resources resources, java.time.Instant instant);
+ method public boolean isAlwaysEmpty();
+ method public boolean returnsSameText(java.time.Instant firstInstant, java.time.Instant secondInstant);
+ field public static final androidx.wear.watchface.complications.data.ComplicationText.Companion Companion;
+ field public static final androidx.wear.watchface.complications.data.ComplicationText EMPTY;
+ }
+
+ public static final class ComplicationText.Companion {
+ }
+
+ public enum ComplicationType {
+ enum_constant public static final androidx.wear.watchface.complications.data.ComplicationType EMPTY;
+ enum_constant public static final androidx.wear.watchface.complications.data.ComplicationType LONG_TEXT;
+ enum_constant public static final androidx.wear.watchface.complications.data.ComplicationType MONOCHROMATIC_IMAGE;
+ enum_constant public static final androidx.wear.watchface.complications.data.ComplicationType NOT_CONFIGURED;
+ enum_constant public static final androidx.wear.watchface.complications.data.ComplicationType NO_DATA;
+ enum_constant public static final androidx.wear.watchface.complications.data.ComplicationType NO_PERMISSION;
+ enum_constant public static final androidx.wear.watchface.complications.data.ComplicationType PHOTO_IMAGE;
+ enum_constant public static final androidx.wear.watchface.complications.data.ComplicationType RANGED_VALUE;
+ enum_constant public static final androidx.wear.watchface.complications.data.ComplicationType SHORT_TEXT;
+ enum_constant public static final androidx.wear.watchface.complications.data.ComplicationType SMALL_IMAGE;
+ }
+
+ public final class CountDownTimeReference {
+ ctor public CountDownTimeReference(java.time.Instant instant);
+ method public java.time.Instant getInstant();
+ property public final java.time.Instant instant;
+ }
+
+ public final class CountUpTimeReference {
+ ctor public CountUpTimeReference(java.time.Instant instant);
+ method public java.time.Instant getInstant();
+ property public final java.time.Instant instant;
+ }
+
+ public final class DataKt {
+ }
+
+ public final class EmptyComplicationData extends androidx.wear.watchface.complications.data.ComplicationData {
+ ctor public EmptyComplicationData();
+ field public static final androidx.wear.watchface.complications.data.ComplicationType TYPE;
+ }
+
+ public final class LongTextComplicationData extends androidx.wear.watchface.complications.data.ComplicationData {
+ method public androidx.wear.watchface.complications.data.ComplicationText? getContentDescription();
+ method public androidx.wear.watchface.complications.data.MonochromaticImage? getMonochromaticImage();
+ method public androidx.wear.watchface.complications.data.SmallImage? getSmallImage();
+ method public androidx.wear.watchface.complications.data.ComplicationText getText();
+ method public androidx.wear.watchface.complications.data.ComplicationText? getTitle();
+ property public final androidx.wear.watchface.complications.data.ComplicationText? contentDescription;
+ property public final androidx.wear.watchface.complications.data.MonochromaticImage? monochromaticImage;
+ property public final androidx.wear.watchface.complications.data.SmallImage? smallImage;
+ property public final androidx.wear.watchface.complications.data.ComplicationText text;
+ property public final androidx.wear.watchface.complications.data.ComplicationText? title;
+ field public static final androidx.wear.watchface.complications.data.ComplicationType TYPE;
+ }
+
+ public static final class LongTextComplicationData.Builder {
+ ctor public LongTextComplicationData.Builder(androidx.wear.watchface.complications.data.ComplicationText text, androidx.wear.watchface.complications.data.ComplicationText contentDescription);
+ method public androidx.wear.watchface.complications.data.LongTextComplicationData build();
+ method public androidx.wear.watchface.complications.data.LongTextComplicationData.Builder setMonochromaticImage(androidx.wear.watchface.complications.data.MonochromaticImage? icon);
+ method public androidx.wear.watchface.complications.data.LongTextComplicationData.Builder setSmallImage(androidx.wear.watchface.complications.data.SmallImage? smallImage);
+ method public androidx.wear.watchface.complications.data.LongTextComplicationData.Builder setTapAction(android.app.PendingIntent? tapAction);
+ method public androidx.wear.watchface.complications.data.LongTextComplicationData.Builder setTitle(androidx.wear.watchface.complications.data.ComplicationText? title);
+ method public androidx.wear.watchface.complications.data.LongTextComplicationData.Builder setValidTimeRange(androidx.wear.watchface.complications.data.TimeRange? validTimeRange);
+ }
+
+ public final class MonochromaticImage {
+ method public android.graphics.drawable.Icon? getAmbientImage();
+ method public android.graphics.drawable.Icon getImage();
+ property public final android.graphics.drawable.Icon? ambientImage;
+ property public final android.graphics.drawable.Icon image;
+ }
+
+ public static final class MonochromaticImage.Builder {
+ ctor public MonochromaticImage.Builder(android.graphics.drawable.Icon image);
+ method public androidx.wear.watchface.complications.data.MonochromaticImage build();
+ method public androidx.wear.watchface.complications.data.MonochromaticImage.Builder setAmbientImage(android.graphics.drawable.Icon? ambientImage);
+ }
+
+ public final class MonochromaticImageComplicationData extends androidx.wear.watchface.complications.data.ComplicationData {
+ method public androidx.wear.watchface.complications.data.ComplicationText? getContentDescription();
+ method public androidx.wear.watchface.complications.data.MonochromaticImage getMonochromaticImage();
+ property public final androidx.wear.watchface.complications.data.ComplicationText? contentDescription;
+ property public final androidx.wear.watchface.complications.data.MonochromaticImage monochromaticImage;
+ field public static final androidx.wear.watchface.complications.data.ComplicationType TYPE;
+ }
+
+ public static final class MonochromaticImageComplicationData.Builder {
+ ctor public MonochromaticImageComplicationData.Builder(androidx.wear.watchface.complications.data.MonochromaticImage monochromaticImage, androidx.wear.watchface.complications.data.ComplicationText contentDescription);
+ method public androidx.wear.watchface.complications.data.MonochromaticImageComplicationData build();
+ method public androidx.wear.watchface.complications.data.MonochromaticImageComplicationData.Builder setTapAction(android.app.PendingIntent? tapAction);
+ method public androidx.wear.watchface.complications.data.MonochromaticImageComplicationData.Builder setValidTimeRange(androidx.wear.watchface.complications.data.TimeRange? validTimeRange);
+ }
+
+ public final class NoDataComplicationData extends androidx.wear.watchface.complications.data.ComplicationData {
+ ctor public NoDataComplicationData();
+ field public static final androidx.wear.watchface.complications.data.ComplicationType TYPE;
+ }
+
+ public final class NoPermissionComplicationData extends androidx.wear.watchface.complications.data.ComplicationData {
+ method public androidx.wear.watchface.complications.data.MonochromaticImage? getMonochromaticImage();
+ method public androidx.wear.watchface.complications.data.ComplicationText? getText();
+ method public androidx.wear.watchface.complications.data.ComplicationText? getTitle();
+ property public final androidx.wear.watchface.complications.data.MonochromaticImage? monochromaticImage;
+ property public final androidx.wear.watchface.complications.data.ComplicationText? text;
+ property public final androidx.wear.watchface.complications.data.ComplicationText? title;
+ field public static final androidx.wear.watchface.complications.data.ComplicationType TYPE;
+ }
+
+ public static final class NoPermissionComplicationData.Builder {
+ ctor public NoPermissionComplicationData.Builder();
+ method public androidx.wear.watchface.complications.data.NoPermissionComplicationData build();
+ method public androidx.wear.watchface.complications.data.NoPermissionComplicationData.Builder setMonochromaticImage(androidx.wear.watchface.complications.data.MonochromaticImage? monochromaticImage);
+ method public androidx.wear.watchface.complications.data.NoPermissionComplicationData.Builder setText(androidx.wear.watchface.complications.data.ComplicationText? text);
+ method public androidx.wear.watchface.complications.data.NoPermissionComplicationData.Builder setTitle(androidx.wear.watchface.complications.data.ComplicationText? title);
+ }
+
+ public final class NotConfiguredComplicationData extends androidx.wear.watchface.complications.data.ComplicationData {
+ ctor public NotConfiguredComplicationData();
+ field public static final androidx.wear.watchface.complications.data.ComplicationType TYPE;
+ }
+
+ public final class PhotoImageComplicationData extends androidx.wear.watchface.complications.data.ComplicationData {
+ method public androidx.wear.watchface.complications.data.ComplicationText? getContentDescription();
+ method public android.graphics.drawable.Icon getPhotoImage();
+ property public final androidx.wear.watchface.complications.data.ComplicationText? contentDescription;
+ property public final android.graphics.drawable.Icon photoImage;
+ field public static final androidx.wear.watchface.complications.data.ComplicationType TYPE;
+ }
+
+ public static final class PhotoImageComplicationData.Builder {
+ ctor public PhotoImageComplicationData.Builder(android.graphics.drawable.Icon photoImage, androidx.wear.watchface.complications.data.ComplicationText contentDescription);
+ method public androidx.wear.watchface.complications.data.PhotoImageComplicationData build();
+ method public androidx.wear.watchface.complications.data.PhotoImageComplicationData.Builder setTapAction(android.app.PendingIntent? tapAction);
+ method public androidx.wear.watchface.complications.data.PhotoImageComplicationData.Builder setValidTimeRange(androidx.wear.watchface.complications.data.TimeRange? validTimeRange);
+ }
+
+ public final class PlainComplicationText implements androidx.wear.watchface.complications.data.ComplicationText {
+ }
+
+ public static final class PlainComplicationText.Builder {
+ ctor public PlainComplicationText.Builder(CharSequence text);
+ method public androidx.wear.watchface.complications.data.PlainComplicationText build();
+ }
+
+ public final class RangedValueComplicationData extends androidx.wear.watchface.complications.data.ComplicationData {
+ method public androidx.wear.watchface.complications.data.ComplicationText? getContentDescription();
+ method public float getMax();
+ method public float getMin();
+ method public androidx.wear.watchface.complications.data.MonochromaticImage? getMonochromaticImage();
+ method public androidx.wear.watchface.complications.data.ComplicationText? getText();
+ method public androidx.wear.watchface.complications.data.ComplicationText? getTitle();
+ method public float getValue();
+ property public final androidx.wear.watchface.complications.data.ComplicationText? contentDescription;
+ property public final float max;
+ property public final float min;
+ property public final androidx.wear.watchface.complications.data.MonochromaticImage? monochromaticImage;
+ property public final androidx.wear.watchface.complications.data.ComplicationText? text;
+ property public final androidx.wear.watchface.complications.data.ComplicationText? title;
+ property public final float value;
+ field public static final androidx.wear.watchface.complications.data.ComplicationType TYPE;
+ }
+
+ public static final class RangedValueComplicationData.Builder {
+ ctor public RangedValueComplicationData.Builder(float value, float min, float max, androidx.wear.watchface.complications.data.ComplicationText contentDescription);
+ method public androidx.wear.watchface.complications.data.RangedValueComplicationData build();
+ method public androidx.wear.watchface.complications.data.RangedValueComplicationData.Builder setMonochromaticImage(androidx.wear.watchface.complications.data.MonochromaticImage? monochromaticImage);
+ method public androidx.wear.watchface.complications.data.RangedValueComplicationData.Builder setTapAction(android.app.PendingIntent? tapAction);
+ method public androidx.wear.watchface.complications.data.RangedValueComplicationData.Builder setText(androidx.wear.watchface.complications.data.ComplicationText? text);
+ method public androidx.wear.watchface.complications.data.RangedValueComplicationData.Builder setTitle(androidx.wear.watchface.complications.data.ComplicationText? title);
+ method public androidx.wear.watchface.complications.data.RangedValueComplicationData.Builder setValidTimeRange(androidx.wear.watchface.complications.data.TimeRange? validTimeRange);
+ }
+
+ public final class ShortTextComplicationData extends androidx.wear.watchface.complications.data.ComplicationData {
+ method public androidx.wear.watchface.complications.data.ComplicationText? getContentDescription();
+ method public androidx.wear.watchface.complications.data.MonochromaticImage? getMonochromaticImage();
+ method public androidx.wear.watchface.complications.data.ComplicationText getText();
+ method public androidx.wear.watchface.complications.data.ComplicationText? getTitle();
+ property public final androidx.wear.watchface.complications.data.ComplicationText? contentDescription;
+ property public final androidx.wear.watchface.complications.data.MonochromaticImage? monochromaticImage;
+ property public final androidx.wear.watchface.complications.data.ComplicationText text;
+ property public final androidx.wear.watchface.complications.data.ComplicationText? title;
+ field public static final int MAX_TEXT_LENGTH;
+ field public static final androidx.wear.watchface.complications.data.ComplicationType TYPE;
+ }
+
+ public static final class ShortTextComplicationData.Builder {
+ ctor public ShortTextComplicationData.Builder(androidx.wear.watchface.complications.data.ComplicationText text, androidx.wear.watchface.complications.data.ComplicationText contentDescription);
+ method public androidx.wear.watchface.complications.data.ShortTextComplicationData build();
+ method public androidx.wear.watchface.complications.data.ShortTextComplicationData.Builder setMonochromaticImage(androidx.wear.watchface.complications.data.MonochromaticImage? monochromaticImage);
+ method public androidx.wear.watchface.complications.data.ShortTextComplicationData.Builder setTapAction(android.app.PendingIntent? tapAction);
+ method public androidx.wear.watchface.complications.data.ShortTextComplicationData.Builder setTitle(androidx.wear.watchface.complications.data.ComplicationText? title);
+ method public androidx.wear.watchface.complications.data.ShortTextComplicationData.Builder setValidTimeRange(androidx.wear.watchface.complications.data.TimeRange? validTimeRange);
+ }
+
+ public final class SmallImage {
+ method public android.graphics.drawable.Icon? getAmbientImage();
+ method public android.graphics.drawable.Icon getImage();
+ method public androidx.wear.watchface.complications.data.SmallImageType getType();
+ property public final android.graphics.drawable.Icon? ambientImage;
+ property public final android.graphics.drawable.Icon image;
+ property public final androidx.wear.watchface.complications.data.SmallImageType type;
+ }
+
+ public static final class SmallImage.Builder {
+ ctor public SmallImage.Builder(android.graphics.drawable.Icon image, androidx.wear.watchface.complications.data.SmallImageType type);
+ method public androidx.wear.watchface.complications.data.SmallImage build();
+ method public androidx.wear.watchface.complications.data.SmallImage.Builder setAmbientImage(android.graphics.drawable.Icon? ambientImage);
+ }
+
+ public final class SmallImageComplicationData extends androidx.wear.watchface.complications.data.ComplicationData {
+ method public androidx.wear.watchface.complications.data.ComplicationText? getContentDescription();
+ method public androidx.wear.watchface.complications.data.SmallImage getSmallImage();
+ property public final androidx.wear.watchface.complications.data.ComplicationText? contentDescription;
+ property public final androidx.wear.watchface.complications.data.SmallImage smallImage;
+ field public static final androidx.wear.watchface.complications.data.ComplicationType TYPE;
+ }
+
+ public static final class SmallImageComplicationData.Builder {
+ ctor public SmallImageComplicationData.Builder(androidx.wear.watchface.complications.data.SmallImage smallImage, androidx.wear.watchface.complications.data.ComplicationText contentDescription);
+ method public androidx.wear.watchface.complications.data.SmallImageComplicationData build();
+ method public androidx.wear.watchface.complications.data.SmallImageComplicationData.Builder setTapAction(android.app.PendingIntent? tapAction);
+ method public androidx.wear.watchface.complications.data.SmallImageComplicationData.Builder setValidTimeRange(androidx.wear.watchface.complications.data.TimeRange? validTimeRange);
+ }
+
+ public enum SmallImageType {
+ enum_constant public static final androidx.wear.watchface.complications.data.SmallImageType ICON;
+ enum_constant public static final androidx.wear.watchface.complications.data.SmallImageType PHOTO;
+ }
+
+ public final class TextKt {
+ }
+
+ public final class TimeDifferenceComplicationText implements androidx.wear.watchface.complications.data.ComplicationText {
+ method public java.util.concurrent.TimeUnit? getMinimumTimeUnit();
+ }
+
+ public static final class TimeDifferenceComplicationText.Builder {
+ ctor public TimeDifferenceComplicationText.Builder(androidx.wear.watchface.complications.data.TimeDifferenceStyle style, androidx.wear.watchface.complications.data.CountUpTimeReference countUpTimeReference);
+ ctor public TimeDifferenceComplicationText.Builder(androidx.wear.watchface.complications.data.TimeDifferenceStyle style, androidx.wear.watchface.complications.data.CountDownTimeReference countDownTimeReference);
+ method public androidx.wear.watchface.complications.data.TimeDifferenceComplicationText build();
+ method public androidx.wear.watchface.complications.data.TimeDifferenceComplicationText.Builder setDisplayAsNow(boolean displayAsNow);
+ method public androidx.wear.watchface.complications.data.TimeDifferenceComplicationText.Builder setMinimumTimeUnit(java.util.concurrent.TimeUnit? minimumUnit);
+ method public androidx.wear.watchface.complications.data.TimeDifferenceComplicationText.Builder setText(CharSequence? text);
+ }
+
+ public enum TimeDifferenceStyle {
+ enum_constant public static final androidx.wear.watchface.complications.data.TimeDifferenceStyle SHORT_DUAL_UNIT;
+ enum_constant public static final androidx.wear.watchface.complications.data.TimeDifferenceStyle SHORT_SINGLE_UNIT;
+ enum_constant public static final androidx.wear.watchface.complications.data.TimeDifferenceStyle SHORT_WORDS_SINGLE_UNIT;
+ enum_constant public static final androidx.wear.watchface.complications.data.TimeDifferenceStyle STOPWATCH;
+ enum_constant public static final androidx.wear.watchface.complications.data.TimeDifferenceStyle WORDS_SINGLE_UNIT;
+ }
+
+ public final class TimeFormatComplicationText implements androidx.wear.watchface.complications.data.ComplicationText {
+ }
+
+ public static final class TimeFormatComplicationText.Builder {
+ ctor public TimeFormatComplicationText.Builder(String format);
+ method public androidx.wear.watchface.complications.data.TimeFormatComplicationText build();
+ method public androidx.wear.watchface.complications.data.TimeFormatComplicationText.Builder setStyle(androidx.wear.watchface.complications.data.TimeFormatStyle style);
+ method public androidx.wear.watchface.complications.data.TimeFormatComplicationText.Builder setText(CharSequence text);
+ method public androidx.wear.watchface.complications.data.TimeFormatComplicationText.Builder setTimeZone(android.icu.util.TimeZone timeZone);
+ }
+
+ public enum TimeFormatStyle {
+ enum_constant public static final androidx.wear.watchface.complications.data.TimeFormatStyle DEFAULT;
+ enum_constant public static final androidx.wear.watchface.complications.data.TimeFormatStyle LOWER_CASE;
+ enum_constant public static final androidx.wear.watchface.complications.data.TimeFormatStyle UPPER_CASE;
+ }
+
+ public final class TimeRange {
+ method public static androidx.wear.watchface.complications.data.TimeRange after(java.time.Instant startInstant);
+ method public static androidx.wear.watchface.complications.data.TimeRange before(java.time.Instant endInstant);
+ method public static androidx.wear.watchface.complications.data.TimeRange between(java.time.Instant startInstant, java.time.Instant endInstant);
+ method public operator boolean contains(java.time.Instant dateTimeMillis);
+ method public java.time.Instant getEndDateTimeMillis();
+ method public java.time.Instant getStartDateTimeMillis();
+ property public final java.time.Instant endDateTimeMillis;
+ property public final java.time.Instant startDateTimeMillis;
+ field public static final androidx.wear.watchface.complications.data.TimeRange ALWAYS;
+ field public static final androidx.wear.watchface.complications.data.TimeRange.Companion Companion;
+ }
+
+ public static final class TimeRange.Companion {
+ method public androidx.wear.watchface.complications.data.TimeRange after(java.time.Instant startInstant);
+ method public androidx.wear.watchface.complications.data.TimeRange before(java.time.Instant endInstant);
+ method public androidx.wear.watchface.complications.data.TimeRange between(java.time.Instant startInstant, java.time.Instant endInstant);
+ }
+
+ public final class TypeKt {
+ }
+
+}
+
+package androidx.wear.watchface.utility {
+
+ public final class TraceEventKt {
+ }
+
+}
+
diff --git a/wear/wear-complications-data/api/res-current.txt b/wear/watchface/watchface-complications-data/api/res-current.txt
similarity index 100%
rename from wear/wear-complications-data/api/res-current.txt
rename to wear/watchface/watchface-complications-data/api/res-current.txt
diff --git a/wear/watchface/watchface-complications-data/api/restricted_current.txt b/wear/watchface/watchface-complications-data/api/restricted_current.txt
new file mode 100644
index 0000000..e892681
--- /dev/null
+++ b/wear/watchface/watchface-complications-data/api/restricted_current.txt
@@ -0,0 +1,409 @@
+// Signature format: 4.0
+package androidx.wear.watchface.complications {
+
+ public final class ComplicationDataSourceInfo {
+ ctor public ComplicationDataSourceInfo(String appName, String name, android.graphics.drawable.Icon icon, androidx.wear.watchface.complications.data.ComplicationType type, android.content.ComponentName? componentName);
+ method public String getAppName();
+ method public android.content.ComponentName? getComponentName();
+ method public androidx.wear.watchface.complications.data.ComplicationData getFallbackPreviewData();
+ method public android.graphics.drawable.Icon getIcon();
+ method public String getName();
+ method public androidx.wear.watchface.complications.data.ComplicationType getType();
+ property public final String appName;
+ property public final android.content.ComponentName? componentName;
+ property public final androidx.wear.watchface.complications.data.ComplicationData fallbackPreviewData;
+ property public final android.graphics.drawable.Icon icon;
+ property public final String name;
+ property public final androidx.wear.watchface.complications.data.ComplicationType type;
+ }
+
+ public final class ComplicationDataSourceInfoRetriever implements java.lang.AutoCloseable {
+ ctor public ComplicationDataSourceInfoRetriever(android.content.Context context);
+ method public void close();
+ method @kotlin.jvm.Throws(exceptionClasses=ServiceDisconnectedException::class) public suspend Object? retrieveComplicationDataSourceInfo(android.content.ComponentName watchFaceComponent, int[] watchFaceComplicationIds, kotlin.coroutines.Continuation<? super androidx.wear.watchface.complications.ComplicationDataSourceInfoRetriever.Result[]> p) throws androidx.wear.watchface.complications.ComplicationDataSourceInfoRetriever.ServiceDisconnectedException;
+ method @RequiresApi(android.os.Build.VERSION_CODES.R) @kotlin.jvm.Throws(exceptionClasses=ServiceDisconnectedException::class) public suspend Object? retrievePreviewComplicationData(android.content.ComponentName complicationDataSourceComponent, androidx.wear.watchface.complications.data.ComplicationType complicationType, kotlin.coroutines.Continuation<? super androidx.wear.watchface.complications.data.ComplicationData> p) throws androidx.wear.watchface.complications.ComplicationDataSourceInfoRetriever.ServiceDisconnectedException;
+ }
+
+ public static final class ComplicationDataSourceInfoRetriever.Result {
+ method public androidx.wear.watchface.complications.ComplicationDataSourceInfo? getInfo();
+ method public int getSlotId();
+ property public final androidx.wear.watchface.complications.ComplicationDataSourceInfo? info;
+ property public final int slotId;
+ }
+
+ public static final class ComplicationDataSourceInfoRetriever.ServiceDisconnectedException extends java.lang.Exception {
+ ctor public ComplicationDataSourceInfoRetriever.ServiceDisconnectedException();
+ }
+
+ public final class ComplicationDataSourceInfoRetrieverKt {
+ }
+
+ public final class ComplicationSlotBounds {
+ ctor public ComplicationSlotBounds(java.util.Map<androidx.wear.watchface.complications.data.ComplicationType,? extends android.graphics.RectF> perComplicationTypeBounds);
+ ctor public ComplicationSlotBounds(android.graphics.RectF bounds);
+ method public java.util.Map<androidx.wear.watchface.complications.data.ComplicationType,android.graphics.RectF> getPerComplicationTypeBounds();
+ property public final java.util.Map<androidx.wear.watchface.complications.data.ComplicationType,android.graphics.RectF> perComplicationTypeBounds;
+ }
+
+ public final class DefaultComplicationDataSourcePolicy {
+ ctor public DefaultComplicationDataSourcePolicy();
+ ctor public DefaultComplicationDataSourcePolicy(int systemProvider);
+ ctor public DefaultComplicationDataSourcePolicy(android.content.ComponentName dataSource, int systemDataSourceFallback);
+ ctor public DefaultComplicationDataSourcePolicy(android.content.ComponentName primaryDataSource, android.content.ComponentName secondaryDataSource, int systemDataSourceFallback);
+ method public android.content.ComponentName? getPrimaryDataSource();
+ method public android.content.ComponentName? getSecondaryDataSource();
+ method public int getSystemDataSourceFallback();
+ method public boolean isEmpty();
+ property public final android.content.ComponentName? primaryDataSource;
+ property public final android.content.ComponentName? secondaryDataSource;
+ property public final int systemDataSourceFallback;
+ }
+
+ public final class SystemDataSources {
+ field public static final androidx.wear.watchface.complications.SystemDataSources.Companion Companion;
+ field public static final int DATA_SOURCE_APP_SHORTCUT = 6; // 0x6
+ field public static final int DATA_SOURCE_DATE = 2; // 0x2
+ field public static final int DATA_SOURCE_DAY_AND_DATE = 16; // 0x10
+ field public static final int DATA_SOURCE_DAY_OF_WEEK = 13; // 0xd
+ field public static final int DATA_SOURCE_FAVORITE_CONTACT = 14; // 0xe
+ field public static final int DATA_SOURCE_NEXT_EVENT = 9; // 0x9
+ field public static final int DATA_SOURCE_STEP_COUNT = 4; // 0x4
+ field public static final int DATA_SOURCE_SUNRISE_SUNSET = 12; // 0xc
+ field public static final int DATA_SOURCE_TIME_AND_DATE = 3; // 0x3
+ field public static final int DATA_SOURCE_UNREAD_NOTIFICATION_COUNT = 7; // 0x7
+ field public static final int DATA_SOURCE_WATCH_BATTERY = 1; // 0x1
+ field public static final int DATA_SOURCE_WORLD_CLOCK = 5; // 0x5
+ field public static final int NO_DATA_SOURCE = -1; // 0xffffffff
+ }
+
+ public static final class SystemDataSources.Companion {
+ }
+
+}
+
+package androidx.wear.watchface.complications.data {
+
+ public abstract sealed class ComplicationData {
+ method public final android.app.PendingIntent? getTapAction();
+ method public final androidx.wear.watchface.complications.data.ComplicationType getType();
+ method public final androidx.wear.watchface.complications.data.TimeRange getValidTimeRange();
+ property public final android.app.PendingIntent? tapAction;
+ property public final androidx.wear.watchface.complications.data.ComplicationType type;
+ property public final androidx.wear.watchface.complications.data.TimeRange validTimeRange;
+ }
+
+ public interface ComplicationText {
+ method public java.time.Instant getNextChangeTime(java.time.Instant afterInstant);
+ method public CharSequence getTextAt(android.content.res.Resources resources, java.time.Instant instant);
+ method public boolean isAlwaysEmpty();
+ method public boolean returnsSameText(java.time.Instant firstInstant, java.time.Instant secondInstant);
+ field public static final androidx.wear.watchface.complications.data.ComplicationText.Companion Companion;
+ field public static final androidx.wear.watchface.complications.data.ComplicationText EMPTY;
+ }
+
+ public static final class ComplicationText.Companion {
+ }
+
+ public enum ComplicationType {
+ enum_constant public static final androidx.wear.watchface.complications.data.ComplicationType EMPTY;
+ enum_constant public static final androidx.wear.watchface.complications.data.ComplicationType LONG_TEXT;
+ enum_constant public static final androidx.wear.watchface.complications.data.ComplicationType MONOCHROMATIC_IMAGE;
+ enum_constant public static final androidx.wear.watchface.complications.data.ComplicationType NOT_CONFIGURED;
+ enum_constant public static final androidx.wear.watchface.complications.data.ComplicationType NO_DATA;
+ enum_constant public static final androidx.wear.watchface.complications.data.ComplicationType NO_PERMISSION;
+ enum_constant public static final androidx.wear.watchface.complications.data.ComplicationType PHOTO_IMAGE;
+ enum_constant public static final androidx.wear.watchface.complications.data.ComplicationType RANGED_VALUE;
+ enum_constant public static final androidx.wear.watchface.complications.data.ComplicationType SHORT_TEXT;
+ enum_constant public static final androidx.wear.watchface.complications.data.ComplicationType SMALL_IMAGE;
+ }
+
+ public final class CountDownTimeReference {
+ ctor public CountDownTimeReference(java.time.Instant instant);
+ method public java.time.Instant getInstant();
+ property public final java.time.Instant instant;
+ }
+
+ public final class CountUpTimeReference {
+ ctor public CountUpTimeReference(java.time.Instant instant);
+ method public java.time.Instant getInstant();
+ property public final java.time.Instant instant;
+ }
+
+ public final class DataKt {
+ }
+
+ public final class EmptyComplicationData extends androidx.wear.watchface.complications.data.ComplicationData {
+ ctor public EmptyComplicationData();
+ method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public android.support.wearable.complications.ComplicationData asWireComplicationData();
+ field public static final androidx.wear.watchface.complications.data.ComplicationType TYPE;
+ }
+
+ public final class LongTextComplicationData extends androidx.wear.watchface.complications.data.ComplicationData {
+ method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public android.support.wearable.complications.ComplicationData asWireComplicationData();
+ method public androidx.wear.watchface.complications.data.ComplicationText? getContentDescription();
+ method public androidx.wear.watchface.complications.data.MonochromaticImage? getMonochromaticImage();
+ method public androidx.wear.watchface.complications.data.SmallImage? getSmallImage();
+ method public androidx.wear.watchface.complications.data.ComplicationText getText();
+ method public androidx.wear.watchface.complications.data.ComplicationText? getTitle();
+ property public final androidx.wear.watchface.complications.data.ComplicationText? contentDescription;
+ property public final androidx.wear.watchface.complications.data.MonochromaticImage? monochromaticImage;
+ property public final androidx.wear.watchface.complications.data.SmallImage? smallImage;
+ property public final androidx.wear.watchface.complications.data.ComplicationText text;
+ property public final androidx.wear.watchface.complications.data.ComplicationText? title;
+ field public static final androidx.wear.watchface.complications.data.ComplicationType TYPE;
+ }
+
+ public static final class LongTextComplicationData.Builder {
+ ctor public LongTextComplicationData.Builder(androidx.wear.watchface.complications.data.ComplicationText text, androidx.wear.watchface.complications.data.ComplicationText contentDescription);
+ method public androidx.wear.watchface.complications.data.LongTextComplicationData build();
+ method public androidx.wear.watchface.complications.data.LongTextComplicationData.Builder setMonochromaticImage(androidx.wear.watchface.complications.data.MonochromaticImage? icon);
+ method public androidx.wear.watchface.complications.data.LongTextComplicationData.Builder setSmallImage(androidx.wear.watchface.complications.data.SmallImage? smallImage);
+ method public androidx.wear.watchface.complications.data.LongTextComplicationData.Builder setTapAction(android.app.PendingIntent? tapAction);
+ method public androidx.wear.watchface.complications.data.LongTextComplicationData.Builder setTitle(androidx.wear.watchface.complications.data.ComplicationText? title);
+ method public androidx.wear.watchface.complications.data.LongTextComplicationData.Builder setValidTimeRange(androidx.wear.watchface.complications.data.TimeRange? validTimeRange);
+ }
+
+ public final class MonochromaticImage {
+ method public android.graphics.drawable.Icon? getAmbientImage();
+ method public android.graphics.drawable.Icon getImage();
+ property public final android.graphics.drawable.Icon? ambientImage;
+ property public final android.graphics.drawable.Icon image;
+ }
+
+ public static final class MonochromaticImage.Builder {
+ ctor public MonochromaticImage.Builder(android.graphics.drawable.Icon image);
+ method public androidx.wear.watchface.complications.data.MonochromaticImage build();
+ method public androidx.wear.watchface.complications.data.MonochromaticImage.Builder setAmbientImage(android.graphics.drawable.Icon? ambientImage);
+ }
+
+ public final class MonochromaticImageComplicationData extends androidx.wear.watchface.complications.data.ComplicationData {
+ method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public android.support.wearable.complications.ComplicationData asWireComplicationData();
+ method public androidx.wear.watchface.complications.data.ComplicationText? getContentDescription();
+ method public androidx.wear.watchface.complications.data.MonochromaticImage getMonochromaticImage();
+ property public final androidx.wear.watchface.complications.data.ComplicationText? contentDescription;
+ property public final androidx.wear.watchface.complications.data.MonochromaticImage monochromaticImage;
+ field public static final androidx.wear.watchface.complications.data.ComplicationType TYPE;
+ }
+
+ public static final class MonochromaticImageComplicationData.Builder {
+ ctor public MonochromaticImageComplicationData.Builder(androidx.wear.watchface.complications.data.MonochromaticImage monochromaticImage, androidx.wear.watchface.complications.data.ComplicationText contentDescription);
+ method public androidx.wear.watchface.complications.data.MonochromaticImageComplicationData build();
+ method public androidx.wear.watchface.complications.data.MonochromaticImageComplicationData.Builder setTapAction(android.app.PendingIntent? tapAction);
+ method public androidx.wear.watchface.complications.data.MonochromaticImageComplicationData.Builder setValidTimeRange(androidx.wear.watchface.complications.data.TimeRange? validTimeRange);
+ }
+
+ public final class NoDataComplicationData extends androidx.wear.watchface.complications.data.ComplicationData {
+ ctor public NoDataComplicationData();
+ method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public android.support.wearable.complications.ComplicationData asWireComplicationData();
+ field public static final androidx.wear.watchface.complications.data.ComplicationType TYPE;
+ }
+
+ public final class NoPermissionComplicationData extends androidx.wear.watchface.complications.data.ComplicationData {
+ method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public android.support.wearable.complications.ComplicationData asWireComplicationData();
+ method public androidx.wear.watchface.complications.data.MonochromaticImage? getMonochromaticImage();
+ method public androidx.wear.watchface.complications.data.ComplicationText? getText();
+ method public androidx.wear.watchface.complications.data.ComplicationText? getTitle();
+ property public final androidx.wear.watchface.complications.data.MonochromaticImage? monochromaticImage;
+ property public final androidx.wear.watchface.complications.data.ComplicationText? text;
+ property public final androidx.wear.watchface.complications.data.ComplicationText? title;
+ field public static final androidx.wear.watchface.complications.data.ComplicationType TYPE;
+ }
+
+ public static final class NoPermissionComplicationData.Builder {
+ ctor public NoPermissionComplicationData.Builder();
+ method public androidx.wear.watchface.complications.data.NoPermissionComplicationData build();
+ method public androidx.wear.watchface.complications.data.NoPermissionComplicationData.Builder setMonochromaticImage(androidx.wear.watchface.complications.data.MonochromaticImage? monochromaticImage);
+ method public androidx.wear.watchface.complications.data.NoPermissionComplicationData.Builder setText(androidx.wear.watchface.complications.data.ComplicationText? text);
+ method public androidx.wear.watchface.complications.data.NoPermissionComplicationData.Builder setTitle(androidx.wear.watchface.complications.data.ComplicationText? title);
+ }
+
+ public final class NotConfiguredComplicationData extends androidx.wear.watchface.complications.data.ComplicationData {
+ ctor public NotConfiguredComplicationData();
+ method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public android.support.wearable.complications.ComplicationData asWireComplicationData();
+ field public static final androidx.wear.watchface.complications.data.ComplicationType TYPE;
+ }
+
+ public final class PhotoImageComplicationData extends androidx.wear.watchface.complications.data.ComplicationData {
+ method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public android.support.wearable.complications.ComplicationData asWireComplicationData();
+ method public androidx.wear.watchface.complications.data.ComplicationText? getContentDescription();
+ method public android.graphics.drawable.Icon getPhotoImage();
+ property public final androidx.wear.watchface.complications.data.ComplicationText? contentDescription;
+ property public final android.graphics.drawable.Icon photoImage;
+ field public static final androidx.wear.watchface.complications.data.ComplicationType TYPE;
+ }
+
+ public static final class PhotoImageComplicationData.Builder {
+ ctor public PhotoImageComplicationData.Builder(android.graphics.drawable.Icon photoImage, androidx.wear.watchface.complications.data.ComplicationText contentDescription);
+ method public androidx.wear.watchface.complications.data.PhotoImageComplicationData build();
+ method public androidx.wear.watchface.complications.data.PhotoImageComplicationData.Builder setTapAction(android.app.PendingIntent? tapAction);
+ method public androidx.wear.watchface.complications.data.PhotoImageComplicationData.Builder setValidTimeRange(androidx.wear.watchface.complications.data.TimeRange? validTimeRange);
+ }
+
+ public final class PlainComplicationText implements androidx.wear.watchface.complications.data.ComplicationText {
+ }
+
+ public static final class PlainComplicationText.Builder {
+ ctor public PlainComplicationText.Builder(CharSequence text);
+ method public androidx.wear.watchface.complications.data.PlainComplicationText build();
+ }
+
+ public final class RangedValueComplicationData extends androidx.wear.watchface.complications.data.ComplicationData {
+ method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public android.support.wearable.complications.ComplicationData asWireComplicationData();
+ method public androidx.wear.watchface.complications.data.ComplicationText? getContentDescription();
+ method public float getMax();
+ method public float getMin();
+ method public androidx.wear.watchface.complications.data.MonochromaticImage? getMonochromaticImage();
+ method public androidx.wear.watchface.complications.data.ComplicationText? getText();
+ method public androidx.wear.watchface.complications.data.ComplicationText? getTitle();
+ method public float getValue();
+ property public final androidx.wear.watchface.complications.data.ComplicationText? contentDescription;
+ property public final float max;
+ property public final float min;
+ property public final androidx.wear.watchface.complications.data.MonochromaticImage? monochromaticImage;
+ property public final androidx.wear.watchface.complications.data.ComplicationText? text;
+ property public final androidx.wear.watchface.complications.data.ComplicationText? title;
+ property public final float value;
+ field public static final androidx.wear.watchface.complications.data.ComplicationType TYPE;
+ }
+
+ public static final class RangedValueComplicationData.Builder {
+ ctor public RangedValueComplicationData.Builder(float value, float min, float max, androidx.wear.watchface.complications.data.ComplicationText contentDescription);
+ method public androidx.wear.watchface.complications.data.RangedValueComplicationData build();
+ method public androidx.wear.watchface.complications.data.RangedValueComplicationData.Builder setMonochromaticImage(androidx.wear.watchface.complications.data.MonochromaticImage? monochromaticImage);
+ method public androidx.wear.watchface.complications.data.RangedValueComplicationData.Builder setTapAction(android.app.PendingIntent? tapAction);
+ method public androidx.wear.watchface.complications.data.RangedValueComplicationData.Builder setText(androidx.wear.watchface.complications.data.ComplicationText? text);
+ method public androidx.wear.watchface.complications.data.RangedValueComplicationData.Builder setTitle(androidx.wear.watchface.complications.data.ComplicationText? title);
+ method public androidx.wear.watchface.complications.data.RangedValueComplicationData.Builder setValidTimeRange(androidx.wear.watchface.complications.data.TimeRange? validTimeRange);
+ }
+
+ public final class ShortTextComplicationData extends androidx.wear.watchface.complications.data.ComplicationData {
+ method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public android.support.wearable.complications.ComplicationData asWireComplicationData();
+ method public androidx.wear.watchface.complications.data.ComplicationText? getContentDescription();
+ method public androidx.wear.watchface.complications.data.MonochromaticImage? getMonochromaticImage();
+ method public androidx.wear.watchface.complications.data.ComplicationText getText();
+ method public androidx.wear.watchface.complications.data.ComplicationText? getTitle();
+ property public final androidx.wear.watchface.complications.data.ComplicationText? contentDescription;
+ property public final androidx.wear.watchface.complications.data.MonochromaticImage? monochromaticImage;
+ property public final androidx.wear.watchface.complications.data.ComplicationText text;
+ property public final androidx.wear.watchface.complications.data.ComplicationText? title;
+ field public static final int MAX_TEXT_LENGTH;
+ field public static final androidx.wear.watchface.complications.data.ComplicationType TYPE;
+ }
+
+ public static final class ShortTextComplicationData.Builder {
+ ctor public ShortTextComplicationData.Builder(androidx.wear.watchface.complications.data.ComplicationText text, androidx.wear.watchface.complications.data.ComplicationText contentDescription);
+ method public androidx.wear.watchface.complications.data.ShortTextComplicationData build();
+ method public androidx.wear.watchface.complications.data.ShortTextComplicationData.Builder setMonochromaticImage(androidx.wear.watchface.complications.data.MonochromaticImage? monochromaticImage);
+ method public androidx.wear.watchface.complications.data.ShortTextComplicationData.Builder setTapAction(android.app.PendingIntent? tapAction);
+ method public androidx.wear.watchface.complications.data.ShortTextComplicationData.Builder setTitle(androidx.wear.watchface.complications.data.ComplicationText? title);
+ method public androidx.wear.watchface.complications.data.ShortTextComplicationData.Builder setValidTimeRange(androidx.wear.watchface.complications.data.TimeRange? validTimeRange);
+ }
+
+ public final class SmallImage {
+ method public android.graphics.drawable.Icon? getAmbientImage();
+ method public android.graphics.drawable.Icon getImage();
+ method public androidx.wear.watchface.complications.data.SmallImageType getType();
+ property public final android.graphics.drawable.Icon? ambientImage;
+ property public final android.graphics.drawable.Icon image;
+ property public final androidx.wear.watchface.complications.data.SmallImageType type;
+ }
+
+ public static final class SmallImage.Builder {
+ ctor public SmallImage.Builder(android.graphics.drawable.Icon image, androidx.wear.watchface.complications.data.SmallImageType type);
+ method public androidx.wear.watchface.complications.data.SmallImage build();
+ method public androidx.wear.watchface.complications.data.SmallImage.Builder setAmbientImage(android.graphics.drawable.Icon? ambientImage);
+ }
+
+ public final class SmallImageComplicationData extends androidx.wear.watchface.complications.data.ComplicationData {
+ method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public android.support.wearable.complications.ComplicationData asWireComplicationData();
+ method public androidx.wear.watchface.complications.data.ComplicationText? getContentDescription();
+ method public androidx.wear.watchface.complications.data.SmallImage getSmallImage();
+ property public final androidx.wear.watchface.complications.data.ComplicationText? contentDescription;
+ property public final androidx.wear.watchface.complications.data.SmallImage smallImage;
+ field public static final androidx.wear.watchface.complications.data.ComplicationType TYPE;
+ }
+
+ public static final class SmallImageComplicationData.Builder {
+ ctor public SmallImageComplicationData.Builder(androidx.wear.watchface.complications.data.SmallImage smallImage, androidx.wear.watchface.complications.data.ComplicationText contentDescription);
+ method public androidx.wear.watchface.complications.data.SmallImageComplicationData build();
+ method public androidx.wear.watchface.complications.data.SmallImageComplicationData.Builder setTapAction(android.app.PendingIntent? tapAction);
+ method public androidx.wear.watchface.complications.data.SmallImageComplicationData.Builder setValidTimeRange(androidx.wear.watchface.complications.data.TimeRange? validTimeRange);
+ }
+
+ public enum SmallImageType {
+ enum_constant public static final androidx.wear.watchface.complications.data.SmallImageType ICON;
+ enum_constant public static final androidx.wear.watchface.complications.data.SmallImageType PHOTO;
+ }
+
+ public final class TextKt {
+ }
+
+ public final class TimeDifferenceComplicationText implements androidx.wear.watchface.complications.data.ComplicationText {
+ method public java.util.concurrent.TimeUnit? getMinimumTimeUnit();
+ }
+
+ public static final class TimeDifferenceComplicationText.Builder {
+ ctor public TimeDifferenceComplicationText.Builder(androidx.wear.watchface.complications.data.TimeDifferenceStyle style, androidx.wear.watchface.complications.data.CountUpTimeReference countUpTimeReference);
+ ctor public TimeDifferenceComplicationText.Builder(androidx.wear.watchface.complications.data.TimeDifferenceStyle style, androidx.wear.watchface.complications.data.CountDownTimeReference countDownTimeReference);
+ method public androidx.wear.watchface.complications.data.TimeDifferenceComplicationText build();
+ method public androidx.wear.watchface.complications.data.TimeDifferenceComplicationText.Builder setDisplayAsNow(boolean displayAsNow);
+ method public androidx.wear.watchface.complications.data.TimeDifferenceComplicationText.Builder setMinimumTimeUnit(java.util.concurrent.TimeUnit? minimumUnit);
+ method public androidx.wear.watchface.complications.data.TimeDifferenceComplicationText.Builder setText(CharSequence? text);
+ }
+
+ public enum TimeDifferenceStyle {
+ enum_constant public static final androidx.wear.watchface.complications.data.TimeDifferenceStyle SHORT_DUAL_UNIT;
+ enum_constant public static final androidx.wear.watchface.complications.data.TimeDifferenceStyle SHORT_SINGLE_UNIT;
+ enum_constant public static final androidx.wear.watchface.complications.data.TimeDifferenceStyle SHORT_WORDS_SINGLE_UNIT;
+ enum_constant public static final androidx.wear.watchface.complications.data.TimeDifferenceStyle STOPWATCH;
+ enum_constant public static final androidx.wear.watchface.complications.data.TimeDifferenceStyle WORDS_SINGLE_UNIT;
+ }
+
+ public final class TimeFormatComplicationText implements androidx.wear.watchface.complications.data.ComplicationText {
+ }
+
+ public static final class TimeFormatComplicationText.Builder {
+ ctor public TimeFormatComplicationText.Builder(String format);
+ method public androidx.wear.watchface.complications.data.TimeFormatComplicationText build();
+ method public androidx.wear.watchface.complications.data.TimeFormatComplicationText.Builder setStyle(androidx.wear.watchface.complications.data.TimeFormatStyle style);
+ method public androidx.wear.watchface.complications.data.TimeFormatComplicationText.Builder setText(CharSequence text);
+ method public androidx.wear.watchface.complications.data.TimeFormatComplicationText.Builder setTimeZone(android.icu.util.TimeZone timeZone);
+ }
+
+ public enum TimeFormatStyle {
+ enum_constant public static final androidx.wear.watchface.complications.data.TimeFormatStyle DEFAULT;
+ enum_constant public static final androidx.wear.watchface.complications.data.TimeFormatStyle LOWER_CASE;
+ enum_constant public static final androidx.wear.watchface.complications.data.TimeFormatStyle UPPER_CASE;
+ }
+
+ public final class TimeRange {
+ method public static androidx.wear.watchface.complications.data.TimeRange after(java.time.Instant startInstant);
+ method public static androidx.wear.watchface.complications.data.TimeRange before(java.time.Instant endInstant);
+ method public static androidx.wear.watchface.complications.data.TimeRange between(java.time.Instant startInstant, java.time.Instant endInstant);
+ method public operator boolean contains(java.time.Instant dateTimeMillis);
+ method public java.time.Instant getEndDateTimeMillis();
+ method public java.time.Instant getStartDateTimeMillis();
+ property public final java.time.Instant endDateTimeMillis;
+ property public final java.time.Instant startDateTimeMillis;
+ field public static final androidx.wear.watchface.complications.data.TimeRange ALWAYS;
+ field public static final androidx.wear.watchface.complications.data.TimeRange.Companion Companion;
+ }
+
+ public static final class TimeRange.Companion {
+ method public androidx.wear.watchface.complications.data.TimeRange after(java.time.Instant startInstant);
+ method public androidx.wear.watchface.complications.data.TimeRange before(java.time.Instant endInstant);
+ method public androidx.wear.watchface.complications.data.TimeRange between(java.time.Instant startInstant, java.time.Instant endInstant);
+ }
+
+ public final class TypeKt {
+ }
+
+}
+
+package androidx.wear.watchface.utility {
+
+ public final class TraceEventKt {
+ }
+
+}
+
diff --git a/wear/wear-complications-data/build.gradle b/wear/watchface/watchface-complications-data/build.gradle
similarity index 95%
rename from wear/wear-complications-data/build.gradle
rename to wear/watchface/watchface-complications-data/build.gradle
index 6ea0b83..3072372 100644
--- a/wear/wear-complications-data/build.gradle
+++ b/wear/watchface/watchface-complications-data/build.gradle
@@ -67,8 +67,7 @@
androidx {
name = "Android Wear Complications"
publish = Publish.SNAPSHOT_AND_RELEASE
- mavenGroup = LibraryGroups.WEAR
- mavenVersion = LibraryVersions.WEAR_COMPLICATIONS_DATA
+ mavenGroup = LibraryGroups.WEAR_WATCHFACE
inceptionYear = "2020"
description = "Android Wear Complications"
}
diff --git a/wear/wear-complications-data/lint-baseline.xml b/wear/watchface/watchface-complications-data/lint-baseline.xml
similarity index 100%
rename from wear/wear-complications-data/lint-baseline.xml
rename to wear/watchface/watchface-complications-data/lint-baseline.xml
diff --git a/wear/wear-complications-data/proguard-rules.pro b/wear/watchface/watchface-complications-data/proguard-rules.pro
similarity index 100%
rename from wear/wear-complications-data/proguard-rules.pro
rename to wear/watchface/watchface-complications-data/proguard-rules.pro
diff --git a/wear/wear-complications-data/src/androidTest/AndroidManifest.xml b/wear/watchface/watchface-complications-data/src/androidTest/AndroidManifest.xml
similarity index 89%
rename from wear/wear-complications-data/src/androidTest/AndroidManifest.xml
rename to wear/watchface/watchface-complications-data/src/androidTest/AndroidManifest.xml
index 05415ff..29e7ac2 100644
--- a/wear/wear-complications-data/src/androidTest/AndroidManifest.xml
+++ b/wear/watchface/watchface-complications-data/src/androidTest/AndroidManifest.xml
@@ -18,7 +18,7 @@
package="androidx.wear.watchface.editor.test">
<application>
- <service android:name="androidx.wear.complications.TestProviderInfoService">
+ <service android:name="androidx.wear.watchface.complications.TestProviderInfoService">
</service>
</application>
</manifest>
\ No newline at end of file
diff --git a/wear/wear-complications-data/src/androidTest/java/androidx/wear/complications/ComplicationDataSourceInfoRetrieverTest.kt b/wear/watchface/watchface-complications-data/src/androidTest/java/androidx/wear/watchface/complications/ComplicationDataSourceInfoRetrieverTest.kt
similarity index 94%
rename from wear/wear-complications-data/src/androidTest/java/androidx/wear/complications/ComplicationDataSourceInfoRetrieverTest.kt
rename to wear/watchface/watchface-complications-data/src/androidTest/java/androidx/wear/watchface/complications/ComplicationDataSourceInfoRetrieverTest.kt
index 1e60e79..da8530c 100644
--- a/wear/wear-complications-data/src/androidTest/java/androidx/wear/complications/ComplicationDataSourceInfoRetrieverTest.kt
+++ b/wear/watchface/watchface-complications-data/src/androidTest/java/androidx/wear/watchface/complications/ComplicationDataSourceInfoRetrieverTest.kt
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package androidx.wear.complications
+package androidx.wear.watchface.complications
import android.app.Service
import android.content.ComponentName
@@ -30,11 +30,11 @@
import androidx.test.core.app.ApplicationProvider
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.MediumTest
-import androidx.wear.complications.data.ComplicationText
-import androidx.wear.complications.data.ComplicationType
-import androidx.wear.complications.data.LongTextComplicationData
-import androidx.wear.complications.data.PlainComplicationText
-import androidx.wear.complications.data.ShortTextComplicationData
+import androidx.wear.watchface.complications.data.ComplicationText
+import androidx.wear.watchface.complications.data.ComplicationType
+import androidx.wear.watchface.complications.data.LongTextComplicationData
+import androidx.wear.watchface.complications.data.PlainComplicationText
+import androidx.wear.watchface.complications.data.ShortTextComplicationData
import com.google.common.truth.Truth.assertThat
import kotlinx.coroutines.runBlocking
import org.junit.Test
diff --git a/wear/wear-complications-data/src/main/AndroidManifest.xml b/wear/watchface/watchface-complications-data/src/main/AndroidManifest.xml
similarity index 81%
rename from wear/wear-complications-data/src/main/AndroidManifest.xml
rename to wear/watchface/watchface-complications-data/src/main/AndroidManifest.xml
index 1caa30d..bb1ea86 100644
--- a/wear/wear-complications-data/src/main/AndroidManifest.xml
+++ b/wear/watchface/watchface-complications-data/src/main/AndroidManifest.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
-<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="androidx.wear.complications">
+<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="androidx.wear.watchface.complications">
<application>
<uses-library android:name="com.google.android.wearable" android:required="false" />
</application>
diff --git a/wear/wear-complications-data/src/main/aidl/android/support/wearable/complications/ComplicationData.aidl b/wear/watchface/watchface-complications-data/src/main/aidl/android/support/wearable/complications/ComplicationData.aidl
similarity index 100%
rename from wear/wear-complications-data/src/main/aidl/android/support/wearable/complications/ComplicationData.aidl
rename to wear/watchface/watchface-complications-data/src/main/aidl/android/support/wearable/complications/ComplicationData.aidl
diff --git a/wear/wear-complications-data/src/main/aidl/android/support/wearable/complications/ComplicationProviderInfo.aidl b/wear/watchface/watchface-complications-data/src/main/aidl/android/support/wearable/complications/ComplicationProviderInfo.aidl
similarity index 100%
rename from wear/wear-complications-data/src/main/aidl/android/support/wearable/complications/ComplicationProviderInfo.aidl
rename to wear/watchface/watchface-complications-data/src/main/aidl/android/support/wearable/complications/ComplicationProviderInfo.aidl
diff --git a/wear/wear-complications-data/src/main/aidl/android/support/wearable/complications/IComplicationManager.aidl b/wear/watchface/watchface-complications-data/src/main/aidl/android/support/wearable/complications/IComplicationManager.aidl
similarity index 100%
rename from wear/wear-complications-data/src/main/aidl/android/support/wearable/complications/IComplicationManager.aidl
rename to wear/watchface/watchface-complications-data/src/main/aidl/android/support/wearable/complications/IComplicationManager.aidl
diff --git a/wear/wear-complications-data/src/main/aidl/android/support/wearable/complications/IComplicationProvider.aidl b/wear/watchface/watchface-complications-data/src/main/aidl/android/support/wearable/complications/IComplicationProvider.aidl
similarity index 94%
rename from wear/wear-complications-data/src/main/aidl/android/support/wearable/complications/IComplicationProvider.aidl
rename to wear/watchface/watchface-complications-data/src/main/aidl/android/support/wearable/complications/IComplicationProvider.aidl
index 05fa5bf..24eaa9e 100644
--- a/wear/wear-complications-data/src/main/aidl/android/support/wearable/complications/IComplicationProvider.aidl
+++ b/wear/watchface/watchface-complications-data/src/main/aidl/android/support/wearable/complications/IComplicationProvider.aidl
@@ -23,8 +23,8 @@
* <p>In response to this request, {@link IComplicationManager#updateComplicationData} should be
* called on the {@link IComplicationManager} after binding, with the data to be displayed. Or
* if no update is needed, {@link
- * androidx.wear.complications.ComplicationManager#noUpdateRequired noUpdateRequired} may be
- * called instead. One of these methods must be called so that the system knows when the
+ * androidx.wear.watchface.complications.ComplicationManager#noUpdateRequired noUpdateRequired}
+ * may be called instead. One of these methods must be called so that the system knows when the
* provider has finished responding to the request.
*
* @param complicationInstanceId The system's id for the updated complication which is a unique
diff --git a/wear/wear-complications-data/src/main/aidl/android/support/wearable/complications/IPreviewComplicationDataCallback.aidl b/wear/watchface/watchface-complications-data/src/main/aidl/android/support/wearable/complications/IPreviewComplicationDataCallback.aidl
similarity index 100%
rename from wear/wear-complications-data/src/main/aidl/android/support/wearable/complications/IPreviewComplicationDataCallback.aidl
rename to wear/watchface/watchface-complications-data/src/main/aidl/android/support/wearable/complications/IPreviewComplicationDataCallback.aidl
diff --git a/wear/wear-complications-data/src/main/aidl/android/support/wearable/complications/IProviderInfoService.aidl b/wear/watchface/watchface-complications-data/src/main/aidl/android/support/wearable/complications/IProviderInfoService.aidl
similarity index 100%
rename from wear/wear-complications-data/src/main/aidl/android/support/wearable/complications/IProviderInfoService.aidl
rename to wear/watchface/watchface-complications-data/src/main/aidl/android/support/wearable/complications/IProviderInfoService.aidl
diff --git a/wear/wear-complications-data/src/main/java/android/support/wearable/complications/ComplicationData.java b/wear/watchface/watchface-complications-data/src/main/java/android/support/wearable/complications/ComplicationData.java
similarity index 99%
rename from wear/wear-complications-data/src/main/java/android/support/wearable/complications/ComplicationData.java
rename to wear/watchface/watchface-complications-data/src/main/java/android/support/wearable/complications/ComplicationData.java
index 1b3074d..f72debc 100644
--- a/wear/wear-complications-data/src/main/java/android/support/wearable/complications/ComplicationData.java
+++ b/wear/watchface/watchface-complications-data/src/main/java/android/support/wearable/complications/ComplicationData.java
@@ -37,10 +37,11 @@
/**
* Container for complication data of all types.
*
- * <p>A {@link androidx.wear.complications.ComplicationProviderService} should create instances of
+ * <p>A {@link androidx.wear.watchface.complications.ComplicationProviderService} should create
+ * instances of
* this class using {@link ComplicationData.Builder} and send them to the complication system in
* response to
- * {@link androidx.wear.complications.ComplicationProviderService#onComplicationRequest}.
+ * {@link androidx.wear.watchface.complications.ComplicationProviderService#onComplicationRequest}.
* Depending on the type of complication data, some fields will be required and some will be
* optional - see the documentation for each type, and for the builder's set methods, for details.
*
diff --git a/wear/wear-complications-data/src/main/java/android/support/wearable/complications/ComplicationProviderInfo.java b/wear/watchface/watchface-complications-data/src/main/java/android/support/wearable/complications/ComplicationProviderInfo.java
similarity index 97%
rename from wear/wear-complications-data/src/main/java/android/support/wearable/complications/ComplicationProviderInfo.java
rename to wear/watchface/watchface-complications-data/src/main/java/android/support/wearable/complications/ComplicationProviderInfo.java
index fd01f86..75bf5a4 100644
--- a/wear/wear-complications-data/src/main/java/android/support/wearable/complications/ComplicationProviderInfo.java
+++ b/wear/watchface/watchface-complications-data/src/main/java/android/support/wearable/complications/ComplicationProviderInfo.java
@@ -26,11 +26,12 @@
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.RestrictTo;
+import androidx.wear.watchface.complications.ComplicationDataSourceInfoRetriever;
/**
* Holder of details of a complication provider, for use by watch faces (for example, to show the
* current provider in settings). A
- * {@link androidx.wear.complications.ComplicationDataSourceInfoRetriever} can be used to obtain
+ * {@link ComplicationDataSourceInfoRetriever} can be used to obtain
* instances of this class for each of a watch face's complications.
*
* @hide
diff --git a/wear/wear-complications-data/src/main/java/android/support/wearable/complications/ComplicationText.java b/wear/watchface/watchface-complications-data/src/main/java/android/support/wearable/complications/ComplicationText.java
similarity index 99%
rename from wear/wear-complications-data/src/main/java/android/support/wearable/complications/ComplicationText.java
rename to wear/watchface/watchface-complications-data/src/main/java/android/support/wearable/complications/ComplicationText.java
index 741972a..bf8f0a3 100644
--- a/wear/wear-complications-data/src/main/java/android/support/wearable/complications/ComplicationText.java
+++ b/wear/watchface/watchface-complications-data/src/main/java/android/support/wearable/complications/ComplicationText.java
@@ -485,7 +485,10 @@
* @param referencePeriodEndMillis The end of the reference period (in milliseconds since
* the epoch) from which the time difference will be calculated.
*/
- public TimeDifferenceBuilder(long referencePeriodStartMillis, long referencePeriodEndMillis) {
+ public TimeDifferenceBuilder(
+ long referencePeriodStartMillis,
+ long referencePeriodEndMillis
+ ) {
mReferencePeriodStartMillis = referencePeriodStartMillis;
mReferencePeriodEndMillis = referencePeriodEndMillis;
}
diff --git a/wear/wear-complications-data/src/main/java/android/support/wearable/complications/ComplicationTextTemplate.java b/wear/watchface/watchface-complications-data/src/main/java/android/support/wearable/complications/ComplicationTextTemplate.java
similarity index 100%
rename from wear/wear-complications-data/src/main/java/android/support/wearable/complications/ComplicationTextTemplate.java
rename to wear/watchface/watchface-complications-data/src/main/java/android/support/wearable/complications/ComplicationTextTemplate.java
diff --git a/wear/wear-complications-data/src/main/java/android/support/wearable/complications/TimeDependentText.java b/wear/watchface/watchface-complications-data/src/main/java/android/support/wearable/complications/TimeDependentText.java
similarity index 100%
rename from wear/wear-complications-data/src/main/java/android/support/wearable/complications/TimeDependentText.java
rename to wear/watchface/watchface-complications-data/src/main/java/android/support/wearable/complications/TimeDependentText.java
diff --git a/wear/wear-complications-data/src/main/java/android/support/wearable/complications/TimeDifferenceText.java b/wear/watchface/watchface-complications-data/src/main/java/android/support/wearable/complications/TimeDifferenceText.java
similarity index 99%
rename from wear/wear-complications-data/src/main/java/android/support/wearable/complications/TimeDifferenceText.java
rename to wear/watchface/watchface-complications-data/src/main/java/android/support/wearable/complications/TimeDifferenceText.java
index d8825db..d74a57c 100644
--- a/wear/wear-complications-data/src/main/java/android/support/wearable/complications/TimeDifferenceText.java
+++ b/wear/watchface/watchface-complications-data/src/main/java/android/support/wearable/complications/TimeDifferenceText.java
@@ -23,7 +23,7 @@
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.RestrictTo;
-import androidx.wear.complications.R;
+import androidx.wear.watchface.complications.R;
import java.util.Locale;
import java.util.concurrent.TimeUnit;
diff --git a/wear/wear-complications-data/src/main/java/android/support/wearable/complications/TimeFormatText.java b/wear/watchface/watchface-complications-data/src/main/java/android/support/wearable/complications/TimeFormatText.java
similarity index 100%
rename from wear/wear-complications-data/src/main/java/android/support/wearable/complications/TimeFormatText.java
rename to wear/watchface/watchface-complications-data/src/main/java/android/support/wearable/complications/TimeFormatText.java
diff --git a/wear/wear-complications-data/src/main/java/android/support/wearable/complications/package-info.java b/wear/watchface/watchface-complications-data/src/main/java/android/support/wearable/complications/package-info.java
similarity index 100%
rename from wear/wear-complications-data/src/main/java/android/support/wearable/complications/package-info.java
rename to wear/watchface/watchface-complications-data/src/main/java/android/support/wearable/complications/package-info.java
diff --git a/wear/wear-complications-data/src/main/java/androidx/wear/complications/ComplicationDataSourceInfoRetriever.kt b/wear/watchface/watchface-complications-data/src/main/java/androidx/wear/watchface/complications/ComplicationDataSourceInfoRetriever.kt
similarity index 91%
rename from wear/wear-complications-data/src/main/java/androidx/wear/complications/ComplicationDataSourceInfoRetriever.kt
rename to wear/watchface/watchface-complications-data/src/main/java/androidx/wear/watchface/complications/ComplicationDataSourceInfoRetriever.kt
index 260e977..41d42f75 100644
--- a/wear/wear-complications-data/src/main/java/androidx/wear/complications/ComplicationDataSourceInfoRetriever.kt
+++ b/wear/watchface/watchface-complications-data/src/main/java/androidx/wear/watchface/complications/ComplicationDataSourceInfoRetriever.kt
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package androidx.wear.complications
+package androidx.wear.watchface.complications
import android.annotation.SuppressLint
import android.content.ComponentName
@@ -29,23 +29,23 @@
import androidx.annotation.RequiresApi
import androidx.annotation.RestrictTo
import androidx.annotation.VisibleForTesting
-import androidx.wear.complications.ComplicationDataSourceInfoRetriever.Result
-import androidx.wear.complications.data.ComplicationData
-import androidx.wear.complications.data.ComplicationType
-import androidx.wear.complications.data.ComplicationType.Companion.fromWireType
-import androidx.wear.complications.data.LongTextComplicationData
-import androidx.wear.complications.data.MonochromaticImage
-import androidx.wear.complications.data.MonochromaticImageComplicationData
-import androidx.wear.complications.data.NoDataComplicationData
-import androidx.wear.complications.data.PhotoImageComplicationData
-import androidx.wear.complications.data.PlainComplicationText
-import androidx.wear.complications.data.RangedValueComplicationData
-import androidx.wear.complications.data.ShortTextComplicationData
-import androidx.wear.complications.data.SmallImage
-import androidx.wear.complications.data.SmallImageComplicationData
-import androidx.wear.complications.data.SmallImageType
-import androidx.wear.complications.data.toApiComplicationData
-import androidx.wear.utility.TraceEvent
+import androidx.wear.watchface.complications.ComplicationDataSourceInfoRetriever.Result
+import androidx.wear.watchface.complications.data.ComplicationData
+import androidx.wear.watchface.complications.data.ComplicationType
+import androidx.wear.watchface.complications.data.ComplicationType.Companion.fromWireType
+import androidx.wear.watchface.complications.data.LongTextComplicationData
+import androidx.wear.watchface.complications.data.MonochromaticImage
+import androidx.wear.watchface.complications.data.MonochromaticImageComplicationData
+import androidx.wear.watchface.complications.data.NoDataComplicationData
+import androidx.wear.watchface.complications.data.PhotoImageComplicationData
+import androidx.wear.watchface.complications.data.PlainComplicationText
+import androidx.wear.watchface.complications.data.RangedValueComplicationData
+import androidx.wear.watchface.complications.data.ShortTextComplicationData
+import androidx.wear.watchface.complications.data.SmallImage
+import androidx.wear.watchface.complications.data.SmallImageComplicationData
+import androidx.wear.watchface.complications.data.SmallImageType
+import androidx.wear.watchface.complications.data.toApiComplicationData
+import androidx.wear.watchface.utility.TraceEvent
import kotlinx.coroutines.CompletableDeferred
import kotlinx.coroutines.suspendCancellableCoroutine
import java.lang.IllegalArgumentException
@@ -77,7 +77,7 @@
* Details of the complication data source for that complication, or `null` if no
* complication data source is currently configured.
*/
- public val info: androidx.wear.complications.ComplicationDataSourceInfo?
+ public val info: ComplicationDataSourceInfo?
)
private inner class ProviderInfoServiceConnection : ServiceConnection {
@@ -390,7 +390,7 @@
}
// Ugh we need this since the linter wants the method signature all on one line...
-typealias ApiInfo = androidx.wear.complications.ComplicationDataSourceInfo
+typealias ApiInfo = ComplicationDataSourceInfo
/**
* @hide
diff --git a/wear/wear-complications-data/src/main/java/androidx/wear/complications/ComplicationDataSourceUpdateRequesterConstants.java b/wear/watchface/watchface-complications-data/src/main/java/androidx/wear/watchface/complications/ComplicationDataSourceUpdateRequesterConstants.java
similarity index 90%
rename from wear/wear-complications-data/src/main/java/androidx/wear/complications/ComplicationDataSourceUpdateRequesterConstants.java
rename to wear/watchface/watchface-complications-data/src/main/java/androidx/wear/watchface/complications/ComplicationDataSourceUpdateRequesterConstants.java
index f8271f0..b7f58bd 100644
--- a/wear/wear-complications-data/src/main/java/androidx/wear/complications/ComplicationDataSourceUpdateRequesterConstants.java
+++ b/wear/watchface/watchface-complications-data/src/main/java/androidx/wear/watchface/complications/ComplicationDataSourceUpdateRequesterConstants.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2020 The Android Open Source Project
+ * Copyright 2021 The Android Open 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,7 +14,7 @@
* limitations under the License.
*/
-package androidx.wear.complications;
+package androidx.wear.watchface.complications;
import androidx.annotation.RestrictTo;
diff --git a/wear/wear-complications-data/src/main/java/androidx/wear/complications/ComplicationSlotBounds.kt b/wear/watchface/watchface-complications-data/src/main/java/androidx/wear/watchface/complications/ComplicationSlotBounds.kt
similarity index 91%
rename from wear/wear-complications-data/src/main/java/androidx/wear/complications/ComplicationSlotBounds.kt
rename to wear/watchface/watchface-complications-data/src/main/java/androidx/wear/watchface/complications/ComplicationSlotBounds.kt
index ddc6b49..f57dabb 100644
--- a/wear/wear-complications-data/src/main/java/androidx/wear/complications/ComplicationSlotBounds.kt
+++ b/wear/watchface/watchface-complications-data/src/main/java/androidx/wear/watchface/complications/ComplicationSlotBounds.kt
@@ -1,5 +1,5 @@
/*
- * Copyright 2020 The Android Open Source Project
+ * Copyright 2021 The Android Open 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,10 +14,10 @@
* limitations under the License.
*/
-package androidx.wear.complications
+package androidx.wear.watchface.complications
import android.graphics.RectF
-import androidx.wear.complications.data.ComplicationType
+import androidx.wear.watchface.complications.data.ComplicationType
/**
* ComplicationSlotBounds are defined by fractional screen space coordinates in unit-square [0..1].
diff --git a/wear/wear-complications-data/src/main/java/androidx/wear/complications/DefaultComplicationDataSourcePolicy.kt b/wear/watchface/watchface-complications-data/src/main/java/androidx/wear/watchface/complications/DefaultComplicationDataSourcePolicy.kt
similarity index 96%
rename from wear/wear-complications-data/src/main/java/androidx/wear/complications/DefaultComplicationDataSourcePolicy.kt
rename to wear/watchface/watchface-complications-data/src/main/java/androidx/wear/watchface/complications/DefaultComplicationDataSourcePolicy.kt
index 4a2846f..7322082 100644
--- a/wear/wear-complications-data/src/main/java/androidx/wear/complications/DefaultComplicationDataSourcePolicy.kt
+++ b/wear/watchface/watchface-complications-data/src/main/java/androidx/wear/watchface/complications/DefaultComplicationDataSourcePolicy.kt
@@ -1,5 +1,5 @@
/*
- * Copyright 2020 The Android Open Source Project
+ * Copyright 2021 The Android Open 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,11 +14,11 @@
* limitations under the License.
*/
-package androidx.wear.complications
+package androidx.wear.watchface.complications
import android.content.ComponentName
import androidx.annotation.RestrictTo
-import androidx.wear.complications.SystemDataSources.DataSourceId
+import androidx.wear.watchface.complications.SystemDataSources.DataSourceId
import java.util.ArrayList
/**
diff --git a/wear/wear-complications-data/src/main/java/androidx/wear/complications/SystemDataSources.kt b/wear/watchface/watchface-complications-data/src/main/java/androidx/wear/watchface/complications/SystemDataSources.kt
similarity index 97%
rename from wear/wear-complications-data/src/main/java/androidx/wear/complications/SystemDataSources.kt
rename to wear/watchface/watchface-complications-data/src/main/java/androidx/wear/watchface/complications/SystemDataSources.kt
index e90c06f..9a7e6ce 100644
--- a/wear/wear-complications-data/src/main/java/androidx/wear/complications/SystemDataSources.kt
+++ b/wear/watchface/watchface-complications-data/src/main/java/androidx/wear/watchface/complications/SystemDataSources.kt
@@ -1,5 +1,5 @@
/*
- * Copyright 2020 The Android Open Source Project
+ * Copyright 2021 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -13,11 +13,11 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package androidx.wear.complications
+package androidx.wear.watchface.complications
import androidx.annotation.IntDef
import androidx.annotation.RestrictTo
-import androidx.wear.complications.data.ComplicationType
+import androidx.wear.watchface.complications.data.ComplicationType
/**
* Methods to retrieve the component names for system complication complication data sources. This
diff --git a/wear/wear-complications-data/src/main/java/androidx/wear/complications/data/Data.kt b/wear/watchface/watchface-complications-data/src/main/java/androidx/wear/watchface/complications/data/Data.kt
similarity index 98%
rename from wear/wear-complications-data/src/main/java/androidx/wear/complications/data/Data.kt
rename to wear/watchface/watchface-complications-data/src/main/java/androidx/wear/watchface/complications/data/Data.kt
index c49e8f3..a129d27 100644
--- a/wear/wear-complications-data/src/main/java/androidx/wear/complications/data/Data.kt
+++ b/wear/watchface/watchface-complications-data/src/main/java/androidx/wear/watchface/complications/data/Data.kt
@@ -1,5 +1,5 @@
/*
- * Copyright 2020 The Android Open Source Project
+ * Copyright 2021 The Android Open 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,7 +14,7 @@
* limitations under the License.
*/
-package androidx.wear.complications.data
+package androidx.wear.watchface.complications.data
import android.app.PendingIntent
import android.graphics.drawable.Icon
@@ -836,8 +836,8 @@
RangedValueComplicationData.Builder(
value = rangedValue, min = rangedMinValue,
max = rangedMaxValue,
- contentDescription =
- contentDescription?.toApiComplicationText() ?: ComplicationText.EMPTY
+ contentDescription = contentDescription?.toApiComplicationText()
+ ?: ComplicationText.EMPTY
).apply {
setTapAction(tapAction)
setValidTimeRange(parseTimeRange())
diff --git a/wear/wear-complications-data/src/main/java/androidx/wear/complications/data/Image.kt b/wear/watchface/watchface-complications-data/src/main/java/androidx/wear/watchface/complications/data/Image.kt
similarity index 97%
rename from wear/wear-complications-data/src/main/java/androidx/wear/complications/data/Image.kt
rename to wear/watchface/watchface-complications-data/src/main/java/androidx/wear/watchface/complications/data/Image.kt
index 4b5aebf..0cbfd40 100644
--- a/wear/wear-complications-data/src/main/java/androidx/wear/complications/data/Image.kt
+++ b/wear/watchface/watchface-complications-data/src/main/java/androidx/wear/watchface/complications/data/Image.kt
@@ -1,5 +1,5 @@
/*
- * Copyright 2020 The Android Open Source Project
+ * Copyright 2021 The Android Open 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,7 +14,7 @@
* limitations under the License.
*/
-package androidx.wear.complications.data
+package androidx.wear.watchface.complications.data
import android.graphics.drawable.Icon
diff --git a/wear/wear-complications-data/src/main/java/androidx/wear/complications/data/Text.kt b/wear/watchface/watchface-complications-data/src/main/java/androidx/wear/watchface/complications/data/Text.kt
similarity index 99%
rename from wear/wear-complications-data/src/main/java/androidx/wear/complications/data/Text.kt
rename to wear/watchface/watchface-complications-data/src/main/java/androidx/wear/watchface/complications/data/Text.kt
index 38cc7b6..2f99f96 100644
--- a/wear/wear-complications-data/src/main/java/androidx/wear/complications/data/Text.kt
+++ b/wear/watchface/watchface-complications-data/src/main/java/androidx/wear/watchface/complications/data/Text.kt
@@ -1,5 +1,5 @@
/*
- * Copyright 2020 The Android Open Source Project
+ * Copyright 2021 The Android Open 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,7 +14,7 @@
* limitations under the License.
*/
-package androidx.wear.complications.data
+package androidx.wear.watchface.complications.data
import android.content.res.Resources
import android.icu.util.TimeZone
diff --git a/wear/wear-complications-data/src/main/java/androidx/wear/complications/data/Time.kt b/wear/watchface/watchface-complications-data/src/main/java/androidx/wear/watchface/complications/data/Time.kt
similarity index 95%
rename from wear/wear-complications-data/src/main/java/androidx/wear/complications/data/Time.kt
rename to wear/watchface/watchface-complications-data/src/main/java/androidx/wear/watchface/complications/data/Time.kt
index e1962a1..0def091 100644
--- a/wear/wear-complications-data/src/main/java/androidx/wear/complications/data/Time.kt
+++ b/wear/watchface/watchface-complications-data/src/main/java/androidx/wear/watchface/complications/data/Time.kt
@@ -1,5 +1,5 @@
/*
- * Copyright 2020 The Android Open Source Project
+ * Copyright 2021 The Android Open 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,7 +14,7 @@
* limitations under the License.
*/
-package androidx.wear.complications.data
+package androidx.wear.watchface.complications.data
import java.time.Instant
diff --git a/wear/wear-complications-data/src/main/java/androidx/wear/complications/data/Type.kt b/wear/watchface/watchface-complications-data/src/main/java/androidx/wear/watchface/complications/data/Type.kt
similarity index 97%
rename from wear/wear-complications-data/src/main/java/androidx/wear/complications/data/Type.kt
rename to wear/watchface/watchface-complications-data/src/main/java/androidx/wear/watchface/complications/data/Type.kt
index 97d4dfc..dd8be6b 100644
--- a/wear/wear-complications-data/src/main/java/androidx/wear/complications/data/Type.kt
+++ b/wear/watchface/watchface-complications-data/src/main/java/androidx/wear/watchface/complications/data/Type.kt
@@ -1,5 +1,5 @@
/*
- * Copyright 2020 The Android Open Source Project
+ * Copyright 2021 The Android Open 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,7 +14,7 @@
* limitations under the License.
*/
-package androidx.wear.complications.data
+package androidx.wear.watchface.complications.data
import androidx.annotation.RestrictTo
diff --git a/wear/wear-complications-data/src/main/java/androidx/wear/utility/TraceEvent.kt b/wear/watchface/watchface-complications-data/src/main/java/androidx/wear/watchface/utility/TraceEvent.kt
similarity index 98%
rename from wear/wear-complications-data/src/main/java/androidx/wear/utility/TraceEvent.kt
rename to wear/watchface/watchface-complications-data/src/main/java/androidx/wear/watchface/utility/TraceEvent.kt
index 7eb143e..8730f90 100644
--- a/wear/wear-complications-data/src/main/java/androidx/wear/utility/TraceEvent.kt
+++ b/wear/watchface/watchface-complications-data/src/main/java/androidx/wear/watchface/utility/TraceEvent.kt
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package androidx.wear.utility
+package androidx.wear.watchface.utility
import android.os.Build
import android.os.Trace
diff --git a/wear/wear-complications-data/src/main/res/values-af/complication_strings.xml b/wear/watchface/watchface-complications-data/src/main/res/values-af/complication_strings.xml
similarity index 100%
rename from wear/wear-complications-data/src/main/res/values-af/complication_strings.xml
rename to wear/watchface/watchface-complications-data/src/main/res/values-af/complication_strings.xml
diff --git a/wear/wear-complications-data/src/main/res/values-am/complication_strings.xml b/wear/watchface/watchface-complications-data/src/main/res/values-am/complication_strings.xml
similarity index 100%
rename from wear/wear-complications-data/src/main/res/values-am/complication_strings.xml
rename to wear/watchface/watchface-complications-data/src/main/res/values-am/complication_strings.xml
diff --git a/wear/wear-complications-data/src/main/res/values-ar/complication_strings.xml b/wear/watchface/watchface-complications-data/src/main/res/values-ar/complication_strings.xml
similarity index 100%
rename from wear/wear-complications-data/src/main/res/values-ar/complication_strings.xml
rename to wear/watchface/watchface-complications-data/src/main/res/values-ar/complication_strings.xml
diff --git a/wear/wear-complications-data/src/main/res/values-as/complication_strings.xml b/wear/watchface/watchface-complications-data/src/main/res/values-as/complication_strings.xml
similarity index 100%
rename from wear/wear-complications-data/src/main/res/values-as/complication_strings.xml
rename to wear/watchface/watchface-complications-data/src/main/res/values-as/complication_strings.xml
diff --git a/wear/wear-complications-data/src/main/res/values-az/complication_strings.xml b/wear/watchface/watchface-complications-data/src/main/res/values-az/complication_strings.xml
similarity index 100%
rename from wear/wear-complications-data/src/main/res/values-az/complication_strings.xml
rename to wear/watchface/watchface-complications-data/src/main/res/values-az/complication_strings.xml
diff --git a/wear/wear-complications-data/src/main/res/values-b+sr+Latn/complication_strings.xml b/wear/watchface/watchface-complications-data/src/main/res/values-b+sr+Latn/complication_strings.xml
similarity index 100%
rename from wear/wear-complications-data/src/main/res/values-b+sr+Latn/complication_strings.xml
rename to wear/watchface/watchface-complications-data/src/main/res/values-b+sr+Latn/complication_strings.xml
diff --git a/wear/wear-complications-data/src/main/res/values-be/complication_strings.xml b/wear/watchface/watchface-complications-data/src/main/res/values-be/complication_strings.xml
similarity index 100%
rename from wear/wear-complications-data/src/main/res/values-be/complication_strings.xml
rename to wear/watchface/watchface-complications-data/src/main/res/values-be/complication_strings.xml
diff --git a/wear/wear-complications-data/src/main/res/values-bg/complication_strings.xml b/wear/watchface/watchface-complications-data/src/main/res/values-bg/complication_strings.xml
similarity index 100%
rename from wear/wear-complications-data/src/main/res/values-bg/complication_strings.xml
rename to wear/watchface/watchface-complications-data/src/main/res/values-bg/complication_strings.xml
diff --git a/wear/wear-complications-data/src/main/res/values-bn/complication_strings.xml b/wear/watchface/watchface-complications-data/src/main/res/values-bn/complication_strings.xml
similarity index 100%
rename from wear/wear-complications-data/src/main/res/values-bn/complication_strings.xml
rename to wear/watchface/watchface-complications-data/src/main/res/values-bn/complication_strings.xml
diff --git a/wear/wear-complications-data/src/main/res/values-bs/complication_strings.xml b/wear/watchface/watchface-complications-data/src/main/res/values-bs/complication_strings.xml
similarity index 100%
rename from wear/wear-complications-data/src/main/res/values-bs/complication_strings.xml
rename to wear/watchface/watchface-complications-data/src/main/res/values-bs/complication_strings.xml
diff --git a/wear/wear-complications-data/src/main/res/values-ca/complication_strings.xml b/wear/watchface/watchface-complications-data/src/main/res/values-ca/complication_strings.xml
similarity index 100%
rename from wear/wear-complications-data/src/main/res/values-ca/complication_strings.xml
rename to wear/watchface/watchface-complications-data/src/main/res/values-ca/complication_strings.xml
diff --git a/wear/wear-complications-data/src/main/res/values-cs/complication_strings.xml b/wear/watchface/watchface-complications-data/src/main/res/values-cs/complication_strings.xml
similarity index 100%
rename from wear/wear-complications-data/src/main/res/values-cs/complication_strings.xml
rename to wear/watchface/watchface-complications-data/src/main/res/values-cs/complication_strings.xml
diff --git a/wear/wear-complications-data/src/main/res/values-da/complication_strings.xml b/wear/watchface/watchface-complications-data/src/main/res/values-da/complication_strings.xml
similarity index 100%
rename from wear/wear-complications-data/src/main/res/values-da/complication_strings.xml
rename to wear/watchface/watchface-complications-data/src/main/res/values-da/complication_strings.xml
diff --git a/wear/wear-complications-data/src/main/res/values-de/complication_strings.xml b/wear/watchface/watchface-complications-data/src/main/res/values-de/complication_strings.xml
similarity index 100%
rename from wear/wear-complications-data/src/main/res/values-de/complication_strings.xml
rename to wear/watchface/watchface-complications-data/src/main/res/values-de/complication_strings.xml
diff --git a/wear/wear-complications-data/src/main/res/values-el/complication_strings.xml b/wear/watchface/watchface-complications-data/src/main/res/values-el/complication_strings.xml
similarity index 100%
rename from wear/wear-complications-data/src/main/res/values-el/complication_strings.xml
rename to wear/watchface/watchface-complications-data/src/main/res/values-el/complication_strings.xml
diff --git a/wear/wear-complications-data/src/main/res/values-en-rAU/complication_strings.xml b/wear/watchface/watchface-complications-data/src/main/res/values-en-rAU/complication_strings.xml
similarity index 100%
rename from wear/wear-complications-data/src/main/res/values-en-rAU/complication_strings.xml
rename to wear/watchface/watchface-complications-data/src/main/res/values-en-rAU/complication_strings.xml
diff --git a/wear/wear-complications-data/src/main/res/values-en-rCA/complication_strings.xml b/wear/watchface/watchface-complications-data/src/main/res/values-en-rCA/complication_strings.xml
similarity index 100%
rename from wear/wear-complications-data/src/main/res/values-en-rCA/complication_strings.xml
rename to wear/watchface/watchface-complications-data/src/main/res/values-en-rCA/complication_strings.xml
diff --git a/wear/wear-complications-data/src/main/res/values-en-rGB/complication_strings.xml b/wear/watchface/watchface-complications-data/src/main/res/values-en-rGB/complication_strings.xml
similarity index 100%
rename from wear/wear-complications-data/src/main/res/values-en-rGB/complication_strings.xml
rename to wear/watchface/watchface-complications-data/src/main/res/values-en-rGB/complication_strings.xml
diff --git a/wear/wear-complications-data/src/main/res/values-en-rIN/complication_strings.xml b/wear/watchface/watchface-complications-data/src/main/res/values-en-rIN/complication_strings.xml
similarity index 100%
rename from wear/wear-complications-data/src/main/res/values-en-rIN/complication_strings.xml
rename to wear/watchface/watchface-complications-data/src/main/res/values-en-rIN/complication_strings.xml
diff --git a/wear/wear-complications-data/src/main/res/values-en-rXC/complication_strings.xml b/wear/watchface/watchface-complications-data/src/main/res/values-en-rXC/complication_strings.xml
similarity index 100%
rename from wear/wear-complications-data/src/main/res/values-en-rXC/complication_strings.xml
rename to wear/watchface/watchface-complications-data/src/main/res/values-en-rXC/complication_strings.xml
diff --git a/wear/wear-complications-data/src/main/res/values-es-rUS/complication_strings.xml b/wear/watchface/watchface-complications-data/src/main/res/values-es-rUS/complication_strings.xml
similarity index 100%
rename from wear/wear-complications-data/src/main/res/values-es-rUS/complication_strings.xml
rename to wear/watchface/watchface-complications-data/src/main/res/values-es-rUS/complication_strings.xml
diff --git a/wear/wear-complications-data/src/main/res/values-es/complication_strings.xml b/wear/watchface/watchface-complications-data/src/main/res/values-es/complication_strings.xml
similarity index 100%
rename from wear/wear-complications-data/src/main/res/values-es/complication_strings.xml
rename to wear/watchface/watchface-complications-data/src/main/res/values-es/complication_strings.xml
diff --git a/wear/wear-complications-data/src/main/res/values-et/complication_strings.xml b/wear/watchface/watchface-complications-data/src/main/res/values-et/complication_strings.xml
similarity index 100%
rename from wear/wear-complications-data/src/main/res/values-et/complication_strings.xml
rename to wear/watchface/watchface-complications-data/src/main/res/values-et/complication_strings.xml
diff --git a/wear/wear-complications-data/src/main/res/values-eu/complication_strings.xml b/wear/watchface/watchface-complications-data/src/main/res/values-eu/complication_strings.xml
similarity index 100%
rename from wear/wear-complications-data/src/main/res/values-eu/complication_strings.xml
rename to wear/watchface/watchface-complications-data/src/main/res/values-eu/complication_strings.xml
diff --git a/wear/wear-complications-data/src/main/res/values-fa/complication_strings.xml b/wear/watchface/watchface-complications-data/src/main/res/values-fa/complication_strings.xml
similarity index 100%
rename from wear/wear-complications-data/src/main/res/values-fa/complication_strings.xml
rename to wear/watchface/watchface-complications-data/src/main/res/values-fa/complication_strings.xml
diff --git a/wear/wear-complications-data/src/main/res/values-fi/complication_strings.xml b/wear/watchface/watchface-complications-data/src/main/res/values-fi/complication_strings.xml
similarity index 100%
rename from wear/wear-complications-data/src/main/res/values-fi/complication_strings.xml
rename to wear/watchface/watchface-complications-data/src/main/res/values-fi/complication_strings.xml
diff --git a/wear/wear-complications-data/src/main/res/values-fr-rCA/complication_strings.xml b/wear/watchface/watchface-complications-data/src/main/res/values-fr-rCA/complication_strings.xml
similarity index 100%
rename from wear/wear-complications-data/src/main/res/values-fr-rCA/complication_strings.xml
rename to wear/watchface/watchface-complications-data/src/main/res/values-fr-rCA/complication_strings.xml
diff --git a/wear/wear-complications-data/src/main/res/values-fr/complication_strings.xml b/wear/watchface/watchface-complications-data/src/main/res/values-fr/complication_strings.xml
similarity index 100%
rename from wear/wear-complications-data/src/main/res/values-fr/complication_strings.xml
rename to wear/watchface/watchface-complications-data/src/main/res/values-fr/complication_strings.xml
diff --git a/wear/wear-complications-data/src/main/res/values-gl/complication_strings.xml b/wear/watchface/watchface-complications-data/src/main/res/values-gl/complication_strings.xml
similarity index 100%
rename from wear/wear-complications-data/src/main/res/values-gl/complication_strings.xml
rename to wear/watchface/watchface-complications-data/src/main/res/values-gl/complication_strings.xml
diff --git a/wear/wear-complications-data/src/main/res/values-gu/complication_strings.xml b/wear/watchface/watchface-complications-data/src/main/res/values-gu/complication_strings.xml
similarity index 100%
rename from wear/wear-complications-data/src/main/res/values-gu/complication_strings.xml
rename to wear/watchface/watchface-complications-data/src/main/res/values-gu/complication_strings.xml
diff --git a/wear/wear-complications-data/src/main/res/values-hi/complication_strings.xml b/wear/watchface/watchface-complications-data/src/main/res/values-hi/complication_strings.xml
similarity index 100%
rename from wear/wear-complications-data/src/main/res/values-hi/complication_strings.xml
rename to wear/watchface/watchface-complications-data/src/main/res/values-hi/complication_strings.xml
diff --git a/wear/wear-complications-data/src/main/res/values-hr/complication_strings.xml b/wear/watchface/watchface-complications-data/src/main/res/values-hr/complication_strings.xml
similarity index 100%
rename from wear/wear-complications-data/src/main/res/values-hr/complication_strings.xml
rename to wear/watchface/watchface-complications-data/src/main/res/values-hr/complication_strings.xml
diff --git a/wear/wear-complications-data/src/main/res/values-hu/complication_strings.xml b/wear/watchface/watchface-complications-data/src/main/res/values-hu/complication_strings.xml
similarity index 100%
rename from wear/wear-complications-data/src/main/res/values-hu/complication_strings.xml
rename to wear/watchface/watchface-complications-data/src/main/res/values-hu/complication_strings.xml
diff --git a/wear/wear-complications-data/src/main/res/values-hy/complication_strings.xml b/wear/watchface/watchface-complications-data/src/main/res/values-hy/complication_strings.xml
similarity index 100%
rename from wear/wear-complications-data/src/main/res/values-hy/complication_strings.xml
rename to wear/watchface/watchface-complications-data/src/main/res/values-hy/complication_strings.xml
diff --git a/wear/wear-complications-data/src/main/res/values-in/complication_strings.xml b/wear/watchface/watchface-complications-data/src/main/res/values-in/complication_strings.xml
similarity index 100%
rename from wear/wear-complications-data/src/main/res/values-in/complication_strings.xml
rename to wear/watchface/watchface-complications-data/src/main/res/values-in/complication_strings.xml
diff --git a/wear/wear-complications-data/src/main/res/values-is/complication_strings.xml b/wear/watchface/watchface-complications-data/src/main/res/values-is/complication_strings.xml
similarity index 100%
rename from wear/wear-complications-data/src/main/res/values-is/complication_strings.xml
rename to wear/watchface/watchface-complications-data/src/main/res/values-is/complication_strings.xml
diff --git a/wear/wear-complications-data/src/main/res/values-it/complication_strings.xml b/wear/watchface/watchface-complications-data/src/main/res/values-it/complication_strings.xml
similarity index 100%
rename from wear/wear-complications-data/src/main/res/values-it/complication_strings.xml
rename to wear/watchface/watchface-complications-data/src/main/res/values-it/complication_strings.xml
diff --git a/wear/wear-complications-data/src/main/res/values-iw/complication_strings.xml b/wear/watchface/watchface-complications-data/src/main/res/values-iw/complication_strings.xml
similarity index 100%
rename from wear/wear-complications-data/src/main/res/values-iw/complication_strings.xml
rename to wear/watchface/watchface-complications-data/src/main/res/values-iw/complication_strings.xml
diff --git a/wear/wear-complications-data/src/main/res/values-ja/complication_strings.xml b/wear/watchface/watchface-complications-data/src/main/res/values-ja/complication_strings.xml
similarity index 100%
rename from wear/wear-complications-data/src/main/res/values-ja/complication_strings.xml
rename to wear/watchface/watchface-complications-data/src/main/res/values-ja/complication_strings.xml
diff --git a/wear/wear-complications-data/src/main/res/values-ka/complication_strings.xml b/wear/watchface/watchface-complications-data/src/main/res/values-ka/complication_strings.xml
similarity index 100%
rename from wear/wear-complications-data/src/main/res/values-ka/complication_strings.xml
rename to wear/watchface/watchface-complications-data/src/main/res/values-ka/complication_strings.xml
diff --git a/wear/wear-complications-data/src/main/res/values-kk/complication_strings.xml b/wear/watchface/watchface-complications-data/src/main/res/values-kk/complication_strings.xml
similarity index 100%
rename from wear/wear-complications-data/src/main/res/values-kk/complication_strings.xml
rename to wear/watchface/watchface-complications-data/src/main/res/values-kk/complication_strings.xml
diff --git a/wear/wear-complications-data/src/main/res/values-km/complication_strings.xml b/wear/watchface/watchface-complications-data/src/main/res/values-km/complication_strings.xml
similarity index 100%
rename from wear/wear-complications-data/src/main/res/values-km/complication_strings.xml
rename to wear/watchface/watchface-complications-data/src/main/res/values-km/complication_strings.xml
diff --git a/wear/wear-complications-data/src/main/res/values-kn/complication_strings.xml b/wear/watchface/watchface-complications-data/src/main/res/values-kn/complication_strings.xml
similarity index 100%
rename from wear/wear-complications-data/src/main/res/values-kn/complication_strings.xml
rename to wear/watchface/watchface-complications-data/src/main/res/values-kn/complication_strings.xml
diff --git a/wear/wear-complications-data/src/main/res/values-ko/complication_strings.xml b/wear/watchface/watchface-complications-data/src/main/res/values-ko/complication_strings.xml
similarity index 100%
rename from wear/wear-complications-data/src/main/res/values-ko/complication_strings.xml
rename to wear/watchface/watchface-complications-data/src/main/res/values-ko/complication_strings.xml
diff --git a/wear/wear-complications-data/src/main/res/values-ky/complication_strings.xml b/wear/watchface/watchface-complications-data/src/main/res/values-ky/complication_strings.xml
similarity index 100%
rename from wear/wear-complications-data/src/main/res/values-ky/complication_strings.xml
rename to wear/watchface/watchface-complications-data/src/main/res/values-ky/complication_strings.xml
diff --git a/wear/wear-complications-data/src/main/res/values-lo/complication_strings.xml b/wear/watchface/watchface-complications-data/src/main/res/values-lo/complication_strings.xml
similarity index 100%
rename from wear/wear-complications-data/src/main/res/values-lo/complication_strings.xml
rename to wear/watchface/watchface-complications-data/src/main/res/values-lo/complication_strings.xml
diff --git a/wear/wear-complications-data/src/main/res/values-lt/complication_strings.xml b/wear/watchface/watchface-complications-data/src/main/res/values-lt/complication_strings.xml
similarity index 100%
rename from wear/wear-complications-data/src/main/res/values-lt/complication_strings.xml
rename to wear/watchface/watchface-complications-data/src/main/res/values-lt/complication_strings.xml
diff --git a/wear/wear-complications-data/src/main/res/values-lv/complication_strings.xml b/wear/watchface/watchface-complications-data/src/main/res/values-lv/complication_strings.xml
similarity index 100%
rename from wear/wear-complications-data/src/main/res/values-lv/complication_strings.xml
rename to wear/watchface/watchface-complications-data/src/main/res/values-lv/complication_strings.xml
diff --git a/wear/wear-complications-data/src/main/res/values-mk/complication_strings.xml b/wear/watchface/watchface-complications-data/src/main/res/values-mk/complication_strings.xml
similarity index 100%
rename from wear/wear-complications-data/src/main/res/values-mk/complication_strings.xml
rename to wear/watchface/watchface-complications-data/src/main/res/values-mk/complication_strings.xml
diff --git a/wear/wear-complications-data/src/main/res/values-ml/complication_strings.xml b/wear/watchface/watchface-complications-data/src/main/res/values-ml/complication_strings.xml
similarity index 100%
rename from wear/wear-complications-data/src/main/res/values-ml/complication_strings.xml
rename to wear/watchface/watchface-complications-data/src/main/res/values-ml/complication_strings.xml
diff --git a/wear/wear-complications-data/src/main/res/values-mn/complication_strings.xml b/wear/watchface/watchface-complications-data/src/main/res/values-mn/complication_strings.xml
similarity index 100%
rename from wear/wear-complications-data/src/main/res/values-mn/complication_strings.xml
rename to wear/watchface/watchface-complications-data/src/main/res/values-mn/complication_strings.xml
diff --git a/wear/wear-complications-data/src/main/res/values-mr/complication_strings.xml b/wear/watchface/watchface-complications-data/src/main/res/values-mr/complication_strings.xml
similarity index 100%
rename from wear/wear-complications-data/src/main/res/values-mr/complication_strings.xml
rename to wear/watchface/watchface-complications-data/src/main/res/values-mr/complication_strings.xml
diff --git a/wear/wear-complications-data/src/main/res/values-ms/complication_strings.xml b/wear/watchface/watchface-complications-data/src/main/res/values-ms/complication_strings.xml
similarity index 100%
rename from wear/wear-complications-data/src/main/res/values-ms/complication_strings.xml
rename to wear/watchface/watchface-complications-data/src/main/res/values-ms/complication_strings.xml
diff --git a/wear/wear-complications-data/src/main/res/values-my/complication_strings.xml b/wear/watchface/watchface-complications-data/src/main/res/values-my/complication_strings.xml
similarity index 100%
rename from wear/wear-complications-data/src/main/res/values-my/complication_strings.xml
rename to wear/watchface/watchface-complications-data/src/main/res/values-my/complication_strings.xml
diff --git a/wear/wear-complications-data/src/main/res/values-nb/complication_strings.xml b/wear/watchface/watchface-complications-data/src/main/res/values-nb/complication_strings.xml
similarity index 100%
rename from wear/wear-complications-data/src/main/res/values-nb/complication_strings.xml
rename to wear/watchface/watchface-complications-data/src/main/res/values-nb/complication_strings.xml
diff --git a/wear/wear-complications-data/src/main/res/values-ne/complication_strings.xml b/wear/watchface/watchface-complications-data/src/main/res/values-ne/complication_strings.xml
similarity index 100%
rename from wear/wear-complications-data/src/main/res/values-ne/complication_strings.xml
rename to wear/watchface/watchface-complications-data/src/main/res/values-ne/complication_strings.xml
diff --git a/wear/wear-complications-data/src/main/res/values-nl/complication_strings.xml b/wear/watchface/watchface-complications-data/src/main/res/values-nl/complication_strings.xml
similarity index 100%
rename from wear/wear-complications-data/src/main/res/values-nl/complication_strings.xml
rename to wear/watchface/watchface-complications-data/src/main/res/values-nl/complication_strings.xml
diff --git a/wear/wear-complications-data/src/main/res/values-or/complication_strings.xml b/wear/watchface/watchface-complications-data/src/main/res/values-or/complication_strings.xml
similarity index 100%
rename from wear/wear-complications-data/src/main/res/values-or/complication_strings.xml
rename to wear/watchface/watchface-complications-data/src/main/res/values-or/complication_strings.xml
diff --git a/wear/wear-complications-data/src/main/res/values-pa/complication_strings.xml b/wear/watchface/watchface-complications-data/src/main/res/values-pa/complication_strings.xml
similarity index 100%
rename from wear/wear-complications-data/src/main/res/values-pa/complication_strings.xml
rename to wear/watchface/watchface-complications-data/src/main/res/values-pa/complication_strings.xml
diff --git a/wear/wear-complications-data/src/main/res/values-pl/complication_strings.xml b/wear/watchface/watchface-complications-data/src/main/res/values-pl/complication_strings.xml
similarity index 100%
rename from wear/wear-complications-data/src/main/res/values-pl/complication_strings.xml
rename to wear/watchface/watchface-complications-data/src/main/res/values-pl/complication_strings.xml
diff --git a/wear/wear-complications-data/src/main/res/values-pt-rBR/complication_strings.xml b/wear/watchface/watchface-complications-data/src/main/res/values-pt-rBR/complication_strings.xml
similarity index 100%
rename from wear/wear-complications-data/src/main/res/values-pt-rBR/complication_strings.xml
rename to wear/watchface/watchface-complications-data/src/main/res/values-pt-rBR/complication_strings.xml
diff --git a/wear/wear-complications-data/src/main/res/values-pt-rPT/complication_strings.xml b/wear/watchface/watchface-complications-data/src/main/res/values-pt-rPT/complication_strings.xml
similarity index 100%
rename from wear/wear-complications-data/src/main/res/values-pt-rPT/complication_strings.xml
rename to wear/watchface/watchface-complications-data/src/main/res/values-pt-rPT/complication_strings.xml
diff --git a/wear/wear-complications-data/src/main/res/values-pt/complication_strings.xml b/wear/watchface/watchface-complications-data/src/main/res/values-pt/complication_strings.xml
similarity index 100%
rename from wear/wear-complications-data/src/main/res/values-pt/complication_strings.xml
rename to wear/watchface/watchface-complications-data/src/main/res/values-pt/complication_strings.xml
diff --git a/wear/wear-complications-data/src/main/res/values-ro/complication_strings.xml b/wear/watchface/watchface-complications-data/src/main/res/values-ro/complication_strings.xml
similarity index 100%
rename from wear/wear-complications-data/src/main/res/values-ro/complication_strings.xml
rename to wear/watchface/watchface-complications-data/src/main/res/values-ro/complication_strings.xml
diff --git a/wear/wear-complications-data/src/main/res/values-ru/complication_strings.xml b/wear/watchface/watchface-complications-data/src/main/res/values-ru/complication_strings.xml
similarity index 100%
rename from wear/wear-complications-data/src/main/res/values-ru/complication_strings.xml
rename to wear/watchface/watchface-complications-data/src/main/res/values-ru/complication_strings.xml
diff --git a/wear/wear-complications-data/src/main/res/values-si/complication_strings.xml b/wear/watchface/watchface-complications-data/src/main/res/values-si/complication_strings.xml
similarity index 100%
rename from wear/wear-complications-data/src/main/res/values-si/complication_strings.xml
rename to wear/watchface/watchface-complications-data/src/main/res/values-si/complication_strings.xml
diff --git a/wear/wear-complications-data/src/main/res/values-sk/complication_strings.xml b/wear/watchface/watchface-complications-data/src/main/res/values-sk/complication_strings.xml
similarity index 100%
rename from wear/wear-complications-data/src/main/res/values-sk/complication_strings.xml
rename to wear/watchface/watchface-complications-data/src/main/res/values-sk/complication_strings.xml
diff --git a/wear/wear-complications-data/src/main/res/values-sl/complication_strings.xml b/wear/watchface/watchface-complications-data/src/main/res/values-sl/complication_strings.xml
similarity index 100%
rename from wear/wear-complications-data/src/main/res/values-sl/complication_strings.xml
rename to wear/watchface/watchface-complications-data/src/main/res/values-sl/complication_strings.xml
diff --git a/wear/wear-complications-data/src/main/res/values-sq/complication_strings.xml b/wear/watchface/watchface-complications-data/src/main/res/values-sq/complication_strings.xml
similarity index 100%
rename from wear/wear-complications-data/src/main/res/values-sq/complication_strings.xml
rename to wear/watchface/watchface-complications-data/src/main/res/values-sq/complication_strings.xml
diff --git a/wear/wear-complications-data/src/main/res/values-sr/complication_strings.xml b/wear/watchface/watchface-complications-data/src/main/res/values-sr/complication_strings.xml
similarity index 100%
rename from wear/wear-complications-data/src/main/res/values-sr/complication_strings.xml
rename to wear/watchface/watchface-complications-data/src/main/res/values-sr/complication_strings.xml
diff --git a/wear/wear-complications-data/src/main/res/values-sv/complication_strings.xml b/wear/watchface/watchface-complications-data/src/main/res/values-sv/complication_strings.xml
similarity index 100%
rename from wear/wear-complications-data/src/main/res/values-sv/complication_strings.xml
rename to wear/watchface/watchface-complications-data/src/main/res/values-sv/complication_strings.xml
diff --git a/wear/wear-complications-data/src/main/res/values-sw/complication_strings.xml b/wear/watchface/watchface-complications-data/src/main/res/values-sw/complication_strings.xml
similarity index 100%
rename from wear/wear-complications-data/src/main/res/values-sw/complication_strings.xml
rename to wear/watchface/watchface-complications-data/src/main/res/values-sw/complication_strings.xml
diff --git a/wear/wear-complications-data/src/main/res/values-ta/complication_strings.xml b/wear/watchface/watchface-complications-data/src/main/res/values-ta/complication_strings.xml
similarity index 100%
rename from wear/wear-complications-data/src/main/res/values-ta/complication_strings.xml
rename to wear/watchface/watchface-complications-data/src/main/res/values-ta/complication_strings.xml
diff --git a/wear/wear-complications-data/src/main/res/values-te/complication_strings.xml b/wear/watchface/watchface-complications-data/src/main/res/values-te/complication_strings.xml
similarity index 100%
rename from wear/wear-complications-data/src/main/res/values-te/complication_strings.xml
rename to wear/watchface/watchface-complications-data/src/main/res/values-te/complication_strings.xml
diff --git a/wear/wear-complications-data/src/main/res/values-th/complication_strings.xml b/wear/watchface/watchface-complications-data/src/main/res/values-th/complication_strings.xml
similarity index 100%
rename from wear/wear-complications-data/src/main/res/values-th/complication_strings.xml
rename to wear/watchface/watchface-complications-data/src/main/res/values-th/complication_strings.xml
diff --git a/wear/wear-complications-data/src/main/res/values-tl/complication_strings.xml b/wear/watchface/watchface-complications-data/src/main/res/values-tl/complication_strings.xml
similarity index 100%
rename from wear/wear-complications-data/src/main/res/values-tl/complication_strings.xml
rename to wear/watchface/watchface-complications-data/src/main/res/values-tl/complication_strings.xml
diff --git a/wear/wear-complications-data/src/main/res/values-tr/complication_strings.xml b/wear/watchface/watchface-complications-data/src/main/res/values-tr/complication_strings.xml
similarity index 100%
rename from wear/wear-complications-data/src/main/res/values-tr/complication_strings.xml
rename to wear/watchface/watchface-complications-data/src/main/res/values-tr/complication_strings.xml
diff --git a/wear/wear-complications-data/src/main/res/values-uk/complication_strings.xml b/wear/watchface/watchface-complications-data/src/main/res/values-uk/complication_strings.xml
similarity index 100%
rename from wear/wear-complications-data/src/main/res/values-uk/complication_strings.xml
rename to wear/watchface/watchface-complications-data/src/main/res/values-uk/complication_strings.xml
diff --git a/wear/wear-complications-data/src/main/res/values-ur/complication_strings.xml b/wear/watchface/watchface-complications-data/src/main/res/values-ur/complication_strings.xml
similarity index 100%
rename from wear/wear-complications-data/src/main/res/values-ur/complication_strings.xml
rename to wear/watchface/watchface-complications-data/src/main/res/values-ur/complication_strings.xml
diff --git a/wear/wear-complications-data/src/main/res/values-uz/complication_strings.xml b/wear/watchface/watchface-complications-data/src/main/res/values-uz/complication_strings.xml
similarity index 100%
rename from wear/wear-complications-data/src/main/res/values-uz/complication_strings.xml
rename to wear/watchface/watchface-complications-data/src/main/res/values-uz/complication_strings.xml
diff --git a/wear/wear-complications-data/src/main/res/values-vi/complication_strings.xml b/wear/watchface/watchface-complications-data/src/main/res/values-vi/complication_strings.xml
similarity index 100%
rename from wear/wear-complications-data/src/main/res/values-vi/complication_strings.xml
rename to wear/watchface/watchface-complications-data/src/main/res/values-vi/complication_strings.xml
diff --git a/wear/wear-complications-data/src/main/res/values-zh-rCN/complication_strings.xml b/wear/watchface/watchface-complications-data/src/main/res/values-zh-rCN/complication_strings.xml
similarity index 100%
rename from wear/wear-complications-data/src/main/res/values-zh-rCN/complication_strings.xml
rename to wear/watchface/watchface-complications-data/src/main/res/values-zh-rCN/complication_strings.xml
diff --git a/wear/wear-complications-data/src/main/res/values-zh-rHK/complication_strings.xml b/wear/watchface/watchface-complications-data/src/main/res/values-zh-rHK/complication_strings.xml
similarity index 100%
rename from wear/wear-complications-data/src/main/res/values-zh-rHK/complication_strings.xml
rename to wear/watchface/watchface-complications-data/src/main/res/values-zh-rHK/complication_strings.xml
diff --git a/wear/wear-complications-data/src/main/res/values-zh-rTW/complication_strings.xml b/wear/watchface/watchface-complications-data/src/main/res/values-zh-rTW/complication_strings.xml
similarity index 100%
rename from wear/wear-complications-data/src/main/res/values-zh-rTW/complication_strings.xml
rename to wear/watchface/watchface-complications-data/src/main/res/values-zh-rTW/complication_strings.xml
diff --git a/wear/wear-complications-data/src/main/res/values-zu/complication_strings.xml b/wear/watchface/watchface-complications-data/src/main/res/values-zu/complication_strings.xml
similarity index 100%
rename from wear/wear-complications-data/src/main/res/values-zu/complication_strings.xml
rename to wear/watchface/watchface-complications-data/src/main/res/values-zu/complication_strings.xml
diff --git a/wear/wear-complications-data/src/main/res/values/complication_strings.xml b/wear/watchface/watchface-complications-data/src/main/res/values/complication_strings.xml
similarity index 100%
rename from wear/wear-complications-data/src/main/res/values/complication_strings.xml
rename to wear/watchface/watchface-complications-data/src/main/res/values/complication_strings.xml
diff --git a/wear/wear-complications-data/src/test/java/android/support/wearable/complications/ComplicationDataTest.kt b/wear/watchface/watchface-complications-data/src/test/java/android/support/wearable/complications/ComplicationDataTest.kt
similarity index 99%
rename from wear/wear-complications-data/src/test/java/android/support/wearable/complications/ComplicationDataTest.kt
rename to wear/watchface/watchface-complications-data/src/test/java/android/support/wearable/complications/ComplicationDataTest.kt
index 3a4fcb6..a638235 100644
--- a/wear/wear-complications-data/src/test/java/android/support/wearable/complications/ComplicationDataTest.kt
+++ b/wear/watchface/watchface-complications-data/src/test/java/android/support/wearable/complications/ComplicationDataTest.kt
@@ -23,7 +23,7 @@
import android.support.wearable.complications.ComplicationText.TimeDifferenceBuilder
import android.support.wearable.complications.ComplicationText.TimeFormatBuilder
import androidx.test.core.app.ApplicationProvider
-import androidx.wear.complications.SharedRobolectricTestRunner
+import androidx.wear.watchface.complications.SharedRobolectricTestRunner
import com.google.common.truth.Truth
import org.junit.Assert
import org.junit.Assert.assertThrows
diff --git a/wear/wear-complications-data/src/test/java/android/support/wearable/complications/ComplicationTextTemplateTest.kt b/wear/watchface/watchface-complications-data/src/test/java/android/support/wearable/complications/ComplicationTextTemplateTest.kt
similarity index 99%
rename from wear/wear-complications-data/src/test/java/android/support/wearable/complications/ComplicationTextTemplateTest.kt
rename to wear/watchface/watchface-complications-data/src/test/java/android/support/wearable/complications/ComplicationTextTemplateTest.kt
index 742bd04..466a3f5 100644
--- a/wear/wear-complications-data/src/test/java/android/support/wearable/complications/ComplicationTextTemplateTest.kt
+++ b/wear/watchface/watchface-complications-data/src/test/java/android/support/wearable/complications/ComplicationTextTemplateTest.kt
@@ -20,7 +20,7 @@
import android.support.wearable.complications.ComplicationText.TimeDifferenceBuilder
import android.support.wearable.complications.ComplicationText.TimeFormatBuilder
import androidx.test.core.app.ApplicationProvider
-import androidx.wear.complications.SharedRobolectricTestRunner
+import androidx.wear.watchface.complications.SharedRobolectricTestRunner
import com.google.common.truth.Truth
import org.junit.Assert
import org.junit.Test
diff --git a/wear/wear-complications-data/src/test/java/android/support/wearable/complications/ComplicationTextTest.kt b/wear/watchface/watchface-complications-data/src/test/java/android/support/wearable/complications/ComplicationTextTest.kt
similarity index 99%
rename from wear/wear-complications-data/src/test/java/android/support/wearable/complications/ComplicationTextTest.kt
rename to wear/watchface/watchface-complications-data/src/test/java/android/support/wearable/complications/ComplicationTextTest.kt
index ce5c29e..e2d783e 100644
--- a/wear/wear-complications-data/src/test/java/android/support/wearable/complications/ComplicationTextTest.kt
+++ b/wear/watchface/watchface-complications-data/src/test/java/android/support/wearable/complications/ComplicationTextTest.kt
@@ -21,7 +21,7 @@
import android.support.wearable.complications.ComplicationText.TimeDifferenceBuilder
import android.support.wearable.complications.ComplicationText.TimeFormatBuilder
import androidx.test.core.app.ApplicationProvider
-import androidx.wear.complications.SharedRobolectricTestRunner
+import androidx.wear.watchface.complications.SharedRobolectricTestRunner
import com.google.common.truth.Truth
import org.junit.Assert
import org.junit.Test
diff --git a/wear/wear-complications-data/src/test/java/android/support/wearable/complications/Parcelables.kt b/wear/watchface/watchface-complications-data/src/test/java/android/support/wearable/complications/Parcelables.kt
similarity index 100%
rename from wear/wear-complications-data/src/test/java/android/support/wearable/complications/Parcelables.kt
rename to wear/watchface/watchface-complications-data/src/test/java/android/support/wearable/complications/Parcelables.kt
diff --git a/wear/wear-complications-data/src/test/java/android/support/wearable/complications/TimeDifferenceTextTest.kt b/wear/watchface/watchface-complications-data/src/test/java/android/support/wearable/complications/TimeDifferenceTextTest.kt
similarity index 99%
rename from wear/wear-complications-data/src/test/java/android/support/wearable/complications/TimeDifferenceTextTest.kt
rename to wear/watchface/watchface-complications-data/src/test/java/android/support/wearable/complications/TimeDifferenceTextTest.kt
index 83d23b0..346f5e4 100644
--- a/wear/wear-complications-data/src/test/java/android/support/wearable/complications/TimeDifferenceTextTest.kt
+++ b/wear/watchface/watchface-complications-data/src/test/java/android/support/wearable/complications/TimeDifferenceTextTest.kt
@@ -18,7 +18,7 @@
import android.content.Context
import androidx.test.core.app.ApplicationProvider
-import androidx.wear.complications.SharedRobolectricTestRunner
+import androidx.wear.watchface.complications.SharedRobolectricTestRunner
import com.google.common.truth.Truth
import org.junit.Assert
import org.junit.Test
diff --git a/wear/wear-complications-data/src/test/java/android/support/wearable/complications/TimeFormatTextTest.kt b/wear/watchface/watchface-complications-data/src/test/java/android/support/wearable/complications/TimeFormatTextTest.kt
similarity index 99%
rename from wear/wear-complications-data/src/test/java/android/support/wearable/complications/TimeFormatTextTest.kt
rename to wear/watchface/watchface-complications-data/src/test/java/android/support/wearable/complications/TimeFormatTextTest.kt
index 4e49bee..82cb546 100644
--- a/wear/wear-complications-data/src/test/java/android/support/wearable/complications/TimeFormatTextTest.kt
+++ b/wear/watchface/watchface-complications-data/src/test/java/android/support/wearable/complications/TimeFormatTextTest.kt
@@ -18,7 +18,7 @@
import android.content.Context
import androidx.test.core.app.ApplicationProvider
-import androidx.wear.complications.SharedRobolectricTestRunner
+import androidx.wear.watchface.complications.SharedRobolectricTestRunner
import com.google.common.truth.Truth
import org.junit.Assert
import org.junit.Test
diff --git a/wear/wear-complications-data/src/test/java/androidx/wear/complications/ComplicationDataSourceInfoRetrieverTest.kt b/wear/watchface/watchface-complications-data/src/test/java/androidx/wear/watchface/complications/ComplicationDataSourceInfoRetrieverTest.kt
similarity index 89%
rename from wear/wear-complications-data/src/test/java/androidx/wear/complications/ComplicationDataSourceInfoRetrieverTest.kt
rename to wear/watchface/watchface-complications-data/src/test/java/androidx/wear/watchface/complications/ComplicationDataSourceInfoRetrieverTest.kt
index 8ae1a28..1b03648 100644
--- a/wear/wear-complications-data/src/test/java/androidx/wear/complications/ComplicationDataSourceInfoRetrieverTest.kt
+++ b/wear/watchface/watchface-complications-data/src/test/java/androidx/wear/watchface/complications/ComplicationDataSourceInfoRetrieverTest.kt
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package androidx.wear.complications
+package androidx.wear.watchface.complications
import android.content.ComponentName
import android.content.Context
@@ -23,16 +23,16 @@
import android.support.wearable.complications.IPreviewComplicationDataCallback
import android.support.wearable.complications.IProviderInfoService
import androidx.test.core.app.ApplicationProvider
-import androidx.wear.complications.data.ComplicationData
-import androidx.wear.complications.data.ComplicationText
-import androidx.wear.complications.data.ComplicationType
-import androidx.wear.complications.data.LongTextComplicationData
-import androidx.wear.complications.data.MonochromaticImageComplicationData
-import androidx.wear.complications.data.PhotoImageComplicationData
-import androidx.wear.complications.data.PlainComplicationText
-import androidx.wear.complications.data.RangedValueComplicationData
-import androidx.wear.complications.data.ShortTextComplicationData
-import androidx.wear.complications.data.SmallImageComplicationData
+import androidx.wear.watchface.complications.data.ComplicationData
+import androidx.wear.watchface.complications.data.ComplicationText
+import androidx.wear.watchface.complications.data.ComplicationType
+import androidx.wear.watchface.complications.data.LongTextComplicationData
+import androidx.wear.watchface.complications.data.MonochromaticImageComplicationData
+import androidx.wear.watchface.complications.data.PhotoImageComplicationData
+import androidx.wear.watchface.complications.data.PlainComplicationText
+import androidx.wear.watchface.complications.data.RangedValueComplicationData
+import androidx.wear.watchface.complications.data.ShortTextComplicationData
+import androidx.wear.watchface.complications.data.SmallImageComplicationData
import com.google.common.truth.Truth.assertThat
import kotlinx.coroutines.runBlocking
import org.junit.Test
@@ -43,22 +43,6 @@
import org.mockito.Mockito.doAnswer
import java.time.Instant
-/*
-* Copyright 2021 The Android Open Source Project
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
-
@RunWith(SharedRobolectricTestRunner::class)
public class ComplicationDataSourceInfoRetrieverTest {
private val mockService = Mockito.mock(IProviderInfoService::class.java)
diff --git a/wear/wear-complications-data/src/test/java/androidx/wear/complications/ParcelableSubject.kt b/wear/watchface/watchface-complications-data/src/test/java/androidx/wear/watchface/complications/ParcelableSubject.kt
similarity index 95%
rename from wear/wear-complications-data/src/test/java/androidx/wear/complications/ParcelableSubject.kt
rename to wear/watchface/watchface-complications-data/src/test/java/androidx/wear/watchface/complications/ParcelableSubject.kt
index 9846336..098c10d 100644
--- a/wear/wear-complications-data/src/test/java/androidx/wear/complications/ParcelableSubject.kt
+++ b/wear/watchface/watchface-complications-data/src/test/java/androidx/wear/watchface/complications/ParcelableSubject.kt
@@ -1,5 +1,5 @@
/*
- * Copyright 2020 The Android Open Source Project
+ * Copyright 2021 The Android Open 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,7 +14,7 @@
* limitations under the License.
*/
-package androidx.wear.complications
+package androidx.wear.watchface.complications
import android.os.Parcel
import android.os.Parcelable
diff --git a/wear/wear-complications-data/src/test/java/androidx/wear/complications/SharedRobolectricTestRunner.kt b/wear/watchface/watchface-complications-data/src/test/java/androidx/wear/watchface/complications/SharedRobolectricTestRunner.kt
similarity index 96%
rename from wear/wear-complications-data/src/test/java/androidx/wear/complications/SharedRobolectricTestRunner.kt
rename to wear/watchface/watchface-complications-data/src/test/java/androidx/wear/watchface/complications/SharedRobolectricTestRunner.kt
index 46f65ca..3ea24e0 100644
--- a/wear/wear-complications-data/src/test/java/androidx/wear/complications/SharedRobolectricTestRunner.kt
+++ b/wear/watchface/watchface-complications-data/src/test/java/androidx/wear/watchface/complications/SharedRobolectricTestRunner.kt
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package androidx.wear.complications
+package androidx.wear.watchface.complications
import org.junit.runners.model.FrameworkMethod
import org.robolectric.RobolectricTestRunner
diff --git a/wear/wear-complications-data/src/test/java/androidx/wear/complications/SystemDataSourcesTest.kt b/wear/watchface/watchface-complications-data/src/test/java/androidx/wear/watchface/complications/SystemDataSourcesTest.kt
similarity index 97%
rename from wear/wear-complications-data/src/test/java/androidx/wear/complications/SystemDataSourcesTest.kt
rename to wear/watchface/watchface-complications-data/src/test/java/androidx/wear/watchface/complications/SystemDataSourcesTest.kt
index a0681d4..624d10d 100644
--- a/wear/wear-complications-data/src/test/java/androidx/wear/complications/SystemDataSourcesTest.kt
+++ b/wear/watchface/watchface-complications-data/src/test/java/androidx/wear/watchface/complications/SystemDataSourcesTest.kt
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package androidx.wear.complications
+package androidx.wear.watchface.complications
import com.google.common.truth.Truth.assertWithMessage
import org.junit.Assert.fail
diff --git a/wear/wear-complications-data/src/test/java/androidx/wear/complications/data/DataTest.kt b/wear/watchface/watchface-complications-data/src/test/java/androidx/wear/watchface/complications/data/DataTest.kt
similarity index 98%
rename from wear/wear-complications-data/src/test/java/androidx/wear/complications/data/DataTest.kt
rename to wear/watchface/watchface-complications-data/src/test/java/androidx/wear/watchface/complications/data/DataTest.kt
index 49fbd691..dfa9cac 100644
--- a/wear/wear-complications-data/src/test/java/androidx/wear/complications/data/DataTest.kt
+++ b/wear/watchface/watchface-complications-data/src/test/java/androidx/wear/watchface/complications/data/DataTest.kt
@@ -1,5 +1,5 @@
/*
- * Copyright 2020 The Android Open Source Project
+ * Copyright 2021 The Android Open 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,14 +14,14 @@
* limitations under the License.
*/
-package androidx.wear.complications.data
+package androidx.wear.watchface.complications.data
import android.app.PendingIntent
import android.content.Intent
import android.graphics.drawable.Icon
import androidx.test.core.app.ApplicationProvider
-import androidx.wear.complications.ParcelableSubject
-import androidx.wear.complications.SharedRobolectricTestRunner
+import androidx.wear.watchface.complications.ParcelableSubject
+import androidx.wear.watchface.complications.SharedRobolectricTestRunner
import com.google.common.truth.Truth.assertThat
import org.junit.Test
import org.junit.runner.RunWith
diff --git a/wear/wear-complications-data/src/test/java/androidx/wear/complications/data/ImageTest.kt b/wear/watchface/watchface-complications-data/src/test/java/androidx/wear/watchface/complications/data/ImageTest.kt
similarity index 90%
rename from wear/wear-complications-data/src/test/java/androidx/wear/complications/data/ImageTest.kt
rename to wear/watchface/watchface-complications-data/src/test/java/androidx/wear/watchface/complications/data/ImageTest.kt
index ed2ccc0..91cead6 100644
--- a/wear/wear-complications-data/src/test/java/androidx/wear/complications/data/ImageTest.kt
+++ b/wear/watchface/watchface-complications-data/src/test/java/androidx/wear/watchface/complications/data/ImageTest.kt
@@ -1,5 +1,5 @@
/*
- * Copyright 2020 The Android Open Source Project
+ * Copyright 2021 The Android Open 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,10 +14,10 @@
* limitations under the License.
*/
-package androidx.wear.complications.data
+package androidx.wear.watchface.complications.data
import android.graphics.drawable.Icon
-import androidx.wear.complications.SharedRobolectricTestRunner
+import androidx.wear.watchface.complications.SharedRobolectricTestRunner
import com.google.common.truth.Truth.assertThat
import org.junit.Test
import org.junit.runner.RunWith
diff --git a/wear/wear-complications-data/src/test/java/androidx/wear/complications/data/TextTest.kt b/wear/watchface/watchface-complications-data/src/test/java/androidx/wear/watchface/complications/data/TextTest.kt
similarity index 97%
rename from wear/wear-complications-data/src/test/java/androidx/wear/complications/data/TextTest.kt
rename to wear/watchface/watchface-complications-data/src/test/java/androidx/wear/watchface/complications/data/TextTest.kt
index bc350df..cb2eef0 100644
--- a/wear/wear-complications-data/src/test/java/androidx/wear/complications/data/TextTest.kt
+++ b/wear/watchface/watchface-complications-data/src/test/java/androidx/wear/watchface/complications/data/TextTest.kt
@@ -1,5 +1,5 @@
/*
- * Copyright 2020 The Android Open Source Project
+ * Copyright 2021 The Android Open 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,15 +14,15 @@
* limitations under the License.
*/
-package androidx.wear.complications.data
+package androidx.wear.watchface.complications.data
import android.content.Context
import android.icu.util.TimeZone
import android.support.wearable.complications.ComplicationText
import android.support.wearable.complications.TimeFormatText
import androidx.test.core.app.ApplicationProvider
-import androidx.wear.complications.ParcelableSubject
-import androidx.wear.complications.SharedRobolectricTestRunner
+import androidx.wear.watchface.complications.ParcelableSubject
+import androidx.wear.watchface.complications.SharedRobolectricTestRunner
import com.google.common.truth.Truth.assertThat
import org.junit.Assert.assertNull
import org.junit.Test
diff --git a/wear/wear-complications-data/src/test/java/androidx/wear/complications/data/TimeRangeTest.kt b/wear/watchface/watchface-complications-data/src/test/java/androidx/wear/watchface/complications/data/TimeRangeTest.kt
similarity index 94%
rename from wear/wear-complications-data/src/test/java/androidx/wear/complications/data/TimeRangeTest.kt
rename to wear/watchface/watchface-complications-data/src/test/java/androidx/wear/watchface/complications/data/TimeRangeTest.kt
index bd966c8..8df0269 100644
--- a/wear/wear-complications-data/src/test/java/androidx/wear/complications/data/TimeRangeTest.kt
+++ b/wear/watchface/watchface-complications-data/src/test/java/androidx/wear/watchface/complications/data/TimeRangeTest.kt
@@ -1,5 +1,5 @@
/*
- * Copyright 2020 The Android Open Source Project
+ * Copyright 2021 The Android Open 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,9 +14,9 @@
* limitations under the License.
*/
-package androidx.wear.complications.data
+package androidx.wear.watchface.complications.data
-import androidx.wear.complications.SharedRobolectricTestRunner
+import androidx.wear.watchface.complications.SharedRobolectricTestRunner
import com.google.common.truth.Truth.assertThat
import org.junit.Test
import org.junit.runner.RunWith
diff --git a/wear/wear-complications-data/src/test/java/androidx/wear/complications/data/TypeTest.kt b/wear/watchface/watchface-complications-data/src/test/java/androidx/wear/watchface/complications/data/TypeTest.kt
similarity index 94%
rename from wear/wear-complications-data/src/test/java/androidx/wear/complications/data/TypeTest.kt
rename to wear/watchface/watchface-complications-data/src/test/java/androidx/wear/watchface/complications/data/TypeTest.kt
index 75c5f30..fce751f 100644
--- a/wear/wear-complications-data/src/test/java/androidx/wear/complications/data/TypeTest.kt
+++ b/wear/watchface/watchface-complications-data/src/test/java/androidx/wear/watchface/complications/data/TypeTest.kt
@@ -1,5 +1,5 @@
/*
- * Copyright 2020 The Android Open Source Project
+ * Copyright 2021 The Android Open 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,9 +14,9 @@
* limitations under the License.
*/
-package androidx.wear.complications.data
+package androidx.wear.watchface.complications.data
-import androidx.wear.complications.SharedRobolectricTestRunner
+import androidx.wear.watchface.complications.SharedRobolectricTestRunner
import com.google.common.truth.Truth.assertThat
import org.junit.Test
import org.junit.runner.RunWith
diff --git a/wear/wear-complications-data/src/test/resources/robolectric.properties b/wear/watchface/watchface-complications-data/src/test/resources/robolectric.properties
similarity index 100%
rename from wear/wear-complications-data/src/test/resources/robolectric.properties
rename to wear/watchface/watchface-complications-data/src/test/resources/robolectric.properties
diff --git a/wear/wear-watchface-complications-rendering/api/current.txt b/wear/watchface/watchface-complications-rendering/api/current.txt
similarity index 93%
rename from wear/wear-watchface-complications-rendering/api/current.txt
rename to wear/watchface/watchface-complications-rendering/api/current.txt
index 0836044..2a0aaa0 100644
--- a/wear/wear-watchface-complications-rendering/api/current.txt
+++ b/wear/watchface/watchface-complications-rendering/api/current.txt
@@ -4,9 +4,9 @@
public class CanvasComplicationDrawable implements androidx.wear.watchface.CanvasComplication {
ctor public CanvasComplicationDrawable(androidx.wear.watchface.complications.rendering.ComplicationDrawable drawable, androidx.wear.watchface.WatchState watchState, androidx.wear.watchface.CanvasComplication.InvalidateCallback invalidateCallback);
method public void drawHighlight(android.graphics.Canvas canvas, android.graphics.Rect bounds, int boundsType, java.time.ZonedDateTime zonedDateTime, @ColorInt int color);
- method public androidx.wear.complications.data.ComplicationData getData();
+ method public androidx.wear.watchface.complications.data.ComplicationData getData();
method public final androidx.wear.watchface.complications.rendering.ComplicationDrawable getDrawable();
- method @CallSuper public void loadData(androidx.wear.complications.data.ComplicationData complicationData, boolean loadDrawablesAsynchronous);
+ method @CallSuper public void loadData(androidx.wear.watchface.complications.data.ComplicationData complicationData, boolean loadDrawablesAsynchronous);
method public void render(android.graphics.Canvas canvas, android.graphics.Rect bounds, java.time.ZonedDateTime zonedDateTime, androidx.wear.watchface.RenderParameters renderParameters, int slotId);
method public final void setDrawable(androidx.wear.watchface.complications.rendering.ComplicationDrawable value);
property public final androidx.wear.watchface.complications.rendering.ComplicationDrawable drawable;
@@ -19,7 +19,7 @@
method public void draw(android.graphics.Canvas canvas);
method public androidx.wear.watchface.complications.rendering.ComplicationStyle getActiveStyle();
method public androidx.wear.watchface.complications.rendering.ComplicationStyle getAmbientStyle();
- method public androidx.wear.complications.data.ComplicationData getComplicationData();
+ method public androidx.wear.watchface.complications.data.ComplicationData getComplicationData();
method public android.content.Context? getContext();
method public java.time.Instant getCurrentTime();
method public static androidx.wear.watchface.complications.rendering.ComplicationDrawable? getDrawable(android.content.Context context, int id);
@@ -35,7 +35,7 @@
method public void setAlpha(@IntRange(from=0, to=255) int alpha);
method public void setBurnInProtectionOn(boolean isBurnInProtectionOn);
method public void setColorFilter(android.graphics.ColorFilter? colorFilter);
- method public void setComplicationData(androidx.wear.complications.data.ComplicationData complicationData, boolean loadDrawablesAsync);
+ method public void setComplicationData(androidx.wear.watchface.complications.data.ComplicationData complicationData, boolean loadDrawablesAsync);
method public void setContext(android.content.Context context);
method public void setCurrentTime(java.time.Instant currentTime);
method public void setHighlightDuration(@IntRange(from=0) long highlightDurationMillis);
@@ -46,7 +46,7 @@
method public void setRangedValueProgressHidden(boolean rangedValueProgressHidden);
property public final androidx.wear.watchface.complications.rendering.ComplicationStyle activeStyle;
property public final androidx.wear.watchface.complications.rendering.ComplicationStyle ambientStyle;
- property public final androidx.wear.complications.data.ComplicationData complicationData;
+ property public final androidx.wear.watchface.complications.data.ComplicationData complicationData;
property public final android.content.Context? context;
property public final java.time.Instant currentTime;
property public final long highlightDuration;
diff --git a/wear/wear-watchface-complications-rendering/api/current.txt b/wear/watchface/watchface-complications-rendering/api/public_plus_experimental_current.txt
similarity index 93%
copy from wear/wear-watchface-complications-rendering/api/current.txt
copy to wear/watchface/watchface-complications-rendering/api/public_plus_experimental_current.txt
index 0836044..2a0aaa0 100644
--- a/wear/wear-watchface-complications-rendering/api/current.txt
+++ b/wear/watchface/watchface-complications-rendering/api/public_plus_experimental_current.txt
@@ -4,9 +4,9 @@
public class CanvasComplicationDrawable implements androidx.wear.watchface.CanvasComplication {
ctor public CanvasComplicationDrawable(androidx.wear.watchface.complications.rendering.ComplicationDrawable drawable, androidx.wear.watchface.WatchState watchState, androidx.wear.watchface.CanvasComplication.InvalidateCallback invalidateCallback);
method public void drawHighlight(android.graphics.Canvas canvas, android.graphics.Rect bounds, int boundsType, java.time.ZonedDateTime zonedDateTime, @ColorInt int color);
- method public androidx.wear.complications.data.ComplicationData getData();
+ method public androidx.wear.watchface.complications.data.ComplicationData getData();
method public final androidx.wear.watchface.complications.rendering.ComplicationDrawable getDrawable();
- method @CallSuper public void loadData(androidx.wear.complications.data.ComplicationData complicationData, boolean loadDrawablesAsynchronous);
+ method @CallSuper public void loadData(androidx.wear.watchface.complications.data.ComplicationData complicationData, boolean loadDrawablesAsynchronous);
method public void render(android.graphics.Canvas canvas, android.graphics.Rect bounds, java.time.ZonedDateTime zonedDateTime, androidx.wear.watchface.RenderParameters renderParameters, int slotId);
method public final void setDrawable(androidx.wear.watchface.complications.rendering.ComplicationDrawable value);
property public final androidx.wear.watchface.complications.rendering.ComplicationDrawable drawable;
@@ -19,7 +19,7 @@
method public void draw(android.graphics.Canvas canvas);
method public androidx.wear.watchface.complications.rendering.ComplicationStyle getActiveStyle();
method public androidx.wear.watchface.complications.rendering.ComplicationStyle getAmbientStyle();
- method public androidx.wear.complications.data.ComplicationData getComplicationData();
+ method public androidx.wear.watchface.complications.data.ComplicationData getComplicationData();
method public android.content.Context? getContext();
method public java.time.Instant getCurrentTime();
method public static androidx.wear.watchface.complications.rendering.ComplicationDrawable? getDrawable(android.content.Context context, int id);
@@ -35,7 +35,7 @@
method public void setAlpha(@IntRange(from=0, to=255) int alpha);
method public void setBurnInProtectionOn(boolean isBurnInProtectionOn);
method public void setColorFilter(android.graphics.ColorFilter? colorFilter);
- method public void setComplicationData(androidx.wear.complications.data.ComplicationData complicationData, boolean loadDrawablesAsync);
+ method public void setComplicationData(androidx.wear.watchface.complications.data.ComplicationData complicationData, boolean loadDrawablesAsync);
method public void setContext(android.content.Context context);
method public void setCurrentTime(java.time.Instant currentTime);
method public void setHighlightDuration(@IntRange(from=0) long highlightDurationMillis);
@@ -46,7 +46,7 @@
method public void setRangedValueProgressHidden(boolean rangedValueProgressHidden);
property public final androidx.wear.watchface.complications.rendering.ComplicationStyle activeStyle;
property public final androidx.wear.watchface.complications.rendering.ComplicationStyle ambientStyle;
- property public final androidx.wear.complications.data.ComplicationData complicationData;
+ property public final androidx.wear.watchface.complications.data.ComplicationData complicationData;
property public final android.content.Context? context;
property public final java.time.Instant currentTime;
property public final long highlightDuration;
diff --git a/wear/wear-watchface-complications-rendering/api/res-current.txt b/wear/watchface/watchface-complications-rendering/api/res-current.txt
similarity index 100%
rename from wear/wear-watchface-complications-rendering/api/res-current.txt
rename to wear/watchface/watchface-complications-rendering/api/res-current.txt
diff --git a/wear/wear-watchface-complications-rendering/api/current.txt b/wear/watchface/watchface-complications-rendering/api/restricted_current.txt
similarity index 93%
copy from wear/wear-watchface-complications-rendering/api/current.txt
copy to wear/watchface/watchface-complications-rendering/api/restricted_current.txt
index 0836044..2a0aaa0 100644
--- a/wear/wear-watchface-complications-rendering/api/current.txt
+++ b/wear/watchface/watchface-complications-rendering/api/restricted_current.txt
@@ -4,9 +4,9 @@
public class CanvasComplicationDrawable implements androidx.wear.watchface.CanvasComplication {
ctor public CanvasComplicationDrawable(androidx.wear.watchface.complications.rendering.ComplicationDrawable drawable, androidx.wear.watchface.WatchState watchState, androidx.wear.watchface.CanvasComplication.InvalidateCallback invalidateCallback);
method public void drawHighlight(android.graphics.Canvas canvas, android.graphics.Rect bounds, int boundsType, java.time.ZonedDateTime zonedDateTime, @ColorInt int color);
- method public androidx.wear.complications.data.ComplicationData getData();
+ method public androidx.wear.watchface.complications.data.ComplicationData getData();
method public final androidx.wear.watchface.complications.rendering.ComplicationDrawable getDrawable();
- method @CallSuper public void loadData(androidx.wear.complications.data.ComplicationData complicationData, boolean loadDrawablesAsynchronous);
+ method @CallSuper public void loadData(androidx.wear.watchface.complications.data.ComplicationData complicationData, boolean loadDrawablesAsynchronous);
method public void render(android.graphics.Canvas canvas, android.graphics.Rect bounds, java.time.ZonedDateTime zonedDateTime, androidx.wear.watchface.RenderParameters renderParameters, int slotId);
method public final void setDrawable(androidx.wear.watchface.complications.rendering.ComplicationDrawable value);
property public final androidx.wear.watchface.complications.rendering.ComplicationDrawable drawable;
@@ -19,7 +19,7 @@
method public void draw(android.graphics.Canvas canvas);
method public androidx.wear.watchface.complications.rendering.ComplicationStyle getActiveStyle();
method public androidx.wear.watchface.complications.rendering.ComplicationStyle getAmbientStyle();
- method public androidx.wear.complications.data.ComplicationData getComplicationData();
+ method public androidx.wear.watchface.complications.data.ComplicationData getComplicationData();
method public android.content.Context? getContext();
method public java.time.Instant getCurrentTime();
method public static androidx.wear.watchface.complications.rendering.ComplicationDrawable? getDrawable(android.content.Context context, int id);
@@ -35,7 +35,7 @@
method public void setAlpha(@IntRange(from=0, to=255) int alpha);
method public void setBurnInProtectionOn(boolean isBurnInProtectionOn);
method public void setColorFilter(android.graphics.ColorFilter? colorFilter);
- method public void setComplicationData(androidx.wear.complications.data.ComplicationData complicationData, boolean loadDrawablesAsync);
+ method public void setComplicationData(androidx.wear.watchface.complications.data.ComplicationData complicationData, boolean loadDrawablesAsync);
method public void setContext(android.content.Context context);
method public void setCurrentTime(java.time.Instant currentTime);
method public void setHighlightDuration(@IntRange(from=0) long highlightDurationMillis);
@@ -46,7 +46,7 @@
method public void setRangedValueProgressHidden(boolean rangedValueProgressHidden);
property public final androidx.wear.watchface.complications.rendering.ComplicationStyle activeStyle;
property public final androidx.wear.watchface.complications.rendering.ComplicationStyle ambientStyle;
- property public final androidx.wear.complications.data.ComplicationData complicationData;
+ property public final androidx.wear.watchface.complications.data.ComplicationData complicationData;
property public final android.content.Context? context;
property public final java.time.Instant currentTime;
property public final long highlightDuration;
diff --git a/wear/wear-watchface-complications-rendering/build.gradle b/wear/watchface/watchface-complications-rendering/build.gradle
similarity index 87%
rename from wear/wear-watchface-complications-rendering/build.gradle
rename to wear/watchface/watchface-complications-rendering/build.gradle
index bcd44e9..4d53861 100644
--- a/wear/wear-watchface-complications-rendering/build.gradle
+++ b/wear/watchface/watchface-complications-rendering/build.gradle
@@ -28,8 +28,8 @@
dependencies {
api("androidx.annotation:annotation:1.1.0")
- api(project(":wear:wear-complications-data"))
- api(project(":wear:wear-watchface"))
+ api(project(":wear:watchface:watchface-complications-data"))
+ api(project(":wear:watchface:watchface"))
implementation("androidx.core:core:1.1.0")
implementation("androidx.preference:preference:1.1.0")
@@ -44,7 +44,7 @@
testImplementation(libs.mockitoCore)
testImplementation(libs.truth)
testImplementation("junit:junit:4.13")
- testImplementation(project(":wear:wear-watchface"))
+ testImplementation(project(":wear:watchface:watchface"))
}
android {
@@ -62,8 +62,7 @@
androidx {
name = "Android Wear Watchface Complication Rendering"
publish = Publish.SNAPSHOT_AND_RELEASE
- mavenGroup = LibraryGroups.WEAR
- mavenVersion = LibraryVersions.WEAR_WATCHFACE_COMPLICATIONS_RENDERING
+ mavenGroup = LibraryGroups.WEAR_WATCHFACE
inceptionYear = "2020"
description = "Support for rendering complications on the watch face"
}
diff --git a/wear/wear-watchface-complications-rendering/src/androidTest/AndroidManifest.xml b/wear/watchface/watchface-complications-rendering/src/androidTest/AndroidManifest.xml
similarity index 100%
rename from wear/wear-watchface-complications-rendering/src/androidTest/AndroidManifest.xml
rename to wear/watchface/watchface-complications-rendering/src/androidTest/AndroidManifest.xml
diff --git a/wear/wear-watchface-complications-rendering/src/androidTest/java/androidx/wear/watchface/complications/rendering/test/ComplicationDrawableAndroidTest.java b/wear/watchface/watchface-complications-rendering/src/androidTest/java/androidx/wear/watchface/complications/rendering/test/ComplicationDrawableAndroidTest.java
similarity index 100%
rename from wear/wear-watchface-complications-rendering/src/androidTest/java/androidx/wear/watchface/complications/rendering/test/ComplicationDrawableAndroidTest.java
rename to wear/watchface/watchface-complications-rendering/src/androidTest/java/androidx/wear/watchface/complications/rendering/test/ComplicationDrawableAndroidTest.java
diff --git a/wear/wear-watchface-complications-rendering/src/androidTest/res/drawable/default_complication_drawable.xml b/wear/watchface/watchface-complications-rendering/src/androidTest/res/drawable/default_complication_drawable.xml
similarity index 100%
rename from wear/wear-watchface-complications-rendering/src/androidTest/res/drawable/default_complication_drawable.xml
rename to wear/watchface/watchface-complications-rendering/src/androidTest/res/drawable/default_complication_drawable.xml
diff --git a/wear/wear-watchface-complications-rendering/src/main/AndroidManifest.xml b/wear/watchface/watchface-complications-rendering/src/main/AndroidManifest.xml
similarity index 100%
rename from wear/wear-watchface-complications-rendering/src/main/AndroidManifest.xml
rename to wear/watchface/watchface-complications-rendering/src/main/AndroidManifest.xml
diff --git a/wear/wear-watchface-complications-rendering/src/main/java/androidx/wear/watchface/complications/rendering/CanvasComplicationDrawable.kt b/wear/watchface/watchface-complications-rendering/src/main/java/androidx/wear/watchface/complications/rendering/CanvasComplicationDrawable.kt
similarity index 96%
rename from wear/wear-watchface-complications-rendering/src/main/java/androidx/wear/watchface/complications/rendering/CanvasComplicationDrawable.kt
rename to wear/watchface/watchface-complications-rendering/src/main/java/androidx/wear/watchface/complications/rendering/CanvasComplicationDrawable.kt
index dd4f493..062f4f8 100644
--- a/wear/wear-watchface-complications-rendering/src/main/java/androidx/wear/watchface/complications/rendering/CanvasComplicationDrawable.kt
+++ b/wear/watchface/watchface-complications-rendering/src/main/java/androidx/wear/watchface/complications/rendering/CanvasComplicationDrawable.kt
@@ -24,9 +24,9 @@
import android.util.TypedValue
import androidx.annotation.CallSuper
import androidx.annotation.ColorInt
-import androidx.wear.complications.data.ComplicationData
-import androidx.wear.complications.data.NoDataComplicationData
-import androidx.wear.utility.TraceEvent
+import androidx.wear.watchface.complications.data.ComplicationData
+import androidx.wear.watchface.complications.data.NoDataComplicationData
+import androidx.wear.watchface.utility.TraceEvent
import androidx.wear.watchface.CanvasComplication
import androidx.wear.watchface.DrawMode
import androidx.wear.watchface.RenderParameters
diff --git a/wear/wear-watchface-complications-rendering/src/main/java/androidx/wear/watchface/complications/rendering/ComplicationDrawable.kt b/wear/watchface/watchface-complications-rendering/src/main/java/androidx/wear/watchface/complications/rendering/ComplicationDrawable.kt
similarity index 98%
rename from wear/wear-watchface-complications-rendering/src/main/java/androidx/wear/watchface/complications/rendering/ComplicationDrawable.kt
rename to wear/watchface/watchface-complications-rendering/src/main/java/androidx/wear/watchface/complications/rendering/ComplicationDrawable.kt
index c83fef1..9e4b390 100644
--- a/wear/wear-watchface-complications-rendering/src/main/java/androidx/wear/watchface/complications/rendering/ComplicationDrawable.kt
+++ b/wear/watchface/watchface-complications-rendering/src/main/java/androidx/wear/watchface/complications/rendering/ComplicationDrawable.kt
@@ -35,11 +35,11 @@
import androidx.annotation.IntRange
import androidx.annotation.Px
import androidx.annotation.VisibleForTesting
-import androidx.wear.complications.data.ComplicationData
-import androidx.wear.complications.data.ComplicationType.NO_DATA
-import androidx.wear.complications.data.ComplicationType.NO_PERMISSION
-import androidx.wear.complications.data.ComplicationType.RANGED_VALUE
-import androidx.wear.complications.data.NoDataComplicationData
+import androidx.wear.watchface.complications.data.ComplicationData
+import androidx.wear.watchface.complications.data.ComplicationType.NO_DATA
+import androidx.wear.watchface.complications.data.ComplicationType.NO_PERMISSION
+import androidx.wear.watchface.complications.data.ComplicationType.RANGED_VALUE
+import androidx.wear.watchface.complications.data.NoDataComplicationData
import androidx.wear.watchface.ComplicationHelperActivity
import androidx.wear.watchface.complications.rendering.ComplicationRenderer.OnInvalidateListener
import org.xmlpull.v1.XmlPullParser
diff --git a/wear/wear-watchface-complications-rendering/src/main/java/androidx/wear/watchface/complications/rendering/ComplicationHighlightRenderer.kt b/wear/watchface/watchface-complications-rendering/src/main/java/androidx/wear/watchface/complications/rendering/ComplicationHighlightRenderer.kt
similarity index 100%
rename from wear/wear-watchface-complications-rendering/src/main/java/androidx/wear/watchface/complications/rendering/ComplicationHighlightRenderer.kt
rename to wear/watchface/watchface-complications-rendering/src/main/java/androidx/wear/watchface/complications/rendering/ComplicationHighlightRenderer.kt
diff --git a/wear/wear-watchface-complications-rendering/src/main/java/androidx/wear/watchface/complications/rendering/ComplicationRenderer.java b/wear/watchface/watchface-complications-rendering/src/main/java/androidx/wear/watchface/complications/rendering/ComplicationRenderer.java
similarity index 100%
rename from wear/wear-watchface-complications-rendering/src/main/java/androidx/wear/watchface/complications/rendering/ComplicationRenderer.java
rename to wear/watchface/watchface-complications-rendering/src/main/java/androidx/wear/watchface/complications/rendering/ComplicationRenderer.java
diff --git a/wear/wear-watchface-complications-rendering/src/main/java/androidx/wear/watchface/complications/rendering/ComplicationStyle.kt b/wear/watchface/watchface-complications-rendering/src/main/java/androidx/wear/watchface/complications/rendering/ComplicationStyle.kt
similarity index 99%
rename from wear/wear-watchface-complications-rendering/src/main/java/androidx/wear/watchface/complications/rendering/ComplicationStyle.kt
rename to wear/watchface/watchface-complications-rendering/src/main/java/androidx/wear/watchface/complications/rendering/ComplicationStyle.kt
index 6ab4734..7efd9b1 100644
--- a/wear/wear-watchface-complications-rendering/src/main/java/androidx/wear/watchface/complications/rendering/ComplicationStyle.kt
+++ b/wear/watchface/watchface-complications-rendering/src/main/java/androidx/wear/watchface/complications/rendering/ComplicationStyle.kt
@@ -23,7 +23,7 @@
import androidx.annotation.IntDef
import androidx.annotation.Px
import androidx.annotation.RestrictTo
-import androidx.wear.complications.data.SmallImageType
+import androidx.wear.watchface.complications.data.SmallImageType
/**
* Defines attributes to customize appearance of rendered [ ].
diff --git a/wear/wear-watchface-complications-rendering/src/main/java/androidx/wear/watchface/complications/rendering/EmojiHelper.java b/wear/watchface/watchface-complications-rendering/src/main/java/androidx/wear/watchface/complications/rendering/EmojiHelper.java
similarity index 100%
rename from wear/wear-watchface-complications-rendering/src/main/java/androidx/wear/watchface/complications/rendering/EmojiHelper.java
rename to wear/watchface/watchface-complications-rendering/src/main/java/androidx/wear/watchface/complications/rendering/EmojiHelper.java
diff --git a/wear/wear-watchface-complications-rendering/src/main/java/androidx/wear/watchface/complications/rendering/GlesTextureComplication.kt b/wear/watchface/watchface-complications-rendering/src/main/java/androidx/wear/watchface/complications/rendering/GlesTextureComplication.kt
similarity index 100%
rename from wear/wear-watchface-complications-rendering/src/main/java/androidx/wear/watchface/complications/rendering/GlesTextureComplication.kt
rename to wear/watchface/watchface-complications-rendering/src/main/java/androidx/wear/watchface/complications/rendering/GlesTextureComplication.kt
diff --git a/wear/wear-watchface-complications-rendering/src/main/java/androidx/wear/watchface/complications/rendering/RoundedDrawable.java b/wear/watchface/watchface-complications-rendering/src/main/java/androidx/wear/watchface/complications/rendering/RoundedDrawable.java
similarity index 100%
rename from wear/wear-watchface-complications-rendering/src/main/java/androidx/wear/watchface/complications/rendering/RoundedDrawable.java
rename to wear/watchface/watchface-complications-rendering/src/main/java/androidx/wear/watchface/complications/rendering/RoundedDrawable.java
diff --git a/wear/wear-watchface-complications-rendering/src/main/java/androidx/wear/watchface/complications/rendering/TextRenderer.java b/wear/watchface/watchface-complications-rendering/src/main/java/androidx/wear/watchface/complications/rendering/TextRenderer.java
similarity index 100%
rename from wear/wear-watchface-complications-rendering/src/main/java/androidx/wear/watchface/complications/rendering/TextRenderer.java
rename to wear/watchface/watchface-complications-rendering/src/main/java/androidx/wear/watchface/complications/rendering/TextRenderer.java
diff --git a/wear/wear-watchface-complications-rendering/src/main/java/androidx/wear/watchface/complications/rendering/utils/IconLayoutHelper.java b/wear/watchface/watchface-complications-rendering/src/main/java/androidx/wear/watchface/complications/rendering/utils/IconLayoutHelper.java
similarity index 100%
rename from wear/wear-watchface-complications-rendering/src/main/java/androidx/wear/watchface/complications/rendering/utils/IconLayoutHelper.java
rename to wear/watchface/watchface-complications-rendering/src/main/java/androidx/wear/watchface/complications/rendering/utils/IconLayoutHelper.java
diff --git a/wear/wear-watchface-complications-rendering/src/main/java/androidx/wear/watchface/complications/rendering/utils/LargeImageLayoutHelper.java b/wear/watchface/watchface-complications-rendering/src/main/java/androidx/wear/watchface/complications/rendering/utils/LargeImageLayoutHelper.java
similarity index 100%
rename from wear/wear-watchface-complications-rendering/src/main/java/androidx/wear/watchface/complications/rendering/utils/LargeImageLayoutHelper.java
rename to wear/watchface/watchface-complications-rendering/src/main/java/androidx/wear/watchface/complications/rendering/utils/LargeImageLayoutHelper.java
diff --git a/wear/wear-watchface-complications-rendering/src/main/java/androidx/wear/watchface/complications/rendering/utils/LayoutHelper.java b/wear/watchface/watchface-complications-rendering/src/main/java/androidx/wear/watchface/complications/rendering/utils/LayoutHelper.java
similarity index 100%
rename from wear/wear-watchface-complications-rendering/src/main/java/androidx/wear/watchface/complications/rendering/utils/LayoutHelper.java
rename to wear/watchface/watchface-complications-rendering/src/main/java/androidx/wear/watchface/complications/rendering/utils/LayoutHelper.java
diff --git a/wear/wear-watchface-complications-rendering/src/main/java/androidx/wear/watchface/complications/rendering/utils/LayoutUtils.java b/wear/watchface/watchface-complications-rendering/src/main/java/androidx/wear/watchface/complications/rendering/utils/LayoutUtils.java
similarity index 100%
rename from wear/wear-watchface-complications-rendering/src/main/java/androidx/wear/watchface/complications/rendering/utils/LayoutUtils.java
rename to wear/watchface/watchface-complications-rendering/src/main/java/androidx/wear/watchface/complications/rendering/utils/LayoutUtils.java
diff --git a/wear/wear-watchface-complications-rendering/src/main/java/androidx/wear/watchface/complications/rendering/utils/LongTextLayoutHelper.java b/wear/watchface/watchface-complications-rendering/src/main/java/androidx/wear/watchface/complications/rendering/utils/LongTextLayoutHelper.java
similarity index 100%
rename from wear/wear-watchface-complications-rendering/src/main/java/androidx/wear/watchface/complications/rendering/utils/LongTextLayoutHelper.java
rename to wear/watchface/watchface-complications-rendering/src/main/java/androidx/wear/watchface/complications/rendering/utils/LongTextLayoutHelper.java
diff --git a/wear/wear-watchface-complications-rendering/src/main/java/androidx/wear/watchface/complications/rendering/utils/RangedValueLayoutHelper.java b/wear/watchface/watchface-complications-rendering/src/main/java/androidx/wear/watchface/complications/rendering/utils/RangedValueLayoutHelper.java
similarity index 100%
rename from wear/wear-watchface-complications-rendering/src/main/java/androidx/wear/watchface/complications/rendering/utils/RangedValueLayoutHelper.java
rename to wear/watchface/watchface-complications-rendering/src/main/java/androidx/wear/watchface/complications/rendering/utils/RangedValueLayoutHelper.java
diff --git a/wear/wear-watchface-complications-rendering/src/main/java/androidx/wear/watchface/complications/rendering/utils/ShortTextLayoutHelper.java b/wear/watchface/watchface-complications-rendering/src/main/java/androidx/wear/watchface/complications/rendering/utils/ShortTextLayoutHelper.java
similarity index 100%
rename from wear/wear-watchface-complications-rendering/src/main/java/androidx/wear/watchface/complications/rendering/utils/ShortTextLayoutHelper.java
rename to wear/watchface/watchface-complications-rendering/src/main/java/androidx/wear/watchface/complications/rendering/utils/ShortTextLayoutHelper.java
diff --git a/wear/wear-watchface-complications-rendering/src/main/java/androidx/wear/watchface/complications/rendering/utils/SmallImageLayoutHelper.java b/wear/watchface/watchface-complications-rendering/src/main/java/androidx/wear/watchface/complications/rendering/utils/SmallImageLayoutHelper.java
similarity index 100%
rename from wear/wear-watchface-complications-rendering/src/main/java/androidx/wear/watchface/complications/rendering/utils/SmallImageLayoutHelper.java
rename to wear/watchface/watchface-complications-rendering/src/main/java/androidx/wear/watchface/complications/rendering/utils/SmallImageLayoutHelper.java
diff --git a/wear/wear-watchface-complications-rendering/src/main/res/values/attrs.xml b/wear/watchface/watchface-complications-rendering/src/main/res/values/attrs.xml
similarity index 100%
rename from wear/wear-watchface-complications-rendering/src/main/res/values/attrs.xml
rename to wear/watchface/watchface-complications-rendering/src/main/res/values/attrs.xml
diff --git a/wear/wear-watchface-complications-rendering/src/main/res/values/complication_drawable.xml b/wear/watchface/watchface-complications-rendering/src/main/res/values/complication_drawable.xml
similarity index 100%
rename from wear/wear-watchface-complications-rendering/src/main/res/values/complication_drawable.xml
rename to wear/watchface/watchface-complications-rendering/src/main/res/values/complication_drawable.xml
diff --git a/wear/wear-watchface-complications-rendering/src/test/java/androidx/wear/watchface/complications/rendering/CanvasComplicationDrawableTest.kt b/wear/watchface/watchface-complications-rendering/src/test/java/androidx/wear/watchface/complications/rendering/CanvasComplicationDrawableTest.kt
similarity index 100%
rename from wear/wear-watchface-complications-rendering/src/test/java/androidx/wear/watchface/complications/rendering/CanvasComplicationDrawableTest.kt
rename to wear/watchface/watchface-complications-rendering/src/test/java/androidx/wear/watchface/complications/rendering/CanvasComplicationDrawableTest.kt
diff --git a/wear/wear-watchface-complications-rendering/src/test/java/androidx/wear/watchface/complications/rendering/ComplicationDrawableTest.java b/wear/watchface/watchface-complications-rendering/src/test/java/androidx/wear/watchface/complications/rendering/ComplicationDrawableTest.java
similarity index 99%
rename from wear/wear-watchface-complications-rendering/src/test/java/androidx/wear/watchface/complications/rendering/ComplicationDrawableTest.java
rename to wear/watchface/watchface-complications-rendering/src/test/java/androidx/wear/watchface/complications/rendering/ComplicationDrawableTest.java
index 19624f1..0af8779 100644
--- a/wear/wear-watchface-complications-rendering/src/test/java/androidx/wear/watchface/complications/rendering/ComplicationDrawableTest.java
+++ b/wear/watchface/watchface-complications-rendering/src/test/java/androidx/wear/watchface/complications/rendering/ComplicationDrawableTest.java
@@ -48,8 +48,6 @@
import androidx.annotation.NonNull;
import androidx.test.core.app.ApplicationProvider;
-import androidx.wear.complications.data.DataKt;
-import androidx.wear.complications.data.NoDataComplicationData;
import androidx.wear.watchface.CanvasType;
import androidx.wear.watchface.ComplicationHelperActivity;
import androidx.wear.watchface.ComplicationSlotsManager;
@@ -58,6 +56,8 @@
import androidx.wear.watchface.WatchFaceService;
import androidx.wear.watchface.WatchFaceType;
import androidx.wear.watchface.WatchState;
+import androidx.wear.watchface.complications.data.DataKt;
+import androidx.wear.watchface.complications.data.NoDataComplicationData;
import androidx.wear.watchface.style.CurrentUserStyleRepository;
import org.jetbrains.annotations.Nullable;
@@ -86,7 +86,7 @@
private static final int AMBIENT_PX = 1;
private ComplicationDrawable mComplicationDrawable;
- private androidx.wear.complications.data.ComplicationData mComplicationData;
+ private androidx.wear.watchface.complications.data.ComplicationData mComplicationData;
private int mDefaultTextSize;
@Mock
diff --git a/wear/wear-watchface-complications-rendering/src/test/java/androidx/wear/watchface/complications/rendering/ComplicationRendererTest.java b/wear/watchface/watchface-complications-rendering/src/test/java/androidx/wear/watchface/complications/rendering/ComplicationRendererTest.java
similarity index 100%
rename from wear/wear-watchface-complications-rendering/src/test/java/androidx/wear/watchface/complications/rendering/ComplicationRendererTest.java
rename to wear/watchface/watchface-complications-rendering/src/test/java/androidx/wear/watchface/complications/rendering/ComplicationRendererTest.java
diff --git a/wear/wear-watchface-complications-rendering/src/test/java/androidx/wear/watchface/complications/rendering/ComplicationsTestRunner.java b/wear/watchface/watchface-complications-rendering/src/test/java/androidx/wear/watchface/complications/rendering/ComplicationsTestRunner.java
similarity index 86%
rename from wear/wear-watchface-complications-rendering/src/test/java/androidx/wear/watchface/complications/rendering/ComplicationsTestRunner.java
rename to wear/watchface/watchface-complications-rendering/src/test/java/androidx/wear/watchface/complications/rendering/ComplicationsTestRunner.java
index 083604e..e318640 100644
--- a/wear/wear-watchface-complications-rendering/src/test/java/androidx/wear/watchface/complications/rendering/ComplicationsTestRunner.java
+++ b/wear/watchface/watchface-complications-rendering/src/test/java/androidx/wear/watchface/complications/rendering/ComplicationsTestRunner.java
@@ -35,9 +35,9 @@
return new InstrumentationConfiguration.Builder(super.createClassLoaderConfig(method))
.doNotInstrumentPackage("android.support.wearable.complicationSlots")
.doNotInstrumentPackage("android.support.wearable.watchface")
- .doNotInstrumentPackage("androidx.wear.complicationSlots")
- .doNotInstrumentPackage("androidx.wear.complicationSlots.data")
- .doNotInstrumentPackage("androidx.wear.complicationSlots.rendering")
+ .doNotInstrumentPackage("androidx.wear.watchface.complicationSlots")
+ .doNotInstrumentPackage("androidx.wear.watchface.complicationSlots.data")
+ .doNotInstrumentPackage("androidx.wear.watchface.complicationSlots.rendering")
.doNotInstrumentPackage("androidx.wear.watchface")
.doNotInstrumentPackage("androidx.wear.watchface.complication.rendering")
.build();
diff --git a/wear/wear-watchface-complications-rendering/src/test/java/androidx/wear/watchface/complications/rendering/EmojiHelperTest.java b/wear/watchface/watchface-complications-rendering/src/test/java/androidx/wear/watchface/complications/rendering/EmojiHelperTest.java
similarity index 100%
rename from wear/wear-watchface-complications-rendering/src/test/java/androidx/wear/watchface/complications/rendering/EmojiHelperTest.java
rename to wear/watchface/watchface-complications-rendering/src/test/java/androidx/wear/watchface/complications/rendering/EmojiHelperTest.java
diff --git a/wear/wear-watchface-complications-rendering/src/test/java/androidx/wear/watchface/complications/rendering/RoundedDrawableTest.java b/wear/watchface/watchface-complications-rendering/src/test/java/androidx/wear/watchface/complications/rendering/RoundedDrawableTest.java
similarity index 100%
rename from wear/wear-watchface-complications-rendering/src/test/java/androidx/wear/watchface/complications/rendering/RoundedDrawableTest.java
rename to wear/watchface/watchface-complications-rendering/src/test/java/androidx/wear/watchface/complications/rendering/RoundedDrawableTest.java
diff --git a/wear/wear-watchface-complications-rendering/src/test/java/androidx/wear/watchface/complications/rendering/TextRendererTest.java b/wear/watchface/watchface-complications-rendering/src/test/java/androidx/wear/watchface/complications/rendering/TextRendererTest.java
similarity index 100%
rename from wear/wear-watchface-complications-rendering/src/test/java/androidx/wear/watchface/complications/rendering/TextRendererTest.java
rename to wear/watchface/watchface-complications-rendering/src/test/java/androidx/wear/watchface/complications/rendering/TextRendererTest.java
diff --git a/wear/wear-watchface-complications-rendering/src/test/resources/robolectric.properties b/wear/watchface/watchface-complications-rendering/src/test/resources/robolectric.properties
similarity index 100%
rename from wear/wear-watchface-complications-rendering/src/test/resources/robolectric.properties
rename to wear/watchface/watchface-complications-rendering/src/test/resources/robolectric.properties
diff --git a/wear/wear-watchface-data/api/current.txt b/wear/watchface/watchface-data/api/current.txt
similarity index 100%
rename from wear/wear-watchface-data/api/current.txt
rename to wear/watchface/watchface-data/api/current.txt
diff --git a/wear/wear-watchface-data/api/public_plus_experimental_current.txt b/wear/watchface/watchface-data/api/public_plus_experimental_current.txt
similarity index 100%
rename from wear/wear-watchface-data/api/public_plus_experimental_current.txt
rename to wear/watchface/watchface-data/api/public_plus_experimental_current.txt
diff --git a/wear/wear-watchface-data/api/res-current.txt b/wear/watchface/watchface-data/api/res-current.txt
similarity index 100%
rename from wear/wear-watchface-data/api/res-current.txt
rename to wear/watchface/watchface-data/api/res-current.txt
diff --git a/wear/wear-watchface-data/api/restricted_current.txt b/wear/watchface/watchface-data/api/restricted_current.txt
similarity index 76%
rename from wear/wear-watchface-data/api/restricted_current.txt
rename to wear/watchface/watchface-data/api/restricted_current.txt
index ecb5ee7..9342af9 100644
--- a/wear/wear-watchface-data/api/restricted_current.txt
+++ b/wear/watchface/watchface-data/api/restricted_current.txt
@@ -1,121 +1,4 @@
// Signature format: 4.0
-package @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) android.support.wearable.watchface {
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public final class Constants {
- field public static final String ACTION_REQUEST_STATE = "com.google.android.wearable.watchfaces.action.REQUEST_STATE";
- field public static final String ACTION_WATCH_FACE_REFRESH_A11Y_LABELS = "androidx.watchface.action.WATCH_FACE_A11Y_LABELS_REFRESH";
- field public static final String COMMAND_AMBIENT_UPDATE = "com.google.android.wearable.action.AMBIENT_UPDATE";
- field public static final String COMMAND_BACKGROUND_ACTION = "com.google.android.wearable.action.BACKGROUND_ACTION";
- field public static final String COMMAND_COMPLICATION_DATA = "com.google.android.wearable.action.COMPLICATION_DATA";
- field public static final String COMMAND_REQUEST_STYLE = "com.google.android.wearable.action.REQUEST_STYLE";
- field public static final String COMMAND_SET_BINDER = "com.google.android.wearable.action.SET_BINDER";
- field public static final String COMMAND_SET_PROPERTIES = "com.google.android.wearable.action.SET_PROPERTIES";
- field public static final String COMMAND_TAP = "android.wallpaper.tap";
- field public static final String COMMAND_TOUCH = "android.wallpaper.touch";
- field public static final String COMMAND_TOUCH_CANCEL = "android.wallpaper.touch_cancel";
- field public static final android.support.wearable.watchface.Constants.Companion Companion;
- field public static final String EXTRA_AMBIENT_MODE = "ambient_mode";
- field public static final String EXTRA_BINDER = "binder";
- field public static final String EXTRA_CALENDAR_TIME_MS = "EXTRA_CALENDAR_TIME_MS";
- field public static final String EXTRA_COMPLICATION_DATA = "complication_data";
- field public static final String EXTRA_COMPLICATION_ID = "complication_id";
- field public static final String EXTRA_DRAW_MODE = "EXTRA_DRAW_MODE";
- field public static final String EXTRA_INDICATOR_STATUS = "indicator_status";
- field public static final String EXTRA_INTERRUPTION_FILTER = "interruption_filter";
- field public static final String EXTRA_NOTIFICATION_COUNT = "notification_count";
- field public static final String EXTRA_UNREAD_COUNT = "unread_count";
- field public static final String EXTRA_WATCH_FACE_COMPONENT = "android.support.wearable.watchface.extra.WATCH_FACE_COMPONENT";
- field public static final String EXTRA_WATCH_FACE_VISIBLE = "watch_face_visible";
- field public static final String KEY_ACCENT_COLOR = "accentColor";
- field public static final String KEY_ACCEPTS_TAPS = "acceptsTapEvents";
- field public static final String KEY_BACKGROUND_IMAGE_SETTINGS = "key_background_image_settings";
- field public static final String KEY_BITMAP_CONFIG_ORDINAL = "KEY_BITMAP_CONFIG_ORDINAL";
- field public static final String KEY_BITMAP_HEIGHT_PX = "KEY_BITMAP_HEIGHT_PX";
- field public static final String KEY_BITMAP_WIDTH_PX = "KEY_BITMAP_WIDTH_PX";
- field public static final String KEY_BOUNDS = "KEY_BOUNDS";
- field public static final String KEY_COMPLICATIONS_SETTINGS = "key_complications_settings";
- field public static final String KEY_COMPONENT = "component";
- field public static final String KEY_HIDE_NOTIFICATION_INDICATOR = "hideNotificationIndicator";
- field public static final String KEY_SCREENSHOT = "KEY_SCREENSHOT";
- field public static final String KEY_SHOW_UNREAD_INDICATOR = "showUnreadIndicator";
- field public static final String KEY_STATUS_BAR_GRAVITY = "statusBarGravity";
- field public static final String KEY_TAP_ACTION = "KEY_TAP_ACTION";
- field public static final String KEY_TEXT = "KEY_TEXT";
- field public static final String KEY_VIEW_PROTECTION_MODE = "viewProtectionMode";
- field public static final String PERMISSION_BIND_WATCH_FACE_CONTROL = "com.google.android.wearable.permission.BIND_WATCH_FACE_CONTROL";
- field public static final String PROPERTY_BURN_IN_PROTECTION = "burn_in_protection";
- field public static final String PROPERTY_LOW_BIT_AMBIENT = "low_bit_ambient";
- field public static final String STATUS_KEYGUARD_LOCKED = "keyguard_locked";
- }
-
- public static final class Constants.Companion {
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public final class SharedMemoryImage {
- field public static final android.support.wearable.watchface.SharedMemoryImage.Companion Companion;
- }
-
- @RequiresApi(27) public static final class SharedMemoryImage.Companion {
- method public android.graphics.Bitmap ashmemReadImageBundle(android.os.Bundle bundle);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public android.os.Bundle ashmemWriteImageBundle(android.graphics.Bitmap bitmap);
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public class WatchFaceStyle implements android.os.Parcelable {
- ctor public WatchFaceStyle(android.content.ComponentName component, int viewProtectionMode, int statusBarGravity, @ColorInt int accentColor, boolean showUnreadCountIndicator, boolean hideNotificationIndicator, boolean acceptsTapEvents, optional android.os.Bundle? compatBundle);
- method public int describeContents();
- method public final int getAccentColor();
- method public final boolean getAcceptsTapEvents();
- method public final android.os.Bundle? getCompatBundle();
- method public final android.content.ComponentName getComponent();
- method public final boolean getHideNotificationIndicator();
- method public final boolean getShowUnreadCountIndicator();
- method public final int getStatusBarGravity();
- method public final int getViewProtectionMode();
- method public void writeToParcel(android.os.Parcel dest, int flags);
- property public final int accentColor;
- property public final boolean acceptsTapEvents;
- property public final android.os.Bundle? compatBundle;
- property public final android.content.ComponentName component;
- property public final boolean hideNotificationIndicator;
- property public final boolean showUnreadCountIndicator;
- property public final int statusBarGravity;
- property public final int viewProtectionMode;
- field public static final android.os.Parcelable.Creator<android.support.wearable.watchface.WatchFaceStyle> CREATOR;
- field public static final android.support.wearable.watchface.WatchFaceStyle.Companion Companion;
- field public static final int DEFAULT_ACCENT_COLOR = -1; // 0xffffffff
- field public static final int PROTECT_HOTWORD_INDICATOR = 2; // 0x2
- field public static final int PROTECT_STATUS_BAR = 1; // 0x1
- field public static final int PROTECT_WHOLE_SCREEN = 4; // 0x4
- }
-
- public static final class WatchFaceStyle.Companion {
- }
-
-}
-
-package @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) android.support.wearable.watchface.accessibility {
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public class AccessibilityUtils {
- method public static android.support.wearable.complications.TimeDependentText generateContentDescription(android.content.Context, android.support.wearable.complications.ComplicationData);
- method public static android.support.wearable.complications.ComplicationText makeTimeAsComplicationText(android.content.Context);
- }
-
- @RequiresApi(android.os.Build.VERSION_CODES.KITKAT) @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public final class ContentDescriptionLabel implements android.os.Parcelable {
- ctor public ContentDescriptionLabel(android.graphics.Rect, android.support.wearable.complications.ComplicationTextTemplate);
- ctor public ContentDescriptionLabel(android.graphics.Rect, android.support.wearable.complications.ComplicationText);
- ctor public ContentDescriptionLabel(android.content.Context, android.graphics.Rect, android.support.wearable.complications.ComplicationData);
- ctor protected ContentDescriptionLabel(android.os.Parcel);
- method public int describeContents();
- method public android.graphics.Rect getBounds();
- method public android.app.PendingIntent? getTapAction();
- method public android.support.wearable.complications.TimeDependentText getText();
- method public void setTapAction(android.app.PendingIntent?);
- method public void writeToParcel(android.os.Parcel, int);
- field public static final android.os.Parcelable.Creator<android.support.wearable.watchface.accessibility.ContentDescriptionLabel!>! CREATOR;
- }
-
-}
-
package androidx.wear.watchface.control.data {
@RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) @androidx.versionedparcelable.VersionedParcelize public class ComplicationRenderParams implements android.os.Parcelable androidx.versionedparcelable.VersionedParcelable {
diff --git a/wear/wear-watchface-data/build.gradle b/wear/watchface/watchface-data/build.gradle
similarity index 91%
rename from wear/wear-watchface-data/build.gradle
rename to wear/watchface/watchface-data/build.gradle
index a3127f8..a361f00 100644
--- a/wear/wear-watchface-data/build.gradle
+++ b/wear/watchface/watchface-data/build.gradle
@@ -27,7 +27,7 @@
dependencies {
api("androidx.annotation:annotation:1.1.0")
api("androidx.versionedparcelable:versionedparcelable:1.1.0")
- api(project(":wear:wear-complications-data"))
+ api(project(":wear:watchface:watchface-complications-data"))
api(libs.kotlinStdlib)
implementation("androidx.core:core:1.1.0")
@@ -51,8 +51,7 @@
androidx {
name = "Android Wear Watchface Data"
publish = Publish.SNAPSHOT_AND_RELEASE
- mavenGroup = LibraryGroups.WEAR
- mavenVersion = LibraryVersions.WEAR_WATCHFACE_DATA
+ mavenGroup = LibraryGroups.WEAR_WATCHFACE
inceptionYear = "2020"
description = "Android Wear Watchface hidden AIDL implementaion details"
}
diff --git a/wear/wear-watchface-data/proguard-rules.pro b/wear/watchface/watchface-data/proguard-rules.pro
similarity index 100%
rename from wear/wear-watchface-data/proguard-rules.pro
rename to wear/watchface/watchface-data/proguard-rules.pro
diff --git a/wear/wear-watchface-data/src/main/AndroidManifest.xml b/wear/watchface/watchface-data/src/main/AndroidManifest.xml
similarity index 100%
rename from wear/wear-watchface-data/src/main/AndroidManifest.xml
rename to wear/watchface/watchface-data/src/main/AndroidManifest.xml
diff --git a/wear/wear-watchface-data/src/main/aidl/android/support/wearable/watchface/IWatchFaceService.aidl b/wear/watchface/watchface-data/src/main/aidl/android/support/wearable/watchface/IWatchFaceService.aidl
similarity index 100%
rename from wear/wear-watchface-data/src/main/aidl/android/support/wearable/watchface/IWatchFaceService.aidl
rename to wear/watchface/watchface-data/src/main/aidl/android/support/wearable/watchface/IWatchFaceService.aidl
diff --git a/wear/wear-watchface-data/src/main/aidl/android/support/wearable/watchface/WatchFaceStyle.aidl b/wear/watchface/watchface-data/src/main/aidl/android/support/wearable/watchface/WatchFaceStyle.aidl
similarity index 100%
rename from wear/wear-watchface-data/src/main/aidl/android/support/wearable/watchface/WatchFaceStyle.aidl
rename to wear/watchface/watchface-data/src/main/aidl/android/support/wearable/watchface/WatchFaceStyle.aidl
diff --git a/wear/wear-watchface-data/src/main/aidl/android/support/wearable/watchface/accessibility/ContentDescriptionLabel.aidl b/wear/watchface/watchface-data/src/main/aidl/android/support/wearable/watchface/accessibility/ContentDescriptionLabel.aidl
similarity index 100%
rename from wear/wear-watchface-data/src/main/aidl/android/support/wearable/watchface/accessibility/ContentDescriptionLabel.aidl
rename to wear/watchface/watchface-data/src/main/aidl/android/support/wearable/watchface/accessibility/ContentDescriptionLabel.aidl
diff --git a/wear/wear-watchface-data/src/main/aidl/androidx/wear/watchface/control/IHeadlessWatchFace.aidl b/wear/watchface/watchface-data/src/main/aidl/androidx/wear/watchface/control/IHeadlessWatchFace.aidl
similarity index 100%
rename from wear/wear-watchface-data/src/main/aidl/androidx/wear/watchface/control/IHeadlessWatchFace.aidl
rename to wear/watchface/watchface-data/src/main/aidl/androidx/wear/watchface/control/IHeadlessWatchFace.aidl
diff --git a/wear/wear-watchface-data/src/main/aidl/androidx/wear/watchface/control/IInteractiveWatchFace.aidl b/wear/watchface/watchface-data/src/main/aidl/androidx/wear/watchface/control/IInteractiveWatchFace.aidl
similarity index 100%
rename from wear/wear-watchface-data/src/main/aidl/androidx/wear/watchface/control/IInteractiveWatchFace.aidl
rename to wear/watchface/watchface-data/src/main/aidl/androidx/wear/watchface/control/IInteractiveWatchFace.aidl
diff --git a/wear/wear-watchface-data/src/main/aidl/androidx/wear/watchface/control/IPendingInteractiveWatchFace.aidl b/wear/watchface/watchface-data/src/main/aidl/androidx/wear/watchface/control/IPendingInteractiveWatchFace.aidl
similarity index 100%
rename from wear/wear-watchface-data/src/main/aidl/androidx/wear/watchface/control/IPendingInteractiveWatchFace.aidl
rename to wear/watchface/watchface-data/src/main/aidl/androidx/wear/watchface/control/IPendingInteractiveWatchFace.aidl
diff --git a/wear/wear-watchface-data/src/main/aidl/androidx/wear/watchface/control/IWatchFaceControlService.aidl b/wear/watchface/watchface-data/src/main/aidl/androidx/wear/watchface/control/IWatchFaceControlService.aidl
similarity index 100%
rename from wear/wear-watchface-data/src/main/aidl/androidx/wear/watchface/control/IWatchFaceControlService.aidl
rename to wear/watchface/watchface-data/src/main/aidl/androidx/wear/watchface/control/IWatchFaceControlService.aidl
diff --git a/wear/wear-watchface-data/src/main/aidl/androidx/wear/watchface/control/IWatchfaceReadyListener.aidl b/wear/watchface/watchface-data/src/main/aidl/androidx/wear/watchface/control/IWatchfaceReadyListener.aidl
similarity index 100%
rename from wear/wear-watchface-data/src/main/aidl/androidx/wear/watchface/control/IWatchfaceReadyListener.aidl
rename to wear/watchface/watchface-data/src/main/aidl/androidx/wear/watchface/control/IWatchfaceReadyListener.aidl
diff --git a/wear/wear-watchface-data/src/main/aidl/androidx/wear/watchface/control/data/ComplicationRenderParams.aidl b/wear/watchface/watchface-data/src/main/aidl/androidx/wear/watchface/control/data/ComplicationRenderParams.aidl
similarity index 100%
rename from wear/wear-watchface-data/src/main/aidl/androidx/wear/watchface/control/data/ComplicationRenderParams.aidl
rename to wear/watchface/watchface-data/src/main/aidl/androidx/wear/watchface/control/data/ComplicationRenderParams.aidl
diff --git a/wear/wear-watchface-data/src/main/aidl/androidx/wear/watchface/control/data/CrashInfoParcel.aidl b/wear/watchface/watchface-data/src/main/aidl/androidx/wear/watchface/control/data/CrashInfoParcel.aidl
similarity index 100%
rename from wear/wear-watchface-data/src/main/aidl/androidx/wear/watchface/control/data/CrashInfoParcel.aidl
rename to wear/watchface/watchface-data/src/main/aidl/androidx/wear/watchface/control/data/CrashInfoParcel.aidl
diff --git a/wear/wear-watchface-data/src/main/aidl/androidx/wear/watchface/control/data/DefaultProviderPoliciesParams.aidl b/wear/watchface/watchface-data/src/main/aidl/androidx/wear/watchface/control/data/DefaultProviderPoliciesParams.aidl
similarity index 100%
rename from wear/wear-watchface-data/src/main/aidl/androidx/wear/watchface/control/data/DefaultProviderPoliciesParams.aidl
rename to wear/watchface/watchface-data/src/main/aidl/androidx/wear/watchface/control/data/DefaultProviderPoliciesParams.aidl
diff --git a/wear/wear-watchface-data/src/main/aidl/androidx/wear/watchface/control/data/GetComplicationSlotMetadataParams.aidl b/wear/watchface/watchface-data/src/main/aidl/androidx/wear/watchface/control/data/GetComplicationSlotMetadataParams.aidl
similarity index 100%
rename from wear/wear-watchface-data/src/main/aidl/androidx/wear/watchface/control/data/GetComplicationSlotMetadataParams.aidl
rename to wear/watchface/watchface-data/src/main/aidl/androidx/wear/watchface/control/data/GetComplicationSlotMetadataParams.aidl
diff --git a/wear/wear-watchface-data/src/main/aidl/androidx/wear/watchface/control/data/GetUserStyleSchemaParams.aidl b/wear/watchface/watchface-data/src/main/aidl/androidx/wear/watchface/control/data/GetUserStyleSchemaParams.aidl
similarity index 100%
rename from wear/wear-watchface-data/src/main/aidl/androidx/wear/watchface/control/data/GetUserStyleSchemaParams.aidl
rename to wear/watchface/watchface-data/src/main/aidl/androidx/wear/watchface/control/data/GetUserStyleSchemaParams.aidl
diff --git a/wear/wear-watchface-data/src/main/aidl/androidx/wear/watchface/control/data/HeadlessWatchFaceInstanceParams.aidl b/wear/watchface/watchface-data/src/main/aidl/androidx/wear/watchface/control/data/HeadlessWatchFaceInstanceParams.aidl
similarity index 100%
rename from wear/wear-watchface-data/src/main/aidl/androidx/wear/watchface/control/data/HeadlessWatchFaceInstanceParams.aidl
rename to wear/watchface/watchface-data/src/main/aidl/androidx/wear/watchface/control/data/HeadlessWatchFaceInstanceParams.aidl
diff --git a/wear/wear-watchface-data/src/main/aidl/androidx/wear/watchface/control/data/IdTypeAndDefaultProviderPolicyWireFormat.aidl b/wear/watchface/watchface-data/src/main/aidl/androidx/wear/watchface/control/data/IdTypeAndDefaultProviderPolicyWireFormat.aidl
similarity index 100%
rename from wear/wear-watchface-data/src/main/aidl/androidx/wear/watchface/control/data/IdTypeAndDefaultProviderPolicyWireFormat.aidl
rename to wear/watchface/watchface-data/src/main/aidl/androidx/wear/watchface/control/data/IdTypeAndDefaultProviderPolicyWireFormat.aidl
diff --git a/wear/wear-watchface-data/src/main/aidl/androidx/wear/watchface/control/data/WallpaperInteractiveWatchFaceInstanceParams.aidl b/wear/watchface/watchface-data/src/main/aidl/androidx/wear/watchface/control/data/WallpaperInteractiveWatchFaceInstanceParams.aidl
similarity index 100%
rename from wear/wear-watchface-data/src/main/aidl/androidx/wear/watchface/control/data/WallpaperInteractiveWatchFaceInstanceParams.aidl
rename to wear/watchface/watchface-data/src/main/aidl/androidx/wear/watchface/control/data/WallpaperInteractiveWatchFaceInstanceParams.aidl
diff --git a/wear/wear-watchface-data/src/main/aidl/androidx/wear/watchface/control/data/WatchFaceRenderParams.aidl b/wear/watchface/watchface-data/src/main/aidl/androidx/wear/watchface/control/data/WatchFaceRenderParams.aidl
similarity index 100%
rename from wear/wear-watchface-data/src/main/aidl/androidx/wear/watchface/control/data/WatchFaceRenderParams.aidl
rename to wear/watchface/watchface-data/src/main/aidl/androidx/wear/watchface/control/data/WatchFaceRenderParams.aidl
diff --git a/wear/wear-watchface-data/src/main/aidl/androidx/wear/watchface/data/ComplicationSlotMetadataWireFormat.aidl b/wear/watchface/watchface-data/src/main/aidl/androidx/wear/watchface/data/ComplicationSlotMetadataWireFormat.aidl
similarity index 100%
rename from wear/wear-watchface-data/src/main/aidl/androidx/wear/watchface/data/ComplicationSlotMetadataWireFormat.aidl
rename to wear/watchface/watchface-data/src/main/aidl/androidx/wear/watchface/data/ComplicationSlotMetadataWireFormat.aidl
diff --git a/wear/wear-watchface-data/src/main/aidl/androidx/wear/watchface/data/ComplicationStateWireFormat.aidl b/wear/watchface/watchface-data/src/main/aidl/androidx/wear/watchface/data/ComplicationStateWireFormat.aidl
similarity index 100%
rename from wear/wear-watchface-data/src/main/aidl/androidx/wear/watchface/data/ComplicationStateWireFormat.aidl
rename to wear/watchface/watchface-data/src/main/aidl/androidx/wear/watchface/data/ComplicationStateWireFormat.aidl
diff --git a/wear/wear-watchface-data/src/main/aidl/androidx/wear/watchface/data/IdAndComplicationDataWireFormat.aidl b/wear/watchface/watchface-data/src/main/aidl/androidx/wear/watchface/data/IdAndComplicationDataWireFormat.aidl
similarity index 100%
rename from wear/wear-watchface-data/src/main/aidl/androidx/wear/watchface/data/IdAndComplicationDataWireFormat.aidl
rename to wear/watchface/watchface-data/src/main/aidl/androidx/wear/watchface/data/IdAndComplicationDataWireFormat.aidl
diff --git a/wear/wear-watchface-data/src/main/aidl/androidx/wear/watchface/data/IdAndComplicationStateWireFormat.aidl b/wear/watchface/watchface-data/src/main/aidl/androidx/wear/watchface/data/IdAndComplicationStateWireFormat.aidl
similarity index 100%
rename from wear/wear-watchface-data/src/main/aidl/androidx/wear/watchface/data/IdAndComplicationStateWireFormat.aidl
rename to wear/watchface/watchface-data/src/main/aidl/androidx/wear/watchface/data/IdAndComplicationStateWireFormat.aidl
diff --git a/wear/wear-watchface-data/src/main/aidl/androidx/wear/watchface/data/ImmutableSystemState.aidl b/wear/watchface/watchface-data/src/main/aidl/androidx/wear/watchface/data/ImmutableSystemState.aidl
similarity index 100%
rename from wear/wear-watchface-data/src/main/aidl/androidx/wear/watchface/data/ImmutableSystemState.aidl
rename to wear/watchface/watchface-data/src/main/aidl/androidx/wear/watchface/data/ImmutableSystemState.aidl
diff --git a/wear/wear-watchface-data/src/main/aidl/androidx/wear/watchface/data/RenderParametersWireFormat.aidl b/wear/watchface/watchface-data/src/main/aidl/androidx/wear/watchface/data/RenderParametersWireFormat.aidl
similarity index 100%
rename from wear/wear-watchface-data/src/main/aidl/androidx/wear/watchface/data/RenderParametersWireFormat.aidl
rename to wear/watchface/watchface-data/src/main/aidl/androidx/wear/watchface/data/RenderParametersWireFormat.aidl
diff --git a/wear/wear-watchface-data/src/main/aidl/androidx/wear/watchface/data/WatchUiState.aidl b/wear/watchface/watchface-data/src/main/aidl/androidx/wear/watchface/data/WatchUiState.aidl
similarity index 100%
rename from wear/wear-watchface-data/src/main/aidl/androidx/wear/watchface/data/WatchUiState.aidl
rename to wear/watchface/watchface-data/src/main/aidl/androidx/wear/watchface/data/WatchUiState.aidl
diff --git a/wear/wear-watchface-data/src/main/aidl/androidx/wear/watchface/editor/IEditorObserver.aidl b/wear/watchface/watchface-data/src/main/aidl/androidx/wear/watchface/editor/IEditorObserver.aidl
similarity index 100%
rename from wear/wear-watchface-data/src/main/aidl/androidx/wear/watchface/editor/IEditorObserver.aidl
rename to wear/watchface/watchface-data/src/main/aidl/androidx/wear/watchface/editor/IEditorObserver.aidl
diff --git a/wear/wear-watchface-data/src/main/aidl/androidx/wear/watchface/editor/IEditorService.aidl b/wear/watchface/watchface-data/src/main/aidl/androidx/wear/watchface/editor/IEditorService.aidl
similarity index 100%
rename from wear/wear-watchface-data/src/main/aidl/androidx/wear/watchface/editor/IEditorService.aidl
rename to wear/watchface/watchface-data/src/main/aidl/androidx/wear/watchface/editor/IEditorService.aidl
diff --git a/wear/wear-watchface-data/src/main/aidl/androidx/wear/watchface/editor/data/EditorStateWireFormat.aidl b/wear/watchface/watchface-data/src/main/aidl/androidx/wear/watchface/editor/data/EditorStateWireFormat.aidl
similarity index 100%
rename from wear/wear-watchface-data/src/main/aidl/androidx/wear/watchface/editor/data/EditorStateWireFormat.aidl
rename to wear/watchface/watchface-data/src/main/aidl/androidx/wear/watchface/editor/data/EditorStateWireFormat.aidl
diff --git a/wear/wear-watchface-data/src/main/aidl/androidx/wear/watchface/style/data/UserStyleSchemaWireFormat.aidl b/wear/watchface/watchface-data/src/main/aidl/androidx/wear/watchface/style/data/UserStyleSchemaWireFormat.aidl
similarity index 100%
rename from wear/wear-watchface-data/src/main/aidl/androidx/wear/watchface/style/data/UserStyleSchemaWireFormat.aidl
rename to wear/watchface/watchface-data/src/main/aidl/androidx/wear/watchface/style/data/UserStyleSchemaWireFormat.aidl
diff --git a/wear/wear-watchface-data/src/main/aidl/androidx/wear/watchface/style/data/UserStyleWireFormat.aidl b/wear/watchface/watchface-data/src/main/aidl/androidx/wear/watchface/style/data/UserStyleWireFormat.aidl
similarity index 100%
rename from wear/wear-watchface-data/src/main/aidl/androidx/wear/watchface/style/data/UserStyleWireFormat.aidl
rename to wear/watchface/watchface-data/src/main/aidl/androidx/wear/watchface/style/data/UserStyleWireFormat.aidl
diff --git a/wear/wear-watchface-data/src/main/java/android/support/wearable/watchface/Constants.kt b/wear/watchface/watchface-data/src/main/java/android/support/wearable/watchface/Constants.kt
similarity index 100%
rename from wear/wear-watchface-data/src/main/java/android/support/wearable/watchface/Constants.kt
rename to wear/watchface/watchface-data/src/main/java/android/support/wearable/watchface/Constants.kt
diff --git a/wear/wear-watchface-data/src/main/java/android/support/wearable/watchface/SharedMemoryImage.kt b/wear/watchface/watchface-data/src/main/java/android/support/wearable/watchface/SharedMemoryImage.kt
similarity index 98%
rename from wear/wear-watchface-data/src/main/java/android/support/wearable/watchface/SharedMemoryImage.kt
rename to wear/watchface/watchface-data/src/main/java/android/support/wearable/watchface/SharedMemoryImage.kt
index b1c6bfc..2def683 100644
--- a/wear/wear-watchface-data/src/main/java/android/support/wearable/watchface/SharedMemoryImage.kt
+++ b/wear/watchface/watchface-data/src/main/java/android/support/wearable/watchface/SharedMemoryImage.kt
@@ -21,7 +21,7 @@
import android.os.SharedMemory
import androidx.annotation.RequiresApi
import androidx.annotation.RestrictTo
-import androidx.wear.utility.TraceEvent
+import androidx.wear.watchface.utility.TraceEvent
import java.nio.ByteBuffer
/**
diff --git a/wear/wear-watchface-data/src/main/java/android/support/wearable/watchface/WatchFaceStyle.kt b/wear/watchface/watchface-data/src/main/java/android/support/wearable/watchface/WatchFaceStyle.kt
similarity index 100%
rename from wear/wear-watchface-data/src/main/java/android/support/wearable/watchface/WatchFaceStyle.kt
rename to wear/watchface/watchface-data/src/main/java/android/support/wearable/watchface/WatchFaceStyle.kt
diff --git a/wear/wear-watchface-data/src/main/java/android/support/wearable/watchface/accessibility/AccessibilityUtils.java b/wear/watchface/watchface-data/src/main/java/android/support/wearable/watchface/accessibility/AccessibilityUtils.java
similarity index 100%
rename from wear/wear-watchface-data/src/main/java/android/support/wearable/watchface/accessibility/AccessibilityUtils.java
rename to wear/watchface/watchface-data/src/main/java/android/support/wearable/watchface/accessibility/AccessibilityUtils.java
diff --git a/wear/wear-watchface-data/src/main/java/android/support/wearable/watchface/accessibility/ContentDescriptionLabel.java b/wear/watchface/watchface-data/src/main/java/android/support/wearable/watchface/accessibility/ContentDescriptionLabel.java
similarity index 100%
rename from wear/wear-watchface-data/src/main/java/android/support/wearable/watchface/accessibility/ContentDescriptionLabel.java
rename to wear/watchface/watchface-data/src/main/java/android/support/wearable/watchface/accessibility/ContentDescriptionLabel.java
diff --git a/wear/wear-watchface-data/src/main/java/android/support/wearable/watchface/accessibility/package-info.java b/wear/watchface/watchface-data/src/main/java/android/support/wearable/watchface/accessibility/package-info.java
similarity index 100%
rename from wear/wear-watchface-data/src/main/java/android/support/wearable/watchface/accessibility/package-info.java
rename to wear/watchface/watchface-data/src/main/java/android/support/wearable/watchface/accessibility/package-info.java
diff --git a/wear/wear-watchface-data/src/main/java/android/support/wearable/watchface/package-info.java b/wear/watchface/watchface-data/src/main/java/android/support/wearable/watchface/package-info.java
similarity index 100%
rename from wear/wear-watchface-data/src/main/java/android/support/wearable/watchface/package-info.java
rename to wear/watchface/watchface-data/src/main/java/android/support/wearable/watchface/package-info.java
diff --git a/wear/wear-watchface-data/src/main/java/androidx/wear/watchface/control/data/ComplicationRenderParams.java b/wear/watchface/watchface-data/src/main/java/androidx/wear/watchface/control/data/ComplicationRenderParams.java
similarity index 100%
rename from wear/wear-watchface-data/src/main/java/androidx/wear/watchface/control/data/ComplicationRenderParams.java
rename to wear/watchface/watchface-data/src/main/java/androidx/wear/watchface/control/data/ComplicationRenderParams.java
diff --git a/wear/wear-watchface-data/src/main/java/androidx/wear/watchface/control/data/CrashInfoParcel.java b/wear/watchface/watchface-data/src/main/java/androidx/wear/watchface/control/data/CrashInfoParcel.java
similarity index 100%
rename from wear/wear-watchface-data/src/main/java/androidx/wear/watchface/control/data/CrashInfoParcel.java
rename to wear/watchface/watchface-data/src/main/java/androidx/wear/watchface/control/data/CrashInfoParcel.java
diff --git a/wear/wear-watchface-data/src/main/java/androidx/wear/watchface/control/data/DefaultProviderPoliciesParams.java b/wear/watchface/watchface-data/src/main/java/androidx/wear/watchface/control/data/DefaultProviderPoliciesParams.java
similarity index 100%
rename from wear/wear-watchface-data/src/main/java/androidx/wear/watchface/control/data/DefaultProviderPoliciesParams.java
rename to wear/watchface/watchface-data/src/main/java/androidx/wear/watchface/control/data/DefaultProviderPoliciesParams.java
diff --git a/wear/wear-watchface-data/src/main/java/androidx/wear/watchface/control/data/GetComplicationSlotMetadataParams.java b/wear/watchface/watchface-data/src/main/java/androidx/wear/watchface/control/data/GetComplicationSlotMetadataParams.java
similarity index 100%
rename from wear/wear-watchface-data/src/main/java/androidx/wear/watchface/control/data/GetComplicationSlotMetadataParams.java
rename to wear/watchface/watchface-data/src/main/java/androidx/wear/watchface/control/data/GetComplicationSlotMetadataParams.java
diff --git a/wear/wear-watchface-data/src/main/java/androidx/wear/watchface/control/data/GetUserStyleSchemaParams.java b/wear/watchface/watchface-data/src/main/java/androidx/wear/watchface/control/data/GetUserStyleSchemaParams.java
similarity index 100%
rename from wear/wear-watchface-data/src/main/java/androidx/wear/watchface/control/data/GetUserStyleSchemaParams.java
rename to wear/watchface/watchface-data/src/main/java/androidx/wear/watchface/control/data/GetUserStyleSchemaParams.java
diff --git a/wear/wear-watchface-data/src/main/java/androidx/wear/watchface/control/data/HeadlessWatchFaceInstanceParams.java b/wear/watchface/watchface-data/src/main/java/androidx/wear/watchface/control/data/HeadlessWatchFaceInstanceParams.java
similarity index 100%
rename from wear/wear-watchface-data/src/main/java/androidx/wear/watchface/control/data/HeadlessWatchFaceInstanceParams.java
rename to wear/watchface/watchface-data/src/main/java/androidx/wear/watchface/control/data/HeadlessWatchFaceInstanceParams.java
diff --git a/wear/wear-watchface-data/src/main/java/androidx/wear/watchface/control/data/IdTypeAndDefaultProviderPolicyWireFormat.java b/wear/watchface/watchface-data/src/main/java/androidx/wear/watchface/control/data/IdTypeAndDefaultProviderPolicyWireFormat.java
similarity index 100%
rename from wear/wear-watchface-data/src/main/java/androidx/wear/watchface/control/data/IdTypeAndDefaultProviderPolicyWireFormat.java
rename to wear/watchface/watchface-data/src/main/java/androidx/wear/watchface/control/data/IdTypeAndDefaultProviderPolicyWireFormat.java
diff --git a/wear/wear-watchface-data/src/main/java/androidx/wear/watchface/control/data/WallpaperInteractiveWatchFaceInstanceParams.java b/wear/watchface/watchface-data/src/main/java/androidx/wear/watchface/control/data/WallpaperInteractiveWatchFaceInstanceParams.java
similarity index 100%
rename from wear/wear-watchface-data/src/main/java/androidx/wear/watchface/control/data/WallpaperInteractiveWatchFaceInstanceParams.java
rename to wear/watchface/watchface-data/src/main/java/androidx/wear/watchface/control/data/WallpaperInteractiveWatchFaceInstanceParams.java
diff --git a/wear/wear-watchface-data/src/main/java/androidx/wear/watchface/control/data/WatchFaceRenderParams.java b/wear/watchface/watchface-data/src/main/java/androidx/wear/watchface/control/data/WatchFaceRenderParams.java
similarity index 100%
rename from wear/wear-watchface-data/src/main/java/androidx/wear/watchface/control/data/WatchFaceRenderParams.java
rename to wear/watchface/watchface-data/src/main/java/androidx/wear/watchface/control/data/WatchFaceRenderParams.java
diff --git a/wear/wear-watchface-data/src/main/java/androidx/wear/watchface/data/ComplicationSlotMetadataWireFormat.java b/wear/watchface/watchface-data/src/main/java/androidx/wear/watchface/data/ComplicationSlotMetadataWireFormat.java
similarity index 100%
rename from wear/wear-watchface-data/src/main/java/androidx/wear/watchface/data/ComplicationSlotMetadataWireFormat.java
rename to wear/watchface/watchface-data/src/main/java/androidx/wear/watchface/data/ComplicationSlotMetadataWireFormat.java
diff --git a/wear/wear-watchface-data/src/main/java/androidx/wear/watchface/data/ComplicationStateWireFormat.java b/wear/watchface/watchface-data/src/main/java/androidx/wear/watchface/data/ComplicationStateWireFormat.java
similarity index 100%
rename from wear/wear-watchface-data/src/main/java/androidx/wear/watchface/data/ComplicationStateWireFormat.java
rename to wear/watchface/watchface-data/src/main/java/androidx/wear/watchface/data/ComplicationStateWireFormat.java
diff --git a/wear/wear-watchface-data/src/main/java/androidx/wear/watchface/data/DeviceConfig.java b/wear/watchface/watchface-data/src/main/java/androidx/wear/watchface/data/DeviceConfig.java
similarity index 100%
rename from wear/wear-watchface-data/src/main/java/androidx/wear/watchface/data/DeviceConfig.java
rename to wear/watchface/watchface-data/src/main/java/androidx/wear/watchface/data/DeviceConfig.java
diff --git a/wear/wear-watchface-data/src/main/java/androidx/wear/watchface/data/IdAndComplicationDataWireFormat.java b/wear/watchface/watchface-data/src/main/java/androidx/wear/watchface/data/IdAndComplicationDataWireFormat.java
similarity index 100%
rename from wear/wear-watchface-data/src/main/java/androidx/wear/watchface/data/IdAndComplicationDataWireFormat.java
rename to wear/watchface/watchface-data/src/main/java/androidx/wear/watchface/data/IdAndComplicationDataWireFormat.java
diff --git a/wear/wear-watchface-data/src/main/java/androidx/wear/watchface/data/IdAndComplicationStateWireFormat.java b/wear/watchface/watchface-data/src/main/java/androidx/wear/watchface/data/IdAndComplicationStateWireFormat.java
similarity index 100%
rename from wear/wear-watchface-data/src/main/java/androidx/wear/watchface/data/IdAndComplicationStateWireFormat.java
rename to wear/watchface/watchface-data/src/main/java/androidx/wear/watchface/data/IdAndComplicationStateWireFormat.java
diff --git a/wear/wear-watchface-data/src/main/java/androidx/wear/watchface/data/IdAndTapEventWireFormat.java b/wear/watchface/watchface-data/src/main/java/androidx/wear/watchface/data/IdAndTapEventWireFormat.java
similarity index 100%
rename from wear/wear-watchface-data/src/main/java/androidx/wear/watchface/data/IdAndTapEventWireFormat.java
rename to wear/watchface/watchface-data/src/main/java/androidx/wear/watchface/data/IdAndTapEventWireFormat.java
diff --git a/wear/wear-watchface-data/src/main/java/androidx/wear/watchface/data/LayerParameterWireFormat.java b/wear/watchface/watchface-data/src/main/java/androidx/wear/watchface/data/LayerParameterWireFormat.java
similarity index 100%
rename from wear/wear-watchface-data/src/main/java/androidx/wear/watchface/data/LayerParameterWireFormat.java
rename to wear/watchface/watchface-data/src/main/java/androidx/wear/watchface/data/LayerParameterWireFormat.java
diff --git a/wear/wear-watchface-data/src/main/java/androidx/wear/watchface/data/RenderParametersWireFormat.java b/wear/watchface/watchface-data/src/main/java/androidx/wear/watchface/data/RenderParametersWireFormat.java
similarity index 100%
rename from wear/wear-watchface-data/src/main/java/androidx/wear/watchface/data/RenderParametersWireFormat.java
rename to wear/watchface/watchface-data/src/main/java/androidx/wear/watchface/data/RenderParametersWireFormat.java
diff --git a/wear/wear-watchface-data/src/main/java/androidx/wear/watchface/data/WatchUiState.java b/wear/watchface/watchface-data/src/main/java/androidx/wear/watchface/data/WatchUiState.java
similarity index 100%
rename from wear/wear-watchface-data/src/main/java/androidx/wear/watchface/data/WatchUiState.java
rename to wear/watchface/watchface-data/src/main/java/androidx/wear/watchface/data/WatchUiState.java
diff --git a/wear/wear-watchface-data/src/main/java/androidx/wear/watchface/editor/data/EditorStateWireFormat.java b/wear/watchface/watchface-data/src/main/java/androidx/wear/watchface/editor/data/EditorStateWireFormat.java
similarity index 100%
rename from wear/wear-watchface-data/src/main/java/androidx/wear/watchface/editor/data/EditorStateWireFormat.java
rename to wear/watchface/watchface-data/src/main/java/androidx/wear/watchface/editor/data/EditorStateWireFormat.java
diff --git a/wear/wear-watchface-data/src/main/java/androidx/wear/watchface/style/data/BooleanOptionWireFormat.java b/wear/watchface/watchface-data/src/main/java/androidx/wear/watchface/style/data/BooleanOptionWireFormat.java
similarity index 100%
rename from wear/wear-watchface-data/src/main/java/androidx/wear/watchface/style/data/BooleanOptionWireFormat.java
rename to wear/watchface/watchface-data/src/main/java/androidx/wear/watchface/style/data/BooleanOptionWireFormat.java
diff --git a/wear/wear-watchface-data/src/main/java/androidx/wear/watchface/style/data/BooleanUserStyleSettingWireFormat.java b/wear/watchface/watchface-data/src/main/java/androidx/wear/watchface/style/data/BooleanUserStyleSettingWireFormat.java
similarity index 100%
rename from wear/wear-watchface-data/src/main/java/androidx/wear/watchface/style/data/BooleanUserStyleSettingWireFormat.java
rename to wear/watchface/watchface-data/src/main/java/androidx/wear/watchface/style/data/BooleanUserStyleSettingWireFormat.java
diff --git a/wear/wear-watchface-data/src/main/java/androidx/wear/watchface/style/data/ComplicationOverlayWireFormat.java b/wear/watchface/watchface-data/src/main/java/androidx/wear/watchface/style/data/ComplicationOverlayWireFormat.java
similarity index 100%
rename from wear/wear-watchface-data/src/main/java/androidx/wear/watchface/style/data/ComplicationOverlayWireFormat.java
rename to wear/watchface/watchface-data/src/main/java/androidx/wear/watchface/style/data/ComplicationOverlayWireFormat.java
diff --git a/wear/wear-watchface-data/src/main/java/androidx/wear/watchface/style/data/ComplicationsOptionWireFormat.java b/wear/watchface/watchface-data/src/main/java/androidx/wear/watchface/style/data/ComplicationsOptionWireFormat.java
similarity index 100%
rename from wear/wear-watchface-data/src/main/java/androidx/wear/watchface/style/data/ComplicationsOptionWireFormat.java
rename to wear/watchface/watchface-data/src/main/java/androidx/wear/watchface/style/data/ComplicationsOptionWireFormat.java
diff --git a/wear/wear-watchface-data/src/main/java/androidx/wear/watchface/style/data/ComplicationsUserStyleSettingWireFormat.java b/wear/watchface/watchface-data/src/main/java/androidx/wear/watchface/style/data/ComplicationsUserStyleSettingWireFormat.java
similarity index 100%
rename from wear/wear-watchface-data/src/main/java/androidx/wear/watchface/style/data/ComplicationsUserStyleSettingWireFormat.java
rename to wear/watchface/watchface-data/src/main/java/androidx/wear/watchface/style/data/ComplicationsUserStyleSettingWireFormat.java
diff --git a/wear/wear-watchface-data/src/main/java/androidx/wear/watchface/style/data/CustomValueOptionWireFormat.java b/wear/watchface/watchface-data/src/main/java/androidx/wear/watchface/style/data/CustomValueOptionWireFormat.java
similarity index 100%
rename from wear/wear-watchface-data/src/main/java/androidx/wear/watchface/style/data/CustomValueOptionWireFormat.java
rename to wear/watchface/watchface-data/src/main/java/androidx/wear/watchface/style/data/CustomValueOptionWireFormat.java
diff --git a/wear/wear-watchface-data/src/main/java/androidx/wear/watchface/style/data/CustomValueUserStyleSettingWireFormat.java b/wear/watchface/watchface-data/src/main/java/androidx/wear/watchface/style/data/CustomValueUserStyleSettingWireFormat.java
similarity index 100%
rename from wear/wear-watchface-data/src/main/java/androidx/wear/watchface/style/data/CustomValueUserStyleSettingWireFormat.java
rename to wear/watchface/watchface-data/src/main/java/androidx/wear/watchface/style/data/CustomValueUserStyleSettingWireFormat.java
diff --git a/wear/wear-watchface-data/src/main/java/androidx/wear/watchface/style/data/DoubleRangeOptionWireFormat.java b/wear/watchface/watchface-data/src/main/java/androidx/wear/watchface/style/data/DoubleRangeOptionWireFormat.java
similarity index 100%
rename from wear/wear-watchface-data/src/main/java/androidx/wear/watchface/style/data/DoubleRangeOptionWireFormat.java
rename to wear/watchface/watchface-data/src/main/java/androidx/wear/watchface/style/data/DoubleRangeOptionWireFormat.java
diff --git a/wear/wear-watchface-data/src/main/java/androidx/wear/watchface/style/data/DoubleRangeUserStyleSettingWireFormat.java b/wear/watchface/watchface-data/src/main/java/androidx/wear/watchface/style/data/DoubleRangeUserStyleSettingWireFormat.java
similarity index 100%
rename from wear/wear-watchface-data/src/main/java/androidx/wear/watchface/style/data/DoubleRangeUserStyleSettingWireFormat.java
rename to wear/watchface/watchface-data/src/main/java/androidx/wear/watchface/style/data/DoubleRangeUserStyleSettingWireFormat.java
diff --git a/wear/wear-watchface-data/src/main/java/androidx/wear/watchface/style/data/ListOptionWireFormat.java b/wear/watchface/watchface-data/src/main/java/androidx/wear/watchface/style/data/ListOptionWireFormat.java
similarity index 100%
rename from wear/wear-watchface-data/src/main/java/androidx/wear/watchface/style/data/ListOptionWireFormat.java
rename to wear/watchface/watchface-data/src/main/java/androidx/wear/watchface/style/data/ListOptionWireFormat.java
diff --git a/wear/wear-watchface-data/src/main/java/androidx/wear/watchface/style/data/ListUserStyleSettingWireFormat.java b/wear/watchface/watchface-data/src/main/java/androidx/wear/watchface/style/data/ListUserStyleSettingWireFormat.java
similarity index 100%
rename from wear/wear-watchface-data/src/main/java/androidx/wear/watchface/style/data/ListUserStyleSettingWireFormat.java
rename to wear/watchface/watchface-data/src/main/java/androidx/wear/watchface/style/data/ListUserStyleSettingWireFormat.java
diff --git a/wear/wear-watchface-data/src/main/java/androidx/wear/watchface/style/data/LongRangeOptionWireFormat.java b/wear/watchface/watchface-data/src/main/java/androidx/wear/watchface/style/data/LongRangeOptionWireFormat.java
similarity index 100%
rename from wear/wear-watchface-data/src/main/java/androidx/wear/watchface/style/data/LongRangeOptionWireFormat.java
rename to wear/watchface/watchface-data/src/main/java/androidx/wear/watchface/style/data/LongRangeOptionWireFormat.java
diff --git a/wear/wear-watchface-data/src/main/java/androidx/wear/watchface/style/data/LongRangeUserStyleSettingWireFormat.java b/wear/watchface/watchface-data/src/main/java/androidx/wear/watchface/style/data/LongRangeUserStyleSettingWireFormat.java
similarity index 100%
rename from wear/wear-watchface-data/src/main/java/androidx/wear/watchface/style/data/LongRangeUserStyleSettingWireFormat.java
rename to wear/watchface/watchface-data/src/main/java/androidx/wear/watchface/style/data/LongRangeUserStyleSettingWireFormat.java
diff --git a/wear/wear-watchface-data/src/main/java/androidx/wear/watchface/style/data/OptionWireFormat.java b/wear/watchface/watchface-data/src/main/java/androidx/wear/watchface/style/data/OptionWireFormat.java
similarity index 100%
rename from wear/wear-watchface-data/src/main/java/androidx/wear/watchface/style/data/OptionWireFormat.java
rename to wear/watchface/watchface-data/src/main/java/androidx/wear/watchface/style/data/OptionWireFormat.java
diff --git a/wear/wear-watchface-data/src/main/java/androidx/wear/watchface/style/data/UserStyleSchemaWireFormat.java b/wear/watchface/watchface-data/src/main/java/androidx/wear/watchface/style/data/UserStyleSchemaWireFormat.java
similarity index 100%
rename from wear/wear-watchface-data/src/main/java/androidx/wear/watchface/style/data/UserStyleSchemaWireFormat.java
rename to wear/watchface/watchface-data/src/main/java/androidx/wear/watchface/style/data/UserStyleSchemaWireFormat.java
diff --git a/wear/wear-watchface-data/src/main/java/androidx/wear/watchface/style/data/UserStyleSettingWireFormat.java b/wear/watchface/watchface-data/src/main/java/androidx/wear/watchface/style/data/UserStyleSettingWireFormat.java
similarity index 100%
rename from wear/wear-watchface-data/src/main/java/androidx/wear/watchface/style/data/UserStyleSettingWireFormat.java
rename to wear/watchface/watchface-data/src/main/java/androidx/wear/watchface/style/data/UserStyleSettingWireFormat.java
diff --git a/wear/wear-watchface-data/src/main/java/androidx/wear/watchface/style/data/UserStyleWireFormat.java b/wear/watchface/watchface-data/src/main/java/androidx/wear/watchface/style/data/UserStyleWireFormat.java
similarity index 100%
rename from wear/wear-watchface-data/src/main/java/androidx/wear/watchface/style/data/UserStyleWireFormat.java
rename to wear/watchface/watchface-data/src/main/java/androidx/wear/watchface/style/data/UserStyleWireFormat.java
diff --git a/wear/wear-watchface-data/src/main/res/values-af/accessibility_strings.xml b/wear/watchface/watchface-data/src/main/res/values-af/accessibility_strings.xml
similarity index 100%
rename from wear/wear-watchface-data/src/main/res/values-af/accessibility_strings.xml
rename to wear/watchface/watchface-data/src/main/res/values-af/accessibility_strings.xml
diff --git a/wear/wear-watchface-data/src/main/res/values-am/accessibility_strings.xml b/wear/watchface/watchface-data/src/main/res/values-am/accessibility_strings.xml
similarity index 100%
rename from wear/wear-watchface-data/src/main/res/values-am/accessibility_strings.xml
rename to wear/watchface/watchface-data/src/main/res/values-am/accessibility_strings.xml
diff --git a/wear/wear-watchface-data/src/main/res/values-ar/accessibility_strings.xml b/wear/watchface/watchface-data/src/main/res/values-ar/accessibility_strings.xml
similarity index 100%
rename from wear/wear-watchface-data/src/main/res/values-ar/accessibility_strings.xml
rename to wear/watchface/watchface-data/src/main/res/values-ar/accessibility_strings.xml
diff --git a/wear/wear-watchface-data/src/main/res/values-as/accessibility_strings.xml b/wear/watchface/watchface-data/src/main/res/values-as/accessibility_strings.xml
similarity index 100%
rename from wear/wear-watchface-data/src/main/res/values-as/accessibility_strings.xml
rename to wear/watchface/watchface-data/src/main/res/values-as/accessibility_strings.xml
diff --git a/wear/wear-watchface-data/src/main/res/values-az/accessibility_strings.xml b/wear/watchface/watchface-data/src/main/res/values-az/accessibility_strings.xml
similarity index 100%
rename from wear/wear-watchface-data/src/main/res/values-az/accessibility_strings.xml
rename to wear/watchface/watchface-data/src/main/res/values-az/accessibility_strings.xml
diff --git a/wear/wear-watchface-data/src/main/res/values-b+sr+Latn/accessibility_strings.xml b/wear/watchface/watchface-data/src/main/res/values-b+sr+Latn/accessibility_strings.xml
similarity index 100%
rename from wear/wear-watchface-data/src/main/res/values-b+sr+Latn/accessibility_strings.xml
rename to wear/watchface/watchface-data/src/main/res/values-b+sr+Latn/accessibility_strings.xml
diff --git a/wear/wear-watchface-data/src/main/res/values-be/accessibility_strings.xml b/wear/watchface/watchface-data/src/main/res/values-be/accessibility_strings.xml
similarity index 100%
rename from wear/wear-watchface-data/src/main/res/values-be/accessibility_strings.xml
rename to wear/watchface/watchface-data/src/main/res/values-be/accessibility_strings.xml
diff --git a/wear/wear-watchface-data/src/main/res/values-bg/accessibility_strings.xml b/wear/watchface/watchface-data/src/main/res/values-bg/accessibility_strings.xml
similarity index 100%
rename from wear/wear-watchface-data/src/main/res/values-bg/accessibility_strings.xml
rename to wear/watchface/watchface-data/src/main/res/values-bg/accessibility_strings.xml
diff --git a/wear/wear-watchface-data/src/main/res/values-bn/accessibility_strings.xml b/wear/watchface/watchface-data/src/main/res/values-bn/accessibility_strings.xml
similarity index 100%
rename from wear/wear-watchface-data/src/main/res/values-bn/accessibility_strings.xml
rename to wear/watchface/watchface-data/src/main/res/values-bn/accessibility_strings.xml
diff --git a/wear/wear-watchface-data/src/main/res/values-bs/accessibility_strings.xml b/wear/watchface/watchface-data/src/main/res/values-bs/accessibility_strings.xml
similarity index 100%
rename from wear/wear-watchface-data/src/main/res/values-bs/accessibility_strings.xml
rename to wear/watchface/watchface-data/src/main/res/values-bs/accessibility_strings.xml
diff --git a/wear/wear-watchface-data/src/main/res/values-ca/accessibility_strings.xml b/wear/watchface/watchface-data/src/main/res/values-ca/accessibility_strings.xml
similarity index 100%
rename from wear/wear-watchface-data/src/main/res/values-ca/accessibility_strings.xml
rename to wear/watchface/watchface-data/src/main/res/values-ca/accessibility_strings.xml
diff --git a/wear/wear-watchface-data/src/main/res/values-cs/accessibility_strings.xml b/wear/watchface/watchface-data/src/main/res/values-cs/accessibility_strings.xml
similarity index 100%
rename from wear/wear-watchface-data/src/main/res/values-cs/accessibility_strings.xml
rename to wear/watchface/watchface-data/src/main/res/values-cs/accessibility_strings.xml
diff --git a/wear/wear-watchface-data/src/main/res/values-da/accessibility_strings.xml b/wear/watchface/watchface-data/src/main/res/values-da/accessibility_strings.xml
similarity index 100%
rename from wear/wear-watchface-data/src/main/res/values-da/accessibility_strings.xml
rename to wear/watchface/watchface-data/src/main/res/values-da/accessibility_strings.xml
diff --git a/wear/wear-watchface-data/src/main/res/values-de/accessibility_strings.xml b/wear/watchface/watchface-data/src/main/res/values-de/accessibility_strings.xml
similarity index 100%
rename from wear/wear-watchface-data/src/main/res/values-de/accessibility_strings.xml
rename to wear/watchface/watchface-data/src/main/res/values-de/accessibility_strings.xml
diff --git a/wear/wear-watchface-data/src/main/res/values-el/accessibility_strings.xml b/wear/watchface/watchface-data/src/main/res/values-el/accessibility_strings.xml
similarity index 100%
rename from wear/wear-watchface-data/src/main/res/values-el/accessibility_strings.xml
rename to wear/watchface/watchface-data/src/main/res/values-el/accessibility_strings.xml
diff --git a/wear/wear-watchface-data/src/main/res/values-en-rAU/accessibility_strings.xml b/wear/watchface/watchface-data/src/main/res/values-en-rAU/accessibility_strings.xml
similarity index 100%
rename from wear/wear-watchface-data/src/main/res/values-en-rAU/accessibility_strings.xml
rename to wear/watchface/watchface-data/src/main/res/values-en-rAU/accessibility_strings.xml
diff --git a/wear/wear-watchface-data/src/main/res/values-en-rCA/accessibility_strings.xml b/wear/watchface/watchface-data/src/main/res/values-en-rCA/accessibility_strings.xml
similarity index 100%
rename from wear/wear-watchface-data/src/main/res/values-en-rCA/accessibility_strings.xml
rename to wear/watchface/watchface-data/src/main/res/values-en-rCA/accessibility_strings.xml
diff --git a/wear/wear-watchface-data/src/main/res/values-en-rGB/accessibility_strings.xml b/wear/watchface/watchface-data/src/main/res/values-en-rGB/accessibility_strings.xml
similarity index 100%
rename from wear/wear-watchface-data/src/main/res/values-en-rGB/accessibility_strings.xml
rename to wear/watchface/watchface-data/src/main/res/values-en-rGB/accessibility_strings.xml
diff --git a/wear/wear-watchface-data/src/main/res/values-en-rIN/accessibility_strings.xml b/wear/watchface/watchface-data/src/main/res/values-en-rIN/accessibility_strings.xml
similarity index 100%
rename from wear/wear-watchface-data/src/main/res/values-en-rIN/accessibility_strings.xml
rename to wear/watchface/watchface-data/src/main/res/values-en-rIN/accessibility_strings.xml
diff --git a/wear/wear-watchface-data/src/main/res/values-en-rXC/accessibility_strings.xml b/wear/watchface/watchface-data/src/main/res/values-en-rXC/accessibility_strings.xml
similarity index 100%
rename from wear/wear-watchface-data/src/main/res/values-en-rXC/accessibility_strings.xml
rename to wear/watchface/watchface-data/src/main/res/values-en-rXC/accessibility_strings.xml
diff --git a/wear/wear-watchface-data/src/main/res/values-es-rUS/accessibility_strings.xml b/wear/watchface/watchface-data/src/main/res/values-es-rUS/accessibility_strings.xml
similarity index 100%
rename from wear/wear-watchface-data/src/main/res/values-es-rUS/accessibility_strings.xml
rename to wear/watchface/watchface-data/src/main/res/values-es-rUS/accessibility_strings.xml
diff --git a/wear/wear-watchface-data/src/main/res/values-es/accessibility_strings.xml b/wear/watchface/watchface-data/src/main/res/values-es/accessibility_strings.xml
similarity index 100%
rename from wear/wear-watchface-data/src/main/res/values-es/accessibility_strings.xml
rename to wear/watchface/watchface-data/src/main/res/values-es/accessibility_strings.xml
diff --git a/wear/wear-watchface-data/src/main/res/values-et/accessibility_strings.xml b/wear/watchface/watchface-data/src/main/res/values-et/accessibility_strings.xml
similarity index 100%
rename from wear/wear-watchface-data/src/main/res/values-et/accessibility_strings.xml
rename to wear/watchface/watchface-data/src/main/res/values-et/accessibility_strings.xml
diff --git a/wear/wear-watchface-data/src/main/res/values-eu/accessibility_strings.xml b/wear/watchface/watchface-data/src/main/res/values-eu/accessibility_strings.xml
similarity index 100%
rename from wear/wear-watchface-data/src/main/res/values-eu/accessibility_strings.xml
rename to wear/watchface/watchface-data/src/main/res/values-eu/accessibility_strings.xml
diff --git a/wear/wear-watchface-data/src/main/res/values-fa/accessibility_strings.xml b/wear/watchface/watchface-data/src/main/res/values-fa/accessibility_strings.xml
similarity index 100%
rename from wear/wear-watchface-data/src/main/res/values-fa/accessibility_strings.xml
rename to wear/watchface/watchface-data/src/main/res/values-fa/accessibility_strings.xml
diff --git a/wear/wear-watchface-data/src/main/res/values-fi/accessibility_strings.xml b/wear/watchface/watchface-data/src/main/res/values-fi/accessibility_strings.xml
similarity index 100%
rename from wear/wear-watchface-data/src/main/res/values-fi/accessibility_strings.xml
rename to wear/watchface/watchface-data/src/main/res/values-fi/accessibility_strings.xml
diff --git a/wear/wear-watchface-data/src/main/res/values-fr-rCA/accessibility_strings.xml b/wear/watchface/watchface-data/src/main/res/values-fr-rCA/accessibility_strings.xml
similarity index 100%
rename from wear/wear-watchface-data/src/main/res/values-fr-rCA/accessibility_strings.xml
rename to wear/watchface/watchface-data/src/main/res/values-fr-rCA/accessibility_strings.xml
diff --git a/wear/wear-watchface-data/src/main/res/values-fr/accessibility_strings.xml b/wear/watchface/watchface-data/src/main/res/values-fr/accessibility_strings.xml
similarity index 100%
rename from wear/wear-watchface-data/src/main/res/values-fr/accessibility_strings.xml
rename to wear/watchface/watchface-data/src/main/res/values-fr/accessibility_strings.xml
diff --git a/wear/wear-watchface-data/src/main/res/values-gl/accessibility_strings.xml b/wear/watchface/watchface-data/src/main/res/values-gl/accessibility_strings.xml
similarity index 100%
rename from wear/wear-watchface-data/src/main/res/values-gl/accessibility_strings.xml
rename to wear/watchface/watchface-data/src/main/res/values-gl/accessibility_strings.xml
diff --git a/wear/wear-watchface-data/src/main/res/values-gu/accessibility_strings.xml b/wear/watchface/watchface-data/src/main/res/values-gu/accessibility_strings.xml
similarity index 100%
rename from wear/wear-watchface-data/src/main/res/values-gu/accessibility_strings.xml
rename to wear/watchface/watchface-data/src/main/res/values-gu/accessibility_strings.xml
diff --git a/wear/wear-watchface-data/src/main/res/values-hi/accessibility_strings.xml b/wear/watchface/watchface-data/src/main/res/values-hi/accessibility_strings.xml
similarity index 100%
rename from wear/wear-watchface-data/src/main/res/values-hi/accessibility_strings.xml
rename to wear/watchface/watchface-data/src/main/res/values-hi/accessibility_strings.xml
diff --git a/wear/wear-watchface-data/src/main/res/values-hr/accessibility_strings.xml b/wear/watchface/watchface-data/src/main/res/values-hr/accessibility_strings.xml
similarity index 100%
rename from wear/wear-watchface-data/src/main/res/values-hr/accessibility_strings.xml
rename to wear/watchface/watchface-data/src/main/res/values-hr/accessibility_strings.xml
diff --git a/wear/wear-watchface-data/src/main/res/values-hu/accessibility_strings.xml b/wear/watchface/watchface-data/src/main/res/values-hu/accessibility_strings.xml
similarity index 100%
rename from wear/wear-watchface-data/src/main/res/values-hu/accessibility_strings.xml
rename to wear/watchface/watchface-data/src/main/res/values-hu/accessibility_strings.xml
diff --git a/wear/wear-watchface-data/src/main/res/values-hy/accessibility_strings.xml b/wear/watchface/watchface-data/src/main/res/values-hy/accessibility_strings.xml
similarity index 100%
rename from wear/wear-watchface-data/src/main/res/values-hy/accessibility_strings.xml
rename to wear/watchface/watchface-data/src/main/res/values-hy/accessibility_strings.xml
diff --git a/wear/wear-watchface-data/src/main/res/values-in/accessibility_strings.xml b/wear/watchface/watchface-data/src/main/res/values-in/accessibility_strings.xml
similarity index 100%
rename from wear/wear-watchface-data/src/main/res/values-in/accessibility_strings.xml
rename to wear/watchface/watchface-data/src/main/res/values-in/accessibility_strings.xml
diff --git a/wear/wear-watchface-data/src/main/res/values-is/accessibility_strings.xml b/wear/watchface/watchface-data/src/main/res/values-is/accessibility_strings.xml
similarity index 100%
rename from wear/wear-watchface-data/src/main/res/values-is/accessibility_strings.xml
rename to wear/watchface/watchface-data/src/main/res/values-is/accessibility_strings.xml
diff --git a/wear/wear-watchface-data/src/main/res/values-it/accessibility_strings.xml b/wear/watchface/watchface-data/src/main/res/values-it/accessibility_strings.xml
similarity index 100%
rename from wear/wear-watchface-data/src/main/res/values-it/accessibility_strings.xml
rename to wear/watchface/watchface-data/src/main/res/values-it/accessibility_strings.xml
diff --git a/wear/wear-watchface-data/src/main/res/values-iw/accessibility_strings.xml b/wear/watchface/watchface-data/src/main/res/values-iw/accessibility_strings.xml
similarity index 100%
rename from wear/wear-watchface-data/src/main/res/values-iw/accessibility_strings.xml
rename to wear/watchface/watchface-data/src/main/res/values-iw/accessibility_strings.xml
diff --git a/wear/wear-watchface-data/src/main/res/values-ja/accessibility_strings.xml b/wear/watchface/watchface-data/src/main/res/values-ja/accessibility_strings.xml
similarity index 100%
rename from wear/wear-watchface-data/src/main/res/values-ja/accessibility_strings.xml
rename to wear/watchface/watchface-data/src/main/res/values-ja/accessibility_strings.xml
diff --git a/wear/wear-watchface-data/src/main/res/values-ka/accessibility_strings.xml b/wear/watchface/watchface-data/src/main/res/values-ka/accessibility_strings.xml
similarity index 100%
rename from wear/wear-watchface-data/src/main/res/values-ka/accessibility_strings.xml
rename to wear/watchface/watchface-data/src/main/res/values-ka/accessibility_strings.xml
diff --git a/wear/wear-watchface-data/src/main/res/values-kk/accessibility_strings.xml b/wear/watchface/watchface-data/src/main/res/values-kk/accessibility_strings.xml
similarity index 100%
rename from wear/wear-watchface-data/src/main/res/values-kk/accessibility_strings.xml
rename to wear/watchface/watchface-data/src/main/res/values-kk/accessibility_strings.xml
diff --git a/wear/wear-watchface-data/src/main/res/values-km/accessibility_strings.xml b/wear/watchface/watchface-data/src/main/res/values-km/accessibility_strings.xml
similarity index 100%
rename from wear/wear-watchface-data/src/main/res/values-km/accessibility_strings.xml
rename to wear/watchface/watchface-data/src/main/res/values-km/accessibility_strings.xml
diff --git a/wear/wear-watchface-data/src/main/res/values-kn/accessibility_strings.xml b/wear/watchface/watchface-data/src/main/res/values-kn/accessibility_strings.xml
similarity index 100%
rename from wear/wear-watchface-data/src/main/res/values-kn/accessibility_strings.xml
rename to wear/watchface/watchface-data/src/main/res/values-kn/accessibility_strings.xml
diff --git a/wear/wear-watchface-data/src/main/res/values-ko/accessibility_strings.xml b/wear/watchface/watchface-data/src/main/res/values-ko/accessibility_strings.xml
similarity index 100%
rename from wear/wear-watchface-data/src/main/res/values-ko/accessibility_strings.xml
rename to wear/watchface/watchface-data/src/main/res/values-ko/accessibility_strings.xml
diff --git a/wear/wear-watchface-data/src/main/res/values-ky/accessibility_strings.xml b/wear/watchface/watchface-data/src/main/res/values-ky/accessibility_strings.xml
similarity index 100%
rename from wear/wear-watchface-data/src/main/res/values-ky/accessibility_strings.xml
rename to wear/watchface/watchface-data/src/main/res/values-ky/accessibility_strings.xml
diff --git a/wear/wear-watchface-data/src/main/res/values-lo/accessibility_strings.xml b/wear/watchface/watchface-data/src/main/res/values-lo/accessibility_strings.xml
similarity index 100%
rename from wear/wear-watchface-data/src/main/res/values-lo/accessibility_strings.xml
rename to wear/watchface/watchface-data/src/main/res/values-lo/accessibility_strings.xml
diff --git a/wear/wear-watchface-data/src/main/res/values-lt/accessibility_strings.xml b/wear/watchface/watchface-data/src/main/res/values-lt/accessibility_strings.xml
similarity index 100%
rename from wear/wear-watchface-data/src/main/res/values-lt/accessibility_strings.xml
rename to wear/watchface/watchface-data/src/main/res/values-lt/accessibility_strings.xml
diff --git a/wear/wear-watchface-data/src/main/res/values-lv/accessibility_strings.xml b/wear/watchface/watchface-data/src/main/res/values-lv/accessibility_strings.xml
similarity index 100%
rename from wear/wear-watchface-data/src/main/res/values-lv/accessibility_strings.xml
rename to wear/watchface/watchface-data/src/main/res/values-lv/accessibility_strings.xml
diff --git a/wear/wear-watchface-data/src/main/res/values-mk/accessibility_strings.xml b/wear/watchface/watchface-data/src/main/res/values-mk/accessibility_strings.xml
similarity index 100%
rename from wear/wear-watchface-data/src/main/res/values-mk/accessibility_strings.xml
rename to wear/watchface/watchface-data/src/main/res/values-mk/accessibility_strings.xml
diff --git a/wear/wear-watchface-data/src/main/res/values-ml/accessibility_strings.xml b/wear/watchface/watchface-data/src/main/res/values-ml/accessibility_strings.xml
similarity index 100%
rename from wear/wear-watchface-data/src/main/res/values-ml/accessibility_strings.xml
rename to wear/watchface/watchface-data/src/main/res/values-ml/accessibility_strings.xml
diff --git a/wear/wear-watchface-data/src/main/res/values-mn/accessibility_strings.xml b/wear/watchface/watchface-data/src/main/res/values-mn/accessibility_strings.xml
similarity index 100%
rename from wear/wear-watchface-data/src/main/res/values-mn/accessibility_strings.xml
rename to wear/watchface/watchface-data/src/main/res/values-mn/accessibility_strings.xml
diff --git a/wear/wear-watchface-data/src/main/res/values-mr/accessibility_strings.xml b/wear/watchface/watchface-data/src/main/res/values-mr/accessibility_strings.xml
similarity index 100%
rename from wear/wear-watchface-data/src/main/res/values-mr/accessibility_strings.xml
rename to wear/watchface/watchface-data/src/main/res/values-mr/accessibility_strings.xml
diff --git a/wear/wear-watchface-data/src/main/res/values-ms/accessibility_strings.xml b/wear/watchface/watchface-data/src/main/res/values-ms/accessibility_strings.xml
similarity index 100%
rename from wear/wear-watchface-data/src/main/res/values-ms/accessibility_strings.xml
rename to wear/watchface/watchface-data/src/main/res/values-ms/accessibility_strings.xml
diff --git a/wear/wear-watchface-data/src/main/res/values-my/accessibility_strings.xml b/wear/watchface/watchface-data/src/main/res/values-my/accessibility_strings.xml
similarity index 100%
rename from wear/wear-watchface-data/src/main/res/values-my/accessibility_strings.xml
rename to wear/watchface/watchface-data/src/main/res/values-my/accessibility_strings.xml
diff --git a/wear/wear-watchface-data/src/main/res/values-nb/accessibility_strings.xml b/wear/watchface/watchface-data/src/main/res/values-nb/accessibility_strings.xml
similarity index 100%
rename from wear/wear-watchface-data/src/main/res/values-nb/accessibility_strings.xml
rename to wear/watchface/watchface-data/src/main/res/values-nb/accessibility_strings.xml
diff --git a/wear/wear-watchface-data/src/main/res/values-ne/accessibility_strings.xml b/wear/watchface/watchface-data/src/main/res/values-ne/accessibility_strings.xml
similarity index 100%
rename from wear/wear-watchface-data/src/main/res/values-ne/accessibility_strings.xml
rename to wear/watchface/watchface-data/src/main/res/values-ne/accessibility_strings.xml
diff --git a/wear/wear-watchface-data/src/main/res/values-nl/accessibility_strings.xml b/wear/watchface/watchface-data/src/main/res/values-nl/accessibility_strings.xml
similarity index 100%
rename from wear/wear-watchface-data/src/main/res/values-nl/accessibility_strings.xml
rename to wear/watchface/watchface-data/src/main/res/values-nl/accessibility_strings.xml
diff --git a/wear/wear-watchface-data/src/main/res/values-or/accessibility_strings.xml b/wear/watchface/watchface-data/src/main/res/values-or/accessibility_strings.xml
similarity index 100%
rename from wear/wear-watchface-data/src/main/res/values-or/accessibility_strings.xml
rename to wear/watchface/watchface-data/src/main/res/values-or/accessibility_strings.xml
diff --git a/wear/wear-watchface-data/src/main/res/values-pa/accessibility_strings.xml b/wear/watchface/watchface-data/src/main/res/values-pa/accessibility_strings.xml
similarity index 100%
rename from wear/wear-watchface-data/src/main/res/values-pa/accessibility_strings.xml
rename to wear/watchface/watchface-data/src/main/res/values-pa/accessibility_strings.xml
diff --git a/wear/wear-watchface-data/src/main/res/values-pl/accessibility_strings.xml b/wear/watchface/watchface-data/src/main/res/values-pl/accessibility_strings.xml
similarity index 100%
rename from wear/wear-watchface-data/src/main/res/values-pl/accessibility_strings.xml
rename to wear/watchface/watchface-data/src/main/res/values-pl/accessibility_strings.xml
diff --git a/wear/wear-watchface-data/src/main/res/values-pt-rBR/accessibility_strings.xml b/wear/watchface/watchface-data/src/main/res/values-pt-rBR/accessibility_strings.xml
similarity index 100%
rename from wear/wear-watchface-data/src/main/res/values-pt-rBR/accessibility_strings.xml
rename to wear/watchface/watchface-data/src/main/res/values-pt-rBR/accessibility_strings.xml
diff --git a/wear/wear-watchface-data/src/main/res/values-pt-rPT/accessibility_strings.xml b/wear/watchface/watchface-data/src/main/res/values-pt-rPT/accessibility_strings.xml
similarity index 100%
rename from wear/wear-watchface-data/src/main/res/values-pt-rPT/accessibility_strings.xml
rename to wear/watchface/watchface-data/src/main/res/values-pt-rPT/accessibility_strings.xml
diff --git a/wear/wear-watchface-data/src/main/res/values-pt/accessibility_strings.xml b/wear/watchface/watchface-data/src/main/res/values-pt/accessibility_strings.xml
similarity index 100%
rename from wear/wear-watchface-data/src/main/res/values-pt/accessibility_strings.xml
rename to wear/watchface/watchface-data/src/main/res/values-pt/accessibility_strings.xml
diff --git a/wear/wear-watchface-data/src/main/res/values-ro/accessibility_strings.xml b/wear/watchface/watchface-data/src/main/res/values-ro/accessibility_strings.xml
similarity index 100%
rename from wear/wear-watchface-data/src/main/res/values-ro/accessibility_strings.xml
rename to wear/watchface/watchface-data/src/main/res/values-ro/accessibility_strings.xml
diff --git a/wear/wear-watchface-data/src/main/res/values-ru/accessibility_strings.xml b/wear/watchface/watchface-data/src/main/res/values-ru/accessibility_strings.xml
similarity index 100%
rename from wear/wear-watchface-data/src/main/res/values-ru/accessibility_strings.xml
rename to wear/watchface/watchface-data/src/main/res/values-ru/accessibility_strings.xml
diff --git a/wear/wear-watchface-data/src/main/res/values-si/accessibility_strings.xml b/wear/watchface/watchface-data/src/main/res/values-si/accessibility_strings.xml
similarity index 100%
rename from wear/wear-watchface-data/src/main/res/values-si/accessibility_strings.xml
rename to wear/watchface/watchface-data/src/main/res/values-si/accessibility_strings.xml
diff --git a/wear/wear-watchface-data/src/main/res/values-sk/accessibility_strings.xml b/wear/watchface/watchface-data/src/main/res/values-sk/accessibility_strings.xml
similarity index 100%
rename from wear/wear-watchface-data/src/main/res/values-sk/accessibility_strings.xml
rename to wear/watchface/watchface-data/src/main/res/values-sk/accessibility_strings.xml
diff --git a/wear/wear-watchface-data/src/main/res/values-sl/accessibility_strings.xml b/wear/watchface/watchface-data/src/main/res/values-sl/accessibility_strings.xml
similarity index 100%
rename from wear/wear-watchface-data/src/main/res/values-sl/accessibility_strings.xml
rename to wear/watchface/watchface-data/src/main/res/values-sl/accessibility_strings.xml
diff --git a/wear/wear-watchface-data/src/main/res/values-sq/accessibility_strings.xml b/wear/watchface/watchface-data/src/main/res/values-sq/accessibility_strings.xml
similarity index 100%
rename from wear/wear-watchface-data/src/main/res/values-sq/accessibility_strings.xml
rename to wear/watchface/watchface-data/src/main/res/values-sq/accessibility_strings.xml
diff --git a/wear/wear-watchface-data/src/main/res/values-sr/accessibility_strings.xml b/wear/watchface/watchface-data/src/main/res/values-sr/accessibility_strings.xml
similarity index 100%
rename from wear/wear-watchface-data/src/main/res/values-sr/accessibility_strings.xml
rename to wear/watchface/watchface-data/src/main/res/values-sr/accessibility_strings.xml
diff --git a/wear/wear-watchface-data/src/main/res/values-sv/accessibility_strings.xml b/wear/watchface/watchface-data/src/main/res/values-sv/accessibility_strings.xml
similarity index 100%
rename from wear/wear-watchface-data/src/main/res/values-sv/accessibility_strings.xml
rename to wear/watchface/watchface-data/src/main/res/values-sv/accessibility_strings.xml
diff --git a/wear/wear-watchface-data/src/main/res/values-sw/accessibility_strings.xml b/wear/watchface/watchface-data/src/main/res/values-sw/accessibility_strings.xml
similarity index 100%
rename from wear/wear-watchface-data/src/main/res/values-sw/accessibility_strings.xml
rename to wear/watchface/watchface-data/src/main/res/values-sw/accessibility_strings.xml
diff --git a/wear/wear-watchface-data/src/main/res/values-ta/accessibility_strings.xml b/wear/watchface/watchface-data/src/main/res/values-ta/accessibility_strings.xml
similarity index 100%
rename from wear/wear-watchface-data/src/main/res/values-ta/accessibility_strings.xml
rename to wear/watchface/watchface-data/src/main/res/values-ta/accessibility_strings.xml
diff --git a/wear/wear-watchface-data/src/main/res/values-te/accessibility_strings.xml b/wear/watchface/watchface-data/src/main/res/values-te/accessibility_strings.xml
similarity index 100%
rename from wear/wear-watchface-data/src/main/res/values-te/accessibility_strings.xml
rename to wear/watchface/watchface-data/src/main/res/values-te/accessibility_strings.xml
diff --git a/wear/wear-watchface-data/src/main/res/values-th/accessibility_strings.xml b/wear/watchface/watchface-data/src/main/res/values-th/accessibility_strings.xml
similarity index 100%
rename from wear/wear-watchface-data/src/main/res/values-th/accessibility_strings.xml
rename to wear/watchface/watchface-data/src/main/res/values-th/accessibility_strings.xml
diff --git a/wear/wear-watchface-data/src/main/res/values-tl/accessibility_strings.xml b/wear/watchface/watchface-data/src/main/res/values-tl/accessibility_strings.xml
similarity index 100%
rename from wear/wear-watchface-data/src/main/res/values-tl/accessibility_strings.xml
rename to wear/watchface/watchface-data/src/main/res/values-tl/accessibility_strings.xml
diff --git a/wear/wear-watchface-data/src/main/res/values-tr/accessibility_strings.xml b/wear/watchface/watchface-data/src/main/res/values-tr/accessibility_strings.xml
similarity index 100%
rename from wear/wear-watchface-data/src/main/res/values-tr/accessibility_strings.xml
rename to wear/watchface/watchface-data/src/main/res/values-tr/accessibility_strings.xml
diff --git a/wear/wear-watchface-data/src/main/res/values-uk/accessibility_strings.xml b/wear/watchface/watchface-data/src/main/res/values-uk/accessibility_strings.xml
similarity index 100%
rename from wear/wear-watchface-data/src/main/res/values-uk/accessibility_strings.xml
rename to wear/watchface/watchface-data/src/main/res/values-uk/accessibility_strings.xml
diff --git a/wear/wear-watchface-data/src/main/res/values-ur/accessibility_strings.xml b/wear/watchface/watchface-data/src/main/res/values-ur/accessibility_strings.xml
similarity index 100%
rename from wear/wear-watchface-data/src/main/res/values-ur/accessibility_strings.xml
rename to wear/watchface/watchface-data/src/main/res/values-ur/accessibility_strings.xml
diff --git a/wear/wear-watchface-data/src/main/res/values-uz/accessibility_strings.xml b/wear/watchface/watchface-data/src/main/res/values-uz/accessibility_strings.xml
similarity index 100%
rename from wear/wear-watchface-data/src/main/res/values-uz/accessibility_strings.xml
rename to wear/watchface/watchface-data/src/main/res/values-uz/accessibility_strings.xml
diff --git a/wear/wear-watchface-data/src/main/res/values-vi/accessibility_strings.xml b/wear/watchface/watchface-data/src/main/res/values-vi/accessibility_strings.xml
similarity index 100%
rename from wear/wear-watchface-data/src/main/res/values-vi/accessibility_strings.xml
rename to wear/watchface/watchface-data/src/main/res/values-vi/accessibility_strings.xml
diff --git a/wear/wear-watchface-data/src/main/res/values-zh-rCN/accessibility_strings.xml b/wear/watchface/watchface-data/src/main/res/values-zh-rCN/accessibility_strings.xml
similarity index 100%
rename from wear/wear-watchface-data/src/main/res/values-zh-rCN/accessibility_strings.xml
rename to wear/watchface/watchface-data/src/main/res/values-zh-rCN/accessibility_strings.xml
diff --git a/wear/wear-watchface-data/src/main/res/values-zh-rHK/accessibility_strings.xml b/wear/watchface/watchface-data/src/main/res/values-zh-rHK/accessibility_strings.xml
similarity index 100%
rename from wear/wear-watchface-data/src/main/res/values-zh-rHK/accessibility_strings.xml
rename to wear/watchface/watchface-data/src/main/res/values-zh-rHK/accessibility_strings.xml
diff --git a/wear/wear-watchface-data/src/main/res/values-zh-rTW/accessibility_strings.xml b/wear/watchface/watchface-data/src/main/res/values-zh-rTW/accessibility_strings.xml
similarity index 100%
rename from wear/wear-watchface-data/src/main/res/values-zh-rTW/accessibility_strings.xml
rename to wear/watchface/watchface-data/src/main/res/values-zh-rTW/accessibility_strings.xml
diff --git a/wear/wear-watchface-data/src/main/res/values-zu/accessibility_strings.xml b/wear/watchface/watchface-data/src/main/res/values-zu/accessibility_strings.xml
similarity index 100%
rename from wear/wear-watchface-data/src/main/res/values-zu/accessibility_strings.xml
rename to wear/watchface/watchface-data/src/main/res/values-zu/accessibility_strings.xml
diff --git a/wear/wear-watchface-data/src/main/res/values/accessibility_strings.xml b/wear/watchface/watchface-data/src/main/res/values/accessibility_strings.xml
similarity index 100%
rename from wear/wear-watchface-data/src/main/res/values/accessibility_strings.xml
rename to wear/watchface/watchface-data/src/main/res/values/accessibility_strings.xml
diff --git a/wear/watchface/watchface-editor-guava/api/api_lint.ignore b/wear/watchface/watchface-editor-guava/api/api_lint.ignore
new file mode 100644
index 0000000..16ace53
--- /dev/null
+++ b/wear/watchface/watchface-editor-guava/api/api_lint.ignore
@@ -0,0 +1,11 @@
+// Baseline format: 1.0
+AsyncSuffixFuture: androidx.wear.watchface.editor.ListenableEditorSession#getListenableComplicationPreviewData():
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
+AsyncSuffixFuture: androidx.wear.watchface.editor.ListenableEditorSession#getListenableComplicationsProviderInfo():
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
+AsyncSuffixFuture: androidx.wear.watchface.editor.ListenableEditorSession#listenableCreateOnWatchEditorSession(androidx.activity.ComponentActivity):
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
+AsyncSuffixFuture: androidx.wear.watchface.editor.ListenableEditorSession#listenableOpenComplicationDataSourceChooser(int):
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
+AsyncSuffixFuture: androidx.wear.watchface.editor.ListenableEditorSession.Companion#listenableCreateOnWatchEditorSession(androidx.activity.ComponentActivity):
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
diff --git a/wear/wear-watchface-editor-guava/api/current.txt b/wear/watchface/watchface-editor-guava/api/current.txt
similarity index 90%
rename from wear/wear-watchface-editor-guava/api/current.txt
rename to wear/watchface/watchface-editor-guava/api/current.txt
index 8a5446f..7bd5fe0 100644
--- a/wear/wear-watchface-editor-guava/api/current.txt
+++ b/wear/watchface/watchface-editor-guava/api/current.txt
@@ -8,10 +8,10 @@
method public Integer? getBackgroundComplicationSlotId();
method public Integer? getComplicationSlotIdAt(int x, int y);
method public kotlinx.coroutines.flow.StateFlow<java.util.Map<java.lang.Integer,androidx.wear.watchface.client.ComplicationSlotState>> getComplicationSlotsState();
- method public suspend Object? getComplicationsDataSourceInfo(kotlin.coroutines.Continuation<? super kotlinx.coroutines.flow.StateFlow<? extends java.util.Map<java.lang.Integer,? extends androidx.wear.complications.ComplicationDataSourceInfo>>> p);
- method public suspend Object? getComplicationsPreviewData(kotlin.coroutines.Continuation<? super kotlinx.coroutines.flow.StateFlow<? extends java.util.Map<java.lang.Integer,? extends androidx.wear.complications.data.ComplicationData>>> p);
- method public com.google.common.util.concurrent.ListenableFuture<kotlinx.coroutines.flow.StateFlow<java.util.Map<java.lang.Integer,androidx.wear.complications.data.ComplicationData>>> getListenableComplicationPreviewData();
- method public com.google.common.util.concurrent.ListenableFuture<kotlinx.coroutines.flow.StateFlow<java.util.Map<java.lang.Integer,androidx.wear.complications.ComplicationDataSourceInfo>>> getListenableComplicationsProviderInfo();
+ method public suspend Object? getComplicationsDataSourceInfo(kotlin.coroutines.Continuation<? super kotlinx.coroutines.flow.StateFlow<? extends java.util.Map<java.lang.Integer,? extends androidx.wear.watchface.complications.ComplicationDataSourceInfo>>> p);
+ method public suspend Object? getComplicationsPreviewData(kotlin.coroutines.Continuation<? super kotlinx.coroutines.flow.StateFlow<? extends java.util.Map<java.lang.Integer,? extends androidx.wear.watchface.complications.data.ComplicationData>>> p);
+ method public com.google.common.util.concurrent.ListenableFuture<kotlinx.coroutines.flow.StateFlow<java.util.Map<java.lang.Integer,androidx.wear.watchface.complications.data.ComplicationData>>> getListenableComplicationPreviewData();
+ method public com.google.common.util.concurrent.ListenableFuture<kotlinx.coroutines.flow.StateFlow<java.util.Map<java.lang.Integer,androidx.wear.watchface.complications.ComplicationDataSourceInfo>>> getListenableComplicationsProviderInfo();
method public java.time.Instant getPreviewReferenceInstant();
method public kotlinx.coroutines.flow.MutableStateFlow<androidx.wear.watchface.style.UserStyle> getUserStyle();
method public androidx.wear.watchface.style.UserStyleSchema getUserStyleSchema();
@@ -21,7 +21,7 @@
method @UiThread public static com.google.common.util.concurrent.ListenableFuture<androidx.wear.watchface.editor.ListenableEditorSession> listenableCreateOnWatchEditorSession(androidx.activity.ComponentActivity activity);
method public com.google.common.util.concurrent.ListenableFuture<androidx.wear.watchface.editor.ChosenComplicationDataSource> listenableOpenComplicationDataSourceChooser(int complicationSlotId);
method public suspend Object? openComplicationDataSourceChooser(int complicationSlotId, kotlin.coroutines.Continuation<? super androidx.wear.watchface.editor.ChosenComplicationDataSource> p);
- method public android.graphics.Bitmap renderWatchFaceToBitmap(androidx.wear.watchface.RenderParameters renderParameters, java.time.Instant instant, java.util.Map<java.lang.Integer,? extends androidx.wear.complications.data.ComplicationData>? slotIdToComplicationData);
+ method public android.graphics.Bitmap renderWatchFaceToBitmap(androidx.wear.watchface.RenderParameters renderParameters, java.time.Instant instant, java.util.Map<java.lang.Integer,? extends androidx.wear.watchface.complications.data.ComplicationData>? slotIdToComplicationData);
method public void setCommitChangesOnClose(boolean commitChangesOnClose);
property public Integer? backgroundComplicationSlotId;
property public boolean commitChangesOnClose;
diff --git a/wear/wear-watchface-editor-guava/api/current.txt b/wear/watchface/watchface-editor-guava/api/public_plus_experimental_current.txt
similarity index 90%
copy from wear/wear-watchface-editor-guava/api/current.txt
copy to wear/watchface/watchface-editor-guava/api/public_plus_experimental_current.txt
index 8a5446f..7bd5fe0 100644
--- a/wear/wear-watchface-editor-guava/api/current.txt
+++ b/wear/watchface/watchface-editor-guava/api/public_plus_experimental_current.txt
@@ -8,10 +8,10 @@
method public Integer? getBackgroundComplicationSlotId();
method public Integer? getComplicationSlotIdAt(int x, int y);
method public kotlinx.coroutines.flow.StateFlow<java.util.Map<java.lang.Integer,androidx.wear.watchface.client.ComplicationSlotState>> getComplicationSlotsState();
- method public suspend Object? getComplicationsDataSourceInfo(kotlin.coroutines.Continuation<? super kotlinx.coroutines.flow.StateFlow<? extends java.util.Map<java.lang.Integer,? extends androidx.wear.complications.ComplicationDataSourceInfo>>> p);
- method public suspend Object? getComplicationsPreviewData(kotlin.coroutines.Continuation<? super kotlinx.coroutines.flow.StateFlow<? extends java.util.Map<java.lang.Integer,? extends androidx.wear.complications.data.ComplicationData>>> p);
- method public com.google.common.util.concurrent.ListenableFuture<kotlinx.coroutines.flow.StateFlow<java.util.Map<java.lang.Integer,androidx.wear.complications.data.ComplicationData>>> getListenableComplicationPreviewData();
- method public com.google.common.util.concurrent.ListenableFuture<kotlinx.coroutines.flow.StateFlow<java.util.Map<java.lang.Integer,androidx.wear.complications.ComplicationDataSourceInfo>>> getListenableComplicationsProviderInfo();
+ method public suspend Object? getComplicationsDataSourceInfo(kotlin.coroutines.Continuation<? super kotlinx.coroutines.flow.StateFlow<? extends java.util.Map<java.lang.Integer,? extends androidx.wear.watchface.complications.ComplicationDataSourceInfo>>> p);
+ method public suspend Object? getComplicationsPreviewData(kotlin.coroutines.Continuation<? super kotlinx.coroutines.flow.StateFlow<? extends java.util.Map<java.lang.Integer,? extends androidx.wear.watchface.complications.data.ComplicationData>>> p);
+ method public com.google.common.util.concurrent.ListenableFuture<kotlinx.coroutines.flow.StateFlow<java.util.Map<java.lang.Integer,androidx.wear.watchface.complications.data.ComplicationData>>> getListenableComplicationPreviewData();
+ method public com.google.common.util.concurrent.ListenableFuture<kotlinx.coroutines.flow.StateFlow<java.util.Map<java.lang.Integer,androidx.wear.watchface.complications.ComplicationDataSourceInfo>>> getListenableComplicationsProviderInfo();
method public java.time.Instant getPreviewReferenceInstant();
method public kotlinx.coroutines.flow.MutableStateFlow<androidx.wear.watchface.style.UserStyle> getUserStyle();
method public androidx.wear.watchface.style.UserStyleSchema getUserStyleSchema();
@@ -21,7 +21,7 @@
method @UiThread public static com.google.common.util.concurrent.ListenableFuture<androidx.wear.watchface.editor.ListenableEditorSession> listenableCreateOnWatchEditorSession(androidx.activity.ComponentActivity activity);
method public com.google.common.util.concurrent.ListenableFuture<androidx.wear.watchface.editor.ChosenComplicationDataSource> listenableOpenComplicationDataSourceChooser(int complicationSlotId);
method public suspend Object? openComplicationDataSourceChooser(int complicationSlotId, kotlin.coroutines.Continuation<? super androidx.wear.watchface.editor.ChosenComplicationDataSource> p);
- method public android.graphics.Bitmap renderWatchFaceToBitmap(androidx.wear.watchface.RenderParameters renderParameters, java.time.Instant instant, java.util.Map<java.lang.Integer,? extends androidx.wear.complications.data.ComplicationData>? slotIdToComplicationData);
+ method public android.graphics.Bitmap renderWatchFaceToBitmap(androidx.wear.watchface.RenderParameters renderParameters, java.time.Instant instant, java.util.Map<java.lang.Integer,? extends androidx.wear.watchface.complications.data.ComplicationData>? slotIdToComplicationData);
method public void setCommitChangesOnClose(boolean commitChangesOnClose);
property public Integer? backgroundComplicationSlotId;
property public boolean commitChangesOnClose;
diff --git a/wear/wear-watchface-editor-guava/api/res-current.txt b/wear/watchface/watchface-editor-guava/api/res-current.txt
similarity index 100%
rename from wear/wear-watchface-editor-guava/api/res-current.txt
rename to wear/watchface/watchface-editor-guava/api/res-current.txt
diff --git a/wear/wear-watchface-editor-guava/api/current.txt b/wear/watchface/watchface-editor-guava/api/restricted_current.txt
similarity index 90%
copy from wear/wear-watchface-editor-guava/api/current.txt
copy to wear/watchface/watchface-editor-guava/api/restricted_current.txt
index 8a5446f..7bd5fe0 100644
--- a/wear/wear-watchface-editor-guava/api/current.txt
+++ b/wear/watchface/watchface-editor-guava/api/restricted_current.txt
@@ -8,10 +8,10 @@
method public Integer? getBackgroundComplicationSlotId();
method public Integer? getComplicationSlotIdAt(int x, int y);
method public kotlinx.coroutines.flow.StateFlow<java.util.Map<java.lang.Integer,androidx.wear.watchface.client.ComplicationSlotState>> getComplicationSlotsState();
- method public suspend Object? getComplicationsDataSourceInfo(kotlin.coroutines.Continuation<? super kotlinx.coroutines.flow.StateFlow<? extends java.util.Map<java.lang.Integer,? extends androidx.wear.complications.ComplicationDataSourceInfo>>> p);
- method public suspend Object? getComplicationsPreviewData(kotlin.coroutines.Continuation<? super kotlinx.coroutines.flow.StateFlow<? extends java.util.Map<java.lang.Integer,? extends androidx.wear.complications.data.ComplicationData>>> p);
- method public com.google.common.util.concurrent.ListenableFuture<kotlinx.coroutines.flow.StateFlow<java.util.Map<java.lang.Integer,androidx.wear.complications.data.ComplicationData>>> getListenableComplicationPreviewData();
- method public com.google.common.util.concurrent.ListenableFuture<kotlinx.coroutines.flow.StateFlow<java.util.Map<java.lang.Integer,androidx.wear.complications.ComplicationDataSourceInfo>>> getListenableComplicationsProviderInfo();
+ method public suspend Object? getComplicationsDataSourceInfo(kotlin.coroutines.Continuation<? super kotlinx.coroutines.flow.StateFlow<? extends java.util.Map<java.lang.Integer,? extends androidx.wear.watchface.complications.ComplicationDataSourceInfo>>> p);
+ method public suspend Object? getComplicationsPreviewData(kotlin.coroutines.Continuation<? super kotlinx.coroutines.flow.StateFlow<? extends java.util.Map<java.lang.Integer,? extends androidx.wear.watchface.complications.data.ComplicationData>>> p);
+ method public com.google.common.util.concurrent.ListenableFuture<kotlinx.coroutines.flow.StateFlow<java.util.Map<java.lang.Integer,androidx.wear.watchface.complications.data.ComplicationData>>> getListenableComplicationPreviewData();
+ method public com.google.common.util.concurrent.ListenableFuture<kotlinx.coroutines.flow.StateFlow<java.util.Map<java.lang.Integer,androidx.wear.watchface.complications.ComplicationDataSourceInfo>>> getListenableComplicationsProviderInfo();
method public java.time.Instant getPreviewReferenceInstant();
method public kotlinx.coroutines.flow.MutableStateFlow<androidx.wear.watchface.style.UserStyle> getUserStyle();
method public androidx.wear.watchface.style.UserStyleSchema getUserStyleSchema();
@@ -21,7 +21,7 @@
method @UiThread public static com.google.common.util.concurrent.ListenableFuture<androidx.wear.watchface.editor.ListenableEditorSession> listenableCreateOnWatchEditorSession(androidx.activity.ComponentActivity activity);
method public com.google.common.util.concurrent.ListenableFuture<androidx.wear.watchface.editor.ChosenComplicationDataSource> listenableOpenComplicationDataSourceChooser(int complicationSlotId);
method public suspend Object? openComplicationDataSourceChooser(int complicationSlotId, kotlin.coroutines.Continuation<? super androidx.wear.watchface.editor.ChosenComplicationDataSource> p);
- method public android.graphics.Bitmap renderWatchFaceToBitmap(androidx.wear.watchface.RenderParameters renderParameters, java.time.Instant instant, java.util.Map<java.lang.Integer,? extends androidx.wear.complications.data.ComplicationData>? slotIdToComplicationData);
+ method public android.graphics.Bitmap renderWatchFaceToBitmap(androidx.wear.watchface.RenderParameters renderParameters, java.time.Instant instant, java.util.Map<java.lang.Integer,? extends androidx.wear.watchface.complications.data.ComplicationData>? slotIdToComplicationData);
method public void setCommitChangesOnClose(boolean commitChangesOnClose);
property public Integer? backgroundComplicationSlotId;
property public boolean commitChangesOnClose;
diff --git a/wear/wear-watchface-editor-guava/build.gradle b/wear/watchface/watchface-editor-guava/build.gradle
similarity index 91%
rename from wear/wear-watchface-editor-guava/build.gradle
rename to wear/watchface/watchface-editor-guava/build.gradle
index 8a9c745..57e0070 100644
--- a/wear/wear-watchface-editor-guava/build.gradle
+++ b/wear/watchface/watchface-editor-guava/build.gradle
@@ -26,7 +26,7 @@
}
dependencies {
- api(project(":wear:wear-watchface-editor"))
+ api(project(":wear:watchface:watchface-editor"))
api(libs.kotlinCoroutinesGuava)
implementation("androidx.concurrent:concurrent-futures:1.0.0")
@@ -42,8 +42,7 @@
androidx {
name = "Android Wear Watchface Client Editor"
type = LibraryType.PUBLISHED_LIBRARY
- mavenGroup = LibraryGroups.WEAR
- mavenVersion = LibraryVersions.WEAR_WATCHFACE_EDITOR_GUAVA
+ mavenGroup = LibraryGroups.WEAR_WATCHFACE
inceptionYear = "2021"
description = "Guava wrappers for the Androidx Wear Watchface Editor library"
}
diff --git a/wear/wear-watchface-editor-guava/src/main/AndroidManifest.xml b/wear/watchface/watchface-editor-guava/src/main/AndroidManifest.xml
similarity index 100%
rename from wear/wear-watchface-editor-guava/src/main/AndroidManifest.xml
rename to wear/watchface/watchface-editor-guava/src/main/AndroidManifest.xml
diff --git a/wear/wear-watchface-editor-guava/src/main/java/androidx/wear/watchface/editor/ListenableEditorSession.kt b/wear/watchface/watchface-editor-guava/src/main/java/androidx/wear/watchface/editor/ListenableEditorSession.kt
similarity index 98%
rename from wear/wear-watchface-editor-guava/src/main/java/androidx/wear/watchface/editor/ListenableEditorSession.kt
rename to wear/watchface/watchface-editor-guava/src/main/java/androidx/wear/watchface/editor/ListenableEditorSession.kt
index 37020d8..5630a1e 100644
--- a/wear/wear-watchface-editor-guava/src/main/java/androidx/wear/watchface/editor/ListenableEditorSession.kt
+++ b/wear/watchface/watchface-editor-guava/src/main/java/androidx/wear/watchface/editor/ListenableEditorSession.kt
@@ -24,8 +24,8 @@
import androidx.annotation.RequiresApi
import androidx.annotation.UiThread
import androidx.concurrent.futures.ResolvableFuture
-import androidx.wear.complications.ComplicationDataSourceInfo
-import androidx.wear.complications.data.ComplicationData
+import androidx.wear.watchface.complications.ComplicationDataSourceInfo
+import androidx.wear.watchface.complications.data.ComplicationData
import androidx.wear.watchface.RenderParameters
import androidx.wear.watchface.client.ComplicationSlotState
import androidx.wear.watchface.client.HeadlessWatchFaceClient
diff --git a/wear/wear-watchface-editor/api/current.txt b/wear/watchface/watchface-editor/api/current.txt
similarity index 90%
rename from wear/wear-watchface-editor/api/current.txt
rename to wear/watchface/watchface-editor/api/current.txt
index 28bd8ba..8960bdc 100644
--- a/wear/wear-watchface-editor/api/current.txt
+++ b/wear/watchface/watchface-editor/api/current.txt
@@ -2,11 +2,11 @@
package androidx.wear.watchface.editor {
public final class ChosenComplicationDataSource {
- ctor public ChosenComplicationDataSource(int complicationSlotId, androidx.wear.complications.ComplicationDataSourceInfo? complicationDataSourceInfo, android.os.Bundle extras);
- method public androidx.wear.complications.ComplicationDataSourceInfo? getComplicationDataSourceInfo();
+ ctor public ChosenComplicationDataSource(int complicationSlotId, androidx.wear.watchface.complications.ComplicationDataSourceInfo? complicationDataSourceInfo, android.os.Bundle extras);
+ method public androidx.wear.watchface.complications.ComplicationDataSourceInfo? getComplicationDataSourceInfo();
method public int getComplicationSlotId();
method public android.os.Bundle getExtras();
- property public final androidx.wear.complications.ComplicationDataSourceInfo? complicationDataSourceInfo;
+ property public final androidx.wear.watchface.complications.ComplicationDataSourceInfo? complicationDataSourceInfo;
property public final int complicationSlotId;
property public final android.os.Bundle extras;
}
@@ -14,6 +14,7 @@
public final class EditorRequest {
ctor @RequiresApi(android.os.Build.VERSION_CODES.R) public EditorRequest(android.content.ComponentName watchFaceComponentName, String editorPackageName, androidx.wear.watchface.style.UserStyleData? initialUserStyle, @RequiresApi androidx.wear.watchface.client.WatchFaceId watchFaceId, androidx.wear.watchface.client.DeviceConfig? headlessDeviceConfig, androidx.wear.watchface.editor.PreviewScreenshotParams? previewScreenshotParams);
ctor public EditorRequest(android.content.ComponentName watchFaceComponentName, String editorPackageName, androidx.wear.watchface.style.UserStyleData? initialUserStyle);
+ method public static boolean canWatchFaceSupportHeadlessEditing(android.content.pm.PackageManager packageManager, String watchfacePackageName);
method @kotlin.jvm.Throws(exceptionClasses=TimeoutCancellationException::class) public static androidx.wear.watchface.editor.EditorRequest createFromIntent(android.content.Intent intent) throws kotlinx.coroutines.TimeoutCancellationException;
method public String getEditorPackageName();
method public androidx.wear.watchface.client.DeviceConfig? getHeadlessDeviceConfig();
@@ -31,6 +32,7 @@
}
public static final class EditorRequest.Companion {
+ method public boolean canWatchFaceSupportHeadlessEditing(android.content.pm.PackageManager packageManager, String watchfacePackageName);
method @kotlin.jvm.Throws(exceptionClasses=TimeoutCancellationException::class) public androidx.wear.watchface.editor.EditorRequest createFromIntent(android.content.Intent intent) throws kotlinx.coroutines.TimeoutCancellationException;
}
@@ -40,8 +42,8 @@
method public Integer? getBackgroundComplicationSlotId();
method @UiThread public Integer? getComplicationSlotIdAt(@Px int x, @Px int y);
method public kotlinx.coroutines.flow.StateFlow<java.util.Map<java.lang.Integer,androidx.wear.watchface.client.ComplicationSlotState>> getComplicationSlotsState();
- method public suspend Object? getComplicationsDataSourceInfo(kotlin.coroutines.Continuation<? super kotlinx.coroutines.flow.StateFlow<? extends java.util.Map<java.lang.Integer,? extends androidx.wear.complications.ComplicationDataSourceInfo>>> p);
- method public suspend Object? getComplicationsPreviewData(kotlin.coroutines.Continuation<? super kotlinx.coroutines.flow.StateFlow<? extends java.util.Map<java.lang.Integer,? extends androidx.wear.complications.data.ComplicationData>>> p);
+ method public suspend Object? getComplicationsDataSourceInfo(kotlin.coroutines.Continuation<? super kotlinx.coroutines.flow.StateFlow<? extends java.util.Map<java.lang.Integer,? extends androidx.wear.watchface.complications.ComplicationDataSourceInfo>>> p);
+ method public suspend Object? getComplicationsPreviewData(kotlin.coroutines.Continuation<? super kotlinx.coroutines.flow.StateFlow<? extends java.util.Map<java.lang.Integer,? extends androidx.wear.watchface.complications.data.ComplicationData>>> p);
method public java.time.Instant getPreviewReferenceInstant();
method public kotlinx.coroutines.flow.MutableStateFlow<androidx.wear.watchface.style.UserStyle> getUserStyle();
method public androidx.wear.watchface.style.UserStyleSchema getUserStyleSchema();
@@ -49,7 +51,7 @@
method @RequiresApi(android.os.Build.VERSION_CODES.R) public androidx.wear.watchface.client.WatchFaceId getWatchFaceId();
method @UiThread public boolean isCommitChangesOnClose();
method @UiThread public suspend Object? openComplicationDataSourceChooser(int complicationSlotId, kotlin.coroutines.Continuation<? super androidx.wear.watchface.editor.ChosenComplicationDataSource> p);
- method @UiThread public android.graphics.Bitmap renderWatchFaceToBitmap(androidx.wear.watchface.RenderParameters renderParameters, java.time.Instant instant, java.util.Map<java.lang.Integer,? extends androidx.wear.complications.data.ComplicationData>? slotIdToComplicationData);
+ method @UiThread public android.graphics.Bitmap renderWatchFaceToBitmap(androidx.wear.watchface.RenderParameters renderParameters, java.time.Instant instant, java.util.Map<java.lang.Integer,? extends androidx.wear.watchface.complications.data.ComplicationData>? slotIdToComplicationData);
method @UiThread public void setCommitChangesOnClose(boolean commitChangesOnClose);
property public abstract Integer? backgroundComplicationSlotId;
property @UiThread public abstract boolean commitChangesOnClose;
diff --git a/wear/wear-watchface-editor/api/public_plus_experimental_current.txt b/wear/watchface/watchface-editor/api/public_plus_experimental_current.txt
similarity index 90%
rename from wear/wear-watchface-editor/api/public_plus_experimental_current.txt
rename to wear/watchface/watchface-editor/api/public_plus_experimental_current.txt
index 28bd8ba..8960bdc 100644
--- a/wear/wear-watchface-editor/api/public_plus_experimental_current.txt
+++ b/wear/watchface/watchface-editor/api/public_plus_experimental_current.txt
@@ -2,11 +2,11 @@
package androidx.wear.watchface.editor {
public final class ChosenComplicationDataSource {
- ctor public ChosenComplicationDataSource(int complicationSlotId, androidx.wear.complications.ComplicationDataSourceInfo? complicationDataSourceInfo, android.os.Bundle extras);
- method public androidx.wear.complications.ComplicationDataSourceInfo? getComplicationDataSourceInfo();
+ ctor public ChosenComplicationDataSource(int complicationSlotId, androidx.wear.watchface.complications.ComplicationDataSourceInfo? complicationDataSourceInfo, android.os.Bundle extras);
+ method public androidx.wear.watchface.complications.ComplicationDataSourceInfo? getComplicationDataSourceInfo();
method public int getComplicationSlotId();
method public android.os.Bundle getExtras();
- property public final androidx.wear.complications.ComplicationDataSourceInfo? complicationDataSourceInfo;
+ property public final androidx.wear.watchface.complications.ComplicationDataSourceInfo? complicationDataSourceInfo;
property public final int complicationSlotId;
property public final android.os.Bundle extras;
}
@@ -14,6 +14,7 @@
public final class EditorRequest {
ctor @RequiresApi(android.os.Build.VERSION_CODES.R) public EditorRequest(android.content.ComponentName watchFaceComponentName, String editorPackageName, androidx.wear.watchface.style.UserStyleData? initialUserStyle, @RequiresApi androidx.wear.watchface.client.WatchFaceId watchFaceId, androidx.wear.watchface.client.DeviceConfig? headlessDeviceConfig, androidx.wear.watchface.editor.PreviewScreenshotParams? previewScreenshotParams);
ctor public EditorRequest(android.content.ComponentName watchFaceComponentName, String editorPackageName, androidx.wear.watchface.style.UserStyleData? initialUserStyle);
+ method public static boolean canWatchFaceSupportHeadlessEditing(android.content.pm.PackageManager packageManager, String watchfacePackageName);
method @kotlin.jvm.Throws(exceptionClasses=TimeoutCancellationException::class) public static androidx.wear.watchface.editor.EditorRequest createFromIntent(android.content.Intent intent) throws kotlinx.coroutines.TimeoutCancellationException;
method public String getEditorPackageName();
method public androidx.wear.watchface.client.DeviceConfig? getHeadlessDeviceConfig();
@@ -31,6 +32,7 @@
}
public static final class EditorRequest.Companion {
+ method public boolean canWatchFaceSupportHeadlessEditing(android.content.pm.PackageManager packageManager, String watchfacePackageName);
method @kotlin.jvm.Throws(exceptionClasses=TimeoutCancellationException::class) public androidx.wear.watchface.editor.EditorRequest createFromIntent(android.content.Intent intent) throws kotlinx.coroutines.TimeoutCancellationException;
}
@@ -40,8 +42,8 @@
method public Integer? getBackgroundComplicationSlotId();
method @UiThread public Integer? getComplicationSlotIdAt(@Px int x, @Px int y);
method public kotlinx.coroutines.flow.StateFlow<java.util.Map<java.lang.Integer,androidx.wear.watchface.client.ComplicationSlotState>> getComplicationSlotsState();
- method public suspend Object? getComplicationsDataSourceInfo(kotlin.coroutines.Continuation<? super kotlinx.coroutines.flow.StateFlow<? extends java.util.Map<java.lang.Integer,? extends androidx.wear.complications.ComplicationDataSourceInfo>>> p);
- method public suspend Object? getComplicationsPreviewData(kotlin.coroutines.Continuation<? super kotlinx.coroutines.flow.StateFlow<? extends java.util.Map<java.lang.Integer,? extends androidx.wear.complications.data.ComplicationData>>> p);
+ method public suspend Object? getComplicationsDataSourceInfo(kotlin.coroutines.Continuation<? super kotlinx.coroutines.flow.StateFlow<? extends java.util.Map<java.lang.Integer,? extends androidx.wear.watchface.complications.ComplicationDataSourceInfo>>> p);
+ method public suspend Object? getComplicationsPreviewData(kotlin.coroutines.Continuation<? super kotlinx.coroutines.flow.StateFlow<? extends java.util.Map<java.lang.Integer,? extends androidx.wear.watchface.complications.data.ComplicationData>>> p);
method public java.time.Instant getPreviewReferenceInstant();
method public kotlinx.coroutines.flow.MutableStateFlow<androidx.wear.watchface.style.UserStyle> getUserStyle();
method public androidx.wear.watchface.style.UserStyleSchema getUserStyleSchema();
@@ -49,7 +51,7 @@
method @RequiresApi(android.os.Build.VERSION_CODES.R) public androidx.wear.watchface.client.WatchFaceId getWatchFaceId();
method @UiThread public boolean isCommitChangesOnClose();
method @UiThread public suspend Object? openComplicationDataSourceChooser(int complicationSlotId, kotlin.coroutines.Continuation<? super androidx.wear.watchface.editor.ChosenComplicationDataSource> p);
- method @UiThread public android.graphics.Bitmap renderWatchFaceToBitmap(androidx.wear.watchface.RenderParameters renderParameters, java.time.Instant instant, java.util.Map<java.lang.Integer,? extends androidx.wear.complications.data.ComplicationData>? slotIdToComplicationData);
+ method @UiThread public android.graphics.Bitmap renderWatchFaceToBitmap(androidx.wear.watchface.RenderParameters renderParameters, java.time.Instant instant, java.util.Map<java.lang.Integer,? extends androidx.wear.watchface.complications.data.ComplicationData>? slotIdToComplicationData);
method @UiThread public void setCommitChangesOnClose(boolean commitChangesOnClose);
property public abstract Integer? backgroundComplicationSlotId;
property @UiThread public abstract boolean commitChangesOnClose;
diff --git a/wear/wear-watchface-editor/api/res-current.txt b/wear/watchface/watchface-editor/api/res-current.txt
similarity index 100%
rename from wear/wear-watchface-editor/api/res-current.txt
rename to wear/watchface/watchface-editor/api/res-current.txt
diff --git a/wear/wear-watchface-editor/api/current.txt b/wear/watchface/watchface-editor/api/restricted_current.txt
similarity index 89%
copy from wear/wear-watchface-editor/api/current.txt
copy to wear/watchface/watchface-editor/api/restricted_current.txt
index 28bd8ba..8960bdc 100644
--- a/wear/wear-watchface-editor/api/current.txt
+++ b/wear/watchface/watchface-editor/api/restricted_current.txt
@@ -2,11 +2,11 @@
package androidx.wear.watchface.editor {
public final class ChosenComplicationDataSource {
- ctor public ChosenComplicationDataSource(int complicationSlotId, androidx.wear.complications.ComplicationDataSourceInfo? complicationDataSourceInfo, android.os.Bundle extras);
- method public androidx.wear.complications.ComplicationDataSourceInfo? getComplicationDataSourceInfo();
+ ctor public ChosenComplicationDataSource(int complicationSlotId, androidx.wear.watchface.complications.ComplicationDataSourceInfo? complicationDataSourceInfo, android.os.Bundle extras);
+ method public androidx.wear.watchface.complications.ComplicationDataSourceInfo? getComplicationDataSourceInfo();
method public int getComplicationSlotId();
method public android.os.Bundle getExtras();
- property public final androidx.wear.complications.ComplicationDataSourceInfo? complicationDataSourceInfo;
+ property public final androidx.wear.watchface.complications.ComplicationDataSourceInfo? complicationDataSourceInfo;
property public final int complicationSlotId;
property public final android.os.Bundle extras;
}
@@ -14,6 +14,7 @@
public final class EditorRequest {
ctor @RequiresApi(android.os.Build.VERSION_CODES.R) public EditorRequest(android.content.ComponentName watchFaceComponentName, String editorPackageName, androidx.wear.watchface.style.UserStyleData? initialUserStyle, @RequiresApi androidx.wear.watchface.client.WatchFaceId watchFaceId, androidx.wear.watchface.client.DeviceConfig? headlessDeviceConfig, androidx.wear.watchface.editor.PreviewScreenshotParams? previewScreenshotParams);
ctor public EditorRequest(android.content.ComponentName watchFaceComponentName, String editorPackageName, androidx.wear.watchface.style.UserStyleData? initialUserStyle);
+ method public static boolean canWatchFaceSupportHeadlessEditing(android.content.pm.PackageManager packageManager, String watchfacePackageName);
method @kotlin.jvm.Throws(exceptionClasses=TimeoutCancellationException::class) public static androidx.wear.watchface.editor.EditorRequest createFromIntent(android.content.Intent intent) throws kotlinx.coroutines.TimeoutCancellationException;
method public String getEditorPackageName();
method public androidx.wear.watchface.client.DeviceConfig? getHeadlessDeviceConfig();
@@ -31,6 +32,7 @@
}
public static final class EditorRequest.Companion {
+ method public boolean canWatchFaceSupportHeadlessEditing(android.content.pm.PackageManager packageManager, String watchfacePackageName);
method @kotlin.jvm.Throws(exceptionClasses=TimeoutCancellationException::class) public androidx.wear.watchface.editor.EditorRequest createFromIntent(android.content.Intent intent) throws kotlinx.coroutines.TimeoutCancellationException;
}
@@ -40,8 +42,8 @@
method public Integer? getBackgroundComplicationSlotId();
method @UiThread public Integer? getComplicationSlotIdAt(@Px int x, @Px int y);
method public kotlinx.coroutines.flow.StateFlow<java.util.Map<java.lang.Integer,androidx.wear.watchface.client.ComplicationSlotState>> getComplicationSlotsState();
- method public suspend Object? getComplicationsDataSourceInfo(kotlin.coroutines.Continuation<? super kotlinx.coroutines.flow.StateFlow<? extends java.util.Map<java.lang.Integer,? extends androidx.wear.complications.ComplicationDataSourceInfo>>> p);
- method public suspend Object? getComplicationsPreviewData(kotlin.coroutines.Continuation<? super kotlinx.coroutines.flow.StateFlow<? extends java.util.Map<java.lang.Integer,? extends androidx.wear.complications.data.ComplicationData>>> p);
+ method public suspend Object? getComplicationsDataSourceInfo(kotlin.coroutines.Continuation<? super kotlinx.coroutines.flow.StateFlow<? extends java.util.Map<java.lang.Integer,? extends androidx.wear.watchface.complications.ComplicationDataSourceInfo>>> p);
+ method public suspend Object? getComplicationsPreviewData(kotlin.coroutines.Continuation<? super kotlinx.coroutines.flow.StateFlow<? extends java.util.Map<java.lang.Integer,? extends androidx.wear.watchface.complications.data.ComplicationData>>> p);
method public java.time.Instant getPreviewReferenceInstant();
method public kotlinx.coroutines.flow.MutableStateFlow<androidx.wear.watchface.style.UserStyle> getUserStyle();
method public androidx.wear.watchface.style.UserStyleSchema getUserStyleSchema();
@@ -49,7 +51,7 @@
method @RequiresApi(android.os.Build.VERSION_CODES.R) public androidx.wear.watchface.client.WatchFaceId getWatchFaceId();
method @UiThread public boolean isCommitChangesOnClose();
method @UiThread public suspend Object? openComplicationDataSourceChooser(int complicationSlotId, kotlin.coroutines.Continuation<? super androidx.wear.watchface.editor.ChosenComplicationDataSource> p);
- method @UiThread public android.graphics.Bitmap renderWatchFaceToBitmap(androidx.wear.watchface.RenderParameters renderParameters, java.time.Instant instant, java.util.Map<java.lang.Integer,? extends androidx.wear.complications.data.ComplicationData>? slotIdToComplicationData);
+ method @UiThread public android.graphics.Bitmap renderWatchFaceToBitmap(androidx.wear.watchface.RenderParameters renderParameters, java.time.Instant instant, java.util.Map<java.lang.Integer,? extends androidx.wear.watchface.complications.data.ComplicationData>? slotIdToComplicationData);
method @UiThread public void setCommitChangesOnClose(boolean commitChangesOnClose);
property public abstract Integer? backgroundComplicationSlotId;
property @UiThread public abstract boolean commitChangesOnClose;
diff --git a/wear/wear-watchface-editor/build.gradle b/wear/watchface/watchface-editor/build.gradle
similarity index 83%
rename from wear/wear-watchface-editor/build.gradle
rename to wear/watchface/watchface-editor/build.gradle
index 58ed02d..64ef142 100644
--- a/wear/wear-watchface-editor/build.gradle
+++ b/wear/watchface/watchface-editor/build.gradle
@@ -28,16 +28,16 @@
api("androidx.annotation:annotation:1.1.0")
api("androidx.versionedparcelable:versionedparcelable:1.1.0")
api("androidx.activity:activity:1.2.0")
- api(project(":wear:wear-watchface-client"))
- api(project(":wear:wear-watchface-data"))
+ api(project(":wear:watchface:watchface-client"))
+ api(project(":wear:watchface:watchface-data"))
api(libs.kotlinStdlib)
api(libs.kotlinCoroutinesAndroid)
implementation("androidx.core:core:1.1.0")
implementation("androidx.lifecycle:lifecycle-common-java8:2.3.1")
- androidTestImplementation(project(":wear:wear-watchface-complications-rendering"))
- androidTestImplementation(project(":wear:wear-watchface-editor-guava"))
+ androidTestImplementation(project(":wear:watchface:watchface-complications-rendering"))
+ androidTestImplementation(project(":wear:watchface:watchface-editor-guava"))
androidTestImplementation(libs.testExtJunit)
androidTestImplementation(libs.testCore)
androidTestImplementation(libs.testRunner)
@@ -45,6 +45,7 @@
androidTestImplementation(libs.mockitoCore, excludes.bytebuddy) // DexMaker has it"s own MockMaker
androidTestImplementation(libs.dexmakerMockito, excludes.bytebuddy) // DexMaker has it"s own MockMaker
androidTestImplementation(libs.kotlinCoroutinesTest)
+ androidTestImplementation(libs.kotlinTest)
androidTestImplementation(libs.truth)
}
@@ -57,8 +58,7 @@
androidx {
name = "Android Wear Watchface Editor"
publish = Publish.SNAPSHOT_AND_RELEASE
- mavenGroup = LibraryGroups.WEAR
- mavenVersion = LibraryVersions.WEAR_WATCHFACE_EDITOR
+ mavenGroup = LibraryGroups.WEAR_WATCHFACE
inceptionYear = "2020"
description = "Classes for building Android Wear watchface editors"
}
diff --git a/wear/watchface/watchface-editor/lint-baseline.xml b/wear/watchface/watchface-editor/lint-baseline.xml
new file mode 100644
index 0000000..3d4c55e
--- /dev/null
+++ b/wear/watchface/watchface-editor/lint-baseline.xml
@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<issues format="6" by="lint 7.2.0-dev" type="baseline" client="gradle" dependencies="false" name="AGP (7.2.0-dev)" variant="all" version="7.2.0-dev">
+
+ <issue
+ id="NewApi"
+ message="Field requires API level 30 (current min is 26): `getWatchFaceId`"
+ errorLine1=" watchFaceId.id"
+ errorLine2=" ~~~~~~~~~~~">
+ <location
+ file="src/main/java/androidx/wear/watchface/editor/EditorSession.kt"
+ line="510"
+ column="21"/>
+ </issue>
+
+ <issue
+ id="NewApi"
+ message="Field requires API level 30 (current min is 26): `getWatchFaceId`"
+ errorLine1=" watchFaceId.id,"
+ errorLine2=" ~~~~~~~~~~~">
+ <location
+ file="src/main/java/androidx/wear/watchface/editor/EditorSession.kt"
+ line="697"
+ column="29"/>
+ </issue>
+
+ <issue
+ id="NewApi"
+ message="Field requires API level 30 (current min is 26): `getWatchFaceId`"
+ errorLine1=" assertThat(it.editorSession.watchFaceId.id).isEqualTo(testInstanceId.id)"
+ errorLine2=" ~~~~~~~~~~~">
+ <location
+ file="src/androidTest/java/androidx/wear/watchface/editor/EditorSessionTest.kt"
+ line="671"
+ column="41"/>
+ </issue>
+
+ <issue
+ id="NewApi"
+ message="Field requires API level 30 (current min is 26): `getWatchFaceId`"
+ errorLine1=" assertThat(activity.editorSession.watchFaceId.id).isEqualTo(testInstanceId.id)"
+ errorLine2=" ~~~~~~~~~~~">
+ <location
+ file="src/androidTest/java/androidx/wear/watchface/editor/EditorSessionTest.kt"
+ line="690"
+ column="43"/>
+ </issue>
+
+</issues>
diff --git a/wear/wear-watchface-editor/samples/build.gradle b/wear/watchface/watchface-editor/samples/build.gradle
similarity index 89%
rename from wear/wear-watchface-editor/samples/build.gradle
rename to wear/watchface/watchface-editor/samples/build.gradle
index 8a391bb..a87188a 100644
--- a/wear/wear-watchface-editor/samples/build.gradle
+++ b/wear/watchface/watchface-editor/samples/build.gradle
@@ -28,15 +28,14 @@
compileOnly(project(":annotation:annotation-sampled"))
api("androidx.fragment:fragment:1.3.0")
implementation("androidx.wear:wear:1.1.0-rc01")
- api(project(":wear:wear-watchface-editor"))
+ api(project(":wear:watchface:watchface-editor"))
api(libs.kotlinStdlib)
}
androidx {
name = "AndroidX Wear Editor Samples"
type = LibraryType.SAMPLES
- mavenGroup = LibraryGroups.WEAR
- mavenVersion = LibraryVersions.WEAR_WATCHFACE_EDITOR
+ mavenGroup = LibraryGroups.WEAR_WATCHFACE
inceptionYear = "2020"
description = "Contains sample code for the Androidx Wear Editor library"
}
diff --git a/wear/wear-watchface-editor/samples/src/main/AndroidManifest.xml b/wear/watchface/watchface-editor/samples/src/main/AndroidManifest.xml
similarity index 100%
rename from wear/wear-watchface-editor/samples/src/main/AndroidManifest.xml
rename to wear/watchface/watchface-editor/samples/src/main/AndroidManifest.xml
diff --git a/wear/wear-watchface-editor/samples/src/main/java/androidx/wear/watchface/editor/sample/ComplicationConfigFragment.kt b/wear/watchface/watchface-editor/samples/src/main/java/androidx/wear/watchface/editor/sample/ComplicationConfigFragment.kt
similarity index 98%
rename from wear/wear-watchface-editor/samples/src/main/java/androidx/wear/watchface/editor/sample/ComplicationConfigFragment.kt
rename to wear/watchface/watchface-editor/samples/src/main/java/androidx/wear/watchface/editor/sample/ComplicationConfigFragment.kt
index f63b16f..491369a 100644
--- a/wear/wear-watchface-editor/samples/src/main/java/androidx/wear/watchface/editor/sample/ComplicationConfigFragment.kt
+++ b/wear/watchface/watchface-editor/samples/src/main/java/androidx/wear/watchface/editor/sample/ComplicationConfigFragment.kt
@@ -28,7 +28,7 @@
import android.widget.Button
import androidx.annotation.RestrictTo
import androidx.fragment.app.Fragment
-import androidx.wear.complications.data.ComplicationData
+import androidx.wear.watchface.complications.data.ComplicationData
import androidx.wear.watchface.DrawMode
import androidx.wear.watchface.RenderParameters
import androidx.wear.watchface.RenderParameters.HighlightLayer
diff --git a/wear/wear-watchface-editor/samples/src/main/java/androidx/wear/watchface/editor/sample/ConfigFragment.kt b/wear/watchface/watchface-editor/samples/src/main/java/androidx/wear/watchface/editor/sample/ConfigFragment.kt
similarity index 98%
rename from wear/wear-watchface-editor/samples/src/main/java/androidx/wear/watchface/editor/sample/ConfigFragment.kt
rename to wear/watchface/watchface-editor/samples/src/main/java/androidx/wear/watchface/editor/sample/ConfigFragment.kt
index 838a8e4..240fb8b 100644
--- a/wear/wear-watchface-editor/samples/src/main/java/androidx/wear/watchface/editor/sample/ConfigFragment.kt
+++ b/wear/watchface/watchface-editor/samples/src/main/java/androidx/wear/watchface/editor/sample/ConfigFragment.kt
@@ -35,7 +35,7 @@
import androidx.lifecycle.Lifecycle
import androidx.lifecycle.LifecycleEventObserver
import androidx.recyclerview.widget.RecyclerView
-import androidx.wear.complications.ComplicationDataSourceInfoRetriever
+import androidx.wear.watchface.complications.ComplicationDataSourceInfoRetriever
import androidx.wear.watchface.R
import androidx.wear.widget.SwipeDismissFrameLayout
import androidx.wear.widget.WearableLinearLayoutManager
diff --git a/wear/wear-watchface-editor/samples/src/main/java/androidx/wear/watchface/editor/sample/StyleConfigFragment.kt b/wear/watchface/watchface-editor/samples/src/main/java/androidx/wear/watchface/editor/sample/StyleConfigFragment.kt
similarity index 100%
rename from wear/wear-watchface-editor/samples/src/main/java/androidx/wear/watchface/editor/sample/StyleConfigFragment.kt
rename to wear/watchface/watchface-editor/samples/src/main/java/androidx/wear/watchface/editor/sample/StyleConfigFragment.kt
diff --git a/wear/wear-watchface-editor/samples/src/main/java/androidx/wear/watchface/editor/sample/WatchFaceConfigActivity.kt b/wear/watchface/watchface-editor/samples/src/main/java/androidx/wear/watchface/editor/sample/WatchFaceConfigActivity.kt
similarity index 100%
rename from wear/wear-watchface-editor/samples/src/main/java/androidx/wear/watchface/editor/sample/WatchFaceConfigActivity.kt
rename to wear/watchface/watchface-editor/samples/src/main/java/androidx/wear/watchface/editor/sample/WatchFaceConfigActivity.kt
diff --git a/wear/wear-watchface-editor/src/androidTest/AndroidManifest.xml b/wear/watchface/watchface-editor/src/androidTest/AndroidManifest.xml
similarity index 100%
rename from wear/wear-watchface-editor/src/androidTest/AndroidManifest.xml
rename to wear/watchface/watchface-editor/src/androidTest/AndroidManifest.xml
diff --git a/wear/wear-watchface-editor/src/androidTest/java/androidx/wear/watchface/editor/EditorSessionGuavaTest.kt b/wear/watchface/watchface-editor/src/androidTest/java/androidx/wear/watchface/editor/EditorSessionGuavaTest.kt
similarity index 96%
rename from wear/wear-watchface-editor/src/androidTest/java/androidx/wear/watchface/editor/EditorSessionGuavaTest.kt
rename to wear/watchface/watchface-editor/src/androidTest/java/androidx/wear/watchface/editor/EditorSessionGuavaTest.kt
index a23a66c..6abee71 100644
--- a/wear/wear-watchface-editor/src/androidTest/java/androidx/wear/watchface/editor/EditorSessionGuavaTest.kt
+++ b/wear/watchface/watchface-editor/src/androidTest/java/androidx/wear/watchface/editor/EditorSessionGuavaTest.kt
@@ -30,13 +30,13 @@
import androidx.test.core.app.ApplicationProvider
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.MediumTest
-import androidx.wear.complications.ComplicationDataSourceInfo
-import androidx.wear.complications.ComplicationSlotBounds
-import androidx.wear.complications.DefaultComplicationDataSourcePolicy
-import androidx.wear.complications.SystemDataSources
-import androidx.wear.complications.data.ComplicationType
-import androidx.wear.complications.data.LongTextComplicationData
-import androidx.wear.complications.data.ShortTextComplicationData
+import androidx.wear.watchface.complications.ComplicationDataSourceInfo
+import androidx.wear.watchface.complications.ComplicationSlotBounds
+import androidx.wear.watchface.complications.DefaultComplicationDataSourcePolicy
+import androidx.wear.watchface.complications.SystemDataSources
+import androidx.wear.watchface.complications.data.ComplicationType
+import androidx.wear.watchface.complications.data.LongTextComplicationData
+import androidx.wear.watchface.complications.data.ShortTextComplicationData
import androidx.wear.watchface.CanvasComplication
import androidx.wear.watchface.ComplicationDataSourceChooserIntent
import androidx.wear.watchface.ComplicationHelperActivity
diff --git a/wear/wear-watchface-editor/src/androidTest/java/androidx/wear/watchface/editor/EditorSessionTest.kt b/wear/watchface/watchface-editor/src/androidTest/java/androidx/wear/watchface/editor/EditorSessionTest.kt
similarity index 95%
rename from wear/wear-watchface-editor/src/androidTest/java/androidx/wear/watchface/editor/EditorSessionTest.kt
rename to wear/watchface/watchface-editor/src/androidTest/java/androidx/wear/watchface/editor/EditorSessionTest.kt
index 58a7f33..dc9b220 100644
--- a/wear/wear-watchface-editor/src/androidTest/java/androidx/wear/watchface/editor/EditorSessionTest.kt
+++ b/wear/watchface/watchface-editor/src/androidTest/java/androidx/wear/watchface/editor/EditorSessionTest.kt
@@ -21,6 +21,8 @@
import android.content.ComponentName
import android.content.Context
import android.content.Intent
+import android.content.pm.ApplicationInfo
+import android.content.pm.PackageManager
import android.graphics.Bitmap
import android.graphics.Canvas
import android.graphics.Color
@@ -43,17 +45,17 @@
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.MediumTest
import androidx.test.filters.SdkSuppress
-import androidx.wear.complications.ComplicationDataSourceInfo
-import androidx.wear.complications.ComplicationDataSourceInfoRetriever
-import androidx.wear.complications.ComplicationSlotBounds
-import androidx.wear.complications.DefaultComplicationDataSourcePolicy
-import androidx.wear.complications.SystemDataSources
-import androidx.wear.complications.data.ComplicationText
-import androidx.wear.complications.data.ComplicationType
-import androidx.wear.complications.data.EmptyComplicationData
-import androidx.wear.complications.data.LongTextComplicationData
-import androidx.wear.complications.data.PlainComplicationText
-import androidx.wear.complications.data.ShortTextComplicationData
+import androidx.wear.watchface.complications.ComplicationDataSourceInfo
+import androidx.wear.watchface.complications.ComplicationDataSourceInfoRetriever
+import androidx.wear.watchface.complications.ComplicationSlotBounds
+import androidx.wear.watchface.complications.DefaultComplicationDataSourcePolicy
+import androidx.wear.watchface.complications.SystemDataSources
+import androidx.wear.watchface.complications.data.ComplicationText
+import androidx.wear.watchface.complications.data.ComplicationType
+import androidx.wear.watchface.complications.data.EmptyComplicationData
+import androidx.wear.watchface.complications.data.LongTextComplicationData
+import androidx.wear.watchface.complications.data.PlainComplicationText
+import androidx.wear.watchface.complications.data.ShortTextComplicationData
import androidx.wear.watchface.BroadcastsObserver
import androidx.wear.watchface.CanvasComplication
import androidx.wear.watchface.CanvasType
@@ -76,6 +78,7 @@
import androidx.wear.watchface.complications.rendering.CanvasComplicationDrawable
import androidx.wear.watchface.complications.rendering.ComplicationDrawable
import androidx.wear.watchface.ComplicationSlotBoundsType
+import androidx.wear.watchface.complications.data.ComplicationData
import androidx.wear.watchface.editor.EditorSession.Companion.EDITING_SESSION_TIMEOUT
import androidx.wear.watchface.editor.data.EditorStateWireFormat
import androidx.wear.watchface.style.CurrentUserStyleRepository
@@ -97,6 +100,7 @@
import kotlinx.coroutines.launch
import kotlinx.coroutines.runBlocking
import kotlinx.coroutines.withContext
+import kotlin.test.assertFailsWith
import org.junit.After
import org.junit.Assert.assertFalse
import org.junit.Assert.assertNotNull
@@ -111,6 +115,7 @@
import org.mockito.Mockito.`when`
import org.mockito.Mockito.doAnswer
import org.mockito.Mockito.mock
+import java.lang.IllegalArgumentException
import java.time.Instant
import java.time.ZonedDateTime
import java.util.concurrent.CountDownLatch
@@ -550,7 +555,7 @@
override var userStyle: UserStyle
get() = userStyleRepository.userStyle.value
set(value) {
- userStyleRepository.userStyle.value = value
+ userStyleRepository.updateUserStyle(value)
}
override val complicationSlotsManager = complicationSlotsManager
@@ -562,7 +567,7 @@
renderParameters: RenderParameters,
instant: Instant,
slotIdToComplicationData:
- Map<Int, androidx.wear.complications.data.ComplicationData>?
+ Map<Int, ComplicationData>?
) = fakeBitmap
override fun onDestroy() {
@@ -2140,6 +2145,75 @@
)
}
}
+
+ @Test
+ public fun watchfaceSupportsHeadlessEditing() {
+ val mockPackageManager = Mockito.mock(PackageManager::class.java)
+
+ `when`(mockPackageManager.getApplicationInfo("test.package", PackageManager.GET_META_DATA))
+ .thenReturn(
+ ApplicationInfo().apply {
+ metaData = Bundle().apply {
+ putString(EditorRequest.ANDROIDX_WATCHFACE_API_VERSION, "4")
+ }
+ }
+ )
+
+ assertThat(
+ EditorRequest.canWatchFaceSupportHeadlessEditing(mockPackageManager, "test.package")
+ ).isTrue()
+ }
+
+ @Test
+ public fun watchfaceSupportsHeadlessEditing_oldApi() {
+ val mockPackageManager = Mockito.mock(PackageManager::class.java)
+
+ `when`(mockPackageManager.getApplicationInfo("test.package", PackageManager.GET_META_DATA))
+ .thenReturn(
+ ApplicationInfo().apply {
+ metaData = Bundle().apply {
+ putString(EditorRequest.ANDROIDX_WATCHFACE_API_VERSION, "3")
+ }
+ }
+ )
+
+ assertThat(
+ EditorRequest.canWatchFaceSupportHeadlessEditing(mockPackageManager, "test.package")
+ ).isFalse()
+ }
+
+ @Test
+ public fun cantAssignUnrelatedUserStyle() {
+ val redOption = ListOption(Option.Id("red"), "Red", icon = null)
+ val greenOption = ListOption(Option.Id("green"), "Green", icon = null)
+ val colorStyleList = listOf(redOption, greenOption)
+ val watchColorSetting = UserStyleSetting.ListUserStyleSetting(
+ UserStyleSetting.Id("color_id"),
+ "Color",
+ "Watch face color", /* icon = */
+ null,
+ colorStyleList,
+ listOf(WatchFaceLayer.COMPLICATIONS_OVERLAY)
+ )
+
+ val scenario = createOnWatchFaceEditingTestActivity(
+ listOf(colorStyleSetting, watchHandStyleSetting),
+ listOf(leftComplication, rightComplication)
+ )
+
+ scenario.onActivity { activity ->
+ try {
+ // Trying to set an unrelated UserStyle should fail.
+ assertFailsWith<IllegalArgumentException> {
+ activity.editorSession.userStyle.value =
+ UserStyle(mapOf(watchColorSetting to greenOption))
+ }
+ } finally {
+ activity.editorSession.close()
+ activity.finish()
+ }
+ }
+ }
}
@SuppressLint("NewApi") // icon.type
diff --git a/wear/wear-watchface-editor/src/main/AndroidManifest.xml b/wear/watchface/watchface-editor/src/main/AndroidManifest.xml
similarity index 100%
rename from wear/wear-watchface-editor/src/main/AndroidManifest.xml
rename to wear/watchface/watchface-editor/src/main/AndroidManifest.xml
diff --git a/wear/wear-watchface-editor/src/main/java/androidx/wear/watchface/editor/EditorSession.kt b/wear/watchface/watchface-editor/src/main/java/androidx/wear/watchface/editor/EditorSession.kt
similarity index 94%
rename from wear/wear-watchface-editor/src/main/java/androidx/wear/watchface/editor/EditorSession.kt
rename to wear/watchface/watchface-editor/src/main/java/androidx/wear/watchface/editor/EditorSession.kt
index 23b6d7b..816ac65 100644
--- a/wear/wear-watchface-editor/src/main/java/androidx/wear/watchface/editor/EditorSession.kt
+++ b/wear/watchface/watchface-editor/src/main/java/androidx/wear/watchface/editor/EditorSession.kt
@@ -35,14 +35,14 @@
import androidx.annotation.UiThread
import androidx.lifecycle.DefaultLifecycleObserver
import androidx.lifecycle.LifecycleOwner
-import androidx.wear.complications.ComplicationDataSourceInfo
-import androidx.wear.complications.ComplicationDataSourceInfoRetriever
-import androidx.wear.complications.data.ComplicationData
-import androidx.wear.complications.data.EmptyComplicationData
-import androidx.wear.complications.toApiComplicationDataSourceInfo
-import androidx.wear.utility.AsyncTraceEvent
-import androidx.wear.utility.TraceEvent
-import androidx.wear.utility.launchWithTracing
+import androidx.wear.watchface.complications.ComplicationDataSourceInfo
+import androidx.wear.watchface.complications.ComplicationDataSourceInfoRetriever
+import androidx.wear.watchface.complications.data.ComplicationData
+import androidx.wear.watchface.complications.data.EmptyComplicationData
+import androidx.wear.watchface.complications.toApiComplicationDataSourceInfo
+import androidx.wear.watchface.utility.AsyncTraceEvent
+import androidx.wear.watchface.utility.TraceEvent
+import androidx.wear.watchface.utility.launchWithTracing
import androidx.wear.watchface.ComplicationHelperActivity
import androidx.wear.watchface.DrawMode
import androidx.wear.watchface.RenderParameters
@@ -76,6 +76,7 @@
import kotlinx.coroutines.runBlocking
import kotlinx.coroutines.withContext
import kotlinx.coroutines.withTimeout
+import java.lang.reflect.Proxy
import java.time.Duration
import java.time.Instant
import kotlin.coroutines.resume
@@ -111,7 +112,7 @@
* changes to the watch face will be reverted upon exit.
*
* If accessed from java, consider using
- * [androidx.wear.watchface.StateFlowCompatHelper] to observe callbacks.
+ * [androidx.lifecycle.FlowLiveDataConversions.asLiveData] to observe changes.
*/
public val userStyle: MutableStateFlow<UserStyle>
@@ -126,7 +127,7 @@
* slot.
*
* If accessed from java, consider using
- * [androidx.wear.watchface.StateFlowCompatHelper] to observe callbacks.
+ * [androidx.lifecycle.FlowLiveDataConversions.asLiveData] to observe changes.
*/
public val complicationSlotsState: StateFlow<Map<Int, ComplicationSlotState>>
@@ -157,7 +158,7 @@
* [openComplicationDataSourceChooser].
*
* If accessed from java, consider using
- * [androidx.wear.watchface.StateFlowCompatHelper] to observe callbacks.
+ * [androidx.lifecycle.FlowLiveDataConversions.asLiveData] to observe changes.
*/
public suspend fun getComplicationsPreviewData(): StateFlow<Map<Int, ComplicationData>>
@@ -798,7 +799,39 @@
}
}
- override val userStyle by lazy { MutableStateFlow(editorDelegate.userStyle) }
+ internal val wrappedUserStyle by lazy { MutableStateFlow(editorDelegate.userStyle) }
+
+ // Unfortunately a dynamic proxy is the only way we can reasonably validate the UserStyle,
+ // exceptions thrown within a coroutine are lost and the MutableStateFlow interface includes
+ // internal unstable methods so we can't use a static proxy...
+ @Suppress("BanUncheckedReflection", "UNCHECKED_CAST")
+ override val userStyle = Proxy.newProxyInstance(
+ MutableStateFlow::class.java.classLoader,
+ arrayOf<Class<*>>(MutableStateFlow::class.java)
+ ) { _, method, args ->
+ if (args == null) {
+ method?.invoke(wrappedUserStyle)
+ } else {
+ if (method?.name == "setValue") {
+ validateAndUpdateUserStyle(args[0] as UserStyle)
+ }
+ method?.invoke(wrappedUserStyle, *args)
+ }
+ } as MutableStateFlow<UserStyle>
+
+ internal fun validateAndUpdateUserStyle(userStyle: UserStyle) {
+ for (userStyleSetting in userStyle.keys) {
+ require(userStyleSchema.userStyleSettings.contains(userStyleSetting)) {
+ "A userStyleSetting (userStyleSetting) in userStyle does not match references in " +
+ "EditorSession's userStyleSchema."
+ }
+ }
+
+ editorDelegate.userStyle = userStyle
+
+ // Changing the style may enable/disable complications.
+ maybeUpdateComplicationSlotsState()
+ }
private lateinit var previousWatchFaceUserStyle: UserStyle
private lateinit var backgroundCoroutineScope: CoroutineScope
@@ -871,20 +904,6 @@
)
fetchComplicationsDataJob = fetchComplicationsData(backgroundCoroutineScope)
-
- coroutineScope.launch {
- var first = true
- userStyle.collect {
- // We can ignore the first callback because it's for the initial style.
- if (!first) {
- editorDelegate.userStyle = it
-
- // Changing the style may enable/disable complications.
- maybeUpdateComplicationSlotsState()
- }
- first = false
- }
- }
}
}
diff --git a/wear/wear-watchface-editor/src/main/java/androidx/wear/watchface/editor/WatchFaceEditorContract.kt b/wear/watchface/watchface-editor/src/main/java/androidx/wear/watchface/editor/WatchFaceEditorContract.kt
similarity index 90%
rename from wear/wear-watchface-editor/src/main/java/androidx/wear/watchface/editor/WatchFaceEditorContract.kt
rename to wear/watchface/watchface-editor/src/main/java/androidx/wear/watchface/editor/WatchFaceEditorContract.kt
index af52c49..119b579 100644
--- a/wear/wear-watchface-editor/src/main/java/androidx/wear/watchface/editor/WatchFaceEditorContract.kt
+++ b/wear/watchface/watchface-editor/src/main/java/androidx/wear/watchface/editor/WatchFaceEditorContract.kt
@@ -21,6 +21,7 @@
import android.content.ComponentName
import android.content.Context
import android.content.Intent
+import android.content.pm.PackageManager
import android.os.Build
import androidx.activity.result.contract.ActivityResultContract
import androidx.annotation.RequiresApi
@@ -90,6 +91,7 @@
* @param headlessDeviceConfig If `non-null` then this is the [DeviceConfig] to use when creating
* a headless instance to back the [EditorSession]. If `null` then the current interactive instance
* will be used. If there isn't one then the [EditorSession] won't launch until it's been created.
+ * Note [canWatchFaceSupportHeadlessEditing] can be used to determine if this feature is supported.
* @param previewScreenshotParams If `non-null` then [EditorSession] upon
* closing will render a screenshot with [PreviewScreenshotParams] using the existing interactive
* or headless instance which will be sent in [EditorState] to any registered clients.
@@ -164,6 +166,25 @@
)
}
)
+
+ internal const val ANDROIDX_WATCHFACE_API_VERSION = "androidx.wear.watchface.api_version"
+
+ /**
+ * Inspects the watchface's manifest to determine whether or not it supports headless
+ * editing.
+ */
+ @JvmStatic
+ public fun canWatchFaceSupportHeadlessEditing(
+ packageManager: PackageManager,
+ watchfacePackageName: String
+ ): Boolean {
+ val metaData = packageManager.getApplicationInfo(
+ watchfacePackageName, PackageManager.GET_META_DATA
+ ).metaData
+ val apiVersion =
+ metaData.getString(ANDROIDX_WATCHFACE_API_VERSION)?.toInt() ?: return false
+ return apiVersion >= 4
+ }
}
}
diff --git a/wear/watchface/watchface-guava/api/api_lint.ignore b/wear/watchface/watchface-guava/api/api_lint.ignore
new file mode 100644
index 0000000..bd7afd7
--- /dev/null
+++ b/wear/watchface/watchface-guava/api/api_lint.ignore
@@ -0,0 +1,9 @@
+// Baseline format: 1.0
+AsyncSuffixFuture: androidx.wear.watchface.ListenableCanvasRenderer#initFuture():
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
+AsyncSuffixFuture: androidx.wear.watchface.ListenableGlesRenderer#onBackgroundThreadGlContextCreatedFuture():
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
+AsyncSuffixFuture: androidx.wear.watchface.ListenableGlesRenderer#onUiThreadGlSurfaceCreatedFuture(int, int):
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
+AsyncSuffixFuture: androidx.wear.watchface.ListenableWatchFaceService#createWatchFaceFuture(android.view.SurfaceHolder, androidx.wear.watchface.WatchState, androidx.wear.watchface.ComplicationSlotsManager, androidx.wear.watchface.style.CurrentUserStyleRepository):
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
diff --git a/wear/wear-watchface-guava/api/current.txt b/wear/watchface/watchface-guava/api/current.txt
similarity index 82%
rename from wear/wear-watchface-guava/api/current.txt
rename to wear/watchface/watchface-guava/api/current.txt
index e2902af..a01ac28 100644
--- a/wear/wear-watchface-guava/api/current.txt
+++ b/wear/watchface/watchface-guava/api/current.txt
@@ -26,15 +26,5 @@
method protected abstract com.google.common.util.concurrent.ListenableFuture<androidx.wear.watchface.WatchFace> createWatchFaceFuture(android.view.SurfaceHolder surfaceHolder, androidx.wear.watchface.WatchState watchState, androidx.wear.watchface.ComplicationSlotsManager complicationSlotsManager, androidx.wear.watchface.style.CurrentUserStyleRepository currentUserStyleRepository);
}
- public final class StateFlowCompatHelper<T> {
- ctor public StateFlowCompatHelper(kotlinx.coroutines.flow.StateFlow<? extends T> stateFlow);
- method public void addValueChangeListener(androidx.wear.watchface.StateFlowCompatHelper.ValueChangeListener<T> userStyleChangeListener, java.util.concurrent.Executor executor);
- method public void removeValueChangeListener(androidx.wear.watchface.StateFlowCompatHelper.ValueChangeListener<T> userStyleChangeListener);
- }
-
- public static fun interface StateFlowCompatHelper.ValueChangeListener<T> {
- method @UiThread public void onValueChanged(T? userStyle);
- }
-
}
diff --git a/wear/wear-watchface-guava/api/public_plus_experimental_current.txt b/wear/watchface/watchface-guava/api/public_plus_experimental_current.txt
similarity index 82%
rename from wear/wear-watchface-guava/api/public_plus_experimental_current.txt
rename to wear/watchface/watchface-guava/api/public_plus_experimental_current.txt
index e2902af..a01ac28 100644
--- a/wear/wear-watchface-guava/api/public_plus_experimental_current.txt
+++ b/wear/watchface/watchface-guava/api/public_plus_experimental_current.txt
@@ -26,15 +26,5 @@
method protected abstract com.google.common.util.concurrent.ListenableFuture<androidx.wear.watchface.WatchFace> createWatchFaceFuture(android.view.SurfaceHolder surfaceHolder, androidx.wear.watchface.WatchState watchState, androidx.wear.watchface.ComplicationSlotsManager complicationSlotsManager, androidx.wear.watchface.style.CurrentUserStyleRepository currentUserStyleRepository);
}
- public final class StateFlowCompatHelper<T> {
- ctor public StateFlowCompatHelper(kotlinx.coroutines.flow.StateFlow<? extends T> stateFlow);
- method public void addValueChangeListener(androidx.wear.watchface.StateFlowCompatHelper.ValueChangeListener<T> userStyleChangeListener, java.util.concurrent.Executor executor);
- method public void removeValueChangeListener(androidx.wear.watchface.StateFlowCompatHelper.ValueChangeListener<T> userStyleChangeListener);
- }
-
- public static fun interface StateFlowCompatHelper.ValueChangeListener<T> {
- method @UiThread public void onValueChanged(T? userStyle);
- }
-
}
diff --git a/wear/wear-watchface-guava/api/res-current.txt b/wear/watchface/watchface-guava/api/res-current.txt
similarity index 100%
rename from wear/wear-watchface-guava/api/res-current.txt
rename to wear/watchface/watchface-guava/api/res-current.txt
diff --git a/wear/wear-watchface-guava/api/restricted_current.txt b/wear/watchface/watchface-guava/api/restricted_current.txt
similarity index 82%
rename from wear/wear-watchface-guava/api/restricted_current.txt
rename to wear/watchface/watchface-guava/api/restricted_current.txt
index e2902af..a01ac28 100644
--- a/wear/wear-watchface-guava/api/restricted_current.txt
+++ b/wear/watchface/watchface-guava/api/restricted_current.txt
@@ -26,15 +26,5 @@
method protected abstract com.google.common.util.concurrent.ListenableFuture<androidx.wear.watchface.WatchFace> createWatchFaceFuture(android.view.SurfaceHolder surfaceHolder, androidx.wear.watchface.WatchState watchState, androidx.wear.watchface.ComplicationSlotsManager complicationSlotsManager, androidx.wear.watchface.style.CurrentUserStyleRepository currentUserStyleRepository);
}
- public final class StateFlowCompatHelper<T> {
- ctor public StateFlowCompatHelper(kotlinx.coroutines.flow.StateFlow<? extends T> stateFlow);
- method public void addValueChangeListener(androidx.wear.watchface.StateFlowCompatHelper.ValueChangeListener<T> userStyleChangeListener, java.util.concurrent.Executor executor);
- method public void removeValueChangeListener(androidx.wear.watchface.StateFlowCompatHelper.ValueChangeListener<T> userStyleChangeListener);
- }
-
- public static fun interface StateFlowCompatHelper.ValueChangeListener<T> {
- method @UiThread public void onValueChanged(T? userStyle);
- }
-
}
diff --git a/wear/wear-watchface-guava/build.gradle b/wear/watchface/watchface-guava/build.gradle
similarity index 90%
rename from wear/wear-watchface-guava/build.gradle
rename to wear/watchface/watchface-guava/build.gradle
index d355b9c..0bf5492 100644
--- a/wear/wear-watchface-guava/build.gradle
+++ b/wear/watchface/watchface-guava/build.gradle
@@ -26,10 +26,10 @@
}
dependencies {
- api(project(":wear:wear-watchface"))
+ api(project(":wear:watchface:watchface"))
api(libs.guavaAndroid)
- androidTestImplementation(project(":wear:wear-watchface-client"))
+ androidTestImplementation(project(":wear:watchface:watchface-client"))
androidTestImplementation(libs.testExtJunit)
androidTestImplementation(libs.testCore)
androidTestImplementation(libs.testRunner)
@@ -48,8 +48,7 @@
androidx {
name = "AndroidX Wear Watchface Guava"
type = LibraryType.PUBLISHED_LIBRARY
- mavenGroup = LibraryGroups.WEAR
- mavenVersion = LibraryVersions.WEAR_WATCHFACE
+ mavenGroup = LibraryGroups.WEAR_WATCHFACE
inceptionYear = "2021"
description = "Guava wrappers for the Androidx Wear Watchface library"
}
diff --git a/wear/watchface/watchface-guava/lint-baseline.xml b/wear/watchface/watchface-guava/lint-baseline.xml
new file mode 100644
index 0000000..2228767
--- /dev/null
+++ b/wear/watchface/watchface-guava/lint-baseline.xml
@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<issues format="6" by="lint 7.2.0-dev" type="baseline" client="gradle" dependencies="false" name="AGP (7.2.0-dev)" variant="all" version="7.2.0-dev">
+
+ <issue
+ id="NewApi"
+ message="Call requires API level 27 (current min is 26): `WatchFaceControlService`"
+ errorLine1=" private val realService = object : WatchFaceControlService() {"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/androidTest/java/androidx/wear/watchface/test/WatchFaceControlTestService.kt"
+ line="62"
+ column="31"/>
+ </issue>
+
+ <issue
+ id="NewApi"
+ message="Extending WatchFaceControlService requires API level 27 (current min is 26): `WatchFaceControlService`"
+ errorLine1=" private val realService = object : WatchFaceControlService() {"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/androidTest/java/androidx/wear/watchface/test/WatchFaceControlTestService.kt"
+ line="62"
+ column="40"/>
+ </issue>
+
+ <issue
+ id="NewApi"
+ message="Call requires API level 27 (current min is 26): `IWatchFaceInstanceServiceStub`"
+ errorLine1=" object : IWatchFaceInstanceServiceStub(this, Handler(Looper.getMainLooper())) {"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/androidTest/java/androidx/wear/watchface/test/WatchFaceControlTestService.kt"
+ line="64"
+ column="13"/>
+ </issue>
+
+ <issue
+ id="NewApi"
+ message="Extending IWatchFaceInstanceServiceStub requires API level 27 (current min is 26): `IWatchFaceInstanceServiceStub`"
+ errorLine1=" object : IWatchFaceInstanceServiceStub(this, Handler(Looper.getMainLooper())) {"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/androidTest/java/androidx/wear/watchface/test/WatchFaceControlTestService.kt"
+ line="64"
+ column="22"/>
+ </issue>
+
+</issues>
diff --git a/wear/wear-watchface-guava/src/androidTest/AndroidManifest.xml b/wear/watchface/watchface-guava/src/androidTest/AndroidManifest.xml
similarity index 100%
rename from wear/wear-watchface-guava/src/androidTest/AndroidManifest.xml
rename to wear/watchface/watchface-guava/src/androidTest/AndroidManifest.xml
diff --git a/wear/wear-watchface-guava/src/androidTest/java/androidx/wear/watchface/test/AsyncListenableCanvasRendererTest.kt b/wear/watchface/watchface-guava/src/androidTest/java/androidx/wear/watchface/test/AsyncListenableCanvasRendererTest.kt
similarity index 100%
rename from wear/wear-watchface-guava/src/androidTest/java/androidx/wear/watchface/test/AsyncListenableCanvasRendererTest.kt
rename to wear/watchface/watchface-guava/src/androidTest/java/androidx/wear/watchface/test/AsyncListenableCanvasRendererTest.kt
diff --git a/wear/wear-watchface-guava/src/androidTest/java/androidx/wear/watchface/test/AsyncListenableGlesRendererTest.kt b/wear/watchface/watchface-guava/src/androidTest/java/androidx/wear/watchface/test/AsyncListenableGlesRendererTest.kt
similarity index 100%
rename from wear/wear-watchface-guava/src/androidTest/java/androidx/wear/watchface/test/AsyncListenableGlesRendererTest.kt
rename to wear/watchface/watchface-guava/src/androidTest/java/androidx/wear/watchface/test/AsyncListenableGlesRendererTest.kt
diff --git a/wear/wear-watchface-guava/src/androidTest/java/androidx/wear/watchface/test/AsyncListenableWatchFaceServiceTest.kt b/wear/watchface/watchface-guava/src/androidTest/java/androidx/wear/watchface/test/AsyncListenableWatchFaceServiceTest.kt
similarity index 100%
rename from wear/wear-watchface-guava/src/androidTest/java/androidx/wear/watchface/test/AsyncListenableWatchFaceServiceTest.kt
rename to wear/watchface/watchface-guava/src/androidTest/java/androidx/wear/watchface/test/AsyncListenableWatchFaceServiceTest.kt
diff --git a/wear/wear-watchface-guava/src/androidTest/java/androidx/wear/watchface/test/WatchFaceControlTestService.kt b/wear/watchface/watchface-guava/src/androidTest/java/androidx/wear/watchface/test/WatchFaceControlTestService.kt
similarity index 100%
rename from wear/wear-watchface-guava/src/androidTest/java/androidx/wear/watchface/test/WatchFaceControlTestService.kt
rename to wear/watchface/watchface-guava/src/androidTest/java/androidx/wear/watchface/test/WatchFaceControlTestService.kt
diff --git a/wear/wear-watchface-guava/src/main/AndroidManifest.xml b/wear/watchface/watchface-guava/src/main/AndroidManifest.xml
similarity index 100%
rename from wear/wear-watchface-guava/src/main/AndroidManifest.xml
rename to wear/watchface/watchface-guava/src/main/AndroidManifest.xml
diff --git a/wear/wear-watchface-guava/src/main/java/androidx/wear/watchface/ListenableCanvasRenderer.kt b/wear/watchface/watchface-guava/src/main/java/androidx/wear/watchface/ListenableCanvasRenderer.kt
similarity index 100%
rename from wear/wear-watchface-guava/src/main/java/androidx/wear/watchface/ListenableCanvasRenderer.kt
rename to wear/watchface/watchface-guava/src/main/java/androidx/wear/watchface/ListenableCanvasRenderer.kt
diff --git a/wear/wear-watchface-guava/src/main/java/androidx/wear/watchface/ListenableGlesRenderer.kt b/wear/watchface/watchface-guava/src/main/java/androidx/wear/watchface/ListenableGlesRenderer.kt
similarity index 100%
rename from wear/wear-watchface-guava/src/main/java/androidx/wear/watchface/ListenableGlesRenderer.kt
rename to wear/watchface/watchface-guava/src/main/java/androidx/wear/watchface/ListenableGlesRenderer.kt
diff --git a/wear/wear-watchface-guava/src/main/java/androidx/wear/watchface/ListenableWatchFaceService.kt b/wear/watchface/watchface-guava/src/main/java/androidx/wear/watchface/ListenableWatchFaceService.kt
similarity index 100%
rename from wear/wear-watchface-guava/src/main/java/androidx/wear/watchface/ListenableWatchFaceService.kt
rename to wear/watchface/watchface-guava/src/main/java/androidx/wear/watchface/ListenableWatchFaceService.kt
diff --git a/wear/wear-watchface-guava/src/test/java/androidx/wear/watchface/ListenableWatchFaceServiceTest.kt b/wear/watchface/watchface-guava/src/test/java/androidx/wear/watchface/ListenableWatchFaceServiceTest.kt
similarity index 100%
rename from wear/wear-watchface-guava/src/test/java/androidx/wear/watchface/ListenableWatchFaceServiceTest.kt
rename to wear/watchface/watchface-guava/src/test/java/androidx/wear/watchface/ListenableWatchFaceServiceTest.kt
diff --git a/wear/wear-watchface-guava/src/test/resources/robolectric.properties b/wear/watchface/watchface-guava/src/test/resources/robolectric.properties
similarity index 100%
rename from wear/wear-watchface-guava/src/test/resources/robolectric.properties
rename to wear/watchface/watchface-guava/src/test/resources/robolectric.properties
diff --git a/wear/wear-watchface-samples-minimal-complications/build.gradle b/wear/watchface/watchface-samples-minimal-complications/build.gradle
similarity index 80%
rename from wear/wear-watchface-samples-minimal-complications/build.gradle
rename to wear/watchface/watchface-samples-minimal-complications/build.gradle
index 3967e3c..11aabca 100644
--- a/wear/wear-watchface-samples-minimal-complications/build.gradle
+++ b/wear/watchface/watchface-samples-minimal-complications/build.gradle
@@ -25,19 +25,18 @@
dependencies {
api("androidx.activity:activity:1.3.1")
- api(project(":wear:wear-watchface"))
- api(project(":wear:wear-watchface-complications-rendering"))
- api(project(":wear:wear-watchface-editor"))
- api(project(":wear:wear-watchface-editor-guava"))
- api(project(":wear:wear-watchface-guava"))
+ api(project(":wear:watchface:watchface"))
+ api(project(":wear:watchface:watchface-complications-rendering"))
+ api(project(":wear:watchface:watchface-editor"))
+ api(project(":wear:watchface:watchface-editor-guava"))
+ api(project(":wear:watchface:watchface-guava"))
implementation(libs.guavaAndroid)
}
androidx {
name = "AndroidX Wear Watchface Minimal Complications Sample"
type = LibraryType.SAMPLES
- mavenGroup = LibraryGroups.WEAR
- mavenVersion = LibraryVersions.WEAR_WATCHFACE
+ mavenGroup = LibraryGroups.WEAR_WATCHFACE
inceptionYear = "2021"
description = "Contains the sample code for the Androidx Wear Watchface library"
}
diff --git a/wear/wear-watchface-samples-minimal-complications/src/main/AndroidManifest.xml b/wear/watchface/watchface-samples-minimal-complications/src/main/AndroidManifest.xml
similarity index 100%
rename from wear/wear-watchface-samples-minimal-complications/src/main/AndroidManifest.xml
rename to wear/watchface/watchface-samples-minimal-complications/src/main/AndroidManifest.xml
diff --git a/wear/wear-watchface-samples-minimal-complications/src/main/java/androidx/wear/watchface/samples/minimal/complications/BaseFutureCallback.java b/wear/watchface/watchface-samples-minimal-complications/src/main/java/androidx/wear/watchface/samples/minimal/complications/BaseFutureCallback.java
similarity index 100%
rename from wear/wear-watchface-samples-minimal-complications/src/main/java/androidx/wear/watchface/samples/minimal/complications/BaseFutureCallback.java
rename to wear/watchface/watchface-samples-minimal-complications/src/main/java/androidx/wear/watchface/samples/minimal/complications/BaseFutureCallback.java
diff --git a/wear/wear-watchface-samples-minimal-complications/src/main/java/androidx/wear/watchface/samples/minimal/complications/ConfigActivity.java b/wear/watchface/watchface-samples-minimal-complications/src/main/java/androidx/wear/watchface/samples/minimal/complications/ConfigActivity.java
similarity index 97%
rename from wear/wear-watchface-samples-minimal-complications/src/main/java/androidx/wear/watchface/samples/minimal/complications/ConfigActivity.java
rename to wear/watchface/watchface-samples-minimal-complications/src/main/java/androidx/wear/watchface/samples/minimal/complications/ConfigActivity.java
index bc82b26..1d27d3e 100644
--- a/wear/wear-watchface-samples-minimal-complications/src/main/java/androidx/wear/watchface/samples/minimal/complications/ConfigActivity.java
+++ b/wear/watchface/watchface-samples-minimal-complications/src/main/java/androidx/wear/watchface/samples/minimal/complications/ConfigActivity.java
@@ -28,8 +28,8 @@
import androidx.activity.ComponentActivity;
import androidx.annotation.Nullable;
import androidx.annotation.RequiresApi;
-import androidx.wear.complications.ComplicationDataSourceInfo;
-import androidx.wear.complications.data.ComplicationData;
+import androidx.wear.watchface.complications.ComplicationDataSourceInfo;
+import androidx.wear.watchface.complications.data.ComplicationData;
import androidx.wear.watchface.complications.rendering.ComplicationDrawable;
import androidx.wear.watchface.editor.ListenableEditorSession;
diff --git a/wear/wear-watchface-samples-minimal-complications/src/main/java/androidx/wear/watchface/samples/minimal/complications/FutureCallback.java b/wear/watchface/watchface-samples-minimal-complications/src/main/java/androidx/wear/watchface/samples/minimal/complications/FutureCallback.java
similarity index 100%
rename from wear/wear-watchface-samples-minimal-complications/src/main/java/androidx/wear/watchface/samples/minimal/complications/FutureCallback.java
rename to wear/watchface/watchface-samples-minimal-complications/src/main/java/androidx/wear/watchface/samples/minimal/complications/FutureCallback.java
diff --git a/wear/wear-watchface-samples-minimal-complications/src/main/java/androidx/wear/watchface/samples/minimal/complications/WatchFaceRenderer.java b/wear/watchface/watchface-samples-minimal-complications/src/main/java/androidx/wear/watchface/samples/minimal/complications/WatchFaceRenderer.java
similarity index 100%
rename from wear/wear-watchface-samples-minimal-complications/src/main/java/androidx/wear/watchface/samples/minimal/complications/WatchFaceRenderer.java
rename to wear/watchface/watchface-samples-minimal-complications/src/main/java/androidx/wear/watchface/samples/minimal/complications/WatchFaceRenderer.java
diff --git a/wear/wear-watchface-samples-minimal-complications/src/main/java/androidx/wear/watchface/samples/minimal/complications/WatchFaceService.java b/wear/watchface/watchface-samples-minimal-complications/src/main/java/androidx/wear/watchface/samples/minimal/complications/WatchFaceService.java
similarity index 93%
rename from wear/wear-watchface-samples-minimal-complications/src/main/java/androidx/wear/watchface/samples/minimal/complications/WatchFaceService.java
rename to wear/watchface/watchface-samples-minimal-complications/src/main/java/androidx/wear/watchface/samples/minimal/complications/WatchFaceService.java
index d036a4c..696ec440 100644
--- a/wear/wear-watchface-samples-minimal-complications/src/main/java/androidx/wear/watchface/samples/minimal/complications/WatchFaceService.java
+++ b/wear/watchface/watchface-samples-minimal-complications/src/main/java/androidx/wear/watchface/samples/minimal/complications/WatchFaceService.java
@@ -20,10 +20,6 @@
import android.graphics.RectF;
import android.view.SurfaceHolder;
-import androidx.wear.complications.ComplicationSlotBounds;
-import androidx.wear.complications.DefaultComplicationDataSourcePolicy;
-import androidx.wear.complications.SystemDataSources;
-import androidx.wear.complications.data.ComplicationType;
import androidx.wear.watchface.ComplicationSlot;
import androidx.wear.watchface.ComplicationSlotsManager;
import androidx.wear.watchface.ListenableWatchFaceService;
@@ -31,6 +27,10 @@
import androidx.wear.watchface.WatchFace;
import androidx.wear.watchface.WatchFaceType;
import androidx.wear.watchface.WatchState;
+import androidx.wear.watchface.complications.ComplicationSlotBounds;
+import androidx.wear.watchface.complications.DefaultComplicationDataSourcePolicy;
+import androidx.wear.watchface.complications.SystemDataSources;
+import androidx.wear.watchface.complications.data.ComplicationType;
import androidx.wear.watchface.complications.rendering.CanvasComplicationDrawable;
import androidx.wear.watchface.complications.rendering.ComplicationDrawable;
import androidx.wear.watchface.style.CurrentUserStyleRepository;
diff --git a/wear/wear-watchface-samples-minimal-complications/src/main/res/drawable/ic_launcher_background.xml b/wear/watchface/watchface-samples-minimal-complications/src/main/res/drawable/ic_launcher_background.xml
similarity index 100%
rename from wear/wear-watchface-samples-minimal-complications/src/main/res/drawable/ic_launcher_background.xml
rename to wear/watchface/watchface-samples-minimal-complications/src/main/res/drawable/ic_launcher_background.xml
diff --git a/wear/wear-watchface-samples-minimal-complications/src/main/res/drawable/ic_launcher_foreground.xml b/wear/watchface/watchface-samples-minimal-complications/src/main/res/drawable/ic_launcher_foreground.xml
similarity index 100%
rename from wear/wear-watchface-samples-minimal-complications/src/main/res/drawable/ic_launcher_foreground.xml
rename to wear/watchface/watchface-samples-minimal-complications/src/main/res/drawable/ic_launcher_foreground.xml
diff --git a/wear/wear-watchface-samples-minimal-complications/src/main/res/drawable/preview.png b/wear/watchface/watchface-samples-minimal-complications/src/main/res/drawable/preview.png
similarity index 100%
rename from wear/wear-watchface-samples-minimal-complications/src/main/res/drawable/preview.png
rename to wear/watchface/watchface-samples-minimal-complications/src/main/res/drawable/preview.png
Binary files differ
diff --git a/wear/wear-watchface-samples-minimal-complications/src/main/res/drawable/preview_loading.xml b/wear/watchface/watchface-samples-minimal-complications/src/main/res/drawable/preview_loading.xml
similarity index 100%
rename from wear/wear-watchface-samples-minimal-complications/src/main/res/drawable/preview_loading.xml
rename to wear/watchface/watchface-samples-minimal-complications/src/main/res/drawable/preview_loading.xml
diff --git a/wear/wear-watchface-samples-minimal-complications/src/main/res/drawable/preview_unavailable.xml b/wear/watchface/watchface-samples-minimal-complications/src/main/res/drawable/preview_unavailable.xml
similarity index 100%
rename from wear/wear-watchface-samples-minimal-complications/src/main/res/drawable/preview_unavailable.xml
rename to wear/watchface/watchface-samples-minimal-complications/src/main/res/drawable/preview_unavailable.xml
diff --git a/wear/wear-watchface-samples-minimal-complications/src/main/res/layout/config_activity_layout.xml b/wear/watchface/watchface-samples-minimal-complications/src/main/res/layout/config_activity_layout.xml
similarity index 100%
rename from wear/wear-watchface-samples-minimal-complications/src/main/res/layout/config_activity_layout.xml
rename to wear/watchface/watchface-samples-minimal-complications/src/main/res/layout/config_activity_layout.xml
diff --git a/wear/wear-watchface-samples-minimal-complications/src/main/res/mipmap-anydpi/ic_launcher.xml b/wear/watchface/watchface-samples-minimal-complications/src/main/res/mipmap-anydpi/ic_launcher.xml
similarity index 100%
rename from wear/wear-watchface-samples-minimal-complications/src/main/res/mipmap-anydpi/ic_launcher.xml
rename to wear/watchface/watchface-samples-minimal-complications/src/main/res/mipmap-anydpi/ic_launcher.xml
diff --git a/wear/wear-watchface-samples-minimal-complications/src/main/res/mipmap-hdpi/ic_launcher.png b/wear/watchface/watchface-samples-minimal-complications/src/main/res/mipmap-hdpi/ic_launcher.png
similarity index 100%
rename from wear/wear-watchface-samples-minimal-complications/src/main/res/mipmap-hdpi/ic_launcher.png
rename to wear/watchface/watchface-samples-minimal-complications/src/main/res/mipmap-hdpi/ic_launcher.png
Binary files differ
diff --git a/wear/wear-watchface-samples-minimal-complications/src/main/res/mipmap-mdpi/ic_launcher.png b/wear/watchface/watchface-samples-minimal-complications/src/main/res/mipmap-mdpi/ic_launcher.png
similarity index 100%
rename from wear/wear-watchface-samples-minimal-complications/src/main/res/mipmap-mdpi/ic_launcher.png
rename to wear/watchface/watchface-samples-minimal-complications/src/main/res/mipmap-mdpi/ic_launcher.png
Binary files differ
diff --git a/wear/wear-watchface-samples-minimal-complications/src/main/res/mipmap-xhdpi/ic_launcher.png b/wear/watchface/watchface-samples-minimal-complications/src/main/res/mipmap-xhdpi/ic_launcher.png
similarity index 100%
rename from wear/wear-watchface-samples-minimal-complications/src/main/res/mipmap-xhdpi/ic_launcher.png
rename to wear/watchface/watchface-samples-minimal-complications/src/main/res/mipmap-xhdpi/ic_launcher.png
Binary files differ
diff --git a/wear/wear-watchface-samples-minimal-complications/src/main/res/mipmap-xxhdpi/ic_launcher.png b/wear/watchface/watchface-samples-minimal-complications/src/main/res/mipmap-xxhdpi/ic_launcher.png
similarity index 100%
rename from wear/wear-watchface-samples-minimal-complications/src/main/res/mipmap-xxhdpi/ic_launcher.png
rename to wear/watchface/watchface-samples-minimal-complications/src/main/res/mipmap-xxhdpi/ic_launcher.png
Binary files differ
diff --git a/wear/wear-watchface-samples-minimal-complications/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/wear/watchface/watchface-samples-minimal-complications/src/main/res/mipmap-xxxhdpi/ic_launcher.png
similarity index 100%
rename from wear/wear-watchface-samples-minimal-complications/src/main/res/mipmap-xxxhdpi/ic_launcher.png
rename to wear/watchface/watchface-samples-minimal-complications/src/main/res/mipmap-xxxhdpi/ic_launcher.png
Binary files differ
diff --git a/wear/wear-watchface-samples-minimal-complications/src/main/res/values/dimens.xml b/wear/watchface/watchface-samples-minimal-complications/src/main/res/values/dimens.xml
similarity index 100%
rename from wear/wear-watchface-samples-minimal-complications/src/main/res/values/dimens.xml
rename to wear/watchface/watchface-samples-minimal-complications/src/main/res/values/dimens.xml
diff --git a/wear/wear-watchface-samples-minimal-complications/src/main/res/values/strings.xml b/wear/watchface/watchface-samples-minimal-complications/src/main/res/values/strings.xml
similarity index 100%
rename from wear/wear-watchface-samples-minimal-complications/src/main/res/values/strings.xml
rename to wear/watchface/watchface-samples-minimal-complications/src/main/res/values/strings.xml
diff --git a/wear/wear-watchface-samples-minimal-complications/src/main/res/xml/watch_face.xml b/wear/watchface/watchface-samples-minimal-complications/src/main/res/xml/watch_face.xml
similarity index 100%
rename from wear/wear-watchface-samples-minimal-complications/src/main/res/xml/watch_face.xml
rename to wear/watchface/watchface-samples-minimal-complications/src/main/res/xml/watch_face.xml
diff --git a/wear/wear-watchface-samples-minimal-style/build.gradle b/wear/watchface/watchface-samples-minimal-style/build.gradle
similarity index 81%
rename from wear/wear-watchface-samples-minimal-style/build.gradle
rename to wear/watchface/watchface-samples-minimal-style/build.gradle
index 484862c..eb370d7 100644
--- a/wear/wear-watchface-samples-minimal-style/build.gradle
+++ b/wear/watchface/watchface-samples-minimal-style/build.gradle
@@ -25,18 +25,18 @@
dependencies {
api("androidx.activity:activity:1.3.1")
- api(project(":wear:wear-watchface"))
- api(project(":wear:wear-watchface-editor"))
- api(project(":wear:wear-watchface-editor-guava"))
- api(project(":wear:wear-watchface-guava"))
+ api(project(":wear:watchface:watchface"))
+ api(project(":wear:watchface:watchface-editor"))
+ api(project(":wear:watchface:watchface-editor-guava"))
+ api(project(":wear:watchface:watchface-guava"))
implementation(libs.guavaAndroid)
+ implementation("androidx.lifecycle:lifecycle-livedata-ktx:2.3.1")
}
androidx {
name = "AndroidX Wear Watchface Minimal Style Sample"
type = LibraryType.SAMPLES
- mavenGroup = LibraryGroups.WEAR
- mavenVersion = LibraryVersions.WEAR_WATCHFACE
+ mavenGroup = LibraryGroups.WEAR_WATCHFACE
inceptionYear = "2021"
description = "Contains the sample code for the Androidx Wear Watchface library"
}
diff --git a/wear/wear-watchface-samples-minimal-style/src/main/AndroidManifest.xml b/wear/watchface/watchface-samples-minimal-style/src/main/AndroidManifest.xml
similarity index 100%
rename from wear/wear-watchface-samples-minimal-style/src/main/AndroidManifest.xml
rename to wear/watchface/watchface-samples-minimal-style/src/main/AndroidManifest.xml
diff --git a/wear/wear-watchface-samples-minimal-style/src/main/java/androidx/wear/watchface/samples/minimal/style/BaseFutureCallback.java b/wear/watchface/watchface-samples-minimal-style/src/main/java/androidx/wear/watchface/samples/minimal/style/BaseFutureCallback.java
similarity index 100%
rename from wear/wear-watchface-samples-minimal-style/src/main/java/androidx/wear/watchface/samples/minimal/style/BaseFutureCallback.java
rename to wear/watchface/watchface-samples-minimal-style/src/main/java/androidx/wear/watchface/samples/minimal/style/BaseFutureCallback.java
diff --git a/wear/wear-watchface-samples-minimal-style/src/main/java/androidx/wear/watchface/samples/minimal/style/ConfigActivity.java b/wear/watchface/watchface-samples-minimal-style/src/main/java/androidx/wear/watchface/samples/minimal/style/ConfigActivity.java
similarity index 100%
rename from wear/wear-watchface-samples-minimal-style/src/main/java/androidx/wear/watchface/samples/minimal/style/ConfigActivity.java
rename to wear/watchface/watchface-samples-minimal-style/src/main/java/androidx/wear/watchface/samples/minimal/style/ConfigActivity.java
diff --git a/wear/wear-watchface-samples-minimal-style/src/main/java/androidx/wear/watchface/samples/minimal/style/FutureCallback.java b/wear/watchface/watchface-samples-minimal-style/src/main/java/androidx/wear/watchface/samples/minimal/style/FutureCallback.java
similarity index 100%
rename from wear/wear-watchface-samples-minimal-style/src/main/java/androidx/wear/watchface/samples/minimal/style/FutureCallback.java
rename to wear/watchface/watchface-samples-minimal-style/src/main/java/androidx/wear/watchface/samples/minimal/style/FutureCallback.java
diff --git a/wear/wear-watchface-samples-minimal-style/src/main/java/androidx/wear/watchface/samples/minimal/style/TimeStyle.java b/wear/watchface/watchface-samples-minimal-style/src/main/java/androidx/wear/watchface/samples/minimal/style/TimeStyle.java
similarity index 100%
rename from wear/wear-watchface-samples-minimal-style/src/main/java/androidx/wear/watchface/samples/minimal/style/TimeStyle.java
rename to wear/watchface/watchface-samples-minimal-style/src/main/java/androidx/wear/watchface/samples/minimal/style/TimeStyle.java
diff --git a/wear/wear-watchface-samples-minimal-style/src/main/java/androidx/wear/watchface/samples/minimal/style/WatchFaceRenderer.java b/wear/watchface/watchface-samples-minimal-style/src/main/java/androidx/wear/watchface/samples/minimal/style/WatchFaceRenderer.java
similarity index 89%
rename from wear/wear-watchface-samples-minimal-style/src/main/java/androidx/wear/watchface/samples/minimal/style/WatchFaceRenderer.java
rename to wear/watchface/watchface-samples-minimal-style/src/main/java/androidx/wear/watchface/samples/minimal/style/WatchFaceRenderer.java
index a70f30b..80bb43d 100644
--- a/wear/wear-watchface-samples-minimal-style/src/main/java/androidx/wear/watchface/samples/minimal/style/WatchFaceRenderer.java
+++ b/wear/watchface/watchface-samples-minimal-style/src/main/java/androidx/wear/watchface/samples/minimal/style/WatchFaceRenderer.java
@@ -21,32 +21,34 @@
import android.graphics.Paint;
import android.graphics.Paint.Align;
import android.graphics.Rect;
-import android.os.Handler;
-import android.os.Looper;
import android.view.SurfaceHolder;
import androidx.annotation.NonNull;
import androidx.annotation.Px;
+import androidx.annotation.UiThread;
+import androidx.lifecycle.FlowLiveDataConversions;
import androidx.wear.watchface.CanvasType;
import androidx.wear.watchface.DrawMode;
+import androidx.wear.watchface.ListenableCanvasRenderer;
import androidx.wear.watchface.RenderParameters;
-import androidx.wear.watchface.Renderer;
-import androidx.wear.watchface.StateFlowCompatHelper;
import androidx.wear.watchface.WatchState;
import androidx.wear.watchface.style.CurrentUserStyleRepository;
-import androidx.wear.watchface.style.UserStyle;
+
+import com.google.common.util.concurrent.Futures;
+import com.google.common.util.concurrent.ListenableFuture;
import org.jetbrains.annotations.NotNull;
import java.time.ZonedDateTime;
-import java.util.concurrent.Executor;
import java.util.concurrent.TimeUnit;
+import kotlin.Unit;
+
/**
* Minimal rendered for the watch face, using canvas to render hours, minutes, and a blinking
* separator.
*/
-public class WatchFaceRenderer extends Renderer.CanvasRenderer {
+public class WatchFaceRenderer extends ListenableCanvasRenderer {
private static final long UPDATE_DELAY_MILLIS = TimeUnit.SECONDS.toMillis(1);
private static final char[] DIGITS = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9'};
@@ -54,18 +56,11 @@
private final TimeRenderer mMinimalRenderer;
private final TimeRenderer mSecondsRenderer;
private final Paint mHighlightPaint;
+ private final CurrentUserStyleRepository mCurrentUserStyleRepository;
+ private final TimeStyle mTimeStyle;
private TimeRenderer mTimeRenderer;
- private final Executor mMainThreadExecutor = new Executor() {
- final Handler mHandler = new Handler(Looper.getMainLooper());
-
- @Override
- public void execute(Runnable command) {
- mHandler.post(command);
- }
- };
-
public WatchFaceRenderer(
@NotNull SurfaceHolder surfaceHolder,
@NotNull CurrentUserStyleRepository currentUserStyleRepository,
@@ -73,17 +68,25 @@
@NotNull TimeStyle timeStyle) {
super(surfaceHolder, currentUserStyleRepository, watchState, CanvasType.HARDWARE,
UPDATE_DELAY_MILLIS);
- StateFlowCompatHelper<UserStyle> userStyleStateFlowCompatHelper =
- new StateFlowCompatHelper<>(currentUserStyleRepository.getUserStyle());
- userStyleStateFlowCompatHelper.addValueChangeListener(
- userStyle -> updateTimeStyle(timeStyle.get(userStyle)),
- mMainThreadExecutor);
mMinimalRenderer = new MinimalRenderer(watchState);
mSecondsRenderer = new SecondsRenderer(watchState);
mHighlightPaint = new Paint();
+ mCurrentUserStyleRepository = currentUserStyleRepository;
+ mTimeStyle = timeStyle;
updateTimeStyle(timeStyle.get(currentUserStyleRepository.getUserStyle().getValue()));
}
+ @UiThread
+ @NonNull
+ @Override
+ public ListenableFuture<Unit> initFuture() {
+ // observeForever has to be called from the UI thread but the WatchFaceRenderer is called
+ // from a background thread.
+ FlowLiveDataConversions.asLiveData(mCurrentUserStyleRepository.getUserStyle())
+ .observeForever(userStyle -> updateTimeStyle(mTimeStyle.get(userStyle)));
+ return Futures.immediateFuture(Unit.INSTANCE);
+ }
+
@Override
public void render(@NotNull Canvas canvas, @NotNull Rect rect,
@NotNull ZonedDateTime zonedDateTime) {
diff --git a/wear/wear-watchface-samples-minimal-style/src/main/java/androidx/wear/watchface/samples/minimal/style/WatchFaceService.java b/wear/watchface/watchface-samples-minimal-style/src/main/java/androidx/wear/watchface/samples/minimal/style/WatchFaceService.java
similarity index 100%
rename from wear/wear-watchface-samples-minimal-style/src/main/java/androidx/wear/watchface/samples/minimal/style/WatchFaceService.java
rename to wear/watchface/watchface-samples-minimal-style/src/main/java/androidx/wear/watchface/samples/minimal/style/WatchFaceService.java
diff --git a/wear/wear-watchface-samples-minimal-style/src/main/res/drawable-nodpi/time_style_icon.png b/wear/watchface/watchface-samples-minimal-style/src/main/res/drawable-nodpi/time_style_icon.png
similarity index 100%
rename from wear/wear-watchface-samples-minimal-style/src/main/res/drawable-nodpi/time_style_icon.png
rename to wear/watchface/watchface-samples-minimal-style/src/main/res/drawable-nodpi/time_style_icon.png
Binary files differ
diff --git a/wear/wear-watchface-samples-minimal-style/src/main/res/drawable-nodpi/time_style_minimal_icon.png b/wear/watchface/watchface-samples-minimal-style/src/main/res/drawable-nodpi/time_style_minimal_icon.png
similarity index 100%
rename from wear/wear-watchface-samples-minimal-style/src/main/res/drawable-nodpi/time_style_minimal_icon.png
rename to wear/watchface/watchface-samples-minimal-style/src/main/res/drawable-nodpi/time_style_minimal_icon.png
Binary files differ
diff --git a/wear/wear-watchface-samples-minimal-style/src/main/res/drawable-nodpi/time_style_seconds_icon.png b/wear/watchface/watchface-samples-minimal-style/src/main/res/drawable-nodpi/time_style_seconds_icon.png
similarity index 100%
rename from wear/wear-watchface-samples-minimal-style/src/main/res/drawable-nodpi/time_style_seconds_icon.png
rename to wear/watchface/watchface-samples-minimal-style/src/main/res/drawable-nodpi/time_style_seconds_icon.png
Binary files differ
diff --git a/wear/wear-watchface-samples-minimal-style/src/main/res/drawable/ic_launcher_background.xml b/wear/watchface/watchface-samples-minimal-style/src/main/res/drawable/ic_launcher_background.xml
similarity index 100%
rename from wear/wear-watchface-samples-minimal-style/src/main/res/drawable/ic_launcher_background.xml
rename to wear/watchface/watchface-samples-minimal-style/src/main/res/drawable/ic_launcher_background.xml
diff --git a/wear/wear-watchface-samples-minimal-style/src/main/res/drawable/ic_launcher_foreground.xml b/wear/watchface/watchface-samples-minimal-style/src/main/res/drawable/ic_launcher_foreground.xml
similarity index 100%
rename from wear/wear-watchface-samples-minimal-style/src/main/res/drawable/ic_launcher_foreground.xml
rename to wear/watchface/watchface-samples-minimal-style/src/main/res/drawable/ic_launcher_foreground.xml
diff --git a/wear/wear-watchface-samples-minimal-style/src/main/res/drawable/preview.png b/wear/watchface/watchface-samples-minimal-style/src/main/res/drawable/preview.png
similarity index 100%
rename from wear/wear-watchface-samples-minimal-style/src/main/res/drawable/preview.png
rename to wear/watchface/watchface-samples-minimal-style/src/main/res/drawable/preview.png
Binary files differ
diff --git a/wear/wear-watchface-samples-minimal-style/src/main/res/drawable/tyme_style_bold_icon.xml b/wear/watchface/watchface-samples-minimal-style/src/main/res/drawable/tyme_style_bold_icon.xml
similarity index 100%
rename from wear/wear-watchface-samples-minimal-style/src/main/res/drawable/tyme_style_bold_icon.xml
rename to wear/watchface/watchface-samples-minimal-style/src/main/res/drawable/tyme_style_bold_icon.xml
diff --git a/wear/wear-watchface-samples-minimal-style/src/main/res/layout/config_activity_layout.xml b/wear/watchface/watchface-samples-minimal-style/src/main/res/layout/config_activity_layout.xml
similarity index 100%
rename from wear/wear-watchface-samples-minimal-style/src/main/res/layout/config_activity_layout.xml
rename to wear/watchface/watchface-samples-minimal-style/src/main/res/layout/config_activity_layout.xml
diff --git a/wear/wear-watchface-samples-minimal-style/src/main/res/mipmap-anydpi/ic_launcher.xml b/wear/watchface/watchface-samples-minimal-style/src/main/res/mipmap-anydpi/ic_launcher.xml
similarity index 100%
rename from wear/wear-watchface-samples-minimal-style/src/main/res/mipmap-anydpi/ic_launcher.xml
rename to wear/watchface/watchface-samples-minimal-style/src/main/res/mipmap-anydpi/ic_launcher.xml
diff --git a/wear/wear-watchface-samples-minimal-style/src/main/res/mipmap-hdpi/ic_launcher.png b/wear/watchface/watchface-samples-minimal-style/src/main/res/mipmap-hdpi/ic_launcher.png
similarity index 100%
rename from wear/wear-watchface-samples-minimal-style/src/main/res/mipmap-hdpi/ic_launcher.png
rename to wear/watchface/watchface-samples-minimal-style/src/main/res/mipmap-hdpi/ic_launcher.png
Binary files differ
diff --git a/wear/wear-watchface-samples-minimal-style/src/main/res/mipmap-mdpi/ic_launcher.png b/wear/watchface/watchface-samples-minimal-style/src/main/res/mipmap-mdpi/ic_launcher.png
similarity index 100%
rename from wear/wear-watchface-samples-minimal-style/src/main/res/mipmap-mdpi/ic_launcher.png
rename to wear/watchface/watchface-samples-minimal-style/src/main/res/mipmap-mdpi/ic_launcher.png
Binary files differ
diff --git a/wear/wear-watchface-samples-minimal-style/src/main/res/mipmap-xhdpi/ic_launcher.png b/wear/watchface/watchface-samples-minimal-style/src/main/res/mipmap-xhdpi/ic_launcher.png
similarity index 100%
rename from wear/wear-watchface-samples-minimal-style/src/main/res/mipmap-xhdpi/ic_launcher.png
rename to wear/watchface/watchface-samples-minimal-style/src/main/res/mipmap-xhdpi/ic_launcher.png
Binary files differ
diff --git a/wear/wear-watchface-samples-minimal-style/src/main/res/mipmap-xxhdpi/ic_launcher.png b/wear/watchface/watchface-samples-minimal-style/src/main/res/mipmap-xxhdpi/ic_launcher.png
similarity index 100%
rename from wear/wear-watchface-samples-minimal-style/src/main/res/mipmap-xxhdpi/ic_launcher.png
rename to wear/watchface/watchface-samples-minimal-style/src/main/res/mipmap-xxhdpi/ic_launcher.png
Binary files differ
diff --git a/wear/wear-watchface-samples-minimal-style/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/wear/watchface/watchface-samples-minimal-style/src/main/res/mipmap-xxxhdpi/ic_launcher.png
similarity index 100%
rename from wear/wear-watchface-samples-minimal-style/src/main/res/mipmap-xxxhdpi/ic_launcher.png
rename to wear/watchface/watchface-samples-minimal-style/src/main/res/mipmap-xxxhdpi/ic_launcher.png
Binary files differ
diff --git a/wear/wear-watchface-samples-minimal-style/src/main/res/values/dimens.xml b/wear/watchface/watchface-samples-minimal-style/src/main/res/values/dimens.xml
similarity index 100%
rename from wear/wear-watchface-samples-minimal-style/src/main/res/values/dimens.xml
rename to wear/watchface/watchface-samples-minimal-style/src/main/res/values/dimens.xml
diff --git a/wear/wear-watchface-samples-minimal-style/src/main/res/values/strings.xml b/wear/watchface/watchface-samples-minimal-style/src/main/res/values/strings.xml
similarity index 100%
rename from wear/wear-watchface-samples-minimal-style/src/main/res/values/strings.xml
rename to wear/watchface/watchface-samples-minimal-style/src/main/res/values/strings.xml
diff --git a/wear/wear-watchface-samples-minimal-style/src/main/res/xml/watch_face.xml b/wear/watchface/watchface-samples-minimal-style/src/main/res/xml/watch_face.xml
similarity index 100%
rename from wear/wear-watchface-samples-minimal-style/src/main/res/xml/watch_face.xml
rename to wear/watchface/watchface-samples-minimal-style/src/main/res/xml/watch_face.xml
diff --git a/wear/wear-watchface-style/api/current.txt b/wear/watchface/watchface-style/api/current.txt
similarity index 95%
rename from wear/wear-watchface-style/api/current.txt
rename to wear/watchface/watchface-style/api/current.txt
index a398cd8..f689efb 100644
--- a/wear/wear-watchface-style/api/current.txt
+++ b/wear/watchface/watchface-style/api/current.txt
@@ -4,10 +4,9 @@
public final class CurrentUserStyleRepository {
ctor public CurrentUserStyleRepository(androidx.wear.watchface.style.UserStyleSchema schema);
method public androidx.wear.watchface.style.UserStyleSchema getSchema();
- method public kotlinx.coroutines.flow.MutableStateFlow<androidx.wear.watchface.style.UserStyle> getUserStyle();
- method public void setUserStyle(kotlinx.coroutines.flow.MutableStateFlow<androidx.wear.watchface.style.UserStyle> userStyle);
+ method public kotlinx.coroutines.flow.StateFlow<androidx.wear.watchface.style.UserStyle> getUserStyle();
property public final androidx.wear.watchface.style.UserStyleSchema schema;
- property public final kotlinx.coroutines.flow.MutableStateFlow<androidx.wear.watchface.style.UserStyle> userStyle;
+ property public final kotlinx.coroutines.flow.StateFlow<androidx.wear.watchface.style.UserStyle> userStyle;
}
public final class MutableUserStyle implements java.lang.Iterable<java.util.Map.Entry<? extends androidx.wear.watchface.style.UserStyleSetting,? extends androidx.wear.watchface.style.UserStyleSetting.Option>> kotlin.jvm.internal.markers.KMappedMarker {
@@ -103,13 +102,13 @@
}
public static final class UserStyleSetting.ComplicationSlotsUserStyleSetting.ComplicationSlotOverlay {
- ctor public UserStyleSetting.ComplicationSlotsUserStyleSetting.ComplicationSlotOverlay(int complicationSlotId, optional Boolean? enabled, optional androidx.wear.complications.ComplicationSlotBounds? complicationSlotBounds, optional Integer? accessibilityTraversalIndex);
+ ctor public UserStyleSetting.ComplicationSlotsUserStyleSetting.ComplicationSlotOverlay(int complicationSlotId, optional Boolean? enabled, optional androidx.wear.watchface.complications.ComplicationSlotBounds? complicationSlotBounds, optional Integer? accessibilityTraversalIndex);
method public Integer? getAccessibilityTraversalIndex();
- method public androidx.wear.complications.ComplicationSlotBounds? getComplicationSlotBounds();
+ method public androidx.wear.watchface.complications.ComplicationSlotBounds? getComplicationSlotBounds();
method public int getComplicationSlotId();
method public Boolean? getEnabled();
property public final Integer? accessibilityTraversalIndex;
- property public final androidx.wear.complications.ComplicationSlotBounds? complicationSlotBounds;
+ property public final androidx.wear.watchface.complications.ComplicationSlotBounds? complicationSlotBounds;
property public final int complicationSlotId;
property public final Boolean? enabled;
}
@@ -118,7 +117,7 @@
ctor public UserStyleSetting.ComplicationSlotsUserStyleSetting.ComplicationSlotOverlay.Builder(int complicationSlotId);
method public androidx.wear.watchface.style.UserStyleSetting.ComplicationSlotsUserStyleSetting.ComplicationSlotOverlay build();
method public androidx.wear.watchface.style.UserStyleSetting.ComplicationSlotsUserStyleSetting.ComplicationSlotOverlay.Builder setAccessibilityTraversalIndex(int accessibilityTraversalIndex);
- method public androidx.wear.watchface.style.UserStyleSetting.ComplicationSlotsUserStyleSetting.ComplicationSlotOverlay.Builder setComplicationSlotBounds(androidx.wear.complications.ComplicationSlotBounds complicationSlotBounds);
+ method public androidx.wear.watchface.style.UserStyleSetting.ComplicationSlotsUserStyleSetting.ComplicationSlotOverlay.Builder setComplicationSlotBounds(androidx.wear.watchface.complications.ComplicationSlotBounds complicationSlotBounds);
method public androidx.wear.watchface.style.UserStyleSetting.ComplicationSlotsUserStyleSetting.ComplicationSlotOverlay.Builder setEnabled(boolean enabled);
}
diff --git a/wear/wear-watchface-style/api/public_plus_experimental_current.txt b/wear/watchface/watchface-style/api/public_plus_experimental_current.txt
similarity index 95%
rename from wear/wear-watchface-style/api/public_plus_experimental_current.txt
rename to wear/watchface/watchface-style/api/public_plus_experimental_current.txt
index a398cd8..f689efb 100644
--- a/wear/wear-watchface-style/api/public_plus_experimental_current.txt
+++ b/wear/watchface/watchface-style/api/public_plus_experimental_current.txt
@@ -4,10 +4,9 @@
public final class CurrentUserStyleRepository {
ctor public CurrentUserStyleRepository(androidx.wear.watchface.style.UserStyleSchema schema);
method public androidx.wear.watchface.style.UserStyleSchema getSchema();
- method public kotlinx.coroutines.flow.MutableStateFlow<androidx.wear.watchface.style.UserStyle> getUserStyle();
- method public void setUserStyle(kotlinx.coroutines.flow.MutableStateFlow<androidx.wear.watchface.style.UserStyle> userStyle);
+ method public kotlinx.coroutines.flow.StateFlow<androidx.wear.watchface.style.UserStyle> getUserStyle();
property public final androidx.wear.watchface.style.UserStyleSchema schema;
- property public final kotlinx.coroutines.flow.MutableStateFlow<androidx.wear.watchface.style.UserStyle> userStyle;
+ property public final kotlinx.coroutines.flow.StateFlow<androidx.wear.watchface.style.UserStyle> userStyle;
}
public final class MutableUserStyle implements java.lang.Iterable<java.util.Map.Entry<? extends androidx.wear.watchface.style.UserStyleSetting,? extends androidx.wear.watchface.style.UserStyleSetting.Option>> kotlin.jvm.internal.markers.KMappedMarker {
@@ -103,13 +102,13 @@
}
public static final class UserStyleSetting.ComplicationSlotsUserStyleSetting.ComplicationSlotOverlay {
- ctor public UserStyleSetting.ComplicationSlotsUserStyleSetting.ComplicationSlotOverlay(int complicationSlotId, optional Boolean? enabled, optional androidx.wear.complications.ComplicationSlotBounds? complicationSlotBounds, optional Integer? accessibilityTraversalIndex);
+ ctor public UserStyleSetting.ComplicationSlotsUserStyleSetting.ComplicationSlotOverlay(int complicationSlotId, optional Boolean? enabled, optional androidx.wear.watchface.complications.ComplicationSlotBounds? complicationSlotBounds, optional Integer? accessibilityTraversalIndex);
method public Integer? getAccessibilityTraversalIndex();
- method public androidx.wear.complications.ComplicationSlotBounds? getComplicationSlotBounds();
+ method public androidx.wear.watchface.complications.ComplicationSlotBounds? getComplicationSlotBounds();
method public int getComplicationSlotId();
method public Boolean? getEnabled();
property public final Integer? accessibilityTraversalIndex;
- property public final androidx.wear.complications.ComplicationSlotBounds? complicationSlotBounds;
+ property public final androidx.wear.watchface.complications.ComplicationSlotBounds? complicationSlotBounds;
property public final int complicationSlotId;
property public final Boolean? enabled;
}
@@ -118,7 +117,7 @@
ctor public UserStyleSetting.ComplicationSlotsUserStyleSetting.ComplicationSlotOverlay.Builder(int complicationSlotId);
method public androidx.wear.watchface.style.UserStyleSetting.ComplicationSlotsUserStyleSetting.ComplicationSlotOverlay build();
method public androidx.wear.watchface.style.UserStyleSetting.ComplicationSlotsUserStyleSetting.ComplicationSlotOverlay.Builder setAccessibilityTraversalIndex(int accessibilityTraversalIndex);
- method public androidx.wear.watchface.style.UserStyleSetting.ComplicationSlotsUserStyleSetting.ComplicationSlotOverlay.Builder setComplicationSlotBounds(androidx.wear.complications.ComplicationSlotBounds complicationSlotBounds);
+ method public androidx.wear.watchface.style.UserStyleSetting.ComplicationSlotsUserStyleSetting.ComplicationSlotOverlay.Builder setComplicationSlotBounds(androidx.wear.watchface.complications.ComplicationSlotBounds complicationSlotBounds);
method public androidx.wear.watchface.style.UserStyleSetting.ComplicationSlotsUserStyleSetting.ComplicationSlotOverlay.Builder setEnabled(boolean enabled);
}
diff --git a/wear/wear-watchface-style/api/res-current.txt b/wear/watchface/watchface-style/api/res-current.txt
similarity index 100%
rename from wear/wear-watchface-style/api/res-current.txt
rename to wear/watchface/watchface-style/api/res-current.txt
diff --git a/wear/wear-watchface-style/api/restricted_current.txt b/wear/watchface/watchface-style/api/restricted_current.txt
similarity index 80%
rename from wear/wear-watchface-style/api/restricted_current.txt
rename to wear/watchface/watchface-style/api/restricted_current.txt
index b8f89d7..028cc3d 100644
--- a/wear/wear-watchface-style/api/restricted_current.txt
+++ b/wear/watchface/watchface-style/api/restricted_current.txt
@@ -4,10 +4,9 @@
public final class CurrentUserStyleRepository {
ctor public CurrentUserStyleRepository(androidx.wear.watchface.style.UserStyleSchema schema);
method public androidx.wear.watchface.style.UserStyleSchema getSchema();
- method public kotlinx.coroutines.flow.MutableStateFlow<androidx.wear.watchface.style.UserStyle> getUserStyle();
- method public void setUserStyle(kotlinx.coroutines.flow.MutableStateFlow<androidx.wear.watchface.style.UserStyle> userStyle);
+ method public kotlinx.coroutines.flow.StateFlow<androidx.wear.watchface.style.UserStyle> getUserStyle();
property public final androidx.wear.watchface.style.UserStyleSchema schema;
- property public final kotlinx.coroutines.flow.MutableStateFlow<androidx.wear.watchface.style.UserStyle> userStyle;
+ property public final kotlinx.coroutines.flow.StateFlow<androidx.wear.watchface.style.UserStyle> userStyle;
}
public final class MutableUserStyle implements java.lang.Iterable<java.util.Map.Entry<? extends androidx.wear.watchface.style.UserStyleSetting,? extends androidx.wear.watchface.style.UserStyleSetting.Option>> kotlin.jvm.internal.markers.KMappedMarker {
@@ -62,7 +61,6 @@
}
public abstract sealed class UserStyleSetting {
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public final int estimateWireSizeInBytesAndValidateIconDimensions(android.content.Context context, @Px int maxWidth, @Px int maxHeight);
method public final java.util.Collection<androidx.wear.watchface.style.WatchFaceLayer> getAffectedWatchFaceLayers();
method public final androidx.wear.watchface.style.UserStyleSetting.Option getDefaultOption();
method public final int getDefaultOptionIndex();
@@ -86,7 +84,6 @@
}
public static final class UserStyleSetting.BooleanUserStyleSetting extends androidx.wear.watchface.style.UserStyleSetting {
- ctor @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public UserStyleSetting.BooleanUserStyleSetting(androidx.wear.watchface.style.UserStyleSetting.Id id, CharSequence displayName, CharSequence description, android.graphics.drawable.Icon? icon, java.util.Collection<? extends androidx.wear.watchface.style.WatchFaceLayer> affectsWatchFaceLayers, boolean defaultValue);
ctor public UserStyleSetting.BooleanUserStyleSetting(androidx.wear.watchface.style.UserStyleSetting.Id id, android.content.res.Resources resources, @StringRes int displayNameResourceId, @StringRes int descriptionResourceId, android.graphics.drawable.Icon? icon, java.util.Collection<? extends androidx.wear.watchface.style.WatchFaceLayer> affectsWatchFaceLayers, boolean defaultValue);
method public boolean getDefaultValue();
method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public androidx.wear.watchface.style.data.BooleanUserStyleSettingWireFormat toWireFormat();
@@ -110,20 +107,18 @@
}
public static final class UserStyleSetting.ComplicationSlotsUserStyleSetting extends androidx.wear.watchface.style.UserStyleSetting {
- ctor @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public UserStyleSetting.ComplicationSlotsUserStyleSetting(androidx.wear.watchface.style.UserStyleSetting.Id id, CharSequence displayName, CharSequence description, android.graphics.drawable.Icon? icon, java.util.List<androidx.wear.watchface.style.UserStyleSetting.ComplicationSlotsUserStyleSetting.ComplicationSlotsOption> complicationConfig, java.util.Collection<? extends androidx.wear.watchface.style.WatchFaceLayer> affectsWatchFaceLayers, optional androidx.wear.watchface.style.UserStyleSetting.ComplicationSlotsUserStyleSetting.ComplicationSlotsOption defaultOption);
- ctor @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public UserStyleSetting.ComplicationSlotsUserStyleSetting(androidx.wear.watchface.style.UserStyleSetting.Id id, CharSequence displayName, CharSequence description, android.graphics.drawable.Icon? icon, java.util.List<androidx.wear.watchface.style.UserStyleSetting.ComplicationSlotsUserStyleSetting.ComplicationSlotsOption> complicationConfig, java.util.Collection<? extends androidx.wear.watchface.style.WatchFaceLayer> affectsWatchFaceLayers);
ctor public UserStyleSetting.ComplicationSlotsUserStyleSetting(androidx.wear.watchface.style.UserStyleSetting.Id id, android.content.res.Resources resources, @StringRes int displayNameResourceId, @StringRes int descriptionResourceId, android.graphics.drawable.Icon? icon, java.util.List<androidx.wear.watchface.style.UserStyleSetting.ComplicationSlotsUserStyleSetting.ComplicationSlotsOption> complicationConfig, java.util.Collection<? extends androidx.wear.watchface.style.WatchFaceLayer> affectsWatchFaceLayers, optional androidx.wear.watchface.style.UserStyleSetting.ComplicationSlotsUserStyleSetting.ComplicationSlotsOption defaultOption);
method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public androidx.wear.watchface.style.data.ComplicationsUserStyleSettingWireFormat toWireFormat();
}
public static final class UserStyleSetting.ComplicationSlotsUserStyleSetting.ComplicationSlotOverlay {
- ctor public UserStyleSetting.ComplicationSlotsUserStyleSetting.ComplicationSlotOverlay(int complicationSlotId, optional Boolean? enabled, optional androidx.wear.complications.ComplicationSlotBounds? complicationSlotBounds, optional Integer? accessibilityTraversalIndex);
+ ctor public UserStyleSetting.ComplicationSlotsUserStyleSetting.ComplicationSlotOverlay(int complicationSlotId, optional Boolean? enabled, optional androidx.wear.watchface.complications.ComplicationSlotBounds? complicationSlotBounds, optional Integer? accessibilityTraversalIndex);
method public Integer? getAccessibilityTraversalIndex();
- method public androidx.wear.complications.ComplicationSlotBounds? getComplicationSlotBounds();
+ method public androidx.wear.watchface.complications.ComplicationSlotBounds? getComplicationSlotBounds();
method public int getComplicationSlotId();
method public Boolean? getEnabled();
property public final Integer? accessibilityTraversalIndex;
- property public final androidx.wear.complications.ComplicationSlotBounds? complicationSlotBounds;
+ property public final androidx.wear.watchface.complications.ComplicationSlotBounds? complicationSlotBounds;
property public final int complicationSlotId;
property public final Boolean? enabled;
}
@@ -132,12 +127,11 @@
ctor public UserStyleSetting.ComplicationSlotsUserStyleSetting.ComplicationSlotOverlay.Builder(int complicationSlotId);
method public androidx.wear.watchface.style.UserStyleSetting.ComplicationSlotsUserStyleSetting.ComplicationSlotOverlay build();
method public androidx.wear.watchface.style.UserStyleSetting.ComplicationSlotsUserStyleSetting.ComplicationSlotOverlay.Builder setAccessibilityTraversalIndex(int accessibilityTraversalIndex);
- method public androidx.wear.watchface.style.UserStyleSetting.ComplicationSlotsUserStyleSetting.ComplicationSlotOverlay.Builder setComplicationSlotBounds(androidx.wear.complications.ComplicationSlotBounds complicationSlotBounds);
+ method public androidx.wear.watchface.style.UserStyleSetting.ComplicationSlotsUserStyleSetting.ComplicationSlotOverlay.Builder setComplicationSlotBounds(androidx.wear.watchface.complications.ComplicationSlotBounds complicationSlotBounds);
method public androidx.wear.watchface.style.UserStyleSetting.ComplicationSlotsUserStyleSetting.ComplicationSlotOverlay.Builder setEnabled(boolean enabled);
}
public static final class UserStyleSetting.ComplicationSlotsUserStyleSetting.ComplicationSlotsOption extends androidx.wear.watchface.style.UserStyleSetting.Option {
- ctor @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public UserStyleSetting.ComplicationSlotsUserStyleSetting.ComplicationSlotsOption(androidx.wear.watchface.style.UserStyleSetting.Option.Id id, CharSequence displayName, android.graphics.drawable.Icon? icon, java.util.Collection<androidx.wear.watchface.style.UserStyleSetting.ComplicationSlotsUserStyleSetting.ComplicationSlotOverlay> complicationSlotOverlays);
ctor public UserStyleSetting.ComplicationSlotsUserStyleSetting.ComplicationSlotsOption(androidx.wear.watchface.style.UserStyleSetting.Option.Id id, android.content.res.Resources resources, @StringRes int displayNameResourceId, android.graphics.drawable.Icon? icon, java.util.Collection<androidx.wear.watchface.style.UserStyleSetting.ComplicationSlotsUserStyleSetting.ComplicationSlotOverlay> complicationSlotOverlays);
method public java.util.Collection<androidx.wear.watchface.style.UserStyleSetting.ComplicationSlotsUserStyleSetting.ComplicationSlotOverlay> getComplicationSlotOverlays();
method public CharSequence getDisplayName();
@@ -161,7 +155,6 @@
}
public static final class UserStyleSetting.DoubleRangeUserStyleSetting extends androidx.wear.watchface.style.UserStyleSetting {
- ctor @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public UserStyleSetting.DoubleRangeUserStyleSetting(androidx.wear.watchface.style.UserStyleSetting.Id id, CharSequence displayName, CharSequence description, android.graphics.drawable.Icon? icon, double minimumValue, double maximumValue, java.util.Collection<? extends androidx.wear.watchface.style.WatchFaceLayer> affectsWatchFaceLayers, double defaultValue);
ctor public UserStyleSetting.DoubleRangeUserStyleSetting(androidx.wear.watchface.style.UserStyleSetting.Id id, android.content.res.Resources resources, @StringRes int displayNameResourceId, @StringRes int descriptionResourceId, android.graphics.drawable.Icon? icon, double minimumValue, double maximumValue, java.util.Collection<? extends androidx.wear.watchface.style.WatchFaceLayer> affectsWatchFaceLayers, double defaultValue);
method public double getDefaultValue();
method public double getMaximumValue();
@@ -191,14 +184,11 @@
}
public static class UserStyleSetting.ListUserStyleSetting extends androidx.wear.watchface.style.UserStyleSetting {
- ctor @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public UserStyleSetting.ListUserStyleSetting(androidx.wear.watchface.style.UserStyleSetting.Id id, CharSequence displayName, CharSequence description, android.graphics.drawable.Icon? icon, java.util.List<androidx.wear.watchface.style.UserStyleSetting.ListUserStyleSetting.ListOption> options, java.util.Collection<? extends androidx.wear.watchface.style.WatchFaceLayer> affectsWatchFaceLayers, optional androidx.wear.watchface.style.UserStyleSetting.ListUserStyleSetting.ListOption defaultOption);
- ctor @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public UserStyleSetting.ListUserStyleSetting(androidx.wear.watchface.style.UserStyleSetting.Id id, CharSequence displayName, CharSequence description, android.graphics.drawable.Icon? icon, java.util.List<androidx.wear.watchface.style.UserStyleSetting.ListUserStyleSetting.ListOption> options, java.util.Collection<? extends androidx.wear.watchface.style.WatchFaceLayer> affectsWatchFaceLayers);
ctor public UserStyleSetting.ListUserStyleSetting(androidx.wear.watchface.style.UserStyleSetting.Id id, android.content.res.Resources resources, @StringRes int displayNameResourceId, @StringRes int descriptionResourceId, android.graphics.drawable.Icon? icon, java.util.List<androidx.wear.watchface.style.UserStyleSetting.ListUserStyleSetting.ListOption> options, java.util.Collection<? extends androidx.wear.watchface.style.WatchFaceLayer> affectsWatchFaceLayers, optional androidx.wear.watchface.style.UserStyleSetting.ListUserStyleSetting.ListOption defaultOption);
method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public androidx.wear.watchface.style.data.ListUserStyleSettingWireFormat toWireFormat();
}
public static final class UserStyleSetting.ListUserStyleSetting.ListOption extends androidx.wear.watchface.style.UserStyleSetting.Option {
- ctor @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public UserStyleSetting.ListUserStyleSetting.ListOption(androidx.wear.watchface.style.UserStyleSetting.Option.Id id, CharSequence displayName, android.graphics.drawable.Icon? icon);
ctor public UserStyleSetting.ListUserStyleSetting.ListOption(androidx.wear.watchface.style.UserStyleSetting.Option.Id id, android.content.res.Resources resources, @StringRes int displayNameResourceId, android.graphics.drawable.Icon? icon);
method public CharSequence getDisplayName();
method public android.graphics.drawable.Icon? getIcon();
@@ -208,7 +198,6 @@
}
public static final class UserStyleSetting.LongRangeUserStyleSetting extends androidx.wear.watchface.style.UserStyleSetting {
- ctor @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public UserStyleSetting.LongRangeUserStyleSetting(androidx.wear.watchface.style.UserStyleSetting.Id id, CharSequence displayName, CharSequence description, android.graphics.drawable.Icon? icon, long minimumValue, long maximumValue, java.util.Collection<? extends androidx.wear.watchface.style.WatchFaceLayer> affectsWatchFaceLayers, long defaultValue);
ctor public UserStyleSetting.LongRangeUserStyleSetting(androidx.wear.watchface.style.UserStyleSetting.Id id, android.content.res.Resources resources, @StringRes int displayNameResourceId, @StringRes int descriptionResourceId, android.graphics.drawable.Icon? icon, long minimumValue, long maximumValue, java.util.Collection<? extends androidx.wear.watchface.style.WatchFaceLayer> affectsWatchFaceLayers, long defaultValue);
method public long getDefaultValue();
method public long getMaximumValue();
diff --git a/wear/wear-watchface-style/build.gradle b/wear/watchface/watchface-style/build.gradle
similarity index 92%
rename from wear/wear-watchface-style/build.gradle
rename to wear/watchface/watchface-style/build.gradle
index 762c2a7..f6994bf 100644
--- a/wear/wear-watchface-style/build.gradle
+++ b/wear/watchface/watchface-style/build.gradle
@@ -28,7 +28,7 @@
dependencies {
api("androidx.annotation:annotation:1.1.0")
- api(project(":wear:wear-watchface-data"))
+ api(project(":wear:watchface:watchface-data"))
api(libs.kotlinStdlib)
implementation("androidx.core:core:1.1.0")
@@ -61,8 +61,7 @@
androidx {
name = "Android Wear Watchface Style"
publish = Publish.SNAPSHOT_AND_RELEASE
- mavenGroup = LibraryGroups.WEAR
- mavenVersion = LibraryVersions.WEAR_WATCHFACE_STYLE
+ mavenGroup = LibraryGroups.WEAR_WATCHFACE
inceptionYear = "2020"
description = "Android Wear Watchface Style"
}
diff --git a/wear/wear-watchface-style/lint-baseline.xml b/wear/watchface/watchface-style/lint-baseline.xml
similarity index 100%
rename from wear/wear-watchface-style/lint-baseline.xml
rename to wear/watchface/watchface-style/lint-baseline.xml
diff --git a/wear/wear-watchface-style/src/androidTest/AndroidManifest.xml b/wear/watchface/watchface-style/src/androidTest/AndroidManifest.xml
similarity index 100%
rename from wear/wear-watchface-style/src/androidTest/AndroidManifest.xml
rename to wear/watchface/watchface-style/src/androidTest/AndroidManifest.xml
diff --git a/wear/wear-watchface-style/src/androidTest/java/androidx/wear/watchface/style/IconWireSizeAndDimensionsTest.kt b/wear/watchface/watchface-style/src/androidTest/java/androidx/wear/watchface/style/IconWireSizeAndDimensionsTest.kt
similarity index 100%
rename from wear/wear-watchface-style/src/androidTest/java/androidx/wear/watchface/style/IconWireSizeAndDimensionsTest.kt
rename to wear/watchface/watchface-style/src/androidTest/java/androidx/wear/watchface/style/IconWireSizeAndDimensionsTest.kt
diff --git a/wear/wear-watchface-style/src/androidTest/java/androidx/wear/watchface/style/UserStyleSettingWithStringResourcesTest.kt b/wear/watchface/watchface-style/src/androidTest/java/androidx/wear/watchface/style/UserStyleSettingWithStringResourcesTest.kt
similarity index 100%
rename from wear/wear-watchface-style/src/androidTest/java/androidx/wear/watchface/style/UserStyleSettingWithStringResourcesTest.kt
rename to wear/watchface/watchface-style/src/androidTest/java/androidx/wear/watchface/style/UserStyleSettingWithStringResourcesTest.kt
diff --git a/wear/wear-watchface-style/src/androidTest/res/drawable-nodpi/test_icon.png b/wear/watchface/watchface-style/src/androidTest/res/drawable-nodpi/test_icon.png
similarity index 100%
rename from wear/wear-watchface-style/src/androidTest/res/drawable-nodpi/test_icon.png
rename to wear/watchface/watchface-style/src/androidTest/res/drawable-nodpi/test_icon.png
Binary files differ
diff --git a/wear/wear-watchface-style/src/androidTest/res/values-it/strings.xml b/wear/watchface/watchface-style/src/androidTest/res/values-it/strings.xml
similarity index 100%
rename from wear/wear-watchface-style/src/androidTest/res/values-it/strings.xml
rename to wear/watchface/watchface-style/src/androidTest/res/values-it/strings.xml
diff --git a/wear/wear-watchface-style/src/androidTest/res/values/strings.xml b/wear/watchface/watchface-style/src/androidTest/res/values/strings.xml
similarity index 100%
rename from wear/wear-watchface-style/src/androidTest/res/values/strings.xml
rename to wear/watchface/watchface-style/src/androidTest/res/values/strings.xml
diff --git a/wear/wear-watchface-style/src/main/AndroidManifest.xml b/wear/watchface/watchface-style/src/main/AndroidManifest.xml
similarity index 100%
rename from wear/wear-watchface-style/src/main/AndroidManifest.xml
rename to wear/watchface/watchface-style/src/main/AndroidManifest.xml
diff --git a/wear/wear-watchface-style/src/main/java/androidx/wear/watchface/style/CurrentUserStyleRepository.kt b/wear/watchface/watchface-style/src/main/java/androidx/wear/watchface/style/CurrentUserStyleRepository.kt
similarity index 93%
rename from wear/wear-watchface-style/src/main/java/androidx/wear/watchface/style/CurrentUserStyleRepository.kt
rename to wear/watchface/watchface-style/src/main/java/androidx/wear/watchface/style/CurrentUserStyleRepository.kt
index ddbda4b..7df9464 100644
--- a/wear/wear-watchface-style/src/main/java/androidx/wear/watchface/style/CurrentUserStyleRepository.kt
+++ b/wear/watchface/watchface-style/src/main/java/androidx/wear/watchface/style/CurrentUserStyleRepository.kt
@@ -20,7 +20,7 @@
import androidx.wear.watchface.style.data.UserStyleSchemaWireFormat
import androidx.wear.watchface.style.data.UserStyleWireFormat
import kotlinx.coroutines.flow.MutableStateFlow
-import java.lang.reflect.Proxy
+import kotlinx.coroutines.flow.StateFlow
/**
* An immutable representation of user style choices that maps each [UserStyleSetting] to
@@ -413,14 +413,14 @@
/**
* In memory storage for the current user style choices represented as a
- * [MutableStateFlow]<[UserStyle]>. The UserStyle options must be from the supplied
- * [UserStyleSchema].
+ * [MutableStateFlow]<[UserStyle]>.
*
* @param schema The [UserStyleSchema] for this CurrentUserStyleRepository which describes the
* available style categories.
*/
public class CurrentUserStyleRepository(public val schema: UserStyleSchema) {
- private var wrappedUserStyle = MutableStateFlow(
+ // Mutable backing field for [userStyle].
+ private val mutableUserStyle = MutableStateFlow(
UserStyle(
HashMap<UserStyleSetting, UserStyleSetting.Option>().apply {
for (setting in schema.userStyleSettings) {
@@ -432,25 +432,19 @@
/**
* The current [UserStyle]. If accessed from java, consider using
- * [androidx.wear.watchface.StateFlowCompatHelper] to observe callbacks.
+ * [androidx.lifecycle.FlowLiveDataConversions.asLiveData] to observe changes.
*/
- // Unfortunately a dynamic proxy is the only way we can reasonably validate the UserStyle,
- // exceptions thrown within a coroutine are lost and the MutableStateFlow interface includes
- // internal unstable methods so we can't use a static proxy...
- @Suppress("BanUncheckedReflection", "UNCHECKED_CAST")
- public var userStyle: MutableStateFlow<UserStyle> = Proxy.newProxyInstance(
- MutableStateFlow::class.java.classLoader,
- arrayOf<Class<*>>(MutableStateFlow::class.java)
- ) { _, method, args ->
- if (args == null) {
- method?.invoke(wrappedUserStyle)
- } else {
- if (method?.name == "setValue") {
- validateUserStyle(args[0] as UserStyle)
- }
- method?.invoke(wrappedUserStyle, *args)
- }
- } as MutableStateFlow<UserStyle>
+ public val userStyle: StateFlow<UserStyle> by CurrentUserStyleRepository::mutableUserStyle
+
+ /**
+ * The UserStyle options must be from the supplied [UserStyleSchema].
+ * @hide
+ */
+ @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
+ public fun updateUserStyle(newUserStyle: UserStyle) {
+ validateUserStyle(newUserStyle)
+ mutableUserStyle.value = newUserStyle
+ }
internal fun validateUserStyle(userStyle: UserStyle) {
for ((key, value) in userStyle) {
diff --git a/wear/wear-watchface-style/src/main/java/androidx/wear/watchface/style/UserStyleSetting.kt b/wear/watchface/watchface-style/src/main/java/androidx/wear/watchface/style/UserStyleSetting.kt
similarity index 99%
rename from wear/wear-watchface-style/src/main/java/androidx/wear/watchface/style/UserStyleSetting.kt
rename to wear/watchface/watchface-style/src/main/java/androidx/wear/watchface/style/UserStyleSetting.kt
index 9275ab2..a9e67e4 100644
--- a/wear/wear-watchface-style/src/main/java/androidx/wear/watchface/style/UserStyleSetting.kt
+++ b/wear/watchface/watchface-style/src/main/java/androidx/wear/watchface/style/UserStyleSetting.kt
@@ -27,8 +27,8 @@
import androidx.annotation.Px
import androidx.annotation.RestrictTo
import androidx.annotation.StringRes
-import androidx.wear.complications.ComplicationSlotBounds
-import androidx.wear.complications.data.ComplicationType
+import androidx.wear.watchface.complications.ComplicationSlotBounds
+import androidx.wear.watchface.complications.data.ComplicationType
import androidx.wear.watchface.style.UserStyleSetting.ComplicationSlotsUserStyleSetting.ComplicationSlotOverlay
import androidx.wear.watchface.style.UserStyleSetting.ComplicationSlotsUserStyleSetting.ComplicationSlotsOption
import androidx.wear.watchface.style.data.BooleanOptionWireFormat
diff --git a/wear/wear-watchface-style/src/main/java/androidx/wear/watchface/style/WatchFaceLayer.kt b/wear/watchface/watchface-style/src/main/java/androidx/wear/watchface/style/WatchFaceLayer.kt
similarity index 100%
rename from wear/wear-watchface-style/src/main/java/androidx/wear/watchface/style/WatchFaceLayer.kt
rename to wear/watchface/watchface-style/src/main/java/androidx/wear/watchface/style/WatchFaceLayer.kt
diff --git a/wear/wear-watchface-style/src/test/java/androidx/wear/watchface/style/CurrentUserStyleRepositoryTest.kt b/wear/watchface/watchface-style/src/test/java/androidx/wear/watchface/style/CurrentUserStyleRepositoryTest.kt
similarity index 96%
rename from wear/wear-watchface-style/src/test/java/androidx/wear/watchface/style/CurrentUserStyleRepositoryTest.kt
rename to wear/watchface/watchface-style/src/test/java/androidx/wear/watchface/style/CurrentUserStyleRepositoryTest.kt
index cdc9f33..88c81c7 100644
--- a/wear/wear-watchface-style/src/test/java/androidx/wear/watchface/style/CurrentUserStyleRepositoryTest.kt
+++ b/wear/watchface/watchface-style/src/test/java/androidx/wear/watchface/style/CurrentUserStyleRepositoryTest.kt
@@ -136,7 +136,7 @@
)
)
- userStyleRepository.userStyle.value = newStyle
+ userStyleRepository.updateUserStyle(newStyle)
assertThat(userStyleRepository.userStyle.value[colorStyleSetting])
.isEqualTo(greenStyleOption)
@@ -170,7 +170,7 @@
)
)
- userStyleRepository.userStyle.value = newStyle
+ userStyleRepository.updateUserStyle(newStyle)
assertThat(userStyleRepository.userStyle.value[colorStyleSetting])
.isEqualTo(greenStyleOption)
@@ -438,8 +438,9 @@
val userStyleSchema = UserStyleSchema(listOf(booleanSetting))
CurrentUserStyleRepository(userStyleSchema).let { currentUserStyleRepository ->
- currentUserStyleRepository.userStyle.value =
+ currentUserStyleRepository.updateUserStyle(
UserStyle(mapOf(booleanSetting to optionFalse))
+ )
currentUserStyleRepository.userStyle.value.let { userStyle ->
assertThat(userStyle[booleanSetting]).isEqualTo(optionFalse)
assertThat(userStyle[booleanSettingCopy]).isEqualTo(optionFalse)
@@ -449,8 +450,9 @@
}
CurrentUserStyleRepository(userStyleSchema).let { currentUserStyleRepository ->
- currentUserStyleRepository.userStyle.value =
+ currentUserStyleRepository.updateUserStyle(
UserStyle(mapOf(booleanSettingCopy to optionFalse))
+ )
currentUserStyleRepository.userStyle.value.let { userStyle ->
assertThat(userStyle[booleanSetting]).isEqualTo(optionFalse)
assertThat(userStyle[booleanSettingCopy]).isEqualTo(optionFalse)
@@ -460,8 +462,9 @@
}
CurrentUserStyleRepository(userStyleSchema).let { currentUserStyleRepository ->
- currentUserStyleRepository.userStyle.value =
+ currentUserStyleRepository.updateUserStyle(
UserStyle(mapOf(booleanSettingModifiedInfo to optionFalse))
+ )
currentUserStyleRepository.userStyle.value.let { userStyle ->
assertThat(userStyle[booleanSetting]).isEqualTo(optionFalse)
assertThat(userStyle[booleanSettingCopy]).isEqualTo(optionFalse)
@@ -472,12 +475,12 @@
CurrentUserStyleRepository(userStyleSchema).let { currentUserStyleRepository ->
assertThrows(
- java.lang.IllegalArgumentException::class.java,
- {
- currentUserStyleRepository.userStyle.value =
- UserStyle(mapOf(booleanSettingModifiedId to optionFalse))
- }
- )
+ java.lang.IllegalArgumentException::class.java
+ ) {
+ currentUserStyleRepository.updateUserStyle(
+ UserStyle(mapOf(booleanSettingModifiedId to optionFalse))
+ )
+ }
}
}
@@ -556,9 +559,11 @@
)
)
- userStyleRepository.userStyle.value = UserStyle(
- mapOf(
- customStyleSetting to CustomValueOption("test".encodeToByteArray())
+ userStyleRepository.updateUserStyle(
+ UserStyle(
+ mapOf(
+ customStyleSetting to CustomValueOption("test".encodeToByteArray())
+ )
)
)
diff --git a/wear/wear-watchface-style/src/test/java/androidx/wear/watchface/style/StyleParcelableTest.kt b/wear/watchface/watchface-style/src/test/java/androidx/wear/watchface/style/StyleParcelableTest.kt
similarity index 100%
rename from wear/wear-watchface-style/src/test/java/androidx/wear/watchface/style/StyleParcelableTest.kt
rename to wear/watchface/watchface-style/src/test/java/androidx/wear/watchface/style/StyleParcelableTest.kt
diff --git a/wear/wear-watchface-style/src/test/java/androidx/wear/watchface/style/StyleTestRunner.kt b/wear/watchface/watchface-style/src/test/java/androidx/wear/watchface/style/StyleTestRunner.kt
similarity index 100%
rename from wear/wear-watchface-style/src/test/java/androidx/wear/watchface/style/StyleTestRunner.kt
rename to wear/watchface/watchface-style/src/test/java/androidx/wear/watchface/style/StyleTestRunner.kt
diff --git a/wear/wear-watchface-style/src/test/java/androidx/wear/watchface/style/UserStyleSettingTest.kt b/wear/watchface/watchface-style/src/test/java/androidx/wear/watchface/style/UserStyleSettingTest.kt
similarity index 100%
rename from wear/wear-watchface-style/src/test/java/androidx/wear/watchface/style/UserStyleSettingTest.kt
rename to wear/watchface/watchface-style/src/test/java/androidx/wear/watchface/style/UserStyleSettingTest.kt
diff --git a/wear/wear-watchface-style/src/test/resources/robolectric.properties b/wear/watchface/watchface-style/src/test/resources/robolectric.properties
similarity index 100%
rename from wear/wear-watchface-style/src/test/resources/robolectric.properties
rename to wear/watchface/watchface-style/src/test/resources/robolectric.properties
diff --git a/wear/wear-watchface/api/api_lint.ignore b/wear/watchface/watchface/api/api_lint.ignore
similarity index 100%
rename from wear/wear-watchface/api/api_lint.ignore
rename to wear/watchface/watchface/api/api_lint.ignore
diff --git a/wear/wear-watchface/api/current.txt b/wear/watchface/watchface/api/current.txt
similarity index 86%
rename from wear/wear-watchface/api/current.txt
rename to wear/watchface/watchface/api/current.txt
index 0a61a68..2aa4b8f 100644
--- a/wear/wear-watchface/api/current.txt
+++ b/wear/watchface/watchface/api/current.txt
@@ -8,8 +8,8 @@
public interface CanvasComplication {
method public void drawHighlight(android.graphics.Canvas canvas, android.graphics.Rect bounds, int boundsType, java.time.ZonedDateTime zonedDateTime, @ColorInt int color);
- method public androidx.wear.complications.data.ComplicationData getData();
- method public void loadData(androidx.wear.complications.data.ComplicationData complicationData, boolean loadDrawablesAsynchronous);
+ method public androidx.wear.watchface.complications.data.ComplicationData getData();
+ method public void loadData(androidx.wear.watchface.complications.data.ComplicationData complicationData, boolean loadDrawablesAsynchronous);
method @WorkerThread public default void onRendererCreated(androidx.wear.watchface.Renderer renderer);
method @UiThread public void render(android.graphics.Canvas canvas, android.graphics.Rect bounds, java.time.ZonedDateTime zonedDateTime, androidx.wear.watchface.RenderParameters renderParameters, int slotId);
}
@@ -24,22 +24,22 @@
public final class ComplicationSlot {
method public android.graphics.Rect computeBounds(android.graphics.Rect screen);
- method public static androidx.wear.watchface.ComplicationSlot.Builder createBackgroundComplicationSlotBuilder(int id, androidx.wear.watchface.CanvasComplicationFactory canvasComplicationFactory, java.util.List<? extends androidx.wear.complications.data.ComplicationType> supportedTypes, androidx.wear.complications.DefaultComplicationDataSourcePolicy defaultDataSourcePolicy);
- method public static androidx.wear.watchface.ComplicationSlot.Builder createEdgeComplicationSlotBuilder(int id, androidx.wear.watchface.CanvasComplicationFactory canvasComplicationFactory, java.util.List<? extends androidx.wear.complications.data.ComplicationType> supportedTypes, androidx.wear.complications.DefaultComplicationDataSourcePolicy defaultDataSourcePolicy, androidx.wear.complications.ComplicationSlotBounds bounds, androidx.wear.watchface.ComplicationTapFilter complicationTapFilter);
- method public static androidx.wear.watchface.ComplicationSlot.Builder createRoundRectComplicationSlotBuilder(int id, androidx.wear.watchface.CanvasComplicationFactory canvasComplicationFactory, java.util.List<? extends androidx.wear.complications.data.ComplicationType> supportedTypes, androidx.wear.complications.DefaultComplicationDataSourcePolicy defaultDataSourcePolicy, androidx.wear.complications.ComplicationSlotBounds bounds);
+ method public static androidx.wear.watchface.ComplicationSlot.Builder createBackgroundComplicationSlotBuilder(int id, androidx.wear.watchface.CanvasComplicationFactory canvasComplicationFactory, java.util.List<? extends androidx.wear.watchface.complications.data.ComplicationType> supportedTypes, androidx.wear.watchface.complications.DefaultComplicationDataSourcePolicy defaultDataSourcePolicy);
+ method public static androidx.wear.watchface.ComplicationSlot.Builder createEdgeComplicationSlotBuilder(int id, androidx.wear.watchface.CanvasComplicationFactory canvasComplicationFactory, java.util.List<? extends androidx.wear.watchface.complications.data.ComplicationType> supportedTypes, androidx.wear.watchface.complications.DefaultComplicationDataSourcePolicy defaultDataSourcePolicy, androidx.wear.watchface.complications.ComplicationSlotBounds bounds, androidx.wear.watchface.ComplicationTapFilter complicationTapFilter);
+ method public static androidx.wear.watchface.ComplicationSlot.Builder createRoundRectComplicationSlotBuilder(int id, androidx.wear.watchface.CanvasComplicationFactory canvasComplicationFactory, java.util.List<? extends androidx.wear.watchface.complications.data.ComplicationType> supportedTypes, androidx.wear.watchface.complications.DefaultComplicationDataSourcePolicy defaultDataSourcePolicy, androidx.wear.watchface.complications.ComplicationSlotBounds bounds);
method @UiThread public int getAccessibilityTraversalIndex();
method public int getBoundsType();
method public androidx.wear.watchface.CanvasComplicationFactory getCanvasComplicationFactory();
- method public kotlinx.coroutines.flow.StateFlow<androidx.wear.complications.data.ComplicationData> getComplicationData();
- method @UiThread public androidx.wear.complications.ComplicationSlotBounds getComplicationSlotBounds();
+ method public kotlinx.coroutines.flow.StateFlow<androidx.wear.watchface.complications.data.ComplicationData> getComplicationData();
+ method @UiThread public androidx.wear.watchface.complications.ComplicationSlotBounds getComplicationSlotBounds();
method public android.os.Bundle getConfigExtras();
- method @UiThread public androidx.wear.complications.DefaultComplicationDataSourcePolicy getDefaultDataSourcePolicy();
- method @UiThread public androidx.wear.complications.data.ComplicationType getDefaultDataSourceType();
+ method @UiThread public androidx.wear.watchface.complications.DefaultComplicationDataSourcePolicy getDefaultDataSourcePolicy();
+ method @UiThread public androidx.wear.watchface.complications.data.ComplicationType getDefaultDataSourceType();
method public boolean getFixedComplicationDataSource();
method public int getId();
method public boolean getInitiallyEnabled();
method public androidx.wear.watchface.CanvasComplication getRenderer();
- method @UiThread public java.util.List<androidx.wear.complications.data.ComplicationType> getSupportedTypes();
+ method @UiThread public java.util.List<androidx.wear.watchface.complications.data.ComplicationType> getSupportedTypes();
method public androidx.wear.watchface.ComplicationTapFilter getTapFilter();
method public boolean isActiveAt(java.time.Instant instant);
method @UiThread public boolean isEnabled();
@@ -48,17 +48,17 @@
property @UiThread public final int accessibilityTraversalIndex;
property public final int boundsType;
property public final androidx.wear.watchface.CanvasComplicationFactory canvasComplicationFactory;
- property public final kotlinx.coroutines.flow.StateFlow<androidx.wear.complications.data.ComplicationData> complicationData;
- property @UiThread public final androidx.wear.complications.ComplicationSlotBounds complicationSlotBounds;
+ property public final kotlinx.coroutines.flow.StateFlow<androidx.wear.watchface.complications.data.ComplicationData> complicationData;
+ property @UiThread public final androidx.wear.watchface.complications.ComplicationSlotBounds complicationSlotBounds;
property public final android.os.Bundle configExtras;
- property @UiThread public final androidx.wear.complications.DefaultComplicationDataSourcePolicy defaultDataSourcePolicy;
- property @UiThread public final androidx.wear.complications.data.ComplicationType defaultDataSourceType;
+ property @UiThread public final androidx.wear.watchface.complications.DefaultComplicationDataSourcePolicy defaultDataSourcePolicy;
+ property @UiThread public final androidx.wear.watchface.complications.data.ComplicationType defaultDataSourceType;
property @UiThread public final boolean enabled;
property public final boolean fixedComplicationDataSource;
property public final int id;
property public final boolean initiallyEnabled;
property public final androidx.wear.watchface.CanvasComplication renderer;
- property @UiThread public final java.util.List<androidx.wear.complications.data.ComplicationType> supportedTypes;
+ property @UiThread public final java.util.List<androidx.wear.watchface.complications.data.ComplicationType> supportedTypes;
property public final androidx.wear.watchface.ComplicationTapFilter tapFilter;
field public static final androidx.wear.watchface.ComplicationSlot.Companion Companion;
}
@@ -67,15 +67,15 @@
method public androidx.wear.watchface.ComplicationSlot build();
method public androidx.wear.watchface.ComplicationSlot.Builder setAccessibilityTraversalIndex(int accessibilityTraversalIndex);
method public androidx.wear.watchface.ComplicationSlot.Builder setConfigExtras(android.os.Bundle extras);
- method public androidx.wear.watchface.ComplicationSlot.Builder setDefaultDataSourceType(androidx.wear.complications.data.ComplicationType defaultDataSourceType);
+ method public androidx.wear.watchface.ComplicationSlot.Builder setDefaultDataSourceType(androidx.wear.watchface.complications.data.ComplicationType defaultDataSourceType);
method public androidx.wear.watchface.ComplicationSlot.Builder setEnabled(boolean enabled);
method public androidx.wear.watchface.ComplicationSlot.Builder setFixedComplicationDataSource(boolean fixedComplicationDataSource);
}
public static final class ComplicationSlot.Companion {
- method public androidx.wear.watchface.ComplicationSlot.Builder createBackgroundComplicationSlotBuilder(int id, androidx.wear.watchface.CanvasComplicationFactory canvasComplicationFactory, java.util.List<? extends androidx.wear.complications.data.ComplicationType> supportedTypes, androidx.wear.complications.DefaultComplicationDataSourcePolicy defaultDataSourcePolicy);
- method public androidx.wear.watchface.ComplicationSlot.Builder createEdgeComplicationSlotBuilder(int id, androidx.wear.watchface.CanvasComplicationFactory canvasComplicationFactory, java.util.List<? extends androidx.wear.complications.data.ComplicationType> supportedTypes, androidx.wear.complications.DefaultComplicationDataSourcePolicy defaultDataSourcePolicy, androidx.wear.complications.ComplicationSlotBounds bounds, androidx.wear.watchface.ComplicationTapFilter complicationTapFilter);
- method public androidx.wear.watchface.ComplicationSlot.Builder createRoundRectComplicationSlotBuilder(int id, androidx.wear.watchface.CanvasComplicationFactory canvasComplicationFactory, java.util.List<? extends androidx.wear.complications.data.ComplicationType> supportedTypes, androidx.wear.complications.DefaultComplicationDataSourcePolicy defaultDataSourcePolicy, androidx.wear.complications.ComplicationSlotBounds bounds);
+ method public androidx.wear.watchface.ComplicationSlot.Builder createBackgroundComplicationSlotBuilder(int id, androidx.wear.watchface.CanvasComplicationFactory canvasComplicationFactory, java.util.List<? extends androidx.wear.watchface.complications.data.ComplicationType> supportedTypes, androidx.wear.watchface.complications.DefaultComplicationDataSourcePolicy defaultDataSourcePolicy);
+ method public androidx.wear.watchface.ComplicationSlot.Builder createEdgeComplicationSlotBuilder(int id, androidx.wear.watchface.CanvasComplicationFactory canvasComplicationFactory, java.util.List<? extends androidx.wear.watchface.complications.data.ComplicationType> supportedTypes, androidx.wear.watchface.complications.DefaultComplicationDataSourcePolicy defaultDataSourcePolicy, androidx.wear.watchface.complications.ComplicationSlotBounds bounds, androidx.wear.watchface.ComplicationTapFilter complicationTapFilter);
+ method public androidx.wear.watchface.ComplicationSlot.Builder createRoundRectComplicationSlotBuilder(int id, androidx.wear.watchface.CanvasComplicationFactory canvasComplicationFactory, java.util.List<? extends androidx.wear.watchface.complications.data.ComplicationType> supportedTypes, androidx.wear.watchface.complications.DefaultComplicationDataSourcePolicy defaultDataSourcePolicy, androidx.wear.watchface.complications.ComplicationSlotBounds bounds);
}
public final class ComplicationSlotsManager {
@@ -103,14 +103,14 @@
}
public final class ContentDescriptionLabel {
- ctor public ContentDescriptionLabel(androidx.wear.complications.data.ComplicationText text, android.graphics.Rect bounds, android.app.PendingIntent? tapAction);
+ ctor public ContentDescriptionLabel(androidx.wear.watchface.complications.data.ComplicationText text, android.graphics.Rect bounds, android.app.PendingIntent? tapAction);
method public android.graphics.Rect getBounds();
method public android.app.PendingIntent? getTapAction();
- method public androidx.wear.complications.data.ComplicationText getText();
+ method public androidx.wear.watchface.complications.data.ComplicationText getText();
method public CharSequence getTextAt(android.content.res.Resources resources, java.time.Instant instant);
property public final android.graphics.Rect bounds;
property public final android.app.PendingIntent? tapAction;
- property public final androidx.wear.complications.data.ComplicationText text;
+ property public final androidx.wear.watchface.complications.data.ComplicationText text;
}
public enum DrawMode {
@@ -172,6 +172,7 @@
}
public abstract sealed class Renderer {
+ method public abstract void dump(java.io.PrintWriter writer);
method public final java.util.Collection<kotlin.Pair<java.lang.Integer,androidx.wear.watchface.ContentDescriptionLabel>> getAdditionalContentDescriptionLabels();
method public final float getCenterX();
method public final float getCenterY();
@@ -198,6 +199,7 @@
public abstract static class Renderer.CanvasRenderer extends androidx.wear.watchface.Renderer {
ctor @WorkerThread public Renderer.CanvasRenderer(android.view.SurfaceHolder surfaceHolder, androidx.wear.watchface.style.CurrentUserStyleRepository currentUserStyleRepository, androidx.wear.watchface.WatchState watchState, int canvasType, @IntRange(from=0, to=60000) long interactiveDrawModeUpdateDelayMillis);
+ method public void dump(java.io.PrintWriter writer);
method @UiThread public suspend Object? init(kotlin.coroutines.Continuation<? super kotlin.Unit> p);
method @UiThread public abstract void render(android.graphics.Canvas canvas, android.graphics.Rect bounds, java.time.ZonedDateTime zonedDateTime);
method @UiThread public abstract void renderHighlightLayer(android.graphics.Canvas canvas, android.graphics.Rect bounds, java.time.ZonedDateTime zonedDateTime);
@@ -207,6 +209,7 @@
ctor @WorkerThread @kotlin.jvm.Throws(exceptionClasses=GlesException::class) public Renderer.GlesRenderer(android.view.SurfaceHolder surfaceHolder, androidx.wear.watchface.style.CurrentUserStyleRepository currentUserStyleRepository, androidx.wear.watchface.WatchState watchState, @IntRange(from=0, to=60000) long interactiveDrawModeUpdateDelayMillis, optional int[] eglConfigAttribList, optional int[] eglSurfaceAttribList) throws androidx.wear.watchface.Renderer.GlesRenderer.GlesException;
ctor @WorkerThread @kotlin.jvm.Throws(exceptionClasses=GlesException::class) public Renderer.GlesRenderer(android.view.SurfaceHolder surfaceHolder, androidx.wear.watchface.style.CurrentUserStyleRepository currentUserStyleRepository, androidx.wear.watchface.WatchState watchState, @IntRange(from=0, to=60000) long interactiveDrawModeUpdateDelayMillis, optional int[] eglConfigAttribList) throws androidx.wear.watchface.Renderer.GlesRenderer.GlesException;
ctor @WorkerThread @kotlin.jvm.Throws(exceptionClasses=GlesException::class) public Renderer.GlesRenderer(android.view.SurfaceHolder surfaceHolder, androidx.wear.watchface.style.CurrentUserStyleRepository currentUserStyleRepository, androidx.wear.watchface.WatchState watchState, @IntRange(from=0, to=60000) long interactiveDrawModeUpdateDelayMillis) throws androidx.wear.watchface.Renderer.GlesRenderer.GlesException;
+ method public void dump(java.io.PrintWriter writer);
method public final android.opengl.EGLContext getEglBackgroundThreadContext();
method public final android.opengl.EGLConfig getEglConfig();
method public final android.opengl.EGLDisplay getEglDisplay();
diff --git a/wear/wear-watchface/api/current.txt b/wear/watchface/watchface/api/public_plus_experimental_current.txt
similarity index 86%
copy from wear/wear-watchface/api/current.txt
copy to wear/watchface/watchface/api/public_plus_experimental_current.txt
index 0a61a68..2aa4b8f 100644
--- a/wear/wear-watchface/api/current.txt
+++ b/wear/watchface/watchface/api/public_plus_experimental_current.txt
@@ -8,8 +8,8 @@
public interface CanvasComplication {
method public void drawHighlight(android.graphics.Canvas canvas, android.graphics.Rect bounds, int boundsType, java.time.ZonedDateTime zonedDateTime, @ColorInt int color);
- method public androidx.wear.complications.data.ComplicationData getData();
- method public void loadData(androidx.wear.complications.data.ComplicationData complicationData, boolean loadDrawablesAsynchronous);
+ method public androidx.wear.watchface.complications.data.ComplicationData getData();
+ method public void loadData(androidx.wear.watchface.complications.data.ComplicationData complicationData, boolean loadDrawablesAsynchronous);
method @WorkerThread public default void onRendererCreated(androidx.wear.watchface.Renderer renderer);
method @UiThread public void render(android.graphics.Canvas canvas, android.graphics.Rect bounds, java.time.ZonedDateTime zonedDateTime, androidx.wear.watchface.RenderParameters renderParameters, int slotId);
}
@@ -24,22 +24,22 @@
public final class ComplicationSlot {
method public android.graphics.Rect computeBounds(android.graphics.Rect screen);
- method public static androidx.wear.watchface.ComplicationSlot.Builder createBackgroundComplicationSlotBuilder(int id, androidx.wear.watchface.CanvasComplicationFactory canvasComplicationFactory, java.util.List<? extends androidx.wear.complications.data.ComplicationType> supportedTypes, androidx.wear.complications.DefaultComplicationDataSourcePolicy defaultDataSourcePolicy);
- method public static androidx.wear.watchface.ComplicationSlot.Builder createEdgeComplicationSlotBuilder(int id, androidx.wear.watchface.CanvasComplicationFactory canvasComplicationFactory, java.util.List<? extends androidx.wear.complications.data.ComplicationType> supportedTypes, androidx.wear.complications.DefaultComplicationDataSourcePolicy defaultDataSourcePolicy, androidx.wear.complications.ComplicationSlotBounds bounds, androidx.wear.watchface.ComplicationTapFilter complicationTapFilter);
- method public static androidx.wear.watchface.ComplicationSlot.Builder createRoundRectComplicationSlotBuilder(int id, androidx.wear.watchface.CanvasComplicationFactory canvasComplicationFactory, java.util.List<? extends androidx.wear.complications.data.ComplicationType> supportedTypes, androidx.wear.complications.DefaultComplicationDataSourcePolicy defaultDataSourcePolicy, androidx.wear.complications.ComplicationSlotBounds bounds);
+ method public static androidx.wear.watchface.ComplicationSlot.Builder createBackgroundComplicationSlotBuilder(int id, androidx.wear.watchface.CanvasComplicationFactory canvasComplicationFactory, java.util.List<? extends androidx.wear.watchface.complications.data.ComplicationType> supportedTypes, androidx.wear.watchface.complications.DefaultComplicationDataSourcePolicy defaultDataSourcePolicy);
+ method public static androidx.wear.watchface.ComplicationSlot.Builder createEdgeComplicationSlotBuilder(int id, androidx.wear.watchface.CanvasComplicationFactory canvasComplicationFactory, java.util.List<? extends androidx.wear.watchface.complications.data.ComplicationType> supportedTypes, androidx.wear.watchface.complications.DefaultComplicationDataSourcePolicy defaultDataSourcePolicy, androidx.wear.watchface.complications.ComplicationSlotBounds bounds, androidx.wear.watchface.ComplicationTapFilter complicationTapFilter);
+ method public static androidx.wear.watchface.ComplicationSlot.Builder createRoundRectComplicationSlotBuilder(int id, androidx.wear.watchface.CanvasComplicationFactory canvasComplicationFactory, java.util.List<? extends androidx.wear.watchface.complications.data.ComplicationType> supportedTypes, androidx.wear.watchface.complications.DefaultComplicationDataSourcePolicy defaultDataSourcePolicy, androidx.wear.watchface.complications.ComplicationSlotBounds bounds);
method @UiThread public int getAccessibilityTraversalIndex();
method public int getBoundsType();
method public androidx.wear.watchface.CanvasComplicationFactory getCanvasComplicationFactory();
- method public kotlinx.coroutines.flow.StateFlow<androidx.wear.complications.data.ComplicationData> getComplicationData();
- method @UiThread public androidx.wear.complications.ComplicationSlotBounds getComplicationSlotBounds();
+ method public kotlinx.coroutines.flow.StateFlow<androidx.wear.watchface.complications.data.ComplicationData> getComplicationData();
+ method @UiThread public androidx.wear.watchface.complications.ComplicationSlotBounds getComplicationSlotBounds();
method public android.os.Bundle getConfigExtras();
- method @UiThread public androidx.wear.complications.DefaultComplicationDataSourcePolicy getDefaultDataSourcePolicy();
- method @UiThread public androidx.wear.complications.data.ComplicationType getDefaultDataSourceType();
+ method @UiThread public androidx.wear.watchface.complications.DefaultComplicationDataSourcePolicy getDefaultDataSourcePolicy();
+ method @UiThread public androidx.wear.watchface.complications.data.ComplicationType getDefaultDataSourceType();
method public boolean getFixedComplicationDataSource();
method public int getId();
method public boolean getInitiallyEnabled();
method public androidx.wear.watchface.CanvasComplication getRenderer();
- method @UiThread public java.util.List<androidx.wear.complications.data.ComplicationType> getSupportedTypes();
+ method @UiThread public java.util.List<androidx.wear.watchface.complications.data.ComplicationType> getSupportedTypes();
method public androidx.wear.watchface.ComplicationTapFilter getTapFilter();
method public boolean isActiveAt(java.time.Instant instant);
method @UiThread public boolean isEnabled();
@@ -48,17 +48,17 @@
property @UiThread public final int accessibilityTraversalIndex;
property public final int boundsType;
property public final androidx.wear.watchface.CanvasComplicationFactory canvasComplicationFactory;
- property public final kotlinx.coroutines.flow.StateFlow<androidx.wear.complications.data.ComplicationData> complicationData;
- property @UiThread public final androidx.wear.complications.ComplicationSlotBounds complicationSlotBounds;
+ property public final kotlinx.coroutines.flow.StateFlow<androidx.wear.watchface.complications.data.ComplicationData> complicationData;
+ property @UiThread public final androidx.wear.watchface.complications.ComplicationSlotBounds complicationSlotBounds;
property public final android.os.Bundle configExtras;
- property @UiThread public final androidx.wear.complications.DefaultComplicationDataSourcePolicy defaultDataSourcePolicy;
- property @UiThread public final androidx.wear.complications.data.ComplicationType defaultDataSourceType;
+ property @UiThread public final androidx.wear.watchface.complications.DefaultComplicationDataSourcePolicy defaultDataSourcePolicy;
+ property @UiThread public final androidx.wear.watchface.complications.data.ComplicationType defaultDataSourceType;
property @UiThread public final boolean enabled;
property public final boolean fixedComplicationDataSource;
property public final int id;
property public final boolean initiallyEnabled;
property public final androidx.wear.watchface.CanvasComplication renderer;
- property @UiThread public final java.util.List<androidx.wear.complications.data.ComplicationType> supportedTypes;
+ property @UiThread public final java.util.List<androidx.wear.watchface.complications.data.ComplicationType> supportedTypes;
property public final androidx.wear.watchface.ComplicationTapFilter tapFilter;
field public static final androidx.wear.watchface.ComplicationSlot.Companion Companion;
}
@@ -67,15 +67,15 @@
method public androidx.wear.watchface.ComplicationSlot build();
method public androidx.wear.watchface.ComplicationSlot.Builder setAccessibilityTraversalIndex(int accessibilityTraversalIndex);
method public androidx.wear.watchface.ComplicationSlot.Builder setConfigExtras(android.os.Bundle extras);
- method public androidx.wear.watchface.ComplicationSlot.Builder setDefaultDataSourceType(androidx.wear.complications.data.ComplicationType defaultDataSourceType);
+ method public androidx.wear.watchface.ComplicationSlot.Builder setDefaultDataSourceType(androidx.wear.watchface.complications.data.ComplicationType defaultDataSourceType);
method public androidx.wear.watchface.ComplicationSlot.Builder setEnabled(boolean enabled);
method public androidx.wear.watchface.ComplicationSlot.Builder setFixedComplicationDataSource(boolean fixedComplicationDataSource);
}
public static final class ComplicationSlot.Companion {
- method public androidx.wear.watchface.ComplicationSlot.Builder createBackgroundComplicationSlotBuilder(int id, androidx.wear.watchface.CanvasComplicationFactory canvasComplicationFactory, java.util.List<? extends androidx.wear.complications.data.ComplicationType> supportedTypes, androidx.wear.complications.DefaultComplicationDataSourcePolicy defaultDataSourcePolicy);
- method public androidx.wear.watchface.ComplicationSlot.Builder createEdgeComplicationSlotBuilder(int id, androidx.wear.watchface.CanvasComplicationFactory canvasComplicationFactory, java.util.List<? extends androidx.wear.complications.data.ComplicationType> supportedTypes, androidx.wear.complications.DefaultComplicationDataSourcePolicy defaultDataSourcePolicy, androidx.wear.complications.ComplicationSlotBounds bounds, androidx.wear.watchface.ComplicationTapFilter complicationTapFilter);
- method public androidx.wear.watchface.ComplicationSlot.Builder createRoundRectComplicationSlotBuilder(int id, androidx.wear.watchface.CanvasComplicationFactory canvasComplicationFactory, java.util.List<? extends androidx.wear.complications.data.ComplicationType> supportedTypes, androidx.wear.complications.DefaultComplicationDataSourcePolicy defaultDataSourcePolicy, androidx.wear.complications.ComplicationSlotBounds bounds);
+ method public androidx.wear.watchface.ComplicationSlot.Builder createBackgroundComplicationSlotBuilder(int id, androidx.wear.watchface.CanvasComplicationFactory canvasComplicationFactory, java.util.List<? extends androidx.wear.watchface.complications.data.ComplicationType> supportedTypes, androidx.wear.watchface.complications.DefaultComplicationDataSourcePolicy defaultDataSourcePolicy);
+ method public androidx.wear.watchface.ComplicationSlot.Builder createEdgeComplicationSlotBuilder(int id, androidx.wear.watchface.CanvasComplicationFactory canvasComplicationFactory, java.util.List<? extends androidx.wear.watchface.complications.data.ComplicationType> supportedTypes, androidx.wear.watchface.complications.DefaultComplicationDataSourcePolicy defaultDataSourcePolicy, androidx.wear.watchface.complications.ComplicationSlotBounds bounds, androidx.wear.watchface.ComplicationTapFilter complicationTapFilter);
+ method public androidx.wear.watchface.ComplicationSlot.Builder createRoundRectComplicationSlotBuilder(int id, androidx.wear.watchface.CanvasComplicationFactory canvasComplicationFactory, java.util.List<? extends androidx.wear.watchface.complications.data.ComplicationType> supportedTypes, androidx.wear.watchface.complications.DefaultComplicationDataSourcePolicy defaultDataSourcePolicy, androidx.wear.watchface.complications.ComplicationSlotBounds bounds);
}
public final class ComplicationSlotsManager {
@@ -103,14 +103,14 @@
}
public final class ContentDescriptionLabel {
- ctor public ContentDescriptionLabel(androidx.wear.complications.data.ComplicationText text, android.graphics.Rect bounds, android.app.PendingIntent? tapAction);
+ ctor public ContentDescriptionLabel(androidx.wear.watchface.complications.data.ComplicationText text, android.graphics.Rect bounds, android.app.PendingIntent? tapAction);
method public android.graphics.Rect getBounds();
method public android.app.PendingIntent? getTapAction();
- method public androidx.wear.complications.data.ComplicationText getText();
+ method public androidx.wear.watchface.complications.data.ComplicationText getText();
method public CharSequence getTextAt(android.content.res.Resources resources, java.time.Instant instant);
property public final android.graphics.Rect bounds;
property public final android.app.PendingIntent? tapAction;
- property public final androidx.wear.complications.data.ComplicationText text;
+ property public final androidx.wear.watchface.complications.data.ComplicationText text;
}
public enum DrawMode {
@@ -172,6 +172,7 @@
}
public abstract sealed class Renderer {
+ method public abstract void dump(java.io.PrintWriter writer);
method public final java.util.Collection<kotlin.Pair<java.lang.Integer,androidx.wear.watchface.ContentDescriptionLabel>> getAdditionalContentDescriptionLabels();
method public final float getCenterX();
method public final float getCenterY();
@@ -198,6 +199,7 @@
public abstract static class Renderer.CanvasRenderer extends androidx.wear.watchface.Renderer {
ctor @WorkerThread public Renderer.CanvasRenderer(android.view.SurfaceHolder surfaceHolder, androidx.wear.watchface.style.CurrentUserStyleRepository currentUserStyleRepository, androidx.wear.watchface.WatchState watchState, int canvasType, @IntRange(from=0, to=60000) long interactiveDrawModeUpdateDelayMillis);
+ method public void dump(java.io.PrintWriter writer);
method @UiThread public suspend Object? init(kotlin.coroutines.Continuation<? super kotlin.Unit> p);
method @UiThread public abstract void render(android.graphics.Canvas canvas, android.graphics.Rect bounds, java.time.ZonedDateTime zonedDateTime);
method @UiThread public abstract void renderHighlightLayer(android.graphics.Canvas canvas, android.graphics.Rect bounds, java.time.ZonedDateTime zonedDateTime);
@@ -207,6 +209,7 @@
ctor @WorkerThread @kotlin.jvm.Throws(exceptionClasses=GlesException::class) public Renderer.GlesRenderer(android.view.SurfaceHolder surfaceHolder, androidx.wear.watchface.style.CurrentUserStyleRepository currentUserStyleRepository, androidx.wear.watchface.WatchState watchState, @IntRange(from=0, to=60000) long interactiveDrawModeUpdateDelayMillis, optional int[] eglConfigAttribList, optional int[] eglSurfaceAttribList) throws androidx.wear.watchface.Renderer.GlesRenderer.GlesException;
ctor @WorkerThread @kotlin.jvm.Throws(exceptionClasses=GlesException::class) public Renderer.GlesRenderer(android.view.SurfaceHolder surfaceHolder, androidx.wear.watchface.style.CurrentUserStyleRepository currentUserStyleRepository, androidx.wear.watchface.WatchState watchState, @IntRange(from=0, to=60000) long interactiveDrawModeUpdateDelayMillis, optional int[] eglConfigAttribList) throws androidx.wear.watchface.Renderer.GlesRenderer.GlesException;
ctor @WorkerThread @kotlin.jvm.Throws(exceptionClasses=GlesException::class) public Renderer.GlesRenderer(android.view.SurfaceHolder surfaceHolder, androidx.wear.watchface.style.CurrentUserStyleRepository currentUserStyleRepository, androidx.wear.watchface.WatchState watchState, @IntRange(from=0, to=60000) long interactiveDrawModeUpdateDelayMillis) throws androidx.wear.watchface.Renderer.GlesRenderer.GlesException;
+ method public void dump(java.io.PrintWriter writer);
method public final android.opengl.EGLContext getEglBackgroundThreadContext();
method public final android.opengl.EGLConfig getEglConfig();
method public final android.opengl.EGLDisplay getEglDisplay();
diff --git a/wear/wear-watchface/api/res-current.txt b/wear/watchface/watchface/api/res-current.txt
similarity index 100%
rename from wear/wear-watchface/api/res-current.txt
rename to wear/watchface/watchface/api/res-current.txt
diff --git a/wear/wear-watchface/api/current.txt b/wear/watchface/watchface/api/restricted_current.txt
similarity index 85%
copy from wear/wear-watchface/api/current.txt
copy to wear/watchface/watchface/api/restricted_current.txt
index 0a61a68..4cdbf7f 100644
--- a/wear/wear-watchface/api/current.txt
+++ b/wear/watchface/watchface/api/restricted_current.txt
@@ -8,8 +8,8 @@
public interface CanvasComplication {
method public void drawHighlight(android.graphics.Canvas canvas, android.graphics.Rect bounds, int boundsType, java.time.ZonedDateTime zonedDateTime, @ColorInt int color);
- method public androidx.wear.complications.data.ComplicationData getData();
- method public void loadData(androidx.wear.complications.data.ComplicationData complicationData, boolean loadDrawablesAsynchronous);
+ method public androidx.wear.watchface.complications.data.ComplicationData getData();
+ method public void loadData(androidx.wear.watchface.complications.data.ComplicationData complicationData, boolean loadDrawablesAsynchronous);
method @WorkerThread public default void onRendererCreated(androidx.wear.watchface.Renderer renderer);
method @UiThread public void render(android.graphics.Canvas canvas, android.graphics.Rect bounds, java.time.ZonedDateTime zonedDateTime, androidx.wear.watchface.RenderParameters renderParameters, int slotId);
}
@@ -24,22 +24,22 @@
public final class ComplicationSlot {
method public android.graphics.Rect computeBounds(android.graphics.Rect screen);
- method public static androidx.wear.watchface.ComplicationSlot.Builder createBackgroundComplicationSlotBuilder(int id, androidx.wear.watchface.CanvasComplicationFactory canvasComplicationFactory, java.util.List<? extends androidx.wear.complications.data.ComplicationType> supportedTypes, androidx.wear.complications.DefaultComplicationDataSourcePolicy defaultDataSourcePolicy);
- method public static androidx.wear.watchface.ComplicationSlot.Builder createEdgeComplicationSlotBuilder(int id, androidx.wear.watchface.CanvasComplicationFactory canvasComplicationFactory, java.util.List<? extends androidx.wear.complications.data.ComplicationType> supportedTypes, androidx.wear.complications.DefaultComplicationDataSourcePolicy defaultDataSourcePolicy, androidx.wear.complications.ComplicationSlotBounds bounds, androidx.wear.watchface.ComplicationTapFilter complicationTapFilter);
- method public static androidx.wear.watchface.ComplicationSlot.Builder createRoundRectComplicationSlotBuilder(int id, androidx.wear.watchface.CanvasComplicationFactory canvasComplicationFactory, java.util.List<? extends androidx.wear.complications.data.ComplicationType> supportedTypes, androidx.wear.complications.DefaultComplicationDataSourcePolicy defaultDataSourcePolicy, androidx.wear.complications.ComplicationSlotBounds bounds);
+ method public static androidx.wear.watchface.ComplicationSlot.Builder createBackgroundComplicationSlotBuilder(int id, androidx.wear.watchface.CanvasComplicationFactory canvasComplicationFactory, java.util.List<? extends androidx.wear.watchface.complications.data.ComplicationType> supportedTypes, androidx.wear.watchface.complications.DefaultComplicationDataSourcePolicy defaultDataSourcePolicy);
+ method public static androidx.wear.watchface.ComplicationSlot.Builder createEdgeComplicationSlotBuilder(int id, androidx.wear.watchface.CanvasComplicationFactory canvasComplicationFactory, java.util.List<? extends androidx.wear.watchface.complications.data.ComplicationType> supportedTypes, androidx.wear.watchface.complications.DefaultComplicationDataSourcePolicy defaultDataSourcePolicy, androidx.wear.watchface.complications.ComplicationSlotBounds bounds, androidx.wear.watchface.ComplicationTapFilter complicationTapFilter);
+ method public static androidx.wear.watchface.ComplicationSlot.Builder createRoundRectComplicationSlotBuilder(int id, androidx.wear.watchface.CanvasComplicationFactory canvasComplicationFactory, java.util.List<? extends androidx.wear.watchface.complications.data.ComplicationType> supportedTypes, androidx.wear.watchface.complications.DefaultComplicationDataSourcePolicy defaultDataSourcePolicy, androidx.wear.watchface.complications.ComplicationSlotBounds bounds);
method @UiThread public int getAccessibilityTraversalIndex();
method public int getBoundsType();
method public androidx.wear.watchface.CanvasComplicationFactory getCanvasComplicationFactory();
- method public kotlinx.coroutines.flow.StateFlow<androidx.wear.complications.data.ComplicationData> getComplicationData();
- method @UiThread public androidx.wear.complications.ComplicationSlotBounds getComplicationSlotBounds();
+ method public kotlinx.coroutines.flow.StateFlow<androidx.wear.watchface.complications.data.ComplicationData> getComplicationData();
+ method @UiThread public androidx.wear.watchface.complications.ComplicationSlotBounds getComplicationSlotBounds();
method public android.os.Bundle getConfigExtras();
- method @UiThread public androidx.wear.complications.DefaultComplicationDataSourcePolicy getDefaultDataSourcePolicy();
- method @UiThread public androidx.wear.complications.data.ComplicationType getDefaultDataSourceType();
+ method @UiThread public androidx.wear.watchface.complications.DefaultComplicationDataSourcePolicy getDefaultDataSourcePolicy();
+ method @UiThread public androidx.wear.watchface.complications.data.ComplicationType getDefaultDataSourceType();
method public boolean getFixedComplicationDataSource();
method public int getId();
method public boolean getInitiallyEnabled();
method public androidx.wear.watchface.CanvasComplication getRenderer();
- method @UiThread public java.util.List<androidx.wear.complications.data.ComplicationType> getSupportedTypes();
+ method @UiThread public java.util.List<androidx.wear.watchface.complications.data.ComplicationType> getSupportedTypes();
method public androidx.wear.watchface.ComplicationTapFilter getTapFilter();
method public boolean isActiveAt(java.time.Instant instant);
method @UiThread public boolean isEnabled();
@@ -48,17 +48,17 @@
property @UiThread public final int accessibilityTraversalIndex;
property public final int boundsType;
property public final androidx.wear.watchface.CanvasComplicationFactory canvasComplicationFactory;
- property public final kotlinx.coroutines.flow.StateFlow<androidx.wear.complications.data.ComplicationData> complicationData;
- property @UiThread public final androidx.wear.complications.ComplicationSlotBounds complicationSlotBounds;
+ property public final kotlinx.coroutines.flow.StateFlow<androidx.wear.watchface.complications.data.ComplicationData> complicationData;
+ property @UiThread public final androidx.wear.watchface.complications.ComplicationSlotBounds complicationSlotBounds;
property public final android.os.Bundle configExtras;
- property @UiThread public final androidx.wear.complications.DefaultComplicationDataSourcePolicy defaultDataSourcePolicy;
- property @UiThread public final androidx.wear.complications.data.ComplicationType defaultDataSourceType;
+ property @UiThread public final androidx.wear.watchface.complications.DefaultComplicationDataSourcePolicy defaultDataSourcePolicy;
+ property @UiThread public final androidx.wear.watchface.complications.data.ComplicationType defaultDataSourceType;
property @UiThread public final boolean enabled;
property public final boolean fixedComplicationDataSource;
property public final int id;
property public final boolean initiallyEnabled;
property public final androidx.wear.watchface.CanvasComplication renderer;
- property @UiThread public final java.util.List<androidx.wear.complications.data.ComplicationType> supportedTypes;
+ property @UiThread public final java.util.List<androidx.wear.watchface.complications.data.ComplicationType> supportedTypes;
property public final androidx.wear.watchface.ComplicationTapFilter tapFilter;
field public static final androidx.wear.watchface.ComplicationSlot.Companion Companion;
}
@@ -67,15 +67,15 @@
method public androidx.wear.watchface.ComplicationSlot build();
method public androidx.wear.watchface.ComplicationSlot.Builder setAccessibilityTraversalIndex(int accessibilityTraversalIndex);
method public androidx.wear.watchface.ComplicationSlot.Builder setConfigExtras(android.os.Bundle extras);
- method public androidx.wear.watchface.ComplicationSlot.Builder setDefaultDataSourceType(androidx.wear.complications.data.ComplicationType defaultDataSourceType);
+ method public androidx.wear.watchface.ComplicationSlot.Builder setDefaultDataSourceType(androidx.wear.watchface.complications.data.ComplicationType defaultDataSourceType);
method public androidx.wear.watchface.ComplicationSlot.Builder setEnabled(boolean enabled);
method public androidx.wear.watchface.ComplicationSlot.Builder setFixedComplicationDataSource(boolean fixedComplicationDataSource);
}
public static final class ComplicationSlot.Companion {
- method public androidx.wear.watchface.ComplicationSlot.Builder createBackgroundComplicationSlotBuilder(int id, androidx.wear.watchface.CanvasComplicationFactory canvasComplicationFactory, java.util.List<? extends androidx.wear.complications.data.ComplicationType> supportedTypes, androidx.wear.complications.DefaultComplicationDataSourcePolicy defaultDataSourcePolicy);
- method public androidx.wear.watchface.ComplicationSlot.Builder createEdgeComplicationSlotBuilder(int id, androidx.wear.watchface.CanvasComplicationFactory canvasComplicationFactory, java.util.List<? extends androidx.wear.complications.data.ComplicationType> supportedTypes, androidx.wear.complications.DefaultComplicationDataSourcePolicy defaultDataSourcePolicy, androidx.wear.complications.ComplicationSlotBounds bounds, androidx.wear.watchface.ComplicationTapFilter complicationTapFilter);
- method public androidx.wear.watchface.ComplicationSlot.Builder createRoundRectComplicationSlotBuilder(int id, androidx.wear.watchface.CanvasComplicationFactory canvasComplicationFactory, java.util.List<? extends androidx.wear.complications.data.ComplicationType> supportedTypes, androidx.wear.complications.DefaultComplicationDataSourcePolicy defaultDataSourcePolicy, androidx.wear.complications.ComplicationSlotBounds bounds);
+ method public androidx.wear.watchface.ComplicationSlot.Builder createBackgroundComplicationSlotBuilder(int id, androidx.wear.watchface.CanvasComplicationFactory canvasComplicationFactory, java.util.List<? extends androidx.wear.watchface.complications.data.ComplicationType> supportedTypes, androidx.wear.watchface.complications.DefaultComplicationDataSourcePolicy defaultDataSourcePolicy);
+ method public androidx.wear.watchface.ComplicationSlot.Builder createEdgeComplicationSlotBuilder(int id, androidx.wear.watchface.CanvasComplicationFactory canvasComplicationFactory, java.util.List<? extends androidx.wear.watchface.complications.data.ComplicationType> supportedTypes, androidx.wear.watchface.complications.DefaultComplicationDataSourcePolicy defaultDataSourcePolicy, androidx.wear.watchface.complications.ComplicationSlotBounds bounds, androidx.wear.watchface.ComplicationTapFilter complicationTapFilter);
+ method public androidx.wear.watchface.ComplicationSlot.Builder createRoundRectComplicationSlotBuilder(int id, androidx.wear.watchface.CanvasComplicationFactory canvasComplicationFactory, java.util.List<? extends androidx.wear.watchface.complications.data.ComplicationType> supportedTypes, androidx.wear.watchface.complications.DefaultComplicationDataSourcePolicy defaultDataSourcePolicy, androidx.wear.watchface.complications.ComplicationSlotBounds bounds);
}
public final class ComplicationSlotsManager {
@@ -103,14 +103,14 @@
}
public final class ContentDescriptionLabel {
- ctor public ContentDescriptionLabel(androidx.wear.complications.data.ComplicationText text, android.graphics.Rect bounds, android.app.PendingIntent? tapAction);
+ ctor public ContentDescriptionLabel(androidx.wear.watchface.complications.data.ComplicationText text, android.graphics.Rect bounds, android.app.PendingIntent? tapAction);
method public android.graphics.Rect getBounds();
method public android.app.PendingIntent? getTapAction();
- method public androidx.wear.complications.data.ComplicationText getText();
+ method public androidx.wear.watchface.complications.data.ComplicationText getText();
method public CharSequence getTextAt(android.content.res.Resources resources, java.time.Instant instant);
property public final android.graphics.Rect bounds;
property public final android.app.PendingIntent? tapAction;
- property public final androidx.wear.complications.data.ComplicationText text;
+ property public final androidx.wear.watchface.complications.data.ComplicationText text;
}
public enum DrawMode {
@@ -127,10 +127,12 @@
ctor public RenderParameters(androidx.wear.watchface.DrawMode drawMode, java.util.Set<? extends androidx.wear.watchface.style.WatchFaceLayer> watchFaceLayers, optional androidx.wear.watchface.RenderParameters.HighlightLayer? highlightLayer, optional java.util.Map<java.lang.Integer,androidx.wear.watchface.TapEvent> lastComplicationTapDownEvents);
ctor public RenderParameters(androidx.wear.watchface.DrawMode drawMode, java.util.Set<? extends androidx.wear.watchface.style.WatchFaceLayer> watchFaceLayers, optional androidx.wear.watchface.RenderParameters.HighlightLayer? highlightLayer);
ctor public RenderParameters(androidx.wear.watchface.DrawMode drawMode, java.util.Set<? extends androidx.wear.watchface.style.WatchFaceLayer> watchFaceLayers);
+ ctor @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public RenderParameters(androidx.wear.watchface.data.RenderParametersWireFormat wireFormat);
method public androidx.wear.watchface.DrawMode getDrawMode();
method public androidx.wear.watchface.RenderParameters.HighlightLayer? getHighlightLayer();
method public java.util.Map<java.lang.Integer,androidx.wear.watchface.TapEvent> getLastComplicationTapDownEvents();
method public java.util.Set<androidx.wear.watchface.style.WatchFaceLayer> getWatchFaceLayers();
+ method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public androidx.wear.watchface.data.RenderParametersWireFormat toWireFormat();
property public final androidx.wear.watchface.DrawMode drawMode;
property public final androidx.wear.watchface.RenderParameters.HighlightLayer? highlightLayer;
property public final java.util.Map<java.lang.Integer,androidx.wear.watchface.TapEvent> lastComplicationTapDownEvents;
@@ -172,6 +174,7 @@
}
public abstract sealed class Renderer {
+ method public abstract void dump(java.io.PrintWriter writer);
method public final java.util.Collection<kotlin.Pair<java.lang.Integer,androidx.wear.watchface.ContentDescriptionLabel>> getAdditionalContentDescriptionLabels();
method public final float getCenterX();
method public final float getCenterY();
@@ -198,6 +201,7 @@
public abstract static class Renderer.CanvasRenderer extends androidx.wear.watchface.Renderer {
ctor @WorkerThread public Renderer.CanvasRenderer(android.view.SurfaceHolder surfaceHolder, androidx.wear.watchface.style.CurrentUserStyleRepository currentUserStyleRepository, androidx.wear.watchface.WatchState watchState, int canvasType, @IntRange(from=0, to=60000) long interactiveDrawModeUpdateDelayMillis);
+ method public void dump(java.io.PrintWriter writer);
method @UiThread public suspend Object? init(kotlin.coroutines.Continuation<? super kotlin.Unit> p);
method @UiThread public abstract void render(android.graphics.Canvas canvas, android.graphics.Rect bounds, java.time.ZonedDateTime zonedDateTime);
method @UiThread public abstract void renderHighlightLayer(android.graphics.Canvas canvas, android.graphics.Rect bounds, java.time.ZonedDateTime zonedDateTime);
@@ -207,6 +211,7 @@
ctor @WorkerThread @kotlin.jvm.Throws(exceptionClasses=GlesException::class) public Renderer.GlesRenderer(android.view.SurfaceHolder surfaceHolder, androidx.wear.watchface.style.CurrentUserStyleRepository currentUserStyleRepository, androidx.wear.watchface.WatchState watchState, @IntRange(from=0, to=60000) long interactiveDrawModeUpdateDelayMillis, optional int[] eglConfigAttribList, optional int[] eglSurfaceAttribList) throws androidx.wear.watchface.Renderer.GlesRenderer.GlesException;
ctor @WorkerThread @kotlin.jvm.Throws(exceptionClasses=GlesException::class) public Renderer.GlesRenderer(android.view.SurfaceHolder surfaceHolder, androidx.wear.watchface.style.CurrentUserStyleRepository currentUserStyleRepository, androidx.wear.watchface.WatchState watchState, @IntRange(from=0, to=60000) long interactiveDrawModeUpdateDelayMillis, optional int[] eglConfigAttribList) throws androidx.wear.watchface.Renderer.GlesRenderer.GlesException;
ctor @WorkerThread @kotlin.jvm.Throws(exceptionClasses=GlesException::class) public Renderer.GlesRenderer(android.view.SurfaceHolder surfaceHolder, androidx.wear.watchface.style.CurrentUserStyleRepository currentUserStyleRepository, androidx.wear.watchface.WatchState watchState, @IntRange(from=0, to=60000) long interactiveDrawModeUpdateDelayMillis) throws androidx.wear.watchface.Renderer.GlesRenderer.GlesException;
+ method public void dump(java.io.PrintWriter writer);
method public final android.opengl.EGLContext getEglBackgroundThreadContext();
method public final android.opengl.EGLConfig getEglConfig();
method public final android.opengl.EGLDisplay getEglDisplay();
diff --git a/wear/wear-watchface/build.gradle b/wear/watchface/watchface/build.gradle
similarity index 85%
rename from wear/wear-watchface/build.gradle
rename to wear/watchface/watchface/build.gradle
index 41a7013..8fb3261 100644
--- a/wear/wear-watchface/build.gradle
+++ b/wear/watchface/watchface/build.gradle
@@ -27,16 +27,16 @@
dependencies {
api("androidx.annotation:annotation:1.1.0")
- api(project(":wear:wear-complications-data"))
- api(project(":wear:wear-watchface-data"))
- api(project(":wear:wear-watchface-style"))
+ api(project(":wear:watchface:watchface-complications-data"))
+ api(project(":wear:watchface:watchface-data"))
+ api(project(":wear:watchface:watchface-style"))
api(libs.kotlinStdlib)
api(libs.kotlinCoroutinesAndroid)
implementation("androidx.core:core:1.1.0")
androidTestImplementation(project(":test:screenshot:screenshot"))
- androidTestImplementation(project(":wear:wear-watchface-samples"))
+ androidTestImplementation(project(":wear:watchface:watchface-samples"))
androidTestImplementation(libs.testExtJunit)
androidTestImplementation(libs.testCore)
androidTestImplementation(libs.testRunner)
@@ -45,7 +45,7 @@
androidTestImplementation(libs.dexmakerMockito, excludes.bytebuddy) // DexMaker has it"s own MockMaker
androidTestImplementation(libs.truth)
- testImplementation(project(":wear:wear-watchface-complications-rendering"))
+ testImplementation(project(":wear:watchface:watchface-complications-rendering"))
testImplementation(libs.testExtJunit)
testImplementation(libs.testCore)
testImplementation(libs.testRules)
@@ -71,8 +71,7 @@
androidx {
name = "Android Wear Watchface"
publish = Publish.SNAPSHOT_AND_RELEASE
- mavenGroup = LibraryGroups.WEAR
- mavenVersion = LibraryVersions.WEAR_WATCHFACE
+ mavenGroup = LibraryGroups.WEAR_WATCHFACE
inceptionYear = "2020"
description = "Android Wear Watchface"
}
diff --git a/wear/watchface/watchface/lint-baseline.xml b/wear/watchface/watchface/lint-baseline.xml
new file mode 100644
index 0000000..d18e470
--- /dev/null
+++ b/wear/watchface/watchface/lint-baseline.xml
@@ -0,0 +1,92 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<issues format="6" by="lint 7.1.0-dev" type="baseline" client="gradle" dependencies="false" name="AGP (7.1.0-dev)" variant="all" version="7.1.0-dev">
+
+ <issue
+ id="MissingClass"
+ message="Class referenced in the layout file, `androidx.wear.widget.SwipeDismissFrameLayout`, was not found in the project or the libraries"
+ errorLine1="<androidx.wear.widget.SwipeDismissFrameLayout"
+ errorLine2="^">
+ <location
+ file="src/main/res/layout/complication_config_layout.xml"
+ line="2"
+ column="1"/>
+ </issue>
+
+ <issue
+ id="MissingClass"
+ message="Class referenced in the layout file, `androidx.wear.widget.SwipeDismissFrameLayout`, was not found in the project or the libraries"
+ errorLine1="<androidx.wear.widget.SwipeDismissFrameLayout"
+ errorLine2="^">
+ <location
+ file="src/main/res/layout/config_layout.xml"
+ line="2"
+ column="1"/>
+ </issue>
+
+ <issue
+ id="MissingClass"
+ message="Class referenced in the layout file, `androidx.wear.widget.WearableRecyclerView`, was not found in the project or the libraries"
+ errorLine1=" <androidx.wear.widget.WearableRecyclerView"
+ errorLine2=" ^">
+ <location
+ file="src/main/res/layout/config_layout.xml"
+ line="11"
+ column="5"/>
+ </issue>
+
+ <issue
+ id="MissingClass"
+ message="Class referenced in the layout file, `androidx.wear.widget.SwipeDismissFrameLayout`, was not found in the project or the libraries"
+ errorLine1="<androidx.wear.widget.SwipeDismissFrameLayout"
+ errorLine2="^">
+ <location
+ file="src/main/res/layout/style_options_layout.xml"
+ line="2"
+ column="1"/>
+ </issue>
+
+ <issue
+ id="MissingClass"
+ message="Class referenced in the layout file, `androidx.wear.widget.WearableRecyclerView`, was not found in the project or the libraries"
+ errorLine1=" <androidx.wear.widget.WearableRecyclerView"
+ errorLine2=" ^">
+ <location
+ file="src/main/res/layout/style_options_layout.xml"
+ line="10"
+ column="5"/>
+ </issue>
+
+ <issue
+ id="NewApi"
+ message="Call requires API level 27 (current min is 26): `dump`"
+ errorLine1=" HeadlessWatchFaceImpl.dump(indentingPrintWriter)"
+ errorLine2=" ~~~~">
+ <location
+ file="src/main/java/androidx/wear/watchface/WatchFaceService.kt"
+ line="1845"
+ column="31"/>
+ </issue>
+
+ <issue
+ id="WrongThread"
+ message="Method addTapListener must be called from the UI thread, currently inferred thread is worker thread"
+ errorLine1=" complicationSlotsManager.addTapListener("
+ errorLine2=" ^">
+ <location
+ file="src/test/java/androidx/wear/watchface/TestCommon.kt"
+ line="91"
+ column="9"/>
+ </issue>
+
+ <issue
+ id="ClassVerificationFailure"
+ message="This call references a method added in API level 30; however, the containing class androidx.wear.watchface.WatchFaceImpl is reachable from earlier API levels and will fail run-time class verification."
+ errorLine1=" renderer.surfaceHolder.surface.setFrameRate("
+ errorLine2=" ~~~~~~~~~~~~">
+ <location
+ file="src/main/java/androidx/wear/watchface/WatchFace.kt"
+ line="601"
+ column="44"/>
+ </issue>
+
+</issues>
diff --git a/wear/wear-watchface/samples/app/build.gradle b/wear/watchface/watchface/samples/app/build.gradle
similarity index 91%
rename from wear/wear-watchface/samples/app/build.gradle
rename to wear/watchface/watchface/samples/app/build.gradle
index 6e58e91..aac6750 100644
--- a/wear/wear-watchface/samples/app/build.gradle
+++ b/wear/watchface/watchface/samples/app/build.gradle
@@ -24,14 +24,13 @@
}
dependencies {
- implementation(project(":wear:wear-watchface-samples"))
+ implementation(project(":wear:watchface:watchface-samples"))
}
androidx {
name = "AndroidX Wear Watchface Samples app"
type = LibraryType.SAMPLES
- mavenGroup = LibraryGroups.WEAR
- mavenVersion = LibraryVersions.WEAR_WATCHFACE
+ mavenGroup = LibraryGroups.WEAR_WATCHFACE
inceptionYear = "2021"
description = "APK for the sample code for the Androidx Wear Watchface library"
}
diff --git a/wear/wear-watchface/samples/app/src/main/AndroidManifest.xml b/wear/watchface/watchface/samples/app/src/main/AndroidManifest.xml
similarity index 100%
rename from wear/wear-watchface/samples/app/src/main/AndroidManifest.xml
rename to wear/watchface/watchface/samples/app/src/main/AndroidManifest.xml
diff --git a/wear/wear-watchface/samples/build.gradle b/wear/watchface/watchface/samples/build.gradle
similarity index 81%
rename from wear/wear-watchface/samples/build.gradle
rename to wear/watchface/watchface/samples/build.gradle
index 6d6d005..032858d 100644
--- a/wear/wear-watchface/samples/build.gradle
+++ b/wear/watchface/watchface/samples/build.gradle
@@ -26,17 +26,16 @@
dependencies {
compileOnly(project(":annotation:annotation-sampled"))
- api(project(":wear:wear-watchface"))
- implementation(project(":wear:wear-watchface-complications-rendering"))
- implementation(project(":wear:wear-watchface-editor-samples"))
+ api(project(":wear:watchface:watchface"))
+ implementation(project(":wear:watchface:watchface-complications-rendering"))
+ implementation(project(":wear:watchface:watchface-editor-samples"))
api(libs.kotlinStdlib)
}
androidx {
name = "AndroidX Wear Watchface Samples"
type = LibraryType.SAMPLES
- mavenGroup = LibraryGroups.WEAR
- mavenVersion = LibraryVersions.WEAR_WATCHFACE
+ mavenGroup = LibraryGroups.WEAR_WATCHFACE
inceptionYear = "2020"
description = "Contains the sample code for the Androidx Wear Watchface library"
}
diff --git a/wear/wear-watchface/samples/minimal/build.gradle b/wear/watchface/watchface/samples/minimal/build.gradle
similarity index 88%
rename from wear/wear-watchface/samples/minimal/build.gradle
rename to wear/watchface/watchface/samples/minimal/build.gradle
index 48af133..ed5433c 100644
--- a/wear/wear-watchface/samples/minimal/build.gradle
+++ b/wear/watchface/watchface/samples/minimal/build.gradle
@@ -24,16 +24,15 @@
}
dependencies {
- api(project(":wear:wear-watchface"))
- api(project(":wear:wear-watchface-guava"))
+ api(project(":wear:watchface:watchface"))
+ api(project(":wear:watchface:watchface-guava"))
implementation(libs.guavaAndroid)
}
androidx {
name = "AndroidX Wear Watchface Minimal Sample"
type = LibraryType.SAMPLES
- mavenGroup = LibraryGroups.WEAR
- mavenVersion = LibraryVersions.WEAR_WATCHFACE
+ mavenGroup = LibraryGroups.WEAR_WATCHFACE
inceptionYear = "2021"
description = "Contains the sample code for the Androidx Wear Watchface library"
}
diff --git a/wear/wear-watchface/samples/minimal/src/main/AndroidManifest.xml b/wear/watchface/watchface/samples/minimal/src/main/AndroidManifest.xml
similarity index 100%
rename from wear/wear-watchface/samples/minimal/src/main/AndroidManifest.xml
rename to wear/watchface/watchface/samples/minimal/src/main/AndroidManifest.xml
diff --git a/wear/wear-watchface/samples/minimal/src/main/java/androidx/wear/watchface/samples/minimal/WatchFaceRenderer.java b/wear/watchface/watchface/samples/minimal/src/main/java/androidx/wear/watchface/samples/minimal/WatchFaceRenderer.java
similarity index 100%
rename from wear/wear-watchface/samples/minimal/src/main/java/androidx/wear/watchface/samples/minimal/WatchFaceRenderer.java
rename to wear/watchface/watchface/samples/minimal/src/main/java/androidx/wear/watchface/samples/minimal/WatchFaceRenderer.java
diff --git a/wear/wear-watchface/samples/minimal/src/main/java/androidx/wear/watchface/samples/minimal/WatchFaceService.java b/wear/watchface/watchface/samples/minimal/src/main/java/androidx/wear/watchface/samples/minimal/WatchFaceService.java
similarity index 100%
rename from wear/wear-watchface/samples/minimal/src/main/java/androidx/wear/watchface/samples/minimal/WatchFaceService.java
rename to wear/watchface/watchface/samples/minimal/src/main/java/androidx/wear/watchface/samples/minimal/WatchFaceService.java
diff --git a/wear/wear-watchface/samples/minimal/src/main/res/drawable/ic_launcher_background.xml b/wear/watchface/watchface/samples/minimal/src/main/res/drawable/ic_launcher_background.xml
similarity index 100%
rename from wear/wear-watchface/samples/minimal/src/main/res/drawable/ic_launcher_background.xml
rename to wear/watchface/watchface/samples/minimal/src/main/res/drawable/ic_launcher_background.xml
diff --git a/wear/wear-watchface/samples/minimal/src/main/res/drawable/ic_launcher_foreground.xml b/wear/watchface/watchface/samples/minimal/src/main/res/drawable/ic_launcher_foreground.xml
similarity index 100%
rename from wear/wear-watchface/samples/minimal/src/main/res/drawable/ic_launcher_foreground.xml
rename to wear/watchface/watchface/samples/minimal/src/main/res/drawable/ic_launcher_foreground.xml
diff --git a/wear/wear-watchface/samples/minimal/src/main/res/drawable/preview.png b/wear/watchface/watchface/samples/minimal/src/main/res/drawable/preview.png
similarity index 100%
rename from wear/wear-watchface/samples/minimal/src/main/res/drawable/preview.png
rename to wear/watchface/watchface/samples/minimal/src/main/res/drawable/preview.png
Binary files differ
diff --git a/wear/wear-watchface/samples/minimal/src/main/res/mipmap-anydpi/ic_launcher.xml b/wear/watchface/watchface/samples/minimal/src/main/res/mipmap-anydpi/ic_launcher.xml
similarity index 100%
rename from wear/wear-watchface/samples/minimal/src/main/res/mipmap-anydpi/ic_launcher.xml
rename to wear/watchface/watchface/samples/minimal/src/main/res/mipmap-anydpi/ic_launcher.xml
diff --git a/wear/wear-watchface/samples/minimal/src/main/res/mipmap-hdpi/ic_launcher.png b/wear/watchface/watchface/samples/minimal/src/main/res/mipmap-hdpi/ic_launcher.png
similarity index 100%
rename from wear/wear-watchface/samples/minimal/src/main/res/mipmap-hdpi/ic_launcher.png
rename to wear/watchface/watchface/samples/minimal/src/main/res/mipmap-hdpi/ic_launcher.png
Binary files differ
diff --git a/wear/wear-watchface/samples/minimal/src/main/res/mipmap-mdpi/ic_launcher.png b/wear/watchface/watchface/samples/minimal/src/main/res/mipmap-mdpi/ic_launcher.png
similarity index 100%
rename from wear/wear-watchface/samples/minimal/src/main/res/mipmap-mdpi/ic_launcher.png
rename to wear/watchface/watchface/samples/minimal/src/main/res/mipmap-mdpi/ic_launcher.png
Binary files differ
diff --git a/wear/wear-watchface/samples/minimal/src/main/res/mipmap-xhdpi/ic_launcher.png b/wear/watchface/watchface/samples/minimal/src/main/res/mipmap-xhdpi/ic_launcher.png
similarity index 100%
rename from wear/wear-watchface/samples/minimal/src/main/res/mipmap-xhdpi/ic_launcher.png
rename to wear/watchface/watchface/samples/minimal/src/main/res/mipmap-xhdpi/ic_launcher.png
Binary files differ
diff --git a/wear/wear-watchface/samples/minimal/src/main/res/mipmap-xxhdpi/ic_launcher.png b/wear/watchface/watchface/samples/minimal/src/main/res/mipmap-xxhdpi/ic_launcher.png
similarity index 100%
rename from wear/wear-watchface/samples/minimal/src/main/res/mipmap-xxhdpi/ic_launcher.png
rename to wear/watchface/watchface/samples/minimal/src/main/res/mipmap-xxhdpi/ic_launcher.png
Binary files differ
diff --git a/wear/wear-watchface/samples/minimal/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/wear/watchface/watchface/samples/minimal/src/main/res/mipmap-xxxhdpi/ic_launcher.png
similarity index 100%
rename from wear/wear-watchface/samples/minimal/src/main/res/mipmap-xxxhdpi/ic_launcher.png
rename to wear/watchface/watchface/samples/minimal/src/main/res/mipmap-xxxhdpi/ic_launcher.png
Binary files differ
diff --git a/wear/wear-watchface/samples/minimal/src/main/res/values/strings.xml b/wear/watchface/watchface/samples/minimal/src/main/res/values/strings.xml
similarity index 100%
rename from wear/wear-watchface/samples/minimal/src/main/res/values/strings.xml
rename to wear/watchface/watchface/samples/minimal/src/main/res/values/strings.xml
diff --git a/wear/wear-watchface/samples/minimal/src/main/res/xml/watch_face.xml b/wear/watchface/watchface/samples/minimal/src/main/res/xml/watch_face.xml
similarity index 100%
rename from wear/wear-watchface/samples/minimal/src/main/res/xml/watch_face.xml
rename to wear/watchface/watchface/samples/minimal/src/main/res/xml/watch_face.xml
diff --git a/wear/wear-watchface/samples/src/main/AndroidManifest.xml b/wear/watchface/watchface/samples/src/main/AndroidManifest.xml
similarity index 100%
rename from wear/wear-watchface/samples/src/main/AndroidManifest.xml
rename to wear/watchface/watchface/samples/src/main/AndroidManifest.xml
diff --git a/wear/wear-watchface/samples/src/main/java/androidx/wear/watchface/samples/ExampleCanvasAnalogWatchFaceService.kt b/wear/watchface/watchface/samples/src/main/java/androidx/wear/watchface/samples/ExampleCanvasAnalogWatchFaceService.kt
similarity index 98%
rename from wear/wear-watchface/samples/src/main/java/androidx/wear/watchface/samples/ExampleCanvasAnalogWatchFaceService.kt
rename to wear/watchface/watchface/samples/src/main/java/androidx/wear/watchface/samples/ExampleCanvasAnalogWatchFaceService.kt
index 02fcf2c..322491e 100644
--- a/wear/wear-watchface/samples/src/main/java/androidx/wear/watchface/samples/ExampleCanvasAnalogWatchFaceService.kt
+++ b/wear/watchface/watchface/samples/src/main/java/androidx/wear/watchface/samples/ExampleCanvasAnalogWatchFaceService.kt
@@ -24,10 +24,10 @@
import android.graphics.RectF
import android.graphics.drawable.Icon
import android.view.SurfaceHolder
-import androidx.wear.complications.ComplicationSlotBounds
-import androidx.wear.complications.DefaultComplicationDataSourcePolicy
-import androidx.wear.complications.SystemDataSources
-import androidx.wear.complications.data.ComplicationType
+import androidx.wear.watchface.complications.ComplicationSlotBounds
+import androidx.wear.watchface.complications.DefaultComplicationDataSourcePolicy
+import androidx.wear.watchface.complications.SystemDataSources
+import androidx.wear.watchface.complications.data.ComplicationType
import androidx.wear.watchface.CanvasComplicationFactory
import androidx.wear.watchface.CanvasType
import androidx.wear.watchface.ComplicationSlot
diff --git a/wear/wear-watchface/samples/src/main/java/androidx/wear/watchface/samples/ExampleCanvasDigitalWatchFaceService.kt b/wear/watchface/watchface/samples/src/main/java/androidx/wear/watchface/samples/ExampleCanvasDigitalWatchFaceService.kt
similarity index 99%
rename from wear/wear-watchface/samples/src/main/java/androidx/wear/watchface/samples/ExampleCanvasDigitalWatchFaceService.kt
rename to wear/watchface/watchface/samples/src/main/java/androidx/wear/watchface/samples/ExampleCanvasDigitalWatchFaceService.kt
index 6abfd99..6ec80ea0 100644
--- a/wear/wear-watchface/samples/src/main/java/androidx/wear/watchface/samples/ExampleCanvasDigitalWatchFaceService.kt
+++ b/wear/watchface/watchface/samples/src/main/java/androidx/wear/watchface/samples/ExampleCanvasDigitalWatchFaceService.kt
@@ -36,10 +36,10 @@
import android.view.animation.AnimationUtils
import android.view.animation.PathInterpolator
import androidx.annotation.ColorInt
-import androidx.wear.complications.ComplicationSlotBounds
-import androidx.wear.complications.DefaultComplicationDataSourcePolicy
-import androidx.wear.complications.SystemDataSources
-import androidx.wear.complications.data.ComplicationType
+import androidx.wear.watchface.complications.ComplicationSlotBounds
+import androidx.wear.watchface.complications.DefaultComplicationDataSourcePolicy
+import androidx.wear.watchface.complications.SystemDataSources
+import androidx.wear.watchface.complications.data.ComplicationType
import androidx.wear.watchface.CanvasComplicationFactory
import androidx.wear.watchface.CanvasType
import androidx.wear.watchface.ComplicationSlot
diff --git a/wear/wear-watchface/samples/src/main/java/androidx/wear/watchface/samples/ExampleOpenGLBackgroundInitWatchFaceService.kt b/wear/watchface/watchface/samples/src/main/java/androidx/wear/watchface/samples/ExampleOpenGLBackgroundInitWatchFaceService.kt
similarity index 100%
rename from wear/wear-watchface/samples/src/main/java/androidx/wear/watchface/samples/ExampleOpenGLBackgroundInitWatchFaceService.kt
rename to wear/watchface/watchface/samples/src/main/java/androidx/wear/watchface/samples/ExampleOpenGLBackgroundInitWatchFaceService.kt
diff --git a/wear/wear-watchface/samples/src/main/java/androidx/wear/watchface/samples/ExampleOpenGLWatchFaceService.kt b/wear/watchface/watchface/samples/src/main/java/androidx/wear/watchface/samples/ExampleOpenGLWatchFaceService.kt
similarity index 99%
rename from wear/wear-watchface/samples/src/main/java/androidx/wear/watchface/samples/ExampleOpenGLWatchFaceService.kt
rename to wear/watchface/watchface/samples/src/main/java/androidx/wear/watchface/samples/ExampleOpenGLWatchFaceService.kt
index a59e3b9..43444c4 100644
--- a/wear/wear-watchface/samples/src/main/java/androidx/wear/watchface/samples/ExampleOpenGLWatchFaceService.kt
+++ b/wear/watchface/watchface/samples/src/main/java/androidx/wear/watchface/samples/ExampleOpenGLWatchFaceService.kt
@@ -26,10 +26,10 @@
import android.util.Log
import android.view.Gravity
import android.view.SurfaceHolder
-import androidx.wear.complications.ComplicationSlotBounds
-import androidx.wear.complications.DefaultComplicationDataSourcePolicy
-import androidx.wear.complications.SystemDataSources
-import androidx.wear.complications.data.ComplicationType
+import androidx.wear.watchface.complications.ComplicationSlotBounds
+import androidx.wear.watchface.complications.DefaultComplicationDataSourcePolicy
+import androidx.wear.watchface.complications.SystemDataSources
+import androidx.wear.watchface.complications.data.ComplicationType
import androidx.wear.watchface.ComplicationSlot
import androidx.wear.watchface.ComplicationSlotsManager
import androidx.wear.watchface.DrawMode
diff --git a/wear/wear-watchface/samples/src/main/java/androidx/wear/watchface/samples/KDocExampleWatchFace.kt b/wear/watchface/watchface/samples/src/main/java/androidx/wear/watchface/samples/KDocExampleWatchFace.kt
similarity index 96%
rename from wear/wear-watchface/samples/src/main/java/androidx/wear/watchface/samples/KDocExampleWatchFace.kt
rename to wear/watchface/watchface/samples/src/main/java/androidx/wear/watchface/samples/KDocExampleWatchFace.kt
index cace3f7..44805cb 100644
--- a/wear/wear-watchface/samples/src/main/java/androidx/wear/watchface/samples/KDocExampleWatchFace.kt
+++ b/wear/watchface/watchface/samples/src/main/java/androidx/wear/watchface/samples/KDocExampleWatchFace.kt
@@ -23,10 +23,10 @@
import android.graphics.RectF
import android.view.SurfaceHolder
import androidx.annotation.Sampled
-import androidx.wear.complications.ComplicationSlotBounds
-import androidx.wear.complications.DefaultComplicationDataSourcePolicy
-import androidx.wear.complications.SystemDataSources
-import androidx.wear.complications.data.ComplicationType
+import androidx.wear.watchface.complications.ComplicationSlotBounds
+import androidx.wear.watchface.complications.DefaultComplicationDataSourcePolicy
+import androidx.wear.watchface.complications.SystemDataSources
+import androidx.wear.watchface.complications.data.ComplicationType
import androidx.wear.watchface.CanvasComplicationFactory
import androidx.wear.watchface.CanvasType
import androidx.wear.watchface.ComplicationSlot
diff --git a/wear/wear-watchface/samples/src/main/java/androidx/wear/watchface/samples/Style.kt b/wear/watchface/watchface/samples/src/main/java/androidx/wear/watchface/samples/Style.kt
similarity index 100%
rename from wear/wear-watchface/samples/src/main/java/androidx/wear/watchface/samples/Style.kt
rename to wear/watchface/watchface/samples/src/main/java/androidx/wear/watchface/samples/Style.kt
diff --git a/wear/wear-watchface/samples/src/main/res/drawable-280dpi/blue_style.png b/wear/watchface/watchface/samples/src/main/res/drawable-280dpi/blue_style.png
similarity index 100%
rename from wear/wear-watchface/samples/src/main/res/drawable-280dpi/blue_style.png
rename to wear/watchface/watchface/samples/src/main/res/drawable-280dpi/blue_style.png
Binary files differ
diff --git a/wear/wear-watchface/samples/src/main/res/drawable-280dpi/green_style.png b/wear/watchface/watchface/samples/src/main/res/drawable-280dpi/green_style.png
similarity index 100%
rename from wear/wear-watchface/samples/src/main/res/drawable-280dpi/green_style.png
rename to wear/watchface/watchface/samples/src/main/res/drawable-280dpi/green_style.png
Binary files differ
diff --git a/wear/wear-watchface/samples/src/main/res/drawable-280dpi/red_style.png b/wear/watchface/watchface/samples/src/main/res/drawable-280dpi/red_style.png
similarity index 100%
rename from wear/wear-watchface/samples/src/main/res/drawable-280dpi/red_style.png
rename to wear/watchface/watchface/samples/src/main/res/drawable-280dpi/red_style.png
Binary files differ
diff --git a/wear/wear-watchface/samples/src/main/res/drawable-hdpi/blue_style.png b/wear/watchface/watchface/samples/src/main/res/drawable-hdpi/blue_style.png
similarity index 100%
rename from wear/wear-watchface/samples/src/main/res/drawable-hdpi/blue_style.png
rename to wear/watchface/watchface/samples/src/main/res/drawable-hdpi/blue_style.png
Binary files differ
diff --git a/wear/wear-watchface/samples/src/main/res/drawable-hdpi/green_style.png b/wear/watchface/watchface/samples/src/main/res/drawable-hdpi/green_style.png
similarity index 100%
rename from wear/wear-watchface/samples/src/main/res/drawable-hdpi/green_style.png
rename to wear/watchface/watchface/samples/src/main/res/drawable-hdpi/green_style.png
Binary files differ
diff --git a/wear/wear-watchface/samples/src/main/res/drawable-hdpi/red_style.png b/wear/watchface/watchface/samples/src/main/res/drawable-hdpi/red_style.png
similarity index 100%
rename from wear/wear-watchface/samples/src/main/res/drawable-hdpi/red_style.png
rename to wear/watchface/watchface/samples/src/main/res/drawable-hdpi/red_style.png
Binary files differ
diff --git a/wear/wear-watchface/samples/src/main/res/drawable-mdpi/blue_style.png b/wear/watchface/watchface/samples/src/main/res/drawable-mdpi/blue_style.png
similarity index 100%
rename from wear/wear-watchface/samples/src/main/res/drawable-mdpi/blue_style.png
rename to wear/watchface/watchface/samples/src/main/res/drawable-mdpi/blue_style.png
Binary files differ
diff --git a/wear/wear-watchface/samples/src/main/res/drawable-mdpi/green_style.png b/wear/watchface/watchface/samples/src/main/res/drawable-mdpi/green_style.png
similarity index 100%
rename from wear/wear-watchface/samples/src/main/res/drawable-mdpi/green_style.png
rename to wear/watchface/watchface/samples/src/main/res/drawable-mdpi/green_style.png
Binary files differ
diff --git a/wear/wear-watchface/samples/src/main/res/drawable-mdpi/red_style.png b/wear/watchface/watchface/samples/src/main/res/drawable-mdpi/red_style.png
similarity index 100%
rename from wear/wear-watchface/samples/src/main/res/drawable-mdpi/red_style.png
rename to wear/watchface/watchface/samples/src/main/res/drawable-mdpi/red_style.png
Binary files differ
diff --git a/wear/wear-watchface/samples/src/main/res/drawable-nodpi/analog_preview.png b/wear/watchface/watchface/samples/src/main/res/drawable-nodpi/analog_preview.png
similarity index 100%
rename from wear/wear-watchface/samples/src/main/res/drawable-nodpi/analog_preview.png
rename to wear/watchface/watchface/samples/src/main/res/drawable-nodpi/analog_preview.png
Binary files differ
diff --git a/wear/wear-watchface/samples/src/main/res/drawable-nodpi/digital_preview.png b/wear/watchface/watchface/samples/src/main/res/drawable-nodpi/digital_preview.png
similarity index 100%
rename from wear/wear-watchface/samples/src/main/res/drawable-nodpi/digital_preview.png
rename to wear/watchface/watchface/samples/src/main/res/drawable-nodpi/digital_preview.png
Binary files differ
diff --git a/wear/wear-watchface/samples/src/main/res/drawable-nodpi/gl_background_preview.png b/wear/watchface/watchface/samples/src/main/res/drawable-nodpi/gl_background_preview.png
similarity index 100%
rename from wear/wear-watchface/samples/src/main/res/drawable-nodpi/gl_background_preview.png
rename to wear/watchface/watchface/samples/src/main/res/drawable-nodpi/gl_background_preview.png
Binary files differ
diff --git a/wear/wear-watchface/samples/src/main/res/drawable-nodpi/gl_preview.png b/wear/watchface/watchface/samples/src/main/res/drawable-nodpi/gl_preview.png
similarity index 100%
rename from wear/wear-watchface/samples/src/main/res/drawable-nodpi/gl_preview.png
rename to wear/watchface/watchface/samples/src/main/res/drawable-nodpi/gl_preview.png
Binary files differ
diff --git a/wear/wear-watchface/samples/src/main/res/drawable-xhdpi/blue_style.png b/wear/watchface/watchface/samples/src/main/res/drawable-xhdpi/blue_style.png
similarity index 100%
rename from wear/wear-watchface/samples/src/main/res/drawable-xhdpi/blue_style.png
rename to wear/watchface/watchface/samples/src/main/res/drawable-xhdpi/blue_style.png
Binary files differ
diff --git a/wear/wear-watchface/samples/src/main/res/drawable-xhdpi/green_style.png b/wear/watchface/watchface/samples/src/main/res/drawable-xhdpi/green_style.png
similarity index 100%
rename from wear/wear-watchface/samples/src/main/res/drawable-xhdpi/green_style.png
rename to wear/watchface/watchface/samples/src/main/res/drawable-xhdpi/green_style.png
Binary files differ
diff --git a/wear/wear-watchface/samples/src/main/res/drawable-xhdpi/red_style.png b/wear/watchface/watchface/samples/src/main/res/drawable-xhdpi/red_style.png
similarity index 100%
rename from wear/wear-watchface/samples/src/main/res/drawable-xhdpi/red_style.png
rename to wear/watchface/watchface/samples/src/main/res/drawable-xhdpi/red_style.png
Binary files differ
diff --git a/wear/wear-watchface/samples/src/main/res/drawable/complication_blue_style.xml b/wear/watchface/watchface/samples/src/main/res/drawable/complication_blue_style.xml
similarity index 100%
rename from wear/wear-watchface/samples/src/main/res/drawable/complication_blue_style.xml
rename to wear/watchface/watchface/samples/src/main/res/drawable/complication_blue_style.xml
diff --git a/wear/wear-watchface/samples/src/main/res/drawable/complication_green_style.xml b/wear/watchface/watchface/samples/src/main/res/drawable/complication_green_style.xml
similarity index 100%
rename from wear/wear-watchface/samples/src/main/res/drawable/complication_green_style.xml
rename to wear/watchface/watchface/samples/src/main/res/drawable/complication_green_style.xml
diff --git a/wear/wear-watchface/samples/src/main/res/drawable/complication_red_style.xml b/wear/watchface/watchface/samples/src/main/res/drawable/complication_red_style.xml
similarity index 100%
rename from wear/wear-watchface/samples/src/main/res/drawable/complication_red_style.xml
rename to wear/watchface/watchface/samples/src/main/res/drawable/complication_red_style.xml
diff --git a/wear/wear-watchface/samples/src/main/res/drawable/complication_white_style.xml b/wear/watchface/watchface/samples/src/main/res/drawable/complication_white_style.xml
similarity index 100%
rename from wear/wear-watchface/samples/src/main/res/drawable/complication_white_style.xml
rename to wear/watchface/watchface/samples/src/main/res/drawable/complication_white_style.xml
diff --git a/wear/wear-watchface/samples/src/main/res/drawable/hand.png b/wear/watchface/watchface/samples/src/main/res/drawable/hand.png
similarity index 100%
rename from wear/wear-watchface/samples/src/main/res/drawable/hand.png
rename to wear/watchface/watchface/samples/src/main/res/drawable/hand.png
Binary files differ
diff --git a/wear/wear-watchface/samples/src/main/res/drawable/wf_background.png b/wear/watchface/watchface/samples/src/main/res/drawable/wf_background.png
similarity index 100%
rename from wear/wear-watchface/samples/src/main/res/drawable/wf_background.png
rename to wear/watchface/watchface/samples/src/main/res/drawable/wf_background.png
Binary files differ
diff --git a/wear/wear-watchface/samples/src/main/res/values-af/strings.xml b/wear/watchface/watchface/samples/src/main/res/values-af/strings.xml
similarity index 100%
rename from wear/wear-watchface/samples/src/main/res/values-af/strings.xml
rename to wear/watchface/watchface/samples/src/main/res/values-af/strings.xml
diff --git a/wear/wear-watchface/samples/src/main/res/values-am/strings.xml b/wear/watchface/watchface/samples/src/main/res/values-am/strings.xml
similarity index 100%
rename from wear/wear-watchface/samples/src/main/res/values-am/strings.xml
rename to wear/watchface/watchface/samples/src/main/res/values-am/strings.xml
diff --git a/wear/wear-watchface/samples/src/main/res/values-ar/strings.xml b/wear/watchface/watchface/samples/src/main/res/values-ar/strings.xml
similarity index 100%
rename from wear/wear-watchface/samples/src/main/res/values-ar/strings.xml
rename to wear/watchface/watchface/samples/src/main/res/values-ar/strings.xml
diff --git a/wear/wear-watchface/samples/src/main/res/values-as/strings.xml b/wear/watchface/watchface/samples/src/main/res/values-as/strings.xml
similarity index 100%
rename from wear/wear-watchface/samples/src/main/res/values-as/strings.xml
rename to wear/watchface/watchface/samples/src/main/res/values-as/strings.xml
diff --git a/wear/wear-watchface/samples/src/main/res/values-az/strings.xml b/wear/watchface/watchface/samples/src/main/res/values-az/strings.xml
similarity index 100%
rename from wear/wear-watchface/samples/src/main/res/values-az/strings.xml
rename to wear/watchface/watchface/samples/src/main/res/values-az/strings.xml
diff --git a/wear/wear-watchface/samples/src/main/res/values-b+sr+Latn/strings.xml b/wear/watchface/watchface/samples/src/main/res/values-b+sr+Latn/strings.xml
similarity index 100%
rename from wear/wear-watchface/samples/src/main/res/values-b+sr+Latn/strings.xml
rename to wear/watchface/watchface/samples/src/main/res/values-b+sr+Latn/strings.xml
diff --git a/wear/wear-watchface/samples/src/main/res/values-be/strings.xml b/wear/watchface/watchface/samples/src/main/res/values-be/strings.xml
similarity index 100%
rename from wear/wear-watchface/samples/src/main/res/values-be/strings.xml
rename to wear/watchface/watchface/samples/src/main/res/values-be/strings.xml
diff --git a/wear/wear-watchface/samples/src/main/res/values-bg/strings.xml b/wear/watchface/watchface/samples/src/main/res/values-bg/strings.xml
similarity index 100%
rename from wear/wear-watchface/samples/src/main/res/values-bg/strings.xml
rename to wear/watchface/watchface/samples/src/main/res/values-bg/strings.xml
diff --git a/wear/wear-watchface/samples/src/main/res/values-bn/strings.xml b/wear/watchface/watchface/samples/src/main/res/values-bn/strings.xml
similarity index 100%
rename from wear/wear-watchface/samples/src/main/res/values-bn/strings.xml
rename to wear/watchface/watchface/samples/src/main/res/values-bn/strings.xml
diff --git a/wear/wear-watchface/samples/src/main/res/values-bs/strings.xml b/wear/watchface/watchface/samples/src/main/res/values-bs/strings.xml
similarity index 100%
rename from wear/wear-watchface/samples/src/main/res/values-bs/strings.xml
rename to wear/watchface/watchface/samples/src/main/res/values-bs/strings.xml
diff --git a/wear/wear-watchface/samples/src/main/res/values-ca/strings.xml b/wear/watchface/watchface/samples/src/main/res/values-ca/strings.xml
similarity index 100%
rename from wear/wear-watchface/samples/src/main/res/values-ca/strings.xml
rename to wear/watchface/watchface/samples/src/main/res/values-ca/strings.xml
diff --git a/wear/wear-watchface/samples/src/main/res/values-cs/strings.xml b/wear/watchface/watchface/samples/src/main/res/values-cs/strings.xml
similarity index 100%
rename from wear/wear-watchface/samples/src/main/res/values-cs/strings.xml
rename to wear/watchface/watchface/samples/src/main/res/values-cs/strings.xml
diff --git a/wear/wear-watchface/samples/src/main/res/values-da/strings.xml b/wear/watchface/watchface/samples/src/main/res/values-da/strings.xml
similarity index 100%
rename from wear/wear-watchface/samples/src/main/res/values-da/strings.xml
rename to wear/watchface/watchface/samples/src/main/res/values-da/strings.xml
diff --git a/wear/wear-watchface/samples/src/main/res/values-de/strings.xml b/wear/watchface/watchface/samples/src/main/res/values-de/strings.xml
similarity index 100%
rename from wear/wear-watchface/samples/src/main/res/values-de/strings.xml
rename to wear/watchface/watchface/samples/src/main/res/values-de/strings.xml
diff --git a/wear/wear-watchface/samples/src/main/res/values-el/strings.xml b/wear/watchface/watchface/samples/src/main/res/values-el/strings.xml
similarity index 100%
rename from wear/wear-watchface/samples/src/main/res/values-el/strings.xml
rename to wear/watchface/watchface/samples/src/main/res/values-el/strings.xml
diff --git a/wear/wear-watchface/samples/src/main/res/values-en-rAU/strings.xml b/wear/watchface/watchface/samples/src/main/res/values-en-rAU/strings.xml
similarity index 100%
rename from wear/wear-watchface/samples/src/main/res/values-en-rAU/strings.xml
rename to wear/watchface/watchface/samples/src/main/res/values-en-rAU/strings.xml
diff --git a/wear/wear-watchface/samples/src/main/res/values-en-rCA/strings.xml b/wear/watchface/watchface/samples/src/main/res/values-en-rCA/strings.xml
similarity index 100%
rename from wear/wear-watchface/samples/src/main/res/values-en-rCA/strings.xml
rename to wear/watchface/watchface/samples/src/main/res/values-en-rCA/strings.xml
diff --git a/wear/wear-watchface/samples/src/main/res/values-en-rGB/strings.xml b/wear/watchface/watchface/samples/src/main/res/values-en-rGB/strings.xml
similarity index 100%
rename from wear/wear-watchface/samples/src/main/res/values-en-rGB/strings.xml
rename to wear/watchface/watchface/samples/src/main/res/values-en-rGB/strings.xml
diff --git a/wear/wear-watchface/samples/src/main/res/values-en-rIN/strings.xml b/wear/watchface/watchface/samples/src/main/res/values-en-rIN/strings.xml
similarity index 100%
rename from wear/wear-watchface/samples/src/main/res/values-en-rIN/strings.xml
rename to wear/watchface/watchface/samples/src/main/res/values-en-rIN/strings.xml
diff --git a/wear/wear-watchface/samples/src/main/res/values-en-rXC/strings.xml b/wear/watchface/watchface/samples/src/main/res/values-en-rXC/strings.xml
similarity index 100%
rename from wear/wear-watchface/samples/src/main/res/values-en-rXC/strings.xml
rename to wear/watchface/watchface/samples/src/main/res/values-en-rXC/strings.xml
diff --git a/wear/wear-watchface/samples/src/main/res/values-es-rUS/strings.xml b/wear/watchface/watchface/samples/src/main/res/values-es-rUS/strings.xml
similarity index 100%
rename from wear/wear-watchface/samples/src/main/res/values-es-rUS/strings.xml
rename to wear/watchface/watchface/samples/src/main/res/values-es-rUS/strings.xml
diff --git a/wear/wear-watchface/samples/src/main/res/values-es/strings.xml b/wear/watchface/watchface/samples/src/main/res/values-es/strings.xml
similarity index 100%
rename from wear/wear-watchface/samples/src/main/res/values-es/strings.xml
rename to wear/watchface/watchface/samples/src/main/res/values-es/strings.xml
diff --git a/wear/wear-watchface/samples/src/main/res/values-et/strings.xml b/wear/watchface/watchface/samples/src/main/res/values-et/strings.xml
similarity index 100%
rename from wear/wear-watchface/samples/src/main/res/values-et/strings.xml
rename to wear/watchface/watchface/samples/src/main/res/values-et/strings.xml
diff --git a/wear/wear-watchface/samples/src/main/res/values-eu/strings.xml b/wear/watchface/watchface/samples/src/main/res/values-eu/strings.xml
similarity index 100%
rename from wear/wear-watchface/samples/src/main/res/values-eu/strings.xml
rename to wear/watchface/watchface/samples/src/main/res/values-eu/strings.xml
diff --git a/wear/wear-watchface/samples/src/main/res/values-fa/strings.xml b/wear/watchface/watchface/samples/src/main/res/values-fa/strings.xml
similarity index 100%
rename from wear/wear-watchface/samples/src/main/res/values-fa/strings.xml
rename to wear/watchface/watchface/samples/src/main/res/values-fa/strings.xml
diff --git a/wear/wear-watchface/samples/src/main/res/values-fi/strings.xml b/wear/watchface/watchface/samples/src/main/res/values-fi/strings.xml
similarity index 100%
rename from wear/wear-watchface/samples/src/main/res/values-fi/strings.xml
rename to wear/watchface/watchface/samples/src/main/res/values-fi/strings.xml
diff --git a/wear/wear-watchface/samples/src/main/res/values-fr-rCA/strings.xml b/wear/watchface/watchface/samples/src/main/res/values-fr-rCA/strings.xml
similarity index 100%
rename from wear/wear-watchface/samples/src/main/res/values-fr-rCA/strings.xml
rename to wear/watchface/watchface/samples/src/main/res/values-fr-rCA/strings.xml
diff --git a/wear/wear-watchface/samples/src/main/res/values-fr/strings.xml b/wear/watchface/watchface/samples/src/main/res/values-fr/strings.xml
similarity index 100%
rename from wear/wear-watchface/samples/src/main/res/values-fr/strings.xml
rename to wear/watchface/watchface/samples/src/main/res/values-fr/strings.xml
diff --git a/wear/wear-watchface/samples/src/main/res/values-gl/strings.xml b/wear/watchface/watchface/samples/src/main/res/values-gl/strings.xml
similarity index 100%
rename from wear/wear-watchface/samples/src/main/res/values-gl/strings.xml
rename to wear/watchface/watchface/samples/src/main/res/values-gl/strings.xml
diff --git a/wear/wear-watchface/samples/src/main/res/values-gu/strings.xml b/wear/watchface/watchface/samples/src/main/res/values-gu/strings.xml
similarity index 100%
rename from wear/wear-watchface/samples/src/main/res/values-gu/strings.xml
rename to wear/watchface/watchface/samples/src/main/res/values-gu/strings.xml
diff --git a/wear/wear-watchface/samples/src/main/res/values-hi/strings.xml b/wear/watchface/watchface/samples/src/main/res/values-hi/strings.xml
similarity index 100%
rename from wear/wear-watchface/samples/src/main/res/values-hi/strings.xml
rename to wear/watchface/watchface/samples/src/main/res/values-hi/strings.xml
diff --git a/wear/wear-watchface/samples/src/main/res/values-hr/strings.xml b/wear/watchface/watchface/samples/src/main/res/values-hr/strings.xml
similarity index 100%
rename from wear/wear-watchface/samples/src/main/res/values-hr/strings.xml
rename to wear/watchface/watchface/samples/src/main/res/values-hr/strings.xml
diff --git a/wear/wear-watchface/samples/src/main/res/values-hu/strings.xml b/wear/watchface/watchface/samples/src/main/res/values-hu/strings.xml
similarity index 100%
rename from wear/wear-watchface/samples/src/main/res/values-hu/strings.xml
rename to wear/watchface/watchface/samples/src/main/res/values-hu/strings.xml
diff --git a/wear/wear-watchface/samples/src/main/res/values-hy/strings.xml b/wear/watchface/watchface/samples/src/main/res/values-hy/strings.xml
similarity index 100%
rename from wear/wear-watchface/samples/src/main/res/values-hy/strings.xml
rename to wear/watchface/watchface/samples/src/main/res/values-hy/strings.xml
diff --git a/wear/wear-watchface/samples/src/main/res/values-in/strings.xml b/wear/watchface/watchface/samples/src/main/res/values-in/strings.xml
similarity index 100%
rename from wear/wear-watchface/samples/src/main/res/values-in/strings.xml
rename to wear/watchface/watchface/samples/src/main/res/values-in/strings.xml
diff --git a/wear/wear-watchface/samples/src/main/res/values-is/strings.xml b/wear/watchface/watchface/samples/src/main/res/values-is/strings.xml
similarity index 100%
rename from wear/wear-watchface/samples/src/main/res/values-is/strings.xml
rename to wear/watchface/watchface/samples/src/main/res/values-is/strings.xml
diff --git a/wear/wear-watchface/samples/src/main/res/values-it/strings.xml b/wear/watchface/watchface/samples/src/main/res/values-it/strings.xml
similarity index 100%
rename from wear/wear-watchface/samples/src/main/res/values-it/strings.xml
rename to wear/watchface/watchface/samples/src/main/res/values-it/strings.xml
diff --git a/wear/wear-watchface/samples/src/main/res/values-iw/strings.xml b/wear/watchface/watchface/samples/src/main/res/values-iw/strings.xml
similarity index 100%
rename from wear/wear-watchface/samples/src/main/res/values-iw/strings.xml
rename to wear/watchface/watchface/samples/src/main/res/values-iw/strings.xml
diff --git a/wear/wear-watchface/samples/src/main/res/values-ja/strings.xml b/wear/watchface/watchface/samples/src/main/res/values-ja/strings.xml
similarity index 100%
rename from wear/wear-watchface/samples/src/main/res/values-ja/strings.xml
rename to wear/watchface/watchface/samples/src/main/res/values-ja/strings.xml
diff --git a/wear/wear-watchface/samples/src/main/res/values-ka/strings.xml b/wear/watchface/watchface/samples/src/main/res/values-ka/strings.xml
similarity index 100%
rename from wear/wear-watchface/samples/src/main/res/values-ka/strings.xml
rename to wear/watchface/watchface/samples/src/main/res/values-ka/strings.xml
diff --git a/wear/wear-watchface/samples/src/main/res/values-kk/strings.xml b/wear/watchface/watchface/samples/src/main/res/values-kk/strings.xml
similarity index 100%
rename from wear/wear-watchface/samples/src/main/res/values-kk/strings.xml
rename to wear/watchface/watchface/samples/src/main/res/values-kk/strings.xml
diff --git a/wear/wear-watchface/samples/src/main/res/values-km/strings.xml b/wear/watchface/watchface/samples/src/main/res/values-km/strings.xml
similarity index 100%
rename from wear/wear-watchface/samples/src/main/res/values-km/strings.xml
rename to wear/watchface/watchface/samples/src/main/res/values-km/strings.xml
diff --git a/wear/wear-watchface/samples/src/main/res/values-kn/strings.xml b/wear/watchface/watchface/samples/src/main/res/values-kn/strings.xml
similarity index 100%
rename from wear/wear-watchface/samples/src/main/res/values-kn/strings.xml
rename to wear/watchface/watchface/samples/src/main/res/values-kn/strings.xml
diff --git a/wear/wear-watchface/samples/src/main/res/values-ko/strings.xml b/wear/watchface/watchface/samples/src/main/res/values-ko/strings.xml
similarity index 100%
rename from wear/wear-watchface/samples/src/main/res/values-ko/strings.xml
rename to wear/watchface/watchface/samples/src/main/res/values-ko/strings.xml
diff --git a/wear/wear-watchface/samples/src/main/res/values-ky/strings.xml b/wear/watchface/watchface/samples/src/main/res/values-ky/strings.xml
similarity index 100%
rename from wear/wear-watchface/samples/src/main/res/values-ky/strings.xml
rename to wear/watchface/watchface/samples/src/main/res/values-ky/strings.xml
diff --git a/wear/wear-watchface/samples/src/main/res/values-lo/strings.xml b/wear/watchface/watchface/samples/src/main/res/values-lo/strings.xml
similarity index 100%
rename from wear/wear-watchface/samples/src/main/res/values-lo/strings.xml
rename to wear/watchface/watchface/samples/src/main/res/values-lo/strings.xml
diff --git a/wear/wear-watchface/samples/src/main/res/values-lt/strings.xml b/wear/watchface/watchface/samples/src/main/res/values-lt/strings.xml
similarity index 100%
rename from wear/wear-watchface/samples/src/main/res/values-lt/strings.xml
rename to wear/watchface/watchface/samples/src/main/res/values-lt/strings.xml
diff --git a/wear/wear-watchface/samples/src/main/res/values-lv/strings.xml b/wear/watchface/watchface/samples/src/main/res/values-lv/strings.xml
similarity index 100%
rename from wear/wear-watchface/samples/src/main/res/values-lv/strings.xml
rename to wear/watchface/watchface/samples/src/main/res/values-lv/strings.xml
diff --git a/wear/wear-watchface/samples/src/main/res/values-mk/strings.xml b/wear/watchface/watchface/samples/src/main/res/values-mk/strings.xml
similarity index 100%
rename from wear/wear-watchface/samples/src/main/res/values-mk/strings.xml
rename to wear/watchface/watchface/samples/src/main/res/values-mk/strings.xml
diff --git a/wear/wear-watchface/samples/src/main/res/values-ml/strings.xml b/wear/watchface/watchface/samples/src/main/res/values-ml/strings.xml
similarity index 100%
rename from wear/wear-watchface/samples/src/main/res/values-ml/strings.xml
rename to wear/watchface/watchface/samples/src/main/res/values-ml/strings.xml
diff --git a/wear/wear-watchface/samples/src/main/res/values-mn/strings.xml b/wear/watchface/watchface/samples/src/main/res/values-mn/strings.xml
similarity index 100%
rename from wear/wear-watchface/samples/src/main/res/values-mn/strings.xml
rename to wear/watchface/watchface/samples/src/main/res/values-mn/strings.xml
diff --git a/wear/wear-watchface/samples/src/main/res/values-mr/strings.xml b/wear/watchface/watchface/samples/src/main/res/values-mr/strings.xml
similarity index 100%
rename from wear/wear-watchface/samples/src/main/res/values-mr/strings.xml
rename to wear/watchface/watchface/samples/src/main/res/values-mr/strings.xml
diff --git a/wear/wear-watchface/samples/src/main/res/values-ms/strings.xml b/wear/watchface/watchface/samples/src/main/res/values-ms/strings.xml
similarity index 100%
rename from wear/wear-watchface/samples/src/main/res/values-ms/strings.xml
rename to wear/watchface/watchface/samples/src/main/res/values-ms/strings.xml
diff --git a/wear/wear-watchface/samples/src/main/res/values-my/strings.xml b/wear/watchface/watchface/samples/src/main/res/values-my/strings.xml
similarity index 100%
rename from wear/wear-watchface/samples/src/main/res/values-my/strings.xml
rename to wear/watchface/watchface/samples/src/main/res/values-my/strings.xml
diff --git a/wear/wear-watchface/samples/src/main/res/values-nb/strings.xml b/wear/watchface/watchface/samples/src/main/res/values-nb/strings.xml
similarity index 100%
rename from wear/wear-watchface/samples/src/main/res/values-nb/strings.xml
rename to wear/watchface/watchface/samples/src/main/res/values-nb/strings.xml
diff --git a/wear/wear-watchface/samples/src/main/res/values-ne/strings.xml b/wear/watchface/watchface/samples/src/main/res/values-ne/strings.xml
similarity index 100%
rename from wear/wear-watchface/samples/src/main/res/values-ne/strings.xml
rename to wear/watchface/watchface/samples/src/main/res/values-ne/strings.xml
diff --git a/wear/wear-watchface/samples/src/main/res/values-nl/strings.xml b/wear/watchface/watchface/samples/src/main/res/values-nl/strings.xml
similarity index 100%
rename from wear/wear-watchface/samples/src/main/res/values-nl/strings.xml
rename to wear/watchface/watchface/samples/src/main/res/values-nl/strings.xml
diff --git a/wear/wear-watchface/samples/src/main/res/values-or/strings.xml b/wear/watchface/watchface/samples/src/main/res/values-or/strings.xml
similarity index 100%
rename from wear/wear-watchface/samples/src/main/res/values-or/strings.xml
rename to wear/watchface/watchface/samples/src/main/res/values-or/strings.xml
diff --git a/wear/wear-watchface/samples/src/main/res/values-pa/strings.xml b/wear/watchface/watchface/samples/src/main/res/values-pa/strings.xml
similarity index 100%
rename from wear/wear-watchface/samples/src/main/res/values-pa/strings.xml
rename to wear/watchface/watchface/samples/src/main/res/values-pa/strings.xml
diff --git a/wear/wear-watchface/samples/src/main/res/values-pl/strings.xml b/wear/watchface/watchface/samples/src/main/res/values-pl/strings.xml
similarity index 100%
rename from wear/wear-watchface/samples/src/main/res/values-pl/strings.xml
rename to wear/watchface/watchface/samples/src/main/res/values-pl/strings.xml
diff --git a/wear/wear-watchface/samples/src/main/res/values-pt-rBR/strings.xml b/wear/watchface/watchface/samples/src/main/res/values-pt-rBR/strings.xml
similarity index 100%
rename from wear/wear-watchface/samples/src/main/res/values-pt-rBR/strings.xml
rename to wear/watchface/watchface/samples/src/main/res/values-pt-rBR/strings.xml
diff --git a/wear/wear-watchface/samples/src/main/res/values-pt-rPT/strings.xml b/wear/watchface/watchface/samples/src/main/res/values-pt-rPT/strings.xml
similarity index 100%
rename from wear/wear-watchface/samples/src/main/res/values-pt-rPT/strings.xml
rename to wear/watchface/watchface/samples/src/main/res/values-pt-rPT/strings.xml
diff --git a/wear/wear-watchface/samples/src/main/res/values-pt/strings.xml b/wear/watchface/watchface/samples/src/main/res/values-pt/strings.xml
similarity index 100%
rename from wear/wear-watchface/samples/src/main/res/values-pt/strings.xml
rename to wear/watchface/watchface/samples/src/main/res/values-pt/strings.xml
diff --git a/wear/wear-watchface/samples/src/main/res/values-ro/strings.xml b/wear/watchface/watchface/samples/src/main/res/values-ro/strings.xml
similarity index 100%
rename from wear/wear-watchface/samples/src/main/res/values-ro/strings.xml
rename to wear/watchface/watchface/samples/src/main/res/values-ro/strings.xml
diff --git a/wear/wear-watchface/samples/src/main/res/values-ru/strings.xml b/wear/watchface/watchface/samples/src/main/res/values-ru/strings.xml
similarity index 100%
rename from wear/wear-watchface/samples/src/main/res/values-ru/strings.xml
rename to wear/watchface/watchface/samples/src/main/res/values-ru/strings.xml
diff --git a/wear/wear-watchface/samples/src/main/res/values-si/strings.xml b/wear/watchface/watchface/samples/src/main/res/values-si/strings.xml
similarity index 100%
rename from wear/wear-watchface/samples/src/main/res/values-si/strings.xml
rename to wear/watchface/watchface/samples/src/main/res/values-si/strings.xml
diff --git a/wear/wear-watchface/samples/src/main/res/values-sk/strings.xml b/wear/watchface/watchface/samples/src/main/res/values-sk/strings.xml
similarity index 100%
rename from wear/wear-watchface/samples/src/main/res/values-sk/strings.xml
rename to wear/watchface/watchface/samples/src/main/res/values-sk/strings.xml
diff --git a/wear/wear-watchface/samples/src/main/res/values-sl/strings.xml b/wear/watchface/watchface/samples/src/main/res/values-sl/strings.xml
similarity index 100%
rename from wear/wear-watchface/samples/src/main/res/values-sl/strings.xml
rename to wear/watchface/watchface/samples/src/main/res/values-sl/strings.xml
diff --git a/wear/wear-watchface/samples/src/main/res/values-sq/strings.xml b/wear/watchface/watchface/samples/src/main/res/values-sq/strings.xml
similarity index 100%
rename from wear/wear-watchface/samples/src/main/res/values-sq/strings.xml
rename to wear/watchface/watchface/samples/src/main/res/values-sq/strings.xml
diff --git a/wear/wear-watchface/samples/src/main/res/values-sr/strings.xml b/wear/watchface/watchface/samples/src/main/res/values-sr/strings.xml
similarity index 100%
rename from wear/wear-watchface/samples/src/main/res/values-sr/strings.xml
rename to wear/watchface/watchface/samples/src/main/res/values-sr/strings.xml
diff --git a/wear/wear-watchface/samples/src/main/res/values-sv/strings.xml b/wear/watchface/watchface/samples/src/main/res/values-sv/strings.xml
similarity index 100%
rename from wear/wear-watchface/samples/src/main/res/values-sv/strings.xml
rename to wear/watchface/watchface/samples/src/main/res/values-sv/strings.xml
diff --git a/wear/wear-watchface/samples/src/main/res/values-sw/strings.xml b/wear/watchface/watchface/samples/src/main/res/values-sw/strings.xml
similarity index 100%
rename from wear/wear-watchface/samples/src/main/res/values-sw/strings.xml
rename to wear/watchface/watchface/samples/src/main/res/values-sw/strings.xml
diff --git a/wear/wear-watchface/samples/src/main/res/values-ta/strings.xml b/wear/watchface/watchface/samples/src/main/res/values-ta/strings.xml
similarity index 100%
rename from wear/wear-watchface/samples/src/main/res/values-ta/strings.xml
rename to wear/watchface/watchface/samples/src/main/res/values-ta/strings.xml
diff --git a/wear/wear-watchface/samples/src/main/res/values-te/strings.xml b/wear/watchface/watchface/samples/src/main/res/values-te/strings.xml
similarity index 100%
rename from wear/wear-watchface/samples/src/main/res/values-te/strings.xml
rename to wear/watchface/watchface/samples/src/main/res/values-te/strings.xml
diff --git a/wear/wear-watchface/samples/src/main/res/values-th/strings.xml b/wear/watchface/watchface/samples/src/main/res/values-th/strings.xml
similarity index 100%
rename from wear/wear-watchface/samples/src/main/res/values-th/strings.xml
rename to wear/watchface/watchface/samples/src/main/res/values-th/strings.xml
diff --git a/wear/wear-watchface/samples/src/main/res/values-tl/strings.xml b/wear/watchface/watchface/samples/src/main/res/values-tl/strings.xml
similarity index 100%
rename from wear/wear-watchface/samples/src/main/res/values-tl/strings.xml
rename to wear/watchface/watchface/samples/src/main/res/values-tl/strings.xml
diff --git a/wear/wear-watchface/samples/src/main/res/values-tr/strings.xml b/wear/watchface/watchface/samples/src/main/res/values-tr/strings.xml
similarity index 100%
rename from wear/wear-watchface/samples/src/main/res/values-tr/strings.xml
rename to wear/watchface/watchface/samples/src/main/res/values-tr/strings.xml
diff --git a/wear/wear-watchface/samples/src/main/res/values-uk/strings.xml b/wear/watchface/watchface/samples/src/main/res/values-uk/strings.xml
similarity index 100%
rename from wear/wear-watchface/samples/src/main/res/values-uk/strings.xml
rename to wear/watchface/watchface/samples/src/main/res/values-uk/strings.xml
diff --git a/wear/wear-watchface/samples/src/main/res/values-ur/strings.xml b/wear/watchface/watchface/samples/src/main/res/values-ur/strings.xml
similarity index 100%
rename from wear/wear-watchface/samples/src/main/res/values-ur/strings.xml
rename to wear/watchface/watchface/samples/src/main/res/values-ur/strings.xml
diff --git a/wear/wear-watchface/samples/src/main/res/values-uz/strings.xml b/wear/watchface/watchface/samples/src/main/res/values-uz/strings.xml
similarity index 100%
rename from wear/wear-watchface/samples/src/main/res/values-uz/strings.xml
rename to wear/watchface/watchface/samples/src/main/res/values-uz/strings.xml
diff --git a/wear/wear-watchface/samples/src/main/res/values-vi/strings.xml b/wear/watchface/watchface/samples/src/main/res/values-vi/strings.xml
similarity index 100%
rename from wear/wear-watchface/samples/src/main/res/values-vi/strings.xml
rename to wear/watchface/watchface/samples/src/main/res/values-vi/strings.xml
diff --git a/wear/wear-watchface/samples/src/main/res/values-zh-rCN/strings.xml b/wear/watchface/watchface/samples/src/main/res/values-zh-rCN/strings.xml
similarity index 100%
rename from wear/wear-watchface/samples/src/main/res/values-zh-rCN/strings.xml
rename to wear/watchface/watchface/samples/src/main/res/values-zh-rCN/strings.xml
diff --git a/wear/wear-watchface/samples/src/main/res/values-zh-rHK/strings.xml b/wear/watchface/watchface/samples/src/main/res/values-zh-rHK/strings.xml
similarity index 100%
rename from wear/wear-watchface/samples/src/main/res/values-zh-rHK/strings.xml
rename to wear/watchface/watchface/samples/src/main/res/values-zh-rHK/strings.xml
diff --git a/wear/wear-watchface/samples/src/main/res/values-zh-rTW/strings.xml b/wear/watchface/watchface/samples/src/main/res/values-zh-rTW/strings.xml
similarity index 100%
rename from wear/wear-watchface/samples/src/main/res/values-zh-rTW/strings.xml
rename to wear/watchface/watchface/samples/src/main/res/values-zh-rTW/strings.xml
diff --git a/wear/wear-watchface/samples/src/main/res/values-zu/strings.xml b/wear/watchface/watchface/samples/src/main/res/values-zu/strings.xml
similarity index 100%
rename from wear/wear-watchface/samples/src/main/res/values-zu/strings.xml
rename to wear/watchface/watchface/samples/src/main/res/values-zu/strings.xml
diff --git a/wear/wear-watchface/samples/src/main/res/values/colors.xml b/wear/watchface/watchface/samples/src/main/res/values/colors.xml
similarity index 100%
rename from wear/wear-watchface/samples/src/main/res/values/colors.xml
rename to wear/watchface/watchface/samples/src/main/res/values/colors.xml
diff --git a/wear/wear-watchface/samples/src/main/res/values/dimens.xml b/wear/watchface/watchface/samples/src/main/res/values/dimens.xml
similarity index 100%
rename from wear/wear-watchface/samples/src/main/res/values/dimens.xml
rename to wear/watchface/watchface/samples/src/main/res/values/dimens.xml
diff --git a/wear/wear-watchface/samples/src/main/res/values/strings.xml b/wear/watchface/watchface/samples/src/main/res/values/strings.xml
similarity index 100%
rename from wear/wear-watchface/samples/src/main/res/values/strings.xml
rename to wear/watchface/watchface/samples/src/main/res/values/strings.xml
diff --git a/wear/wear-watchface/samples/src/main/res/values/test_watchface_styles.xml b/wear/watchface/watchface/samples/src/main/res/values/test_watchface_styles.xml
similarity index 100%
rename from wear/wear-watchface/samples/src/main/res/values/test_watchface_styles.xml
rename to wear/watchface/watchface/samples/src/main/res/values/test_watchface_styles.xml
diff --git a/wear/wear-watchface/samples/src/main/res/xml/watch_face.xml b/wear/watchface/watchface/samples/src/main/res/xml/watch_face.xml
similarity index 100%
rename from wear/wear-watchface/samples/src/main/res/xml/watch_face.xml
rename to wear/watchface/watchface/samples/src/main/res/xml/watch_face.xml
diff --git a/wear/wear-watchface/src/androidTest/AndroidManifest.xml b/wear/watchface/watchface/src/androidTest/AndroidManifest.xml
similarity index 100%
rename from wear/wear-watchface/src/androidTest/AndroidManifest.xml
rename to wear/watchface/watchface/src/androidTest/AndroidManifest.xml
diff --git a/wear/wear-watchface/src/androidTest/java/androidx/wear/watchface/ComplicationHelperActivityTest.kt b/wear/watchface/watchface/src/androidTest/java/androidx/wear/watchface/ComplicationHelperActivityTest.kt
similarity index 93%
rename from wear/wear-watchface/src/androidTest/java/androidx/wear/watchface/ComplicationHelperActivityTest.kt
rename to wear/watchface/watchface/src/androidTest/java/androidx/wear/watchface/ComplicationHelperActivityTest.kt
index f69783b..54625da 100644
--- a/wear/wear-watchface/src/androidTest/java/androidx/wear/watchface/ComplicationHelperActivityTest.kt
+++ b/wear/watchface/watchface/src/androidTest/java/androidx/wear/watchface/ComplicationHelperActivityTest.kt
@@ -19,10 +19,10 @@
import android.content.Context
import android.content.Intent
import androidx.test.core.app.ApplicationProvider
-import androidx.wear.complications.data.ComplicationType
-import androidx.wear.complications.data.ComplicationType.LONG_TEXT
-import androidx.wear.complications.data.ComplicationType.MONOCHROMATIC_IMAGE
-import androidx.wear.complications.data.ComplicationType.SHORT_TEXT
+import androidx.wear.watchface.complications.data.ComplicationType
+import androidx.wear.watchface.complications.data.ComplicationType.LONG_TEXT
+import androidx.wear.watchface.complications.data.ComplicationType.MONOCHROMATIC_IMAGE
+import androidx.wear.watchface.complications.data.ComplicationType.SHORT_TEXT
import com.google.common.truth.Truth.assertThat
import org.junit.Test
diff --git a/wear/wear-watchface/src/androidTest/java/androidx/wear/watchface/test/TestCanvasAnalogWatchFaceService.kt b/wear/watchface/watchface/src/androidTest/java/androidx/wear/watchface/test/TestCanvasAnalogWatchFaceService.kt
similarity index 100%
rename from wear/wear-watchface/src/androidTest/java/androidx/wear/watchface/test/TestCanvasAnalogWatchFaceService.kt
rename to wear/watchface/watchface/src/androidTest/java/androidx/wear/watchface/test/TestCanvasAnalogWatchFaceService.kt
diff --git a/wear/wear-watchface/src/androidTest/java/androidx/wear/watchface/test/TestGlesWatchFaceService.kt b/wear/watchface/watchface/src/androidTest/java/androidx/wear/watchface/test/TestGlesWatchFaceService.kt
similarity index 100%
rename from wear/wear-watchface/src/androidTest/java/androidx/wear/watchface/test/TestGlesWatchFaceService.kt
rename to wear/watchface/watchface/src/androidTest/java/androidx/wear/watchface/test/TestGlesWatchFaceService.kt
diff --git a/wear/wear-watchface/src/androidTest/java/androidx/wear/watchface/test/WatchFaceControlServiceTest.kt b/wear/watchface/watchface/src/androidTest/java/androidx/wear/watchface/test/WatchFaceControlServiceTest.kt
similarity index 97%
rename from wear/wear-watchface/src/androidTest/java/androidx/wear/watchface/test/WatchFaceControlServiceTest.kt
rename to wear/watchface/watchface/src/androidTest/java/androidx/wear/watchface/test/WatchFaceControlServiceTest.kt
index 2ef3593..37db7a1 100644
--- a/wear/wear-watchface/src/androidTest/java/androidx/wear/watchface/test/WatchFaceControlServiceTest.kt
+++ b/wear/watchface/watchface/src/androidTest/java/androidx/wear/watchface/test/WatchFaceControlServiceTest.kt
@@ -30,9 +30,9 @@
import androidx.test.filters.MediumTest
import androidx.test.screenshot.AndroidXScreenshotTestRule
import androidx.test.screenshot.assertAgainstGolden
-import androidx.wear.complications.data.ComplicationText
-import androidx.wear.complications.data.PlainComplicationText
-import androidx.wear.complications.data.ShortTextComplicationData
+import androidx.wear.watchface.complications.data.ComplicationText
+import androidx.wear.watchface.complications.data.PlainComplicationText
+import androidx.wear.watchface.complications.data.ShortTextComplicationData
import androidx.wear.watchface.CanvasType
import androidx.wear.watchface.ComplicationSlotsManager
import androidx.wear.watchface.DrawMode
diff --git a/wear/wear-watchface/src/androidTest/java/androidx/wear/watchface/test/WatchFaceServiceImageTest.kt b/wear/watchface/watchface/src/androidTest/java/androidx/wear/watchface/test/WatchFaceServiceImageTest.kt
similarity index 98%
rename from wear/wear-watchface/src/androidTest/java/androidx/wear/watchface/test/WatchFaceServiceImageTest.kt
rename to wear/watchface/watchface/src/androidTest/java/androidx/wear/watchface/test/WatchFaceServiceImageTest.kt
index 5acc600..38e3e47 100644
--- a/wear/wear-watchface/src/androidTest/java/androidx/wear/watchface/test/WatchFaceServiceImageTest.kt
+++ b/wear/watchface/watchface/src/androidTest/java/androidx/wear/watchface/test/WatchFaceServiceImageTest.kt
@@ -40,10 +40,10 @@
import androidx.test.filters.MediumTest
import androidx.test.screenshot.AndroidXScreenshotTestRule
import androidx.test.screenshot.assertAgainstGolden
-import androidx.wear.complications.SystemDataSources
-import androidx.wear.complications.data.ComplicationText
-import androidx.wear.complications.data.PlainComplicationText
-import androidx.wear.complications.data.ShortTextComplicationData
+import androidx.wear.watchface.complications.SystemDataSources
+import androidx.wear.watchface.complications.data.ComplicationText
+import androidx.wear.watchface.complications.data.PlainComplicationText
+import androidx.wear.watchface.complications.data.ShortTextComplicationData
import androidx.wear.watchface.CanvasType
import androidx.wear.watchface.ComplicationSlotsManager
import androidx.wear.watchface.DrawMode
diff --git a/wear/wear-watchface/src/main/AndroidManifest.xml b/wear/watchface/watchface/src/main/AndroidManifest.xml
similarity index 98%
rename from wear/wear-watchface/src/main/AndroidManifest.xml
rename to wear/watchface/watchface/src/main/AndroidManifest.xml
index d92c4046..f9fd803 100644
--- a/wear/wear-watchface/src/main/AndroidManifest.xml
+++ b/wear/watchface/watchface/src/main/AndroidManifest.xml
@@ -34,7 +34,7 @@
android:enabled="@bool/watch_face_instance_service_enabled"
android:exported="true"
android:permission="com.google.android.wearable.permission.BIND_WATCH_FACE_CONTROL">
- <meta-data android:name="androidx.wear.watchface.api_version" android:value="3" />
+ <meta-data android:name="androidx.wear.watchface.api_version" android:value="4" />
<intent-filter>
<action android:name="com.google.android.wearable.action.WATCH_FACE_CONTROL"/>
</intent-filter>
diff --git a/wear/wear-watchface/src/main/java/androidx/wear/watchface/BroadcastsObserver.kt b/wear/watchface/watchface/src/main/java/androidx/wear/watchface/BroadcastsObserver.kt
similarity index 100%
rename from wear/wear-watchface/src/main/java/androidx/wear/watchface/BroadcastsObserver.kt
rename to wear/watchface/watchface/src/main/java/androidx/wear/watchface/BroadcastsObserver.kt
diff --git a/wear/wear-watchface/src/main/java/androidx/wear/watchface/BroadcastsReceiver.kt b/wear/watchface/watchface/src/main/java/androidx/wear/watchface/BroadcastsReceiver.kt
similarity index 100%
rename from wear/wear-watchface/src/main/java/androidx/wear/watchface/BroadcastsReceiver.kt
rename to wear/watchface/watchface/src/main/java/androidx/wear/watchface/BroadcastsReceiver.kt
diff --git a/wear/wear-watchface/src/main/java/androidx/wear/watchface/CancellableUniqueTask.kt b/wear/watchface/watchface/src/main/java/androidx/wear/watchface/CancellableUniqueTask.kt
similarity index 100%
rename from wear/wear-watchface/src/main/java/androidx/wear/watchface/CancellableUniqueTask.kt
rename to wear/watchface/watchface/src/main/java/androidx/wear/watchface/CancellableUniqueTask.kt
diff --git a/wear/wear-watchface/src/main/java/androidx/wear/watchface/CanvasComplicationFactory.java b/wear/watchface/watchface/src/main/java/androidx/wear/watchface/CanvasComplicationFactory.java
similarity index 100%
rename from wear/wear-watchface/src/main/java/androidx/wear/watchface/CanvasComplicationFactory.java
rename to wear/watchface/watchface/src/main/java/androidx/wear/watchface/CanvasComplicationFactory.java
diff --git a/wear/wear-watchface/src/main/java/androidx/wear/watchface/ComplicationDataSourceChooserIntent.java b/wear/watchface/watchface/src/main/java/androidx/wear/watchface/ComplicationDataSourceChooserIntent.java
similarity index 98%
rename from wear/wear-watchface/src/main/java/androidx/wear/watchface/ComplicationDataSourceChooserIntent.java
rename to wear/watchface/watchface/src/main/java/androidx/wear/watchface/ComplicationDataSourceChooserIntent.java
index 0bd1da5..60049d7 100644
--- a/wear/wear-watchface/src/main/java/androidx/wear/watchface/ComplicationDataSourceChooserIntent.java
+++ b/wear/watchface/watchface/src/main/java/androidx/wear/watchface/ComplicationDataSourceChooserIntent.java
@@ -90,7 +90,7 @@
*/
@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
public static final String EXTRA_WATCHFACE_INSTANCE_ID =
- "androidx.wear.complications.EXTRA_WATCHFACE_INSTANCE_ID";
+ "androidx.wear.watchface.complications.EXTRA_WATCHFACE_INSTANCE_ID";
/**
* Key for an extra used to include details of the chosen complication data source in the
diff --git a/wear/wear-watchface/src/main/java/androidx/wear/watchface/ComplicationHelperActivity.java b/wear/watchface/watchface/src/main/java/androidx/wear/watchface/ComplicationHelperActivity.java
similarity index 98%
rename from wear/wear-watchface/src/main/java/androidx/wear/watchface/ComplicationHelperActivity.java
rename to wear/watchface/watchface/src/main/java/androidx/wear/watchface/ComplicationHelperActivity.java
index ae93020..f4d58c4 100644
--- a/wear/wear-watchface/src/main/java/androidx/wear/watchface/ComplicationHelperActivity.java
+++ b/wear/watchface/watchface/src/main/java/androidx/wear/watchface/ComplicationHelperActivity.java
@@ -32,8 +32,8 @@
import androidx.annotation.RequiresApi;
import androidx.annotation.RestrictTo;
import androidx.core.app.ActivityCompat;
-import androidx.wear.complications.ComplicationDataSourceUpdateRequesterConstants;
-import androidx.wear.complications.data.ComplicationType;
+import androidx.wear.watchface.complications.ComplicationDataSourceUpdateRequesterConstants;
+import androidx.wear.watchface.complications.data.ComplicationType;
import java.util.Collection;
import java.util.Objects;
diff --git a/wear/wear-watchface/src/main/java/androidx/wear/watchface/ComplicationSlot.kt b/wear/watchface/watchface/src/main/java/androidx/wear/watchface/ComplicationSlot.kt
similarity index 98%
rename from wear/wear-watchface/src/main/java/androidx/wear/watchface/ComplicationSlot.kt
rename to wear/watchface/watchface/src/main/java/androidx/wear/watchface/ComplicationSlot.kt
index 629cde5..02fa327 100644
--- a/wear/wear-watchface/src/main/java/androidx/wear/watchface/ComplicationSlot.kt
+++ b/wear/watchface/watchface/src/main/java/androidx/wear/watchface/ComplicationSlot.kt
@@ -27,12 +27,12 @@
import androidx.annotation.RestrictTo
import androidx.annotation.UiThread
import androidx.annotation.WorkerThread
-import androidx.wear.complications.ComplicationSlotBounds
-import androidx.wear.complications.DefaultComplicationDataSourcePolicy
-import androidx.wear.complications.data.ComplicationData
-import androidx.wear.complications.data.ComplicationType
-import androidx.wear.complications.data.EmptyComplicationData
-import androidx.wear.complications.data.NoDataComplicationData
+import androidx.wear.watchface.complications.ComplicationSlotBounds
+import androidx.wear.watchface.complications.DefaultComplicationDataSourcePolicy
+import androidx.wear.watchface.complications.data.ComplicationData
+import androidx.wear.watchface.complications.data.ComplicationType
+import androidx.wear.watchface.complications.data.EmptyComplicationData
+import androidx.wear.watchface.complications.data.NoDataComplicationData
import androidx.wear.watchface.RenderParameters.HighlightedElement
import androidx.wear.watchface.style.UserStyleSetting
import androidx.wear.watchface.style.UserStyleSetting.ComplicationSlotsUserStyleSetting
@@ -598,7 +598,7 @@
internal var dataDirty = true
/**
- * The [androidx.wear.complications.data.ComplicationData] associated with the
+ * The [androidx.wear.watchface.complications.data.ComplicationData] associated with the
* [ComplicationSlot]. This defaults to [NoDataComplicationData].
*/
public val complicationData: StateFlow<ComplicationData> =
diff --git a/wear/wear-watchface/src/main/java/androidx/wear/watchface/ComplicationSlotsManager.kt b/wear/watchface/watchface/src/main/java/androidx/wear/watchface/ComplicationSlotsManager.kt
similarity index 97%
rename from wear/wear-watchface/src/main/java/androidx/wear/watchface/ComplicationSlotsManager.kt
rename to wear/watchface/watchface/src/main/java/androidx/wear/watchface/ComplicationSlotsManager.kt
index 63c8639..c4e1899 100644
--- a/wear/wear-watchface/src/main/java/androidx/wear/watchface/ComplicationSlotsManager.kt
+++ b/wear/watchface/watchface/src/main/java/androidx/wear/watchface/ComplicationSlotsManager.kt
@@ -26,11 +26,11 @@
import androidx.annotation.UiThread
import androidx.annotation.VisibleForTesting
import androidx.annotation.WorkerThread
-import androidx.wear.complications.ComplicationSlotBounds
-import androidx.wear.complications.data.ComplicationData
-import androidx.wear.complications.data.ComplicationType
-import androidx.wear.complications.data.NoDataComplicationData
-import androidx.wear.utility.TraceEvent
+import androidx.wear.watchface.complications.ComplicationSlotBounds
+import androidx.wear.watchface.complications.data.ComplicationData
+import androidx.wear.watchface.complications.data.ComplicationType
+import androidx.wear.watchface.complications.data.NoDataComplicationData
+import androidx.wear.watchface.utility.TraceEvent
import androidx.wear.watchface.control.data.IdTypeAndDefaultProviderPolicyWireFormat
import androidx.wear.watchface.style.CurrentUserStyleRepository
import androidx.wear.watchface.style.UserStyleSetting.ComplicationSlotsUserStyleSetting
diff --git a/wear/wear-watchface/src/main/java/androidx/wear/watchface/ContentDescriptionLabel.kt b/wear/watchface/watchface/src/main/java/androidx/wear/watchface/ContentDescriptionLabel.kt
similarity index 96%
rename from wear/wear-watchface/src/main/java/androidx/wear/watchface/ContentDescriptionLabel.kt
rename to wear/watchface/watchface/src/main/java/androidx/wear/watchface/ContentDescriptionLabel.kt
index 2e4736d..bc87a3b 100644
--- a/wear/wear-watchface/src/main/java/androidx/wear/watchface/ContentDescriptionLabel.kt
+++ b/wear/watchface/watchface/src/main/java/androidx/wear/watchface/ContentDescriptionLabel.kt
@@ -19,7 +19,7 @@
import android.app.PendingIntent
import android.content.res.Resources
import android.graphics.Rect
-import androidx.wear.complications.data.ComplicationText
+import androidx.wear.watchface.complications.data.ComplicationText
import java.time.Instant
import java.util.Objects
diff --git a/wear/wear-watchface/src/main/java/androidx/wear/watchface/IndentingPrintWriter.kt b/wear/watchface/watchface/src/main/java/androidx/wear/watchface/IndentingPrintWriter.kt
similarity index 97%
rename from wear/wear-watchface/src/main/java/androidx/wear/watchface/IndentingPrintWriter.kt
rename to wear/watchface/watchface/src/main/java/androidx/wear/watchface/IndentingPrintWriter.kt
index aa66e3b..46db63b 100644
--- a/wear/wear-watchface/src/main/java/androidx/wear/watchface/IndentingPrintWriter.kt
+++ b/wear/watchface/watchface/src/main/java/androidx/wear/watchface/IndentingPrintWriter.kt
@@ -31,7 +31,7 @@
writer: Writer,
private val singleIndent: String = "\t"
) : Printer {
- private val writer: PrintWriter = PrintWriter(writer)
+ internal val writer: PrintWriter = PrintWriter(writer)
/** Mutable version of current indent */
private val indentBuilder = StringBuilder()
diff --git a/wear/wear-watchface/src/main/java/androidx/wear/watchface/RenderBufferTexture.kt b/wear/watchface/watchface/src/main/java/androidx/wear/watchface/RenderBufferTexture.kt
similarity index 100%
rename from wear/wear-watchface/src/main/java/androidx/wear/watchface/RenderBufferTexture.kt
rename to wear/watchface/watchface/src/main/java/androidx/wear/watchface/RenderBufferTexture.kt
diff --git a/wear/wear-watchface/src/main/java/androidx/wear/watchface/RenderParameters.kt b/wear/watchface/watchface/src/main/java/androidx/wear/watchface/RenderParameters.kt
similarity index 100%
rename from wear/wear-watchface/src/main/java/androidx/wear/watchface/RenderParameters.kt
rename to wear/watchface/watchface/src/main/java/androidx/wear/watchface/RenderParameters.kt
diff --git a/wear/wear-watchface/src/main/java/androidx/wear/watchface/Renderer.kt b/wear/watchface/watchface/src/main/java/androidx/wear/watchface/Renderer.kt
similarity index 98%
rename from wear/wear-watchface/src/main/java/androidx/wear/watchface/Renderer.kt
rename to wear/watchface/watchface/src/main/java/androidx/wear/watchface/Renderer.kt
index e472be2..5e4e80a9 100644
--- a/wear/wear-watchface/src/main/java/androidx/wear/watchface/Renderer.kt
+++ b/wear/watchface/watchface/src/main/java/androidx/wear/watchface/Renderer.kt
@@ -40,7 +40,7 @@
import androidx.annotation.Px
import androidx.annotation.UiThread
import androidx.annotation.WorkerThread
-import androidx.wear.utility.TraceEvent
+import androidx.wear.watchface.utility.TraceEvent
import androidx.wear.watchface.Renderer.CanvasRenderer
import androidx.wear.watchface.Renderer.GlesRenderer
import androidx.wear.watchface.Renderer.GlesRenderer.GlesException
@@ -50,6 +50,7 @@
import kotlinx.coroutines.runBlocking
import kotlinx.coroutines.sync.Mutex
import kotlinx.coroutines.sync.withLock
+import java.io.PrintWriter
import java.nio.ByteBuffer
import java.time.ZonedDateTime
@@ -293,7 +294,10 @@
}
@UiThread
- internal abstract fun dump(writer: IndentingPrintWriter)
+ internal abstract fun dumpInternal(writer: IndentingPrintWriter)
+
+ /** Called when adb shell dumpsys is invoked for the WatchFaceService. */
+ public abstract fun dump(writer: PrintWriter)
/**
* Perform UiThread specific initialization. Will be called once during initialization before
@@ -456,7 +460,7 @@
zonedDateTime: ZonedDateTime
)
- internal override fun dump(writer: IndentingPrintWriter) {
+ internal override fun dumpInternal(writer: IndentingPrintWriter) {
writer.println("CanvasRenderer:")
writer.increaseIndent()
writer.println("canvasType=$canvasType")
@@ -466,8 +470,11 @@
)
writer.println("shouldAnimate=${shouldAnimate()}")
renderParameters.dump(writer)
+ dump(writer.writer)
writer.decreaseIndent()
}
+
+ override fun dump(writer: PrintWriter) {}
}
/**
@@ -1031,7 +1038,7 @@
@UiThread
public abstract fun renderHighlightLayer(zonedDateTime: ZonedDateTime)
- internal override fun dump(writer: IndentingPrintWriter) {
+ internal override fun dumpInternal(writer: IndentingPrintWriter) {
writer.println("GlesRenderer:")
writer.increaseIndent()
writer.println("screenBounds=$screenBounds")
@@ -1040,7 +1047,10 @@
)
writer.println("shouldAnimate=${shouldAnimate()}")
renderParameters.dump(writer)
+ dump(writer.writer)
writer.decreaseIndent()
}
+
+ override fun dump(writer: PrintWriter) {}
}
}
diff --git a/wear/wear-watchface/src/main/java/androidx/wear/watchface/TapEvent.kt b/wear/watchface/watchface/src/main/java/androidx/wear/watchface/TapEvent.kt
similarity index 100%
rename from wear/wear-watchface/src/main/java/androidx/wear/watchface/TapEvent.kt
rename to wear/watchface/watchface/src/main/java/androidx/wear/watchface/TapEvent.kt
diff --git a/wear/wear-watchface/src/main/java/androidx/wear/watchface/WatchFace.kt b/wear/watchface/watchface/src/main/java/androidx/wear/watchface/WatchFace.kt
similarity index 98%
rename from wear/wear-watchface/src/main/java/androidx/wear/watchface/WatchFace.kt
rename to wear/watchface/watchface/src/main/java/androidx/wear/watchface/WatchFace.kt
index 3606b43..d503ae6 100644
--- a/wear/wear-watchface/src/main/java/androidx/wear/watchface/WatchFace.kt
+++ b/wear/watchface/watchface/src/main/java/androidx/wear/watchface/WatchFace.kt
@@ -39,11 +39,11 @@
import androidx.annotation.RestrictTo
import androidx.annotation.UiThread
import androidx.annotation.VisibleForTesting
-import androidx.wear.complications.SystemDataSources
-import androidx.wear.complications.data.ComplicationData
-import androidx.wear.complications.data.ComplicationType
-import androidx.wear.complications.data.toApiComplicationData
-import androidx.wear.utility.TraceEvent
+import androidx.wear.watchface.complications.SystemDataSources
+import androidx.wear.watchface.complications.data.ComplicationData
+import androidx.wear.watchface.complications.data.ComplicationType
+import androidx.wear.watchface.complications.data.toApiComplicationData
+import androidx.wear.watchface.utility.TraceEvent
import androidx.wear.watchface.control.data.ComplicationRenderParams
import androidx.wear.watchface.control.data.HeadlessWatchFaceInstanceParams
import androidx.wear.watchface.control.data.WatchFaceRenderParams
@@ -679,9 +679,7 @@
override var userStyle: UserStyle
get() = currentUserStyleRepository.userStyle.value
- set(value) {
- currentUserStyleRepository.userStyle.value = value
- }
+ set(value) { currentUserStyleRepository.updateUserStyle(value) }
override val complicationSlotsManager: ComplicationSlotsManager
get() = this@WatchFaceImpl.complicationSlotsManager
@@ -749,7 +747,7 @@
internal fun onSetStyleInternal(style: UserStyle) {
// No need to echo the userStyle back.
inOnSetStyle = true
- currentUserStyleRepository.userStyle.value = style
+ currentUserStyleRepository.updateUserStyle(style)
inOnSetStyle = false
}
@@ -1070,7 +1068,7 @@
writer.println("currentUserStyleRepository.schema=${currentUserStyleRepository.schema}")
watchState.dump(writer)
complicationSlotsManager.dump(writer)
- renderer.dump(writer)
+ renderer.dumpInternal(writer)
writer.decreaseIndent()
}
}
diff --git a/wear/wear-watchface/src/main/java/androidx/wear/watchface/WatchFaceHostApi.kt b/wear/watchface/watchface/src/main/java/androidx/wear/watchface/WatchFaceHostApi.kt
similarity index 98%
rename from wear/wear-watchface/src/main/java/androidx/wear/watchface/WatchFaceHostApi.kt
rename to wear/watchface/watchface/src/main/java/androidx/wear/watchface/WatchFaceHostApi.kt
index 06e175d..41b62f9 100644
--- a/wear/wear-watchface/src/main/java/androidx/wear/watchface/WatchFaceHostApi.kt
+++ b/wear/watchface/watchface/src/main/java/androidx/wear/watchface/WatchFaceHostApi.kt
@@ -22,7 +22,7 @@
import android.support.wearable.complications.ComplicationData
import androidx.annotation.RestrictTo
import androidx.annotation.UiThread
-import androidx.wear.complications.SystemDataSources.DataSourceId
+import androidx.wear.watchface.complications.SystemDataSources.DataSourceId
import androidx.wear.watchface.style.data.UserStyleWireFormat
import kotlinx.coroutines.CoroutineScope
diff --git a/wear/wear-watchface/src/main/java/androidx/wear/watchface/WatchFaceService.kt b/wear/watchface/watchface/src/main/java/androidx/wear/watchface/WatchFaceService.kt
similarity index 98%
rename from wear/wear-watchface/src/main/java/androidx/wear/watchface/WatchFaceService.kt
rename to wear/watchface/watchface/src/main/java/androidx/wear/watchface/WatchFaceService.kt
index 2651348..16fe806 100644
--- a/wear/wear-watchface/src/main/java/androidx/wear/watchface/WatchFaceService.kt
+++ b/wear/watchface/watchface/src/main/java/androidx/wear/watchface/WatchFaceService.kt
@@ -49,12 +49,12 @@
import androidx.annotation.VisibleForTesting
import androidx.annotation.WorkerThread
import androidx.versionedparcelable.ParcelUtils
-import androidx.wear.complications.SystemDataSources.DataSourceId
-import androidx.wear.complications.data.ComplicationData
-import androidx.wear.complications.data.toApiComplicationData
-import androidx.wear.complications.data.toWireTypes
-import androidx.wear.utility.AsyncTraceEvent
-import androidx.wear.utility.TraceEvent
+import androidx.wear.watchface.complications.SystemDataSources.DataSourceId
+import androidx.wear.watchface.complications.data.ComplicationData
+import androidx.wear.watchface.complications.data.toApiComplicationData
+import androidx.wear.watchface.complications.data.toWireTypes
+import androidx.wear.watchface.utility.AsyncTraceEvent
+import androidx.wear.watchface.utility.TraceEvent
import androidx.wear.watchface.control.HeadlessWatchFaceImpl
import androidx.wear.watchface.control.IWatchfaceReadyListener
import androidx.wear.watchface.control.InteractiveInstanceManager
@@ -1541,17 +1541,20 @@
val storedUserStyle = getInitialUserStyle()
if (storedUserStyle != null) {
TraceEvent("WatchFaceImpl.init apply userStyle").use {
- currentUserStyleRepository.userStyle.value =
+ currentUserStyleRepository.updateUserStyle(
UserStyle(UserStyleData(storedUserStyle), currentUserStyleRepository.schema)
+ )
}
} else {
TraceEvent("WatchFaceImpl.init apply userStyle from prefs").use {
// The system doesn't support preference persistence we need to do it ourselves.
val preferencesFile = "watchface_prefs_${_context.javaClass.name}.txt"
- currentUserStyleRepository.userStyle.value = UserStyle(
- UserStyleData(readPrefs(_context, preferencesFile)),
- currentUserStyleRepository.schema
+ currentUserStyleRepository.updateUserStyle(
+ UserStyle(
+ UserStyleData(readPrefs(_context, preferencesFile)),
+ currentUserStyleRepository.schema
+ )
)
backgroundThreadCoroutineScope.launch {
diff --git a/wear/wear-watchface/src/main/java/androidx/wear/watchface/WatchState.kt b/wear/watchface/watchface/src/main/java/androidx/wear/watchface/WatchState.kt
similarity index 100%
rename from wear/wear-watchface/src/main/java/androidx/wear/watchface/WatchState.kt
rename to wear/watchface/watchface/src/main/java/androidx/wear/watchface/WatchState.kt
diff --git a/wear/wear-watchface/src/main/java/androidx/wear/watchface/control/HeadlessWatchFaceImpl.kt b/wear/watchface/watchface/src/main/java/androidx/wear/watchface/control/HeadlessWatchFaceImpl.kt
similarity index 98%
rename from wear/wear-watchface/src/main/java/androidx/wear/watchface/control/HeadlessWatchFaceImpl.kt
rename to wear/watchface/watchface/src/main/java/androidx/wear/watchface/control/HeadlessWatchFaceImpl.kt
index 658a469..2d48f24 100644
--- a/wear/wear-watchface/src/main/java/androidx/wear/watchface/control/HeadlessWatchFaceImpl.kt
+++ b/wear/watchface/watchface/src/main/java/androidx/wear/watchface/control/HeadlessWatchFaceImpl.kt
@@ -19,7 +19,7 @@
import android.util.Log
import androidx.annotation.RequiresApi
import androidx.annotation.UiThread
-import androidx.wear.utility.TraceEvent
+import androidx.wear.watchface.utility.TraceEvent
import androidx.wear.watchface.IndentingPrintWriter
import androidx.wear.watchface.WatchFaceImpl
import androidx.wear.watchface.WatchFaceService
diff --git a/wear/wear-watchface/src/main/java/androidx/wear/watchface/control/InteractiveInstanceManager.kt b/wear/watchface/watchface/src/main/java/androidx/wear/watchface/control/InteractiveInstanceManager.kt
similarity index 98%
rename from wear/wear-watchface/src/main/java/androidx/wear/watchface/control/InteractiveInstanceManager.kt
rename to wear/watchface/watchface/src/main/java/androidx/wear/watchface/control/InteractiveInstanceManager.kt
index cfe74a60..f470cf3 100644
--- a/wear/wear-watchface/src/main/java/androidx/wear/watchface/control/InteractiveInstanceManager.kt
+++ b/wear/watchface/watchface/src/main/java/androidx/wear/watchface/control/InteractiveInstanceManager.kt
@@ -18,7 +18,7 @@
import android.annotation.SuppressLint
import androidx.annotation.UiThread
-import androidx.wear.utility.TraceEvent
+import androidx.wear.watchface.utility.TraceEvent
import androidx.wear.watchface.IndentingPrintWriter
import androidx.wear.watchface.control.data.WallpaperInteractiveWatchFaceInstanceParams
import kotlinx.coroutines.runBlocking
@@ -88,6 +88,7 @@
@SuppressLint("SyntheticAccessor")
fun deleteInstance(instanceId: String) {
synchronized(pendingWallpaperInteractiveWatchFaceInstanceLock) {
+ instances[instanceId]?.impl?.onDestroy()
instances.remove(instanceId)
}
}
diff --git a/wear/wear-watchface/src/main/java/androidx/wear/watchface/control/InteractiveWatchFaceImpl.kt b/wear/watchface/watchface/src/main/java/androidx/wear/watchface/control/InteractiveWatchFaceImpl.kt
similarity index 91%
rename from wear/wear-watchface/src/main/java/androidx/wear/watchface/control/InteractiveWatchFaceImpl.kt
rename to wear/watchface/watchface/src/main/java/androidx/wear/watchface/control/InteractiveWatchFaceImpl.kt
index 2395af1..a8447bb5 100644
--- a/wear/wear-watchface/src/main/java/androidx/wear/watchface/control/InteractiveWatchFaceImpl.kt
+++ b/wear/watchface/watchface/src/main/java/androidx/wear/watchface/control/InteractiveWatchFaceImpl.kt
@@ -19,7 +19,7 @@
import android.os.Build
import android.util.Log
import androidx.annotation.RequiresApi
-import androidx.wear.utility.TraceEvent
+import androidx.wear.watchface.utility.TraceEvent
import androidx.wear.watchface.TapEvent
import androidx.wear.watchface.WatchFaceImpl
import androidx.wear.watchface.WatchFaceService
@@ -28,6 +28,7 @@
import androidx.wear.watchface.data.WatchUiState
import androidx.wear.watchface.runBlockingWithTracing
import androidx.wear.watchface.style.data.UserStyleWireFormat
+import kotlinx.coroutines.launch
import kotlinx.coroutines.runBlocking
import kotlinx.coroutines.withContext
import java.time.Instant
@@ -106,15 +107,15 @@
) { engine!!.ambientTickUpdate() }
}
- override fun release() = TraceEvent("InteractiveWatchFaceImpl.release").use {
- runBlocking {
- try {
- engine!!.deferredWatchFaceImpl.await()
- } catch (e: Exception) {
- // deferredWatchFaceImpl may have completed with an exception. This will have
- // already been reported so we can ignore it.
- }
- withContext(engine!!.uiThreadCoroutineScope.coroutineContext) {
+ override fun release(): Unit = TraceEvent("InteractiveWatchFaceImpl.release").use {
+ engine?.let {
+ it.uiThreadCoroutineScope.launch {
+ try {
+ it.deferredWatchFaceImpl.await()
+ } catch (e: Exception) {
+ // deferredWatchFaceImpl may have completed with an exception. This will
+ // have already been reported so we can ignore it.
+ }
InteractiveInstanceManager.releaseInstance(instanceId)
}
}
diff --git a/wear/wear-watchface/src/main/java/androidx/wear/watchface/control/WatchFaceControlService.kt b/wear/watchface/watchface/src/main/java/androidx/wear/watchface/control/WatchFaceControlService.kt
similarity index 98%
rename from wear/wear-watchface/src/main/java/androidx/wear/watchface/control/WatchFaceControlService.kt
rename to wear/watchface/watchface/src/main/java/androidx/wear/watchface/control/WatchFaceControlService.kt
index bb56fc3..b2504c0 100644
--- a/wear/wear-watchface/src/main/java/androidx/wear/watchface/control/WatchFaceControlService.kt
+++ b/wear/watchface/watchface/src/main/java/androidx/wear/watchface/control/WatchFaceControlService.kt
@@ -27,8 +27,8 @@
import androidx.annotation.RestrictTo
import androidx.annotation.UiThread
import androidx.annotation.VisibleForTesting
-import androidx.wear.utility.AsyncTraceEvent
-import androidx.wear.utility.TraceEvent
+import androidx.wear.watchface.utility.AsyncTraceEvent
+import androidx.wear.watchface.utility.TraceEvent
import androidx.wear.watchface.IndentingPrintWriter
import androidx.wear.watchface.WatchFaceService
import androidx.wear.watchface.control.data.CrashInfoParcel
diff --git a/wear/wear-watchface/src/main/java/androidx/wear/watchface/editor/EditorService.kt b/wear/watchface/watchface/src/main/java/androidx/wear/watchface/editor/EditorService.kt
similarity index 100%
rename from wear/wear-watchface/src/main/java/androidx/wear/watchface/editor/EditorService.kt
rename to wear/watchface/watchface/src/main/java/androidx/wear/watchface/editor/EditorService.kt
diff --git a/wear/wear-watchface/src/main/res/drawable-280dpi/ic_elements_comps_bg.png b/wear/watchface/watchface/src/main/res/drawable-280dpi/ic_elements_comps_bg.png
similarity index 100%
rename from wear/wear-watchface/src/main/res/drawable-280dpi/ic_elements_comps_bg.png
rename to wear/watchface/watchface/src/main/res/drawable-280dpi/ic_elements_comps_bg.png
Binary files differ
diff --git a/wear/wear-watchface/src/main/res/drawable-280dpi/ic_elements_settings_complications.png b/wear/watchface/watchface/src/main/res/drawable-280dpi/ic_elements_settings_complications.png
similarity index 100%
rename from wear/wear-watchface/src/main/res/drawable-280dpi/ic_elements_settings_complications.png
rename to wear/watchface/watchface/src/main/res/drawable-280dpi/ic_elements_settings_complications.png
Binary files differ
diff --git a/wear/wear-watchface/src/main/res/drawable-280dpi/ic_elements_settings_styles.png b/wear/watchface/watchface/src/main/res/drawable-280dpi/ic_elements_settings_styles.png
similarity index 100%
rename from wear/wear-watchface/src/main/res/drawable-280dpi/ic_elements_settings_styles.png
rename to wear/watchface/watchface/src/main/res/drawable-280dpi/ic_elements_settings_styles.png
Binary files differ
diff --git a/wear/wear-watchface/src/main/res/drawable-hdpi/ic_elements_comps_bg.png b/wear/watchface/watchface/src/main/res/drawable-hdpi/ic_elements_comps_bg.png
similarity index 100%
rename from wear/wear-watchface/src/main/res/drawable-hdpi/ic_elements_comps_bg.png
rename to wear/watchface/watchface/src/main/res/drawable-hdpi/ic_elements_comps_bg.png
Binary files differ
diff --git a/wear/wear-watchface/src/main/res/drawable-hdpi/ic_elements_settings_complications.png b/wear/watchface/watchface/src/main/res/drawable-hdpi/ic_elements_settings_complications.png
similarity index 100%
rename from wear/wear-watchface/src/main/res/drawable-hdpi/ic_elements_settings_complications.png
rename to wear/watchface/watchface/src/main/res/drawable-hdpi/ic_elements_settings_complications.png
Binary files differ
diff --git a/wear/wear-watchface/src/main/res/drawable-hdpi/ic_elements_settings_styles.png b/wear/watchface/watchface/src/main/res/drawable-hdpi/ic_elements_settings_styles.png
similarity index 100%
rename from wear/wear-watchface/src/main/res/drawable-hdpi/ic_elements_settings_styles.png
rename to wear/watchface/watchface/src/main/res/drawable-hdpi/ic_elements_settings_styles.png
Binary files differ
diff --git a/wear/wear-watchface/src/main/res/drawable-mdpi/ic_elements_comps_bg.png b/wear/watchface/watchface/src/main/res/drawable-mdpi/ic_elements_comps_bg.png
similarity index 100%
rename from wear/wear-watchface/src/main/res/drawable-mdpi/ic_elements_comps_bg.png
rename to wear/watchface/watchface/src/main/res/drawable-mdpi/ic_elements_comps_bg.png
Binary files differ
diff --git a/wear/wear-watchface/src/main/res/drawable-mdpi/ic_elements_settings_complications.png b/wear/watchface/watchface/src/main/res/drawable-mdpi/ic_elements_settings_complications.png
similarity index 100%
rename from wear/wear-watchface/src/main/res/drawable-mdpi/ic_elements_settings_complications.png
rename to wear/watchface/watchface/src/main/res/drawable-mdpi/ic_elements_settings_complications.png
Binary files differ
diff --git a/wear/wear-watchface/src/main/res/drawable-mdpi/ic_elements_settings_styles.png b/wear/watchface/watchface/src/main/res/drawable-mdpi/ic_elements_settings_styles.png
similarity index 100%
rename from wear/wear-watchface/src/main/res/drawable-mdpi/ic_elements_settings_styles.png
rename to wear/watchface/watchface/src/main/res/drawable-mdpi/ic_elements_settings_styles.png
Binary files differ
diff --git a/wear/wear-watchface/src/main/res/drawable-xhdpi/ic_elements_comps_bg.png b/wear/watchface/watchface/src/main/res/drawable-xhdpi/ic_elements_comps_bg.png
similarity index 100%
rename from wear/wear-watchface/src/main/res/drawable-xhdpi/ic_elements_comps_bg.png
rename to wear/watchface/watchface/src/main/res/drawable-xhdpi/ic_elements_comps_bg.png
Binary files differ
diff --git a/wear/wear-watchface/src/main/res/drawable-xhdpi/ic_elements_settings_complications.png b/wear/watchface/watchface/src/main/res/drawable-xhdpi/ic_elements_settings_complications.png
similarity index 100%
rename from wear/wear-watchface/src/main/res/drawable-xhdpi/ic_elements_settings_complications.png
rename to wear/watchface/watchface/src/main/res/drawable-xhdpi/ic_elements_settings_complications.png
Binary files differ
diff --git a/wear/wear-watchface/src/main/res/drawable-xhdpi/ic_elements_settings_styles.png b/wear/watchface/watchface/src/main/res/drawable-xhdpi/ic_elements_settings_styles.png
similarity index 100%
rename from wear/wear-watchface/src/main/res/drawable-xhdpi/ic_elements_settings_styles.png
rename to wear/watchface/watchface/src/main/res/drawable-xhdpi/ic_elements_settings_styles.png
Binary files differ
diff --git a/wear/wear-watchface/src/main/res/drawable-xxhdpi/ic_elements_comps_bg.png b/wear/watchface/watchface/src/main/res/drawable-xxhdpi/ic_elements_comps_bg.png
similarity index 100%
rename from wear/wear-watchface/src/main/res/drawable-xxhdpi/ic_elements_comps_bg.png
rename to wear/watchface/watchface/src/main/res/drawable-xxhdpi/ic_elements_comps_bg.png
Binary files differ
diff --git a/wear/wear-watchface/src/main/res/drawable-xxhdpi/ic_elements_settings_complications.png b/wear/watchface/watchface/src/main/res/drawable-xxhdpi/ic_elements_settings_complications.png
similarity index 100%
rename from wear/wear-watchface/src/main/res/drawable-xxhdpi/ic_elements_settings_complications.png
rename to wear/watchface/watchface/src/main/res/drawable-xxhdpi/ic_elements_settings_complications.png
Binary files differ
diff --git a/wear/wear-watchface/src/main/res/drawable-xxxhdpi/ic_elements_comps_bg.png b/wear/watchface/watchface/src/main/res/drawable-xxxhdpi/ic_elements_comps_bg.png
similarity index 100%
rename from wear/wear-watchface/src/main/res/drawable-xxxhdpi/ic_elements_comps_bg.png
rename to wear/watchface/watchface/src/main/res/drawable-xxxhdpi/ic_elements_comps_bg.png
Binary files differ
diff --git a/wear/wear-watchface/src/main/res/drawable-xxxhdpi/ic_elements_settings_complications.png b/wear/watchface/watchface/src/main/res/drawable-xxxhdpi/ic_elements_settings_complications.png
similarity index 100%
rename from wear/wear-watchface/src/main/res/drawable-xxxhdpi/ic_elements_settings_complications.png
rename to wear/watchface/watchface/src/main/res/drawable-xxxhdpi/ic_elements_settings_complications.png
Binary files differ
diff --git a/wear/wear-watchface/src/main/res/drawable/preference_wrapped_icon.xml b/wear/watchface/watchface/src/main/res/drawable/preference_wrapped_icon.xml
similarity index 100%
rename from wear/wear-watchface/src/main/res/drawable/preference_wrapped_icon.xml
rename to wear/watchface/watchface/src/main/res/drawable/preference_wrapped_icon.xml
diff --git a/wear/wear-watchface/src/main/res/layout/complication_config_layout.xml b/wear/watchface/watchface/src/main/res/layout/complication_config_layout.xml
similarity index 100%
rename from wear/wear-watchface/src/main/res/layout/complication_config_layout.xml
rename to wear/watchface/watchface/src/main/res/layout/complication_config_layout.xml
diff --git a/wear/wear-watchface/src/main/res/layout/config_layout.xml b/wear/watchface/watchface/src/main/res/layout/config_layout.xml
similarity index 100%
rename from wear/wear-watchface/src/main/res/layout/config_layout.xml
rename to wear/watchface/watchface/src/main/res/layout/config_layout.xml
diff --git a/wear/wear-watchface/src/main/res/layout/configlist_item_layout.xml b/wear/watchface/watchface/src/main/res/layout/configlist_item_layout.xml
similarity index 100%
rename from wear/wear-watchface/src/main/res/layout/configlist_item_layout.xml
rename to wear/watchface/watchface/src/main/res/layout/configlist_item_layout.xml
diff --git a/wear/wear-watchface/src/main/res/layout/style_options_layout.xml b/wear/watchface/watchface/src/main/res/layout/style_options_layout.xml
similarity index 100%
rename from wear/wear-watchface/src/main/res/layout/style_options_layout.xml
rename to wear/watchface/watchface/src/main/res/layout/style_options_layout.xml
diff --git a/wear/wear-watchface/src/main/res/layout/stylelist_item_layout.xml b/wear/watchface/watchface/src/main/res/layout/stylelist_item_layout.xml
similarity index 100%
rename from wear/wear-watchface/src/main/res/layout/stylelist_item_layout.xml
rename to wear/watchface/watchface/src/main/res/layout/stylelist_item_layout.xml
diff --git a/wear/wear-watchface/src/main/res/values-af/watchface_strings.xml b/wear/watchface/watchface/src/main/res/values-af/watchface_strings.xml
similarity index 100%
rename from wear/wear-watchface/src/main/res/values-af/watchface_strings.xml
rename to wear/watchface/watchface/src/main/res/values-af/watchface_strings.xml
diff --git a/wear/wear-watchface/src/main/res/values-am/watchface_strings.xml b/wear/watchface/watchface/src/main/res/values-am/watchface_strings.xml
similarity index 100%
rename from wear/wear-watchface/src/main/res/values-am/watchface_strings.xml
rename to wear/watchface/watchface/src/main/res/values-am/watchface_strings.xml
diff --git a/wear/wear-watchface/src/main/res/values-ar/watchface_strings.xml b/wear/watchface/watchface/src/main/res/values-ar/watchface_strings.xml
similarity index 100%
rename from wear/wear-watchface/src/main/res/values-ar/watchface_strings.xml
rename to wear/watchface/watchface/src/main/res/values-ar/watchface_strings.xml
diff --git a/wear/wear-watchface/src/main/res/values-as/watchface_strings.xml b/wear/watchface/watchface/src/main/res/values-as/watchface_strings.xml
similarity index 100%
rename from wear/wear-watchface/src/main/res/values-as/watchface_strings.xml
rename to wear/watchface/watchface/src/main/res/values-as/watchface_strings.xml
diff --git a/wear/wear-watchface/src/main/res/values-az/watchface_strings.xml b/wear/watchface/watchface/src/main/res/values-az/watchface_strings.xml
similarity index 100%
rename from wear/wear-watchface/src/main/res/values-az/watchface_strings.xml
rename to wear/watchface/watchface/src/main/res/values-az/watchface_strings.xml
diff --git a/wear/wear-watchface/src/main/res/values-b+sr+Latn/watchface_strings.xml b/wear/watchface/watchface/src/main/res/values-b+sr+Latn/watchface_strings.xml
similarity index 100%
rename from wear/wear-watchface/src/main/res/values-b+sr+Latn/watchface_strings.xml
rename to wear/watchface/watchface/src/main/res/values-b+sr+Latn/watchface_strings.xml
diff --git a/wear/wear-watchface/src/main/res/values-be/watchface_strings.xml b/wear/watchface/watchface/src/main/res/values-be/watchface_strings.xml
similarity index 100%
rename from wear/wear-watchface/src/main/res/values-be/watchface_strings.xml
rename to wear/watchface/watchface/src/main/res/values-be/watchface_strings.xml
diff --git a/wear/wear-watchface/src/main/res/values-bg/watchface_strings.xml b/wear/watchface/watchface/src/main/res/values-bg/watchface_strings.xml
similarity index 100%
rename from wear/wear-watchface/src/main/res/values-bg/watchface_strings.xml
rename to wear/watchface/watchface/src/main/res/values-bg/watchface_strings.xml
diff --git a/wear/wear-watchface/src/main/res/values-bn/watchface_strings.xml b/wear/watchface/watchface/src/main/res/values-bn/watchface_strings.xml
similarity index 100%
rename from wear/wear-watchface/src/main/res/values-bn/watchface_strings.xml
rename to wear/watchface/watchface/src/main/res/values-bn/watchface_strings.xml
diff --git a/wear/wear-watchface/src/main/res/values-bs/watchface_strings.xml b/wear/watchface/watchface/src/main/res/values-bs/watchface_strings.xml
similarity index 100%
rename from wear/wear-watchface/src/main/res/values-bs/watchface_strings.xml
rename to wear/watchface/watchface/src/main/res/values-bs/watchface_strings.xml
diff --git a/wear/wear-watchface/src/main/res/values-ca/watchface_strings.xml b/wear/watchface/watchface/src/main/res/values-ca/watchface_strings.xml
similarity index 100%
rename from wear/wear-watchface/src/main/res/values-ca/watchface_strings.xml
rename to wear/watchface/watchface/src/main/res/values-ca/watchface_strings.xml
diff --git a/wear/wear-watchface/src/main/res/values-cs/watchface_strings.xml b/wear/watchface/watchface/src/main/res/values-cs/watchface_strings.xml
similarity index 100%
rename from wear/wear-watchface/src/main/res/values-cs/watchface_strings.xml
rename to wear/watchface/watchface/src/main/res/values-cs/watchface_strings.xml
diff --git a/wear/wear-watchface/src/main/res/values-da/watchface_strings.xml b/wear/watchface/watchface/src/main/res/values-da/watchface_strings.xml
similarity index 100%
rename from wear/wear-watchface/src/main/res/values-da/watchface_strings.xml
rename to wear/watchface/watchface/src/main/res/values-da/watchface_strings.xml
diff --git a/wear/wear-watchface/src/main/res/values-de/watchface_strings.xml b/wear/watchface/watchface/src/main/res/values-de/watchface_strings.xml
similarity index 100%
rename from wear/wear-watchface/src/main/res/values-de/watchface_strings.xml
rename to wear/watchface/watchface/src/main/res/values-de/watchface_strings.xml
diff --git a/wear/wear-watchface/src/main/res/values-el/watchface_strings.xml b/wear/watchface/watchface/src/main/res/values-el/watchface_strings.xml
similarity index 100%
rename from wear/wear-watchface/src/main/res/values-el/watchface_strings.xml
rename to wear/watchface/watchface/src/main/res/values-el/watchface_strings.xml
diff --git a/wear/wear-watchface/src/main/res/values-en-rAU/watchface_strings.xml b/wear/watchface/watchface/src/main/res/values-en-rAU/watchface_strings.xml
similarity index 100%
rename from wear/wear-watchface/src/main/res/values-en-rAU/watchface_strings.xml
rename to wear/watchface/watchface/src/main/res/values-en-rAU/watchface_strings.xml
diff --git a/wear/wear-watchface/src/main/res/values-en-rCA/watchface_strings.xml b/wear/watchface/watchface/src/main/res/values-en-rCA/watchface_strings.xml
similarity index 100%
rename from wear/wear-watchface/src/main/res/values-en-rCA/watchface_strings.xml
rename to wear/watchface/watchface/src/main/res/values-en-rCA/watchface_strings.xml
diff --git a/wear/wear-watchface/src/main/res/values-en-rGB/watchface_strings.xml b/wear/watchface/watchface/src/main/res/values-en-rGB/watchface_strings.xml
similarity index 100%
rename from wear/wear-watchface/src/main/res/values-en-rGB/watchface_strings.xml
rename to wear/watchface/watchface/src/main/res/values-en-rGB/watchface_strings.xml
diff --git a/wear/wear-watchface/src/main/res/values-en-rIN/watchface_strings.xml b/wear/watchface/watchface/src/main/res/values-en-rIN/watchface_strings.xml
similarity index 100%
rename from wear/wear-watchface/src/main/res/values-en-rIN/watchface_strings.xml
rename to wear/watchface/watchface/src/main/res/values-en-rIN/watchface_strings.xml
diff --git a/wear/wear-watchface/src/main/res/values-en-rXC/watchface_strings.xml b/wear/watchface/watchface/src/main/res/values-en-rXC/watchface_strings.xml
similarity index 100%
rename from wear/wear-watchface/src/main/res/values-en-rXC/watchface_strings.xml
rename to wear/watchface/watchface/src/main/res/values-en-rXC/watchface_strings.xml
diff --git a/wear/wear-watchface/src/main/res/values-es-rUS/watchface_strings.xml b/wear/watchface/watchface/src/main/res/values-es-rUS/watchface_strings.xml
similarity index 100%
rename from wear/wear-watchface/src/main/res/values-es-rUS/watchface_strings.xml
rename to wear/watchface/watchface/src/main/res/values-es-rUS/watchface_strings.xml
diff --git a/wear/wear-watchface/src/main/res/values-es/watchface_strings.xml b/wear/watchface/watchface/src/main/res/values-es/watchface_strings.xml
similarity index 100%
rename from wear/wear-watchface/src/main/res/values-es/watchface_strings.xml
rename to wear/watchface/watchface/src/main/res/values-es/watchface_strings.xml
diff --git a/wear/wear-watchface/src/main/res/values-et/watchface_strings.xml b/wear/watchface/watchface/src/main/res/values-et/watchface_strings.xml
similarity index 100%
rename from wear/wear-watchface/src/main/res/values-et/watchface_strings.xml
rename to wear/watchface/watchface/src/main/res/values-et/watchface_strings.xml
diff --git a/wear/wear-watchface/src/main/res/values-eu/watchface_strings.xml b/wear/watchface/watchface/src/main/res/values-eu/watchface_strings.xml
similarity index 100%
rename from wear/wear-watchface/src/main/res/values-eu/watchface_strings.xml
rename to wear/watchface/watchface/src/main/res/values-eu/watchface_strings.xml
diff --git a/wear/wear-watchface/src/main/res/values-fa/watchface_strings.xml b/wear/watchface/watchface/src/main/res/values-fa/watchface_strings.xml
similarity index 100%
rename from wear/wear-watchface/src/main/res/values-fa/watchface_strings.xml
rename to wear/watchface/watchface/src/main/res/values-fa/watchface_strings.xml
diff --git a/wear/wear-watchface/src/main/res/values-fi/watchface_strings.xml b/wear/watchface/watchface/src/main/res/values-fi/watchface_strings.xml
similarity index 100%
rename from wear/wear-watchface/src/main/res/values-fi/watchface_strings.xml
rename to wear/watchface/watchface/src/main/res/values-fi/watchface_strings.xml
diff --git a/wear/wear-watchface/src/main/res/values-fr-rCA/watchface_strings.xml b/wear/watchface/watchface/src/main/res/values-fr-rCA/watchface_strings.xml
similarity index 100%
rename from wear/wear-watchface/src/main/res/values-fr-rCA/watchface_strings.xml
rename to wear/watchface/watchface/src/main/res/values-fr-rCA/watchface_strings.xml
diff --git a/wear/wear-watchface/src/main/res/values-fr/watchface_strings.xml b/wear/watchface/watchface/src/main/res/values-fr/watchface_strings.xml
similarity index 100%
rename from wear/wear-watchface/src/main/res/values-fr/watchface_strings.xml
rename to wear/watchface/watchface/src/main/res/values-fr/watchface_strings.xml
diff --git a/wear/wear-watchface/src/main/res/values-gl/watchface_strings.xml b/wear/watchface/watchface/src/main/res/values-gl/watchface_strings.xml
similarity index 100%
rename from wear/wear-watchface/src/main/res/values-gl/watchface_strings.xml
rename to wear/watchface/watchface/src/main/res/values-gl/watchface_strings.xml
diff --git a/wear/wear-watchface/src/main/res/values-gu/watchface_strings.xml b/wear/watchface/watchface/src/main/res/values-gu/watchface_strings.xml
similarity index 100%
rename from wear/wear-watchface/src/main/res/values-gu/watchface_strings.xml
rename to wear/watchface/watchface/src/main/res/values-gu/watchface_strings.xml
diff --git a/wear/wear-watchface/src/main/res/values-hi/watchface_strings.xml b/wear/watchface/watchface/src/main/res/values-hi/watchface_strings.xml
similarity index 100%
rename from wear/wear-watchface/src/main/res/values-hi/watchface_strings.xml
rename to wear/watchface/watchface/src/main/res/values-hi/watchface_strings.xml
diff --git a/wear/wear-watchface/src/main/res/values-hr/watchface_strings.xml b/wear/watchface/watchface/src/main/res/values-hr/watchface_strings.xml
similarity index 100%
rename from wear/wear-watchface/src/main/res/values-hr/watchface_strings.xml
rename to wear/watchface/watchface/src/main/res/values-hr/watchface_strings.xml
diff --git a/wear/wear-watchface/src/main/res/values-hu/watchface_strings.xml b/wear/watchface/watchface/src/main/res/values-hu/watchface_strings.xml
similarity index 100%
rename from wear/wear-watchface/src/main/res/values-hu/watchface_strings.xml
rename to wear/watchface/watchface/src/main/res/values-hu/watchface_strings.xml
diff --git a/wear/wear-watchface/src/main/res/values-hy/watchface_strings.xml b/wear/watchface/watchface/src/main/res/values-hy/watchface_strings.xml
similarity index 100%
rename from wear/wear-watchface/src/main/res/values-hy/watchface_strings.xml
rename to wear/watchface/watchface/src/main/res/values-hy/watchface_strings.xml
diff --git a/wear/wear-watchface/src/main/res/values-in/watchface_strings.xml b/wear/watchface/watchface/src/main/res/values-in/watchface_strings.xml
similarity index 100%
rename from wear/wear-watchface/src/main/res/values-in/watchface_strings.xml
rename to wear/watchface/watchface/src/main/res/values-in/watchface_strings.xml
diff --git a/wear/wear-watchface/src/main/res/values-is/watchface_strings.xml b/wear/watchface/watchface/src/main/res/values-is/watchface_strings.xml
similarity index 100%
rename from wear/wear-watchface/src/main/res/values-is/watchface_strings.xml
rename to wear/watchface/watchface/src/main/res/values-is/watchface_strings.xml
diff --git a/wear/wear-watchface/src/main/res/values-it/watchface_strings.xml b/wear/watchface/watchface/src/main/res/values-it/watchface_strings.xml
similarity index 100%
rename from wear/wear-watchface/src/main/res/values-it/watchface_strings.xml
rename to wear/watchface/watchface/src/main/res/values-it/watchface_strings.xml
diff --git a/wear/wear-watchface/src/main/res/values-iw/watchface_strings.xml b/wear/watchface/watchface/src/main/res/values-iw/watchface_strings.xml
similarity index 100%
rename from wear/wear-watchface/src/main/res/values-iw/watchface_strings.xml
rename to wear/watchface/watchface/src/main/res/values-iw/watchface_strings.xml
diff --git a/wear/wear-watchface/src/main/res/values-ja/watchface_strings.xml b/wear/watchface/watchface/src/main/res/values-ja/watchface_strings.xml
similarity index 100%
rename from wear/wear-watchface/src/main/res/values-ja/watchface_strings.xml
rename to wear/watchface/watchface/src/main/res/values-ja/watchface_strings.xml
diff --git a/wear/wear-watchface/src/main/res/values-ka/watchface_strings.xml b/wear/watchface/watchface/src/main/res/values-ka/watchface_strings.xml
similarity index 100%
rename from wear/wear-watchface/src/main/res/values-ka/watchface_strings.xml
rename to wear/watchface/watchface/src/main/res/values-ka/watchface_strings.xml
diff --git a/wear/wear-watchface/src/main/res/values-kk/watchface_strings.xml b/wear/watchface/watchface/src/main/res/values-kk/watchface_strings.xml
similarity index 100%
rename from wear/wear-watchface/src/main/res/values-kk/watchface_strings.xml
rename to wear/watchface/watchface/src/main/res/values-kk/watchface_strings.xml
diff --git a/wear/wear-watchface/src/main/res/values-km/watchface_strings.xml b/wear/watchface/watchface/src/main/res/values-km/watchface_strings.xml
similarity index 100%
rename from wear/wear-watchface/src/main/res/values-km/watchface_strings.xml
rename to wear/watchface/watchface/src/main/res/values-km/watchface_strings.xml
diff --git a/wear/wear-watchface/src/main/res/values-kn/watchface_strings.xml b/wear/watchface/watchface/src/main/res/values-kn/watchface_strings.xml
similarity index 100%
rename from wear/wear-watchface/src/main/res/values-kn/watchface_strings.xml
rename to wear/watchface/watchface/src/main/res/values-kn/watchface_strings.xml
diff --git a/wear/wear-watchface/src/main/res/values-ko/watchface_strings.xml b/wear/watchface/watchface/src/main/res/values-ko/watchface_strings.xml
similarity index 100%
rename from wear/wear-watchface/src/main/res/values-ko/watchface_strings.xml
rename to wear/watchface/watchface/src/main/res/values-ko/watchface_strings.xml
diff --git a/wear/wear-watchface/src/main/res/values-ky/watchface_strings.xml b/wear/watchface/watchface/src/main/res/values-ky/watchface_strings.xml
similarity index 100%
rename from wear/wear-watchface/src/main/res/values-ky/watchface_strings.xml
rename to wear/watchface/watchface/src/main/res/values-ky/watchface_strings.xml
diff --git a/wear/wear-watchface/src/main/res/values-lo/watchface_strings.xml b/wear/watchface/watchface/src/main/res/values-lo/watchface_strings.xml
similarity index 100%
rename from wear/wear-watchface/src/main/res/values-lo/watchface_strings.xml
rename to wear/watchface/watchface/src/main/res/values-lo/watchface_strings.xml
diff --git a/wear/wear-watchface/src/main/res/values-lt/watchface_strings.xml b/wear/watchface/watchface/src/main/res/values-lt/watchface_strings.xml
similarity index 100%
rename from wear/wear-watchface/src/main/res/values-lt/watchface_strings.xml
rename to wear/watchface/watchface/src/main/res/values-lt/watchface_strings.xml
diff --git a/wear/wear-watchface/src/main/res/values-lv/watchface_strings.xml b/wear/watchface/watchface/src/main/res/values-lv/watchface_strings.xml
similarity index 100%
rename from wear/wear-watchface/src/main/res/values-lv/watchface_strings.xml
rename to wear/watchface/watchface/src/main/res/values-lv/watchface_strings.xml
diff --git a/wear/wear-watchface/src/main/res/values-mk/watchface_strings.xml b/wear/watchface/watchface/src/main/res/values-mk/watchface_strings.xml
similarity index 100%
rename from wear/wear-watchface/src/main/res/values-mk/watchface_strings.xml
rename to wear/watchface/watchface/src/main/res/values-mk/watchface_strings.xml
diff --git a/wear/wear-watchface/src/main/res/values-ml/watchface_strings.xml b/wear/watchface/watchface/src/main/res/values-ml/watchface_strings.xml
similarity index 100%
rename from wear/wear-watchface/src/main/res/values-ml/watchface_strings.xml
rename to wear/watchface/watchface/src/main/res/values-ml/watchface_strings.xml
diff --git a/wear/wear-watchface/src/main/res/values-mn/watchface_strings.xml b/wear/watchface/watchface/src/main/res/values-mn/watchface_strings.xml
similarity index 100%
rename from wear/wear-watchface/src/main/res/values-mn/watchface_strings.xml
rename to wear/watchface/watchface/src/main/res/values-mn/watchface_strings.xml
diff --git a/wear/wear-watchface/src/main/res/values-mr/watchface_strings.xml b/wear/watchface/watchface/src/main/res/values-mr/watchface_strings.xml
similarity index 100%
rename from wear/wear-watchface/src/main/res/values-mr/watchface_strings.xml
rename to wear/watchface/watchface/src/main/res/values-mr/watchface_strings.xml
diff --git a/wear/wear-watchface/src/main/res/values-ms/watchface_strings.xml b/wear/watchface/watchface/src/main/res/values-ms/watchface_strings.xml
similarity index 100%
rename from wear/wear-watchface/src/main/res/values-ms/watchface_strings.xml
rename to wear/watchface/watchface/src/main/res/values-ms/watchface_strings.xml
diff --git a/wear/wear-watchface/src/main/res/values-my/watchface_strings.xml b/wear/watchface/watchface/src/main/res/values-my/watchface_strings.xml
similarity index 100%
rename from wear/wear-watchface/src/main/res/values-my/watchface_strings.xml
rename to wear/watchface/watchface/src/main/res/values-my/watchface_strings.xml
diff --git a/wear/wear-watchface/src/main/res/values-nb/watchface_strings.xml b/wear/watchface/watchface/src/main/res/values-nb/watchface_strings.xml
similarity index 100%
rename from wear/wear-watchface/src/main/res/values-nb/watchface_strings.xml
rename to wear/watchface/watchface/src/main/res/values-nb/watchface_strings.xml
diff --git a/wear/wear-watchface/src/main/res/values-ne/watchface_strings.xml b/wear/watchface/watchface/src/main/res/values-ne/watchface_strings.xml
similarity index 100%
rename from wear/wear-watchface/src/main/res/values-ne/watchface_strings.xml
rename to wear/watchface/watchface/src/main/res/values-ne/watchface_strings.xml
diff --git a/wear/wear-watchface/src/main/res/values-nl/watchface_strings.xml b/wear/watchface/watchface/src/main/res/values-nl/watchface_strings.xml
similarity index 100%
rename from wear/wear-watchface/src/main/res/values-nl/watchface_strings.xml
rename to wear/watchface/watchface/src/main/res/values-nl/watchface_strings.xml
diff --git a/wear/wear-watchface/src/main/res/values-or/watchface_strings.xml b/wear/watchface/watchface/src/main/res/values-or/watchface_strings.xml
similarity index 100%
rename from wear/wear-watchface/src/main/res/values-or/watchface_strings.xml
rename to wear/watchface/watchface/src/main/res/values-or/watchface_strings.xml
diff --git a/wear/wear-watchface/src/main/res/values-pa/watchface_strings.xml b/wear/watchface/watchface/src/main/res/values-pa/watchface_strings.xml
similarity index 100%
rename from wear/wear-watchface/src/main/res/values-pa/watchface_strings.xml
rename to wear/watchface/watchface/src/main/res/values-pa/watchface_strings.xml
diff --git a/wear/wear-watchface/src/main/res/values-pl/watchface_strings.xml b/wear/watchface/watchface/src/main/res/values-pl/watchface_strings.xml
similarity index 100%
rename from wear/wear-watchface/src/main/res/values-pl/watchface_strings.xml
rename to wear/watchface/watchface/src/main/res/values-pl/watchface_strings.xml
diff --git a/wear/wear-watchface/src/main/res/values-pt-rBR/watchface_strings.xml b/wear/watchface/watchface/src/main/res/values-pt-rBR/watchface_strings.xml
similarity index 100%
rename from wear/wear-watchface/src/main/res/values-pt-rBR/watchface_strings.xml
rename to wear/watchface/watchface/src/main/res/values-pt-rBR/watchface_strings.xml
diff --git a/wear/wear-watchface/src/main/res/values-pt-rPT/watchface_strings.xml b/wear/watchface/watchface/src/main/res/values-pt-rPT/watchface_strings.xml
similarity index 100%
rename from wear/wear-watchface/src/main/res/values-pt-rPT/watchface_strings.xml
rename to wear/watchface/watchface/src/main/res/values-pt-rPT/watchface_strings.xml
diff --git a/wear/wear-watchface/src/main/res/values-pt/watchface_strings.xml b/wear/watchface/watchface/src/main/res/values-pt/watchface_strings.xml
similarity index 100%
rename from wear/wear-watchface/src/main/res/values-pt/watchface_strings.xml
rename to wear/watchface/watchface/src/main/res/values-pt/watchface_strings.xml
diff --git a/wear/wear-watchface/src/main/res/values-ro/watchface_strings.xml b/wear/watchface/watchface/src/main/res/values-ro/watchface_strings.xml
similarity index 100%
rename from wear/wear-watchface/src/main/res/values-ro/watchface_strings.xml
rename to wear/watchface/watchface/src/main/res/values-ro/watchface_strings.xml
diff --git a/wear/wear-watchface/src/main/res/values-ru/watchface_strings.xml b/wear/watchface/watchface/src/main/res/values-ru/watchface_strings.xml
similarity index 100%
rename from wear/wear-watchface/src/main/res/values-ru/watchface_strings.xml
rename to wear/watchface/watchface/src/main/res/values-ru/watchface_strings.xml
diff --git a/wear/wear-watchface/src/main/res/values-si/watchface_strings.xml b/wear/watchface/watchface/src/main/res/values-si/watchface_strings.xml
similarity index 100%
rename from wear/wear-watchface/src/main/res/values-si/watchface_strings.xml
rename to wear/watchface/watchface/src/main/res/values-si/watchface_strings.xml
diff --git a/wear/wear-watchface/src/main/res/values-sk/watchface_strings.xml b/wear/watchface/watchface/src/main/res/values-sk/watchface_strings.xml
similarity index 100%
rename from wear/wear-watchface/src/main/res/values-sk/watchface_strings.xml
rename to wear/watchface/watchface/src/main/res/values-sk/watchface_strings.xml
diff --git a/wear/wear-watchface/src/main/res/values-sl/watchface_strings.xml b/wear/watchface/watchface/src/main/res/values-sl/watchface_strings.xml
similarity index 100%
rename from wear/wear-watchface/src/main/res/values-sl/watchface_strings.xml
rename to wear/watchface/watchface/src/main/res/values-sl/watchface_strings.xml
diff --git a/wear/wear-watchface/src/main/res/values-sq/watchface_strings.xml b/wear/watchface/watchface/src/main/res/values-sq/watchface_strings.xml
similarity index 100%
rename from wear/wear-watchface/src/main/res/values-sq/watchface_strings.xml
rename to wear/watchface/watchface/src/main/res/values-sq/watchface_strings.xml
diff --git a/wear/wear-watchface/src/main/res/values-sr/watchface_strings.xml b/wear/watchface/watchface/src/main/res/values-sr/watchface_strings.xml
similarity index 100%
rename from wear/wear-watchface/src/main/res/values-sr/watchface_strings.xml
rename to wear/watchface/watchface/src/main/res/values-sr/watchface_strings.xml
diff --git a/wear/wear-watchface/src/main/res/values-sv/watchface_strings.xml b/wear/watchface/watchface/src/main/res/values-sv/watchface_strings.xml
similarity index 100%
rename from wear/wear-watchface/src/main/res/values-sv/watchface_strings.xml
rename to wear/watchface/watchface/src/main/res/values-sv/watchface_strings.xml
diff --git a/wear/wear-watchface/src/main/res/values-sw/watchface_strings.xml b/wear/watchface/watchface/src/main/res/values-sw/watchface_strings.xml
similarity index 100%
rename from wear/wear-watchface/src/main/res/values-sw/watchface_strings.xml
rename to wear/watchface/watchface/src/main/res/values-sw/watchface_strings.xml
diff --git a/wear/wear-watchface/src/main/res/values-ta/watchface_strings.xml b/wear/watchface/watchface/src/main/res/values-ta/watchface_strings.xml
similarity index 100%
rename from wear/wear-watchface/src/main/res/values-ta/watchface_strings.xml
rename to wear/watchface/watchface/src/main/res/values-ta/watchface_strings.xml
diff --git a/wear/wear-watchface/src/main/res/values-te/watchface_strings.xml b/wear/watchface/watchface/src/main/res/values-te/watchface_strings.xml
similarity index 100%
rename from wear/wear-watchface/src/main/res/values-te/watchface_strings.xml
rename to wear/watchface/watchface/src/main/res/values-te/watchface_strings.xml
diff --git a/wear/wear-watchface/src/main/res/values-th/watchface_strings.xml b/wear/watchface/watchface/src/main/res/values-th/watchface_strings.xml
similarity index 100%
rename from wear/wear-watchface/src/main/res/values-th/watchface_strings.xml
rename to wear/watchface/watchface/src/main/res/values-th/watchface_strings.xml
diff --git a/wear/wear-watchface/src/main/res/values-tl/watchface_strings.xml b/wear/watchface/watchface/src/main/res/values-tl/watchface_strings.xml
similarity index 100%
rename from wear/wear-watchface/src/main/res/values-tl/watchface_strings.xml
rename to wear/watchface/watchface/src/main/res/values-tl/watchface_strings.xml
diff --git a/wear/wear-watchface/src/main/res/values-tr/watchface_strings.xml b/wear/watchface/watchface/src/main/res/values-tr/watchface_strings.xml
similarity index 100%
rename from wear/wear-watchface/src/main/res/values-tr/watchface_strings.xml
rename to wear/watchface/watchface/src/main/res/values-tr/watchface_strings.xml
diff --git a/wear/wear-watchface/src/main/res/values-uk/watchface_strings.xml b/wear/watchface/watchface/src/main/res/values-uk/watchface_strings.xml
similarity index 100%
rename from wear/wear-watchface/src/main/res/values-uk/watchface_strings.xml
rename to wear/watchface/watchface/src/main/res/values-uk/watchface_strings.xml
diff --git a/wear/wear-watchface/src/main/res/values-ur/watchface_strings.xml b/wear/watchface/watchface/src/main/res/values-ur/watchface_strings.xml
similarity index 100%
rename from wear/wear-watchface/src/main/res/values-ur/watchface_strings.xml
rename to wear/watchface/watchface/src/main/res/values-ur/watchface_strings.xml
diff --git a/wear/wear-watchface/src/main/res/values-uz/watchface_strings.xml b/wear/watchface/watchface/src/main/res/values-uz/watchface_strings.xml
similarity index 100%
rename from wear/wear-watchface/src/main/res/values-uz/watchface_strings.xml
rename to wear/watchface/watchface/src/main/res/values-uz/watchface_strings.xml
diff --git a/wear/wear-watchface/src/main/res/values-v30/config.xml b/wear/watchface/watchface/src/main/res/values-v30/config.xml
similarity index 100%
rename from wear/wear-watchface/src/main/res/values-v30/config.xml
rename to wear/watchface/watchface/src/main/res/values-v30/config.xml
diff --git a/wear/wear-watchface/src/main/res/values-vi/watchface_strings.xml b/wear/watchface/watchface/src/main/res/values-vi/watchface_strings.xml
similarity index 100%
rename from wear/wear-watchface/src/main/res/values-vi/watchface_strings.xml
rename to wear/watchface/watchface/src/main/res/values-vi/watchface_strings.xml
diff --git a/wear/wear-watchface/src/main/res/values-zh-rCN/watchface_strings.xml b/wear/watchface/watchface/src/main/res/values-zh-rCN/watchface_strings.xml
similarity index 100%
rename from wear/wear-watchface/src/main/res/values-zh-rCN/watchface_strings.xml
rename to wear/watchface/watchface/src/main/res/values-zh-rCN/watchface_strings.xml
diff --git a/wear/wear-watchface/src/main/res/values-zh-rHK/watchface_strings.xml b/wear/watchface/watchface/src/main/res/values-zh-rHK/watchface_strings.xml
similarity index 100%
rename from wear/wear-watchface/src/main/res/values-zh-rHK/watchface_strings.xml
rename to wear/watchface/watchface/src/main/res/values-zh-rHK/watchface_strings.xml
diff --git a/wear/wear-watchface/src/main/res/values-zh-rTW/watchface_strings.xml b/wear/watchface/watchface/src/main/res/values-zh-rTW/watchface_strings.xml
similarity index 100%
rename from wear/wear-watchface/src/main/res/values-zh-rTW/watchface_strings.xml
rename to wear/watchface/watchface/src/main/res/values-zh-rTW/watchface_strings.xml
diff --git a/wear/wear-watchface/src/main/res/values-zu/watchface_strings.xml b/wear/watchface/watchface/src/main/res/values-zu/watchface_strings.xml
similarity index 100%
rename from wear/wear-watchface/src/main/res/values-zu/watchface_strings.xml
rename to wear/watchface/watchface/src/main/res/values-zu/watchface_strings.xml
diff --git a/wear/wear-watchface/src/main/res/values/config.xml b/wear/watchface/watchface/src/main/res/values/config.xml
similarity index 100%
rename from wear/wear-watchface/src/main/res/values/config.xml
rename to wear/watchface/watchface/src/main/res/values/config.xml
diff --git a/wear/wear-watchface/src/main/res/values/watchface_strings.xml b/wear/watchface/watchface/src/main/res/values/watchface_strings.xml
similarity index 100%
rename from wear/wear-watchface/src/main/res/values/watchface_strings.xml
rename to wear/watchface/watchface/src/main/res/values/watchface_strings.xml
diff --git a/wear/wear-watchface/src/test/java/androidx/wear/watchface/AsyncWatchFaceInitTest.kt b/wear/watchface/watchface/src/test/java/androidx/wear/watchface/AsyncWatchFaceInitTest.kt
similarity index 100%
rename from wear/wear-watchface/src/test/java/androidx/wear/watchface/AsyncWatchFaceInitTest.kt
rename to wear/watchface/watchface/src/test/java/androidx/wear/watchface/AsyncWatchFaceInitTest.kt
diff --git a/wear/wear-watchface/src/test/java/androidx/wear/watchface/RenderParametersTest.kt b/wear/watchface/watchface/src/test/java/androidx/wear/watchface/RenderParametersTest.kt
similarity index 100%
rename from wear/wear-watchface/src/test/java/androidx/wear/watchface/RenderParametersTest.kt
rename to wear/watchface/watchface/src/test/java/androidx/wear/watchface/RenderParametersTest.kt
diff --git a/wear/wear-watchface/src/test/java/androidx/wear/watchface/TestCommon.kt b/wear/watchface/watchface/src/test/java/androidx/wear/watchface/TestCommon.kt
similarity index 97%
rename from wear/wear-watchface/src/test/java/androidx/wear/watchface/TestCommon.kt
rename to wear/watchface/watchface/src/test/java/androidx/wear/watchface/TestCommon.kt
index 9f6396f..6f13864 100644
--- a/wear/wear-watchface/src/test/java/androidx/wear/watchface/TestCommon.kt
+++ b/wear/watchface/watchface/src/test/java/androidx/wear/watchface/TestCommon.kt
@@ -30,7 +30,7 @@
import android.support.wearable.watchface.accessibility.ContentDescriptionLabel
import android.view.SurfaceHolder
import androidx.test.core.app.ApplicationProvider
-import androidx.wear.complications.data.toApiComplicationData
+import androidx.wear.watchface.complications.data.toApiComplicationData
import androidx.wear.watchface.control.data.WallpaperInteractiveWatchFaceInstanceParams
import androidx.wear.watchface.style.CurrentUserStyleRepository
import androidx.wear.watchface.style.UserStyleSchema
@@ -243,7 +243,7 @@
override fun shouldAnimate(): Boolean = animate
}
-public fun createComplicationData(): androidx.wear.complications.data.ComplicationData =
+public fun createComplicationData(): androidx.wear.watchface.complications.data.ComplicationData =
ComplicationData.Builder(ComplicationData.TYPE_SHORT_TEXT)
.setShortText(ComplicationText.plainText("Test Text"))
.setTapAction(
@@ -260,7 +260,7 @@
override fun createClassLoaderConfig(method: FrameworkMethod): InstrumentationConfiguration =
InstrumentationConfiguration.Builder(super.createClassLoaderConfig(method))
.doNotInstrumentPackage("android.support.wearable.watchface")
- .doNotInstrumentPackage("androidx.wear.complicationSlots")
+ .doNotInstrumentPackage("androidx.wear.watchface.complicationSlots")
.doNotInstrumentPackage("androidx.wear.utility")
.doNotInstrumentPackage("androidx.wear.watchface")
.doNotInstrumentPackage("androidx.wear.watchface.ui")
diff --git a/wear/wear-watchface/src/test/java/androidx/wear/watchface/WatchFaceServiceTest.kt b/wear/watchface/watchface/src/test/java/androidx/wear/watchface/WatchFaceServiceTest.kt
similarity index 98%
rename from wear/wear-watchface/src/test/java/androidx/wear/watchface/WatchFaceServiceTest.kt
rename to wear/watchface/watchface/src/test/java/androidx/wear/watchface/WatchFaceServiceTest.kt
index ffba020..be7c6d3 100644
--- a/wear/wear-watchface/src/test/java/androidx/wear/watchface/WatchFaceServiceTest.kt
+++ b/wear/watchface/watchface/src/test/java/androidx/wear/watchface/WatchFaceServiceTest.kt
@@ -45,14 +45,14 @@
import androidx.annotation.RequiresApi
import androidx.test.core.app.ApplicationProvider
import androidx.test.filters.SdkSuppress
-import androidx.wear.complications.ComplicationSlotBounds
-import androidx.wear.complications.DefaultComplicationDataSourcePolicy
-import androidx.wear.complications.SystemDataSources
-import androidx.wear.complications.data.ComplicationType
-import androidx.wear.complications.data.EmptyComplicationData
-import androidx.wear.complications.data.NoDataComplicationData
-import androidx.wear.complications.data.PlainComplicationText
-import androidx.wear.complications.data.ShortTextComplicationData
+import androidx.wear.watchface.complications.ComplicationSlotBounds
+import androidx.wear.watchface.complications.DefaultComplicationDataSourcePolicy
+import androidx.wear.watchface.complications.SystemDataSources
+import androidx.wear.watchface.complications.data.ComplicationType
+import androidx.wear.watchface.complications.data.EmptyComplicationData
+import androidx.wear.watchface.complications.data.NoDataComplicationData
+import androidx.wear.watchface.complications.data.PlainComplicationText
+import androidx.wear.watchface.complications.data.ShortTextComplicationData
import androidx.wear.watchface.complications.rendering.CanvasComplicationDrawable
import androidx.wear.watchface.complications.rendering.ComplicationDrawable
import androidx.wear.watchface.control.IInteractiveWatchFace
@@ -1168,10 +1168,12 @@
)
// This should get persisted.
- currentUserStyleRepository.userStyle.value = UserStyle(
- hashMapOf(
- colorStyleSetting to blueStyleOption,
- watchHandStyleSetting to gothicStyleOption
+ currentUserStyleRepository.updateUserStyle(
+ UserStyle(
+ hashMapOf(
+ colorStyleSetting to blueStyleOption,
+ watchHandStyleSetting to gothicStyleOption
+ )
)
)
engineWrapper.onDestroy()
@@ -1547,10 +1549,11 @@
) // Right complication.
// Change the style
- watchFaceImpl.currentUserStyleRepository.userStyle.value =
+ watchFaceImpl.currentUserStyleRepository.updateUserStyle(
watchFaceImpl.currentUserStyleRepository.userStyle.value.toMutableUserStyle().apply {
this[complicationsStyleSetting] = rightAndSelectComplicationsOption
}.toUserStyle()
+ )
runPostedTasksFor(0)
val contentDescriptionLabels2 = engineWrapper.contentDescriptionLabels
@@ -1898,7 +1901,7 @@
// Select a new style which turns off both complicationSlots.
val mutableUserStyleA = currentUserStyleRepository.userStyle.value.toMutableUserStyle()
mutableUserStyleA[complicationsStyleSetting] = noComplicationsOption
- currentUserStyleRepository.userStyle.value = mutableUserStyleA.toUserStyle()
+ currentUserStyleRepository.updateUserStyle(mutableUserStyleA.toUserStyle())
assertFalse(leftComplication.enabled)
assertFalse(rightComplication.enabled)
@@ -1914,7 +1917,7 @@
// Select a new style which turns on only the left complication.
val mutableUserStyleB = currentUserStyleRepository.userStyle.value.toMutableUserStyle()
mutableUserStyleB[complicationsStyleSetting] = leftComplicationsOption
- currentUserStyleRepository.userStyle.value = mutableUserStyleB.toUserStyle()
+ currentUserStyleRepository.updateUserStyle(mutableUserStyleB.toUserStyle())
assertTrue(leftComplication.enabled)
assertFalse(rightComplication.enabled)
@@ -1974,7 +1977,7 @@
// Select left complication only.
val mutableUserStyleA = currentUserStyleRepository.userStyle.value.toMutableUserStyle()
mutableUserStyleA[complicationsStyleSetting] = leftOnlyComplicationsOption
- currentUserStyleRepository.userStyle.value = mutableUserStyleA.toUserStyle()
+ currentUserStyleRepository.updateUserStyle(mutableUserStyleA.toUserStyle())
runPostedTasksFor(0)
@@ -1984,7 +1987,7 @@
// Select right complication only.
val mutableUserStyleB = currentUserStyleRepository.userStyle.value.toMutableUserStyle()
mutableUserStyleB[complicationsStyleSetting] = rightOnlyComplicationsOption
- currentUserStyleRepository.userStyle.value = mutableUserStyleB.toUserStyle()
+ currentUserStyleRepository.updateUserStyle(mutableUserStyleB.toUserStyle())
runPostedTasksFor(0)
@@ -1994,7 +1997,7 @@
// Select both complicationSlots.
val mutableUserStyleC = currentUserStyleRepository.userStyle.value.toMutableUserStyle()
mutableUserStyleC[complicationsStyleSetting] = bothComplicationsOption
- currentUserStyleRepository.userStyle.value = mutableUserStyleC.toUserStyle()
+ currentUserStyleRepository.updateUserStyle(mutableUserStyleC.toUserStyle())
runPostedTasksFor(0)
@@ -2791,7 +2794,7 @@
// Select a style which changes the bounds of the right complication.
val mutableUserStyle = currentUserStyleRepository.userStyle.value.toMutableUserStyle()
mutableUserStyle[complicationsStyleSetting] = rightComplicationBoundsOption
- currentUserStyleRepository.userStyle.value = mutableUserStyle.toUserStyle()
+ currentUserStyleRepository.updateUserStyle(mutableUserStyle.toUserStyle())
complicationDetails = watchFaceImpl.getComplicationState()
assertThat(complicationDetails[1].id).isEqualTo(RIGHT_COMPLICATION_ID)
diff --git a/wear/wear-watchface/src/test/java/androidx/wear/watchface/WatchStateTest.kt b/wear/watchface/watchface/src/test/java/androidx/wear/watchface/WatchStateTest.kt
similarity index 100%
rename from wear/wear-watchface/src/test/java/androidx/wear/watchface/WatchStateTest.kt
rename to wear/watchface/watchface/src/test/java/androidx/wear/watchface/WatchStateTest.kt
diff --git a/wear/wear-watchface/src/test/resources/robolectric.properties b/wear/watchface/watchface/src/test/resources/robolectric.properties
similarity index 100%
rename from wear/wear-watchface/src/test/resources/robolectric.properties
rename to wear/watchface/watchface/src/test/resources/robolectric.properties
diff --git a/wear/wear-complications-data-source-ktx/api/current.txt b/wear/wear-complications-data-source-ktx/api/current.txt
deleted file mode 100644
index 874628e..0000000
--- a/wear/wear-complications-data-source-ktx/api/current.txt
+++ /dev/null
@@ -1,11 +0,0 @@
-// Signature format: 4.0
-package androidx.wear.complications.datasource {
-
- public abstract class SuspendingComplicationDataSourceService extends androidx.wear.complications.datasource.ComplicationDataSourceService {
- ctor public SuspendingComplicationDataSourceService();
- method public final void onComplicationRequest(androidx.wear.complications.datasource.ComplicationRequest request, androidx.wear.complications.datasource.ComplicationDataSourceService.ComplicationRequestListener listener);
- method @UiThread public abstract suspend Object? onComplicationRequest(androidx.wear.complications.datasource.ComplicationRequest request, kotlin.coroutines.Continuation<? super androidx.wear.complications.data.ComplicationData> p);
- }
-
-}
-
diff --git a/wear/wear-complications-data-source-ktx/api/public_plus_experimental_current.txt b/wear/wear-complications-data-source-ktx/api/public_plus_experimental_current.txt
deleted file mode 100644
index 874628e..0000000
--- a/wear/wear-complications-data-source-ktx/api/public_plus_experimental_current.txt
+++ /dev/null
@@ -1,11 +0,0 @@
-// Signature format: 4.0
-package androidx.wear.complications.datasource {
-
- public abstract class SuspendingComplicationDataSourceService extends androidx.wear.complications.datasource.ComplicationDataSourceService {
- ctor public SuspendingComplicationDataSourceService();
- method public final void onComplicationRequest(androidx.wear.complications.datasource.ComplicationRequest request, androidx.wear.complications.datasource.ComplicationDataSourceService.ComplicationRequestListener listener);
- method @UiThread public abstract suspend Object? onComplicationRequest(androidx.wear.complications.datasource.ComplicationRequest request, kotlin.coroutines.Continuation<? super androidx.wear.complications.data.ComplicationData> p);
- }
-
-}
-
diff --git a/wear/wear-complications-data-source-ktx/api/restricted_current.txt b/wear/wear-complications-data-source-ktx/api/restricted_current.txt
deleted file mode 100644
index 874628e..0000000
--- a/wear/wear-complications-data-source-ktx/api/restricted_current.txt
+++ /dev/null
@@ -1,11 +0,0 @@
-// Signature format: 4.0
-package androidx.wear.complications.datasource {
-
- public abstract class SuspendingComplicationDataSourceService extends androidx.wear.complications.datasource.ComplicationDataSourceService {
- ctor public SuspendingComplicationDataSourceService();
- method public final void onComplicationRequest(androidx.wear.complications.datasource.ComplicationRequest request, androidx.wear.complications.datasource.ComplicationDataSourceService.ComplicationRequestListener listener);
- method @UiThread public abstract suspend Object? onComplicationRequest(androidx.wear.complications.datasource.ComplicationRequest request, kotlin.coroutines.Continuation<? super androidx.wear.complications.data.ComplicationData> p);
- }
-
-}
-
diff --git a/wear/wear-complications-data-source/api/current.txt b/wear/wear-complications-data-source/api/current.txt
deleted file mode 100644
index fec91f0..0000000
--- a/wear/wear-complications-data-source/api/current.txt
+++ /dev/null
@@ -1,50 +0,0 @@
-// Signature format: 4.0
-package androidx.wear.complications.datasource {
-
- public abstract class ComplicationDataSourceService extends android.app.Service {
- ctor public ComplicationDataSourceService();
- method public abstract androidx.wear.complications.data.ComplicationData? getPreviewData(androidx.wear.complications.data.ComplicationType type);
- method public final android.os.IBinder? onBind(android.content.Intent intent);
- method @UiThread public void onComplicationActivated(int complicationInstanceId, androidx.wear.complications.data.ComplicationType type);
- method @UiThread public void onComplicationDeactivated(int complicationInstanceId);
- method @UiThread public abstract void onComplicationRequest(androidx.wear.complications.datasource.ComplicationRequest request, androidx.wear.complications.datasource.ComplicationDataSourceService.ComplicationRequestListener listener);
- field public static final String ACTION_COMPLICATION_UPDATE_REQUEST = "android.support.wearable.complications.ACTION_COMPLICATION_UPDATE_REQUEST";
- field public static final String CATEGORY_DATA_SOURCE_CONFIG = "android.support.wearable.complications.category.PROVIDER_CONFIG";
- field public static final androidx.wear.complications.datasource.ComplicationDataSourceService.Companion Companion;
- field public static final String EXTRA_CONFIG_COMPLICATION_ID = "android.support.wearable.complications.EXTRA_CONFIG_COMPLICATION_ID";
- field public static final String EXTRA_CONFIG_COMPLICATION_TYPE = "android.support.wearable.complications.EXTRA_CONFIG_COMPLICATION_TYPE";
- field public static final String EXTRA_CONFIG_DATA_SOURCE_COMPONENT = "android.support.wearable.complications.EXTRA_CONFIG_PROVIDER_COMPONENT";
- field public static final String METADATA_KEY_DATA_SOURCE_CONFIG_ACTION = "android.support.wearable.complications.PROVIDER_CONFIG_ACTION";
- field public static final String METADATA_KEY_SAFE_WATCH_FACES = "android.support.wearable.complications.SAFE_WATCH_FACES";
- field public static final String METADATA_KEY_SUPPORTED_TYPES = "android.support.wearable.complications.SUPPORTED_TYPES";
- field public static final String METADATA_KEY_UPDATE_PERIOD_SECONDS = "android.support.wearable.complications.UPDATE_PERIOD_SECONDS";
- }
-
- public static final class ComplicationDataSourceService.Companion {
- }
-
- public static interface ComplicationDataSourceService.ComplicationRequestListener {
- method @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public void onComplicationData(androidx.wear.complications.data.ComplicationData? complicationData) throws android.os.RemoteException;
- }
-
- public interface ComplicationDataSourceUpdateRequester {
- method public default static androidx.wear.complications.datasource.ComplicationDataSourceUpdateRequester create(android.content.Context context, android.content.ComponentName complicationDataSourceComponent);
- method public void requestUpdate(int... complicationInstanceIds);
- method public void requestUpdateAll();
- field public static final androidx.wear.complications.datasource.ComplicationDataSourceUpdateRequester.Companion Companion;
- }
-
- public static final class ComplicationDataSourceUpdateRequester.Companion {
- method public androidx.wear.complications.datasource.ComplicationDataSourceUpdateRequester create(android.content.Context context, android.content.ComponentName complicationDataSourceComponent);
- }
-
- public final class ComplicationRequest {
- ctor public ComplicationRequest(int complicationInstanceId, androidx.wear.complications.data.ComplicationType complicationType);
- method public int getComplicationInstanceId();
- method public androidx.wear.complications.data.ComplicationType getComplicationType();
- property public final int complicationInstanceId;
- property public final androidx.wear.complications.data.ComplicationType complicationType;
- }
-
-}
-
diff --git a/wear/wear-complications-data-source/api/public_plus_experimental_current.txt b/wear/wear-complications-data-source/api/public_plus_experimental_current.txt
deleted file mode 100644
index fec91f0..0000000
--- a/wear/wear-complications-data-source/api/public_plus_experimental_current.txt
+++ /dev/null
@@ -1,50 +0,0 @@
-// Signature format: 4.0
-package androidx.wear.complications.datasource {
-
- public abstract class ComplicationDataSourceService extends android.app.Service {
- ctor public ComplicationDataSourceService();
- method public abstract androidx.wear.complications.data.ComplicationData? getPreviewData(androidx.wear.complications.data.ComplicationType type);
- method public final android.os.IBinder? onBind(android.content.Intent intent);
- method @UiThread public void onComplicationActivated(int complicationInstanceId, androidx.wear.complications.data.ComplicationType type);
- method @UiThread public void onComplicationDeactivated(int complicationInstanceId);
- method @UiThread public abstract void onComplicationRequest(androidx.wear.complications.datasource.ComplicationRequest request, androidx.wear.complications.datasource.ComplicationDataSourceService.ComplicationRequestListener listener);
- field public static final String ACTION_COMPLICATION_UPDATE_REQUEST = "android.support.wearable.complications.ACTION_COMPLICATION_UPDATE_REQUEST";
- field public static final String CATEGORY_DATA_SOURCE_CONFIG = "android.support.wearable.complications.category.PROVIDER_CONFIG";
- field public static final androidx.wear.complications.datasource.ComplicationDataSourceService.Companion Companion;
- field public static final String EXTRA_CONFIG_COMPLICATION_ID = "android.support.wearable.complications.EXTRA_CONFIG_COMPLICATION_ID";
- field public static final String EXTRA_CONFIG_COMPLICATION_TYPE = "android.support.wearable.complications.EXTRA_CONFIG_COMPLICATION_TYPE";
- field public static final String EXTRA_CONFIG_DATA_SOURCE_COMPONENT = "android.support.wearable.complications.EXTRA_CONFIG_PROVIDER_COMPONENT";
- field public static final String METADATA_KEY_DATA_SOURCE_CONFIG_ACTION = "android.support.wearable.complications.PROVIDER_CONFIG_ACTION";
- field public static final String METADATA_KEY_SAFE_WATCH_FACES = "android.support.wearable.complications.SAFE_WATCH_FACES";
- field public static final String METADATA_KEY_SUPPORTED_TYPES = "android.support.wearable.complications.SUPPORTED_TYPES";
- field public static final String METADATA_KEY_UPDATE_PERIOD_SECONDS = "android.support.wearable.complications.UPDATE_PERIOD_SECONDS";
- }
-
- public static final class ComplicationDataSourceService.Companion {
- }
-
- public static interface ComplicationDataSourceService.ComplicationRequestListener {
- method @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public void onComplicationData(androidx.wear.complications.data.ComplicationData? complicationData) throws android.os.RemoteException;
- }
-
- public interface ComplicationDataSourceUpdateRequester {
- method public default static androidx.wear.complications.datasource.ComplicationDataSourceUpdateRequester create(android.content.Context context, android.content.ComponentName complicationDataSourceComponent);
- method public void requestUpdate(int... complicationInstanceIds);
- method public void requestUpdateAll();
- field public static final androidx.wear.complications.datasource.ComplicationDataSourceUpdateRequester.Companion Companion;
- }
-
- public static final class ComplicationDataSourceUpdateRequester.Companion {
- method public androidx.wear.complications.datasource.ComplicationDataSourceUpdateRequester create(android.content.Context context, android.content.ComponentName complicationDataSourceComponent);
- }
-
- public final class ComplicationRequest {
- ctor public ComplicationRequest(int complicationInstanceId, androidx.wear.complications.data.ComplicationType complicationType);
- method public int getComplicationInstanceId();
- method public androidx.wear.complications.data.ComplicationType getComplicationType();
- property public final int complicationInstanceId;
- property public final androidx.wear.complications.data.ComplicationType complicationType;
- }
-
-}
-
diff --git a/wear/wear-complications-data-source/api/restricted_current.txt b/wear/wear-complications-data-source/api/restricted_current.txt
deleted file mode 100644
index df3765a..0000000
--- a/wear/wear-complications-data-source/api/restricted_current.txt
+++ /dev/null
@@ -1,60 +0,0 @@
-// Signature format: 4.0
-package androidx.wear.complications.datasource {
-
- public abstract class ComplicationDataSourceService extends android.app.Service {
- ctor public ComplicationDataSourceService();
- method public abstract androidx.wear.complications.data.ComplicationData? getPreviewData(androidx.wear.complications.data.ComplicationType type);
- method public final android.os.IBinder? onBind(android.content.Intent intent);
- method @UiThread public void onComplicationActivated(int complicationInstanceId, androidx.wear.complications.data.ComplicationType type);
- method @UiThread public void onComplicationDeactivated(int complicationInstanceId);
- method @UiThread public abstract void onComplicationRequest(androidx.wear.complications.datasource.ComplicationRequest request, androidx.wear.complications.datasource.ComplicationDataSourceService.ComplicationRequestListener listener);
- field public static final String ACTION_COMPLICATION_UPDATE_REQUEST = "android.support.wearable.complications.ACTION_COMPLICATION_UPDATE_REQUEST";
- field public static final String CATEGORY_DATA_SOURCE_CONFIG = "android.support.wearable.complications.category.PROVIDER_CONFIG";
- field public static final androidx.wear.complications.datasource.ComplicationDataSourceService.Companion Companion;
- field public static final String EXTRA_CONFIG_COMPLICATION_ID = "android.support.wearable.complications.EXTRA_CONFIG_COMPLICATION_ID";
- field public static final String EXTRA_CONFIG_COMPLICATION_TYPE = "android.support.wearable.complications.EXTRA_CONFIG_COMPLICATION_TYPE";
- field public static final String EXTRA_CONFIG_DATA_SOURCE_COMPONENT = "android.support.wearable.complications.EXTRA_CONFIG_PROVIDER_COMPONENT";
- field public static final String METADATA_KEY_DATA_SOURCE_CONFIG_ACTION = "android.support.wearable.complications.PROVIDER_CONFIG_ACTION";
- field public static final String METADATA_KEY_SAFE_WATCH_FACES = "android.support.wearable.complications.SAFE_WATCH_FACES";
- field public static final String METADATA_KEY_SUPPORTED_TYPES = "android.support.wearable.complications.SUPPORTED_TYPES";
- field public static final String METADATA_KEY_UPDATE_PERIOD_SECONDS = "android.support.wearable.complications.UPDATE_PERIOD_SECONDS";
- }
-
- public static final class ComplicationDataSourceService.Companion {
- }
-
- public static interface ComplicationDataSourceService.ComplicationRequestListener {
- method @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public void onComplicationData(androidx.wear.complications.data.ComplicationData? complicationData) throws android.os.RemoteException;
- }
-
- public interface ComplicationDataSourceUpdateRequester {
- method public default static androidx.wear.complications.datasource.ComplicationDataSourceUpdateRequester create(android.content.Context context, android.content.ComponentName complicationDataSourceComponent);
- method public void requestUpdate(int... complicationInstanceIds);
- method public void requestUpdateAll();
- field @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public static final String ACTION_REQUEST_UPDATE = "android.support.wearable.complications.ACTION_REQUEST_UPDATE";
- field @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public static final String ACTION_REQUEST_UPDATE_ALL = "android.support.wearable.complications.ACTION_REQUEST_UPDATE_ALL";
- field public static final androidx.wear.complications.datasource.ComplicationDataSourceUpdateRequester.Companion Companion;
- field @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public static final String EXTRA_COMPLICATION_IDS = "android.support.wearable.complications.EXTRA_COMPLICATION_IDS";
- field @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public static final String EXTRA_PROVIDER_COMPONENT = "android.support.wearable.complications.EXTRA_PROVIDER_COMPONENT";
- field @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public static final String UPDATE_REQUEST_RECEIVER_PACKAGE = "com.google.android.wearable.app";
- }
-
- public static final class ComplicationDataSourceUpdateRequester.Companion {
- method public androidx.wear.complications.datasource.ComplicationDataSourceUpdateRequester create(android.content.Context context, android.content.ComponentName complicationDataSourceComponent);
- field @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public static final String ACTION_REQUEST_UPDATE = "android.support.wearable.complications.ACTION_REQUEST_UPDATE";
- field @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public static final String ACTION_REQUEST_UPDATE_ALL = "android.support.wearable.complications.ACTION_REQUEST_UPDATE_ALL";
- field @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public static final String EXTRA_COMPLICATION_IDS = "android.support.wearable.complications.EXTRA_COMPLICATION_IDS";
- field @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public static final String EXTRA_PROVIDER_COMPONENT = "android.support.wearable.complications.EXTRA_PROVIDER_COMPONENT";
- field @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public static final String UPDATE_REQUEST_RECEIVER_PACKAGE = "com.google.android.wearable.app";
- }
-
- public final class ComplicationRequest {
- ctor public ComplicationRequest(int complicationInstanceId, androidx.wear.complications.data.ComplicationType complicationType);
- method public int getComplicationInstanceId();
- method public androidx.wear.complications.data.ComplicationType getComplicationType();
- property public final int complicationInstanceId;
- property public final androidx.wear.complications.data.ComplicationType complicationType;
- }
-
-}
-
diff --git a/wear/wear-complications-data-source/src/main/AndroidManifest.xml b/wear/wear-complications-data-source/src/main/AndroidManifest.xml
deleted file mode 100644
index e48871f..0000000
--- a/wear/wear-complications-data-source/src/main/AndroidManifest.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<manifest xmlns:android="http://schemas.android.com/apk/res/android"
- package="androidx.wear.complications.datasource">
- <application>
- <uses-library android:name="com.google.android.wearable" android:required="false" />
- </application>
-</manifest>
diff --git a/wear/wear-complications-data/api/api_lint.ignore b/wear/wear-complications-data/api/api_lint.ignore
deleted file mode 100644
index fa2de68..0000000
--- a/wear/wear-complications-data/api/api_lint.ignore
+++ /dev/null
@@ -1,11 +0,0 @@
-// Baseline format: 1.0
-MissingGetterMatchingBuilder: androidx.wear.complications.data.TimeDifferenceComplicationText.Builder#setDisplayAsNow(boolean):
- androidx.wear.complications.data.TimeDifferenceComplicationText does not declare a `isDisplayAsNow()` method matching method androidx.wear.complications.data.TimeDifferenceComplicationText.Builder.setDisplayAsNow(boolean)
-MissingGetterMatchingBuilder: androidx.wear.complications.data.TimeDifferenceComplicationText.Builder#setText(CharSequence):
- androidx.wear.complications.data.TimeDifferenceComplicationText does not declare a `getText()` method matching method androidx.wear.complications.data.TimeDifferenceComplicationText.Builder.setText(CharSequence)
-MissingGetterMatchingBuilder: androidx.wear.complications.data.TimeFormatComplicationText.Builder#setStyle(androidx.wear.complications.data.TimeFormatStyle):
- androidx.wear.complications.data.TimeFormatComplicationText does not declare a `getStyle()` method matching method androidx.wear.complications.data.TimeFormatComplicationText.Builder.setStyle(androidx.wear.complications.data.TimeFormatStyle)
-MissingGetterMatchingBuilder: androidx.wear.complications.data.TimeFormatComplicationText.Builder#setText(CharSequence):
- androidx.wear.complications.data.TimeFormatComplicationText does not declare a `getText()` method matching method androidx.wear.complications.data.TimeFormatComplicationText.Builder.setText(CharSequence)
-MissingGetterMatchingBuilder: androidx.wear.complications.data.TimeFormatComplicationText.Builder#setTimeZone(android.icu.util.TimeZone):
- androidx.wear.complications.data.TimeFormatComplicationText does not declare a `getTimeZone()` method matching method androidx.wear.complications.data.TimeFormatComplicationText.Builder.setTimeZone(android.icu.util.TimeZone)
diff --git a/wear/wear-complications-data/api/current.txt b/wear/wear-complications-data/api/current.txt
deleted file mode 100644
index 07d84a3..0000000
--- a/wear/wear-complications-data/api/current.txt
+++ /dev/null
@@ -1,399 +0,0 @@
-// Signature format: 4.0
-package androidx.wear.complications {
-
- public final class ComplicationDataSourceInfo {
- ctor public ComplicationDataSourceInfo(String appName, String name, android.graphics.drawable.Icon icon, androidx.wear.complications.data.ComplicationType type, android.content.ComponentName? componentName);
- method public String getAppName();
- method public android.content.ComponentName? getComponentName();
- method public androidx.wear.complications.data.ComplicationData getFallbackPreviewData();
- method public android.graphics.drawable.Icon getIcon();
- method public String getName();
- method public androidx.wear.complications.data.ComplicationType getType();
- property public final String appName;
- property public final android.content.ComponentName? componentName;
- property public final androidx.wear.complications.data.ComplicationData fallbackPreviewData;
- property public final android.graphics.drawable.Icon icon;
- property public final String name;
- property public final androidx.wear.complications.data.ComplicationType type;
- }
-
- public final class ComplicationDataSourceInfoRetriever implements java.lang.AutoCloseable {
- ctor public ComplicationDataSourceInfoRetriever(android.content.Context context);
- method public void close();
- method @kotlin.jvm.Throws(exceptionClasses=ServiceDisconnectedException::class) public suspend Object? retrieveComplicationDataSourceInfo(android.content.ComponentName watchFaceComponent, int[] watchFaceComplicationIds, kotlin.coroutines.Continuation<? super androidx.wear.complications.ComplicationDataSourceInfoRetriever.Result[]> p) throws androidx.wear.complications.ComplicationDataSourceInfoRetriever.ServiceDisconnectedException;
- method @RequiresApi(android.os.Build.VERSION_CODES.R) @kotlin.jvm.Throws(exceptionClasses=ServiceDisconnectedException::class) public suspend Object? retrievePreviewComplicationData(android.content.ComponentName complicationDataSourceComponent, androidx.wear.complications.data.ComplicationType complicationType, kotlin.coroutines.Continuation<? super androidx.wear.complications.data.ComplicationData> p) throws androidx.wear.complications.ComplicationDataSourceInfoRetriever.ServiceDisconnectedException;
- }
-
- public static final class ComplicationDataSourceInfoRetriever.Result {
- method public androidx.wear.complications.ComplicationDataSourceInfo? getInfo();
- method public int getSlotId();
- property public final androidx.wear.complications.ComplicationDataSourceInfo? info;
- property public final int slotId;
- }
-
- public static final class ComplicationDataSourceInfoRetriever.ServiceDisconnectedException extends java.lang.Exception {
- ctor public ComplicationDataSourceInfoRetriever.ServiceDisconnectedException();
- }
-
- public final class ComplicationDataSourceInfoRetrieverKt {
- }
-
- public final class ComplicationSlotBounds {
- ctor public ComplicationSlotBounds(java.util.Map<androidx.wear.complications.data.ComplicationType,? extends android.graphics.RectF> perComplicationTypeBounds);
- ctor public ComplicationSlotBounds(android.graphics.RectF bounds);
- method public java.util.Map<androidx.wear.complications.data.ComplicationType,android.graphics.RectF> getPerComplicationTypeBounds();
- property public final java.util.Map<androidx.wear.complications.data.ComplicationType,android.graphics.RectF> perComplicationTypeBounds;
- }
-
- public final class DefaultComplicationDataSourcePolicy {
- ctor public DefaultComplicationDataSourcePolicy();
- ctor public DefaultComplicationDataSourcePolicy(int systemProvider);
- ctor public DefaultComplicationDataSourcePolicy(android.content.ComponentName dataSource, int systemDataSourceFallback);
- ctor public DefaultComplicationDataSourcePolicy(android.content.ComponentName primaryDataSource, android.content.ComponentName secondaryDataSource, int systemDataSourceFallback);
- method public android.content.ComponentName? getPrimaryDataSource();
- method public android.content.ComponentName? getSecondaryDataSource();
- method public int getSystemDataSourceFallback();
- method public boolean isEmpty();
- property public final android.content.ComponentName? primaryDataSource;
- property public final android.content.ComponentName? secondaryDataSource;
- property public final int systemDataSourceFallback;
- }
-
- public final class SystemDataSources {
- field public static final androidx.wear.complications.SystemDataSources.Companion Companion;
- field public static final int DATA_SOURCE_APP_SHORTCUT = 6; // 0x6
- field public static final int DATA_SOURCE_DATE = 2; // 0x2
- field public static final int DATA_SOURCE_DAY_AND_DATE = 16; // 0x10
- field public static final int DATA_SOURCE_DAY_OF_WEEK = 13; // 0xd
- field public static final int DATA_SOURCE_FAVORITE_CONTACT = 14; // 0xe
- field public static final int DATA_SOURCE_NEXT_EVENT = 9; // 0x9
- field public static final int DATA_SOURCE_STEP_COUNT = 4; // 0x4
- field public static final int DATA_SOURCE_SUNRISE_SUNSET = 12; // 0xc
- field public static final int DATA_SOURCE_TIME_AND_DATE = 3; // 0x3
- field public static final int DATA_SOURCE_UNREAD_NOTIFICATION_COUNT = 7; // 0x7
- field public static final int DATA_SOURCE_WATCH_BATTERY = 1; // 0x1
- field public static final int DATA_SOURCE_WORLD_CLOCK = 5; // 0x5
- field public static final int NO_DATA_SOURCE = -1; // 0xffffffff
- }
-
- public static final class SystemDataSources.Companion {
- }
-
-}
-
-package androidx.wear.complications.data {
-
- public abstract sealed class ComplicationData {
- method public final android.app.PendingIntent? getTapAction();
- method public final androidx.wear.complications.data.ComplicationType getType();
- method public final androidx.wear.complications.data.TimeRange getValidTimeRange();
- property public final android.app.PendingIntent? tapAction;
- property public final androidx.wear.complications.data.ComplicationType type;
- property public final androidx.wear.complications.data.TimeRange validTimeRange;
- }
-
- public interface ComplicationText {
- method public java.time.Instant getNextChangeTime(java.time.Instant afterInstant);
- method public CharSequence getTextAt(android.content.res.Resources resources, java.time.Instant instant);
- method public boolean isAlwaysEmpty();
- method public boolean returnsSameText(java.time.Instant firstInstant, java.time.Instant secondInstant);
- field public static final androidx.wear.complications.data.ComplicationText.Companion Companion;
- field public static final androidx.wear.complications.data.ComplicationText EMPTY;
- }
-
- public static final class ComplicationText.Companion {
- }
-
- public enum ComplicationType {
- enum_constant public static final androidx.wear.complications.data.ComplicationType EMPTY;
- enum_constant public static final androidx.wear.complications.data.ComplicationType LONG_TEXT;
- enum_constant public static final androidx.wear.complications.data.ComplicationType MONOCHROMATIC_IMAGE;
- enum_constant public static final androidx.wear.complications.data.ComplicationType NOT_CONFIGURED;
- enum_constant public static final androidx.wear.complications.data.ComplicationType NO_DATA;
- enum_constant public static final androidx.wear.complications.data.ComplicationType NO_PERMISSION;
- enum_constant public static final androidx.wear.complications.data.ComplicationType PHOTO_IMAGE;
- enum_constant public static final androidx.wear.complications.data.ComplicationType RANGED_VALUE;
- enum_constant public static final androidx.wear.complications.data.ComplicationType SHORT_TEXT;
- enum_constant public static final androidx.wear.complications.data.ComplicationType SMALL_IMAGE;
- }
-
- public final class CountDownTimeReference {
- ctor public CountDownTimeReference(java.time.Instant instant);
- method public java.time.Instant getInstant();
- property public final java.time.Instant instant;
- }
-
- public final class CountUpTimeReference {
- ctor public CountUpTimeReference(java.time.Instant instant);
- method public java.time.Instant getInstant();
- property public final java.time.Instant instant;
- }
-
- public final class DataKt {
- }
-
- public final class EmptyComplicationData extends androidx.wear.complications.data.ComplicationData {
- ctor public EmptyComplicationData();
- field public static final androidx.wear.complications.data.ComplicationType TYPE;
- }
-
- public final class LongTextComplicationData extends androidx.wear.complications.data.ComplicationData {
- method public androidx.wear.complications.data.ComplicationText? getContentDescription();
- method public androidx.wear.complications.data.MonochromaticImage? getMonochromaticImage();
- method public androidx.wear.complications.data.SmallImage? getSmallImage();
- method public androidx.wear.complications.data.ComplicationText getText();
- method public androidx.wear.complications.data.ComplicationText? getTitle();
- property public final androidx.wear.complications.data.ComplicationText? contentDescription;
- property public final androidx.wear.complications.data.MonochromaticImage? monochromaticImage;
- property public final androidx.wear.complications.data.SmallImage? smallImage;
- property public final androidx.wear.complications.data.ComplicationText text;
- property public final androidx.wear.complications.data.ComplicationText? title;
- field public static final androidx.wear.complications.data.ComplicationType TYPE;
- }
-
- public static final class LongTextComplicationData.Builder {
- ctor public LongTextComplicationData.Builder(androidx.wear.complications.data.ComplicationText text, androidx.wear.complications.data.ComplicationText contentDescription);
- method public androidx.wear.complications.data.LongTextComplicationData build();
- method public androidx.wear.complications.data.LongTextComplicationData.Builder setMonochromaticImage(androidx.wear.complications.data.MonochromaticImage? icon);
- method public androidx.wear.complications.data.LongTextComplicationData.Builder setSmallImage(androidx.wear.complications.data.SmallImage? smallImage);
- method public androidx.wear.complications.data.LongTextComplicationData.Builder setTapAction(android.app.PendingIntent? tapAction);
- method public androidx.wear.complications.data.LongTextComplicationData.Builder setTitle(androidx.wear.complications.data.ComplicationText? title);
- method public androidx.wear.complications.data.LongTextComplicationData.Builder setValidTimeRange(androidx.wear.complications.data.TimeRange? validTimeRange);
- }
-
- public final class MonochromaticImage {
- method public android.graphics.drawable.Icon? getAmbientImage();
- method public android.graphics.drawable.Icon getImage();
- property public final android.graphics.drawable.Icon? ambientImage;
- property public final android.graphics.drawable.Icon image;
- }
-
- public static final class MonochromaticImage.Builder {
- ctor public MonochromaticImage.Builder(android.graphics.drawable.Icon image);
- method public androidx.wear.complications.data.MonochromaticImage build();
- method public androidx.wear.complications.data.MonochromaticImage.Builder setAmbientImage(android.graphics.drawable.Icon? ambientImage);
- }
-
- public final class MonochromaticImageComplicationData extends androidx.wear.complications.data.ComplicationData {
- method public androidx.wear.complications.data.ComplicationText? getContentDescription();
- method public androidx.wear.complications.data.MonochromaticImage getMonochromaticImage();
- property public final androidx.wear.complications.data.ComplicationText? contentDescription;
- property public final androidx.wear.complications.data.MonochromaticImage monochromaticImage;
- field public static final androidx.wear.complications.data.ComplicationType TYPE;
- }
-
- public static final class MonochromaticImageComplicationData.Builder {
- ctor public MonochromaticImageComplicationData.Builder(androidx.wear.complications.data.MonochromaticImage monochromaticImage, androidx.wear.complications.data.ComplicationText contentDescription);
- method public androidx.wear.complications.data.MonochromaticImageComplicationData build();
- method public androidx.wear.complications.data.MonochromaticImageComplicationData.Builder setTapAction(android.app.PendingIntent? tapAction);
- method public androidx.wear.complications.data.MonochromaticImageComplicationData.Builder setValidTimeRange(androidx.wear.complications.data.TimeRange? validTimeRange);
- }
-
- public final class NoDataComplicationData extends androidx.wear.complications.data.ComplicationData {
- ctor public NoDataComplicationData();
- field public static final androidx.wear.complications.data.ComplicationType TYPE;
- }
-
- public final class NoPermissionComplicationData extends androidx.wear.complications.data.ComplicationData {
- method public androidx.wear.complications.data.MonochromaticImage? getMonochromaticImage();
- method public androidx.wear.complications.data.ComplicationText? getText();
- method public androidx.wear.complications.data.ComplicationText? getTitle();
- property public final androidx.wear.complications.data.MonochromaticImage? monochromaticImage;
- property public final androidx.wear.complications.data.ComplicationText? text;
- property public final androidx.wear.complications.data.ComplicationText? title;
- field public static final androidx.wear.complications.data.ComplicationType TYPE;
- }
-
- public static final class NoPermissionComplicationData.Builder {
- ctor public NoPermissionComplicationData.Builder();
- method public androidx.wear.complications.data.NoPermissionComplicationData build();
- method public androidx.wear.complications.data.NoPermissionComplicationData.Builder setMonochromaticImage(androidx.wear.complications.data.MonochromaticImage? monochromaticImage);
- method public androidx.wear.complications.data.NoPermissionComplicationData.Builder setText(androidx.wear.complications.data.ComplicationText? text);
- method public androidx.wear.complications.data.NoPermissionComplicationData.Builder setTitle(androidx.wear.complications.data.ComplicationText? title);
- }
-
- public final class NotConfiguredComplicationData extends androidx.wear.complications.data.ComplicationData {
- ctor public NotConfiguredComplicationData();
- field public static final androidx.wear.complications.data.ComplicationType TYPE;
- }
-
- public final class PhotoImageComplicationData extends androidx.wear.complications.data.ComplicationData {
- method public androidx.wear.complications.data.ComplicationText? getContentDescription();
- method public android.graphics.drawable.Icon getPhotoImage();
- property public final androidx.wear.complications.data.ComplicationText? contentDescription;
- property public final android.graphics.drawable.Icon photoImage;
- field public static final androidx.wear.complications.data.ComplicationType TYPE;
- }
-
- public static final class PhotoImageComplicationData.Builder {
- ctor public PhotoImageComplicationData.Builder(android.graphics.drawable.Icon photoImage, androidx.wear.complications.data.ComplicationText contentDescription);
- method public androidx.wear.complications.data.PhotoImageComplicationData build();
- method public androidx.wear.complications.data.PhotoImageComplicationData.Builder setTapAction(android.app.PendingIntent? tapAction);
- method public androidx.wear.complications.data.PhotoImageComplicationData.Builder setValidTimeRange(androidx.wear.complications.data.TimeRange? validTimeRange);
- }
-
- public final class PlainComplicationText implements androidx.wear.complications.data.ComplicationText {
- }
-
- public static final class PlainComplicationText.Builder {
- ctor public PlainComplicationText.Builder(CharSequence text);
- method public androidx.wear.complications.data.PlainComplicationText build();
- }
-
- public final class RangedValueComplicationData extends androidx.wear.complications.data.ComplicationData {
- method public androidx.wear.complications.data.ComplicationText? getContentDescription();
- method public float getMax();
- method public float getMin();
- method public androidx.wear.complications.data.MonochromaticImage? getMonochromaticImage();
- method public androidx.wear.complications.data.ComplicationText? getText();
- method public androidx.wear.complications.data.ComplicationText? getTitle();
- method public float getValue();
- property public final androidx.wear.complications.data.ComplicationText? contentDescription;
- property public final float max;
- property public final float min;
- property public final androidx.wear.complications.data.MonochromaticImage? monochromaticImage;
- property public final androidx.wear.complications.data.ComplicationText? text;
- property public final androidx.wear.complications.data.ComplicationText? title;
- property public final float value;
- field public static final androidx.wear.complications.data.ComplicationType TYPE;
- }
-
- public static final class RangedValueComplicationData.Builder {
- ctor public RangedValueComplicationData.Builder(float value, float min, float max, androidx.wear.complications.data.ComplicationText contentDescription);
- method public androidx.wear.complications.data.RangedValueComplicationData build();
- method public androidx.wear.complications.data.RangedValueComplicationData.Builder setMonochromaticImage(androidx.wear.complications.data.MonochromaticImage? monochromaticImage);
- method public androidx.wear.complications.data.RangedValueComplicationData.Builder setTapAction(android.app.PendingIntent? tapAction);
- method public androidx.wear.complications.data.RangedValueComplicationData.Builder setText(androidx.wear.complications.data.ComplicationText? text);
- method public androidx.wear.complications.data.RangedValueComplicationData.Builder setTitle(androidx.wear.complications.data.ComplicationText? title);
- method public androidx.wear.complications.data.RangedValueComplicationData.Builder setValidTimeRange(androidx.wear.complications.data.TimeRange? validTimeRange);
- }
-
- public final class ShortTextComplicationData extends androidx.wear.complications.data.ComplicationData {
- method public androidx.wear.complications.data.ComplicationText? getContentDescription();
- method public androidx.wear.complications.data.MonochromaticImage? getMonochromaticImage();
- method public androidx.wear.complications.data.ComplicationText getText();
- method public androidx.wear.complications.data.ComplicationText? getTitle();
- property public final androidx.wear.complications.data.ComplicationText? contentDescription;
- property public final androidx.wear.complications.data.MonochromaticImage? monochromaticImage;
- property public final androidx.wear.complications.data.ComplicationText text;
- property public final androidx.wear.complications.data.ComplicationText? title;
- field public static final int MAX_TEXT_LENGTH;
- field public static final androidx.wear.complications.data.ComplicationType TYPE;
- }
-
- public static final class ShortTextComplicationData.Builder {
- ctor public ShortTextComplicationData.Builder(androidx.wear.complications.data.ComplicationText text, androidx.wear.complications.data.ComplicationText contentDescription);
- method public androidx.wear.complications.data.ShortTextComplicationData build();
- method public androidx.wear.complications.data.ShortTextComplicationData.Builder setMonochromaticImage(androidx.wear.complications.data.MonochromaticImage? monochromaticImage);
- method public androidx.wear.complications.data.ShortTextComplicationData.Builder setTapAction(android.app.PendingIntent? tapAction);
- method public androidx.wear.complications.data.ShortTextComplicationData.Builder setTitle(androidx.wear.complications.data.ComplicationText? title);
- method public androidx.wear.complications.data.ShortTextComplicationData.Builder setValidTimeRange(androidx.wear.complications.data.TimeRange? validTimeRange);
- }
-
- public final class SmallImage {
- method public android.graphics.drawable.Icon? getAmbientImage();
- method public android.graphics.drawable.Icon getImage();
- method public androidx.wear.complications.data.SmallImageType getType();
- property public final android.graphics.drawable.Icon? ambientImage;
- property public final android.graphics.drawable.Icon image;
- property public final androidx.wear.complications.data.SmallImageType type;
- }
-
- public static final class SmallImage.Builder {
- ctor public SmallImage.Builder(android.graphics.drawable.Icon image, androidx.wear.complications.data.SmallImageType type);
- method public androidx.wear.complications.data.SmallImage build();
- method public androidx.wear.complications.data.SmallImage.Builder setAmbientImage(android.graphics.drawable.Icon? ambientImage);
- }
-
- public final class SmallImageComplicationData extends androidx.wear.complications.data.ComplicationData {
- method public androidx.wear.complications.data.ComplicationText? getContentDescription();
- method public androidx.wear.complications.data.SmallImage getSmallImage();
- property public final androidx.wear.complications.data.ComplicationText? contentDescription;
- property public final androidx.wear.complications.data.SmallImage smallImage;
- field public static final androidx.wear.complications.data.ComplicationType TYPE;
- }
-
- public static final class SmallImageComplicationData.Builder {
- ctor public SmallImageComplicationData.Builder(androidx.wear.complications.data.SmallImage smallImage, androidx.wear.complications.data.ComplicationText contentDescription);
- method public androidx.wear.complications.data.SmallImageComplicationData build();
- method public androidx.wear.complications.data.SmallImageComplicationData.Builder setTapAction(android.app.PendingIntent? tapAction);
- method public androidx.wear.complications.data.SmallImageComplicationData.Builder setValidTimeRange(androidx.wear.complications.data.TimeRange? validTimeRange);
- }
-
- public enum SmallImageType {
- enum_constant public static final androidx.wear.complications.data.SmallImageType ICON;
- enum_constant public static final androidx.wear.complications.data.SmallImageType PHOTO;
- }
-
- public final class TextKt {
- }
-
- public final class TimeDifferenceComplicationText implements androidx.wear.complications.data.ComplicationText {
- method public java.util.concurrent.TimeUnit? getMinimumTimeUnit();
- }
-
- public static final class TimeDifferenceComplicationText.Builder {
- ctor public TimeDifferenceComplicationText.Builder(androidx.wear.complications.data.TimeDifferenceStyle style, androidx.wear.complications.data.CountUpTimeReference countUpTimeReference);
- ctor public TimeDifferenceComplicationText.Builder(androidx.wear.complications.data.TimeDifferenceStyle style, androidx.wear.complications.data.CountDownTimeReference countDownTimeReference);
- method public androidx.wear.complications.data.TimeDifferenceComplicationText build();
- method public androidx.wear.complications.data.TimeDifferenceComplicationText.Builder setDisplayAsNow(boolean displayAsNow);
- method public androidx.wear.complications.data.TimeDifferenceComplicationText.Builder setMinimumTimeUnit(java.util.concurrent.TimeUnit? minimumUnit);
- method public androidx.wear.complications.data.TimeDifferenceComplicationText.Builder setText(CharSequence? text);
- }
-
- public enum TimeDifferenceStyle {
- enum_constant public static final androidx.wear.complications.data.TimeDifferenceStyle SHORT_DUAL_UNIT;
- enum_constant public static final androidx.wear.complications.data.TimeDifferenceStyle SHORT_SINGLE_UNIT;
- enum_constant public static final androidx.wear.complications.data.TimeDifferenceStyle SHORT_WORDS_SINGLE_UNIT;
- enum_constant public static final androidx.wear.complications.data.TimeDifferenceStyle STOPWATCH;
- enum_constant public static final androidx.wear.complications.data.TimeDifferenceStyle WORDS_SINGLE_UNIT;
- }
-
- public final class TimeFormatComplicationText implements androidx.wear.complications.data.ComplicationText {
- }
-
- public static final class TimeFormatComplicationText.Builder {
- ctor public TimeFormatComplicationText.Builder(String format);
- method public androidx.wear.complications.data.TimeFormatComplicationText build();
- method public androidx.wear.complications.data.TimeFormatComplicationText.Builder setStyle(androidx.wear.complications.data.TimeFormatStyle style);
- method public androidx.wear.complications.data.TimeFormatComplicationText.Builder setText(CharSequence text);
- method public androidx.wear.complications.data.TimeFormatComplicationText.Builder setTimeZone(android.icu.util.TimeZone timeZone);
- }
-
- public enum TimeFormatStyle {
- enum_constant public static final androidx.wear.complications.data.TimeFormatStyle DEFAULT;
- enum_constant public static final androidx.wear.complications.data.TimeFormatStyle LOWER_CASE;
- enum_constant public static final androidx.wear.complications.data.TimeFormatStyle UPPER_CASE;
- }
-
- public final class TimeRange {
- method public static androidx.wear.complications.data.TimeRange after(java.time.Instant startInstant);
- method public static androidx.wear.complications.data.TimeRange before(java.time.Instant endInstant);
- method public static androidx.wear.complications.data.TimeRange between(java.time.Instant startInstant, java.time.Instant endInstant);
- method public operator boolean contains(java.time.Instant dateTimeMillis);
- method public java.time.Instant getEndDateTimeMillis();
- method public java.time.Instant getStartDateTimeMillis();
- property public final java.time.Instant endDateTimeMillis;
- property public final java.time.Instant startDateTimeMillis;
- field public static final androidx.wear.complications.data.TimeRange ALWAYS;
- field public static final androidx.wear.complications.data.TimeRange.Companion Companion;
- }
-
- public static final class TimeRange.Companion {
- method public androidx.wear.complications.data.TimeRange after(java.time.Instant startInstant);
- method public androidx.wear.complications.data.TimeRange before(java.time.Instant endInstant);
- method public androidx.wear.complications.data.TimeRange between(java.time.Instant startInstant, java.time.Instant endInstant);
- }
-
- public final class TypeKt {
- }
-
-}
-
-package androidx.wear.utility {
-
- public final class TraceEventKt {
- }
-
-}
-
diff --git a/wear/wear-complications-data/api/public_plus_experimental_current.txt b/wear/wear-complications-data/api/public_plus_experimental_current.txt
deleted file mode 100644
index 07d84a3..0000000
--- a/wear/wear-complications-data/api/public_plus_experimental_current.txt
+++ /dev/null
@@ -1,399 +0,0 @@
-// Signature format: 4.0
-package androidx.wear.complications {
-
- public final class ComplicationDataSourceInfo {
- ctor public ComplicationDataSourceInfo(String appName, String name, android.graphics.drawable.Icon icon, androidx.wear.complications.data.ComplicationType type, android.content.ComponentName? componentName);
- method public String getAppName();
- method public android.content.ComponentName? getComponentName();
- method public androidx.wear.complications.data.ComplicationData getFallbackPreviewData();
- method public android.graphics.drawable.Icon getIcon();
- method public String getName();
- method public androidx.wear.complications.data.ComplicationType getType();
- property public final String appName;
- property public final android.content.ComponentName? componentName;
- property public final androidx.wear.complications.data.ComplicationData fallbackPreviewData;
- property public final android.graphics.drawable.Icon icon;
- property public final String name;
- property public final androidx.wear.complications.data.ComplicationType type;
- }
-
- public final class ComplicationDataSourceInfoRetriever implements java.lang.AutoCloseable {
- ctor public ComplicationDataSourceInfoRetriever(android.content.Context context);
- method public void close();
- method @kotlin.jvm.Throws(exceptionClasses=ServiceDisconnectedException::class) public suspend Object? retrieveComplicationDataSourceInfo(android.content.ComponentName watchFaceComponent, int[] watchFaceComplicationIds, kotlin.coroutines.Continuation<? super androidx.wear.complications.ComplicationDataSourceInfoRetriever.Result[]> p) throws androidx.wear.complications.ComplicationDataSourceInfoRetriever.ServiceDisconnectedException;
- method @RequiresApi(android.os.Build.VERSION_CODES.R) @kotlin.jvm.Throws(exceptionClasses=ServiceDisconnectedException::class) public suspend Object? retrievePreviewComplicationData(android.content.ComponentName complicationDataSourceComponent, androidx.wear.complications.data.ComplicationType complicationType, kotlin.coroutines.Continuation<? super androidx.wear.complications.data.ComplicationData> p) throws androidx.wear.complications.ComplicationDataSourceInfoRetriever.ServiceDisconnectedException;
- }
-
- public static final class ComplicationDataSourceInfoRetriever.Result {
- method public androidx.wear.complications.ComplicationDataSourceInfo? getInfo();
- method public int getSlotId();
- property public final androidx.wear.complications.ComplicationDataSourceInfo? info;
- property public final int slotId;
- }
-
- public static final class ComplicationDataSourceInfoRetriever.ServiceDisconnectedException extends java.lang.Exception {
- ctor public ComplicationDataSourceInfoRetriever.ServiceDisconnectedException();
- }
-
- public final class ComplicationDataSourceInfoRetrieverKt {
- }
-
- public final class ComplicationSlotBounds {
- ctor public ComplicationSlotBounds(java.util.Map<androidx.wear.complications.data.ComplicationType,? extends android.graphics.RectF> perComplicationTypeBounds);
- ctor public ComplicationSlotBounds(android.graphics.RectF bounds);
- method public java.util.Map<androidx.wear.complications.data.ComplicationType,android.graphics.RectF> getPerComplicationTypeBounds();
- property public final java.util.Map<androidx.wear.complications.data.ComplicationType,android.graphics.RectF> perComplicationTypeBounds;
- }
-
- public final class DefaultComplicationDataSourcePolicy {
- ctor public DefaultComplicationDataSourcePolicy();
- ctor public DefaultComplicationDataSourcePolicy(int systemProvider);
- ctor public DefaultComplicationDataSourcePolicy(android.content.ComponentName dataSource, int systemDataSourceFallback);
- ctor public DefaultComplicationDataSourcePolicy(android.content.ComponentName primaryDataSource, android.content.ComponentName secondaryDataSource, int systemDataSourceFallback);
- method public android.content.ComponentName? getPrimaryDataSource();
- method public android.content.ComponentName? getSecondaryDataSource();
- method public int getSystemDataSourceFallback();
- method public boolean isEmpty();
- property public final android.content.ComponentName? primaryDataSource;
- property public final android.content.ComponentName? secondaryDataSource;
- property public final int systemDataSourceFallback;
- }
-
- public final class SystemDataSources {
- field public static final androidx.wear.complications.SystemDataSources.Companion Companion;
- field public static final int DATA_SOURCE_APP_SHORTCUT = 6; // 0x6
- field public static final int DATA_SOURCE_DATE = 2; // 0x2
- field public static final int DATA_SOURCE_DAY_AND_DATE = 16; // 0x10
- field public static final int DATA_SOURCE_DAY_OF_WEEK = 13; // 0xd
- field public static final int DATA_SOURCE_FAVORITE_CONTACT = 14; // 0xe
- field public static final int DATA_SOURCE_NEXT_EVENT = 9; // 0x9
- field public static final int DATA_SOURCE_STEP_COUNT = 4; // 0x4
- field public static final int DATA_SOURCE_SUNRISE_SUNSET = 12; // 0xc
- field public static final int DATA_SOURCE_TIME_AND_DATE = 3; // 0x3
- field public static final int DATA_SOURCE_UNREAD_NOTIFICATION_COUNT = 7; // 0x7
- field public static final int DATA_SOURCE_WATCH_BATTERY = 1; // 0x1
- field public static final int DATA_SOURCE_WORLD_CLOCK = 5; // 0x5
- field public static final int NO_DATA_SOURCE = -1; // 0xffffffff
- }
-
- public static final class SystemDataSources.Companion {
- }
-
-}
-
-package androidx.wear.complications.data {
-
- public abstract sealed class ComplicationData {
- method public final android.app.PendingIntent? getTapAction();
- method public final androidx.wear.complications.data.ComplicationType getType();
- method public final androidx.wear.complications.data.TimeRange getValidTimeRange();
- property public final android.app.PendingIntent? tapAction;
- property public final androidx.wear.complications.data.ComplicationType type;
- property public final androidx.wear.complications.data.TimeRange validTimeRange;
- }
-
- public interface ComplicationText {
- method public java.time.Instant getNextChangeTime(java.time.Instant afterInstant);
- method public CharSequence getTextAt(android.content.res.Resources resources, java.time.Instant instant);
- method public boolean isAlwaysEmpty();
- method public boolean returnsSameText(java.time.Instant firstInstant, java.time.Instant secondInstant);
- field public static final androidx.wear.complications.data.ComplicationText.Companion Companion;
- field public static final androidx.wear.complications.data.ComplicationText EMPTY;
- }
-
- public static final class ComplicationText.Companion {
- }
-
- public enum ComplicationType {
- enum_constant public static final androidx.wear.complications.data.ComplicationType EMPTY;
- enum_constant public static final androidx.wear.complications.data.ComplicationType LONG_TEXT;
- enum_constant public static final androidx.wear.complications.data.ComplicationType MONOCHROMATIC_IMAGE;
- enum_constant public static final androidx.wear.complications.data.ComplicationType NOT_CONFIGURED;
- enum_constant public static final androidx.wear.complications.data.ComplicationType NO_DATA;
- enum_constant public static final androidx.wear.complications.data.ComplicationType NO_PERMISSION;
- enum_constant public static final androidx.wear.complications.data.ComplicationType PHOTO_IMAGE;
- enum_constant public static final androidx.wear.complications.data.ComplicationType RANGED_VALUE;
- enum_constant public static final androidx.wear.complications.data.ComplicationType SHORT_TEXT;
- enum_constant public static final androidx.wear.complications.data.ComplicationType SMALL_IMAGE;
- }
-
- public final class CountDownTimeReference {
- ctor public CountDownTimeReference(java.time.Instant instant);
- method public java.time.Instant getInstant();
- property public final java.time.Instant instant;
- }
-
- public final class CountUpTimeReference {
- ctor public CountUpTimeReference(java.time.Instant instant);
- method public java.time.Instant getInstant();
- property public final java.time.Instant instant;
- }
-
- public final class DataKt {
- }
-
- public final class EmptyComplicationData extends androidx.wear.complications.data.ComplicationData {
- ctor public EmptyComplicationData();
- field public static final androidx.wear.complications.data.ComplicationType TYPE;
- }
-
- public final class LongTextComplicationData extends androidx.wear.complications.data.ComplicationData {
- method public androidx.wear.complications.data.ComplicationText? getContentDescription();
- method public androidx.wear.complications.data.MonochromaticImage? getMonochromaticImage();
- method public androidx.wear.complications.data.SmallImage? getSmallImage();
- method public androidx.wear.complications.data.ComplicationText getText();
- method public androidx.wear.complications.data.ComplicationText? getTitle();
- property public final androidx.wear.complications.data.ComplicationText? contentDescription;
- property public final androidx.wear.complications.data.MonochromaticImage? monochromaticImage;
- property public final androidx.wear.complications.data.SmallImage? smallImage;
- property public final androidx.wear.complications.data.ComplicationText text;
- property public final androidx.wear.complications.data.ComplicationText? title;
- field public static final androidx.wear.complications.data.ComplicationType TYPE;
- }
-
- public static final class LongTextComplicationData.Builder {
- ctor public LongTextComplicationData.Builder(androidx.wear.complications.data.ComplicationText text, androidx.wear.complications.data.ComplicationText contentDescription);
- method public androidx.wear.complications.data.LongTextComplicationData build();
- method public androidx.wear.complications.data.LongTextComplicationData.Builder setMonochromaticImage(androidx.wear.complications.data.MonochromaticImage? icon);
- method public androidx.wear.complications.data.LongTextComplicationData.Builder setSmallImage(androidx.wear.complications.data.SmallImage? smallImage);
- method public androidx.wear.complications.data.LongTextComplicationData.Builder setTapAction(android.app.PendingIntent? tapAction);
- method public androidx.wear.complications.data.LongTextComplicationData.Builder setTitle(androidx.wear.complications.data.ComplicationText? title);
- method public androidx.wear.complications.data.LongTextComplicationData.Builder setValidTimeRange(androidx.wear.complications.data.TimeRange? validTimeRange);
- }
-
- public final class MonochromaticImage {
- method public android.graphics.drawable.Icon? getAmbientImage();
- method public android.graphics.drawable.Icon getImage();
- property public final android.graphics.drawable.Icon? ambientImage;
- property public final android.graphics.drawable.Icon image;
- }
-
- public static final class MonochromaticImage.Builder {
- ctor public MonochromaticImage.Builder(android.graphics.drawable.Icon image);
- method public androidx.wear.complications.data.MonochromaticImage build();
- method public androidx.wear.complications.data.MonochromaticImage.Builder setAmbientImage(android.graphics.drawable.Icon? ambientImage);
- }
-
- public final class MonochromaticImageComplicationData extends androidx.wear.complications.data.ComplicationData {
- method public androidx.wear.complications.data.ComplicationText? getContentDescription();
- method public androidx.wear.complications.data.MonochromaticImage getMonochromaticImage();
- property public final androidx.wear.complications.data.ComplicationText? contentDescription;
- property public final androidx.wear.complications.data.MonochromaticImage monochromaticImage;
- field public static final androidx.wear.complications.data.ComplicationType TYPE;
- }
-
- public static final class MonochromaticImageComplicationData.Builder {
- ctor public MonochromaticImageComplicationData.Builder(androidx.wear.complications.data.MonochromaticImage monochromaticImage, androidx.wear.complications.data.ComplicationText contentDescription);
- method public androidx.wear.complications.data.MonochromaticImageComplicationData build();
- method public androidx.wear.complications.data.MonochromaticImageComplicationData.Builder setTapAction(android.app.PendingIntent? tapAction);
- method public androidx.wear.complications.data.MonochromaticImageComplicationData.Builder setValidTimeRange(androidx.wear.complications.data.TimeRange? validTimeRange);
- }
-
- public final class NoDataComplicationData extends androidx.wear.complications.data.ComplicationData {
- ctor public NoDataComplicationData();
- field public static final androidx.wear.complications.data.ComplicationType TYPE;
- }
-
- public final class NoPermissionComplicationData extends androidx.wear.complications.data.ComplicationData {
- method public androidx.wear.complications.data.MonochromaticImage? getMonochromaticImage();
- method public androidx.wear.complications.data.ComplicationText? getText();
- method public androidx.wear.complications.data.ComplicationText? getTitle();
- property public final androidx.wear.complications.data.MonochromaticImage? monochromaticImage;
- property public final androidx.wear.complications.data.ComplicationText? text;
- property public final androidx.wear.complications.data.ComplicationText? title;
- field public static final androidx.wear.complications.data.ComplicationType TYPE;
- }
-
- public static final class NoPermissionComplicationData.Builder {
- ctor public NoPermissionComplicationData.Builder();
- method public androidx.wear.complications.data.NoPermissionComplicationData build();
- method public androidx.wear.complications.data.NoPermissionComplicationData.Builder setMonochromaticImage(androidx.wear.complications.data.MonochromaticImage? monochromaticImage);
- method public androidx.wear.complications.data.NoPermissionComplicationData.Builder setText(androidx.wear.complications.data.ComplicationText? text);
- method public androidx.wear.complications.data.NoPermissionComplicationData.Builder setTitle(androidx.wear.complications.data.ComplicationText? title);
- }
-
- public final class NotConfiguredComplicationData extends androidx.wear.complications.data.ComplicationData {
- ctor public NotConfiguredComplicationData();
- field public static final androidx.wear.complications.data.ComplicationType TYPE;
- }
-
- public final class PhotoImageComplicationData extends androidx.wear.complications.data.ComplicationData {
- method public androidx.wear.complications.data.ComplicationText? getContentDescription();
- method public android.graphics.drawable.Icon getPhotoImage();
- property public final androidx.wear.complications.data.ComplicationText? contentDescription;
- property public final android.graphics.drawable.Icon photoImage;
- field public static final androidx.wear.complications.data.ComplicationType TYPE;
- }
-
- public static final class PhotoImageComplicationData.Builder {
- ctor public PhotoImageComplicationData.Builder(android.graphics.drawable.Icon photoImage, androidx.wear.complications.data.ComplicationText contentDescription);
- method public androidx.wear.complications.data.PhotoImageComplicationData build();
- method public androidx.wear.complications.data.PhotoImageComplicationData.Builder setTapAction(android.app.PendingIntent? tapAction);
- method public androidx.wear.complications.data.PhotoImageComplicationData.Builder setValidTimeRange(androidx.wear.complications.data.TimeRange? validTimeRange);
- }
-
- public final class PlainComplicationText implements androidx.wear.complications.data.ComplicationText {
- }
-
- public static final class PlainComplicationText.Builder {
- ctor public PlainComplicationText.Builder(CharSequence text);
- method public androidx.wear.complications.data.PlainComplicationText build();
- }
-
- public final class RangedValueComplicationData extends androidx.wear.complications.data.ComplicationData {
- method public androidx.wear.complications.data.ComplicationText? getContentDescription();
- method public float getMax();
- method public float getMin();
- method public androidx.wear.complications.data.MonochromaticImage? getMonochromaticImage();
- method public androidx.wear.complications.data.ComplicationText? getText();
- method public androidx.wear.complications.data.ComplicationText? getTitle();
- method public float getValue();
- property public final androidx.wear.complications.data.ComplicationText? contentDescription;
- property public final float max;
- property public final float min;
- property public final androidx.wear.complications.data.MonochromaticImage? monochromaticImage;
- property public final androidx.wear.complications.data.ComplicationText? text;
- property public final androidx.wear.complications.data.ComplicationText? title;
- property public final float value;
- field public static final androidx.wear.complications.data.ComplicationType TYPE;
- }
-
- public static final class RangedValueComplicationData.Builder {
- ctor public RangedValueComplicationData.Builder(float value, float min, float max, androidx.wear.complications.data.ComplicationText contentDescription);
- method public androidx.wear.complications.data.RangedValueComplicationData build();
- method public androidx.wear.complications.data.RangedValueComplicationData.Builder setMonochromaticImage(androidx.wear.complications.data.MonochromaticImage? monochromaticImage);
- method public androidx.wear.complications.data.RangedValueComplicationData.Builder setTapAction(android.app.PendingIntent? tapAction);
- method public androidx.wear.complications.data.RangedValueComplicationData.Builder setText(androidx.wear.complications.data.ComplicationText? text);
- method public androidx.wear.complications.data.RangedValueComplicationData.Builder setTitle(androidx.wear.complications.data.ComplicationText? title);
- method public androidx.wear.complications.data.RangedValueComplicationData.Builder setValidTimeRange(androidx.wear.complications.data.TimeRange? validTimeRange);
- }
-
- public final class ShortTextComplicationData extends androidx.wear.complications.data.ComplicationData {
- method public androidx.wear.complications.data.ComplicationText? getContentDescription();
- method public androidx.wear.complications.data.MonochromaticImage? getMonochromaticImage();
- method public androidx.wear.complications.data.ComplicationText getText();
- method public androidx.wear.complications.data.ComplicationText? getTitle();
- property public final androidx.wear.complications.data.ComplicationText? contentDescription;
- property public final androidx.wear.complications.data.MonochromaticImage? monochromaticImage;
- property public final androidx.wear.complications.data.ComplicationText text;
- property public final androidx.wear.complications.data.ComplicationText? title;
- field public static final int MAX_TEXT_LENGTH;
- field public static final androidx.wear.complications.data.ComplicationType TYPE;
- }
-
- public static final class ShortTextComplicationData.Builder {
- ctor public ShortTextComplicationData.Builder(androidx.wear.complications.data.ComplicationText text, androidx.wear.complications.data.ComplicationText contentDescription);
- method public androidx.wear.complications.data.ShortTextComplicationData build();
- method public androidx.wear.complications.data.ShortTextComplicationData.Builder setMonochromaticImage(androidx.wear.complications.data.MonochromaticImage? monochromaticImage);
- method public androidx.wear.complications.data.ShortTextComplicationData.Builder setTapAction(android.app.PendingIntent? tapAction);
- method public androidx.wear.complications.data.ShortTextComplicationData.Builder setTitle(androidx.wear.complications.data.ComplicationText? title);
- method public androidx.wear.complications.data.ShortTextComplicationData.Builder setValidTimeRange(androidx.wear.complications.data.TimeRange? validTimeRange);
- }
-
- public final class SmallImage {
- method public android.graphics.drawable.Icon? getAmbientImage();
- method public android.graphics.drawable.Icon getImage();
- method public androidx.wear.complications.data.SmallImageType getType();
- property public final android.graphics.drawable.Icon? ambientImage;
- property public final android.graphics.drawable.Icon image;
- property public final androidx.wear.complications.data.SmallImageType type;
- }
-
- public static final class SmallImage.Builder {
- ctor public SmallImage.Builder(android.graphics.drawable.Icon image, androidx.wear.complications.data.SmallImageType type);
- method public androidx.wear.complications.data.SmallImage build();
- method public androidx.wear.complications.data.SmallImage.Builder setAmbientImage(android.graphics.drawable.Icon? ambientImage);
- }
-
- public final class SmallImageComplicationData extends androidx.wear.complications.data.ComplicationData {
- method public androidx.wear.complications.data.ComplicationText? getContentDescription();
- method public androidx.wear.complications.data.SmallImage getSmallImage();
- property public final androidx.wear.complications.data.ComplicationText? contentDescription;
- property public final androidx.wear.complications.data.SmallImage smallImage;
- field public static final androidx.wear.complications.data.ComplicationType TYPE;
- }
-
- public static final class SmallImageComplicationData.Builder {
- ctor public SmallImageComplicationData.Builder(androidx.wear.complications.data.SmallImage smallImage, androidx.wear.complications.data.ComplicationText contentDescription);
- method public androidx.wear.complications.data.SmallImageComplicationData build();
- method public androidx.wear.complications.data.SmallImageComplicationData.Builder setTapAction(android.app.PendingIntent? tapAction);
- method public androidx.wear.complications.data.SmallImageComplicationData.Builder setValidTimeRange(androidx.wear.complications.data.TimeRange? validTimeRange);
- }
-
- public enum SmallImageType {
- enum_constant public static final androidx.wear.complications.data.SmallImageType ICON;
- enum_constant public static final androidx.wear.complications.data.SmallImageType PHOTO;
- }
-
- public final class TextKt {
- }
-
- public final class TimeDifferenceComplicationText implements androidx.wear.complications.data.ComplicationText {
- method public java.util.concurrent.TimeUnit? getMinimumTimeUnit();
- }
-
- public static final class TimeDifferenceComplicationText.Builder {
- ctor public TimeDifferenceComplicationText.Builder(androidx.wear.complications.data.TimeDifferenceStyle style, androidx.wear.complications.data.CountUpTimeReference countUpTimeReference);
- ctor public TimeDifferenceComplicationText.Builder(androidx.wear.complications.data.TimeDifferenceStyle style, androidx.wear.complications.data.CountDownTimeReference countDownTimeReference);
- method public androidx.wear.complications.data.TimeDifferenceComplicationText build();
- method public androidx.wear.complications.data.TimeDifferenceComplicationText.Builder setDisplayAsNow(boolean displayAsNow);
- method public androidx.wear.complications.data.TimeDifferenceComplicationText.Builder setMinimumTimeUnit(java.util.concurrent.TimeUnit? minimumUnit);
- method public androidx.wear.complications.data.TimeDifferenceComplicationText.Builder setText(CharSequence? text);
- }
-
- public enum TimeDifferenceStyle {
- enum_constant public static final androidx.wear.complications.data.TimeDifferenceStyle SHORT_DUAL_UNIT;
- enum_constant public static final androidx.wear.complications.data.TimeDifferenceStyle SHORT_SINGLE_UNIT;
- enum_constant public static final androidx.wear.complications.data.TimeDifferenceStyle SHORT_WORDS_SINGLE_UNIT;
- enum_constant public static final androidx.wear.complications.data.TimeDifferenceStyle STOPWATCH;
- enum_constant public static final androidx.wear.complications.data.TimeDifferenceStyle WORDS_SINGLE_UNIT;
- }
-
- public final class TimeFormatComplicationText implements androidx.wear.complications.data.ComplicationText {
- }
-
- public static final class TimeFormatComplicationText.Builder {
- ctor public TimeFormatComplicationText.Builder(String format);
- method public androidx.wear.complications.data.TimeFormatComplicationText build();
- method public androidx.wear.complications.data.TimeFormatComplicationText.Builder setStyle(androidx.wear.complications.data.TimeFormatStyle style);
- method public androidx.wear.complications.data.TimeFormatComplicationText.Builder setText(CharSequence text);
- method public androidx.wear.complications.data.TimeFormatComplicationText.Builder setTimeZone(android.icu.util.TimeZone timeZone);
- }
-
- public enum TimeFormatStyle {
- enum_constant public static final androidx.wear.complications.data.TimeFormatStyle DEFAULT;
- enum_constant public static final androidx.wear.complications.data.TimeFormatStyle LOWER_CASE;
- enum_constant public static final androidx.wear.complications.data.TimeFormatStyle UPPER_CASE;
- }
-
- public final class TimeRange {
- method public static androidx.wear.complications.data.TimeRange after(java.time.Instant startInstant);
- method public static androidx.wear.complications.data.TimeRange before(java.time.Instant endInstant);
- method public static androidx.wear.complications.data.TimeRange between(java.time.Instant startInstant, java.time.Instant endInstant);
- method public operator boolean contains(java.time.Instant dateTimeMillis);
- method public java.time.Instant getEndDateTimeMillis();
- method public java.time.Instant getStartDateTimeMillis();
- property public final java.time.Instant endDateTimeMillis;
- property public final java.time.Instant startDateTimeMillis;
- field public static final androidx.wear.complications.data.TimeRange ALWAYS;
- field public static final androidx.wear.complications.data.TimeRange.Companion Companion;
- }
-
- public static final class TimeRange.Companion {
- method public androidx.wear.complications.data.TimeRange after(java.time.Instant startInstant);
- method public androidx.wear.complications.data.TimeRange before(java.time.Instant endInstant);
- method public androidx.wear.complications.data.TimeRange between(java.time.Instant startInstant, java.time.Instant endInstant);
- }
-
- public final class TypeKt {
- }
-
-}
-
-package androidx.wear.utility {
-
- public final class TraceEventKt {
- }
-
-}
-
diff --git a/wear/wear-complications-data/api/restricted_current.txt b/wear/wear-complications-data/api/restricted_current.txt
deleted file mode 100644
index d7aaa47..0000000
--- a/wear/wear-complications-data/api/restricted_current.txt
+++ /dev/null
@@ -1,603 +0,0 @@
-// Signature format: 4.0
-package @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) android.support.wearable.complications {
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public final class ComplicationData implements android.os.Parcelable {
- method public int describeContents();
- method public android.graphics.drawable.Icon? getBurnInProtectionIcon();
- method public android.graphics.drawable.Icon? getBurnInProtectionSmallImage();
- method public android.support.wearable.complications.ComplicationText? getContentDescription();
- method public long getEndDateTimeMillis();
- method public android.graphics.drawable.Icon? getIcon();
- method public android.graphics.drawable.Icon? getLargeImage();
- method public android.support.wearable.complications.ComplicationText? getLongText();
- method public android.support.wearable.complications.ComplicationText? getLongTitle();
- method public float getRangedMaxValue();
- method public float getRangedMinValue();
- method public float getRangedValue();
- method public android.support.wearable.complications.ComplicationText? getShortText();
- method public android.support.wearable.complications.ComplicationText? getShortTitle();
- method public android.graphics.drawable.Icon? getSmallImage();
- method @android.support.wearable.complications.ComplicationData.ImageStyle public int getSmallImageStyle();
- method public long getStartDateTimeMillis();
- method public android.app.PendingIntent? getTapAction();
- method @android.support.wearable.complications.ComplicationData.ComplicationType public int getType();
- method public boolean hasBurnInProtectionIcon();
- method public boolean hasBurnInProtectionSmallImage();
- method public boolean hasContentDescription();
- method public boolean hasIcon();
- method public boolean hasLargeImage();
- method public boolean hasLongText();
- method public boolean hasLongTitle();
- method public boolean hasRangedMaxValue();
- method public boolean hasRangedMinValue();
- method public boolean hasRangedValue();
- method public boolean hasShortText();
- method public boolean hasShortTitle();
- method public boolean hasSmallImage();
- method public boolean hasTapAction();
- method public boolean isActiveAt(long);
- method public boolean isTimeDependent();
- method public void writeToParcel(android.os.Parcel, int);
- field public static final android.os.Parcelable.Creator<android.support.wearable.complications.ComplicationData!> CREATOR;
- field public static final int IMAGE_STYLE_ICON = 2; // 0x2
- field public static final int IMAGE_STYLE_PHOTO = 1; // 0x1
- field public static final int TYPE_EMPTY = 2; // 0x2
- field public static final int TYPE_ICON = 6; // 0x6
- field public static final int TYPE_LARGE_IMAGE = 8; // 0x8
- field public static final int TYPE_LONG_TEXT = 4; // 0x4
- field public static final int TYPE_NOT_CONFIGURED = 1; // 0x1
- field public static final int TYPE_NO_DATA = 10; // 0xa
- field public static final int TYPE_NO_PERMISSION = 9; // 0x9
- field public static final int TYPE_RANGED_VALUE = 5; // 0x5
- field public static final int TYPE_SHORT_TEXT = 3; // 0x3
- field public static final int TYPE_SMALL_IMAGE = 7; // 0x7
- }
-
- public static final class ComplicationData.Builder {
- ctor public ComplicationData.Builder(android.support.wearable.complications.ComplicationData);
- ctor public ComplicationData.Builder(@android.support.wearable.complications.ComplicationData.ComplicationType int);
- method public android.support.wearable.complications.ComplicationData build();
- method public android.support.wearable.complications.ComplicationData.Builder clearEndDateTime();
- method public android.support.wearable.complications.ComplicationData.Builder clearStartDateTime();
- method public android.support.wearable.complications.ComplicationData.Builder setBurnInProtectionIcon(android.graphics.drawable.Icon?);
- method public android.support.wearable.complications.ComplicationData.Builder setBurnInProtectionSmallImage(android.graphics.drawable.Icon?);
- method public android.support.wearable.complications.ComplicationData.Builder setContentDescription(android.support.wearable.complications.ComplicationText?);
- method public android.support.wearable.complications.ComplicationData.Builder setEndDateTimeMillis(long);
- method public android.support.wearable.complications.ComplicationData.Builder setIcon(android.graphics.drawable.Icon?);
- method public android.support.wearable.complications.ComplicationData.Builder setLargeImage(android.graphics.drawable.Icon?);
- method public android.support.wearable.complications.ComplicationData.Builder setLongText(android.support.wearable.complications.ComplicationText?);
- method public android.support.wearable.complications.ComplicationData.Builder setLongTitle(android.support.wearable.complications.ComplicationText?);
- method public android.support.wearable.complications.ComplicationData.Builder setRangedMaxValue(float);
- method public android.support.wearable.complications.ComplicationData.Builder setRangedMinValue(float);
- method public android.support.wearable.complications.ComplicationData.Builder setRangedValue(float);
- method public android.support.wearable.complications.ComplicationData.Builder setShortText(android.support.wearable.complications.ComplicationText?);
- method public android.support.wearable.complications.ComplicationData.Builder setShortTitle(android.support.wearable.complications.ComplicationText?);
- method public android.support.wearable.complications.ComplicationData.Builder setSmallImage(android.graphics.drawable.Icon?);
- method public android.support.wearable.complications.ComplicationData.Builder setSmallImageStyle(@android.support.wearable.complications.ComplicationData.ImageStyle int);
- method public android.support.wearable.complications.ComplicationData.Builder setStartDateTimeMillis(long);
- method public android.support.wearable.complications.ComplicationData.Builder setTapAction(android.app.PendingIntent?);
- }
-
- @IntDef({android.support.wearable.complications.ComplicationData.TYPE_EMPTY, android.support.wearable.complications.ComplicationData.TYPE_NOT_CONFIGURED, android.support.wearable.complications.ComplicationData.TYPE_SHORT_TEXT, android.support.wearable.complications.ComplicationData.TYPE_LONG_TEXT, android.support.wearable.complications.ComplicationData.TYPE_RANGED_VALUE, android.support.wearable.complications.ComplicationData.TYPE_ICON, android.support.wearable.complications.ComplicationData.TYPE_SMALL_IMAGE, android.support.wearable.complications.ComplicationData.TYPE_LARGE_IMAGE, android.support.wearable.complications.ComplicationData.TYPE_NO_PERMISSION, android.support.wearable.complications.ComplicationData.TYPE_NO_DATA}) @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) public static @interface ComplicationData.ComplicationType {
- }
-
- @IntDef({android.support.wearable.complications.ComplicationData.IMAGE_STYLE_PHOTO, android.support.wearable.complications.ComplicationData.IMAGE_STYLE_ICON}) @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) public static @interface ComplicationData.ImageStyle {
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public final class ComplicationProviderInfo implements android.os.Parcelable {
- ctor public ComplicationProviderInfo(String, String, android.graphics.drawable.Icon, @android.support.wearable.complications.ComplicationData.ComplicationType int, android.content.ComponentName?);
- ctor public ComplicationProviderInfo(android.os.Parcel);
- method public int describeContents();
- method public String? getAppName();
- method @android.support.wearable.complications.ComplicationData.ComplicationType public int getComplicationType();
- method public android.content.ComponentName? getProviderComponentName();
- method public android.graphics.drawable.Icon? getProviderIcon();
- method public String? getProviderName();
- method public void setAppName(String);
- method public void setComplicationType(@android.support.wearable.complications.ComplicationData.ComplicationType int);
- method public void setProviderComponentName(android.content.ComponentName);
- method public void setProviderIcon(android.graphics.drawable.Icon);
- method public void setProviderName(String);
- method public void writeToParcel(android.os.Parcel, int);
- field public static final android.os.Parcelable.Creator<android.support.wearable.complications.ComplicationProviderInfo!> CREATOR;
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public final class ComplicationText implements android.os.Parcelable android.support.wearable.complications.TimeDependentText {
- method public int describeContents();
- method public long getNextChangeTime(long);
- method public CharSequence getTextAt(android.content.res.Resources, long);
- method public boolean isAlwaysEmpty();
- method public static android.support.wearable.complications.ComplicationText plainText(CharSequence);
- method public boolean returnsSameText(long, long);
- method public void writeToParcel(android.os.Parcel, int);
- field public static final android.os.Parcelable.Creator<android.support.wearable.complications.ComplicationText!> CREATOR;
- field public static final int DIFFERENCE_STYLE_SHORT_DUAL_UNIT = 3; // 0x3
- field public static final int DIFFERENCE_STYLE_SHORT_SINGLE_UNIT = 2; // 0x2
- field public static final int DIFFERENCE_STYLE_SHORT_WORDS_SINGLE_UNIT = 5; // 0x5
- field public static final int DIFFERENCE_STYLE_STOPWATCH = 1; // 0x1
- field public static final int DIFFERENCE_STYLE_WORDS_SINGLE_UNIT = 4; // 0x4
- field public static final int FORMAT_STYLE_DEFAULT = 1; // 0x1
- field public static final int FORMAT_STYLE_LOWER_CASE = 3; // 0x3
- field public static final int FORMAT_STYLE_UPPER_CASE = 2; // 0x2
- }
-
- public static final class ComplicationText.TimeDifferenceBuilder {
- ctor public ComplicationText.TimeDifferenceBuilder();
- ctor public ComplicationText.TimeDifferenceBuilder(long, long);
- method public android.support.wearable.complications.ComplicationText build();
- method public android.support.wearable.complications.ComplicationText.TimeDifferenceBuilder setMinimumUnit(java.util.concurrent.TimeUnit?);
- method public android.support.wearable.complications.ComplicationText.TimeDifferenceBuilder setReferencePeriodEndMillis(long);
- method public android.support.wearable.complications.ComplicationText.TimeDifferenceBuilder setReferencePeriodStartMillis(long);
- method public android.support.wearable.complications.ComplicationText.TimeDifferenceBuilder setShowNowText(boolean);
- method public android.support.wearable.complications.ComplicationText.TimeDifferenceBuilder setStyle(@android.support.wearable.complications.ComplicationText.TimeDifferenceStyle int);
- method public android.support.wearable.complications.ComplicationText.TimeDifferenceBuilder setSurroundingText(CharSequence?);
- }
-
- @IntDef({android.support.wearable.complications.ComplicationText.DIFFERENCE_STYLE_STOPWATCH, android.support.wearable.complications.ComplicationText.DIFFERENCE_STYLE_SHORT_SINGLE_UNIT, android.support.wearable.complications.ComplicationText.DIFFERENCE_STYLE_SHORT_DUAL_UNIT, android.support.wearable.complications.ComplicationText.DIFFERENCE_STYLE_WORDS_SINGLE_UNIT, android.support.wearable.complications.ComplicationText.DIFFERENCE_STYLE_SHORT_WORDS_SINGLE_UNIT}) @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) public static @interface ComplicationText.TimeDifferenceStyle {
- }
-
- public static final class ComplicationText.TimeFormatBuilder {
- ctor public ComplicationText.TimeFormatBuilder();
- method public android.support.wearable.complications.ComplicationText build();
- method public android.support.wearable.complications.ComplicationText.TimeFormatBuilder setFormat(String?);
- method public android.support.wearable.complications.ComplicationText.TimeFormatBuilder setStyle(@android.support.wearable.complications.ComplicationText.TimeFormatStyle int);
- method public android.support.wearable.complications.ComplicationText.TimeFormatBuilder setSurroundingText(CharSequence?);
- method public android.support.wearable.complications.ComplicationText.TimeFormatBuilder setTimeZone(java.util.TimeZone?);
- }
-
- @IntDef({android.support.wearable.complications.ComplicationText.FORMAT_STYLE_DEFAULT, android.support.wearable.complications.ComplicationText.FORMAT_STYLE_UPPER_CASE, android.support.wearable.complications.ComplicationText.FORMAT_STYLE_LOWER_CASE}) @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) public static @interface ComplicationText.TimeFormatStyle {
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public interface TimeDependentText extends android.os.Parcelable {
- method public long getNextChangeTime(long);
- method public CharSequence getTextAt(android.content.res.Resources, long);
- method public boolean returnsSameText(long, long);
- }
-
-}
-
-package androidx.wear.complications {
-
- public final class ComplicationDataSourceInfo {
- ctor public ComplicationDataSourceInfo(String appName, String name, android.graphics.drawable.Icon icon, androidx.wear.complications.data.ComplicationType type, android.content.ComponentName? componentName);
- method public String getAppName();
- method public android.content.ComponentName? getComponentName();
- method public androidx.wear.complications.data.ComplicationData getFallbackPreviewData();
- method public android.graphics.drawable.Icon getIcon();
- method public String getName();
- method public androidx.wear.complications.data.ComplicationType getType();
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public android.support.wearable.complications.ComplicationProviderInfo toWireComplicationProviderInfo();
- property public final String appName;
- property public final android.content.ComponentName? componentName;
- property public final androidx.wear.complications.data.ComplicationData fallbackPreviewData;
- property public final android.graphics.drawable.Icon icon;
- property public final String name;
- property public final androidx.wear.complications.data.ComplicationType type;
- }
-
- public final class ComplicationDataSourceInfoRetriever implements java.lang.AutoCloseable {
- ctor public ComplicationDataSourceInfoRetriever(android.content.Context context);
- method public void close();
- method @kotlin.jvm.Throws(exceptionClasses=ServiceDisconnectedException::class) public suspend Object? retrieveComplicationDataSourceInfo(android.content.ComponentName watchFaceComponent, int[] watchFaceComplicationIds, kotlin.coroutines.Continuation<? super androidx.wear.complications.ComplicationDataSourceInfoRetriever.Result[]> p) throws androidx.wear.complications.ComplicationDataSourceInfoRetriever.ServiceDisconnectedException;
- method @RequiresApi(android.os.Build.VERSION_CODES.R) @kotlin.jvm.Throws(exceptionClasses=ServiceDisconnectedException::class) public suspend Object? retrievePreviewComplicationData(android.content.ComponentName complicationDataSourceComponent, androidx.wear.complications.data.ComplicationType complicationType, kotlin.coroutines.Continuation<? super androidx.wear.complications.data.ComplicationData> p) throws androidx.wear.complications.ComplicationDataSourceInfoRetriever.ServiceDisconnectedException;
- }
-
- public static final class ComplicationDataSourceInfoRetriever.Result {
- method public androidx.wear.complications.ComplicationDataSourceInfo? getInfo();
- method public int getSlotId();
- property public final androidx.wear.complications.ComplicationDataSourceInfo? info;
- property public final int slotId;
- }
-
- public static final class ComplicationDataSourceInfoRetriever.ServiceDisconnectedException extends java.lang.Exception {
- ctor public ComplicationDataSourceInfoRetriever.ServiceDisconnectedException();
- }
-
- public final class ComplicationDataSourceInfoRetrieverKt {
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public static androidx.wear.complications.ComplicationDataSourceInfo toApiComplicationDataSourceInfo(android.support.wearable.complications.ComplicationProviderInfo);
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public class ComplicationDataSourceUpdateRequesterConstants {
- field public static final String EXTRA_PENDING_INTENT = "android.support.wearable.complications.EXTRA_PENDING_INTENT";
- }
-
- public final class ComplicationSlotBounds {
- ctor public ComplicationSlotBounds(java.util.Map<androidx.wear.complications.data.ComplicationType,? extends android.graphics.RectF> perComplicationTypeBounds);
- ctor public ComplicationSlotBounds(android.graphics.RectF bounds);
- method public java.util.Map<androidx.wear.complications.data.ComplicationType,android.graphics.RectF> getPerComplicationTypeBounds();
- property public final java.util.Map<androidx.wear.complications.data.ComplicationType,android.graphics.RectF> perComplicationTypeBounds;
- }
-
- public final class DefaultComplicationDataSourcePolicy {
- ctor @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public DefaultComplicationDataSourcePolicy(java.util.List<android.content.ComponentName> dataSources, @androidx.wear.complications.SystemDataSources.DataSourceId int systemProviderFallback);
- ctor public DefaultComplicationDataSourcePolicy();
- ctor public DefaultComplicationDataSourcePolicy(@androidx.wear.complications.SystemDataSources.DataSourceId int systemProvider);
- ctor public DefaultComplicationDataSourcePolicy(android.content.ComponentName dataSource, @androidx.wear.complications.SystemDataSources.DataSourceId int systemDataSourceFallback);
- ctor public DefaultComplicationDataSourcePolicy(android.content.ComponentName primaryDataSource, android.content.ComponentName secondaryDataSource, @androidx.wear.complications.SystemDataSources.DataSourceId int systemDataSourceFallback);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public java.util.ArrayList<android.content.ComponentName> dataSourcesAsList();
- method public android.content.ComponentName? getPrimaryDataSource();
- method public android.content.ComponentName? getSecondaryDataSource();
- method public int getSystemDataSourceFallback();
- method public boolean isEmpty();
- property public final android.content.ComponentName? primaryDataSource;
- property public final android.content.ComponentName? secondaryDataSource;
- property public final int systemDataSourceFallback;
- }
-
- public final class SystemDataSources {
- field public static final androidx.wear.complications.SystemDataSources.Companion Companion;
- field public static final int DATA_SOURCE_APP_SHORTCUT = 6; // 0x6
- field public static final int DATA_SOURCE_DATE = 2; // 0x2
- field public static final int DATA_SOURCE_DAY_AND_DATE = 16; // 0x10
- field public static final int DATA_SOURCE_DAY_OF_WEEK = 13; // 0xd
- field public static final int DATA_SOURCE_FAVORITE_CONTACT = 14; // 0xe
- field public static final int DATA_SOURCE_NEXT_EVENT = 9; // 0x9
- field public static final int DATA_SOURCE_STEP_COUNT = 4; // 0x4
- field public static final int DATA_SOURCE_SUNRISE_SUNSET = 12; // 0xc
- field public static final int DATA_SOURCE_TIME_AND_DATE = 3; // 0x3
- field public static final int DATA_SOURCE_UNREAD_NOTIFICATION_COUNT = 7; // 0x7
- field public static final int DATA_SOURCE_WATCH_BATTERY = 1; // 0x1
- field public static final int DATA_SOURCE_WORLD_CLOCK = 5; // 0x5
- field public static final int NO_DATA_SOURCE = -1; // 0xffffffff
- }
-
- public static final class SystemDataSources.Companion {
- }
-
- @IntDef({androidx.wear.complications.SystemDataSources.NO_DATA_SOURCE, androidx.wear.complications.SystemDataSources.DATA_SOURCE_WATCH_BATTERY, androidx.wear.complications.SystemDataSources.DATA_SOURCE_DATE, androidx.wear.complications.SystemDataSources.DATA_SOURCE_TIME_AND_DATE, androidx.wear.complications.SystemDataSources.DATA_SOURCE_STEP_COUNT, androidx.wear.complications.SystemDataSources.DATA_SOURCE_WORLD_CLOCK, androidx.wear.complications.SystemDataSources.DATA_SOURCE_APP_SHORTCUT, androidx.wear.complications.SystemDataSources.DATA_SOURCE_UNREAD_NOTIFICATION_COUNT, androidx.wear.complications.SystemDataSources.DATA_SOURCE_NEXT_EVENT, androidx.wear.complications.SystemDataSources.DATA_SOURCE_SUNRISE_SUNSET, androidx.wear.complications.SystemDataSources.DATA_SOURCE_DAY_OF_WEEK, androidx.wear.complications.SystemDataSources.DATA_SOURCE_FAVORITE_CONTACT, androidx.wear.complications.SystemDataSources.DATA_SOURCE_DAY_AND_DATE}) @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) @kotlin.annotation.Retention(kotlin.annotation.AnnotationRetention) public static @interface SystemDataSources.DataSourceId {
- }
-
-}
-
-package androidx.wear.complications.data {
-
- public abstract sealed class ComplicationData {
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public abstract android.support.wearable.complications.ComplicationData asWireComplicationData();
- method public final android.app.PendingIntent? getTapAction();
- method public final androidx.wear.complications.data.ComplicationType getType();
- method public final androidx.wear.complications.data.TimeRange getValidTimeRange();
- property public final android.app.PendingIntent? tapAction;
- property public final androidx.wear.complications.data.ComplicationType type;
- property public final androidx.wear.complications.data.TimeRange validTimeRange;
- }
-
- public interface ComplicationText {
- method public java.time.Instant getNextChangeTime(java.time.Instant afterInstant);
- method public CharSequence getTextAt(android.content.res.Resources resources, java.time.Instant instant);
- method public boolean isAlwaysEmpty();
- method public boolean returnsSameText(java.time.Instant firstInstant, java.time.Instant secondInstant);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public android.support.wearable.complications.ComplicationText toWireComplicationText();
- field public static final androidx.wear.complications.data.ComplicationText.Companion Companion;
- field public static final androidx.wear.complications.data.ComplicationText EMPTY;
- }
-
- public static final class ComplicationText.Companion {
- }
-
- public enum ComplicationType {
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public static final java.util.List<androidx.wear.complications.data.ComplicationType> fromWireTypeList(int[] types);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public static final androidx.wear.complications.data.ComplicationType![] fromWireTypes(int[] types);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public static final int[] toWireTypes(java.util.Collection<? extends androidx.wear.complications.data.ComplicationType> types);
- enum_constant public static final androidx.wear.complications.data.ComplicationType EMPTY;
- enum_constant public static final androidx.wear.complications.data.ComplicationType LONG_TEXT;
- enum_constant public static final androidx.wear.complications.data.ComplicationType MONOCHROMATIC_IMAGE;
- enum_constant public static final androidx.wear.complications.data.ComplicationType NOT_CONFIGURED;
- enum_constant public static final androidx.wear.complications.data.ComplicationType NO_DATA;
- enum_constant public static final androidx.wear.complications.data.ComplicationType NO_PERMISSION;
- enum_constant public static final androidx.wear.complications.data.ComplicationType PHOTO_IMAGE;
- enum_constant public static final androidx.wear.complications.data.ComplicationType RANGED_VALUE;
- enum_constant public static final androidx.wear.complications.data.ComplicationType SHORT_TEXT;
- enum_constant public static final androidx.wear.complications.data.ComplicationType SMALL_IMAGE;
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public static final class ComplicationType.Companion {
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public java.util.List<androidx.wear.complications.data.ComplicationType> fromWireTypeList(int[] types);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public androidx.wear.complications.data.ComplicationType![] fromWireTypes(int[] types);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public int[] toWireTypes(java.util.Collection<? extends androidx.wear.complications.data.ComplicationType> types);
- }
-
- public final class CountDownTimeReference {
- ctor public CountDownTimeReference(java.time.Instant instant);
- method public java.time.Instant getInstant();
- property public final java.time.Instant instant;
- }
-
- public final class CountUpTimeReference {
- ctor public CountUpTimeReference(java.time.Instant instant);
- method public java.time.Instant getInstant();
- property public final java.time.Instant instant;
- }
-
- public final class DataKt {
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public static androidx.wear.complications.data.ComplicationData toApiComplicationData(android.support.wearable.complications.ComplicationData);
- }
-
- public final class EmptyComplicationData extends androidx.wear.complications.data.ComplicationData {
- ctor public EmptyComplicationData();
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public android.support.wearable.complications.ComplicationData asWireComplicationData();
- field public static final androidx.wear.complications.data.ComplicationType TYPE;
- }
-
- public final class LongTextComplicationData extends androidx.wear.complications.data.ComplicationData {
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public android.support.wearable.complications.ComplicationData asWireComplicationData();
- method public androidx.wear.complications.data.ComplicationText? getContentDescription();
- method public androidx.wear.complications.data.MonochromaticImage? getMonochromaticImage();
- method public androidx.wear.complications.data.SmallImage? getSmallImage();
- method public androidx.wear.complications.data.ComplicationText getText();
- method public androidx.wear.complications.data.ComplicationText? getTitle();
- property public final androidx.wear.complications.data.ComplicationText? contentDescription;
- property public final androidx.wear.complications.data.MonochromaticImage? monochromaticImage;
- property public final androidx.wear.complications.data.SmallImage? smallImage;
- property public final androidx.wear.complications.data.ComplicationText text;
- property public final androidx.wear.complications.data.ComplicationText? title;
- field public static final androidx.wear.complications.data.ComplicationType TYPE;
- }
-
- public static final class LongTextComplicationData.Builder {
- ctor public LongTextComplicationData.Builder(androidx.wear.complications.data.ComplicationText text, androidx.wear.complications.data.ComplicationText contentDescription);
- method public androidx.wear.complications.data.LongTextComplicationData build();
- method public androidx.wear.complications.data.LongTextComplicationData.Builder setMonochromaticImage(androidx.wear.complications.data.MonochromaticImage? icon);
- method public androidx.wear.complications.data.LongTextComplicationData.Builder setSmallImage(androidx.wear.complications.data.SmallImage? smallImage);
- method public androidx.wear.complications.data.LongTextComplicationData.Builder setTapAction(android.app.PendingIntent? tapAction);
- method public androidx.wear.complications.data.LongTextComplicationData.Builder setTitle(androidx.wear.complications.data.ComplicationText? title);
- method public androidx.wear.complications.data.LongTextComplicationData.Builder setValidTimeRange(androidx.wear.complications.data.TimeRange? validTimeRange);
- }
-
- public final class MonochromaticImage {
- method public android.graphics.drawable.Icon? getAmbientImage();
- method public android.graphics.drawable.Icon getImage();
- property public final android.graphics.drawable.Icon? ambientImage;
- property public final android.graphics.drawable.Icon image;
- }
-
- public static final class MonochromaticImage.Builder {
- ctor public MonochromaticImage.Builder(android.graphics.drawable.Icon image);
- method public androidx.wear.complications.data.MonochromaticImage build();
- method public androidx.wear.complications.data.MonochromaticImage.Builder setAmbientImage(android.graphics.drawable.Icon? ambientImage);
- }
-
- public final class MonochromaticImageComplicationData extends androidx.wear.complications.data.ComplicationData {
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public android.support.wearable.complications.ComplicationData asWireComplicationData();
- method public androidx.wear.complications.data.ComplicationText? getContentDescription();
- method public androidx.wear.complications.data.MonochromaticImage getMonochromaticImage();
- property public final androidx.wear.complications.data.ComplicationText? contentDescription;
- property public final androidx.wear.complications.data.MonochromaticImage monochromaticImage;
- field public static final androidx.wear.complications.data.ComplicationType TYPE;
- }
-
- public static final class MonochromaticImageComplicationData.Builder {
- ctor public MonochromaticImageComplicationData.Builder(androidx.wear.complications.data.MonochromaticImage monochromaticImage, androidx.wear.complications.data.ComplicationText contentDescription);
- method public androidx.wear.complications.data.MonochromaticImageComplicationData build();
- method public androidx.wear.complications.data.MonochromaticImageComplicationData.Builder setTapAction(android.app.PendingIntent? tapAction);
- method public androidx.wear.complications.data.MonochromaticImageComplicationData.Builder setValidTimeRange(androidx.wear.complications.data.TimeRange? validTimeRange);
- }
-
- public final class NoDataComplicationData extends androidx.wear.complications.data.ComplicationData {
- ctor public NoDataComplicationData();
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public android.support.wearable.complications.ComplicationData asWireComplicationData();
- field public static final androidx.wear.complications.data.ComplicationType TYPE;
- }
-
- public final class NoPermissionComplicationData extends androidx.wear.complications.data.ComplicationData {
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public android.support.wearable.complications.ComplicationData asWireComplicationData();
- method public androidx.wear.complications.data.MonochromaticImage? getMonochromaticImage();
- method public androidx.wear.complications.data.ComplicationText? getText();
- method public androidx.wear.complications.data.ComplicationText? getTitle();
- property public final androidx.wear.complications.data.MonochromaticImage? monochromaticImage;
- property public final androidx.wear.complications.data.ComplicationText? text;
- property public final androidx.wear.complications.data.ComplicationText? title;
- field public static final androidx.wear.complications.data.ComplicationType TYPE;
- }
-
- public static final class NoPermissionComplicationData.Builder {
- ctor public NoPermissionComplicationData.Builder();
- method public androidx.wear.complications.data.NoPermissionComplicationData build();
- method public androidx.wear.complications.data.NoPermissionComplicationData.Builder setMonochromaticImage(androidx.wear.complications.data.MonochromaticImage? monochromaticImage);
- method public androidx.wear.complications.data.NoPermissionComplicationData.Builder setText(androidx.wear.complications.data.ComplicationText? text);
- method public androidx.wear.complications.data.NoPermissionComplicationData.Builder setTitle(androidx.wear.complications.data.ComplicationText? title);
- }
-
- public final class NotConfiguredComplicationData extends androidx.wear.complications.data.ComplicationData {
- ctor public NotConfiguredComplicationData();
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public android.support.wearable.complications.ComplicationData asWireComplicationData();
- field public static final androidx.wear.complications.data.ComplicationType TYPE;
- }
-
- public final class PhotoImageComplicationData extends androidx.wear.complications.data.ComplicationData {
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public android.support.wearable.complications.ComplicationData asWireComplicationData();
- method public androidx.wear.complications.data.ComplicationText? getContentDescription();
- method public android.graphics.drawable.Icon getPhotoImage();
- property public final androidx.wear.complications.data.ComplicationText? contentDescription;
- property public final android.graphics.drawable.Icon photoImage;
- field public static final androidx.wear.complications.data.ComplicationType TYPE;
- }
-
- public static final class PhotoImageComplicationData.Builder {
- ctor public PhotoImageComplicationData.Builder(android.graphics.drawable.Icon photoImage, androidx.wear.complications.data.ComplicationText contentDescription);
- method public androidx.wear.complications.data.PhotoImageComplicationData build();
- method public androidx.wear.complications.data.PhotoImageComplicationData.Builder setTapAction(android.app.PendingIntent? tapAction);
- method public androidx.wear.complications.data.PhotoImageComplicationData.Builder setValidTimeRange(androidx.wear.complications.data.TimeRange? validTimeRange);
- }
-
- public final class PlainComplicationText implements androidx.wear.complications.data.ComplicationText {
- }
-
- public static final class PlainComplicationText.Builder {
- ctor public PlainComplicationText.Builder(CharSequence text);
- method public androidx.wear.complications.data.PlainComplicationText build();
- }
-
- public final class RangedValueComplicationData extends androidx.wear.complications.data.ComplicationData {
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public android.support.wearable.complications.ComplicationData asWireComplicationData();
- method public androidx.wear.complications.data.ComplicationText? getContentDescription();
- method public float getMax();
- method public float getMin();
- method public androidx.wear.complications.data.MonochromaticImage? getMonochromaticImage();
- method public androidx.wear.complications.data.ComplicationText? getText();
- method public androidx.wear.complications.data.ComplicationText? getTitle();
- method public float getValue();
- property public final androidx.wear.complications.data.ComplicationText? contentDescription;
- property public final float max;
- property public final float min;
- property public final androidx.wear.complications.data.MonochromaticImage? monochromaticImage;
- property public final androidx.wear.complications.data.ComplicationText? text;
- property public final androidx.wear.complications.data.ComplicationText? title;
- property public final float value;
- field public static final androidx.wear.complications.data.ComplicationType TYPE;
- }
-
- public static final class RangedValueComplicationData.Builder {
- ctor public RangedValueComplicationData.Builder(float value, float min, float max, androidx.wear.complications.data.ComplicationText contentDescription);
- method public androidx.wear.complications.data.RangedValueComplicationData build();
- method public androidx.wear.complications.data.RangedValueComplicationData.Builder setMonochromaticImage(androidx.wear.complications.data.MonochromaticImage? monochromaticImage);
- method public androidx.wear.complications.data.RangedValueComplicationData.Builder setTapAction(android.app.PendingIntent? tapAction);
- method public androidx.wear.complications.data.RangedValueComplicationData.Builder setText(androidx.wear.complications.data.ComplicationText? text);
- method public androidx.wear.complications.data.RangedValueComplicationData.Builder setTitle(androidx.wear.complications.data.ComplicationText? title);
- method public androidx.wear.complications.data.RangedValueComplicationData.Builder setValidTimeRange(androidx.wear.complications.data.TimeRange? validTimeRange);
- }
-
- public final class ShortTextComplicationData extends androidx.wear.complications.data.ComplicationData {
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public android.support.wearable.complications.ComplicationData asWireComplicationData();
- method public androidx.wear.complications.data.ComplicationText? getContentDescription();
- method public androidx.wear.complications.data.MonochromaticImage? getMonochromaticImage();
- method public androidx.wear.complications.data.ComplicationText getText();
- method public androidx.wear.complications.data.ComplicationText? getTitle();
- property public final androidx.wear.complications.data.ComplicationText? contentDescription;
- property public final androidx.wear.complications.data.MonochromaticImage? monochromaticImage;
- property public final androidx.wear.complications.data.ComplicationText text;
- property public final androidx.wear.complications.data.ComplicationText? title;
- field public static final int MAX_TEXT_LENGTH;
- field public static final androidx.wear.complications.data.ComplicationType TYPE;
- }
-
- public static final class ShortTextComplicationData.Builder {
- ctor public ShortTextComplicationData.Builder(androidx.wear.complications.data.ComplicationText text, androidx.wear.complications.data.ComplicationText contentDescription);
- method public androidx.wear.complications.data.ShortTextComplicationData build();
- method public androidx.wear.complications.data.ShortTextComplicationData.Builder setMonochromaticImage(androidx.wear.complications.data.MonochromaticImage? monochromaticImage);
- method public androidx.wear.complications.data.ShortTextComplicationData.Builder setTapAction(android.app.PendingIntent? tapAction);
- method public androidx.wear.complications.data.ShortTextComplicationData.Builder setTitle(androidx.wear.complications.data.ComplicationText? title);
- method public androidx.wear.complications.data.ShortTextComplicationData.Builder setValidTimeRange(androidx.wear.complications.data.TimeRange? validTimeRange);
- }
-
- public final class SmallImage {
- method public android.graphics.drawable.Icon? getAmbientImage();
- method public android.graphics.drawable.Icon getImage();
- method public androidx.wear.complications.data.SmallImageType getType();
- property public final android.graphics.drawable.Icon? ambientImage;
- property public final android.graphics.drawable.Icon image;
- property public final androidx.wear.complications.data.SmallImageType type;
- }
-
- public static final class SmallImage.Builder {
- ctor public SmallImage.Builder(android.graphics.drawable.Icon image, androidx.wear.complications.data.SmallImageType type);
- method public androidx.wear.complications.data.SmallImage build();
- method public androidx.wear.complications.data.SmallImage.Builder setAmbientImage(android.graphics.drawable.Icon? ambientImage);
- }
-
- public final class SmallImageComplicationData extends androidx.wear.complications.data.ComplicationData {
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public android.support.wearable.complications.ComplicationData asWireComplicationData();
- method public androidx.wear.complications.data.ComplicationText? getContentDescription();
- method public androidx.wear.complications.data.SmallImage getSmallImage();
- property public final androidx.wear.complications.data.ComplicationText? contentDescription;
- property public final androidx.wear.complications.data.SmallImage smallImage;
- field public static final androidx.wear.complications.data.ComplicationType TYPE;
- }
-
- public static final class SmallImageComplicationData.Builder {
- ctor public SmallImageComplicationData.Builder(androidx.wear.complications.data.SmallImage smallImage, androidx.wear.complications.data.ComplicationText contentDescription);
- method public androidx.wear.complications.data.SmallImageComplicationData build();
- method public androidx.wear.complications.data.SmallImageComplicationData.Builder setTapAction(android.app.PendingIntent? tapAction);
- method public androidx.wear.complications.data.SmallImageComplicationData.Builder setValidTimeRange(androidx.wear.complications.data.TimeRange? validTimeRange);
- }
-
- public enum SmallImageType {
- enum_constant public static final androidx.wear.complications.data.SmallImageType ICON;
- enum_constant public static final androidx.wear.complications.data.SmallImageType PHOTO;
- }
-
- public final class TextKt {
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public static androidx.wear.complications.data.ComplicationText toApiComplicationText(android.support.wearable.complications.TimeDependentText);
- }
-
- public final class TimeDifferenceComplicationText implements androidx.wear.complications.data.ComplicationText {
- method public java.util.concurrent.TimeUnit? getMinimumTimeUnit();
- }
-
- public static final class TimeDifferenceComplicationText.Builder {
- ctor public TimeDifferenceComplicationText.Builder(androidx.wear.complications.data.TimeDifferenceStyle style, androidx.wear.complications.data.CountUpTimeReference countUpTimeReference);
- ctor public TimeDifferenceComplicationText.Builder(androidx.wear.complications.data.TimeDifferenceStyle style, androidx.wear.complications.data.CountDownTimeReference countDownTimeReference);
- method public androidx.wear.complications.data.TimeDifferenceComplicationText build();
- method public androidx.wear.complications.data.TimeDifferenceComplicationText.Builder setDisplayAsNow(boolean displayAsNow);
- method public androidx.wear.complications.data.TimeDifferenceComplicationText.Builder setMinimumTimeUnit(java.util.concurrent.TimeUnit? minimumUnit);
- method public androidx.wear.complications.data.TimeDifferenceComplicationText.Builder setText(CharSequence? text);
- }
-
- public enum TimeDifferenceStyle {
- enum_constant public static final androidx.wear.complications.data.TimeDifferenceStyle SHORT_DUAL_UNIT;
- enum_constant public static final androidx.wear.complications.data.TimeDifferenceStyle SHORT_SINGLE_UNIT;
- enum_constant public static final androidx.wear.complications.data.TimeDifferenceStyle SHORT_WORDS_SINGLE_UNIT;
- enum_constant public static final androidx.wear.complications.data.TimeDifferenceStyle STOPWATCH;
- enum_constant public static final androidx.wear.complications.data.TimeDifferenceStyle WORDS_SINGLE_UNIT;
- }
-
- public final class TimeFormatComplicationText implements androidx.wear.complications.data.ComplicationText {
- }
-
- public static final class TimeFormatComplicationText.Builder {
- ctor public TimeFormatComplicationText.Builder(String format);
- method public androidx.wear.complications.data.TimeFormatComplicationText build();
- method public androidx.wear.complications.data.TimeFormatComplicationText.Builder setStyle(androidx.wear.complications.data.TimeFormatStyle style);
- method public androidx.wear.complications.data.TimeFormatComplicationText.Builder setText(CharSequence text);
- method public androidx.wear.complications.data.TimeFormatComplicationText.Builder setTimeZone(android.icu.util.TimeZone timeZone);
- }
-
- public enum TimeFormatStyle {
- enum_constant public static final androidx.wear.complications.data.TimeFormatStyle DEFAULT;
- enum_constant public static final androidx.wear.complications.data.TimeFormatStyle LOWER_CASE;
- enum_constant public static final androidx.wear.complications.data.TimeFormatStyle UPPER_CASE;
- }
-
- public final class TimeRange {
- method public static androidx.wear.complications.data.TimeRange after(java.time.Instant startInstant);
- method public static androidx.wear.complications.data.TimeRange before(java.time.Instant endInstant);
- method public static androidx.wear.complications.data.TimeRange between(java.time.Instant startInstant, java.time.Instant endInstant);
- method public operator boolean contains(java.time.Instant dateTimeMillis);
- method public java.time.Instant getEndDateTimeMillis();
- method public java.time.Instant getStartDateTimeMillis();
- property public final java.time.Instant endDateTimeMillis;
- property public final java.time.Instant startDateTimeMillis;
- field public static final androidx.wear.complications.data.TimeRange ALWAYS;
- field public static final androidx.wear.complications.data.TimeRange.Companion Companion;
- }
-
- public static final class TimeRange.Companion {
- method public androidx.wear.complications.data.TimeRange after(java.time.Instant startInstant);
- method public androidx.wear.complications.data.TimeRange before(java.time.Instant endInstant);
- method public androidx.wear.complications.data.TimeRange between(java.time.Instant startInstant, java.time.Instant endInstant);
- }
-
- public final class TypeKt {
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public static androidx.wear.complications.data.ComplicationType![] toApiComplicationTypes(int[]);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public static int[] toWireTypes(java.util.Collection<? extends androidx.wear.complications.data.ComplicationType>);
- }
-
-}
-
-package androidx.wear.utility {
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public final class AsyncTraceEvent implements java.io.Closeable {
- ctor public AsyncTraceEvent(String traceName);
- method public void close();
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public final class TraceEvent implements java.io.Closeable {
- ctor public TraceEvent(String traceName);
- method public void close();
- }
-
- public final class TraceEventKt {
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public static kotlinx.coroutines.Job launchWithTracing(kotlinx.coroutines.CoroutineScope, String traceEventName, kotlin.jvm.functions.Function2<? super kotlinx.coroutines.CoroutineScope,? super kotlin.coroutines.Continuation<? super kotlin.Unit>,?> block);
- }
-
-}
-
diff --git a/wear/wear-remote-interactions/api/api_lint.ignore b/wear/wear-remote-interactions/api/api_lint.ignore
new file mode 100644
index 0000000..12e000d
--- /dev/null
+++ b/wear/wear-remote-interactions/api/api_lint.ignore
@@ -0,0 +1,5 @@
+// Baseline format: 1.0
+AsyncSuffixFuture: androidx.wear.remote.interactions.RemoteActivityHelper#startRemoteActivity(android.content.Intent):
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
+AsyncSuffixFuture: androidx.wear.remote.interactions.RemoteActivityHelper#startRemoteActivity(android.content.Intent, String):
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
diff --git a/wear/wear-watchface-client/api/restricted_current.txt b/wear/wear-watchface-client/api/restricted_current.txt
deleted file mode 100644
index 3229976..0000000
--- a/wear/wear-watchface-client/api/restricted_current.txt
+++ /dev/null
@@ -1,189 +0,0 @@
-// Signature format: 4.0
-package androidx.wear.watchface.client {
-
- public final class ComplicationSlotState {
- ctor public ComplicationSlotState(android.graphics.Rect bounds, @androidx.wear.watchface.ComplicationSlotBoundsType int boundsType, java.util.List<? extends androidx.wear.complications.data.ComplicationType> supportedTypes, androidx.wear.complications.DefaultComplicationDataSourcePolicy defaultDataSourcePolicy, androidx.wear.complications.data.ComplicationType defaultDataSourceType, boolean isEnabled, boolean isInitiallyEnabled, androidx.wear.complications.data.ComplicationType currentType, boolean fixedComplicationDataSource, android.os.Bundle complicationConfigExtras);
- ctor @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public ComplicationSlotState(androidx.wear.watchface.data.ComplicationStateWireFormat complicationStateWireFormat);
- method public android.graphics.Rect getBounds();
- method public int getBoundsType();
- method public android.os.Bundle getComplicationConfigExtras();
- method public androidx.wear.complications.data.ComplicationType getCurrentType();
- method public androidx.wear.complications.DefaultComplicationDataSourcePolicy getDefaultDataSourcePolicy();
- method public androidx.wear.complications.data.ComplicationType getDefaultDataSourceType();
- method public boolean getFixedComplicationDataSource();
- method public java.util.List<androidx.wear.complications.data.ComplicationType> getSupportedTypes();
- method public boolean isEnabled();
- method public boolean isInitiallyEnabled();
- property public final android.graphics.Rect bounds;
- property public final int boundsType;
- property public final android.os.Bundle complicationConfigExtras;
- property public final androidx.wear.complications.data.ComplicationType currentType;
- property public final androidx.wear.complications.DefaultComplicationDataSourcePolicy defaultDataSourcePolicy;
- property public final androidx.wear.complications.data.ComplicationType defaultDataSourceType;
- property public final boolean fixedComplicationDataSource;
- property public final boolean isEnabled;
- property public final boolean isInitiallyEnabled;
- property public final java.util.List<androidx.wear.complications.data.ComplicationType> supportedTypes;
- }
-
- public final class DefaultComplicationDataSourcePolicyAndType {
- ctor public DefaultComplicationDataSourcePolicyAndType(androidx.wear.complications.DefaultComplicationDataSourcePolicy policy, androidx.wear.complications.data.ComplicationType type);
- method public androidx.wear.complications.DefaultComplicationDataSourcePolicy getPolicy();
- method public androidx.wear.complications.data.ComplicationType getType();
- property public final androidx.wear.complications.DefaultComplicationDataSourcePolicy policy;
- property public final androidx.wear.complications.data.ComplicationType type;
- }
-
- public final class DeviceConfig {
- ctor public DeviceConfig(boolean hasLowBitAmbient, boolean hasBurnInProtection, long analogPreviewReferenceTimeMillis, long digitalPreviewReferenceTimeMillis);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public androidx.wear.watchface.data.DeviceConfig asWireDeviceConfig();
- method public long getAnalogPreviewReferenceTimeMillis();
- method public long getDigitalPreviewReferenceTimeMillis();
- method public boolean getHasBurnInProtection();
- method public boolean getHasLowBitAmbient();
- property public final long analogPreviewReferenceTimeMillis;
- property public final long digitalPreviewReferenceTimeMillis;
- property public final boolean hasBurnInProtection;
- property public final boolean hasLowBitAmbient;
- }
-
- public final class DeviceConfigKt {
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public static androidx.wear.watchface.client.DeviceConfig asApiDeviceConfig(androidx.wear.watchface.data.DeviceConfig);
- }
-
- public interface EditorListener {
- method public void onEditorStateChanged(androidx.wear.watchface.client.EditorState editorState);
- }
-
- public interface EditorServiceClient {
- method public void addListener(androidx.wear.watchface.client.EditorListener editorListener, java.util.concurrent.Executor listenerExecutor);
- method @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public void closeEditor() throws android.os.RemoteException;
- method public void removeListener(androidx.wear.watchface.client.EditorListener editorListener);
- }
-
- public final class EditorState {
- method public java.util.Map<java.lang.Integer,androidx.wear.complications.data.ComplicationData> getPreviewComplicationsData();
- method public android.graphics.Bitmap? getPreviewImage();
- method public boolean getShouldCommitChanges();
- method public androidx.wear.watchface.style.UserStyleData getUserStyle();
- method public androidx.wear.watchface.client.WatchFaceId getWatchFaceId();
- property public final java.util.Map<java.lang.Integer,androidx.wear.complications.data.ComplicationData> previewComplicationsData;
- property public final android.graphics.Bitmap? previewImage;
- property public final boolean shouldCommitChanges;
- property public final androidx.wear.watchface.style.UserStyleData userStyle;
- property public final androidx.wear.watchface.client.WatchFaceId watchFaceId;
- }
-
- public final class EditorStateKt {
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public static androidx.wear.watchface.client.EditorState asApiEditorState(androidx.wear.watchface.editor.data.EditorStateWireFormat);
- }
-
- public interface HeadlessWatchFaceClient extends java.lang.AutoCloseable {
- method @AnyThread public void addClientDisconnectListener(androidx.wear.watchface.client.HeadlessWatchFaceClient.ClientDisconnectListener listener, java.util.concurrent.Executor executor);
- method public default static androidx.wear.watchface.client.HeadlessWatchFaceClient createFromBundle(android.os.Bundle bundle);
- method @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public java.util.Map<java.lang.Integer,androidx.wear.watchface.client.ComplicationSlotState> getComplicationSlotsState();
- method @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public java.time.Instant getPreviewReferenceInstant();
- method @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public androidx.wear.watchface.style.UserStyleSchema getUserStyleSchema();
- method @AnyThread public boolean isConnectionAlive();
- method @AnyThread public void removeClientDisconnectListener(androidx.wear.watchface.client.HeadlessWatchFaceClient.ClientDisconnectListener listener);
- method @RequiresApi(27) @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public android.graphics.Bitmap? renderComplicationToBitmap(int complicationSlotId, androidx.wear.watchface.RenderParameters renderParameters, java.time.Instant instant, androidx.wear.complications.data.ComplicationData complicationData, androidx.wear.watchface.style.UserStyle? userStyle) throws android.os.RemoteException;
- method @RequiresApi(27) @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public android.graphics.Bitmap renderWatchFaceToBitmap(androidx.wear.watchface.RenderParameters renderParameters, java.time.Instant instant, androidx.wear.watchface.style.UserStyle? userStyle, java.util.Map<java.lang.Integer,? extends androidx.wear.complications.data.ComplicationData>? slotIdToComplicationData) throws android.os.RemoteException;
- method public android.os.Bundle toBundle();
- property @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public abstract java.util.Map<java.lang.Integer,androidx.wear.watchface.client.ComplicationSlotState> complicationSlotsState;
- property @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public abstract java.time.Instant previewReferenceInstant;
- property @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public abstract androidx.wear.watchface.style.UserStyleSchema userStyleSchema;
- field public static final String BINDER_KEY = "HeadlessWatchFaceClient";
- field public static final androidx.wear.watchface.client.HeadlessWatchFaceClient.Companion Companion;
- }
-
- public static interface HeadlessWatchFaceClient.ClientDisconnectListener {
- method public void onClientDisconnected();
- }
-
- public static final class HeadlessWatchFaceClient.Companion {
- method public androidx.wear.watchface.client.HeadlessWatchFaceClient createFromBundle(android.os.Bundle bundle);
- }
-
- public interface InteractiveWatchFaceClient extends java.lang.AutoCloseable {
- method @AnyThread public void addClientDisconnectListener(androidx.wear.watchface.client.InteractiveWatchFaceClient.ClientDisconnectListener listener, java.util.concurrent.Executor executor);
- method public void addWatchFaceReadyListener(androidx.wear.watchface.client.InteractiveWatchFaceClient.WatchFaceReadyListener listener, java.util.concurrent.Executor executor);
- method @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public default Integer? getComplicationIdAt(@Px int x, @Px int y) throws android.os.RemoteException;
- method @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public java.util.Map<java.lang.Integer,androidx.wear.watchface.client.ComplicationSlotState> getComplicationSlotsState();
- method @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public java.util.List<androidx.wear.watchface.ContentDescriptionLabel> getContentDescriptionLabels();
- method @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public String getInstanceId();
- method @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public java.time.Instant getPreviewReferenceInstant();
- method @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public androidx.wear.watchface.style.UserStyleSchema getUserStyleSchema();
- method @AnyThread public boolean isConnectionAlive();
- method @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public void performAmbientTick() throws android.os.RemoteException;
- method @AnyThread public void removeClientDisconnectListener(androidx.wear.watchface.client.InteractiveWatchFaceClient.ClientDisconnectListener listener);
- method public void removeWatchFaceReadyListener(androidx.wear.watchface.client.InteractiveWatchFaceClient.WatchFaceReadyListener listener);
- method @RequiresApi(27) @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public android.graphics.Bitmap renderWatchFaceToBitmap(androidx.wear.watchface.RenderParameters renderParameters, java.time.Instant instant, androidx.wear.watchface.style.UserStyle? userStyle, java.util.Map<java.lang.Integer,? extends androidx.wear.complications.data.ComplicationData>? idAndComplicationData) throws android.os.RemoteException;
- method @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public void sendTouchEvent(@Px int xPosition, @Px int yPosition, @androidx.wear.watchface.TapType int tapType) throws android.os.RemoteException;
- method @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public void setWatchUiState(androidx.wear.watchface.client.WatchUiState watchUiState) throws android.os.RemoteException;
- method @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public void updateComplicationData(java.util.Map<java.lang.Integer,? extends androidx.wear.complications.data.ComplicationData> slotIdToComplicationData) throws android.os.RemoteException;
- method @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public void updateWatchFaceInstance(String newInstanceId, androidx.wear.watchface.style.UserStyle userStyle) throws android.os.RemoteException;
- method @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public void updateWatchFaceInstance(String newInstanceId, androidx.wear.watchface.style.UserStyleData userStyle) throws android.os.RemoteException;
- property @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public abstract java.util.Map<java.lang.Integer,androidx.wear.watchface.client.ComplicationSlotState> complicationSlotsState;
- property @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public abstract java.util.List<androidx.wear.watchface.ContentDescriptionLabel> contentDescriptionLabels;
- property @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public abstract String instanceId;
- property @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public abstract java.time.Instant previewReferenceInstant;
- property @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public abstract androidx.wear.watchface.style.UserStyleSchema userStyleSchema;
- field public static final androidx.wear.watchface.client.InteractiveWatchFaceClient.Companion Companion;
- field public static final int TAP_TYPE_CANCEL = 1; // 0x1
- field public static final int TAP_TYPE_DOWN = 0; // 0x0
- field public static final int TAP_TYPE_UP = 2; // 0x2
- }
-
- public static interface InteractiveWatchFaceClient.ClientDisconnectListener {
- method public void onClientDisconnected();
- }
-
- public static final class InteractiveWatchFaceClient.Companion {
- field public static final int TAP_TYPE_CANCEL = 1; // 0x1
- field public static final int TAP_TYPE_DOWN = 0; // 0x0
- field public static final int TAP_TYPE_UP = 2; // 0x2
- }
-
- public static fun interface InteractiveWatchFaceClient.WatchFaceReadyListener {
- method public void onWatchFaceReady();
- }
-
- public interface WatchFaceControlClient extends java.lang.AutoCloseable {
- method @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public androidx.wear.watchface.client.HeadlessWatchFaceClient? createHeadlessWatchFaceClient(android.content.ComponentName watchFaceName, androidx.wear.watchface.client.DeviceConfig deviceConfig, @Px int surfaceWidth, @Px int surfaceHeight) throws android.os.RemoteException;
- method @kotlin.jvm.Throws(exceptionClasses={ServiceNotBoundException::class, ServiceStartFailureException::class}) public default static suspend Object? createWatchFaceControlClient(android.content.Context context, String watchFacePackageName, kotlin.coroutines.Continuation<? super androidx.wear.watchface.client.WatchFaceControlClient> p) throws androidx.wear.watchface.client.WatchFaceControlClient.ServiceNotBoundException, androidx.wear.watchface.client.WatchFaceControlClient.ServiceStartFailureException;
- method @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public java.util.Map<java.lang.Integer,androidx.wear.watchface.client.DefaultComplicationDataSourcePolicyAndType> getDefaultComplicationDataSourcePoliciesAndType(android.content.ComponentName watchFaceName) throws android.os.RemoteException;
- method @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public androidx.wear.watchface.client.EditorServiceClient getEditorServiceClient() throws android.os.RemoteException;
- method @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public androidx.wear.watchface.client.InteractiveWatchFaceClient? getInteractiveWatchFaceClientInstance(String instanceId) throws android.os.RemoteException;
- method @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public suspend Object? getOrCreateInteractiveWatchFaceClient(String id, androidx.wear.watchface.client.DeviceConfig deviceConfig, androidx.wear.watchface.client.WatchUiState watchUiState, androidx.wear.watchface.style.UserStyleData? userStyle, java.util.Map<java.lang.Integer,? extends androidx.wear.complications.data.ComplicationData>? slotIdToComplicationData, kotlin.coroutines.Continuation<? super androidx.wear.watchface.client.InteractiveWatchFaceClient> p) throws android.os.RemoteException;
- field public static final androidx.wear.watchface.client.WatchFaceControlClient.Companion Companion;
- }
-
- public static final class WatchFaceControlClient.Companion {
- method @kotlin.jvm.Throws(exceptionClasses={ServiceNotBoundException::class, ServiceStartFailureException::class}) public suspend Object? createWatchFaceControlClient(android.content.Context context, String watchFacePackageName, kotlin.coroutines.Continuation<? super androidx.wear.watchface.client.WatchFaceControlClient> p) throws androidx.wear.watchface.client.WatchFaceControlClient.ServiceNotBoundException, androidx.wear.watchface.client.WatchFaceControlClient.ServiceStartFailureException;
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public suspend Object? createWatchFaceControlClientImpl(android.content.Context context, android.content.Intent intent, kotlin.coroutines.Continuation<? super androidx.wear.watchface.client.WatchFaceControlClient> p);
- }
-
- public static final class WatchFaceControlClient.ServiceNotBoundException extends java.lang.Exception {
- ctor public WatchFaceControlClient.ServiceNotBoundException();
- }
-
- public static final class WatchFaceControlClient.ServiceStartFailureException extends java.lang.Exception {
- ctor public WatchFaceControlClient.ServiceStartFailureException(optional String message);
- }
-
- public final class WatchFaceId {
- ctor public WatchFaceId(String id);
- method public String getId();
- property public final String id;
- }
-
- public final class WatchUiState {
- ctor public WatchUiState(boolean inAmbientMode, int interruptionFilter);
- method public boolean getInAmbientMode();
- method public int getInterruptionFilter();
- property public final boolean inAmbientMode;
- property public final int interruptionFilter;
- }
-
-}
-
diff --git a/wear/wear-watchface-client/lint-baseline.xml b/wear/wear-watchface-client/lint-baseline.xml
deleted file mode 100644
index 5bbd3e0..0000000
--- a/wear/wear-watchface-client/lint-baseline.xml
+++ /dev/null
@@ -1,103 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<issues format="6" by="lint 7.1.0-alpha02" type="baseline" client="cli" name="Lint" variant="all" version="7.1.0-alpha02">
-
- <issue
- id="NewApi"
- message="Call requires API level 26 (current min is 25): `java.util.Base64#getDecoder`"
- errorLine1=" val bytes = Base64.getDecoder().decode(String(resource.readBytes()))"
- errorLine2=" ~~~~~~~~~~">
- <location
- file="src/androidTest/java/androidx/wear/watchface/client/test/SerializationTest.kt"
- line="59"
- column="28"/>
- </issue>
-
- <issue
- id="NewApi"
- message="Call requires API level 26 (current min is 25): `java.util.Base64.Decoder#decode`"
- errorLine1=" val bytes = Base64.getDecoder().decode(String(resource.readBytes()))"
- errorLine2=" ~~~~~~">
- <location
- file="src/androidTest/java/androidx/wear/watchface/client/test/SerializationTest.kt"
- line="59"
- column="41"/>
- </issue>
-
- <issue
- id="NewApi"
- message="Call requires API level 27 (current min is 25): `renderWatchFaceToBitmap`"
- errorLine1=" val bitmap = headlessInstance.renderWatchFaceToBitmap("
- errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~">
- <location
- file="src/androidTest/java/androidx/wear/watchface/client/test/WatchFaceControlClientTest.kt"
- line="216"
- column="39"/>
- </issue>
-
- <issue
- id="NewApi"
- message="Call requires API level 27 (current min is 25): `renderWatchFaceToBitmap`"
- errorLine1=" val bitmap = headlessInstance.renderWatchFaceToBitmap("
- errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~">
- <location
- file="src/androidTest/java/androidx/wear/watchface/client/test/WatchFaceControlClientTest.kt"
- line="245"
- column="39"/>
- </issue>
-
- <issue
- id="NewApi"
- message="Call requires API level 27 (current min is 25): `renderWatchFaceToBitmap`"
- errorLine1=" val bitmap = headlessInstance.renderWatchFaceToBitmap("
- errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~">
- <location
- file="src/androidTest/java/androidx/wear/watchface/client/test/WatchFaceControlClientTest.kt"
- line="278"
- column="39"/>
- </issue>
-
- <issue
- id="NewApi"
- message="Call requires API level 27 (current min is 25): `renderWatchFaceToBitmap`"
- errorLine1=" val bitmap = interactiveInstance.renderWatchFaceToBitmap("
- errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~">
- <location
- file="src/androidTest/java/androidx/wear/watchface/client/test/WatchFaceControlClientTest.kt"
- line="411"
- column="42"/>
- </issue>
-
- <issue
- id="NewApi"
- message="Call requires API level 27 (current min is 25): `renderWatchFaceToBitmap`"
- errorLine1=" val bitmap = interactiveInstance.renderWatchFaceToBitmap("
- errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~">
- <location
- file="src/androidTest/java/androidx/wear/watchface/client/test/WatchFaceControlClientTest.kt"
- line="453"
- column="42"/>
- </issue>
-
- <issue
- id="NewApi"
- message="Call requires API level 27 (current min is 25): `renderWatchFaceToBitmap`"
- errorLine1=" val bitmap = interactiveInstance.renderWatchFaceToBitmap("
- errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~">
- <location
- file="src/androidTest/java/androidx/wear/watchface/client/test/WatchFaceControlClientTest.kt"
- line="804"
- column="42"/>
- </issue>
-
- <issue
- id="NewApi"
- message="Call requires API level 27 (current min is 25): `getApiVersion`"
- errorLine1=" override fun getApiVersion(): Int = apiVersionOverride ?: super.getApiVersion()"
- errorLine2=" ~~~~~~~~~~~~~">
- <location
- file="src/androidTest/java/androidx/wear/watchface/client/test/WatchFaceControlTestService.kt"
- line="44"
- column="81"/>
- </issue>
-
-</issues>
diff --git a/wear/wear-watchface-complications-rendering/api/public_plus_experimental_current.txt b/wear/wear-watchface-complications-rendering/api/public_plus_experimental_current.txt
deleted file mode 100644
index 0836044..0000000
--- a/wear/wear-watchface-complications-rendering/api/public_plus_experimental_current.txt
+++ /dev/null
@@ -1,153 +0,0 @@
-// Signature format: 4.0
-package androidx.wear.watchface.complications.rendering {
-
- public class CanvasComplicationDrawable implements androidx.wear.watchface.CanvasComplication {
- ctor public CanvasComplicationDrawable(androidx.wear.watchface.complications.rendering.ComplicationDrawable drawable, androidx.wear.watchface.WatchState watchState, androidx.wear.watchface.CanvasComplication.InvalidateCallback invalidateCallback);
- method public void drawHighlight(android.graphics.Canvas canvas, android.graphics.Rect bounds, int boundsType, java.time.ZonedDateTime zonedDateTime, @ColorInt int color);
- method public androidx.wear.complications.data.ComplicationData getData();
- method public final androidx.wear.watchface.complications.rendering.ComplicationDrawable getDrawable();
- method @CallSuper public void loadData(androidx.wear.complications.data.ComplicationData complicationData, boolean loadDrawablesAsynchronous);
- method public void render(android.graphics.Canvas canvas, android.graphics.Rect bounds, java.time.ZonedDateTime zonedDateTime, androidx.wear.watchface.RenderParameters renderParameters, int slotId);
- method public final void setDrawable(androidx.wear.watchface.complications.rendering.ComplicationDrawable value);
- property public final androidx.wear.watchface.complications.rendering.ComplicationDrawable drawable;
- }
-
- public final class ComplicationDrawable extends android.graphics.drawable.Drawable {
- ctor public ComplicationDrawable();
- ctor public ComplicationDrawable(android.content.Context context);
- ctor public ComplicationDrawable(androidx.wear.watchface.complications.rendering.ComplicationDrawable drawable);
- method public void draw(android.graphics.Canvas canvas);
- method public androidx.wear.watchface.complications.rendering.ComplicationStyle getActiveStyle();
- method public androidx.wear.watchface.complications.rendering.ComplicationStyle getAmbientStyle();
- method public androidx.wear.complications.data.ComplicationData getComplicationData();
- method public android.content.Context? getContext();
- method public java.time.Instant getCurrentTime();
- method public static androidx.wear.watchface.complications.rendering.ComplicationDrawable? getDrawable(android.content.Context context, int id);
- method public long getHighlightDuration();
- method public CharSequence? getNoDataText();
- method @Deprecated public int getOpacity();
- method public boolean isBurnInProtectionOn();
- method public boolean isHighlighted();
- method public boolean isInAmbientMode();
- method public boolean isLowBitAmbient();
- method public boolean isRangedValueProgressHidden();
- method public boolean onTap(@Px int x, @Px int y);
- method public void setAlpha(@IntRange(from=0, to=255) int alpha);
- method public void setBurnInProtectionOn(boolean isBurnInProtectionOn);
- method public void setColorFilter(android.graphics.ColorFilter? colorFilter);
- method public void setComplicationData(androidx.wear.complications.data.ComplicationData complicationData, boolean loadDrawablesAsync);
- method public void setContext(android.content.Context context);
- method public void setCurrentTime(java.time.Instant currentTime);
- method public void setHighlightDuration(@IntRange(from=0) long highlightDurationMillis);
- method public void setHighlighted(boolean isHighlighted);
- method public void setInAmbientMode(boolean isInAmbientMode);
- method public void setLowBitAmbient(boolean isLowBitAmbient);
- method public void setNoDataText(CharSequence? noDataText);
- method public void setRangedValueProgressHidden(boolean rangedValueProgressHidden);
- property public final androidx.wear.watchface.complications.rendering.ComplicationStyle activeStyle;
- property public final androidx.wear.watchface.complications.rendering.ComplicationStyle ambientStyle;
- property public final androidx.wear.complications.data.ComplicationData complicationData;
- property public final android.content.Context? context;
- property public final java.time.Instant currentTime;
- property public final long highlightDuration;
- property public final boolean isBurnInProtectionOn;
- property public final boolean isHighlighted;
- property public final boolean isInAmbientMode;
- property public final boolean isLowBitAmbient;
- property public final boolean isRangedValueProgressHidden;
- property public final CharSequence? noDataText;
- field public static final androidx.wear.watchface.complications.rendering.ComplicationDrawable.Companion Companion;
- }
-
- public static final class ComplicationDrawable.Companion {
- method public androidx.wear.watchface.complications.rendering.ComplicationDrawable? getDrawable(android.content.Context context, int id);
- }
-
- public final class ComplicationHighlightRenderer {
- ctor public ComplicationHighlightRenderer(@Px float outlineExpansion, @Px float outlineStrokeWidth);
- method public void drawComplicationHighlight(android.graphics.Canvas canvas, android.graphics.Rect bounds, @ColorInt int color);
- }
-
- public final class ComplicationStyle {
- ctor public ComplicationStyle();
- ctor public ComplicationStyle(androidx.wear.watchface.complications.rendering.ComplicationStyle style);
- method @ColorInt public int getBackgroundColor();
- method public android.graphics.drawable.Drawable? getBackgroundDrawable();
- method @ColorInt public int getBorderColor();
- method @Px public int getBorderDashGap();
- method @Px public int getBorderDashWidth();
- method @Px public int getBorderRadius();
- method public int getBorderStyle();
- method @Px public int getBorderWidth();
- method @ColorInt public int getHighlightColor();
- method @ColorInt public int getIconColor();
- method public android.graphics.ColorFilter? getImageColorFilter();
- method @ColorInt public int getRangedValuePrimaryColor();
- method @Px public int getRangedValueRingWidth();
- method @ColorInt public int getRangedValueSecondaryColor();
- method @ColorInt public int getTextColor();
- method @Px public int getTextSize();
- method public android.graphics.Typeface getTextTypeface();
- method @ColorInt public int getTitleColor();
- method @Px public int getTitleSize();
- method public android.graphics.Typeface getTitleTypeface();
- method public void setBackgroundColor(@ColorInt int backgroundColor);
- method public void setBackgroundDrawable(android.graphics.drawable.Drawable? backgroundDrawable);
- method public void setBorderColor(@ColorInt int borderColor);
- method public void setBorderDashGap(@Px int borderDashGap);
- method public void setBorderDashWidth(@Px int borderDashWidth);
- method public void setBorderRadius(@Px int borderRadius);
- method public void setBorderStyle(int borderStyle);
- method public void setBorderWidth(@Px int borderWidth);
- method public void setHighlightColor(@ColorInt int highlightColor);
- method public void setIconColor(@ColorInt int iconColor);
- method public void setImageColorFilter(android.graphics.ColorFilter? colorFilter);
- method public void setRangedValuePrimaryColor(@ColorInt int rangedValuePrimaryColor);
- method public void setRangedValueRingWidth(@Px int rangedValueRingWidth);
- method public void setRangedValueSecondaryColor(@ColorInt int rangedValueSecondaryColor);
- method public void setTextColor(@ColorInt int textColor);
- method public void setTextSize(@Px int textSize);
- method public void setTextTypeface(android.graphics.Typeface textTypeface);
- method public void setTitleColor(@ColorInt int titleColor);
- method public void setTitleSize(@Px int titleSize);
- method public void setTitleTypeface(android.graphics.Typeface titleTypeface);
- property @ColorInt public final int backgroundColor;
- property public final android.graphics.drawable.Drawable? backgroundDrawable;
- property @ColorInt public final int borderColor;
- property @Px public final int borderDashGap;
- property @Px public final int borderDashWidth;
- property @Px public final int borderRadius;
- property public final int borderStyle;
- property @Px public final int borderWidth;
- property @ColorInt public final int highlightColor;
- property @ColorInt public final int iconColor;
- property public final android.graphics.ColorFilter? imageColorFilter;
- property @ColorInt public final int rangedValuePrimaryColor;
- property @Px public final int rangedValueRingWidth;
- property @ColorInt public final int rangedValueSecondaryColor;
- property @ColorInt public final int textColor;
- property @Px public final int textSize;
- property public final android.graphics.Typeface textTypeface;
- property @ColorInt public final int titleColor;
- property @Px public final int titleSize;
- property public final android.graphics.Typeface titleTypeface;
- field @Px public static final int BORDER_RADIUS_DEFAULT = 2147483647; // 0x7fffffff
- field public static final int BORDER_STYLE_DASHED = 2; // 0x2
- field public static final int BORDER_STYLE_NONE = 0; // 0x0
- field public static final int BORDER_STYLE_SOLID = 1; // 0x1
- field public static final androidx.wear.watchface.complications.rendering.ComplicationStyle.Companion Companion;
- }
-
- public static final class ComplicationStyle.Companion {
- }
-
- public final class GlesTextureComplication {
- ctor public GlesTextureComplication(androidx.wear.watchface.ComplicationSlot complicationSlot, @Px int textureWidth, @Px int textureHeight, int textureType);
- method public void bind();
- method public androidx.wear.watchface.ComplicationSlot getComplicationSlot();
- method public void renderToTexture(java.time.ZonedDateTime zonedDateTime, androidx.wear.watchface.RenderParameters renderParameters);
- property public final androidx.wear.watchface.ComplicationSlot complicationSlot;
- }
-
-}
-
diff --git a/wear/wear-watchface-complications-rendering/api/restricted_current.txt b/wear/wear-watchface-complications-rendering/api/restricted_current.txt
deleted file mode 100644
index c4bdb37..0000000
--- a/wear/wear-watchface-complications-rendering/api/restricted_current.txt
+++ /dev/null
@@ -1,156 +0,0 @@
-// Signature format: 4.0
-package androidx.wear.watchface.complications.rendering {
-
- public class CanvasComplicationDrawable implements androidx.wear.watchface.CanvasComplication {
- ctor public CanvasComplicationDrawable(androidx.wear.watchface.complications.rendering.ComplicationDrawable drawable, androidx.wear.watchface.WatchState watchState, androidx.wear.watchface.CanvasComplication.InvalidateCallback invalidateCallback);
- method public void drawHighlight(android.graphics.Canvas canvas, android.graphics.Rect bounds, int boundsType, java.time.ZonedDateTime zonedDateTime, @ColorInt int color);
- method public androidx.wear.complications.data.ComplicationData getData();
- method public final androidx.wear.watchface.complications.rendering.ComplicationDrawable getDrawable();
- method @CallSuper public void loadData(androidx.wear.complications.data.ComplicationData complicationData, boolean loadDrawablesAsynchronous);
- method public void render(android.graphics.Canvas canvas, android.graphics.Rect bounds, java.time.ZonedDateTime zonedDateTime, androidx.wear.watchface.RenderParameters renderParameters, int slotId);
- method public final void setDrawable(androidx.wear.watchface.complications.rendering.ComplicationDrawable value);
- property public final androidx.wear.watchface.complications.rendering.ComplicationDrawable drawable;
- }
-
- public final class ComplicationDrawable extends android.graphics.drawable.Drawable {
- ctor public ComplicationDrawable();
- ctor public ComplicationDrawable(android.content.Context context);
- ctor public ComplicationDrawable(androidx.wear.watchface.complications.rendering.ComplicationDrawable drawable);
- method public void draw(android.graphics.Canvas canvas);
- method public androidx.wear.watchface.complications.rendering.ComplicationStyle getActiveStyle();
- method public androidx.wear.watchface.complications.rendering.ComplicationStyle getAmbientStyle();
- method public androidx.wear.complications.data.ComplicationData getComplicationData();
- method public android.content.Context? getContext();
- method public java.time.Instant getCurrentTime();
- method public static androidx.wear.watchface.complications.rendering.ComplicationDrawable? getDrawable(android.content.Context context, int id);
- method public long getHighlightDuration();
- method public CharSequence? getNoDataText();
- method @Deprecated public int getOpacity();
- method public boolean isBurnInProtectionOn();
- method public boolean isHighlighted();
- method public boolean isInAmbientMode();
- method public boolean isLowBitAmbient();
- method public boolean isRangedValueProgressHidden();
- method public boolean onTap(@Px int x, @Px int y);
- method public void setAlpha(@IntRange(from=0, to=255) int alpha);
- method public void setBurnInProtectionOn(boolean isBurnInProtectionOn);
- method public void setColorFilter(android.graphics.ColorFilter? colorFilter);
- method public void setComplicationData(androidx.wear.complications.data.ComplicationData complicationData, boolean loadDrawablesAsync);
- method public void setContext(android.content.Context context);
- method public void setCurrentTime(java.time.Instant currentTime);
- method public void setHighlightDuration(@IntRange(from=0) long highlightDurationMillis);
- method public void setHighlighted(boolean isHighlighted);
- method public void setInAmbientMode(boolean isInAmbientMode);
- method public void setLowBitAmbient(boolean isLowBitAmbient);
- method public void setNoDataText(CharSequence? noDataText);
- method public void setRangedValueProgressHidden(boolean rangedValueProgressHidden);
- property public final androidx.wear.watchface.complications.rendering.ComplicationStyle activeStyle;
- property public final androidx.wear.watchface.complications.rendering.ComplicationStyle ambientStyle;
- property public final androidx.wear.complications.data.ComplicationData complicationData;
- property public final android.content.Context? context;
- property public final java.time.Instant currentTime;
- property public final long highlightDuration;
- property public final boolean isBurnInProtectionOn;
- property public final boolean isHighlighted;
- property public final boolean isInAmbientMode;
- property public final boolean isLowBitAmbient;
- property public final boolean isRangedValueProgressHidden;
- property public final CharSequence? noDataText;
- field public static final androidx.wear.watchface.complications.rendering.ComplicationDrawable.Companion Companion;
- }
-
- public static final class ComplicationDrawable.Companion {
- method public androidx.wear.watchface.complications.rendering.ComplicationDrawable? getDrawable(android.content.Context context, int id);
- }
-
- public final class ComplicationHighlightRenderer {
- ctor public ComplicationHighlightRenderer(@Px float outlineExpansion, @Px float outlineStrokeWidth);
- method public void drawComplicationHighlight(android.graphics.Canvas canvas, android.graphics.Rect bounds, @ColorInt int color);
- }
-
- public final class ComplicationStyle {
- ctor public ComplicationStyle();
- ctor public ComplicationStyle(androidx.wear.watchface.complications.rendering.ComplicationStyle style);
- method @ColorInt public int getBackgroundColor();
- method public android.graphics.drawable.Drawable? getBackgroundDrawable();
- method @ColorInt public int getBorderColor();
- method @Px public int getBorderDashGap();
- method @Px public int getBorderDashWidth();
- method @Px public int getBorderRadius();
- method @androidx.wear.watchface.complications.rendering.ComplicationStyle.BorderStyle public int getBorderStyle();
- method @Px public int getBorderWidth();
- method @ColorInt public int getHighlightColor();
- method @ColorInt public int getIconColor();
- method public android.graphics.ColorFilter? getImageColorFilter();
- method @ColorInt public int getRangedValuePrimaryColor();
- method @Px public int getRangedValueRingWidth();
- method @ColorInt public int getRangedValueSecondaryColor();
- method @ColorInt public int getTextColor();
- method @Px public int getTextSize();
- method public android.graphics.Typeface getTextTypeface();
- method @ColorInt public int getTitleColor();
- method @Px public int getTitleSize();
- method public android.graphics.Typeface getTitleTypeface();
- method public void setBackgroundColor(@ColorInt int backgroundColor);
- method public void setBackgroundDrawable(android.graphics.drawable.Drawable? backgroundDrawable);
- method public void setBorderColor(@ColorInt int borderColor);
- method public void setBorderDashGap(@Px int borderDashGap);
- method public void setBorderDashWidth(@Px int borderDashWidth);
- method public void setBorderRadius(@Px int borderRadius);
- method public void setBorderStyle(@androidx.wear.watchface.complications.rendering.ComplicationStyle.BorderStyle int borderStyle);
- method public void setBorderWidth(@Px int borderWidth);
- method public void setHighlightColor(@ColorInt int highlightColor);
- method public void setIconColor(@ColorInt int iconColor);
- method public void setImageColorFilter(android.graphics.ColorFilter? colorFilter);
- method public void setRangedValuePrimaryColor(@ColorInt int rangedValuePrimaryColor);
- method public void setRangedValueRingWidth(@Px int rangedValueRingWidth);
- method public void setRangedValueSecondaryColor(@ColorInt int rangedValueSecondaryColor);
- method public void setTextColor(@ColorInt int textColor);
- method public void setTextSize(@Px int textSize);
- method public void setTextTypeface(android.graphics.Typeface textTypeface);
- method public void setTitleColor(@ColorInt int titleColor);
- method public void setTitleSize(@Px int titleSize);
- method public void setTitleTypeface(android.graphics.Typeface titleTypeface);
- property @ColorInt public final int backgroundColor;
- property public final android.graphics.drawable.Drawable? backgroundDrawable;
- property @ColorInt public final int borderColor;
- property @Px public final int borderDashGap;
- property @Px public final int borderDashWidth;
- property @Px public final int borderRadius;
- property @androidx.wear.watchface.complications.rendering.ComplicationStyle.BorderStyle public final int borderStyle;
- property @Px public final int borderWidth;
- property @ColorInt public final int highlightColor;
- property @ColorInt public final int iconColor;
- property public final android.graphics.ColorFilter? imageColorFilter;
- property @ColorInt public final int rangedValuePrimaryColor;
- property @Px public final int rangedValueRingWidth;
- property @ColorInt public final int rangedValueSecondaryColor;
- property @ColorInt public final int textColor;
- property @Px public final int textSize;
- property public final android.graphics.Typeface textTypeface;
- property @ColorInt public final int titleColor;
- property @Px public final int titleSize;
- property public final android.graphics.Typeface titleTypeface;
- field @Px public static final int BORDER_RADIUS_DEFAULT = 2147483647; // 0x7fffffff
- field public static final int BORDER_STYLE_DASHED = 2; // 0x2
- field public static final int BORDER_STYLE_NONE = 0; // 0x0
- field public static final int BORDER_STYLE_SOLID = 1; // 0x1
- field public static final androidx.wear.watchface.complications.rendering.ComplicationStyle.Companion Companion;
- }
-
- @IntDef({androidx.wear.watchface.complications.rendering.ComplicationStyle.BORDER_STYLE_NONE, androidx.wear.watchface.complications.rendering.ComplicationStyle.BORDER_STYLE_SOLID, androidx.wear.watchface.complications.rendering.ComplicationStyle.BORDER_STYLE_DASHED}) @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) @kotlin.annotation.Retention(kotlin.annotation.AnnotationRetention) public static @interface ComplicationStyle.BorderStyle {
- }
-
- public static final class ComplicationStyle.Companion {
- }
-
- public final class GlesTextureComplication {
- ctor public GlesTextureComplication(androidx.wear.watchface.ComplicationSlot complicationSlot, @Px int textureWidth, @Px int textureHeight, int textureType);
- method public void bind();
- method public androidx.wear.watchface.ComplicationSlot getComplicationSlot();
- method public void renderToTexture(java.time.ZonedDateTime zonedDateTime, androidx.wear.watchface.RenderParameters renderParameters);
- property public final androidx.wear.watchface.ComplicationSlot complicationSlot;
- }
-
-}
-
diff --git a/wear/wear-watchface-editor-guava/api/public_plus_experimental_current.txt b/wear/wear-watchface-editor-guava/api/public_plus_experimental_current.txt
deleted file mode 100644
index 8a5446f..0000000
--- a/wear/wear-watchface-editor-guava/api/public_plus_experimental_current.txt
+++ /dev/null
@@ -1,43 +0,0 @@
-// Signature format: 4.0
-package androidx.wear.watchface.editor {
-
- public final class ListenableEditorSession implements androidx.wear.watchface.editor.EditorSession {
- ctor public ListenableEditorSession(androidx.wear.watchface.editor.EditorSession wrappedEditorSession);
- method public void close();
- method @RequiresApi(27) @UiThread public static androidx.wear.watchface.editor.ListenableEditorSession createHeadlessEditorSession(androidx.activity.ComponentActivity activity, android.content.Intent editIntent, androidx.wear.watchface.client.HeadlessWatchFaceClient headlessWatchFaceClient);
- method public Integer? getBackgroundComplicationSlotId();
- method public Integer? getComplicationSlotIdAt(int x, int y);
- method public kotlinx.coroutines.flow.StateFlow<java.util.Map<java.lang.Integer,androidx.wear.watchface.client.ComplicationSlotState>> getComplicationSlotsState();
- method public suspend Object? getComplicationsDataSourceInfo(kotlin.coroutines.Continuation<? super kotlinx.coroutines.flow.StateFlow<? extends java.util.Map<java.lang.Integer,? extends androidx.wear.complications.ComplicationDataSourceInfo>>> p);
- method public suspend Object? getComplicationsPreviewData(kotlin.coroutines.Continuation<? super kotlinx.coroutines.flow.StateFlow<? extends java.util.Map<java.lang.Integer,? extends androidx.wear.complications.data.ComplicationData>>> p);
- method public com.google.common.util.concurrent.ListenableFuture<kotlinx.coroutines.flow.StateFlow<java.util.Map<java.lang.Integer,androidx.wear.complications.data.ComplicationData>>> getListenableComplicationPreviewData();
- method public com.google.common.util.concurrent.ListenableFuture<kotlinx.coroutines.flow.StateFlow<java.util.Map<java.lang.Integer,androidx.wear.complications.ComplicationDataSourceInfo>>> getListenableComplicationsProviderInfo();
- method public java.time.Instant getPreviewReferenceInstant();
- method public kotlinx.coroutines.flow.MutableStateFlow<androidx.wear.watchface.style.UserStyle> getUserStyle();
- method public androidx.wear.watchface.style.UserStyleSchema getUserStyleSchema();
- method public android.content.ComponentName getWatchFaceComponentName();
- method @RequiresApi(android.os.Build.VERSION_CODES.R) public androidx.wear.watchface.client.WatchFaceId getWatchFaceId();
- method public boolean isCommitChangesOnClose();
- method @UiThread public static com.google.common.util.concurrent.ListenableFuture<androidx.wear.watchface.editor.ListenableEditorSession> listenableCreateOnWatchEditorSession(androidx.activity.ComponentActivity activity);
- method public com.google.common.util.concurrent.ListenableFuture<androidx.wear.watchface.editor.ChosenComplicationDataSource> listenableOpenComplicationDataSourceChooser(int complicationSlotId);
- method public suspend Object? openComplicationDataSourceChooser(int complicationSlotId, kotlin.coroutines.Continuation<? super androidx.wear.watchface.editor.ChosenComplicationDataSource> p);
- method public android.graphics.Bitmap renderWatchFaceToBitmap(androidx.wear.watchface.RenderParameters renderParameters, java.time.Instant instant, java.util.Map<java.lang.Integer,? extends androidx.wear.complications.data.ComplicationData>? slotIdToComplicationData);
- method public void setCommitChangesOnClose(boolean commitChangesOnClose);
- property public Integer? backgroundComplicationSlotId;
- property public boolean commitChangesOnClose;
- property public kotlinx.coroutines.flow.StateFlow<java.util.Map<java.lang.Integer,androidx.wear.watchface.client.ComplicationSlotState>> complicationSlotsState;
- property public java.time.Instant previewReferenceInstant;
- property public kotlinx.coroutines.flow.MutableStateFlow<androidx.wear.watchface.style.UserStyle> userStyle;
- property public androidx.wear.watchface.style.UserStyleSchema userStyleSchema;
- property public android.content.ComponentName watchFaceComponentName;
- property @RequiresApi(android.os.Build.VERSION_CODES.R) public androidx.wear.watchface.client.WatchFaceId watchFaceId;
- field public static final androidx.wear.watchface.editor.ListenableEditorSession.Companion Companion;
- }
-
- public static final class ListenableEditorSession.Companion {
- method @RequiresApi(27) @UiThread public androidx.wear.watchface.editor.ListenableEditorSession createHeadlessEditorSession(androidx.activity.ComponentActivity activity, android.content.Intent editIntent, androidx.wear.watchface.client.HeadlessWatchFaceClient headlessWatchFaceClient);
- method @UiThread public com.google.common.util.concurrent.ListenableFuture<androidx.wear.watchface.editor.ListenableEditorSession> listenableCreateOnWatchEditorSession(androidx.activity.ComponentActivity activity);
- }
-
-}
-
diff --git a/wear/wear-watchface-editor-guava/api/restricted_current.txt b/wear/wear-watchface-editor-guava/api/restricted_current.txt
deleted file mode 100644
index 8a5446f..0000000
--- a/wear/wear-watchface-editor-guava/api/restricted_current.txt
+++ /dev/null
@@ -1,43 +0,0 @@
-// Signature format: 4.0
-package androidx.wear.watchface.editor {
-
- public final class ListenableEditorSession implements androidx.wear.watchface.editor.EditorSession {
- ctor public ListenableEditorSession(androidx.wear.watchface.editor.EditorSession wrappedEditorSession);
- method public void close();
- method @RequiresApi(27) @UiThread public static androidx.wear.watchface.editor.ListenableEditorSession createHeadlessEditorSession(androidx.activity.ComponentActivity activity, android.content.Intent editIntent, androidx.wear.watchface.client.HeadlessWatchFaceClient headlessWatchFaceClient);
- method public Integer? getBackgroundComplicationSlotId();
- method public Integer? getComplicationSlotIdAt(int x, int y);
- method public kotlinx.coroutines.flow.StateFlow<java.util.Map<java.lang.Integer,androidx.wear.watchface.client.ComplicationSlotState>> getComplicationSlotsState();
- method public suspend Object? getComplicationsDataSourceInfo(kotlin.coroutines.Continuation<? super kotlinx.coroutines.flow.StateFlow<? extends java.util.Map<java.lang.Integer,? extends androidx.wear.complications.ComplicationDataSourceInfo>>> p);
- method public suspend Object? getComplicationsPreviewData(kotlin.coroutines.Continuation<? super kotlinx.coroutines.flow.StateFlow<? extends java.util.Map<java.lang.Integer,? extends androidx.wear.complications.data.ComplicationData>>> p);
- method public com.google.common.util.concurrent.ListenableFuture<kotlinx.coroutines.flow.StateFlow<java.util.Map<java.lang.Integer,androidx.wear.complications.data.ComplicationData>>> getListenableComplicationPreviewData();
- method public com.google.common.util.concurrent.ListenableFuture<kotlinx.coroutines.flow.StateFlow<java.util.Map<java.lang.Integer,androidx.wear.complications.ComplicationDataSourceInfo>>> getListenableComplicationsProviderInfo();
- method public java.time.Instant getPreviewReferenceInstant();
- method public kotlinx.coroutines.flow.MutableStateFlow<androidx.wear.watchface.style.UserStyle> getUserStyle();
- method public androidx.wear.watchface.style.UserStyleSchema getUserStyleSchema();
- method public android.content.ComponentName getWatchFaceComponentName();
- method @RequiresApi(android.os.Build.VERSION_CODES.R) public androidx.wear.watchface.client.WatchFaceId getWatchFaceId();
- method public boolean isCommitChangesOnClose();
- method @UiThread public static com.google.common.util.concurrent.ListenableFuture<androidx.wear.watchface.editor.ListenableEditorSession> listenableCreateOnWatchEditorSession(androidx.activity.ComponentActivity activity);
- method public com.google.common.util.concurrent.ListenableFuture<androidx.wear.watchface.editor.ChosenComplicationDataSource> listenableOpenComplicationDataSourceChooser(int complicationSlotId);
- method public suspend Object? openComplicationDataSourceChooser(int complicationSlotId, kotlin.coroutines.Continuation<? super androidx.wear.watchface.editor.ChosenComplicationDataSource> p);
- method public android.graphics.Bitmap renderWatchFaceToBitmap(androidx.wear.watchface.RenderParameters renderParameters, java.time.Instant instant, java.util.Map<java.lang.Integer,? extends androidx.wear.complications.data.ComplicationData>? slotIdToComplicationData);
- method public void setCommitChangesOnClose(boolean commitChangesOnClose);
- property public Integer? backgroundComplicationSlotId;
- property public boolean commitChangesOnClose;
- property public kotlinx.coroutines.flow.StateFlow<java.util.Map<java.lang.Integer,androidx.wear.watchface.client.ComplicationSlotState>> complicationSlotsState;
- property public java.time.Instant previewReferenceInstant;
- property public kotlinx.coroutines.flow.MutableStateFlow<androidx.wear.watchface.style.UserStyle> userStyle;
- property public androidx.wear.watchface.style.UserStyleSchema userStyleSchema;
- property public android.content.ComponentName watchFaceComponentName;
- property @RequiresApi(android.os.Build.VERSION_CODES.R) public androidx.wear.watchface.client.WatchFaceId watchFaceId;
- field public static final androidx.wear.watchface.editor.ListenableEditorSession.Companion Companion;
- }
-
- public static final class ListenableEditorSession.Companion {
- method @RequiresApi(27) @UiThread public androidx.wear.watchface.editor.ListenableEditorSession createHeadlessEditorSession(androidx.activity.ComponentActivity activity, android.content.Intent editIntent, androidx.wear.watchface.client.HeadlessWatchFaceClient headlessWatchFaceClient);
- method @UiThread public com.google.common.util.concurrent.ListenableFuture<androidx.wear.watchface.editor.ListenableEditorSession> listenableCreateOnWatchEditorSession(androidx.activity.ComponentActivity activity);
- }
-
-}
-
diff --git a/wear/wear-watchface-editor/api/restricted_current.txt b/wear/wear-watchface-editor/api/restricted_current.txt
deleted file mode 100644
index 874ff95..0000000
--- a/wear/wear-watchface-editor/api/restricted_current.txt
+++ /dev/null
@@ -1,124 +0,0 @@
-// Signature format: 4.0
-package androidx.wear.watchface.editor {
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public abstract class BaseEditorSession implements androidx.wear.watchface.editor.EditorSession {
- method public void close();
- method protected final kotlinx.coroutines.Job fetchComplicationsData(kotlinx.coroutines.CoroutineScope fetchCoroutineScope);
- method public Integer? getBackgroundComplicationSlotId();
- method protected final boolean getClosed();
- method public boolean getCommitChangesOnClose();
- method public Integer? getComplicationSlotIdAt(@Px int x, @Px int y);
- method public kotlinx.coroutines.flow.MutableStateFlow<java.util.Map<java.lang.Integer,androidx.wear.watchface.client.ComplicationSlotState>> getComplicationSlotsState();
- method public suspend Object? getComplicationsDataSourceInfo(kotlin.coroutines.Continuation<? super kotlinx.coroutines.flow.StateFlow<? extends java.util.Map<java.lang.Integer,? extends androidx.wear.complications.ComplicationDataSourceInfo>>> p);
- method public suspend Object? getComplicationsPreviewData(kotlin.coroutines.Continuation<? super kotlinx.coroutines.flow.StateFlow<? extends java.util.Map<java.lang.Integer,? extends androidx.wear.complications.data.ComplicationData>>> p);
- method public final kotlinx.coroutines.CoroutineScope getCoroutineScope();
- method protected final boolean getForceClosed();
- method public suspend Object? openComplicationDataSourceChooser(int complicationSlotId, kotlin.coroutines.Continuation<? super androidx.wear.watchface.editor.ChosenComplicationDataSource> p);
- method @UiThread protected abstract void releaseResources();
- method protected final void requireNotClosed();
- method protected final void setClosed(boolean closed);
- method public void setCommitChangesOnClose(boolean commitChangesOnClose);
- method protected final void setForceClosed(boolean forceClosed);
- property public Integer? backgroundComplicationSlotId;
- property protected final boolean closed;
- property public boolean commitChangesOnClose;
- property public kotlinx.coroutines.flow.MutableStateFlow<java.util.Map<java.lang.Integer,androidx.wear.watchface.client.ComplicationSlotState>> complicationSlotsState;
- property public final kotlinx.coroutines.CoroutineScope coroutineScope;
- property protected final boolean forceClosed;
- }
-
- public final class ChosenComplicationDataSource {
- ctor public ChosenComplicationDataSource(int complicationSlotId, androidx.wear.complications.ComplicationDataSourceInfo? complicationDataSourceInfo, android.os.Bundle extras);
- method public androidx.wear.complications.ComplicationDataSourceInfo? getComplicationDataSourceInfo();
- method public int getComplicationSlotId();
- method public android.os.Bundle getExtras();
- property public final androidx.wear.complications.ComplicationDataSourceInfo? complicationDataSourceInfo;
- property public final int complicationSlotId;
- property public final android.os.Bundle extras;
- }
-
- public final class EditorRequest {
- ctor @RequiresApi(android.os.Build.VERSION_CODES.R) public EditorRequest(android.content.ComponentName watchFaceComponentName, String editorPackageName, androidx.wear.watchface.style.UserStyleData? initialUserStyle, @RequiresApi androidx.wear.watchface.client.WatchFaceId watchFaceId, androidx.wear.watchface.client.DeviceConfig? headlessDeviceConfig, androidx.wear.watchface.editor.PreviewScreenshotParams? previewScreenshotParams);
- ctor public EditorRequest(android.content.ComponentName watchFaceComponentName, String editorPackageName, androidx.wear.watchface.style.UserStyleData? initialUserStyle);
- method @kotlin.jvm.Throws(exceptionClasses=TimeoutCancellationException::class) public static androidx.wear.watchface.editor.EditorRequest createFromIntent(android.content.Intent intent) throws kotlinx.coroutines.TimeoutCancellationException;
- method public String getEditorPackageName();
- method public androidx.wear.watchface.client.DeviceConfig? getHeadlessDeviceConfig();
- method public androidx.wear.watchface.style.UserStyleData? getInitialUserStyle();
- method public androidx.wear.watchface.editor.PreviewScreenshotParams? getPreviewScreenshotParams();
- method public android.content.ComponentName getWatchFaceComponentName();
- method @RequiresApi(android.os.Build.VERSION_CODES.R) public androidx.wear.watchface.client.WatchFaceId getWatchFaceId();
- property public final String editorPackageName;
- property public final androidx.wear.watchface.client.DeviceConfig? headlessDeviceConfig;
- property public final androidx.wear.watchface.style.UserStyleData? initialUserStyle;
- property public final androidx.wear.watchface.editor.PreviewScreenshotParams? previewScreenshotParams;
- property public final android.content.ComponentName watchFaceComponentName;
- property @RequiresApi(android.os.Build.VERSION_CODES.R) public final androidx.wear.watchface.client.WatchFaceId watchFaceId;
- field public static final androidx.wear.watchface.editor.EditorRequest.Companion Companion;
- }
-
- public static final class EditorRequest.Companion {
- method @kotlin.jvm.Throws(exceptionClasses=TimeoutCancellationException::class) public androidx.wear.watchface.editor.EditorRequest createFromIntent(android.content.Intent intent) throws kotlinx.coroutines.TimeoutCancellationException;
- }
-
- public interface EditorSession extends java.lang.AutoCloseable {
- method @RequiresApi(27) @UiThread public default static androidx.wear.watchface.editor.EditorSession createHeadlessEditorSession(androidx.activity.ComponentActivity activity, android.content.Intent editIntent, androidx.wear.watchface.client.HeadlessWatchFaceClient headlessWatchFaceClient);
- method @UiThread @kotlin.jvm.Throws(exceptionClasses=TimeoutCancellationException::class) public default static suspend Object? createOnWatchEditorSession(androidx.activity.ComponentActivity activity, kotlin.coroutines.Continuation<? super androidx.wear.watchface.editor.EditorSession> p) throws kotlinx.coroutines.TimeoutCancellationException;
- method public Integer? getBackgroundComplicationSlotId();
- method @UiThread public Integer? getComplicationSlotIdAt(@Px int x, @Px int y);
- method public kotlinx.coroutines.flow.StateFlow<java.util.Map<java.lang.Integer,androidx.wear.watchface.client.ComplicationSlotState>> getComplicationSlotsState();
- method public suspend Object? getComplicationsDataSourceInfo(kotlin.coroutines.Continuation<? super kotlinx.coroutines.flow.StateFlow<? extends java.util.Map<java.lang.Integer,? extends androidx.wear.complications.ComplicationDataSourceInfo>>> p);
- method public suspend Object? getComplicationsPreviewData(kotlin.coroutines.Continuation<? super kotlinx.coroutines.flow.StateFlow<? extends java.util.Map<java.lang.Integer,? extends androidx.wear.complications.data.ComplicationData>>> p);
- method public java.time.Instant getPreviewReferenceInstant();
- method public kotlinx.coroutines.flow.MutableStateFlow<androidx.wear.watchface.style.UserStyle> getUserStyle();
- method public androidx.wear.watchface.style.UserStyleSchema getUserStyleSchema();
- method public android.content.ComponentName getWatchFaceComponentName();
- method @RequiresApi(android.os.Build.VERSION_CODES.R) public androidx.wear.watchface.client.WatchFaceId getWatchFaceId();
- method @UiThread public boolean isCommitChangesOnClose();
- method @UiThread public suspend Object? openComplicationDataSourceChooser(int complicationSlotId, kotlin.coroutines.Continuation<? super androidx.wear.watchface.editor.ChosenComplicationDataSource> p);
- method @UiThread public android.graphics.Bitmap renderWatchFaceToBitmap(androidx.wear.watchface.RenderParameters renderParameters, java.time.Instant instant, java.util.Map<java.lang.Integer,? extends androidx.wear.complications.data.ComplicationData>? slotIdToComplicationData);
- method @UiThread public void setCommitChangesOnClose(boolean commitChangesOnClose);
- property public abstract Integer? backgroundComplicationSlotId;
- property @UiThread public abstract boolean commitChangesOnClose;
- property public abstract kotlinx.coroutines.flow.StateFlow<java.util.Map<java.lang.Integer,androidx.wear.watchface.client.ComplicationSlotState>> complicationSlotsState;
- property public abstract java.time.Instant previewReferenceInstant;
- property public abstract kotlinx.coroutines.flow.MutableStateFlow<androidx.wear.watchface.style.UserStyle> userStyle;
- property public abstract androidx.wear.watchface.style.UserStyleSchema userStyleSchema;
- property public abstract android.content.ComponentName watchFaceComponentName;
- property @RequiresApi(android.os.Build.VERSION_CODES.R) public abstract androidx.wear.watchface.client.WatchFaceId watchFaceId;
- field public static final androidx.wear.watchface.editor.EditorSession.Companion Companion;
- field public static final java.time.Instant DEFAULT_PREVIEW_INSTANT;
- field public static final java.time.Duration EDITING_SESSION_TIMEOUT;
- }
-
- public static final class EditorSession.Companion {
- method @RequiresApi(27) @UiThread public androidx.wear.watchface.editor.EditorSession createHeadlessEditorSession(androidx.activity.ComponentActivity activity, android.content.Intent editIntent, androidx.wear.watchface.client.HeadlessWatchFaceClient headlessWatchFaceClient);
- method @UiThread @kotlin.jvm.Throws(exceptionClasses=TimeoutCancellationException::class) public suspend Object? createOnWatchEditorSession(androidx.activity.ComponentActivity activity, kotlin.coroutines.Continuation<? super androidx.wear.watchface.editor.EditorSession> p) throws kotlinx.coroutines.TimeoutCancellationException;
- }
-
- public final class EditorSessionKt {
- }
-
- public final class PreviewScreenshotParams {
- ctor public PreviewScreenshotParams(androidx.wear.watchface.RenderParameters renderParameters, java.time.Instant instant);
- method public java.time.Instant getInstant();
- method public androidx.wear.watchface.RenderParameters getRenderParameters();
- property public final java.time.Instant instant;
- property public final androidx.wear.watchface.RenderParameters renderParameters;
- }
-
- public class WatchFaceEditorContract extends androidx.activity.result.contract.ActivityResultContract<androidx.wear.watchface.editor.EditorRequest,kotlin.Unit> {
- ctor public WatchFaceEditorContract();
- method public android.content.Intent createIntent(android.content.Context context, androidx.wear.watchface.editor.EditorRequest input);
- method public void parseResult(int resultCode, android.content.Intent? intent);
- field public static final String ACTION_WATCH_FACE_EDITOR = "androidx.wear.watchface.editor.action.WATCH_FACE_EDITOR";
- field public static final androidx.wear.watchface.editor.WatchFaceEditorContract.Companion Companion;
- }
-
- public static final class WatchFaceEditorContract.Companion {
- }
-
- public final class WatchFaceEditorContractKt {
- }
-
-}
-
diff --git a/wear/wear-watchface-editor/lint-baseline.xml b/wear/wear-watchface-editor/lint-baseline.xml
deleted file mode 100644
index b47a5fd..0000000
--- a/wear/wear-watchface-editor/lint-baseline.xml
+++ /dev/null
@@ -1,103 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<issues format="6" by="lint 7.1.0-alpha02" type="baseline" client="cli" name="Lint" variant="all" version="7.1.0-alpha02">
-
- <issue
- id="NewApi"
- message="Call requires API level 30 (current min is 25): `EditorRequest`"
- errorLine1=" EditorRequest(testComponentName, testEditorPackageName, null, watchFaceId)"
- errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
- <location
- file="src/androidTest/java/androidx/wear/watchface/editor/EditingSessionTest.kt"
- line="462"
- column="17"/>
- </issue>
-
- <issue
- id="NewApi"
- message="Call requires API level 30 (current min is 25): `watchFaceId`"
- errorLine1=" assertThat(result.watchFaceId.id).isEqualTo(testInstanceId.id)"
- errorLine2=" ~~~~~~~~~~~">
- <location
- file="src/androidTest/java/androidx/wear/watchface/editor/EditingSessionTest.kt"
- line="1164"
- column="27"/>
- </issue>
-
- <issue
- id="NewApi"
- message="Call requires API level 30 (current min is 25): `watchFaceId`"
- errorLine1=" assertThat(result.watchFaceId.id).isEmpty()"
- errorLine2=" ~~~~~~~~~~~">
- <location
- file="src/androidTest/java/androidx/wear/watchface/editor/EditingSessionTest.kt"
- line="1219"
- column="27"/>
- </issue>
-
- <issue
- id="NewApi"
- message="Call requires API level 30 (current min is 25): `EditorRequest`"
- errorLine1=" EditorRequest(testComponentName, testEditorPackageName, null, testInstanceId)"
- errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
- <location
- file="src/androidTest/java/androidx/wear/watchface/editor/EditingSessionTest.kt"
- line="1346"
- column="17"/>
- </issue>
-
- <issue
- id="NewApi"
- message="Call requires API level 30 (current min is 25): `EditorRequest`"
- errorLine1=" EditorRequest("
- errorLine2=" ^">
- <location
- file="src/androidTest/java/androidx/wear/watchface/editor/EditingSessionTest.kt"
- line="1399"
- column="17"/>
- </issue>
-
- <issue
- id="NewApi"
- message="Call requires API level 30 (current min is 25): `EditorRequest`"
- errorLine1=" EditorRequest(testComponentName, testEditorPackageName, null, watchFaceId)"
- errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
- <location
- file="src/androidTest/java/androidx/wear/watchface/editor/EditingSessionTest.kt"
- line="1545"
- column="17"/>
- </issue>
-
- <issue
- id="NewApi"
- message="Call requires API level 28 (current min is 25): `android.graphics.drawable.Icon#getType`"
- errorLine1=" assertThat(actual.icon.type).isEqualTo(expected.icon.type)"
- errorLine2=" ~~~~">
- <location
- file="src/androidTest/java/androidx/wear/watchface/editor/EditingSessionTest.kt"
- line="1624"
- column="36"/>
- </issue>
-
- <issue
- id="NewApi"
- message="Call requires API level 28 (current min is 25): `android.graphics.drawable.Icon#getType`"
- errorLine1=" assertThat(actual.icon.type).isEqualTo(expected.icon.type)"
- errorLine2=" ~~~~">
- <location
- file="src/androidTest/java/androidx/wear/watchface/editor/EditingSessionTest.kt"
- line="1624"
- column="66"/>
- </issue>
-
- <issue
- id="NewApi"
- message="Call requires API level 30 (current min is 25): `EditorRequest`"
- errorLine1=" EditorRequest(testComponentName, testEditorPackageName, null, watchFaceId)"
- errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
- <location
- file="src/androidTest/java/androidx/wear/watchface/editor/EditorSessionGuavaTest.kt"
- line="137"
- column="17"/>
- </issue>
-
-</issues>
diff --git a/wear/wear-watchface-guava/src/main/java/androidx/wear/watchface/StateFlowCompatHelper.kt b/wear/wear-watchface-guava/src/main/java/androidx/wear/watchface/StateFlowCompatHelper.kt
deleted file mode 100644
index 72fd0b4..0000000
--- a/wear/wear-watchface-guava/src/main/java/androidx/wear/watchface/StateFlowCompatHelper.kt
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * Copyright 2021 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES 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.wear.watchface
-
-import androidx.annotation.UiThread
-import kotlinx.coroutines.CoroutineDispatcher
-import kotlinx.coroutines.CoroutineScope
-import kotlinx.coroutines.Runnable
-import kotlinx.coroutines.flow.StateFlow
-import kotlinx.coroutines.flow.collect
-import kotlinx.coroutines.launch
-import java.util.concurrent.Executor
-import kotlin.coroutines.CoroutineContext
-
-/**
- * A helper which provides Java style callbacks whenever [StateFlow.value] changes in the supplied
- * [StateFlow].
- *
- * @param stateFlow The [StateFlow] to observe.
- */
-// TODO(alexclarke): Consider if there's a better location for this helper
-public class StateFlowCompatHelper<T>(private val stateFlow: StateFlow<T>) {
- /** A listener for observing StateFlow changes from java. */
- public fun interface ValueChangeListener<T> {
- /** Called whenever the value changes. */
- @UiThread
- public fun onValueChanged(userStyle: T)
- }
-
- private val listeners = HashMap<ValueChangeListener<T>, Executor>()
- private val lock = Any()
-
- init {
- val immediateCoroutineScope = CoroutineScope(
- object : CoroutineDispatcher() {
- override fun dispatch(context: CoroutineContext, block: Runnable) {
- block.run()
- }
- }
- )
- immediateCoroutineScope.launch {
- stateFlow.collect {
- // We iterate over a copy of the listeners set because callbacks could mutate it.
- for ((listener, executor) in synchronized(lock) { HashMap(listeners) }) {
- executor.execute {
- listener.onValueChanged(it)
- }
- }
- }
- }
- }
-
- /**
- * Adds a [ValueChangeListener] which is called immediately with the [StateFlow]'s current
- * value and subsequently whenever the value changes.
- *
- * NB the order in which ambient vs style changes are reported is not guaranteed.
- */
- public fun addValueChangeListener(
- userStyleChangeListener: ValueChangeListener<T>,
- executor: Executor
- ) {
- synchronized(lock) {
- listeners.put(userStyleChangeListener, executor)
- }
- userStyleChangeListener.onValueChanged(stateFlow.value)
- }
-
- /** Removes a [ValueChangeListener] previously added by [addValueChangeListener]. */
- public fun removeValueChangeListener(userStyleChangeListener: ValueChangeListener<T>) {
- synchronized(lock) {
- listeners.remove(userStyleChangeListener)
- }
- }
-}
\ No newline at end of file
diff --git a/wear/wear-watchface/api/public_plus_experimental_current.txt b/wear/wear-watchface/api/public_plus_experimental_current.txt
deleted file mode 100644
index 0a61a68..0000000
--- a/wear/wear-watchface/api/public_plus_experimental_current.txt
+++ /dev/null
@@ -1,333 +0,0 @@
-// Signature format: 4.0
-package androidx.wear.watchface {
-
- public final class BackgroundComplicationTapFilter implements androidx.wear.watchface.ComplicationTapFilter {
- ctor public BackgroundComplicationTapFilter();
- method public boolean hitTest(androidx.wear.watchface.ComplicationSlot complicationSlot, android.graphics.Rect screenBounds, @Px int x, @Px int y);
- }
-
- public interface CanvasComplication {
- method public void drawHighlight(android.graphics.Canvas canvas, android.graphics.Rect bounds, int boundsType, java.time.ZonedDateTime zonedDateTime, @ColorInt int color);
- method public androidx.wear.complications.data.ComplicationData getData();
- method public void loadData(androidx.wear.complications.data.ComplicationData complicationData, boolean loadDrawablesAsynchronous);
- method @WorkerThread public default void onRendererCreated(androidx.wear.watchface.Renderer renderer);
- method @UiThread public void render(android.graphics.Canvas canvas, android.graphics.Rect bounds, java.time.ZonedDateTime zonedDateTime, androidx.wear.watchface.RenderParameters renderParameters, int slotId);
- }
-
- public static interface CanvasComplication.InvalidateCallback {
- method public void onInvalidate();
- }
-
- public interface CanvasComplicationFactory {
- method @WorkerThread public androidx.wear.watchface.CanvasComplication create(androidx.wear.watchface.WatchState, androidx.wear.watchface.CanvasComplication.InvalidateCallback);
- }
-
- public final class ComplicationSlot {
- method public android.graphics.Rect computeBounds(android.graphics.Rect screen);
- method public static androidx.wear.watchface.ComplicationSlot.Builder createBackgroundComplicationSlotBuilder(int id, androidx.wear.watchface.CanvasComplicationFactory canvasComplicationFactory, java.util.List<? extends androidx.wear.complications.data.ComplicationType> supportedTypes, androidx.wear.complications.DefaultComplicationDataSourcePolicy defaultDataSourcePolicy);
- method public static androidx.wear.watchface.ComplicationSlot.Builder createEdgeComplicationSlotBuilder(int id, androidx.wear.watchface.CanvasComplicationFactory canvasComplicationFactory, java.util.List<? extends androidx.wear.complications.data.ComplicationType> supportedTypes, androidx.wear.complications.DefaultComplicationDataSourcePolicy defaultDataSourcePolicy, androidx.wear.complications.ComplicationSlotBounds bounds, androidx.wear.watchface.ComplicationTapFilter complicationTapFilter);
- method public static androidx.wear.watchface.ComplicationSlot.Builder createRoundRectComplicationSlotBuilder(int id, androidx.wear.watchface.CanvasComplicationFactory canvasComplicationFactory, java.util.List<? extends androidx.wear.complications.data.ComplicationType> supportedTypes, androidx.wear.complications.DefaultComplicationDataSourcePolicy defaultDataSourcePolicy, androidx.wear.complications.ComplicationSlotBounds bounds);
- method @UiThread public int getAccessibilityTraversalIndex();
- method public int getBoundsType();
- method public androidx.wear.watchface.CanvasComplicationFactory getCanvasComplicationFactory();
- method public kotlinx.coroutines.flow.StateFlow<androidx.wear.complications.data.ComplicationData> getComplicationData();
- method @UiThread public androidx.wear.complications.ComplicationSlotBounds getComplicationSlotBounds();
- method public android.os.Bundle getConfigExtras();
- method @UiThread public androidx.wear.complications.DefaultComplicationDataSourcePolicy getDefaultDataSourcePolicy();
- method @UiThread public androidx.wear.complications.data.ComplicationType getDefaultDataSourceType();
- method public boolean getFixedComplicationDataSource();
- method public int getId();
- method public boolean getInitiallyEnabled();
- method public androidx.wear.watchface.CanvasComplication getRenderer();
- method @UiThread public java.util.List<androidx.wear.complications.data.ComplicationType> getSupportedTypes();
- method public androidx.wear.watchface.ComplicationTapFilter getTapFilter();
- method public boolean isActiveAt(java.time.Instant instant);
- method @UiThread public boolean isEnabled();
- method @UiThread public void render(android.graphics.Canvas canvas, java.time.ZonedDateTime zonedDateTime, androidx.wear.watchface.RenderParameters renderParameters);
- method @UiThread public void renderHighlightLayer(android.graphics.Canvas canvas, java.time.ZonedDateTime zonedDateTime, androidx.wear.watchface.RenderParameters renderParameters);
- property @UiThread public final int accessibilityTraversalIndex;
- property public final int boundsType;
- property public final androidx.wear.watchface.CanvasComplicationFactory canvasComplicationFactory;
- property public final kotlinx.coroutines.flow.StateFlow<androidx.wear.complications.data.ComplicationData> complicationData;
- property @UiThread public final androidx.wear.complications.ComplicationSlotBounds complicationSlotBounds;
- property public final android.os.Bundle configExtras;
- property @UiThread public final androidx.wear.complications.DefaultComplicationDataSourcePolicy defaultDataSourcePolicy;
- property @UiThread public final androidx.wear.complications.data.ComplicationType defaultDataSourceType;
- property @UiThread public final boolean enabled;
- property public final boolean fixedComplicationDataSource;
- property public final int id;
- property public final boolean initiallyEnabled;
- property public final androidx.wear.watchface.CanvasComplication renderer;
- property @UiThread public final java.util.List<androidx.wear.complications.data.ComplicationType> supportedTypes;
- property public final androidx.wear.watchface.ComplicationTapFilter tapFilter;
- field public static final androidx.wear.watchface.ComplicationSlot.Companion Companion;
- }
-
- public static final class ComplicationSlot.Builder {
- method public androidx.wear.watchface.ComplicationSlot build();
- method public androidx.wear.watchface.ComplicationSlot.Builder setAccessibilityTraversalIndex(int accessibilityTraversalIndex);
- method public androidx.wear.watchface.ComplicationSlot.Builder setConfigExtras(android.os.Bundle extras);
- method public androidx.wear.watchface.ComplicationSlot.Builder setDefaultDataSourceType(androidx.wear.complications.data.ComplicationType defaultDataSourceType);
- method public androidx.wear.watchface.ComplicationSlot.Builder setEnabled(boolean enabled);
- method public androidx.wear.watchface.ComplicationSlot.Builder setFixedComplicationDataSource(boolean fixedComplicationDataSource);
- }
-
- public static final class ComplicationSlot.Companion {
- method public androidx.wear.watchface.ComplicationSlot.Builder createBackgroundComplicationSlotBuilder(int id, androidx.wear.watchface.CanvasComplicationFactory canvasComplicationFactory, java.util.List<? extends androidx.wear.complications.data.ComplicationType> supportedTypes, androidx.wear.complications.DefaultComplicationDataSourcePolicy defaultDataSourcePolicy);
- method public androidx.wear.watchface.ComplicationSlot.Builder createEdgeComplicationSlotBuilder(int id, androidx.wear.watchface.CanvasComplicationFactory canvasComplicationFactory, java.util.List<? extends androidx.wear.complications.data.ComplicationType> supportedTypes, androidx.wear.complications.DefaultComplicationDataSourcePolicy defaultDataSourcePolicy, androidx.wear.complications.ComplicationSlotBounds bounds, androidx.wear.watchface.ComplicationTapFilter complicationTapFilter);
- method public androidx.wear.watchface.ComplicationSlot.Builder createRoundRectComplicationSlotBuilder(int id, androidx.wear.watchface.CanvasComplicationFactory canvasComplicationFactory, java.util.List<? extends androidx.wear.complications.data.ComplicationType> supportedTypes, androidx.wear.complications.DefaultComplicationDataSourcePolicy defaultDataSourcePolicy, androidx.wear.complications.ComplicationSlotBounds bounds);
- }
-
- public final class ComplicationSlotsManager {
- ctor public ComplicationSlotsManager(java.util.Collection<androidx.wear.watchface.ComplicationSlot> complicationSlotCollection, androidx.wear.watchface.style.CurrentUserStyleRepository currentUserStyleRepository);
- method @UiThread public void addTapListener(androidx.wear.watchface.ComplicationSlotsManager.TapCallback tapCallback);
- method public operator androidx.wear.watchface.ComplicationSlot? get(int id);
- method public androidx.wear.watchface.ComplicationSlot? getBackgroundComplicationSlot();
- method public androidx.wear.watchface.ComplicationSlot? getComplicationSlotAt(@Px int x, @Px int y);
- method public java.util.Map<java.lang.Integer,androidx.wear.watchface.ComplicationSlot> getComplicationSlots();
- method public java.util.Map<java.lang.Integer,androidx.wear.watchface.TapEvent> getLastComplicationTapDownEvents();
- method @UiThread public void removeTapListener(androidx.wear.watchface.ComplicationSlotsManager.TapCallback tapCallback);
- property public final java.util.Map<java.lang.Integer,androidx.wear.watchface.ComplicationSlot> complicationSlots;
- property public final java.util.Map<java.lang.Integer,androidx.wear.watchface.TapEvent> lastComplicationTapDownEvents;
- }
-
- public static interface ComplicationSlotsManager.TapCallback {
- method public default void onComplicationSlotTapped(int complicationSlotId);
- }
-
- public final class ComplicationSlotsManagerKt {
- }
-
- public interface ComplicationTapFilter {
- method public boolean hitTest(androidx.wear.watchface.ComplicationSlot complicationSlot, android.graphics.Rect screenBounds, @Px int x, @Px int y);
- }
-
- public final class ContentDescriptionLabel {
- ctor public ContentDescriptionLabel(androidx.wear.complications.data.ComplicationText text, android.graphics.Rect bounds, android.app.PendingIntent? tapAction);
- method public android.graphics.Rect getBounds();
- method public android.app.PendingIntent? getTapAction();
- method public androidx.wear.complications.data.ComplicationText getText();
- method public CharSequence getTextAt(android.content.res.Resources resources, java.time.Instant instant);
- property public final android.graphics.Rect bounds;
- property public final android.app.PendingIntent? tapAction;
- property public final androidx.wear.complications.data.ComplicationText text;
- }
-
- public enum DrawMode {
- enum_constant public static final androidx.wear.watchface.DrawMode AMBIENT;
- enum_constant public static final androidx.wear.watchface.DrawMode INTERACTIVE;
- enum_constant public static final androidx.wear.watchface.DrawMode LOW_BATTERY_INTERACTIVE;
- enum_constant public static final androidx.wear.watchface.DrawMode MUTE;
- }
-
- public final class RenderBufferTextureKt {
- }
-
- public final class RenderParameters {
- ctor public RenderParameters(androidx.wear.watchface.DrawMode drawMode, java.util.Set<? extends androidx.wear.watchface.style.WatchFaceLayer> watchFaceLayers, optional androidx.wear.watchface.RenderParameters.HighlightLayer? highlightLayer, optional java.util.Map<java.lang.Integer,androidx.wear.watchface.TapEvent> lastComplicationTapDownEvents);
- ctor public RenderParameters(androidx.wear.watchface.DrawMode drawMode, java.util.Set<? extends androidx.wear.watchface.style.WatchFaceLayer> watchFaceLayers, optional androidx.wear.watchface.RenderParameters.HighlightLayer? highlightLayer);
- ctor public RenderParameters(androidx.wear.watchface.DrawMode drawMode, java.util.Set<? extends androidx.wear.watchface.style.WatchFaceLayer> watchFaceLayers);
- method public androidx.wear.watchface.DrawMode getDrawMode();
- method public androidx.wear.watchface.RenderParameters.HighlightLayer? getHighlightLayer();
- method public java.util.Map<java.lang.Integer,androidx.wear.watchface.TapEvent> getLastComplicationTapDownEvents();
- method public java.util.Set<androidx.wear.watchface.style.WatchFaceLayer> getWatchFaceLayers();
- property public final androidx.wear.watchface.DrawMode drawMode;
- property public final androidx.wear.watchface.RenderParameters.HighlightLayer? highlightLayer;
- property public final java.util.Map<java.lang.Integer,androidx.wear.watchface.TapEvent> lastComplicationTapDownEvents;
- property public final java.util.Set<androidx.wear.watchface.style.WatchFaceLayer> watchFaceLayers;
- field public static final androidx.wear.watchface.RenderParameters.Companion Companion;
- field public static final androidx.wear.watchface.RenderParameters DEFAULT_INTERACTIVE;
- }
-
- public static final class RenderParameters.Companion {
- }
-
- public static final class RenderParameters.HighlightLayer {
- ctor public RenderParameters.HighlightLayer(androidx.wear.watchface.RenderParameters.HighlightedElement highlightedElement, @ColorInt int highlightTint, @ColorInt int backgroundTint);
- method @ColorInt public int getBackgroundTint();
- method @ColorInt public int getHighlightTint();
- method public androidx.wear.watchface.RenderParameters.HighlightedElement getHighlightedElement();
- property @ColorInt public final int backgroundTint;
- property @ColorInt public final int highlightTint;
- property public final androidx.wear.watchface.RenderParameters.HighlightedElement highlightedElement;
- }
-
- public abstract static sealed class RenderParameters.HighlightedElement {
- }
-
- public static final class RenderParameters.HighlightedElement.AllComplicationSlots extends androidx.wear.watchface.RenderParameters.HighlightedElement {
- field public static final androidx.wear.watchface.RenderParameters.HighlightedElement.AllComplicationSlots INSTANCE;
- }
-
- public static final class RenderParameters.HighlightedElement.ComplicationSlot extends androidx.wear.watchface.RenderParameters.HighlightedElement {
- ctor public RenderParameters.HighlightedElement.ComplicationSlot(int id);
- method public int getId();
- property public final int id;
- }
-
- public static final class RenderParameters.HighlightedElement.UserStyle extends androidx.wear.watchface.RenderParameters.HighlightedElement {
- ctor public RenderParameters.HighlightedElement.UserStyle(androidx.wear.watchface.style.UserStyleSetting.Id id);
- method public androidx.wear.watchface.style.UserStyleSetting.Id getId();
- property public final androidx.wear.watchface.style.UserStyleSetting.Id id;
- }
-
- public abstract sealed class Renderer {
- method public final java.util.Collection<kotlin.Pair<java.lang.Integer,androidx.wear.watchface.ContentDescriptionLabel>> getAdditionalContentDescriptionLabels();
- method public final float getCenterX();
- method public final float getCenterY();
- method public final long getInteractiveDrawModeUpdateDelayMillis();
- method @UiThread public android.graphics.Rect getMainClockElementBounds();
- method public final androidx.wear.watchface.RenderParameters getRenderParameters();
- method public final android.graphics.Rect getScreenBounds();
- method public final android.view.SurfaceHolder getSurfaceHolder();
- method @UiThread public final void invalidate();
- method @UiThread public void onDestroy();
- method @UiThread protected void onRenderParametersChanged(androidx.wear.watchface.RenderParameters renderParameters);
- method public final void postInvalidate();
- method public final void setAdditionalContentDescriptionLabels(java.util.Collection<kotlin.Pair<java.lang.Integer,androidx.wear.watchface.ContentDescriptionLabel>> value);
- method public final void setInteractiveDrawModeUpdateDelayMillis(long interactiveDrawModeUpdateDelayMillis);
- method @UiThread public boolean shouldAnimate();
- property public final java.util.Collection<kotlin.Pair<java.lang.Integer,androidx.wear.watchface.ContentDescriptionLabel>> additionalContentDescriptionLabels;
- property public final float centerX;
- property public final float centerY;
- property public final long interactiveDrawModeUpdateDelayMillis;
- property public final androidx.wear.watchface.RenderParameters renderParameters;
- property public final android.graphics.Rect screenBounds;
- property public final android.view.SurfaceHolder surfaceHolder;
- }
-
- public abstract static class Renderer.CanvasRenderer extends androidx.wear.watchface.Renderer {
- ctor @WorkerThread public Renderer.CanvasRenderer(android.view.SurfaceHolder surfaceHolder, androidx.wear.watchface.style.CurrentUserStyleRepository currentUserStyleRepository, androidx.wear.watchface.WatchState watchState, int canvasType, @IntRange(from=0, to=60000) long interactiveDrawModeUpdateDelayMillis);
- method @UiThread public suspend Object? init(kotlin.coroutines.Continuation<? super kotlin.Unit> p);
- method @UiThread public abstract void render(android.graphics.Canvas canvas, android.graphics.Rect bounds, java.time.ZonedDateTime zonedDateTime);
- method @UiThread public abstract void renderHighlightLayer(android.graphics.Canvas canvas, android.graphics.Rect bounds, java.time.ZonedDateTime zonedDateTime);
- }
-
- public abstract static class Renderer.GlesRenderer extends androidx.wear.watchface.Renderer {
- ctor @WorkerThread @kotlin.jvm.Throws(exceptionClasses=GlesException::class) public Renderer.GlesRenderer(android.view.SurfaceHolder surfaceHolder, androidx.wear.watchface.style.CurrentUserStyleRepository currentUserStyleRepository, androidx.wear.watchface.WatchState watchState, @IntRange(from=0, to=60000) long interactiveDrawModeUpdateDelayMillis, optional int[] eglConfigAttribList, optional int[] eglSurfaceAttribList) throws androidx.wear.watchface.Renderer.GlesRenderer.GlesException;
- ctor @WorkerThread @kotlin.jvm.Throws(exceptionClasses=GlesException::class) public Renderer.GlesRenderer(android.view.SurfaceHolder surfaceHolder, androidx.wear.watchface.style.CurrentUserStyleRepository currentUserStyleRepository, androidx.wear.watchface.WatchState watchState, @IntRange(from=0, to=60000) long interactiveDrawModeUpdateDelayMillis, optional int[] eglConfigAttribList) throws androidx.wear.watchface.Renderer.GlesRenderer.GlesException;
- ctor @WorkerThread @kotlin.jvm.Throws(exceptionClasses=GlesException::class) public Renderer.GlesRenderer(android.view.SurfaceHolder surfaceHolder, androidx.wear.watchface.style.CurrentUserStyleRepository currentUserStyleRepository, androidx.wear.watchface.WatchState watchState, @IntRange(from=0, to=60000) long interactiveDrawModeUpdateDelayMillis) throws androidx.wear.watchface.Renderer.GlesRenderer.GlesException;
- method public final android.opengl.EGLContext getEglBackgroundThreadContext();
- method public final android.opengl.EGLConfig getEglConfig();
- method public final android.opengl.EGLDisplay getEglDisplay();
- method public final android.opengl.EGLContext getEglUiThreadContext();
- method @WorkerThread public suspend Object? onBackgroundThreadGlContextCreated(kotlin.coroutines.Continuation<? super kotlin.Unit> p);
- method @UiThread public suspend Object? onUiThreadGlSurfaceCreated(@Px int width, @Px int height, kotlin.coroutines.Continuation<? super kotlin.Unit> p);
- method @UiThread public abstract void render(java.time.ZonedDateTime zonedDateTime);
- method @UiThread public abstract void renderHighlightLayer(java.time.ZonedDateTime zonedDateTime);
- method @WorkerThread public final suspend Object? runBackgroundThreadGlCommands(kotlin.jvm.functions.Function1<? super kotlin.coroutines.Continuation<? super kotlin.Unit>,?> commands, kotlin.coroutines.Continuation<? super kotlin.Unit> p);
- method public final suspend Object? runUiThreadGlCommands(kotlin.jvm.functions.Function1<? super kotlin.coroutines.Continuation<? super kotlin.Unit>,?> commands, kotlin.coroutines.Continuation<? super kotlin.Unit> p);
- method public final void setEglConfig(android.opengl.EGLConfig eglConfig);
- method public final void setEglDisplay(android.opengl.EGLDisplay eglDisplay);
- property public final android.opengl.EGLContext eglBackgroundThreadContext;
- property public final android.opengl.EGLConfig eglConfig;
- property public final android.opengl.EGLDisplay eglDisplay;
- property public final android.opengl.EGLContext eglUiThreadContext;
- }
-
- public static final class Renderer.GlesRenderer.GlesException extends java.lang.Exception {
- ctor public Renderer.GlesRenderer.GlesException(String message);
- }
-
- public final class RendererKt {
- }
-
- public final class RoundRectComplicationTapFilter implements androidx.wear.watchface.ComplicationTapFilter {
- ctor public RoundRectComplicationTapFilter();
- method public boolean hitTest(androidx.wear.watchface.ComplicationSlot complicationSlot, android.graphics.Rect screenBounds, @Px int x, @Px int y);
- }
-
- public final class TapEvent {
- ctor public TapEvent(@Px int xPos, @Px int yPos, java.time.Instant tapTime);
- method public java.time.Instant getTapTime();
- method public int getXPos();
- method public int getYPos();
- property public final java.time.Instant tapTime;
- property public final int xPos;
- property public final int yPos;
- }
-
- public final class WatchFace {
- ctor public WatchFace(int watchFaceType, androidx.wear.watchface.Renderer renderer);
- method public androidx.wear.watchface.WatchFace.LegacyWatchFaceOverlayStyle getLegacyWatchFaceStyle();
- method public java.time.Instant? getOverridePreviewReferenceInstant();
- method public androidx.wear.watchface.Renderer getRenderer();
- method public int getWatchFaceType();
- method public static boolean isLegacyWatchFaceOverlayStyleSupported();
- method public androidx.wear.watchface.WatchFace setLegacyWatchFaceStyle(androidx.wear.watchface.WatchFace.LegacyWatchFaceOverlayStyle legacyWatchFaceStyle);
- method public androidx.wear.watchface.WatchFace setOverridePreviewReferenceInstant(java.time.Instant previewReferenceTimeMillis);
- method public androidx.wear.watchface.WatchFace setTapListener(androidx.wear.watchface.WatchFace.TapListener? tapListener);
- method public void setWatchFaceType(int watchFaceType);
- property public final androidx.wear.watchface.WatchFace.LegacyWatchFaceOverlayStyle legacyWatchFaceStyle;
- property public final java.time.Instant? overridePreviewReferenceInstant;
- property public final androidx.wear.watchface.Renderer renderer;
- property public final int watchFaceType;
- field public static final androidx.wear.watchface.WatchFace.Companion Companion;
- }
-
- public static final class WatchFace.Companion {
- method public boolean isLegacyWatchFaceOverlayStyleSupported();
- }
-
- public static final class WatchFace.LegacyWatchFaceOverlayStyle {
- ctor public WatchFace.LegacyWatchFaceOverlayStyle(int viewProtectionMode, int statusBarGravity, boolean tapEventsAccepted, optional @ColorInt int accentColor);
- ctor public WatchFace.LegacyWatchFaceOverlayStyle(int viewProtectionMode, int statusBarGravity, boolean tapEventsAccepted);
- method public int getAccentColor();
- method public int getStatusBarGravity();
- method public boolean getTapEventsAccepted();
- method public int getViewProtectionMode();
- property public final int accentColor;
- property public final int statusBarGravity;
- property public final boolean tapEventsAccepted;
- property public final int viewProtectionMode;
- }
-
- public static interface WatchFace.TapListener {
- method @UiThread public void onTapEvent(int tapType, androidx.wear.watchface.TapEvent tapEvent);
- }
-
- public final class WatchFaceKt {
- }
-
- public abstract class WatchFaceService extends android.service.wallpaper.WallpaperService {
- ctor public WatchFaceService();
- method @WorkerThread protected androidx.wear.watchface.ComplicationSlotsManager createComplicationSlotsManager(androidx.wear.watchface.style.CurrentUserStyleRepository currentUserStyleRepository);
- method @WorkerThread protected androidx.wear.watchface.style.UserStyleSchema createUserStyleSchema();
- method @WorkerThread protected abstract suspend Object? createWatchFace(android.view.SurfaceHolder surfaceHolder, androidx.wear.watchface.WatchState watchState, androidx.wear.watchface.ComplicationSlotsManager complicationSlotsManager, androidx.wear.watchface.style.CurrentUserStyleRepository currentUserStyleRepository, kotlin.coroutines.Continuation<? super androidx.wear.watchface.WatchFace> p);
- method public final android.os.Handler getBackgroundThreadHandler();
- method public final android.os.Handler getUiThreadHandler();
- method public final android.service.wallpaper.WallpaperService.Engine onCreateEngine();
- field public static final androidx.wear.watchface.WatchFaceService.Companion Companion;
- field public static final int MAX_CREATE_WATCHFACE_TIME_MILLIS = 5000; // 0x1388
- }
-
- public static final class WatchFaceService.Companion {
- }
-
- public final class WatchFaceServiceKt {
- }
-
- public final class WatchState {
- ctor public WatchState(kotlinx.coroutines.flow.StateFlow<java.lang.Integer> interruptionFilter, kotlinx.coroutines.flow.StateFlow<java.lang.Boolean> isAmbient, kotlinx.coroutines.flow.StateFlow<java.lang.Boolean> isBatteryLowAndNotCharging, kotlinx.coroutines.flow.StateFlow<java.lang.Boolean> isVisible, boolean hasLowBitAmbient, boolean hasBurnInProtection, long analogPreviewReferenceTimeMillis, long digitalPreviewReferenceTimeMillis, @Px int chinHeight, boolean isHeadless);
- method public long getAnalogPreviewReferenceTimeMillis();
- method @Px public int getChinHeight();
- method public long getDigitalPreviewReferenceTimeMillis();
- method public boolean getHasBurnInProtection();
- method public boolean getHasLowBitAmbient();
- method public kotlinx.coroutines.flow.StateFlow<java.lang.Integer> getInterruptionFilter();
- method public kotlinx.coroutines.flow.StateFlow<java.lang.Boolean> isAmbient();
- method public boolean isHeadless();
- method public kotlinx.coroutines.flow.StateFlow<java.lang.Boolean> isVisible();
- property public final long analogPreviewReferenceTimeMillis;
- property @Px public final int chinHeight;
- property public final long digitalPreviewReferenceTimeMillis;
- property public final boolean hasBurnInProtection;
- property public final boolean hasLowBitAmbient;
- property public final kotlinx.coroutines.flow.StateFlow<java.lang.Integer> interruptionFilter;
- property public final kotlinx.coroutines.flow.StateFlow<java.lang.Boolean> isAmbient;
- property public final boolean isHeadless;
- property public final kotlinx.coroutines.flow.StateFlow<java.lang.Boolean> isVisible;
- }
-
-}
-
diff --git a/wear/wear-watchface/api/restricted_current.txt b/wear/wear-watchface/api/restricted_current.txt
deleted file mode 100644
index cc4033c..0000000
--- a/wear/wear-watchface/api/restricted_current.txt
+++ /dev/null
@@ -1,563 +0,0 @@
-// Signature format: 4.0
-package androidx.wear.watchface {
-
- public final class BackgroundComplicationTapFilter implements androidx.wear.watchface.ComplicationTapFilter {
- ctor public BackgroundComplicationTapFilter();
- method public boolean hitTest(androidx.wear.watchface.ComplicationSlot complicationSlot, android.graphics.Rect screenBounds, @Px int x, @Px int y);
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public final class BroadcastsObserver implements androidx.wear.watchface.BroadcastsReceiver.BroadcastEventObserver {
- ctor public BroadcastsObserver(androidx.wear.watchface.WatchState watchState, androidx.wear.watchface.WatchFaceHostApi watchFaceHostApi, kotlinx.coroutines.Deferred<androidx.wear.watchface.WatchFaceImpl> deferredWatchFaceImpl, kotlinx.coroutines.CoroutineScope uiThreadCoroutineScope);
- method public void onActionBatteryLow();
- method public void onActionBatteryOkay();
- method public void onActionPowerConnected();
- method public void onActionTimeChanged();
- method public void onActionTimeTick();
- method public void onActionTimeZoneChanged();
- method public void onMockTime(android.content.Intent intent);
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public final class BroadcastsReceiver {
- ctor public BroadcastsReceiver(android.content.Context context, androidx.wear.watchface.BroadcastsReceiver.BroadcastEventObserver observer);
- method public void onDestroy();
- }
-
- public static interface BroadcastsReceiver.BroadcastEventObserver {
- method @UiThread public void onActionBatteryLow();
- method @UiThread public void onActionBatteryOkay();
- method @UiThread public void onActionPowerConnected();
- method @UiThread public void onActionTimeChanged();
- method @UiThread public void onActionTimeTick();
- method @UiThread public void onActionTimeZoneChanged();
- method @UiThread public void onMockTime(android.content.Intent intent);
- }
-
- public interface CanvasComplication {
- method public void drawHighlight(android.graphics.Canvas canvas, android.graphics.Rect bounds, @androidx.wear.watchface.ComplicationSlotBoundsType int boundsType, java.time.ZonedDateTime zonedDateTime, @ColorInt int color);
- method public androidx.wear.complications.data.ComplicationData getData();
- method public void loadData(androidx.wear.complications.data.ComplicationData complicationData, boolean loadDrawablesAsynchronous);
- method @WorkerThread public default void onRendererCreated(androidx.wear.watchface.Renderer renderer);
- method @UiThread public void render(android.graphics.Canvas canvas, android.graphics.Rect bounds, java.time.ZonedDateTime zonedDateTime, androidx.wear.watchface.RenderParameters renderParameters, int slotId);
- }
-
- public static interface CanvasComplication.InvalidateCallback {
- method public void onInvalidate();
- }
-
- public interface CanvasComplicationFactory {
- method @WorkerThread public androidx.wear.watchface.CanvasComplication create(androidx.wear.watchface.WatchState, androidx.wear.watchface.CanvasComplication.InvalidateCallback);
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public class ComplicationDataSourceChooserIntent {
- method public static android.content.Intent createComplicationDataSourceChooserIntent(android.content.ComponentName, int, @android.support.wearable.complications.ComplicationData.ComplicationType int...);
- method public static void startProviderChooserActivity(android.content.Context, android.content.ComponentName, int, @android.support.wearable.complications.ComplicationData.ComplicationType int...);
- field @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public static final String EXTRA_COMPLICATION_ID = "android.support.wearable.complications.EXTRA_COMPLICATION_ID";
- field @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public static final String EXTRA_PENDING_INTENT = "android.support.wearable.complications.EXTRA_PENDING_INTENT";
- field public static final String EXTRA_PROVIDER_INFO = "android.support.wearable.complications.EXTRA_PROVIDER_INFO";
- field @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public static final String EXTRA_SUPPORTED_TYPES = "android.support.wearable.complications.EXTRA_SUPPORTED_TYPES";
- field @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public static final String EXTRA_WATCHFACE_INSTANCE_ID = "androidx.wear.complications.EXTRA_WATCHFACE_INSTANCE_ID";
- field @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public static final String EXTRA_WATCH_FACE_COMPONENT_NAME = "android.support.wearable.complications.EXTRA_WATCH_FACE_COMPONENT_NAME";
- }
-
- @RequiresApi(android.os.Build.VERSION_CODES.N) @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public final class ComplicationHelperActivity extends android.app.Activity implements androidx.core.app.ActivityCompat.OnRequestPermissionsResultCallback {
- ctor public ComplicationHelperActivity();
- method public static android.content.Intent createComplicationDataSourceChooserHelperIntent(android.content.Context, android.content.ComponentName, int, java.util.Collection<androidx.wear.complications.data.ComplicationType!>, String?);
- method public static android.content.Intent createPermissionRequestHelperIntent(android.content.Context, android.content.ComponentName);
- field @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public static final String ACTION_PERMISSION_REQUEST_ONLY = "android.support.wearable.complications.ACTION_PERMISSION_REQUEST_ONLY";
- field @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public static final String ACTION_REQUEST_UPDATE_ALL_ACTIVE = "android.support.wearable.complications.ACTION_REQUEST_UPDATE_ALL_ACTIVE";
- field @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public static final String ACTION_START_PROVIDER_CHOOSER = "android.support.wearable.complications.ACTION_START_PROVIDER_CHOOSER";
- field @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public static final String EXTRA_WATCH_FACE_COMPONENT = "android.support.wearable.complications.EXTRA_WATCH_FACE_COMPONENT";
- field public static boolean skipPermissionCheck;
- field public static boolean useTestComplicationDataSourceChooserActivity;
- }
-
- public final class ComplicationSlot {
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public android.graphics.Rect computeBounds(android.graphics.Rect screen, androidx.wear.complications.data.ComplicationType complicationType);
- method public android.graphics.Rect computeBounds(android.graphics.Rect screen);
- method public static androidx.wear.watchface.ComplicationSlot.Builder createBackgroundComplicationSlotBuilder(int id, androidx.wear.watchface.CanvasComplicationFactory canvasComplicationFactory, java.util.List<? extends androidx.wear.complications.data.ComplicationType> supportedTypes, androidx.wear.complications.DefaultComplicationDataSourcePolicy defaultDataSourcePolicy);
- method public static androidx.wear.watchface.ComplicationSlot.Builder createEdgeComplicationSlotBuilder(int id, androidx.wear.watchface.CanvasComplicationFactory canvasComplicationFactory, java.util.List<? extends androidx.wear.complications.data.ComplicationType> supportedTypes, androidx.wear.complications.DefaultComplicationDataSourcePolicy defaultDataSourcePolicy, androidx.wear.complications.ComplicationSlotBounds bounds, androidx.wear.watchface.ComplicationTapFilter complicationTapFilter);
- method public static androidx.wear.watchface.ComplicationSlot.Builder createRoundRectComplicationSlotBuilder(int id, androidx.wear.watchface.CanvasComplicationFactory canvasComplicationFactory, java.util.List<? extends androidx.wear.complications.data.ComplicationType> supportedTypes, androidx.wear.complications.DefaultComplicationDataSourcePolicy defaultDataSourcePolicy, androidx.wear.complications.ComplicationSlotBounds bounds);
- method @UiThread public int getAccessibilityTraversalIndex();
- method public int getBoundsType();
- method public androidx.wear.watchface.CanvasComplicationFactory getCanvasComplicationFactory();
- method public kotlinx.coroutines.flow.StateFlow<androidx.wear.complications.data.ComplicationData> getComplicationData();
- method @UiThread public androidx.wear.complications.ComplicationSlotBounds getComplicationSlotBounds();
- method public android.os.Bundle getConfigExtras();
- method @UiThread public androidx.wear.complications.DefaultComplicationDataSourcePolicy getDefaultDataSourcePolicy();
- method @UiThread public androidx.wear.complications.data.ComplicationType getDefaultDataSourceType();
- method public boolean getFixedComplicationDataSource();
- method public int getId();
- method public boolean getInitiallyEnabled();
- method public androidx.wear.watchface.CanvasComplication getRenderer();
- method @UiThread public java.util.List<androidx.wear.complications.data.ComplicationType> getSupportedTypes();
- method public androidx.wear.watchface.ComplicationTapFilter getTapFilter();
- method public boolean isActiveAt(java.time.Instant instant);
- method @UiThread public boolean isEnabled();
- method @UiThread public void render(android.graphics.Canvas canvas, java.time.ZonedDateTime zonedDateTime, androidx.wear.watchface.RenderParameters renderParameters);
- method @UiThread public void renderHighlightLayer(android.graphics.Canvas canvas, java.time.ZonedDateTime zonedDateTime, androidx.wear.watchface.RenderParameters renderParameters);
- property @UiThread public final int accessibilityTraversalIndex;
- property public final int boundsType;
- property public final androidx.wear.watchface.CanvasComplicationFactory canvasComplicationFactory;
- property public final kotlinx.coroutines.flow.StateFlow<androidx.wear.complications.data.ComplicationData> complicationData;
- property @UiThread public final androidx.wear.complications.ComplicationSlotBounds complicationSlotBounds;
- property public final android.os.Bundle configExtras;
- property @UiThread public final androidx.wear.complications.DefaultComplicationDataSourcePolicy defaultDataSourcePolicy;
- property @UiThread public final androidx.wear.complications.data.ComplicationType defaultDataSourceType;
- property @UiThread public final boolean enabled;
- property public final boolean fixedComplicationDataSource;
- property public final int id;
- property public final boolean initiallyEnabled;
- property public final androidx.wear.watchface.CanvasComplication renderer;
- property @UiThread public final java.util.List<androidx.wear.complications.data.ComplicationType> supportedTypes;
- property public final androidx.wear.watchface.ComplicationTapFilter tapFilter;
- field public static final androidx.wear.watchface.ComplicationSlot.Companion Companion;
- }
-
- public static final class ComplicationSlot.Builder {
- method public androidx.wear.watchface.ComplicationSlot build();
- method public androidx.wear.watchface.ComplicationSlot.Builder setAccessibilityTraversalIndex(int accessibilityTraversalIndex);
- method public androidx.wear.watchface.ComplicationSlot.Builder setConfigExtras(android.os.Bundle extras);
- method public androidx.wear.watchface.ComplicationSlot.Builder setDefaultDataSourceType(androidx.wear.complications.data.ComplicationType defaultDataSourceType);
- method public androidx.wear.watchface.ComplicationSlot.Builder setEnabled(boolean enabled);
- method public androidx.wear.watchface.ComplicationSlot.Builder setFixedComplicationDataSource(boolean fixedComplicationDataSource);
- }
-
- public static final class ComplicationSlot.Companion {
- method public androidx.wear.watchface.ComplicationSlot.Builder createBackgroundComplicationSlotBuilder(int id, androidx.wear.watchface.CanvasComplicationFactory canvasComplicationFactory, java.util.List<? extends androidx.wear.complications.data.ComplicationType> supportedTypes, androidx.wear.complications.DefaultComplicationDataSourcePolicy defaultDataSourcePolicy);
- method public androidx.wear.watchface.ComplicationSlot.Builder createEdgeComplicationSlotBuilder(int id, androidx.wear.watchface.CanvasComplicationFactory canvasComplicationFactory, java.util.List<? extends androidx.wear.complications.data.ComplicationType> supportedTypes, androidx.wear.complications.DefaultComplicationDataSourcePolicy defaultDataSourcePolicy, androidx.wear.complications.ComplicationSlotBounds bounds, androidx.wear.watchface.ComplicationTapFilter complicationTapFilter);
- method public androidx.wear.watchface.ComplicationSlot.Builder createRoundRectComplicationSlotBuilder(int id, androidx.wear.watchface.CanvasComplicationFactory canvasComplicationFactory, java.util.List<? extends androidx.wear.complications.data.ComplicationType> supportedTypes, androidx.wear.complications.DefaultComplicationDataSourcePolicy defaultDataSourcePolicy, androidx.wear.complications.ComplicationSlotBounds bounds);
- }
-
- @IntDef({androidx.wear.watchface.ComplicationSlotBoundsType.ROUND_RECT, androidx.wear.watchface.ComplicationSlotBoundsType.BACKGROUND, androidx.wear.watchface.ComplicationSlotBoundsType.EDGE}) @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public @interface ComplicationSlotBoundsType {
- field public static final int BACKGROUND = 1; // 0x1
- field public static final androidx.wear.watchface.ComplicationSlotBoundsType.Companion Companion;
- field public static final int EDGE = 2; // 0x2
- field public static final int ROUND_RECT = 0; // 0x0
- }
-
- public static final class ComplicationSlotBoundsType.Companion {
- field public static final int BACKGROUND = 1; // 0x1
- field public static final int EDGE = 2; // 0x2
- field public static final int ROUND_RECT = 0; // 0x0
- }
-
- public final class ComplicationSlotsManager {
- ctor public ComplicationSlotsManager(java.util.Collection<androidx.wear.watchface.ComplicationSlot> complicationSlotCollection, androidx.wear.watchface.style.CurrentUserStyleRepository currentUserStyleRepository);
- method @UiThread public void addTapListener(androidx.wear.watchface.ComplicationSlotsManager.TapCallback tapCallback);
- method public operator androidx.wear.watchface.ComplicationSlot? get(int id);
- method public androidx.wear.watchface.ComplicationSlot? getBackgroundComplicationSlot();
- method public androidx.wear.watchface.ComplicationSlot? getComplicationSlotAt(@Px int x, @Px int y);
- method public java.util.Map<java.lang.Integer,androidx.wear.watchface.ComplicationSlot> getComplicationSlots();
- method public java.util.Map<java.lang.Integer,androidx.wear.watchface.TapEvent> getLastComplicationTapDownEvents();
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public void listenForStyleChanges(kotlinx.coroutines.CoroutineScope coroutineScope);
- method @UiThread public void removeTapListener(androidx.wear.watchface.ComplicationSlotsManager.TapCallback tapCallback);
- property public final java.util.Map<java.lang.Integer,androidx.wear.watchface.ComplicationSlot> complicationSlots;
- property public final java.util.Map<java.lang.Integer,androidx.wear.watchface.TapEvent> lastComplicationTapDownEvents;
- field @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) @VisibleForTesting public androidx.wear.watchface.WatchState watchState;
- }
-
- public static interface ComplicationSlotsManager.TapCallback {
- method public default void onComplicationSlotTapped(int complicationSlotId);
- }
-
- public final class ComplicationSlotsManagerKt {
- }
-
- public interface ComplicationTapFilter {
- method public boolean hitTest(androidx.wear.watchface.ComplicationSlot complicationSlot, android.graphics.Rect screenBounds, @Px int x, @Px int y);
- }
-
- public final class ContentDescriptionLabel {
- ctor public ContentDescriptionLabel(androidx.wear.complications.data.ComplicationText text, android.graphics.Rect bounds, android.app.PendingIntent? tapAction);
- method public android.graphics.Rect getBounds();
- method public android.app.PendingIntent? getTapAction();
- method public androidx.wear.complications.data.ComplicationText getText();
- method public CharSequence getTextAt(android.content.res.Resources resources, java.time.Instant instant);
- property public final android.graphics.Rect bounds;
- property public final android.app.PendingIntent? tapAction;
- property public final androidx.wear.complications.data.ComplicationText text;
- }
-
- public enum DrawMode {
- enum_constant public static final androidx.wear.watchface.DrawMode AMBIENT;
- enum_constant public static final androidx.wear.watchface.DrawMode INTERACTIVE;
- enum_constant public static final androidx.wear.watchface.DrawMode LOW_BATTERY_INTERACTIVE;
- enum_constant public static final androidx.wear.watchface.DrawMode MUTE;
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public final class MutableWatchState {
- method public androidx.wear.watchface.WatchState asWatchState();
- method public long getAnalogPreviewReferenceTimeMillis();
- method @Px public int getChinHeight();
- method public long getDigitalPreviewReferenceTimeMillis();
- method public boolean getHasBurnInProtection();
- method public boolean getHasLowBitAmbient();
- method public kotlinx.coroutines.flow.MutableStateFlow<java.lang.Integer> getInterruptionFilter();
- method public kotlinx.coroutines.flow.MutableStateFlow<java.lang.Boolean> isAmbient();
- method public kotlinx.coroutines.flow.MutableStateFlow<java.lang.Boolean> isBatteryLowAndNotCharging();
- method public boolean isHeadless();
- method public kotlinx.coroutines.flow.MutableStateFlow<java.lang.Boolean> isVisible();
- method public void setAnalogPreviewReferenceTimeMillis(long analogPreviewReferenceTimeMillis);
- method public void setChinHeight(@Px int value);
- method public void setDigitalPreviewReferenceTimeMillis(long digitalPreviewReferenceTimeMillis);
- method public void setHasBurnInProtection(boolean hasBurnInProtection);
- method public void setHasLowBitAmbient(boolean hasLowBitAmbient);
- method public void setHeadless(boolean isHeadless);
- method public void setInterruptionFilter(kotlinx.coroutines.flow.MutableStateFlow<java.lang.Integer> interruptionFilter);
- property public final long analogPreviewReferenceTimeMillis;
- property @Px public final int chinHeight;
- property public final long digitalPreviewReferenceTimeMillis;
- property public final boolean hasBurnInProtection;
- property public final boolean hasLowBitAmbient;
- property public final kotlinx.coroutines.flow.MutableStateFlow<java.lang.Integer> interruptionFilter;
- property public final kotlinx.coroutines.flow.MutableStateFlow<java.lang.Boolean> isAmbient;
- property public final kotlinx.coroutines.flow.MutableStateFlow<java.lang.Boolean> isBatteryLowAndNotCharging;
- property public final boolean isHeadless;
- property public final kotlinx.coroutines.flow.MutableStateFlow<java.lang.Boolean> isVisible;
- }
-
- public final class RenderBufferTextureKt {
- }
-
- public final class RenderParameters {
- ctor public RenderParameters(androidx.wear.watchface.DrawMode drawMode, java.util.Set<? extends androidx.wear.watchface.style.WatchFaceLayer> watchFaceLayers, optional androidx.wear.watchface.RenderParameters.HighlightLayer? highlightLayer, optional java.util.Map<java.lang.Integer,androidx.wear.watchface.TapEvent> lastComplicationTapDownEvents);
- ctor public RenderParameters(androidx.wear.watchface.DrawMode drawMode, java.util.Set<? extends androidx.wear.watchface.style.WatchFaceLayer> watchFaceLayers, optional androidx.wear.watchface.RenderParameters.HighlightLayer? highlightLayer);
- ctor public RenderParameters(androidx.wear.watchface.DrawMode drawMode, java.util.Set<? extends androidx.wear.watchface.style.WatchFaceLayer> watchFaceLayers);
- ctor @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public RenderParameters(androidx.wear.watchface.data.RenderParametersWireFormat wireFormat);
- method public androidx.wear.watchface.DrawMode getDrawMode();
- method public androidx.wear.watchface.RenderParameters.HighlightLayer? getHighlightLayer();
- method public java.util.Map<java.lang.Integer,androidx.wear.watchface.TapEvent> getLastComplicationTapDownEvents();
- method public java.util.Set<androidx.wear.watchface.style.WatchFaceLayer> getWatchFaceLayers();
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public androidx.wear.watchface.data.RenderParametersWireFormat toWireFormat();
- property public final androidx.wear.watchface.DrawMode drawMode;
- property public final androidx.wear.watchface.RenderParameters.HighlightLayer? highlightLayer;
- property public final java.util.Map<java.lang.Integer,androidx.wear.watchface.TapEvent> lastComplicationTapDownEvents;
- property public final java.util.Set<androidx.wear.watchface.style.WatchFaceLayer> watchFaceLayers;
- field public static final androidx.wear.watchface.RenderParameters.Companion Companion;
- field public static final androidx.wear.watchface.RenderParameters DEFAULT_INTERACTIVE;
- }
-
- public static final class RenderParameters.Companion {
- }
-
- public static final class RenderParameters.HighlightLayer {
- ctor public RenderParameters.HighlightLayer(androidx.wear.watchface.RenderParameters.HighlightedElement highlightedElement, @ColorInt int highlightTint, @ColorInt int backgroundTint);
- method @ColorInt public int getBackgroundTint();
- method @ColorInt public int getHighlightTint();
- method public androidx.wear.watchface.RenderParameters.HighlightedElement getHighlightedElement();
- property @ColorInt public final int backgroundTint;
- property @ColorInt public final int highlightTint;
- property public final androidx.wear.watchface.RenderParameters.HighlightedElement highlightedElement;
- }
-
- public abstract static sealed class RenderParameters.HighlightedElement {
- }
-
- public static final class RenderParameters.HighlightedElement.AllComplicationSlots extends androidx.wear.watchface.RenderParameters.HighlightedElement {
- field public static final androidx.wear.watchface.RenderParameters.HighlightedElement.AllComplicationSlots INSTANCE;
- }
-
- public static final class RenderParameters.HighlightedElement.ComplicationSlot extends androidx.wear.watchface.RenderParameters.HighlightedElement {
- ctor public RenderParameters.HighlightedElement.ComplicationSlot(int id);
- method public int getId();
- property public final int id;
- }
-
- public static final class RenderParameters.HighlightedElement.UserStyle extends androidx.wear.watchface.RenderParameters.HighlightedElement {
- ctor public RenderParameters.HighlightedElement.UserStyle(androidx.wear.watchface.style.UserStyleSetting.Id id);
- method public androidx.wear.watchface.style.UserStyleSetting.Id getId();
- property public final androidx.wear.watchface.style.UserStyleSetting.Id id;
- }
-
- public abstract sealed class Renderer {
- method public final java.util.Collection<kotlin.Pair<java.lang.Integer,androidx.wear.watchface.ContentDescriptionLabel>> getAdditionalContentDescriptionLabels();
- method public final float getCenterX();
- method public final float getCenterY();
- method public final long getInteractiveDrawModeUpdateDelayMillis();
- method @UiThread public android.graphics.Rect getMainClockElementBounds();
- method public final androidx.wear.watchface.RenderParameters getRenderParameters();
- method public final android.graphics.Rect getScreenBounds();
- method public final android.view.SurfaceHolder getSurfaceHolder();
- method @UiThread public final void invalidate();
- method @UiThread public void onDestroy();
- method @UiThread protected void onRenderParametersChanged(androidx.wear.watchface.RenderParameters renderParameters);
- method public final void postInvalidate();
- method public final void setAdditionalContentDescriptionLabels(java.util.Collection<kotlin.Pair<java.lang.Integer,androidx.wear.watchface.ContentDescriptionLabel>> value);
- method public final void setInteractiveDrawModeUpdateDelayMillis(long interactiveDrawModeUpdateDelayMillis);
- method @UiThread public boolean shouldAnimate();
- property public final java.util.Collection<kotlin.Pair<java.lang.Integer,androidx.wear.watchface.ContentDescriptionLabel>> additionalContentDescriptionLabels;
- property public final float centerX;
- property public final float centerY;
- property public final long interactiveDrawModeUpdateDelayMillis;
- property public final androidx.wear.watchface.RenderParameters renderParameters;
- property public final android.graphics.Rect screenBounds;
- property public final android.view.SurfaceHolder surfaceHolder;
- }
-
- public abstract static class Renderer.CanvasRenderer extends androidx.wear.watchface.Renderer {
- ctor @WorkerThread public Renderer.CanvasRenderer(android.view.SurfaceHolder surfaceHolder, androidx.wear.watchface.style.CurrentUserStyleRepository currentUserStyleRepository, androidx.wear.watchface.WatchState watchState, int canvasType, @IntRange(from=0, to=60000) long interactiveDrawModeUpdateDelayMillis);
- method @UiThread public suspend Object? init(kotlin.coroutines.Continuation<? super kotlin.Unit> p);
- method @UiThread public abstract void render(android.graphics.Canvas canvas, android.graphics.Rect bounds, java.time.ZonedDateTime zonedDateTime);
- method @UiThread public abstract void renderHighlightLayer(android.graphics.Canvas canvas, android.graphics.Rect bounds, java.time.ZonedDateTime zonedDateTime);
- }
-
- public abstract static class Renderer.GlesRenderer extends androidx.wear.watchface.Renderer {
- ctor @WorkerThread @kotlin.jvm.Throws(exceptionClasses=GlesException::class) public Renderer.GlesRenderer(android.view.SurfaceHolder surfaceHolder, androidx.wear.watchface.style.CurrentUserStyleRepository currentUserStyleRepository, androidx.wear.watchface.WatchState watchState, @IntRange(from=0, to=60000) long interactiveDrawModeUpdateDelayMillis, optional int[] eglConfigAttribList, optional int[] eglSurfaceAttribList) throws androidx.wear.watchface.Renderer.GlesRenderer.GlesException;
- ctor @WorkerThread @kotlin.jvm.Throws(exceptionClasses=GlesException::class) public Renderer.GlesRenderer(android.view.SurfaceHolder surfaceHolder, androidx.wear.watchface.style.CurrentUserStyleRepository currentUserStyleRepository, androidx.wear.watchface.WatchState watchState, @IntRange(from=0, to=60000) long interactiveDrawModeUpdateDelayMillis, optional int[] eglConfigAttribList) throws androidx.wear.watchface.Renderer.GlesRenderer.GlesException;
- ctor @WorkerThread @kotlin.jvm.Throws(exceptionClasses=GlesException::class) public Renderer.GlesRenderer(android.view.SurfaceHolder surfaceHolder, androidx.wear.watchface.style.CurrentUserStyleRepository currentUserStyleRepository, androidx.wear.watchface.WatchState watchState, @IntRange(from=0, to=60000) long interactiveDrawModeUpdateDelayMillis) throws androidx.wear.watchface.Renderer.GlesRenderer.GlesException;
- method public final android.opengl.EGLContext getEglBackgroundThreadContext();
- method public final android.opengl.EGLConfig getEglConfig();
- method public final android.opengl.EGLDisplay getEglDisplay();
- method public final android.opengl.EGLContext getEglUiThreadContext();
- method @WorkerThread public suspend Object? onBackgroundThreadGlContextCreated(kotlin.coroutines.Continuation<? super kotlin.Unit> p);
- method @UiThread public suspend Object? onUiThreadGlSurfaceCreated(@Px int width, @Px int height, kotlin.coroutines.Continuation<? super kotlin.Unit> p);
- method @UiThread public abstract void render(java.time.ZonedDateTime zonedDateTime);
- method @UiThread public abstract void renderHighlightLayer(java.time.ZonedDateTime zonedDateTime);
- method @WorkerThread public final suspend Object? runBackgroundThreadGlCommands(kotlin.jvm.functions.Function1<? super kotlin.coroutines.Continuation<? super kotlin.Unit>,?> commands, kotlin.coroutines.Continuation<? super kotlin.Unit> p);
- method public final suspend Object? runUiThreadGlCommands(kotlin.jvm.functions.Function1<? super kotlin.coroutines.Continuation<? super kotlin.Unit>,?> commands, kotlin.coroutines.Continuation<? super kotlin.Unit> p);
- method public final void setEglConfig(android.opengl.EGLConfig eglConfig);
- method public final void setEglDisplay(android.opengl.EGLDisplay eglDisplay);
- property public final android.opengl.EGLContext eglBackgroundThreadContext;
- property public final android.opengl.EGLConfig eglConfig;
- property public final android.opengl.EGLDisplay eglDisplay;
- property public final android.opengl.EGLContext eglUiThreadContext;
- }
-
- public static final class Renderer.GlesRenderer.GlesException extends java.lang.Exception {
- ctor public Renderer.GlesRenderer.GlesException(String message);
- }
-
- public final class RendererKt {
- }
-
- public final class RoundRectComplicationTapFilter implements androidx.wear.watchface.ComplicationTapFilter {
- ctor public RoundRectComplicationTapFilter();
- method public boolean hitTest(androidx.wear.watchface.ComplicationSlot complicationSlot, android.graphics.Rect screenBounds, @Px int x, @Px int y);
- }
-
- public final class TapEvent {
- ctor public TapEvent(@Px int xPos, @Px int yPos, java.time.Instant tapTime);
- method public java.time.Instant getTapTime();
- method public int getXPos();
- method public int getYPos();
- property public final java.time.Instant tapTime;
- property public final int xPos;
- property public final int yPos;
- }
-
- public final class WatchFace {
- ctor public WatchFace(int watchFaceType, androidx.wear.watchface.Renderer renderer);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) @UiThread @VisibleForTesting public static void clearAllEditorDelegates();
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) @UiThread public static suspend Object? createHeadlessSessionDelegate(android.content.ComponentName componentName, androidx.wear.watchface.control.data.HeadlessWatchFaceInstanceParams params, android.content.Context context, kotlin.coroutines.Continuation<? super androidx.wear.watchface.WatchFace.EditorDelegate> p);
- method public androidx.wear.watchface.WatchFace.LegacyWatchFaceOverlayStyle getLegacyWatchFaceStyle();
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) @UiThread public static kotlinx.coroutines.CompletableDeferred<androidx.wear.watchface.WatchFace.EditorDelegate> getOrCreateEditorDelegate(android.content.ComponentName componentName);
- method public java.time.Instant? getOverridePreviewReferenceInstant();
- method public androidx.wear.watchface.Renderer getRenderer();
- method public int getWatchFaceType();
- method public static boolean isLegacyWatchFaceOverlayStyleSupported();
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) @UiThread public static void registerEditorDelegate(android.content.ComponentName componentName, androidx.wear.watchface.WatchFace.EditorDelegate editorDelegate);
- method public androidx.wear.watchface.WatchFace setLegacyWatchFaceStyle(androidx.wear.watchface.WatchFace.LegacyWatchFaceOverlayStyle legacyWatchFaceStyle);
- method public androidx.wear.watchface.WatchFace setOverridePreviewReferenceInstant(java.time.Instant previewReferenceTimeMillis);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public androidx.wear.watchface.WatchFace setSystemTimeProvider(androidx.wear.watchface.WatchFace.SystemTimeProvider systemTimeProvider);
- method public androidx.wear.watchface.WatchFace setTapListener(androidx.wear.watchface.WatchFace.TapListener? tapListener);
- method public void setWatchFaceType(int watchFaceType);
- property public final androidx.wear.watchface.WatchFace.LegacyWatchFaceOverlayStyle legacyWatchFaceStyle;
- property public final java.time.Instant? overridePreviewReferenceInstant;
- property public final androidx.wear.watchface.Renderer renderer;
- property public final int watchFaceType;
- field public static final androidx.wear.watchface.WatchFace.Companion Companion;
- }
-
- public static final class WatchFace.Companion {
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) @UiThread @VisibleForTesting public void clearAllEditorDelegates();
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) @UiThread public suspend Object? createHeadlessSessionDelegate(android.content.ComponentName componentName, androidx.wear.watchface.control.data.HeadlessWatchFaceInstanceParams params, android.content.Context context, kotlin.coroutines.Continuation<? super androidx.wear.watchface.WatchFace.EditorDelegate> p);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) @UiThread public kotlinx.coroutines.CompletableDeferred<androidx.wear.watchface.WatchFace.EditorDelegate> getOrCreateEditorDelegate(android.content.ComponentName componentName);
- method public boolean isLegacyWatchFaceOverlayStyleSupported();
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) @UiThread public void registerEditorDelegate(android.content.ComponentName componentName, androidx.wear.watchface.WatchFace.EditorDelegate editorDelegate);
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public static interface WatchFace.EditorDelegate {
- method public android.os.Handler getBackgroundThreadHandler();
- method public androidx.wear.watchface.ComplicationSlotsManager getComplicationSlotsManager();
- method public java.time.Instant getPreviewReferenceInstant();
- method public android.graphics.Rect getScreenBounds();
- method public androidx.wear.watchface.style.UserStyle getUserStyle();
- method public androidx.wear.watchface.style.UserStyleSchema getUserStyleSchema();
- method public void onDestroy();
- method public android.graphics.Bitmap renderWatchFaceToBitmap(androidx.wear.watchface.RenderParameters renderParameters, java.time.Instant instant, java.util.Map<java.lang.Integer,? extends androidx.wear.complications.data.ComplicationData>? slotIdToComplicationData);
- method public void setUserStyle(androidx.wear.watchface.style.UserStyle userStyle);
- property public abstract android.os.Handler backgroundThreadHandler;
- property public abstract androidx.wear.watchface.ComplicationSlotsManager complicationSlotsManager;
- property public abstract java.time.Instant previewReferenceInstant;
- property public abstract android.graphics.Rect screenBounds;
- property public abstract androidx.wear.watchface.style.UserStyle userStyle;
- property public abstract androidx.wear.watchface.style.UserStyleSchema userStyleSchema;
- }
-
- public static final class WatchFace.LegacyWatchFaceOverlayStyle {
- ctor public WatchFace.LegacyWatchFaceOverlayStyle(int viewProtectionMode, int statusBarGravity, boolean tapEventsAccepted, optional @ColorInt int accentColor);
- ctor public WatchFace.LegacyWatchFaceOverlayStyle(int viewProtectionMode, int statusBarGravity, boolean tapEventsAccepted);
- method public int getAccentColor();
- method public int getStatusBarGravity();
- method public boolean getTapEventsAccepted();
- method public int getViewProtectionMode();
- property public final int accentColor;
- property public final int statusBarGravity;
- property public final boolean tapEventsAccepted;
- property public final int viewProtectionMode;
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public static interface WatchFace.SystemTimeProvider {
- method public long getSystemTimeMillis();
- method public java.time.ZoneId getSystemTimeZoneId();
- }
-
- public static interface WatchFace.TapListener {
- method @UiThread public void onTapEvent(int tapType, androidx.wear.watchface.TapEvent tapEvent);
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public interface WatchFaceHostApi {
- method public android.os.Handler getBackgroundThreadHandler();
- method public android.content.Context getContext();
- method public androidx.wear.watchface.style.data.UserStyleWireFormat? getInitialUserStyle();
- method public kotlinx.coroutines.CoroutineScope getUiThreadCoroutineScope();
- method public android.os.Handler getUiThreadHandler();
- method @UiThread public void invalidate();
- method public void setActiveComplicationSlots(int[] complicationSlotIds);
- method public void setDefaultComplicationDataSourceWithFallbacks(int complicationSlotId, java.util.List<android.content.ComponentName>? dataSources, @androidx.wear.complications.SystemDataSources.DataSourceId int fallbackSystemProvider, int type);
- method public void updateContentDescriptionLabels();
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public final class WatchFaceImpl {
- ctor @UiThread public WatchFaceImpl(androidx.wear.watchface.WatchFace watchface, androidx.wear.watchface.WatchFaceHostApi watchFaceHostApi, androidx.wear.watchface.WatchState watchState, androidx.wear.watchface.style.CurrentUserStyleRepository currentUserStyleRepository, androidx.wear.watchface.ComplicationSlotsManager complicationSlotsManager, androidx.wear.watchface.BroadcastsObserver broadcastsObserver, androidx.wear.watchface.BroadcastsReceiver? broadcastsReceiver);
- method public java.time.Instant getPreviewReferenceInstant();
- method public void setComplicationSlotsManager(androidx.wear.watchface.ComplicationSlotsManager complicationSlotsManager);
- property public final java.time.Instant previewReferenceInstant;
- }
-
- public final class WatchFaceKt {
- }
-
- public abstract class WatchFaceService extends android.service.wallpaper.WallpaperService {
- ctor public WatchFaceService();
- method @WorkerThread protected androidx.wear.watchface.ComplicationSlotsManager createComplicationSlotsManager(androidx.wear.watchface.style.CurrentUserStyleRepository currentUserStyleRepository);
- method @WorkerThread protected androidx.wear.watchface.style.UserStyleSchema createUserStyleSchema();
- method @WorkerThread protected abstract suspend Object? createWatchFace(android.view.SurfaceHolder surfaceHolder, androidx.wear.watchface.WatchState watchState, androidx.wear.watchface.ComplicationSlotsManager complicationSlotsManager, androidx.wear.watchface.style.CurrentUserStyleRepository currentUserStyleRepository, kotlin.coroutines.Continuation<? super androidx.wear.watchface.WatchFace> p);
- method public final android.os.Handler getBackgroundThreadHandler();
- method public final android.os.Handler getUiThreadHandler();
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public android.view.SurfaceHolder? getWallpaperSurfaceHolderOverride();
- method public final android.service.wallpaper.WallpaperService.Engine onCreateEngine();
- field public static final androidx.wear.watchface.WatchFaceService.Companion Companion;
- field public static final int MAX_CREATE_WATCHFACE_TIME_MILLIS = 5000; // 0x1388
- }
-
- public static final class WatchFaceService.Companion {
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public final class WatchFaceService.EngineWrapper extends android.service.wallpaper.WallpaperService.Engine implements androidx.wear.watchface.WatchFaceHostApi {
- ctor public WatchFaceService.EngineWrapper(android.os.Handler uiThreadHandler, android.os.Handler backgroundThreadHandler, boolean headless);
- method public android.os.Handler getBackgroundThreadHandler();
- method public android.content.Context getContext();
- method public kotlinx.coroutines.CompletableDeferred<androidx.wear.watchface.WatchFaceImpl> getDeferredWatchFaceImpl();
- method public androidx.wear.watchface.style.data.UserStyleWireFormat? getInitialUserStyle();
- method public kotlinx.coroutines.CoroutineScope getUiThreadCoroutineScope();
- method public android.os.Handler getUiThreadHandler();
- method public void invalidate();
- method public void setActiveComplicationSlots(int[] complicationSlotIds);
- method public void setDefaultComplicationDataSourceWithFallbacks(int complicationSlotId, java.util.List<android.content.ComponentName>? dataSources, @androidx.wear.complications.SystemDataSources.DataSourceId int fallbackSystemProvider, int type);
- method public void setDeferredWatchFaceImpl(kotlinx.coroutines.CompletableDeferred<androidx.wear.watchface.WatchFaceImpl> deferredWatchFaceImpl);
- method @UiThread public void updateContentDescriptionLabels();
- property public final kotlinx.coroutines.CompletableDeferred<androidx.wear.watchface.WatchFaceImpl> deferredWatchFaceImpl;
- }
-
- public final class WatchFaceServiceKt {
- }
-
- public final class WatchState {
- ctor public WatchState(kotlinx.coroutines.flow.StateFlow<java.lang.Integer> interruptionFilter, kotlinx.coroutines.flow.StateFlow<java.lang.Boolean> isAmbient, kotlinx.coroutines.flow.StateFlow<java.lang.Boolean> isBatteryLowAndNotCharging, kotlinx.coroutines.flow.StateFlow<java.lang.Boolean> isVisible, boolean hasLowBitAmbient, boolean hasBurnInProtection, long analogPreviewReferenceTimeMillis, long digitalPreviewReferenceTimeMillis, @Px int chinHeight, boolean isHeadless);
- method public long getAnalogPreviewReferenceTimeMillis();
- method @Px public int getChinHeight();
- method public long getDigitalPreviewReferenceTimeMillis();
- method public boolean getHasBurnInProtection();
- method public boolean getHasLowBitAmbient();
- method public kotlinx.coroutines.flow.StateFlow<java.lang.Integer> getInterruptionFilter();
- method public kotlinx.coroutines.flow.StateFlow<java.lang.Boolean> isAmbient();
- method public boolean isHeadless();
- method public kotlinx.coroutines.flow.StateFlow<java.lang.Boolean> isVisible();
- property public final long analogPreviewReferenceTimeMillis;
- property @Px public final int chinHeight;
- property public final long digitalPreviewReferenceTimeMillis;
- property public final boolean hasBurnInProtection;
- property public final boolean hasLowBitAmbient;
- property public final kotlinx.coroutines.flow.StateFlow<java.lang.Integer> interruptionFilter;
- property public final kotlinx.coroutines.flow.StateFlow<java.lang.Boolean> isAmbient;
- property public final boolean isHeadless;
- property public final kotlinx.coroutines.flow.StateFlow<java.lang.Boolean> isVisible;
- }
-
-}
-
-package androidx.wear.watchface.control {
-
- @RequiresApi(27) @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public class IWatchFaceInstanceServiceStub extends android.os.Binder implements android.os.IInterface {
- ctor public IWatchFaceInstanceServiceStub(android.content.Context context, android.os.Handler uiThreadHandler);
- method public android.os.IBinder! asBinder();
- method public androidx.wear.watchface.control.IHeadlessWatchFace? createHeadlessWatchFaceInstance(androidx.wear.watchface.control.data.HeadlessWatchFaceInstanceParams params);
- method public int getApiVersion();
- method public androidx.wear.watchface.data.ComplicationSlotMetadataWireFormat![]? getComplicationSlotMetadata(androidx.wear.watchface.control.data.GetComplicationSlotMetadataParams params);
- method public androidx.wear.watchface.control.data.IdTypeAndDefaultProviderPolicyWireFormat![]? getDefaultProviderPolicies(androidx.wear.watchface.control.data.DefaultProviderPoliciesParams params);
- method public androidx.wear.watchface.editor.EditorService getEditorService();
- method public androidx.wear.watchface.control.IInteractiveWatchFace? getInteractiveWatchFaceInstance(String instanceId);
- method public androidx.wear.watchface.control.IInteractiveWatchFace? getOrCreateInteractiveWatchFace(androidx.wear.watchface.control.data.WallpaperInteractiveWatchFaceInstanceParams params, androidx.wear.watchface.control.IPendingInteractiveWatchFace callback);
- method public androidx.wear.watchface.style.data.UserStyleSchemaWireFormat? getUserStyleSchema(androidx.wear.watchface.control.data.GetUserStyleSchemaParams params);
- method public boolean onTransact(int, android.os.Parcel!, android.os.Parcel!, int) throws android.os.RemoteException;
- field public static final int API_VERSION = 3; // 0x3
- }
-
- @RequiresApi(27) @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) @VisibleForTesting public class WatchFaceControlService extends android.app.Service {
- method @VisibleForTesting public androidx.wear.watchface.control.IWatchFaceInstanceServiceStub createServiceStub();
- method public android.os.IBinder? onBind(android.content.Intent? intent);
- method @VisibleForTesting public final void setContext(android.content.Context context);
- field public static final String ACTION_WATCHFACE_CONTROL_SERVICE = "com.google.android.wearable.action.WATCH_FACE_CONTROL";
- }
-
- @RequiresApi(27) @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public final class WatchFaceControlServiceFactory {
- method public static androidx.wear.watchface.control.IWatchFaceControlService createWatchFaceControlService(android.content.Context context, android.os.Handler uiThreadHandler);
- field public static final androidx.wear.watchface.control.WatchFaceControlServiceFactory.Companion Companion;
- }
-
- public static final class WatchFaceControlServiceFactory.Companion {
- method public androidx.wear.watchface.control.IWatchFaceControlService createWatchFaceControlService(android.content.Context context, android.os.Handler uiThreadHandler);
- }
-
-}
-
-package androidx.wear.watchface.editor {
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public final class EditorService extends android.os.Binder implements android.os.IInterface {
- method public void addCloseCallback(androidx.wear.watchface.editor.EditorService.CloseCallback closeCallback);
- method public android.os.IBinder! asBinder();
- method public void broadcastEditorState(androidx.wear.watchface.editor.data.EditorStateWireFormat editorState);
- method public void clearCloseCallbacks();
- method public void closeEditor();
- method public int getApiVersion();
- method public boolean onTransact(int, android.os.Parcel!, android.os.Parcel!, int) throws android.os.RemoteException;
- method public int registerObserver(androidx.wear.watchface.editor.IEditorObserver observer);
- method public void removeCloseCallback(androidx.wear.watchface.editor.EditorService.CloseCallback closeCallback);
- method public void unregisterObserver(int observerId);
- field public static final int API_VERSION = 1; // 0x1
- field public static final androidx.wear.watchface.editor.EditorService.Companion Companion;
- }
-
- public abstract static class EditorService.CloseCallback {
- ctor public EditorService.CloseCallback();
- method public abstract void onClose();
- }
-
- public static final class EditorService.Companion {
- method public androidx.wear.watchface.editor.EditorService getGlobalEditorService();
- property public final androidx.wear.watchface.editor.EditorService globalEditorService;
- }
-
-}
-
diff --git a/wear/wear-watchface/lint-baseline.xml b/wear/wear-watchface/lint-baseline.xml
deleted file mode 100644
index 0dbe68b..0000000
--- a/wear/wear-watchface/lint-baseline.xml
+++ /dev/null
@@ -1,488 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<issues format="6" by="lint 7.1.0-alpha03" type="baseline" client="gradle" name="AGP (7.1.0-alpha03)" variant="all" version="7.1.0-alpha03">
-
- <issue
- id="MissingClass"
- message="Class referenced in the layout file, `androidx.wear.widget.SwipeDismissFrameLayout`, was not found in the project or the libraries"
- errorLine1="<androidx.wear.widget.SwipeDismissFrameLayout"
- errorLine2="^">
- <location
- file="src/main/res/layout/complication_config_layout.xml"
- line="2"
- column="1"/>
- </issue>
-
- <issue
- id="MissingClass"
- message="Class referenced in the layout file, `androidx.wear.widget.SwipeDismissFrameLayout`, was not found in the project or the libraries"
- errorLine1="<androidx.wear.widget.SwipeDismissFrameLayout"
- errorLine2="^">
- <location
- file="src/main/res/layout/config_layout.xml"
- line="2"
- column="1"/>
- </issue>
-
- <issue
- id="MissingClass"
- message="Class referenced in the layout file, `androidx.wear.widget.WearableRecyclerView`, was not found in the project or the libraries"
- errorLine1=" <androidx.wear.widget.WearableRecyclerView"
- errorLine2=" ^">
- <location
- file="src/main/res/layout/config_layout.xml"
- line="11"
- column="5"/>
- </issue>
-
- <issue
- id="MissingClass"
- message="Class referenced in the layout file, `androidx.wear.widget.SwipeDismissFrameLayout`, was not found in the project or the libraries"
- errorLine1="<androidx.wear.widget.SwipeDismissFrameLayout"
- errorLine2="^">
- <location
- file="src/main/res/layout/style_options_layout.xml"
- line="2"
- column="1"/>
- </issue>
-
- <issue
- id="MissingClass"
- message="Class referenced in the layout file, `androidx.wear.widget.WearableRecyclerView`, was not found in the project or the libraries"
- errorLine1=" <androidx.wear.widget.WearableRecyclerView"
- errorLine2=" ^">
- <location
- file="src/main/res/layout/style_options_layout.xml"
- line="10"
- column="5"/>
- </issue>
-
- <issue
- id="NewApi"
- message="Call requires API level 27 (current min is 25): `createInteractiveInstance$lint_module`"
- errorLine1=" engineWrapper.createInteractiveInstance(initParams, "test")"
- errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~">
- <location
- file="src/test/java/androidx/wear/watchface/AsyncWatchFaceInitTest.kt"
- line="220"
- column="31"/>
- </issue>
-
- <issue
- id="NewApi"
- message="Call requires API level 27 (current min is 25): `getExistingInstanceOrSetPendingWallpaperInteractiveWatchFaceInstance`"
- errorLine1=" .getExistingInstanceOrSetPendingWallpaperInteractiveWatchFaceInstance("
- errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
- <location
- file="src/test/java/androidx/wear/watchface/AsyncWatchFaceInitTest.kt"
- line="242"
- column="18"/>
- </issue>
-
- <issue
- id="NewApi"
- message="Call requires API level 27 (current min is 25): `WatchFaceControlService`"
- errorLine1=" WatchFaceControlService().apply {"
- errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~">
- <location
- file="src/androidTest/java/androidx/wear/watchface/test/WatchFaceControlServiceTest.kt"
- line="111"
- column="13"/>
- </issue>
-
- <issue
- id="NewApi"
- message="Call requires API level 27 (current min is 25): `setContext`"
- errorLine1=" setContext(ApplicationProvider.getApplicationContext<Context>())"
- errorLine2=" ~~~~~~~~~~">
- <location
- file="src/androidTest/java/androidx/wear/watchface/test/WatchFaceControlServiceTest.kt"
- line="112"
- column="17"/>
- </issue>
-
- <issue
- id="NewApi"
- message="Call requires API level 27 (current min is 25): `onBind`"
- errorLine1=" }.onBind("
- errorLine2=" ~~~~~~">
- <location
- file="src/androidTest/java/androidx/wear/watchface/test/WatchFaceControlServiceTest.kt"
- line="113"
- column="15"/>
- </issue>
-
- <issue
- id="NewApi"
- message="Call requires API level 27 (current min is 25): `ACTION_WATCHFACE_CONTROL_SERVICE`"
- errorLine1=" Intent(WatchFaceControlService.ACTION_WATCHFACE_CONTROL_SERVICE)"
- errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
- <location
- file="src/androidTest/java/androidx/wear/watchface/test/WatchFaceControlServiceTest.kt"
- line="114"
- column="48"/>
- </issue>
-
- <issue
- id="NewApi"
- message="Call requires API level 27 (current min is 25): `WatchFaceControlService`"
- errorLine1=" WatchFaceControlService().apply {"
- errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~">
- <location
- file="src/androidTest/java/androidx/wear/watchface/test/WatchFaceControlServiceTest.kt"
- line="137"
- column="13"/>
- </issue>
-
- <issue
- id="NewApi"
- message="Call requires API level 27 (current min is 25): `setContext`"
- errorLine1=" setContext(ApplicationProvider.getApplicationContext<Context>())"
- errorLine2=" ~~~~~~~~~~">
- <location
- file="src/androidTest/java/androidx/wear/watchface/test/WatchFaceControlServiceTest.kt"
- line="138"
- column="17"/>
- </issue>
-
- <issue
- id="NewApi"
- message="Call requires API level 27 (current min is 25): `onBind`"
- errorLine1=" }.onBind("
- errorLine2=" ~~~~~~">
- <location
- file="src/androidTest/java/androidx/wear/watchface/test/WatchFaceControlServiceTest.kt"
- line="139"
- column="15"/>
- </issue>
-
- <issue
- id="NewApi"
- message="Call requires API level 27 (current min is 25): `ACTION_WATCHFACE_CONTROL_SERVICE`"
- errorLine1=" Intent(WatchFaceControlService.ACTION_WATCHFACE_CONTROL_SERVICE)"
- errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
- <location
- file="src/androidTest/java/androidx/wear/watchface/test/WatchFaceControlServiceTest.kt"
- line="140"
- column="48"/>
- </issue>
-
- <issue
- id="NewApi"
- message="Call requires API level 27 (current min is 25): `ashmemReadImageBundle`"
- errorLine1=" val bitmap = SharedMemoryImage.ashmemReadImageBundle("
- errorLine2=" ~~~~~~~~~~~~~~~~~~~~~">
- <location
- file="src/androidTest/java/androidx/wear/watchface/test/WatchFaceControlServiceTest.kt"
- line="164"
- column="40"/>
- </issue>
-
- <issue
- id="NewApi"
- message="Call requires API level 27 (current min is 25): `ashmemReadImageBundle`"
- errorLine1=" val bitmap = SharedMemoryImage.ashmemReadImageBundle("
- errorLine2=" ~~~~~~~~~~~~~~~~~~~~~">
- <location
- file="src/androidTest/java/androidx/wear/watchface/test/WatchFaceControlServiceTest.kt"
- line="208"
- column="40"/>
- </issue>
-
- <issue
- id="NewApi"
- message="Call requires API level 27 (current min is 25): `ashmemReadImageBundle`"
- errorLine1=" val bitmap = SharedMemoryImage.ashmemReadImageBundle("
- errorLine2=" ~~~~~~~~~~~~~~~~~~~~~">
- <location
- file="src/androidTest/java/androidx/wear/watchface/test/WatchFaceControlServiceTest.kt"
- line="242"
- column="40"/>
- </issue>
-
- <issue
- id="NewApi"
- message="Call requires API level 27 (current min is 25): `WatchFaceControlService`"
- errorLine1=" WatchFaceControlService().apply {"
- errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~">
- <location
- file="src/androidTest/java/androidx/wear/watchface/test/WatchFaceControlServiceTest.kt"
- line="275"
- column="13"/>
- </issue>
-
- <issue
- id="NewApi"
- message="Call requires API level 27 (current min is 25): `setContext`"
- errorLine1=" setContext(ApplicationProvider.getApplicationContext<Context>())"
- errorLine2=" ~~~~~~~~~~">
- <location
- file="src/androidTest/java/androidx/wear/watchface/test/WatchFaceControlServiceTest.kt"
- line="276"
- column="17"/>
- </issue>
-
- <issue
- id="NewApi"
- message="Call requires API level 27 (current min is 25): `onBind`"
- errorLine1=" }.onBind("
- errorLine2=" ~~~~~~">
- <location
- file="src/androidTest/java/androidx/wear/watchface/test/WatchFaceControlServiceTest.kt"
- line="277"
- column="15"/>
- </issue>
-
- <issue
- id="NewApi"
- message="Call requires API level 27 (current min is 25): `ACTION_WATCHFACE_CONTROL_SERVICE`"
- errorLine1=" Intent(WatchFaceControlService.ACTION_WATCHFACE_CONTROL_SERVICE)"
- errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
- <location
- file="src/androidTest/java/androidx/wear/watchface/test/WatchFaceControlServiceTest.kt"
- line="278"
- column="48"/>
- </issue>
-
- <issue
- id="NewApi"
- message="Call requires API level 26 (current min is 25): `android.graphics.SurfaceTexture()`"
- errorLine1=" private val surfaceTexture = SurfaceTexture(false)"
- errorLine2=" ~~~~~~~~~~~~~~~~~~~~~">
- <location
- file="src/androidTest/java/androidx/wear/watchface/test/WatchFaceServiceImageTest.kt"
- line="292"
- column="34"/>
- </issue>
-
- <issue
- id="NewApi"
- message="Call requires API level 26 (current min is 25): `android.view.SurfaceHolder#lockHardwareCanvas`"
- errorLine1=" Mockito.`when`(surfaceHolder.lockHardwareCanvas()).thenReturn(canvas)"
- errorLine2=" ~~~~~~~~~~~~~~~~~~">
- <location
- file="src/androidTest/java/androidx/wear/watchface/test/WatchFaceServiceImageTest.kt"
- line="330"
- column="38"/>
- </issue>
-
- <issue
- id="NewApi"
- message="Call requires API level 26 (current min is 25): `android.view.SurfaceHolder#lockHardwareCanvas`"
- errorLine1=" Mockito.`when`(surfaceHolder.lockHardwareCanvas()).thenReturn(canvas)"
- errorLine2=" ~~~~~~~~~~~~~~~~~~">
- <location
- file="src/androidTest/java/androidx/wear/watchface/test/WatchFaceServiceImageTest.kt"
- line="368"
- column="38"/>
- </issue>
-
- <issue
- id="NewApi"
- message="Call requires API level 27 (current min is 25): `getExistingInstanceOrSetPendingWallpaperInteractiveWatchFaceInstance`"
- errorLine1=" .getExistingInstanceOrSetPendingWallpaperInteractiveWatchFaceInstance("
- errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
- <location
- file="src/androidTest/java/androidx/wear/watchface/test/WatchFaceServiceImageTest.kt"
- line="413"
- column="14"/>
- </issue>
-
- <issue
- id="NewApi"
- message="Call requires API level 27 (current min is 25): `setWatchUiState`"
- errorLine1=" interactiveWatchFaceInstance.setWatchUiState("
- errorLine2=" ~~~~~~~~~~~~~~~">
- <location
- file="src/androidTest/java/androidx/wear/watchface/test/WatchFaceServiceImageTest.kt"
- line="463"
- column="38"/>
- </issue>
-
- <issue
- id="NewApi"
- message="Call requires API level 27 (current min is 25): `release`"
- errorLine1=" interactiveWatchFaceInstance.release()"
- errorLine2=" ~~~~~~~">
- <location
- file="src/androidTest/java/androidx/wear/watchface/test/WatchFaceServiceImageTest.kt"
- line="469"
- column="38"/>
- </issue>
-
- <issue
- id="NewApi"
- message="Call requires API level 26 (current min is 25): `android.view.SurfaceHolder#lockHardwareCanvas`"
- errorLine1=" Mockito.`when`(surfaceHolder.lockHardwareCanvas()).thenReturn(canvas)"
- errorLine2=" ~~~~~~~~~~~~~~~~~~">
- <location
- file="src/androidTest/java/androidx/wear/watchface/test/WatchFaceServiceImageTest.kt"
- line="802"
- column="38"/>
- </issue>
-
- <issue
- id="NewApi"
- message="Call requires API level 27 (current min is 25): `getExistingInstanceOrSetPendingWallpaperInteractiveWatchFaceInstance`"
- errorLine1=" .getExistingInstanceOrSetPendingWallpaperInteractiveWatchFaceInstance("
- errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
- <location
- file="src/test/java/androidx/wear/watchface/WatchFaceServiceTest.kt"
- line="434"
- column="14"/>
- </issue>
-
- <issue
- id="NewApi"
- message="Call requires API level 27 (current min is 25): `getExistingInstanceOrSetPendingWallpaperInteractiveWatchFaceInstance`"
- errorLine1=" .getExistingInstanceOrSetPendingWallpaperInteractiveWatchFaceInstance("
- errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
- <location
- file="src/test/java/androidx/wear/watchface/WatchFaceServiceTest.kt"
- line="2699"
- column="14"/>
- </issue>
-
- <issue
- id="NewApi"
- message="Call requires API level 27 (current min is 25): `updateComplicationData`"
- errorLine1=" interactiveInstance!!.updateComplicationData("
- errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~">
- <location
- file="src/test/java/androidx/wear/watchface/WatchFaceServiceTest.kt"
- line="2765"
- column="31"/>
- </issue>
-
- <issue
- id="NewApi"
- message="Call requires API level 29 (current min is 25): `android.view.WindowInsets.Builder#setSystemWindowInsets`"
- errorLine1=" WindowInsets.Builder().setSystemWindowInsets("
- errorLine2=" ~~~~~~~~~~~~~~~~~~~~~">
- <location
- file="src/test/java/androidx/wear/watchface/WatchFaceServiceTest.kt"
- line="2939"
- column="32"/>
- </issue>
-
- <issue
- id="NewApi"
- message="Call requires API level 29 (current min is 25): `android.view.WindowInsets.Builder()`"
- errorLine1=" WindowInsets.Builder().setSystemWindowInsets("
- errorLine2=" ~~~~~~~~~">
- <location
- file="src/test/java/androidx/wear/watchface/WatchFaceServiceTest.kt"
- line="2939"
- column="22"/>
- </issue>
-
- <issue
- id="NewApi"
- message="Call requires API level 29 (current min is 25): `android.graphics.Insets#of`"
- errorLine1=" Insets.of(0, 0, 0, chinHeight)"
- errorLine2=" ~~">
- <location
- file="src/test/java/androidx/wear/watchface/WatchFaceServiceTest.kt"
- line="2940"
- column="20"/>
- </issue>
-
- <issue
- id="NewApi"
- message="Call requires API level 29 (current min is 25): `android.view.WindowInsets.Builder#build`"
- errorLine1=" ).build()"
- errorLine2=" ~~~~~">
- <location
- file="src/test/java/androidx/wear/watchface/WatchFaceServiceTest.kt"
- line="2941"
- column="11"/>
- </issue>
-
- <issue
- id="NewApi"
- message="Call requires API level 29 (current min is 25): `android.view.WindowInsets.Builder()`"
- errorLine1=" WindowInsets.Builder().setInsets("
- errorLine2=" ~~~~~~~~~">
- <location
- file="src/test/java/androidx/wear/watchface/WatchFaceServiceTest.kt"
- line="2944"
- column="22"/>
- </issue>
-
- <issue
- id="NewApi"
- message="Call requires API level 30 (current min is 25): `android.view.WindowInsets.Builder#setInsets`"
- errorLine1=" WindowInsets.Builder().setInsets("
- errorLine2=" ~~~~~~~~~">
- <location
- file="src/test/java/androidx/wear/watchface/WatchFaceServiceTest.kt"
- line="2944"
- column="32"/>
- </issue>
-
- <issue
- id="NewApi"
- message="Call requires API level 30 (current min is 25): `android.view.WindowInsets.Type#systemBars`"
- errorLine1=" WindowInsets.Type.systemBars(),"
- errorLine2=" ~~~~~~~~~~">
- <location
- file="src/test/java/androidx/wear/watchface/WatchFaceServiceTest.kt"
- line="2945"
- column="31"/>
- </issue>
-
- <issue
- id="NewApi"
- message="Call requires API level 29 (current min is 25): `android.graphics.Insets#of`"
- errorLine1=" Insets.of(Rect().apply { bottom = chinHeight })"
- errorLine2=" ~~">
- <location
- file="src/test/java/androidx/wear/watchface/WatchFaceServiceTest.kt"
- line="2946"
- column="20"/>
- </issue>
-
- <issue
- id="NewApi"
- message="Call requires API level 29 (current min is 25): `android.view.WindowInsets.Builder#build`"
- errorLine1=" ).build()"
- errorLine2=" ~~~~~">
- <location
- file="src/test/java/androidx/wear/watchface/WatchFaceServiceTest.kt"
- line="2947"
- column="11"/>
- </issue>
-
- <issue
- id="WrongThread"
- message="Method addUserStyleChangeListener must be called from the UI thread, currently inferred thread is worker thread"
- errorLine1=" currentUserStyleRepository.addUserStyleChangeListener("
- errorLine2=" ^">
- <location
- file="src/test/java/androidx/wear/watchface/TestCommon.kt"
- line="89"
- column="9"/>
- </issue>
-
- <issue
- id="WrongThread"
- message="Method addTapListener must be called from the UI thread, currently inferred thread is worker thread"
- errorLine1=" complicationSlotsManager.addTapListener("
- errorLine2=" ^">
- <location
- file="src/test/java/androidx/wear/watchface/TestCommon.kt"
- line="99"
- column="9"/>
- </issue>
-
- <issue
- id="ClassVerificationFailure"
- message="This call references a method added in API level 30; however, the containing class androidx.wear.watchface.WatchFaceImpl is reachable from earlier API levels and will fail run-time class verification."
- errorLine1=" renderer.surfaceHolder.surface.setFrameRate("
- errorLine2=" ~~~~~~~~~~~~">
- <location
- file="src/main/java/androidx/wear/watchface/WatchFace.kt"
- line="593"
- column="44"/>
- </issue>
-
-</issues>
diff --git a/window/window-extensions/api/api_lint.ignore b/window/window-extensions/api/api_lint.ignore
deleted file mode 100644
index c929e8e..0000000
--- a/window/window-extensions/api/api_lint.ignore
+++ /dev/null
@@ -1,3 +0,0 @@
-// Baseline format: 1.0
-ExecutorRegistration: androidx.window.extensions.layout.ExtensionInterface#setExtensionCallback(androidx.window.extensions.layout.ExtensionInterface.ExtensionCallback):
- Registration methods should have overload that accepts delivery Executor: `setExtensionCallback`
diff --git a/window/window-extensions/api/current.txt b/window/window-extensions/api/current.txt
index 95519f1..096d5d7 100644
--- a/window/window-extensions/api/current.txt
+++ b/window/window-extensions/api/current.txt
@@ -1,9 +1,14 @@
// Signature format: 4.0
package androidx.window.extensions {
- public class WindowLibraryInfo {
- method public static androidx.window.extensions.WindowLibraryInfo getInstance(android.content.Context);
- method public int getVendorApiLevel();
+ public interface WindowExtensions {
+ method public default int getVendorApiLevel();
+ method public androidx.window.extensions.layout.WindowLayoutComponent getWindowLayoutComponent();
+ method public boolean isWindowLayoutComponentAvailable();
+ }
+
+ public class WindowExtensionsProvider {
+ method public static androidx.window.extensions.WindowExtensions getWindowExtensions();
}
}
@@ -27,15 +32,9 @@
public interface WindowLayoutComponent {
method public void addWindowLayoutInfoListener(android.app.Activity, java.util.function.Consumer<androidx.window.extensions.layout.WindowLayoutInfo!>);
- method public static androidx.window.extensions.layout.WindowLayoutComponent? getInstance(android.content.Context);
method public void removeWindowLayoutInfoListener(java.util.function.Consumer<androidx.window.extensions.layout.WindowLayoutInfo!>);
}
- public class WindowLayoutComponentProvider {
- method public static androidx.window.extensions.layout.WindowLayoutComponent getWindowLayoutComponent(android.content.Context);
- method public static boolean isWindowLayoutComponentAvailable();
- }
-
public class WindowLayoutInfo {
ctor public WindowLayoutInfo(java.util.List<androidx.window.extensions.layout.DisplayFeature!>);
method public java.util.List<androidx.window.extensions.layout.DisplayFeature!> getDisplayFeatures();
diff --git a/window/window-extensions/api/public_plus_experimental_current.txt b/window/window-extensions/api/public_plus_experimental_current.txt
index 95519f1..096d5d7 100644
--- a/window/window-extensions/api/public_plus_experimental_current.txt
+++ b/window/window-extensions/api/public_plus_experimental_current.txt
@@ -1,9 +1,14 @@
// Signature format: 4.0
package androidx.window.extensions {
- public class WindowLibraryInfo {
- method public static androidx.window.extensions.WindowLibraryInfo getInstance(android.content.Context);
- method public int getVendorApiLevel();
+ public interface WindowExtensions {
+ method public default int getVendorApiLevel();
+ method public androidx.window.extensions.layout.WindowLayoutComponent getWindowLayoutComponent();
+ method public boolean isWindowLayoutComponentAvailable();
+ }
+
+ public class WindowExtensionsProvider {
+ method public static androidx.window.extensions.WindowExtensions getWindowExtensions();
}
}
@@ -27,15 +32,9 @@
public interface WindowLayoutComponent {
method public void addWindowLayoutInfoListener(android.app.Activity, java.util.function.Consumer<androidx.window.extensions.layout.WindowLayoutInfo!>);
- method public static androidx.window.extensions.layout.WindowLayoutComponent? getInstance(android.content.Context);
method public void removeWindowLayoutInfoListener(java.util.function.Consumer<androidx.window.extensions.layout.WindowLayoutInfo!>);
}
- public class WindowLayoutComponentProvider {
- method public static androidx.window.extensions.layout.WindowLayoutComponent getWindowLayoutComponent(android.content.Context);
- method public static boolean isWindowLayoutComponentAvailable();
- }
-
public class WindowLayoutInfo {
ctor public WindowLayoutInfo(java.util.List<androidx.window.extensions.layout.DisplayFeature!>);
method public java.util.List<androidx.window.extensions.layout.DisplayFeature!> getDisplayFeatures();
diff --git a/window/window-extensions/api/restricted_current.txt b/window/window-extensions/api/restricted_current.txt
index 95519f1..096d5d7 100644
--- a/window/window-extensions/api/restricted_current.txt
+++ b/window/window-extensions/api/restricted_current.txt
@@ -1,9 +1,14 @@
// Signature format: 4.0
package androidx.window.extensions {
- public class WindowLibraryInfo {
- method public static androidx.window.extensions.WindowLibraryInfo getInstance(android.content.Context);
- method public int getVendorApiLevel();
+ public interface WindowExtensions {
+ method public default int getVendorApiLevel();
+ method public androidx.window.extensions.layout.WindowLayoutComponent getWindowLayoutComponent();
+ method public boolean isWindowLayoutComponentAvailable();
+ }
+
+ public class WindowExtensionsProvider {
+ method public static androidx.window.extensions.WindowExtensions getWindowExtensions();
}
}
@@ -27,15 +32,9 @@
public interface WindowLayoutComponent {
method public void addWindowLayoutInfoListener(android.app.Activity, java.util.function.Consumer<androidx.window.extensions.layout.WindowLayoutInfo!>);
- method public static androidx.window.extensions.layout.WindowLayoutComponent? getInstance(android.content.Context);
method public void removeWindowLayoutInfoListener(java.util.function.Consumer<androidx.window.extensions.layout.WindowLayoutInfo!>);
}
- public class WindowLayoutComponentProvider {
- method public static androidx.window.extensions.layout.WindowLayoutComponent getWindowLayoutComponent(android.content.Context);
- method public static boolean isWindowLayoutComponentAvailable();
- }
-
public class WindowLayoutInfo {
ctor public WindowLayoutInfo(java.util.List<androidx.window.extensions.layout.DisplayFeature!>);
method public java.util.List<androidx.window.extensions.layout.DisplayFeature!> getDisplayFeatures();
diff --git a/window/window-extensions/src/main/java/androidx/window/extensions/WindowExtensions.java b/window/window-extensions/src/main/java/androidx/window/extensions/WindowExtensions.java
new file mode 100644
index 0000000..6804b74
--- /dev/null
+++ b/window/window-extensions/src/main/java/androidx/window/extensions/WindowExtensions.java
@@ -0,0 +1,60 @@
+/*
+ * Copyright 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES 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.window.extensions;
+
+import androidx.annotation.NonNull;
+import androidx.window.extensions.layout.WindowLayoutComponent;
+
+/**
+ * A class to provide instances of different WindowManager Jetpack extension components. An OEM must
+ * implement all the availability methods to state which WindowManager Jetpack extension
+ * can be used. If a component is not available then the check must return {@code false}. Trying to
+ * get a component that is not available will throw an {@link UnsupportedOperationException}.
+ * All components must support the API level returned in
+ * {@link WindowExtensions#getVendorApiLevel()}.
+ */
+public interface WindowExtensions {
+ /**
+ * Returns the API level of the vendor library on the device. If the returned version is not
+ * supported by the WindowManager library, then some functions may not be available or replaced
+ * with stub implementations.
+ *
+ * The expected use case is for the WindowManager library to determine which APIs are
+ * available and wrap the API so that app developers do not need to deal with the complexity.
+ * @return the API level supported by the library.
+ */
+ default int getVendorApiLevel() {
+ return 1;
+ }
+
+ /**
+ * Returns {@code true} if {@link WindowLayoutComponent} is present on the device,
+ * {@code false} otherwise.
+ */
+ boolean isWindowLayoutComponentAvailable();
+
+ /**
+ * Returns the OEM implementation of {@link WindowLayoutComponent} if it is supported on the
+ * device. The implementation must match the API level reported in
+ * {@link WindowExtensions}. Use {@link WindowExtensions#isWindowLayoutComponentAvailable()} to
+ * determine if {@link WindowLayoutComponent} is present.
+ * @return the OEM implementation of {@link WindowLayoutComponent}
+ * @throws UnsupportedOperationException if the device does not support
+ */
+ @NonNull
+ WindowLayoutComponent getWindowLayoutComponent();
+}
diff --git a/window/window-extensions/src/main/java/androidx/window/extensions/WindowExtensionsProvider.java b/window/window-extensions/src/main/java/androidx/window/extensions/WindowExtensionsProvider.java
new file mode 100644
index 0000000..1f3aefd
--- /dev/null
+++ b/window/window-extensions/src/main/java/androidx/window/extensions/WindowExtensionsProvider.java
@@ -0,0 +1,37 @@
+/*
+ * Copyright 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES 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.window.extensions;
+
+import androidx.annotation.NonNull;
+
+/**
+ * Provides the OEM implementation of {@link WindowExtensions}.
+ */
+public class WindowExtensionsProvider {
+
+ private WindowExtensionsProvider() {}
+
+ /**
+ * Returns the OEM implementation of {@link WindowExtensions}. This method must be
+ * implemented by the OEM also.
+ * @return the OEM implementation of {@link WindowExtensions}
+ */
+ @NonNull
+ public static WindowExtensions getWindowExtensions() {
+ throw new UnsupportedOperationException("Stub, replace with implementation");
+ }
+}
diff --git a/window/window-extensions/src/main/java/androidx/window/extensions/WindowLibraryInfo.java b/window/window-extensions/src/main/java/androidx/window/extensions/WindowLibraryInfo.java
deleted file mode 100644
index 0404625c..0000000
--- a/window/window-extensions/src/main/java/androidx/window/extensions/WindowLibraryInfo.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Copyright 2021 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES 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.window.extensions;
-
-import android.content.Context;
-
-import androidx.annotation.NonNull;
-
-/**
- * A class to return global information about the library. From this class you can get the
- * API level supported by the library.
- *
- * @see WindowLibraryInfo#getVendorApiLevel() ()
- */
-public class WindowLibraryInfo {
-
- private WindowLibraryInfo() {}
-
- /**
- * Returns the API level of the vendor library on the device. If the returned version is not
- * supported by the WindowManager library, then some functions may not be available or replaced
- * with stub implementations.
- *
- * The expected use case is for the WindowManager library to determine which APIs are
- * available and wrap the API so that app developers do not need to deal with the complexity.
- * @return the API level supported by the library.
- */
- public int getVendorApiLevel() {
- return 1;
- }
-
- @NonNull
- public static WindowLibraryInfo getInstance(@NonNull Context context) {
- return new WindowLibraryInfo();
- }
-}
diff --git a/window/window-extensions/src/main/java/androidx/window/extensions/layout/WindowLayoutComponent.java b/window/window-extensions/src/main/java/androidx/window/extensions/layout/WindowLayoutComponent.java
index dc71865..dc3d83c 100644
--- a/window/window-extensions/src/main/java/androidx/window/extensions/layout/WindowLayoutComponent.java
+++ b/window/window-extensions/src/main/java/androidx/window/extensions/layout/WindowLayoutComponent.java
@@ -17,10 +17,9 @@
package androidx.window.extensions.layout;
import android.app.Activity;
-import android.content.Context;
import androidx.annotation.NonNull;
-import androidx.annotation.Nullable;
+import androidx.window.extensions.WindowExtensions;
import java.util.function.Consumer;
@@ -36,7 +35,7 @@
* relevant logical areas.
*
* <p>This interface should be implemented by OEM and deployed to the target devices.
- * @see WindowLayoutComponentProvider
+ * @see WindowExtensions#getWindowLayoutComponent()
*/
public interface WindowLayoutComponent {
@@ -54,19 +53,4 @@
*/
public void removeWindowLayoutInfoListener(
@NonNull Consumer<WindowLayoutInfo> consumer);
-
- /**
- * Returns the OEM implementation of {@link WindowLayoutComponent} if it is supported on the
- * device. The implementation must match the API level reported in
- * {@link androidx.window.extensions.WindowLibraryInfo}. A {@code null} value may be returned
- * if the device does not support {@link WindowLayoutInfo}. If {@code null} is returned the
- * core library will ignore all features related to {@link WindowLayoutComponent}. Currently
- * the developer will receive a single callback with empty data where possible. For
- * synchronous methods we will return a default value or {@code null}.
- * @return the OEM implementation of {@link WindowLayoutComponent}
- */
- @Nullable
- public static WindowLayoutComponent getInstance(@NonNull Context context) {
- throw new UnsupportedOperationException("Stub, replace with implementation.");
- }
}
diff --git a/window/window-extensions/src/main/java/androidx/window/extensions/layout/WindowLayoutComponentProvider.java b/window/window-extensions/src/main/java/androidx/window/extensions/layout/WindowLayoutComponentProvider.java
deleted file mode 100644
index 8e41db9..0000000
--- a/window/window-extensions/src/main/java/androidx/window/extensions/layout/WindowLayoutComponentProvider.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright 2021 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES 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.window.extensions.layout;
-
-import android.content.Context;
-
-import androidx.annotation.NonNull;
-import androidx.window.extensions.WindowLibraryInfo;
-
-/**
- * A class to provide instances of {@link WindowLayoutComponent}. An OEM must implement
- * {@link WindowLayoutComponentProvider#isWindowLayoutComponentAvailable()} and
- * {@link WindowLayoutComponentProvider#getWindowLayoutComponent(Context)} for the core window
- * library to support {@link DisplayFeature}s. Any implementation of
- * {@link WindowLayoutComponent} must support the methods up to
- * {@link WindowLibraryInfo#getApiLevel()}
- */
-public class WindowLayoutComponentProvider {
-
- private WindowLayoutComponentProvider() {}
-
- /**
- * Returns {@code true} if {@link WindowLayoutComponent} is present on the device,
- * {@code false} otherwise.
- */
- public static boolean isWindowLayoutComponentAvailable() {
- throw new UnsupportedOperationException("Stub, replace with implementation.");
- }
-
- /**
- * Returns the OEM implementation of {@link WindowLayoutComponent} if it is supported on the
- * device. The implementation must match the API level reported in
- * {@link androidx.window.extensions.WindowLibraryInfo}. An
- * {@link UnsupportedOperationException} will be thrown if the device does not support
- * {@link WindowLayoutInfo}. Use
- * {@link WindowLayoutComponentProvider#isWindowLayoutComponentAvailable()} to determine if
- * {@link WindowLayoutComponent} is present.
- * @return the OEM implementation of {@link WindowLayoutComponent}
- */
- @NonNull
- public static WindowLayoutComponent getWindowLayoutComponent(@NonNull Context context) {
- throw new UnsupportedOperationException("Stub, replace with implementation.");
- }
-}
diff --git a/window/window-java/src/androidTest/java/androidx/window/java/layout/WindowInfoRepositoryCallbackAdapterTest.kt b/window/window-java/src/androidTest/java/androidx/window/java/layout/WindowInfoRepositoryCallbackAdapterTest.kt
index e83ec38..fcb4a6f 100644
--- a/window/window-java/src/androidTest/java/androidx/window/java/layout/WindowInfoRepositoryCallbackAdapterTest.kt
+++ b/window/window-java/src/androidTest/java/androidx/window/java/layout/WindowInfoRepositoryCallbackAdapterTest.kt
@@ -85,7 +85,7 @@
@Test
public fun testRegisterListener() {
val feature = mock<FoldingFeature>()
- val expected = WindowLayoutInfo.Builder().setDisplayFeatures(listOf(feature)).build()
+ val expected = WindowLayoutInfo(listOf(feature))
val mockRepo = mock<WindowInfoRepository>()
whenever(mockRepo.windowLayoutInfo).thenReturn(flowOf(expected))
val unitUnderTest = WindowInfoRepositoryCallbackAdapter(mockRepo)
@@ -99,7 +99,7 @@
@Test
public fun testWindowLayoutInfo_registerMultipleIsNoOp() {
val feature = mock<FoldingFeature>()
- val expected = WindowLayoutInfo.Builder().setDisplayFeatures(listOf(feature)).build()
+ val expected = WindowLayoutInfo(listOf(feature))
val mockRepo = mock<WindowInfoRepository>()
whenever(mockRepo.windowLayoutInfo).thenReturn(flowOf(expected))
val unitUnderTest = WindowInfoRepositoryCallbackAdapter(mockRepo)
@@ -114,7 +114,7 @@
@Test
public fun testWindowLayoutInfo_unregister() {
val feature = mock<FoldingFeature>()
- val info = WindowLayoutInfo.Builder().setDisplayFeatures(listOf(feature)).build()
+ val info = WindowLayoutInfo(listOf(feature))
val mockRepo = mock<WindowInfoRepository>()
val channel = Channel<WindowLayoutInfo>()
whenever(mockRepo.windowLayoutInfo).thenReturn(channel.receiveAsFlow())
diff --git a/window/window-rxjava2/src/androidTest/java/androidx/window/rxjava2/layout/WindowInfoRepositoryRxTest.kt b/window/window-rxjava2/src/androidTest/java/androidx/window/rxjava2/layout/WindowInfoRepositoryRxTest.kt
index c83acf4..7691c47 100644
--- a/window/window-rxjava2/src/androidTest/java/androidx/window/rxjava2/layout/WindowInfoRepositoryRxTest.kt
+++ b/window/window-rxjava2/src/androidTest/java/androidx/window/rxjava2/layout/WindowInfoRepositoryRxTest.kt
@@ -55,7 +55,7 @@
@Test
public fun testWindowLayoutInfoObservable() {
val feature = mock<FoldingFeature>()
- val expected = WindowLayoutInfo.Builder().setDisplayFeatures(listOf(feature)).build()
+ val expected = WindowLayoutInfo(listOf(feature))
val mockRepo = mock<WindowInfoRepository>()
whenever(mockRepo.windowLayoutInfo).thenReturn(flowOf(expected))
@@ -67,7 +67,7 @@
@Test
public fun testWindowLayoutInfoFlowable() {
val feature = mock<FoldingFeature>()
- val expected = WindowLayoutInfo.Builder().setDisplayFeatures(listOf(feature)).build()
+ val expected = WindowLayoutInfo(listOf(feature))
val mockRepo = mock<WindowInfoRepository>()
whenever(mockRepo.windowLayoutInfo).thenReturn(flowOf(expected))
diff --git a/window/window-rxjava3/src/androidTest/java/androidx/window/rxjava3/layout/WindowInfoRepositoryRxTest.kt b/window/window-rxjava3/src/androidTest/java/androidx/window/rxjava3/layout/WindowInfoRepositoryRxTest.kt
index 1587033..add069f 100644
--- a/window/window-rxjava3/src/androidTest/java/androidx/window/rxjava3/layout/WindowInfoRepositoryRxTest.kt
+++ b/window/window-rxjava3/src/androidTest/java/androidx/window/rxjava3/layout/WindowInfoRepositoryRxTest.kt
@@ -58,7 +58,7 @@
@Test
public fun testWindowLayoutInfoObservable() {
val feature = mock<FoldingFeature>()
- val expected = WindowLayoutInfo.Builder().setDisplayFeatures(listOf(feature)).build()
+ val expected = WindowLayoutInfo(listOf(feature))
val mockRepo = mock<WindowInfoRepository>()
whenever(mockRepo.windowLayoutInfo).thenReturn(flowOf(expected))
@@ -70,7 +70,7 @@
@Test
public fun testWindowLayoutInfoFlowable() {
val feature = mock<FoldingFeature>()
- val expected = WindowLayoutInfo.Builder().setDisplayFeatures(listOf(feature)).build()
+ val expected = WindowLayoutInfo(listOf(feature))
val mockRepo = mock<WindowInfoRepository>()
whenever(mockRepo.windowLayoutInfo).thenReturn(flowOf(expected))
diff --git a/window/window-samples/build.gradle b/window/window-samples/build.gradle
index a05d259..1a91038 100644
--- a/window/window-samples/build.gradle
+++ b/window/window-samples/build.gradle
@@ -35,9 +35,10 @@
implementation("androidx.appcompat:appcompat:1.2.0")
implementation("androidx.core:core-ktx:1.3.2")
implementation("androidx.activity:activity:1.2.0")
+ implementation "androidx.recyclerview:recyclerview:1.2.1"
api(libs.constraintLayout)
// TODO(b/152245564) Conflicting dependencies cause IDE errors.
- implementation("androidx.lifecycle:lifecycle-viewmodel:2.2.0")
+ implementation("androidx.lifecycle:lifecycle-viewmodel:2.4.0-alpha02")
implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.4.0-alpha02")
implementation(project(":window:window"))
diff --git a/window/window-samples/src/main/AndroidManifest.xml b/window/window-samples/src/main/AndroidManifest.xml
index f933814..4ffb8b5 100644
--- a/window/window-samples/src/main/AndroidManifest.xml
+++ b/window/window-samples/src/main/AndroidManifest.xml
@@ -42,6 +42,10 @@
android:name=".SplitLayoutActivity"
android:exported="false"
android:label="@string/split_layout" />
+ <activity android:name=".WindowMetricsActivity"
+ android:exported="false"
+ android:configChanges="orientation|screenSize|screenLayout|screenSize"
+ android:label="@string/window_metrics"/>
</application>
</manifest>
\ No newline at end of file
diff --git a/window/window-samples/src/main/java/androidx/window/sample/WindowDemosActivity.kt b/window/window-samples/src/main/java/androidx/window/sample/WindowDemosActivity.kt
index 77bc954..ac89a72 100644
--- a/window/window-samples/src/main/java/androidx/window/sample/WindowDemosActivity.kt
+++ b/window/window-samples/src/main/java/androidx/window/sample/WindowDemosActivity.kt
@@ -36,6 +36,11 @@
startActivity(intent)
}
+ fun showWindowMetrics(@Suppress("UNUSED_PARAMETER")view: View) {
+ val intent = Intent(this, WindowMetricsActivity::class.java)
+ startActivity(intent)
+ }
+
fun showSplitLayout(@Suppress("UNUSED_PARAMETER")view: View) {
val intent = Intent(this, SplitLayoutActivity::class.java)
startActivity(intent)
diff --git a/window/window-samples/src/main/java/androidx/window/sample/WindowMetricsActivity.kt b/window/window-samples/src/main/java/androidx/window/sample/WindowMetricsActivity.kt
new file mode 100644
index 0000000..0be64be
--- /dev/null
+++ b/window/window-samples/src/main/java/androidx/window/sample/WindowMetricsActivity.kt
@@ -0,0 +1,51 @@
+/*
+ * Copyright 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES 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.window.sample
+
+import android.os.Bundle
+import androidx.appcompat.app.AppCompatActivity
+import androidx.lifecycle.Lifecycle
+import androidx.lifecycle.lifecycleScope
+import androidx.lifecycle.repeatOnLifecycle
+import androidx.recyclerview.widget.RecyclerView
+import androidx.window.layout.WindowInfoRepository.Companion.windowInfoRepository
+import androidx.window.sample.infolog.InfoLogAdapter
+import kotlinx.coroutines.flow.collect
+import kotlinx.coroutines.launch
+
+class WindowMetricsActivity : AppCompatActivity() {
+
+ private val adapter = InfoLogAdapter()
+
+ override fun onCreate(savedInstanceState: Bundle?) {
+ super.onCreate(savedInstanceState)
+ setContentView(R.layout.activity_window_metrics)
+ findViewById<RecyclerView>(R.id.recycler_view).adapter = adapter
+ adapter.append("onCreate", "triggered")
+
+ lifecycleScope.launch {
+ repeatOnLifecycle(Lifecycle.State.CREATED) {
+ windowInfoRepository().currentWindowMetrics.collect { windowMetrics ->
+ val width = windowMetrics.bounds.width()
+ val height = windowMetrics.bounds.height()
+ adapter.append("WindowMetrics update", "width: $width, height: $height")
+ adapter.notifyDataSetChanged()
+ }
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/wear/wear-complications-data-source-samples/src/main/java/androidx/wear/complications/datasource/samples/PlainComplicationText.kt b/window/window-samples/src/main/java/androidx/window/sample/infolog/InfoLog.kt
similarity index 67%
copy from wear/wear-complications-data-source-samples/src/main/java/androidx/wear/complications/datasource/samples/PlainComplicationText.kt
copy to window/window-samples/src/main/java/androidx/window/sample/infolog/InfoLog.kt
index cb807c3..e69a77b 100644
--- a/wear/wear-complications-data-source-samples/src/main/java/androidx/wear/complications/datasource/samples/PlainComplicationText.kt
+++ b/window/window-samples/src/main/java/androidx/window/sample/infolog/InfoLog.kt
@@ -14,9 +14,10 @@
* limitations under the License.
*/
-package androidx.wear.complications.datasource.samples
+package androidx.window.sample.infolog
-import androidx.wear.complications.data.PlainComplicationText
-
-internal fun plainText(text: CharSequence) =
- PlainComplicationText.Builder(text).build()
\ No newline at end of file
+/**
+ * A data class to hold a title and a detail or subtitle that can be shown using [InfoLogAdapter]
+ * . This can be used to create samples with an ordered timeline of events.
+ */
+data class InfoLog(val title: String, val detail: String, val id: Int)
\ No newline at end of file
diff --git a/window/window-samples/src/main/java/androidx/window/sample/infolog/InfoLogAdapter.kt b/window/window-samples/src/main/java/androidx/window/sample/infolog/InfoLogAdapter.kt
new file mode 100644
index 0000000..29fefd6
--- /dev/null
+++ b/window/window-samples/src/main/java/androidx/window/sample/infolog/InfoLogAdapter.kt
@@ -0,0 +1,53 @@
+/*
+ * Copyright 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES 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.window.sample.infolog
+
+import android.view.LayoutInflater
+import android.view.ViewGroup
+import androidx.recyclerview.widget.RecyclerView
+import androidx.window.sample.R
+
+class InfoLogAdapter : RecyclerView.Adapter<InfoLogVH>() {
+
+ private var id = 0
+ private val items = mutableListOf<InfoLog>()
+
+ override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): InfoLogVH {
+ val root = LayoutInflater.from(parent.context)
+ .inflate(R.layout.view_holder_info_log, parent, false)
+ return InfoLogVH(root)
+ }
+
+ override fun onBindViewHolder(holder: InfoLogVH, position: Int) {
+ val item = items[position]
+ holder.titleView.text = "ID: ${item.id} Title: ${item.title}"
+ holder.detailView.text = "Detail: ${item.detail}"
+ }
+
+ override fun getItemCount(): Int {
+ return items.size
+ }
+
+ fun append(title: String, message: String) {
+ append(InfoLog(title, message, id))
+ ++id
+ }
+
+ private fun append(item: InfoLog) {
+ items.add(0, item)
+ }
+}
\ No newline at end of file
diff --git a/wear/wear-complications-data-source-samples/src/main/java/androidx/wear/complications/datasource/samples/PlainComplicationText.kt b/window/window-samples/src/main/java/androidx/window/sample/infolog/InfoLogVH.kt
similarity index 61%
copy from wear/wear-complications-data-source-samples/src/main/java/androidx/wear/complications/datasource/samples/PlainComplicationText.kt
copy to window/window-samples/src/main/java/androidx/window/sample/infolog/InfoLogVH.kt
index cb807c3..4760be2 100644
--- a/wear/wear-complications-data-source-samples/src/main/java/androidx/wear/complications/datasource/samples/PlainComplicationText.kt
+++ b/window/window-samples/src/main/java/androidx/window/sample/infolog/InfoLogVH.kt
@@ -14,9 +14,14 @@
* limitations under the License.
*/
-package androidx.wear.complications.datasource.samples
+package androidx.window.sample.infolog
-import androidx.wear.complications.data.PlainComplicationText
+import android.view.View
+import android.widget.TextView
+import androidx.recyclerview.widget.RecyclerView
+import androidx.window.sample.R
-internal fun plainText(text: CharSequence) =
- PlainComplicationText.Builder(text).build()
\ No newline at end of file
+class InfoLogVH(view: View) : RecyclerView.ViewHolder(view) {
+ val titleView: TextView = view.findViewById(R.id.title_view)
+ val detailView: TextView = view.findViewById(R.id.detail_view)
+}
\ No newline at end of file
diff --git a/window/window-samples/src/main/res/layout/activity_window_demos.xml b/window/window-samples/src/main/res/layout/activity_window_demos.xml
index bea8045..54b8515 100644
--- a/window/window-samples/src/main/res/layout/activity_window_demos.xml
+++ b/window/window-samples/src/main/res/layout/activity_window_demos.xml
@@ -101,6 +101,28 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/presentationActivityButton" />
+
+ <Button
+ android:id="@+id/windowMetricsActivityButton"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginTop="16dp"
+ android:text="@string/window_metrics"
+ app:layout_constraintStart_toStartOf="parent"
+ app:layout_constraintTop_toBottomOf="@+id/presentationTextView"
+ android:onClick="showWindowMetrics" />
+
+ <TextView
+ android:id="@+id/windowMetricsTextView"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_marginTop="5dp"
+ android:text="@string/window_metrics_description"
+ app:layout_constraintEnd_toEndOf="parent"
+ app:layout_constraintHorizontal_bias="0.0"
+ app:layout_constraintStart_toStartOf="parent"
+ app:layout_constraintTop_toBottomOf="@+id/windowMetricsActivityButton" />
+
</androidx.constraintlayout.widget.ConstraintLayout>
</ScrollView>
\ No newline at end of file
diff --git a/core/core-splashscreen/samples/src/main/res/drawable/foreground.xml b/window/window-samples/src/main/res/layout/activity_window_metrics.xml
similarity index 64%
copy from core/core-splashscreen/samples/src/main/res/drawable/foreground.xml
copy to window/window-samples/src/main/res/layout/activity_window_metrics.xml
index c46194a..00e2599 100644
--- a/core/core-splashscreen/samples/src/main/res/drawable/foreground.xml
+++ b/window/window-samples/src/main/res/layout/activity_window_metrics.xml
@@ -14,7 +14,9 @@
limitations under the License.
-->
-<inset xmlns:android="http://schemas.android.com/apk/res/android"
- android:drawable="@drawable/android"
- android:inset="25%">
-</inset>
\ No newline at end of file
+<androidx.recyclerview.widget.RecyclerView xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:app="http://schemas.android.com/apk/res-auto"
+ android:id="@+id/recycler_view"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"/>
diff --git a/window/window-samples/src/main/res/layout/view_holder_info_log.xml b/window/window-samples/src/main/res/layout/view_holder_info_log.xml
new file mode 100644
index 0000000..7487737
--- /dev/null
+++ b/window/window-samples/src/main/res/layout/view_holder_info_log.xml
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="utf-8"?><!--
+ Copyright 2021 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+ -->
+
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_marginTop="16dp"
+ android:layout_marginBottom="16dp"
+ android:orientation="vertical"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content">
+
+ <TextView
+ android:id="@+id/title_view"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"/>
+
+ <TextView
+ android:id="@+id/detail_view"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"/>
+
+</LinearLayout>
\ No newline at end of file
diff --git a/window/window-samples/src/main/res/values/strings.xml b/window/window-samples/src/main/res/values/strings.xml
index 9dd6a26..ff0b4c0 100644
--- a/window/window-samples/src/main/res/values/strings.xml
+++ b/window/window-samples/src/main/res/values/strings.xml
@@ -42,4 +42,6 @@
<string name="show_all_display_features_description">Show all display features of the device on the screen</string>
<string name="split_layout_demo_description">Demo of a layout that splits the content to sides of a fold or a hinge. If not present or minimal size requirements are not meant, it behave like a FrameLayout.</string>
<string name="presentation_demo_description">Demo of using Presentation API to show content on secondary display.</string>
+ <string name="window_metrics">Window metrics</string>
+ <string name="window_metrics_description">Demo of using WindowMetrics API with activity handling rotations.</string>
</resources>
diff --git a/window/window-testing/api/1.0.0-beta03.txt b/window/window-testing/api/1.0.0-beta03.txt
index f47d528..ee2ae07 100644
--- a/window/window-testing/api/1.0.0-beta03.txt
+++ b/window/window-testing/api/1.0.0-beta03.txt
@@ -15,5 +15,9 @@
method public void overrideWindowLayoutInfo(androidx.window.layout.WindowLayoutInfo info);
}
+ public final class WindowLayoutInfoTesting {
+ method public static androidx.window.layout.WindowLayoutInfo createWindowLayoutInfo(java.util.List<? extends androidx.window.layout.DisplayFeature> displayFeatures);
+ }
+
}
diff --git a/window/window-testing/api/current.txt b/window/window-testing/api/current.txt
index f47d528..ee2ae07 100644
--- a/window/window-testing/api/current.txt
+++ b/window/window-testing/api/current.txt
@@ -15,5 +15,9 @@
method public void overrideWindowLayoutInfo(androidx.window.layout.WindowLayoutInfo info);
}
+ public final class WindowLayoutInfoTesting {
+ method public static androidx.window.layout.WindowLayoutInfo createWindowLayoutInfo(java.util.List<? extends androidx.window.layout.DisplayFeature> displayFeatures);
+ }
+
}
diff --git a/window/window-testing/api/public_plus_experimental_1.0.0-beta03.txt b/window/window-testing/api/public_plus_experimental_1.0.0-beta03.txt
index 04668ba..0cf4e10 100644
--- a/window/window-testing/api/public_plus_experimental_1.0.0-beta03.txt
+++ b/window/window-testing/api/public_plus_experimental_1.0.0-beta03.txt
@@ -20,5 +20,9 @@
method public void overrideWindowLayoutInfo(androidx.window.layout.WindowLayoutInfo info);
}
+ public final class WindowLayoutInfoTesting {
+ method public static androidx.window.layout.WindowLayoutInfo createWindowLayoutInfo(java.util.List<? extends androidx.window.layout.DisplayFeature> displayFeatures);
+ }
+
}
diff --git a/window/window-testing/api/public_plus_experimental_current.txt b/window/window-testing/api/public_plus_experimental_current.txt
index 04668ba..0cf4e10 100644
--- a/window/window-testing/api/public_plus_experimental_current.txt
+++ b/window/window-testing/api/public_plus_experimental_current.txt
@@ -20,5 +20,9 @@
method public void overrideWindowLayoutInfo(androidx.window.layout.WindowLayoutInfo info);
}
+ public final class WindowLayoutInfoTesting {
+ method public static androidx.window.layout.WindowLayoutInfo createWindowLayoutInfo(java.util.List<? extends androidx.window.layout.DisplayFeature> displayFeatures);
+ }
+
}
diff --git a/window/window-testing/api/restricted_1.0.0-beta03.txt b/window/window-testing/api/restricted_1.0.0-beta03.txt
index f47d528..ee2ae07 100644
--- a/window/window-testing/api/restricted_1.0.0-beta03.txt
+++ b/window/window-testing/api/restricted_1.0.0-beta03.txt
@@ -15,5 +15,9 @@
method public void overrideWindowLayoutInfo(androidx.window.layout.WindowLayoutInfo info);
}
+ public final class WindowLayoutInfoTesting {
+ method public static androidx.window.layout.WindowLayoutInfo createWindowLayoutInfo(java.util.List<? extends androidx.window.layout.DisplayFeature> displayFeatures);
+ }
+
}
diff --git a/window/window-testing/api/restricted_current.txt b/window/window-testing/api/restricted_current.txt
index f47d528..ee2ae07 100644
--- a/window/window-testing/api/restricted_current.txt
+++ b/window/window-testing/api/restricted_current.txt
@@ -15,5 +15,9 @@
method public void overrideWindowLayoutInfo(androidx.window.layout.WindowLayoutInfo info);
}
+ public final class WindowLayoutInfoTesting {
+ method public static androidx.window.layout.WindowLayoutInfo createWindowLayoutInfo(java.util.List<? extends androidx.window.layout.DisplayFeature> displayFeatures);
+ }
+
}
diff --git a/window/window-testing/src/androidTest/java/androidx/window/testing/layout/WindowLayoutInfoPublisherRuleTest.kt b/window/window-testing/src/androidTest/java/androidx/window/testing/layout/WindowLayoutInfoPublisherRuleTest.kt
index 23448af..6b9b599 100644
--- a/window/window-testing/src/androidTest/java/androidx/window/testing/layout/WindowLayoutInfoPublisherRuleTest.kt
+++ b/window/window-testing/src/androidTest/java/androidx/window/testing/layout/WindowLayoutInfoPublisherRuleTest.kt
@@ -61,7 +61,7 @@
@OptIn(ExperimentalCoroutinesApi::class)
@Test
public fun testWindowLayoutInfo_relayValue(): Unit = testScope.runBlockingTest {
- val expected = WindowLayoutInfo.Builder().setDisplayFeatures(emptyList()).build()
+ val expected = WindowLayoutInfo(emptyList())
activityRule.scenario.onActivity { activity ->
val value = testScope.async {
activity.windowInfoRepository().windowLayoutInfo.first()
@@ -107,8 +107,8 @@
override val bounds: Rect
get() = Rect()
}
- val expected1 = WindowLayoutInfo.Builder().setDisplayFeatures(listOf(feature1)).build()
- val expected2 = WindowLayoutInfo.Builder().setDisplayFeatures(listOf(feature2)).build()
+ val expected1 = WindowLayoutInfo(listOf(feature1))
+ val expected2 = WindowLayoutInfo(listOf(feature2))
activityRule.scenario.onActivity { activity ->
val values = mutableListOf<WindowLayoutInfo>()
val value = testScope.async {
diff --git a/wear/wear-complications-data-source-samples/src/main/java/androidx/wear/complications/datasource/samples/PlainComplicationText.kt b/window/window-testing/src/main/java/androidx/window/testing/layout/WindowLayoutInfoTesting.kt
similarity index 64%
copy from wear/wear-complications-data-source-samples/src/main/java/androidx/wear/complications/datasource/samples/PlainComplicationText.kt
copy to window/window-testing/src/main/java/androidx/window/testing/layout/WindowLayoutInfoTesting.kt
index cb807c3..e5f65b0 100644
--- a/wear/wear-complications-data-source-samples/src/main/java/androidx/wear/complications/datasource/samples/PlainComplicationText.kt
+++ b/window/window-testing/src/main/java/androidx/window/testing/layout/WindowLayoutInfoTesting.kt
@@ -13,10 +13,14 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
+@file:JvmName("WindowLayoutInfoTesting")
-package androidx.wear.complications.datasource.samples
+package androidx.window.testing.layout
-import androidx.wear.complications.data.PlainComplicationText
+import androidx.window.layout.DisplayFeature
+import androidx.window.layout.WindowLayoutInfo
-internal fun plainText(text: CharSequence) =
- PlainComplicationText.Builder(text).build()
\ No newline at end of file
+@JvmName("createWindowLayoutInfo")
+fun WindowLayoutInfo(displayFeatures: List<DisplayFeature>): WindowLayoutInfo {
+ return WindowLayoutInfo(displayFeatures)
+}
\ No newline at end of file
diff --git a/window/window/api/1.0.0-beta03.txt b/window/window/api/1.0.0-beta03.txt
index f87dfd1..e9c53e0 100644
--- a/window/window/api/1.0.0-beta03.txt
+++ b/window/window/api/1.0.0-beta03.txt
@@ -62,14 +62,7 @@
property public final java.util.List<androidx.window.layout.DisplayFeature> displayFeatures;
}
- public static final class WindowLayoutInfo.Builder {
- ctor public WindowLayoutInfo.Builder();
- method public androidx.window.layout.WindowLayoutInfo build();
- method public androidx.window.layout.WindowLayoutInfo.Builder setDisplayFeatures(java.util.List<? extends androidx.window.layout.DisplayFeature> displayFeatures);
- }
-
public final class WindowMetrics {
- ctor public WindowMetrics(android.graphics.Rect bounds);
method public android.graphics.Rect getBounds();
property public final android.graphics.Rect bounds;
}
diff --git a/window/window/api/current.ignore b/window/window/api/current.ignore
new file mode 100644
index 0000000..85c25c3
--- /dev/null
+++ b/window/window/api/current.ignore
@@ -0,0 +1,7 @@
+// Baseline format: 1.0
+RemovedClass: androidx.window.layout.WindowLayoutInfo.Builder:
+ Removed class androidx.window.layout.WindowLayoutInfo.Builder
+
+
+RemovedMethod: androidx.window.layout.WindowMetrics#WindowMetrics(android.graphics.Rect):
+ Removed constructor androidx.window.layout.WindowMetrics(android.graphics.Rect)
diff --git a/window/window/api/current.txt b/window/window/api/current.txt
index f87dfd1..e9c53e0 100644
--- a/window/window/api/current.txt
+++ b/window/window/api/current.txt
@@ -62,14 +62,7 @@
property public final java.util.List<androidx.window.layout.DisplayFeature> displayFeatures;
}
- public static final class WindowLayoutInfo.Builder {
- ctor public WindowLayoutInfo.Builder();
- method public androidx.window.layout.WindowLayoutInfo build();
- method public androidx.window.layout.WindowLayoutInfo.Builder setDisplayFeatures(java.util.List<? extends androidx.window.layout.DisplayFeature> displayFeatures);
- }
-
public final class WindowMetrics {
- ctor public WindowMetrics(android.graphics.Rect bounds);
method public android.graphics.Rect getBounds();
property public final android.graphics.Rect bounds;
}
diff --git a/window/window/api/public_plus_experimental_1.0.0-beta03.txt b/window/window/api/public_plus_experimental_1.0.0-beta03.txt
index 125d6da..78f1efe 100644
--- a/window/window/api/public_plus_experimental_1.0.0-beta03.txt
+++ b/window/window/api/public_plus_experimental_1.0.0-beta03.txt
@@ -69,14 +69,7 @@
property public final java.util.List<androidx.window.layout.DisplayFeature> displayFeatures;
}
- public static final class WindowLayoutInfo.Builder {
- ctor public WindowLayoutInfo.Builder();
- method public androidx.window.layout.WindowLayoutInfo build();
- method public androidx.window.layout.WindowLayoutInfo.Builder setDisplayFeatures(java.util.List<? extends androidx.window.layout.DisplayFeature> displayFeatures);
- }
-
public final class WindowMetrics {
- ctor public WindowMetrics(android.graphics.Rect bounds);
method public android.graphics.Rect getBounds();
property public final android.graphics.Rect bounds;
}
diff --git a/window/window/api/public_plus_experimental_current.txt b/window/window/api/public_plus_experimental_current.txt
index 125d6da..78f1efe 100644
--- a/window/window/api/public_plus_experimental_current.txt
+++ b/window/window/api/public_plus_experimental_current.txt
@@ -69,14 +69,7 @@
property public final java.util.List<androidx.window.layout.DisplayFeature> displayFeatures;
}
- public static final class WindowLayoutInfo.Builder {
- ctor public WindowLayoutInfo.Builder();
- method public androidx.window.layout.WindowLayoutInfo build();
- method public androidx.window.layout.WindowLayoutInfo.Builder setDisplayFeatures(java.util.List<? extends androidx.window.layout.DisplayFeature> displayFeatures);
- }
-
public final class WindowMetrics {
- ctor public WindowMetrics(android.graphics.Rect bounds);
method public android.graphics.Rect getBounds();
property public final android.graphics.Rect bounds;
}
diff --git a/window/window/api/restricted_1.0.0-beta03.txt b/window/window/api/restricted_1.0.0-beta03.txt
index 082d83a..0cb3e36 100644
--- a/window/window/api/restricted_1.0.0-beta03.txt
+++ b/window/window/api/restricted_1.0.0-beta03.txt
@@ -70,14 +70,7 @@
property public final java.util.List<androidx.window.layout.DisplayFeature> displayFeatures;
}
- public static final class WindowLayoutInfo.Builder {
- ctor public WindowLayoutInfo.Builder();
- method public androidx.window.layout.WindowLayoutInfo build();
- method public androidx.window.layout.WindowLayoutInfo.Builder setDisplayFeatures(java.util.List<? extends androidx.window.layout.DisplayFeature> displayFeatures);
- }
-
public final class WindowMetrics {
- ctor public WindowMetrics(android.graphics.Rect bounds);
method public android.graphics.Rect getBounds();
property public final android.graphics.Rect bounds;
}
diff --git a/window/window/api/restricted_current.ignore b/window/window/api/restricted_current.ignore
new file mode 100644
index 0000000..85c25c3
--- /dev/null
+++ b/window/window/api/restricted_current.ignore
@@ -0,0 +1,7 @@
+// Baseline format: 1.0
+RemovedClass: androidx.window.layout.WindowLayoutInfo.Builder:
+ Removed class androidx.window.layout.WindowLayoutInfo.Builder
+
+
+RemovedMethod: androidx.window.layout.WindowMetrics#WindowMetrics(android.graphics.Rect):
+ Removed constructor androidx.window.layout.WindowMetrics(android.graphics.Rect)
diff --git a/window/window/api/restricted_current.txt b/window/window/api/restricted_current.txt
index 082d83a..0cb3e36 100644
--- a/window/window/api/restricted_current.txt
+++ b/window/window/api/restricted_current.txt
@@ -70,14 +70,7 @@
property public final java.util.List<androidx.window.layout.DisplayFeature> displayFeatures;
}
- public static final class WindowLayoutInfo.Builder {
- ctor public WindowLayoutInfo.Builder();
- method public androidx.window.layout.WindowLayoutInfo build();
- method public androidx.window.layout.WindowLayoutInfo.Builder setDisplayFeatures(java.util.List<? extends androidx.window.layout.DisplayFeature> displayFeatures);
- }
-
public final class WindowMetrics {
- ctor public WindowMetrics(android.graphics.Rect bounds);
method public android.graphics.Rect getBounds();
property public final android.graphics.Rect bounds;
}
diff --git a/window/window/lint-baseline.xml b/window/window/lint-baseline.xml
index dee0155..46c5630 100644
--- a/window/window/lint-baseline.xml
+++ b/window/window/lint-baseline.xml
@@ -1,81 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
-<issues format="6" by="lint 7.1.0-alpha02" type="baseline" client="cli" name="Lint" variant="all" version="7.1.0-alpha02">
+<issues format="6" by="lint 7.1.0-dev" type="baseline" client="gradle" dependencies="false" name="AGP (7.1.0-dev)" variant="all" version="7.1.0-dev">
<issue
- id="NewApi"
- message="Call requires API level 24 (current min is 14): `java.util.Collection#removeIf`"
- errorLine1=" consumers.removeIf { it.callback == callback }"
- errorLine2=" ~~~~~~~~">
+ id="SupportAnnotationUsage"
+ message="Did you mean `@get:VisibleForTesting` ? Without `get:` this annotates the constructor parameter itself instead of the associated getter."
+ errorLine1=" @VisibleForTesting"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~">
<location
- file="src/androidTest/java/androidx/window/WindowInfoRepoImpTest.kt"
- line="115"
- column="23"/>
- </issue>
-
- <issue
- id="NewApi"
- message="Call requires API level 30 (current min is 14): `android.view.WindowManager#getCurrentWindowMetrics`"
- errorLine1=" val windowMetricsBounds = activity.windowManager.currentWindowMetrics.bounds"
- errorLine2=" ~~~~~~~~~~~~~~~~~~~~">
- <location
- file="src/androidTest/java/androidx/window/WindowMetricsCalculatorCompatTest.kt"
- line="112"
- column="62"/>
- </issue>
-
- <issue
- id="NewApi"
- message="Call requires API level 30 (current min is 14): `android.view.WindowMetrics#getBounds`"
- errorLine1=" val windowMetricsBounds = activity.windowManager.currentWindowMetrics.bounds"
- errorLine2=" ~~~~~~">
- <location
- file="src/androidTest/java/androidx/window/WindowMetricsCalculatorCompatTest.kt"
- line="112"
- column="83"/>
- </issue>
-
- <issue
- id="NewApi"
- message="Call requires API level 30 (current min is 14): `android.view.WindowManager#getMaximumWindowMetrics`"
- errorLine1=" val windowMetricsBounds = activity.windowManager.maximumWindowMetrics.bounds"
- errorLine2=" ~~~~~~~~~~~~~~~~~~~~">
- <location
- file="src/androidTest/java/androidx/window/WindowMetricsCalculatorCompatTest.kt"
- line="186"
- column="62"/>
- </issue>
-
- <issue
- id="NewApi"
- message="Call requires API level 30 (current min is 14): `android.view.WindowMetrics#getBounds`"
- errorLine1=" val windowMetricsBounds = activity.windowManager.maximumWindowMetrics.bounds"
- errorLine2=" ~~~~~~">
- <location
- file="src/androidTest/java/androidx/window/WindowMetricsCalculatorCompatTest.kt"
- line="186"
- column="83"/>
- </issue>
-
- <issue
- id="SyntheticAccessor"
- message="Access to `private` method `toggleState` of class `Companion` requires synthetic accessor"
- errorLine1=" lock.withLock { state = toggleState(state) }"
- errorLine2=" ~~~~~~~~~~~">
- <location
- file="src/testUtil/java/androidx/window/SwitchOnUnregisterExtensionInterfaceCompat.kt"
- line="52"
- column="33"/>
- </issue>
-
- <issue
- id="SyntheticAccessor"
- message="Access to `private` method `toggleState` of class `Companion` requires synthetic accessor"
- errorLine1=" lock.withLock { state = toggleState(state) }"
- errorLine2=" ~~~~~~~~~~~">
- <location
- file="src/testUtil/java/androidx/window/SwitchOnUnregisterExtensionInterfaceCompat.kt"
- line="52"
- column="33"/>
+ file="src/main/java/androidx/window/layout/SidecarCompat.kt"
+ line="50"
+ column="5"/>
</issue>
</issues>
diff --git a/window/window/src/androidTest/java/androidx/window/layout/ExtensionWindowBackendTest.kt b/window/window/src/androidTest/java/androidx/window/layout/ExtensionWindowBackendTest.kt
index f65df1451..f481024 100644
--- a/window/window/src/androidTest/java/androidx/window/layout/ExtensionWindowBackendTest.kt
+++ b/window/window/src/androidTest/java/androidx/window/layout/ExtensionWindowBackendTest.kt
@@ -207,15 +207,10 @@
internal companion object {
private fun newTestWindowLayoutInfo(): WindowLayoutInfo {
- var builder = WindowLayoutInfo.Builder()
- val windowLayoutInfo = builder.build()
- assertTrue(windowLayoutInfo.displayFeatures.isEmpty())
val feature1: DisplayFeature = HardwareFoldingFeature(Bounds(0, 2, 3, 4), HINGE, FLAT)
val feature2: DisplayFeature = HardwareFoldingFeature(Bounds(0, 1, 5, 1), HINGE, FLAT)
val displayFeatures = listOf(feature1, feature2)
- builder = WindowLayoutInfo.Builder()
- builder.setDisplayFeatures(displayFeatures)
- return builder.build()
+ return WindowLayoutInfo(displayFeatures)
}
}
}
diff --git a/window/window/src/androidTest/java/androidx/window/layout/WindowLayoutInfoTest.kt b/window/window/src/androidTest/java/androidx/window/layout/WindowLayoutInfoTest.kt
index 10c8aaf..336bd35 100644
--- a/window/window/src/androidTest/java/androidx/window/layout/WindowLayoutInfoTest.kt
+++ b/window/window/src/androidTest/java/androidx/window/layout/WindowLayoutInfoTest.kt
@@ -21,7 +21,6 @@
import androidx.window.layout.FoldingFeature.State.Companion.FLAT
import androidx.window.layout.FoldingFeature.State.Companion.HALF_OPENED
import androidx.window.layout.HardwareFoldingFeature.Type.Companion.HINGE
-import com.google.common.truth.Truth.assertThat
import org.junit.Assert.assertEquals
import org.junit.Assert.assertNotEquals
import org.junit.Test
@@ -33,21 +32,12 @@
public class WindowLayoutInfoTest {
@Test
- public fun testBuilder_empty() {
- val builder = WindowLayoutInfo.Builder()
- val windowLayoutInfo = builder.build()
- assertThat(windowLayoutInfo.displayFeatures).isEmpty()
- }
-
- @Test
public fun testBuilder_setDisplayFeatures() {
val feature1: DisplayFeature = HardwareFoldingFeature(Bounds(1, 0, 3, 4), HINGE, FLAT)
val feature2: DisplayFeature =
HardwareFoldingFeature(Bounds(1, 0, 1, 4), HINGE, HALF_OPENED)
val displayFeatures = listOf(feature1, feature2)
- val builder = WindowLayoutInfo.Builder()
- builder.setDisplayFeatures(displayFeatures)
- val windowLayoutInfo = builder.build()
+ val windowLayoutInfo = WindowLayoutInfo(displayFeatures)
assertEquals(displayFeatures, windowLayoutInfo.displayFeatures)
}
diff --git a/window/window/src/main/java/androidx/window/layout/WindowLayoutInfo.kt b/window/window/src/main/java/androidx/window/layout/WindowLayoutInfo.kt
index c9270ee..b46e8c8 100644
--- a/window/window/src/main/java/androidx/window/layout/WindowLayoutInfo.kt
+++ b/window/window/src/main/java/androidx/window/layout/WindowLayoutInfo.kt
@@ -15,6 +15,9 @@
*/
package androidx.window.layout
+import androidx.annotation.RestrictTo
+import androidx.annotation.RestrictTo.Scope.TESTS
+
/**
* Contains the list of [DisplayFeature]-s located within the window. For example, a hinge or
* display fold can go across the window, in which case it might make sense to separate the
@@ -24,12 +27,20 @@
* positions and sizes can change if the window is moved or resized on screen.
* @see WindowInfoRepository.windowLayoutInfo
*/
-public class WindowLayoutInfo internal constructor(
+public class WindowLayoutInfo {
+
/**
* [displayFeatures] all the [DisplayFeature] within the window.
*/
public val displayFeatures: List<DisplayFeature>
-) {
+
+ /**
+ * @suppress
+ */
+ @RestrictTo(TESTS)
+ public constructor(displayFeatures: List<DisplayFeature>) {
+ this.displayFeatures = displayFeatures
+ }
override fun toString(): String {
return displayFeatures.joinToString(
@@ -49,27 +60,4 @@
override fun hashCode(): Int {
return displayFeatures.hashCode()
}
-
- /**
- * Builder for [WindowLayoutInfo] objects.
- */
- public class Builder {
- private var displayFeatures: List<DisplayFeature> = emptyList()
-
- /**
- * Sets the display features for the [WindowLayoutInfo] instance.
- */
- public fun setDisplayFeatures(displayFeatures: List<DisplayFeature>): Builder {
- this.displayFeatures = displayFeatures.toList()
- return this
- }
-
- /**
- * Creates a [WindowLayoutInfo] instance with the specified fields.
- * @return A WindowLayoutInfo instance.
- */
- public fun build(): WindowLayoutInfo {
- return WindowLayoutInfo(displayFeatures.toList())
- }
- }
}
diff --git a/window/window/src/main/java/androidx/window/layout/WindowMetrics.kt b/window/window/src/main/java/androidx/window/layout/WindowMetrics.kt
index de6946a..283da05 100644
--- a/window/window/src/main/java/androidx/window/layout/WindowMetrics.kt
+++ b/window/window/src/main/java/androidx/window/layout/WindowMetrics.kt
@@ -16,6 +16,8 @@
package androidx.window.layout
import android.graphics.Rect
+import androidx.annotation.RestrictTo
+import androidx.annotation.RestrictTo.Scope.TESTS
import androidx.window.core.Bounds
/**
@@ -29,6 +31,11 @@
*/
public class WindowMetrics internal constructor(private val _bounds: Bounds) {
+ /**
+ * An internal constructor for [WindowMetrics]
+ * @suppress
+ */
+ @RestrictTo(TESTS)
public constructor(bounds: Rect) : this(Bounds(bounds))
/**
diff --git a/window/window/src/test/java/androidx/window/layout/ExtensionWindowBackendUnitTest.kt b/window/window/src/test/java/androidx/window/layout/ExtensionWindowBackendUnitTest.kt
index a81f452..a12e9e8 100644
--- a/window/window/src/test/java/androidx/window/layout/ExtensionWindowBackendUnitTest.kt
+++ b/window/window/src/test/java/androidx/window/layout/ExtensionWindowBackendUnitTest.kt
@@ -182,8 +182,7 @@
private companion object {
private fun newTestWindowLayoutInfo(): WindowLayoutInfo {
- val builder = WindowLayoutInfo.Builder()
- return builder.build()
+ return WindowLayoutInfo(emptyList())
}
}
}
diff --git a/work/work-multiprocess/api/api_lint.ignore b/work/work-multiprocess/api/api_lint.ignore
new file mode 100644
index 0000000..07b6896
--- /dev/null
+++ b/work/work-multiprocess/api/api_lint.ignore
@@ -0,0 +1,7 @@
+// Baseline format: 1.0
+AsyncSuffixFuture: androidx.work.multiprocess.RemoteCoroutineWorker#startRemoteWork():
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
+AsyncSuffixFuture: androidx.work.multiprocess.RemoteListenableWorker#startRemoteWork():
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
+AsyncSuffixFuture: androidx.work.multiprocess.RemoteListenableWorker#startWork():
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
diff --git a/work/work-runtime-ktx/api/api_lint.ignore b/work/work-runtime-ktx/api/api_lint.ignore
index 539a475..ee82cf9 100644
--- a/work/work-runtime-ktx/api/api_lint.ignore
+++ b/work/work-runtime-ktx/api/api_lint.ignore
@@ -1,4 +1,8 @@
// Baseline format: 1.0
+AsyncSuffixFuture: androidx.work.CoroutineWorker#startWork():
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
+
+
MissingNullability: androidx.work.OneTimeWorkRequestKt#OneTimeWorkRequestBuilder():
Missing nullability on method `OneTimeWorkRequestBuilder` return
MissingNullability: androidx.work.PeriodicWorkRequestKt#PeriodicWorkRequestBuilder(java.time.Duration):
diff --git a/work/work-runtime/api/api_lint.ignore b/work/work-runtime/api/api_lint.ignore
index a1d408b..c37582c 100644
--- a/work/work-runtime/api/api_lint.ignore
+++ b/work/work-runtime/api/api_lint.ignore
@@ -7,6 +7,50 @@
Acronyms should not be capitalized in class names: was `SUCCESS`, should this be `Success`?
+AsyncSuffixFuture: androidx.work.ListenableWorker#startWork():
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
+AsyncSuffixFuture: androidx.work.Operation#getResult():
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
+AsyncSuffixFuture: androidx.work.ProgressUpdater#updateProgress(android.content.Context, java.util.UUID, androidx.work.Data):
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
+AsyncSuffixFuture: androidx.work.WorkContinuation#getWorkInfos():
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
+AsyncSuffixFuture: androidx.work.WorkManager#getLastCancelAllTimeMillis():
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
+AsyncSuffixFuture: androidx.work.WorkManager#getWorkInfoById(java.util.UUID):
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
+AsyncSuffixFuture: androidx.work.WorkManager#getWorkInfos(androidx.work.WorkQuery):
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
+AsyncSuffixFuture: androidx.work.WorkManager#getWorkInfosByTag(String):
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
+AsyncSuffixFuture: androidx.work.WorkManager#getWorkInfosForUniqueWork(String):
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
+AsyncSuffixFuture: androidx.work.Worker#startWork():
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
+AsyncSuffixFuture: androidx.work.multiprocess.RemoteWorkContinuation#enqueue():
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
+AsyncSuffixFuture: androidx.work.multiprocess.RemoteWorkManager#cancelAllWork():
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
+AsyncSuffixFuture: androidx.work.multiprocess.RemoteWorkManager#cancelAllWorkByTag(String):
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
+AsyncSuffixFuture: androidx.work.multiprocess.RemoteWorkManager#cancelUniqueWork(String):
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
+AsyncSuffixFuture: androidx.work.multiprocess.RemoteWorkManager#cancelWorkById(java.util.UUID):
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
+AsyncSuffixFuture: androidx.work.multiprocess.RemoteWorkManager#enqueue(androidx.work.WorkRequest):
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
+AsyncSuffixFuture: androidx.work.multiprocess.RemoteWorkManager#enqueue(java.util.List<androidx.work.WorkRequest>):
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
+AsyncSuffixFuture: androidx.work.multiprocess.RemoteWorkManager#enqueueUniquePeriodicWork(String, androidx.work.ExistingPeriodicWorkPolicy, androidx.work.PeriodicWorkRequest):
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
+AsyncSuffixFuture: androidx.work.multiprocess.RemoteWorkManager#enqueueUniqueWork(String, androidx.work.ExistingWorkPolicy, androidx.work.OneTimeWorkRequest):
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
+AsyncSuffixFuture: androidx.work.multiprocess.RemoteWorkManager#enqueueUniqueWork(String, androidx.work.ExistingWorkPolicy, java.util.List<androidx.work.OneTimeWorkRequest>):
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
+AsyncSuffixFuture: androidx.work.multiprocess.RemoteWorkManager#getWorkInfos(androidx.work.WorkQuery):
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
+
+
BuilderSetStyle: androidx.work.Data.Builder#putAll(androidx.work.Data):
Builder methods names should use setFoo() / addFoo() / clearFoo() style: method androidx.work.Data.Builder.putAll(androidx.work.Data)
BuilderSetStyle: androidx.work.Data.Builder#putAll(java.util.Map<java.lang.String,java.lang.Object>):
diff --git a/work/work-runtime/lint-baseline.xml b/work/work-runtime/lint-baseline.xml
index 27ddc53..e0e0f58 100644
--- a/work/work-runtime/lint-baseline.xml
+++ b/work/work-runtime/lint-baseline.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<issues format="6" by="lint 7.1.0-alpha02" type="baseline" client="cli" name="Lint" variant="all" version="7.1.0-alpha02">
+<issues format="6" by="lint 7.2.0-dev" type="baseline" client="gradle" dependencies="false" name="AGP (7.2.0-dev)" variant="all" version="7.2.0-dev">
<issue
id="NewApi"
@@ -16,6 +16,17 @@
id="NewApi"
message="Call requires API level 24 (current min is 23): `getTriggeredContentAuthorities`"
errorLine1=" sTriggeredContentAuthorities = getTriggeredContentAuthorities();"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/androidTest/java/androidx/work/impl/background/systemjob/SystemJobServiceTest.java"
+ line="304"
+ column="17"/>
+ </issue>
+
+ <issue
+ id="NewApi"
+ message="Call requires API level 24 (current min is 23): `getTriggeredContentAuthorities`"
+ errorLine1=" sTriggeredContentAuthorities = getTriggeredContentAuthorities();"
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
<location
file="src/androidTest/java/androidx/work/impl/background/systemjob/SystemJobServiceTest.java"
@@ -27,6 +38,17 @@
id="NewApi"
message="Call requires API level 24 (current min is 23): `getTriggeredContentUris`"
errorLine1=" sTriggeredContentUris = getTriggeredContentUris();"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/androidTest/java/androidx/work/impl/background/systemjob/SystemJobServiceTest.java"
+ line="305"
+ column="17"/>
+ </issue>
+
+ <issue
+ id="NewApi"
+ message="Call requires API level 24 (current min is 23): `getTriggeredContentUris`"
+ errorLine1=" sTriggeredContentUris = getTriggeredContentUris();"
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~">
<location
file="src/androidTest/java/androidx/work/impl/background/systemjob/SystemJobServiceTest.java"
@@ -38,6 +60,17 @@
id="NewApi"
message="Call requires API level 28 (current min is 23): `getNetwork`"
errorLine1=" sNetwork = getNetwork();"
+ errorLine2=" ~~~~~~~~">
+ <location
+ file="src/androidTest/java/androidx/work/impl/background/systemjob/SystemJobServiceTest.java"
+ line="325"
+ column="17"/>
+ </issue>
+
+ <issue
+ id="NewApi"
+ message="Call requires API level 28 (current min is 23): `getNetwork`"
+ errorLine1=" sNetwork = getNetwork();"
errorLine2=" ~~~~~~~~~~">
<location
file="src/androidTest/java/androidx/work/impl/background/systemjob/SystemJobServiceTest.java"
@@ -47,50 +80,6 @@
<issue
id="NewApi"
- message="Call requires API level 24 (current min is 23): `addContentUriTrigger`"
- errorLine1=" .addContentUriTrigger(testUri1, true)"
- errorLine2=" ~~~~~~~~~~~~~~~~~~~~">
- <location
- file="src/androidTest/java/androidx/work/impl/WorkManagerImplTest.java"
- line="367"
- column="34"/>
- </issue>
-
- <issue
- id="NewApi"
- message="Call requires API level 24 (current min is 23): `addContentUriTrigger`"
- errorLine1=" .addContentUriTrigger(testUri2, false)"
- errorLine2=" ~~~~~~~~~~~~~~~~~~~~">
- <location
- file="src/androidTest/java/androidx/work/impl/WorkManagerImplTest.java"
- line="368"
- column="34"/>
- </issue>
-
- <issue
- id="NewApi"
- message="Call requires API level 24 (current min is 23): `getContentUriTriggers`"
- errorLine1=" assertThat(constraints.getContentUriTriggers(), is(new ContentUriTriggers()));"
- errorLine2=" ~~~~~~~~~~~~~~~~~~~~~">
- <location
- file="src/androidTest/java/androidx/work/impl/WorkManagerImplTest.java"
- line="391"
- column="36"/>
- </issue>
-
- <issue
- id="NewApi"
- message="Call requires API level 24 (current min is 23): `getContentUriTriggers`"
- errorLine1=" assertThat(constraints.getContentUriTriggers().size(), is(0));"
- errorLine2=" ~~~~~~~~~~~~~~~~~~~~~">
- <location
- file="src/androidTest/java/androidx/work/impl/WorkManagerImplTest.java"
- line="401"
- column="32"/>
- </issue>
-
- <issue
- id="NewApi"
message="Call requires API level 24 (current min is 14): `getTriggeredContentAuthorities`"
errorLine1=" assertThat(worker.getTriggeredContentAuthorities(),"
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
@@ -195,7 +184,7 @@
errorLine2=" ~~~~~~~~">
<location
file="src/main/java/androidx/work/impl/background/systemalarm/Alarms.java"
- line="128"
+ line="134"
column="30"/>
</issue>
@@ -223,39 +212,6 @@
<issue
id="ClassVerificationFailure"
- message="This call references a method added in API level 30; however, the containing class androidx.work.impl.utils.ForceStopRunnable is reachable from earlier API levels and will fail run-time class verification."
- errorLine1=" activityManager.getHistoricalProcessExitReasons("
- errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
- <location
- file="src/main/java/androidx/work/impl/utils/ForceStopRunnable.java"
- line="171"
- column="41"/>
- </issue>
-
- <issue
- id="ClassVerificationFailure"
- message="This call references a method added in API level 30; however, the containing class androidx.work.impl.utils.ForceStopRunnable is reachable from earlier API levels and will fail run-time class verification."
- errorLine1=" if (info.getReason() == REASON_USER_REQUESTED) {"
- errorLine2=" ~~~~~~~~~">
- <location
- file="src/main/java/androidx/work/impl/utils/ForceStopRunnable.java"
- line="180"
- column="34"/>
- </issue>
-
- <issue
- id="ClassVerificationFailure"
- message="This call references a method added in API level 19; however, the containing class androidx.work.impl.utils.ForceStopRunnable is reachable from earlier API levels and will fail run-time class verification."
- errorLine1=" alarmManager.setExact(RTC_WAKEUP, triggerAt, pendingIntent);"
- errorLine2=" ~~~~~~~~">
- <location
- file="src/main/java/androidx/work/impl/utils/ForceStopRunnable.java"
- line="339"
- column="30"/>
- </issue>
-
- <issue
- id="ClassVerificationFailure"
message="This call references a method added in API level 24; however, the containing class androidx.work.impl.constraints.trackers.NetworkStateTracker is reachable from earlier API levels and will fail run-time class verification."
errorLine1=" mConnectivityManager.registerDefaultNetworkCallback(mNetworkCallback);"
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
@@ -349,7 +305,7 @@
errorLine2=" ~~~~~~~~~~~~~~">
<location
file="src/main/java/androidx/work/impl/utils/ProcessUtils.java"
- line="77"
+ line="76"
column="32"/>
</issue>
diff --git a/work/work-rxjava2/api/api_lint.ignore b/work/work-rxjava2/api/api_lint.ignore
new file mode 100644
index 0000000..9707043
--- /dev/null
+++ b/work/work-rxjava2/api/api_lint.ignore
@@ -0,0 +1,3 @@
+// Baseline format: 1.0
+AsyncSuffixFuture: androidx.work.RxWorker#startWork():
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
diff --git a/work/work-rxjava3/api/api_lint.ignore b/work/work-rxjava3/api/api_lint.ignore
new file mode 100644
index 0000000..7e7192e
--- /dev/null
+++ b/work/work-rxjava3/api/api_lint.ignore
@@ -0,0 +1,3 @@
+// Baseline format: 1.0
+AsyncSuffixFuture: androidx.work.rxjava3.RxWorker#startWork():
+ Methods returning com.google.common.util.concurrent.ListenableFuture should have a suffix *Async to reserve unmodified name for a suspend function
diff --git a/work/work-testing/lint-baseline.xml b/work/work-testing/lint-baseline.xml
index b84652dd..4a8b332 100644
--- a/work/work-testing/lint-baseline.xml
+++ b/work/work-testing/lint-baseline.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<issues format="6" by="lint 7.1.0-alpha02" type="baseline" client="cli" name="Lint" variant="all" version="7.1.0-alpha02">
+<issues format="6" by="lint 7.2.0-dev" type="baseline" client="gradle" dependencies="false" name="AGP (7.2.0-dev)" variant="all" version="7.2.0-dev">
<issue
id="NewApi"
@@ -36,6 +36,17 @@
<issue
id="NewApi"
+ message="Field requires API level 24 (current min is 14): `getTriggeredContentAuthorities`"
+ errorLine1=" assertThat(worker.triggeredContentAuthorities, containsInAnyOrder(*authorities))"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/androidTest/java/androidx/work/testing/TestWorkerBuilderTest.kt"
+ line="109"
+ column="27"/>
+ </issue>
+
+ <issue
+ id="NewApi"
message="Call requires API level 24 (current min is 14): `getTriggeredContentUris`"
errorLine1=" assertThat(worker.triggeredContentUris, containsInAnyOrder(*contentUris))"
errorLine2=" ~~~~~~~~~~~~~~~~~~~~">
@@ -46,6 +57,17 @@
</issue>
<issue
+ id="NewApi"
+ message="Field requires API level 24 (current min is 14): `getTriggeredContentUris`"
+ errorLine1=" assertThat(worker.triggeredContentUris, containsInAnyOrder(*contentUris))"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/androidTest/java/androidx/work/testing/TestWorkerBuilderTest.kt"
+ line="110"
+ column="27"/>
+ </issue>
+
+ <issue
id="KotlinPropertyAccess"
message="This getter should be public such that `id` can be accessed as a property from Kotlin; see https://android.github.io/kotlin-guides/interop.html#property-prefixes"
errorLine1=" UUID getId() {"