내 리사이클 뷰에 리플 효과를 추가하려는 앱을 개발 중입니다. 그래서 누구나 내가 할 코드를 말해 줄 수 있고, 내가 사탕 사탕에서도 그것을 얻을 수있는 방법이 있습니다. 그렇지 않다면 내 앱으로 코드를 제안하면 롤리팝 및 상위 버전의 파급 효과 및 사전 사탕 과자에 대한 간단한 효과가 표시되어 탭 또는 클릭 한 항목을 표시 할 수 있습니다. 감사합니다.롤리팝 사전 리플 효과
0
A
답변
1
당신은 this library을 사용하여 미리 Lolipop 버전에도 리플 효과를 추가 할 수 있습니다. 레이아웃 파일
<com.rey.material.widget.Button
style="@style/ButtonRippleStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="BUTTON"
app:rd_enable="true"/>
당신의 스타일 파일에 사용자 지정 스타일을 추가 예를
추가 버튼
<style name="ButtonRippleStyle" parent="Material.Drawable.Ripple.Wave.Light">
<item name="android:background">@null</item>
<item name="rd_rippleColor">#20F15A2B</item>
</style>
0
왜 미리 롤리팝에는 잔물결이 없다?
RippleDrawable이 원활하게 실행될 수있게 해주는 많은 요소는 Android 5.0의 new RenderThread입니다. Android의 이전 버전에서 성능을 최적화하기 위해 지금은 RippleDrawable을 사용하지 않았습니다.
http://android-developers.blogspot.com.uy/2014/10/appcompat-v21-material-design-for-pre.html
당신이 사전 롤리팝 원하는 경우와 같은 라이브러리를 사용 sould :
https://github.com/balysv/material-ripple
https://github.com/traex/RippleEffect
기타 라이브러리 : 대한 https://android-arsenal.com/tag/167
을> = 21 API 레이아웃에서 설정하기 만하면됩니다.
android:background="?android:attr/selectableItemBackground"