├── .classpath ├── .gitattributes ├── .gitignore ├── .project ├── .settings └── org.eclipse.jdt.core.prefs ├── AndroidManifest.xml ├── README.md ├── bin ├── AndroidManifest.xml ├── ColorPhrase.apk ├── classes.dex ├── classes │ └── com │ │ ├── example │ │ └── colorphrase │ │ │ ├── BuildConfig.class │ │ │ ├── MainActivity$1.class │ │ │ ├── MainActivity.class │ │ │ ├── R$attr.class │ │ │ ├── R$dimen.class │ │ │ ├── R$drawable.class │ │ │ ├── R$id.class │ │ │ ├── R$layout.class │ │ │ ├── R$menu.class │ │ │ ├── R$string.class │ │ │ ├── R$style.class │ │ │ └── R.class │ │ └── medusa │ │ └── lib │ │ ├── ColorPhrase$InnerToken.class │ │ ├── ColorPhrase$LeftSeparatorToken.class │ │ ├── ColorPhrase$OuterToken.class │ │ ├── ColorPhrase$Token.class │ │ └── ColorPhrase.class ├── dexedLibs │ └── android-support-v4-280ef5398d81ad2ece5360949c0b77e8.jar ├── res │ └── crunch │ │ ├── drawable-hdpi │ │ └── ic_launcher.png │ │ ├── drawable-mdpi │ │ └── ic_launcher.png │ │ ├── drawable-xhdpi │ │ └── ic_launcher.png │ │ └── drawable-xxhdpi │ │ └── ic_launcher.png └── resources.ap_ ├── gen └── com │ └── example │ └── colorphrase │ ├── BuildConfig.java │ └── R.java ├── ic_launcher-web.png ├── libs └── android-support-v4.jar ├── proguard-project.txt ├── project.properties ├── res ├── drawable-hdpi │ └── ic_launcher.png ├── drawable-mdpi │ └── ic_launcher.png ├── drawable-xhdpi │ └── ic_launcher.png ├── drawable-xxhdpi │ └── ic_launcher.png ├── layout │ └── activity_main.xml ├── menu │ └── main.xml ├── values-sw600dp │ └── dimens.xml ├── values-sw720dp-land │ └── dimens.xml ├── values-v11 │ └── styles.xml ├── values-v14 │ └── styles.xml └── values │ ├── dimens.xml │ ├── strings.xml │ └── styles.xml ├── screenshot └── Screenshot_2015-05-16-18-12-23.jpeg └── src └── com ├── example └── colorphrase │ └── MainActivity.java └── medusa └── lib └── ColorPhrase.java /.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | 4 | # Custom for Visual Studio 5 | *.cs diff=csharp 6 | 7 | # Standard to msysgit 8 | *.doc diff=astextplain 9 | *.DOC diff=astextplain 10 | *.docx diff=astextplain 11 | *.DOCX diff=astextplain 12 | *.dot diff=astextplain 13 | *.DOT diff=astextplain 14 | *.pdf diff=astextplain 15 | *.PDF diff=astextplain 16 | *.rtf diff=astextplain 17 | *.RTF diff=astextplain 18 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Windows image file caches 2 | Thumbs.db 3 | ehthumbs.db 4 | 5 | # Folder config file 6 | Desktop.ini 7 | 8 | # Recycle Bin used on file shares 9 | $RECYCLE.BIN/ 10 | 11 | # Windows Installer files 12 | *.cab 13 | *.msi 14 | *.msm 15 | *.msp 16 | 17 | # Windows shortcuts 18 | *.lnk 19 | 20 | # ========================= 21 | # Operating System Files 22 | # ========================= 23 | 24 | # OSX 25 | # ========================= 26 | 27 | .DS_Store 28 | .AppleDouble 29 | .LSOverride 30 | 31 | # Thumbnails 32 | ._* 33 | 34 | # Files that might appear on external disk 35 | .Spotlight-V100 36 | .Trashes 37 | 38 | # Directories potentially created on remote AFP share 39 | .AppleDB 40 | .AppleDesktop 41 | Network Trash Folder 42 | Temporary Items 43 | .apdisk 44 | -------------------------------------------------------------------------------- /.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | ColorPhrase 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 | -------------------------------------------------------------------------------- /.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 | -------------------------------------------------------------------------------- /AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 10 | 11 | 16 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # ColorPhrase 2 | Phrase is an Android string resource color setting library 3 | 4 | ## Usage 5 | ```java 6 | CharSequence formatted = ColorPhrase.from("I'm {Chinese}, I love {China}") 7 | .withSeparator("{}") 8 | .innerColor(0xFFE6454A) 9 | .outerColor(0xFF666666) 10 | .format(); 11 | ``` 12 | ## Preview 13 | ![sample](https://github.com/THEONE10211024/ColorPhrase/blob/master/screenshot/Screenshot_2015-05-16-18-12-23.jpeg) 14 | ##Download 15 | 1)download the project 16 | 2)find ColorPhrase.java in "\src\com\medusa\lib" and copy it into your project 17 | 3)then you can use it! 18 | 4)ps: you should include the android-support-v4.jar in your porject 19 | [![Android Arsenal](https://img.shields.io/badge/Android%20Arsenal-ColorPhrase-green.svg?style=flat)](https://android-arsenal.com/details/1/1915) 20 | -------------------------------------------------------------------------------- /bin/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 10 | 11 | 16 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /bin/ColorPhrase.apk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/THEONE10211024/ColorPhrase/e6ae11893279fc99165d33295c45d6297d77d476/bin/ColorPhrase.apk -------------------------------------------------------------------------------- /bin/classes.dex: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/THEONE10211024/ColorPhrase/e6ae11893279fc99165d33295c45d6297d77d476/bin/classes.dex -------------------------------------------------------------------------------- /bin/classes/com/example/colorphrase/BuildConfig.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/THEONE10211024/ColorPhrase/e6ae11893279fc99165d33295c45d6297d77d476/bin/classes/com/example/colorphrase/BuildConfig.class -------------------------------------------------------------------------------- /bin/classes/com/example/colorphrase/MainActivity$1.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/THEONE10211024/ColorPhrase/e6ae11893279fc99165d33295c45d6297d77d476/bin/classes/com/example/colorphrase/MainActivity$1.class -------------------------------------------------------------------------------- /bin/classes/com/example/colorphrase/MainActivity.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/THEONE10211024/ColorPhrase/e6ae11893279fc99165d33295c45d6297d77d476/bin/classes/com/example/colorphrase/MainActivity.class -------------------------------------------------------------------------------- /bin/classes/com/example/colorphrase/R$attr.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/THEONE10211024/ColorPhrase/e6ae11893279fc99165d33295c45d6297d77d476/bin/classes/com/example/colorphrase/R$attr.class -------------------------------------------------------------------------------- /bin/classes/com/example/colorphrase/R$dimen.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/THEONE10211024/ColorPhrase/e6ae11893279fc99165d33295c45d6297d77d476/bin/classes/com/example/colorphrase/R$dimen.class -------------------------------------------------------------------------------- /bin/classes/com/example/colorphrase/R$drawable.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/THEONE10211024/ColorPhrase/e6ae11893279fc99165d33295c45d6297d77d476/bin/classes/com/example/colorphrase/R$drawable.class -------------------------------------------------------------------------------- /bin/classes/com/example/colorphrase/R$id.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/THEONE10211024/ColorPhrase/e6ae11893279fc99165d33295c45d6297d77d476/bin/classes/com/example/colorphrase/R$id.class -------------------------------------------------------------------------------- /bin/classes/com/example/colorphrase/R$layout.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/THEONE10211024/ColorPhrase/e6ae11893279fc99165d33295c45d6297d77d476/bin/classes/com/example/colorphrase/R$layout.class -------------------------------------------------------------------------------- /bin/classes/com/example/colorphrase/R$menu.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/THEONE10211024/ColorPhrase/e6ae11893279fc99165d33295c45d6297d77d476/bin/classes/com/example/colorphrase/R$menu.class -------------------------------------------------------------------------------- /bin/classes/com/example/colorphrase/R$string.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/THEONE10211024/ColorPhrase/e6ae11893279fc99165d33295c45d6297d77d476/bin/classes/com/example/colorphrase/R$string.class -------------------------------------------------------------------------------- /bin/classes/com/example/colorphrase/R$style.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/THEONE10211024/ColorPhrase/e6ae11893279fc99165d33295c45d6297d77d476/bin/classes/com/example/colorphrase/R$style.class -------------------------------------------------------------------------------- /bin/classes/com/example/colorphrase/R.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/THEONE10211024/ColorPhrase/e6ae11893279fc99165d33295c45d6297d77d476/bin/classes/com/example/colorphrase/R.class -------------------------------------------------------------------------------- /bin/classes/com/medusa/lib/ColorPhrase$InnerToken.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/THEONE10211024/ColorPhrase/e6ae11893279fc99165d33295c45d6297d77d476/bin/classes/com/medusa/lib/ColorPhrase$InnerToken.class -------------------------------------------------------------------------------- /bin/classes/com/medusa/lib/ColorPhrase$LeftSeparatorToken.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/THEONE10211024/ColorPhrase/e6ae11893279fc99165d33295c45d6297d77d476/bin/classes/com/medusa/lib/ColorPhrase$LeftSeparatorToken.class -------------------------------------------------------------------------------- /bin/classes/com/medusa/lib/ColorPhrase$OuterToken.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/THEONE10211024/ColorPhrase/e6ae11893279fc99165d33295c45d6297d77d476/bin/classes/com/medusa/lib/ColorPhrase$OuterToken.class -------------------------------------------------------------------------------- /bin/classes/com/medusa/lib/ColorPhrase$Token.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/THEONE10211024/ColorPhrase/e6ae11893279fc99165d33295c45d6297d77d476/bin/classes/com/medusa/lib/ColorPhrase$Token.class -------------------------------------------------------------------------------- /bin/classes/com/medusa/lib/ColorPhrase.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/THEONE10211024/ColorPhrase/e6ae11893279fc99165d33295c45d6297d77d476/bin/classes/com/medusa/lib/ColorPhrase.class -------------------------------------------------------------------------------- /bin/dexedLibs/android-support-v4-280ef5398d81ad2ece5360949c0b77e8.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/THEONE10211024/ColorPhrase/e6ae11893279fc99165d33295c45d6297d77d476/bin/dexedLibs/android-support-v4-280ef5398d81ad2ece5360949c0b77e8.jar -------------------------------------------------------------------------------- /bin/res/crunch/drawable-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/THEONE10211024/ColorPhrase/e6ae11893279fc99165d33295c45d6297d77d476/bin/res/crunch/drawable-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /bin/res/crunch/drawable-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/THEONE10211024/ColorPhrase/e6ae11893279fc99165d33295c45d6297d77d476/bin/res/crunch/drawable-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /bin/res/crunch/drawable-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/THEONE10211024/ColorPhrase/e6ae11893279fc99165d33295c45d6297d77d476/bin/res/crunch/drawable-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /bin/res/crunch/drawable-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/THEONE10211024/ColorPhrase/e6ae11893279fc99165d33295c45d6297d77d476/bin/res/crunch/drawable-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /bin/resources.ap_: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/THEONE10211024/ColorPhrase/e6ae11893279fc99165d33295c45d6297d77d476/bin/resources.ap_ -------------------------------------------------------------------------------- /gen/com/example/colorphrase/BuildConfig.java: -------------------------------------------------------------------------------- 1 | /** Automatically generated file. DO NOT MODIFY */ 2 | package com.example.colorphrase; 3 | 4 | public final class BuildConfig { 5 | public final static boolean DEBUG = true; 6 | } -------------------------------------------------------------------------------- /gen/com/example/colorphrase/R.java: -------------------------------------------------------------------------------- 1 | /* AUTO-GENERATED FILE. DO NOT MODIFY. 2 | * 3 | * This class was automatically generated by the 4 | * aapt tool from the resource data it found. It 5 | * should not be modified by hand. 6 | */ 7 | 8 | package com.example.colorphrase; 9 | 10 | public final class R { 11 | public static final class attr { 12 | } 13 | public static final class dimen { 14 | /** Default screen margins, per the Android Design guidelines. 15 | 16 | Customize dimensions originally defined in res/values/dimens.xml (such as 17 | screen margins) for sw720dp devices (e.g. 10" tablets) in landscape here. 18 | 19 | */ 20 | public static final int activity_horizontal_margin=0x7f040000; 21 | public static final int activity_vertical_margin=0x7f040001; 22 | } 23 | public static final class drawable { 24 | public static final int ic_launcher=0x7f020000; 25 | } 26 | public static final class id { 27 | public static final int action_settings=0x7f080003; 28 | public static final int button1=0x7f080002; 29 | public static final int editText1=0x7f080000; 30 | public static final int textView1=0x7f080001; 31 | } 32 | public static final class layout { 33 | public static final int activity_main=0x7f030000; 34 | } 35 | public static final class menu { 36 | public static final int main=0x7f070000; 37 | } 38 | public static final class string { 39 | public static final int action_settings=0x7f050001; 40 | public static final int app_name=0x7f050000; 41 | public static final int hello_world=0x7f050002; 42 | public static final int pattern=0x7f050003; 43 | } 44 | public static final class style { 45 | /** 46 | Base application theme, dependent on API level. This theme is replaced 47 | by AppBaseTheme from res/values-vXX/styles.xml on newer devices. 48 | 49 | 50 | Theme customizations available in newer API levels can go in 51 | res/values-vXX/styles.xml, while customizations related to 52 | backward-compatibility can go here. 53 | 54 | 55 | Base application theme for API 11+. This theme completely replaces 56 | AppBaseTheme from res/values/styles.xml on API 11+ devices. 57 | 58 | API 11 theme customizations can go here. 59 | 60 | Base application theme for API 14+. This theme completely replaces 61 | AppBaseTheme from BOTH res/values/styles.xml and 62 | res/values-v11/styles.xml on API 14+ devices. 63 | 64 | API 14 theme customizations can go here. 65 | */ 66 | public static final int AppBaseTheme=0x7f060000; 67 | /** Application theme. 68 | All customizations that are NOT specific to a particular API-level can go here. 69 | */ 70 | public static final int AppTheme=0x7f060001; 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /ic_launcher-web.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/THEONE10211024/ColorPhrase/e6ae11893279fc99165d33295c45d6297d77d476/ic_launcher-web.png -------------------------------------------------------------------------------- /libs/android-support-v4.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/THEONE10211024/ColorPhrase/e6ae11893279fc99165d33295c45d6297d77d476/libs/android-support-v4.jar -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /res/drawable-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/THEONE10211024/ColorPhrase/e6ae11893279fc99165d33295c45d6297d77d476/res/drawable-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /res/drawable-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/THEONE10211024/ColorPhrase/e6ae11893279fc99165d33295c45d6297d77d476/res/drawable-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /res/drawable-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/THEONE10211024/ColorPhrase/e6ae11893279fc99165d33295c45d6297d77d476/res/drawable-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /res/drawable-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/THEONE10211024/ColorPhrase/e6ae11893279fc99165d33295c45d6297d77d476/res/drawable-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 12 | 13 | 20 | 21 | 22 | 23 | 24 | 30 | 31 |