├── library_ColorTrackView ├── .settings │ ├── org.eclipse.core.resources.prefs │ └── org.eclipse.jdt.core.prefs ├── ic_launcher-web.png ├── res │ ├── drawable-hdpi │ │ └── ic_launcher.png │ ├── drawable-mdpi │ │ └── ic_launcher.png │ ├── drawable-xhdpi │ │ └── ic_launcher.png │ ├── drawable-xxhdpi │ │ └── ic_launcher.png │ ├── values-sw600dp │ │ └── dimens.xml │ ├── values │ │ ├── dimens.xml │ │ ├── strings.xml │ │ ├── styles.xml │ │ └── attr.xml │ ├── menu │ │ └── main.xml │ ├── values-sw720dp-land │ │ └── dimens.xml │ ├── values-v11 │ │ └── styles.xml │ └── values-v14 │ │ └── styles.xml ├── .classpath ├── project.properties ├── proguard-project.txt ├── .project ├── AndroidManifest.xml └── src │ └── com │ └── zhy │ └── view │ └── ColorTrackView.java ├── sample_ColorTrackeView ├── sc.gif ├── changecolorTv.gif ├── ic_launcher-web.png ├── changecolortvdemo.gif ├── libs │ └── android-support-v4.jar ├── res │ ├── drawable-hdpi │ │ └── ic_launcher.png │ ├── drawable-mdpi │ │ └── ic_launcher.png │ ├── drawable-xhdpi │ │ └── ic_launcher.png │ ├── drawable-xxhdpi │ │ └── ic_launcher.png │ ├── values-sw600dp │ │ └── dimens.xml │ ├── values │ │ ├── dimens.xml │ │ ├── strings.xml │ │ └── styles.xml │ ├── menu │ │ └── main.xml │ ├── values-sw720dp-land │ │ └── dimens.xml │ ├── values-v11 │ │ └── styles.xml │ ├── values-v14 │ │ └── styles.xml │ └── layout │ │ ├── activity_simple_main.xml │ │ └── activity_vp_main.xml ├── .settings │ └── org.eclipse.jdt.core.prefs ├── .classpath ├── project.properties ├── proguard-project.txt ├── .project ├── AndroidManifest.xml └── src │ └── com │ └── zhy │ └── viewpagerIndicator │ ├── SimpleUseActivity.java │ ├── HomeActivity.java │ ├── TabFragment.java │ └── ViewPagerUseActivity.java ├── .gitignore ├── README.md └── LICENSE /library_ColorTrackView/.settings/org.eclipse.core.resources.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | encoding/=UTF-8 3 | -------------------------------------------------------------------------------- /sample_ColorTrackeView/sc.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hongyangAndroid/ColorTrackView/HEAD/sample_ColorTrackeView/sc.gif -------------------------------------------------------------------------------- /sample_ColorTrackeView/changecolorTv.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hongyangAndroid/ColorTrackView/HEAD/sample_ColorTrackeView/changecolorTv.gif -------------------------------------------------------------------------------- /library_ColorTrackView/ic_launcher-web.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hongyangAndroid/ColorTrackView/HEAD/library_ColorTrackView/ic_launcher-web.png -------------------------------------------------------------------------------- /sample_ColorTrackeView/ic_launcher-web.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hongyangAndroid/ColorTrackView/HEAD/sample_ColorTrackeView/ic_launcher-web.png -------------------------------------------------------------------------------- /sample_ColorTrackeView/changecolortvdemo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hongyangAndroid/ColorTrackView/HEAD/sample_ColorTrackeView/changecolortvdemo.gif -------------------------------------------------------------------------------- /sample_ColorTrackeView/libs/android-support-v4.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hongyangAndroid/ColorTrackView/HEAD/sample_ColorTrackeView/libs/android-support-v4.jar -------------------------------------------------------------------------------- /library_ColorTrackView/res/drawable-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hongyangAndroid/ColorTrackView/HEAD/library_ColorTrackView/res/drawable-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /library_ColorTrackView/res/drawable-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hongyangAndroid/ColorTrackView/HEAD/library_ColorTrackView/res/drawable-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /sample_ColorTrackeView/res/drawable-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hongyangAndroid/ColorTrackView/HEAD/sample_ColorTrackeView/res/drawable-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /sample_ColorTrackeView/res/drawable-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hongyangAndroid/ColorTrackView/HEAD/sample_ColorTrackeView/res/drawable-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /library_ColorTrackView/res/drawable-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hongyangAndroid/ColorTrackView/HEAD/library_ColorTrackView/res/drawable-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /library_ColorTrackView/res/drawable-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hongyangAndroid/ColorTrackView/HEAD/library_ColorTrackView/res/drawable-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /sample_ColorTrackeView/res/drawable-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hongyangAndroid/ColorTrackView/HEAD/sample_ColorTrackeView/res/drawable-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /sample_ColorTrackeView/res/drawable-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hongyangAndroid/ColorTrackView/HEAD/sample_ColorTrackeView/res/drawable-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /library_ColorTrackView/.settings/org.eclipse.jdt.core.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 3 | org.eclipse.jdt.core.compiler.compliance=1.6 4 | org.eclipse.jdt.core.compiler.source=1.6 5 | -------------------------------------------------------------------------------- /sample_ColorTrackeView/.settings/org.eclipse.jdt.core.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 3 | org.eclipse.jdt.core.compiler.compliance=1.6 4 | org.eclipse.jdt.core.compiler.source=1.6 5 | -------------------------------------------------------------------------------- /sample_ColorTrackeView/res/values-sw600dp/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /library_ColorTrackView/res/values-sw600dp/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /sample_ColorTrackeView/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 16dp 5 | 16dp 6 | 7 | 8 | -------------------------------------------------------------------------------- /library_ColorTrackView/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 16dp 5 | 16dp 6 | 7 | 8 | -------------------------------------------------------------------------------- /sample_ColorTrackeView/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | sample_viewpagerindicator 5 | Settings 6 | Hello world! 7 | 8 | 9 | -------------------------------------------------------------------------------- /library_ColorTrackView/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | sample_color_change_text 5 | Settings 6 | Hello world! 7 | 8 | 9 | -------------------------------------------------------------------------------- /sample_ColorTrackeView/res/menu/main.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /library_ColorTrackView/res/menu/main.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /sample_ColorTrackeView/res/values-sw720dp-land/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 128dp 8 | 9 | 10 | -------------------------------------------------------------------------------- /library_ColorTrackView/res/values-sw720dp-land/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 128dp 8 | 9 | 10 | -------------------------------------------------------------------------------- /sample_ColorTrackeView/res/values-v11/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Built application files 2 | *.apk 3 | *.ap_ 4 | 5 | # Files for the Dalvik VM 6 | *.dex 7 | 8 | # Java class files 9 | *.class 10 | 11 | # Generated files 12 | bin/ 13 | gen/ 14 | 15 | # Gradle files 16 | .gradle/ 17 | build/ 18 | 19 | # Local configuration file (sdk path, etc) 20 | local.properties 21 | 22 | # Proguard folder generated by Eclipse 23 | proguard/ 24 | 25 | # Log Files 26 | *.log 27 | -------------------------------------------------------------------------------- /library_ColorTrackView/res/values-v11/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /sample_ColorTrackeView/res/values-v14/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /library_ColorTrackView/res/values-v14/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /library_ColorTrackView/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /sample_ColorTrackeView/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /library_ColorTrackView/project.properties: -------------------------------------------------------------------------------- 1 | # This file is automatically generated by Android Tools. 2 | # Do not modify this file -- YOUR CHANGES WILL BE ERASED! 3 | # 4 | # This file must be checked in Version Control Systems. 5 | # 6 | # To customize properties used by the Ant build system edit 7 | # "ant.properties", and override values to adapt the script to your 8 | # project structure. 9 | # 10 | # To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home): 11 | #proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt 12 | 13 | # Project target. 14 | target=android-19 15 | android.library=true 16 | -------------------------------------------------------------------------------- /sample_ColorTrackeView/project.properties: -------------------------------------------------------------------------------- 1 | # This file is automatically generated by Android Tools. 2 | # Do not modify this file -- YOUR CHANGES WILL BE ERASED! 3 | # 4 | # This file must be checked in Version Control Systems. 5 | # 6 | # To customize properties used by the Ant build system edit 7 | # "ant.properties", and override values to adapt the script to your 8 | # project structure. 9 | # 10 | # To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home): 11 | #proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt 12 | 13 | # Project target. 14 | target=android-17 15 | android.library.reference.1=../library_ColorTrackView 16 | -------------------------------------------------------------------------------- /sample_ColorTrackeView/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 14 | 15 | 16 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /library_ColorTrackView/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 14 | 15 | 16 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /library_ColorTrackView/proguard-project.txt: -------------------------------------------------------------------------------- 1 | # To enable ProGuard in your project, edit project.properties 2 | # to define the proguard.config property as described in that file. 3 | # 4 | # Add project specific ProGuard rules here. 5 | # By default, the flags in this file are appended to flags specified 6 | # in ${sdk.dir}/tools/proguard/proguard-android.txt 7 | # You can edit the include path and order by changing the ProGuard 8 | # include property in project.properties. 9 | # 10 | # For more details, see 11 | # http://developer.android.com/guide/developing/tools/proguard.html 12 | 13 | # Add any project specific keep options here: 14 | 15 | # If your project uses WebView with JS, uncomment the following 16 | # and specify the fully qualified class name to the JavaScript interface 17 | # class: 18 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 19 | # public *; 20 | #} 21 | -------------------------------------------------------------------------------- /sample_ColorTrackeView/proguard-project.txt: -------------------------------------------------------------------------------- 1 | # To enable ProGuard in your project, edit project.properties 2 | # to define the proguard.config property as described in that file. 3 | # 4 | # Add project specific ProGuard rules here. 5 | # By default, the flags in this file are appended to flags specified 6 | # in ${sdk.dir}/tools/proguard/proguard-android.txt 7 | # You can edit the include path and order by changing the ProGuard 8 | # include property in project.properties. 9 | # 10 | # For more details, see 11 | # http://developer.android.com/guide/developing/tools/proguard.html 12 | 13 | # Add any project specific keep options here: 14 | 15 | # If your project uses WebView with JS, uncomment the following 16 | # and specify the fully qualified class name to the JavaScript interface 17 | # class: 18 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 19 | # public *; 20 | #} 21 | -------------------------------------------------------------------------------- /library_ColorTrackView/res/values/attr.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 | -------------------------------------------------------------------------------- /library_ColorTrackView/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | library_ColorTrackView 4 | 5 | 6 | 7 | 8 | 9 | com.android.ide.eclipse.adt.ResourceManagerBuilder 10 | 11 | 12 | 13 | 14 | com.android.ide.eclipse.adt.PreCompilerBuilder 15 | 16 | 17 | 18 | 19 | org.eclipse.jdt.core.javabuilder 20 | 21 | 22 | 23 | 24 | com.android.ide.eclipse.adt.ApkBuilder 25 | 26 | 27 | 28 | 29 | 30 | com.android.ide.eclipse.adt.AndroidNature 31 | org.eclipse.jdt.core.javanature 32 | 33 | 34 | -------------------------------------------------------------------------------- /sample_ColorTrackeView/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | sample_ColorTrackeView 4 | 5 | 6 | 7 | 8 | 9 | com.android.ide.eclipse.adt.ResourceManagerBuilder 10 | 11 | 12 | 13 | 14 | com.android.ide.eclipse.adt.PreCompilerBuilder 15 | 16 | 17 | 18 | 19 | org.eclipse.jdt.core.javabuilder 20 | 21 | 22 | 23 | 24 | com.android.ide.eclipse.adt.ApkBuilder 25 | 26 | 27 | 28 | 29 | 30 | com.android.ide.eclipse.adt.AndroidNature 31 | org.eclipse.jdt.core.javanature 32 | 33 | 34 | -------------------------------------------------------------------------------- /library_ColorTrackView/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 10 | 11 | 16 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /sample_ColorTrackeView/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 10 | 11 | 16 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /sample_ColorTrackeView/src/com/zhy/viewpagerIndicator/SimpleUseActivity.java: -------------------------------------------------------------------------------- 1 | package com.zhy.viewpagerIndicator; 2 | 3 | import android.animation.ObjectAnimator; 4 | import android.annotation.SuppressLint; 5 | import android.app.Activity; 6 | import android.os.Bundle; 7 | import android.view.View; 8 | 9 | import com.zhy.view.ColorTrackView; 10 | 11 | public class SimpleUseActivity extends Activity 12 | { 13 | 14 | ColorTrackView mView; 15 | 16 | @Override 17 | protected void onCreate(Bundle savedInstanceState) 18 | { 19 | super.onCreate(savedInstanceState); 20 | setContentView(R.layout.activity_simple_main); 21 | mView = (ColorTrackView) findViewById(R.id.id_changeTextColorView); 22 | 23 | 24 | } 25 | 26 | @SuppressLint("NewApi") 27 | public void startLeftChange(View view) 28 | { 29 | mView.setDirection(0); 30 | ObjectAnimator.ofFloat(mView, "progress", 0, 1).setDuration(2000) 31 | .start(); 32 | } 33 | 34 | @SuppressLint("NewApi") 35 | public void startRightChange(View view) 36 | { 37 | mView.setDirection(1); 38 | ObjectAnimator.ofFloat(mView, "progress", 0, 1).setDuration(2000) 39 | .start(); 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /sample_ColorTrackeView/src/com/zhy/viewpagerIndicator/HomeActivity.java: -------------------------------------------------------------------------------- 1 | package com.zhy.viewpagerIndicator; 2 | 3 | import android.app.ListActivity; 4 | import android.content.Intent; 5 | import android.os.Bundle; 6 | import android.view.View; 7 | import android.view.ViewPropertyAnimator; 8 | import android.widget.ArrayAdapter; 9 | import android.widget.ListView; 10 | 11 | public class HomeActivity extends ListActivity 12 | { 13 | private String[] mStrs = new String[] { "Simple Use", "ViewPager Use" }; 14 | 15 | @Override 16 | protected void onCreate(Bundle savedInstanceState) 17 | { 18 | super.onCreate(savedInstanceState); 19 | 20 | getListView().setAdapter( 21 | new ArrayAdapter(this, 22 | android.R.layout.simple_list_item_1, mStrs)); 23 | } 24 | 25 | @Override 26 | protected void onListItemClick(ListView l, View v, int position, long id) 27 | { 28 | Intent intent = null; 29 | switch (position) 30 | { 31 | case 0: 32 | intent = new Intent(this,SimpleUseActivity.class); 33 | break; 34 | case 1: 35 | intent = new Intent(this,ViewPagerUseActivity.class); 36 | break; 37 | } 38 | 39 | if(intent != null ) startActivity(intent); 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Android-ColorTrackView 2 | 字体或者图片可以逐渐染色和逐渐褪色的动画效果 3 | 4 | # 使用 5 | 6 | ```xml 7 | 22 | ``` 23 | 24 | 注:zhy为命名空间,xmlns:zhy="http://schemas.android.com/apk/res-auto",可自由修改。 25 | 26 | * `progress` [0.0f , 1.0f] 27 | * `text` 绘制的文本 28 | * `text_change_color`目标颜色 29 | * `text_origin_color`原始颜色 30 | * `text_size`字体大小 31 | * `direction `方向,枚举类型,支持:left,right,top,bottom 32 | 33 | # 效果图 34 | 35 | ## 简单使用 36 | ![](sample_ColorTrackeView/sc.gif) 37 | 38 | ## 结合ViewPager 39 | ![](sample_ColorTrackeView/changecolortvdemo.gif) 40 | 41 | 42 | # 关于我 43 | [我的博客地址](http://blog.csdn.net/lmj623565791) 44 | 45 | 46 | -------------------------------------------------------------------------------- /sample_ColorTrackeView/src/com/zhy/viewpagerIndicator/TabFragment.java: -------------------------------------------------------------------------------- 1 | package com.zhy.viewpagerIndicator; 2 | 3 | import java.util.Random; 4 | 5 | import android.graphics.Color; 6 | import android.os.Bundle; 7 | import android.support.v4.app.Fragment; 8 | import android.view.Gravity; 9 | import android.view.LayoutInflater; 10 | import android.view.View; 11 | import android.view.ViewGroup; 12 | import android.widget.TextView; 13 | 14 | public class TabFragment extends Fragment 15 | { 16 | public static final String TITLE = "title"; 17 | private String mTitle = "Defaut Value"; 18 | 19 | @Override 20 | public void onCreate(Bundle savedInstanceState) 21 | { 22 | super.onCreate(savedInstanceState); 23 | if (getArguments() != null) 24 | { 25 | mTitle = getArguments().getString(TITLE); 26 | } 27 | } 28 | 29 | @Override 30 | public View onCreateView(LayoutInflater inflater, ViewGroup container, 31 | Bundle savedInstanceState) 32 | { 33 | TextView tv = new TextView(getActivity()); 34 | tv.setTextSize(60); 35 | Random r = new Random(); 36 | tv.setBackgroundColor(Color.argb(r.nextInt(120), r.nextInt(255), 37 | r.nextInt(255), r.nextInt(255))); 38 | tv.setText(mTitle); 39 | tv.setGravity(Gravity.CENTER); 40 | return tv; 41 | 42 | } 43 | 44 | public static TabFragment newInstance(String title) 45 | { 46 | TabFragment tabFragment = new TabFragment(); 47 | Bundle bundle = new Bundle(); 48 | bundle.putString(TITLE, title); 49 | tabFragment.setArguments(bundle); 50 | return tabFragment; 51 | } 52 | 53 | } 54 | -------------------------------------------------------------------------------- /sample_ColorTrackeView/res/layout/activity_simple_main.xml: -------------------------------------------------------------------------------- 1 | 6 | 7 | 19 | 20 | 26 | 27 |