Commit 679de6ea authored by wanglei's avatar wanglei

...

parent 605794cb
......@@ -8,8 +8,13 @@ import androidx.recyclerview.widget.RecyclerView
import androidx.recyclerview.widget.RecyclerView.ViewHolder
import com.base.datarecovery.R
import com.base.datarecovery.bean.ConstObject.JUNK_CLEANER
import com.base.datarecovery.bean.ConstObject.PRIVACY_SPACE
import com.base.datarecovery.bean.ConstObject.RECOVERY_DOCUMENTS
import com.base.datarecovery.bean.ConstObject.RECOVERY_PHOTOS
import com.base.datarecovery.bean.ConstObject.RECOVERY_VIDEOS
import com.base.datarecovery.bean.ConstObject.REPEAT_PHOTOS
import com.base.datarecovery.bean.ConstObject.SCREENSHOT_CLEANER
import com.base.datarecovery.databinding.ItemResultFun2Binding
import com.base.datarecovery.databinding.ItemResultFunBinding
import com.base.datarecovery.utils.AppPreferences
import com.base.datarecovery.view.XmlEx.inflate
......@@ -19,16 +24,20 @@ class AppFunctionAdapter(val click: (name: String) -> Unit) :
RecyclerView.Adapter<AppFunctionAdapter.JJJ>() {
val list = arrayListOf(
Fun(JUNK_CLEANER, R.mipmap.clean, "Clean junk regularly to free up space", "Clean Up"),
Fun(REPEAT_PHOTOS, R.mipmap.repeatedphotos, "Check similar photos to release more space", "Clean Up"),
Fun(SCREENSHOT_CLEANER, R.mipmap.screenshots, "Too many screenshots? Free up your phone storage!", "Clean Up"),
Fun(JUNK_CLEANER, R.mipmap.clean),
Fun(RECOVERY_PHOTOS, R.mipmap.photos_ss),
Fun(RECOVERY_VIDEOS, R.mipmap.videos_ss),
Fun(RECOVERY_DOCUMENTS, R.mipmap.documents_ss),
Fun(PRIVACY_SPACE, R.mipmap.space),
Fun(REPEAT_PHOTOS, R.mipmap.repeatedphotos),
Fun(SCREENSHOT_CLEANER, R.mipmap.screenshots),
)
class JJJ(view: View) : ViewHolder(view)
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): JJJ {
return JJJ(R.layout.item_result_fun.inflate(parent))
return JJJ(R.layout.item_result_fun_2.inflate(parent))
}
override fun getItemCount(): Int {
......@@ -38,12 +47,12 @@ class AppFunctionAdapter(val click: (name: String) -> Unit) :
override fun onBindViewHolder(holder: JJJ, position: Int) {
val data = list[position]
val context = holder.itemView.context
val binding = ItemResultFunBinding.bind(holder.itemView)
val binding = ItemResultFun2Binding.bind(holder.itemView)
binding.ivIcon.setImageDrawable(ContextCompat.getDrawable(context, data.icon))
binding.tvTittle.text = data.name
binding.tvDes.text = data.des
binding.tvButton.text = data.button
binding.tvButton.setOnClickListener {
// binding.tvDes.text = data.des
// binding.tvButton.text = data.button
binding.root.setOnClickListener {
click.invoke(data.name)
}
}
......
......@@ -12,10 +12,14 @@ object ConstObject {
const val ID_RECOVERY_DOCUMENTS = 0
const val ID_PRIVACY_SPACE = 0
const val RECOVERY_PHOTOS = "Recovery Photos"
const val RECOVERY_VIDEOS = "Recovery Videos"
const val RECOVERY_DOCUMENTS = "Recovery Documents"
const val JUNK_CLEANER = "Junk Cleaner"
const val REPEAT_PHOTOS = "Repeat Photos"
const val PHOTO_COMPRESS = "Photo Compress"
const val SCREENSHOT_CLEANER = "Screenshot Cleaner"
const val PRIVACY_SPACE = "Privacy Space"
const val SCAN_PHOTOS = 1
const val SCAN_DOCUMENTS = 2
......
......@@ -9,7 +9,7 @@
android:id="@+id/cl_top"
android:layout_width="match_parent"
android:layout_height="200dp"
android:background="#0164C8"
android:background="@mipmap/bg_result"
app:layout_constraintTop_toTopOf="parent">
<androidx.appcompat.widget.AppCompatImageView
......@@ -67,25 +67,26 @@
</androidx.constraintlayout.widget.ConstraintLayout>
<FrameLayout
android:id="@+id/fl_ad"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintBottom_toTopOf="@id/rv_fun"
app:layout_constraintTop_toBottomOf="@id/cl_top" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv_fun"
android:layout_width="match_parent"
android:layout_width="wrap_content"
android:layout_height="0dp"
android:paddingTop="20dp"
android:paddingBottom="15dp"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
app:layout_constraintBottom_toTopOf="@id/fl_ad"
app:layoutManager="androidx.recyclerview.widget.GridLayoutManager"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/cl_top"
app:layout_constraintVertical_bias="0.0" />
app:spanCount="2"
tools:listitem="@layout/item_result_fun_2" />
<FrameLayout
android:id="@+id/fl_ad"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintBottom_toBottomOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
\ 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="166dp"
android:layout_height="100dp"
android:layout_margin="10dp">
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:orientation="vertical">
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/iv_icon"
android:layout_width="45dp"
android:layout_height="45dp"
android:layout_gravity="center_horizontal"
android:layout_marginStart="12dp"
android:layout_marginEnd="9dp"
android:src="@mipmap/h_cleanjunk" />
<TextView
android:id="@+id/tv_tittle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="13dp"
android:includeFontPadding="false"
android:text="Battery information"
android:textColor="#ff000000"
android:textSize="15sp"
android:textStyle="bold"
tools:ignore="HardcodedText" />
</androidx.appcompat.widget.LinearLayoutCompat>
</androidx.cardview.widget.CardView>
\ 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