Commit 5cdd42ce authored by gaodapeng's avatar gaodapeng

增加一个api。向外提供resources。升高版本

parent b1b64c32
...@@ -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;
......
...@@ -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=true android.useAndroidX=false
# 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":
......
...@@ -11,8 +11,8 @@ android { ...@@ -11,8 +11,8 @@ android {
defaultConfig { defaultConfig {
minSdkVersion 18 minSdkVersion 18
targetSdkVersion 28 targetSdkVersion 28
versionCode 101 versionCode 102
versionName "1.01" versionName "1.02"
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.01' publishVersion = '1.02'
//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'
......
...@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment