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
c7aa77b8
Commit
c7aa77b8
authored
Dec 02, 2021
by
gaodapeng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
删除无用代码
parent
3a1365cd
Hide whitespace changes
Inline
Side-by-side
Showing
27 changed files
with
5 additions
and
380 deletions
+5
-380
build.gradle
demo/build.gradle
+0
-3
AndroidManifest.xml
demo/src/main/AndroidManifest.xml
+0
-25
MainActivity.java
demo/src/main/java/com/study/skindemo/MainActivity.java
+0
-31
OneApplication.java
demo/src/main/java/com/study/skindemo/OneApplication.java
+0
-15
ic_launcher_foreground.xml
demo/src/main/res/drawable-v24/ic_launcher_foreground.xml
+0
-30
ic_launcher_background.xml
demo/src/main/res/drawable/ic_launcher_background.xml
+0
-170
activity_main.xml
demo/src/main/res/layout/activity_main.xml
+0
-27
menu_main.xml
demo/src/main/res/menu/menu_main.xml
+0
-10
ic_launcher.xml
demo/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
+0
-5
ic_launcher_round.xml
demo/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
+0
-5
ic_launcher.png
demo/src/main/res/mipmap-hdpi/ic_launcher.png
+0
-0
ic_launcher_round.png
demo/src/main/res/mipmap-hdpi/ic_launcher_round.png
+0
-0
ic_launcher.png
demo/src/main/res/mipmap-mdpi/ic_launcher.png
+0
-0
ic_launcher_round.png
demo/src/main/res/mipmap-mdpi/ic_launcher_round.png
+0
-0
ic_launcher.png
demo/src/main/res/mipmap-xhdpi/ic_launcher.png
+0
-0
ic_launcher_round.png
demo/src/main/res/mipmap-xhdpi/ic_launcher_round.png
+0
-0
ic_launcher.png
demo/src/main/res/mipmap-xxhdpi/ic_launcher.png
+0
-0
ic_launcher_round.png
demo/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
+0
-0
ic_launcher.png
demo/src/main/res/mipmap-xxxhdpi/ic_launcher.png
+0
-0
ic_launcher_round.png
demo/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
+0
-0
colors.xml
demo/src/main/res/values/colors.xml
+0
-6
dimens.xml
demo/src/main/res/values/dimens.xml
+0
-3
strings.xml
demo/src/main/res/values/strings.xml
+0
-12
styles.xml
demo/src/main/res/values/styles.xml
+0
-19
ExampleUnitTest.kt
demo/src/test/java/com/study/skindemo/ExampleUnitTest.kt
+0
-17
SkinAttribute.java
skin-lib/src/main/java/com/miya/skin_lib/SkinAttribute.java
+1
-0
SkinThemeUtils.java
...src/main/java/com/miya/skin_lib/utils/SkinThemeUtils.java
+4
-2
No files found.
demo/build.gradle
View file @
c7aa77b8
...
...
@@ -27,9 +27,6 @@ android {
dependencies
{
implementation
fileTree
(
dir:
"libs"
,
include:
[
"*.jar"
])
implementation
"com.android.support:support-v13:28.0.0"
implementation
'com.google.android.material:material:1.2.1'
implementation
'com.android.support.constraint:constraint-layout:2.0.4'
implementation
project
(
':skin-lib'
)
testImplementation
'junit:junit:4.12'
...
...
demo/src/main/AndroidManifest.xml
deleted
100644 → 0
View file @
3a1365cd
<?xml version="1.0" encoding="utf-8"?>
<manifest
xmlns:android=
"http://schemas.android.com/apk/res/android"
package=
"com.study.skindemo"
>
<application
android:name=
".OneApplication"
android:allowBackup=
"true"
android:icon=
"@mipmap/ic_launcher"
android:label=
"@string/app_name"
android:roundIcon=
"@mipmap/ic_launcher_round"
android:supportsRtl=
"true"
android:theme=
"@style/AppTheme"
>
<activity
android:name=
".MainActivity"
android:label=
"@string/app_name"
android:theme=
"@style/AppTheme.NoActionBar"
>
<intent-filter>
<action
android:name=
"android.intent.action.MAIN"
/>
<category
android:name=
"android.intent.category.LAUNCHER"
/>
</intent-filter>
</activity>
</application>
</manifest>
\ No newline at end of file
demo/src/main/java/com/study/skindemo/MainActivity.java
deleted
100644 → 0
View file @
3a1365cd
package
com
.
study
.
skindemo
;
import
android.os.Build
;
import
android.os.Bundle
;
import
android.support.annotation.Nullable
;
import
android.support.annotation.RequiresApi
;
import
android.support.v7.app.AppCompatActivity
;
import
android.view.View
;
import
com.miya.skin_lib.SkinManager
;
import
java.io.File
;
public
class
MainActivity
extends
AppCompatActivity
{
@Override
protected
void
onCreate
(
@Nullable
Bundle
savedInstanceState
)
{
super
.
onCreate
(
savedInstanceState
);
setContentView
(
R
.
layout
.
activity_main
);
findViewById
(
R
.
id
.
btnCtl
).
setOnClickListener
(
new
View
.
OnClickListener
()
{
@RequiresApi
(
api
=
Build
.
VERSION_CODES
.
KITKAT
)
@Override
public
void
onClick
(
View
v
)
{
SkinManager
.
getInstance
()
.
loadSkin
(
new
File
(
getCacheDir
(),
"skin1-release-unsigned.apk"
).
getAbsolutePath
());
}
});
}
}
demo/src/main/java/com/study/skindemo/OneApplication.java
deleted
100644 → 0
View file @
3a1365cd
package
com
.
study
.
skindemo
;
import
android.app.Application
;
import
com.miya.skin_lib.SkinManager
;
public
class
OneApplication
extends
Application
{
@Override
public
void
onCreate
()
{
super
.
onCreate
();
SkinManager
.
init
(
this
);
}
}
demo/src/main/res/drawable-v24/ic_launcher_foreground.xml
deleted
100644 → 0
View file @
3a1365cd
<vector
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:aapt=
"http://schemas.android.com/aapt"
android:width=
"108dp"
android:height=
"108dp"
android:viewportWidth=
"108"
android:viewportHeight=
"108"
>
<path
android:pathData=
"M31,63.928c0,0 6.4,-11 12.1,-13.1c7.2,-2.6 26,-1.4 26,-1.4l38.1,38.1L107,108.928l-32,-1L31,63.928z"
>
<aapt:attr
name=
"android:fillColor"
>
<gradient
android:endX=
"85.84757"
android:endY=
"92.4963"
android:startX=
"42.9492"
android:startY=
"49.59793"
android:type=
"linear"
>
<item
android:color=
"#44000000"
android:offset=
"0.0"
/>
<item
android:color=
"#00000000"
android:offset=
"1.0"
/>
</gradient>
</aapt:attr>
</path>
<path
android:fillColor=
"#FFFFFF"
android:fillType=
"nonZero"
android:pathData=
"M65.3,45.828l3.8,-6.6c0.2,-0.4 0.1,-0.9 -0.3,-1.1c-0.4,-0.2 -0.9,-0.1 -1.1,0.3l-3.9,6.7c-6.3,-2.8 -13.4,-2.8 -19.7,0l-3.9,-6.7c-0.2,-0.4 -0.7,-0.5 -1.1,-0.3C38.8,38.328 38.7,38.828 38.9,39.228l3.8,6.6C36.2,49.428 31.7,56.028 31,63.928h46C76.3,56.028 71.8,49.428 65.3,45.828zM43.4,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2c-0.3,-0.7 -0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C45.3,56.528 44.5,57.328 43.4,57.328L43.4,57.328zM64.6,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2s-0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C66.5,56.528 65.6,57.328 64.6,57.328L64.6,57.328z"
android:strokeWidth=
"1"
android:strokeColor=
"#00000000"
/>
</vector>
\ No newline at end of file
demo/src/main/res/drawable/ic_launcher_background.xml
deleted
100644 → 0
View file @
3a1365cd
<?xml version="1.0" encoding="utf-8"?>
<vector
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:width=
"108dp"
android:height=
"108dp"
android:viewportWidth=
"108"
android:viewportHeight=
"108"
>
<path
android:fillColor=
"#3DDC84"
android:pathData=
"M0,0h108v108h-108z"
/>
<path
android:fillColor=
"#00000000"
android:pathData=
"M9,0L9,108"
android:strokeWidth=
"0.8"
android:strokeColor=
"#33FFFFFF"
/>
<path
android:fillColor=
"#00000000"
android:pathData=
"M19,0L19,108"
android:strokeWidth=
"0.8"
android:strokeColor=
"#33FFFFFF"
/>
<path
android:fillColor=
"#00000000"
android:pathData=
"M29,0L29,108"
android:strokeWidth=
"0.8"
android:strokeColor=
"#33FFFFFF"
/>
<path
android:fillColor=
"#00000000"
android:pathData=
"M39,0L39,108"
android:strokeWidth=
"0.8"
android:strokeColor=
"#33FFFFFF"
/>
<path
android:fillColor=
"#00000000"
android:pathData=
"M49,0L49,108"
android:strokeWidth=
"0.8"
android:strokeColor=
"#33FFFFFF"
/>
<path
android:fillColor=
"#00000000"
android:pathData=
"M59,0L59,108"
android:strokeWidth=
"0.8"
android:strokeColor=
"#33FFFFFF"
/>
<path
android:fillColor=
"#00000000"
android:pathData=
"M69,0L69,108"
android:strokeWidth=
"0.8"
android:strokeColor=
"#33FFFFFF"
/>
<path
android:fillColor=
"#00000000"
android:pathData=
"M79,0L79,108"
android:strokeWidth=
"0.8"
android:strokeColor=
"#33FFFFFF"
/>
<path
android:fillColor=
"#00000000"
android:pathData=
"M89,0L89,108"
android:strokeWidth=
"0.8"
android:strokeColor=
"#33FFFFFF"
/>
<path
android:fillColor=
"#00000000"
android:pathData=
"M99,0L99,108"
android:strokeWidth=
"0.8"
android:strokeColor=
"#33FFFFFF"
/>
<path
android:fillColor=
"#00000000"
android:pathData=
"M0,9L108,9"
android:strokeWidth=
"0.8"
android:strokeColor=
"#33FFFFFF"
/>
<path
android:fillColor=
"#00000000"
android:pathData=
"M0,19L108,19"
android:strokeWidth=
"0.8"
android:strokeColor=
"#33FFFFFF"
/>
<path
android:fillColor=
"#00000000"
android:pathData=
"M0,29L108,29"
android:strokeWidth=
"0.8"
android:strokeColor=
"#33FFFFFF"
/>
<path
android:fillColor=
"#00000000"
android:pathData=
"M0,39L108,39"
android:strokeWidth=
"0.8"
android:strokeColor=
"#33FFFFFF"
/>
<path
android:fillColor=
"#00000000"
android:pathData=
"M0,49L108,49"
android:strokeWidth=
"0.8"
android:strokeColor=
"#33FFFFFF"
/>
<path
android:fillColor=
"#00000000"
android:pathData=
"M0,59L108,59"
android:strokeWidth=
"0.8"
android:strokeColor=
"#33FFFFFF"
/>
<path
android:fillColor=
"#00000000"
android:pathData=
"M0,69L108,69"
android:strokeWidth=
"0.8"
android:strokeColor=
"#33FFFFFF"
/>
<path
android:fillColor=
"#00000000"
android:pathData=
"M0,79L108,79"
android:strokeWidth=
"0.8"
android:strokeColor=
"#33FFFFFF"
/>
<path
android:fillColor=
"#00000000"
android:pathData=
"M0,89L108,89"
android:strokeWidth=
"0.8"
android:strokeColor=
"#33FFFFFF"
/>
<path
android:fillColor=
"#00000000"
android:pathData=
"M0,99L108,99"
android:strokeWidth=
"0.8"
android:strokeColor=
"#33FFFFFF"
/>
<path
android:fillColor=
"#00000000"
android:pathData=
"M19,29L89,29"
android:strokeWidth=
"0.8"
android:strokeColor=
"#33FFFFFF"
/>
<path
android:fillColor=
"#00000000"
android:pathData=
"M19,39L89,39"
android:strokeWidth=
"0.8"
android:strokeColor=
"#33FFFFFF"
/>
<path
android:fillColor=
"#00000000"
android:pathData=
"M19,49L89,49"
android:strokeWidth=
"0.8"
android:strokeColor=
"#33FFFFFF"
/>
<path
android:fillColor=
"#00000000"
android:pathData=
"M19,59L89,59"
android:strokeWidth=
"0.8"
android:strokeColor=
"#33FFFFFF"
/>
<path
android:fillColor=
"#00000000"
android:pathData=
"M19,69L89,69"
android:strokeWidth=
"0.8"
android:strokeColor=
"#33FFFFFF"
/>
<path
android:fillColor=
"#00000000"
android:pathData=
"M19,79L89,79"
android:strokeWidth=
"0.8"
android:strokeColor=
"#33FFFFFF"
/>
<path
android:fillColor=
"#00000000"
android:pathData=
"M29,19L29,89"
android:strokeWidth=
"0.8"
android:strokeColor=
"#33FFFFFF"
/>
<path
android:fillColor=
"#00000000"
android:pathData=
"M39,19L39,89"
android:strokeWidth=
"0.8"
android:strokeColor=
"#33FFFFFF"
/>
<path
android:fillColor=
"#00000000"
android:pathData=
"M49,19L49,89"
android:strokeWidth=
"0.8"
android:strokeColor=
"#33FFFFFF"
/>
<path
android:fillColor=
"#00000000"
android:pathData=
"M59,19L59,89"
android:strokeWidth=
"0.8"
android:strokeColor=
"#33FFFFFF"
/>
<path
android:fillColor=
"#00000000"
android:pathData=
"M69,19L69,89"
android:strokeWidth=
"0.8"
android:strokeColor=
"#33FFFFFF"
/>
<path
android:fillColor=
"#00000000"
android:pathData=
"M79,19L79,89"
android:strokeWidth=
"0.8"
android:strokeColor=
"#33FFFFFF"
/>
</vector>
demo/src/main/res/layout/activity_main.xml
deleted
100644 → 0
View file @
3a1365cd
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
xmlns:tools=
"http://schemas.android.com/tools"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
>
<Button
android:id=
"@+id/btnCtl"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"换肤"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
/>
<View
android:layout_width=
"match_parent"
android:layout_height=
"0dp"
android:background=
"@color/colorPrimary"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@id/btnCtl"
/>
</android.support.constraint.ConstraintLayout>
\ No newline at end of file
demo/src/main/res/menu/menu_main.xml
deleted
100644 → 0
View file @
3a1365cd
<menu
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
xmlns:tools=
"http://schemas.android.com/tools"
tools:context=
"com.study.skindemo.MainActivity"
>
<item
android:id=
"@+id/action_settings"
android:orderInCategory=
"100"
android:title=
"@string/action_settings"
app:showAsAction=
"never"
/>
</menu>
\ No newline at end of file
demo/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
deleted
100644 → 0
View file @
3a1365cd
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<background
android:drawable=
"@drawable/ic_launcher_background"
/>
<foreground
android:drawable=
"@drawable/ic_launcher_foreground"
/>
</adaptive-icon>
\ No newline at end of file
demo/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
deleted
100644 → 0
View file @
3a1365cd
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<background
android:drawable=
"@drawable/ic_launcher_background"
/>
<foreground
android:drawable=
"@drawable/ic_launcher_foreground"
/>
</adaptive-icon>
\ No newline at end of file
demo/src/main/res/mipmap-hdpi/ic_launcher.png
deleted
100644 → 0
View file @
3a1365cd
3.51 KB
demo/src/main/res/mipmap-hdpi/ic_launcher_round.png
deleted
100644 → 0
View file @
3a1365cd
5.21 KB
demo/src/main/res/mipmap-mdpi/ic_launcher.png
deleted
100644 → 0
View file @
3a1365cd
2.57 KB
demo/src/main/res/mipmap-mdpi/ic_launcher_round.png
deleted
100644 → 0
View file @
3a1365cd
3.31 KB
demo/src/main/res/mipmap-xhdpi/ic_launcher.png
deleted
100644 → 0
View file @
3a1365cd
4.81 KB
demo/src/main/res/mipmap-xhdpi/ic_launcher_round.png
deleted
100644 → 0
View file @
3a1365cd
7.3 KB
demo/src/main/res/mipmap-xxhdpi/ic_launcher.png
deleted
100644 → 0
View file @
3a1365cd
7.72 KB
demo/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
deleted
100644 → 0
View file @
3a1365cd
11.6 KB
demo/src/main/res/mipmap-xxxhdpi/ic_launcher.png
deleted
100644 → 0
View file @
3a1365cd
10.4 KB
demo/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
deleted
100644 → 0
View file @
3a1365cd
16.2 KB
demo/src/main/res/values/colors.xml
deleted
100644 → 0
View file @
3a1365cd
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color
name=
"colorPrimary"
>
#6200EE
</color>
<color
name=
"colorPrimaryDark"
>
#3700B3
</color>
<color
name=
"colorAccent"
>
#03DAC5
</color>
</resources>
\ No newline at end of file
demo/src/main/res/values/dimens.xml
deleted
100644 → 0
View file @
3a1365cd
<resources>
<dimen
name=
"fab_margin"
>
16dp
</dimen>
</resources>
\ No newline at end of file
demo/src/main/res/values/strings.xml
deleted
100644 → 0
View file @
3a1365cd
<resources>
<string
name=
"app_name"
>
SkinDemo
</string>
<string
name=
"action_settings"
>
Settings
</string>
<!-- Strings used for fragments for navigation -->
<string
name=
"first_fragment_label"
>
First Fragment
</string>
<string
name=
"second_fragment_label"
>
Second Fragment
</string>
<string
name=
"next"
>
Next
</string>
<string
name=
"previous"
>
Previous
</string>
<string
name=
"hello_first_fragment"
>
Hello first fragment
</string>
<string
name=
"hello_second_fragment"
>
Hello second fragment. Arg: %1$s
</string>
</resources>
\ No newline at end of file
demo/src/main/res/values/styles.xml
deleted
100644 → 0
View file @
3a1365cd
<resources>
<!-- Base application theme. -->
<style
name=
"AppTheme"
parent=
"Theme.AppCompat.Light.DarkActionBar"
>
<!-- Customize your theme here. -->
<item
name=
"colorPrimary"
>
@color/colorPrimary
</item>
<item
name=
"colorPrimaryDark"
>
@color/colorPrimaryDark
</item>
<item
name=
"colorAccent"
>
@color/colorAccent
</item>
</style>
<style
name=
"AppTheme.NoActionBar"
>
<item
name=
"windowActionBar"
>
false
</item>
<item
name=
"windowNoTitle"
>
true
</item>
</style>
<style
name=
"AppTheme.AppBarOverlay"
parent=
"ThemeOverlay.AppCompat.Dark.ActionBar"
/>
<style
name=
"AppTheme.PopupOverlay"
parent=
"ThemeOverlay.AppCompat.Light"
/>
</resources>
\ No newline at end of file
demo/src/test/java/com/study/skindemo/ExampleUnitTest.kt
deleted
100644 → 0
View file @
3a1365cd
package
com.study.skindemo
import
org.junit.Test
import
org.junit.Assert.*
/**
* Example local unit test, which will execute on the development machine (host).
*
* See [testing documentation](http://d.android.com/tools/testing).
*/
class
ExampleUnitTest
{
@Test
fun
addition_isCorrect
()
{
assertEquals
(
4
,
2
+
2
)
}
}
\ No newline at end of file
skin-lib/src/main/java/com/miya/skin_lib/SkinAttribute.java
View file @
c7aa77b8
package
com
.
miya
.
skin_lib
;
import
android.graphics.BitmapFactory
;
import
android.graphics.drawable.ColorDrawable
;
import
android.graphics.drawable.Drawable
;
import
android.support.v4.view.ViewCompat
;
...
...
skin-lib/src/main/java/com/miya/skin_lib/utils/SkinThemeUtils.java
View file @
c7aa77b8
...
...
@@ -7,6 +7,7 @@ import android.content.res.Resources;
import
android.content.res.TypedArray
;
import
android.graphics.drawable.Drawable
;
import
android.os.Build
;
import
android.support.annotation.RequiresApi
;
import
android.support.v4.content.res.ResourcesCompat
;
import
android.text.TextUtils
;
...
...
@@ -14,15 +15,16 @@ import android.text.TextUtils;
/**
* 修改主题信息
*/
@RequiresApi
(
api
=
Build
.
VERSION_CODES
.
LOLLIPOP
)
public
class
SkinThemeUtils
{
/**
* 以下的几个模式的资源,取决于自己应用要用什么资源,和当前版本中主要用什么资源,可以根据项目具体使用来改改
*/
private
static
int
[]
APPCOMPAT_COLOR_PRIMARY_DARK_ATTRS
=
{
private
static
final
int
[]
APPCOMPAT_COLOR_PRIMARY_DARK_ATTRS
=
{
android
.
R
.
attr
.
colorPrimaryDark
};
private
static
int
[]
STATUSBAR_COLOR_ATTRS
=
{
android
.
R
.
attr
.
statusBarColor
,
android
.
R
.
attr
private
static
final
int
[]
STATUSBAR_COLOR_ATTRS
=
{
android
.
R
.
attr
.
statusBarColor
,
android
.
R
.
attr
.
navigationBarColor
};
...
...
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