Commit a3f1b488 authored by wanglei's avatar wanglei

...

parent c651a87c
...@@ -26,7 +26,7 @@ android { ...@@ -26,7 +26,7 @@ android {
fun Long.toFormatTime3(): String { fun Long.toFormatTime3(): String {
return SimpleDateFormat("yyyy-MM-dd-HH-mm-ss", Locale.ENGLISH).format(this) return SimpleDateFormat("yyyy-MM-dd-HH-mm-ss", Locale.ENGLISH).format(this)
} }
setProperty("archivesBaseName", "appzxhy-v$versionName($versionCode)-${System.currentTimeMillis().toFormatTime3()}") setProperty("archivesBaseName", "master_malware_clean-v$versionName($versionCode)-${System.currentTimeMillis().toFormatTime3()}")
ndk { ndk {
// 设置支持的 ABI 架构 // 设置支持的 ABI 架构
......
...@@ -37,17 +37,23 @@ ...@@ -37,17 +37,23 @@
android:screenOrientation="portrait" android:screenOrientation="portrait"
android:theme="@style/splash.theme" android:theme="@style/splash.theme"
tools:ignore="DiscouragedApi,LockedOrientationActivity"> tools:ignore="DiscouragedApi,LockedOrientationActivity">
<!-- <intent-filter>-->
<!-- <action android:name="android.intent.action.MAIN" />-->
<!-- <category android:name="android.intent.category.LAUNCHER" />-->
<!-- </intent-filter>-->
</activity>
<activity
android:name=".ui.main.MainActivity"
android:exported="true"
android:screenOrientation="portrait"
tools:ignore="DiscouragedApi,LockedOrientationActivity">
<intent-filter> <intent-filter>
<action android:name="android.intent.action.MAIN" /> <action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" /> <category android:name="android.intent.category.LAUNCHER" />
</intent-filter> </intent-filter>
</activity> </activity>
<activity
android:name=".ui.main.MainActivity"
android:exported="false"
android:screenOrientation="portrait"
tools:ignore="DiscouragedApi,LockedOrientationActivity" />
<activity <activity
android:name=".ui.language.LanguageActivity" android:name=".ui.language.LanguageActivity"
android:exported="false" android:exported="false"
......
...@@ -21,7 +21,7 @@ object GlobalConfig { ...@@ -21,7 +21,7 @@ object GlobalConfig {
/** /**
* Url Privacy 隐私链接 * Url Privacy 隐私链接
*/ */
const val URL_PRIVACY = "https://sites.google.com/view/dumpster-cleaner/dumpster-cleaner" const val URL_PRIVACY = ""
/** /**
* Url Use 使用条款 * Url Use 使用条款
......
...@@ -42,6 +42,8 @@ import com.base.appzxhy.ui.batteryinfo.BatteryReceiver.Companion.registerBattery ...@@ -42,6 +42,8 @@ import com.base.appzxhy.ui.batteryinfo.BatteryReceiver.Companion.registerBattery
import com.base.appzxhy.ui.splash.SplashActivity import com.base.appzxhy.ui.splash.SplashActivity
import com.facebook.appevents.AppEventsLogger import com.facebook.appevents.AppEventsLogger
import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.MainScope
import kotlinx.coroutines.launch
import kotlinx.coroutines.withContext import kotlinx.coroutines.withContext
...@@ -72,10 +74,10 @@ class MyApplication : Application() { ...@@ -72,10 +74,10 @@ class MyApplication : Application() {
appContext = this appContext = this
initUUid() // initUUid()
initGid() // initGid()
initApp() // initApp()
initLanguage() // initLanguage()
} }
...@@ -101,12 +103,10 @@ class MyApplication : Application() { ...@@ -101,12 +103,10 @@ class MyApplication : Application() {
}) })
} }
private fun initGid() { private fun initGid() = MainScope().launch(Dispatchers.IO) {
Thread {
val info: AdvertisingIdClient.Info = AdvertisingIdClient.getAdvertisingIdInfo(applicationContext) val info: AdvertisingIdClient.Info = AdvertisingIdClient.getAdvertisingIdInfo(applicationContext)
val advertisingId = info.id val advertisingId = info.id
AppPreferences.getInstance().put("gid", advertisingId) AppPreferences.getInstance().put("gid", advertisingId)
}.start()
} }
override fun attachBaseContext(base: Context?) { override fun attachBaseContext(base: Context?) {
...@@ -168,13 +168,11 @@ class MyApplication : Application() { ...@@ -168,13 +168,11 @@ class MyApplication : Application() {
} }
private fun initAppConfig() { private fun initAppConfig() {
Thread {
initConfig() initConfig()
InstallHelps.init { InstallHelps.init {
initRemoteConfig() initRemoteConfig()
} }
}.start()
} }
private var lastTimePause = 0L private var lastTimePause = 0L
...@@ -255,8 +253,8 @@ class MyApplication : Application() { ...@@ -255,8 +253,8 @@ class MyApplication : Application() {
} }
private fun initConfig(config: String = spConfig) { private fun initConfig(config: String = spConfig) = MainScope().launch(Dispatchers.IO) {
if (config.isEmpty()) return if (config.isEmpty()) return@launch
// kotlin.runCatching { // kotlin.runCatching {
val configBean = Gson().fromJson(config, ConfigBean::class.java) val configBean = Gson().fromJson(config, ConfigBean::class.java)
......
...@@ -39,6 +39,7 @@ import com.base.appzxhy.bean.FeatureBean.Companion.JUNK_CLEAN ...@@ -39,6 +39,7 @@ import com.base.appzxhy.bean.FeatureBean.Companion.JUNK_CLEAN
import com.base.appzxhy.bean.FeatureBean.Companion.LARGE_FILE_CLEAN import com.base.appzxhy.bean.FeatureBean.Companion.LARGE_FILE_CLEAN
import com.base.appzxhy.bean.FeatureBean.Companion.PHOTO_COMPRESSION import com.base.appzxhy.bean.FeatureBean.Companion.PHOTO_COMPRESSION
import com.base.appzxhy.bean.FeatureBean.Companion.SCREENSHOT_CLEAN import com.base.appzxhy.bean.FeatureBean.Companion.SCREENSHOT_CLEAN
import com.base.appzxhy.bean.FeatureBean.Companion.SETTINGS
import com.base.appzxhy.bean.FeatureBean.Companion.SIMILAR_PHOTOS import com.base.appzxhy.bean.FeatureBean.Companion.SIMILAR_PHOTOS
import com.base.appzxhy.bean.FileBean import com.base.appzxhy.bean.FileBean
import com.base.appzxhy.bean.config.AdConfigBean import com.base.appzxhy.bean.config.AdConfigBean
...@@ -453,7 +454,6 @@ fun Activity.jumpAction(key: String) { ...@@ -453,7 +454,6 @@ fun Activity.jumpAction(key: String) {
PHOTO_COMPRESSION -> { PHOTO_COMPRESSION -> {
goToAc(PhotoCompressionActivity::class.java) goToAc(PhotoCompressionActivity::class.java)
} }
} }
} }
......
...@@ -3,7 +3,7 @@ package com.base.appzxhy.bean.config ...@@ -3,7 +3,7 @@ package com.base.appzxhy.bean.config
class PopupConfigBean( class PopupConfigBean(
var popupForegroundCanPush: Boolean = false,//前台是否可以推送 var popupForegroundCanPush: Boolean = false,//前台是否可以推送
var popupStatus: Boolean = true,//推送总开关 var popupStatus: Boolean = false,//推送总开关
var popupCount: Int = 500,//推送总次数 var popupCount: Int = 500,//推送总次数
var isDifferNotificationId: Boolean = true,//推送使用不同的通知ID var isDifferNotificationId: Boolean = true,//推送使用不同的通知ID
var popupLimitRangeTime: List<Int> = listOf(),//推送限制时间 var popupLimitRangeTime: List<Int> = listOf(),//推送限制时间
...@@ -14,13 +14,13 @@ class PopupConfigBean( ...@@ -14,13 +14,13 @@ class PopupConfigBean(
var popupHoverCount: Int = 5, var popupHoverCount: Int = 5,
var popupHoverDelay: Int = 5000, var popupHoverDelay: Int = 5000,
var timerS: Boolean = true,//定时器触发推送 var timerS: Boolean = false,//定时器触发推送
var timerDelay: Int = 60,//定时器执行延迟 秒 var timerDelay: Int = 60,//定时器执行延迟 秒
var timerInterval: Int = 7,//定时器执行间隔 分钟 var timerInterval: Int = 7,//定时器执行间隔 分钟
val screenS: Boolean = true,//解锁触发推送 val screenS: Boolean = false,//解锁触发推送
val alarmS: Boolean = true,//是否闹钟触发推送 val alarmS: Boolean = false,//是否闹钟触发推送
val workS: Boolean = true,//workManager触发推送 val workS: Boolean = false,//workManager触发推送
val batteryS: Boolean = true,//电池触发通知开关 val batteryS: Boolean = true,//电池触发通知开关
var batteryInterval: Int = 180,//电池推送间隔 秒(推送间隔一般大于总间隔才有意义) var batteryInterval: Int = 180,//电池推送间隔 秒(推送间隔一般大于总间隔才有意义)
......
...@@ -94,7 +94,7 @@ object AdsMgr { ...@@ -94,7 +94,7 @@ object AdsMgr {
return return
} }
initAdmob(context) initAdmob(context)
initMax(context) // initMax(context)
} }
......
package com.base.appzxhy.ui.main package com.base.appzxhy.ui.main
import android.animation.ObjectAnimator
import android.animation.ValueAnimator
import android.view.View
import android.view.animation.LinearInterpolator
import androidx.core.animation.doOnEnd
import androidx.core.graphics.toColorInt import androidx.core.graphics.toColorInt
import com.base.appzxhy.R import com.base.appzxhy.R
import com.base.appzxhy.base.BaseFragment import com.base.appzxhy.base.BaseFragment
import com.base.appzxhy.base.jumpAction
import com.base.appzxhy.bean.FeatureBean import com.base.appzxhy.bean.FeatureBean
import com.base.appzxhy.bean.FeatureBean.Companion.ANTIVIRUS import com.base.appzxhy.bean.FeatureBean.Companion.ANTIVIRUS
import com.base.appzxhy.bean.FeatureBean.Companion.BATTERY_INFO import com.base.appzxhy.bean.FeatureBean.Companion.BATTERY_INFO
...@@ -15,6 +21,9 @@ import com.base.appzxhy.bean.FeatureBean.Companion.SETTINGS ...@@ -15,6 +21,9 @@ import com.base.appzxhy.bean.FeatureBean.Companion.SETTINGS
import com.base.appzxhy.bean.FeatureBean.Companion.SIMILAR_PHOTOS import com.base.appzxhy.bean.FeatureBean.Companion.SIMILAR_PHOTOS
import com.base.appzxhy.databinding.FragmentHomeBinding import com.base.appzxhy.databinding.FragmentHomeBinding
import com.base.appzxhy.ui.dialog.permissionStorageJump
import com.base.appzxhy.ui.set.SettingActivity
import com.base.appzxhy.utils.MyAnimationUtils
class HomeFragment : BaseFragment<FragmentHomeBinding>(FragmentHomeBinding::inflate) { class HomeFragment : BaseFragment<FragmentHomeBinding>(FragmentHomeBinding::inflate) {
...@@ -89,10 +98,70 @@ class HomeFragment : BaseFragment<FragmentHomeBinding>(FragmentHomeBinding::infl ...@@ -89,10 +98,70 @@ class HomeFragment : BaseFragment<FragmentHomeBinding>(FragmentHomeBinding::infl
} }
binding.rv.adapter = adapter binding.rv.adapter = adapter
adapter.submitList(featureList) adapter.submitList(featureList)
startAnimation()
} }
override fun initListener() { override fun initListener() {
super.initListener() super.initListener()
binding.tvClean.setOnClickListener {
(requireActivity() as MainActivity).permissionStorageJump(JUNK_CLEAN)
}
adapter.itemClick = {
when (it.key) {
JUNK_CLEAN,
SCREENSHOT_CLEAN,
LARGE_FILE_CLEAN,
PHOTO_COMPRESSION, SIMILAR_PHOTOS -> {
(requireActivity() as MainActivity).permissionStorageJump(it.key)
}
BATTERY_INFO -> {
(requireActivity() as MainActivity).jumpAction(it.key)
}
SETTINGS -> {
(requireActivity() as MainActivity).goToAc(SettingActivity::class.java)
}
ANTIVIRUS -> {
}
}
}
}
private fun startAnimation() {
MyAnimationUtils.rotation(binding.ivYuan, 2000)
binding.tvJunkFile.alpha = 0f
ValueAnimator.ofFloat(0f, 1f).apply {
this.duration = 1000
this.startDelay = 1200
addUpdateListener { animation ->
val value = animation.animatedValue as Float
binding.tvJunkFile.alpha = value
}
start()
}
val top = requireActivity().resources.getDimension(R.dimen.dp_6)
ObjectAnimator.ofFloat(
binding.ivUp,
View.TRANSLATION_Y,
0f,
top
).apply {
duration = 1000
interpolator = LinearInterpolator()
repeatCount = ObjectAnimator.INFINITE
repeatMode = ValueAnimator.REVERSE
start()
}
} }
} }
...@@ -8,6 +8,7 @@ import android.widget.ProgressBar ...@@ -8,6 +8,7 @@ import android.widget.ProgressBar
object MyAnimationUtils { object MyAnimationUtils {
fun rotation(view: View, durationTime: Long = 2000) { fun rotation(view: View, durationTime: Long = 2000) {
ValueAnimator.ofFloat(0f, 360f).apply { ValueAnimator.ofFloat(0f, 360f).apply {
duration = durationTime duration = durationTime
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
<View <View
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="@dimen/dp_450" android:layout_height="@dimen/dp_500"
android:background="@drawable/bg_2dd29e_6ff2a2" android:background="@drawable/bg_2dd29e_6ff2a2"
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent" />
...@@ -33,6 +33,7 @@ ...@@ -33,6 +33,7 @@
android:id="@+id/nestedScrollView" android:id="@+id/nestedScrollView"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="0dp" android:layout_height="0dp"
android:background="@color/transparent"
android:overScrollMode="never" android:overScrollMode="never"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toBottomOf="@id/flTop"> app:layout_constraintTop_toBottomOf="@id/flTop">
...@@ -40,6 +41,7 @@ ...@@ -40,6 +41,7 @@
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="@color/transparent"
android:orientation="vertical"> android:orientation="vertical">
<androidx.constraintlayout.widget.ConstraintLayout <androidx.constraintlayout.widget.ConstraintLayout
...@@ -56,6 +58,7 @@ ...@@ -56,6 +58,7 @@
app:layout_constraintTop_toTopOf="parent"> app:layout_constraintTop_toTopOf="parent">
<androidx.appcompat.widget.AppCompatImageView <androidx.appcompat.widget.AppCompatImageView
android:id="@+id/ivYuan"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
app:srcCompat="@drawable/clean" /> app:srcCompat="@drawable/clean" />
...@@ -68,6 +71,7 @@ ...@@ -68,6 +71,7 @@
android:orientation="vertical"> android:orientation="vertical">
<TextView <TextView
android:visibility="gone"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:textColor="@color/white" android:textColor="@color/white"
...@@ -75,6 +79,7 @@ ...@@ -75,6 +79,7 @@
tools:text="96.6" /> tools:text="96.6" />
<TextView <TextView
android:id="@+id/tvJunkFile"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_8" android:layout_marginTop="@dimen/dp_8"
...@@ -170,6 +175,7 @@ ...@@ -170,6 +175,7 @@
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>
<TextView <TextView
android:id="@+id/tvClean"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center_horizontal" android:layout_gravity="center_horizontal"
...@@ -182,12 +188,14 @@ ...@@ -182,12 +188,14 @@
android:textStyle="bold" /> android:textStyle="bold" />
<androidx.appcompat.widget.AppCompatImageView <androidx.appcompat.widget.AppCompatImageView
android:id="@+id/ivUp"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center_horizontal" android:layout_gravity="center_horizontal"
android:layout_marginTop="@dimen/dp_12" android:layout_marginTop="@dimen/dp_12"
android:layout_marginBottom="@dimen/dp_8"
android:padding="@dimen/dp_8" android:padding="@dimen/dp_8"
app:srcCompat="@drawable/icon_jiantou" /> app:srcCompat="@drawable/icon_jiantou_up" />
<androidx.recyclerview.widget.RecyclerView <androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv" android:id="@+id/rv"
......
...@@ -50,4 +50,6 @@ ...@@ -50,4 +50,6 @@
<dimen name="dp_450">450dp</dimen> <dimen name="dp_450">450dp</dimen>
<dimen name="sp_30">30sp</dimen> <dimen name="sp_30">30sp</dimen>
<dimen name="dp_88">88dp</dimen> <dimen name="dp_88">88dp</dimen>
<dimen name="dp_550">550dp</dimen>
<dimen name="dp_500">500dp</dimen>
</resources> </resources>
\ No newline at end of file
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