I implemented a costumized "enabled" button in Android. I set android:stateListAnimator="@null" when my button is disabled and want to reset it to the default Widget.AppCompat.Button style, when it is enabled. But how can I reset it? What do I have to set stateListAnimator ?
How to reset android:stateListAnimator from null to the default style of the button in Android`
427 Views Asked by user650708 At
1
There are 1 best solutions below
Related Questions in ANDROID
- Creating global Class holder
- Flutter + Dart: Editing name of a tab shows up a black screen
- android-pdf-viewer Received status code 401 from server: Unauthorized
- Sdk 34 WRITE_EXTERNAL_STORAGE not working
- ussd reader in Recket Native module
- Incorrect display of LinearGradientBrush in IOS
- The Binary Version Of its metadata is 1.8.0, expected Version is 1.6.0 build error
- I can't make TextInput to auto expand properly in Android
- Creating multiple instances of a class with different initializing values in Flutter
- How to create a lottie animation
- making android analyze with coverity sast tool
- Flutter plugin development android src not opening after opening example
- I initialize my ViewModel in the Activity with several fragments as tabs, but the fragments(tabs) return null for the updated livedata
- Node.js Server + Socket.IO + Android Mobile Applicatoin XHR Polling Error...?
- How I can use the shared preferences class?
Related Questions in ANDROID-LAYOUT
- Is ConstraintLayout broken?
- error: cannot find symbol View root = inflater.inflate(R.layout.toolbar, parent, false);
- C# Xamarin Android | Change Contentview from class
- RTL/LTR layout drawable as Background
- Tab ItemIndicator not visible - Android TabLayout
- Guidelines in layouts in android studio
- How to style dynamic text in android with TextView
- Is it possible to navigate from one navgraph to a different one on a different starting fragment? (Nested Navgraph)
- Open full screen fragment from smaller fragment
- Should I create a layout file for each card view I have?
- Convert coordinates in android
- why does my background color override some of my other components?
- Layout goes over recycler view instead of pushing it above
- Vertical Label In Android And Show Text In Center With Dynamic Width
- The recyclerView items doesnt shows up when i put them inside a horizontalScrollView
Related Questions in ANDROID-STYLES
- How to change inflated toolbar item icon color in Actionmode from App Theme
- There is an issue with the MaterialDatePicker text color when manually entering the date in Android
- CanvasFrontBufferRenderer is giving error as APP_SCOUT_WARNING
- How to change text style when user presses on subtext in ClickableText in jetpack compose
- Which style am I missing for AlertDialog button colors to change? Works fine with MaterialAlertDialog
- android how to change text color for "textOFF" for switch?
- Android Studio (how can i fix it?)
- Custom font for Alert Dialog message
- Problem in setting font(Family) for Switch (Kotlin Android)
- How to make custom input pin code Android?
- What is this strange character `*` in Android Toast style resources?
- how to make style "inherit" from layout in custom view class with children?
- How can I override the Wi-Fi signal icon in a custom Android theme?
- Android set EditText style globally in theme doesn't work
- Toolbar colors overlay
Related Questions in ANDROID-DEVELOPER-API
- Collision Detection in Jetpack Compose
- Turn screen on when user has call
- Inserting data to a Room database
- I am trying to measure the width of the object like Measure app in iOS
- I am doing a project in android. I made a app in which a floatingActionButton is not working when clicked. Its showing App keeps stopping
- How can I call (use ACTION_CALL) in fore ground service?
- RecyclerView crushes when using notifyDataSetChanged()
- Broadcast receiver for discovering available Bluetooth devices
- unresolved reference error in my RecyclerView code
- Java code for fetching Android battery specific details
- How to track QR code scanning when someone scans QR?
- FragmentManager.ensureExecReady java.lang.IllegalStateException - FragmentManager is already executing transactions
- Error with RecyclerView: android.view.InflateException
- After i created apk my android app doesn't fetch any data from api
- What things can be done to not get errors at running sdkmanager and other utilities of Android SDK (a version for command line)?
Related Questions in ANDROID-LAYOUTPARAMS
- Setting Android overlay position results in unwanted animations to old position, when later changing size
- Is adjustResize deprecated or only WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE?
- How can I use SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN with SOFT_INPUT_ADJUST_RESIZE
- Multiline TextInputEditText with height wrap_content not restoring size
- What's the best approach in android development to scale a view to a percentage of the parent's dimensions?
- Resolution specific dimensions are not working as expected in Android
- Converting Layout params animation from Kotlin to Java in Android Studio
- Top-level Layout in Android XML is ALWAYS FrameLayout?
- How to reset android:stateListAnimator from null to the default style of the button in Android`
- Android. Custom font not working when setting from style
- How do we create an AttributeSet in Android without xml
- Android constraint layout set programmatically is incorrect
- Constraining a EditText view to a checkBox programmatically in android?
- How do I copy and modify LayoutParams to set them on a programmatically created widget?
- Execution failed for task ':app:processReleaseResources'. > Android resource linking failed
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
If we look at AppcompatButton.java, we see that the default button style is defined by
buttonStyleattribute:Now that we know this, we can extract the state list animator from the theme as follows:
It is also possible to let the button default to the state list animator by not setting it to
@null. You can then capture the value in code, save it and set the animator to null also in code. You can then replace the capture state list animator value when you want.