Water ripple effect compatible with Android

Source: Internet
Author: User
<span id="Label3"></p><p><p><span style="font-size: 18px;"></span></p></p><p><p><span style="font-size: 18px;">The water ripple effect of Android is only high version only, we hope our application in the lower version with the lower version of the shadow, the high version of water ripple, how do this? In fact, as long as the sub-drawable and drawablev21 two folder is Good.</span></p></p><p><p><span style="font-size: 18px;"></span></p></p><p><p><span style="font-size: 18px; line-height: 21.6000003814697px;">Selector in Ordinary Cases:</span></p></p><pre><span style="color: #0000ff;"><span style="color: #0000ff;"><?</span></span><span style="color: #ff00ff;"><span style="color: #ff00ff;">XML version= "1.0" encoding= "utf-8"</span></span><span style="color: #0000ff;"><span style="color: #0000ff;">?></span></span><span style="color: #0000ff;"><span style="color: #0000ff;"><</span></span><span style="color: #800000;"><span style="color: #800000;">selector</span></span><span style="color: #ff0000;"><span style="color: #ff0000;">xmlns:android</span></span><span style="color: #0000ff;"><span style="color: #0000ff;">= "http://schemas.android.com/apk/res/android"</span></span><span style="color: #0000ff;"><span style="color: #0000ff;">></span></span> <span style="color: #0000ff;"><span style="color: #0000ff;"><</span></span><span style="color: #800000;"><span style="color: #800000;">Item</span></span><span style="color: #ff0000;"><span style="color: #ff0000;">android:drawable</span></span><span style="color: #0000ff;"><span style="color: #0000ff;">= "@color/menu_selected"</span></span><span style="color: #ff0000;"><span style="color: #ff0000;">android:state_pressed</span></span><span style="color: #0000ff;"><span style="color: #0000ff;">= "true"</span></span> <span style="color: #0000ff;"><span style="color: #0000ff;">/></span></span> <span style="color: #0000ff;"><span style="color: #0000ff;"><</span></span><span style="color: #800000;"><span style="color: #800000;">Item</span></span><span style="color: #ff0000;"><span style="color: #ff0000;">android:drawable</span></span><span style="color: #0000ff;"><span style="color: #0000ff;">= "@android: color/transparent"</span></span> <span style="color: #0000ff;"><span style="color: #0000ff;">/></span></span><span style="color: #0000ff;"><span style="color: #0000ff;"></</span></span><span style="color: #800000;"><span style="color: #800000;">selector</span></span><span style="color: #0000ff;"><span style="color: #0000ff;">></span></span></pre><p><p><span style="font-size: 18px;">V21 in the Selector:</span></p></p><pre><span style="color: #0000ff;"><span style="color: #0000ff;"><?</span></span><span style="color: #ff00ff;"><span style="color: #ff00ff;">XML version= "1.0" encoding= "utf-8"</span></span><span style="color: #0000ff;"><span style="color: #0000ff;">?></span></span><span style="color: #0000ff;"><span style="color: #0000ff;"><</span></span><span style="color: #800000;"><span style="color: #800000;">Ripple</span></span><span style="color: #ff0000;"><span style="color: #ff0000;">xmlns:android</span></span><span style="color: #0000ff;"><span style="color: #0000ff;">= "http://schemas.android.com/apk/res/android"</span></span><span style="color: #ff0000;"><span style="color: #ff0000;">Android:color</span></span><span style="color: #0000ff;"><span style="color: #0000ff;">= "@color/menu_selected"</span></span> <span style="color: #0000ff;"><span style="color: #0000ff;">></span></span><span style="color: #008000;"><span style="color: #008000;"><!--</span></span><span style="color: #008000;"><span style="color: #008000;">the color of the press</span></span><span style="color: #008000;"><span style="color: #008000;"></span> -</span> <span style="color: #008000;"><span style="color: #008000;"><!--</span></span><span style="color: #008000;"><span style="color: #008000;">Drawable/color/bitmap of the bottom background</span></span><span style="color: #008000;"><span style="color: #008000;"></span> -</span> <span style="color: #008000;"><span style="color: #008000;"><!--</span></span><span style="color: #008000;"><span style="color: #008000;"><item android:drawable= "@color/red"/></span></span><span style="color: #008000;"><span style="color: #008000;"></span> -</span><span style="color: #0000ff;"><span style="color: #0000ff;"></</span></span><span style="color: #800000;"><span style="color: #800000;">Ripple</span></span><span style="color: #0000ff;"><span style="color: #0000ff;">></span></span></pre><p><p><span style="font-size: 18px;">The color in this ripple is the water ripple that is pressed, adding an item to it, and the item becomes the BACKGROUND. note, do not add transparent item to do the background, one is meaningless, the second will be unable to display the effect of the pressing PROBLEM.</span></p></p><p><p></p></p><p><p><span style="font-size: 18px; line-height: 21.6000003814697px;">Reference from:</span></p></p><p><p><span style="font-size: 18px; line-height: 21.6000003814697px;">Http://www.tuicool.com/articles/NFr6jie</span></p></p><p><p>Water ripple effect compatible with Android</p></p></span>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.