Commit c444c479 authored by wanglei's avatar wanglei

...平分弹窗8次逻辑

parent 2af9ef22
......@@ -7,12 +7,17 @@ import androidx.appcompat.app.AppCompatActivity
import androidx.core.view.ViewCompat
import androidx.core.view.WindowInsetsCompat
import androidx.core.view.updatePadding
import androidx.lifecycle.lifecycleScope
import com.base.datarecovery.databinding.ActivityMainBinding
import com.base.datarecovery.help.BaseActivity
import com.base.datarecovery.help.PermissionHelp.checkStorePermission
import com.base.datarecovery.utils.BarUtils
import com.base.datarecovery.view.PermissionDialog.showPermissionBottomSheet
import com.base.datarecovery.view.RateStarPop
import com.base.datarecovery.view.RateStarPop.showRateStarPopDialog
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.delay
import kotlinx.coroutines.launch
class MainActivity : BaseActivity<ActivityMainBinding>() {
......@@ -37,5 +42,10 @@ class MainActivity : BaseActivity<ActivityMainBinding>() {
dialog = showPermissionBottomSheet(launcher)
}
}
lifecycleScope.launch(Dispatchers.Main) {
delay(1000)
showRateStarPopDialog()
}
}
}
\ No newline at end of file
......@@ -12,6 +12,7 @@ import androidx.activity.OnBackPressedCallback
import androidx.core.view.isVisible
import androidx.core.view.updatePadding
import androidx.recyclerview.widget.LinearLayoutManager
import com.base.datarecovery.BuildConfig
import com.base.datarecovery.R
import com.base.datarecovery.activity.ResultActivity
import com.base.datarecovery.ads.AdmobInterstitialUtils
......@@ -27,6 +28,7 @@ import com.base.datarecovery.help.KotlinExt.toFormatSize
import com.base.datarecovery.utils.BarUtils
import com.base.datarecovery.utils.MediaStoreUtils
import pokercc.android.expandablerecyclerview.ExpandableAdapter
import kotlin.random.Random
/**
* 清理数据获取页面
......@@ -43,14 +45,14 @@ class CleanJunkActivity : BaseActivity<ActivityLayoutCleanJunkBinding>() {
expanded = false
),
ParentBean(
title = "Residual cache junk",
title = "Temp File",
childItem = child4,
parentSize = sizes[1],
isParentSelected = true,
expanded = false
),
ParentBean(
title = "Clean up more",
title = "Log File",
childItem = child5,
parentSize = sizes[2],
isParentSelected = true,
......@@ -72,10 +74,10 @@ class CleanJunkActivity : BaseActivity<ActivityLayoutCleanJunkBinding>() {
}
override fun initView() {
BarUtils.setStatusBarLightMode(this, true)
BarUtils.setStatusBarColor(this, Color.TRANSPARENT)
binding.root.updatePadding(top = BarUtils.getStatusBarHeight())
// binding.root.updatePadding(top = BarUtils.getStatusBarHeight())
AdmobNativeUtils.showNativeAd(this@CleanJunkActivity, binding.flAd)
setAdapter()
}
......@@ -122,6 +124,7 @@ class CleanJunkActivity : BaseActivity<ActivityLayoutCleanJunkBinding>() {
val bean = ChildBean(R.mipmap.apk, l.name, l.path, l.size)
child3.add(bean)
}
testApk()
scanCount += 1
updateSize(doneIndex = 0)
......@@ -132,6 +135,7 @@ class CleanJunkActivity : BaseActivity<ActivityLayoutCleanJunkBinding>() {
val bean = ChildBean(null, l.name, l.path, l.size)
child4.add(bean)
}
// testTemp()
scanCount += 1
updateSize(doneIndex = 1)
......@@ -141,10 +145,41 @@ class CleanJunkActivity : BaseActivity<ActivityLayoutCleanJunkBinding>() {
val bean = ChildBean(null, l.name, l.path, l.size)
child5.add(bean)
}
// testLog()
scanCount += 2
updateSize(doneIndex = 2)
}
private fun testLog() {
if (BuildConfig.DEBUG) {
repeat(5) {
sizes[2] += Random.nextLong()
val bean = ChildBean(null, "log", "", Random.nextLong())
child5.add(bean)
}
}
}
private fun testTemp() {
if (BuildConfig.DEBUG) {
repeat(5) {
sizes[1] += Random.nextLong()
val bean = ChildBean(null, "temp", "", Random.nextLong())
child4.add(bean)
}
}
}
private fun testApk() {
if (BuildConfig.DEBUG) {
repeat(5) {
sizes[0] += Random.nextLong(1500)
val bean = ChildBean(R.mipmap.apk, "apk", "", Random.nextLong())
child3.add(bean)
}
}
}
@SuppressLint("SetTextI18n")
private fun updateSize(doneIndex: Int = -1) {
addData(index = doneIndex)
......@@ -303,9 +338,9 @@ class CleanJunkActivity : BaseActivity<ActivityLayoutCleanJunkBinding>() {
viewHolder.binding.idTypeName.text = parentType.title
parentType.expanded = expand
if (parentType.expanded) {
viewHolder.binding.idXiala.setImageResource(R.mipmap.shouqi)
} else {
viewHolder.binding.idXiala.setImageResource(R.mipmap.zhankai)
} else {
viewHolder.binding.idXiala.setImageResource(R.mipmap.shouqi)
}
if (parentType.isfinish) {
viewHolder.binding.idImgLoad.isVisible = false
......@@ -372,6 +407,8 @@ class CleanJunkActivity : BaseActivity<ActivityLayoutCleanJunkBinding>() {
val applicationInfo = packageInfo.applicationInfo
val appIcon = packageManager.getApplicationIcon(applicationInfo)
viewHolder.binding.idImgIcon.setImageDrawable(appIcon)
} else {
viewHolder.binding.idImgIcon.setImageResource(R.mipmap.apk)
}
}
......
......@@ -134,7 +134,7 @@ class StayNotificationService : Service() {
val smallIcon = IconCompat.createFromIcon(
context, Icon.createWithResource(
this, R.drawable.icon_notification_small
this, R.drawable.icon_100
)
)
smallIcon?.let {
......
......@@ -14,6 +14,19 @@ object RateStarPop {
@SuppressLint("SetTextI18n")
fun Context.showRateStarPopDialog() {
val n = SPUtils.getInstance().getInt("RateNumbers", 0)
SPUtils.getInstance().put("RateNumbers", n + 1)
if (SPUtils.getInstance().getBoolean("isRated", false)) {
return
}
if (n > 0 && n % 8 == 0) {
} else {
return
}
val binding = DialogRateStarBinding.inflate(LayoutInflater.from(this))
val dialog = AlertDialog.Builder(this).create()
dialog.setView(binding.root)
......
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<gradient
android:angle="90"
android:endColor="#3FD3FF"
android:startColor="#587EFC" />
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="#BEBEBE" />
<corners android:radius="22dp" />
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/bg_355bea_10" android:state_enabled="true" />
<item android:drawable="@drawable/bg_577dfd_22" android:state_enabled="true" />
<item android:drawable="@drawable/bg_bebebe_10" android:state_enabled="false" />
</selector>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@mipmap/weixuan" android:state_selected="false" />
<item android:drawable="@mipmap/xuanzhong" android:state_selected="true" />
</selector>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners
android:topLeftRadius="15dp"
android:topRightRadius="15dp" />
<solid android:color="@color/white" />
</shape>
\ No newline at end of file
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="100dp"
android:height="100dp"
android:viewportWidth="24"
android:viewportHeight="24">
<!-- <path android:fillColor="#ABABAB" android:pathData="M12,12m-12,0a12,12 0,1 1,24 0a12,12 0,1 1,-24 0"/>-->
<path
android:fillColor="#FFFFFF"
android:pathData="M6.368,6.31h1.226c0.097,0 0.175,-0.07 0.175,-0.158V5.68c0,-0.087 -0.078,-0.158 -0.175,-0.158H6.368c-0.097,0 -0.175,0.07 -0.175,0.158v0.473C6.193,6.239 6.271,6.31 6.368,6.31z" />
<path
android:fillColor="#FFFFFF"
android:pathData="M18.963,18.104c0.884,-0.003 1.595,-0.721 1.595,-1.605v-2.887l-0.018,-4.95c0,-1.575 -1.575,-1.575 -1.575,-1.575h-3.15l-0.788,-1.575H9.513L8.726,7.087H4.788c0,0 -1.575,0 -1.575,1.575v7.876c0,1.575 1.575,1.575 1.575,1.575h10.226C15.014,18.117 17.325,18.11 18.963,18.104zM16.602,8.662c0.435,0 0.788,0.353 0.788,0.788c0,0.435 -0.353,0.788 -0.788,0.788c-0.435,0 -0.788,-0.353 -0.788,-0.788C15.814,9.015 16.167,8.662 16.602,8.662zM13.55,14.706c-0.49,0.339 -1.072,0.521 -1.669,0.521c-0.097,0 -0.194,-0.006 -0.291,-0.016c-0.02,-0.002 -0.039,-0.006 -0.058,-0.007c-0.054,-0.007 -0.109,-0.012 -0.162,-0.021c-0.016,-0.002 -0.031,-0.007 -0.047,-0.011c-0.04,-0.007 -0.077,-0.017 -0.115,-0.025c-0.059,-0.013 -0.115,-0.027 -0.17,-0.043c-0.031,-0.009 -0.061,-0.019 -0.091,-0.029c-0.064,-0.02 -0.127,-0.043 -0.189,-0.068l-0.054,-0.024c-0.072,-0.031 -0.143,-0.065 -0.212,-0.101l-0.019,-0.011c-0.247,-0.133 -0.474,-0.302 -0.672,-0.5c-0.058,-0.059 -0.115,-0.119 -0.168,-0.182l-0.04,-0.051c-0.036,-0.044 -0.074,-0.089 -0.107,-0.136c-0.004,-0.006 -0.007,-0.013 -0.011,-0.019c-0.336,-0.476 -0.517,-1.044 -0.517,-1.627H8.374l0.934,-1.378l0.934,1.378H9.658c0.001,0.496 0.172,0.976 0.486,1.359v0l0.026,0.033c0.18,0.213 0.399,0.39 0.644,0.523c0.058,0.03 0.116,0.059 0.176,0.084l0.033,0.015c0.049,0.02 0.099,0.038 0.15,0.054c0.021,0.007 0.042,0.014 0.063,0.021c0.044,0.013 0.089,0.024 0.134,0.034c0.028,0.007 0.055,0.014 0.084,0.02c0.046,0.009 0.093,0.015 0.14,0.021c0.024,0.003 0.049,0.007 0.074,0.009c0.06,0.005 0.121,0.008 0.181,0.009c0.463,0.007 0.917,-0.13 1.299,-0.393c0.158,-0.109 0.375,-0.072 0.487,0.085c0.001,0.002 0.003,0.004 0.004,0.006C13.746,14.388 13.706,14.6 13.55,14.706zM13.51,12.353L13.51,12.353l0.583,0c0,-0.506 -0.178,-0.995 -0.503,-1.382c-0.231,-0.274 -0.517,-0.485 -0.841,-0.622l-0.017,-0.008c-0.054,-0.022 -0.11,-0.042 -0.166,-0.059c-0.015,-0.005 -0.031,-0.011 -0.047,-0.016c-0.049,-0.015 -0.1,-0.027 -0.15,-0.039c-0.022,-0.005 -0.044,-0.011 -0.067,-0.015c-0.052,-0.01 -0.104,-0.018 -0.157,-0.024c-0.019,-0.003 -0.039,-0.006 -0.058,-0.008c-0.524,-0.051 -1.05,0.085 -1.483,0.384c-0.158,0.109 -0.375,0.072 -0.488,-0.085c-0.001,-0.002 -0.003,-0.004 -0.004,-0.006c-0.106,-0.156 -0.066,-0.368 0.09,-0.474c0.49,-0.338 1.071,-0.519 1.666,-0.518c0.021,0 0.035,0.002 0.049,0.002c0.077,0.001 0.155,0.005 0.232,0.012c0.032,0.003 0.064,0.008 0.096,0.012c0.046,0.006 0.093,0.009 0.138,0.017c0.017,0.003 0.033,0.008 0.05,0.011c0.035,0.007 0.069,0.015 0.103,0.023c0.062,0.014 0.123,0.029 0.183,0.047c0.026,0.008 0.05,0.016 0.075,0.024C12.864,9.652 12.932,9.677 13,9.704l0.035,0.016c0.422,0.178 0.795,0.454 1.089,0.805l0.015,0.02c0.044,0.053 0.087,0.106 0.127,0.161c0.005,0.008 0.009,0.016 0.013,0.024c0.334,0.475 0.514,1.042 0.514,1.624h0.584l-0.934,1.378L13.51,12.353z" />
</vector>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="36dp"
android:height="36dp"
android:viewportWidth="24"
android:viewportHeight="24">
<!-- <path android:fillColor="#ABABAB" android:pathData="M12,12m-12,0a12,12 0,1 1,24 0a12,12 0,1 1,-24 0"/>-->
<path
android:fillColor="#FFFFFF"
android:pathData="M6.368,6.31h1.226c0.097,0 0.175,-0.07 0.175,-0.158V5.68c0,-0.087 -0.078,-0.158 -0.175,-0.158H6.368c-0.097,0 -0.175,0.07 -0.175,0.158v0.473C6.193,6.239 6.271,6.31 6.368,6.31z" />
<path
android:fillColor="#FFFFFF"
android:pathData="M18.963,18.104c0.884,-0.003 1.595,-0.721 1.595,-1.605v-2.887l-0.018,-4.95c0,-1.575 -1.575,-1.575 -1.575,-1.575h-3.15l-0.788,-1.575H9.513L8.726,7.087H4.788c0,0 -1.575,0 -1.575,1.575v7.876c0,1.575 1.575,1.575 1.575,1.575h10.226C15.014,18.117 17.325,18.11 18.963,18.104zM16.602,8.662c0.435,0 0.788,0.353 0.788,0.788c0,0.435 -0.353,0.788 -0.788,0.788c-0.435,0 -0.788,-0.353 -0.788,-0.788C15.814,9.015 16.167,8.662 16.602,8.662zM13.55,14.706c-0.49,0.339 -1.072,0.521 -1.669,0.521c-0.097,0 -0.194,-0.006 -0.291,-0.016c-0.02,-0.002 -0.039,-0.006 -0.058,-0.007c-0.054,-0.007 -0.109,-0.012 -0.162,-0.021c-0.016,-0.002 -0.031,-0.007 -0.047,-0.011c-0.04,-0.007 -0.077,-0.017 -0.115,-0.025c-0.059,-0.013 -0.115,-0.027 -0.17,-0.043c-0.031,-0.009 -0.061,-0.019 -0.091,-0.029c-0.064,-0.02 -0.127,-0.043 -0.189,-0.068l-0.054,-0.024c-0.072,-0.031 -0.143,-0.065 -0.212,-0.101l-0.019,-0.011c-0.247,-0.133 -0.474,-0.302 -0.672,-0.5c-0.058,-0.059 -0.115,-0.119 -0.168,-0.182l-0.04,-0.051c-0.036,-0.044 -0.074,-0.089 -0.107,-0.136c-0.004,-0.006 -0.007,-0.013 -0.011,-0.019c-0.336,-0.476 -0.517,-1.044 -0.517,-1.627H8.374l0.934,-1.378l0.934,1.378H9.658c0.001,0.496 0.172,0.976 0.486,1.359v0l0.026,0.033c0.18,0.213 0.399,0.39 0.644,0.523c0.058,0.03 0.116,0.059 0.176,0.084l0.033,0.015c0.049,0.02 0.099,0.038 0.15,0.054c0.021,0.007 0.042,0.014 0.063,0.021c0.044,0.013 0.089,0.024 0.134,0.034c0.028,0.007 0.055,0.014 0.084,0.02c0.046,0.009 0.093,0.015 0.14,0.021c0.024,0.003 0.049,0.007 0.074,0.009c0.06,0.005 0.121,0.008 0.181,0.009c0.463,0.007 0.917,-0.13 1.299,-0.393c0.158,-0.109 0.375,-0.072 0.487,0.085c0.001,0.002 0.003,0.004 0.004,0.006C13.746,14.388 13.706,14.6 13.55,14.706zM13.51,12.353L13.51,12.353l0.583,0c0,-0.506 -0.178,-0.995 -0.503,-1.382c-0.231,-0.274 -0.517,-0.485 -0.841,-0.622l-0.017,-0.008c-0.054,-0.022 -0.11,-0.042 -0.166,-0.059c-0.015,-0.005 -0.031,-0.011 -0.047,-0.016c-0.049,-0.015 -0.1,-0.027 -0.15,-0.039c-0.022,-0.005 -0.044,-0.011 -0.067,-0.015c-0.052,-0.01 -0.104,-0.018 -0.157,-0.024c-0.019,-0.003 -0.039,-0.006 -0.058,-0.008c-0.524,-0.051 -1.05,0.085 -1.483,0.384c-0.158,0.109 -0.375,0.072 -0.488,-0.085c-0.001,-0.002 -0.003,-0.004 -0.004,-0.006c-0.106,-0.156 -0.066,-0.368 0.09,-0.474c0.49,-0.338 1.071,-0.519 1.666,-0.518c0.021,0 0.035,0.002 0.049,0.002c0.077,0.001 0.155,0.005 0.232,0.012c0.032,0.003 0.064,0.008 0.096,0.012c0.046,0.006 0.093,0.009 0.138,0.017c0.017,0.003 0.033,0.008 0.05,0.011c0.035,0.007 0.069,0.015 0.103,0.023c0.062,0.014 0.123,0.029 0.183,0.047c0.026,0.008 0.05,0.016 0.075,0.024C12.864,9.652 12.932,9.677 13,9.704l0.035,0.016c0.422,0.178 0.795,0.454 1.089,0.805l0.015,0.02c0.044,0.053 0.087,0.106 0.127,0.161c0.005,0.008 0.009,0.016 0.013,0.024c0.334,0.475 0.514,1.042 0.514,1.624h0.584l-0.934,1.378L13.51,12.353z" />
</vector>
......@@ -4,9 +4,18 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#0164C8"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/bg_587efc_3fd3ff"
android:orientation="vertical">
<View
android:layout_width="match_parent"
android:layout_height="40dp" />
<RelativeLayout
android:id="@+id/id_top_rl"
android:layout_width="match_parent"
......@@ -72,24 +81,23 @@
android:layout_gravity="center_horizontal"
android:layout_marginBottom="43dp"
android:text="Cleanable"
android:textColor="#80FFFFFF"
android:textColor="@color/white"
android:textSize="14sp"
tools:ignore="HardcodedText" />
</LinearLayout>
<FrameLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:background="@color/white">
android:background="@drawable/bg_ffffff_tlr15">
<androidx.appcompat.widget.LinearLayoutCompat
android:id="@+id/id_scan_reslut"
android:id="@+id/id_scan_result"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<pokercc.android.expandablerecyclerview.ExpandableRecyclerView
android:id="@+id/id_ex_rl"
android:layout_width="match_parent"
......@@ -97,11 +105,6 @@
android:layout_weight="1"
android:visibility="visible" />
<FrameLayout
android:id="@+id/fl_ad"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<TextView
android:id="@+id/id_cl_btn"
android:layout_width="match_parent"
......
......@@ -57,7 +57,7 @@
android:id="@+id/id_img_choose"
android:layout_width="20dp"
android:layout_height="20dp"
android:background="@drawable/bg_square_selector"
android:background="@drawable/bg_circle_selector_2"
android:visibility="gone"
tools:ignore="ContentDescription" />
......
app/src/main/res/mipmap-xxhdpi/shouqi.png

796 Bytes | W: | H:

app/src/main/res/mipmap-xxhdpi/shouqi.png

965 Bytes | W: | H:

app/src/main/res/mipmap-xxhdpi/shouqi.png
app/src/main/res/mipmap-xxhdpi/shouqi.png
app/src/main/res/mipmap-xxhdpi/shouqi.png
app/src/main/res/mipmap-xxhdpi/shouqi.png
  • 2-up
  • Swipe
  • Onion skin
app/src/main/res/mipmap-xxhdpi/zhankai.png

770 Bytes | W: | H:

app/src/main/res/mipmap-xxhdpi/zhankai.png

953 Bytes | W: | H:

app/src/main/res/mipmap-xxhdpi/zhankai.png
app/src/main/res/mipmap-xxhdpi/zhankai.png
app/src/main/res/mipmap-xxhdpi/zhankai.png
app/src/main/res/mipmap-xxhdpi/zhankai.png
  • 2-up
  • Swipe
  • Onion skin
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