Skip to content
This repository was archived by the owner on Jun 8, 2024. It is now read-only.

Commit ebbc5df

Browse files
committed
Project: Remove blur effect & Add -dontobfuscate in proguard
Signed-off-by: Fung Gwo <fython@163.com>
1 parent 4481bf8 commit ebbc5df

9 files changed

Lines changed: 12 additions & 589 deletions

File tree

mobile/build.gradle

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,12 @@ android {
3232
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
3333
pseudoLocalesEnabled true
3434
}
35+
debug {
36+
minifyEnabled true
37+
shrinkResources true
38+
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
39+
pseudoLocalesEnabled true
40+
}
3541
}
3642
sourceSets {
3743
main {
@@ -90,7 +96,6 @@ dependencies {
9096
implementation 'com.scwang.smartrefresh:SmartRefreshHeader:1.1.0-andx-3'
9197
implementation 'moe.feng:MaterialStepperView:0.2.4.2'
9298
implementation 'me.dm7.barcodescanner:zxing:1.9.8'
93-
implementation 'io.alterac.blurkit:blurkit:1.0.0'
9499

95100
// Utils
96101
api 'moe.feng:AlipayZeroSdk:1.1'

mobile/proguard-rules.pro

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
-ignorewarn
2-
3-
-dontwarn com.tencent.bugly.**
4-
-keep public class com.tencent.bugly.** {*;}
2+
-dontobfuscate
53
-optimizations !code/simplification/arithmetic
64
-optimizationpasses 5
75

@@ -32,14 +30,11 @@
3230
-keep class info.papdt.express.helper.widget.** {*;}
3331
-keep class info.papdt.express.helper.model.** {*;}
3432
-keep class info.papdt.express.helper.dao.** {*;}
35-
-keep class info.papdt.express.helper.asynctask.** {*;}
3633
-keep class info.papdt.express.helper.api.** {*;}
3734
-keep class info.papdt.express.helper.receiver.** {*;}
3835
-keep class info.papdt.express.helper.services.** {*;}
3936
-keep class android.support.** {*;}
4037
-keep class me.dm7.** {*;}
41-
-keep class com.roughlike.** {*;}
42-
-keep class com.rengwuxian.** {*;}
4338
-keep class okio.** {*;}
4439
-keep class com.google.** {*;}
4540
-keep class moe.feng.alipay.zerosdk.** {*;}

mobile/src/main/kotlin/info/papdt/express/helper/Application.kt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ import info.papdt.express.helper.services.ClipboardDetectService
1616
import info.papdt.express.helper.support.MaterialColorGenerator
1717
import info.papdt.express.helper.support.Settings
1818
import info.papdt.express.helper.support.SettingsInstance
19-
import io.alterac.blurkit.BlurKit
2019
import io.fabric.sdk.android.Fabric
2120
import kotlinx.coroutines.CoroutineScope
2221
import kotlinx.coroutines.Dispatchers
@@ -45,7 +44,6 @@ class Application : MultiDexApplication() {
4544
// Init Widget components
4645
MaterialIcon.init(this)
4746
MaterialColorGenerator.init(this)
48-
BlurKit.init(this)
4947

5048
// Init CrashReport
5149
Fabric.with(this, Crashlytics())

mobile/src/main/kotlin/info/papdt/express/helper/support/PTSettings.kt

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,6 @@ class PTSettings(context: Context): SharedPreferencesProvider(context, "settings
2929

3030
var usingNewDatabase by booleanValue(defValue = false)
3131

32-
var enableAddDialogBackgroundBlur by booleanValue(
33-
// Default disabled in pre-O devices
34-
defValue = Build.VERSION.SDK_INT >= Build.VERSION_CODES.O
35-
)
36-
3732
var lastFilter by intValue(defValue = HomePackageListAdapter.FILTER_ON_THE_WAY)
3833

3934
var lastSortBy by intValue(defValue = HomePackageListAdapter.SORT_BY_UPDATE_TIME)

mobile/src/main/kotlin/info/papdt/express/helper/ui/HomeActivity.kt

Lines changed: 4 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ import info.papdt.express.helper.support.SettingsInstance
3636
import info.papdt.express.helper.ui.adapter.HomeToolbarSpinnerAdapter
3737
import info.papdt.express.helper.ui.adapter.HomePackageListAdapter
3838
import info.papdt.express.helper.ui.common.AbsActivity
39-
import io.alterac.blurkit.FixedBlurLayout
4039
import moe.feng.common.stepperview.VerticalStepperItemView
4140
import moe.feng.kotlinyan.common.*
4241

@@ -99,20 +98,9 @@ class HomeActivity : AbsActivity(), OnRefreshListener {
9998
private val scanButton by lazy<View> { findViewById(R.id.scan_button) }
10099
private val moreButton by lazy<View> { findViewById(R.id.more_button) }
101100
private val bottomSheet by lazy<View> { findViewById(R.id.bottom_sheet_add_package) }
102-
private val bottomSheetBackgroundBlur by lazy<FixedBlurLayout> {
103-
findViewById(R.id.bottom_sheet_background_blur)
101+
private val bottomSheetBackground by lazy<View> {
102+
findViewById(R.id.bottom_sheet_background)
104103
}
105-
private val bottomSheetBackgroundNormal by lazy<View> {
106-
findViewById(R.id.bottom_sheet_background_normal)
107-
}
108-
private val bottomSheetBackground: View
109-
get() {
110-
return if (SettingsInstance.enableAddDialogBackgroundBlur) {
111-
bottomSheetBackgroundBlur
112-
} else {
113-
bottomSheetBackgroundNormal
114-
}
115-
}
116104

117105
private val moreMenu: PopupMenu by lazy {
118106
PopupMenu(this, moreButton).also {
@@ -207,16 +195,6 @@ class HomeActivity : AbsActivity(), OnRefreshListener {
207195
tempFilterCategory = if (it.title.isEmpty()) null else it.title
208196
updateSearchDialogViewsValue()
209197
}, action = ChooseCategoryDialog.ACTION_CHOOSE_CATEGORY)
210-
if (SettingsInstance.enableAddDialogBackgroundBlur) {
211-
bottomSheetBackgroundBlur.startBlur()
212-
}
213-
}
214-
215-
override fun onStop() {
216-
super.onStop()
217-
if (SettingsInstance.enableAddDialogBackgroundBlur) {
218-
bottomSheetBackgroundBlur.pauseBlur()
219-
}
220198
}
221199

222200
private fun showBottomSheetBackground() {
@@ -552,14 +530,8 @@ class HomeActivity : AbsActivity(), OnRefreshListener {
552530
override fun onSlide(v: View, slideOffset: Float) {
553531
val progress = if (slideOffset.isNaN())
554532
1f else 1f + Math.max(slideOffset, -1f)
555-
if (SettingsInstance.enableAddDialogBackgroundBlur) {
556-
bottomSheetBackgroundBlur.post {
557-
bottomSheetBackgroundBlur.alpha = progress
558-
}
559-
} else {
560-
bottomSheetBackgroundNormal.post {
561-
bottomSheetBackgroundNormal.alpha = progress * 0.35f
562-
}
533+
bottomSheetBackground.post {
534+
bottomSheetBackground.alpha = progress * 0.35f
563535
}
564536
bottomSheetBackground.postInvalidate()
565537
}
@@ -603,10 +575,6 @@ class HomeActivity : AbsActivity(), OnRefreshListener {
603575
val layoutManager = recyclerView.layoutManager!! as LinearLayoutManager
604576
val shouldLift = layoutManager.findFirstCompletelyVisibleItemPosition() != 0
605577

606-
if (SettingsInstance.enableAddDialogBackgroundBlur) {
607-
bottomSheetBackgroundBlur.postInvalidate()
608-
}
609-
610578
if (animatorDirection != shouldLift) {
611579
if (elevationAnimator?.isRunning == true) {
612580
elevationAnimator?.cancel()

mobile/src/main/kotlin/info/papdt/express/helper/ui/fragment/settings/SettingsUi.kt

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import info.papdt.express.helper.support.Settings
66
import info.papdt.express.helper.support.SettingsInstance
77
import moe.shizuku.preference.ListPreference
88
import moe.shizuku.preference.Preference
9-
import moe.shizuku.preference.SwitchPreference
109

1110
class SettingsUi : AbsPrefFragment(), Preference.OnPreferenceChangeListener, Preference.OnPreferenceClickListener {
1211

@@ -15,8 +14,6 @@ class SettingsUi : AbsPrefFragment(), Preference.OnPreferenceChangeListener, Pre
1514
by PreferenceProperty("night_mode")
1615
private val mPrefShowTipsAgain: Preference?
1716
by NullablePreferenceProperty("show_tips_again")
18-
private val mPrefBlurOnAddDialogBg: SwitchPreference
19-
by PreferenceProperty("enable_blur_on_add_dialog_background")
2017

2118
override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) {
2219
addPreferencesFromResource(R.xml.settings_ui)
@@ -26,12 +23,9 @@ class SettingsUi : AbsPrefFragment(), Preference.OnPreferenceChangeListener, Pre
2623
mPrefNightMode.setValueIndex(target)
2724
}
2825

29-
mPrefBlurOnAddDialogBg.isChecked = SettingsInstance.enableAddDialogBackgroundBlur
30-
3126
// UI
3227
mPrefNightMode.onPreferenceChangeListener = this
3328
mPrefShowTipsAgain?.onPreferenceClickListener = this
34-
mPrefBlurOnAddDialogBg.onPreferenceChangeListener = this
3529
}
3630

3731
override fun onPreferenceClick(pref: Preference): Boolean {
@@ -55,10 +49,6 @@ class SettingsUi : AbsPrefFragment(), Preference.OnPreferenceChangeListener, Pre
5549
makeRestartTips()
5650
true
5751
}
58-
mPrefBlurOnAddDialogBg -> {
59-
SettingsInstance.enableAddDialogBackgroundBlur = newValue as Boolean
60-
true
61-
}
6252
else -> false
6353
}
6454
}

0 commit comments

Comments
 (0)