Git Product home page Git Product logo

bubblelayout's Introduction

BubbleLayout

Android 实现气泡布局

Demo:

图片名称

用法

  1. 复制BubbleLayout到项目中,
  2. 将以下熟悉复制到res/values/attrs中,
    <declare-styleable name="BubbleLayout">
        <attr name="background_color" format="color" />
        <attr name="shadow_color" format="color" />
        <attr name="shadow_size" format="dimension" />
        <attr name="radius" format="dimension" />
        <attr name="direction" format="enum">
            <enum name="left" value="1" />
            <enum name="top" value="2" />
            <enum name="right" value="3" />
            <enum name="bottom" value="4" />
        </attr>
        <attr name="offset" format="dimension" />
    </declare-styleable>

3.xml中使用,参考activity_main

    <me.wy.app.BubbleLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        //必须设置足够的padding才可以绘制三角形和阴影
        android:padding="16dp"
        //背景颜色
        app:background_color="#FF4081"
        //三角形方向
        app:direction="left"
        //三角形相对偏移量
        app:offset="-40dp"
        //圆角大小
        app:radius="4dp"
        //阴影颜色
        app:shadow_color="#999999"
        //阴影大小
        app:shadow_size="4dp">

        ...
    </me.wy.app.BubbleLayout>

bubblelayout's People

Contributors

wangyiwy avatar

Watchers

James Cloos 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.