跳至主要内容

博文

目前显示的是标签为“add”的博文

android Button add ripple effects

Method 1:  To Add Ripple Effect/Animation to a Android Button Just replace your button background attribute with  android:background="?attr/selectableItemBackground"  and your code looks like this. < Button android : layout_width = " match_parent " android : layout_height = " wrap_content " android : background = " ?attr/selectableItemBackground " android : text = " Click Me " /> view raw button_ripple_effect.xml  hosted with ❤ by  GitHub Method 2:  To Add Ripple Effect/Animation to a Android Button Using this method, you can customize ripple effect color. First, you have to create a xml file in your drawable resource directory. Create a  ripple_effect.xml  file and add following code. res/drawable/ripple_effect.xml <? xml version = " 1.0 " encoding = " utf-8 " ?> < ripple xmlns : android = " http://schemas.android.com/apk/res/andr...

android add a file to apk

The  assets/  folder in apk is intended to store any extra user files in any formats. They will be included to apk automatically on compilation stage and can be accessed from the app using  getAssets()  function. For example: final InputStream is = getResources (). getAssets (). open ( "some_file.xml" )