Commit 3d1596c7 authored by wanglei's avatar wanglei

...

parent c30c7593
......@@ -45,21 +45,24 @@
android:launchMode="singleTop"
android:screenOrientation="portrait"
tools:ignore="DiscouragedApi,LockedOrientationActivity" />
<!-- <activity -->
<!-- android:name="com.artifex.mupdf.viewer.PdfTestActivity" -->
<!-- android:exported="false" -->
<!-- android:launchMode="singleTop" -->
<!-- android:screenOrientation="portrait" -->
<!-- tools:ignore="DiscouragedApi,LockedOrientationActivity" /> -->
<activity
android:name=".ui.document.pdf.PdfMergeActivity"
android:exported="false"
android:launchMode="singleTop"
android:screenOrientation="portrait"
tools:ignore="DiscouragedApi,LockedOrientationActivity" />
<activity
android:name=".ui.document.pdf.PdfSelectActivity"
android:exported="false"
android:launchMode="singleTop"
android:screenOrientation="portrait"
tools:ignore="DiscouragedApi,LockedOrientationActivity" />
<activity
android:name=".ui.document.pdf.PdfActivity"
android:exported="false"
android:screenOrientation="portrait"
android:theme="@style/Theme.PDFViewerScannerWhite"
tools:ignore="DiscouragedApi,LockedOrientationActivity" />
<activity
android:name=".ui.document.pdf.PdfLoadingActivity"
android:exported="false"
......
......@@ -4,12 +4,14 @@ import android.net.Uri
data class DocumentBean(
val path: String = "",
var uri:Uri=Uri.EMPTY,
var uri: Uri = Uri.EMPTY,
val type: String = "",
var isBookmarked: Boolean = false
) {
companion object {
var showSelect: Boolean = false
var isSelect: Boolean = false
companion object {
const val TYPE_PDF = "type_pdf"
}
}
......@@ -22,6 +22,7 @@ class DocumentAdapter : BaseQuickAdapter<DocumentBean, DocumentAdapter.DocumentV
var itemClick: ((item: DocumentBean) -> Unit)? = null
var bookmarkAction: ((addRemove: Boolean, path: String) -> Unit)? = null
var moreAction: ((item: DocumentBean) -> Unit)? = null
var selectAction: ((size: Int) -> Unit)? = null
@SuppressLint("SetTextI18n")
override fun onBindViewHolder(holder: DocumentViewHolder, position: Int, item: DocumentBean?) {
......@@ -33,24 +34,43 @@ class DocumentAdapter : BaseQuickAdapter<DocumentBean, DocumentAdapter.DocumentV
val file = File(item.path)
binding.tvName.text = file.name
binding.tvInfo.text = file.lastModified().toFormatTime() + " " + file.length().toFormatSize()
if (item.isBookmarked) {
binding.ivBookmark.setImageResource(R.mipmap.h_soucang_s)
} else {
binding.ivBookmark.setImageResource(R.mipmap.h_soucang_n)
}
binding.flBookmark.setOnClickListener {
if (item.showSelect) {
binding.flMore.visibility = View.INVISIBLE
binding.flBookmark.visibility = View.INVISIBLE
binding.flSelect.visibility = View.VISIBLE
binding.ivSelector.isSelected = item.isSelect
binding.flSelect.setOnClickListener {
item.isSelect = !item.isSelect
notifyItemChanged(position, "aaa")
selectAction?.invoke(items.filter { it.isSelect }.size)
}
} else {
binding.flSelect.visibility = View.GONE
binding.flMore.visibility = View.VISIBLE
binding.flBookmark.visibility = View.VISIBLE
if (item.isBookmarked) {
bookmarkAction?.invoke(false, item.path)
binding.ivBookmark.setImageResource(R.mipmap.h_soucang_s)
} else {
bookmarkAction?.invoke(true, item.path)
binding.ivBookmark.setImageResource(R.mipmap.h_soucang_n)
}
binding.flBookmark.setOnClickListener {
if (item.isBookmarked) {
bookmarkAction?.invoke(false, item.path)
} else {
bookmarkAction?.invoke(true, item.path)
}
item.isBookmarked = !item.isBookmarked
notifyItemChanged(position, "aaaa")
}
binding.flMore.setOnClickListener {
moreAction?.invoke(item)
}
item.isBookmarked = !item.isBookmarked
notifyItemChanged(position, "aaaa")
}
binding.flMore.setOnClickListener {
moreAction?.invoke(item)
}
binding.root.setOnClickListener {
itemClick?.invoke(item)
}
......
......@@ -11,7 +11,6 @@ import android.view.View
import android.view.animation.Animation
import android.view.animation.TranslateAnimation
import android.view.inputmethod.EditorInfo
import android.view.inputmethod.InputMethodManager
import androidx.activity.addCallback
import androidx.core.widget.addTextChangedListener
import com.artifex.mupdfdemo.Annotation
......@@ -27,6 +26,8 @@ import com.base.pdfviewerscannerwhite.bean.PdfPageBean
import com.base.pdfviewerscannerwhite.databinding.ActivityPdfBinding
import com.base.pdfviewerscannerwhite.helper.BaseActivity
import com.base.pdfviewerscannerwhite.ui.document.pdf.PdfLoadingActivity.Companion.DO_SAVE_PDF
import com.base.pdfviewerscannerwhite.utils.KeyBoardUtils.hideKeyboard
import com.base.pdfviewerscannerwhite.utils.KeyBoardUtils.showKeyBoard
import com.base.pdfviewerscannerwhite.utils.ToastUtils.toast
import java.io.File
......@@ -71,20 +72,34 @@ class PdfActivity : BaseActivity<ActivityPdfBinding>(), PdfView {
if (muPDFCore == null) {
toast("can't open pdf")
} else {
pdfPresenter.iniPdfPage(path)
createPdfUI()
binding.root.postDelayed({
pdfPresenter.iniPdfPage(path)
}, 500)
}
}
override fun initListener() {
onBackPressedDispatcher.addCallback {
hideKeyboard(binding.editSearch)
if (uiMode == UI_MODE_SEARCH) {
changeNormalUI()
cancelSearch()
return@addCallback
}
if (uiMode == UI_MODE_EDITE_SELECT) {
changeNormalUI()
cancelOperation()
return@addCallback
}
if (uiMode == UI_MODE_EDITE_SAVE) {
changeNormalUI()
resetPdfView()
return@addCallback
}
finishToMain()
}
binding.flFanhui.setOnClickListener {
onBackPressedDispatcher.onBackPressed()
......@@ -145,7 +160,7 @@ class PdfActivity : BaseActivity<ActivityPdfBinding>(), PdfView {
binding.ivSearch.setOnClickListener {
bianJiScaleXiao {
changeSearchUI()
binding.editSearch.requestFocus()
showKeyBoard(binding.editSearch)
}
}
binding.editSearch.addTextChangedListener {
......@@ -172,11 +187,31 @@ class PdfActivity : BaseActivity<ActivityPdfBinding>(), PdfView {
}
}
private fun resetPdfView() {
val pageView = binding.mupdfReaderView.displayedView as MuPDFView?
binding.mupdfReaderView.refresh(true)
}
private fun cancelOperation() {
val pageView = binding.mupdfReaderView.displayedView as MuPDFView?
if (pageView != null) {
pageView.deselectAnnotation()
pageView.deleteSelectedAnnotation()
pageView.deselectText()
pageView.cancelDraw()
}
}
private fun cancelSearch() {
SearchTaskResult.set(null)
binding.mupdfReaderView.resetupChildren()
}
/**
* 有个问题,一旦pdf某页编辑后加个蒙层,搜索功能就是失效了
*/
private fun search(direction: Int) {
this.hideKeyboard()
this.hideKeyboard(binding.editSearch)
val displayPage: Int = binding.mupdfReaderView.displayedViewIndex
val r = SearchTaskResult.get()
val searchPage = r?.pageNumber ?: -1
......@@ -192,18 +227,12 @@ class PdfActivity : BaseActivity<ActivityPdfBinding>(), PdfView {
}
@SuppressLint("ServiceCast")
private fun hideKeyboard() {
val imm = this.getSystemService(INPUT_METHOD_SERVICE) as InputMethodManager
imm.hideSoftInputFromWindow(binding.editSearch.windowToken, 0)
}
private var isShowTopBottomLayout = true
private fun hideTopBottomLayout() {
if (isShowTopBottomLayout) {
isShowTopBottomLayout = false
hideKeyboard()
hideKeyboard(binding.editSearch)
val topAnim: Animation = TranslateAnimation(0f, 0f, 0f, -binding.vAnimatorTop.height.toFloat())
topAnim.setDuration(200)
topAnim.setAnimationListener(object : Animation.AnimationListener {
......@@ -267,34 +296,39 @@ class PdfActivity : BaseActivity<ActivityPdfBinding>(), PdfView {
}
private fun bianJiScaleDa() {
val scaleXAnimator = ObjectAnimator.ofFloat(binding.ivBianji, "scaleX", 0f, 1.0f)
scaleXAnimator.duration = 200
val scaleYAnimator = ObjectAnimator.ofFloat(binding.ivBianji, "scaleY", 0f, 1.0f)
scaleYAnimator.duration = 200
val animatorSet = AnimatorSet()
animatorSet.playTogether(scaleXAnimator, scaleYAnimator)
animatorSet.start()
if (binding.ivBianji.scaleX == 0f) {
val scaleXAnimator = ObjectAnimator.ofFloat(binding.ivBianji, "scaleX", 0f, 1.0f)
scaleXAnimator.duration = 200
val scaleYAnimator = ObjectAnimator.ofFloat(binding.ivBianji, "scaleY", 0f, 1.0f)
scaleYAnimator.duration = 200
val animatorSet = AnimatorSet()
animatorSet.playTogether(scaleXAnimator, scaleYAnimator)
animatorSet.start()
}
}
private fun bianJiScaleXiao(endAction: (() -> Unit)? = null) {
val scaleXAnimator = ObjectAnimator.ofFloat(binding.ivBianji, "scaleX", 1.0f, 0f)
scaleXAnimator.duration = 200
val scaleYAnimator = ObjectAnimator.ofFloat(binding.ivBianji, "scaleY", 1.0f, 0f)
scaleYAnimator.duration = 200
val animatorSet = AnimatorSet()
animatorSet.addListener(object : Animator.AnimatorListener {
override fun onAnimationStart(animation: Animator) = Unit
override fun onAnimationEnd(animation: Animator) {
endAction?.invoke()
}
if (binding.ivBianji.scaleX == 1f) {
val scaleXAnimator = ObjectAnimator.ofFloat(binding.ivBianji, "scaleX", 1.0f, 0f)
scaleXAnimator.duration = 200
val scaleYAnimator = ObjectAnimator.ofFloat(binding.ivBianji, "scaleY", 1.0f, 0f)
scaleYAnimator.duration = 200
val animatorSet = AnimatorSet()
animatorSet.addListener(object : Animator.AnimatorListener {
override fun onAnimationStart(animation: Animator) = Unit
override fun onAnimationEnd(animation: Animator) {
endAction?.invoke()
}
override fun onAnimationCancel(animation: Animator) = Unit
override fun onAnimationRepeat(animation: Animator) = Unit
})
animatorSet.playTogether(scaleXAnimator, scaleYAnimator)
animatorSet.start()
override fun onAnimationCancel(animation: Animator) = Unit
override fun onAnimationRepeat(animation: Animator) = Unit
})
animatorSet.playTogether(scaleXAnimator, scaleYAnimator)
animatorSet.start()
}
}
/**
......@@ -347,13 +381,18 @@ class PdfActivity : BaseActivity<ActivityPdfBinding>(), PdfView {
*/
private fun changeNormalUI() {
uiMode = UI_MODE_NORMAL
binding.ivWancheng.visibility = View.GONE
binding.clOperation.visibility = View.GONE
binding.tvBtnSave.visibility = View.GONE
binding.editSearch.visibility = View.INVISIBLE
binding.ivXuanzhuan.visibility = View.VISIBLE
binding.ivSearch.visibility = View.VISIBLE
binding.ivMore.visibility = View.VISIBLE
binding.rvPager.visibility = View.VISIBLE
binding.tvPdfName.visibility = View.VISIBLE
bianJiScaleDa()
}
/**
......@@ -386,6 +425,8 @@ class PdfActivity : BaseActivity<ActivityPdfBinding>(), PdfView {
binding.ivWancheng.visibility = View.VISIBLE
if (binding.llHighlight == view) {
binding.llHighlight.setBackgroundColor(Color.parseColor("#F5F5F5"))
} else {
......@@ -413,6 +454,7 @@ class PdfActivity : BaseActivity<ActivityPdfBinding>(), PdfView {
* 编辑报错UI模式
*/
private fun changeEditSaveUI() {
uiMode = UI_MODE_EDITE_SAVE
binding.ivWancheng.visibility = View.INVISIBLE
binding.ivMore.visibility = View.INVISIBLE
binding.ivXuanzhuan.visibility = View.INVISIBLE
......@@ -437,8 +479,8 @@ class PdfActivity : BaseActivity<ActivityPdfBinding>(), PdfView {
const val UI_MODE_NORMAL = 0
const val UI_MODE_SEARCH = 1
const val UI_MODE_EDITE_SAVE = 2
const val UI_MODE_EDITE_SELECT = 3
const val UI_MODE_EDITE_SELECT = 2
const val UI_MODE_EDITE_SAVE = 3
const val SAVE_MODE_HIGHLIGHT = "Highlight"
const val SAVE_MODE_GLIDE_LINE = "Glide Line"
......
package com.base.pdfviewerscannerwhite.ui.document.pdf
import com.base.pdfviewerscannerwhite.databinding.ActivityPdfMergeBinding
import com.base.pdfviewerscannerwhite.helper.BaseActivity
class PdfMergeActivity : BaseActivity<ActivityPdfMergeBinding>() {
override val binding: ActivityPdfMergeBinding by lazy {
ActivityPdfMergeBinding.inflate(layoutInflater)
}
override fun initView() {
}
}
\ No newline at end of file
package com.base.pdfviewerscannerwhite.ui.document.pdf
import android.annotation.SuppressLint
import android.view.View
import androidx.lifecycle.lifecycleScope
import com.base.pdfviewerscannerwhite.bean.DocumentBean
import com.base.pdfviewerscannerwhite.databinding.ActivityPdfSelectBinding
import com.base.pdfviewerscannerwhite.helper.BaseActivity
import com.base.pdfviewerscannerwhite.ui.adapter.DocumentAdapter
import com.base.pdfviewerscannerwhite.ui.main.DocumentPresenter
import com.base.pdfviewerscannerwhite.ui.main.DocumentView
class PdfSelectActivity : BaseActivity<ActivityPdfSelectBinding>(), DocumentView {
private lateinit var documentPresenter: DocumentPresenter
private lateinit var adapter: DocumentAdapter
override val binding: ActivityPdfSelectBinding by lazy {
ActivityPdfSelectBinding.inflate(layoutInflater)
}
override fun initView() {
documentPresenter = DocumentPresenter(this, this, DocumentBean.TYPE_PDF, lifecycleScope)
initAdapter()
documentPresenter.initData()
}
@SuppressLint("SetTextI18n")
private fun initAdapter() {
adapter = DocumentAdapter()
adapter.selectAction = {
if (it == 0) {
binding.tvSelectTip.visibility = View.INVISIBLE
binding.tvBtnNext.isEnabled = false
} else {
binding.tvBtnNext.isEnabled = true
binding.tvSelectTip.visibility = View.VISIBLE
binding.tvSelectTip.text = "$it items has been selected"
}
}
binding.rv.adapter = adapter
}
override fun refreshDocumentRv(documentList: List<DocumentBean>) {
super.refreshDocumentRv(documentList)
documentList.map { it.showSelect = true }
adapter.submitList(documentList)
}
}
\ No newline at end of file
......@@ -32,14 +32,14 @@ class DocumentFragment() : BaseFragment<FragmentDocumentBinding>(), DocumentView
}
override fun setView() {
documentPresenter = DocumentPresenter(this, type, lifecycleScope)
documentPresenter = DocumentPresenter(requireContext(), this, type, lifecycleScope)
initAdapter()
if (documentList != null) {
adapter.submitList(documentList)
} else {
if (requireContext().checkStorePermission()) {
documentPresenter.initData(requireContext())
documentPresenter.initData()
}
}
}
......@@ -99,7 +99,7 @@ class DocumentFragment() : BaseFragment<FragmentDocumentBinding>(), DocumentView
override fun dialogRename(item: DocumentBean) {
val file = File(item.path)
requireContext().showDocumentRenameDialog(file.name, firstDialog) { newName ->
documentPresenter.renameDocumentBean(requireContext(), file, newName)
documentPresenter.renameDocumentBean(file, newName)
}
}
......
......@@ -11,12 +11,13 @@ import kotlinx.coroutines.launch
import java.io.File
class DocumentPresenter(
val context: Context,
val documentView: DocumentView,
val type: String,
val lifecycleScope: LifecycleCoroutineScope
) {
fun getDocumentBeanList(context: Context): List<DocumentBean> {
private fun getDocumentBeanList(): List<DocumentBean> {
var selectionArgs = arrayOf(ConstObject.MIME_TYPE_PDF)
if (type == DocumentBean.TYPE_PDF) {
selectionArgs = arrayOf(ConstObject.MIME_TYPE_PDF)
......@@ -30,8 +31,8 @@ class DocumentPresenter(
return documentList
}
fun initData(context: Context) = lifecycleScope.launch(Dispatchers.IO) {
val documentList = getDocumentBeanList(context)
fun initData() = lifecycleScope.launch(Dispatchers.IO) {
val documentList = getDocumentBeanList()
launch(Dispatchers.Main) {
documentView.refreshDocumentRv(documentList)
}
......@@ -45,13 +46,13 @@ class DocumentPresenter(
}
}
fun renameDocumentBean(context: Context, file: File, newName: String) = lifecycleScope.launch(Dispatchers.IO) {
fun renameDocumentBean(file: File, newName: String) = lifecycleScope.launch(Dispatchers.IO) {
runCatching {
val nameFile = File(file.parentFile, newName)
file.renameTo(nameFile)
}
val documentList = getDocumentBeanList(context)
val documentList = getDocumentBeanList()
launch(Dispatchers.Main) {
documentView.refreshDocumentRv(documentList)
}
......
......@@ -4,9 +4,9 @@ import com.base.pdfviewerscannerwhite.bean.DocumentBean
interface DocumentView {
fun dialogRename(item: DocumentBean)
fun refreshDocumentRv(documentList: List<DocumentBean>)
fun splitPdf(path: String)
fun dialogRename(item: DocumentBean) = Unit
fun refreshDocumentRv(documentList: List<DocumentBean>) = Unit
fun splitPdf(path: String) = Unit
fun deleteDocument(item: DocumentBean)
fun deleteDocument(item: DocumentBean) = Unit
}
\ No newline at end of file
package com.base.pdfviewerscannerwhite.ui.main
import androidx.recyclerview.widget.RecyclerView
import android.content.Intent
import com.base.pdfviewerscannerwhite.databinding.FragmentToolBinding
import com.base.pdfviewerscannerwhite.helper.BaseFragment
import com.base.pdfviewerscannerwhite.ui.document.pdf.PdfSelectActivity
class ToolFragment : BaseFragment<FragmentToolBinding>() {
......@@ -14,4 +15,11 @@ class ToolFragment : BaseFragment<FragmentToolBinding>() {
override fun setView() {
}
override fun setListener() {
super.setListener()
binding.llMerge.setOnClickListener {
startActivity(Intent(requireContext(), PdfSelectActivity::class.java))
}
}
}
\ No newline at end of file
package com.base.pdfviewerscannerwhite.utils
import android.annotation.SuppressLint
import android.content.Context
import android.content.Context.INPUT_METHOD_SERVICE
import android.view.inputmethod.InputMethodManager
import android.widget.EditText
object KeyBoardUtils {
@SuppressLint("ServiceCast")
fun Context.hideKeyboard(editText: EditText) {
editText.clearFocus()
val imm = this.getSystemService(INPUT_METHOD_SERVICE) as InputMethodManager
imm.hideSoftInputFromWindow(editText.windowToken, 0)
}
@SuppressLint("ServiceCast")
fun Context.showKeyBoard(editText: EditText) {
editText.requestFocus()
val imm = this.getSystemService(INPUT_METHOD_SERVICE) as InputMethodManager?
imm?.showSoftInput(editText, InputMethodManager.SHOW_IMPLICIT)
}
}
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="#00B8DE"/>
<solid android:color="#7FDCEE"/>
<corners android:radius="10dp"/>
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/bg_00b8de_10" android:state_enabled="false" />
<item android:drawable="@drawable/bg_7fdcee_10" android:state_enabled="true" />
<item android:drawable="@drawable/bg_00b8de_10" android:state_enabled="true" />
<item android:drawable="@drawable/bg_7fdcee_10" android:state_enabled="false" />
</selector>
\ No newline at end of file
......@@ -90,7 +90,7 @@
android:src="@mipmap/wancheng"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@id/iv_more"
app:layout_constraintStart_toStartOf="@id/iv_more"
app:layout_constraintTop_toTopOf="parent"
tools:ignore="ContentDescription" />
......@@ -159,6 +159,17 @@
app:layout_constraintTop_toBottomOf="@id/v_animator_top"
tools:text="1/3" />
<ImageView
android:id="@+id/iv_bianji"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="15dp"
android:layout_marginBottom="108dp"
android:src="@mipmap/bianji"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
tools:ignore="ContentDescription" />
<ViewAnimator
android:id="@+id/v_animator_bottom"
android:layout_width="match_parent"
......@@ -182,7 +193,6 @@
android:visibility="gone"
app:layout_constraintBottom_toTopOf="@id/v_animator_bottom">
<LinearLayout
android:id="@+id/ll_highlight"
......@@ -245,7 +255,6 @@
<LinearLayout
android:id="@+id/ll_strikethrough"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:background="?android:attr/selectableItemBackground"
......@@ -288,7 +297,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:src="@mipmap/strike"
android:src="@mipmap/painting"
tools:ignore="ContentDescription" />
<TextView
......@@ -296,7 +305,7 @@
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="6dp"
android:text="Strikethrough"
android:text="Painting Brush"
android:textColor="#232323"
android:textSize="12sp"
tools:ignore="HardcodedText" />
......@@ -320,16 +329,5 @@
</ViewAnimator>
<ImageView
android:id="@+id/iv_bianji"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="15dp"
android:layout_marginBottom="108dp"
android:src="@mipmap/bianji"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
tools:ignore="ContentDescription" />
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout 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:id="@+id/main"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".ui.document.pdf.PdfMergeActivity">
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout 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:id="@+id/main"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".ui.document.pdf.PdfSelectActivity">
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/cl_top"
android:layout_width="match_parent"
android:layout_height="60dp"
app:layout_constraintTop_toTopOf="parent">
<FrameLayout
android:id="@+id/fl_fanhui"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@id/tv_select_tip"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:padding="15dp"
android:src="@mipmap/fanhui_b"
tools:ignore="ContentDescription" />
</FrameLayout>
<TextView
android:id="@+id/tv_select_tip"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:ellipsize="end"
android:singleLine="true"
android:textColor="@color/black"
android:textSize="19sp"
android:textStyle="bold"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/fl_fanhui"
app:layout_constraintTop_toTopOf="parent"
tools:ignore="HardcodedText"
tools:text="1 item has been selected" />
</androidx.constraintlayout.widget.ConstraintLayout>
<FrameLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_marginBottom="8dp"
app:layout_constraintBottom_toTopOf="@id/tv_btn_next"
app:layout_constraintTop_toBottomOf="@id/cl_top">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
tools:listitem="@layout/item_docment" />
</FrameLayout>
<TextView
android:id="@+id/tv_btn_next"
android:layout_width="338dp"
android:layout_height="48dp"
android:layout_marginBottom="24dp"
android:background="@drawable/bg_selector_btn"
android:enabled="false"
android:gravity="center"
android:text="Next"
android:textColor="@color/white"
android:textSize="18sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
tools:ignore="HardcodedText" />
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
......@@ -17,8 +17,8 @@
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:src="@mipmap/h_pdfiocn"
tools:ignore="ContentDescription" />
tools:ignore="ContentDescription"
tools:src="@mipmap/h_pdfiocn" />
<FrameLayout
......@@ -42,6 +42,29 @@
tools:ignore="ContentDescription" />
</FrameLayout>
<FrameLayout
android:id="@+id/fl_select"
android:layout_width="45dp"
android:layout_height="45dp"
android:layout_marginEnd="5dp"
android:background="?android:attr/selectableItemBackground"
android:clickable="true"
android:focusable="true"
android:padding="15dp"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent">
<ImageView
android:id="@+id/iv_selector"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:src="@drawable/bg_selector_select"
tools:ignore="ContentDescription" />
</FrameLayout>
<FrameLayout
android:id="@+id/fl_bookmark"
android:layout_width="45dp"
......
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