android - How to achieve ripple animation using support library? -


I am trying to add a wave animation to the click button. I was like below but it requires minSdKVersion 21.

ripple.xml

  & lt; Wave xmlns: android = "http://schemas.android.com/apk/Native/Android" Android: Color = "? Android: colorControlHighlight" & gt; & Lt; Items & gt; & Lt; Size Android: shape = "rectangle" & gt; & Lt; Solid Android: Color = "Android: Color Score" /> & Lt; / Size & gt; & Lt; / Item & gt; & Lt; / Wave & gt;  

button

  & lt; Com.devspark.robototextview.widget.RobotoButtonAndroid: id = "@ + id / loginButton" Android: layout_width = "match_parent" Android: layout_height = "wrap_content" Android: background = "@drawable / rip" Android: text = "@ String / login_button "/>  

I want to make it backward backward compatible with the design library.

How can this be done?

original waveform setup

  • < P> The inherent wave in the scene.
  • Ripples that extend beyond the bounds of the scenes:
    Android: background = "selectablebestgroundbroadgroundborderless"

    In Java code, ? (Attr) for xml references.

Support ? Android: attr instead of ? Attr: Returns

    by using (or ? shorthand), so the API is available back to 7.

Wave with picture / background

  • The easiest solution to keep an image or background and overlaying wave View with a framelayout set with a wave setpref () or setBackground () .

There is no clear way to do this sincerely, though Nick Butcher posted the topic of wave with ImageView s.


Comments

Popular posts from this blog

java - Can't add JTree to JPanel of a JInternalFrame -

javascript - data.match(var) not working it seems -

javascript - How can I pause a jQuery .each() loop, while waiting for user input? -