Commit 46cf468d authored by wanglei's avatar wanglei

同步代码

parent 2149a77f
......@@ -36,7 +36,7 @@ class ScreenShotActivity : BaseActivity<ActivityScreenShotBinding>() {
}
override fun initView() {
screenShotAdapter = ScreenShotAdapter { size ->
screenShotAdapter = ScreenShotAdapter(this) { size ->
setCleanUpUi(size)
}
......@@ -52,6 +52,7 @@ class ScreenShotActivity : BaseActivity<ActivityScreenShotBinding>() {
binding.idLottie.setAnimation("easy_imgcompress/data.json")
binding.idLottie.playAnimation()
Handler().postDelayed({
AdmobUtils.showInterstitialAd(this) {
binding.clLottie.visibility = View.GONE
......@@ -64,9 +65,9 @@ class ScreenShotActivity : BaseActivity<ActivityScreenShotBinding>() {
if (flag) initData() else finishToMain()
})
})
}
}
}, Random.nextLong(2500, 4000))
}
......@@ -81,6 +82,7 @@ class ScreenShotActivity : BaseActivity<ActivityScreenShotBinding>() {
binding.tvClean.isEnabled = false
binding.tvClean.text = "CLEAN"
}
binding.llSelectAll.isSelected = screenShotAdapter.isAllSelect()
}
private fun initData() {
......@@ -90,6 +92,9 @@ class ScreenShotActivity : BaseActivity<ActivityScreenShotBinding>() {
val sizeF = size.toFormatSize().split(" ")
binding.tvSize.text = sizeF[0]
binding.tvUnit.text = sizeF[1]
binding.root.postDelayed({
binding.llSelectAll.callOnClick()
}, Random.nextLong(500, 1000))
}
override fun initListener() {
......
......@@ -7,6 +7,7 @@ import com.test.easy.easycleanerjunk.databinding.ActivitySettingBinding
import com.test.easy.easycleanerjunk.display.NotificationService
import com.test.easy.easycleanerjunk.display.fcm.FcmHelper
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.remainNotification
......@@ -44,7 +45,7 @@ class SettingActivity : BaseActivity<ActivitySettingBinding>() {
binding.cardPrivacy.setOnClickListener {
val intent = Intent(
Intent.ACTION_VIEW,
Uri.parse("https://sites.google.com/view/super-cleaner-max/super-cleaner-max")
Uri.parse(ConfigHelper.privacyPolicy)
)
startActivity(intent)
}
......
......@@ -42,7 +42,7 @@ class PrivacyAgreementManager {
binding.idTvPrivacyPolicy.setOnClickListener {
val intent = Intent(
Intent.ACTION_VIEW,
Uri.parse("https://sites.google.com/view/easy-cleannow/easy-clean")
Uri.parse(ConfigHelper.privacyPolicy)
)
context.startActivity(intent)
}
......
package com.test.easy.easycleanerjunk.adapter
import android.annotation.SuppressLint
import android.content.Context
import android.view.Gravity
import android.view.View
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.LayoutParams
import androidx.recyclerview.widget.RecyclerView.ViewHolder
import com.bumptech.glide.Glide
import com.test.easy.easycleanerjunk.R
......@@ -15,13 +21,17 @@ import com.test.easy.easycleanerjunk.view.XmlEx.inflate
class ScreenShotAdapter(
val context: Context,
val select: (size: Int) -> Unit
) : RecyclerView.Adapter<ScreenShotAdapter.SSS>() {
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)
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): SSS {
return SSS(R.layout.item_screenshot.inflate(parent))
}
......@@ -43,11 +53,14 @@ class ScreenShotAdapter(
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))
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)
photoBinding.ivSelector.isSelected = screenPhotoBean.isSelect
arrayOf(photoBinding.root, photoBinding.ivSelector).forEach {
......@@ -59,9 +72,16 @@ class ScreenShotAdapter(
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")
......@@ -82,6 +102,10 @@ class ScreenShotAdapter(
notifyDataSetChanged()
}
fun isAllSelect(): Boolean {
return beans.all { bean -> bean.screenPhotoBean.all { it.isSelect } }
}
fun getSelectDataSize(): Int {
return beans.sumOf { bean -> bean.screenPhotoBean.filter { it.isSelect }.size }
}
......
......@@ -7,10 +7,11 @@ import com.test.easy.easycleanerjunk.utils.SPUtils
object ConfigHelper {
var gid = ""
var isOpenNotification = false
var appList: List<AppInfo>? = null
const val privacyPolicy = "https://sites.google.com/view/easy-cleannow/easy-clean"
// 域名
const val eventUrl = "https://rp.easyfilemanager.xyz"
......
......@@ -3,12 +3,12 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="0dp"
android:layout_weight="1"
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"
......
......@@ -8,5 +8,9 @@
<dimen name="dp_30">30dp</dimen>
<dimen name="dp_300" >300dp</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>
\ 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