Coder Social home page Coder Social logo

materiallayout's Introduction

MaterialLayout

MaterialLayout是一个能够在低版本的Android 系统中实现点击布局中任何视图都会产生波纹效果的布局,它继承自RelativeLayout,因此能够当做普通的RelativeLayout使用,如果需要其他布局实现该功能,参考该布局实现即可。也可以使用Proxy代理所有的操作,将各个操作封装到一个代理类中,布局类只需要调用代理类来完成相应的工作即可,这样在多种布局都实现这种效果时能够避免代码重复。 MaterialLayout的使用示例如下:

    <org.simple.MaterialLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:ml="http://schemas.android.com/apk/res/com.example.materialdemo"
    android:id="@+id/layout"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:layout_margin="5dp"
    android:background="#f0f0f0"
    android:gravity="center"
    ml:duration="200"
    ml:alpha="200"
    ml:scale="1.2"
    ml:color="#FFD306" >

    <Button
        android:id="@+id/my_button"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:background="#33CC99"
        android:padding="10dp"
        android:text="@string/click"
        android:textSize="20sp" />

    <ImageView
        android:id="@+id/my_imageview1"
        android:layout_width="100dp"
        android:layout_height="100dp"
        android:layout_below="@id/my_button"
        android:layout_marginTop="30dp"
        android:background="#33CC99"
        android:contentDescription="@string/app_name"
        android:padding="10dp"
        android:src="@drawable/ic_launcher" />

</org.simple.MaterialLayout>	

注意不要com.example.materialdemo替换为你工程的包名。
运行一下就可以看到效果了。

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.