Giter Club home page Giter Club logo

android_widget's Introduction

圆角组件 与渐变组件

  1. 为什么要写这个组件?
  2. android 设置selector drawable写烦了,业务太多而不统一,背景圆角度都不一样
  3. 市面上大部分圆角组件都是用canvase重绘制,会破坏原有的selector drawable特性
  4. 遇到一个奇葩的设计师 什么组件背景都是各种渐变色且不统一

增加自定义属性

  1. app:radius="8dp"
  2. app:radius="360dp" 为圆形

控件支持

  1. XXFCompatButton
  2. XXFCompatCheckedTextView
  3. XXFCompatEditText
  4. XXFCompatImageView
  5. XXFCompatTextView
  6. XXFFrameLayout
  7. XXFLinearLayout
  8. XXFRelativeLayout

带圆角 带渐变背景的组件

XXFGradientCompatButton XXFGradientCompatCheckedTextView XXFGradientCompatEditText XXFGradientCompatImageView XXFGradientCompatTextView XXFGradientFrameLayout XXFGradientLinearLayout XXFGradientRelativeLayout

带圆角支持日夜间模式

XXFSkinCompatButton XXFSkinCompatCheckedTextView XXFSkinCompatEditText XXFSkinCompatImageView XXFSkinCompatTextView XXFSkinFrameLayout XXFSkinLinearLayout XXFSkinRelativeLayout

依赖

  1. implementation 'androidx.appcompat:appcompat:1.1.0'
  2. implementation 'com.github.NBXXF:round_components:x.x.x'

如果想使用skin 换肤

  1. implementation 'androidx.appcompat:appcompat:1.1.0'
  2. implementation'skin.support:skin-support:4.0.5' // skin-support
  3. implementation 'skin.support:skin-support-appcompat:4.0.5' // skin-support 基础控件支持

#用法 参考demo

  <com.xxf.roundcomponent.XXFCompatTextView
        android:id="@+id/btn_1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginTop="10dp"
        android:background="#ff00ff"
        android:padding="10dp"
        android:text="CompatTextView"
        android:textColor="@color/test"
        app:radius="8dp" />
<com.xxf.gradient.XXFGradientCompatButton
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:text="测试"
        android:textColor="@android:color/white"
        app:end_color="@android:color/holo_blue_bright"
        app:orientation="TOP_BOTTOM"
        app:radius="4dp"
        app:start_color="#00ff00" />

android_widget's People

Contributors

nbxxf avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 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.