Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

mikedream89/AndroidGradientUI

Open more actions menu
 
 

Repository files navigation

Qucik Setup

1. Include library

Using AndroidStudio

Edit your build.gradle file and add below dependency:

dependencies {
    compile 'com.david.gradientuilib:gradientuilibrary:1.0.1'
}

2. Using in layout.xml

GradientIconView

First the custom attribute should declare in xml like this:

xmlns:app="http://schemas.android.com/apk/res-auto"

Then you can add GradientIconView in layout.xml

<com.david.gradientuilibrary.GradientIconView
    android:id="@+id/id_iconfont_chat"
    app:bottom_icon="@mipmap/chats"
    app:top_icon="@mipmap/chats_green"
    android:layout_width="40dp"
    android:layout_height="35dp" />

The GradientIconView can gradient change itself from top_icon to bottom_icon. GradientIconView will show top icon completely like this:

gradientIconView.setIconAlpha(1.0f);

And it will show bottom icon completely like this:

gradientIconView.setIconAlpha(0);

GradientTextView

You can add GradientTextView in layout.xml like this.

<com.david.gradientuilibrary.GradientTextView
    android:id="@+id/id_chats_tv"
    app:bottom_text_color="@color/tab_text_gray"
    app:text="@string/chats"
    app:text_size="12sp"
    app:top_text_color="@color/tab_bg_green"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content" />

The GradientTextView can gradient change itself textcolor from top_text_color to bottom_text_color. GradientIconView will show top textcolor completely like this:

gradientTextView.setTextViewAlpha(1.0f);

And it will show bottom textcolor completely like this:

gradientTextView.setTextViewAlpha(0);

3. Running effect

About

The first Android repository of David Wong

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Java 100.0%
Morty Proxy This is a proxified and sanitized view of the page, visit original site.