Giter Site home page Giter Site logo

shadowlayout-1's Introduction

ShadowLayout阴影布局(需要加阴影的控件只要被他嵌套,即刻享受)

效果展示(图片较模糊,下载demo自行观看。觉得不错就star下吧)

alt text

添加依赖

  • 项目build.gradle添加如下
    allprojects {
     	repositories {
     		maven { url 'https://jitpack.io' }
     	}
     }
  • app build.gradle添加如下
    dependencies {
            implementation 'com.github.lihangleo2:ShadowLayout:1.0'
    }

使用

      <com.lihang.ShadowLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        app:hl_cornerRadius="18dp"
        app:hl_dx="0dp"
        app:hl_dy="0dp"
        app:hl_leftShow="false"
        app:hl_shadowColor="#2a000000"
        app:hl_shadowLimit="5dp">

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="36dp"
            android:background="@drawable/shape_show_"
            android:gravity="center"
            android:paddingLeft="10dp"
            android:paddingRight="10dp"
            android:text="完全圆形圆角"
            android:textColor="#000" />

    </com.lihang.ShadowLayout>

Api说明

① 圆角属性

  • app:hl_cornerRadius="18dp" 阴影圆角属性

② 阴影扩散程度

  • app:hl_shadowLimit="5dp" 阴影的扩散区域

③ 阴影的颜色

  • app:hl_shadowColor="#2a000000" 阴影的颜色可以随便改变,透明度的改变可以改变阴影的清晰程度

④ x轴的偏移量

  • app:hl_dx="0dp" 也可以理解为左右偏移量

⑤ y轴的偏移量

  • app:hl_dy="0dp" 也可以理解为上下的偏移量

⑥ 阴影的4边可见不可见(与偏移量无关)

  • app:hl_leftShow="false" 左边的阴影不可见,其他3边保持不变

shadowlayout-1's People

Contributors

lihangleo2 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.