... binders);
37 | }
38 |
--------------------------------------------------------------------------------
/mutiType/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | MutiRecyclerAdatper
3 |
4 |
--------------------------------------------------------------------------------
/mutiType/src/test/java/com/jerey/mutitype/ExampleUnitTest.java:
--------------------------------------------------------------------------------
1 | package com.jerey.mutitype;
2 |
3 | import org.junit.Test;
4 |
5 | import static org.junit.Assert.*;
6 |
7 | /**
8 | * Example local unit test, which will execute on the development machine (host).
9 | * @see Testing documentation
10 | */
11 | public class ExampleUnitTest {
12 | @Test
13 | public void addition_isCorrect() throws Exception {
14 | assertEquals(4, 2 + 2);
15 | }
16 | }
--------------------------------------------------------------------------------
/pic/choose_head.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jerey-Jobs/KeepGank/776b35819f1e713514420d0ba0f5efedd95a2025/pic/choose_head.gif
--------------------------------------------------------------------------------
/pic/pic0.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jerey-Jobs/KeepGank/776b35819f1e713514420d0ba0f5efedd95a2025/pic/pic0.jpg
--------------------------------------------------------------------------------
/pic/pic1.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jerey-Jobs/KeepGank/776b35819f1e713514420d0ba0f5efedd95a2025/pic/pic1.jpg
--------------------------------------------------------------------------------
/pic/pic10.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jerey-Jobs/KeepGank/776b35819f1e713514420d0ba0f5efedd95a2025/pic/pic10.jpg
--------------------------------------------------------------------------------
/pic/pic11.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jerey-Jobs/KeepGank/776b35819f1e713514420d0ba0f5efedd95a2025/pic/pic11.jpg
--------------------------------------------------------------------------------
/pic/pic13.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jerey-Jobs/KeepGank/776b35819f1e713514420d0ba0f5efedd95a2025/pic/pic13.jpg
--------------------------------------------------------------------------------
/pic/pic14.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jerey-Jobs/KeepGank/776b35819f1e713514420d0ba0f5efedd95a2025/pic/pic14.jpg
--------------------------------------------------------------------------------
/pic/pic15.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jerey-Jobs/KeepGank/776b35819f1e713514420d0ba0f5efedd95a2025/pic/pic15.jpg
--------------------------------------------------------------------------------
/pic/pic16.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jerey-Jobs/KeepGank/776b35819f1e713514420d0ba0f5efedd95a2025/pic/pic16.jpg
--------------------------------------------------------------------------------
/pic/pic17.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jerey-Jobs/KeepGank/776b35819f1e713514420d0ba0f5efedd95a2025/pic/pic17.jpg
--------------------------------------------------------------------------------
/pic/pic18.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jerey-Jobs/KeepGank/776b35819f1e713514420d0ba0f5efedd95a2025/pic/pic18.jpg
--------------------------------------------------------------------------------
/pic/pic19.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jerey-Jobs/KeepGank/776b35819f1e713514420d0ba0f5efedd95a2025/pic/pic19.jpg
--------------------------------------------------------------------------------
/pic/pic2.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jerey-Jobs/KeepGank/776b35819f1e713514420d0ba0f5efedd95a2025/pic/pic2.jpg
--------------------------------------------------------------------------------
/pic/pic3.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jerey-Jobs/KeepGank/776b35819f1e713514420d0ba0f5efedd95a2025/pic/pic3.jpg
--------------------------------------------------------------------------------
/pic/pic4.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jerey-Jobs/KeepGank/776b35819f1e713514420d0ba0f5efedd95a2025/pic/pic4.jpg
--------------------------------------------------------------------------------
/pic/pic5.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jerey-Jobs/KeepGank/776b35819f1e713514420d0ba0f5efedd95a2025/pic/pic5.jpg
--------------------------------------------------------------------------------
/pic/pic6.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jerey-Jobs/KeepGank/776b35819f1e713514420d0ba0f5efedd95a2025/pic/pic6.jpg
--------------------------------------------------------------------------------
/pic/pic7.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jerey-Jobs/KeepGank/776b35819f1e713514420d0ba0f5efedd95a2025/pic/pic7.jpg
--------------------------------------------------------------------------------
/pic/pic8.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jerey-Jobs/KeepGank/776b35819f1e713514420d0ba0f5efedd95a2025/pic/pic8.jpg
--------------------------------------------------------------------------------
/pic/pic9.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jerey-Jobs/KeepGank/776b35819f1e713514420d0ba0f5efedd95a2025/pic/pic9.jpg
--------------------------------------------------------------------------------
/searchview/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/searchview/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.library'
2 |
3 | android {
4 | compileSdkVersion COMPILE_SDK_VERSION
5 | buildToolsVersion BUILD_TOOLS_VERSION
6 |
7 | defaultConfig {
8 | minSdkVersion MIN_SDK_VERSION
9 | targetSdkVersion TARGET_SDK_VERSION
10 | versionCode 1
11 | versionName "1.0"
12 |
13 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
14 |
15 | }
16 | buildTypes {
17 | release {
18 | minifyEnabled false
19 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
20 | }
21 | }
22 | }
23 |
24 | dependencies {
25 | compile fileTree(include: ['*.jar'], dir: 'libs')
26 | androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
27 | exclude group: 'com.android.support', module: 'support-annotations'
28 | })
29 | compile "${APPCOMPAT_VERSION}"
30 | testCompile JUNIT_VERSION
31 | compile BUTTERKNIFE_VERSION
32 | annotationProcessor Butterknife_compiler
33 | compile SUPPORT_DESIGN
34 | compile 'com.android.support:cardview-v7:26.0.0-alpha1'
35 | compile RECYCLER_VERSION
36 | compile SUPPORT_ANNOTATIONS
37 | compile GLIDE
38 | compile 'com.github.CymChad:BaseRecyclerViewAdapterHelper:2.9.25'
39 | compile project(':mutiType')
40 | compile 'io.reactivex:rxandroid:0.24.0'
41 | }
42 |
--------------------------------------------------------------------------------
/searchview/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # By default, the flags in this file are appended to flags specified
3 | # in /home/xiamin/Android/Sdk/tools/proguard/proguard-android.txt
4 | # You can edit the include path and order by changing the proguardFiles
5 | # directive in build.gradle.
6 | #
7 | # For more details, see
8 | # http://developer.android.com/guide/developing/tools/proguard.html
9 |
10 | # Add any project specific keep options here:
11 |
12 | # If your project uses WebView with JS, uncomment the following
13 | # and specify the fully qualified class name to the JavaScript interface
14 | # class:
15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16 | # public *;
17 | #}
18 |
19 | # Uncomment this to preserve the line number information for
20 | # debugging stack traces.
21 | #-keepattributes SourceFile,LineNumberTable
22 |
23 | # If you keep the line number information, uncomment this to
24 | # hide the original source file name.
25 | #-renamesourcefileattribute SourceFile
26 |
--------------------------------------------------------------------------------
/searchview/src/androidTest/java/com/jerey/searchview/ExampleInstrumentedTest.java:
--------------------------------------------------------------------------------
1 | package com.jerey.searchview;
2 |
3 | import android.content.Context;
4 | import android.support.test.InstrumentationRegistry;
5 | import android.support.test.runner.AndroidJUnit4;
6 |
7 | import org.junit.Test;
8 | import org.junit.runner.RunWith;
9 |
10 | import static org.junit.Assert.*;
11 |
12 | /**
13 | * Instrumentation test, which will execute on an Android device.
14 | * @see Testing documentation
15 | */
16 | @RunWith(AndroidJUnit4.class)
17 | public class ExampleInstrumentedTest {
18 | @Test
19 | public void useAppContext() throws Exception {
20 | // Context of the app under test.
21 | Context appContext = InstrumentationRegistry.getTargetContext();
22 |
23 | assertEquals("com.jerey.searchview.test", appContext.getPackageName());
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/searchview/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
5 |
6 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/searchview/src/main/java/com/jerey/searchview/KeyboardUtils.java:
--------------------------------------------------------------------------------
1 | package com.jerey.searchview;
2 |
3 | import android.content.Context;
4 | import android.view.View;
5 | import android.view.inputmethod.InputMethodManager;
6 |
7 |
8 | public class KeyboardUtils {
9 | private KeyboardUtils() {
10 | throw new UnsupportedOperationException("u can't instantiate me...");
11 | }
12 |
13 | /*
14 | 避免输入法面板遮挡
15 | 在manifest.xml中activity中设置
16 | android:windowSoftInputMode="adjustPan"
17 | */
18 |
19 | /**
20 | * 动态显示软键盘
21 | *
22 | * @param view 视图
23 | */
24 | public static void showSoftInput(final View view, Context context) {
25 | view.setFocusable(true);
26 | view.setFocusableInTouchMode(true);
27 | view.requestFocus();
28 | InputMethodManager imm = (InputMethodManager) context.getSystemService(Context.INPUT_METHOD_SERVICE);
29 | if (imm == null) return;
30 | imm.showSoftInput(view, InputMethodManager.SHOW_FORCED);
31 | }
32 |
33 | /**
34 | * 动态隐藏软键盘
35 | *
36 | * @param view 视图
37 | */
38 | public static void hideSoftInput(final View view, Context context) {
39 | InputMethodManager imm = (InputMethodManager) context.getSystemService(Context.INPUT_METHOD_SERVICE);
40 | if (imm == null) return;
41 | imm.hideSoftInputFromWindow(view.getWindowToken(), 0);
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/searchview/src/main/res/drawable/ic_arrow_back_black_24dp.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/searchview/src/main/res/drawable/ic_clean_input.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/searchview/src/main/res/drawable/ic_history_black_24dp.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/searchview/src/main/res/drawable/ic_search_black_24dp.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/searchview/src/main/res/drawable/recycler_touch_bg.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/searchview/src/main/res/layout/view_rv_item.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
16 |
17 |
27 |
--------------------------------------------------------------------------------
/searchview/src/main/res/values/attrs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/searchview/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | #d1d1d1
8 |
9 |
--------------------------------------------------------------------------------
/searchview/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | SearchView
3 |
4 |
--------------------------------------------------------------------------------
/searchview/src/test/java/com/jerey/searchview/ExampleUnitTest.java:
--------------------------------------------------------------------------------
1 | package com.jerey.searchview;
2 |
3 | import org.junit.Test;
4 |
5 | import static org.junit.Assert.*;
6 |
7 | /**
8 | * Example local unit test, which will execute on the development machine (host).
9 | * @see Testing documentation
10 | */
11 | public class ExampleUnitTest {
12 | @Test
13 | public void addition_isCorrect() throws Exception {
14 | assertEquals(4, 2 + 2);
15 | }
16 | }
--------------------------------------------------------------------------------
/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app', ':lrucache', ':themelib', ':theme-night', ':theme-ocean', ':downloadmanager', ':footerrecyclerview', ':searchview', ':mutiType', ':animationlib'
2 |
--------------------------------------------------------------------------------
/theme-night/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/theme-night/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.application'
2 |
3 | android {
4 | compileSdkVersion COMPILE_SDK_VERSION
5 | buildToolsVersion BUILD_TOOLS_VERSION
6 |
7 | defaultConfig {
8 | applicationId "com.jerey.theme_night"
9 | minSdkVersion MIN_SDK_VERSION
10 | targetSdkVersion TARGET_SDK_VERSION
11 | versionCode 1
12 | versionName "1.0"
13 |
14 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
15 |
16 | }
17 | buildTypes {
18 | release {
19 | minifyEnabled false
20 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
21 | }
22 | }
23 | }
24 |
25 | dependencies {
26 | }
27 |
--------------------------------------------------------------------------------
/theme-night/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # By default, the flags in this file are appended to flags specified
3 | # in /home/xiamin/Android/Sdk/tools/proguard/proguard-android.txt
4 | # You can edit the include path and order by changing the proguardFiles
5 | # directive in build.gradle.
6 | #
7 | # For more details, see
8 | # http://developer.android.com/guide/developing/tools/proguard.html
9 |
10 | # Add any project specific keep options here:
11 |
12 | # If your project uses WebView with JS, uncomment the following
13 | # and specify the fully qualified class name to the JavaScript interface
14 | # class:
15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16 | # public *;
17 | #}
18 |
19 | # Uncomment this to preserve the line number information for
20 | # debugging stack traces.
21 | #-keepattributes SourceFile,LineNumberTable
22 |
23 | # If you keep the line number information, uncomment this to
24 | # hide the original source file name.
25 | #-renamesourcefileattribute SourceFile
26 |
--------------------------------------------------------------------------------
/theme-night/src/androidTest/java/com/jerey/theme_night/ExampleInstrumentedTest.java:
--------------------------------------------------------------------------------
1 | package com.jerey.theme_night;
2 |
3 | import android.content.Context;
4 | import android.support.test.InstrumentationRegistry;
5 | import android.support.test.runner.AndroidJUnit4;
6 |
7 | import org.junit.Test;
8 | import org.junit.runner.RunWith;
9 |
10 | import static org.junit.Assert.*;
11 |
12 | /**
13 | * Instrumentation test, which will execute on an Android device.
14 | *
15 | * @see Testing documentation
16 | */
17 | @RunWith(AndroidJUnit4.class)
18 | public class ExampleInstrumentedTest {
19 | @Test
20 | public void useAppContext() throws Exception {
21 | // Context of the app under test.
22 | Context appContext = InstrumentationRegistry.getTargetContext();
23 |
24 | assertEquals("com.jerey.theme_night", appContext.getPackageName());
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/theme-night/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/theme-night/src/main/res/drawable/bg_green.xml:
--------------------------------------------------------------------------------
1 |
3 |
5 |
6 |
--------------------------------------------------------------------------------
/theme-night/src/main/res/drawable/bg_grey.xml:
--------------------------------------------------------------------------------
1 |
3 |
5 |
6 |
--------------------------------------------------------------------------------
/theme-night/src/main/res/drawable/bg_pink.xml:
--------------------------------------------------------------------------------
1 |
3 |
5 |
6 |
--------------------------------------------------------------------------------
/theme-night/src/main/res/drawable/bg_progressbar_color.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | -
6 |
7 |
8 |
9 |
10 |
11 | -
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/theme-night/src/main/res/drawable/bg_red.xml:
--------------------------------------------------------------------------------
1 |
3 |
5 |
6 |
--------------------------------------------------------------------------------
/theme-night/src/main/res/drawable/bg_yellow.xml:
--------------------------------------------------------------------------------
1 |
3 |
5 |
6 |
--------------------------------------------------------------------------------
/theme-night/src/main/res/drawable/ic_type_github.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
10 |
--------------------------------------------------------------------------------
/theme-night/src/main/res/drawable/ic_type_github_circle_white_24dp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jerey-Jobs/KeepGank/776b35819f1e713514420d0ba0f5efedd95a2025/theme-night/src/main/res/drawable/ic_type_github_circle_white_24dp.png
--------------------------------------------------------------------------------
/theme-night/src/main/res/mipmap-xxhdpi/ic_menu.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jerey-Jobs/KeepGank/776b35819f1e713514420d0ba0f5efedd95a2025/theme-night/src/main/res/mipmap-xxhdpi/ic_menu.png
--------------------------------------------------------------------------------
/theme-night/src/main/res/values/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 16dp
4 | 16dp
5 | 48dp
6 | 32dp
7 | 24dp
8 | 16dp
9 | 8dp
10 | 4dp
11 |
12 | 40dp
13 |
14 | 72dp
15 | 240dp
16 | 80dp
17 |
18 |
--------------------------------------------------------------------------------
/theme-night/src/test/java/com/jerey/theme_night/ExampleUnitTest.java:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jerey-Jobs/KeepGank/776b35819f1e713514420d0ba0f5efedd95a2025/theme-night/src/test/java/com/jerey/theme_night/ExampleUnitTest.java
--------------------------------------------------------------------------------
/theme-ocean/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/theme-ocean/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.application'
2 |
3 | android {
4 | compileSdkVersion COMPILE_SDK_VERSION
5 | buildToolsVersion BUILD_TOOLS_VERSION
6 |
7 | defaultConfig {
8 | applicationId "com.jerey.theme_ocean"
9 | minSdkVersion MIN_SDK_VERSION
10 | targetSdkVersion TARGET_SDK_VERSION
11 | versionCode 1
12 | versionName "1.0"
13 |
14 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
15 |
16 | }
17 | buildTypes {
18 | release {
19 | minifyEnabled false
20 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
21 | }
22 | }
23 | }
24 |
25 |
--------------------------------------------------------------------------------
/theme-ocean/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # By default, the flags in this file are appended to flags specified
3 | # in /home/xiamin/Android/Sdk/tools/proguard/proguard-android.txt
4 | # You can edit the include path and order by changing the proguardFiles
5 | # directive in build.gradle.
6 | #
7 | # For more details, see
8 | # http://developer.android.com/guide/developing/tools/proguard.html
9 |
10 | # Add any project specific keep options here:
11 |
12 | # If your project uses WebView with JS, uncomment the following
13 | # and specify the fully qualified class name to the JavaScript interface
14 | # class:
15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16 | # public *;
17 | #}
18 |
19 | # Uncomment this to preserve the line number information for
20 | # debugging stack traces.
21 | #-keepattributes SourceFile,LineNumberTable
22 |
23 | # If you keep the line number information, uncomment this to
24 | # hide the original source file name.
25 | #-renamesourcefileattribute SourceFile
26 |
--------------------------------------------------------------------------------
/theme-ocean/src/androidTest/java/com/jerey/theme_ocean/ExampleInstrumentedTest.java:
--------------------------------------------------------------------------------
1 | package com.jerey.theme_ocean;
2 |
3 | import android.content.Context;
4 | import android.support.test.InstrumentationRegistry;
5 | import android.support.test.runner.AndroidJUnit4;
6 |
7 | import org.junit.Test;
8 | import org.junit.runner.RunWith;
9 |
10 | import static org.junit.Assert.*;
11 |
12 | /**
13 | * Instrumentation test, which will execute on an Android device.
14 | *
15 | * @see Testing documentation
16 | */
17 | @RunWith(AndroidJUnit4.class)
18 | public class ExampleInstrumentedTest {
19 | @Test
20 | public void useAppContext() throws Exception {
21 | // Context of the app under test.
22 | Context appContext = InstrumentationRegistry.getTargetContext();
23 |
24 | assertEquals("com.jerey.theme_ocean", appContext.getPackageName());
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/theme-ocean/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
5 |
6 |
--------------------------------------------------------------------------------
/theme-ocean/src/main/res/drawable/bg_green.xml:
--------------------------------------------------------------------------------
1 |
3 |
5 |
6 |
--------------------------------------------------------------------------------
/theme-ocean/src/main/res/drawable/bg_grey.xml:
--------------------------------------------------------------------------------
1 |
3 |
5 |
6 |
--------------------------------------------------------------------------------
/theme-ocean/src/main/res/drawable/bg_pink.xml:
--------------------------------------------------------------------------------
1 |
3 |
5 |
6 |
--------------------------------------------------------------------------------
/theme-ocean/src/main/res/drawable/bg_progressbar_color.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | -
6 |
7 |
8 |
9 |
10 |
11 | -
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/theme-ocean/src/main/res/drawable/bg_red.xml:
--------------------------------------------------------------------------------
1 |
3 |
5 |
6 |
--------------------------------------------------------------------------------
/theme-ocean/src/main/res/drawable/bg_yellow.xml:
--------------------------------------------------------------------------------
1 |
3 |
5 |
6 |
--------------------------------------------------------------------------------
/theme-ocean/src/main/res/drawable/ic_type_github.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
10 |
--------------------------------------------------------------------------------
/theme-ocean/src/main/res/drawable/ic_type_github_circle_white_24dp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jerey-Jobs/KeepGank/776b35819f1e713514420d0ba0f5efedd95a2025/theme-ocean/src/main/res/drawable/ic_type_github_circle_white_24dp.png
--------------------------------------------------------------------------------
/theme-ocean/src/main/res/mipmap-xxhdpi/ic_menu.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jerey-Jobs/KeepGank/776b35819f1e713514420d0ba0f5efedd95a2025/theme-ocean/src/main/res/mipmap-xxhdpi/ic_menu.png
--------------------------------------------------------------------------------
/theme-ocean/src/main/res/values/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 16dp
4 | 16dp
5 | 48dp
6 | 32dp
7 | 24dp
8 | 16dp
9 | 8dp
10 | 4dp
11 |
12 | 40dp
13 |
14 | 72dp
15 | 240dp
16 | 80dp
17 |
18 |
--------------------------------------------------------------------------------
/theme-ocean/src/test/java/com/jerey/theme_ocean/ExampleUnitTest.java:
--------------------------------------------------------------------------------
1 | package com.jerey.theme_ocean;
2 |
3 | import org.junit.Test;
4 |
5 | import static org.junit.Assert.*;
6 |
7 | /**
8 | * Example local unit test, which will execute on the development machine (host).
9 | *
10 | * @see Testing documentation
11 | */
12 | public class ExampleUnitTest {
13 | @Test
14 | public void addition_isCorrect() throws Exception {
15 | assertEquals(4, 2 + 2);
16 | }
17 | }
--------------------------------------------------------------------------------
/themelib/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/themelib/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.library'
2 |
3 | android {
4 | compileSdkVersion COMPILE_SDK_VERSION
5 | buildToolsVersion BUILD_TOOLS_VERSION
6 |
7 | defaultConfig {
8 | minSdkVersion MIN_SDK_VERSION
9 | targetSdkVersion TARGET_SDK_VERSION
10 | versionCode 1
11 | versionName "1.0"
12 |
13 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
14 |
15 | }
16 | buildTypes {
17 | release {
18 | minifyEnabled false
19 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
20 | }
21 | }
22 | }
23 |
24 | dependencies {
25 | compile fileTree(include: ['*.jar'], dir: 'libs')
26 | androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
27 | exclude group: 'com.android.support', module: 'support-annotations'
28 | })
29 | compile APPCOMPAT_VERSION
30 | testCompile JUNIT_VERSION
31 | compile SUPPORT_DESIGN
32 | compile project(':downloadmanager')
33 | compile 'com.githang:status-bar-compat:0.5.3'
34 | compile 'com.android.support:cardview-v7:26.0.0-alpha1'
35 | }
36 |
--------------------------------------------------------------------------------
/themelib/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # By default, the flags in this file are appended to flags specified
3 | # in /home/xiamin/Android/Sdk/tools/proguard/proguard-android.txt
4 | # You can edit the include path and order by changing the proguardFiles
5 | # directive in build.gradle.
6 | #
7 | # For more details, see
8 | # http://developer.android.com/guide/developing/tools/proguard.html
9 |
10 | # Add any project specific keep options here:
11 |
12 | # If your project uses WebView with JS, uncomment the following
13 | # and specify the fully qualified class name to the JavaScript interface
14 | # class:
15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16 | # public *;
17 | #}
18 |
19 | # Uncomment this to preserve the line number information for
20 | # debugging stack traces.
21 | #-keepattributes SourceFile,LineNumberTable
22 |
23 | # If you keep the line number information, uncomment this to
24 | # hide the original source file name.
25 | #-renamesourcefileattribute SourceFile
26 |
--------------------------------------------------------------------------------
/themelib/src/androidTest/java/com/jerey/themelib/ExampleInstrumentedTest.java:
--------------------------------------------------------------------------------
1 | package com.jerey.themelib;
2 |
3 | import android.content.Context;
4 | import android.support.test.InstrumentationRegistry;
5 | import android.support.test.runner.AndroidJUnit4;
6 |
7 | import org.junit.Test;
8 | import org.junit.runner.RunWith;
9 |
10 | import static org.junit.Assert.*;
11 |
12 | /**
13 | * Instrumentation test, which will execute on an Android device.
14 | *
15 | * @see Testing documentation
16 | */
17 | @RunWith(AndroidJUnit4.class)
18 | public class ExampleInstrumentedTest {
19 | @Test
20 | public void useAppContext() throws Exception {
21 | // Context of the app under test.
22 | Context appContext = InstrumentationRegistry.getTargetContext();
23 |
24 | assertEquals("com.jerey.themelib.test", appContext.getPackageName());
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/themelib/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
5 |
6 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/themelib/src/main/java/com/jerey/themelib/IDynamicNewView.java:
--------------------------------------------------------------------------------
1 | package com.jerey.themelib;
2 |
3 | import android.view.View;
4 | import android.widget.TextView;
5 |
6 | import com.jerey.themelib.attr.base.DynamicAttr;
7 |
8 | import java.util.List;
9 |
10 |
11 | /**
12 | * 动态添加View接口
13 | */
14 | public interface IDynamicNewView {
15 | void dynamicAddView(View view, List pDAttrs);
16 |
17 | void dynamicAddView(View view, String attrName, int attrValueResId);
18 |
19 | /**
20 | * add the textview for font switch
21 | *
22 | * @param textView textview
23 | */
24 | void dynamicAddFontView(TextView textView);
25 | }
26 |
--------------------------------------------------------------------------------
/themelib/src/main/java/com/jerey/themelib/ISkinUpdate.java:
--------------------------------------------------------------------------------
1 | package com.jerey.themelib;
2 |
3 |
4 | public interface ISkinUpdate {
5 | void onThemeUpdate();
6 | }
7 |
--------------------------------------------------------------------------------
/themelib/src/main/java/com/jerey/themelib/SkinItem.java:
--------------------------------------------------------------------------------
1 | package com.jerey.themelib;
2 |
3 | import android.view.View;
4 |
5 | import com.jerey.themelib.attr.base.SkinAttr;
6 | import com.jerey.themelib.utils.SkinListUtils;
7 |
8 | import java.util.ArrayList;
9 | import java.util.List;
10 |
11 | /**
12 | * 含有skin属性的bean
13 | * View与attr是一对多的关系
14 | */
15 | public class SkinItem {
16 |
17 | public View view;
18 |
19 | public List attrs;
20 |
21 | public SkinItem() {
22 | attrs = new ArrayList<>();
23 | }
24 |
25 | /**
26 | * 对我们每个需要修改的attrs,都需要apply一下
27 | */
28 | public void apply() {
29 | if (SkinListUtils.isEmpty(attrs)) {
30 | return;
31 | }
32 | for (SkinAttr at : attrs) {
33 | at.apply(view);
34 | }
35 | }
36 |
37 | public void clean() {
38 | if (!SkinListUtils.isEmpty(attrs)) {
39 | attrs.clear();
40 | }
41 | }
42 |
43 | @Override
44 | public String toString() {
45 | return "SkinItem [view=" + view.getClass().getSimpleName() + ", attrs=" + attrs + "]";
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/themelib/src/main/java/com/jerey/themelib/SkinLoaderListener.java:
--------------------------------------------------------------------------------
1 | package com.jerey.themelib;
2 |
3 | /**
4 | * 皮肤加载监听器
5 | */
6 | public interface SkinLoaderListener {
7 | void onStart();
8 |
9 | void onSuccess();
10 |
11 | void onFailed(String errMsg);
12 |
13 | /**
14 | * called when from network load skin
15 | *
16 | * @param progress download progress
17 | */
18 | void onProgress(int progress);
19 | }
20 |
--------------------------------------------------------------------------------
/themelib/src/main/java/com/jerey/themelib/attr/BackgroundAttr.java:
--------------------------------------------------------------------------------
1 | package com.jerey.themelib.attr;
2 |
3 | import android.graphics.drawable.Drawable;
4 | import android.view.View;
5 |
6 | import com.jerey.themelib.attr.base.SkinAttr;
7 | import com.jerey.themelib.utils.SkinResourcesUtils;
8 |
9 |
10 | public class BackgroundAttr extends SkinAttr {
11 |
12 | @Override
13 | public void apply(View view) {
14 | if (isColor()) {
15 | int color = SkinResourcesUtils.getColor(attrValueRefId);
16 | view.setBackgroundColor(color);
17 | } else if (isDrawable()) {
18 | Drawable bg = SkinResourcesUtils.getDrawable(attrValueRefId);
19 | view.setBackgroundDrawable(bg);
20 | }
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/themelib/src/main/java/com/jerey/themelib/attr/CardViewBackgroundAttr.java:
--------------------------------------------------------------------------------
1 | package com.jerey.themelib.attr;
2 |
3 | import android.support.v7.widget.CardView;
4 | import android.view.View;
5 |
6 | import com.jerey.themelib.attr.base.SkinAttr;
7 | import com.jerey.themelib.utils.SkinResourcesUtils;
8 |
9 | /**
10 | * @author xiamin
11 | * @date 9/18/17.
12 | */
13 | public class CardViewBackgroundAttr extends SkinAttr {
14 |
15 | @Override
16 | public void apply(View view) {
17 | if (view instanceof CardView) {
18 | CardView cardView = (CardView) view;
19 | cardView.setCardBackgroundColor(SkinResourcesUtils.getColor(attrValueRefId));
20 | }
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/themelib/src/main/java/com/jerey/themelib/attr/ContentScrimColorAttr.java:
--------------------------------------------------------------------------------
1 | package com.jerey.themelib.attr;
2 |
3 | import android.support.design.widget.CollapsingToolbarLayout;
4 | import android.util.Log;
5 | import android.view.View;
6 |
7 | import com.jerey.themelib.attr.base.SkinAttr;
8 | import com.jerey.themelib.utils.SkinResourcesUtils;
9 |
10 | /**
11 | * Created by xiamin on 6/8/17.
12 | */
13 |
14 | public class ContentScrimColorAttr extends SkinAttr {
15 | @Override
16 | public void apply(View view) {
17 | if (view instanceof CollapsingToolbarLayout) {
18 | CollapsingToolbarLayout toolbar = (CollapsingToolbarLayout) view;
19 | Log.e("ContentScrimColorAttr", toString());
20 | if (isColor()) {
21 | toolbar.setContentScrimColor(SkinResourcesUtils.getColor(attrValueRefId));
22 | }
23 | }
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/themelib/src/main/java/com/jerey/themelib/attr/ImageViewSrcAttr.java:
--------------------------------------------------------------------------------
1 | package com.jerey.themelib.attr;
2 |
3 | import android.view.View;
4 | import android.widget.ImageView;
5 |
6 | import com.jerey.themelib.attr.base.SkinAttr;
7 | import com.jerey.themelib.utils.SkinResourcesUtils;
8 |
9 |
10 | public class ImageViewSrcAttr extends SkinAttr {
11 | @Override
12 | public void apply(View view) {
13 | if (view instanceof ImageView) {
14 | ImageView iv = (ImageView) view;
15 | if (isDrawable()) {
16 | iv.setImageDrawable(SkinResourcesUtils.getDrawable(attrValueRefId));
17 | } else if (isColor()) {
18 | iv.setBackgroundColor(SkinResourcesUtils.getColor(attrValueRefId));
19 | }
20 | }
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/themelib/src/main/java/com/jerey/themelib/attr/NavigationIconAttr.java:
--------------------------------------------------------------------------------
1 | package com.jerey.themelib.attr;
2 |
3 | import android.support.v7.widget.Toolbar;
4 | import android.util.Log;
5 | import android.view.View;
6 |
7 | import com.jerey.themelib.attr.base.SkinAttr;
8 | import com.jerey.themelib.utils.SkinResourcesUtils;
9 |
10 | /**
11 | * Created by xiamin on 6/8/17.
12 | */
13 |
14 | public class NavigationIconAttr extends SkinAttr {
15 | @Override
16 | public void apply(View view) {
17 | if (view instanceof Toolbar) {
18 | Toolbar toolbar = (Toolbar) view;
19 | if (isDrawable()) {
20 | Log.e("NavigationIconAttr", "RES_TYPE_NAME_DRAWABLE.equals(attrValueTypeName)");
21 | Log.e("NavigationIconAttr", toString());
22 | toolbar.setNavigationIcon(SkinResourcesUtils.getDrawable(attrValueRefId));
23 | }
24 | }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/themelib/src/main/java/com/jerey/themelib/attr/TabLayoutIndicatorAttr.java:
--------------------------------------------------------------------------------
1 | package com.jerey.themelib.attr;
2 |
3 | import android.support.design.widget.TabLayout;
4 | import android.view.View;
5 |
6 | import com.jerey.themelib.attr.base.SkinAttr;
7 | import com.jerey.themelib.utils.SkinResourcesUtils;
8 |
9 | public class TabLayoutIndicatorAttr extends SkinAttr {
10 | @Override
11 | public void apply(View view) {
12 | if (view instanceof TabLayout) {
13 | TabLayout tl = (TabLayout) view;
14 | if (RES_TYPE_NAME_COLOR.equals(attrValueTypeName)) {
15 | int color = SkinResourcesUtils.getColor(attrValueRefId);
16 | tl.setSelectedTabIndicatorColor(color);
17 | }
18 | }
19 | }
20 | }
--------------------------------------------------------------------------------
/themelib/src/main/java/com/jerey/themelib/attr/TextColorAttr.java:
--------------------------------------------------------------------------------
1 | package com.jerey.themelib.attr;
2 |
3 | import android.view.View;
4 | import android.widget.TextView;
5 |
6 | import com.jerey.themelib.attr.base.SkinAttr;
7 | import com.jerey.themelib.utils.SkinResourcesUtils;
8 |
9 |
10 | public class TextColorAttr extends SkinAttr {
11 | @Override
12 | public void apply(View view) {
13 | if (view instanceof TextView) {
14 | TextView tv = (TextView) view;
15 | if (RES_TYPE_NAME_COLOR.equals(attrValueTypeName)) {
16 | tv.setTextColor(SkinResourcesUtils.getColorStateList(attrValueRefId));
17 | }
18 | }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/themelib/src/main/java/com/jerey/themelib/attr/base/DynamicAttr.java:
--------------------------------------------------------------------------------
1 | package com.jerey.themelib.attr.base;
2 |
3 | import android.support.annotation.AnyRes;
4 |
5 | /**
6 | * Created by _SOLID
7 | * Date:2016/4/14
8 | * Time:10:21
9 | */
10 | public class DynamicAttr {
11 | /**
12 | * attr name,defined from {@link AttrFactory}
13 | */
14 | public String attrName;
15 |
16 | /**
17 | * resource id from default context,eg: "R.drawable.app_bg"
18 | */
19 | public int refResId;
20 |
21 | public DynamicAttr(String attrName, @AnyRes int refResId) {
22 | this.attrName = attrName;
23 | this.refResId = refResId;
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/themelib/src/main/java/com/jerey/themelib/base/SkinBaseApplication.java:
--------------------------------------------------------------------------------
1 | package com.jerey.themelib.base;
2 |
3 | import android.app.Application;
4 |
5 | import com.jerey.themelib.SkinConfig;
6 | import com.jerey.themelib.loader.SkinManager;
7 | import com.jerey.themelib.utils.SkinFileUtils;
8 |
9 | import java.io.File;
10 | import java.io.IOException;
11 |
12 | public class SkinBaseApplication extends Application {
13 |
14 | public void onCreate() {
15 |
16 | super.onCreate();
17 | initSkinLoader();
18 | }
19 |
20 | /**
21 | * Must call init first
22 | */
23 | private void initSkinLoader() {
24 | setUpSkinFile();
25 | SkinManager.getInstance().init(this);
26 | SkinManager.getInstance().loadSkin();
27 | }
28 |
29 | private void setUpSkinFile() {
30 | try {
31 | String[] skinFiles = getAssets().list(SkinConfig.SKIN_DIR_NAME);
32 | for (String fileName : skinFiles) {
33 | File file = new File(SkinFileUtils.getSkinDir(this), fileName);
34 | if (!file.exists())
35 | SkinFileUtils.copySkinAssetsToDir(this, fileName, SkinFileUtils.getSkinDir(this));
36 | }
37 | } catch (IOException e) {
38 | e.printStackTrace();
39 | }
40 | }
41 |
42 |
43 | }
44 |
--------------------------------------------------------------------------------
/themelib/src/main/java/com/jerey/themelib/loader/ISkinLoader.java:
--------------------------------------------------------------------------------
1 | package com.jerey.themelib.loader;
2 |
3 |
4 | import com.jerey.themelib.ISkinUpdate;
5 |
6 | /**
7 | *
8 | * 用来添加、删除需要皮肤更新的界面以及通知界面皮肤更新
9 | */
10 | public interface ISkinLoader {
11 | void attach(ISkinUpdate observer);
12 |
13 | void detach(ISkinUpdate observer);
14 |
15 | void notifySkinUpdate();
16 | }
17 |
--------------------------------------------------------------------------------
/themelib/src/main/java/com/jerey/themelib/loader/TextViewRepository.java:
--------------------------------------------------------------------------------
1 | package com.jerey.themelib.loader;
2 |
3 | import android.graphics.Typeface;
4 | import android.widget.TextView;
5 |
6 | import com.jerey.themelib.utils.TypefaceUtils;
7 |
8 | import java.lang.ref.WeakReference;
9 | import java.util.ArrayList;
10 |
11 | /**
12 | * 字体改变工厂
13 | */
14 | public class TextViewRepository {
15 | private static final String TAG = "TextViewRepository";
16 | /**
17 | * 虽使用了弱引用来解决TextView得不到释放的问题,但是没有效果,内存中的TextView依旧在不断增多.
18 | * 即使不加入列表里面,TextView数量依旧是在使用过程中中变多
19 | */
20 | private static ArrayList> mTextViewsWeakList = new ArrayList<>();
21 |
22 | public static void add(TextView textView) {
23 | mTextViewsWeakList.add(new WeakReference(textView));
24 | textView.setTypeface(TypefaceUtils.CURRENT_TYPEFACE);
25 | // Log.d(TAG, "TextViewRepository mTextViews count: " + mTextViewsWeakList.size());
26 | }
27 |
28 | public static void clear() {
29 | mTextViewsWeakList.clear();
30 | }
31 |
32 | public static void remove(TextView textView) {
33 | mTextViewsWeakList.remove(new WeakReference(textView));
34 | }
35 |
36 | public static void applyFont(Typeface tf) {
37 | for (WeakReference textViewWeak : mTextViewsWeakList) {
38 | TextView textView = textViewWeak.get();
39 | if (textView != null) {
40 | textView.setTypeface(tf);
41 | }
42 | }
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/themelib/src/main/java/com/jerey/themelib/utils/SkinL.java:
--------------------------------------------------------------------------------
1 | package com.jerey.themelib.utils;
2 |
3 | import android.util.Log;
4 |
5 | import com.jerey.themelib.SkinConfig;
6 |
7 |
8 | /**
9 | * Skin log库
10 | */
11 | public class SkinL {
12 | public static void i(String tag, String msg) {
13 | if (SkinConfig.isDebug()) {
14 | Log.i(tag, msg);
15 | }
16 | }
17 |
18 | public static void w(String tag, String msg) {
19 | if (SkinConfig.isDebug()) {
20 | Log.w(tag, msg);
21 | }
22 | }
23 |
24 | public static void e(String tag, String msg) {
25 | if (SkinConfig.isDebug()) {
26 | Log.e(tag, msg);
27 | }
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/themelib/src/main/java/com/jerey/themelib/utils/SkinResourcesUtils.java:
--------------------------------------------------------------------------------
1 | package com.jerey.themelib.utils;
2 |
3 | import android.content.res.ColorStateList;
4 | import android.graphics.drawable.Drawable;
5 |
6 | import com.jerey.themelib.loader.SkinManager;
7 |
8 | /**
9 | * 从插件皮肤包中获取资源工具类
10 | */
11 | public class SkinResourcesUtils {
12 |
13 | public static int getColor(int resId) {
14 | return SkinManager.getInstance().getColor(resId);
15 | }
16 |
17 | public static Drawable getDrawable(int resId) {
18 | return SkinManager.getInstance().getDrawable(resId);
19 | }
20 |
21 | /**
22 | * get drawable from specific directory
23 | *
24 | * @param resId res id
25 | * @param dir res directory
26 | * @return drawable
27 | */
28 | public static Drawable getDrawable(int resId, String dir) {
29 | return SkinManager.getInstance().getDrawable(resId, dir);
30 | }
31 |
32 | public static ColorStateList getColorStateList(int resId) {
33 | return SkinManager.getInstance().getColorStateList(resId);
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/themelib/src/main/java/com/jerey/themelib/utils/TypefaceUtils.java:
--------------------------------------------------------------------------------
1 | package com.jerey.themelib.utils;
2 |
3 | import android.content.Context;
4 | import android.graphics.Typeface;
5 | import android.text.TextUtils;
6 |
7 | import com.jerey.themelib.SkinConfig;
8 |
9 | import java.io.File;
10 |
11 |
12 | /**
13 | * 加载字体工具类
14 | */
15 | public class TypefaceUtils {
16 |
17 | public static Typeface CURRENT_TYPEFACE;
18 |
19 | public static Typeface createTypeface(Context context, String fontName) {
20 | Typeface tf;
21 | if (!TextUtils.isEmpty(fontName)) {
22 | tf = Typeface.createFromAsset(context.getAssets(), getFontPath(fontName));
23 | SkinPreferencesUtils.putString(context, SkinConfig.PREF_FONT_PATH, getFontPath(fontName));
24 | } else {
25 | tf = Typeface.DEFAULT;
26 | SkinPreferencesUtils.putString(context, SkinConfig.PREF_FONT_PATH, "");
27 | }
28 | TypefaceUtils.CURRENT_TYPEFACE = tf;
29 | return tf;
30 | }
31 |
32 | /**
33 | * 从sp中读取字体入路径加载, 若没有,则为默认
34 | * @param context
35 | * @return
36 | */
37 | public static Typeface getTypeface(Context context) {
38 | String fontPath = SkinPreferencesUtils.getString(context, SkinConfig.PREF_FONT_PATH);
39 | Typeface tf;
40 | if (!TextUtils.isEmpty(fontPath)) {
41 | tf = Typeface.createFromAsset(context.getAssets(), fontPath);
42 | } else {
43 | tf = Typeface.DEFAULT;
44 | SkinPreferencesUtils.putString(context, SkinConfig.PREF_FONT_PATH, "");
45 | }
46 | return tf;
47 | }
48 |
49 | private static String getFontPath(String fontName) {
50 | return SkinConfig.FONT_DIR_NAME + File.separator + fontName;
51 | }
52 | }
53 |
--------------------------------------------------------------------------------
/themelib/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | themelib
3 |
4 |
--------------------------------------------------------------------------------
/themelib/src/test/java/com/jerey/themelib/ExampleUnitTest.java:
--------------------------------------------------------------------------------
1 | package com.jerey.themelib;
2 |
3 | import org.junit.Test;
4 |
5 | import static org.junit.Assert.*;
6 |
7 | /**
8 | * Example local unit test, which will execute on the development machine (host).
9 | *
10 | * @see Testing documentation
11 | */
12 | public class ExampleUnitTest {
13 | @Test
14 | public void addition_isCorrect() throws Exception {
15 | assertEquals(4, 2 + 2);
16 | }
17 | }
--------------------------------------------------------------------------------