Coder Social home page Coder Social logo

bevelabelview's Introduction

斜角标签BeveLabelView

image

引入下面依赖

   implementation 'com.github.poqiao:BeveLabelView:1.0.2'
        <com.mxq.pq.BeveLabelView
            android:layout_width="80dp"
            android:layout_height="80dp"
            app:label_corner="20dp"
            app:label_length="45dp"
            app:label_bg_color="#00ffae"
            app:label_mode="right_top"
            app:label_text="折扣"
            app:label_text_color="#020202"
            app:label_text_size="18sp" />


可设置背景和文字颜色,文字大小,圆角大小,是否填满,上下左右位置

控件属性

      <!--斜角标签-->
    <declare-styleable name="BeveLabelView">
        <!--背景颜色-->
        <attr name="label_bg_color" format="color|reference"/>
        <!--文字-->
        <attr name="label_text" format="string"/>
        <!-- 文字颜色-->
        <attr name="label_text_color" format="color|reference"/>
        <!--文字大小-->
        <attr name="label_text_size" format="dimension"/>

        <attr name="label_length" format="dimension"/>
        <!--   圆角-->
        <attr name="label_corner" format="dimension"/>

        <attr name="label_mode">
            <!--   fill是沾满整个,-->
            <enum name="left_top" value="0"/>
            <enum name="right_top" value="1"/>
            <enum name="left_bottom" value="2"/>
            <enum name="right_bottom" value="3"/>
            <enum name="left_top_fill" value="4"/>
            <enum name="right_top_fill" value="5"/>
            <enum name="left_bottom_fill" value="6"/>
            <enum name="right_bottom_fill" value="7"/>
        </attr>
    </declare-styleable>

image

bevelabelview's People

Contributors

poqiao avatar

Stargazers

Tan_GC avatar yanlei avatar  avatar  avatar  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.