androidx.core.widget
Interfaces
NestedScrollView.OnScrollChangeListener |
Interface definition for a callback to be invoked when the scroll X or Y positions of a view change. |
TintableCompoundButton |
Interface which allows a |
TintableCompoundDrawablesView |
Interface which allows |
Classes
AutoScrollHelper |
AutoScrollHelper is a utility class for adding automatic edge-triggered scrolling to Views. |
CheckedTextViewCompat |
Helper for accessing |
CompoundButtonCompat |
Helper for accessing |
ContentLoadingProgressBar |
ContentLoadingProgressBar implements a ProgressBar that waits a minimum time to be dismissed before showing. |
EdgeEffectCompat |
Helper for accessing |
ImageViewCompat |
Helper for accessing features in |
ListPopupWindowCompat |
Helper for accessing features in |
ListViewAutoScrollHelper |
An implementation of |
ListViewCompat |
This class is deprecated. Use |
NestedScrollView |
NestedScrollView is just like |
PopupMenuCompat |
Helper for accessing features in |
PopupWindowCompat |
Helper for accessing features in |
RemoteViewsCompat.RemoteCollectionItems |
Representation of a fixed list of items to be displayed in a RemoteViews collection. |
RemoteViewsCompat.RemoteCollectionItems.Builder |
Builder class for |
ScrollerCompat |
This class is deprecated. Use |
TextViewCompat |
Helper for accessing features in |
Objects
RemoteViewsCompat |
Helper for accessing features in |
Top-level functions summary
RemoteViews |
createExactSizeAppWidget(Creates a |
RemoteViews |
createResponsiveSizeAppWidget(Creating a |
Extension functions summary
inline TextWatcher |
TextView.addTextChangedListener(Add a text changed listener to this TextView using the provided actions |
inline TextWatcher |
TextView.doAfterTextChanged(crossinline action: (Editable?) -> Unit)Add an action which will be invoked after the text changed. |
inline TextWatcher |
TextView.doBeforeTextChanged(Add an action which will be invoked before the text changed. |
inline TextWatcher |
TextView.doOnTextChanged(Add an action which will be invoked when the text is changing. |
Unit |
AppWidgetManager.updateAppWidget(Updates the app widget with |
Unit |
AppWidgetManager.updateAppWidget(Updates the app widget with |
Top-level functions
createExactSizeAppWidget
fun createExactSizeAppWidget(
appWidgetManager: AppWidgetManager,
appWidgetId: Int,
factory: (SizeFCompat) -> RemoteViews
): RemoteViews
Creates a RemoteViews associated with each size assigned to the app widget by AppWidgetManager, invoking factory to create each alternative view.
This provides "exact" sizing , which allows you to tailor your app widget appearance to the exact size at which it is displayed. If you are only concerned with a small number of size thresholds, it is preferable to use "responsive" sizing by providing a fixed set of sizes that your app widget supports.
As your factory may be invoked multiple times, if there is expensive computation of state that is shared among each size, it is recommended to perform that computation before calling this and cache the results as necessary.
To handle resizing of your app widget, it is necessary to call AppWidgetManager.updateAppWidget during both android.appwidget.AppWidgetProvider.onUpdate and android.appwidget.AppWidgetProvider.onAppWidgetOptionsChanged.
| Parameters | |
|---|---|
appWidgetManager: AppWidgetManager |
the |
appWidgetId: Int |
the id of the app widget |
factory: (SizeFCompat) -> RemoteViews |
a function to create a |
createResponsiveSizeAppWidget
fun createResponsiveSizeAppWidget(
appWidgetManager: AppWidgetManager,
appWidgetId: Int,
dpSizes: Collection<SizeFCompat>,
factory: (SizeFCompat) -> RemoteViews
): RemoteViews
Creating a RemoteViews associated with each size provided in dpSizes.
This provides "responsive" sizing , which allows for smoother resizing and a more consistent experience across different host configurations.
As your factory may be invoked multiple times, if there is expensive computation of state that is shared among each size, it is recommended to perform that computation before calling this and cache the results as necessary.
To handle resizing of your app widget, it is necessary to call AppWidgetManager.updateAppWidget during both android.appwidget.AppWidgetProvider.onUpdate and android.appwidget.AppWidgetProvider.onAppWidgetOptionsChanged. If your app's minSdk is 31 or higher, it is only necessary to call updateAppWidget during onUpdate.
| Parameters | |
|---|---|
appWidgetManager: AppWidgetManager |
the |
appWidgetId: Int |
the id of the app widget |
dpSizes: Collection<SizeFCompat> |
a collection of sizes (in dp) that your app widget supports. Must not be empty or contain more than 16 elements. |
factory: (SizeFCompat) -> RemoteViews |
a function to create a |
Extension functions
addTextChangedListener
inline fun TextView.addTextChangedListener(
crossinline beforeTextChanged: (CharSequence?, start: Int, count: Int, after: Int) -> Unit = { _, _, _, _ -> },
crossinline onTextChanged: (CharSequence?, start: Int, before: Int, count: Int) -> Unit = { _, _, _, _ -> },
crossinline afterTextChanged: (Editable?) -> Unit = {}
): TextWatcher
Add a text changed listener to this TextView using the provided actions
| Returns | |
|---|---|
TextWatcher |
the |
doAfterTextChanged
inline fun TextView.doAfterTextChanged(crossinline action: (Editable?) -> Unit): TextWatcher
Add an action which will be invoked after the text changed.
| Returns | |
|---|---|
TextWatcher |
the |
doBeforeTextChanged
inline fun TextView.doBeforeTextChanged(
crossinline action: (CharSequence?, start: Int, count: Int, after: Int) -> Unit
): TextWatcher
Add an action which will be invoked before the text changed.
| Returns | |
|---|---|
TextWatcher |
the |
doOnTextChanged
inline fun TextView.doOnTextChanged(
crossinline action: (CharSequence?, start: Int, before: Int, count: Int) -> Unit
): TextWatcher
Add an action which will be invoked when the text is changing.
| Returns | |
|---|---|
TextWatcher |
the |
updateAppWidget
fun AppWidgetManager.updateAppWidget(
appWidgetId: Int,
factory: (SizeFCompat) -> RemoteViews
): Unit
Updates the app widget with appWidgetId, creating a RemoteViews for each size assigned to the app widget by AppWidgetManager, invoking factory to create each alternative view.
This provides "exact" sizing , which allows you to tailor your app widget appearance to the exact size at which it is displayed. If you are only concerned with a small number of size thresholds, it is preferable to use "responsive" sizing by providing a fixed set of sizes that your app widget supports.
As your factory may be invoked multiple times, if there is expensive computation of state that is shared among each size, it is recommended to perform that computation before calling this and cache the results as necessary.
To handle resizing of your app widget, it is necessary to call this function during both android.appwidget.AppWidgetProvider.onUpdate and android.appwidget.AppWidgetProvider.onAppWidgetOptionsChanged.
| Parameters | |
|---|---|
appWidgetId: Int |
the id of the app widget |
factory: (SizeFCompat) -> RemoteViews |
a function to create a |
updateAppWidget
fun AppWidgetManager.updateAppWidget(
appWidgetId: Int,
dpSizes: Collection<SizeFCompat>,
factory: (SizeFCompat) -> RemoteViews
): Unit
Updates the app widget with appWidgetId, creating a RemoteViews for each size provided in dpSizes.
This provides "responsive" sizing , which allows for smoother resizing and a more consistent experience across different host configurations.
As your factory may be invoked multiple times, if there is expensive computation of state that is shared among each size, it is recommended to perform that computation before calling this and cache the results as necessary.
To handle resizing of your app widget, it is necessary to call this function during both android.appwidget.AppWidgetProvider.onUpdate and android.appwidget.AppWidgetProvider.onAppWidgetOptionsChanged. If your app's minSdk is 31 or higher, it is only necessary to call this function during onUpdate.
| Parameters | |
|---|---|
appWidgetId: Int |
the id of the app widget |
dpSizes: Collection<SizeFCompat> |
a collection of sizes (in dp) that your app widget supports. Must not be empty or contain more than 16 elements. |
factory: (SizeFCompat) -> RemoteViews |
a function to create a |