개발중에 round border 를 줄 일이있었는데 view 선택 시 툭 툭 변경되는데 좀 부자연 스럽게 느껴저서 부드럽게 전환 할 방법이 있나하고 찾아보았더니 나온다.
별건 없고 생성한 selector 에 enterFadeDuration / exitFadeDuration 값을 설정하면 내부적으로 처리를 해주더라 (min api 21 에서 시도 했다.)
<?xml version="1.0" encoding="utf-8"?>
<selector
xmlns:android="http://schemas.android.com/apk/res/android"
android:enterFadeDuration="@android:integer/config_mediumAnimTime"
android:exitFadeDuration="@android:integer/config_mediumAnimTime"
>
<item android:drawable="@drawable/shape_round_corner_16_stroke_primary_600" android:state_selected="true"/>
<item android:drawable="@drawable/shape_round_corner_16_solid_grey_100"/>
</selector>
'Android' 카테고리의 다른 글
이모지 체크 하기 (0) | 2021.09.09 |
---|---|
Dagger Hilt (0) | 2020.07.03 |
AppUpdateManager (0) | 2020.01.29 |
SameSite=Lax (0) | 2020.01.29 |
SameSite=Lax (0) | 2020.01.29 |