Commit 6c2db82a authored by wanglei's avatar wanglei

Initial commit

parent 1dab7ad6
{
"project_info": {
"project_number": "993178188325",
"project_id": "testcleanmaster",
"storage_bucket": "testcleanmaster.appspot.com"
},
"client": [
{
"client_info": {
"mobilesdk_app_id": "1:993178188325:android:a7986c2607f23024825dcc",
"android_client_info": {
"package_name": "com.base.easyfilemanager"
}
},
"oauth_client": [],
"api_key": [
{
"current_key": "AIzaSyCY5uqNx8qS5ZPvSIknbh2nH2v5vjzCmPI"
}
],
"services": {
"appinvite_service": {
"other_platform_oauth_client": []
}
}
}
],
"configuration_version": "1"
}
\ No newline at end of file
This diff is collapsed.
......@@ -46,10 +46,12 @@ class FileCategoryActivity : BaseActivity<ActivityFileCategoryBinding>() {
initStatusBar()
type = intent.extras?.getString("type") ?: ""
binding.tvTittle.text = type
adapter = FileBrowseAdapter { size ->
adapter = FileBrowseAdapter(select = { size ->
binding.tvDelete.isSelected = size > 0
binding.tvDelete.isEnabled = size > 0
}
}, empty = {
binding.ivEmpty.isVisible = adapter.isEmpty()
})
binding.rv.adapter = adapter
binding.rv.addItemDecoration(DividerItemDecoration(this, LinearLayout.VERTICAL))
......@@ -100,6 +102,7 @@ class FileCategoryActivity : BaseActivity<ActivityFileCategoryBinding>() {
}.await()
adapter.removeData(deleteList)
binding.progressbar.visibility = View.GONE
}
}
......
......@@ -5,6 +5,7 @@ import android.content.Context
import android.view.View
import android.view.ViewGroup
import android.widget.ImageView
import androidx.datastore.preferences.protobuf.Empty
import androidx.recyclerview.widget.RecyclerView
import androidx.recyclerview.widget.RecyclerView.ViewHolder
import com.base.easyfilemanager.R
......@@ -13,7 +14,10 @@ import com.base.easyfilemanager.databinding.ItemFileListBinding
import com.base.easyfilemanager.helps.XmlEx.inflate
import com.bumptech.glide.Glide
class FileBrowseAdapter(private val select: (size: Int) -> Unit) : RecyclerView.Adapter<FileBrowseAdapter.FB>() {
class FileBrowseAdapter(
private val select: (size: Int) -> Unit,
private val empty: () -> Unit
) : RecyclerView.Adapter<FileBrowseAdapter.FB>() {
private val fileList = arrayListOf<FileBean>()
......@@ -61,6 +65,7 @@ class FileBrowseAdapter(private val select: (size: Int) -> Unit) : RecyclerView.
}
fileList.addAll(data)
notifyDataSetChanged()
empty.invoke()
}
......@@ -83,6 +88,11 @@ class FileBrowseAdapter(private val select: (size: Int) -> Unit) : RecyclerView.
fun removeData(deleteList: List<FileBean>) {
fileList.removeAll(deleteList.toSet())
notifyDataSetChanged()
empty.invoke()
}
fun isEmpty(): Boolean {
return fileList.isEmpty()
}
}
......
{
"project_info": {
"project_number": "875966296285",
"project_id": "easy-file-manager-168b1",
"storage_bucket": "easy-file-manager-168b1.appspot.com"
},
"client": [
{
"client_info": {
"mobilesdk_app_id": "1:875966296285:android:828968be5529c6a380eb34",
"android_client_info": {
"package_name": "com.sp.easyfilemanager.king.androidkol"
}
},
"oauth_client": [],
"api_key": [
{
"current_key": "AIzaSyDqFrADqSBP0ctl66KnN3kPIlCSTWinJfI"
}
],
"services": {
"appinvite_service": {
"other_platform_oauth_client": []
}
}
}
],
"configuration_version": "1"
}
\ 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