├── LICENSE
├── README.md
├── SkinTest
├── .classpath
├── .fatjar
├── .gradle
│ └── 2.8
│ │ └── taskArtifacts
│ │ ├── cache.properties
│ │ ├── cache.properties.lock
│ │ ├── fileHashes.bin
│ │ ├── fileSnapshots.bin
│ │ ├── outputFileStates.bin
│ │ └── taskArtifacts.bin
├── .idea
│ ├── .name
│ ├── compiler.xml
│ ├── copyright
│ │ └── profiles_settings.xml
│ ├── encodings.xml
│ ├── findbugs-idea.xml
│ ├── gradle.xml
│ ├── libraries
│ │ └── injor.xml
│ ├── misc.xml
│ ├── modules.xml
│ ├── runConfigurations.xml
│ ├── vcs.xml
│ └── workspace.xml
├── .project
├── AndroidManifest.xml
├── SkinTest.iml
├── assets
│ └── fonts
│ │ ├── custom_font.ttf
│ │ └── custom_font_dark.ttf
├── bin
│ ├── AndroidManifest.xml
│ ├── SkinTest.apk
│ ├── classes.dex
│ ├── classes
│ │ └── com
│ │ │ └── iflytek
│ │ │ ├── main
│ │ │ ├── BrightnessProcessor$1.class
│ │ │ ├── BrightnessProcessor.class
│ │ │ ├── Home$1.class
│ │ │ ├── Home.class
│ │ │ ├── SettingActivity$1.class
│ │ │ ├── SettingActivity.class
│ │ │ └── SkinApplication.class
│ │ │ └── skintest
│ │ │ ├── BuildConfig.class
│ │ │ ├── R$attr.class
│ │ │ ├── R$color.class
│ │ │ ├── R$dimen.class
│ │ │ ├── R$drawable.class
│ │ │ ├── R$id.class
│ │ │ ├── R$integer.class
│ │ │ ├── R$layout.class
│ │ │ ├── R$string.class
│ │ │ ├── R$style.class
│ │ │ └── R.class
│ ├── dexedLibs
│ │ └── injor-701be309e533d7d1894a201d7265b7ea.jar
│ ├── jarlist.cache
│ ├── res
│ │ └── crunch
│ │ │ ├── drawable-hdpi
│ │ │ ├── btn_normal.9.png
│ │ │ ├── btn_normal_dark.9.png
│ │ │ ├── btn_pressed.9.png
│ │ │ ├── btn_pressed_dark.9.png
│ │ │ └── ic_launcher.png
│ │ │ ├── drawable-mdpi
│ │ │ └── ic_launcher.png
│ │ │ ├── drawable-xhdpi
│ │ │ └── ic_launcher.png
│ │ │ └── drawable-xxhdpi
│ │ │ └── ic_launcher.png
│ └── resources.ap_
├── build.gradle
├── build
│ ├── generated
│ │ └── source
│ │ │ ├── buildConfig
│ │ │ ├── androidTest
│ │ │ │ └── debug
│ │ │ │ │ └── com
│ │ │ │ │ └── iflytek
│ │ │ │ │ └── skintest
│ │ │ │ │ └── test
│ │ │ │ │ └── BuildConfig.java
│ │ │ └── debug
│ │ │ │ └── com
│ │ │ │ └── iflytek
│ │ │ │ └── skintest
│ │ │ │ └── BuildConfig.java
│ │ │ └── r
│ │ │ └── debug
│ │ │ └── com
│ │ │ └── iflytek
│ │ │ └── skintest
│ │ │ └── R.java
│ ├── intermediates
│ │ ├── assets
│ │ │ └── debug
│ │ │ │ └── fonts
│ │ │ │ ├── custom_font.ttf
│ │ │ │ └── custom_font_dark.ttf
│ │ ├── blame
│ │ │ └── res
│ │ │ │ └── debug
│ │ │ │ ├── multi
│ │ │ │ └── values.json
│ │ │ │ └── single
│ │ │ │ ├── color.json
│ │ │ │ ├── drawable-hdpi-v4.json
│ │ │ │ ├── drawable-mdpi-v4.json
│ │ │ │ ├── drawable-xhdpi-v4.json
│ │ │ │ ├── drawable-xxhdpi-v4.json
│ │ │ │ ├── drawable.json
│ │ │ │ └── layout.json
│ │ ├── incremental
│ │ │ ├── compileDebugAidl
│ │ │ │ └── dependency.store
│ │ │ ├── compileDebugAndroidTestAidl
│ │ │ │ └── dependency.store
│ │ │ ├── mergeDebugAndroidTestAssets
│ │ │ │ └── merger.xml
│ │ │ ├── mergeDebugAndroidTestResources
│ │ │ │ └── merger.xml
│ │ │ ├── mergeDebugAssets
│ │ │ │ └── merger.xml
│ │ │ └── mergeDebugResources
│ │ │ │ └── merger.xml
│ │ ├── manifest
│ │ │ └── androidTest
│ │ │ │ └── debug
│ │ │ │ └── AndroidManifest.xml
│ │ ├── manifests
│ │ │ └── full
│ │ │ │ └── debug
│ │ │ │ └── AndroidManifest.xml
│ │ └── res
│ │ │ ├── merged
│ │ │ └── debug
│ │ │ │ ├── color
│ │ │ │ ├── btn_color.xml
│ │ │ │ └── btn_color_dark.xml
│ │ │ │ ├── drawable-hdpi-v4
│ │ │ │ ├── btn_normal.9.png
│ │ │ │ ├── btn_normal_dark.9.png
│ │ │ │ ├── btn_pressed.9.png
│ │ │ │ ├── btn_pressed_dark.9.png
│ │ │ │ └── ic_launcher.png
│ │ │ │ ├── drawable-mdpi-v4
│ │ │ │ └── ic_launcher.png
│ │ │ │ ├── drawable-xhdpi-v4
│ │ │ │ └── ic_launcher.png
│ │ │ │ ├── drawable-xxhdpi-v4
│ │ │ │ └── ic_launcher.png
│ │ │ │ ├── drawable
│ │ │ │ ├── btn_background.xml
│ │ │ │ └── btn_background_dark.xml
│ │ │ │ ├── layout
│ │ │ │ ├── activity_home.xml
│ │ │ │ └── activity_setting.xml
│ │ │ │ └── values
│ │ │ │ └── values.xml
│ │ │ ├── resources-debug-androidTest.ap_
│ │ │ └── resources-debug.ap_
│ └── outputs
│ │ └── logs
│ │ └── manifest-merger-debug-report.txt
├── gen
│ └── com
│ │ └── iflytek
│ │ └── skintest
│ │ ├── BuildConfig.java
│ │ └── R.java
├── gradle.properties
├── gradle
│ └── wrapper
│ │ ├── gradle-wrapper.jar
│ │ └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
├── ic_launcher-web.png
├── libs
│ └── injor.jar
├── local.properties
├── proguard-project.txt
├── project.properties
├── res
│ ├── color
│ │ ├── btn_color.xml
│ │ └── btn_color_dark.xml
│ ├── drawable-hdpi
│ │ ├── btn_normal.9.png
│ │ ├── btn_normal_dark.9.png
│ │ ├── btn_pressed.9.png
│ │ ├── btn_pressed_dark.9.png
│ │ └── ic_launcher.png
│ ├── drawable-mdpi
│ │ └── ic_launcher.png
│ ├── drawable-xhdpi
│ │ └── ic_launcher.png
│ ├── drawable-xxhdpi
│ │ └── ic_launcher.png
│ ├── drawable
│ │ ├── btn_background.xml
│ │ └── btn_background_dark.xml
│ ├── layout
│ │ ├── activity_home.xml
│ │ └── activity_setting.xml
│ └── values
│ │ ├── colors.xml
│ │ ├── dimens.xml
│ │ ├── integers.xml
│ │ ├── strings.xml
│ │ └── styles.xml
└── src
│ └── com
│ └── iflytek
│ └── main
│ ├── BrightnessProcessor.java
│ ├── Home.java
│ ├── SettingActivity.java
│ └── SkinApplication.java
├── injor-bin-with-src.jar
├── injor-bin.jar
└── injor
├── .classpath
├── .fatjar
├── .project
├── AndroidManifest.xml
├── bin
├── AndroidManifest.xml
└── classes
│ └── com
│ ├── hackware
│ └── injor
│ │ ├── BuildConfig.class
│ │ ├── R$attr.class
│ │ ├── R$drawable.class
│ │ ├── R$string.class
│ │ ├── R$style.class
│ │ └── R.class
│ └── injor
│ ├── callback
│ ├── ISkinChangingCallback$1.class
│ └── ISkinChangingCallback.class
│ ├── common
│ ├── BackgroundTaskManager$BackgroundHandler.class
│ ├── BackgroundTaskManager$SingletonHolder.class
│ ├── BackgroundTaskManager.class
│ ├── FontCacheManager$SingletonHolder.class
│ ├── FontCacheManager.class
│ ├── PrefManager.class
│ ├── ResourceManager.class
│ ├── UITaskManager$SingletonHolder.class
│ └── UITaskManager.class
│ ├── constant
│ └── SkinConfig.class
│ ├── entity
│ └── SkinItem.class
│ ├── main
│ ├── SkinManager$1$1.class
│ ├── SkinManager$1.class
│ ├── SkinManager$2.class
│ ├── SkinManager$SingletonHolder.class
│ └── SkinManager.class
│ └── processor
│ ├── ISkinProcessor.class
│ └── impl
│ ├── BackroundProcessor$1.class
│ ├── BackroundProcessor$2.class
│ ├── BackroundProcessor.class
│ ├── DividerProcessor$1.class
│ ├── DividerProcessor.class
│ ├── SrcProcessor$1.class
│ ├── SrcProcessor.class
│ ├── TextColorProcessor$1.class
│ ├── TextColorProcessor.class
│ ├── TextProcessor$1.class
│ ├── TextProcessor.class
│ ├── TextSizeProcessor$1.class
│ ├── TextSizeProcessor.class
│ ├── TypefaceProcessor$1.class
│ └── TypefaceProcessor.class
├── gen
└── com
│ └── hackware
│ └── injor
│ ├── BuildConfig.java
│ └── R.java
├── proguard-project.txt
├── project.properties
├── res
├── drawable-hdpi
│ └── ic_launcher.png
├── drawable-mdpi
│ └── ic_launcher.png
├── drawable-xhdpi
│ └── ic_launcher.png
├── values-v11
│ └── styles.xml
├── values-v14
│ └── styles.xml
└── values
│ ├── strings.xml
│ └── styles.xml
└── src
└── com
└── injor
├── callback
└── ISkinChangingCallback.java
├── common
├── BackgroundTaskManager.java
├── CacheManager.java
├── PrefManager.java
├── ResourceManager.java
└── UITaskManager.java
├── constant
└── SkinConfig.java
├── entity
└── SkinItem.java
├── main
└── SkinManager.java
└── processor
├── ISkinProcessor.java
└── impl
├── BackroundProcessor.java
├── DividerProcessor.java
├── SrcProcessor.java
├── TextColorProcessor.java
├── TextProcessor.java
├── TextSizeProcessor.java
└── TypefaceProcessor.java
/LICENSE:
--------------------------------------------------------------------------------
1 | Apache License
2 | Version 2.0, January 2004
3 | http://www.apache.org/licenses/
4 |
5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6 |
7 | 1. Definitions.
8 |
9 | "License" shall mean the terms and conditions for use, reproduction,
10 | and distribution as defined by Sections 1 through 9 of this document.
11 |
12 | "Licensor" shall mean the copyright owner or entity authorized by
13 | the copyright owner that is granting the License.
14 |
15 | "Legal Entity" shall mean the union of the acting entity and all
16 | other entities that control, are controlled by, or are under common
17 | control with that entity. For the purposes of this definition,
18 | "control" means (i) the power, direct or indirect, to cause the
19 | direction or management of such entity, whether by contract or
20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the
21 | outstanding shares, or (iii) beneficial ownership of such entity.
22 |
23 | "You" (or "Your") shall mean an individual or Legal Entity
24 | exercising permissions granted by this License.
25 |
26 | "Source" form shall mean the preferred form for making modifications,
27 | including but not limited to software source code, documentation
28 | source, and configuration files.
29 |
30 | "Object" form shall mean any form resulting from mechanical
31 | transformation or translation of a Source form, including but
32 | not limited to compiled object code, generated documentation,
33 | and conversions to other media types.
34 |
35 | "Work" shall mean the work of authorship, whether in Source or
36 | Object form, made available under the License, as indicated by a
37 | copyright notice that is included in or attached to the work
38 | (an example is provided in the Appendix below).
39 |
40 | "Derivative Works" shall mean any work, whether in Source or Object
41 | form, that is based on (or derived from) the Work and for which the
42 | editorial revisions, annotations, elaborations, or other modifications
43 | represent, as a whole, an original work of authorship. For the purposes
44 | of this License, Derivative Works shall not include works that remain
45 | separable from, or merely link (or bind by name) to the interfaces of,
46 | the Work and Derivative Works thereof.
47 |
48 | "Contribution" shall mean any work of authorship, including
49 | the original version of the Work and any modifications or additions
50 | to that Work or Derivative Works thereof, that is intentionally
51 | submitted to Licensor for inclusion in the Work by the copyright owner
52 | or by an individual or Legal Entity authorized to submit on behalf of
53 | the copyright owner. For the purposes of this definition, "submitted"
54 | means any form of electronic, verbal, or written communication sent
55 | to the Licensor or its representatives, including but not limited to
56 | communication on electronic mailing lists, source code control systems,
57 | and issue tracking systems that are managed by, or on behalf of, the
58 | Licensor for the purpose of discussing and improving the Work, but
59 | excluding communication that is conspicuously marked or otherwise
60 | designated in writing by the copyright owner as "Not a Contribution."
61 |
62 | "Contributor" shall mean Licensor and any individual or Legal Entity
63 | on behalf of whom a Contribution has been received by Licensor and
64 | subsequently incorporated within the Work.
65 |
66 | 2. Grant of Copyright License. Subject to the terms and conditions of
67 | this License, each Contributor hereby grants to You a perpetual,
68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69 | copyright license to reproduce, prepare Derivative Works of,
70 | publicly display, publicly perform, sublicense, and distribute the
71 | Work and such Derivative Works in Source or Object form.
72 |
73 | 3. Grant of Patent License. Subject to the terms and conditions of
74 | this License, each Contributor hereby grants to You a perpetual,
75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76 | (except as stated in this section) patent license to make, have made,
77 | use, offer to sell, sell, import, and otherwise transfer the Work,
78 | where such license applies only to those patent claims licensable
79 | by such Contributor that are necessarily infringed by their
80 | Contribution(s) alone or by combination of their Contribution(s)
81 | with the Work to which such Contribution(s) was submitted. If You
82 | institute patent litigation against any entity (including a
83 | cross-claim or counterclaim in a lawsuit) alleging that the Work
84 | or a Contribution incorporated within the Work constitutes direct
85 | or contributory patent infringement, then any patent licenses
86 | granted to You under this License for that Work shall terminate
87 | as of the date such litigation is filed.
88 |
89 | 4. Redistribution. You may reproduce and distribute copies of the
90 | Work or Derivative Works thereof in any medium, with or without
91 | modifications, and in Source or Object form, provided that You
92 | meet the following conditions:
93 |
94 | (a) You must give any other recipients of the Work or
95 | Derivative Works a copy of this License; and
96 |
97 | (b) You must cause any modified files to carry prominent notices
98 | stating that You changed the files; and
99 |
100 | (c) You must retain, in the Source form of any Derivative Works
101 | that You distribute, all copyright, patent, trademark, and
102 | attribution notices from the Source form of the Work,
103 | excluding those notices that do not pertain to any part of
104 | the Derivative Works; and
105 |
106 | (d) If the Work includes a "NOTICE" text file as part of its
107 | distribution, then any Derivative Works that You distribute must
108 | include a readable copy of the attribution notices contained
109 | within such NOTICE file, excluding those notices that do not
110 | pertain to any part of the Derivative Works, in at least one
111 | of the following places: within a NOTICE text file distributed
112 | as part of the Derivative Works; within the Source form or
113 | documentation, if provided along with the Derivative Works; or,
114 | within a display generated by the Derivative Works, if and
115 | wherever such third-party notices normally appear. The contents
116 | of the NOTICE file are for informational purposes only and
117 | do not modify the License. You may add Your own attribution
118 | notices within Derivative Works that You distribute, alongside
119 | or as an addendum to the NOTICE text from the Work, provided
120 | that such additional attribution notices cannot be construed
121 | as modifying the License.
122 |
123 | You may add Your own copyright statement to Your modifications and
124 | may provide additional or different license terms and conditions
125 | for use, reproduction, or distribution of Your modifications, or
126 | for any such Derivative Works as a whole, provided Your use,
127 | reproduction, and distribution of the Work otherwise complies with
128 | the conditions stated in this License.
129 |
130 | 5. Submission of Contributions. Unless You explicitly state otherwise,
131 | any Contribution intentionally submitted for inclusion in the Work
132 | by You to the Licensor shall be under the terms and conditions of
133 | this License, without any additional terms or conditions.
134 | Notwithstanding the above, nothing herein shall supersede or modify
135 | the terms of any separate license agreement you may have executed
136 | with Licensor regarding such Contributions.
137 |
138 | 6. Trademarks. This License does not grant permission to use the trade
139 | names, trademarks, service marks, or product names of the Licensor,
140 | except as required for reasonable and customary use in describing the
141 | origin of the Work and reproducing the content of the NOTICE file.
142 |
143 | 7. Disclaimer of Warranty. Unless required by applicable law or
144 | agreed to in writing, Licensor provides the Work (and each
145 | Contributor provides its Contributions) on an "AS IS" BASIS,
146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147 | implied, including, without limitation, any warranties or conditions
148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149 | PARTICULAR PURPOSE. You are solely responsible for determining the
150 | appropriateness of using or redistributing the Work and assume any
151 | risks associated with Your exercise of permissions under this License.
152 |
153 | 8. Limitation of Liability. In no event and under no legal theory,
154 | whether in tort (including negligence), contract, or otherwise,
155 | unless required by applicable law (such as deliberate and grossly
156 | negligent acts) or agreed to in writing, shall any Contributor be
157 | liable to You for damages, including any direct, indirect, special,
158 | incidental, or consequential damages of any character arising as a
159 | result of this License or out of the use or inability to use the
160 | Work (including but not limited to damages for loss of goodwill,
161 | work stoppage, computer failure or malfunction, or any and all
162 | other commercial damages or losses), even if such Contributor
163 | has been advised of the possibility of such damages.
164 |
165 | 9. Accepting Warranty or Additional Liability. While redistributing
166 | the Work or Derivative Works thereof, You may choose to offer,
167 | and charge a fee for, acceptance of support, warranty, indemnity,
168 | or other liability obligations and/or rights consistent with this
169 | License. However, in accepting such obligations, You may act only
170 | on Your own behalf and on Your sole responsibility, not on behalf
171 | of any other Contributor, and only if You agree to indemnify,
172 | defend, and hold each Contributor harmless for any liability
173 | incurred by, or claims asserted against, such Contributor by reason
174 | of your accepting any such warranty or additional liability.
175 |
176 | END OF TERMS AND CONDITIONS
177 |
178 | APPENDIX: How to apply the Apache License to your work.
179 |
180 | To apply the Apache License to your work, attach the following
181 | boilerplate notice, with the fields enclosed by brackets "{}"
182 | replaced with your own identifying information. (Don't include
183 | the brackets!) The text should be enclosed in the appropriate
184 | comment syntax for the file format. We also recommend that a
185 | file or class name and description of purpose be included on the
186 | same "printed page" as the copyright notice for easier
187 | identification within third-party archives.
188 |
189 | Copyright {yyyy} {name of copyright owner}
190 |
191 | Licensed under the Apache License, Version 2.0 (the "License");
192 | you may not use this file except in compliance with the License.
193 | You may obtain a copy of the License at
194 |
195 | http://www.apache.org/licenses/LICENSE-2.0
196 |
197 | Unless required by applicable law or agreed to in writing, software
198 | distributed under the License is distributed on an "AS IS" BASIS,
199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200 | See the License for the specific language governing permissions and
201 | limitations under the License.
202 |
203 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # injor
2 | **injor** —— 一个高度可扩展的,非侵入式的,简单的,轻量的,强悍的,"原生"的Android皮肤框架,仅35K,无第三方依赖,完美兼容Android 1.0 ~ 6.0。支持内置皮肤和插件皮肤(本质是apk,但无需安装)。
3 |
4 | **injor** 的灵感来自AndroidChangeSkin ,原理一样,均是在换肤时遍历contentView,但**injor**内置更多的特性,具有更好、更强的扩展性也更简单,并且支持异步换肤 —— 更换皮肤时,对ViewTree的遍历,语法解析,资源加载均在子线程中进行,只有将资源设置到view上时才在主线程中运行。因此对于大量item(成千上万,可在SkinTest 中模拟)的界面,换肤时界面仍保持响应(虽然有点卡,但不至于出现ANR,因此可在换肤时显示进度对话框)。
5 |
6 |
7 | #说明
8 | - /injor 中仅包含框架代码,直接打包/injor/src 中的代码即可使用。bin包大概35K,bin_with_src包大概51K。
9 | - /SkinTest 演示了如何使用**injor**,包含对**injor**默认支持的7种resType的简单使用,性能测试以及如何扩展**injor**(演示了如何扩展injor使得可通过皮肤调整界面亮度)。用ADT或Android Studio直接导入均可运行。
10 |
11 | #特性
12 | **injor** 默认支持7种resType,分别是:
13 | - background 切换View及其子类的背景
14 | - color 切换TextView及其子类的文字颜色
15 | - text 切换TextView及其子类的文字
16 | - textSize 切换TextView及其子类的文字大小
17 | - divider 切换ListView及其子类的分割器
18 | - typeface 切换TextView及其子类的字体
19 | - src 切换ImageView及其子类的源
20 |
21 | 在**injor**中,每一个resType均由一个对应的处理器(ISkinProcessor)处理,要想扩展resType,只需实现一个ISkinProcessor并将它注册到**injor**即可,**injor**便能理解皮肤语法中的新resType。**injor**默认开启异步换肤,这对于包含大量item的界面尤为有用,但也可选择关闭它,少量item的界面换肤反而更快。**injor**支持切换应用内置皮肤和插件皮肤,插件皮肤就是一个APK,但无需安装。皮肤资源的组织方式就是Android的那一套,**injor**也是通过android.content.res.Resources去获取资源。这也是为什么说它是“原生”的原因。唯一不同的是,由于**injor**内置字体切换特性,而Android对字体切换不太友好。因此需要把字体放置在/assets/fonts 目录下,**injor**通过Typeface.createFromAsset(AssetManager)去获取并自动做字体缓存。**injor**换肤是动态的,不用重启Activity,并自动记录当前的皮肤,换肤后会一直生效。
22 |
23 | #缺陷
24 | **injor**不支持切换布局文件,事实上有必要么?
25 |
26 | #兼容性
27 | **injor**不会引入额外的兼容性问题,内部的兼容性的问题都已经处理,甚至都考虑了获取apiLevel的兼容性,吹牛B的说,兼容至Android 1.0。
28 |
29 | #引入及用法
30 | 正在编辑... 99%,等不及了?
31 |
--------------------------------------------------------------------------------
/SkinTest/.classpath:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/SkinTest/.fatjar:
--------------------------------------------------------------------------------
1 | #Fat Jar Configuration File
2 | #Wed Dec 23 22:11:32 CST 2015
3 | onejar.license.required=true
4 | manifest.classpath=
5 | manifest.removesigners=true
6 | onejar.checkbox=false
7 | jarname=C\:\\Users\\chen\\Desktop\\injor.jar
8 | manifest.mergeall=true
9 | manifest.mainclass=
10 | manifest.file=
11 | jarname.isextern=true
12 | onejar.expand=
13 | excludes=~com/~iflytek/
14 | includes=
15 |
--------------------------------------------------------------------------------
/SkinTest/.gradle/2.8/taskArtifacts/cache.properties:
--------------------------------------------------------------------------------
1 | #Wed Dec 23 09:12:20 CST 2015
2 |
--------------------------------------------------------------------------------
/SkinTest/.gradle/2.8/taskArtifacts/cache.properties.lock:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hackware1993/injor/9813f885474051ad4f11e4fbd33b0f8c59835cdc/SkinTest/.gradle/2.8/taskArtifacts/cache.properties.lock
--------------------------------------------------------------------------------
/SkinTest/.gradle/2.8/taskArtifacts/fileHashes.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hackware1993/injor/9813f885474051ad4f11e4fbd33b0f8c59835cdc/SkinTest/.gradle/2.8/taskArtifacts/fileHashes.bin
--------------------------------------------------------------------------------
/SkinTest/.gradle/2.8/taskArtifacts/fileSnapshots.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hackware1993/injor/9813f885474051ad4f11e4fbd33b0f8c59835cdc/SkinTest/.gradle/2.8/taskArtifacts/fileSnapshots.bin
--------------------------------------------------------------------------------
/SkinTest/.gradle/2.8/taskArtifacts/outputFileStates.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hackware1993/injor/9813f885474051ad4f11e4fbd33b0f8c59835cdc/SkinTest/.gradle/2.8/taskArtifacts/outputFileStates.bin
--------------------------------------------------------------------------------
/SkinTest/.gradle/2.8/taskArtifacts/taskArtifacts.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hackware1993/injor/9813f885474051ad4f11e4fbd33b0f8c59835cdc/SkinTest/.gradle/2.8/taskArtifacts/taskArtifacts.bin
--------------------------------------------------------------------------------
/SkinTest/.idea/.name:
--------------------------------------------------------------------------------
1 | SkinTest
--------------------------------------------------------------------------------
/SkinTest/.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 |
--------------------------------------------------------------------------------
/SkinTest/.idea/copyright/profiles_settings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/SkinTest/.idea/encodings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/SkinTest/.idea/findbugs-idea.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 |
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 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 |
128 |
129 |
130 |
131 |
132 |
133 |
134 |
135 |
136 |
137 |
138 |
139 |
140 |
141 |
142 |
143 |
144 |
145 |
146 |
147 |
148 |
149 |
150 |
151 |
152 |
153 |
154 |
155 |
156 |
157 |
158 |
159 |
160 |
161 |
162 |
163 |
164 |
165 |
166 |
167 |
168 |
169 |
170 |
171 |
172 |
173 |
174 |
175 |
176 |
177 |
178 |
179 |
180 |
181 |
182 |
183 |
184 |
185 |
186 |
187 |
188 |
189 |
190 |
191 |
192 |
193 |
194 |
195 |
196 |
197 |
198 |
199 |
200 |
201 |
202 |
203 |
204 |
205 |
206 |
207 |
208 |
209 |
210 |
211 |
212 |
213 |
214 |
215 |
216 |
217 |
218 |
219 |
220 |
221 |
222 |
223 |
224 |
225 |
226 |
--------------------------------------------------------------------------------
/SkinTest/.idea/gradle.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/SkinTest/.idea/libraries/injor.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/SkinTest/.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 |
47 |
48 |
49 |
--------------------------------------------------------------------------------
/SkinTest/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/SkinTest/.idea/runConfigurations.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/SkinTest/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/SkinTest/.project:
--------------------------------------------------------------------------------
1 |
2 |
3 | SkinTest
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 |
--------------------------------------------------------------------------------
/SkinTest/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
10 |
11 |
12 |
13 |
19 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
31 |
32 |
33 |
--------------------------------------------------------------------------------
/SkinTest/SkinTest.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 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 |
128 |
129 |
130 |
131 |
132 |
133 |
134 |
135 |
136 |
137 |
138 |
139 |
140 |
141 |
142 |
143 |
144 |
145 |
146 |
147 |
148 |
149 |
150 |
151 |
152 |
153 |
154 |
155 |
156 |
157 |
158 |
159 |
160 |
161 |
162 |
163 |
164 |
165 |
166 |
167 |
168 |
169 |
170 |
171 |
172 |
173 |
174 |
175 |
176 |
177 |
178 |
179 |
180 |
181 |
182 |
183 |
184 |
185 |
186 |
187 |
188 |
189 |
190 |
191 |
192 |
193 |
194 |
195 |
196 |
197 |
198 |
199 |
200 |
201 |
202 |
203 |
204 |
205 |
206 |
207 |
208 |
209 |
210 |
211 |
212 |
213 |
214 |
215 |
216 |
217 |
218 |
219 |
220 |
221 |
222 |
223 |
224 |
225 |
226 |
227 |
228 |
229 |
230 |
231 |
232 |
233 |
234 |
235 |
236 |
237 |
238 |
239 |
240 |
241 |
242 |
243 |
244 |
245 |
246 |
247 |
248 |
249 |
250 |
251 |
252 |
253 |
254 |
255 |
256 |
257 |
258 |
259 |
260 |
261 |
262 |
263 |
264 |
265 |
266 |
267 |
268 |
269 |
270 |
271 |
272 |
273 |
274 |
275 |
276 |
277 |
278 |
279 |
280 |
281 |
282 |
283 |
284 |
285 |
286 |
287 |
288 |
289 |
290 |
291 |
292 |
--------------------------------------------------------------------------------
/SkinTest/assets/fonts/custom_font.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hackware1993/injor/9813f885474051ad4f11e4fbd33b0f8c59835cdc/SkinTest/assets/fonts/custom_font.ttf
--------------------------------------------------------------------------------
/SkinTest/assets/fonts/custom_font_dark.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hackware1993/injor/9813f885474051ad4f11e4fbd33b0f8c59835cdc/SkinTest/assets/fonts/custom_font_dark.ttf
--------------------------------------------------------------------------------
/SkinTest/bin/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
10 |
11 |
12 |
13 |
19 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
31 |
32 |
33 |
--------------------------------------------------------------------------------
/SkinTest/bin/SkinTest.apk:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hackware1993/injor/9813f885474051ad4f11e4fbd33b0f8c59835cdc/SkinTest/bin/SkinTest.apk
--------------------------------------------------------------------------------
/SkinTest/bin/classes.dex:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hackware1993/injor/9813f885474051ad4f11e4fbd33b0f8c59835cdc/SkinTest/bin/classes.dex
--------------------------------------------------------------------------------
/SkinTest/bin/classes/com/iflytek/main/BrightnessProcessor$1.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hackware1993/injor/9813f885474051ad4f11e4fbd33b0f8c59835cdc/SkinTest/bin/classes/com/iflytek/main/BrightnessProcessor$1.class
--------------------------------------------------------------------------------
/SkinTest/bin/classes/com/iflytek/main/BrightnessProcessor.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hackware1993/injor/9813f885474051ad4f11e4fbd33b0f8c59835cdc/SkinTest/bin/classes/com/iflytek/main/BrightnessProcessor.class
--------------------------------------------------------------------------------
/SkinTest/bin/classes/com/iflytek/main/Home$1.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hackware1993/injor/9813f885474051ad4f11e4fbd33b0f8c59835cdc/SkinTest/bin/classes/com/iflytek/main/Home$1.class
--------------------------------------------------------------------------------
/SkinTest/bin/classes/com/iflytek/main/Home.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hackware1993/injor/9813f885474051ad4f11e4fbd33b0f8c59835cdc/SkinTest/bin/classes/com/iflytek/main/Home.class
--------------------------------------------------------------------------------
/SkinTest/bin/classes/com/iflytek/main/SettingActivity$1.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hackware1993/injor/9813f885474051ad4f11e4fbd33b0f8c59835cdc/SkinTest/bin/classes/com/iflytek/main/SettingActivity$1.class
--------------------------------------------------------------------------------
/SkinTest/bin/classes/com/iflytek/main/SettingActivity.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hackware1993/injor/9813f885474051ad4f11e4fbd33b0f8c59835cdc/SkinTest/bin/classes/com/iflytek/main/SettingActivity.class
--------------------------------------------------------------------------------
/SkinTest/bin/classes/com/iflytek/main/SkinApplication.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hackware1993/injor/9813f885474051ad4f11e4fbd33b0f8c59835cdc/SkinTest/bin/classes/com/iflytek/main/SkinApplication.class
--------------------------------------------------------------------------------
/SkinTest/bin/classes/com/iflytek/skintest/BuildConfig.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hackware1993/injor/9813f885474051ad4f11e4fbd33b0f8c59835cdc/SkinTest/bin/classes/com/iflytek/skintest/BuildConfig.class
--------------------------------------------------------------------------------
/SkinTest/bin/classes/com/iflytek/skintest/R$attr.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hackware1993/injor/9813f885474051ad4f11e4fbd33b0f8c59835cdc/SkinTest/bin/classes/com/iflytek/skintest/R$attr.class
--------------------------------------------------------------------------------
/SkinTest/bin/classes/com/iflytek/skintest/R$color.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hackware1993/injor/9813f885474051ad4f11e4fbd33b0f8c59835cdc/SkinTest/bin/classes/com/iflytek/skintest/R$color.class
--------------------------------------------------------------------------------
/SkinTest/bin/classes/com/iflytek/skintest/R$dimen.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hackware1993/injor/9813f885474051ad4f11e4fbd33b0f8c59835cdc/SkinTest/bin/classes/com/iflytek/skintest/R$dimen.class
--------------------------------------------------------------------------------
/SkinTest/bin/classes/com/iflytek/skintest/R$drawable.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hackware1993/injor/9813f885474051ad4f11e4fbd33b0f8c59835cdc/SkinTest/bin/classes/com/iflytek/skintest/R$drawable.class
--------------------------------------------------------------------------------
/SkinTest/bin/classes/com/iflytek/skintest/R$id.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hackware1993/injor/9813f885474051ad4f11e4fbd33b0f8c59835cdc/SkinTest/bin/classes/com/iflytek/skintest/R$id.class
--------------------------------------------------------------------------------
/SkinTest/bin/classes/com/iflytek/skintest/R$integer.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hackware1993/injor/9813f885474051ad4f11e4fbd33b0f8c59835cdc/SkinTest/bin/classes/com/iflytek/skintest/R$integer.class
--------------------------------------------------------------------------------
/SkinTest/bin/classes/com/iflytek/skintest/R$layout.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hackware1993/injor/9813f885474051ad4f11e4fbd33b0f8c59835cdc/SkinTest/bin/classes/com/iflytek/skintest/R$layout.class
--------------------------------------------------------------------------------
/SkinTest/bin/classes/com/iflytek/skintest/R$string.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hackware1993/injor/9813f885474051ad4f11e4fbd33b0f8c59835cdc/SkinTest/bin/classes/com/iflytek/skintest/R$string.class
--------------------------------------------------------------------------------
/SkinTest/bin/classes/com/iflytek/skintest/R$style.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hackware1993/injor/9813f885474051ad4f11e4fbd33b0f8c59835cdc/SkinTest/bin/classes/com/iflytek/skintest/R$style.class
--------------------------------------------------------------------------------
/SkinTest/bin/classes/com/iflytek/skintest/R.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hackware1993/injor/9813f885474051ad4f11e4fbd33b0f8c59835cdc/SkinTest/bin/classes/com/iflytek/skintest/R.class
--------------------------------------------------------------------------------
/SkinTest/bin/dexedLibs/injor-701be309e533d7d1894a201d7265b7ea.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hackware1993/injor/9813f885474051ad4f11e4fbd33b0f8c59835cdc/SkinTest/bin/dexedLibs/injor-701be309e533d7d1894a201d7265b7ea.jar
--------------------------------------------------------------------------------
/SkinTest/bin/jarlist.cache:
--------------------------------------------------------------------------------
1 | # cache for current jar dependency. DO NOT EDIT.
2 | # format is
3 | # Encoding is UTF-8
4 |
--------------------------------------------------------------------------------
/SkinTest/bin/res/crunch/drawable-hdpi/btn_normal.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hackware1993/injor/9813f885474051ad4f11e4fbd33b0f8c59835cdc/SkinTest/bin/res/crunch/drawable-hdpi/btn_normal.9.png
--------------------------------------------------------------------------------
/SkinTest/bin/res/crunch/drawable-hdpi/btn_normal_dark.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hackware1993/injor/9813f885474051ad4f11e4fbd33b0f8c59835cdc/SkinTest/bin/res/crunch/drawable-hdpi/btn_normal_dark.9.png
--------------------------------------------------------------------------------
/SkinTest/bin/res/crunch/drawable-hdpi/btn_pressed.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hackware1993/injor/9813f885474051ad4f11e4fbd33b0f8c59835cdc/SkinTest/bin/res/crunch/drawable-hdpi/btn_pressed.9.png
--------------------------------------------------------------------------------
/SkinTest/bin/res/crunch/drawable-hdpi/btn_pressed_dark.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hackware1993/injor/9813f885474051ad4f11e4fbd33b0f8c59835cdc/SkinTest/bin/res/crunch/drawable-hdpi/btn_pressed_dark.9.png
--------------------------------------------------------------------------------
/SkinTest/bin/res/crunch/drawable-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hackware1993/injor/9813f885474051ad4f11e4fbd33b0f8c59835cdc/SkinTest/bin/res/crunch/drawable-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/SkinTest/bin/res/crunch/drawable-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hackware1993/injor/9813f885474051ad4f11e4fbd33b0f8c59835cdc/SkinTest/bin/res/crunch/drawable-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/SkinTest/bin/res/crunch/drawable-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hackware1993/injor/9813f885474051ad4f11e4fbd33b0f8c59835cdc/SkinTest/bin/res/crunch/drawable-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/SkinTest/bin/res/crunch/drawable-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hackware1993/injor/9813f885474051ad4f11e4fbd33b0f8c59835cdc/SkinTest/bin/res/crunch/drawable-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/SkinTest/bin/resources.ap_:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hackware1993/injor/9813f885474051ad4f11e4fbd33b0f8c59835cdc/SkinTest/bin/resources.ap_
--------------------------------------------------------------------------------
/SkinTest/build.gradle:
--------------------------------------------------------------------------------
1 | buildscript {
2 | repositories {
3 | jcenter()
4 | }
5 | dependencies {
6 | classpath 'com.android.tools.build:gradle:2.0.0-alpha3'
7 | }
8 | }
9 | apply plugin: 'com.android.application'
10 |
11 | dependencies {
12 | compile fileTree(dir: 'libs', include: '*.jar')
13 | }
14 |
15 | android {
16 | compileSdkVersion 23
17 | buildToolsVersion "23.0.2"
18 |
19 | compileOptions {
20 | sourceCompatibility JavaVersion.VERSION_1_7
21 | targetCompatibility JavaVersion.VERSION_1_7
22 | }
23 |
24 | sourceSets {
25 | main {
26 | manifest.srcFile 'AndroidManifest.xml'
27 | java.srcDirs = ['src']
28 | resources.srcDirs = ['src']
29 | aidl.srcDirs = ['src']
30 | renderscript.srcDirs = ['src']
31 | res.srcDirs = ['res']
32 | assets.srcDirs = ['assets']
33 | }
34 |
35 | // Move the tests to tests/java, tests/res, etc...
36 | instrumentTest.setRoot('tests')
37 |
38 | // Move the build types to build-types/
39 | // For instance, build-types/debug/java, build-types/debug/AndroidManifest.xml, ...
40 | // This moves them out of them default location under src//... which would
41 | // conflict with src/ being used by the main source set.
42 | // Adding new build types or product flavors should be accompanied
43 | // by a similar customization.
44 | debug.setRoot('build-types/debug')
45 | release.setRoot('build-types/release')
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/SkinTest/build/generated/source/buildConfig/androidTest/debug/com/iflytek/skintest/test/BuildConfig.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Automatically generated file. DO NOT MODIFY
3 | */
4 | package com.iflytek.skintest.test;
5 |
6 | public final class BuildConfig {
7 | public static final boolean DEBUG = Boolean.parseBoolean("true");
8 | public static final String APPLICATION_ID = "com.iflytek.skintest.test";
9 | public static final String BUILD_TYPE = "debug";
10 | public static final String FLAVOR = "";
11 | public static final int VERSION_CODE = -1;
12 | public static final String VERSION_NAME = "";
13 | }
14 |
--------------------------------------------------------------------------------
/SkinTest/build/generated/source/buildConfig/debug/com/iflytek/skintest/BuildConfig.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Automatically generated file. DO NOT MODIFY
3 | */
4 | package com.iflytek.skintest;
5 |
6 | public final class BuildConfig {
7 | public static final boolean DEBUG = Boolean.parseBoolean("true");
8 | public static final String APPLICATION_ID = "com.iflytek.skintest";
9 | public static final String BUILD_TYPE = "debug";
10 | public static final String FLAVOR = "";
11 | public static final int VERSION_CODE = 1;
12 | public static final String VERSION_NAME = "1.0";
13 | }
14 |
--------------------------------------------------------------------------------
/SkinTest/build/generated/source/r/debug/com/iflytek/skintest/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.iflytek.skintest;
9 |
10 | public final class R {
11 | public static final class attr {
12 | }
13 | public static final class color {
14 | public static final int background=0x7f040000;
15 | public static final int background_dark=0x7f040001;
16 | public static final int btn_color=0x7f040003;
17 | public static final int btn_color_dark=0x7f040004;
18 | public static final int window_background=0x7f040002;
19 | }
20 | public static final class dimen {
21 | public static final int font_size=0x7f050000;
22 | public static final int font_size_dark=0x7f050001;
23 | public static final int font_size_large=0x7f050002;
24 | public static final int font_size_large_dark=0x7f050003;
25 | }
26 | public static final class drawable {
27 | public static final int btn_background=0x7f020000;
28 | public static final int btn_background_dark=0x7f020001;
29 | public static final int btn_normal=0x7f020002;
30 | public static final int btn_normal_dark=0x7f020003;
31 | public static final int btn_pressed=0x7f020004;
32 | public static final int btn_pressed_dark=0x7f020005;
33 | public static final int ic_launcher=0x7f020006;
34 | }
35 | public static final class id {
36 | public static final int button_num_edit=0x7f090007;
37 | public static final int button_num_setting=0x7f090008;
38 | public static final int enable_async_load_skin=0x7f090005;
39 | public static final int feature_area=0x7f090006;
40 | public static final int load_dark_skin=0x7f090002;
41 | public static final int load_plugin_skin=0x7f090003;
42 | public static final int load_white_skin=0x7f090001;
43 | public static final int root=0x7f090000;
44 | public static final int start_new_activity=0x7f090004;
45 | }
46 | public static final class integer {
47 | public static final int brightness_dark=0x7f060000;
48 | }
49 | public static final class layout {
50 | public static final int activity_home=0x7f030000;
51 | public static final int activity_setting=0x7f030001;
52 | }
53 | public static final class string {
54 | public static final int app_name=0x7f070000;
55 | public static final int button_num_setting=0x7f070001;
56 | public static final int changing_skin=0x7f070002;
57 | public static final int disable_async_load_skin=0x7f070003;
58 | public static final int disabled_feature=0x7f070004;
59 | public static final int dynamic_button=0x7f070005;
60 | public static final int enable_async_load_skin=0x7f070006;
61 | public static final int enabled_feature=0x7f070007;
62 | public static final int feature_hint=0x7f070008;
63 | public static final int load_dark_skin=0x7f070009;
64 | public static final int load_dark_skin_dark=0x7f07000a;
65 | public static final int load_default_skin=0x7f07000b;
66 | public static final int load_plugin_skin=0x7f07000c;
67 | public static final int load_plugin_skin_dark=0x7f07000d;
68 | public static final int load_white_skin=0x7f07000e;
69 | public static final int load_white_skin_dark=0x7f07000f;
70 | public static final int performance_test_hint=0x7f070010;
71 | public static final int skin_configuration=0x7f070011;
72 | public static final int time_usage=0x7f070012;
73 | public static final int title_activity_home=0x7f070013;
74 | public static final int title_activity_setting=0x7f070014;
75 | }
76 | public static final class style {
77 | public static final int CustomTheme=0x7f080000;
78 | }
79 | }
80 |
--------------------------------------------------------------------------------
/SkinTest/build/intermediates/assets/debug/fonts/custom_font.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hackware1993/injor/9813f885474051ad4f11e4fbd33b0f8c59835cdc/SkinTest/build/intermediates/assets/debug/fonts/custom_font.ttf
--------------------------------------------------------------------------------
/SkinTest/build/intermediates/assets/debug/fonts/custom_font_dark.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hackware1993/injor/9813f885474051ad4f11e4fbd33b0f8c59835cdc/SkinTest/build/intermediates/assets/debug/fonts/custom_font_dark.ttf
--------------------------------------------------------------------------------
/SkinTest/build/intermediates/blame/res/debug/single/color.json:
--------------------------------------------------------------------------------
1 | [
2 | {
3 | "merged": "G:\\code\\trunk\\SkinTest\\build\\intermediates\\res\\merged\\debug\\color\\btn_color_dark.xml",
4 | "source": "G:\\code\\trunk\\SkinTest\\res\\color\\btn_color_dark.xml"
5 | },
6 | {
7 | "merged": "G:\\code\\trunk\\SkinTest\\build\\intermediates\\res\\merged\\debug\\color\\btn_color.xml",
8 | "source": "G:\\code\\trunk\\SkinTest\\res\\color\\btn_color.xml"
9 | }
10 | ]
--------------------------------------------------------------------------------
/SkinTest/build/intermediates/blame/res/debug/single/drawable-hdpi-v4.json:
--------------------------------------------------------------------------------
1 | [
2 | {
3 | "merged": "G:\\code\\trunk\\SkinTest\\build\\intermediates\\res\\merged\\debug\\drawable-hdpi-v4\\btn_pressed.9.png",
4 | "source": "G:\\code\\trunk\\SkinTest\\res\\drawable-hdpi\\btn_pressed.9.png"
5 | },
6 | {
7 | "merged": "G:\\code\\trunk\\SkinTest\\build\\intermediates\\res\\merged\\debug\\drawable-hdpi-v4\\btn_normal_dark.9.png",
8 | "source": "G:\\code\\trunk\\SkinTest\\res\\drawable-hdpi\\btn_normal_dark.9.png"
9 | },
10 | {
11 | "merged": "G:\\code\\trunk\\SkinTest\\build\\intermediates\\res\\merged\\debug\\drawable-hdpi-v4\\ic_launcher.png",
12 | "source": "G:\\code\\trunk\\SkinTest\\res\\drawable-hdpi\\ic_launcher.png"
13 | },
14 | {
15 | "merged": "G:\\code\\trunk\\SkinTest\\build\\intermediates\\res\\merged\\debug\\drawable-hdpi-v4\\btn_pressed_dark.9.png",
16 | "source": "G:\\code\\trunk\\SkinTest\\res\\drawable-hdpi\\btn_pressed_dark.9.png"
17 | },
18 | {
19 | "merged": "G:\\code\\trunk\\SkinTest\\build\\intermediates\\res\\merged\\debug\\drawable-hdpi-v4\\btn_normal.9.png",
20 | "source": "G:\\code\\trunk\\SkinTest\\res\\drawable-hdpi\\btn_normal.9.png"
21 | }
22 | ]
--------------------------------------------------------------------------------
/SkinTest/build/intermediates/blame/res/debug/single/drawable-mdpi-v4.json:
--------------------------------------------------------------------------------
1 | [
2 | {
3 | "merged": "G:\\code\\trunk\\SkinTest\\build\\intermediates\\res\\merged\\debug\\drawable-mdpi-v4\\ic_launcher.png",
4 | "source": "G:\\code\\trunk\\SkinTest\\res\\drawable-mdpi\\ic_launcher.png"
5 | }
6 | ]
--------------------------------------------------------------------------------
/SkinTest/build/intermediates/blame/res/debug/single/drawable-xhdpi-v4.json:
--------------------------------------------------------------------------------
1 | [
2 | {
3 | "merged": "G:\\code\\trunk\\SkinTest\\build\\intermediates\\res\\merged\\debug\\drawable-xhdpi-v4\\ic_launcher.png",
4 | "source": "G:\\code\\trunk\\SkinTest\\res\\drawable-xhdpi\\ic_launcher.png"
5 | }
6 | ]
--------------------------------------------------------------------------------
/SkinTest/build/intermediates/blame/res/debug/single/drawable-xxhdpi-v4.json:
--------------------------------------------------------------------------------
1 | [
2 | {
3 | "merged": "G:\\code\\trunk\\SkinTest\\build\\intermediates\\res\\merged\\debug\\drawable-xxhdpi-v4\\ic_launcher.png",
4 | "source": "G:\\code\\trunk\\SkinTest\\res\\drawable-xxhdpi\\ic_launcher.png"
5 | }
6 | ]
--------------------------------------------------------------------------------
/SkinTest/build/intermediates/blame/res/debug/single/drawable.json:
--------------------------------------------------------------------------------
1 | [
2 | {
3 | "merged": "G:\\code\\trunk\\SkinTest\\build\\intermediates\\res\\merged\\debug\\drawable\\btn_background_dark.xml",
4 | "source": "G:\\code\\trunk\\SkinTest\\res\\drawable\\btn_background_dark.xml"
5 | },
6 | {
7 | "merged": "G:\\code\\trunk\\SkinTest\\build\\intermediates\\res\\merged\\debug\\drawable\\btn_background.xml",
8 | "source": "G:\\code\\trunk\\SkinTest\\res\\drawable\\btn_background.xml"
9 | }
10 | ]
--------------------------------------------------------------------------------
/SkinTest/build/intermediates/blame/res/debug/single/layout.json:
--------------------------------------------------------------------------------
1 | [
2 | {
3 | "merged": "G:\\code\\trunk\\SkinTest\\build\\intermediates\\res\\merged\\debug\\layout\\activity_setting.xml",
4 | "source": "G:\\code\\trunk\\SkinTest\\res\\layout\\activity_setting.xml"
5 | },
6 | {
7 | "merged": "G:\\code\\trunk\\SkinTest\\build\\intermediates\\res\\merged\\debug\\layout\\activity_home.xml",
8 | "source": "G:\\code\\trunk\\SkinTest\\res\\layout\\activity_home.xml"
9 | }
10 | ]
--------------------------------------------------------------------------------
/SkinTest/build/intermediates/incremental/compileDebugAidl/dependency.store:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/SkinTest/build/intermediates/incremental/compileDebugAndroidTestAidl/dependency.store:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/SkinTest/build/intermediates/incremental/mergeDebugAndroidTestAssets/merger.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/SkinTest/build/intermediates/incremental/mergeDebugAndroidTestResources/merger.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/SkinTest/build/intermediates/incremental/mergeDebugAssets/merger.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/SkinTest/build/intermediates/incremental/mergeDebugResources/merger.xml:
--------------------------------------------------------------------------------
1 |
2 | #000000 #00000000 #ffffff 6dp 5dp 3dp 4dp 0 夜晚模式(当前) 耗时: 皮肤测试 设置 皮肤框架配置 加载皮肤插件 已禁用 皮肤测试 已启用皮肤异步加载 动态按钮 已启用 切换到夜晚模式(内置) 功能特性(建议更改后重启) 已禁用皮肤异步加载 恢复默认 设置 加载皮肤插件 切换到白天模式(内置) 正在切换 动态按钮数量,用于性能测试(重启后生效) 白天模式(当前)
--------------------------------------------------------------------------------
/SkinTest/build/intermediates/manifest/androidTest/debug/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
16 |
17 |
--------------------------------------------------------------------------------
/SkinTest/build/intermediates/manifests/full/debug/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
10 |
11 |
12 |
13 |
19 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
31 |
32 |
33 |
--------------------------------------------------------------------------------
/SkinTest/build/intermediates/res/merged/debug/color/btn_color.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/SkinTest/build/intermediates/res/merged/debug/color/btn_color_dark.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/SkinTest/build/intermediates/res/merged/debug/drawable-hdpi-v4/btn_normal.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hackware1993/injor/9813f885474051ad4f11e4fbd33b0f8c59835cdc/SkinTest/build/intermediates/res/merged/debug/drawable-hdpi-v4/btn_normal.9.png
--------------------------------------------------------------------------------
/SkinTest/build/intermediates/res/merged/debug/drawable-hdpi-v4/btn_normal_dark.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hackware1993/injor/9813f885474051ad4f11e4fbd33b0f8c59835cdc/SkinTest/build/intermediates/res/merged/debug/drawable-hdpi-v4/btn_normal_dark.9.png
--------------------------------------------------------------------------------
/SkinTest/build/intermediates/res/merged/debug/drawable-hdpi-v4/btn_pressed.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hackware1993/injor/9813f885474051ad4f11e4fbd33b0f8c59835cdc/SkinTest/build/intermediates/res/merged/debug/drawable-hdpi-v4/btn_pressed.9.png
--------------------------------------------------------------------------------
/SkinTest/build/intermediates/res/merged/debug/drawable-hdpi-v4/btn_pressed_dark.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hackware1993/injor/9813f885474051ad4f11e4fbd33b0f8c59835cdc/SkinTest/build/intermediates/res/merged/debug/drawable-hdpi-v4/btn_pressed_dark.9.png
--------------------------------------------------------------------------------
/SkinTest/build/intermediates/res/merged/debug/drawable-hdpi-v4/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hackware1993/injor/9813f885474051ad4f11e4fbd33b0f8c59835cdc/SkinTest/build/intermediates/res/merged/debug/drawable-hdpi-v4/ic_launcher.png
--------------------------------------------------------------------------------
/SkinTest/build/intermediates/res/merged/debug/drawable-mdpi-v4/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hackware1993/injor/9813f885474051ad4f11e4fbd33b0f8c59835cdc/SkinTest/build/intermediates/res/merged/debug/drawable-mdpi-v4/ic_launcher.png
--------------------------------------------------------------------------------
/SkinTest/build/intermediates/res/merged/debug/drawable-xhdpi-v4/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hackware1993/injor/9813f885474051ad4f11e4fbd33b0f8c59835cdc/SkinTest/build/intermediates/res/merged/debug/drawable-xhdpi-v4/ic_launcher.png
--------------------------------------------------------------------------------
/SkinTest/build/intermediates/res/merged/debug/drawable-xxhdpi-v4/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hackware1993/injor/9813f885474051ad4f11e4fbd33b0f8c59835cdc/SkinTest/build/intermediates/res/merged/debug/drawable-xxhdpi-v4/ic_launcher.png
--------------------------------------------------------------------------------
/SkinTest/build/intermediates/res/merged/debug/drawable/btn_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/SkinTest/build/intermediates/res/merged/debug/drawable/btn_background_dark.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/SkinTest/build/intermediates/res/merged/debug/layout/activity_home.xml:
--------------------------------------------------------------------------------
1 |
7 |
8 |
16 |
17 |
24 |
25 |
32 |
33 |
40 |
41 |
49 |
50 |
51 |
--------------------------------------------------------------------------------
/SkinTest/build/intermediates/res/merged/debug/layout/activity_setting.xml:
--------------------------------------------------------------------------------
1 |
7 |
8 |
16 |
17 |
24 |
25 |
32 |
33 |
39 |
40 |
47 |
48 |
53 |
54 |
55 |
61 |
62 |
65 |
66 |
74 |
75 |
82 |
83 |
84 |
85 |
--------------------------------------------------------------------------------
/SkinTest/build/intermediates/res/merged/debug/values/values.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #ffffff
4 | #000000
5 | #00000000
6 | 5dp
7 | 3dp
8 | 4dp
9 | 6dp
10 | 0
11 | 皮肤测试
12 | 设置
13 | 正在切换
14 | 已禁用皮肤异步加载
15 | 已禁用
16 | 动态按钮
17 | 已启用皮肤异步加载
18 | 已启用
19 | 功能特性(建议更改后重启)
20 | 切换到夜晚模式(内置)
21 | 夜晚模式(当前)
22 | 恢复默认
23 | 加载皮肤插件
24 | 加载皮肤插件
25 | 白天模式(当前)
26 | 切换到白天模式(内置)
27 | 动态按钮数量,用于性能测试(重启后生效)
28 | 皮肤框架配置
29 | 耗时:
30 | 皮肤测试
31 | 设置
32 |
35 |
--------------------------------------------------------------------------------
/SkinTest/build/intermediates/res/resources-debug-androidTest.ap_:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hackware1993/injor/9813f885474051ad4f11e4fbd33b0f8c59835cdc/SkinTest/build/intermediates/res/resources-debug-androidTest.ap_
--------------------------------------------------------------------------------
/SkinTest/build/intermediates/res/resources-debug.ap_:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hackware1993/injor/9813f885474051ad4f11e4fbd33b0f8c59835cdc/SkinTest/build/intermediates/res/resources-debug.ap_
--------------------------------------------------------------------------------
/SkinTest/build/outputs/logs/manifest-merger-debug-report.txt:
--------------------------------------------------------------------------------
1 | -- Merging decision tree log ---
2 | manifest
3 | ADDED from G:\code\trunk\SkinTest\AndroidManifest.xml:2:1-33:12
4 | package
5 | ADDED from G:\code\trunk\SkinTest\AndroidManifest.xml:3:5-35
6 | android:versionName
7 | ADDED from G:\code\trunk\SkinTest\AndroidManifest.xml:5:5-30
8 | INJECTED from G:\code\trunk\SkinTest\AndroidManifest.xml
9 | INJECTED from G:\code\trunk\SkinTest\AndroidManifest.xml
10 | android:versionCode
11 | ADDED from G:\code\trunk\SkinTest\AndroidManifest.xml:4:5-28
12 | INJECTED from G:\code\trunk\SkinTest\AndroidManifest.xml
13 | INJECTED from G:\code\trunk\SkinTest\AndroidManifest.xml
14 | xmlns:android
15 | ADDED from G:\code\trunk\SkinTest\AndroidManifest.xml:2:11-69
16 | uses-sdk
17 | ADDED from G:\code\trunk\SkinTest\AndroidManifest.xml:7:5-9:41
18 | android:targetSdkVersion
19 | ADDED from G:\code\trunk\SkinTest\AndroidManifest.xml:9:9-38
20 | android:minSdkVersion
21 | ADDED from G:\code\trunk\SkinTest\AndroidManifest.xml:8:9-35
22 | uses-permission#android.permission.WRITE_EXTERNAL_STORAGE
23 | ADDED from G:\code\trunk\SkinTest\AndroidManifest.xml:11:5-81
24 | android:name
25 | ADDED from G:\code\trunk\SkinTest\AndroidManifest.xml:11:22-78
26 | application
27 | ADDED from G:\code\trunk\SkinTest\AndroidManifest.xml:13:5-31:19
28 | android:label
29 | ADDED from G:\code\trunk\SkinTest\AndroidManifest.xml:17:9-41
30 | android:allowBackup
31 | ADDED from G:\code\trunk\SkinTest\AndroidManifest.xml:15:9-35
32 | android:icon
33 | ADDED from G:\code\trunk\SkinTest\AndroidManifest.xml:16:9-45
34 | android:theme
35 | ADDED from G:\code\trunk\SkinTest\AndroidManifest.xml:18:9-43
36 | android:name
37 | ADDED from G:\code\trunk\SkinTest\AndroidManifest.xml:14:9-56
38 | activity#com.iflytek.main.Home
39 | ADDED from G:\code\trunk\SkinTest\AndroidManifest.xml:19:9-27:20
40 | android:label
41 | ADDED from G:\code\trunk\SkinTest\AndroidManifest.xml:21:13-56
42 | android:name
43 | ADDED from G:\code\trunk\SkinTest\AndroidManifest.xml:20:13-49
44 | intent-filter#android.intent.action.MAIN+android.intent.category.LAUNCHER
45 | ADDED from G:\code\trunk\SkinTest\AndroidManifest.xml:22:13-26:29
46 | action#android.intent.action.MAIN
47 | ADDED from G:\code\trunk\SkinTest\AndroidManifest.xml:23:17-69
48 | android:name
49 | ADDED from G:\code\trunk\SkinTest\AndroidManifest.xml:23:25-66
50 | category#android.intent.category.LAUNCHER
51 | ADDED from G:\code\trunk\SkinTest\AndroidManifest.xml:25:17-77
52 | android:name
53 | ADDED from G:\code\trunk\SkinTest\AndroidManifest.xml:25:27-74
54 | activity#com.iflytek.main.SettingActivity
55 | ADDED from G:\code\trunk\SkinTest\AndroidManifest.xml:28:9-30:71
56 | android:label
57 | ADDED from G:\code\trunk\SkinTest\AndroidManifest.xml:30:13-59
58 | android:name
59 | ADDED from G:\code\trunk\SkinTest\AndroidManifest.xml:29:13-60
60 |
--------------------------------------------------------------------------------
/SkinTest/gen/com/iflytek/skintest/BuildConfig.java:
--------------------------------------------------------------------------------
1 | /** Automatically generated file. DO NOT MODIFY */
2 | package com.iflytek.skintest;
3 |
4 | public final class BuildConfig {
5 | public final static boolean DEBUG = true;
6 | }
--------------------------------------------------------------------------------
/SkinTest/gen/com/iflytek/skintest/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.iflytek.skintest;
9 |
10 | public final class R {
11 | public static final class attr {
12 | }
13 | public static final class color {
14 | public static final int background=0x7f040001;
15 | public static final int background_dark=0x7f040002;
16 | public static final int btn_color=0x7f040003;
17 | public static final int btn_color_dark=0x7f040004;
18 | public static final int window_background=0x7f040000;
19 | }
20 | public static final class dimen {
21 | public static final int font_size=0x7f050000;
22 | public static final int font_size_dark=0x7f050001;
23 | public static final int font_size_large=0x7f050002;
24 | public static final int font_size_large_dark=0x7f050003;
25 | }
26 | public static final class drawable {
27 | public static final int btn_background=0x7f020000;
28 | public static final int btn_background_dark=0x7f020001;
29 | public static final int btn_normal=0x7f020002;
30 | public static final int btn_normal_dark=0x7f020003;
31 | public static final int btn_pressed=0x7f020004;
32 | public static final int btn_pressed_dark=0x7f020005;
33 | public static final int ic_launcher=0x7f020006;
34 | }
35 | public static final class id {
36 | public static final int button_num_edit=0x7f090007;
37 | public static final int button_num_setting=0x7f090008;
38 | public static final int enable_async_load_skin=0x7f090005;
39 | public static final int feature_area=0x7f090006;
40 | public static final int load_dark_skin=0x7f090002;
41 | public static final int load_plugin_skin=0x7f090003;
42 | public static final int load_white_skin=0x7f090001;
43 | public static final int root=0x7f090000;
44 | public static final int start_new_activity=0x7f090004;
45 | }
46 | public static final class integer {
47 | public static final int brightness_dark=0x7f060000;
48 | }
49 | public static final class layout {
50 | public static final int activity_home=0x7f030000;
51 | public static final int activity_setting=0x7f030001;
52 | }
53 | public static final class string {
54 | public static final int app_name=0x7f070000;
55 | public static final int button_num_setting=0x7f07000d;
56 | public static final int changing_skin=0x7f07000e;
57 | public static final int disable_async_load_skin=0x7f07000b;
58 | public static final int disabled_feature=0x7f070013;
59 | public static final int dynamic_button=0x7f07000f;
60 | public static final int enable_async_load_skin=0x7f07000a;
61 | public static final int enabled_feature=0x7f070012;
62 | public static final int feature_hint=0x7f070010;
63 | public static final int load_dark_skin=0x7f070004;
64 | public static final int load_dark_skin_dark=0x7f070005;
65 | public static final int load_default_skin=0x7f070006;
66 | public static final int load_plugin_skin=0x7f070007;
67 | public static final int load_plugin_skin_dark=0x7f070008;
68 | public static final int load_white_skin=0x7f070002;
69 | public static final int load_white_skin_dark=0x7f070003;
70 | public static final int performance_test_hint=0x7f070011;
71 | public static final int skin_configuration=0x7f070009;
72 | public static final int time_usage=0x7f070014;
73 | public static final int title_activity_home=0x7f070001;
74 | public static final int title_activity_setting=0x7f07000c;
75 | }
76 | public static final class style {
77 | public static final int CustomTheme=0x7f080000;
78 | }
79 | }
80 |
--------------------------------------------------------------------------------
/SkinTest/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 | #Wed Dec 23 09:10:54 CST 2015
16 | systemProp.https.proxyPort=1080
17 | systemProp.http.proxyHost=127.0.0.1
18 | systemProp.https.proxyHost=127.0.0.1
19 | systemProp.http.proxyPort=1080
20 |
--------------------------------------------------------------------------------
/SkinTest/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hackware1993/injor/9813f885474051ad4f11e4fbd33b0f8c59835cdc/SkinTest/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/SkinTest/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Wed Dec 23 09:11:41 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.8-all.zip
7 |
--------------------------------------------------------------------------------
/SkinTest/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 |
--------------------------------------------------------------------------------
/SkinTest/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 |
--------------------------------------------------------------------------------
/SkinTest/ic_launcher-web.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hackware1993/injor/9813f885474051ad4f11e4fbd33b0f8c59835cdc/SkinTest/ic_launcher-web.png
--------------------------------------------------------------------------------
/SkinTest/libs/injor.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hackware1993/injor/9813f885474051ad4f11e4fbd33b0f8c59835cdc/SkinTest/libs/injor.jar
--------------------------------------------------------------------------------
/SkinTest/local.properties:
--------------------------------------------------------------------------------
1 | ## This file is automatically generated by Android Studio.
2 | # Do not modify this file -- YOUR CHANGES WILL BE ERASED!
3 | #
4 | # This file must *NOT* be checked into Version Control Systems,
5 | # as it contains information specific to your local configuration.
6 | #
7 | # Location of the SDK. This is only used by Gradle.
8 | # For customization when using a Version Control System, please read the
9 | # header note.
10 | #Wed Dec 23 09:10:50 CST 2015
11 | sdk.dir=G\:\\Android\\sdk
12 |
--------------------------------------------------------------------------------
/SkinTest/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 |
--------------------------------------------------------------------------------
/SkinTest/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-23
15 |
--------------------------------------------------------------------------------
/SkinTest/res/color/btn_color.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/SkinTest/res/color/btn_color_dark.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/SkinTest/res/drawable-hdpi/btn_normal.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hackware1993/injor/9813f885474051ad4f11e4fbd33b0f8c59835cdc/SkinTest/res/drawable-hdpi/btn_normal.9.png
--------------------------------------------------------------------------------
/SkinTest/res/drawable-hdpi/btn_normal_dark.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hackware1993/injor/9813f885474051ad4f11e4fbd33b0f8c59835cdc/SkinTest/res/drawable-hdpi/btn_normal_dark.9.png
--------------------------------------------------------------------------------
/SkinTest/res/drawable-hdpi/btn_pressed.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hackware1993/injor/9813f885474051ad4f11e4fbd33b0f8c59835cdc/SkinTest/res/drawable-hdpi/btn_pressed.9.png
--------------------------------------------------------------------------------
/SkinTest/res/drawable-hdpi/btn_pressed_dark.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hackware1993/injor/9813f885474051ad4f11e4fbd33b0f8c59835cdc/SkinTest/res/drawable-hdpi/btn_pressed_dark.9.png
--------------------------------------------------------------------------------
/SkinTest/res/drawable-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hackware1993/injor/9813f885474051ad4f11e4fbd33b0f8c59835cdc/SkinTest/res/drawable-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/SkinTest/res/drawable-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hackware1993/injor/9813f885474051ad4f11e4fbd33b0f8c59835cdc/SkinTest/res/drawable-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/SkinTest/res/drawable-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hackware1993/injor/9813f885474051ad4f11e4fbd33b0f8c59835cdc/SkinTest/res/drawable-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/SkinTest/res/drawable-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hackware1993/injor/9813f885474051ad4f11e4fbd33b0f8c59835cdc/SkinTest/res/drawable-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/SkinTest/res/drawable/btn_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/SkinTest/res/drawable/btn_background_dark.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/SkinTest/res/layout/activity_home.xml:
--------------------------------------------------------------------------------
1 |
7 |
8 |
16 |
17 |
24 |
25 |
32 |
33 |
40 |
41 |
49 |
50 |
51 |
--------------------------------------------------------------------------------
/SkinTest/res/layout/activity_setting.xml:
--------------------------------------------------------------------------------
1 |
7 |
8 |
16 |
17 |
24 |
25 |
32 |
33 |
39 |
40 |
47 |
48 |
53 |
54 |
55 |
61 |
62 |
65 |
66 |
74 |
75 |
82 |
83 |
84 |
85 |
--------------------------------------------------------------------------------
/SkinTest/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | #00000000
5 | #ffffff
6 | #000000
7 |
8 |
--------------------------------------------------------------------------------
/SkinTest/res/values/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 5dp
5 | 3dp
6 | 4dp
7 | 6dp
8 |
9 |
--------------------------------------------------------------------------------
/SkinTest/res/values/integers.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 0
5 |
6 |
--------------------------------------------------------------------------------
/SkinTest/res/values/strings.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 |
--------------------------------------------------------------------------------
/SkinTest/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
7 |
8 |
--------------------------------------------------------------------------------
/SkinTest/src/com/iflytek/main/BrightnessProcessor.java:
--------------------------------------------------------------------------------
1 | package com.iflytek.main;
2 |
3 | import android.app.Activity;
4 | import android.content.res.Resources;
5 | import android.view.View;
6 | import android.view.WindowManager.LayoutParams;
7 |
8 | import com.injor.common.ResourceManager;
9 | import com.injor.common.UITaskManager;
10 | import com.injor.processor.ISkinProcessor;
11 |
12 | public class BrightnessProcessor extends ISkinProcessor {
13 | private static final String DEFTYPE_INTEGER = "integer";
14 | public static final String PROCESSOR_BRIGHTNESS = "brightNess";
15 |
16 | @Override
17 | public void process(final Activity activity, View view, String resName, ResourceManager resourceManager, boolean isInUiThread) {
18 | if (activity != null) {
19 | final LayoutParams lp = activity.getWindow().getAttributes();
20 | Resources currentResources = resourceManager.getCurrentResources();
21 | Resources defaultResources = resourceManager.getDefaultResources();
22 | float brightnessValue = -1f;
23 | int id = 0;
24 | try {
25 | id = currentResources.getIdentifier(resourceManager.appendSuffix(resName), DEFTYPE_INTEGER, resourceManager.getCurrentPluginPackageName());
26 | if (id != 0) {
27 | brightnessValue = (float) (currentResources.getInteger(id) / 100.0);
28 | }
29 | } catch (Exception e) {
30 | e.printStackTrace();
31 | if (currentResources != defaultResources) {
32 | id = defaultResources.getIdentifier(resName, DEFTYPE_INTEGER, resourceManager.getDefaultPackageName());
33 | if (id != 0) {
34 | brightnessValue = (float) (defaultResources.getInteger(id) / 100.0);
35 | }
36 | }
37 | }
38 | lp.screenBrightness = brightnessValue;
39 | if (isInUiThread) {
40 | activity.getWindow().setAttributes(lp);
41 | } else {
42 | UITaskManager.getInstance().post(new Runnable() {
43 | @Override
44 | public void run() {
45 | activity.getWindow().setAttributes(lp);
46 | }
47 | });
48 | }
49 | }
50 | }
51 |
52 | @Override
53 | public String getName() {
54 | return PROCESSOR_BRIGHTNESS;
55 | }
56 | }
57 |
--------------------------------------------------------------------------------
/SkinTest/src/com/iflytek/main/Home.java:
--------------------------------------------------------------------------------
1 | package com.iflytek.main;
2 |
3 | import android.app.Activity;
4 | import android.app.ProgressDialog;
5 | import android.content.Intent;
6 | import android.os.Bundle;
7 | import android.os.Environment;
8 | import android.view.View;
9 | import android.widget.Button;
10 | import android.widget.LinearLayout;
11 | import android.widget.LinearLayout.LayoutParams;
12 | import android.widget.Toast;
13 |
14 | import com.iflytek.skintest.R;
15 | import com.injor.callback.ISkinChangingCallback;
16 | import com.injor.common.PrefManager;
17 | import com.injor.main.SkinManager;
18 |
19 | import java.io.File;
20 |
21 | public class Home extends Activity {
22 |
23 | private ISkinChangingCallback skinChangingCallback = new ISkinChangingCallback() {
24 | private ProgressDialog progressDialog;
25 | private long start;
26 |
27 | @Override
28 | public void onStart() {
29 | start = System.currentTimeMillis();
30 | if (progressDialog == null) {
31 | progressDialog = new ProgressDialog(Home.this);
32 | progressDialog.setTitle(getString(R.string.changing_skin));
33 | progressDialog.setCancelable(false);
34 | progressDialog.setCanceledOnTouchOutside(false);
35 | }
36 | progressDialog.show();
37 | }
38 |
39 | @Override
40 | public void onError(Exception e) {
41 | progressDialog.dismiss();
42 | }
43 |
44 | @Override
45 | public void onComplete() {
46 | Toast.makeText(Home.this, getString(R.string.time_usage) + (System.currentTimeMillis() - start) + " ms", Toast.LENGTH_SHORT).show();
47 | progressDialog.dismiss();
48 | }
49 | };
50 |
51 | @Override
52 | protected void onCreate(Bundle savedInstanceState) {
53 | super.onCreate(savedInstanceState);
54 | setContentView(R.layout.activity_home);
55 | SkinManager.getInstance().register(this);
56 | int buttonNum = PrefManager.getInstance(this).getInt(SettingActivity.BUTTON_NUM, 0);
57 | if (buttonNum > 0) {
58 | LinearLayout root = (LinearLayout) findViewById(R.id.root);
59 | int marginTop = dip2px(5);
60 | for (int i = 1; i <= buttonNum; i++) {
61 | Button button = new Button(this);
62 | button.setText(getString(R.string.dynamic_button) + " " + i);
63 | button.setTag("skin:btn_color:textColor|skin:btn_background:background|skin:font_size:textSize|skin:custom_font:typeface");
64 | LayoutParams layoutParams = new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT);
65 | layoutParams.setMargins(0, marginTop, 0, 0);
66 | root.addView(button, layoutParams);
67 | SkinManager.getInstance().injectSkinAsync(button);
68 | }
69 | }
70 | }
71 |
72 | public int dip2px(double dpValue) {
73 | return (int) (dpValue * getResources().getDisplayMetrics().density + 0.5);
74 | }
75 |
76 | public void onClick(View v) {
77 | switch (v.getId()) {
78 | case R.id.load_white_skin:
79 | SkinManager.getInstance().loadInternalSkin("", skinChangingCallback);
80 | break;
81 | case R.id.load_dark_skin:
82 | SkinManager.getInstance().loadInternalSkin("dark", skinChangingCallback);
83 | break;
84 | case R.id.load_plugin_skin:
85 | SkinManager.getInstance().loadPluginSkin(Environment.getExternalStorageDirectory() + File.separator + "skin_plugin.skin", "com.iflytek.skin", skinChangingCallback);
86 | break;
87 | case R.id.start_new_activity:
88 | startActivity(new Intent(Home.this, SettingActivity.class));
89 | break;
90 | default:
91 | break;
92 | }
93 | }
94 |
95 | @Override
96 | protected void onDestroy() {
97 | super.onDestroy();
98 | SkinManager.getInstance().unregister(this);
99 | }
100 | }
101 |
--------------------------------------------------------------------------------
/SkinTest/src/com/iflytek/main/SettingActivity.java:
--------------------------------------------------------------------------------
1 | package com.iflytek.main;
2 |
3 | import android.app.Activity;
4 | import android.app.ProgressDialog;
5 | import android.os.Bundle;
6 | import android.view.View;
7 | import android.view.View.OnClickListener;
8 | import android.widget.Button;
9 | import android.widget.EditText;
10 | import android.widget.LinearLayout;
11 | import android.widget.LinearLayout.LayoutParams;
12 | import android.widget.Toast;
13 |
14 | import com.iflytek.skintest.R;
15 | import com.injor.callback.ISkinChangingCallback;
16 | import com.injor.common.PrefManager;
17 | import com.injor.main.SkinManager;
18 | import com.injor.processor.ISkinProcessor;
19 |
20 | public class SettingActivity extends Activity implements OnClickListener {
21 |
22 | private Button asyncLoadBtn;
23 | private EditText buttonNumEdit;
24 | private LinearLayout featureArea;
25 | private ISkinChangingCallback skinChangingCallback = new ISkinChangingCallback() {
26 | private ProgressDialog progressDialog;
27 | private long start;
28 |
29 | @Override
30 | public void onStart() {
31 | start = System.currentTimeMillis();
32 | if (progressDialog == null) {
33 | progressDialog = new ProgressDialog(SettingActivity.this);
34 | progressDialog.setTitle(getString(R.string.changing_skin));
35 | progressDialog.setCancelable(false);
36 | progressDialog.setCanceledOnTouchOutside(false);
37 | }
38 | progressDialog.show();
39 | }
40 |
41 | @Override
42 | public void onError(Exception e) {
43 | progressDialog.dismiss();
44 | }
45 |
46 | @Override
47 | public void onComplete() {
48 | Toast.makeText(SettingActivity.this, getString(R.string.time_usage) + (System.currentTimeMillis() - start) + " ms", Toast.LENGTH_SHORT).show();
49 | progressDialog.dismiss();
50 | }
51 | };
52 | public static final String BUTTON_NUM = "button_num";
53 |
54 | @Override
55 | protected void onCreate(Bundle savedInstanceState) {
56 | super.onCreate(savedInstanceState);
57 | setContentView(R.layout.activity_setting);
58 | SkinManager.getInstance().register(this);
59 | asyncLoadBtn = (Button) findViewById(R.id.enable_async_load_skin);
60 | asyncLoadBtn.setText(SkinManager.getInstance().isAsyncLoadSkin() ? R.string.enable_async_load_skin : R.string.disable_async_load_skin);
61 | buttonNumEdit = (EditText) findViewById(R.id.button_num_edit);
62 | buttonNumEdit.setText("" + PrefManager.getInstance(this).getInt(BUTTON_NUM, 0));
63 | featureArea = (LinearLayout) findViewById(R.id.feature_area);
64 | int marginTop = dip2px(5);
65 | for (ISkinProcessor processor : SkinManager.getInstance().getProcessors()) {
66 | Button button = new Button(this);
67 | String feature = processor.getName();
68 | if (SkinManager.getInstance().isProcessorDisabled(feature)) {
69 | button.setText(getString(R.string.disabled_feature) + feature);
70 | } else {
71 | button.setText(getString(R.string.enabled_feature) + feature);
72 | }
73 | button.setTag("skin:btn_color:textColor");
74 | button.setOnClickListener(this);
75 | LayoutParams layoutParams = new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT);
76 | layoutParams.setMargins(0, marginTop, 0, 0);
77 | featureArea.addView(button, layoutParams);
78 | SkinManager.getInstance().injectSkinAsync(button);
79 | }
80 | }
81 |
82 | public int dip2px(double dpValue) {
83 | return (int) (dpValue * getResources().getDisplayMetrics().density + 0.5);
84 | }
85 |
86 | @Override
87 | public void onClick(View v) {
88 | switch (v.getId()) {
89 | case R.id.load_white_skin:
90 | SkinManager.getInstance().loadInternalSkin("", skinChangingCallback);
91 | break;
92 | case R.id.load_dark_skin:
93 | SkinManager.getInstance().loadInternalSkin("dark", skinChangingCallback);
94 | break;
95 | case R.id.enable_async_load_skin:
96 | SkinManager.getInstance().setAsyncLoadEnable(!SkinManager.getInstance().isAsyncLoadSkin());
97 | asyncLoadBtn.setText(SkinManager.getInstance().isAsyncLoadSkin() ? R.string.enable_async_load_skin : R.string.disable_async_load_skin);
98 | break;
99 | case R.id.button_num_setting:
100 | int buttonNum = 0;
101 | try {
102 | buttonNum = Integer.parseInt(buttonNumEdit.getText().toString());
103 | if (buttonNum >= 0) {
104 | PrefManager.getInstance(this).setInt(BUTTON_NUM, buttonNum);
105 | }
106 | } catch (Exception e) {
107 | }
108 | break;
109 | default:
110 | if (v instanceof Button) {
111 | Button button = (Button) v;
112 | String text = button.getText().toString();
113 | String disabledFeatureStr = getString(R.string.disabled_feature);
114 | String enabledFeatureStr = getString(R.string.enabled_feature);
115 | if (text.startsWith(disabledFeatureStr)) {
116 | String feature = text.replace(disabledFeatureStr, "");
117 | SkinManager.getInstance().enableProcessor(feature);
118 | button.setText(enabledFeatureStr + feature);
119 | } else if (text.startsWith(enabledFeatureStr)) {
120 | String feature = text.replace(enabledFeatureStr, "");
121 | SkinManager.getInstance().disableProcessor(feature);
122 | button.setText(disabledFeatureStr + feature);
123 | }
124 | }
125 | break;
126 | }
127 | }
128 |
129 | @Override
130 | protected void onDestroy() {
131 | super.onDestroy();
132 | SkinManager.getInstance().unregister(this);
133 | }
134 | }
135 |
--------------------------------------------------------------------------------
/SkinTest/src/com/iflytek/main/SkinApplication.java:
--------------------------------------------------------------------------------
1 | package com.iflytek.main;
2 |
3 | import android.app.Application;
4 |
5 | import com.injor.main.SkinManager;
6 |
7 | public class SkinApplication extends Application {
8 | @Override
9 | public void onCreate() {
10 | super.onCreate();
11 | SkinManager.getInstance().init(this).addProcessor(new BrightnessProcessor());
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/injor-bin-with-src.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hackware1993/injor/9813f885474051ad4f11e4fbd33b0f8c59835cdc/injor-bin-with-src.jar
--------------------------------------------------------------------------------
/injor-bin.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hackware1993/injor/9813f885474051ad4f11e4fbd33b0f8c59835cdc/injor-bin.jar
--------------------------------------------------------------------------------
/injor/.classpath:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/injor/.fatjar:
--------------------------------------------------------------------------------
1 | #Fat Jar Configuration File
2 | #Sun Dec 27 12:42:28 CST 2015
3 | onejar.license.required=true
4 | manifest.classpath=
5 | manifest.removesigners=true
6 | onejar.checkbox=false
7 | jarname=C\:\\Users\\chen\\Desktop\\injor.jar
8 | manifest.mergeall=true
9 | manifest.mainclass=
10 | manifest.file=
11 | jarname.isextern=true
12 | onejar.expand=
13 | excludes=~com/~hackware/
14 | includes=
15 |
--------------------------------------------------------------------------------
/injor/.project:
--------------------------------------------------------------------------------
1 |
2 |
3 | injor
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 |
--------------------------------------------------------------------------------
/injor/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
5 |
6 |
9 |
10 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/injor/bin/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
5 |
6 |
9 |
10 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/injor/bin/classes/com/hackware/injor/BuildConfig.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hackware1993/injor/9813f885474051ad4f11e4fbd33b0f8c59835cdc/injor/bin/classes/com/hackware/injor/BuildConfig.class
--------------------------------------------------------------------------------
/injor/bin/classes/com/hackware/injor/R$attr.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hackware1993/injor/9813f885474051ad4f11e4fbd33b0f8c59835cdc/injor/bin/classes/com/hackware/injor/R$attr.class
--------------------------------------------------------------------------------
/injor/bin/classes/com/hackware/injor/R$drawable.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hackware1993/injor/9813f885474051ad4f11e4fbd33b0f8c59835cdc/injor/bin/classes/com/hackware/injor/R$drawable.class
--------------------------------------------------------------------------------
/injor/bin/classes/com/hackware/injor/R$string.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hackware1993/injor/9813f885474051ad4f11e4fbd33b0f8c59835cdc/injor/bin/classes/com/hackware/injor/R$string.class
--------------------------------------------------------------------------------
/injor/bin/classes/com/hackware/injor/R$style.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hackware1993/injor/9813f885474051ad4f11e4fbd33b0f8c59835cdc/injor/bin/classes/com/hackware/injor/R$style.class
--------------------------------------------------------------------------------
/injor/bin/classes/com/hackware/injor/R.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hackware1993/injor/9813f885474051ad4f11e4fbd33b0f8c59835cdc/injor/bin/classes/com/hackware/injor/R.class
--------------------------------------------------------------------------------
/injor/bin/classes/com/injor/callback/ISkinChangingCallback$1.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hackware1993/injor/9813f885474051ad4f11e4fbd33b0f8c59835cdc/injor/bin/classes/com/injor/callback/ISkinChangingCallback$1.class
--------------------------------------------------------------------------------
/injor/bin/classes/com/injor/callback/ISkinChangingCallback.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hackware1993/injor/9813f885474051ad4f11e4fbd33b0f8c59835cdc/injor/bin/classes/com/injor/callback/ISkinChangingCallback.class
--------------------------------------------------------------------------------
/injor/bin/classes/com/injor/common/BackgroundTaskManager$BackgroundHandler.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hackware1993/injor/9813f885474051ad4f11e4fbd33b0f8c59835cdc/injor/bin/classes/com/injor/common/BackgroundTaskManager$BackgroundHandler.class
--------------------------------------------------------------------------------
/injor/bin/classes/com/injor/common/BackgroundTaskManager$SingletonHolder.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hackware1993/injor/9813f885474051ad4f11e4fbd33b0f8c59835cdc/injor/bin/classes/com/injor/common/BackgroundTaskManager$SingletonHolder.class
--------------------------------------------------------------------------------
/injor/bin/classes/com/injor/common/BackgroundTaskManager.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hackware1993/injor/9813f885474051ad4f11e4fbd33b0f8c59835cdc/injor/bin/classes/com/injor/common/BackgroundTaskManager.class
--------------------------------------------------------------------------------
/injor/bin/classes/com/injor/common/FontCacheManager$SingletonHolder.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hackware1993/injor/9813f885474051ad4f11e4fbd33b0f8c59835cdc/injor/bin/classes/com/injor/common/FontCacheManager$SingletonHolder.class
--------------------------------------------------------------------------------
/injor/bin/classes/com/injor/common/FontCacheManager.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hackware1993/injor/9813f885474051ad4f11e4fbd33b0f8c59835cdc/injor/bin/classes/com/injor/common/FontCacheManager.class
--------------------------------------------------------------------------------
/injor/bin/classes/com/injor/common/PrefManager.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hackware1993/injor/9813f885474051ad4f11e4fbd33b0f8c59835cdc/injor/bin/classes/com/injor/common/PrefManager.class
--------------------------------------------------------------------------------
/injor/bin/classes/com/injor/common/ResourceManager.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hackware1993/injor/9813f885474051ad4f11e4fbd33b0f8c59835cdc/injor/bin/classes/com/injor/common/ResourceManager.class
--------------------------------------------------------------------------------
/injor/bin/classes/com/injor/common/UITaskManager$SingletonHolder.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hackware1993/injor/9813f885474051ad4f11e4fbd33b0f8c59835cdc/injor/bin/classes/com/injor/common/UITaskManager$SingletonHolder.class
--------------------------------------------------------------------------------
/injor/bin/classes/com/injor/common/UITaskManager.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hackware1993/injor/9813f885474051ad4f11e4fbd33b0f8c59835cdc/injor/bin/classes/com/injor/common/UITaskManager.class
--------------------------------------------------------------------------------
/injor/bin/classes/com/injor/constant/SkinConfig.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hackware1993/injor/9813f885474051ad4f11e4fbd33b0f8c59835cdc/injor/bin/classes/com/injor/constant/SkinConfig.class
--------------------------------------------------------------------------------
/injor/bin/classes/com/injor/entity/SkinItem.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hackware1993/injor/9813f885474051ad4f11e4fbd33b0f8c59835cdc/injor/bin/classes/com/injor/entity/SkinItem.class
--------------------------------------------------------------------------------
/injor/bin/classes/com/injor/main/SkinManager$1$1.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hackware1993/injor/9813f885474051ad4f11e4fbd33b0f8c59835cdc/injor/bin/classes/com/injor/main/SkinManager$1$1.class
--------------------------------------------------------------------------------
/injor/bin/classes/com/injor/main/SkinManager$1.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hackware1993/injor/9813f885474051ad4f11e4fbd33b0f8c59835cdc/injor/bin/classes/com/injor/main/SkinManager$1.class
--------------------------------------------------------------------------------
/injor/bin/classes/com/injor/main/SkinManager$2.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hackware1993/injor/9813f885474051ad4f11e4fbd33b0f8c59835cdc/injor/bin/classes/com/injor/main/SkinManager$2.class
--------------------------------------------------------------------------------
/injor/bin/classes/com/injor/main/SkinManager$SingletonHolder.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hackware1993/injor/9813f885474051ad4f11e4fbd33b0f8c59835cdc/injor/bin/classes/com/injor/main/SkinManager$SingletonHolder.class
--------------------------------------------------------------------------------
/injor/bin/classes/com/injor/main/SkinManager.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hackware1993/injor/9813f885474051ad4f11e4fbd33b0f8c59835cdc/injor/bin/classes/com/injor/main/SkinManager.class
--------------------------------------------------------------------------------
/injor/bin/classes/com/injor/processor/ISkinProcessor.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hackware1993/injor/9813f885474051ad4f11e4fbd33b0f8c59835cdc/injor/bin/classes/com/injor/processor/ISkinProcessor.class
--------------------------------------------------------------------------------
/injor/bin/classes/com/injor/processor/impl/BackroundProcessor$1.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hackware1993/injor/9813f885474051ad4f11e4fbd33b0f8c59835cdc/injor/bin/classes/com/injor/processor/impl/BackroundProcessor$1.class
--------------------------------------------------------------------------------
/injor/bin/classes/com/injor/processor/impl/BackroundProcessor$2.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hackware1993/injor/9813f885474051ad4f11e4fbd33b0f8c59835cdc/injor/bin/classes/com/injor/processor/impl/BackroundProcessor$2.class
--------------------------------------------------------------------------------
/injor/bin/classes/com/injor/processor/impl/BackroundProcessor.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hackware1993/injor/9813f885474051ad4f11e4fbd33b0f8c59835cdc/injor/bin/classes/com/injor/processor/impl/BackroundProcessor.class
--------------------------------------------------------------------------------
/injor/bin/classes/com/injor/processor/impl/DividerProcessor$1.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hackware1993/injor/9813f885474051ad4f11e4fbd33b0f8c59835cdc/injor/bin/classes/com/injor/processor/impl/DividerProcessor$1.class
--------------------------------------------------------------------------------
/injor/bin/classes/com/injor/processor/impl/DividerProcessor.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hackware1993/injor/9813f885474051ad4f11e4fbd33b0f8c59835cdc/injor/bin/classes/com/injor/processor/impl/DividerProcessor.class
--------------------------------------------------------------------------------
/injor/bin/classes/com/injor/processor/impl/SrcProcessor$1.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hackware1993/injor/9813f885474051ad4f11e4fbd33b0f8c59835cdc/injor/bin/classes/com/injor/processor/impl/SrcProcessor$1.class
--------------------------------------------------------------------------------
/injor/bin/classes/com/injor/processor/impl/SrcProcessor.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hackware1993/injor/9813f885474051ad4f11e4fbd33b0f8c59835cdc/injor/bin/classes/com/injor/processor/impl/SrcProcessor.class
--------------------------------------------------------------------------------
/injor/bin/classes/com/injor/processor/impl/TextColorProcessor$1.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hackware1993/injor/9813f885474051ad4f11e4fbd33b0f8c59835cdc/injor/bin/classes/com/injor/processor/impl/TextColorProcessor$1.class
--------------------------------------------------------------------------------
/injor/bin/classes/com/injor/processor/impl/TextColorProcessor.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hackware1993/injor/9813f885474051ad4f11e4fbd33b0f8c59835cdc/injor/bin/classes/com/injor/processor/impl/TextColorProcessor.class
--------------------------------------------------------------------------------
/injor/bin/classes/com/injor/processor/impl/TextProcessor$1.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hackware1993/injor/9813f885474051ad4f11e4fbd33b0f8c59835cdc/injor/bin/classes/com/injor/processor/impl/TextProcessor$1.class
--------------------------------------------------------------------------------
/injor/bin/classes/com/injor/processor/impl/TextProcessor.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hackware1993/injor/9813f885474051ad4f11e4fbd33b0f8c59835cdc/injor/bin/classes/com/injor/processor/impl/TextProcessor.class
--------------------------------------------------------------------------------
/injor/bin/classes/com/injor/processor/impl/TextSizeProcessor$1.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hackware1993/injor/9813f885474051ad4f11e4fbd33b0f8c59835cdc/injor/bin/classes/com/injor/processor/impl/TextSizeProcessor$1.class
--------------------------------------------------------------------------------
/injor/bin/classes/com/injor/processor/impl/TextSizeProcessor.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hackware1993/injor/9813f885474051ad4f11e4fbd33b0f8c59835cdc/injor/bin/classes/com/injor/processor/impl/TextSizeProcessor.class
--------------------------------------------------------------------------------
/injor/bin/classes/com/injor/processor/impl/TypefaceProcessor$1.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hackware1993/injor/9813f885474051ad4f11e4fbd33b0f8c59835cdc/injor/bin/classes/com/injor/processor/impl/TypefaceProcessor$1.class
--------------------------------------------------------------------------------
/injor/bin/classes/com/injor/processor/impl/TypefaceProcessor.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hackware1993/injor/9813f885474051ad4f11e4fbd33b0f8c59835cdc/injor/bin/classes/com/injor/processor/impl/TypefaceProcessor.class
--------------------------------------------------------------------------------
/injor/gen/com/hackware/injor/BuildConfig.java:
--------------------------------------------------------------------------------
1 | /** Automatically generated file. DO NOT MODIFY */
2 | package com.hackware.injor;
3 |
4 | public final class BuildConfig {
5 | public final static boolean DEBUG = true;
6 | }
--------------------------------------------------------------------------------
/injor/gen/com/hackware/injor/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.hackware.injor;
9 |
10 | public final class R {
11 | public static final class attr {
12 | }
13 | public static final class drawable {
14 | public static final int ic_launcher=0x7f020000;
15 | }
16 | public static final class string {
17 | public static final int app_name=0x7f030000;
18 | }
19 | public static final class style {
20 | /**
21 | Base application theme, dependent on API level. This theme is replaced
22 | by AppBaseTheme from res/values-vXX/styles.xml on newer devices.
23 |
24 |
25 | Theme customizations available in newer API levels can go in
26 | res/values-vXX/styles.xml, while customizations related to
27 | backward-compatibility can go here.
28 |
29 |
30 | Base application theme for API 11+. This theme completely replaces
31 | AppBaseTheme from res/values/styles.xml on API 11+ devices.
32 |
33 | API 11 theme customizations can go here.
34 |
35 | Base application theme for API 14+. This theme completely replaces
36 | AppBaseTheme from BOTH res/values/styles.xml and
37 | res/values-v11/styles.xml on API 14+ devices.
38 |
39 | API 14 theme customizations can go here.
40 | */
41 | public static final int AppBaseTheme=0x7f040000;
42 | /** Application theme.
43 | All customizations that are NOT specific to a particular API-level can go here.
44 | */
45 | public static final int AppTheme=0x7f040001;
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/injor/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 |
--------------------------------------------------------------------------------
/injor/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-23
15 |
--------------------------------------------------------------------------------
/injor/res/drawable-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hackware1993/injor/9813f885474051ad4f11e4fbd33b0f8c59835cdc/injor/res/drawable-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/injor/res/drawable-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hackware1993/injor/9813f885474051ad4f11e4fbd33b0f8c59835cdc/injor/res/drawable-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/injor/res/drawable-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hackware1993/injor/9813f885474051ad4f11e4fbd33b0f8c59835cdc/injor/res/drawable-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/injor/res/values-v11/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/injor/res/values-v14/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
8 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/injor/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | injor
4 |
5 |
6 |
--------------------------------------------------------------------------------
/injor/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 |
14 |
15 |
16 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/injor/src/com/injor/callback/ISkinChangingCallback.java:
--------------------------------------------------------------------------------
1 | package com.injor.callback;
2 |
3 | import android.util.Log;
4 |
5 | import com.injor.main.SkinManager;
6 |
7 | /**
8 | * 皮肤切换回调
9 | *
10 | * @author hackware 2015.12.26
11 | *
12 | */
13 | public interface ISkinChangingCallback {
14 |
15 | /**
16 | * 开始切换
17 | */
18 | void onStart();
19 |
20 | /**
21 | * 切换过程出错
22 | *
23 | * @param e
24 | * 异常信息
25 | */
26 | void onError(Exception e);
27 |
28 | /**
29 | * 切换完成(成功)
30 | */
31 | void onComplete();
32 |
33 | // 默认的切换回调
34 | public static final ISkinChangingCallback DEFAULT = new ISkinChangingCallback() {
35 |
36 | @Override
37 | public void onStart() {
38 | Log.d(SkinManager.TAG, "onStart");
39 | }
40 |
41 | @Override
42 | public void onError(Exception e) {
43 | Log.d(SkinManager.TAG, "onError", e);
44 | }
45 |
46 | @Override
47 | public void onComplete() {
48 | Log.d(SkinManager.TAG, "onComplete");
49 | }
50 | };
51 | }
52 |
--------------------------------------------------------------------------------
/injor/src/com/injor/common/BackgroundTaskManager.java:
--------------------------------------------------------------------------------
1 | package com.injor.common;
2 |
3 | import android.os.Handler;
4 | import android.os.HandlerThread;
5 | import android.os.Looper;
6 | import android.os.Message;
7 |
8 | /**
9 | * 使用HandlerThread处理后台任务的工具类
10 | *
11 | * @author hackware 2015.12.26
12 | *
13 | */
14 | public class BackgroundTaskManager {
15 | private BackgroundHandler backgroundHandler;
16 |
17 | private BackgroundTaskManager() {
18 | HandlerThread handlerThread = new HandlerThread("BackgroundTaskManager");
19 | handlerThread.start();
20 | backgroundHandler = new BackgroundHandler(handlerThread.getLooper());
21 | }
22 |
23 | private static class SingletonHolder {
24 | static BackgroundTaskManager sManager = new BackgroundTaskManager();
25 | }
26 |
27 | public static BackgroundTaskManager getInstance() {
28 | return SingletonHolder.sManager;
29 | }
30 |
31 | private static class BackgroundHandler extends Handler {
32 | public BackgroundHandler(Looper looper) {
33 | super(looper);
34 | }
35 |
36 | @Override
37 | public void handleMessage(Message msg) {
38 | super.handleMessage(msg);
39 | }
40 | }
41 |
42 | public void post(Runnable runnable) {
43 | backgroundHandler.post(runnable);
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/injor/src/com/injor/common/CacheManager.java:
--------------------------------------------------------------------------------
1 | package com.injor.common;
2 |
3 | import java.util.Map;
4 | import java.util.concurrent.ConcurrentHashMap;
5 |
6 | /**
7 | * 缓存管理器,避免资源重复加载
8 | *
9 | * @author hackware 2015.12.22
10 | *
11 | */
12 | public class CacheManager {
13 |
14 | // 需要保证线程安全,换肤时多个Activity是同时换的,多个换肤线程可能会同时访问
15 | private Map mCache = new ConcurrentHashMap();
16 |
17 | private CacheManager() {
18 | }
19 |
20 | private static class SingletonHolder {
21 | static CacheManager sCacheManager = new CacheManager();
22 | }
23 |
24 | public static CacheManager getInstance() {
25 | return SingletonHolder.sCacheManager;
26 | }
27 |
28 | public Object get(String key) {
29 | return mCache.get(key);
30 | }
31 |
32 | public void put(String key, Object content) {
33 | if (content != null) {
34 | mCache.put(key, content);
35 | }
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/injor/src/com/injor/common/PrefManager.java:
--------------------------------------------------------------------------------
1 | package com.injor.common;
2 |
3 | import java.util.Set;
4 |
5 | import android.annotation.TargetApi;
6 | import android.content.Context;
7 | import android.content.SharedPreferences;
8 | import android.os.Build;
9 |
10 | import com.injor.constant.SkinConfig;
11 |
12 | /**
13 | * 记录当前皮肤,使得重启程序皮肤不变
14 | *
15 | * @author hackware 2015.12.21
16 | *
17 | */
18 | public class PrefManager {
19 | private Context mContext;
20 | private SharedPreferences mSp;
21 | private static PrefManager sManager;
22 | private int apiLevel;
23 |
24 | private PrefManager(Context context) {
25 | mContext = context;
26 | mSp = mContext.getSharedPreferences(SkinConfig.SKIN_PREF_KEY, Context.MODE_PRIVATE);
27 |
28 | // 连获取apiLevel都要保证兼容性,是不是丧心病狂了
29 | try {
30 | apiLevel = Integer.valueOf(Build.VERSION.SDK);
31 | } catch (Exception e) {
32 | apiLevel = 0;
33 | }
34 | }
35 |
36 | public static PrefManager getInstance(Context context) {
37 | if (sManager == null) {
38 | synchronized (PrefManager.class) {
39 | if (sManager == null) {
40 | sManager = new PrefManager(context);
41 | }
42 | }
43 | }
44 | return sManager;
45 | }
46 |
47 | @TargetApi(Build.VERSION_CODES.GINGERBREAD)
48 | public void clear() {
49 | SharedPreferences.Editor editor = mSp.edit().clear();
50 | if (apiLevel >= 9) {
51 | editor.apply();
52 | } else {
53 | editor.commit();
54 | }
55 | }
56 |
57 | public Integer getInt(String key, int defaultValue) {
58 | return mSp.getInt(key, defaultValue);
59 | }
60 |
61 | @TargetApi(Build.VERSION_CODES.GINGERBREAD)
62 | public void setInt(String key, int value) {
63 | SharedPreferences.Editor editor = mSp.edit().putInt(key, value);
64 | if (apiLevel >= 9) {
65 | editor.apply();
66 | } else {
67 | editor.commit();
68 | }
69 | }
70 |
71 | @TargetApi(Build.VERSION_CODES.GINGERBREAD)
72 | public void setBoolean(String key, boolean value) {
73 | SharedPreferences.Editor editor = mSp.edit().putBoolean(key, value);
74 | if (apiLevel >= 9) {
75 | editor.apply();
76 | } else {
77 | editor.commit();
78 | }
79 | }
80 |
81 | public boolean getBoolean(String key, boolean defaultValue) {
82 | return mSp.getBoolean(key, defaultValue);
83 | }
84 |
85 | public String getString(String key, String defaultValue) {
86 | return mSp.getString(key, defaultValue);
87 | }
88 |
89 | @TargetApi(Build.VERSION_CODES.GINGERBREAD)
90 | public void setString(String key, String value) {
91 | SharedPreferences.Editor editor = mSp.edit().putString(key, value);
92 | if (apiLevel >= 9) {
93 | editor.apply();
94 | } else {
95 | editor.commit();
96 | }
97 | }
98 |
99 | public float getFloat(String key, float defaultValue) {
100 | return mSp.getFloat(key, defaultValue);
101 | }
102 |
103 | @TargetApi(Build.VERSION_CODES.GINGERBREAD)
104 | public void setFloat(String key, float value) {
105 | SharedPreferences.Editor editor = mSp.edit().putFloat(key, value);
106 | if (apiLevel >= 9) {
107 | editor.apply();
108 | } else {
109 | editor.commit();
110 | }
111 | }
112 |
113 | @TargetApi(Build.VERSION_CODES.GINGERBREAD)
114 | public void setLong(String key, long value) {
115 | SharedPreferences.Editor editor = mSp.edit().putLong(key, value);
116 | if (apiLevel >= 9) {
117 | editor.apply();
118 | } else {
119 | editor.commit();
120 | }
121 | }
122 |
123 | public void getLong(String key, long defaultValue) {
124 | mSp.getLong(key, defaultValue);
125 | }
126 |
127 | // 下面这两个方法没什么卵用
128 | @TargetApi(Build.VERSION_CODES.HONEYCOMB)
129 | public void setStringSet(String key, Set values) {
130 | SharedPreferences.Editor editor = mSp.edit().putStringSet(key, values);
131 | if (apiLevel >= 9) {
132 | editor.apply();
133 | } else {
134 | editor.commit();
135 | }
136 | }
137 |
138 | @TargetApi(Build.VERSION_CODES.HONEYCOMB)
139 | public Set getStringSet(String key, Set defaultValues) {
140 | return mSp.getStringSet(key, defaultValues);
141 | }
142 | }
143 |
--------------------------------------------------------------------------------
/injor/src/com/injor/common/ResourceManager.java:
--------------------------------------------------------------------------------
1 | package com.injor.common;
2 |
3 | import android.content.res.ColorStateList;
4 | import android.content.res.Resources;
5 | import android.graphics.Typeface;
6 | import android.graphics.drawable.Drawable;
7 | import android.text.TextUtils;
8 |
9 | import com.injor.main.SkinManager;
10 |
11 | /**
12 | * 用于获取资源,无论内置的还是插件中的,都是使用android.content.res.Resources类
13 | *
14 | * @author hackware 2015.12.20
15 | *
16 | */
17 | public class ResourceManager {
18 | private static final String DEFTYPE_DRAWABLE = "drawable";
19 | private static final String DEFTYPE_COLOR = "color";
20 | private static final String DEFTYPE_STRING = "string";
21 | private static final String DEFTYPE_DIMEN = "dimen";
22 |
23 | // 用于访问内置资源
24 | private Resources mDefaultResources = SkinManager.getInstance().getContext().getResources();
25 | private String mDefaultPackageName = SkinManager.getInstance().getContext().getPackageName();
26 |
27 | // 用于访问资源(内置或插件)
28 | private Resources mCurrentResources;
29 | private String mCurrentPluginPackageName; // Resources.getIdentifer(,,mCurrentPluginPackageName);
30 |
31 | // 皮肤后缀
32 | private String mSuffix;
33 |
34 | public ResourceManager(Resources res, String pluginPackageName, String suffix) {
35 | mCurrentResources = res;
36 | mCurrentPluginPackageName = pluginPackageName;
37 | mSuffix = suffix;
38 | if (mSuffix == null) {
39 | mSuffix = "";// 表示内置默认皮肤(插件或内置)
40 | }
41 | }
42 |
43 | public Resources getCurrentResources() {
44 | return mCurrentResources;
45 | }
46 |
47 | public Resources getDefaultResources() {
48 | return mDefaultResources;
49 | }
50 |
51 | public String getSuffix() {
52 | return mSuffix;
53 | }
54 |
55 | public String getDefaultPackageName() {
56 | return mDefaultPackageName;
57 | }
58 |
59 | public String getCurrentPluginPackageName() {
60 | return mCurrentPluginPackageName;
61 | }
62 |
63 | public void setSuffix(String suffix) {
64 | mSuffix = suffix;
65 | if (mSuffix == null) {
66 | mSuffix = "";
67 | }
68 | }
69 |
70 | public String appendSuffix(String name) {
71 | if (!TextUtils.isEmpty(mSuffix)) {
72 | return name + "_" + mSuffix;
73 | }
74 | return name;
75 | }
76 |
77 | /*
78 | * 下面的几个方法作用都是根据名字获取资源
79 | * 先从当前的Resources中获取,如果获取不到
80 | * 再从默认的Resources中获取,说白了就是在皮肤插件中
81 | * 找不到资源的话,从内置资源中找,这也就能实现通过皮肤来
82 | * 更改单一类型的资源,比如字体
83 | */
84 | public Drawable getDrawable(String name) {
85 | try {
86 | return mCurrentResources.getDrawable(mCurrentResources.getIdentifier(appendSuffix(name), DEFTYPE_DRAWABLE, mCurrentPluginPackageName));
87 | } catch (Exception e) {
88 | e.printStackTrace();
89 | if (mCurrentResources != mDefaultResources) {
90 | try {
91 | return mDefaultResources.getDrawable(mDefaultResources.getIdentifier(name, DEFTYPE_DRAWABLE, mDefaultPackageName));
92 | } catch (Exception e2) {
93 | e2.printStackTrace();
94 | }
95 | }
96 | return null;
97 | }
98 | }
99 |
100 | public int getColor(String name) throws Exception {
101 | try {
102 | return mCurrentResources.getColor(mCurrentResources.getIdentifier(appendSuffix(name), DEFTYPE_COLOR, mCurrentPluginPackageName));
103 | } catch (Exception e) {
104 | if (mCurrentResources != mDefaultResources) {
105 | return mDefaultResources.getColor(mDefaultResources.getIdentifier(name, DEFTYPE_COLOR, mDefaultPackageName));
106 | }
107 | throw e;
108 | }
109 | }
110 |
111 | public ColorStateList getColorStateList(String name) {
112 | try {
113 | return mCurrentResources.getColorStateList(mCurrentResources.getIdentifier(appendSuffix(name), DEFTYPE_COLOR, mCurrentPluginPackageName));
114 | } catch (Exception e) {
115 | e.printStackTrace();
116 | if (mCurrentResources != mDefaultResources) {
117 | try {
118 | return mDefaultResources.getColorStateList(mDefaultResources.getIdentifier(name, DEFTYPE_COLOR, mDefaultPackageName));
119 | } catch (Exception e2) {
120 | e2.printStackTrace();
121 | }
122 | }
123 | return null;
124 | }
125 | }
126 |
127 | public String getString(String name) {
128 | try {
129 | return mCurrentResources.getString(mCurrentResources.getIdentifier(appendSuffix(name), DEFTYPE_STRING, mCurrentPluginPackageName));
130 | } catch (Exception e) {
131 | e.printStackTrace();
132 | if (mCurrentResources != mDefaultResources) {
133 | try {
134 | return mDefaultResources.getString(mDefaultResources.getIdentifier(name, DEFTYPE_STRING, mDefaultPackageName));
135 | } catch (Exception e2) {
136 | e2.printStackTrace();
137 | }
138 | }
139 | return null;
140 | }
141 | }
142 |
143 | public float getDimension(String name) throws Exception {
144 | try {
145 | return mCurrentResources.getDimension(mCurrentResources.getIdentifier(appendSuffix(name), DEFTYPE_DIMEN, mCurrentPluginPackageName));
146 | } catch (Exception e) {
147 | e.printStackTrace();
148 | if (mCurrentResources != mDefaultResources) {
149 | return mDefaultResources.getDimension(mDefaultResources.getIdentifier(name, DEFTYPE_DIMEN, mDefaultPackageName));
150 | }
151 | throw e;
152 | }
153 | }
154 |
155 | /**
156 | * 获取字体,字体需要放置在assets/fonts目录下
157 | *
158 | * @param name
159 | * 字体文件的名字
160 | * @return
161 | */
162 | public Typeface getTypeface(String name) {
163 | String key;
164 | String param;
165 | CacheManager cacheManager = CacheManager.getInstance();
166 | try {
167 | param = "fonts/" + appendSuffix(name) + ".ttf";
168 | key = ((mCurrentResources == mDefaultResources) ? "typeface_internal://" : "typeface_plugin://") + param;
169 | Object object = cacheManager.get(key);
170 | if (object != null) {
171 | return (Typeface) object;
172 | } else {
173 | Typeface typeface = Typeface.createFromAsset(mCurrentResources.getAssets(), param);
174 | cacheManager.put(key, typeface);
175 | return typeface;
176 | }
177 | } catch (Exception e) {
178 | e.printStackTrace();
179 | if (mCurrentResources != mDefaultResources) {
180 | try {
181 | param = "fonts/" + name + ".ttf";
182 | key = "typeface_internal://" + param;
183 | Object object = cacheManager.get(key);
184 | if (object != null) {
185 | return (Typeface) object;
186 | } else {
187 | Typeface typeface = Typeface.createFromAsset(mDefaultResources.getAssets(), param);
188 | cacheManager.put(key, typeface);
189 | return typeface;
190 | }
191 | } catch (Exception e2) {
192 | e2.printStackTrace();
193 | }
194 | }
195 | return null;
196 | }
197 | }
198 | }
199 |
--------------------------------------------------------------------------------
/injor/src/com/injor/common/UITaskManager.java:
--------------------------------------------------------------------------------
1 | package com.injor.common;
2 |
3 | import android.os.Handler;
4 | import android.os.Looper;
5 |
6 | /**
7 | * 用于在子线程中更新UI。 异步刷新皮肤时,遍历contentView、解析skin tag以及加载资源
8 | * 都在子线程中,但最终将新资源设置到view时必须要在主线程中
9 | *
10 | * @author hackware 2015.12.22
11 | *
12 | */
13 | public class UITaskManager extends Handler {
14 | private UITaskManager() {
15 | super(Looper.getMainLooper());
16 | }
17 |
18 | private static class SingletonHolder {
19 | static UITaskManager sManager = new UITaskManager();
20 | }
21 |
22 | public static UITaskManager getInstance() {
23 | return SingletonHolder.sManager;
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/injor/src/com/injor/constant/SkinConfig.java:
--------------------------------------------------------------------------------
1 | package com.injor.constant;
2 |
3 | /**
4 | * 常量,配置信息
5 | *
6 | * @author hackware 2015.12.20
7 | *
8 | */
9 | public class SkinConfig {
10 | public static final String SKIN_PREF_KEY = "skin_plugin_pref";
11 | public static final String SKIN_STATEMENT_PREFIX = "skin:";
12 |
13 | public static final String KEY_CURRENT_SKIN_PATH = "key_current_skin_path";
14 | public static final String KEY_CURRENT_SKIN_PKG = "key_current_skin_pkg";
15 | public static final String KEY_CURRENT_SKIN_SUFFIX = "key_skin_plugin_file_suffix";
16 | public static final String KEY_ASYNC_LOAD_SKIN_SWITCH = "key_async_load_skin_switch";
17 |
18 | // 默认开启异步换肤,对于包含大量item(成千上万)的界面,换肤时界面也会保持响应,可在换肤时弹出进度框
19 | public static final boolean DEFAULT_ASYNC_LOAD_VALUE = true;
20 | }
21 |
--------------------------------------------------------------------------------
/injor/src/com/injor/entity/SkinItem.java:
--------------------------------------------------------------------------------
1 | package com.injor.entity;
2 |
3 | /**
4 | * skin:resName:resType
5 | *
6 | * @author hackware 2015.12.20
7 | *
8 | */
9 | public class SkinItem {
10 | public String resName;
11 | public String resType;
12 |
13 | public SkinItem(String resName, String resType) {
14 | this.resName = resName;
15 | this.resType = resType;
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/injor/src/com/injor/main/SkinManager.java:
--------------------------------------------------------------------------------
1 | package com.injor.main;
2 |
3 | import java.io.File;
4 | import java.lang.reflect.Method;
5 | import java.util.ArrayList;
6 | import java.util.List;
7 |
8 | import android.app.Activity;
9 | import android.content.Context;
10 | import android.content.pm.PackageInfo;
11 | import android.content.pm.PackageManager;
12 | import android.content.res.AssetManager;
13 | import android.content.res.Resources;
14 | import android.os.Looper;
15 | import android.text.TextUtils;
16 | import android.view.View;
17 | import android.view.ViewGroup;
18 |
19 | import com.injor.callback.ISkinChangingCallback;
20 | import com.injor.common.BackgroundTaskManager;
21 | import com.injor.common.PrefManager;
22 | import com.injor.common.ResourceManager;
23 | import com.injor.common.UITaskManager;
24 | import com.injor.constant.SkinConfig;
25 | import com.injor.entity.SkinItem;
26 | import com.injor.processor.ISkinProcessor;
27 | import com.injor.processor.impl.BackroundProcessor;
28 | import com.injor.processor.impl.DividerProcessor;
29 | import com.injor.processor.impl.SrcProcessor;
30 | import com.injor.processor.impl.TextColorProcessor;
31 | import com.injor.processor.impl.TextProcessor;
32 | import com.injor.processor.impl.TextSizeProcessor;
33 | import com.injor.processor.impl.TypefaceProcessor;
34 |
35 | public class SkinManager {
36 | private static final String PROCESSOR_STATUS = "processor_enabled:";
37 | public static final String TAG = "SkinManager";
38 | private Context mContext;
39 | private ResourceManager mResourceManager;
40 | private PrefManager prefManager;
41 |
42 | private List mActivities = new ArrayList();// 需要换肤的activity
43 | private byte[] mLock = new byte[0];
44 |
45 | public static final String PROCESSOR_TYPEFACE = "typeface";
46 | public static final String PROCESSOR_SRC = "src";
47 | public static final String PROCESSOR_BACKGROUND = "background";
48 | public static final String PROCESSOR_TEXT_COLOR = "textColor";
49 | public static final String PROCESSOR_DIVIDER = "divider";
50 | public static final String PROCESSOR_TEXT_SIZE = "textSize";
51 | public static final String PROCESSOR_TEXT = "text";
52 |
53 | // 处理皮肤异步加载
54 | private boolean isAsyncLoadSkin;
55 | private volatile int mAsyncLoadIndex;
56 | private int mTotalActivities;
57 | private ISkinChangingCallback mSkinChangingCallback;
58 | private volatile boolean mIsChangingSkin;
59 |
60 | // 可以控制启用、禁用一些处理器
61 | private List disabledProcessors = new ArrayList();
62 | private List processors = new ArrayList();
63 |
64 | private SkinManager() {
65 | // 默认启用所有内置处理器
66 | processors.add(new BackroundProcessor());
67 | processors.add(new DividerProcessor());
68 | processors.add(new SrcProcessor());
69 | processors.add(new TextColorProcessor());
70 | processors.add(new TextProcessor());
71 | processors.add(new TextSizeProcessor());
72 | processors.add(new TypefaceProcessor());
73 | }
74 |
75 | private static class SingletonHolder {
76 | static SkinManager sInstance = new SkinManager();
77 | }
78 |
79 | public static SkinManager getInstance() {
80 | return SingletonHolder.sInstance;
81 | }
82 |
83 | public boolean isAsyncLoadSkin() {
84 | return prefManager.getBoolean(SkinConfig.KEY_ASYNC_LOAD_SKIN_SWITCH, SkinConfig.DEFAULT_ASYNC_LOAD_VALUE);
85 | }
86 |
87 | public void setCurrentSkinSuffix(String suffix) {
88 | prefManager.setString(SkinConfig.KEY_CURRENT_SKIN_SUFFIX, suffix);
89 | }
90 |
91 | public String getCurrentSkinSuffix() {
92 | return prefManager.getString(SkinConfig.KEY_CURRENT_SKIN_SUFFIX, "");
93 | }
94 |
95 | public String getCurrentSkinPackage() {
96 | return prefManager.getString(SkinConfig.KEY_CURRENT_SKIN_PKG, "");
97 | }
98 |
99 | public void setCurrentSkinPackage(String pkgName) {
100 | prefManager.setString(SkinConfig.KEY_CURRENT_SKIN_PKG, pkgName);
101 | }
102 |
103 | public void setCurrentSkinPath(String path) {
104 | prefManager.setString(SkinConfig.KEY_CURRENT_SKIN_PATH, path);
105 | }
106 |
107 | public String getCurrentSkinPath() {
108 | return prefManager.getString(SkinConfig.KEY_CURRENT_SKIN_PATH, "");
109 | }
110 |
111 | public void clearSkinConfig() {
112 | setCurrentSkinPath(null);
113 | setCurrentSkinPackage(null);
114 | setCurrentSkinSuffix(null);
115 | }
116 |
117 | public SkinManager init(Context context) {
118 | mContext = context;
119 | prefManager = PrefManager.getInstance(mContext);
120 | isAsyncLoadSkin = isAsyncLoadSkin();
121 |
122 | for (ISkinProcessor processor : processors) {
123 | if (!prefManager.getBoolean(PROCESSOR_STATUS + processor.getName(), true)) {
124 | disabledProcessors.add(processor.getName());
125 | }
126 | }
127 |
128 | // 获取皮肤信息
129 | String skinPluginPath = getCurrentSkinPath();
130 | String skinPluginPkg = getCurrentSkinPackage();
131 | String suffix = getCurrentSkinSuffix();
132 |
133 | if (!validPluginParams(skinPluginPath, skinPluginPkg)) {// 是否是内置皮肤
134 | mResourceManager = new ResourceManager(mContext.getResources(), mContext.getPackageName(), suffix);
135 | } else {
136 | try {
137 | // 生成插件的Resources
138 | mResourceManager = getPluginResourceManager(skinPluginPath, skinPluginPkg, suffix);
139 | } catch (Exception e) {
140 | e.printStackTrace();
141 | // 插件的Resources生成失败,切换到内置的默认皮肤
142 | mResourceManager = new ResourceManager(mContext.getResources(), mContext.getPackageName(), null);
143 | clearSkinConfig();
144 | }
145 | }
146 | return this;
147 | }
148 |
149 | public List getProcessors() {
150 | return processors;
151 | }
152 |
153 | /**
154 | * 添加处理器,外部可覆盖内置处理器
155 | *
156 | * @param newProcessor
157 | */
158 | public void addProcessor(ISkinProcessor newProcessor) {
159 | boolean replaced = false;
160 | for (int i = 0; i < processors.size(); i++) {
161 | if (processors.get(i).getName().equals(newProcessor.getName())) {
162 | processors.set(i, newProcessor);
163 | replaced = true;
164 | }
165 | }
166 | if (!replaced) {
167 | processors.add(newProcessor);
168 | }
169 | }
170 |
171 | /**
172 | * 启用处理器
173 | *
174 | * @param processorName
175 | */
176 | public void enableProcessor(String processorName) {
177 | boolean hasProcessor = false;
178 | for (ISkinProcessor processor : processors) {
179 | if (processor.getName().equals(processorName)) {
180 | hasProcessor = true;
181 | break;
182 | }
183 | }
184 | if (hasProcessor) {
185 | int index = disabledProcessors.indexOf(processorName);
186 | if (index != -1) {
187 | disabledProcessors.remove(index);
188 | prefManager.setBoolean(PROCESSOR_STATUS + processorName, true);
189 | }
190 | } else {
191 | throw new IllegalArgumentException("processor: '" + processorName + "' does't support.");
192 | }
193 | }
194 |
195 | /**
196 | * 禁用处理器
197 | *
198 | * @param processorName
199 | */
200 | public void disableProcessor(String processorName) {
201 | boolean hasProcessor = false;
202 | for (ISkinProcessor processor : processors) {
203 | if (processor.getName().equals(processorName)) {
204 | hasProcessor = true;
205 | break;
206 | }
207 | }
208 | if (hasProcessor) {
209 | if (!disabledProcessors.contains(processorName)) {
210 | disabledProcessors.add(processorName);
211 | prefManager.setBoolean(PROCESSOR_STATUS + processorName, false);
212 | }
213 | } else {
214 | throw new IllegalArgumentException("processor: '" + processorName + "' does't support.");
215 | }
216 | }
217 |
218 | /**
219 | * 禁用多个处理器
220 | *
221 | * @param processorNames
222 | */
223 | public void disableProcessors(String... processorNames) {
224 | for (int i = 0; i < processorNames.length; i++) {
225 | disableProcessor(processorNames[i]);
226 | }
227 | }
228 |
229 | public boolean isProcessorDisabled(String processorName) {
230 | return disabledProcessors.contains(processorName);
231 | }
232 |
233 | public List getEnabledProcessors() {
234 | List enabledProcessors = new ArrayList();
235 | for (ISkinProcessor processor : processors) {
236 | if (!isProcessorDisabled(processor.getName())) {
237 | enabledProcessors.add(processor.getName());
238 | }
239 | }
240 | return enabledProcessors;
241 | }
242 |
243 | /**
244 | * 获取外部apk的包名
245 | *
246 | * @param skinPluginPath
247 | * @return
248 | */
249 | private PackageInfo getPackageInfo(String skinPluginPath) {
250 | PackageManager pm = mContext.getPackageManager();
251 | return pm.getPackageArchiveInfo(skinPluginPath, PackageManager.GET_ACTIVITIES);
252 | }
253 |
254 | /**
255 | * 生成皮肤插件的资源管理器
256 | *
257 | * @param skinPath
258 | * 插件路径
259 | * @param skinPkgName
260 | * 插件包名
261 | * @param suffix
262 | * 插件中的皮肤后缀为null或""表示默认皮肤
263 | * @return
264 | * @throws Exception
265 | */
266 | private ResourceManager getPluginResourceManager(String skinPath, String skinPkgName, String suffix) throws Exception {
267 | AssetManager assetManager = AssetManager.class.newInstance();
268 | Method addAssetPath = AssetManager.class.getMethod("addAssetPath", String.class);
269 | addAssetPath.invoke(assetManager, skinPath);
270 | Resources superRes = mContext.getResources();
271 | Resources resources = new Resources(assetManager, superRes.getDisplayMetrics(), superRes.getConfiguration());
272 | return new ResourceManager(resources, skinPkgName, suffix);
273 | }
274 |
275 | private boolean validPluginParams(String skinPath, String skinPkgName) {
276 | if (TextUtils.isEmpty(skinPath) || TextUtils.isEmpty(skinPkgName)) {
277 | return false;
278 | }
279 |
280 | File file = new File(skinPath);
281 | if (!file.exists()) {
282 | return false;
283 | }
284 |
285 | PackageInfo info = getPackageInfo(skinPath);
286 | if (info == null || !skinPkgName.equals(info.packageName)) {
287 | return false;
288 | }
289 | return true;
290 | }
291 |
292 | /**
293 | * 当前皮肤是否是内置的默认皮肤
294 | *
295 | * @return
296 | */
297 | public boolean isDefaultSkin() {
298 | return isInternalSkin() && TextUtils.isEmpty(mResourceManager.getSuffix());
299 | }
300 |
301 | /**
302 | * 当前皮肤是否是插件皮肤
303 | *
304 | * @return
305 | */
306 | public boolean isPluginSkin() {
307 | return mContext.getResources() != mResourceManager.getCurrentResources();
308 | }
309 |
310 | /**
311 | * 当前皮肤是否是插件中的默认皮肤
312 | *
313 | * @return
314 | */
315 | public boolean isPluginDefaultSkin() {
316 | return isPluginSkin() && TextUtils.isEmpty(mResourceManager.getSuffix());
317 | }
318 |
319 | /**
320 | * 当前皮肤是否是内置皮肤
321 | *
322 | * @return
323 | */
324 | public boolean isInternalSkin() {
325 | return !isPluginSkin();
326 | }
327 |
328 | /**
329 | * 设置异步换肤
330 | *
331 | * @param is
332 | */
333 | public void setAsyncLoadEnable(boolean is) {
334 | if (mIsChangingSkin) {
335 | throw new IllegalStateException("skin is changing.");
336 | } else {
337 | isAsyncLoadSkin = is;
338 | prefManager.setBoolean(SkinConfig.KEY_ASYNC_LOAD_SKIN_SWITCH, is);
339 | }
340 | }
341 |
342 | public ResourceManager getResourceManager() {
343 | return mResourceManager;
344 | }
345 |
346 | public Context getContext() {
347 | return mContext;
348 | }
349 |
350 | /**
351 | * 加载内置皮肤
352 | *
353 | * @param suffix
354 | */
355 | public void loadInternalSkin(String suffix) {
356 | loadInternalSkin(suffix, null);
357 | }
358 |
359 | /**
360 | * 加载内置皮肤,并监听回调
361 | *
362 | * @param suffix
363 | * @param callback
364 | */
365 | public void loadInternalSkin(String suffix, ISkinChangingCallback callback) {
366 | if (callback == null) {
367 | callback = ISkinChangingCallback.DEFAULT;
368 | }
369 | if (mIsChangingSkin) {// 换肤过程中不能再换肤
370 | callback.onError(new IllegalStateException("skin is changing."));
371 | return;
372 | }
373 | mIsChangingSkin = true;
374 | callback.onStart();
375 | try {
376 | if (isPluginSkin()) {// 由插件皮肤切换到内置皮肤,需要重新生成ResourceManager
377 | mResourceManager = new ResourceManager(mContext.getResources(), mContext.getPackageName(), suffix);
378 | } else {
379 | String sfx = suffix;
380 | if (sfx == null) {
381 | sfx = "";
382 | }
383 | if (sfx.equals(mResourceManager.getSuffix())) {// 要切换的皮肤就是当前皮肤,不予切换
384 | mIsChangingSkin = false;
385 | callback.onComplete();
386 | return;
387 | }
388 | mResourceManager.setSuffix(suffix);
389 | }
390 | clearSkinConfig();
391 | setCurrentSkinSuffix(suffix);
392 | loadSkinInternel();// 执行真正的换肤操作
393 | if (!isAsyncLoadSkin) {// 如果不是异步换肤,则loadSkinInternal执行完后就换肤结束了
394 | mIsChangingSkin = false;
395 | callback.onComplete();
396 | } else {
397 | mSkinChangingCallback = callback;// 异步换肤,先保存回调
398 | }
399 | } catch (Exception e) {
400 | e.printStackTrace();
401 | mIsChangingSkin = false;
402 | callback.onError(e);
403 | }
404 | }
405 |
406 | /**
407 | * 加载插件中的默认皮肤
408 | *
409 | * @param skinPluginPath
410 | * 插件路径
411 | * @param skinPluginPkg
412 | * 插件报名
413 | * @param callback
414 | * 换肤回调
415 | */
416 | public void loadPluginSkin(String skinPluginPath, String skinPluginPkg, ISkinChangingCallback callback) {
417 | loadPluginSkin(skinPluginPath, skinPluginPkg, null, callback);
418 | }
419 |
420 | /**
421 | * 加载插件中的默认皮肤,不提供回调
422 | *
423 | * @param skinPluginPath
424 | * 插件路径
425 | * @param skinPluginPkg
426 | * 插件报名
427 | */
428 | public void loadPluginSkin(String skinPluginPath, String skinPluginPkg) {
429 | loadPluginSkin(skinPluginPath, skinPluginPkg, null);
430 | }
431 |
432 | /**
433 | * 根据suffix选择插件内某套皮肤,默认为""
434 | *
435 | * @param skinPluginPath
436 | * @param skinPluginPkg
437 | * @param suffix
438 | * @param callback
439 | */
440 | public void loadPluginSkin(String skinPluginPath, String skinPluginPkg, String suffix, ISkinChangingCallback callback) {
441 | if (callback == null) {
442 | callback = ISkinChangingCallback.DEFAULT;
443 | }
444 | if (mIsChangingSkin) {
445 | callback.onError(new IllegalStateException("skin is changing."));
446 | return;
447 | }
448 | mIsChangingSkin = true;
449 | callback.onStart();
450 | if (validPluginParams(skinPluginPath, skinPluginPkg)) {
451 | try {
452 | mResourceManager = getPluginResourceManager(skinPluginPath, skinPluginPkg, suffix);
453 | setCurrentSkinPath(skinPluginPath);
454 | setCurrentSkinPackage(skinPluginPkg);
455 | setCurrentSkinSuffix(suffix);
456 | loadSkinInternel();
457 | if (!isAsyncLoadSkin) {
458 | mIsChangingSkin = false;
459 | callback.onComplete();
460 | } else {
461 | mSkinChangingCallback = callback;
462 | }
463 | } catch (Exception e) {
464 | e.printStackTrace();
465 | mIsChangingSkin = false;
466 | callback.onError(e);
467 | }
468 | } else {
469 | mIsChangingSkin = false;
470 | callback.onError(new IllegalArgumentException("skin plugin params error, please check it."));
471 | }
472 | }
473 |
474 | /**
475 | * 为某个activity换肤
476 | *
477 | * @param activity
478 | */
479 | public void apply(Activity activity) {
480 | injectSkin(activity, activity.findViewById(android.R.id.content));
481 | }
482 |
483 | /**
484 | * 根据resType,查找对应的处理器
485 | *
486 | * @param resType
487 | * @return
488 | */
489 | private ISkinProcessor getProcessor(String resType) {
490 | for (ISkinProcessor processor : processors) {
491 | if (processor.getName().equals(resType) && !isProcessorDisabled(resType)) {
492 | return processor;
493 | }
494 | }
495 | return null;
496 | }
497 |
498 | /**
499 | * 解析皮肤语法 skin:resName:resType|skin:resName:resType|skin:resName:resType|...
500 | *
501 | * @param tagStr
502 | * @return
503 | */
504 | private List parseTag(String tagStr) {
505 | if (tagStr == null || tagStr.trim().length() == 0) {
506 | return null;
507 | }
508 | List skinItems = new ArrayList();
509 | String[] items = tagStr.split("\\|");
510 | for (String item : items) {
511 | if (!item.startsWith(SkinConfig.SKIN_STATEMENT_PREFIX)) {
512 | continue;
513 | }
514 | String[] resItems = item.split(":");
515 | if (resItems.length != 3) {
516 | continue;
517 | }
518 | SkinItem attr = new SkinItem(resItems[1], resItems[2]);
519 | skinItems.add(attr);
520 | }
521 | return skinItems;
522 | }
523 |
524 | /**
525 | * 异步为某个activity换肤
526 | *
527 | * @param activity
528 | */
529 | private void applyAsync(final Activity activity) {
530 | new Thread(new Runnable() {
531 | @Override
532 | public void run() {
533 | apply(activity);
534 | mAsyncLoadIndex++;
535 | if (mAsyncLoadIndex == mTotalActivities) {
536 | mIsChangingSkin = false;
537 | UITaskManager.getInstance().post(new Runnable() {
538 | @Override
539 | public void run() {
540 | mSkinChangingCallback.onComplete();
541 | }
542 | });
543 | }
544 | }
545 | }).start();
546 | }
547 |
548 | /**
549 | * 注册activity,在Activity.onCreate中setContentView之后调用
550 | *
551 | * @param activity
552 | */
553 | public void register(Activity activity) {
554 | synchronized (mLock) {
555 | mActivities.add(activity);
556 | }
557 | apply(activity);
558 | }
559 |
560 | /**
561 | * 注册activity,在Activity.onCreate中setContentView之后调用
562 | *
563 | * @param activity
564 | */
565 | public void registerAsync(Activity activity) {
566 | synchronized (mLock) {
567 | mActivities.add(activity);
568 | }
569 | applyAsync(activity);
570 | }
571 |
572 | /**
573 | * 反注册activity,在Activity.onDestroy中调用
574 | *
575 | * @param activity
576 | */
577 | public void unregister(Activity activity) {
578 | synchronized (mLock) {
579 | mActivities.remove(activity);
580 | }
581 | }
582 |
583 | private void loadSkinInternel() {
584 | if (isAsyncLoadSkin) {
585 | synchronized (mLock) {
586 | mTotalActivities = mActivities.size();
587 | mAsyncLoadIndex = 0;
588 | for (Activity activity : mActivities) {
589 | applyAsync(activity);
590 | }
591 | }
592 | } else {
593 | synchronized (mLock) {
594 | for (Activity activity : mActivities) {
595 | apply(activity);
596 | }
597 | }
598 | }
599 | }
600 |
601 | /**
602 | * 为单个view换肤
603 | *
604 | * @param activity
605 | * @param view
606 | */
607 | private void injectSkin(Activity activity, View view) {
608 | Object tag = view.getTag();
609 | String tagStr = null;
610 | if (tag instanceof String) {
611 | tagStr = (String) tag;
612 | }
613 | boolean isInUiThread = (Looper.myLooper() == Looper.getMainLooper());
614 | if (tagStr != null) {
615 | List skinItems = parseTag(tagStr);
616 | for (SkinItem skinItem : skinItems) {
617 | ISkinProcessor processor = getProcessor(skinItem.resType);
618 | if (processor != null) {
619 | processor.process(activity, view, skinItem.resName, mResourceManager, isInUiThread);
620 | }
621 | }
622 | }
623 | if (view instanceof ViewGroup) {
624 | ViewGroup container = (ViewGroup) view;
625 | for (int i = 0, n = container.getChildCount(); i < n; i++) {
626 | View child = container.getChildAt(i);
627 | injectSkin(activity, child);
628 | }
629 | }
630 | }
631 |
632 | /**
633 | * 为单个view换肤,用于为动态生成的view换肤
634 | *
635 | * @param view
636 | */
637 | public void injectSkin(View view) {
638 | injectSkin(null, view);
639 | }
640 |
641 | public void injectSkinAsync(final View view) {
642 | BackgroundTaskManager.getInstance().post(new Runnable() {
643 | @Override
644 | public void run() {
645 | injectSkin(view);
646 | }
647 | });
648 | }
649 | }
650 |
--------------------------------------------------------------------------------
/injor/src/com/injor/processor/ISkinProcessor.java:
--------------------------------------------------------------------------------
1 | package com.injor.processor;
2 |
3 | import android.app.Activity;
4 | import android.view.View;
5 |
6 | import com.injor.common.ResourceManager;
7 |
8 | /**
9 | * 皮肤处理器,每个处理器可处理一个resType,处理器由框架调用,扩展框架时只需实现不同的处理器并注册到框架
10 | *
11 | * @author hackware 2015.12.26
12 | *
13 | */
14 | public abstract class ISkinProcessor {
15 | /**
16 | * 为特定view换肤,这些参数均由框架传入
17 | *
18 | * @param activity
19 | * 当前view所在的activity,传入activity是为了让扩展性更强,比如通过皮肤调整界面亮度
20 | * @param view
21 | * 要换肤的view
22 | * @param resName
23 | * 资源名字
24 | * @param resourceManager
25 | * 用于获取资源
26 | * @param isInUiThread
27 | * 处理器是否运行在UI线程中,如果不是,则更改view时要使用UITaskManager.post(Runnable
28 | * runnable);
29 | */
30 | public void process(Activity activity, View view, String resName, ResourceManager resourceManager, boolean isInUiThread) {
31 | process(view, resName, resourceManager, isInUiThread);
32 | }
33 |
34 | public void process(View view, String resName, ResourceManager resourceManager, boolean isInUiThread) {
35 | }
36 |
37 | /**
38 | * 返回处理器要处理的resType
39 | *
40 | * @return
41 | */
42 | public abstract String getName();
43 | }
44 |
--------------------------------------------------------------------------------
/injor/src/com/injor/processor/impl/BackroundProcessor.java:
--------------------------------------------------------------------------------
1 | package com.injor.processor.impl;
2 |
3 | import android.graphics.drawable.Drawable;
4 | import android.view.View;
5 |
6 | import com.injor.common.ResourceManager;
7 | import com.injor.common.UITaskManager;
8 | import com.injor.main.SkinManager;
9 | import com.injor.processor.ISkinProcessor;
10 |
11 | /**
12 | * 处理background
13 | *
14 | * @author hackware 2015.12.26
15 | *
16 | */
17 | public class BackroundProcessor extends ISkinProcessor {
18 |
19 | @Override
20 | public void process(final View view, String resName, ResourceManager resourceManager, boolean isInUiThread) {
21 | final Drawable drawable = resourceManager.getDrawable(resName);
22 | if (drawable != null) {
23 | if (isInUiThread) {
24 | view.setBackgroundDrawable(drawable);
25 | } else {
26 | UITaskManager.getInstance().post(new Runnable() {
27 | @Override
28 | public void run() {
29 | view.setBackgroundDrawable(drawable);
30 | }
31 | });
32 | }
33 | } else {
34 | try {
35 | final int color = resourceManager.getColor(resName);
36 | if (isInUiThread) {
37 | view.setBackgroundColor(color);
38 | } else {
39 | UITaskManager.getInstance().post(new Runnable() {
40 | @Override
41 | public void run() {
42 | view.setBackgroundColor(color);
43 | }
44 | });
45 | }
46 | } catch (Exception e) {
47 | e.printStackTrace();
48 | }
49 | }
50 | }
51 |
52 | @Override
53 | public String getName() {
54 | return SkinManager.PROCESSOR_BACKGROUND;
55 | }
56 | }
57 |
--------------------------------------------------------------------------------
/injor/src/com/injor/processor/impl/DividerProcessor.java:
--------------------------------------------------------------------------------
1 | package com.injor.processor.impl;
2 |
3 | import android.graphics.drawable.Drawable;
4 | import android.view.View;
5 | import android.widget.ListView;
6 |
7 | import com.injor.common.ResourceManager;
8 | import com.injor.common.UITaskManager;
9 | import com.injor.main.SkinManager;
10 | import com.injor.processor.ISkinProcessor;
11 |
12 | /**
13 | * 处理listview的divider
14 | *
15 | * @author hackware 2015.12.26
16 | *
17 | */
18 | public class DividerProcessor extends ISkinProcessor {
19 |
20 | @Override
21 | public void process(View view, String resName, ResourceManager resourceManager, boolean isInUiThread) {
22 | if (view instanceof ListView) {
23 | final Drawable divider = resourceManager.getDrawable(resName);
24 | if (divider != null) {
25 | final ListView listView = (ListView) view;
26 | if (isInUiThread) {
27 | listView.setDivider(divider);
28 | } else {
29 | UITaskManager.getInstance().post(new Runnable() {
30 | @Override
31 | public void run() {
32 | listView.setDivider(divider);
33 | }
34 | });
35 | }
36 | }
37 | }
38 | }
39 |
40 | @Override
41 | public String getName() {
42 | return SkinManager.PROCESSOR_DIVIDER;
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/injor/src/com/injor/processor/impl/SrcProcessor.java:
--------------------------------------------------------------------------------
1 | package com.injor.processor.impl;
2 |
3 | import android.graphics.drawable.Drawable;
4 | import android.view.View;
5 | import android.widget.ImageView;
6 |
7 | import com.injor.common.ResourceManager;
8 | import com.injor.common.UITaskManager;
9 | import com.injor.main.SkinManager;
10 | import com.injor.processor.ISkinProcessor;
11 |
12 | /**
13 | * 处理ImageView的src
14 | *
15 | * @author hackware 2015.12.26
16 | *
17 | */
18 | public class SrcProcessor extends ISkinProcessor {
19 |
20 | @Override
21 | public void process(View view, String resName, ResourceManager resourceManager, boolean isInUiThread) {
22 | if (view instanceof ImageView) {
23 | final Drawable drawable = resourceManager.getDrawable(resName);
24 | if (drawable != null) {
25 | final ImageView imageView = (ImageView) view;
26 | if (isInUiThread) {
27 | imageView.setImageDrawable(drawable);
28 | } else {
29 | UITaskManager.getInstance().post(new Runnable() {
30 | @Override
31 | public void run() {
32 | imageView.setImageDrawable(drawable);
33 | }
34 | });
35 | }
36 | }
37 | }
38 | }
39 |
40 | @Override
41 | public String getName() {
42 | return SkinManager.PROCESSOR_SRC;
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/injor/src/com/injor/processor/impl/TextColorProcessor.java:
--------------------------------------------------------------------------------
1 | package com.injor.processor.impl;
2 |
3 | import android.content.res.ColorStateList;
4 | import android.view.View;
5 | import android.widget.TextView;
6 |
7 | import com.injor.common.ResourceManager;
8 | import com.injor.common.UITaskManager;
9 | import com.injor.main.SkinManager;
10 | import com.injor.processor.ISkinProcessor;
11 |
12 | /**
13 | * 处理TextView的textColor
14 | *
15 | * @author hackware 2015.12.26
16 | *
17 | */
18 | public class TextColorProcessor extends ISkinProcessor {
19 |
20 | @Override
21 | public void process(View view, String resName, ResourceManager resourceManager, boolean isInUiThread) {
22 | if (view instanceof TextView) {
23 | final ColorStateList colorList = resourceManager.getColorStateList(resName);
24 | if (colorList != null) {
25 | final TextView textView = (TextView) view;
26 | if (isInUiThread) {
27 | textView.setTextColor(colorList);
28 | } else {
29 | UITaskManager.getInstance().post(new Runnable() {
30 | @Override
31 | public void run() {
32 | textView.setTextColor(colorList);
33 | }
34 | });
35 | }
36 | }
37 | }
38 | }
39 |
40 | @Override
41 | public String getName() {
42 | return SkinManager.PROCESSOR_TEXT_COLOR;
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/injor/src/com/injor/processor/impl/TextProcessor.java:
--------------------------------------------------------------------------------
1 | package com.injor.processor.impl;
2 |
3 | import android.view.View;
4 | import android.widget.TextView;
5 |
6 | import com.injor.common.ResourceManager;
7 | import com.injor.common.UITaskManager;
8 | import com.injor.main.SkinManager;
9 | import com.injor.processor.ISkinProcessor;
10 |
11 | /**
12 | * 处理TextView的text,通过皮肤来换文案貌似没什么用,不过如果换了一个比较活泼的皮肤,如果想让文案也活泼一点,这就派上用场了
13 | * 同时,这样可以实现动态切换语言包
14 | *
15 | * @author hackware 2015.12.26
16 | *
17 | */
18 | public class TextProcessor extends ISkinProcessor {
19 |
20 | @Override
21 | public void process(View view, String resName, ResourceManager resourceManager, boolean isInUiThread) {
22 | if (view instanceof TextView) {
23 | final String str = resourceManager.getString(resName);
24 | if (str != null) {
25 | final TextView textView = (TextView) view;
26 | if (isInUiThread) {
27 | textView.setText(str);
28 | } else {
29 | UITaskManager.getInstance().post(new Runnable() {
30 | @Override
31 | public void run() {
32 | textView.setText(str);
33 | }
34 | });
35 | }
36 | }
37 | }
38 | }
39 |
40 | @Override
41 | public String getName() {
42 | return SkinManager.PROCESSOR_TEXT;
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/injor/src/com/injor/processor/impl/TextSizeProcessor.java:
--------------------------------------------------------------------------------
1 | package com.injor.processor.impl;
2 |
3 | import android.view.View;
4 | import android.widget.TextView;
5 |
6 | import com.injor.common.ResourceManager;
7 | import com.injor.common.UITaskManager;
8 | import com.injor.main.SkinManager;
9 | import com.injor.processor.ISkinProcessor;
10 |
11 | /**
12 | * 处理TextView的textSize
13 | *
14 | * @author hackware 2015.12.26
15 | *
16 | */
17 | public class TextSizeProcessor extends ISkinProcessor {
18 |
19 | @Override
20 | public void process(View view, String resName, ResourceManager resourceManager, boolean isInUiThread) {
21 | if (view instanceof TextView) {
22 | try {
23 | final float dimen = resourceManager.getDimension(resName);
24 | final TextView textView = (TextView) view;
25 | if (isInUiThread) {
26 | textView.setTextSize(dimen);
27 | } else {
28 | UITaskManager.getInstance().post(new Runnable() {
29 | @Override
30 | public void run() {
31 | textView.setTextSize(dimen);
32 | }
33 | });
34 | }
35 | } catch (Exception e) {
36 | e.printStackTrace();
37 | }
38 | }
39 | }
40 |
41 | @Override
42 | public String getName() {
43 | return SkinManager.PROCESSOR_TEXT_SIZE;
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/injor/src/com/injor/processor/impl/TypefaceProcessor.java:
--------------------------------------------------------------------------------
1 | package com.injor.processor.impl;
2 |
3 | import android.graphics.Typeface;
4 | import android.view.View;
5 | import android.widget.TextView;
6 |
7 | import com.injor.common.ResourceManager;
8 | import com.injor.common.UITaskManager;
9 | import com.injor.main.SkinManager;
10 | import com.injor.processor.ISkinProcessor;
11 |
12 | /**
13 | * 处理TextView的typeface,实现通过皮肤换字体
14 | *
15 | * @author hackware 2015.12.26
16 | *
17 | */
18 | public class TypefaceProcessor extends ISkinProcessor {
19 |
20 | @Override
21 | public void process(View view, String resName, ResourceManager resourceManager, boolean isInUiThread) {
22 | if (view instanceof TextView) {
23 | final Typeface typeface = resourceManager.getTypeface(resName);
24 | if (typeface != null) {
25 | final TextView textView = (TextView) view;
26 | if (isInUiThread) {
27 | textView.setTypeface(typeface);
28 | } else {
29 | UITaskManager.getInstance().post(new Runnable() {
30 | @Override
31 | public void run() {
32 | textView.setTypeface(typeface);
33 | }
34 | });
35 | }
36 | }
37 | }
38 | }
39 |
40 | @Override
41 | public String getName() {
42 | return SkinManager.PROCESSOR_TYPEFACE;
43 | }
44 | }
45 |
--------------------------------------------------------------------------------