Commit c884d79b authored by wanglei's avatar wanglei

截图清理功能

parent 52753f0a
# Easy Junk Cleaner # Easy Cleaner Junk
清理包,拆的fastcleanerjunk 清理包,拆的fastcleanerjunk
\ No newline at end of file
...@@ -57,12 +57,30 @@ ...@@ -57,12 +57,30 @@
<category android:name="android.intent.category.LAUNCHER" /> <category android:name="android.intent.category.LAUNCHER" />
</intent-filter> </intent-filter>
</activity> </activity>
<activity
android:name=".activity.home.NewMainActivity"
android:exported="true"
android:launchMode="singleTask"
android:screenOrientation="portrait"
tools:ignore="DiscouragedApi,LockedOrientationActivity" />
<activity
android:name=".activity.ScreenShotActivity"
android:exported="false"
android:launchMode="singleTop"
android:screenOrientation="portrait"
tools:ignore="DiscouragedApi,LockedOrientationActivity" />
<activity <activity
android:name=".activity.DeviceScanActivity" android:name=".activity.DeviceScanActivity"
android:exported="false" android:exported="false"
android:launchMode="singleTop" android:launchMode="singleTop"
android:screenOrientation="portrait" android:screenOrientation="portrait"
tools:ignore="DiscouragedApi,LockedOrientationActivity" /> tools:ignore="DiscouragedApi,LockedOrientationActivity" />
<activity
android:name=".activity.DeviceScanInfoActivity"
android:exported="false"
android:launchMode="singleTop"
android:screenOrientation="portrait"
tools:ignore="DiscouragedApi,LockedOrientationActivity" />
<activity <activity
android:name=".activity.SettingActivity" android:name=".activity.SettingActivity"
android:exported="false" android:exported="false"
...@@ -99,9 +117,7 @@ ...@@ -99,9 +117,7 @@
android:name=".activity.BatteryInfoActivity" android:name=".activity.BatteryInfoActivity"
android:screenOrientation="portrait" android:screenOrientation="portrait"
tools:ignore="DiscouragedApi,LockedOrientationActivity" /> tools:ignore="DiscouragedApi,LockedOrientationActivity" />
<activity
android:name=".activity.home.NewMainActivity"
android:exported="true" />
<activity <activity
android:name=".activity.ScanJunkActivity" android:name=".activity.ScanJunkActivity"
android:screenOrientation="portrait" android:screenOrientation="portrait"
...@@ -162,6 +178,7 @@ ...@@ -162,6 +178,7 @@
<meta-data <meta-data
android:name="com.google.android.gms.ads.flag.NATIVE_AD_DEBUGGER_ENABLED" android:name="com.google.android.gms.ads.flag.NATIVE_AD_DEBUGGER_ENABLED"
android:value="false" /> android:value="false" />
<service <service
android:name=".display.fcm.MyFirebaseMessagingService" android:name=".display.fcm.MyFirebaseMessagingService"
android:exported="true"> android:exported="true">
...@@ -198,6 +215,7 @@ ...@@ -198,6 +215,7 @@
android:name=".service.FlashlightService" android:name=".service.FlashlightService"
android:exported="true" android:exported="true"
tools:ignore="ExportedService" /> tools:ignore="ExportedService" />
<activity <activity
android:name=".activity.photocompress.photo.StartCompressionPhotoActivity" android:name=".activity.photocompress.photo.StartCompressionPhotoActivity"
android:screenOrientation="portrait" android:screenOrientation="portrait"
......
...@@ -60,7 +60,7 @@ class CleanJunkActivity : BaseActivity<ActivityLayoutCleanJunkBinding>() { ...@@ -60,7 +60,7 @@ class CleanJunkActivity : BaseActivity<ActivityLayoutCleanJunkBinding>() {
private val child4 = ArrayList<ChildBean>() private val child4 = ArrayList<ChildBean>()
private val child5 = ArrayList<ChildBean>() private val child5 = ArrayList<ChildBean>()
private val sizes = MutableList(3) { 0L } private val sizes = MutableList(3) { 0L }
private var ScanCount = 0 private var scanCount = 0
private val selectList = mutableListOf<String>() private val selectList = mutableListOf<String>()
private var selectSize = 0L private var selectSize = 0L
override val binding: ActivityLayoutCleanJunkBinding by lazy { override val binding: ActivityLayoutCleanJunkBinding by lazy {
...@@ -104,7 +104,7 @@ class CleanJunkActivity : BaseActivity<ActivityLayoutCleanJunkBinding>() { ...@@ -104,7 +104,7 @@ class CleanJunkActivity : BaseActivity<ActivityLayoutCleanJunkBinding>() {
val bean = ChildBean(R.mipmap.apk, l.name, l.path, l.size) val bean = ChildBean(R.mipmap.apk, l.name, l.path, l.size)
child3.add(bean) child3.add(bean)
} }
ScanCount += 1 scanCount += 1
updateSize(doneIndex = 0) updateSize(doneIndex = 0)
...@@ -114,7 +114,7 @@ class CleanJunkActivity : BaseActivity<ActivityLayoutCleanJunkBinding>() { ...@@ -114,7 +114,7 @@ class CleanJunkActivity : BaseActivity<ActivityLayoutCleanJunkBinding>() {
val bean = ChildBean(null, l.name, l.path, l.size) val bean = ChildBean(null, l.name, l.path, l.size)
child4.add(bean) child4.add(bean)
} }
ScanCount += 1 scanCount += 1
updateSize(doneIndex = 1) updateSize(doneIndex = 1)
val log = MediaStoreUtils.queryFiles(this, MediaStoreUtils.FileType.LOG) ?: listOf() val log = MediaStoreUtils.queryFiles(this, MediaStoreUtils.FileType.LOG) ?: listOf()
...@@ -123,53 +123,22 @@ class CleanJunkActivity : BaseActivity<ActivityLayoutCleanJunkBinding>() { ...@@ -123,53 +123,22 @@ class CleanJunkActivity : BaseActivity<ActivityLayoutCleanJunkBinding>() {
val bean = ChildBean(null, l.name, l.path, l.size) val bean = ChildBean(null, l.name, l.path, l.size)
child5.add(bean) child5.add(bean)
} }
ScanCount += 2 scanCount += 2
updateSize(doneIndex = 2) updateSize(doneIndex = 2)
// FileHelps.getFileList({
// }, {
// FileHelps.fileList.toList().let { it ->
// if (it.isNotEmpty()) {
// val a = it.filter { it.isApk() }
// a.forEach { l ->
// sizes[0] += l.size
// val bean = ChildBean(R.mipmap.apk, l.name, l.path, l.size)
// child3.add(bean)
// }
// ScanCount += 1
// updateSize(doneIndex = 0)
// val b = it.filter { it.isJunk() }
// b.forEach { l ->
// sizes[1] += l.size
// val bean = ChildBean(null, l.name, l.path, l.size)
// child4.add(bean)
// }
// ScanCount += 1
// updateSize(doneIndex = 1)
// val c = it.filter { it.isOtherTrash() }
// c.forEach { l ->
// sizes[2] += l.size
// val bean = ChildBean(null, l.name, l.path, l.size)
// child5.add(bean)
// }
// ScanCount += 2
// updateSize(doneIndex = 2)
// }
// }
// })
} }
@SuppressLint("SetTextI18n")
private fun updateSize(doneIndex: Int = -1) { private fun updateSize(doneIndex: Int = -1) {
addData(index = doneIndex) addData(index = doneIndex)
val split = sizes.sum().toFormatSize(1).split(' ') val split = sizes.sum().toFormatSize(1).split(' ')
binding.idKeCl.text = split[0] binding.idKeCl.text = split[0]
binding.idSizeUnit.text = split[1] binding.idSizeUnit.text = split[1]
if (ScanCount >= 3) { if (scanCount >= 3) {
selectList.clear() selectList.clear()
selectSize = 0L selectSize = 0L
for (i in parentList.indices) { for (i in parentList.indices) {
if (parentList[i].childItem.isNotEmpty()) { if (parentList[i].childItem.isNotEmpty()) {
val childsize = parentList[i].childItem.filter { val childSize = parentList[i].childItem.filter {
it.isChildSelected it.isChildSelected
}.sumOf { }.sumOf {
it.childSize it.childSize
...@@ -183,7 +152,7 @@ class CleanJunkActivity : BaseActivity<ActivityLayoutCleanJunkBinding>() { ...@@ -183,7 +152,7 @@ class CleanJunkActivity : BaseActivity<ActivityLayoutCleanJunkBinding>() {
} }
} }
} }
selectSize += childsize selectSize += childSize
} else { } else {
if (parentList[i].isParentSelected) { if (parentList[i].isParentSelected) {
selectSize += parentList[i].parentSize selectSize += parentList[i].parentSize
...@@ -197,9 +166,9 @@ class CleanJunkActivity : BaseActivity<ActivityLayoutCleanJunkBinding>() { ...@@ -197,9 +166,9 @@ class CleanJunkActivity : BaseActivity<ActivityLayoutCleanJunkBinding>() {
}.map { it.chilepath }) }.map { it.chilepath })
} }
} }
binding.idClBtn.isVisible = ScanCount >= 3 binding.idClBtn.isVisible = scanCount >= 3
binding.idClBtn.isEnabled = sizes.sum() > 0 binding.idClBtn.isEnabled = sizes.sum() > 0
if (ScanCount >= 3 && sizes.sum().toInt() == 0) { if (scanCount >= 3 && sizes.sum().toInt() == 0) {
AdmobUtils.showInterstitialAd(this) { AdmobUtils.showInterstitialAd(this) {
startActivity( startActivity(
Intent(this, ResultActivity::class.java).putExtra( Intent(this, ResultActivity::class.java).putExtra(
...@@ -223,12 +192,13 @@ class CleanJunkActivity : BaseActivity<ActivityLayoutCleanJunkBinding>() { ...@@ -223,12 +192,13 @@ class CleanJunkActivity : BaseActivity<ActivityLayoutCleanJunkBinding>() {
} }
} }
@SuppressLint("SetTextI18n")
private fun updateView() { private fun updateView() {
selectList.clear() selectList.clear()
var allSize = 0L var allSize = 0L
for (i in parentList.indices) { for (i in parentList.indices) {
if (parentList[i].childItem.isNotEmpty()) { if (parentList[i].childItem.isNotEmpty()) {
val childsize = parentList[i].childItem.filter { val childSize = parentList[i].childItem.filter {
it.isChildSelected it.isChildSelected
}.sumOf { }.sumOf {
it.childSize it.childSize
...@@ -242,7 +212,7 @@ class CleanJunkActivity : BaseActivity<ActivityLayoutCleanJunkBinding>() { ...@@ -242,7 +212,7 @@ class CleanJunkActivity : BaseActivity<ActivityLayoutCleanJunkBinding>() {
} }
} }
} }
allSize += childsize allSize += childSize
} else { } else {
if (parentList[i].isParentSelected) { if (parentList[i].isParentSelected) {
allSize += parentList[i].parentSize allSize += parentList[i].parentSize
...@@ -310,6 +280,7 @@ class CleanJunkActivity : BaseActivity<ActivityLayoutCleanJunkBinding>() { ...@@ -310,6 +280,7 @@ class CleanJunkActivity : BaseActivity<ActivityLayoutCleanJunkBinding>() {
} }
@SuppressLint("NotifyDataSetChanged")
override fun onBindGroupViewHolder( override fun onBindGroupViewHolder(
holder: ViewHolder, holder: ViewHolder,
groupPosition: Int, groupPosition: Int,
...@@ -368,6 +339,7 @@ class CleanJunkActivity : BaseActivity<ActivityLayoutCleanJunkBinding>() { ...@@ -368,6 +339,7 @@ class CleanJunkActivity : BaseActivity<ActivityLayoutCleanJunkBinding>() {
} }
} }
@SuppressLint("NotifyDataSetChanged")
override fun onBindChildViewHolder( override fun onBindChildViewHolder(
holder: ViewHolder, holder: ViewHolder,
groupPosition: Int, groupPosition: Int,
...@@ -411,7 +383,7 @@ class CleanJunkActivity : BaseActivity<ActivityLayoutCleanJunkBinding>() { ...@@ -411,7 +383,7 @@ class CleanJunkActivity : BaseActivity<ActivityLayoutCleanJunkBinding>() {
viewHolder.binding.idTvAppName.text = childType.childname viewHolder.binding.idTvAppName.text = childType.childname
viewHolder.binding.idImgSelect.isSelected = childType.isChildSelected viewHolder.binding.idImgSelect.isSelected = childType.isChildSelected
viewHolder.binding.idTvSize.text = "${childType.childSize.toFormatSize()}" viewHolder.binding.idTvSize.text = childType.childSize.toFormatSize()
viewHolder.itemView.setOnClickListener { viewHolder.itemView.setOnClickListener {
when (childPosition) { when (childPosition) {
childPosition -> { childPosition -> {
......
...@@ -9,9 +9,15 @@ import androidx.core.view.updatePadding ...@@ -9,9 +9,15 @@ import androidx.core.view.updatePadding
import com.test.easy.easycleanerjunk.databinding.ActivityLayoutCleanupingBinding import com.test.easy.easycleanerjunk.databinding.ActivityLayoutCleanupingBinding
import com.test.easy.easycleanerjunk.helps.BaseActivity import com.test.easy.easycleanerjunk.helps.BaseActivity
import com.test.easy.easycleanerjunk.helps.ConfigHelper import com.test.easy.easycleanerjunk.helps.ConfigHelper
import com.test.easy.easycleanerjunk.helps.MediaStoreUtils
import com.test.easy.easycleanerjunk.helps.ads.AdmobUtils import com.test.easy.easycleanerjunk.helps.ads.AdmobUtils
import com.test.easy.easycleanerjunk.utils.BarUtils import com.test.easy.easycleanerjunk.utils.BarUtils
import com.test.easy.easycleanerjunk.utils.NewFileUtils
import com.test.easy.easycleanerjunk.view.AFunOb import com.test.easy.easycleanerjunk.view.AFunOb
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.MainScope
import kotlinx.coroutines.launch
import java.io.File
import kotlin.random.Random import kotlin.random.Random
class CleaningActivity : BaseActivity<ActivityLayoutCleanupingBinding>() { class CleaningActivity : BaseActivity<ActivityLayoutCleanupingBinding>() {
...@@ -26,30 +32,22 @@ class CleaningActivity : BaseActivity<ActivityLayoutCleanupingBinding>() { ...@@ -26,30 +32,22 @@ class CleaningActivity : BaseActivity<ActivityLayoutCleanupingBinding>() {
intent.getStringArrayExtra("list") ?: arrayOf() intent.getStringArrayExtra("list") ?: arrayOf()
} }
var isDeleSuc = false
private var size = 0L
override fun initView() { override fun initView() {
BarUtils.setStatusBarColor(this, Color.TRANSPARENT) BarUtils.setStatusBarColor(this, Color.TRANSPARENT)
binding.root.updatePadding(top = BarUtils.getStatusBarHeight()) binding.root.updatePadding(top = BarUtils.getStatusBarHeight())
ConfigHelper.junkSizeClean += intentSize ConfigHelper.junkSizeClean += intentSize
// MainScope().launch(Dispatchers.IO) { MainScope().launch(Dispatchers.IO) {
// try { try {
// FileHelps.fileList.clear() listPath.forEach { NewFileUtils.delete(it) }
// listPath.forEach { MediaStoreUtils.updateMediaStore(this@CleaningActivity, listPath)
// val file = File(it) } catch (_: Exception) {
// if (FileHelps.deleteFile(file)) { } finally {
// isDeleSuc = true
// } }
//
// } }
// } catch (_: Exception) {
// } finally {
//
// }
//
// }
playAnm() playAnm()
} }
...@@ -72,7 +70,10 @@ class CleaningActivity : BaseActivity<ActivityLayoutCleanupingBinding>() { ...@@ -72,7 +70,10 @@ class CleaningActivity : BaseActivity<ActivityLayoutCleanupingBinding>() {
} }
doOnEnd { doOnEnd {
AdmobUtils.showInterstitialAd(this@CleaningActivity) { AdmobUtils.showInterstitialAd(this@CleaningActivity) {
startActivity(Intent(this@CleaningActivity, ResultActivity::class.java).putExtra("from", AFunOb.JUNK_CLEANER).putExtra("clean_size", intentSize)) startActivity(
Intent(this@CleaningActivity, ResultActivity::class.java).putExtra("from", AFunOb.JUNK_CLEANER)
.putExtra("clean_size", intentSize)
)
finish() finish()
} }
......
package com.test.easy.easycleanerjunk.activity
import android.annotation.SuppressLint
import android.content.Context
import android.content.Intent
import android.net.ConnectivityManager
import android.net.wifi.WifiManager
import android.os.Build
import android.os.Environment
import android.os.StatFs
import androidx.activity.addCallback
import com.test.easy.easycleanerjunk.databinding.ActivityDeviceScanInfoBinding
import com.test.easy.easycleanerjunk.helps.BaseActivity
import com.test.easy.easycleanerjunk.helps.KotlinExt.toFormatSize
import com.test.easy.easycleanerjunk.helps.LogEx
import com.test.easy.easycleanerjunk.helps.StatFsHelper
import com.test.easy.easycleanerjunk.helps.ads.AdmobUtils
import com.test.easy.easycleanerjunk.utils.DeviceUtils
import com.test.easy.easycleanerjunk.view.AFunOb
import java.io.BufferedReader
import java.io.File
import java.io.FileReader
import java.io.IOException
import java.nio.file.Files
import java.nio.file.Paths
import java.util.Locale
class DeviceScanInfoActivity : BaseActivity<ActivityDeviceScanInfoBinding>() {
private val TAG = "DeviceScanActivity"
override val binding: ActivityDeviceScanInfoBinding by lazy {
ActivityDeviceScanInfoBinding.inflate(layoutInflater)
}
@SuppressLint("SetTextI18n")
override fun initView() {
binding.tvDeviceName.text = getDeviceName()
binding.tvAndroidVersion.text = "System Version: Android ${Build.VERSION.RELEASE}"
initStorage()
binding.tvAbis.text = DeviceUtils.getABIs().toStringEx()
val cupInfo = cpuInfo()
cupInfo.forEach {
LogEx.logDebug(TAG, "cupInfo $it")
}
binding.tvCpuCores.text = cupInfo.find { it.contains("CPU architecture") }?.split(":")?.get(1)
binding.tvIpAddress.text = if (isWifiConnected(this)) getWifiIpAddress(this) else ""
binding.tvSsid.text = getWifiSSID(this)
binding.tvLinkSpeed.text = "${getWifiLinkSpeed(this)} Mbps"
binding.tvCpuFrequency.text = "${getCpuFreq("cpuinfo_min_freq") / 1000}MHZ - ${getCpuFreq("cpuinfo_max_freq") / 1000}MHZ"
binding.tvCpuHardware.text = getCpuHardware()
}
override fun initListener() {
binding.tvOk.setOnClickListener {
startActivity(Intent(this, ResultActivity::class.java).apply {
putExtra("from", AFunOb.DEVICE_SCAN)
})
}
binding.flBack.setOnClickListener {
onBackPressedDispatcher.onBackPressed()
}
onBackPressedDispatcher.addCallback {
AdmobUtils.showInterstitialAd(this@DeviceScanInfoActivity){
finishToMain()
}
}
}
private fun capitalize(str: String?): String? {
return if (str.isNullOrEmpty()) {
str
} else str.substring(0, 1).uppercase(Locale.getDefault()) + str.substring(1).lowercase(Locale.getDefault())
}
fun getDeviceName(): String? {
val manufacturer = Build.MANUFACTURER
val model = Build.MODEL
return if (model.lowercase(Locale.getDefault()).startsWith(manufacturer.lowercase(Locale.getDefault()))) {
capitalize(model)
} else capitalize(manufacturer) + " " + model
}
@SuppressLint("SetTextI18n")
private fun initStorage() {
val stat = StatFs(Environment.getExternalStorageDirectory().path)
val totalSize = StatFsHelper.totalSize()
val availableSize = StatFsHelper.availableSize()
val usedSize = totalSize - availableSize
val usedPercentage = usedSize.toFloat() / totalSize * 100
binding.tvStorage.text = "${usedSize.toFormatSize()}/ ${totalSize.toFormatSize()}"
}
private fun cpuInfo(): ArrayList<String> {
val cpuList: ArrayList<String> = arrayListOf()
try {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
val cpuInfo = String(Files.readAllBytes(Paths.get("/proc/cpuinfo")))
LogEx.logDebug(TAG, "$cpuInfo")
val arrays = cpuInfo.split("\n")
cpuList.addAll(arrays)
}
} catch (e: IOException) {
e.printStackTrace()
}
return cpuList
}
fun isWifiConnected(context: Context): Boolean {
val connectivityManager = context.getSystemService(CONNECTIVITY_SERVICE) as ConnectivityManager
val networkInfo = connectivityManager.activeNetworkInfo
// 检查networkInfo是否为null以及是否连接到Wi-Fi
return networkInfo != null && networkInfo.type == ConnectivityManager.TYPE_WIFI
}
fun getWifiIpAddress(context: Context): String {
val wifiManager = context.getSystemService(WIFI_SERVICE) as WifiManager
val wifiInfo = wifiManager.connectionInfo
val ip = wifiInfo.ipAddress
return if (ip == 0) {
"No network connection"
} else (ip and 0xff).toString() + "." + (ip shr 8 and 0xff) + "." + (ip shr 16 and 0xff) + "." + (ip shr 24 and 0xff)
}
fun getMobileIpAddress(context: Context): String {
val connectivityManager = context.getSystemService(CONNECTIVITY_SERVICE) as ConnectivityManager
val activeNetwork = connectivityManager.activeNetworkInfo
return if (activeNetwork != null && activeNetwork.isConnected) {
activeNetwork.extraInfo.toString().split(" ".toRegex()).dropLastWhile { it.isEmpty() }.toTypedArray()[1].trim { it <= ' ' }
} else "No network connection"
}
fun getWifiSSID(context: Context): String? {
val wifiManager = context.getSystemService(WIFI_SERVICE) as WifiManager
val wifiInfo = wifiManager.connectionInfo
if (wifiInfo != null) {
val ssid = wifiInfo.ssid
// 移除SSID周围的双引号
return if (ssid != null && ssid.isNotEmpty()) ssid.replace("\"".toRegex(), "") else null
}
return "<unknown ssid>"
}
/**
* 获取当前Wi-Fi连接的链路速度。
*
* @param context Android上下文对象。
* @return 链路速度,单位为Mbps。如果没有连接到Wi-Fi或无法获取,则返回-1。
*/
fun getWifiLinkSpeed(context: Context): Int {
val wifiManager = context.getSystemService(WIFI_SERVICE) as WifiManager
val wifiInfo = wifiManager.connectionInfo
// 获取Wi-Fi链路速度,单位为Mbps
return wifiInfo?.linkSpeed ?: -1
}
/**
* @param filePath
* cpuinfo_cur_freq
* cpuinfo_min_freq
* cpuinfo_max_freq
* scaling_available_frequencies
*
* @return 返回数据 546000KHZ=546MHZ
*/
fun getCpuFreq(filePath: String): Int {
val scalingPath = "/sys/devices/system/cpu/cpu0/cpufreq/"
val path = File(scalingPath + filePath)
var frequency = 0
try {
if (path.exists()) {
val reader = BufferedReader(FileReader(path))
val line = reader.readLine()
reader.close()
if (line != null) {
// 处理读取到的频率值
LogEx.logDebug("CPU Frequency", "$filePath: $line kHz")
frequency = line.toInt()
}
}
} catch (e: IOException) {
e.printStackTrace()
}
return frequency
}
@SuppressLint("PrivateApi")
fun getCpuHardware(): String {
val classType = Class.forName("android.os.SystemProperties")
val method = classType.getDeclaredMethod("get", String::class.java)
val result = method.invoke(classType, "ro.board.platform") as String
return result
}
private fun <T> Array<T>.toStringEx(): String {
val sb = StringBuffer()
sb.append("[")
forEachIndexed { index, t ->
if (index == size - 1) {
sb.append("$t")
} else {
sb.append("$t").append(",")
}
}
sb.append("]")
return sb.toString()
}
}
\ No newline at end of file
package com.test.easy.easycleanerjunk.activity
import android.annotation.SuppressLint
import android.os.Environment
import android.os.Handler
import android.view.View
import androidx.activity.addCallback
import androidx.lifecycle.lifecycleScope
import com.test.easy.easycleanerjunk.adapter.ScreenShotAdapter
import com.test.easy.easycleanerjunk.bean.ScreenPhotoBean
import com.test.easy.easycleanerjunk.bean.ScreenshotBean
import com.test.easy.easycleanerjunk.databinding.ActivityScreenShotBinding
import com.test.easy.easycleanerjunk.helps.BaseActivity
import com.test.easy.easycleanerjunk.helps.FileHelps
import com.test.easy.easycleanerjunk.helps.KotlinExt.toFormatSize
import com.test.easy.easycleanerjunk.helps.PermissionHelp.checkStorePermission
import com.test.easy.easycleanerjunk.helps.PermissionHelp.requestStorePermission
import com.test.easy.easycleanerjunk.helps.ads.AdmobUtils
import com.test.easy.easycleanerjunk.view.DialogViews.showGerPermission
import com.test.easy.easycleanerjunk.view.FileDeleteDialog.showFileDeleteDialog
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.async
import kotlinx.coroutines.launch
import java.io.File
import java.text.SimpleDateFormat
import java.util.Locale
import kotlin.collections.HashSet
import kotlin.random.Random
class ScreenShotActivity : BaseActivity<ActivityScreenShotBinding>() {
private lateinit var screenShotAdapter: ScreenShotAdapter
override val binding: ActivityScreenShotBinding by lazy {
ActivityScreenShotBinding.inflate(layoutInflater)
}
override fun initView() {
screenShotAdapter = ScreenShotAdapter { size ->
setCleanUpUi(size)
}
binding.rv.adapter = screenShotAdapter
playLottie()
}
private fun playLottie() {
binding.clLottie.visibility = View.VISIBLE
binding.clLottie.setOnClickListener { }
binding.idLottie.imageAssetsFolder = "easy_imgcompress/images/"
binding.idLottie.setAnimation("easy_imgcompress/data.json")
binding.idLottie.playAnimation()
Handler().postDelayed({
AdmobUtils.showInterstitialAd(this) {
binding.clLottie.visibility = View.GONE
if (checkStorePermission()) {
initData()
} else {
dialog = showGerPermission(null, deny = {},
allow = {
requestStorePermission(launcher, result = { flag ->
if (flag) initData() else finishToMain()
})
})
}
}
}, Random.nextLong(2500, 4000))
}
@SuppressLint("SetTextI18n")
private fun setCleanUpUi(size: Int) {
if (size > 0) {
binding.tvClean.isEnabled = true
binding.tvClean.text = "CLEAN(${size})"
} else {
binding.tvClean.isEnabled = false
binding.tvClean.text = "CLEAN"
}
}
private fun initData() {
val list = getScreenshotBean()
screenShotAdapter.setData(list)
val size = list.sumOf { it.screenPhotoBean.sumOf { ss -> ss.file.length() } }
val sizeF = size.toFormatSize().split(" ")
binding.tvSize.text = sizeF[0]
binding.tvUnit.text = sizeF[1]
}
override fun initListener() {
binding.flBack.setOnClickListener {
onBackPressedDispatcher.onBackPressed()
}
onBackPressedDispatcher.addCallback {
AdmobUtils.showInterstitialAd(this@ScreenShotActivity) {
finishToMain()
}
}
binding.llSelectAll.setOnClickListener {
binding.llSelectAll.isSelected = !binding.llSelectAll.isSelected
screenShotAdapter.toggleSelect(binding.llSelectAll.isSelected)
val size = screenShotAdapter.getSelectDataSize()
setCleanUpUi(size)
}
binding.tvClean.setOnClickListener {
AdmobUtils.showInterstitialAd(this) {
val files = screenShotAdapter.getSelectData()
showFileDeleteDialog {
lifecycleScope.launch(Dispatchers.IO) {
async {
files.forEach { screenFile ->
runCatching {
val file = screenFile.file
if (file.exists()) file.delete()
}
}
}.await()
launch(Dispatchers.Main) {
screenShotAdapter.removeData(files)
}
}
}
}
}
}
private fun getScreenshotBean(): ArrayList<ScreenshotBean> {
val dcim = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DCIM)
val screenFiles = FileHelps.getDcim(dcim)
val hash = HashMap<String, HashSet<File>>()
val formatter = SimpleDateFormat("yyyy/MM", Locale.getDefault())
screenFiles.forEach { file ->
val time = formatter.format(file.lastModified())
if (hash[time] == null) {
hash[time] = HashSet()
}
val set = hash[time]
set?.add(file)
}
val beans = arrayListOf<ScreenshotBean>()
hash.forEach { (t, u) ->
val arrayList = arrayListOf<ScreenPhotoBean>()
val mapList = u.map { file -> ScreenPhotoBean(file) }
arrayList.addAll(mapList)
beans.add(ScreenshotBean(t, arrayList))
}
return beans
}
}
\ No newline at end of file
...@@ -52,7 +52,7 @@ class AppFunctionAdapter(val click: (name: String) -> Unit) : ...@@ -52,7 +52,7 @@ class AppFunctionAdapter(val click: (name: String) -> Unit) :
R.mipmap.t_network, R.mipmap.t_network,
"View network traffic usage and stop traffic-consuming apps", "View network traffic usage and stop traffic-consuming apps",
"View Now" "View Now"
) ),
) )
//修改顺序 //修改顺序
......
package com.test.easy.easycleanerjunk.adapter
import android.annotation.SuppressLint
import android.view.View
import android.view.ViewGroup
import androidx.recyclerview.widget.RecyclerView
import androidx.recyclerview.widget.RecyclerView.ViewHolder
import com.bumptech.glide.Glide
import com.test.easy.easycleanerjunk.R
import com.test.easy.easycleanerjunk.bean.ScreenPhotoBean
import com.test.easy.easycleanerjunk.bean.ScreenshotBean
import com.test.easy.easycleanerjunk.databinding.ItemScreenPhotoBinding
import com.test.easy.easycleanerjunk.databinding.ItemScreenshotBinding
import com.test.easy.easycleanerjunk.view.XmlEx.inflate
class ScreenShotAdapter(
val select: (size: Int) -> Unit
) : RecyclerView.Adapter<ScreenShotAdapter.SSS>() {
private var beans = arrayListOf<ScreenshotBean>()
inner class SSS(view: View) : ViewHolder(view)
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): SSS {
return SSS(R.layout.item_screenshot.inflate(parent))
}
override fun getItemCount(): Int {
return beans.size
}
@SuppressLint("NotifyDataSetChanged")
override fun onBindViewHolder(holder: SSS, position: Int) {
val binding = ItemScreenshotBinding.bind(holder.itemView)
val context = holder.itemView.context
val bean = beans[position]
binding.tvSelectAll.text = if (bean.isSelect) "UNSELECT ALL" else "SELECT ALL"
binding.tvSelectAll.setOnClickListener {
bean.isSelect = !bean.isSelect
bean.screenPhotoBean.forEach { subBean -> subBean.isSelect = bean.isSelect }
notifyItemChanged(position)
select.invoke(getSelectDataSize())
}
binding.tvTime.text = bean.time
binding.group.removeAllViews()
bean.screenPhotoBean.forEach { screenPhotoBean ->
val photoBinding = ItemScreenPhotoBinding.bind(R.layout.item_screen_photo.inflate(binding.group))
Glide.with(context).load(screenPhotoBean.file).centerCrop().into(photoBinding.iv)
photoBinding.ivSelector.isSelected = screenPhotoBean.isSelect
arrayOf(photoBinding.root, photoBinding.ivSelector).forEach {
it.setOnClickListener {
screenPhotoBean.isSelect = !screenPhotoBean.isSelect
photoBinding.ivSelector.isSelected = screenPhotoBean.isSelect
bean.isSelect = bean.screenPhotoBean.all { it.isSelect }
notifyDataSetChanged()
select.invoke(getSelectDataSize())
}
}
binding.group.addView(photoBinding.root)
}
}
@SuppressLint("NotifyDataSetChanged")
fun setData(screenshotBean: List<ScreenshotBean>) {
beans.clear()
beans.addAll(screenshotBean)
notifyDataSetChanged()
}
@SuppressLint("NotifyDataSetChanged")
fun toggleSelect(selected: Boolean) {
beans.forEach {
it.isSelect = selected
it.screenPhotoBean.forEach {
it.isSelect = selected
}
}
notifyDataSetChanged()
}
fun getSelectDataSize(): Int {
return beans.sumOf { bean -> bean.screenPhotoBean.filter { it.isSelect }.size }
}
fun getSelectData(): List<ScreenPhotoBean> {
return beans.flatMap { bean ->
bean.screenPhotoBean.filter { it.isSelect }
}
}
@SuppressLint("NotifyDataSetChanged")
fun removeData(files: List<ScreenPhotoBean>) {
beans.forEach { screenshotBean ->
screenshotBean.screenPhotoBean.removeAll(files.toSet())
}
beans.removeIf { it.screenPhotoBean.isEmpty() }
notifyDataSetChanged()
}
}
\ No newline at end of file
...@@ -11,12 +11,14 @@ import com.test.easy.easycleanerjunk.databinding.ItemToolGrid1Binding ...@@ -11,12 +11,14 @@ import com.test.easy.easycleanerjunk.databinding.ItemToolGrid1Binding
import com.test.easy.easycleanerjunk.databinding.ItemToolsGrid1Binding import com.test.easy.easycleanerjunk.databinding.ItemToolsGrid1Binding
import com.test.easy.easycleanerjunk.helps.ads.AdmobUtils import com.test.easy.easycleanerjunk.helps.ads.AdmobUtils
import com.test.easy.easycleanerjunk.view.AFunOb.APP_MANAGER import com.test.easy.easycleanerjunk.view.AFunOb.APP_MANAGER
import com.test.easy.easycleanerjunk.view.AFunOb.DEVICE_SCAN
import com.test.easy.easycleanerjunk.view.AFunOb.JUNK_CLEANER import com.test.easy.easycleanerjunk.view.AFunOb.JUNK_CLEANER
import com.test.easy.easycleanerjunk.view.AFunOb.LARGE_FILE_CLEANER import com.test.easy.easycleanerjunk.view.AFunOb.LARGE_FILE_CLEANER
import com.test.easy.easycleanerjunk.view.AFunOb.NETWORK_TRAFFIC import com.test.easy.easycleanerjunk.view.AFunOb.NETWORK_TRAFFIC
import com.test.easy.easycleanerjunk.view.AFunOb.NOTIFICATION_CLEANER import com.test.easy.easycleanerjunk.view.AFunOb.NOTIFICATION_CLEANER
import com.test.easy.easycleanerjunk.view.AFunOb.PHOTO_COMPRESS import com.test.easy.easycleanerjunk.view.AFunOb.PHOTO_COMPRESS
import com.test.easy.easycleanerjunk.view.AFunOb.RECENT_APP_USAGE import com.test.easy.easycleanerjunk.view.AFunOb.RECENT_APP_USAGE
import com.test.easy.easycleanerjunk.view.AFunOb.SCREENSHOT_CLEANER
import com.test.easy.easycleanerjunk.view.AFunOb.SIMILAR_PHOTOS import com.test.easy.easycleanerjunk.view.AFunOb.SIMILAR_PHOTOS
import com.test.easy.easycleanerjunk.view.XmlEx.inflate import com.test.easy.easycleanerjunk.view.XmlEx.inflate
...@@ -32,7 +34,7 @@ class ToolsAdapter( ...@@ -32,7 +34,7 @@ class ToolsAdapter(
ToolUI(LARGE_FILE_CLEANER, context.getString(R.string.large_file_cleaner), R.mipmap.t_large), ToolUI(LARGE_FILE_CLEANER, context.getString(R.string.large_file_cleaner), R.mipmap.t_large),
ToolUI(PHOTO_COMPRESS, context.getString(R.string.photo_compress), R.mipmap.t_photo), ToolUI(PHOTO_COMPRESS, context.getString(R.string.photo_compress), R.mipmap.t_photo),
ToolUI(SIMILAR_PHOTOS, context.getString(R.string.similar_photos), R.mipmap.t_similar), ToolUI(SIMILAR_PHOTOS, context.getString(R.string.similar_photos), R.mipmap.t_similar),
ToolUI(APP_MANAGER, context.getString(R.string.app_manager), R.mipmap.t_appmanager) ToolUI(APP_MANAGER, context.getString(R.string.app_manager), R.mipmap.t_appmanager),
) )
), ),
ToolsUI(isAd = true), ToolsUI(isAd = true),
...@@ -42,6 +44,8 @@ class ToolsAdapter( ...@@ -42,6 +44,8 @@ class ToolsAdapter(
ToolUI(NOTIFICATION_CLEANER, context.getString(R.string.notification_cleaner), R.mipmap.t_notification), ToolUI(NOTIFICATION_CLEANER, context.getString(R.string.notification_cleaner), R.mipmap.t_notification),
ToolUI(NETWORK_TRAFFIC, context.getString(R.string.network_traffic), R.mipmap.t_network), ToolUI(NETWORK_TRAFFIC, context.getString(R.string.network_traffic), R.mipmap.t_network),
ToolUI(RECENT_APP_USAGE, context.getString(R.string.recent_app_usage), R.mipmap.t_recent), ToolUI(RECENT_APP_USAGE, context.getString(R.string.recent_app_usage), R.mipmap.t_recent),
ToolUI(DEVICE_SCAN, context.getString(R.string.device_scan), R.mipmap.devicescan),
ToolUI(SCREENSHOT_CLEANER, context.getString(R.string.screenshot_cleaner), R.mipmap.screenshot)
) )
), ),
......
package com.test.easy.easycleanerjunk.bean
import java.io.File
data class ScreenshotBean(
val time: String,
val screenPhotoBean: ArrayList<ScreenPhotoBean>
){
var isSelect: Boolean = false
}
data class ScreenPhotoBean(val file: File) {
var isSelect: Boolean = false
}
\ No newline at end of file
...@@ -3,11 +3,13 @@ package com.test.easy.easycleanerjunk.fragment ...@@ -3,11 +3,13 @@ package com.test.easy.easycleanerjunk.fragment
import android.content.Intent import android.content.Intent
import com.test.easy.easycleanerjunk.activity.AppManagerActivity import com.test.easy.easycleanerjunk.activity.AppManagerActivity
import com.test.easy.easycleanerjunk.activity.BatteryInfoActivity import com.test.easy.easycleanerjunk.activity.BatteryInfoActivity
import com.test.easy.easycleanerjunk.activity.DeviceScanInfoActivity
import com.test.easy.easycleanerjunk.activity.LargeFileCleanActivity import com.test.easy.easycleanerjunk.activity.LargeFileCleanActivity
import com.test.easy.easycleanerjunk.activity.NetWorkActivity import com.test.easy.easycleanerjunk.activity.NetWorkActivity
import com.test.easy.easycleanerjunk.activity.RecentAppActivity import com.test.easy.easycleanerjunk.activity.RecentAppActivity
import com.test.easy.easycleanerjunk.activity.RepeatPhotoActivity import com.test.easy.easycleanerjunk.activity.RepeatPhotoActivity
import com.test.easy.easycleanerjunk.activity.ScanJunkActivity import com.test.easy.easycleanerjunk.activity.ScanJunkActivity
import com.test.easy.easycleanerjunk.activity.ScreenShotActivity
import com.test.easy.easycleanerjunk.activity.photocompress.photo.StartCompressionPhotoActivity import com.test.easy.easycleanerjunk.activity.photocompress.photo.StartCompressionPhotoActivity
import com.test.easy.easycleanerjunk.adapter.ToolsAdapter import com.test.easy.easycleanerjunk.adapter.ToolsAdapter
import com.test.easy.easycleanerjunk.databinding.FragmentLayoutTools1Binding import com.test.easy.easycleanerjunk.databinding.FragmentLayoutTools1Binding
...@@ -16,11 +18,13 @@ import com.test.easy.easycleanerjunk.notificationclean.NotificationGuestActivity ...@@ -16,11 +18,13 @@ import com.test.easy.easycleanerjunk.notificationclean.NotificationGuestActivity
import com.test.easy.easycleanerjunk.view.AFunOb import com.test.easy.easycleanerjunk.view.AFunOb
import com.test.easy.easycleanerjunk.view.AFunOb.APP_MANAGER import com.test.easy.easycleanerjunk.view.AFunOb.APP_MANAGER
import com.test.easy.easycleanerjunk.view.AFunOb.BATTERY_INFO import com.test.easy.easycleanerjunk.view.AFunOb.BATTERY_INFO
import com.test.easy.easycleanerjunk.view.AFunOb.DEVICE_SCAN
import com.test.easy.easycleanerjunk.view.AFunOb.LARGE_FILE_CLEANER import com.test.easy.easycleanerjunk.view.AFunOb.LARGE_FILE_CLEANER
import com.test.easy.easycleanerjunk.view.AFunOb.NETWORK_TRAFFIC import com.test.easy.easycleanerjunk.view.AFunOb.NETWORK_TRAFFIC
import com.test.easy.easycleanerjunk.view.AFunOb.NOTIFICATION_CLEANER import com.test.easy.easycleanerjunk.view.AFunOb.NOTIFICATION_CLEANER
import com.test.easy.easycleanerjunk.view.AFunOb.PHOTO_COMPRESS import com.test.easy.easycleanerjunk.view.AFunOb.PHOTO_COMPRESS
import com.test.easy.easycleanerjunk.view.AFunOb.RECENT_APP_USAGE import com.test.easy.easycleanerjunk.view.AFunOb.RECENT_APP_USAGE
import com.test.easy.easycleanerjunk.view.AFunOb.SCREENSHOT_CLEANER
import com.test.easy.easycleanerjunk.view.AFunOb.SIMILAR_PHOTOS import com.test.easy.easycleanerjunk.view.AFunOb.SIMILAR_PHOTOS
class ToolsFragment : BaseFragment<FragmentLayoutTools1Binding>() { class ToolsFragment : BaseFragment<FragmentLayoutTools1Binding>() {
...@@ -69,6 +73,14 @@ class ToolsFragment : BaseFragment<FragmentLayoutTools1Binding>() { ...@@ -69,6 +73,14 @@ class ToolsFragment : BaseFragment<FragmentLayoutTools1Binding>() {
startActivity(Intent(requireActivity(), BatteryInfoActivity::class.java)) startActivity(Intent(requireActivity(), BatteryInfoActivity::class.java))
} }
DEVICE_SCAN -> {
startActivity(Intent(requireActivity(), DeviceScanInfoActivity::class.java))
}
SCREENSHOT_CLEANER -> {
startActivity(Intent(requireActivity(), ScreenShotActivity::class.java))
}
} }
} }
binding.rvTools.adapter = adapter binding.rvTools.adapter = adapter
......
...@@ -6,6 +6,8 @@ import kotlinx.coroutines.Dispatchers ...@@ -6,6 +6,8 @@ import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.MainScope import kotlinx.coroutines.MainScope
import kotlinx.coroutines.launch import kotlinx.coroutines.launch
import kotlinx.coroutines.withContext import kotlinx.coroutines.withContext
import java.io.File
import java.util.LinkedList
object FileHelps { object FileHelps {
...@@ -60,4 +62,34 @@ object FileHelps { ...@@ -60,4 +62,34 @@ object FileHelps {
} }
} }
fun getDcim(
folder: File,
): ArrayList<File> {
val result = arrayListOf<File>()
//添加第一层文件到链表
val linkList = LinkedList<File>()
folder.listFiles()?.forEach {
if (it.isDirectory) {
linkList.add(it)
} else {
result.add(it)
}
}
//链表取文件
var tempFile: File
while (!linkList.isEmpty()) {
tempFile = linkList.removeFirst()
val tempFileList = tempFile.listFiles()
tempFileList?.forEach {
if (it.isDirectory) {
linkList.add(it)
} else {
result.add(it)
}
}
}
return result
}
} }
\ No newline at end of file
package com.test.easy.easycleanerjunk.utils; package com.test.easy.easycleanerjunk.utils;
import android.content.Context; import android.content.Context;
import android.os.Build;
import android.text.TextUtils;
import android.util.DisplayMetrics; import android.util.DisplayMetrics;
import android.view.WindowManager; import android.view.WindowManager;
...@@ -28,4 +30,15 @@ public class DeviceUtils { ...@@ -28,4 +30,15 @@ public class DeviceUtils {
return dm.heightPixels; return dm.heightPixels;
} }
public static String[] getABIs() {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
return Build.SUPPORTED_ABIS;
} else {
if (!TextUtils.isEmpty(Build.CPU_ABI2)) {
return new String[]{Build.CPU_ABI, Build.CPU_ABI2};
}
return new String[]{Build.CPU_ABI};
}
}
} }
\ No newline at end of file
...@@ -16,5 +16,6 @@ object AFunOb { ...@@ -16,5 +16,6 @@ object AFunOb {
const val APP_SPEED = "App Speed" const val APP_SPEED = "App Speed"
const val BATTERY_OPTIMIZER = "Battery Optimizer" const val BATTERY_OPTIMIZER = "Battery Optimizer"
const val DEVICE_SCAN = "Device Scan" const val DEVICE_SCAN = "Device Scan"
const val SCREENSHOT_CLEANER = "Screenshot Cleaner"
} }
\ No newline at end of file
package com.test.easy.easycleanerjunk.view
import android.content.Context
import android.view.LayoutInflater
import androidx.appcompat.app.AlertDialog
import com.test.easy.easycleanerjunk.databinding.DialogNotificationOpenAlertBinding
object NotificationOpenDialog {
fun Context.showNotificationOpenDialog() {
val binding = DialogNotificationOpenAlertBinding.inflate(LayoutInflater.from(this))
val dialog = AlertDialog.Builder(this).setView(binding.root).create()
dialog.setContentView(binding.root)
dialog.setCanceledOnTouchOutside(true)
dialog.show()
}
}
\ 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/quanxuan_s" android:state_selected="true" />
<item android:drawable="@mipmap/quanxuan_n" android:state_selected="false" />
</selector>
\ No newline at end of file
This diff is collapsed.
...@@ -3,8 +3,7 @@ ...@@ -3,8 +3,7 @@
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent">
tools:context=".activity.MainActivity">
<androidx.viewpager2.widget.ViewPager2 <androidx.viewpager2.widget.ViewPager2
android:id="@+id/id_vp" android:id="@+id/id_vp"
......
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout 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:id="@+id/main"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".activity.ScreenShotActivity">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#F4F5F9"
android:orientation="vertical">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white">
<FrameLayout
android:id="@+id/fl_back"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="20dp"
android:padding="8dp"
app:layout_constraintBottom_toBottomOf="@id/tv_title"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="@id/tv_title">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@mipmap/fanhui"
android:tint="@color/black"
tools:ignore="ContentDescription,UseAppTint" />
</FrameLayout>
<TextView
android:id="@+id/tv_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Screenshot Cleaner"
android:textSize="19sp"
android:textStyle="bold"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.1"
tools:ignore="HardcodedText" />
<FrameLayout
android:id="@+id/fl_recycle_bin"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="20dp"
android:layout_marginEnd="16dp"
android:padding="8dp"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.3">
</FrameLayout>
<LinearLayout
android:id="@+id/ll_size"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginStart="16dp"
android:layout_marginTop="20dp"
android:orientation="horizontal"
app:layout_constraintEnd_toEndOf="@id/tv_title"
app:layout_constraintStart_toStartOf="@id/tv_title"
app:layout_constraintTop_toBottomOf="@id/tv_title">
<TextView
android:id="@+id/tv_size"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/theme_color"
android:textSize="40sp"
android:textStyle="bold"
tools:text="90.1" />
<TextView
android:id="@+id/tv_unit"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="start"
android:includeFontPadding="false"
android:textColor="@color/theme_color"
android:textSize="16sp"
tools:text="MB" />
</LinearLayout>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:layout_marginBottom="30dp"
android:text="Screenshots totally"
android:textColor="#666666"
android:textSize="15sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="@id/tv_title"
app:layout_constraintStart_toStartOf="@id/tv_title"
app:layout_constraintTop_toBottomOf="@id/ll_size"
tools:ignore="HardcodedText" />
</androidx.constraintlayout.widget.ConstraintLayout>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" />
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="80dp">
<LinearLayout
android:id="@+id/ll_select_all"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="30dp"
android:orientation="vertical"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:ignore="UseCompoundDrawables">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:minWidth="23dp"
android:minHeight="23dp"
android:src="@drawable/bg_selector_square"
tools:ignore="ContentDescription" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Select All"
tools:ignore="HardcodedText" />
</LinearLayout>
<com.noober.background.view.BLTextView
android:id="@+id/tv_clean"
android:layout_width="266dp"
android:layout_height="50dp"
android:enabled="false"
android:gravity="center"
android:text="CLEAN"
android:textColor="@color/white"
android:textSize="19sp"
app:bl_corners_radius="10dp"
app:bl_enabled_solid_color="@color/theme_color"
app:bl_unEnabled_solid_color="#BEBEBE"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/ll_select_all"
app:layout_constraintTop_toTopOf="parent"
tools:ignore="HardcodedText" />
</androidx.constraintlayout.widget.ConstraintLayout>
</LinearLayout>
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/cl_lottie"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#4772ff">
<com.airbnb.lottie.LottieAnimationView
android:id="@+id/id_lottie"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:lottie_autoPlay="true"
app:lottie_loop="true" />
<TextView
android:id="@+id/id_scaning"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="100dp"
android:gravity="center"
android:text="Wait a moment please."
android:textColor="@color/white"
android:textSize="18sp"
android:textStyle="bold"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
tools:ignore="HardcodedText" />
</androidx.constraintlayout.widget.ConstraintLayout>
</FrameLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<androidx.cardview.widget.CardView 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="wrap_content"
android:layout_height="wrap_content"
app:cardBackgroundColor="@color/white"
app:cardCornerRadius="10dp">
<LinearLayout
android:layout_width="319dp"
android:layout_height="wrap_content"
android:orientation="vertical">
<ImageView
android:layout_width="match_parent"
android:layout_height="167dp"
android:src="@mipmap/tanchuangbg"
tools:ignore="ContentDescription" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="20dp"
android:text="Don't miss important tips"
android:textColor="@color/black"
android:textSize="16sp"
android:textStyle="bold"
tools:ignore="HardcodedText" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginHorizontal="27dp"
android:layout_marginTop="16dp"
android:gravity="center"
android:text="Enable notifications to receive important suggestions."
tools:ignore="HardcodedText" />
<com.noober.background.view.BLTextView
android:layout_width="251dp"
android:layout_height="44dp"
android:layout_gravity="center_horizontal"
android:layout_marginTop="8dp"
android:layout_marginBottom="30dp"
app:bl_corners_radius="24dp"
app:bl_solid_color="#4772FF" />
</LinearLayout>
</androidx.cardview.widget.CardView>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<androidx.cardview.widget.CardView 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="0dp"
android:layout_columnWeight="1"
android:layout_height="109dp"
android:layout_margin="4dp"
app:cardCornerRadius="5dp">
<ImageView
android:id="@+id/iv"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:ignore="ContentDescription" />
<ImageView
android:id="@+id/iv_selector"
android:layout_width="25dp"
android:layout_height="25dp"
android:layout_gravity="end"
android:layout_margin="5dp"
android:importantForAccessibility="no"
android:src="@drawable/bg_select_all" />
</androidx.cardview.widget.CardView>
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout 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="wrap_content"
android:layout_margin="15dp"
android:orientation="vertical">
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
tools:ignore="UselessParent">
<TextView
android:id="@+id/tv_time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical|start"
android:textColor="@color/black"
android:textSize="15sp"
tools:ignore="HardcodedText"
tools:text="3024/06" />
<TextView
android:id="@+id/tv_select_all"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical|end"
android:text="SELECT ALL"
android:textColor="@color/theme_color"
android:textSize="15sp"
tools:ignore="HardcodedText" />
</FrameLayout>
<GridLayout
android:id="@+id/group"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:columnCount="3" />
</LinearLayout>
\ No newline at end of file
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_columnWeight="1" android:layout_columnWeight="1"
android:layout_margin="16dp" android:padding="16dp"
android:background="?android:attr/selectableItemBackground" android:background="?android:attr/selectableItemBackground"
android:clickable="true" android:clickable="true"
android:focusable="true" android:focusable="true"
......
...@@ -188,4 +188,6 @@ ...@@ -188,4 +188,6 @@
<string name="last_7_days">Last 7 days</string> <string name="last_7_days">Last 7 days</string>
<string name="battery_info">Battery Info</string> <string name="battery_info">Battery Info</string>
<string name="similar_photos">Similar Photos</string> <string name="similar_photos">Similar Photos</string>
<string name="device_scan">Device Scan</string>
<string name="screenshot_cleaner">Screenshot Cleaner</string>
</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