Skip to content

Commit 12f5922

Browse files
committed
feat: Optimize project dependencies
Signed-off-by: Hu Shenghao <dede.hu@qq.com>
1 parent 5e25e9f commit 12f5922

File tree

50 files changed

+338
-1001
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+338
-1001
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog
22

3+
### v3.2.1
4+
5+
- Optimize APK file size
6+
37
### v3.2.0 (2024-12-03)
48

59
- Add Android 16 preview

CHANGELOG_zh.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# 更新日志
22

3+
### v3.2.1
4+
5+
- 优化 APK 文件大小
6+
37
### v3.2.0 (2024-12-03)
48

59
- 添加 Android 16 预览

app/build.gradle.kts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ android {
77

88
defaultConfig {
99
applicationId = "com.dede.android_eggs"
10-
versionCode = 55
11-
versionName = "3.2.0"
10+
versionCode = 56
11+
versionName = "3.2.1"
1212
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
1313

1414
resourceConfigurations += listOf(
@@ -95,8 +95,10 @@ android {
9595
"META-INF/*.version",
9696
"META-INF/NOTICE.*",
9797
"META-INF/LICENSE",
98+
"META-INF/**/LICENSE.txt",
9899
"kotlin/**.kotlin_builtins",
99100
"DebugProbesKt.bin",
101+
"*.properties"
100102
)
101103
}
102104

@@ -115,7 +117,6 @@ dependencies {
115117
implementation(libs.androidx.lifecycle)
116118
implementation(libs.androidx.viewmodel)
117119
implementation(libs.androidx.livedata)
118-
implementation(libs.google.material)
119120
implementation(libs.androidx.startup)
120121

121122
implementation(libs.androidx.compose.activity)

app/src/androidTest/java/com/dede/android_eggs/fake_test/ClockAnalogSimpleDialUtil.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ package com.dede.android_eggs.fake_test
33
import androidx.core.graphics.drawable.toBitmap
44
import androidx.test.ext.junit.runners.AndroidJUnit4
55
import androidx.test.platform.app.InstrumentationRegistry
6-
import com.dede.android_eggs.R
76
import com.dede.android_eggs.fake_test.utils.EasterEggsServer
87
import com.dede.android_eggs.fake_test.utils.ResponseUtils.toResponse
98
import com.dede.basic.createThemeWrapperContext
@@ -26,8 +25,9 @@ class ClockAnalogSimpleDialUtil {
2625
@Test
2726
fun generate() {
2827
val context = InstrumentationRegistry.getInstrumentation().targetContext
28+
val drawableRes = com.dede.android_eggs.views.widget.R.drawable.clock_analog_simple_dial
2929
val wrapperContext = context.createThemeWrapperContext()
30-
val drawable = wrapperContext.requireDrawable(R.drawable.clock_analog_simple_dial)
30+
val drawable = wrapperContext.requireDrawable(drawableRes)
3131
val bitmap = drawable.toBitmap()
3232

3333
//bitmap = bitmap.scale(IMAGE_SIZE, IMAGE_SIZE)
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
package com.dede.android_eggs
22

3-
import androidx.fragment.app.FragmentActivity
3+
import androidx.activity.ComponentActivity
44
import com.dede.android_eggs.inject.FlavorFeatures
55

66
class FlavorFeaturesImpl : FlavorFeatures {
7-
override fun call(activity: FragmentActivity) {
7+
override fun call(activity: ComponentActivity) {
88
}
99
}

app/src/main/java/com/dede/android_eggs/inject/FlavorFeatures.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package com.dede.android_eggs.inject
22

3-
import androidx.fragment.app.FragmentActivity
3+
import androidx.activity.ComponentActivity
44
import com.dede.android_eggs.FlavorFeaturesImpl
55

66
interface FlavorFeatures {
@@ -14,5 +14,5 @@ interface FlavorFeatures {
1414
}
1515
}
1616

17-
fun call(activity: FragmentActivity)
17+
fun call(activity: ComponentActivity)
1818
}

app/src/main/java/com/dede/android_eggs/startup/ApplicationInitializer.kt

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,12 @@ import android.app.Application
44
import android.content.Context
55
import androidx.startup.Initializer
66
import com.dede.android_eggs.util.ActivityActionDispatcher
7-
import com.dede.android_eggs.views.settings.compose.prefs.DynamicColorPrefUtil
8-
import com.dede.android_eggs.views.settings.compose.prefs.ThemePrefUtil
97
import com.dede.basic.GlobalContext
108

119
class ApplicationInitializer : Initializer<Unit> {
1210

1311
override fun create(context: Context) {
1412
val application = context.applicationContext as Application
15-
// apply compat style
16-
DynamicColorPrefUtil.apply(application)
17-
ThemePrefUtil.apply(application)
1813
ActivityActionDispatcher.register(application)
1914
}
2015

app/src/main/java/com/dede/android_eggs/ui/Icons.kt

Lines changed: 0 additions & 14 deletions
This file was deleted.

app/src/main/java/com/dede/android_eggs/ui/composes/ThemedHashImageBitmap.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ fun rememberThemedHashImageBitmap(
2121
height: Int = 32
2222
): ImageBitmap {
2323
val context = LocalContext.current
24-
return remember(hash, ThemeUtils.isSystemNightMode(context)) {
24+
return remember(hash, ThemeUtils.isDarkMode(context.resources)) {
2525
var bitmap = checkNotNull(BlurHashDecoder.decode(hash, width, height)) {
2626
"BlurHash decode error! hash: ".format(hash)
2727
}
28-
if (ThemeUtils.isSystemNightMode(context)) {
28+
if (ThemeUtils.isDarkMode(context.resources)) {
2929
val nightMode =
3030
Bitmap.createBitmap(bitmap.width, bitmap.height, Bitmap.Config.ARGB_8888)
3131
val paint = Paint(Paint.ANTI_ALIAS_FLAG)

app/src/main/java/com/dede/android_eggs/ui/drawables/FontIconsDrawable.kt

Lines changed: 0 additions & 225 deletions
This file was deleted.

0 commit comments

Comments
 (0)