├── .gitignore
├── .idea
├── .name
├── compiler.xml
├── copyright
│ └── profiles_settings.xml
├── gradle.xml
├── misc.xml
├── modules.xml
├── runConfigurations.xml
└── vcs.xml
├── ChangeColorTab.iml
├── README.md
├── build.gradle
├── gradle.properties
├── gradle
└── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
├── library
├── .gitignore
├── build.gradle
├── library.iml
├── proguard-rules.pro
└── src
│ ├── androidTest
│ └── java
│ │ └── com
│ │ └── xdu
│ │ └── xhin
│ │ └── library
│ │ └── ApplicationTest.java
│ ├── main
│ ├── AndroidManifest.xml
│ ├── java
│ │ └── com
│ │ │ └── xdu
│ │ │ └── xhin
│ │ │ └── library
│ │ │ └── view
│ │ │ ├── ChangeColorItem.java
│ │ │ └── ChangeColorTab.java
│ └── res
│ │ ├── drawable
│ │ └── tab_bg.xml
│ │ └── values
│ │ ├── attrs.xml
│ │ └── strings.xml
│ └── test
│ └── java
│ └── com
│ └── xdu
│ └── xhin
│ └── library
│ └── ExampleUnitTest.java
├── sample.gif
├── sample
├── .gitignore
├── build.gradle
├── proguard-rules.pro
├── sample.iml
└── src
│ ├── androidTest
│ └── java
│ │ └── com
│ │ └── xdu
│ │ └── xhin
│ │ └── changecolortab
│ │ └── ApplicationTest.java
│ ├── main
│ ├── AndroidManifest.xml
│ ├── java
│ │ └── com
│ │ │ └── xdu
│ │ │ └── xhin
│ │ │ └── changecolortab
│ │ │ ├── MainActivity.java
│ │ │ └── TabFragment.java
│ └── res
│ │ ├── drawable-hdpi
│ │ ├── ic_menu_allfriends.png
│ │ ├── ic_menu_emoticons.png
│ │ ├── ic_menu_friendslist.png
│ │ └── ic_menu_start_conversation.png
│ │ ├── layout
│ │ └── activity_main.xml
│ │ ├── mipmap-hdpi
│ │ └── ic_launcher.png
│ │ ├── mipmap-mdpi
│ │ └── ic_launcher.png
│ │ ├── mipmap-xhdpi
│ │ └── ic_launcher.png
│ │ ├── mipmap-xxhdpi
│ │ └── ic_launcher.png
│ │ ├── mipmap-xxxhdpi
│ │ └── ic_launcher.png
│ │ └── values
│ │ ├── colors.xml
│ │ ├── strings.xml
│ │ └── styles.xml
│ └── test
│ └── java
│ └── com
│ └── xdu
│ └── xhin
│ └── changecolortab
│ └── ExampleUnitTest.java
└── settings.gradle
/.gitignore:
--------------------------------------------------------------------------------
1 | .gradle
2 | /local.properties
3 | /.idea/workspace.xml
4 | /.idea/libraries
5 | .DS_Store
6 | /build
7 | /captures
8 |
--------------------------------------------------------------------------------
/.idea/.name:
--------------------------------------------------------------------------------
1 | ChangeColorTab
--------------------------------------------------------------------------------
/.idea/compiler.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/.idea/copyright/profiles_settings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/.idea/gradle.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
19 |
20 |
--------------------------------------------------------------------------------
/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
--------------------------------------------------------------------------------
/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/.idea/runConfigurations.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/ChangeColorTab.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # ChangeColorTab
2 |
3 | - **ChangeColorTab** is a simple **TabLayout** extends **LinearLayout** , Host For **ChangeColorItem**.
4 | - **ChangeColorItem** is a custom **View** which can change color when you scroll **ViewPager**.
5 |
6 | ## Sample
7 | 
8 |
9 | ## Usage
10 |
11 | #### Import in Gradle
12 |
13 | ```
14 | compile 'com.xdu.xhin:library:0.1.0'
15 | ```
16 |
17 | #### layout
18 |
19 | ```
20 |
25 |
26 |
30 |
31 |
40 |
41 |
51 |
52 |
61 |
62 |
71 |
72 | ```
73 |
74 | #### Bind to ViewPager
75 |
76 | ```
77 | mViewPager = (ViewPager) findViewById(R.id.id_viewpager);
78 | changeColorTab = (ChangeColorTab) findViewById(R.id.change_color_tab);
79 | changeColorTab.setViewpager(mViewPager);
80 | ```
81 |
82 | ## Thanks
83 |
84 | **[HongYang](http://blog.csdn.net/lmj623565791/article/details/41087219)**
85 |
86 | ## Contact
87 | - **Email**:****
88 |
89 |
90 |
--------------------------------------------------------------------------------
/build.gradle:
--------------------------------------------------------------------------------
1 | // Top-level build file where you can add configuration options common to all sub-projects/modules.
2 |
3 | buildscript {
4 | repositories {
5 | jcenter()
6 | }
7 | dependencies {
8 | classpath 'com.android.tools.build:gradle:1.3.0'
9 | classpath 'com.github.dcendents:android-maven-gradle-plugin:1.3'
10 | classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.0'
11 | // NOTE: Do not place your application dependencies here; they belong
12 | // in the individual module build.gradle files
13 | }
14 | }
15 |
16 | allprojects {
17 | repositories {
18 | jcenter()
19 | }
20 | }
21 |
22 |
23 | task clean(type: Delete) {
24 | delete rootProject.buildDir
25 | }
26 |
--------------------------------------------------------------------------------
/gradle.properties:
--------------------------------------------------------------------------------
1 | ## Project-wide Gradle settings.
2 | #
3 | # For more details on how to configure your build environment visit
4 | # http://www.gradle.org/docs/current/userguide/build_environment.html
5 | #
6 | # Specifies the JVM arguments used for the daemon process.
7 | # The setting is particularly useful for tweaking memory settings.
8 | # Default value: -Xmx10248m -XX:MaxPermSize=256m
9 | # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
10 | #
11 | # When configured, Gradle will run in incubating parallel mode.
12 | # This option should only be used with decoupled projects. More details, visit
13 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
14 | # org.gradle.parallel=true
15 | #Tue Sep 29 21:10:45 CST 2015
16 |
17 |
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XhinLiang/ChangeColorTab/7160497117551414753c3757c362d59ee7c5b85a/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Tue Sep 29 19:05:13 CST 2015
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.4-all.zip
7 |
--------------------------------------------------------------------------------
/gradlew:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | ##############################################################################
4 | ##
5 | ## Gradle start up script for UN*X
6 | ##
7 | ##############################################################################
8 |
9 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
10 | DEFAULT_JVM_OPTS=""
11 |
12 | APP_NAME="Gradle"
13 | APP_BASE_NAME=`basename "$0"`
14 |
15 | # Use the maximum available, or set MAX_FD != -1 to use that value.
16 | MAX_FD="maximum"
17 |
18 | warn ( ) {
19 | echo "$*"
20 | }
21 |
22 | die ( ) {
23 | echo
24 | echo "$*"
25 | echo
26 | exit 1
27 | }
28 |
29 | # OS specific support (must be 'true' or 'false').
30 | cygwin=false
31 | msys=false
32 | darwin=false
33 | case "`uname`" in
34 | CYGWIN* )
35 | cygwin=true
36 | ;;
37 | Darwin* )
38 | darwin=true
39 | ;;
40 | MINGW* )
41 | msys=true
42 | ;;
43 | esac
44 |
45 | # For Cygwin, ensure paths are in UNIX format before anything is touched.
46 | if $cygwin ; then
47 | [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
48 | fi
49 |
50 | # Attempt to set APP_HOME
51 | # Resolve links: $0 may be a link
52 | PRG="$0"
53 | # Need this for relative symlinks.
54 | while [ -h "$PRG" ] ; do
55 | ls=`ls -ld "$PRG"`
56 | link=`expr "$ls" : '.*-> \(.*\)$'`
57 | if expr "$link" : '/.*' > /dev/null; then
58 | PRG="$link"
59 | else
60 | PRG=`dirname "$PRG"`"/$link"
61 | fi
62 | done
63 | SAVED="`pwd`"
64 | cd "`dirname \"$PRG\"`/" >&-
65 | APP_HOME="`pwd -P`"
66 | cd "$SAVED" >&-
67 |
68 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
69 |
70 | # Determine the Java command to use to start the JVM.
71 | if [ -n "$JAVA_HOME" ] ; then
72 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
73 | # IBM's JDK on AIX uses strange locations for the executables
74 | JAVACMD="$JAVA_HOME/jre/sh/java"
75 | else
76 | JAVACMD="$JAVA_HOME/bin/java"
77 | fi
78 | if [ ! -x "$JAVACMD" ] ; then
79 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
80 |
81 | Please set the JAVA_HOME variable in your environment to match the
82 | location of your Java installation."
83 | fi
84 | else
85 | JAVACMD="java"
86 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
87 |
88 | Please set the JAVA_HOME variable in your environment to match the
89 | location of your Java installation."
90 | fi
91 |
92 | # Increase the maximum file descriptors if we can.
93 | if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
94 | MAX_FD_LIMIT=`ulimit -H -n`
95 | if [ $? -eq 0 ] ; then
96 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
97 | MAX_FD="$MAX_FD_LIMIT"
98 | fi
99 | ulimit -n $MAX_FD
100 | if [ $? -ne 0 ] ; then
101 | warn "Could not set maximum file descriptor limit: $MAX_FD"
102 | fi
103 | else
104 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
105 | fi
106 | fi
107 |
108 | # For Darwin, add options to specify how the application appears in the dock
109 | if $darwin; then
110 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
111 | fi
112 |
113 | # For Cygwin, switch paths to Windows format before running java
114 | if $cygwin ; then
115 | APP_HOME=`cygpath --path --mixed "$APP_HOME"`
116 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
117 |
118 | # We build the pattern for arguments to be converted via cygpath
119 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
120 | SEP=""
121 | for dir in $ROOTDIRSRAW ; do
122 | ROOTDIRS="$ROOTDIRS$SEP$dir"
123 | SEP="|"
124 | done
125 | OURCYGPATTERN="(^($ROOTDIRS))"
126 | # Add a user-defined pattern to the cygpath arguments
127 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then
128 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
129 | fi
130 | # Now convert the arguments - kludge to limit ourselves to /bin/sh
131 | i=0
132 | for arg in "$@" ; do
133 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
134 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
135 |
136 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
137 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
138 | else
139 | eval `echo args$i`="\"$arg\""
140 | fi
141 | i=$((i+1))
142 | done
143 | case $i in
144 | (0) set -- ;;
145 | (1) set -- "$args0" ;;
146 | (2) set -- "$args0" "$args1" ;;
147 | (3) set -- "$args0" "$args1" "$args2" ;;
148 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
149 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
150 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
151 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
152 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
153 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
154 | esac
155 | fi
156 |
157 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
158 | function splitJvmOpts() {
159 | JVM_OPTS=("$@")
160 | }
161 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
162 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
163 |
164 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
165 |
--------------------------------------------------------------------------------
/gradlew.bat:
--------------------------------------------------------------------------------
1 | @if "%DEBUG%" == "" @echo off
2 | @rem ##########################################################################
3 | @rem
4 | @rem Gradle startup script for Windows
5 | @rem
6 | @rem ##########################################################################
7 |
8 | @rem Set local scope for the variables with windows NT shell
9 | if "%OS%"=="Windows_NT" setlocal
10 |
11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
12 | set DEFAULT_JVM_OPTS=
13 |
14 | set DIRNAME=%~dp0
15 | if "%DIRNAME%" == "" set DIRNAME=.
16 | set APP_BASE_NAME=%~n0
17 | set APP_HOME=%DIRNAME%
18 |
19 | @rem Find java.exe
20 | if defined JAVA_HOME goto findJavaFromJavaHome
21 |
22 | set JAVA_EXE=java.exe
23 | %JAVA_EXE% -version >NUL 2>&1
24 | if "%ERRORLEVEL%" == "0" goto init
25 |
26 | echo.
27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28 | echo.
29 | echo Please set the JAVA_HOME variable in your environment to match the
30 | echo location of your Java installation.
31 |
32 | goto fail
33 |
34 | :findJavaFromJavaHome
35 | set JAVA_HOME=%JAVA_HOME:"=%
36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37 |
38 | if exist "%JAVA_EXE%" goto init
39 |
40 | echo.
41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42 | echo.
43 | echo Please set the JAVA_HOME variable in your environment to match the
44 | echo location of your Java installation.
45 |
46 | goto fail
47 |
48 | :init
49 | @rem Get command-line arguments, handling Windowz variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 | if "%@eval[2+2]" == "4" goto 4NT_args
53 |
54 | :win9xME_args
55 | @rem Slurp the command line arguments.
56 | set CMD_LINE_ARGS=
57 | set _SKIP=2
58 |
59 | :win9xME_args_slurp
60 | if "x%~1" == "x" goto execute
61 |
62 | set CMD_LINE_ARGS=%*
63 | goto execute
64 |
65 | :4NT_args
66 | @rem Get arguments from the 4NT Shell from JP Software
67 | set CMD_LINE_ARGS=%$
68 |
69 | :execute
70 | @rem Setup the command line
71 |
72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
73 |
74 | @rem Execute Gradle
75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
76 |
77 | :end
78 | @rem End local scope for the variables with windows NT shell
79 | if "%ERRORLEVEL%"=="0" goto mainEnd
80 |
81 | :fail
82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
83 | rem the _cmd.exe /c_ return code!
84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
85 | exit /b 1
86 |
87 | :mainEnd
88 | if "%OS%"=="Windows_NT" endlocal
89 |
90 | :omega
91 |
--------------------------------------------------------------------------------
/library/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/library/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.library'
2 | apply plugin: 'com.github.dcendents.android-maven'
3 | apply plugin: 'com.jfrog.bintray'
4 | version = "0.1.0"
5 |
6 | android {
7 | compileSdkVersion 23
8 | buildToolsVersion "23.0.1"
9 |
10 | defaultConfig {
11 | minSdkVersion 16
12 | targetSdkVersion 23
13 | versionCode 1
14 | versionName "0.0.1"
15 | }
16 | buildTypes {
17 | release {
18 | minifyEnabled false
19 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
20 | }
21 | }
22 | }
23 |
24 | dependencies {
25 | compile fileTree(dir: 'libs', include: ['*.jar'])
26 | testCompile 'junit:junit:4.12'
27 | compile 'com.android.support:appcompat-v7:23.0.1'
28 | }
29 |
30 | def siteUrl = 'https://github.com/XhinLiang/ChangeColorTab' // 项目的主页
31 | def gitUrl = 'https://github.com/XhinLiang/ChangeColorTab.git' // Git仓库的url
32 | group = "com.xdu.xhin"
33 |
34 | install {
35 | repositories.mavenInstaller {
36 | pom {
37 | project {
38 | packaging 'aar'
39 | name 'Android ChangeColorTab' //项目描述
40 | url siteUrl
41 | licenses {
42 | license {
43 | name 'The Apache Software License, Version 2.0'
44 | url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
45 | }
46 | }
47 | developers {
48 | developer {
49 | id 'xhinliang' //填写的一些基本信息
50 | name 'Xhin Liang'
51 | email 'xhinliang@gmail.com'
52 | }
53 | }
54 | scm {
55 | connection gitUrl
56 | developerConnection gitUrl
57 | url siteUrl
58 | }
59 | }
60 | }
61 | }
62 | }
63 |
64 | task sourcesJar(type: Jar) {
65 | from android.sourceSets.main.java.srcDirs
66 | classifier = 'sources'
67 | }
68 | task javadoc(type: Javadoc) {
69 | source = android.sourceSets.main.java.srcDirs
70 | classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
71 | }
72 | task javadocJar(type: Jar, dependsOn: javadoc) {
73 | classifier = 'javadoc'
74 | from javadoc.destinationDir
75 | }
76 | artifacts {
77 | archives javadocJar
78 | archives sourcesJar
79 | }
80 |
81 | Properties properties = new Properties()
82 | properties.load(project.rootProject.file('local.properties').newDataInputStream())
83 |
84 | bintray {
85 | user = properties.getProperty("bintray.user")
86 | key = properties.getProperty("bintray.apikey")
87 | configurations = ['archives']
88 | pkg {
89 | repo = "maven"
90 | name = "ChangeColorTab" //发布到JCenter上的项目名字
91 | websiteUrl = siteUrl
92 | vcsUrl = gitUrl
93 | licenses = ["Apache-2.0"]
94 | publish = true
95 | }
96 | }
97 |
98 |
99 |
--------------------------------------------------------------------------------
/library/library.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 | generateDebugAndroidTestSources
19 | generateDebugSources
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
--------------------------------------------------------------------------------
/library/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # By default, the flags in this file are appended to flags specified
3 | # in /opt/android-sdk-linux/tools/proguard/proguard-android.txt
4 | # You can edit the include path and order by changing the proguardFiles
5 | # directive in build.gradle.
6 | #
7 | # For more details, see
8 | # http://developer.android.com/guide/developing/tools/proguard.html
9 |
10 | # Add any project specific keep options here:
11 |
12 | # If your project uses WebView with JS, uncomment the following
13 | # and specify the fully qualified class name to the JavaScript interface
14 | # class:
15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16 | # public *;
17 | #}
18 |
--------------------------------------------------------------------------------
/library/src/androidTest/java/com/xdu/xhin/library/ApplicationTest.java:
--------------------------------------------------------------------------------
1 | package com.xdu.xhin.library;
2 |
3 | import android.app.Application;
4 | import android.test.ApplicationTestCase;
5 |
6 | /**
7 | * Testing Fundamentals
8 | */
9 | public class ApplicationTest extends ApplicationTestCase {
10 | public ApplicationTest() {
11 | super(Application.class);
12 | }
13 | }
--------------------------------------------------------------------------------
/library/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/library/src/main/java/com/xdu/xhin/library/view/ChangeColorItem.java:
--------------------------------------------------------------------------------
1 | package com.xdu.xhin.library.view;
2 |
3 | import android.content.Context;
4 | import android.content.res.TypedArray;
5 | import android.graphics.Bitmap;
6 | import android.graphics.Bitmap.Config;
7 | import android.graphics.Canvas;
8 | import android.graphics.Paint;
9 | import android.graphics.PorterDuff;
10 | import android.graphics.PorterDuffXfermode;
11 | import android.graphics.Rect;
12 | import android.graphics.drawable.BitmapDrawable;
13 | import android.os.Bundle;
14 | import android.os.Looper;
15 | import android.os.Parcelable;
16 | import android.util.AttributeSet;
17 | import android.util.TypedValue;
18 | import android.view.View;
19 |
20 | import com.xdu.xhin.library.R;
21 |
22 |
23 | public class ChangeColorItem extends View {
24 |
25 | private int mColor = 0xFF45C01A;
26 | private Bitmap mIconBitmap;
27 | private String mText = "";
28 |
29 | private Bitmap mBitmap;
30 |
31 | private float mAlpha;
32 |
33 | private Rect mIconRect;
34 | private Rect mTextBound;
35 | private Paint mTextPaint;
36 |
37 | public ChangeColorItem(Context context) {
38 | this(context, null);
39 | }
40 |
41 | public ChangeColorItem(Context context, AttributeSet attrs) {
42 | this(context, attrs, 0);
43 | }
44 |
45 | /**
46 | * 获取自定义属性的值
47 | */
48 | public ChangeColorItem(Context context, AttributeSet attrs,
49 | int defStyleAttr) {
50 | super(context, attrs, defStyleAttr);
51 |
52 | //获取自定义属性的值
53 | TypedArray typedArray = context.obtainStyledAttributes(attrs,
54 | R.styleable.ChangeColorItem);
55 | //先设置默认的字体大小
56 | int mTextSize = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_SP, 12, getResources().getDisplayMetrics());
57 | for (int i = 0; i < typedArray.getIndexCount(); i++) {
58 | int attr = typedArray.getIndex(i);
59 | if (attr == R.styleable.ChangeColorItem_item_icon) {
60 | BitmapDrawable drawable = (BitmapDrawable) typedArray.getDrawable(attr);
61 | if (drawable != null)
62 | mIconBitmap = drawable.getBitmap();
63 |
64 | } else if (attr == R.styleable.ChangeColorItem_item_color) {
65 | mColor = typedArray.getColor(attr, 0xFF45C01A);
66 |
67 | } else if (attr == R.styleable.ChangeColorItem_item_text) {
68 | mText = typedArray.getString(attr);
69 |
70 | } else if (attr == R.styleable.ChangeColorItem_item_text_size) {
71 | mTextSize = (int) typedArray.getDimension(attr, TypedValue
72 | .applyDimension(TypedValue.COMPLEX_UNIT_SP, 12,
73 | getResources().getDisplayMetrics()));
74 |
75 | }
76 |
77 | }
78 | //用完记得回收
79 | typedArray.recycle();
80 |
81 | //文本框的矩形
82 | mTextBound = new Rect();
83 | //文本的画笔
84 | mTextPaint = new Paint();
85 | //启用绘图反锯齿
86 | mTextPaint.setAntiAlias(true);
87 | //启用防抖动
88 | mTextPaint.setDither(true);
89 | //设置文本大小
90 | mTextPaint.setTextSize(mTextSize);
91 | //设置文本颜色
92 | mTextPaint.setColor(0Xff555555);
93 | //设置要绘制的文本和文本框
94 | mTextPaint.getTextBounds(mText, 0, mText.length(), mTextBound);
95 |
96 | mIconRect = new Rect();
97 |
98 | }
99 |
100 |
101 | //测量View
102 | @Override
103 | protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
104 | super.onMeasure(widthMeasureSpec, heightMeasureSpec);
105 | int iconWidth = Math.min(getMeasuredWidth() - getPaddingLeft()
106 | - getPaddingRight(), getMeasuredHeight() - getPaddingTop()
107 | - getPaddingBottom() - mTextBound.height());
108 |
109 | int left = getMeasuredWidth() / 2 - iconWidth / 2;
110 | int top = getMeasuredHeight() / 2 - (mTextBound.height() + iconWidth) / 2;
111 | mIconRect.set(left, top, left + iconWidth, top + iconWidth);
112 | }
113 |
114 | @Override
115 | protected void onDraw(Canvas canvas) {
116 | canvas.drawBitmap(mIconBitmap, null, mIconRect, null);
117 | int alpha = (int) Math.ceil(255 * mAlpha);
118 | // 内存去准备mBitmap , setAlpha , 纯色 ,xfermode , 图标
119 | setupTargetBitmap(alpha);
120 | // 1、绘制原文本 ; 2、绘制变色的文本
121 | drawSourceText(canvas, alpha);
122 | drawTargetText(canvas, alpha);
123 | canvas.drawBitmap(mBitmap, 0, 0, null);
124 | }
125 |
126 | /**
127 | * 绘制变色的文本
128 | */
129 | private void drawTargetText(Canvas canvas, int alpha) {
130 | mTextPaint.setColor(mColor);
131 | mTextPaint.setAlpha(alpha);
132 | int x = getMeasuredWidth() / 2 - mTextBound.width() / 2;
133 | int y = mIconRect.bottom + mTextBound.height();
134 | canvas.drawText(mText, x, y, mTextPaint);
135 | }
136 |
137 | /**
138 | * 绘制原文本
139 | */
140 | private void drawSourceText(Canvas canvas, int alpha) {
141 | mTextPaint.setColor(0Xff555555);
142 | mTextPaint.setAlpha(255 - alpha);
143 | int x = getMeasuredWidth() / 2 - mTextBound.width() / 2;
144 | int y = mIconRect.bottom + mTextBound.height();
145 | canvas.drawText(mText, x, y, mTextPaint);
146 | }
147 |
148 | /**
149 | * 在内存中绘制可变色的Icon
150 | */
151 | private void setupTargetBitmap(int alpha) {
152 | //创建一个Bitmap,并设置为32位真彩色
153 | mBitmap = Bitmap.createBitmap(getMeasuredWidth(), getMeasuredHeight(), Config.ARGB_8888);
154 | //在原Bitmap上创建一个画板
155 | Canvas mCanvas = new Canvas(mBitmap);
156 | //新建一个画笔并设置其参数
157 | Paint mPaint = new Paint();
158 | mPaint.setColor(mColor);
159 | mPaint.setAntiAlias(true);
160 | mPaint.setDither(true);
161 | mPaint.setAlpha(alpha);
162 | //画板上画出原图像
163 | mCanvas.drawRect(mIconRect, mPaint);
164 | //Xfermode 共有16种模式,现在选择DST_IN模式
165 | mPaint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.DST_IN));
166 | //设置画笔透明度为完全透明
167 | mPaint.setAlpha(255);
168 | //画板上再画一个图像
169 | mCanvas.drawBitmap(mIconBitmap, null, mIconRect, mPaint);
170 | }
171 |
172 | private static final String INSTANCE_STATUS = "instance_status";
173 | private static final String STATUS_ALPHA = "status_alpha";
174 |
175 | @Override
176 | protected Parcelable onSaveInstanceState() {
177 | Bundle bundle = new Bundle();
178 | bundle.putParcelable(INSTANCE_STATUS, super.onSaveInstanceState());
179 | bundle.putFloat(STATUS_ALPHA, mAlpha);
180 | return bundle;
181 | }
182 |
183 | @Override
184 | protected void onRestoreInstanceState(Parcelable state) {
185 | if (state instanceof Bundle) {
186 | Bundle bundle = (Bundle) state;
187 | mAlpha = bundle.getFloat(STATUS_ALPHA);
188 | super.onRestoreInstanceState(bundle.getParcelable(INSTANCE_STATUS));
189 | return;
190 | }
191 | super.onRestoreInstanceState(state);
192 | }
193 |
194 |
195 | //供外部调用的设置透明度(图像颜色深浅)的方法
196 | public void setIconAlpha(float alpha) {
197 | this.mAlpha = alpha;
198 | invalidateView();
199 | }
200 |
201 | //重绘
202 | private void invalidateView() {
203 | if (Looper.getMainLooper() == Looper.myLooper()) {
204 | invalidate();
205 | } else {
206 | postInvalidate();
207 | }
208 | }
209 |
210 | }
211 |
--------------------------------------------------------------------------------
/library/src/main/java/com/xdu/xhin/library/view/ChangeColorTab.java:
--------------------------------------------------------------------------------
1 | package com.xdu.xhin.library.view;
2 |
3 | import android.content.Context;
4 | import android.support.v4.view.ViewPager;
5 | import android.util.AttributeSet;
6 | import android.view.View;
7 | import android.widget.LinearLayout;
8 |
9 | import com.xdu.xhin.library.R;
10 |
11 | import java.util.ArrayList;
12 | import java.util.List;
13 |
14 | /**
15 | * Created by xhinliang on 15-9-29.
16 | * xhinliang@gmail.com
17 | */
18 | public class ChangeColorTab extends LinearLayout {
19 |
20 | private ViewPager mViewPager;
21 | private List children = new ArrayList<>();
22 | private OnClickListener tabOnClick = new OnClickListener() {
23 | @Override
24 | public void onClick(View v) {
25 | clickTab(v);
26 | }
27 | };
28 |
29 | public ChangeColorTab(Context context) {
30 | this(context, null);
31 | }
32 |
33 | public ChangeColorTab(Context context, AttributeSet attrs) {
34 | this(context, attrs, 0);
35 | }
36 |
37 | public ChangeColorTab(Context context, AttributeSet attrs, int defStyleAttr) {
38 | super(context, attrs, defStyleAttr);
39 | setBackgroundResource(R.drawable.tab_bg);
40 | setOrientation(HORIZONTAL);
41 | }
42 |
43 |
44 | @Override
45 | protected void onLayout(boolean changed, int l, int t, int r, int b) {
46 | super.onLayout(changed, l, t, r, b);
47 | //有的时候onLayout会被调用两次,第二次调用的时候不需要初始化
48 | if (!children.isEmpty()) return;
49 | for (int i = 0; i < getChildCount(); ++i) {
50 | children.add((ChangeColorItem) getChildAt(i));
51 | }
52 | for (ChangeColorItem item : children) {
53 | item.setOnClickListener(tabOnClick);
54 | }
55 | //初始化现在ViewPager所选定的Item为不透明
56 | children.get(mViewPager.getCurrentItem()).setIconAlpha(1.0f);
57 | }
58 |
59 | public void setViewpager(ViewPager viewpager) {
60 | this.mViewPager = viewpager;
61 | mViewPager.addOnPageChangeListener(new ViewPager.OnPageChangeListener() {
62 | @Override
63 | public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
64 | if (positionOffset > 0) {
65 | ChangeColorItem left = children.get(position);
66 | ChangeColorItem right = children.get(position + 1);
67 | left.setIconAlpha(1 - positionOffset);
68 | right.setIconAlpha(positionOffset);
69 | }
70 | }
71 |
72 | @Override
73 | public void onPageSelected(int position) {
74 |
75 | }
76 |
77 | @Override
78 | public void onPageScrollStateChanged(int state) {
79 |
80 | }
81 | });
82 | }
83 |
84 | private void clickTab(View v) {
85 | resetOtherTabs();
86 | int index = children.indexOf(v);
87 | children.get(index).setIconAlpha(1.0f);
88 | mViewPager.setCurrentItem(index, false);
89 | }
90 |
91 |
92 | private void resetOtherTabs() {
93 | for (int i = 0; i < children.size(); i++) {
94 | children.get(i).setIconAlpha(0);
95 | }
96 | }
97 | }
98 |
--------------------------------------------------------------------------------
/library/src/main/res/drawable/tab_bg.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/library/src/main/res/values/attrs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/library/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | library
3 |
4 |
--------------------------------------------------------------------------------
/library/src/test/java/com/xdu/xhin/library/ExampleUnitTest.java:
--------------------------------------------------------------------------------
1 | package com.xdu.xhin.library;
2 |
3 | import org.junit.Test;
4 |
5 | import static org.junit.Assert.*;
6 |
7 | /**
8 | * To work on unit tests, switch the Test Artifact in the Build Variants view.
9 | */
10 | public class ExampleUnitTest {
11 | @Test
12 | public void addition_isCorrect() throws Exception {
13 | assertEquals(4, 2 + 2);
14 | }
15 | }
--------------------------------------------------------------------------------
/sample.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XhinLiang/ChangeColorTab/7160497117551414753c3757c362d59ee7c5b85a/sample.gif
--------------------------------------------------------------------------------
/sample/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/sample/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.application'
2 |
3 | android {
4 | compileSdkVersion 23
5 | buildToolsVersion "23.0.1"
6 |
7 | defaultConfig {
8 | applicationId "com.xdu.xhin.changecolortab"
9 | minSdkVersion 16
10 | targetSdkVersion 23
11 | versionCode 1
12 | versionName "1.0"
13 | }
14 | buildTypes {
15 | release {
16 | minifyEnabled false
17 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
18 | }
19 | }
20 | }
21 |
22 | dependencies {
23 | compile fileTree(include: ['*.jar'], dir: 'libs')
24 | testCompile 'junit:junit:4.12'
25 | compile 'com.android.support:appcompat-v7:23.0.1'
26 | compile project(':library')
27 | }
28 |
--------------------------------------------------------------------------------
/sample/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # By default, the flags in this file are appended to flags specified
3 | # in /opt/android-sdk-linux/tools/proguard/proguard-android.txt
4 | # You can edit the include path and order by changing the proguardFiles
5 | # directive in build.gradle.
6 | #
7 | # For more details, see
8 | # http://developer.android.com/guide/developing/tools/proguard.html
9 |
10 | # Add any project specific keep options here:
11 |
12 | # If your project uses WebView with JS, uncomment the following
13 | # and specify the fully qualified class name to the JavaScript interface
14 | # class:
15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16 | # public *;
17 | #}
18 |
--------------------------------------------------------------------------------
/sample/sample.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 | generateDebugAndroidTestSources
19 | generateDebugSources
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
--------------------------------------------------------------------------------
/sample/src/androidTest/java/com/xdu/xhin/changecolortab/ApplicationTest.java:
--------------------------------------------------------------------------------
1 | package com.xdu.xhin.changecolortab;
2 |
3 | import android.app.Application;
4 | import android.test.ApplicationTestCase;
5 |
6 | /**
7 | * Testing Fundamentals
8 | */
9 | public class ApplicationTest extends ApplicationTestCase {
10 | public ApplicationTest() {
11 | super(Application.class);
12 | }
13 | }
--------------------------------------------------------------------------------
/sample/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/sample/src/main/java/com/xdu/xhin/changecolortab/MainActivity.java:
--------------------------------------------------------------------------------
1 | package com.xdu.xhin.changecolortab;
2 |
3 | import android.os.Bundle;
4 | import android.support.v4.app.Fragment;
5 | import android.support.v4.app.FragmentPagerAdapter;
6 | import android.support.v4.view.ViewPager;
7 | import android.support.v7.app.AppCompatActivity;
8 |
9 | import com.xdu.xhin.library.view.ChangeColorTab;
10 |
11 | import java.util.ArrayList;
12 | import java.util.List;
13 |
14 | /**
15 | * Created by xhinliang on 15-9-28.
16 | * xhinliang@gmail.com
17 | */
18 | public class MainActivity extends AppCompatActivity {
19 |
20 | private ViewPager mViewPager;
21 | private List mTabFragments = new ArrayList<>();
22 | private ChangeColorTab changeColorTab;
23 |
24 |
25 | @Override
26 | protected void onCreate(Bundle savedInstanceState) {
27 | super.onCreate(savedInstanceState);
28 | setContentView(R.layout.activity_main);
29 | initView();
30 | initData();
31 | initEvent();
32 | }
33 |
34 | //FindView
35 | private void initView() {
36 | mViewPager = (ViewPager) findViewById(R.id.id_viewpager);
37 | changeColorTab = (ChangeColorTab) findViewById(R.id.change_color_tab);
38 | }
39 |
40 | //初始化所有事件
41 | private void initEvent() {
42 | changeColorTab.setViewpager(mViewPager);
43 | if (getSupportActionBar() != null) {
44 | getSupportActionBar().setDisplayHomeAsUpEnabled(false);
45 | }
46 | }
47 |
48 | //初始化四个Fragment
49 | private void initData() {
50 | String[] mTitles = {"First Fragment !", "Second Fragment !", "Third Fragment !", "Fourth Fragment !"};
51 | for (String title : mTitles) {
52 | TabFragment tabFragment = new TabFragment();
53 | Bundle bundle = new Bundle();
54 | bundle.putString(TabFragment.TITLE, title);
55 | tabFragment.setArguments(bundle);
56 | mTabFragments.add(tabFragment);
57 | }
58 | mViewPager.setAdapter(new FragmentPagerAdapter(getSupportFragmentManager()) {
59 | @Override
60 | public int getCount() {
61 | return mTabFragments.size();
62 | }
63 |
64 | @Override
65 | public Fragment getItem(int position) {
66 | return mTabFragments.get(position);
67 | }
68 | });
69 | }
70 |
71 |
72 |
73 |
74 | }
--------------------------------------------------------------------------------
/sample/src/main/java/com/xdu/xhin/changecolortab/TabFragment.java:
--------------------------------------------------------------------------------
1 | package com.xdu.xhin.changecolortab;
2 |
3 | import android.graphics.Color;
4 | import android.os.Bundle;
5 | import android.support.v4.app.Fragment;
6 | import android.view.Gravity;
7 | import android.view.LayoutInflater;
8 | import android.view.View;
9 | import android.view.ViewGroup;
10 | import android.widget.TextView;
11 |
12 | public class TabFragment extends Fragment
13 | {
14 | private String mTitle = "Default";
15 |
16 | public static final String TITLE = "title";
17 |
18 | @Override
19 | public View onCreateView(LayoutInflater inflater, ViewGroup container,
20 | Bundle savedInstanceState)
21 | {
22 | if (getArguments() != null)
23 | {
24 | mTitle = getArguments().getString(TITLE);
25 | }
26 |
27 | TextView tv = new TextView(getActivity());
28 | tv.setTextSize(20);
29 | tv.setBackgroundColor(Color.parseColor("#ffffffff"));
30 | tv.setText(mTitle);
31 | tv.setGravity(Gravity.CENTER);
32 | return tv;
33 |
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/sample/src/main/res/drawable-hdpi/ic_menu_allfriends.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XhinLiang/ChangeColorTab/7160497117551414753c3757c362d59ee7c5b85a/sample/src/main/res/drawable-hdpi/ic_menu_allfriends.png
--------------------------------------------------------------------------------
/sample/src/main/res/drawable-hdpi/ic_menu_emoticons.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XhinLiang/ChangeColorTab/7160497117551414753c3757c362d59ee7c5b85a/sample/src/main/res/drawable-hdpi/ic_menu_emoticons.png
--------------------------------------------------------------------------------
/sample/src/main/res/drawable-hdpi/ic_menu_friendslist.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XhinLiang/ChangeColorTab/7160497117551414753c3757c362d59ee7c5b85a/sample/src/main/res/drawable-hdpi/ic_menu_friendslist.png
--------------------------------------------------------------------------------
/sample/src/main/res/drawable-hdpi/ic_menu_start_conversation.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XhinLiang/ChangeColorTab/7160497117551414753c3757c362d59ee7c5b85a/sample/src/main/res/drawable-hdpi/ic_menu_start_conversation.png
--------------------------------------------------------------------------------
/sample/src/main/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
12 |
13 |
17 |
18 |
27 |
28 |
38 |
39 |
48 |
49 |
58 |
59 |
60 |
--------------------------------------------------------------------------------
/sample/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XhinLiang/ChangeColorTab/7160497117551414753c3757c362d59ee7c5b85a/sample/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/sample/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XhinLiang/ChangeColorTab/7160497117551414753c3757c362d59ee7c5b85a/sample/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/sample/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XhinLiang/ChangeColorTab/7160497117551414753c3757c362d59ee7c5b85a/sample/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/sample/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XhinLiang/ChangeColorTab/7160497117551414753c3757c362d59ee7c5b85a/sample/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/sample/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XhinLiang/ChangeColorTab/7160497117551414753c3757c362d59ee7c5b85a/sample/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/sample/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #3F51B5
4 | #303F9F
5 | #FF4081
6 |
7 |
--------------------------------------------------------------------------------
/sample/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | ChangeColorTab
3 |
4 |
--------------------------------------------------------------------------------
/sample/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/sample/src/test/java/com/xdu/xhin/changecolortab/ExampleUnitTest.java:
--------------------------------------------------------------------------------
1 | package com.xdu.xhin.changecolortab;
2 |
3 | import org.junit.Test;
4 |
5 | import static org.junit.Assert.*;
6 |
7 | /**
8 | * To work on unit tests, switch the Test Artifact in the Build Variants view.
9 | */
10 | public class ExampleUnitTest {
11 | @Test
12 | public void addition_isCorrect() throws Exception {
13 | assertEquals(4, 2 + 2);
14 | }
15 | }
--------------------------------------------------------------------------------
/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':sample', ':library'
2 |
--------------------------------------------------------------------------------