Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
S
SkinLibrary
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gaodapeng
SkinLibrary
Commits
5cdd42ce
Commit
5cdd42ce
authored
Nov 04, 2021
by
gaodapeng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加一个api。向外提供resources。升高版本
parent
b1b64c32
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
12 additions
and
5 deletions
+12
-5
MainActivity.java
demo/src/main/java/com/study/skindemo/MainActivity.java
+1
-1
gradle.properties
gradle.properties
+1
-1
build.gradle
skin-lib/build.gradle
+3
-3
SkinResources.java
.../src/main/java/com/miya/skin_lib/utils/SkinResources.java
+7
-0
No files found.
demo/src/main/java/com/study/skindemo/MainActivity.java
View file @
5cdd42ce
...
@@ -3,10 +3,10 @@ package com.study.skindemo;
...
@@ -3,10 +3,10 @@ package com.study.skindemo;
import
android.os.Build
;
import
android.os.Build
;
import
android.os.Bundle
;
import
android.os.Bundle
;
import
android.support.annotation.Nullable
;
import
android.support.annotation.Nullable
;
import
android.support.annotation.RequiresApi
;
import
android.support.v7.app.AppCompatActivity
;
import
android.support.v7.app.AppCompatActivity
;
import
android.view.View
;
import
android.view.View
;
import
androidx.annotation.RequiresApi
;
import
com.miya.skin_lib.SkinManager
;
import
com.miya.skin_lib.SkinManager
;
...
...
gradle.properties
View file @
5cdd42ce
...
@@ -14,7 +14,7 @@ org.gradle.jvmargs=-Xmx2048m
...
@@ -14,7 +14,7 @@ org.gradle.jvmargs=-Xmx2048m
# AndroidX package structure to make it clearer which packages are bundled with the
# AndroidX package structure to make it clearer which packages are bundled with the
# Android operating system, and which are packaged with your app"s APK
# Android operating system, and which are packaged with your app"s APK
# https://developer.android.com/topic/libraries/support-library/androidx-rn
# https://developer.android.com/topic/libraries/support-library/androidx-rn
#android.useAndroidX=tru
e
android.useAndroidX
=
fals
e
# Automatically convert third-party libraries to use AndroidX
# Automatically convert third-party libraries to use AndroidX
#android.enableJetifier=true
#android.enableJetifier=true
# Kotlin code style for this project: "official" or "obsolete":
# Kotlin code style for this project: "official" or "obsolete":
...
...
skin-lib/build.gradle
View file @
5cdd42ce
...
@@ -11,8 +11,8 @@ android {
...
@@ -11,8 +11,8 @@ android {
defaultConfig
{
defaultConfig
{
minSdkVersion
18
minSdkVersion
18
targetSdkVersion
28
targetSdkVersion
28
versionCode
10
1
versionCode
10
2
versionName
"1.0
1
"
versionName
"1.0
2
"
consumerProguardFiles
"consumer-rules.pro"
consumerProguardFiles
"consumer-rules.pro"
}
}
...
@@ -39,7 +39,7 @@ ext {
...
@@ -39,7 +39,7 @@ ext {
//仓库地址
//仓库地址
publishURL
=
"https://nexus.infra.miyatech.com/repository/shualianzhifu/"
publishURL
=
"https://nexus.infra.miyatech.com/repository/shualianzhifu/"
publishVersion
=
'1.0
1
'
publishVersion
=
'1.0
2
'
//skin-lib-compat表示兼容之前版本,skin-lib是androidx版本的
//skin-lib-compat表示兼容之前版本,skin-lib是androidx版本的
publishArtifactId
=
"skin-lib-compat"
publishArtifactId
=
"skin-lib-compat"
publishGroupId
=
'com.miya.iot'
publishGroupId
=
'com.miya.iot'
...
...
skin-lib/src/main/java/com/miya/skin_lib/utils/SkinResources.java
View file @
5cdd42ce
...
@@ -53,6 +53,13 @@ public class SkinResources {
...
@@ -53,6 +53,13 @@ public class SkinResources {
isDefaultSkin
=
TextUtils
.
isEmpty
(
pkgName
)
||
resources
==
null
;
isDefaultSkin
=
TextUtils
.
isEmpty
(
pkgName
)
||
resources
==
null
;
}
}
/**
* 获取当前的 resources
*/
public
Resources
getResources
()
{
return
isDefaultSkin
?
appResources
:
skinResources
;
}
/**
/**
* 1. 通过原始app中的resId获取到自己的名字(R.color.icon_up,获取到的就是icon_up)和类型
* 1. 通过原始app中的resId获取到自己的名字(R.color.icon_up,获取到的就是icon_up)和类型
* 2. 根据名字和类型获取皮肤包中的ID
* 2. 根据名字和类型获取皮肤包中的ID
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment