详情删除和批量删除后返回页面继续进行删除或者恢复
This commit is contained in:
parent
37e894ad47
commit
587636c7a5
@ -13,13 +13,16 @@ import androidx.fragment.app.DialogFragment
|
|||||||
import com.ux.video.file.filerecovery.databinding.DialogRecoveringBinding
|
import com.ux.video.file.filerecovery.databinding.DialogRecoveringBinding
|
||||||
|
|
||||||
|
|
||||||
abstract class BaseIngDialogFragment(var total: Int, var complete: () -> Unit) : DialogFragment() {
|
abstract class BaseIngDialogFragment() : DialogFragment() {
|
||||||
|
var total: Int = 0
|
||||||
|
var completeListener: ((number: Int) -> Unit)? = null
|
||||||
private lateinit var binding: DialogRecoveringBinding
|
private lateinit var binding: DialogRecoveringBinding
|
||||||
|
|
||||||
|
|
||||||
override fun onStart() {
|
override fun onStart() {
|
||||||
super.onStart()
|
super.onStart()
|
||||||
|
dialog?.setCanceledOnTouchOutside(false)
|
||||||
|
isCancelable = false
|
||||||
dialog?.window?.apply {
|
dialog?.window?.apply {
|
||||||
setLayout(
|
setLayout(
|
||||||
ViewGroup.LayoutParams.MATCH_PARENT,
|
ViewGroup.LayoutParams.MATCH_PARENT,
|
||||||
@ -42,7 +45,7 @@ abstract class BaseIngDialogFragment(var total: Int, var complete: () -> Unit) :
|
|||||||
object : CountDownTimer(defaultTimer, 200) {
|
object : CountDownTimer(defaultTimer, 200) {
|
||||||
override fun onFinish() {
|
override fun onFinish() {
|
||||||
progressBar.progress = 100
|
progressBar.progress = 100
|
||||||
complete.invoke()
|
completeListener?.invoke(total)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onTick(millisUntilFinished: Long) {
|
override fun onTick(millisUntilFinished: Long) {
|
||||||
@ -75,7 +78,7 @@ abstract class BaseIngDialogFragment(var total: Int, var complete: () -> Unit) :
|
|||||||
binding.progressBar.progress = progress
|
binding.progressBar.progress = progress
|
||||||
|
|
||||||
if (progress == 100) {
|
if (progress == 100) {
|
||||||
complete.invoke()
|
completeListener?.invoke(number)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -24,7 +24,7 @@ abstract class NewBaseAdapter<K>(
|
|||||||
items?.let { data.addAll(it) }
|
items?.let { data.addAll(it) }
|
||||||
notifyDataSetChanged()
|
notifyDataSetChanged()
|
||||||
}
|
}
|
||||||
|
fun getCurrentData() = data
|
||||||
override fun getItemCount(): Int = data.size
|
override fun getItemCount(): Int = data.size
|
||||||
|
|
||||||
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): RecyclerView.ViewHolder {
|
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): RecyclerView.ViewHolder {
|
||||||
|
|||||||
@ -0,0 +1,45 @@
|
|||||||
|
package com.ux.video.file.filerecovery.photo
|
||||||
|
|
||||||
|
import android.graphics.Color
|
||||||
|
import android.os.Bundle
|
||||||
|
import android.view.LayoutInflater
|
||||||
|
import android.view.View
|
||||||
|
import android.view.ViewGroup
|
||||||
|
import androidx.core.graphics.drawable.toDrawable
|
||||||
|
import androidx.fragment.app.DialogFragment
|
||||||
|
import com.ux.video.file.filerecovery.databinding.DialogDeleteBinding
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除确认弹窗
|
||||||
|
*/
|
||||||
|
class ConfirmDeleteDialogFragment() : DialogFragment() {
|
||||||
|
|
||||||
|
var onClickDelete: (() -> Unit)? = null
|
||||||
|
private lateinit var binding: DialogDeleteBinding
|
||||||
|
override fun onStart() {
|
||||||
|
super.onStart()
|
||||||
|
dialog?.window?.apply {
|
||||||
|
setLayout(
|
||||||
|
ViewGroup.LayoutParams.MATCH_PARENT,
|
||||||
|
ViewGroup.LayoutParams.WRAP_CONTENT
|
||||||
|
)
|
||||||
|
setBackgroundDrawable(Color.TRANSPARENT.toDrawable())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onCreateView(
|
||||||
|
inflater: LayoutInflater, container: ViewGroup?,
|
||||||
|
savedInstanceState: Bundle?
|
||||||
|
): View? {
|
||||||
|
binding = DialogDeleteBinding.inflate(inflater)
|
||||||
|
binding.run {
|
||||||
|
tvCancel.setOnClickListener { dismiss() }
|
||||||
|
tvDelete.setOnClickListener {
|
||||||
|
onClickDelete?.invoke()
|
||||||
|
dismiss()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return binding.root
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -8,7 +8,7 @@ import com.ux.video.file.filerecovery.databinding.DialogRecoveringBinding
|
|||||||
/**
|
/**
|
||||||
* 删除中弹窗
|
* 删除中弹窗
|
||||||
*/
|
*/
|
||||||
class DeletingDialogFragment(total: Int, complete:()-> Unit) : BaseIngDialogFragment(total,complete) {
|
class DeletingDialogFragment() : BaseIngDialogFragment() {
|
||||||
|
|
||||||
override fun initUi(binding: DialogRecoveringBinding) {
|
override fun initUi(binding: DialogRecoveringBinding) {
|
||||||
binding.run {
|
binding.run {
|
||||||
|
|||||||
@ -25,7 +25,7 @@ class PhotoDisplayDateAdapter(
|
|||||||
|
|
||||||
|
|
||||||
private var allSelected: Boolean? = null
|
private var allSelected: Boolean? = null
|
||||||
// private var hideThumbnails = false
|
|
||||||
override fun getViewBinding(parent: ViewGroup): PhotoDisplayDateAdapterBinding =
|
override fun getViewBinding(parent: ViewGroup): PhotoDisplayDateAdapterBinding =
|
||||||
PhotoDisplayDateAdapterBinding.inflate(
|
PhotoDisplayDateAdapterBinding.inflate(
|
||||||
LayoutInflater.from(parent.context),
|
LayoutInflater.from(parent.context),
|
||||||
@ -33,10 +33,7 @@ class PhotoDisplayDateAdapter(
|
|||||||
false
|
false
|
||||||
)
|
)
|
||||||
|
|
||||||
fun updateHideThumbnails(isChecked: Boolean) {
|
|
||||||
// hideThumbnails = isChecked
|
|
||||||
notifyDataSetChanged()
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 返回所有嵌套的数据量总数
|
* 返回所有嵌套的数据量总数
|
||||||
@ -97,14 +94,6 @@ class PhotoDisplayDateAdapter(
|
|||||||
},clickItem
|
},clickItem
|
||||||
).apply { setData(files) }
|
).apply { setData(files) }
|
||||||
|
|
||||||
// if (hideThumbnails && files.filter { !it.isThumbnail }.isEmpty()) {
|
|
||||||
// holder.vb.root.isVisible = false
|
|
||||||
// return
|
|
||||||
// }else{
|
|
||||||
// holder.vb.root.isVisible = true
|
|
||||||
// childAdapter.updateHideThumbnails(hideThumbnails)
|
|
||||||
// }
|
|
||||||
|
|
||||||
allSelected?.let {
|
allSelected?.let {
|
||||||
childAdapter.setAllSelected(it)
|
childAdapter.setAllSelected(it)
|
||||||
}
|
}
|
||||||
|
|||||||
@ -43,27 +43,16 @@ class PhotoDisplayDateChildAdapter(
|
|||||||
) :
|
) :
|
||||||
NewBaseAdapter<ResultPhotosFiles>(mContext) {
|
NewBaseAdapter<ResultPhotosFiles>(mContext) {
|
||||||
|
|
||||||
// private var hideThumbnails: Boolean? = null
|
|
||||||
//日期组某一天的数据选择状态维护
|
//日期组某一天的数据选择状态维护
|
||||||
val dateSelectedMap = mutableSetOf<ResultPhotosFiles>()
|
val dateSelectedMap = mutableSetOf<ResultPhotosFiles>()
|
||||||
|
|
||||||
//实际显示数据集合(包含隐藏的缩略图)
|
|
||||||
// val visibleList = data.toMutableSet()
|
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
private const val TYPE_TWO = 2
|
private const val TYPE_TWO = 2
|
||||||
private const val TYPE_THREE = 3
|
private const val TYPE_THREE = 3
|
||||||
private const val TYPE_FOUR = 4
|
private const val TYPE_FOUR = 4
|
||||||
}
|
}
|
||||||
|
|
||||||
// fun getVisibleList() = visibleList
|
|
||||||
|
|
||||||
fun updateHideThumbnails(isChecked: Boolean){
|
|
||||||
// hideThumbnails = isChecked
|
|
||||||
notifyDataSetChanged()
|
|
||||||
hideThumbnailsUpdate.invoke(getVisibleCount(dateSelectedMap.toMutableList(),isChecked) == getVisibleCount(data,isChecked))
|
|
||||||
}
|
|
||||||
|
|
||||||
fun setAllSelected(isAdd: Boolean) {
|
fun setAllSelected(isAdd: Boolean) {
|
||||||
data.forEach {
|
data.forEach {
|
||||||
addOrRemove(it, isAdd)
|
addOrRemove(it, isAdd)
|
||||||
@ -132,12 +121,12 @@ class PhotoDisplayDateChildAdapter(
|
|||||||
|
|
||||||
when (holder) {
|
when (holder) {
|
||||||
is TwoHolder -> holder.vb.run {
|
is TwoHolder -> holder.vb.run {
|
||||||
// root.isVisible = !(hideThumbnails == true && item.isThumbnail)
|
|
||||||
initDateView(rootLayout, imageSelect, textSize, imageThumbnail, item)
|
initDateView(rootLayout, imageSelect, textSize, imageThumbnail, item)
|
||||||
}
|
}
|
||||||
|
|
||||||
is ThreeHolder -> holder.vb.run {
|
is ThreeHolder -> holder.vb.run {
|
||||||
// root.isVisible = !(hideThumbnails == true && item.isThumbnail)
|
|
||||||
initDateView(rootLayout, imageSelect, textSize, imageThumbnail, item)
|
initDateView(rootLayout, imageSelect, textSize, imageThumbnail, item)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -218,16 +207,11 @@ class PhotoDisplayDateChildAdapter(
|
|||||||
dateSelectedMap.remove(resultPhotosFiles)
|
dateSelectedMap.remove(resultPhotosFiles)
|
||||||
}
|
}
|
||||||
onSelectedUpdate.invoke(resultPhotosFiles, boolean, dateSelectedMap.size == data.size)
|
onSelectedUpdate.invoke(resultPhotosFiles, boolean, dateSelectedMap.size == data.size)
|
||||||
// updateSelected(resultPhotosFiles,boolean)
|
|
||||||
}
|
|
||||||
|
|
||||||
private fun updateSelected(resultPhotosFiles: ResultPhotosFiles,boolean: Boolean){
|
|
||||||
// hideThumbnails?.let {
|
|
||||||
// onSelectedUpdate.invoke(resultPhotosFiles, boolean, getVisibleCount(dateSelectedMap.toMutableList(),it) == getVisibleCount(data,it))
|
|
||||||
// }
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
fun getVisibleCount(list: MutableList<ResultPhotosFiles> = data, hideThumbnails: Boolean): Int {
|
fun getVisibleCount(list: MutableList<ResultPhotosFiles> = data, hideThumbnails: Boolean): Int {
|
||||||
if(hideThumbnails){
|
if(hideThumbnails){
|
||||||
return list.filter { !it.isThumbnail }.size
|
return list.filter { !it.isThumbnail }.size
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
package com.ux.video.file.filerecovery.photo
|
package com.ux.video.file.filerecovery.photo
|
||||||
|
|
||||||
|
import android.content.Intent
|
||||||
import android.graphics.drawable.Drawable
|
import android.graphics.drawable.Drawable
|
||||||
import android.os.Build
|
import android.os.Build
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
@ -8,6 +9,7 @@ import androidx.activity.enableEdgeToEdge
|
|||||||
import androidx.appcompat.app.AppCompatActivity
|
import androidx.appcompat.app.AppCompatActivity
|
||||||
import androidx.core.view.ViewCompat
|
import androidx.core.view.ViewCompat
|
||||||
import androidx.core.view.WindowInsetsCompat
|
import androidx.core.view.WindowInsetsCompat
|
||||||
|
import androidx.lifecycle.lifecycleScope
|
||||||
import com.bumptech.glide.Glide
|
import com.bumptech.glide.Glide
|
||||||
import com.bumptech.glide.load.DataSource
|
import com.bumptech.glide.load.DataSource
|
||||||
import com.bumptech.glide.load.engine.GlideException
|
import com.bumptech.glide.load.engine.GlideException
|
||||||
@ -20,6 +22,8 @@ import com.ux.video.file.filerecovery.R
|
|||||||
import com.ux.video.file.filerecovery.base.BaseActivity
|
import com.ux.video.file.filerecovery.base.BaseActivity
|
||||||
import com.ux.video.file.filerecovery.databinding.ActivityPhotoInfoBinding
|
import com.ux.video.file.filerecovery.databinding.ActivityPhotoInfoBinding
|
||||||
import com.ux.video.file.filerecovery.databinding.ActivityPhotoSortingBinding
|
import com.ux.video.file.filerecovery.databinding.ActivityPhotoSortingBinding
|
||||||
|
import com.ux.video.file.filerecovery.photo.PhotoSortingActivity
|
||||||
|
import com.ux.video.file.filerecovery.success.RecoverySuccessActivity
|
||||||
import com.ux.video.file.filerecovery.utils.Common
|
import com.ux.video.file.filerecovery.utils.Common
|
||||||
import com.ux.video.file.filerecovery.utils.ExtendFunctions.dpToPx
|
import com.ux.video.file.filerecovery.utils.ExtendFunctions.dpToPx
|
||||||
import com.ux.video.file.filerecovery.utils.ScanManager
|
import com.ux.video.file.filerecovery.utils.ScanManager
|
||||||
@ -43,17 +47,17 @@ class PhotoInfoActivity : BaseActivity<ActivityPhotoInfoBinding>() {
|
|||||||
@Suppress("DEPRECATION")
|
@Suppress("DEPRECATION")
|
||||||
intent.getParcelableExtra("MY_KEY")
|
intent.getParcelableExtra("MY_KEY")
|
||||||
}
|
}
|
||||||
|
|
||||||
binding.run {
|
binding.run {
|
||||||
myData?.let {
|
imageViewBack.setOnClickListener { finish() }
|
||||||
|
myData?.let { resultPhotosFiles->
|
||||||
|
|
||||||
tvName.text = it.name
|
tvName.text = resultPhotosFiles.name
|
||||||
tvPath.text = it.path
|
tvPath.text = resultPhotosFiles.path
|
||||||
tvDate.text = Common.getFormatDate(it.lastModified)
|
tvDate.text = Common.getFormatDate(resultPhotosFiles.lastModified)
|
||||||
tvResolution.text = it.resolution
|
tvResolution.text = resultPhotosFiles.resolution
|
||||||
|
|
||||||
Glide.with(this@PhotoInfoActivity)
|
Glide.with(this@PhotoInfoActivity)
|
||||||
.load(it.targetFile)
|
.load(resultPhotosFiles.targetFile)
|
||||||
.apply(
|
.apply(
|
||||||
RequestOptions()
|
RequestOptions()
|
||||||
.transform(
|
.transform(
|
||||||
@ -84,9 +88,33 @@ class PhotoInfoActivity : BaseActivity<ActivityPhotoInfoBinding>() {
|
|||||||
|
|
||||||
})
|
})
|
||||||
.into(image)
|
.into(image)
|
||||||
|
|
||||||
|
layoutBottom.tvLeft.run {
|
||||||
|
text = resources.getString(R.string.delete)
|
||||||
|
setOnClickListener {
|
||||||
|
RecoverOrDeleteManager.showConfirmDeleteDialog(true,supportFragmentManager,lifecycleScope,setOf(resultPhotosFiles)){count->
|
||||||
|
complete(count,1)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
layoutBottom.tvRight.run {
|
||||||
|
text = resources.getString(R.string.recover)
|
||||||
|
setOnClickListener {
|
||||||
|
RecoverOrDeleteManager.showRecoveringDialog(supportFragmentManager,lifecycleScope,setOf(resultPhotosFiles)){count->
|
||||||
|
complete(count,0)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun complete(number: Int,type: Int) {
|
||||||
|
finish()
|
||||||
|
startActivity(Intent(this@PhotoInfoActivity, RecoverySuccessActivity::class.java).apply {
|
||||||
|
putExtra(RecoverySuccessActivity.KEY_SUCCESS_COUNT,number)
|
||||||
|
putExtra(RecoverySuccessActivity.KEY_SUCCESS_TYPE,type)
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -23,12 +23,15 @@ import com.ux.video.file.filerecovery.utils.ExtendFunctions.filterWithinDateRang
|
|||||||
import com.ux.video.file.filerecovery.utils.ExtendFunctions.filterWithinDateRangeList
|
import com.ux.video.file.filerecovery.utils.ExtendFunctions.filterWithinDateRangeList
|
||||||
import com.ux.video.file.filerecovery.utils.ExtendFunctions.getParcelableArrayListExtraCompat
|
import com.ux.video.file.filerecovery.utils.ExtendFunctions.getParcelableArrayListExtraCompat
|
||||||
import com.ux.video.file.filerecovery.utils.ExtendFunctions.mbToBytes
|
import com.ux.video.file.filerecovery.utils.ExtendFunctions.mbToBytes
|
||||||
|
import com.ux.video.file.filerecovery.utils.ExtendFunctions.removeItem
|
||||||
import com.ux.video.file.filerecovery.utils.GridSpacingItemDecoration
|
import com.ux.video.file.filerecovery.utils.GridSpacingItemDecoration
|
||||||
import com.ux.video.file.filerecovery.utils.ScanManager
|
import com.ux.video.file.filerecovery.utils.ScanManager
|
||||||
import com.ux.video.file.filerecovery.utils.ScanManager.copySelectedFilesAsync
|
import com.ux.video.file.filerecovery.utils.ScanManager.copySelectedFilesAsync
|
||||||
import com.ux.video.file.filerecovery.utils.ScanManager.deleteFilesAsync
|
import com.ux.video.file.filerecovery.utils.ScanManager.deleteFilesAsync
|
||||||
import com.ux.video.file.filerecovery.utils.ScanRepository
|
import com.ux.video.file.filerecovery.utils.ScanRepository
|
||||||
|
import kotlinx.coroutines.Dispatchers
|
||||||
import kotlinx.coroutines.launch
|
import kotlinx.coroutines.launch
|
||||||
|
import kotlinx.coroutines.withContext
|
||||||
import java.util.Date
|
import java.util.Date
|
||||||
|
|
||||||
class PhotoSortingActivity : BaseActivity<ActivityPhotoSortingBinding>() {
|
class PhotoSortingActivity : BaseActivity<ActivityPhotoSortingBinding>() {
|
||||||
@ -61,9 +64,6 @@ class PhotoSortingActivity : BaseActivity<ActivityPhotoSortingBinding>() {
|
|||||||
//文件大小排序使用的适配器
|
//文件大小排序使用的适配器
|
||||||
private var sizeSortAdapter: PhotoDisplayDateChildAdapter? = null
|
private var sizeSortAdapter: PhotoDisplayDateChildAdapter? = null
|
||||||
|
|
||||||
private var dialogRecovering: RecoveringDialogFragment? = null
|
|
||||||
|
|
||||||
private var dialogDeleting: DeletingDialogFragment? = null
|
|
||||||
|
|
||||||
private var dialogCustomerDateStart: DatePickerDialogFragment? = null
|
private var dialogCustomerDateStart: DatePickerDialogFragment? = null
|
||||||
private var dialogCustomerDateEnd: DatePickerDialogFragment? = null
|
private var dialogCustomerDateEnd: DatePickerDialogFragment? = null
|
||||||
@ -180,6 +180,7 @@ class PhotoSortingActivity : BaseActivity<ActivityPhotoSortingBinding>() {
|
|||||||
resetCurrentDateList(sortByDateReverse)
|
resetCurrentDateList(sortByDateReverse)
|
||||||
}
|
}
|
||||||
setDateAdapter()
|
setDateAdapter()
|
||||||
|
setSingleDelete()
|
||||||
setFilter()
|
setFilter()
|
||||||
binding.run {
|
binding.run {
|
||||||
imageViewBack.setOnClickListener { finish() }
|
imageViewBack.setOnClickListener { finish() }
|
||||||
@ -219,36 +220,24 @@ class PhotoSortingActivity : BaseActivity<ActivityPhotoSortingBinding>() {
|
|||||||
|
|
||||||
}
|
}
|
||||||
tvRecover.setOnClickListener {
|
tvRecover.setOnClickListener {
|
||||||
showRecoveringDialog()
|
// showRecoveringDialog()
|
||||||
lifecycleScope.copySelectedFilesAsync(
|
RecoverOrDeleteManager.showRecoveringDialog(
|
||||||
selectedSet = filterSelectedSetList,
|
supportFragmentManager,
|
||||||
folder = Common.recoveryPhotoDir,
|
lifecycleScope,
|
||||||
onProgress = { currentCounts: Int, fileName: String, success: Boolean ->
|
filterSelectedSetList
|
||||||
ScanManager.showLog(
|
) { count ->
|
||||||
"--------恢复图片 ",
|
complete(count, 0)
|
||||||
"----------${currentCounts} ${fileName}"
|
|
||||||
)
|
|
||||||
dialogRecovering?.updateProgress(currentCounts)
|
|
||||||
|
|
||||||
}) { counts ->
|
|
||||||
dialogRecovering?.updateProgress(counts)
|
|
||||||
ScanManager.showLog("--------恢复图片 ", "----------恢复完成 ${counts}")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
tvDelete.setOnClickListener {
|
tvDelete.setOnClickListener {
|
||||||
showDeletingDialog()
|
// showConfirmDeleteDialog()
|
||||||
lifecycleScope.deleteFilesAsync(
|
RecoverOrDeleteManager.showConfirmDeleteDialog(
|
||||||
selectedSet = filterSelectedSetList,
|
fragmentManager = supportFragmentManager,
|
||||||
onProgress = { currentCounts: Int, path: String, success: Boolean ->
|
scope = lifecycleScope,
|
||||||
ScanManager.showLog(
|
selectedSetList = filterSelectedSetList
|
||||||
"--------删除图片 ",
|
) { count ->
|
||||||
"----------${currentCounts} ${path}"
|
complete(count, 1)
|
||||||
)
|
|
||||||
dialogDeleting?.updateProgress(currentCounts)
|
|
||||||
}) { counts ->
|
|
||||||
dialogDeleting?.updateProgress(counts)
|
|
||||||
ScanManager.showLog("--------恢复图片 ", "----------恢复完成 ${counts}")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -277,7 +266,8 @@ class PhotoSortingActivity : BaseActivity<ActivityPhotoSortingBinding>() {
|
|||||||
initGetCurrentDateList().let {
|
initGetCurrentDateList().let {
|
||||||
val filterThumbnailsAsync =
|
val filterThumbnailsAsync =
|
||||||
if (switchHideThumbnails.isChecked) it.filterThumbnailsAsync() else it
|
if (switchHideThumbnails.isChecked) it.filterThumbnailsAsync() else it
|
||||||
val sortByDayNewToOld = Common.getSortByDayNewToOld(filterThumbnailsAsync)
|
val sortByDayNewToOld =
|
||||||
|
Common.getSortByDayNewToOld(filterThumbnailsAsync)
|
||||||
dateAdapter?.setData(sortByDayNewToOld)
|
dateAdapter?.setData(sortByDayNewToOld)
|
||||||
resetCurrentDateList(sortByDayNewToOld)
|
resetCurrentDateList(sortByDayNewToOld)
|
||||||
}
|
}
|
||||||
@ -323,8 +313,28 @@ class PhotoSortingActivity : BaseActivity<ActivityPhotoSortingBinding>() {
|
|||||||
//全选按钮 只对当前显示的数据有效
|
//全选按钮 只对当前显示的数据有效
|
||||||
tvSelectAll.setOnClickListener {
|
tvSelectAll.setOnClickListener {
|
||||||
it.isSelected = !it.isSelected
|
it.isSelected = !it.isSelected
|
||||||
|
when (binding.recyclerView.adapter) {
|
||||||
|
is PhotoDisplayDateAdapter -> {
|
||||||
dateAdapter?.setAllSelected(it.isSelected)
|
dateAdapter?.setAllSelected(it.isSelected)
|
||||||
|
dateAdapter?.getCurrentData()?.let {
|
||||||
|
it as List<Pair<String, List<ResultPhotosFiles>>>
|
||||||
|
|
||||||
|
if (it.size > 0)
|
||||||
|
Common.showLog("------------全选按钮 日期-${it.size} ${it[0].second[0].path}")
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
is PhotoDisplayDateChildAdapter -> {
|
||||||
sizeSortAdapter?.setAllSelected(it.isSelected)
|
sizeSortAdapter?.setAllSelected(it.isSelected)
|
||||||
|
sizeSortAdapter?.getCurrentData()?.let {
|
||||||
|
it as List<ResultPhotosFiles>
|
||||||
|
if (it.size > 0)
|
||||||
|
Common.showLog("------------全选按钮 大小-${it.size} ${it[0].path}")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -339,14 +349,22 @@ class PhotoSortingActivity : BaseActivity<ActivityPhotoSortingBinding>() {
|
|||||||
when (binding.recyclerView.adapter) {
|
when (binding.recyclerView.adapter) {
|
||||||
is PhotoDisplayDateAdapter -> {
|
is PhotoDisplayDateAdapter -> {
|
||||||
val adapter = binding.recyclerView.adapter as PhotoDisplayDateAdapter
|
val adapter = binding.recyclerView.adapter as PhotoDisplayDateAdapter
|
||||||
|
if (it > 0) {
|
||||||
binding.tvSelectAll.isSelected = it == adapter.getTotalChildCount(false)
|
binding.tvSelectAll.isSelected = it == adapter.getTotalChildCount(false)
|
||||||
|
} else {
|
||||||
|
binding.tvSelectAll.isSelected = false
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
is PhotoDisplayDateChildAdapter -> {
|
is PhotoDisplayDateChildAdapter -> {
|
||||||
val adapter = binding.recyclerView.adapter as PhotoDisplayDateChildAdapter
|
val adapter = binding.recyclerView.adapter as PhotoDisplayDateChildAdapter
|
||||||
|
if (it > 0) {
|
||||||
binding.tvSelectAll.isSelected =
|
binding.tvSelectAll.isSelected =
|
||||||
it == adapter.itemCount
|
it == adapter.itemCount
|
||||||
|
} else {
|
||||||
|
binding.tvSelectAll.isSelected = false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -358,19 +376,29 @@ class PhotoSortingActivity : BaseActivity<ActivityPhotoSortingBinding>() {
|
|||||||
currentSizeList = currentSizeList ?: currentDateList?.flatMap { it.second }
|
currentSizeList = currentSizeList ?: currentDateList?.flatMap { it.second }
|
||||||
return currentSizeList!!
|
return currentSizeList!!
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun resetCurrentSizeList(currentList: List<ResultPhotosFiles>) {
|
private fun resetCurrentSizeList(currentList: List<ResultPhotosFiles>) {
|
||||||
currentSizeList = currentList
|
currentSizeList = currentList
|
||||||
currentDateList = null
|
currentDateList = null
|
||||||
|
|
||||||
|
binding.tvThumbnailCounts.text =
|
||||||
|
getString(R.string.hide_thumbnails, currentList.filter { it.isThumbnail }.size)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun initGetCurrentDateList(): List<Pair<String, List<ResultPhotosFiles>>> {
|
private fun initGetCurrentDateList(): List<Pair<String, List<ResultPhotosFiles>>> {
|
||||||
currentDateList = currentDateList ?: Common.getSortByDayNewToOldInit(currentSizeList!!)
|
currentDateList = currentDateList ?: Common.getSortByDayNewToOldInit(currentSizeList!!)
|
||||||
return currentDateList!!
|
return currentDateList!!
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun resetCurrentDateList(currentList: List<Pair<String, List<ResultPhotosFiles>>>) {
|
private fun resetCurrentDateList(currentList: List<Pair<String, List<ResultPhotosFiles>>>) {
|
||||||
currentDateList = currentList
|
currentDateList = currentList
|
||||||
currentSizeList = null
|
currentSizeList = null
|
||||||
|
val totalSelectedCount = currentList.sumOf { pair ->
|
||||||
|
pair.second.filter { it.isThumbnail }.size
|
||||||
|
}
|
||||||
|
binding.tvThumbnailCounts.text =
|
||||||
|
getString(R.string.hide_thumbnails, totalSelectedCount)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -649,11 +677,9 @@ class PhotoSortingActivity : BaseActivity<ActivityPhotoSortingBinding>() {
|
|||||||
}
|
}
|
||||||
onPickerChooseListener = { selectedDate ->
|
onPickerChooseListener = { selectedDate ->
|
||||||
filterStartDate = selectedDate
|
filterStartDate = selectedDate
|
||||||
// filterDatePopupWindows?.updateStartEndDate(start = selectedDate)
|
|
||||||
Log.d("showStartDateDialog", "isFirst=${isNeedSetSelected}--------")
|
Log.d("showStartDateDialog", "isFirst=${isNeedSetSelected}--------")
|
||||||
showEndDateDialog(isNeedSetSelected, null)
|
showEndDateDialog(isNeedSetSelected, null)
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
onClickCancel = {
|
onClickCancel = {
|
||||||
|
|
||||||
@ -701,34 +727,115 @@ class PhotoSortingActivity : BaseActivity<ActivityPhotoSortingBinding>() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 显示恢复中弹窗
|
|
||||||
*/
|
|
||||||
private fun showRecoveringDialog() {
|
|
||||||
dialogRecovering =
|
|
||||||
dialogRecovering ?: RecoveringDialogFragment(filterSelectedSetList.size) {
|
|
||||||
complete()
|
|
||||||
}
|
|
||||||
dialogRecovering?.show(supportFragmentManager, "")
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 显示删除中弹窗
|
|
||||||
*/
|
|
||||||
private fun showDeletingDialog() {
|
|
||||||
dialogDeleting = dialogDeleting ?: DeletingDialogFragment(filterSelectedSetList.size) {
|
|
||||||
complete()
|
|
||||||
}
|
|
||||||
dialogDeleting?.show(supportFragmentManager, "")
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除或者恢复完成
|
* 删除或者恢复完成
|
||||||
|
* @param type 0 恢复 1 删除
|
||||||
*/
|
*/
|
||||||
private fun complete() {
|
private fun complete(number: Int, type: Int) {
|
||||||
dialogDeleting?.dismiss()
|
startActivity(Intent(this@PhotoSortingActivity, RecoverySuccessActivity::class.java).apply {
|
||||||
dialogRecovering?.dismiss()
|
putExtra(RecoverySuccessActivity.KEY_SUCCESS_COUNT, number)
|
||||||
startActivity(Intent(this@PhotoSortingActivity, RecoverySuccessActivity::class.java))
|
putExtra(RecoverySuccessActivity.KEY_SUCCESS_TYPE, type)
|
||||||
|
})
|
||||||
|
if (type == 1) {
|
||||||
|
lifecycleScope.launch {
|
||||||
|
val deferredResults = withContext(Dispatchers.Default) {
|
||||||
|
filterSelectedSetList.let { deletedData ->
|
||||||
|
//删除后,处理当前实际显示的数据
|
||||||
|
val newSizeList = currentSizeList?.let {
|
||||||
|
Common.removeSelectedFromSizeList(
|
||||||
|
it,
|
||||||
|
deletedData
|
||||||
|
)
|
||||||
|
}
|
||||||
|
val newDateList = currentDateList?.let {
|
||||||
|
Common.removeSelectedFromList(it, deletedData)
|
||||||
|
}
|
||||||
|
|
||||||
|
//后续用于筛选的原始数据更新
|
||||||
|
sortBySizeBigToSmall =
|
||||||
|
Common.removeSelectedFromSizeList(sortBySizeBigToSmall, deletedData)
|
||||||
|
sortBySizeSmallToBig =
|
||||||
|
Common.removeSelectedFromSizeList(sortBySizeSmallToBig, deletedData)
|
||||||
|
sortByDateReverse =
|
||||||
|
Common.removeSelectedFromList(sortByDateReverse, deletedData)
|
||||||
|
sortedByDatePositive =
|
||||||
|
Common.removeSelectedFromList(sortedByDatePositive, deletedData)
|
||||||
|
|
||||||
|
|
||||||
|
// 一次性返回结果
|
||||||
|
mapOf(
|
||||||
|
"sizeList" to newSizeList,
|
||||||
|
"dateList" to newDateList,
|
||||||
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
withContext(Dispatchers.Main) {
|
||||||
|
//选中集合的更新
|
||||||
|
viewModel.afterDeleted()
|
||||||
|
deferredResults["sizeList"]?.let { list ->
|
||||||
|
list as List<ResultPhotosFiles>
|
||||||
|
Common.showLog("---------更新 sizeList = ${list.size}")
|
||||||
|
sizeSortAdapter?.setData(list)
|
||||||
|
resetCurrentSizeList(list)
|
||||||
|
}
|
||||||
|
deferredResults["dateList"]?.let { list ->
|
||||||
|
list as List<Pair<String, List<ResultPhotosFiles>>>
|
||||||
|
Common.showLog("---------更新 dateList = ${list.size}")
|
||||||
|
dateAdapter?.setData(list)
|
||||||
|
resetCurrentDateList(list)
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun setSingleDelete() {
|
||||||
|
RecoverOrDeleteManager.setOnSingleDeleteCompleteListener { deletedData ->
|
||||||
|
lifecycleScope.launch {
|
||||||
|
val deferredResults = withContext(Dispatchers.Default) {
|
||||||
|
//删除后,处理当前实际显示的数据
|
||||||
|
val newSizeList = currentSizeList?.let {
|
||||||
|
it.filterNot { it == deletedData }
|
||||||
|
}
|
||||||
|
val newDateList = currentDateList?.removeItem(deletedData)
|
||||||
|
|
||||||
|
//后续用于筛选的原始数据更新
|
||||||
|
sortBySizeBigToSmall = sortBySizeBigToSmall.filterNot { it == deletedData }
|
||||||
|
sortBySizeSmallToBig = sortBySizeSmallToBig.filterNot { it == deletedData }
|
||||||
|
sortByDateReverse = sortByDateReverse.removeItem(deletedData)
|
||||||
|
sortedByDatePositive = sortedByDatePositive.removeItem(deletedData)
|
||||||
|
|
||||||
|
// 一次性返回结果
|
||||||
|
mapOf(
|
||||||
|
"sizeList" to newSizeList,
|
||||||
|
"dateList" to newDateList,
|
||||||
|
)
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
withContext(Dispatchers.Main) {
|
||||||
|
//选中集合的更新
|
||||||
|
viewModel.afterSingleDeleted(deletedData)
|
||||||
|
deferredResults["sizeList"]?.let { list ->
|
||||||
|
list as List<ResultPhotosFiles>
|
||||||
|
Common.showLog("---------更新 sizeList = ${list.size}")
|
||||||
|
sizeSortAdapter?.setData(list)
|
||||||
|
resetCurrentSizeList(list)
|
||||||
|
}
|
||||||
|
deferredResults["dateList"]?.let { list ->
|
||||||
|
list as List<Pair<String, List<ResultPhotosFiles>>>
|
||||||
|
Common.showLog("---------更新 dateList = ${list.size}")
|
||||||
|
dateAdapter?.setData(list)
|
||||||
|
resetCurrentDateList(list)
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,114 @@
|
|||||||
|
package com.ux.video.file.filerecovery.photo
|
||||||
|
|
||||||
|
import android.app.Activity
|
||||||
|
import androidx.fragment.app.FragmentManager
|
||||||
|
|
||||||
|
import androidx.lifecycle.lifecycleScope
|
||||||
|
import com.ux.video.file.filerecovery.utils.Common
|
||||||
|
import com.ux.video.file.filerecovery.utils.ScanManager
|
||||||
|
import com.ux.video.file.filerecovery.utils.ScanManager.copySelectedFilesAsync
|
||||||
|
import com.ux.video.file.filerecovery.utils.ScanManager.deleteFilesAsync
|
||||||
|
import kotlinx.coroutines.CoroutineScope
|
||||||
|
|
||||||
|
object RecoverOrDeleteManager {
|
||||||
|
|
||||||
|
private var dialogRecovering: RecoveringDialogFragment? = null
|
||||||
|
|
||||||
|
private var dialogDeleting: DeletingDialogFragment? = null
|
||||||
|
private var dialogConfirmDelete: ConfirmDeleteDialogFragment? = null
|
||||||
|
|
||||||
|
//详情页面进行删除操作的监听
|
||||||
|
private var onSingleDeletedCompleteListener: ((ResultPhotosFiles) -> Unit)? = null
|
||||||
|
|
||||||
|
fun setOnSingleDeleteCompleteListener(listener: (ResultPhotosFiles) -> Unit) {
|
||||||
|
onSingleDeletedCompleteListener = listener
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 显示恢复中弹窗
|
||||||
|
*/
|
||||||
|
fun showRecoveringDialog(
|
||||||
|
fragmentManager: FragmentManager,
|
||||||
|
scope: CoroutineScope,
|
||||||
|
selectedSetList: Set<ResultPhotosFiles>,
|
||||||
|
onComplete: (number: Int) -> Unit
|
||||||
|
) {
|
||||||
|
scope.copySelectedFilesAsync(
|
||||||
|
selectedSet = selectedSetList,
|
||||||
|
folder = Common.recoveryPhotoDir,
|
||||||
|
onProgress = { currentCounts: Int, fileName: String, success: Boolean ->
|
||||||
|
ScanManager.showLog("--------恢复图片 ", "----------${currentCounts} ${fileName}")
|
||||||
|
dialogRecovering?.updateProgress(currentCounts)
|
||||||
|
|
||||||
|
}) { counts ->
|
||||||
|
dialogRecovering?.updateProgress(counts)
|
||||||
|
ScanManager.showLog("--------恢复图片 ", "----------恢复完成 ${counts}")
|
||||||
|
|
||||||
|
}
|
||||||
|
dialogRecovering = dialogRecovering ?: RecoveringDialogFragment()
|
||||||
|
dialogRecovering?.run {
|
||||||
|
total = selectedSetList.size
|
||||||
|
completeListener = { number ->
|
||||||
|
onComplete(number)
|
||||||
|
dialogRecovering?.dismiss()
|
||||||
|
}
|
||||||
|
show(fragmentManager, "")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 显示删除中弹窗
|
||||||
|
*/
|
||||||
|
fun showConfirmDeleteDialog(
|
||||||
|
isInfoDelete: Boolean = false,
|
||||||
|
fragmentManager: FragmentManager,
|
||||||
|
scope: CoroutineScope,
|
||||||
|
selectedSetList: Set<ResultPhotosFiles>,
|
||||||
|
onComplete: (number: Int) -> Unit
|
||||||
|
) {
|
||||||
|
dialogConfirmDelete = dialogConfirmDelete ?: ConfirmDeleteDialogFragment()
|
||||||
|
dialogConfirmDelete?.run {
|
||||||
|
onClickDelete = {
|
||||||
|
showDeletingDialog(
|
||||||
|
isInfoDelete,
|
||||||
|
fragmentManager,
|
||||||
|
scope,
|
||||||
|
selectedSetList,
|
||||||
|
onComplete
|
||||||
|
)
|
||||||
|
}
|
||||||
|
show(fragmentManager, "")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun showDeletingDialog(
|
||||||
|
isInfoDelete: Boolean = false,
|
||||||
|
fragmentManager: FragmentManager,
|
||||||
|
scope: CoroutineScope,
|
||||||
|
selectedSetList: Set<ResultPhotosFiles>,
|
||||||
|
onComplete: (number: Int) -> Unit
|
||||||
|
) {
|
||||||
|
scope.deleteFilesAsync(
|
||||||
|
selectedSet = selectedSetList,
|
||||||
|
onProgress = { currentCounts: Int, path: String, success: Boolean ->
|
||||||
|
ScanManager.showLog("--------删除图片 ", "----------${currentCounts} ${path}")
|
||||||
|
dialogDeleting?.updateProgress(currentCounts)
|
||||||
|
}) { counts ->
|
||||||
|
dialogDeleting?.updateProgress(counts)
|
||||||
|
ScanManager.showLog("--------恢复图片 ", "----------恢复完成 ${counts}")
|
||||||
|
}
|
||||||
|
dialogDeleting = dialogDeleting ?: DeletingDialogFragment()
|
||||||
|
dialogDeleting?.run {
|
||||||
|
total = selectedSetList.size
|
||||||
|
completeListener = { number ->
|
||||||
|
dialogDeleting?.dismiss()
|
||||||
|
onComplete(number)
|
||||||
|
if (isInfoDelete && selectedSetList.size == 1) {
|
||||||
|
onSingleDeletedCompleteListener?.invoke(selectedSetList.first())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
show(fragmentManager, "")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -8,7 +8,7 @@ import com.ux.video.file.filerecovery.databinding.DialogRecoveringBinding
|
|||||||
/**
|
/**
|
||||||
* 恢复中弹窗
|
* 恢复中弹窗
|
||||||
*/
|
*/
|
||||||
class RecoveringDialogFragment(total: Int, complete:()-> Unit) : BaseIngDialogFragment(total,complete) {
|
class RecoveringDialogFragment() : BaseIngDialogFragment() {
|
||||||
override fun initUi(binding: DialogRecoveringBinding) {
|
override fun initUi(binding: DialogRecoveringBinding) {
|
||||||
binding.run {
|
binding.run {
|
||||||
relativeLayout.setBackgroundResource(R.drawable.bg_rectangle_0048fd_top_20)
|
relativeLayout.setBackgroundResource(R.drawable.bg_rectangle_0048fd_top_20)
|
||||||
|
|||||||
@ -3,16 +3,19 @@ package com.ux.video.file.filerecovery.success
|
|||||||
import android.content.Intent
|
import android.content.Intent
|
||||||
import android.os.Environment
|
import android.os.Environment
|
||||||
import android.view.LayoutInflater
|
import android.view.LayoutInflater
|
||||||
|
import androidx.core.view.isVisible
|
||||||
import androidx.lifecycle.lifecycleScope
|
import androidx.lifecycle.lifecycleScope
|
||||||
import com.ux.video.file.filerecovery.R
|
import com.ux.video.file.filerecovery.R
|
||||||
import com.ux.video.file.filerecovery.base.BaseActivity
|
import com.ux.video.file.filerecovery.base.BaseActivity
|
||||||
import com.ux.video.file.filerecovery.databinding.ActivityRecoverOrDeletedSuccessBinding
|
import com.ux.video.file.filerecovery.databinding.ActivityRecoverOrDeletedSuccessBinding
|
||||||
import com.ux.video.file.filerecovery.databinding.ActivityScanningBinding
|
import com.ux.video.file.filerecovery.databinding.ActivityScanningBinding
|
||||||
|
import com.ux.video.file.filerecovery.main.MainActivity
|
||||||
import com.ux.video.file.filerecovery.main.ScanSelectTypeActivity.Companion.VALUE_AUDIO
|
import com.ux.video.file.filerecovery.main.ScanSelectTypeActivity.Companion.VALUE_AUDIO
|
||||||
import com.ux.video.file.filerecovery.main.ScanSelectTypeActivity.Companion.VALUE_DOCUMENT
|
import com.ux.video.file.filerecovery.main.ScanSelectTypeActivity.Companion.VALUE_DOCUMENT
|
||||||
import com.ux.video.file.filerecovery.main.ScanSelectTypeActivity.Companion.VALUE_PHOTO
|
import com.ux.video.file.filerecovery.main.ScanSelectTypeActivity.Companion.VALUE_PHOTO
|
||||||
import com.ux.video.file.filerecovery.main.ScanSelectTypeActivity.Companion.VALUE_VIDEO
|
import com.ux.video.file.filerecovery.main.ScanSelectTypeActivity.Companion.VALUE_VIDEO
|
||||||
import com.ux.video.file.filerecovery.result.ScanResultDisplayActivity
|
import com.ux.video.file.filerecovery.result.ScanResultDisplayActivity
|
||||||
|
import com.ux.video.file.filerecovery.utils.Common
|
||||||
import com.ux.video.file.filerecovery.utils.Common.KEY_SCAN_TYPE
|
import com.ux.video.file.filerecovery.utils.Common.KEY_SCAN_TYPE
|
||||||
import com.ux.video.file.filerecovery.utils.Common.VALUE_SCAN_TYPE_audio
|
import com.ux.video.file.filerecovery.utils.Common.VALUE_SCAN_TYPE_audio
|
||||||
import com.ux.video.file.filerecovery.utils.Common.VALUE_SCAN_TYPE_deleted_audio
|
import com.ux.video.file.filerecovery.utils.Common.VALUE_SCAN_TYPE_deleted_audio
|
||||||
@ -32,17 +35,87 @@ import kotlinx.coroutines.launch
|
|||||||
class RecoverySuccessActivity : BaseActivity<ActivityRecoverOrDeletedSuccessBinding>() {
|
class RecoverySuccessActivity : BaseActivity<ActivityRecoverOrDeletedSuccessBinding>() {
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
// val KEY_SCAN_TYPE = "scan_type"
|
val KEY_SUCCESS_TYPE = "success_type"
|
||||||
|
val KEY_SUCCESS_COUNT = "success_count"
|
||||||
}
|
}
|
||||||
|
|
||||||
private var scanType: Int = VALUE_SCAN_TYPE_photo
|
private var scanType: Int = VALUE_SCAN_TYPE_photo
|
||||||
|
|
||||||
|
//0 恢复成功 1 删除成功
|
||||||
|
private var successType = 0
|
||||||
override fun inflateBinding(inflater: LayoutInflater): ActivityRecoverOrDeletedSuccessBinding =
|
override fun inflateBinding(inflater: LayoutInflater): ActivityRecoverOrDeletedSuccessBinding =
|
||||||
ActivityRecoverOrDeletedSuccessBinding.inflate(inflater)
|
ActivityRecoverOrDeletedSuccessBinding.inflate(inflater)
|
||||||
|
|
||||||
override fun initData() {
|
override fun initData() {
|
||||||
super.initData()
|
super.initData()
|
||||||
scanType = intent.getIntExtra(KEY_SCAN_TYPE, VALUE_SCAN_TYPE_photo)
|
scanType = intent.getIntExtra(KEY_SCAN_TYPE, VALUE_SCAN_TYPE_photo)
|
||||||
binding.imageViewBack.setOnClickListener { finish() }
|
successType = intent.getIntExtra(KEY_SUCCESS_TYPE, 0)
|
||||||
|
val counts = intent.getIntExtra(KEY_SUCCESS_COUNT, 0)
|
||||||
|
|
||||||
|
binding.run {
|
||||||
|
tvNumber.text = counts.toString()
|
||||||
|
bottomBtnRecoverLayout.run {
|
||||||
|
tvLeft.text = resources.getString(R.string.text_continue)
|
||||||
|
tvRight.text = resources.getString(R.string.view)
|
||||||
|
}
|
||||||
|
when (scanType) {
|
||||||
|
VALUE_SCAN_TYPE_photo, VALUE_SCAN_TYPE_deleted_photo -> tvFileType.text =
|
||||||
|
resources.getString(R.string.describe_photos)
|
||||||
|
|
||||||
|
VALUE_SCAN_TYPE_video, VALUE_SCAN_TYPE_deleted_video -> tvFileType.text =
|
||||||
|
resources.getString(R.string.describe_videos)
|
||||||
|
|
||||||
|
VALUE_SCAN_TYPE_audio, VALUE_SCAN_TYPE_deleted_audio -> tvFileType.text =
|
||||||
|
resources.getString(R.string.describe_audios)
|
||||||
|
|
||||||
|
VALUE_SCAN_TYPE_documents, VALUE_SCAN_TYPE_deleted_documents -> tvFileType.text =
|
||||||
|
resources.getString(R.string.describe_documents)
|
||||||
|
}
|
||||||
|
when (successType) {
|
||||||
|
0 -> {
|
||||||
|
imageCenter.setImageResource(R.drawable.image_recover_success)
|
||||||
|
tvNumber.setTextColor(
|
||||||
|
Common.getColorInt(
|
||||||
|
this@RecoverySuccessActivity,
|
||||||
|
R.color.main_text_blue
|
||||||
|
)
|
||||||
|
)
|
||||||
|
bottomBtnRecoverLayout.root.isVisible = true
|
||||||
|
tvContinue.isVisible = false
|
||||||
|
tvDescribe.text = resources.getString(R.string.recovered_success)
|
||||||
|
|
||||||
|
bottomBtnRecoverLayout.tvLeft.setOnClickListener { finish()}
|
||||||
|
bottomBtnRecoverLayout.tvRight.setOnClickListener {
|
||||||
|
//todo 跳转到所有恢复文件页面
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
1 -> {
|
||||||
|
imageCenter.setImageResource(R.drawable.image_deleted_success)
|
||||||
|
tvNumber.setTextColor(
|
||||||
|
Common.getColorInt(
|
||||||
|
this@RecoverySuccessActivity,
|
||||||
|
R.color.dialog_shape_delete
|
||||||
|
)
|
||||||
|
)
|
||||||
|
bottomBtnRecoverLayout.root.isVisible = false
|
||||||
|
tvContinue.isVisible = true
|
||||||
|
tvDescribe.text = resources.getString(R.string.deleted_success)
|
||||||
|
tvContinue.setOnClickListener { finish()}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
imageViewBack.setOnClickListener { finish() }
|
||||||
|
imageBackHome.setOnClickListener {
|
||||||
|
val intent = Intent(this@RecoverySuccessActivity, MainActivity::class.java)
|
||||||
|
intent.flags = Intent.FLAG_ACTIVITY_CLEAR_TOP or Intent.FLAG_ACTIVITY_SINGLE_TOP
|
||||||
|
startActivity(intent)
|
||||||
|
finish()
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -8,6 +8,7 @@ import android.util.Log
|
|||||||
import android.view.View
|
import android.view.View
|
||||||
import android.view.ViewGroup
|
import android.view.ViewGroup
|
||||||
import androidx.core.content.ContextCompat
|
import androidx.core.content.ContextCompat
|
||||||
|
import androidx.lifecycle.MutableLiveData
|
||||||
import com.ux.video.file.filerecovery.App
|
import com.ux.video.file.filerecovery.App
|
||||||
import com.ux.video.file.filerecovery.R
|
import com.ux.video.file.filerecovery.R
|
||||||
import com.ux.video.file.filerecovery.photo.ResultPhotosFiles
|
import com.ux.video.file.filerecovery.photo.ResultPhotosFiles
|
||||||
@ -61,7 +62,6 @@ object Common {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 按照日期排序, 时间最早的排前面 升序
|
* 按照日期排序, 时间最早的排前面 升序
|
||||||
*
|
*
|
||||||
@ -247,6 +247,24 @@ object Common {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
fun removeSelectedFromList(
|
||||||
|
list: List<Pair<String, List<ResultPhotosFiles>>>,
|
||||||
|
selectedLiveData: Set<ResultPhotosFiles>
|
||||||
|
): List<Pair<String, List<ResultPhotosFiles>>> {
|
||||||
|
return list.mapNotNull { (key, files) ->
|
||||||
|
val filtered = files.filterNot { it in selectedLiveData }
|
||||||
|
if (filtered.isNotEmpty()) key to filtered else null
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fun removeSelectedFromSizeList(
|
||||||
|
list: List<ResultPhotosFiles>,
|
||||||
|
selectedLiveData: Set<ResultPhotosFiles>
|
||||||
|
): List<ResultPhotosFiles> {
|
||||||
|
return list.filterNot { it in selectedLiveData }
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
fun getFormatDate(time: Long): String {
|
fun getFormatDate(time: Long): String {
|
||||||
return dateFormat.format(Date(time))
|
return dateFormat.format(Date(time))
|
||||||
}
|
}
|
||||||
|
|||||||
@ -206,4 +206,14 @@ object ExtendFunctions {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
fun List<Pair<String, List<ResultPhotosFiles>>>.removeItem(
|
||||||
|
target: ResultPhotosFiles
|
||||||
|
): List<Pair<String, List<ResultPhotosFiles>>> {
|
||||||
|
return this.mapNotNull { (key, files) ->
|
||||||
|
val updatedFiles = files.filterNot { it == target }
|
||||||
|
if (updatedFiles.isNotEmpty()) key to updatedFiles else null
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -31,7 +31,6 @@ class ScanRepository : ViewModel() {
|
|||||||
val current = _selectedLiveData.value?.toMutableSet() ?: mutableSetOf()
|
val current = _selectedLiveData.value?.toMutableSet() ?: mutableSetOf()
|
||||||
val currentDisplay = _selectedDisplayLiveData.value?.toMutableSet() ?: mutableSetOf()
|
val currentDisplay = _selectedDisplayLiveData.value?.toMutableSet() ?: mutableSetOf()
|
||||||
resultPhotosFiles.let {
|
resultPhotosFiles.let {
|
||||||
|
|
||||||
if (isAdd) {
|
if (isAdd) {
|
||||||
current.add(it)
|
current.add(it)
|
||||||
currentDisplay.add(it)
|
currentDisplay.add(it)
|
||||||
@ -60,6 +59,34 @@ class ScanRepository : ViewModel() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除操作完成过后,对选中集合进行更新
|
||||||
|
*/
|
||||||
|
fun afterDeleted(){
|
||||||
|
val selected = _selectedLiveData.value.orEmpty().toMutableSet()
|
||||||
|
val display = _selectedDisplayLiveData.value.orEmpty()
|
||||||
|
|
||||||
|
selected.removeAll(display)
|
||||||
|
_selectedLiveData.value = selected
|
||||||
|
_selectedDisplayLiveData.value = emptySet()
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 详情页删除完毕,移除删除掉的数据
|
||||||
|
*/
|
||||||
|
fun afterSingleDeleted(deletedItem:ResultPhotosFiles){
|
||||||
|
val selected = _selectedLiveData.value.orEmpty().toMutableSet()
|
||||||
|
val display = _selectedDisplayLiveData.value.orEmpty().toMutableSet()
|
||||||
|
|
||||||
|
selected.remove(deletedItem)
|
||||||
|
display.remove(deletedItem)
|
||||||
|
_selectedLiveData.value = selected
|
||||||
|
_selectedDisplayLiveData.value = display
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
fun checkIsSelect(resultPhotosFiles: ResultPhotosFiles): Boolean {
|
fun checkIsSelect(resultPhotosFiles: ResultPhotosFiles): Boolean {
|
||||||
val current = _selectedLiveData.value
|
val current = _selectedLiveData.value
|
||||||
|
|||||||
BIN
app/src/main/res/drawable/icon_back_home.png
Normal file
BIN
app/src/main/res/drawable/icon_back_home.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.0 KiB |
@ -157,44 +157,13 @@
|
|||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
|
||||||
|
<include
|
||||||
<include layout="@layout/common_bottom_btn"
|
android:id="@+id/layout_bottom"
|
||||||
|
layout="@layout/common_bottom_btn"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
app:layout_constraintBottom_toBottomOf="parent" />
|
app:layout_constraintBottom_toBottomOf="parent" />
|
||||||
<!-- <com.ux.video.file.filerecovery.utils.CustomTextView-->
|
|
||||||
<!-- android:id="@+id/tv_delete"-->
|
|
||||||
<!-- android:layout_width="0dp"-->
|
|
||||||
<!-- android:layout_height="50dp"-->
|
|
||||||
<!-- android:layout_marginStart="16dp"-->
|
|
||||||
<!-- android:layout_marginBottom="21dp"-->
|
|
||||||
<!-- android:background="@drawable/bg_rectangle_white_left_8"-->
|
|
||||||
<!-- android:gravity="center"-->
|
|
||||||
<!-- android:text="@string/delete"-->
|
|
||||||
<!-- android:textColor="@color/main_text_blue"-->
|
|
||||||
<!-- android:textSize="16sp"-->
|
|
||||||
<!-- app:fontType="bold"-->
|
|
||||||
<!-- app:layout_constraintBottom_toBottomOf="parent"-->
|
|
||||||
<!-- app:layout_constraintHorizontal_weight="1"-->
|
|
||||||
<!-- app:layout_constraintLeft_toLeftOf="parent"-->
|
|
||||||
<!-- app:layout_constraintRight_toLeftOf="@id/tv_recover" />-->
|
|
||||||
|
|
||||||
<!-- <com.ux.video.file.filerecovery.utils.CustomTextView-->
|
|
||||||
<!-- android:id="@+id/tv_recover"-->
|
|
||||||
<!-- android:layout_width="0dp"-->
|
|
||||||
<!-- android:layout_height="50dp"-->
|
|
||||||
<!-- android:layout_marginEnd="16dp"-->
|
|
||||||
<!-- android:layout_marginBottom="21dp"-->
|
|
||||||
<!-- android:background="@drawable/bg_rectangle_blue_right_8"-->
|
|
||||||
<!-- android:gravity="center"-->
|
|
||||||
<!-- android:text="@string/recover"-->
|
|
||||||
<!-- android:textColor="@color/white"-->
|
|
||||||
<!-- android:textSize="16sp"-->
|
|
||||||
<!-- app:fontType="bold"-->
|
|
||||||
<!-- app:layout_constraintBottom_toBottomOf="parent"-->
|
|
||||||
<!-- app:layout_constraintHorizontal_weight="1"-->
|
|
||||||
<!-- app:layout_constraintLeft_toRightOf="@id/tv_delete"-->
|
|
||||||
<!-- app:layout_constraintRight_toRightOf="parent" />-->
|
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
|
|||||||
@ -32,6 +32,14 @@
|
|||||||
android:textColor="@color/main_title"
|
android:textColor="@color/main_title"
|
||||||
android:textSize="16sp"
|
android:textSize="16sp"
|
||||||
app:fontType="bold" />
|
app:fontType="bold" />
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/image_back_home"
|
||||||
|
android:layout_width="44dp"
|
||||||
|
android:layout_height="44dp"
|
||||||
|
android:layout_marginEnd="10dp"
|
||||||
|
android:layout_alignParentEnd="true"
|
||||||
|
android:src="@drawable/icon_back_home" />
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
@ -43,63 +51,82 @@
|
|||||||
android:layout_marginTop="60dp"
|
android:layout_marginTop="60dp"
|
||||||
android:src="@drawable/image_recover_success" />
|
android:src="@drawable/image_recover_success" />
|
||||||
|
|
||||||
<com.ux.video.file.filerecovery.utils.CustomTextView
|
|
||||||
android:id="@+id/tv_number"
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
|
android:id="@+id/constraint"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_below="@id/image_center"
|
android:layout_below="@id/image_center"
|
||||||
android:layout_centerHorizontal="true"
|
android:layout_centerHorizontal="true"
|
||||||
android:layout_marginTop="46dp"
|
android:layout_marginTop="46dp"
|
||||||
|
android:baselineAligned="true"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<com.ux.video.file.filerecovery.utils.CustomTextView
|
||||||
|
android:id="@+id/tv_number"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
android:textColor="@color/main_text_blue"
|
android:textColor="@color/main_text_blue"
|
||||||
android:textSize="48sp"
|
android:textSize="48sp"
|
||||||
app:fontType="bold" />
|
app:fontType="bold"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
tools:text="1" />
|
||||||
|
|
||||||
<com.ux.video.file.filerecovery.utils.CustomTextView
|
<com.ux.video.file.filerecovery.utils.CustomTextView
|
||||||
android:id="@+id/tv_file_type"
|
android:id="@+id/tv_file_type"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_alignBottom="@id/tv_number"
|
|
||||||
android:layout_marginStart="6dp"
|
android:layout_marginStart="6dp"
|
||||||
android:layout_toEndOf="@id/tv_number"
|
|
||||||
android:textColor="@color/main_sub_title"
|
android:textColor="@color/main_sub_title"
|
||||||
android:textSize="16sp"
|
android:textSize="16sp"
|
||||||
app:fontType="bold" />
|
app:fontType="bold"
|
||||||
|
app:layout_constraintBaseline_toBaselineOf="@id/tv_number"
|
||||||
|
app:layout_constraintStart_toEndOf="@id/tv_number"
|
||||||
|
tools:text="Photo" />
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
|
|
||||||
<com.ux.video.file.filerecovery.utils.CustomTextView
|
<com.ux.video.file.filerecovery.utils.CustomTextView
|
||||||
android:id="@+id/tv_describe"
|
android:id="@+id/tv_describe"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_below="@id/tv_number"
|
android:layout_below="@id/constraint"
|
||||||
android:layout_centerHorizontal="true"
|
android:layout_centerHorizontal="true"
|
||||||
android:layout_marginTop="10dp"
|
android:layout_marginTop="10dp"
|
||||||
|
android:text="@string/recovered_success"
|
||||||
android:textColor="@color/main_sub_title"
|
android:textColor="@color/main_sub_title"
|
||||||
android:textSize="20sp"
|
android:textSize="20sp"
|
||||||
app:fontType="bold" />
|
app:fontType="bold"
|
||||||
|
tools:text="Photo" />
|
||||||
|
|
||||||
|
|
||||||
<include
|
<include
|
||||||
layout="@layout/common_bottom_btn"
|
layout="@layout/common_bottom_btn"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:visibility="gone"
|
||||||
|
android:id="@+id/bottom_btn_recover_layout"
|
||||||
android:layout_alignParentBottom="true" />
|
android:layout_alignParentBottom="true" />
|
||||||
|
|
||||||
<com.ux.video.file.filerecovery.utils.CustomTextView
|
<com.ux.video.file.filerecovery.utils.CustomTextView
|
||||||
android:id="@+id/tv_continue"
|
android:id="@+id/tv_continue"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="50dp"
|
android:layout_height="50dp"
|
||||||
android:layout_marginBottom="21dp"
|
|
||||||
android:layout_marginHorizontal="16dp"
|
|
||||||
android:layout_alignParentBottom="true"
|
android:layout_alignParentBottom="true"
|
||||||
android:visibility="gone"
|
android:layout_marginHorizontal="16dp"
|
||||||
|
android:layout_marginBottom="21dp"
|
||||||
android:background="@drawable/bg_rectangle_fdad00_8"
|
android:background="@drawable/bg_rectangle_fdad00_8"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:text="@string/text_continue"
|
android:text="@string/text_continue"
|
||||||
android:textColor="@color/white"
|
android:textColor="@color/white"
|
||||||
android:textSize="16sp"
|
android:textSize="16sp"
|
||||||
|
android:visibility="visible"
|
||||||
app:fontType="bold"
|
app:fontType="bold"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintHorizontal_weight="1"
|
app:layout_constraintHorizontal_weight="1"
|
||||||
app:layout_constraintLeft_toLeftOf="parent"
|
app:layout_constraintLeft_toLeftOf="parent"
|
||||||
app:layout_constraintRight_toLeftOf="@id/tv_recover" />
|
app:layout_constraintRight_toLeftOf="@id/bottom_btn_recover_layout" />
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
@ -5,7 +5,7 @@
|
|||||||
android:layout_height="wrap_content">
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
<com.ux.video.file.filerecovery.utils.CustomTextView
|
<com.ux.video.file.filerecovery.utils.CustomTextView
|
||||||
android:id="@+id/tv_delete"
|
android:id="@+id/tv_left"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="50dp"
|
android:layout_height="50dp"
|
||||||
android:layout_marginStart="16dp"
|
android:layout_marginStart="16dp"
|
||||||
@ -19,10 +19,10 @@
|
|||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintHorizontal_weight="1"
|
app:layout_constraintHorizontal_weight="1"
|
||||||
app:layout_constraintLeft_toLeftOf="parent"
|
app:layout_constraintLeft_toLeftOf="parent"
|
||||||
app:layout_constraintRight_toLeftOf="@id/tv_recover" />
|
app:layout_constraintRight_toLeftOf="@id/tv_right" />
|
||||||
|
|
||||||
<com.ux.video.file.filerecovery.utils.CustomTextView
|
<com.ux.video.file.filerecovery.utils.CustomTextView
|
||||||
android:id="@+id/tv_recover"
|
android:id="@+id/tv_right"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="50dp"
|
android:layout_height="50dp"
|
||||||
android:layout_marginEnd="16dp"
|
android:layout_marginEnd="16dp"
|
||||||
@ -35,6 +35,6 @@
|
|||||||
app:fontType="bold"
|
app:fontType="bold"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintHorizontal_weight="1"
|
app:layout_constraintHorizontal_weight="1"
|
||||||
app:layout_constraintLeft_toRightOf="@id/tv_delete"
|
app:layout_constraintLeft_toRightOf="@id/tv_left"
|
||||||
app:layout_constraintRight_toRightOf="parent" />
|
app:layout_constraintRight_toRightOf="parent" />
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
74
app/src/main/res/layout/dialog_delete.xml
Normal file
74
app/src/main/res/layout/dialog_delete.xml
Normal file
@ -0,0 +1,74 @@
|
|||||||
|
<?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"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="20dp"
|
||||||
|
android:layout_marginEnd="20dp"
|
||||||
|
android:background="@drawable/bg_rectangle_white_20"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:paddingHorizontal="20dp"
|
||||||
|
android:paddingVertical="30dp">
|
||||||
|
|
||||||
|
|
||||||
|
<com.ux.video.file.filerecovery.utils.CustomTextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/confirm_delete"
|
||||||
|
android:textSize="20sp"
|
||||||
|
app:fontType="bold" />
|
||||||
|
|
||||||
|
<com.ux.video.file.filerecovery.utils.CustomTextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="10dp"
|
||||||
|
android:lineSpacingExtra="2dp"
|
||||||
|
android:text="@string/confirm_delete_content"
|
||||||
|
android:textColor="@color/dialog_permission_content"
|
||||||
|
android:textSize="14sp" />
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="36dp"
|
||||||
|
android:layout_marginTop="26dp"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<com.ux.video.file.filerecovery.utils.CustomTextView
|
||||||
|
android:id="@+id/tv_cancel"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="36dp"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:background="@drawable/bg_dialog_btn_cancel_stoke_8"
|
||||||
|
android:gravity="center"
|
||||||
|
android:text="@string/cancel"
|
||||||
|
android:textColor="@color/main_text_blue"
|
||||||
|
android:textSize="14sp"
|
||||||
|
app:fontType="bold" />
|
||||||
|
|
||||||
|
<com.ux.video.file.filerecovery.utils.CustomTextView
|
||||||
|
android:id="@+id/tv_delete"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="36dp"
|
||||||
|
android:layout_marginStart="20dp"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:background="@drawable/bg_dialog_btn_allow_solid_8"
|
||||||
|
android:gravity="center"
|
||||||
|
android:text="@string/delete"
|
||||||
|
android:textColor="@color/white"
|
||||||
|
android:textSize="14sp"
|
||||||
|
app:fontType="bold" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</FrameLayout>
|
||||||
@ -75,6 +75,9 @@ wait..</string>
|
|||||||
<string name="text_continue">Continue</string>
|
<string name="text_continue">Continue</string>
|
||||||
<string name="start_date">Start date</string>
|
<string name="start_date">Start date</string>
|
||||||
<string name="end_date">End date</string>
|
<string name="end_date">End date</string>
|
||||||
|
<string name="confirm_delete_content">The file(s) will be completely deleted and cannot be recovered.</string>
|
||||||
|
<string name="confirm_delete">Confirm delete?</string>
|
||||||
|
<string name="view">View</string>
|
||||||
|
|
||||||
<string-array name="filter_date">
|
<string-array name="filter_date">
|
||||||
<item>All</item>
|
<item>All</item>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user