AppCompatButton
open class AppCompatButton : Button, TintableBackgroundView, AutoSizeableTextView, TintableCompoundDrawablesView
kotlin.Any | ||||
↳ | android.view.View | |||
↳ | android.widget.TextView | |||
↳ | android.widget.Button | |||
↳ | androidx.appcompat.widget.AppCompatButton |
A Button
which supports compatible features on older versions of the platform, including:
- Allows dynamic tint of its background via the background tint methods in
androidx.core.view.ViewCompat
. - Allows setting of the background tint using
R.attr#backgroundTint
andR.attr#backgroundTintMode
. - Allows setting of the font family using
android.R.attr#fontFamily
This will automatically be used when you use Button
in your layouts and the top-level activity / dialog is provided by appcompat. You should only need to manually use this class when writing custom views.
Summary
Public constructors | |
---|---|
<init>(@NonNull context: Context, @Nullable attrs: AttributeSet?) |
|
<init>(@NonNull context: Context, @Nullable attrs: AttributeSet?, defStyleAttr: Int) |
Public methods | |
---|---|
open Unit | |
open Unit | |
open Unit |
setBackgroundDrawable(@Nullable background: Drawable?) |
open Unit |
setBackgroundResource(@DrawableRes resId: Int) |
open Unit |
setCustomSelectionActionModeCallback(actionModeCallback: Callback!) See |
open Unit |
setSupportAllCaps(allCaps: Boolean) Sets the properties of this field to transform input to ALL CAPS display. |
open Unit |
setTextAppearance(context: Context!, resId: Int) |
open Unit |
setTextSize(unit: Int, size: Float) |
Protected methods | |
---|---|
open Unit | |
open Unit | |
open Unit |
onTextChanged(text: CharSequence!, start: Int, lengthBefore: Int, lengthAfter: Int) |
Public constructors
<init>
AppCompatButton(@NonNull context: Context)
<init>
AppCompatButton(
@NonNull context: Context,
@Nullable attrs: AttributeSet?)
<init>
AppCompatButton(
@NonNull context: Context,
@Nullable attrs: