Commit 46cf468d authored by wanglei's avatar wanglei

同步代码

parent 2149a77f
...@@ -36,7 +36,7 @@ class ScreenShotActivity : BaseActivity<ActivityScreenShotBinding>() { ...@@ -36,7 +36,7 @@ class ScreenShotActivity : BaseActivity<ActivityScreenShotBinding>() {
} }
override fun initView() { override fun initView() {
screenShotAdapter = ScreenShotAdapter { size -> screenShotAdapter = ScreenShotAdapter(this) { size ->
setCleanUpUi(size) setCleanUpUi(size)
} }
...@@ -52,6 +52,7 @@ class ScreenShotActivity : BaseActivity<ActivityScreenShotBinding>() { ...@@ -52,6 +52,7 @@ class ScreenShotActivity : BaseActivity<ActivityScreenShotBinding>() {
binding.idLottie.setAnimation("easy_imgcompress/data.json") binding.idLottie.setAnimation("easy_imgcompress/data.json")
binding.idLottie.playAnimation() binding.idLottie.playAnimation()
Handler().postDelayed({ Handler().postDelayed({
AdmobUtils.showInterstitialAd(this) { AdmobUtils.showInterstitialAd(this) {
binding.clLottie.visibility = View.GONE binding.clLottie.visibility = View.GONE
...@@ -64,9 +65,9 @@ class ScreenShotActivity : BaseActivity<ActivityScreenShotBinding>() { ...@@ -64,9 +65,9 @@ class ScreenShotActivity : BaseActivity<ActivityScreenShotBinding>() {
if (flag) initData() else finishToMain() if (flag) initData() else finishToMain()
}) })
}) })
} }
} }
}, Random.nextLong(2500, 4000)) }, Random.nextLong(2500, 4000))
} }
...@@ -81,6 +82,7 @@ class ScreenShotActivity : BaseActivity<ActivityScreenShotBinding>() { ...@@ -81,6 +82,7 @@ class ScreenShotActivity : BaseActivity<ActivityScreenShotBinding>() {
binding.tvClean.isEnabled = false binding.tvClean.isEnabled = false
binding.tvClean.text = "CLEAN" binding.tvClean.text = "CLEAN"
} }
binding.llSelectAll.isSelected = screenShotAdapter.isAllSelect()
} }
private fun initData() { private fun initData() {
...@@ -90,6 +92,9 @@ class ScreenShotActivity : BaseActivity<ActivityScreenShotBinding>() { ...@@ -90,6 +92,9 @@ class ScreenShotActivity : BaseActivity<ActivityScreenShotBinding>() {
val sizeF = size.toFormatSize().split(" ") val sizeF = size.toFormatSize().split(" ")
binding.tvSize.text = sizeF[0] binding.tvSize.text = sizeF[0]
binding.tvUnit.text = sizeF[1] binding.tvUnit.text = sizeF[1]
binding.root.postDelayed({
binding.llSelectAll.callOnClick()
}, Random.nextLong(500, 1000))
} }
override fun initListener() { override fun initListener() {
......
...@@ -7,6 +7,7 @@ import com.test.easy.easycleanerjunk.databinding.ActivitySettingBinding ...@@ -7,6 +7,7 @@ import com.test.easy.easycleanerjunk.databinding.ActivitySettingBinding
import com.test.easy.easycleanerjunk.display.NotificationService import com.test.easy.easycleanerjunk.display.NotificationService
import com.test.easy.easycleanerjunk.display.fcm.FcmHelper import com.test.easy.easycleanerjunk.display.fcm.FcmHelper
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.allNotification import com.test.easy.easycleanerjunk.helps.ConfigHelper.allNotification
import com.test.easy.easycleanerjunk.helps.ConfigHelper.remainNotification import com.test.easy.easycleanerjunk.helps.ConfigHelper.remainNotification
...@@ -44,7 +45,7 @@ class SettingActivity : BaseActivity<ActivitySettingBinding>() { ...@@ -44,7 +45,7 @@ class SettingActivity : BaseActivity<ActivitySettingBinding>() {
binding.cardPrivacy.setOnClickListener { binding.cardPrivacy.setOnClickListener {
val intent = Intent( val intent = Intent(
Intent.ACTION_VIEW, Intent.ACTION_VIEW,
Uri.parse("https://sites.google.com/view/super-cleaner-max/super-cleaner-max") Uri.parse(ConfigHelper.privacyPolicy)
) )
startActivity(intent) startActivity(intent)
} }
......
...@@ -42,7 +42,7 @@ class PrivacyAgreementManager { ...@@ -42,7 +42,7 @@ class PrivacyAgreementManager {
binding.idTvPrivacyPolicy.setOnClickListener { binding.idTvPrivacyPolicy.setOnClickListener {
val intent = Intent( val intent = Intent(
Intent.ACTION_VIEW, Intent.ACTION_VIEW,
Uri.parse("https://sites.google.com/view/easy-cleannow/easy-clean") Uri.parse(ConfigHelper.privacyPolicy)
) )
context.startActivity(intent) context.startActivity(intent)
} }
......
package com.test.easy.easycleanerjunk.adapter package com.test.easy.easycleanerjunk.adapter
import android.annotation.SuppressLint import android.annotation.SuppressLint
import android.content.Context
import android.view.Gravity
import android.view.View import android.view.View
import android.view.ViewGroup import android.view.ViewGroup
import android.widget.GridLayout
import android.widget.LinearLayout
import androidx.core.view.setMargins
import androidx.recyclerview.widget.RecyclerView import androidx.recyclerview.widget.RecyclerView
import androidx.recyclerview.widget.RecyclerView.LayoutParams
import androidx.recyclerview.widget.RecyclerView.ViewHolder import androidx.recyclerview.widget.RecyclerView.ViewHolder
import com.bumptech.glide.Glide import com.bumptech.glide.Glide
import com.test.easy.easycleanerjunk.R import com.test.easy.easycleanerjunk.R
...@@ -15,13 +21,17 @@ import com.test.easy.easycleanerjunk.view.XmlEx.inflate ...@@ -15,13 +21,17 @@ import com.test.easy.easycleanerjunk.view.XmlEx.inflate
class ScreenShotAdapter( class ScreenShotAdapter(
val context: Context,
val select: (size: Int) -> Unit val select: (size: Int) -> Unit
) : RecyclerView.Adapter<ScreenShotAdapter.SSS>() { ) : RecyclerView.Adapter<ScreenShotAdapter.SSS>() {
private var beans = arrayListOf<ScreenshotBean>() private var beans = arrayListOf<ScreenshotBean>()
private val itemViewSize = context.resources.getDimensionPixelOffset(R.dimen.dp_109)
private val margin = context.resources.getDimensionPixelOffset(R.dimen.dp_5)
inner class SSS(view: View) : ViewHolder(view) inner class SSS(view: View) : ViewHolder(view)
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): SSS { override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): SSS {
return SSS(R.layout.item_screenshot.inflate(parent)) return SSS(R.layout.item_screenshot.inflate(parent))
} }
...@@ -43,11 +53,14 @@ class ScreenShotAdapter( ...@@ -43,11 +53,14 @@ class ScreenShotAdapter(
select.invoke(getSelectDataSize()) select.invoke(getSelectDataSize())
} }
binding.tvTime.text = bean.time binding.tvTime.text = bean.time
binding.group.removeAllViews() binding.group.removeAllViews()
bean.screenPhotoBean.forEach { screenPhotoBean -> bean.screenPhotoBean.forEach { screenPhotoBean ->
val photoBinding = ItemScreenPhotoBinding.bind(R.layout.item_screen_photo.inflate(binding.group))
val itemView = R.layout.item_screen_photo.inflate(binding.group)
val photoBinding = ItemScreenPhotoBinding.bind(itemView)
Glide.with(context).load(screenPhotoBean.file).centerCrop().into(photoBinding.iv) Glide.with(context).load(screenPhotoBean.file).centerCrop().into(photoBinding.iv)
photoBinding.ivSelector.isSelected = screenPhotoBean.isSelect photoBinding.ivSelector.isSelected = screenPhotoBean.isSelect
arrayOf(photoBinding.root, photoBinding.ivSelector).forEach { arrayOf(photoBinding.root, photoBinding.ivSelector).forEach {
...@@ -59,9 +72,16 @@ class ScreenShotAdapter( ...@@ -59,9 +72,16 @@ class ScreenShotAdapter(
select.invoke(getSelectDataSize()) select.invoke(getSelectDataSize())
} }
} }
binding.group.addView(photoBinding.root) binding.group.addView(itemView)
} }
if (bean.screenPhotoBean.size < 3) {
repeat(2) {
val itemView = R.layout.item_screen_photo.inflate(binding.group)
itemView.visibility = View.INVISIBLE
binding.group.addView(itemView)
}
}
} }
@SuppressLint("NotifyDataSetChanged") @SuppressLint("NotifyDataSetChanged")
...@@ -82,6 +102,10 @@ class ScreenShotAdapter( ...@@ -82,6 +102,10 @@ class ScreenShotAdapter(
notifyDataSetChanged() notifyDataSetChanged()
} }
fun isAllSelect(): Boolean {
return beans.all { bean -> bean.screenPhotoBean.all { it.isSelect } }
}
fun getSelectDataSize(): Int { fun getSelectDataSize(): Int {
return beans.sumOf { bean -> bean.screenPhotoBean.filter { it.isSelect }.size } return beans.sumOf { bean -> bean.screenPhotoBean.filter { it.isSelect }.size }
} }
......
...@@ -7,10 +7,11 @@ import com.test.easy.easycleanerjunk.utils.SPUtils ...@@ -7,10 +7,11 @@ import com.test.easy.easycleanerjunk.utils.SPUtils
object ConfigHelper { object ConfigHelper {
var gid = ""
var isOpenNotification = false var isOpenNotification = false
var appList: List<AppInfo>? = null var appList: List<AppInfo>? = null
const val privacyPolicy = "https://sites.google.com/view/easy-cleannow/easy-clean"
// 域名 // 域名
const val eventUrl = "https://rp.easyfilemanager.xyz" const val eventUrl = "https://rp.easyfilemanager.xyz"
......
...@@ -3,12 +3,12 @@ ...@@ -3,12 +3,12 @@
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="0dp" android:layout_width="0dp"
android:layout_weight="1"
android:layout_columnWeight="1" android:layout_columnWeight="1"
android:layout_height="109dp" android:layout_height="109dp"
android:layout_margin="4dp" android:layout_margin="4dp"
app:cardCornerRadius="5dp"> app:cardCornerRadius="5dp">
<ImageView <ImageView
android:id="@+id/iv" android:id="@+id/iv"
android:layout_width="match_parent" android:layout_width="match_parent"
......
...@@ -8,5 +8,9 @@ ...@@ -8,5 +8,9 @@
<dimen name="dp_30">30dp</dimen> <dimen name="dp_30">30dp</dimen>
<dimen name="dp_300" >300dp</dimen> <dimen name="dp_300" >300dp</dimen>
<dimen name="dp_310">310dp</dimen> <dimen name="dp_310">310dp</dimen>
<dimen name="dp_200">200dp</dimen>
<dimen name="dp_109">109dp</dimen>
<dimen name="dp_5">5dp</dimen>
<dimen name="dp_8">8dp</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