AndroidPub
Published in

AndroidPub

https://unsplash.com/photos/Wpn9NX84SeI

Polishing UI: Android StateListAnimator

Contents

Drawable States

StateListDrawable

StateListDrawable

But wait. Clickable? Why did we add that attribute? Should we add that too? Yes. But only for custom views. It takes some time to find out. Buttons work perfectly without adding because it is clickable by default. But If you want to use StateListDrawable for a View, ImageView, Custom View, etc. you need to add attribute.

StateListDrawable

StateListAnimator

The property animation system is a robust framework that allows you to animate almost anything. You can define an animation to change any object property over time, regardless of whether it draws to the screen or not. A property animation changes a property’s (a field in an object) value over a specified length of time.

FAB button animates its property “translationZ” on pressed and released

The (retired) Pub(lication) for Android & Tech, focused on Development

Recommended from Medium

Web and UI JavaScript Frameworks and Libraries

React Navigation 5.0 — A new way to navigate | React Navigation

Minimize side effects in front end apps by limiting state updates to interactions with the outside…

File Uploads with Multer — The Complete Guide

Unity 3D: Character Controller

Create a custom drawer with React/Javascript

Trust in God but Tie Your Camel*

Use JavaScript Sets to Return Unique Elements from Array

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Mert SIMSEK

Mert SIMSEK

Software Engineer at Storytel

More from Medium

MVVM Unit testing on Android — Howtodoandroid

Seekbar android kotlin

Common errors found when generating Android certificates (and how to fix them!)