Coder Social home page Coder Social logo

smartui's Introduction

Smart UI

Smart UI主要提供了Android开发过程中经常用到的一些UI控件,该库会持续开发,力求解决Android开发过程中的UI痛点 问题!目前Smart UI已经提供了如下控件供大家使用:

使用方法:

  1. 增加以下脚本到你的工程根目录的build.gradle文件中
allprojects {
    repositories {
        ...
        maven { url 'https://jitpack.io' }
    }
}

2)在你的app工程中,增加如下依赖:

dependencies {
        compile 'com.github.yuanhoujun:SmartUI:0.2.0'
}

RoundedTextView

RoundedTextView是一个圆形的TextView控件,可以作为展示新消息提示之类的通知控件。 该控件有如下属性:

<me.foji.smartui.RoundedTextView
    android:layout_width="30dp"
    android:layout_height="30dp"
    android:text="10"
    android:textSize="14dp"
    android:textColor="@android:color/white"
    app:fillColor="#ff0000"
    app:radius="15dp"
    app:autoTextSize="true" />

TabBar

TabBar是一个组合控件,通常与TabBarGroup配合使用,使用方法类似RadioButton和RadioGroup,该控件支持的属性 较多,具体如下:

<me.foji.smartui.TabBarGroup
        android:layout_width="match_parent"
        android:layout_height="56dp"
        android:layout_alignParentBottom="true"
        android:orientation="horizontal"
        android:background="#fcfcfc"
        app:checkedButton="@+id/tab_bar_home"
        android:id="@+id/main_tab_bar">
        <me.foji.smartui.TabBar
            android:layout_width="0dp"
            android:layout_height="match_parent"
            android:layout_weight="1"
            app:imageDrawable="@drawable/selector_tab_bar_home"
            app:textColor="@drawable/tab_bar_textcolor"
            app:text="@string/home"
            app:textSize="12dp"
            android:id="@+id/tab_bar_home"/>
        <me.foji.smartui.TabBar
            android:layout_width="0dp"
            android:layout_height="match_parent"
            android:layout_weight="1"
            app:imageDrawable="@drawable/selector_tab_bar_discover"
            app:textColor="@drawable/tab_bar_textcolor"
            app:text="@string/discover"
            app:textSize="12dp"
            android:id="@+id/tab_bar_discover"/>
        <me.foji.smartui.TabBar
            android:layout_width="0dp"
            android:layout_height="match_parent"
            android:layout_weight="1"
            app:imageDrawable="@drawable/selector_tab_bar_message"
            app:textColor="@drawable/tab_bar_textcolor"
            app:text="@string/message"
            app:textSize="12dp"
            app:badgeVisible="true"
            app:badgeText="3"
            app:badgeRadius="8dp"
            app:badgeFillColor="#ff0000"
            app:badgeTextColor="@android:color/white"
            app:badgeTextSize="10dp"
            app:badgeMarginRight="-3dp"
            app:badgeMarginTop="0dp"
            android:id="@+id/tab_bar_message"/>
        <me.foji.smartui.TabBar
            android:layout_width="0dp"
            android:layout_height="match_parent"
            android:layout_weight="1"
            app:imageDrawable="@drawable/selector_tab_bar_mine"
            app:textColor="@drawable/tab_bar_textcolor"
            app:text="@string/mine"
            app:textSize="12dp"
            android:id="@+id/tab_bar_mine"/>
    </me.foji.smartui.TabBarGroup>

具体使用方法请参照例子sample

如果你有更多很有意思的控件,欢迎Fork这个仓库,推送Pull Request

smartui's People

Contributors

yuanhoujun avatar

Watchers

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