Giter Site home page Giter Site logo

android-anomalybutton's Introduction

Android-AnomalyButton

Android不规则按钮

利用判断图片背景像素来判断形状

使用方法如下:

    <info.smemo.androidanomalybutton.AnomalyButton
        android:id="@+id/button"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:src="@drawable/play"
        app:bgcolor="@android:color/transparent"
        android:layout_alignParentTop="true"
        android:layout_centerHorizontal="true" />

设置bgcolor,为其他区域颜色,如果其它区域均为透明色,则设置透明。判断像素是透明的地方均为形状之外

设置src为需要使用的图片 支持使用selector

使用selector的时候,如果有两个状态(press=true和false)判断背景根据当前状态。如果只有一个状态,则取该状态

使用时候直接复制AnomalyButton以及value/attrs.xml

#About Devloper

Neo (http://blog.smemo.info)

android-anomalybutton's People

Contributors

szpnygo avatar

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.