Commit bb98a0e7 authored by wanglei's avatar wanglei

...

parent 8bbe0494
...@@ -35,9 +35,9 @@ android { ...@@ -35,9 +35,9 @@ android {
isMinifyEnabled = false isMinifyEnabled = false
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro") proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")
// 设置是否要自动上传 // 设置是否要自动上传
// firebaseCrashlytics { firebaseCrashlytics {
// mappingFileUploadEnabled = true mappingFileUploadEnabled = true
// } }
signingConfig = signingConfigs.getByName("release") signingConfig = signingConfigs.getByName("release")
} }
} }
...@@ -92,7 +92,7 @@ dependencies { ...@@ -92,7 +92,7 @@ dependencies {
//Pdf库 //Pdf库
implementation("com.tom-roush:pdfbox-android:2.0.27.0") implementation("com.tom-roush:pdfbox-android:2.0.27.0")
// api(project(":pdflibrary")) api(project(":pdflibrary"))
// //
//Word库 //Word库
......
package com.base.pdfreaderallpdfreader.bean
import android.graphics.drawable.Drawable
data class PdfPageBean(
val pageIndex: Int = 0,
var pageDrawable: Drawable? = null
) {
var isSelect: Boolean = false
}
\ No newline at end of file
...@@ -20,6 +20,7 @@ import com.base.pdfreaderallpdfreader.ui.main.getPptDocument ...@@ -20,6 +20,7 @@ import com.base.pdfreaderallpdfreader.ui.main.getPptDocument
import com.base.pdfreaderallpdfreader.ui.main.getWordDocument import com.base.pdfreaderallpdfreader.ui.main.getWordDocument
import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.launch import kotlinx.coroutines.launch
import java.io.File
class DocumentFragment() : Fragment() { class DocumentFragment() : Fragment() {
...@@ -98,6 +99,13 @@ class DocumentFragment() : Fragment() { ...@@ -98,6 +99,13 @@ class DocumentFragment() : Fragment() {
} }
} }
fun deleteDocument(item: DocumentBean) {
val flag = File(item.path).delete()
if (flag) {
adapter?.remove(item)
}
}
companion object { companion object {
var pdfNeedRefresh: Boolean = true var pdfNeedRefresh: Boolean = true
} }
......
package com.base.pdfreaderallpdfreader.ui.pdf
import android.annotation.SuppressLint
import android.content.Context
import android.view.View
import android.view.ViewGroup
import androidx.recyclerview.widget.RecyclerView.ViewHolder
import com.base.pdfreaderallpdfreader.R
import com.base.pdfreaderallpdfreader.bean.DocumentBean
import com.base.pdfreaderallpdfreader.bean.DocumentBean.Companion.TYPE_EXCEL
import com.base.pdfreaderallpdfreader.bean.DocumentBean.Companion.TYPE_PDF
import com.base.pdfreaderallpdfreader.bean.DocumentBean.Companion.TYPE_PPT
import com.base.pdfreaderallpdfreader.bean.DocumentBean.Companion.TYPE_WORD
import com.base.pdfreaderallpdfreader.databinding.ItemDocumentPdfBinding
import com.base.pdfreaderallpdfreader.utils.KotlinExt.toFormatSize
import com.base.pdfreaderallpdfreader.utils.KotlinExt.toFormatTime
import com.base.pdfreaderallpdfreader.utils.XmlEx.inflate
import com.chad.library.adapter4.BaseQuickAdapter
import java.io.File
class DocumentPdfAdapter() : BaseQuickAdapter<DocumentBean, DocumentPdfAdapter.DocumentPdfViewHolder>() {
private val TAG = "DocumentAdapter"
inner class DocumentPdfViewHolder(view: View) : ViewHolder(view)
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: DocumentPdfViewHolder, position: Int, item: DocumentBean?) {
if (item == null) return
if (item.isAd) {
//todo
// val binding = ItemAdBinding.bind(holder.itemView)
// AdmobNativeUtils.showNativeAd(null, binding.flAd, R.layout.layout_admob_document)
} else {
val binding = ItemDocumentPdfBinding.bind(holder.itemView)
changeIcon(item, binding)
val file = File(item.path)
runCatching {
binding.tvName.text = file.name
binding.tvTime.text = file.lastModified().toFormatTime()
binding.tvSize.text = file.length().toFormatSize()
}
// LogEx.logDebug(TAG, "uiType=${item.uiType}")
when (item.uiType) {
0 -> {//首页
binding.flSelect.visibility = View.GONE
binding.flMore.visibility = View.VISIBLE
binding.flBookmark.visibility = View.VISIBLE
if (item.isBookmarked) {
binding.ivBookmark.setImageResource(R.mipmap.pdf_bookmark_s)
} else {
binding.ivBookmark.setImageResource(R.mipmap.pdf_bookmark_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)
}
binding.root.setOnClickListener {
itemClick?.invoke(item)
}
}
1 -> {//合并选择
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)
}
binding.root.setOnClickListener {
item.isSelect = !item.isSelect
notifyItemChanged(position, "aaa")
selectAction?.invoke(items.filter { it.isSelect }.size)
}
}
2 -> {//拆分选择
binding.flBookmark.visibility = View.GONE
binding.flMore.visibility = View.INVISIBLE
binding.root.setOnClickListener {
itemClick?.invoke(item)
}
}
3 -> {//解锁模式选择
binding.flBookmark.visibility = View.GONE
binding.flMore.visibility = View.INVISIBLE
binding.root.setOnClickListener {
itemClick?.invoke(item)
}
}
4 -> {//搜索选择
binding.flBookmark.visibility = View.GONE
binding.flMore.setOnClickListener {
moreAction?.invoke(item)
}
binding.root.setOnClickListener {
itemClick?.invoke(item)
}
}
}
}
}
fun changeIcon(item: DocumentBean, binding: ItemDocumentPdfBinding) {
if (item.type == TYPE_PDF) {
if (item.state == 0) {
binding.iv.setImageResource(R.mipmap.r_pdf)
}
if (item.state == 1) {
binding.iv.setImageResource(R.mipmap.rv_pdf_lock)
}
}
if (item.type == TYPE_WORD) {
binding.iv.setImageResource(R.mipmap.rv_word)
}
if (item.type == TYPE_EXCEL) {
binding.iv.setImageResource(R.mipmap.rv_excel)
}
if (item.type == TYPE_PPT) {
binding.iv.setImageResource(R.mipmap.r_ppt)
}
}
override fun getItemViewType(position: Int, list: List<DocumentBean>): Int {
val item = list[position]
return if (item.isAd) 1 else 0
}
override fun onCreateViewHolder(context: Context, parent: ViewGroup, viewType: Int): DocumentPdfViewHolder {
return if (viewType == 0) {
DocumentPdfViewHolder(R.layout.item_document.inflate(parent))
} else {
DocumentPdfViewHolder(R.layout.item_ad.inflate(parent))
}
}
}
\ No newline at end of file
package com.base.pdfreaderallpdfreader.ui.pdf
import android.animation.Animator
import android.animation.AnimatorSet
import android.animation.ObjectAnimator
import android.annotation.SuppressLint
import android.app.Activity
import android.content.Intent
import android.content.pm.ActivityInfo
import android.graphics.Color
import android.util.DisplayMetrics
import android.view.View
import android.view.animation.Animation
import android.view.animation.TranslateAnimation
import android.view.inputmethod.EditorInfo
import androidx.activity.addCallback
import androidx.core.content.ContextCompat
import androidx.core.widget.addTextChangedListener
import androidx.lifecycle.ViewModelProvider
import androidx.lifecycle.lifecycleScope
import com.artifex.mupdfdemo.Annotation
import com.artifex.mupdfdemo.Hit
import com.artifex.mupdfdemo.MuPDFCore
import com.artifex.mupdfdemo.MuPDFPageAdapter
import com.artifex.mupdfdemo.MuPDFReaderView
import com.artifex.mupdfdemo.MuPDFReaderViewListener
import com.artifex.mupdfdemo.MuPDFView
import com.artifex.mupdfdemo.SearchTask
import com.artifex.mupdfdemo.SearchTaskResult
import com.base.pdfreaderallpdfreader.R
import com.base.pdfreaderallpdfreader.base.BaseActivity
import com.base.pdfreaderallpdfreader.bean.ConstObject
import com.base.pdfreaderallpdfreader.bean.ConstObject.haveGuideGesture
import com.base.pdfreaderallpdfreader.databinding.ActivityPdfBinding
import com.base.pdfreaderallpdfreader.ui.view.PdfDialog.showPdfMoreDialog
import com.base.pdfreaderallpdfreader.utils.KeyBoardUtils.hideKeyboard
import com.base.pdfreaderallpdfreader.utils.KeyBoardUtils.showKeyBoard
import com.base.pdfreaderallpdfreader.utils.LogEx
import com.base.pdfreaderallpdfreader.utils.SpStringUtils
import com.base.pdfreaderallpdfreader.utils.SpStringUtils.LAST_VIEW_KEY
import com.base.pdfreaderallpdfreader.utils.ToastUtils.toast
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.delay
import kotlinx.coroutines.launch
import java.io.File
class PdfActivity : BaseActivity<ActivityPdfBinding>() {
private val TAG = "PdfActivity"
private lateinit var pdfPageAdapter: PdfPagerAdapter
private lateinit var pdfViewModel: PdfViewModel
private var muPDFCore: MuPDFCore? = null // 加载mupdf.so文件
private var searchTask: SearchTask? = null
private var uiMode = UI_MODE_NORMAL
private var saveMode = ""
private var path: String = ""
private var uri: String? = null
private var assets: String? = null
private var density = 0f
private var pwd: String = ""
override val binding: ActivityPdfBinding by lazy {
ActivityPdfBinding.inflate(layoutInflater)
}
override fun onResume() {
super.onResume()
// updateAppLanguage(MyApplication.pdfLanguage, TAG) {
// MyApplication.pdfLanguage = it
// }
}
override fun onPause() {
super.onPause()
searchTask?.stop()
}
override fun onDestroy() {
super.onDestroy()
muPDFCore?.onDestroy()
// AdmobNativeUtils.onDestroy()
}
override fun initView() {
pdfViewModel = ViewModelProvider(this)[PdfViewModel::class.java]
pdfViewModel.initPdfPageRv = { items ->
pdfPageAdapter.submitList(items)
pdfPageAdapter.changeSelectPager(0)
iniSetVerticalSeekbar(items.size)
}
// val needRecreate = checkNeedRecreate(MyApplication.pdfLanguage)
// if (needRecreate) return
val metrics = DisplayMetrics()
windowManager.defaultDisplay.getMetrics(metrics)
density = metrics.density
path = intent.extras?.getString("path") ?: ""
uri = intent.extras?.getString("uri")
assets = intent.extras?.getString("assets") ?: ""
pwd = intent.extras?.getString("pwd") ?: ""
LogEx.logDebug(TAG, "path=$path")
LogEx.logDebug(TAG, "uri=$uri")
LogEx.logDebug(TAG, "pwd=$pwd")
val file = File(path)
binding.tvPdfName.text = file.name
initAdapter()
changeNormalUI()
runCatching {
muPDFCore = pdfViewModel.openFile(this, path, uri)
}
// 搜索设为空
SearchTaskResult.set(null)
if (muPDFCore?.needsPassword() == true) {
val pwd = intent.extras?.getString("pwd") ?: ""
val flag = muPDFCore?.authenticatePassword(pwd) ?: false
if (flag) {
pdfViewModel.password = pwd
pdfPageAdapter.setPassword(pwd)
createPdfUI()
muPDFCore?.countPages()?.let { pdfViewModel.iniPdfPage(it) }
SpStringUtils.addSpString(LAST_VIEW_KEY, "${path}_/_${System.currentTimeMillis()}")
} else {
toast("unknown error")
finish()
}
} else {
createPdfUI()
muPDFCore?.countPages()?.let { pdfViewModel.iniPdfPage(it) }
SpStringUtils.addSpString(LAST_VIEW_KEY, "${path}_/_${System.currentTimeMillis()}")
}
if (!haveGuideGesture) {
binding.flGuideGesture.visibility = View.VISIBLE
lifecycleScope.launch(Dispatchers.Main) {
delay(2000)
binding.flGuideGesture.visibility = View.GONE
}
}
// AdmobNativeUtils.showNativeAd(this, binding.flAd, R.layout.layout_admob_document_in)
}
fun jumpPage(pageIndex: Int) {
binding.mupdfReaderView.displayedViewIndex = pageIndex
}
private fun iniSetVerticalSeekbar(max: Int) {
binding.verticalSeekbar.visibility = View.VISIBLE
binding.verticalSeekbar.showThumb = true
binding.verticalSeekbar.barBackgroundStartColor = Color.TRANSPARENT
binding.verticalSeekbar.thumbContainerColor = Color.TRANSPARENT
binding.verticalSeekbar.thumbPlaceholderDrawable =
ContextCompat.getDrawable(this, R.mipmap.fanye)
if (binding.verticalSeekbar.maxValue != max - 1) {
binding.verticalSeekbar.maxValue = max - 1
}
}
private fun setVerticalSeekbar(current: Int, max: Int) {
val process = max - current
LogEx.logDebug(TAG, "process=$process $current $max")
binding.verticalSeekbar.progress = process
}
override fun initListener() {
// val needRecreate = checkNeedRecreate(MyApplication.pdfLanguage)
// if (needRecreate) return
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()
cancelOperation()
return@addCallback
}
// if (AdmobHelper.isShowCloseDocumentInter() && isShowCloseDocument()) {
// AdmobInterstitialUtils.showInterstitialAd(this@PdfActivity) {
// if (it) {
// AdmobHelper.lastCloseDocumentShowAd = System.currentTimeMillis()
// }
// binding.root.postDelayed({ finishToMain() }, 500)
// }
// } else {
// binding.root.postDelayed({ finishToMain() }, 500)
// }
}
binding.flFanhui.setOnClickListener {
onBackPressedDispatcher.onBackPressed()
}
binding.llHighlight.setOnClickListener {
saveMode = SAVE_MODE_HIGHLIGHT
changeEditSelectUI(it)
binding.mupdfReaderView.setMode(MuPDFReaderView.Mode.Selecting)
}
binding.llGlideLine.setOnClickListener {
saveMode = SAVE_MODE_GLIDE_LINE
changeEditSelectUI(it)
binding.mupdfReaderView.setMode(MuPDFReaderView.Mode.Selecting)
}
binding.llStrikethrough.setOnClickListener {
saveMode = SAVE_MODE_STRIKETHROUGH
changeEditSelectUI(it)
binding.mupdfReaderView.setMode(MuPDFReaderView.Mode.Selecting)
}
binding.llPaintingBrush.setOnClickListener {
saveMode = SAVE_MODE_PAINTING_BRUSH
changeEditSelectUI(it)
binding.mupdfReaderView.setMode(MuPDFReaderView.Mode.Drawing)
}
binding.ivWancheng.setOnClickListener {
changeEditSaveUI()
binding.mupdfReaderView.setMode(MuPDFReaderView.Mode.Viewing)
}
binding.ivBianji.setOnClickListener {
bianJiScaleXiao {
changeEditSaveUI()
}
}
binding.ivSearch.setOnClickListener {
bianJiScaleXiao {
changeSearchUI()
this.showKeyBoard(binding.editSearch)
}
}
binding.editSearch.addTextChangedListener {
if (SearchTaskResult.get() != null && it.toString() != SearchTaskResult.get().txt) {
SearchTaskResult.set(null as SearchTaskResult?)
binding.mupdfReaderView.resetupChildren()
}
}
binding.editSearch.setOnEditorActionListener { v, actionId, event ->
if (actionId == EditorInfo.IME_ACTION_DONE) {
search(1)
}
false
}
binding.tvBtnSave.setOnClickListener {
//todo
// PdfLoadingActivity.muPDFCore = muPDFCore
// reallySave()
// startActivity(Intent(this, PdfLoadingActivity::class.java).apply {
// putExtra("doWhat", DO_SAVE_PDF)
// putExtra("srcPath", path)
// })
// finish()
}
binding.ivXuanzhuan.setOnClickListener {
switchOrientation()
}
binding.verticalSeekbar.setOnReleaseListener { progress ->
LogEx.logDebug(TAG, "progress=$progress")
val total = muPDFCore?.countPages() ?: 0
val pageIndex = total - 1 - progress
binding.mupdfReaderView.displayedViewIndex = pageIndex
}
binding.flGuideGesture.setOnClickListener {
haveGuideGesture = true
binding.flGuideGesture.visibility = View.GONE
}
binding.ivMore.setOnClickListener {
val count = muPDFCore?.countPages() ?: 0
showPdfMoreDialog(this, count - 1, path)
}
}
/**
*
*/
private fun reallySave() {
var success: Boolean = false
val pageView = binding.mupdfReaderView.displayedView as MuPDFView
when (saveMode) {
SAVE_MODE_HIGHLIGHT -> {
success = pageView.markupSelection(Annotation.Type.HIGHLIGHT)
}
SAVE_MODE_GLIDE_LINE -> {
success = pageView.markupSelection(Annotation.Type.UNDERLINE)
}
SAVE_MODE_STRIKETHROUGH -> {
success = pageView.markupSelection(Annotation.Type.STRIKEOUT)
}
SAVE_MODE_PAINTING_BRUSH -> {
success = pageView.saveDraw()
}
}
if (!success) {
toast("nothing to save")
return
}
}
private fun cancelOperation() {
val pageView = binding.mupdfReaderView.displayedView as MuPDFView?
if (pageView != null) {
pageView.deselectAnnotation()
pageView.deleteSelectedAnnotation()
pageView.deselectText()
pageView.cancelDraw()
}
binding.mupdfReaderView.setMode(MuPDFReaderView.Mode.Viewing)
}
private fun cancelSearch() {
SearchTaskResult.set(null)
binding.mupdfReaderView.resetupChildren()
}
/**
* 有个问题,一旦pdf某页编辑后加个蒙层,搜索功能就是失效了
*/
private fun search(direction: Int) {
this.hideKeyboard(binding.editSearch)
val displayPage: Int = binding.mupdfReaderView.displayedViewIndex
val r = SearchTaskResult.get()
val searchPage = r?.pageNumber ?: -1
searchTask?.go(binding.editSearch.text.toString(), direction, displayPage, searchPage)
}
private fun initAdapter() {
pdfPageAdapter = PdfPagerAdapter(path, uri)
pdfPageAdapter.clickAction = { pageIndex ->
binding.mupdfReaderView.displayedViewIndex = pageIndex
}
binding.rvPager.adapter = pdfPageAdapter
}
private var isShowTopBottomLayout = true
private fun hideTopBottomLayout() {
if (isShowTopBottomLayout) {
isShowTopBottomLayout = false
hideKeyboard(binding.editSearch)
val topAnim: Animation = TranslateAnimation(0f, 0f, 0f, -binding.vAnimatorTop.height.toFloat())
topAnim.setDuration(200)
topAnim.setAnimationListener(object : Animation.AnimationListener {
override fun onAnimationStart(animation: Animation) {}
override fun onAnimationRepeat(animation: Animation) {}
override fun onAnimationEnd(animation: Animation) {
binding.vAnimatorTop.visibility = View.GONE
}
})
binding.vAnimatorTop.startAnimation(topAnim)
val bottomAnim: Animation = TranslateAnimation(0f, 0f, 0f, binding.vAnimatorBottom.height.toFloat())
bottomAnim.duration = 200
bottomAnim.setAnimationListener(object : Animation.AnimationListener {
override fun onAnimationStart(animation: Animation) {}
override fun onAnimationRepeat(animation: Animation) {}
override fun onAnimationEnd(animation: Animation) {
binding.vAnimatorBottom.visibility = View.GONE
}
})
binding.vAnimatorBottom.startAnimation(bottomAnim)
bianJiScaleXiao()
}
}
private fun showTopBottomLayout() {
if (!isShowTopBottomLayout) {
isShowTopBottomLayout = true
val topAnim: Animation = TranslateAnimation(0f, 0f, -binding.vAnimatorTop.height.toFloat(), 0f)
topAnim.setDuration(200)
topAnim.setAnimationListener(object : Animation.AnimationListener {
override fun onAnimationStart(animation: Animation) {
binding.vAnimatorTop.visibility = View.VISIBLE
}
override fun onAnimationRepeat(animation: Animation) {}
override fun onAnimationEnd(animation: Animation) {
}
})
binding.vAnimatorTop.startAnimation(topAnim)
val bottomAnim: Animation = TranslateAnimation(0f, 0f, binding.vAnimatorBottom.height.toFloat(), 0f)
bottomAnim.duration = 200
bottomAnim.setAnimationListener(object : Animation.AnimationListener {
override fun onAnimationStart(animation: Animation) {
binding.vAnimatorBottom.visibility = View.VISIBLE
}
override fun onAnimationRepeat(animation: Animation) {}
override fun onAnimationEnd(animation: Animation) {
}
})
binding.vAnimatorBottom.startAnimation(bottomAnim)
bianJiScaleDa()
}
}
private fun bianJiScaleDa() {
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) {
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()
}
}
/**
* 构建pdf的ui
*/
@SuppressLint("SetTextI18n")
private fun createPdfUI() {
if (muPDFCore == null) return
binding.tvPageCount.text = "1/${muPDFCore?.countPages()}"
binding.mupdfReaderView.setListener(object : MuPDFReaderViewListener {
@SuppressLint("SetTextI18n")
override fun onMoveToChild(i: Int) {
binding.tvPageCount.text = "${i + 1}/${muPDFCore?.countPages()}"
pdfPageAdapter.changeSelectPager(i)
binding.rvPager.scrollToPosition(i)
setVerticalSeekbar(i + 1, muPDFCore?.countPages() ?: 0)
}
override fun onTapMainDocArea() {
if (isShowTopBottomLayout) {
hideTopBottomLayout()
} else {
showTopBottomLayout()
}
}
override fun onDocMotion() {
}
override fun onHit(item: Hit?) {
}
})
binding.mupdfReaderView.adapter = MuPDFPageAdapter(this, {}, muPDFCore)
binding.mupdfReaderView.setBackgroundColor(Color.parseColor("#E0D5FA"))
binding.mupdfReaderView.setHorizontalScrolling(false)
searchTask = object : SearchTask(this, muPDFCore) {
override fun onTextFound(result: SearchTaskResult?) {
SearchTaskResult.set(result)
binding.mupdfReaderView.displayedViewIndex = result?.pageNumber ?: 0
binding.mupdfReaderView.resetupChildren()
}
}
}
/**
* 普通模式
*/
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()
}
/**
* 搜索模式UI
*/
private fun changeSearchUI() {
uiMode = UI_MODE_SEARCH
binding.ivXuanzhuan.visibility = View.INVISIBLE
binding.ivMore.visibility = View.GONE
binding.tvPdfName.visibility = View.INVISIBLE
binding.rvPager.visibility = View.GONE
binding.clOperation.visibility = View.GONE
binding.editSearch.visibility = View.VISIBLE
}
/**
* 编辑选择UI模式
*/
private fun changeEditSelectUI(view: View) {
uiMode = UI_MODE_EDITE_SELECT
binding.tvBtnSave.visibility = View.GONE
binding.rvPager.visibility = View.GONE
binding.ivXuanzhuan.visibility = View.INVISIBLE
binding.ivSearch.visibility = View.INVISIBLE
binding.ivMore.visibility = View.INVISIBLE
binding.ivWancheng.visibility = View.VISIBLE
if (binding.llHighlight == view) {
binding.llHighlight.setBackgroundColor(Color.parseColor("#F5F5F5"))
} else {
binding.llHighlight.setBackgroundColor(Color.TRANSPARENT)
}
if (binding.llGlideLine == view) {
binding.llGlideLine.setBackgroundColor(Color.parseColor("#F5F5F5"))
} else {
binding.llGlideLine.setBackgroundColor(Color.TRANSPARENT)
}
if (binding.llStrikethrough == view) {
binding.llStrikethrough.setBackgroundColor(Color.parseColor("#F5F5F5"))
} else {
binding.llStrikethrough.setBackgroundColor(Color.TRANSPARENT)
}
if (binding.llPaintingBrush == view) {
binding.llPaintingBrush.setBackgroundColor(Color.parseColor("#F5F5F5"))
} else {
binding.llPaintingBrush.setBackgroundColor(Color.TRANSPARENT)
}
}
/**
* 编辑保持UI模式
*/
private fun changeEditSaveUI() {
uiMode = UI_MODE_EDITE_SAVE
binding.ivWancheng.visibility = View.INVISIBLE
binding.ivMore.visibility = View.INVISIBLE
binding.ivXuanzhuan.visibility = View.INVISIBLE
binding.ivSearch.visibility = View.INVISIBLE
binding.clOperation.visibility = View.VISIBLE
binding.tvBtnSave.visibility = View.VISIBLE
binding.rvPager.visibility = View.VISIBLE
binding.llHighlight.setBackgroundColor(Color.TRANSPARENT)
binding.llGlideLine.setBackgroundColor(Color.TRANSPARENT)
binding.llStrikethrough.setBackgroundColor(Color.TRANSPARENT)
binding.llPaintingBrush.setBackgroundColor(Color.TRANSPARENT)
}
fun switchOrientation() {
requestedOrientation = if (requestedOrientation == ActivityInfo.SCREEN_ORIENTATION_PORTRAIT) {
ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE
} else {
ActivityInfo.SCREEN_ORIENTATION_PORTRAIT
}
}
companion object {
const val UI_MODE_NORMAL = 0
const val UI_MODE_SEARCH = 1
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"
const val SAVE_MODE_STRIKETHROUGH = "Strikethrough"
const val SAVE_MODE_PAINTING_BRUSH = "Painting Brush"
//todo
fun jumpSplit(activity: Activity) {
// activity.startActivity(Intent(activity, PdfSplitActivity::class.java).apply {
// putExtra("path", path)
// putExtra("pwd", pwd)
// putExtra("uri", uri)
// })
}
fun jumpMerge(activity: Activity) {
activity.startActivity(Intent(activity, PdfSelectActivity::class.java).apply {
putExtra("doWhat", ConstObject.DO_MERGE_PDF)
})
}
}
}
\ No newline at end of file
package com.base.pdfreaderallpdfreader.ui.pdf
import android.content.Intent
import androidx.lifecycle.ViewModelProvider
import androidx.lifecycle.lifecycleScope
import com.artifex.mupdfdemo.MuPDFCore
import com.base.pdfreaderallpdfreader.base.BaseActivity
import com.base.pdfreaderallpdfreader.bean.ConstObject.DO_MERGE_PDF
import com.base.pdfreaderallpdfreader.bean.ConstObject.DO_SAVE_PDF
import com.base.pdfreaderallpdfreader.bean.ConstObject.DO_SPLIT_PDF
import com.base.pdfreaderallpdfreader.databinding.ActivityPdfLoadingBinding
import com.base.pdfreaderallpdfreader.utils.LogEx
import com.base.pdfreaderallpdfreader.utils.ToastUtils.toast
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.delay
import kotlinx.coroutines.isActive
import kotlinx.coroutines.launch
import java.io.File
import kotlin.random.Random
class PdfLoadingActivity : BaseActivity<ActivityPdfLoadingBinding>() {
private val TAG = "PdfLoadingActivity"
private var doWhat = ""
private var srcPath: String = ""
private var newPath: String = ""
private var pwd: String? = null
private var splitIndex: List<Int> = listOf()
private lateinit var pdfViewModel: PdfViewModel
override val binding: ActivityPdfLoadingBinding by lazy {
ActivityPdfLoadingBinding.inflate(layoutInflater)
}
private var isFinishBoolean: Boolean = false
private var progressFinishAction: (() -> Unit)? = null
var resultFile: File? = null
override fun onResume() {
super.onResume()
// updateAppLanguage(MyApplication.pdfLoadingLanguage) {
// MyApplication.pdfLoadingLanguage = it
// }
}
fun progressFinishAd(next: () -> Unit) {
//todo
// if (AdmobHelper.canCommonShowAd()) {
// AdmobInterstitialUtils.showInterstitialAd(this) {
// next.invoke()
// }
// } else {
// next.invoke()
// }
}
override fun initView() {
// if (checkNeedRecreate(MyApplication.pdfLoadingLanguage)) {
// return
// }
pdfViewModel = ViewModelProvider(this)[PdfViewModel::class.java]
initSpPa()
pdfViewModel.password = pwd
when (doWhat) {
DO_SPLIT_PDF -> {
progressFinishAction = {
progressFinishAd {
if (resultFile != null) {
startActivity(Intent(this, PdfActivity::class.java).apply {
putExtra("path", resultFile?.absolutePath ?: "")
})
} else {
toast("split pdf failed")
}
finish()
}
}
pdfViewModel.splitPdf(srcPath, newPath, splitIndex, finishAction = {
resultFile = it
isFinishBoolean = true
})
}
DO_SAVE_PDF -> {
muPDFCore?.save()
muPDFCore = null
progressFinishAction = {
progressFinishAd {
startActivity(Intent(this, PdfActivity::class.java).apply {
putExtra("path", srcPath)
})
finish()
}
}
lifecycleScope.launch {
delay(Random.nextLong(1500, 2500))
isFinishBoolean = true
}
}
DO_MERGE_PDF -> {
progressFinishAction = {
progressFinishAd {
startActivity(Intent(this, PdfActivity::class.java).apply {
putExtra("path", newPath)
})
finish()
}
}
pdfViewModel.mergePdf(newPath) {
isFinishBoolean = true
}
}
}
startProgress()
}
private fun startProgress() = lifecycleScope.launch(Dispatchers.Main) {
while (isActive) {
if (isFinishBoolean) {
binding.progressBar.progress = 100
delay(200)
break
} else {
binding.progressBar.progress += 2
}
delay(500)
}
progressFinishAction?.invoke()
}
private fun initSpPa() {
doWhat = intent?.extras?.getString("doWhat", "") ?: ""
srcPath = intent?.extras?.getString("srcPath", "") ?: ""
pwd = intent.extras?.getString("pwd")
newPath = intent?.extras?.getString("newPath", "") ?: ""
splitIndex = intent.extras?.getString("splitIndex")?.split(",")?.map { it.toInt() } ?: listOf()
LogEx.logDebug(TAG, "initSpPa doWhat=$doWhat srcPath=$srcPath pwd=$pwd newPath=$newPath splitIndex=$splitIndex")
}
companion object {
var muPDFCore: MuPDFCore? = null
}
override fun onDestroy() {
super.onDestroy()
muPDFCore?.onDestroy()
}
}
\ No newline at end of file
package com.base.pdfreaderallpdfreader.ui.pdf
import android.content.Intent
import androidx.activity.addCallback
import androidx.lifecycle.ViewModelProvider
import androidx.lifecycle.lifecycleScope
import androidx.recyclerview.widget.ItemTouchHelper
import com.base.pdfreaderallpdfreader.base.BaseActivity
import com.base.pdfreaderallpdfreader.bean.ConstObject.DO_MERGE_PDF
import com.base.pdfreaderallpdfreader.bean.DocumentBean
import com.base.pdfreaderallpdfreader.databinding.ActivityPdfMergeBinding
import com.base.pdfreaderallpdfreader.ui.view.NameDialog.showDocumentRenameDialog
import com.base.pdfreaderallpdfreader.ui.view.PwdDialog.showPdfPwdDialog
import com.base.pdfreaderallpdfreader.utils.KotlinExt.toFormatTime2
import com.base.pdfreaderallpdfreader.utils.LogEx
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.cancel
import kotlinx.coroutines.isActive
import kotlinx.coroutines.launch
import java.util.concurrent.ArrayBlockingQueue
import java.util.concurrent.BlockingQueue
class PdfMergeActivity : BaseActivity<ActivityPdfMergeBinding>() {
private val TAG = "PdfMergeActivity"
override val binding: ActivityPdfMergeBinding by lazy {
ActivityPdfMergeBinding.inflate(layoutInflater)
}
private lateinit var pdfViewModel: PdfViewModel
private lateinit var adapter: PdfMergeAdapter
override fun onResume() {
super.onResume()
// updateAppLanguage(MyApplication.pdfMergeLanguage) {
// MyApplication.pdfMergeLanguage = it
// }
}
override fun initView() {
pdfViewModel = ViewModelProvider(this)[PdfViewModel::class.java]
initAdapter()
}
override fun initListener() {
super.initListener()
onBackPressedDispatcher.addCallback {
finish()
}
binding.flFanhui.setOnClickListener {
onBackPressedDispatcher.onBackPressed()
}
binding.tvAdd.setOnClickListener {
finish()
}
binding.tvBtnNext.setOnClickListener {
verificationPasswordDialogs {
showDocumentRenameDialog(name = "Merge_${System.currentTimeMillis().toFormatTime2()}", okAction = { name ->
startActivity(Intent(this, PdfLoadingActivity::class.java).apply {
putExtra("doWhat", DO_MERGE_PDF)
putExtra("newPath", pdfViewModel.createNewPdfPath(this@PdfMergeActivity, name))
})
})
}
}
}
private fun verificationPasswordDialogs(callBack: () -> Unit) {
val queue: BlockingQueue<DocumentBean> = ArrayBlockingQueue(1)
val pwdItemList = mergePdfList.filter { it.state == 1 }.toMutableList()
if (pwdItemList.isNotEmpty()) {
LogEx.logDebug(TAG, "verificationPasswordDialogs1")
val verifiedList = arrayListOf<DocumentBean>()
val first = pwdItemList[0]
queue.put(first)
pwdItemList.removeAt(0)
LogEx.logDebug(TAG, "verificationPasswordDialogs2")
lifecycleScope.launch(Dispatchers.IO) {
while (isActive) {
val item: DocumentBean = queue.take()
LogEx.logDebug(TAG, "pwdItem =${item.path}")
if (item.path == "Cancel") {
break
}
launch(Dispatchers.Main) {
showPdfPwdDialog(item.state, item.path, isCheckPwd = true, verificationAction = { pwd ->
item.password = pwd
verifiedList.add(item)
if (pwdItemList.isNotEmpty()) {
val next = pwdItemList[0]
queue.put(next)
pwdItemList.removeAt(0)
} else {
queue.put(DocumentBean(path = "Cancel"))
}
}, cancelAction = {
cancel()
})
}
}
LogEx.logDebug(TAG, "verificationPasswordDialogs3 ${verifiedList.size}")
verifiedList.forEach { verifiedItem ->
mergePdfList.find { it.path == verifiedItem.path }?.password = verifiedItem.password
}
mergePdfList.forEach {
LogEx.logDebug(TAG, "密码=" + it.password)
}
launch(Dispatchers.Main) {
callBack.invoke()
}
}
} else {
callBack.invoke()
}
}
private fun initAdapter() {
val callBack = PdfMergeItemTouchHelperCallBack()
val itemTouchHelper = ItemTouchHelper(callBack)
itemTouchHelper.attachToRecyclerView(binding.rv)
adapter = PdfMergeAdapter(itemTouchHelper, callBack)
adapter.removeAction = {
mergePdfList.remove(it)
binding.tvBtnNext.isEnabled = mergePdfList.size >= 2
}
binding.rv.adapter = adapter
callBack.changeListOrder = { olderPosition, newPosition ->
val bean = mergePdfList[olderPosition]
mergePdfList.remove(bean)
mergePdfList.add(newPosition, bean)
mergePdfList.forEach {
LogEx.logDebug(TAG, "mergePdfList ${it.path}")
}
adapter.items.forEach {
LogEx.logDebug(TAG, "items ${it.path}")
}
// adapter.items = mergePdfList
}
mergePdfList.let { adapter.submitList(it) }
binding.tvBtnNext.isEnabled = mergePdfList.size >= 2
}
companion object {
val mergePdfList: ArrayList<DocumentBean> = arrayListOf()
}
}
\ No newline at end of file
package com.base.pdfreaderallpdfreader.ui.pdf
import android.annotation.SuppressLint
import android.content.Context
import android.view.MotionEvent
import android.view.View
import android.view.ViewGroup
import androidx.recyclerview.widget.ItemTouchHelper
import androidx.recyclerview.widget.RecyclerView
import com.base.pdfreaderallpdfreader.R
import com.base.pdfreaderallpdfreader.bean.DocumentBean
import com.base.pdfreaderallpdfreader.databinding.ItemPdfMergeBinding
import com.base.pdfreaderallpdfreader.utils.KotlinExt.toFormatSize
import com.base.pdfreaderallpdfreader.utils.KotlinExt.toFormatTime4
import com.base.pdfreaderallpdfreader.utils.LogEx
import com.base.pdfreaderallpdfreader.utils.XmlEx.inflate
import com.chad.library.adapter4.BaseQuickAdapter
import java.io.File
class PdfMergeAdapter(
val itemTouchHelper: ItemTouchHelper,
val callBack: PdfMergeItemTouchHelperCallBack
) : BaseQuickAdapter<DocumentBean, PdfMergeAdapter.PdfMergeViewHolder>() {
private val TAG = "PdfMergeAdapter"
var removeAction: ((item: DocumentBean) -> Unit)? = null
inner class PdfMergeViewHolder(view: View) : RecyclerView.ViewHolder(view)
@SuppressLint("SetTextI18n", "ClickableViewAccessibility")
override fun onBindViewHolder(holder: PdfMergeViewHolder, position: Int, item: DocumentBean?) {
if (item == null) return
val binding = ItemPdfMergeBinding.bind(holder.itemView)
val file = File(item.path)
binding.tvName.text = file.name
binding.tvInfo.text = file.lastModified().toFormatTime4() + " " + file.length().toFormatSize()
if (item.state == 0) {
binding.iv.setImageResource(R.mipmap.r_pdf)
} else {
binding.iv.setImageResource(R.mipmap.rv_pdf_lock)
}
binding.flClose.setOnClickListener {
remove(item)
removeAction?.invoke(item)
}
binding.ivMove.setOnTouchListener(object : View.OnTouchListener {
override fun onTouch(v: View?, event: MotionEvent?): Boolean {
if (event?.action == MotionEvent.ACTION_DOWN) {
callBack.enableLongPress = true
LogEx.logDebug(TAG, "ACTION_DOWN ${System.currentTimeMillis()}")
// 长按时启动拖动
itemTouchHelper.startDrag(holder)
return true
}
return false
}
})
}
override fun onCreateViewHolder(context: Context, parent: ViewGroup, viewType: Int): PdfMergeViewHolder {
return PdfMergeViewHolder(R.layout.item_pdf_merge.inflate(parent))
}
}
\ No newline at end of file
package com.base.pdfreaderallpdfreader.ui.pdf
import androidx.recyclerview.widget.ItemTouchHelper
import androidx.recyclerview.widget.RecyclerView
import com.base.pdfreaderallpdfreader.utils.LogEx
class PdfMergeItemTouchHelperCallBack : ItemTouchHelper.Callback() {
var changeListOrder: ((olderPosition: Int, newPosition: Int) -> Unit)? = null
var enableLongPress: Boolean = false
private val TAG = "PdfMergeItemTouchHelperCallBack"
override fun getMovementFlags(recyclerView: RecyclerView, viewHolder: RecyclerView.ViewHolder): Int {
//支持上下左右拖动
// ACTION_STATE_IDLE item默认滑动方向
return makeMovementFlags(
ItemTouchHelper.UP or ItemTouchHelper.DOWN or ItemTouchHelper.START or ItemTouchHelper.END,
ItemTouchHelper.ACTION_STATE_IDLE
)
// 禁用默认的拖动和滑动
// return makeMovementFlags(0, 0);
}
/**
* 拖拽结束后(手指抬起)会回调的方法
*/
override fun onMove(recyclerView: RecyclerView, viewHolder: RecyclerView.ViewHolder, target: RecyclerView.ViewHolder): Boolean {
//更新item holder对应位置
recyclerView.adapter?.notifyItemMoved(
viewHolder.adapterPosition,
target.adapterPosition
)
changeListOrder?.invoke(viewHolder.layoutPosition, target.layoutPosition)
enableLongPress = false
return true
}
override fun onSwiped(viewHolder: RecyclerView.ViewHolder, direction: Int) = Unit
override fun isLongPressDragEnabled(): Boolean {
LogEx.logDebug(TAG, "isLongPressDragEnabled $enableLongPress ${System.currentTimeMillis()}")
return enableLongPress
}
override fun onSelectedChanged(viewHolder: RecyclerView.ViewHolder?, actionState: Int) {
super.onSelectedChanged(viewHolder, actionState)
if (actionState == ItemTouchHelper.ACTION_STATE_IDLE) {
// 当没有动作时,取消拖动状态
viewHolder?.itemView?.setPressed(false)
} else if (actionState == ItemTouchHelper.ACTION_STATE_SWIPE) {
// 当滑动时,设置拖动状态
viewHolder?.itemView?.setPressed(true)
}
}
}
\ No newline at end of file
package com.base.pdfreaderallpdfreader.ui.pdf
import android.annotation.SuppressLint
import android.content.Context
import android.view.View
import android.view.ViewGroup
import android.widget.ImageView
import androidx.recyclerview.widget.RecyclerView.ViewHolder
import com.base.pdfreaderallpdfreader.R
import com.base.pdfreaderallpdfreader.bean.PdfPageBean
import com.base.pdfreaderallpdfreader.databinding.ItemPdfPagerBinding
import com.base.pdfreaderallpdfreader.databinding.ItemPdfPagerSplitBinding
import com.base.pdfreaderallpdfreader.utils.PdfBoxUtils
import com.base.pdfreaderallpdfreader.utils.XmlEx.inflate
import com.chad.library.adapter4.BaseQuickAdapter
import java.util.concurrent.LinkedBlockingQueue
import java.util.concurrent.ThreadPoolExecutor
import java.util.concurrent.TimeUnit
class PdfPagerAdapter(
val pdfPath: String,
val uri: String? = null,
val itemLayout: Int = R.layout.item_pdf_pager,
) : BaseQuickAdapter<PdfPageBean, PdfPagerAdapter.PdfPagerViewHolder>() {
var mPassword: String? = null
var selectAction: ((enable: Boolean, allSelect: Boolean) -> Unit)? = null
var clickAction: ((pageIndex: Int) -> Unit)? = null
inner class PdfPagerViewHolder(view: View) : ViewHolder(view)
var corePoolSize = 4 // 核心线程数
var maximumPoolSize = 10 // 最大线程数
var keepAliveTime: Long = 120 // 非核心线程空闲存活时间
var threadPoolExecutor = ThreadPoolExecutor(
corePoolSize,
maximumPoolSize,
keepAliveTime,
TimeUnit.SECONDS,
LinkedBlockingQueue()
)
@SuppressLint("SetTextI18n")
override fun onBindViewHolder(holder: PdfPagerViewHolder, position: Int, item: PdfPageBean?) {
if (item == null) return
when (itemLayout) {
R.layout.item_pdf_pager -> {
val binding = ItemPdfPagerBinding.bind(holder.itemView)
val context = holder.itemView.context
binding.tvPagerIndex.isSelected = item.isSelect
binding.tvPagerIndex.text = (item.pageIndex + 1).toString()
binding.flBorder.isSelected = item.isSelect
if (item.pageDrawable != null) {
binding.ivPager.setImageDrawable(item.pageDrawable)
} else {
loadPagerDrawable(context, item, binding.root, binding.ivPager)
}
binding.root.setOnClickListener {
clickAction?.invoke(item.pageIndex)
}
}
R.layout.item_pdf_pager_split -> {
val binding = ItemPdfPagerSplitBinding.bind(holder.itemView)
binding.ivSelector.isSelected = item.isSelect
if (item.pageDrawable != null) {
binding.ivPager.setImageDrawable(item.pageDrawable)
} else {
loadPagerDrawable(context, item, binding.root, binding.ivPager, 1.5f)
}
binding.ivSelector.setOnClickListener {
item.isSelect = !item.isSelect
notifyItemChanged(position, "aaa")
selectAction?.invoke(items.any { it.isSelect }, items.all { it.isSelect })
}
}
}
}
private fun loadPagerDrawable(
context: Context,
item: PdfPageBean,
itemView: View,
iv: ImageView,
scale: Float = 1f
) {
threadPoolExecutor.execute {
runCatching {
val drawable = PdfBoxUtils.getPdfDrawablePage(context, pdfPath, mPassword, uri, item.pageIndex, scale)
item.pageDrawable = drawable
itemView.post {
item.pageDrawable?.let {
iv.setImageDrawable(it)
}
}
}
}
}
override fun onCreateViewHolder(context: Context, parent: ViewGroup, viewType: Int): PdfPagerViewHolder {
return PdfPagerViewHolder(itemLayout.inflate(parent))
}
@SuppressLint("NotifyDataSetChanged")
fun toggleSelect(select: Boolean) {
items.forEach { it.isSelect = select }
notifyDataSetChanged()
}
@SuppressLint("NotifyDataSetChanged")
fun changeSelectPager(page: Int) {
runCatching {
items.forEach { it.isSelect = false }
items[page].isSelect = true
}
notifyDataSetChanged()
}
@SuppressLint("NotifyDataSetChanged")
fun setPassword(password: String) {
mPassword = password
notifyDataSetChanged()
}
}
\ No newline at end of file
package com.base.pdfreaderallpdfreader.ui.pdf
import android.annotation.SuppressLint
import android.view.View
import androidx.activity.addCallback
import androidx.core.view.isVisible
import androidx.lifecycle.ViewModelProvider
import androidx.lifecycle.lifecycleScope
import com.base.pdfreaderallpdfreader.R
import com.base.pdfreaderallpdfreader.base.BaseActivity
import com.base.pdfreaderallpdfreader.bean.ConstObject.DO_LOCK_PDF
import com.base.pdfreaderallpdfreader.bean.ConstObject.DO_MERGE_PDF
import com.base.pdfreaderallpdfreader.bean.ConstObject.DO_SPLIT_PDF
import com.base.pdfreaderallpdfreader.bean.ConstObject.DO_UNLOCK_PDF
import com.base.pdfreaderallpdfreader.bean.DocumentBean
import com.base.pdfreaderallpdfreader.databinding.ActivityPdfSelectBinding
import com.base.pdfreaderallpdfreader.ui.main.getPdfDocument
import com.base.pdfreaderallpdfreader.ui.view.PwdDialog.showPdfPwdDialog
import com.base.pdfreaderallpdfreader.utils.LogEx
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.launch
class PdfSelectActivity : BaseActivity<ActivityPdfSelectBinding>() {
private val TAG = "PdfSelectActivity"
private lateinit var pdfViewModel: PdfViewModel
private lateinit var adapter: DocumentPdfAdapter
private var doWhat: String = ""
override val binding: ActivityPdfSelectBinding by lazy {
ActivityPdfSelectBinding.inflate(layoutInflater)
}
override fun onResume() {
super.onResume()
// updateAppLanguage(MyApplication.pdfSelectLanguage) {
// MyApplication.pdfSelectLanguage = it
// }
}
override fun initView() {
// if (checkNeedRecreate(MyApplication.pdfSelectLanguage)) {
// return
// }
pdfViewModel = ViewModelProvider(this)[PdfViewModel::class.java]
doWhat = intent.extras?.getString("doWhat", "") ?: ""
LogEx.logDebug(TAG, "doWhat=$doWhat")
initAdapter()
when (doWhat) {
DO_SPLIT_PDF -> {
binding.tvBtnNext.visibility = View.GONE
binding.tvSelectTip.text = getString(R.string.select_a_project)
getPdfData(2)
}
DO_MERGE_PDF -> {
binding.tvSelectTip.text = getString(R.string.select_a_project)
getPdfData(1)
}
DO_LOCK_PDF -> {
binding.tvBtnNext.visibility = View.GONE
binding.tvSelectTip.text = getString(R.string.select_a_project)
getPdfData(3)
}
DO_UNLOCK_PDF -> {
binding.tvBtnNext.visibility = View.GONE
binding.tvSelectTip.text = getString(R.string.select_a_project)
getPdfData(3)
}
}
}
private fun getPdfData(uiType: Int) {
lifecycleScope.launch(Dispatchers.IO) {
val list = getPdfDocument(this@PdfSelectActivity)
list.forEach { it.uiType = uiType }
launch(Dispatchers.Main) {
refreshUI(list)
}
}
}
private fun refreshUI(list: List<DocumentBean>) {
adapter.submitList(list)
binding.llEmpty.isVisible = list.isEmpty()
binding.progressBar.visibility = View.GONE
}
override fun initListener() {
super.initListener()
// if (checkNeedRecreate(MyApplication.pdfSelectLanguage)) {
// return
// }
onBackPressedDispatcher.addCallback {
finishToMain()
}
binding.flFanhui.setOnClickListener {
onBackPressedDispatcher.onBackPressed()
}
binding.tvBtnNext.setOnClickListener {
if (doWhat == DO_MERGE_PDF) {
val selectList = adapter.items.filter { it.isSelect }
//todo
// PdfMergeActivity.mergePdfList.clear()
// PdfMergeActivity.mergePdfList.addAll(selectList)
// startActivity(Intent(this, PdfMergeActivity::class.java))
}
}
}
@SuppressLint("StringFormatMatches")
private fun initAdapter() {
adapter = DocumentPdfAdapter()
adapter.itemClick = {
if (doWhat == DO_SPLIT_PDF) {
if (it.state == 0) {
//todo
// startActivity(Intent(this, PdfSplitActivity::class.java).apply {
// putExtra("path", it.path)
// })
} else {
showPdfPwdDialog(
state = it.state,
path = it.path,
isCheckPwd = true,
verificationAction = { pwd ->
//
// startActivity(Intent(this, PdfSplitActivity::class.java).apply {
// putExtra("path", it.path)
// putExtra("pwd", pwd)
// })
})
}
}
if (doWhat == DO_LOCK_PDF) {
showPdfPwdDialog(state = it.state, path = it.path, encryptionAction = {
// if (AdmobHelper.canCommonShowAd()) {
// AdmobInterstitialUtils.showInterstitialAd(this) { flag ->
// adapter.remove(it)
// binding.llEmpty.isVisible = adapter.items.isEmpty()
// }
// } else {
adapter.remove(it)
binding.llEmpty.isVisible = adapter.items.isEmpty()
// }
})
}
if (doWhat == DO_UNLOCK_PDF) {
showPdfPwdDialog(state = it.state, path = it.path, encryptionAction = {
// if (AdmobHelper.canCommonShowAd()) {
// AdmobInterstitialUtils.showInterstitialAd(this) { flag ->
// adapter.remove(it)
// binding.llEmpty.isVisible = adapter.items.isEmpty()
// }
// } else {
adapter.remove(it)
binding.llEmpty.isVisible = adapter.items.isEmpty()
// }
})
}
}
adapter.selectAction = {
LogEx.logDebug(TAG, "selectAction $it")
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 = getString(R.string.items_has_been_selected, it)
}
}
binding.rv.adapter = adapter
}
}
\ No newline at end of file
package com.base.pdfreaderallpdfreader.ui.pdf
import android.content.Intent
import androidx.activity.addCallback
import androidx.lifecycle.ViewModelProvider
import com.base.pdfreaderallpdfreader.R
import com.base.pdfreaderallpdfreader.base.BaseActivity
import com.base.pdfreaderallpdfreader.bean.ConstObject
import com.base.pdfreaderallpdfreader.databinding.ActivityPdfSplitBinding
import com.base.pdfreaderallpdfreader.ui.view.NameDialog.showDocumentRenameDialog
class PdfSplitActivity : BaseActivity<ActivityPdfSplitBinding>() {
private lateinit var pdfViewModel: PdfViewModel
private lateinit var pdfPagerAdapter: PdfPagerAdapter
private var path: String = ""
private var pwd: String? = ""
override val binding: ActivityPdfSplitBinding by lazy {
ActivityPdfSplitBinding.inflate(layoutInflater)
}
override fun onResume() {
super.onResume()
// updateAppLanguage(MyApplication.pdfSplitLanguage) {
// MyApplication.pdfSplitLanguage = it
// }
}
override fun initView() {
pdfViewModel = ViewModelProvider(this)[PdfViewModel::class.java]
path = intent.extras?.getString("path", "") ?: ""
pwd = intent.extras?.getString("pwd", "") ?: ""
pdfViewModel.password = pwd
initAdapter()
pdfViewModel.initPdfPageRv = { items ->
pdfPagerAdapter.submitList(items)
}
pdfViewModel.iniPdfPage(this, path)
}
override fun initListener() {
super.initListener()
onBackPressedDispatcher.addCallback {
finishToMain()
}
binding.flFanhui.setOnClickListener {
onBackPressedDispatcher.onBackPressed()
}
binding.ivSelector.setOnClickListener {
binding.ivSelector.isSelected = !binding.ivSelector.isSelected
pdfPagerAdapter.toggleSelect(binding.ivSelector.isSelected)
}
binding.tvBtnSplit.setOnClickListener {
val splitIndex = pdfPagerAdapter.items.filter { it.isSelect }.map { it.pageIndex }
showDocumentRenameDialog(okAction = { newName ->
startActivity(Intent(this, PdfLoadingActivity::class.java).apply {
putExtra("doWhat", ConstObject.DO_SPLIT_PDF)
putExtra("srcPath", path)
putExtra("pwd", pwd)
putExtra("newPath", pdfViewModel.createNewPdfPath(this@PdfSplitActivity, newName))
putExtra("splitIndex", splitIndex.joinToString(separator = ","))
})
finish()
})
}
}
private fun initAdapter() {
pdfPagerAdapter = PdfPagerAdapter(path, null, R.layout.item_pdf_pager_split)
pdfPagerAdapter.mPassword = pwd
pdfPagerAdapter.selectAction = { enable, allSelect ->
binding.tvBtnSplit.isEnabled = enable
binding.ivSelector.isSelected = allSelect
}
binding.rv.adapter = pdfPagerAdapter
}
}
\ No newline at end of file
package com.base.pdfreaderallpdfreader.ui.pdf
import android.content.Context
import android.net.Uri
import android.os.Environment
import androidx.lifecycle.ViewModel
import androidx.lifecycle.viewModelScope
import com.artifex.mupdfdemo.MuPDFCore
import com.artifex.mupdfdemo.OutlineActivityData
import com.base.pdfreaderallpdfreader.R
import com.base.pdfreaderallpdfreader.bean.ConstObject.MIME_TYPE_PDF
import com.base.pdfreaderallpdfreader.bean.PdfPageBean
import com.base.pdfreaderallpdfreader.ui.pdf.PdfMergeActivity.Companion.mergePdfList
import com.base.pdfreaderallpdfreader.utils.LogEx
import com.base.pdfreaderallpdfreader.utils.PdfBoxUtils
import com.base.pdfreaderallpdfreader.utils.UriUtils.readFileToByteArray
import com.tom_roush.pdfbox.multipdf.PDFMergerUtility
import com.tom_roush.pdfbox.pdmodel.PDDocument
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.launch
import java.io.File
class PdfViewModel : ViewModel() {
private val TAG = "PdfViewModel"
var password: String? = null
var initPdfPageRv: ((items: List<PdfPageBean>) -> Unit)? = null
fun openFile(context: Context, path: String, uri: String? = null): MuPDFCore? {
var muPDFCore: MuPDFCore? = null
try {
muPDFCore = if (uri == null)
MuPDFCore(context, path)
else
MuPDFCore(context, readFileToByteArray(context, Uri.parse(uri)), MIME_TYPE_PDF)
// 新建:删除旧的目录数据
OutlineActivityData.set(null)
} catch (e: java.lang.Exception) {
return null
} catch (e: OutOfMemoryError) {
return null
}
return muPDFCore
}
fun iniPdfPage(pageCount: Int) {
val list = arrayListOf<PdfPageBean>()
repeat(pageCount) {
list.add(PdfPageBean(it))
}
initPdfPageRv?.invoke(list)
}
fun iniPdfPage(context: Context, filePath: String, uri: String? = null) = viewModelScope.launch(Dispatchers.IO) {
val list = arrayListOf<PdfPageBean>()
val number = PdfBoxUtils.getNumberOfPages(context, filePath, password, uri)
repeat(number) {
list.add(PdfPageBean(it))
}
initPdfPageRv?.invoke(list)
}
private fun createAppDocumentDir(context: Context): File {
val appName = context.resources.getString(R.string.app_name)
val appDir = File(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOCUMENTS), appName)
if (!appDir.exists()) {
appDir.mkdirs()
}
return appDir
}
fun createNewPdfPath(context: Context, name: String): String {
val appDir = createAppDocumentDir(context)
val child = if (name.endsWith(".pdf")) name else "$name.pdf"
val mergeFile = File(appDir, child)
mergeFile.createNewFile()
LogEx.logDebug(TAG, "mergeFile ${mergeFile.absolutePath}")
return mergeFile.absolutePath
}
fun splitPdf(
srcPath: String,
newPath: String,
splitIndex: List<Int>,
finishAction: (newFile: File?) -> Unit
) = Thread {
try {
// 加载现有 PDF 文档
val sourceDocument = PDDocument.load(File(srcPath), password)
LogEx.logDebug(TAG, "sourceDocument open")
// 创建新的 PDF 文档
val newDocument = PDDocument()
// 遍历指定的页面范围
splitIndex.forEach { index ->
val page = sourceDocument.getPage(index)
newDocument.addPage(page)
}
// 保存新的 PDF 文档
newDocument.save(newPath)
newDocument.close()
sourceDocument.close()
} catch (e: Exception) {
LogEx.logDebug(TAG, "splitPdf error")
finishAction.invoke(null)
return@Thread
}
finishAction.invoke(File(newPath))
}.start()
fun mergePdf(mergePath: String, finishAction: (success: Boolean) -> Unit) = Thread {
var isSuccess: Boolean = false
try {
val mergerUtility = PDFMergerUtility()
mergerUtility.destinationFileName = mergePath
//解密
PdfMergeActivity.mergePdfList.filter { it.state == 1 }.forEach {
PdfBoxUtils.clearPassword(it.path, it.password)
}
LogEx.logDebug(TAG, "mergePdf ${mergePdfList.size}")
PdfMergeActivity.mergePdfList.forEach { documentBean ->
LogEx.logDebug(TAG, "mergePdf item= ${documentBean.path} ${documentBean.state}")
//带密码 mergerUtility.addSource(inputStream) 不行
mergerUtility.addSource(File(documentBean.path))
// if (documentBean.state == 0) {
// mergerUtility.addSource(File(documentBean.path))
// } else {
// LogEx.logDebug(TAG, "mergePdf password=${documentBean.password}")
// try {
// val pdfDocument = PDDocument.load(File(documentBean.path), documentBean.password)
// LogEx.logDebug(TAG, "mergePdf pdfDocument ${pdfDocument.numberOfPages}")
// val byteArrayOutputStream = ByteArrayOutputStream()
// pdfDocument.save(byteArrayOutputStream)
// LogEx.logDebug(TAG, "mergePdf byteArrayOutputStream ${byteArrayOutputStream.size()}")
// pdfDocument.close()
// val inputStream = ByteArrayInputStream(byteArrayOutputStream.toByteArray())
// LogEx.logDebug(TAG, "mergePdf inputStream")
// mergerUtility.addSource(inputStream)
// } catch (e: Exception) {
// LogEx.logDebug(TAG, "mergePdf Exception ${e.printStackTrace()}")
// }
// LogEx.logDebug(TAG, "mergePdf inputStream")
// }
}
mergerUtility.mergeDocuments(null)
//重新加密
PdfMergeActivity.mergePdfList.filter { it.state == 1 }.forEach {
val flag = PdfBoxUtils.setPassword(it.path, it.password, it.password)
LogEx.logDebug(TAG, "重新加密 flag=$flag ${it.path} ${it.password}")
}
mergePdfList.clear()
LogEx.logDebug(TAG, "mergePdf finish")
isSuccess = true
} catch (e: Exception) {
}
finishAction.invoke(isSuccess)
}.start()
}
\ No newline at end of file
package com.base.pdfreaderallpdfreader.ui.view
import android.content.Context
import android.view.LayoutInflater
import android.view.View
import com.base.pdfreaderallpdfreader.R
import com.base.pdfreaderallpdfreader.databinding.DialogDeleteBinding
import com.google.android.material.bottomsheet.BottomSheetBehavior
import com.google.android.material.bottomsheet.BottomSheetDialog
object DialogView {
fun Context.showDeleteDialog(deleteAction: () -> Unit) {
val dialog = BottomSheetDialog(this, R.style.BottomSheetDialog)
val binding = DialogDeleteBinding.inflate(LayoutInflater.from(this))
dialog.setContentView(binding.root)
dialog.setCanceledOnTouchOutside(false)
dialog.show()
val parentView = binding.root.parent as View
val behavior = BottomSheetBehavior.from(parentView)
//展开
behavior.state = BottomSheetBehavior.STATE_EXPANDED
binding.tvCancel.setOnClickListener {
dialog.dismiss()
}
binding.tvDelete.setOnClickListener {
dialog.dismiss()
deleteAction.invoke()
}
}
}
\ No newline at end of file
package com.base.pdfreaderallpdfreader.ui.view
import android.annotation.SuppressLint
import android.content.Context
import android.view.LayoutInflater
import android.view.View
import android.view.WindowManager
import androidx.core.widget.addTextChangedListener
import com.base.pdfreaderallpdfreader.R
import com.base.pdfreaderallpdfreader.bean.DocumentBean
import com.base.pdfreaderallpdfreader.bean.DocumentBean.Companion.TYPE_EXCEL
import com.base.pdfreaderallpdfreader.bean.DocumentBean.Companion.TYPE_PPT
import com.base.pdfreaderallpdfreader.bean.DocumentBean.Companion.TYPE_WORD
import com.base.pdfreaderallpdfreader.databinding.DialogDocumentDetailBinding
import com.base.pdfreaderallpdfreader.databinding.DialogDocumentHomeMoreBinding
import com.base.pdfreaderallpdfreader.databinding.DialogPageNumberBinding
import com.base.pdfreaderallpdfreader.ui.document.DocumentFragment
import com.base.pdfreaderallpdfreader.ui.view.DialogView.showDeleteDialog
import com.base.pdfreaderallpdfreader.utils.IntentShareUtils.documentShare
import com.base.pdfreaderallpdfreader.utils.KotlinExt.toFormatSize
import com.base.pdfreaderallpdfreader.utils.KotlinExt.toFormatTime3
import com.base.pdfreaderallpdfreader.utils.KotlinExt.toFormatTime4
import com.base.pdfreaderallpdfreader.utils.NumberRangeFilter
import com.base.pdfreaderallpdfreader.utils.SpStringUtils
import com.base.pdfreaderallpdfreader.utils.SpStringUtils.LAST_VIEW_KEY
import com.base.pdfreaderallpdfreader.utils.ToastUtils.toast
import com.google.android.material.bottomsheet.BottomSheetBehavior
import com.google.android.material.bottomsheet.BottomSheetDialog
import java.io.File
object DocumentDialog {
@SuppressLint("SetTextI18n", "NotifyDataSetChanged")
fun Context.showDocumentHomeMoreDialog(
item: DocumentBean,
documentFragment: DocumentFragment
): BottomSheetDialog {
val dialog = BottomSheetDialog(this, R.style.BottomSheetDialog)
val binding = DialogDocumentHomeMoreBinding.inflate(LayoutInflater.from(this))
dialog.setContentView(binding.root)
dialog.setCanceledOnTouchOutside(false)
dialog.show()
val parentView = binding.root.parent as View
val behavior = BottomSheetBehavior.from(parentView)
//展开
behavior.state = BottomSheetBehavior.STATE_EXPANDED
val file = File(item.path)
binding.tvName.text = file.name
binding.tvInfo.text = file.lastModified().toFormatTime4() + " " + file.length().toFormatSize()
if (item.isBookmarked) {
binding.ivBookmark.setImageResource(R.mipmap.pdf_bookmark_s)
} else {
binding.ivBookmark.setImageResource(R.mipmap.pdf_bookmark_n)
}
when (item.type) {
TYPE_WORD -> {
binding.ivDocument.setImageResource(R.mipmap.rv_word)
}
TYPE_EXCEL -> {
binding.ivDocument.setImageResource(R.mipmap.rv_excel)
}
TYPE_PPT -> {
binding.ivDocument.setImageResource(R.mipmap.r_ppt)
}
}
binding.llRename.setOnClickListener {
//todo
// showDocumentRenameDialog(file.name, okAction = { newName ->
// dialog.dismiss()
// documentPresenter.renameDocumentBean(file, newName, documentFragment)
// })
}
binding.llDetail.setOnClickListener {
showDocumentDetail(item.path)
}
binding.llShare.setOnClickListener {
documentShare(item)
}
binding.llDelete.setOnClickListener {
dialog.dismiss()
showDeleteDialog {
documentFragment.deleteDocument(item)
}
}
return dialog
}
fun Context.showDocumentDetail(path: String) {
val dialog = BottomSheetDialog(this, R.style.BottomSheetDialog)
val binding = DialogDocumentDetailBinding.inflate(LayoutInflater.from(this))
dialog.setContentView(binding.root)
dialog.setCanceledOnTouchOutside(false)
dialog.show()
val parentView = binding.root.parent as View
val behavior = BottomSheetBehavior.from(parentView)
//展开
behavior.state = BottomSheetBehavior.STATE_EXPANDED
val file = File(path)
binding.tvName.text = file.name
binding.tvPath.text = file.absolutePath
val lastView = SpStringUtils.getSpStringList(LAST_VIEW_KEY).find { it.contains(file.absolutePath) }
if (lastView != null) {
val lastTime = lastView.split("_/_")[1]
binding.tvLastView.text = lastTime.toLong().toFormatTime3()
} else {
binding.tvLastView.text = file.lastModified().toFormatTime3()
}
binding.tvLastChange.text = file.lastModified().toFormatTime3()
binding.tvFileSize.text = file.length().toFormatSize()
binding.tvBtnOk.setOnClickListener {
dialog.dismiss()
}
}
// fun Activity.showDocumentMore(
// documentBean: DocumentBean,
// pageNumber: Int = 0,
// jumpAction: ((pageIndex: Int) -> Unit)? = null
// ) {
// val dialog = BottomSheetDialog(this, R.style.BottomSheetDialog)
// val binding = DialogDocumentMoreBinding.inflate(LayoutInflater.from(this))
// dialog.setContentView(binding.root)
// dialog.setCanceledOnTouchOutside(false)
//
// dialog.show()
//
// val parentView = binding.root.parent as View
// val behavior = BottomSheetBehavior.from(parentView)
// //展开
// behavior.state = BottomSheetBehavior.STATE_EXPANDED
//
// if (documentBean.type == TYPE_EXCEL) {
// binding.llJump.visibility = View.GONE
// }
//
// if (documentBean.isBookmarked) {
// binding.ivBookmark.setImageResource(R.mipmap.h_soucang_s)
// } else {
// binding.ivBookmark.setImageResource(R.mipmap.h_soucang_n)
// }
//
// binding.ivBookmark.setOnClickListener {
// binding.ivBookmark.isSelected = !binding.ivBookmark.isSelected
//
// if (binding.ivBookmark.isSelected) {
// binding.ivBookmark.setImageResource(R.mipmap.h_soucang_s)
// SpStringUtils.addSpString(SpStringUtils.BOOKMARK_KEY, documentBean.path)
// } else {
// binding.ivBookmark.setImageResource(R.mipmap.h_soucang_n)
// SpStringUtils.deleteSpString(SpStringUtils.BOOKMARK_KEY, documentBean.path)
// }
// }
// binding.llDetail.setOnClickListener {
// showDocumentDetail(documentBean.path)
// }
// binding.llShare.setOnClickListener {
// documentShare(documentBean)
// }
// binding.llJump.setOnClickListener {
// showJumpPageNumberDialog(pageNumber) { pageIndex ->
// dialog.dismiss()
// jumpAction?.invoke(pageIndex)
// }
// }
//
// }
fun Context.showJumpPageNumberDialog(pageNumber: Int, okAction: ((pageIndex: Int) -> Unit)?) {
val dialog = BottomSheetDialog(this, R.style.BottomSheetDialog)
val binding = DialogPageNumberBinding.inflate(LayoutInflater.from(this))
dialog.setContentView(binding.root)
dialog.setCanceledOnTouchOutside(false)
val window = dialog.window
window?.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE)
dialog.show()
val parentView = binding.root.parent as View
val behavior = BottomSheetBehavior.from(parentView)
//展开
behavior.state = BottomSheetBehavior.STATE_EXPANDED
binding.edit.filters = arrayOf(NumberRangeFilter(1, pageNumber + 1))
binding.edit.hint = "1 - ${pageNumber + 1}"
binding.edit.addTextChangedListener {
binding.tvOk.isEnabled = !it.isNullOrEmpty()
}
binding.edit.requestFocus()
binding.tvOk.setOnClickListener {
val number = binding.edit.text.toString()
if (number.isEmpty()) {
toast("number can't be empty!")
return@setOnClickListener
}
dialog.dismiss()
okAction?.invoke(number.toInt() - 1)
}
}
}
\ No newline at end of file
package com.base.pdfreaderallpdfreader.ui.view
import android.content.Context
import android.view.LayoutInflater
import android.view.View
import android.view.WindowManager
import androidx.core.widget.addTextChangedListener
import com.base.pdfreaderallpdfreader.R
import com.base.pdfreaderallpdfreader.databinding.DialogDocumentRenameBinding
import com.base.pdfreaderallpdfreader.utils.KotlinExt.toFormatTime2
import com.base.pdfreaderallpdfreader.utils.ToastUtils.toast
import com.google.android.material.bottomsheet.BottomSheetBehavior
import com.google.android.material.bottomsheet.BottomSheetDialog
object NameDialog {
/**
* 重命名
*/
fun Context.showDocumentRenameDialog(
name: String? = null,
okAction: ((newName: String) -> Unit)? = null,
dismissAction: (() -> Unit)? = null
) {
val dialog = BottomSheetDialog(this, R.style.BottomSheetDialog)
val binding = DialogDocumentRenameBinding.inflate(LayoutInflater.from(this))
dialog.setContentView(binding.root)
dialog.setCanceledOnTouchOutside(false)
val window = dialog.window
window?.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE)
dialog.show()
val parentView = binding.root.parent as View
val behavior = BottomSheetBehavior.from(parentView)
//展开
behavior.state = BottomSheetBehavior.STATE_EXPANDED
binding.edit.addTextChangedListener {
binding.tvOk.isEnabled = !it.isNullOrEmpty()
}
val tempName = "Split_" + System.currentTimeMillis().toFormatTime2()
binding.edit.setText(name ?: tempName)
if (name == null) {
binding.edit.selectAll()
} else {
val nameS = name.split(".")[0]
binding.edit.setSelection(0, nameS.length)
}
binding.edit.requestFocus()
binding.tvCancel.setOnClickListener {
dialog.dismiss()
}
binding.tvOk.setOnClickListener {
dialog.dismiss()
val newName = binding.edit.text.toString()
if (newName.isEmpty()) {
toast("name can't be empty!")
return@setOnClickListener
}
okAction?.invoke(newName)
}
dialog.setOnDismissListener {
dismissAction?.invoke()
}
}
}
\ No newline at end of file
package com.base.pdfreaderallpdfreader.ui.view
import android.annotation.SuppressLint
import android.app.Activity
import android.app.Dialog
import android.content.Context
import android.content.Intent
import android.text.method.PasswordTransformationMethod
import android.view.LayoutInflater
import android.view.View
import android.view.WindowManager
import androidx.core.content.FileProvider
import androidx.core.widget.addTextChangedListener
import com.base.pdfreaderallpdfreader.R
import com.base.pdfreaderallpdfreader.bean.ConstObject
import com.base.pdfreaderallpdfreader.databinding.DialogPageNumberBinding
import com.base.pdfreaderallpdfreader.databinding.DialogPdfMoreBinding
import com.base.pdfreaderallpdfreader.ui.pdf.PdfActivity
import com.base.pdfreaderallpdfreader.ui.pdf.PdfActivity.Companion.jumpMerge
import com.base.pdfreaderallpdfreader.ui.pdf.PdfActivity.Companion.jumpSplit
import com.base.pdfreaderallpdfreader.ui.view.DocumentDialog.showDocumentDetail
import com.base.pdfreaderallpdfreader.utils.IntentShareUtils
import com.base.pdfreaderallpdfreader.utils.LogEx
import com.base.pdfreaderallpdfreader.utils.NumberRangeFilter
import com.base.pdfreaderallpdfreader.utils.ToastUtils.toast
import com.google.android.material.bottomsheet.BottomSheetBehavior
import com.google.android.material.bottomsheet.BottomSheetDialog
import java.io.File
object PdfDialog {
// //pdf首页弹窗
// @SuppressLint("NotifyDataSetChanged")
// fun Context.showPdfHomeMoreDialog(
// item: DocumentBean,
// mainActivity: MainActivity,
// documentFragment: DocumentFragment,
// documentPageFragment: DocumentPageFragment,
// ): BottomSheetDialog {
// val dialog = BottomSheetDialog(this, R.style.BottomSheetDialog)
// val binding = DialogPdfHomeMoreBinding.inflate(LayoutInflater.from(this))
// dialog.setContentView(binding.root)
// dialog.setCanceledOnTouchOutside(false)
//
// dialog.show()
//
// val parentView = binding.root.parent as View
// val behavior = BottomSheetBehavior.from(parentView)
// //展开
// behavior.state = BottomSheetBehavior.STATE_EXPANDED
//
// 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.ivBookmark.setOnClickListener {
// item.isBookmarked = !item.isBookmarked
// if (item.isBookmarked) {
// binding.ivBookmark.setImageResource(R.mipmap.h_soucang_s)
// } else {
// binding.ivBookmark.setImageResource(R.mipmap.h_soucang_n)
// }
// mainActivity.mainPresenter.changeBookmark(item.path, item.isBookmarked, documentPageFragment)
//
// }
// binding.llRename.setOnClickListener {
// showDocumentRenameDialog(file.name, okAction = { newName ->
// dialog.dismiss()
// mainActivity.mainPresenter.renameDocumentBean(file, newName, documentPageFragment)
// })
// }
// binding.llSplit.setOnClickListener {
// dialog.dismiss()
// if (item.state == 1) {
// showPdfPwdDialog(
// state = item.state, path = item.path, firstDialog = dialog, isCheckPwd = true, verificationAction = {
// documentPageFragment.splitPdf(item.path, it)
// })
// } else {
// documentPageFragment.splitPdf(item.path)
// }
// }
// binding.llMerge.setOnClickListener {
// dialog.dismiss()
// documentPageFragment.mergePdf(item.path)
// }
// binding.llDelete.setOnClickListener {
// dialog.dismiss()
// showDeleteDialog {
// mainActivity.mainPresenter.deleteDocument(item.path, documentPageFragment)
// documentFragment.searchDeleteDocument(item)
// }
// }
// binding.llDetail.setOnClickListener {
// showDocumentDetail(item.path)
// }
// binding.llShare.setOnClickListener {
// val intent = IntentShareUtils.sharePdfIntent(item.uri)
// runCatching {
// startActivity(intent)
// }
// }
// if (item.state == 1) {
// binding.tvLock.text = getString(R.string.unlock_pdf)
// }
// if (item.state == 0) {
// binding.tvLock.text = getString(R.string.lock_pdf)
// }
// binding.llLock.setOnClickListener {
// showPdfPwdDialog(state = item.state, path = item.path,
// firstDialog = dialog,
// isCheckPwd = false,
// encryptionAction = {
// dialog.dismiss()
// mainActivity.mainPresenter.changePdfLock(item, documentPageFragment)
// })
// }
// dialog.setOnDismissListener {
// }
// return dialog
// }
fun Activity.showPdfMoreDialog(
pdfActivity: PdfActivity,
pageNumber: Int,
pafPath: String,
) {
val dialog = BottomSheetDialog(this, R.style.BottomSheetDialog)
val binding = DialogPdfMoreBinding.inflate(LayoutInflater.from(this))
dialog.setContentView(binding.root)
dialog.setCanceledOnTouchOutside(false)
dialog.show()
val parentView = binding.root.parent as View
val behavior = BottomSheetBehavior.from(parentView)
//展开
behavior.state = BottomSheetBehavior.STATE_EXPANDED
binding.llJump.setOnClickListener {
showJumpPageNumberDialog(pageNumber) { pageIndex ->
dialog.dismiss()
pdfActivity.jumpPage(pageIndex)
}
}
binding.llMerge.setOnClickListener {
dialog.dismiss()
jumpMerge(pdfActivity)
}
binding.llSplit.setOnClickListener {
dialog.dismiss()
jumpSplit(pdfActivity)
}
binding.llDetail.setOnClickListener {
showDocumentDetail(pafPath)
}
binding.llShare.setOnClickListener {
dialog.dismiss()
runCatching {
val pkg = this.packageName
LogEx.logDebug("showPdfMoreDialog", "pkg=$pkg")
val uri = FileProvider.getUriForFile(
this, this.packageName + ".provider", File(pafPath)
)
startActivity(Intent.createChooser(IntentShareUtils.sharePdfIntent(uri), "Share PDF"))
}
}
}
// @SuppressLint("SetTextI18n")
// fun Context.showPdfPwdDialog(
// state: Int,
// path: String = "",
// uri: String? = null,
// firstDialog: Dialog? = null,
// isCheckPwd: Boolean = false,
// verificationAction: ((pwd: String) -> Unit)? = null,
// encryptionAction: (() -> Unit)? = null,
// cancelAction: (() -> Unit)? = null,
// ) {
// val dialog = BottomSheetDialog(this, R.style.BottomSheetDialog)
// val binding = DialogPdfPasswordBinding.inflate(LayoutInflater.from(this))
// dialog.setContentView(binding.root)
// dialog.setCanceledOnTouchOutside(false)
//
// val window = dialog.window
// window?.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE)
//
// dialog.show()
//
// val parentView = binding.root.parent as View
// val behavior = BottomSheetBehavior.from(parentView)
// //展开
// behavior.state = BottomSheetBehavior.STATE_EXPANDED
//
// if (!isCheckPwd) {
// if (state == 1) {
// binding.tvTittle.text = getString(R.string.delete_password)
// binding.tvTip.text = getString(R.string.delete_password_the_file_is_not_password_protected)
// }
// if (state == 0) {
// binding.tvTittle.text = getString(R.string.set_password)
// binding.tvTip.text = getString(R.string.set_password_protection_pdf)
//
// }
// } else {
// binding.tvTittle.text = getString(R.string.input_password)
// val file = File(path)
// binding.tvTip.text = getString(R.string.password_protected, file.name)
// binding.tvInputTip.visibility = View.VISIBLE
// }
//
// binding.edit.requestFocus()
// binding.edit.addTextChangedListener {
// binding.tvConfirm.isEnabled = it.toString().isNotEmpty()
// binding.tvErrorTip.visibility = View.GONE
// }
//
// binding.tvCancel.setOnClickListener {
// dialog.dismiss()
// cancelAction?.invoke()
// }
// binding.tvConfirm.setOnClickListener {
//
// val pwd = binding.edit.text.toString()
//
// if (!isCheckPwd) {
//
// //加锁逻辑
// if (state == 0) {
// PdfBoxUtils.setPassword(path, pwd, pwd)
// toast("Success Encryption")
// encryptionAction?.invoke()
// dialog.dismiss()
// firstDialog?.dismiss()
// }
// //解锁逻辑
// if (state == 1) {
// val result = PdfBoxUtils.checkPwd(path, pwd, uri)
// LogEx.logDebug("checkPwd", "result=$result")
// if (result) {
// PdfBoxUtils.clearPassword(path, pwd)
// toast("clear Encryption")
// encryptionAction?.invoke()
// dialog.dismiss()
// firstDialog?.dismiss()
// } else {
// binding.tvErrorTip.visibility = View.VISIBLE
// }
// }
// } else {
// //验证密码逻辑
// val result = PdfBoxUtils.checkPwd(path, pwd, uri)
// if (!result) {
// binding.tvErrorTip.visibility = View.VISIBLE
// return@setOnClickListener
// }
// dialog.dismiss()
// firstDialog?.dismiss()
// verificationAction?.invoke(pwd)
// }
//
// }
// binding.ivEye.setOnClickListener {
//
// if (binding.edit.transformationMethod == null) {
// // 隐藏密码
// binding.edit.transformationMethod = PasswordTransformationMethod()
// binding.ivEye.setImageResource(R.mipmap.weishuru)
// } else {
// // 显示密码
// binding.edit.transformationMethod = null
// binding.ivEye.setImageResource(R.mipmap.yishuru)
// }
// }
//
// }
fun Context.showJumpPageNumberDialog(pageNumber: Int, okAction: ((pageIndex: Int) -> Unit)?) {
val dialog = BottomSheetDialog(this, R.style.BottomSheetDialog)
val binding = DialogPageNumberBinding.inflate(LayoutInflater.from(this))
dialog.setContentView(binding.root)
dialog.setCanceledOnTouchOutside(false)
val window = dialog.window
window?.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE)
dialog.show()
val parentView = binding.root.parent as View
val behavior = BottomSheetBehavior.from(parentView)
//展开
behavior.state = BottomSheetBehavior.STATE_EXPANDED
binding.edit.filters = arrayOf(NumberRangeFilter(1, pageNumber + 1))
binding.edit.hint = "1 - ${pageNumber + 1}"
binding.edit.addTextChangedListener {
binding.tvOk.isEnabled = !it.isNullOrEmpty()
}
binding.edit.requestFocus()
binding.tvOk.setOnClickListener {
val number = binding.edit.text.toString()
if (number.isEmpty()) {
toast("number can't be empty!")
return@setOnClickListener
}
dialog.dismiss()
okAction?.invoke(number.toInt() - 1)
}
}
}
\ No newline at end of file
package com.base.pdfreaderallpdfreader.ui.view
import android.annotation.SuppressLint
import android.app.Dialog
import android.content.Context
import android.text.method.PasswordTransformationMethod
import android.view.LayoutInflater
import android.view.View
import android.view.WindowManager
import androidx.core.widget.addTextChangedListener
import com.base.pdfreaderallpdfreader.R
import com.base.pdfreaderallpdfreader.databinding.DialogPdfPasswordBinding
import com.base.pdfreaderallpdfreader.utils.LogEx
import com.base.pdfreaderallpdfreader.utils.PdfBoxUtils
import com.base.pdfreaderallpdfreader.utils.PdfBoxUtils.checkPwd
import com.base.pdfreaderallpdfreader.utils.ToastUtils.toast
import com.google.android.material.bottomsheet.BottomSheetBehavior
import com.google.android.material.bottomsheet.BottomSheetDialog
import java.io.File
object PwdDialog {
@SuppressLint("SetTextI18n")
fun Context.showPdfPwdDialog(
state: Int,
path: String = "",
uri: String? = null,
firstDialog: Dialog? = null,
isCheckPwd: Boolean = false,
verificationAction: ((pwd: String) -> Unit)? = null,
encryptionAction: (() -> Unit)? = null,
cancelAction: (() -> Unit)? = null,
) {
val dialog = BottomSheetDialog(this, R.style.BottomSheetDialog)
val binding = DialogPdfPasswordBinding.inflate(LayoutInflater.from(this))
dialog.setContentView(binding.root)
dialog.setCanceledOnTouchOutside(false)
val window = dialog.window
window?.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE)
dialog.show()
val parentView = binding.root.parent as View
val behavior = BottomSheetBehavior.from(parentView)
//展开
behavior.state = BottomSheetBehavior.STATE_EXPANDED
if (!isCheckPwd) {
if (state == 1) {
binding.tvTittle.text = getString(R.string.delete_password)
binding.tvTip.text = getString(R.string.delete_password_the_file_is_not_password_protected)
}
if (state == 0) {
binding.tvTittle.text = getString(R.string.set_password)
binding.tvTip.text = getString(R.string.set_password_protection_pdf)
}
} else {
binding.tvTittle.text = getString(R.string.input_password)
val file = File(path)
binding.tvTip.text = getString(R.string.password_protected, file.name)
binding.tvInputTip.visibility = View.VISIBLE
}
binding.edit.requestFocus()
binding.edit.addTextChangedListener {
binding.tvConfirm.isEnabled = it.toString().isNotEmpty()
binding.tvErrorTip.visibility = View.GONE
}
binding.tvCancel.setOnClickListener {
dialog.dismiss()
cancelAction?.invoke()
}
binding.tvConfirm.setOnClickListener {
val pwd = binding.edit.text.toString()
if (!isCheckPwd) {
//加锁逻辑
if (state == 0) {
PdfBoxUtils.setPassword(path, pwd, pwd)
toast("Success Encryption")
encryptionAction?.invoke()
dialog.dismiss()
firstDialog?.dismiss()
}
//解锁逻辑
if (state == 1) {
val result = checkPwd(path, pwd, uri)
LogEx.logDebug("checkPwd", "result=$result")
if (result) {
PdfBoxUtils.clearPassword(path, pwd)
toast("clear Encryption")
encryptionAction?.invoke()
dialog.dismiss()
firstDialog?.dismiss()
} else {
binding.tvErrorTip.visibility = View.VISIBLE
}
}
} else {
//验证密码逻辑
val result = checkPwd(path, pwd, uri)
if (!result) {
binding.tvErrorTip.visibility = View.VISIBLE
return@setOnClickListener
}
dialog.dismiss()
firstDialog?.dismiss()
verificationAction?.invoke(pwd)
}
}
binding.ivEye.setOnClickListener {
if (binding.edit.transformationMethod == null) {
// 隐藏密码
binding.edit.transformationMethod = PasswordTransformationMethod()
binding.ivEye.setImageResource(R.mipmap.weishuru)
} else {
// 显示密码
binding.edit.transformationMethod = null
binding.ivEye.setImageResource(R.mipmap.yishuru)
}
}
}
}
\ No newline at end of file
@file:Suppress("unused", "MemberVisibilityCanBePrivate")
package com.base.pdfreaderallpdfreader.ui.view
import android.annotation.SuppressLint
import android.content.Context
import android.content.res.ColorStateList
import android.graphics.Color
import android.graphics.drawable.Drawable
import android.graphics.drawable.GradientDrawable
import android.util.AttributeSet
import android.util.DisplayMetrics
import android.view.MotionEvent
import android.view.View
import android.widget.FrameLayout
import android.widget.ImageView
import androidx.cardview.widget.CardView
import androidx.core.view.ViewCompat
import com.base.pdfreaderallpdfreader.R
import com.base.pdfreaderallpdfreader.utils.LogEx
import kotlin.math.max
import kotlin.math.roundToInt
/**
* A nicer, redesigned and vertical SeekBar
* copy from:
* https://github.com/lukelorusso/VerticalSeekBar
*
*/
class VerticalSeekBar : FrameLayout {
private val TAG = "VerticalSeekBar"
constructor(context: Context) : super(context) {
LogEx.logDebug(TAG, "init1")
initAttributes(context, null)
}
constructor(context: Context, attrs: AttributeSet?) : super(context, attrs) {
LogEx.logDebug(TAG, "init2")
initAttributes(context, attrs)
}
constructor(context: Context, attrs: AttributeSet?, defStyleAttr: Int) : super(context, attrs, defStyleAttr) {
LogEx.logDebug(TAG, "init3")
initAttributes(context, attrs)
}
companion object {
private const val DEFAULT_MAX_VALUE = 100
private const val DEFAULT_PROGRESS = 50
private const val DEFAULT_DRAWABLE_BACKGROUND: String = "#00000000"
private const val DEFAULT_DRAWABLE_PROGRESS_START: String = "#00000000"
private const val DEFAULT_DRAWABLE_PROGRESS_END: String = "#00000000"
}
enum class Placeholder {
OUTSIDE,
INSIDE,
MIDDLE
}
private var onProgressChangeListener: ((Int) -> Unit)? = null
private var onPressListener: ((Int) -> Unit)? = null
private var onReleaseListener: ((Int) -> Unit)? = null
var clickToSetProgress = true
set(value) {
field = value
applyAttributes()
}
var barCornerRadius: Int = 0
set(value) {
field = value
applyAttributes()
}
var barBackgroundDrawable: Drawable? = null
set(value) {
field = value
applyAttributes()
}
var barBackgroundStartColor: Int = Color.parseColor(DEFAULT_DRAWABLE_BACKGROUND)
set(value) {
field = value
barBackgroundDrawable = null
applyAttributes()
}
var barBackgroundEndColor: Int = Color.parseColor(DEFAULT_DRAWABLE_BACKGROUND)
set(value) {
field = value
barBackgroundDrawable = null
applyAttributes()
}
var barProgressDrawable: Drawable? = null
set(value) {
field = value
applyAttributes()
}
var barProgressStartColor: Int = Color.parseColor(DEFAULT_DRAWABLE_PROGRESS_START)
set(value) {
field = value
barProgressDrawable = null
applyAttributes()
}
var barProgressEndColor: Int = Color.parseColor(DEFAULT_DRAWABLE_PROGRESS_END)
set(value) {
field = value
barProgressDrawable = null
applyAttributes()
}
var barWidth: Int? = null
set(value) {
field = value
applyAttributes()
}
var minLayoutWidth: Int = 0
set(value) {
field = value
applyAttributes()
}
var minLayoutHeight: Int = 0
set(value) {
field = value
applyAttributes()
}
var maxPlaceholderDrawable: Drawable? = null
set(value) {
field = value
applyAttributes()
}
var maxPlaceholderPosition = Placeholder.MIDDLE
set(value) {
field = value
applyAttributes()
}
var minPlaceholderDrawable: Drawable? = null
set(value) {
field = value
applyAttributes()
}
var minPlaceholderPosition = Placeholder.MIDDLE
set(value) {
field = value
applyAttributes()
}
var showThumb = true
set(value) {
field = value
applyAttributes()
}
var thumbContainerColor: Int = Color.WHITE
set(value) {
field = value
applyAttributes()
}
var thumbContainerCornerRadius: Int = 0
set(value) {
field = value
applyAttributes()
}
var thumbPlaceholderDrawable: Drawable? = null
set(value) {
field = value
applyAttributes()
}
var useThumbToSetProgress = true
set(value) {
field = value
applyAttributes()
}
var maxValue = DEFAULT_MAX_VALUE
set(value) {
val newValue = when {
value < 1 -> 1
else -> value
}
if (progress > newValue) progress = newValue
field = newValue
updateViews()
}
var progress: Int = DEFAULT_PROGRESS
set(value) {
val newValue = when {
value < 0 -> 0
value > maxValue -> maxValue
else -> value
}
if (field != newValue) {
onProgressChangeListener?.invoke(newValue)
}
field = newValue
updateViews()
}
private var yDelta: Int = 0
private var initEnded =
false // if true allows the view to be updated after setting an attribute programmatically
lateinit var container: FrameLayout
lateinit var thumb: FrameLayout
lateinit var barCardView: CardView
lateinit var barBackground: View
lateinit var barProgress: View
lateinit var maxPlaceholder: ImageView
lateinit var minPlaceholder: ImageView
private fun initAttributes(context: Context, attrs: AttributeSet?) {
val view = inflate(context, R.layout.layout_verticalseekbar, this)
container = findViewById(R.id.container)
thumb = findViewById(R.id.thumb)
barCardView = findViewById(R.id.barCardView)
barBackground = findViewById(R.id.barBackground)
barProgress = findViewById(R.id.barProgress)
maxPlaceholder = findViewById(R.id.maxPlaceholder)
minPlaceholder = findViewById(R.id.minPlaceholder)
if (attrs != null) {
val attributes =
context.obtainStyledAttributes(attrs, R.styleable.VerticalSeekBar, 0, 0)
LogEx.logDebug(TAG, "attributes=$attributes")
try {
clickToSetProgress =
attributes.getBoolean(
R.styleable.VerticalSeekBar_vsb_click_to_set_progress,
clickToSetProgress
)
barCornerRadius = attributes.getLayoutDimension(
R.styleable.VerticalSeekBar_vsb_bar_corner_radius,
barCornerRadius
)
barBackgroundStartColor =
attributes.getColor(
R.styleable.VerticalSeekBar_vsb_bar_background_gradient_start,
barBackgroundStartColor
)
barBackgroundEndColor =
attributes.getColor(
R.styleable.VerticalSeekBar_vsb_bar_background_gradient_end,
barBackgroundEndColor
)
attributes.getDrawable(R.styleable.VerticalSeekBar_vsb_bar_background)?.also {
barBackgroundDrawable = it
}
barProgressStartColor =
attributes.getColor(
R.styleable.VerticalSeekBar_vsb_bar_progress_gradient_start,
barProgressStartColor
)
barProgressEndColor =
attributes.getColor(
R.styleable.VerticalSeekBar_vsb_bar_progress_gradient_end,
barProgressEndColor
)
attributes.getDrawable(R.styleable.VerticalSeekBar_vsb_bar_progress).also {
barProgressDrawable = it
}
barWidth = attributes.getDimensionPixelSize(
R.styleable.VerticalSeekBar_vsb_bar_width,
barWidth ?: container.layoutParams.width
)
attributes.getLayoutDimension(
R.styleable.VerticalSeekBar_android_layout_width,
minLayoutWidth
).also {
container.layoutParams.width =
if (it != -1 && it < minLayoutWidth) minLayoutWidth // wrap_content
else it
}
attributes.getLayoutDimension(
R.styleable.VerticalSeekBar_android_layout_height,
minLayoutHeight
).also {
container.layoutParams.height =
if (it != -1 && it < minLayoutHeight) minLayoutHeight // wrap_content
else it
}
attributes.getDrawable(R.styleable.VerticalSeekBar_vsb_max_placeholder_src).also {
maxPlaceholderDrawable = it
}
maxPlaceholderPosition = Placeholder.values()[attributes.getInt(
R.styleable.VerticalSeekBar_vsb_max_placeholder_position,
maxPlaceholderPosition.ordinal
)]
attributes.getDrawable(R.styleable.VerticalSeekBar_vsb_min_placeholder_src).also {
minPlaceholderDrawable = it
}
minPlaceholderPosition = Placeholder.values()[attributes.getInt(
R.styleable.VerticalSeekBar_vsb_min_placeholder_position,
minPlaceholderPosition.ordinal
)]
showThumb =
attributes.getBoolean(R.styleable.VerticalSeekBar_vsb_show_thumb, showThumb)
thumbContainerColor =
attributes.getColor(
R.styleable.VerticalSeekBar_vsb_thumb_container_tint,
thumbContainerColor
)
thumbContainerCornerRadius = attributes.getLayoutDimension(
R.styleable.VerticalSeekBar_vsb_thumb_container_corner_radius,
thumbContainerCornerRadius
)
attributes.getDrawable(R.styleable.VerticalSeekBar_vsb_thumb_placeholder_src).also {
thumbPlaceholderDrawable = it
}
attributes.getInt(R.styleable.VerticalSeekBar_vsb_max_value, maxValue).also {
maxValue = it
}
attributes.getInt(R.styleable.VerticalSeekBar_vsb_progress, progress).also {
progress = it
}
useThumbToSetProgress =
attributes.getBoolean(
R.styleable.VerticalSeekBar_vsb_use_thumb_to_set_progress,
useThumbToSetProgress
)
} finally {
attributes.recycle()
}
}
initEnded = true
applyAttributes()
}
fun setOnProgressChangeListener(listener: ((Int) -> Unit)?) {
this.onProgressChangeListener = listener
}
fun setOnPressListener(listener: ((Int) -> Unit)?) {
this.onPressListener = listener
}
fun setOnReleaseListener(listener: ((Int) -> Unit)?) {
this.onReleaseListener = listener
}
//region PROTECTED METHODS
protected fun Context.dpToPixel(dp: Float): Float =
dp * (resources.displayMetrics.densityDpi.toFloat() / DisplayMetrics.DENSITY_DEFAULT)
protected fun Context.pixelToDp(px: Float): Float =
px / (resources.displayMetrics.densityDpi.toFloat() / DisplayMetrics.DENSITY_DEFAULT)
//endregion
@SuppressLint("ClickableViewAccessibility")
private fun applyAttributes() {
if (initEnded) {
initEnded = false // will be released at the end
var thumbCardView: CardView? = null // nullable for customization
try {
thumbCardView = thumb.findViewById(R.id.thumbCardView)
} catch (ignored: NoSuchFieldError) {
}
var thumbPlaceholder: ImageView? = null // nullable for customization
try {
thumbPlaceholder = findViewById<FrameLayout>(R.id.thumb).findViewById(R.id.thumbPlaceholder)
} catch (ignored: NoSuchFieldError) {
}
// Customizing drawableCardView
barCardView.layoutParams.width = barWidth ?: 0
// Customizing drawableBackground
if (barBackgroundDrawable == null) barBackgroundDrawable = GradientDrawable(
GradientDrawable.Orientation.TOP_BOTTOM,
intArrayOf(barBackgroundStartColor, barBackgroundEndColor)
).apply { cornerRadius = 0f }
barBackground.background = barBackgroundDrawable
// Customizing drawableProgress
if (barProgressDrawable == null) barProgressDrawable = GradientDrawable(
GradientDrawable.Orientation.TOP_BOTTOM,
intArrayOf(barProgressStartColor, barProgressEndColor)
).apply { cornerRadius = 0f }
barProgress.background = barProgressDrawable
// Applying card corner radius
barCardView.radius = barCornerRadius.toFloat()
thumbCardView?.radius = thumbContainerCornerRadius.toFloat()
// Applying custom placeholders
maxPlaceholder.setImageDrawable(maxPlaceholderDrawable) // can also be null
minPlaceholder.setImageDrawable(minPlaceholderDrawable) // can also be null
// Let's shape the thumb
val thumbMeasureIncrease =
if (thumbCardView != null) (ViewCompat.getElevation(thumbCardView)
+ context.dpToPixel(1F)).roundToInt()
else 0
if (showThumb) {
thumbPlaceholderDrawable?.also { thumbPlaceholder?.setImageDrawable(it) } // CANNOT be null
thumb.visibility = View.VISIBLE
val states = arrayOf(
intArrayOf(android.R.attr.state_enabled), // enabled
intArrayOf(-android.R.attr.state_enabled), // disabled
intArrayOf(-android.R.attr.state_checked), // unchecked
intArrayOf(android.R.attr.state_pressed) // pressed
)
val colors = arrayOf(
thumbContainerColor,
thumbContainerColor,
thumbContainerColor,
thumbContainerColor
).toIntArray()
if (thumbCardView != null)
ViewCompat.setBackgroundTintList(thumbCardView, ColorStateList(states, colors))
thumb.measure(0, 0)
thumb.layoutParams = (thumb.layoutParams as LayoutParams).apply {
width = thumb.measuredWidth + thumbMeasureIncrease
height = thumb.measuredHeight + thumbMeasureIncrease
thumbCardView?.layoutParams =
(thumbCardView?.layoutParams as LayoutParams).apply {
topMargin = thumbMeasureIncrease / 2
}
}
} else thumb.visibility = View.GONE
// Adding some margin to drawableCardView, maxPlaceholder and minPlaceholder
val maxPlaceholderLayoutParams = (maxPlaceholder.layoutParams as LayoutParams)
val minPlaceholderLayoutParams = (minPlaceholder.layoutParams as LayoutParams)
barCardView.layoutParams = (barCardView.layoutParams as LayoutParams).apply {
val thumbHalfHeight =
if (showThumb) thumb.measuredHeight / 2
else 0
val maxPlaceholderHalfHeight = (maxPlaceholder.drawable?.intrinsicHeight ?: 0) / 2
when (maxPlaceholderPosition) {
Placeholder.INSIDE -> {
topMargin = thumbHalfHeight
maxPlaceholderLayoutParams.topMargin = topMargin
}
Placeholder.OUTSIDE -> {
topMargin = maxPlaceholder.drawable.intrinsicHeight +
if (thumbHalfHeight > maxPlaceholder.drawable.intrinsicHeight)
thumbHalfHeight - maxPlaceholder.drawable.intrinsicHeight
else 0
maxPlaceholderLayoutParams.topMargin =
topMargin - maxPlaceholder.drawable.intrinsicHeight
}
else -> {
topMargin = max(thumbHalfHeight, maxPlaceholderHalfHeight)
maxPlaceholderLayoutParams.topMargin = topMargin - maxPlaceholderHalfHeight
}
}
maxPlaceholderLayoutParams.bottomMargin = maxPlaceholderLayoutParams.topMargin
maxPlaceholder.layoutParams = maxPlaceholderLayoutParams
val minPlaceholderHalfHeight = (minPlaceholder.drawable?.intrinsicHeight ?: 0) / 2
when (minPlaceholderPosition) {
Placeholder.INSIDE -> {
bottomMargin = thumbHalfHeight
minPlaceholderLayoutParams.bottomMargin = bottomMargin
}
Placeholder.OUTSIDE -> {
bottomMargin = minPlaceholder.drawable.intrinsicHeight +
if (thumbHalfHeight > minPlaceholder.drawable.intrinsicHeight)
thumbHalfHeight - minPlaceholder.drawable.intrinsicHeight
else 0
minPlaceholderLayoutParams.bottomMargin =
bottomMargin - minPlaceholder.drawable.intrinsicHeight
}
else -> {
bottomMargin = max(thumbHalfHeight, minPlaceholderHalfHeight)
minPlaceholderLayoutParams.bottomMargin =
bottomMargin - minPlaceholderHalfHeight
}
}
bottomMargin += thumbMeasureIncrease
minPlaceholderLayoutParams.bottomMargin += thumbMeasureIncrease
minPlaceholderLayoutParams.topMargin = maxPlaceholderLayoutParams.bottomMargin
minPlaceholder.layoutParams = minPlaceholderLayoutParams
}
// here we intercept the click on the thumb
if (showThumb && useThumbToSetProgress) thumb.setOnTouchListener { thumb, event ->
val rawY = event.rawY.roundToInt()
when (event.action and MotionEvent.ACTION_MASK) {
MotionEvent.ACTION_DOWN -> { // here we get the max top y coordinate (yDelta)
yDelta = rawY +
(barCardView.layoutParams as LayoutParams).topMargin -
(thumb.layoutParams as LayoutParams).topMargin -
thumb.measuredHeight / 2
onPressListener?.invoke(progress)
}
MotionEvent.ACTION_MOVE -> {
val positionY = rawY - yDelta // here we calculate the displacement
val fillHeight = barCardView.measuredHeight
when { // here we update progress
positionY in 1 until fillHeight -> {
val newValue =
maxValue - (positionY.toFloat() * maxValue / fillHeight)
progress = newValue.roundToInt()
}
positionY <= 0 -> progress = maxValue
positionY >= fillHeight -> progress = 0
}
}
MotionEvent.ACTION_UP -> onReleaseListener?.invoke(progress)
}
true
} else thumb.setOnTouchListener(null)
// here we intercept the click on the bar
if (clickToSetProgress) barCardView.setOnTouchListener { bar, event ->
val positionY = event.y.roundToInt()
val action = {
val fillHeight = bar.measuredHeight
when { // here we update progress
positionY in 1 until fillHeight -> {
val newValue = maxValue - (positionY.toFloat() * maxValue / fillHeight)
progress = newValue.roundToInt()
}
positionY <= 0 -> progress = maxValue
positionY >= fillHeight -> progress = 0
}
}
when (event.action and MotionEvent.ACTION_MASK) {
MotionEvent.ACTION_DOWN -> {
action.invoke()
onPressListener?.invoke(progress)
}
MotionEvent.ACTION_MOVE -> if (useThumbToSetProgress) action.invoke()
MotionEvent.ACTION_UP -> onReleaseListener?.invoke(progress)
}
true
} else barCardView.setOnTouchListener(null)
initEnded = true
updateViews()
}
}
/**
* Inside here the views are repositioned based on the new value
*/
private fun updateViews() {
if (initEnded) post {
val barCardViewLayoutParams = barCardView.layoutParams as LayoutParams
val fillHeight =
height - barCardViewLayoutParams.topMargin - barCardViewLayoutParams.bottomMargin
val marginByProgress = fillHeight - (progress * fillHeight / maxValue)
thumb.layoutParams = (thumb.layoutParams as LayoutParams).apply {
topMargin = marginByProgress
val thumbHalfHeight = if (showThumb) thumb.measuredHeight / 2 else 0
if (barCardViewLayoutParams.topMargin > thumbHalfHeight) {
val displacement = barCardViewLayoutParams.topMargin - thumbHalfHeight
topMargin += displacement
}
}
barProgress.translationY =
(barBackground.height * (maxValue - progress) / maxValue).toFloat()
invalidate()
}
}
}
package com.base.pdfreaderallpdfreader.utils
import android.content.Context
import android.content.Intent
import android.net.Uri
import androidx.core.content.FileProvider
import com.base.pdfreaderallpdfreader.R
import com.base.pdfreaderallpdfreader.bean.DocumentBean
import com.base.pdfreaderallpdfreader.bean.DocumentBean.Companion.TYPE_PDF
import java.io.File
object IntentShareUtils {
fun Context.documentShare(documentBean: DocumentBean) {
val uri = FileProvider.getUriForFile(
this, this.packageName + ".provider", File(documentBean.path)
)
var intent: Intent? = null
var desc = getString(R.string.share_pdf)
if (documentBean.type == DocumentBean.TYPE_PPT) {
intent = sharePptIntent(uri)
desc = getString(R.string.share_ppt)
}
if (documentBean.type == DocumentBean.TYPE_WORD) {
intent = shareWordIntent(uri)
desc = getString(R.string.share_word)
}
if (documentBean.type == DocumentBean.TYPE_EXCEL) {
intent = shareExcelIntent(uri)
desc = getString(R.string.share_excel)
}
intent?.let { startActivity(Intent.createChooser(it, desc)) }
}
fun sharePdfIntent(uri: Uri): Intent {
val shareIntent = Intent().apply {
action = Intent.ACTION_SEND
putExtra(Intent.EXTRA_STREAM, uri)
type = "application/pdf"
addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION) // 授权临时权限
}
return shareIntent
}
fun sharePptIntent(uri: Uri): Intent {
val shareIntent = Intent().apply {
action = Intent.ACTION_SEND
putExtra(Intent.EXTRA_STREAM, uri)
type = "application/vnd.ms-powerpoint"
addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION) // 授权临时权限
}
return shareIntent
}
fun shareWordIntent(uri: Uri): Intent {
val shareIntent = Intent().apply {
action = Intent.ACTION_SEND
putExtra(Intent.EXTRA_STREAM, uri)
type = "application/msword"
addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION) // 授权临时权限
}
return shareIntent
}
fun shareExcelIntent(uri: Uri): Intent {
val shareIntent = Intent().apply {
action = Intent.ACTION_SEND
putExtra(Intent.EXTRA_STREAM, uri)
type = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION) // 授权临时权限
}
return shareIntent
}
fun sharePdfPrintIntent(uri: Uri): Intent {
// 创建打印的 Intent
val intent = Intent(Intent.ACTION_SEND)
intent.setDataAndType(uri, "application/pdf")
// 启动打印服务
intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION)
return intent
}
fun Context.shareMutDocuments(
type: String, uris: ArrayList<Uri>
) {
var desc = "Share PDF files"
val intent = when (type) {
TYPE_PDF -> {
shareMutPdfIntent(uris)
}
else -> shareMutPdfIntent(uris)
}
val chooserIntent = Intent.createChooser(intent, desc)
startActivity(chooserIntent)
}
fun shareMutPdfIntent(uris: ArrayList<Uri>): Intent {
val shareIntent = Intent().apply {
action = Intent.ACTION_SEND_MULTIPLE
type = "application/pdf"
addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION) // 授权临时权限
putParcelableArrayListExtra(Intent.EXTRA_STREAM, uris)
}
return shareIntent
}
}
\ No newline at end of file
package com.base.pdfreaderallpdfreader.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
package com.base.pdfreaderallpdfreader.utils
import android.text.InputFilter
import android.text.Spanned
class NumberRangeFilter(private val min: Int, private val max: Int) : InputFilter {
override fun filter(source: CharSequence, start: Int, end: Int, dest: Spanned, dstart: Int, dend: Int): CharSequence? {
try {
val input = dest.subSequence(0, dstart).toString() + source.toString() + dest.subSequence(dend, dest.length)
val numericValue = input.toIntOrNull()
if (numericValue != null && numericValue in min..max) {
return null // 允许输入
}
} catch (nfe: NumberFormatException) {
// 如果输入不是数字,则忽略
}
return "" // 拒绝输入
}
}
\ No newline at end of file
...@@ -24,14 +24,13 @@ object PdfBoxUtils { ...@@ -24,14 +24,13 @@ object PdfBoxUtils {
private val TAG = "PdfUtils" private val TAG = "PdfUtils"
fun Context.getNumberOfPages(filePath: String, password: String? = null, uri: String? = null): Int { fun getNumberOfPages(context: Context, filePath: String, password: String? = null, uri: String? = null): Int {
val document = val document = context.loadPDDocument(path = filePath, password, uri)
loadPDDocument(path = filePath, password, uri)
return document.numberOfPages return document.numberOfPages
} }
fun Context.getPdfDrawablePage( fun getPdfDrawablePage(
context: Context, context: Context,
filePath: String, filePath: String,
password: String? = null, password: String? = null,
...@@ -39,7 +38,7 @@ object PdfBoxUtils { ...@@ -39,7 +38,7 @@ object PdfBoxUtils {
pageIndex: Int, pageIndex: Int,
scale: Float = 1f, scale: Float = 1f,
): Drawable { ): Drawable {
val document = loadPDDocument(filePath, password, uri) val document = context.loadPDDocument(filePath, password, uri)
val renderer = PDFRenderer(document) val renderer = PDFRenderer(document)
val bitmap: Bitmap = renderer.renderImage(pageIndex, scale, ImageType.RGB, RenderDestination.EXPORT) val bitmap: Bitmap = renderer.renderImage(pageIndex, scale, ImageType.RGB, RenderDestination.EXPORT)
......
package com.base.pdfreaderallpdfreader.utils
import android.content.Context
import android.widget.Toast
object ToastUtils {
fun Context.toast(content: String) {
Toast.makeText(this, content, Toast.LENGTH_SHORT).show()
}
}
\ 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" />
<corners android:radius="10dp" />
</shape>
\ 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"/>
<corners android:radius="4dp"/>
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="5dp" />
<solid android:color="#54585B" />
</shape>
\ 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="#7FDCEE"/>
<corners android:radius="10dp"/>
</shape>
\ 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="#9699A2" />
<corners android:radius="4dp" />
</shape>
\ 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="#B3000000" />
<corners android:radius="10dp" />
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="oval">
<solid android:color="#C0C0C0" />
</shape>
\ 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="#F1F2F6"/>
<corners android:radius="10dp"/>
</shape>
\ 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="#F3F3F3" />
<corners
android:topLeftRadius="25dp"
android:topRightRadius="25dp" />
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="10dp" />
<solid android:color="#F8F9FE" />
</shape>
\ 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="#FB2B39" />
<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="true" />
<item android:drawable="@drawable/bg_7fdcee_10" android:state_enabled="false" />
</selector>
\ 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_stoke_00bbde_5" android:state_selected="true"/>
<item android:drawable="@drawable/bg_stoke_cfcfcf_5" android:state_selected="false"/>
</selector>
\ 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:state_selected="true" android:drawable="@drawable/bg_00b8de_4"/>
<item android:state_selected="false" android:drawable="@drawable/bg_9699a2_4"/>
</selector>
\ 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="@mipmap/xuan" android:state_selected="true" />
<item android:drawable="@mipmap/weixuan" android:state_selected="false" />
</selector>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<stroke
android:width="1dp"
android:color="#00B8DE" />
<corners android:radius="5dp" />
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<stroke
android:width="0.5dp"
android:color="#BABABA" />
<corners android:radius="10dp" />
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<stroke
android:width="1dp"
android:color="#CFCFCF" />
<corners android:radius="5dp" />
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<!-- 设置背景色 -->
<item android:id="@android:id/background">
<shape>
<solid android:color="#3300B8DE" />
<corners android:radius="2.5dp" />
</shape>
</item>
<!-- 设置进度条颜色 -->
<!-- <item android:id="@android:id/progress">-->
<!-- <scale android:scaleWidth="100%">-->
<!-- <clip>-->
<!-- <shape>-->
<!-- <corners android:radius="2.5dp" />-->
<!-- <solid android:color="#00B8DE" />-->
<!-- </shape>-->
<!-- </clip>-->
<!-- </scale>-->
<!-- </item>-->
</layer-list>
\ 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">
<FrameLayout
android:layout_width="match_parent"
android:layout_height="0dp"
app:layout_constraintBottom_toTopOf="@id/v_animator_bottom"
app:layout_constraintTop_toBottomOf="@id/v_animator_top">
<com.artifex.mupdfdemo.MuPDFReaderView
android:id="@+id/mupdf_reader_view"
android:layout_width="match_parent"
android:layout_height="match_parent">
</com.artifex.mupdfdemo.MuPDFReaderView>
<com.base.pdfreaderallpdfreader.ui.view.VerticalSeekBar
android:id="@+id/vertical_seekbar"
android:layout_width="30dp"
android:layout_height="match_parent"
android:layout_gravity="end"
android:layout_marginEnd="10dp"
android:visibility="gone"
app:vsb_bar_background="@color/transparent"
app:vsb_bar_progress="@color/transparent"
app:vsb_show_thumb="true" />
</FrameLayout>
<ViewAnimator
android:id="@+id/v_animator_top"
android:layout_width="match_parent"
android:layout_height="60dp"
android:background="@color/white"
app:layout_constraintTop_toTopOf="parent">
<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_pdf_name"
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_pdf_name"
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_toStartOf="@+id/iv_xuanzhuan"
app:layout_constraintStart_toEndOf="@id/fl_fanhui"
app:layout_constraintTop_toTopOf="parent"
tools:ignore="HardcodedText"
tools:text="DEMO.pdf" />
<ImageView
android:id="@+id/iv_xuanzhuan"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="16dp"
android:src="@mipmap/hengping"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@id/iv_search"
app:layout_constraintTop_toTopOf="parent"
tools:ignore="ContentDescription" />
<ImageView
android:id="@+id/iv_search"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="16dp"
android:src="@mipmap/h_sousuo"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@id/iv_more"
app:layout_constraintTop_toTopOf="parent"
tools:ignore="ContentDescription" />
<ImageView
android:id="@+id/iv_wancheng"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="16dp"
android:src="@mipmap/wancheng"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="@id/iv_more"
app:layout_constraintTop_toTopOf="parent"
tools:ignore="ContentDescription" />
<ImageView
android:id="@+id/iv_more"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="16dp"
android:src="@mipmap/x_genduo"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:ignore="ContentDescription" />
<EditText
android:id="@+id/edit_search"
android:layout_width="0dp"
android:layout_height="40dp"
android:layout_marginStart="5dp"
android:layout_marginEnd="20dp"
android:background="@drawable/bg_f8f9fe_10"
android:hint="input..."
android:paddingHorizontal="18dp"
android:singleLine="true"
android:textColor="@color/black"
android:textColorHint="#B8B9BD"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@id/iv_search"
app:layout_constraintStart_toEndOf="@id/fl_fanhui"
app:layout_constraintTop_toTopOf="parent"
tools:ignore="Autofill,HardcodedText,TextFields" />
<TextView
android:id="@+id/tv_btn_save"
android:layout_width="90dp"
android:layout_height="36dp"
android:background="@drawable/bg_00b8de_10"
android:gravity="center"
android:text="@string/save"
android:textColor="@color/white"
android:textSize="16sp"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="@+id/iv_more"
app:layout_constraintTop_toTopOf="parent"
tools:ignore="HardcodedText" />
</androidx.constraintlayout.widget.ConstraintLayout>
</ViewAnimator>
<TextView
android:id="@+id/tv_pageCount"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="28dp"
android:layout_marginTop="28dp"
android:background="@drawable/bg_54585b_5"
android:includeFontPadding="false"
android:paddingHorizontal="2dp"
android:paddingVertical="2dp"
android:textColor="@color/white"
android:textSize="12sp"
app:layout_constraintStart_toStartOf="parent"
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="35dp"
android:layout_marginBottom="108dp"
android:src="@mipmap/bianji"
app:layout_constraintBottom_toBottomOf="@id/v_animator_bottom"
app:layout_constraintEnd_toEndOf="parent"
tools:ignore="ContentDescription" />
<ViewAnimator
android:id="@+id/v_animator_bottom"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:background="@color/white"
app:layout_constraintBottom_toTopOf="@id/fl_ad">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
tools:ignore="UselessParent">
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/cl_operation"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white"
android:paddingVertical="8dp"
android:visibility="gone"
app:layout_constraintBottom_toTopOf="@id/v_animator_bottom">
<LinearLayout
android:id="@+id/ll_highlight"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:background="?android:attr/selectableItemBackground"
android:orientation="vertical"
app:layout_constraintEnd_toStartOf="@id/ll_glide_line"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:ignore="UseCompoundDrawables">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:src="@mipmap/highlight"
tools:ignore="ContentDescription" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="6dp"
android:text="@string/highlight"
android:textColor="#232323"
android:textSize="12sp"
tools:ignore="HardcodedText" />
</LinearLayout>
<LinearLayout
android:id="@+id/ll_glide_line"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:background="?android:attr/selectableItemBackground"
android:orientation="vertical"
app:layout_constraintEnd_toStartOf="@id/ll_strikethrough"
app:layout_constraintStart_toEndOf="@id/ll_highlight"
app:layout_constraintTop_toTopOf="parent"
tools:ignore="UseCompoundDrawables">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:src="@mipmap/glideline"
tools:ignore="ContentDescription" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="6dp"
android:text="@string/glide_line"
android:textColor="#232323"
android:textSize="12sp"
tools:ignore="HardcodedText" />
</LinearLayout>
<LinearLayout
android:id="@+id/ll_strikethrough"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:background="?android:attr/selectableItemBackground"
android:orientation="vertical"
app:layout_constraintEnd_toStartOf="@id/ll_painting_brush"
app:layout_constraintStart_toEndOf="@id/ll_glide_line"
app:layout_constraintTop_toTopOf="parent"
tools:ignore="UseCompoundDrawables">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:src="@mipmap/strike"
tools:ignore="ContentDescription" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="6dp"
android:text="@string/strikethrough"
android:textColor="#232323"
android:textSize="12sp"
tools:ignore="HardcodedText" />
</LinearLayout>
<LinearLayout
android:id="@+id/ll_painting_brush"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:background="?android:attr/selectableItemBackground"
android:orientation="vertical"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/ll_strikethrough"
app:layout_constraintTop_toTopOf="parent"
tools:ignore="UseCompoundDrawables">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:src="@mipmap/painting"
tools:ignore="ContentDescription" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="6dp"
android:text="@string/painting_brush"
android:textColor="#232323"
android:textSize="12sp"
tools:ignore="HardcodedText" />
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv_pager"
android:layout_width="match_parent"
android:layout_height="88dp"
android:orientation="horizontal"
android:paddingHorizontal="4dp"
android:paddingTop="5dp"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
app:layout_constraintBottom_toBottomOf="parent"
tools:listitem="@layout/item_pdf_pager" />
</LinearLayout>
</ViewAnimator>
<FrameLayout
android:id="@+id/fl_ad"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintBottom_toBottomOf="parent">
<ImageView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:src="@mipmap/zhanweitu2"
tools:ignore="ContentDescription" />
</FrameLayout>
<FrameLayout
android:id="@+id/fl_guide_gesture"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:visibility="gone">
<FrameLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:background="@drawable/bg_b3000000_10"
tools:ignore="UselessParent">
<com.base.pdfreaderallpdfreader.widget.XmlLottieAnimationView
android:id="@+id/lottie"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
app:lottie_autoPlay="true"
app:lottie_loop="true"
app:lottie_rawRes="@raw/enlarge" />
</FrameLayout>
</FrameLayout>
</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">
<ImageView
android:id="@+id/iv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@mipmap/tu_loading"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.35"
tools:ignore="ContentDescription" />
<TextView
android:id="@+id/tv_desc"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="76dp"
android:text="@string/splitting_pdf_please_wait"
android:textColor="#333333"
android:textSize="16sp"
app:layout_constraintEnd_toEndOf="@id/iv"
app:layout_constraintStart_toStartOf="@id/iv"
app:layout_constraintTop_toBottomOf="@id/iv"
tools:ignore="HardcodedText" />
<ProgressBar
android:id="@+id/progressBar"
style="@style/Widget.AppCompat.ProgressBar.Horizontal"
android:layout_width="0dp"
android:layout_height="16sp"
android:layout_marginHorizontal="56dp"
android:layout_marginTop="19dp"
android:max="100"
android:progressDrawable="@drawable/progress_bg_pdf_loading"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tv_desc" />
</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">
<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_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:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ellipsize="end"
android:singleLine="true"
android:text="@string/merge_pdf"
android:textColor="@color/black"
android:textSize="19sp"
android:textStyle="bold"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toEndOf="@id/fl_fanhui"
app:layout_constraintTop_toTopOf="parent"
tools:ignore="HardcodedText" />
<TextView
android:id="@+id/tv_add"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="24dp"
android:text="@string/add"
android:textColor="#00B8DE"
android:textSize="16sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:ignore="HardcodedText" />
</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_pdf_merge" />
</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="@string/merge"
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
<?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">
<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_document" />
<ProgressBar
android:id="@+id/progressBar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center" />
<LinearLayout
android:id="@+id/ll_empty"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginBottom="60dp"
android:orientation="vertical"
android:visibility="gone"
tools:ignore="UseCompoundDrawables,UselessParent">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@mipmap/r_pdf_no"
tools:ignore="ContentDescription" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="20dp"
android:text="Empty"
android:textColor="#B1B4B9"
android:textSize="16sp"
tools:ignore="HardcodedText" />
</LinearLayout>
</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="@string/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
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout 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"
android:orientation="vertical">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="60dp">
<FrameLayout
android:id="@+id/fl_fanhui"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="15dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@mipmap/fanhui_b"
tools:ignore="ContentDescription" />
</FrameLayout>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="13dp"
android:text="@string/split_pdf"
android:textColor="@color/black"
android:textSize="19sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toEndOf="@id/fl_fanhui"
app:layout_constraintTop_toTopOf="parent"
tools:ignore="HardcodedText" />
<ImageView
android:id="@+id/iv_selector"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="34dp"
android:src="@drawable/bg_selector_select"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:ignore="ContentDescription" />
</androidx.constraintlayout.widget.ConstraintLayout>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv"
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_gravity="center_horizontal"
android:layout_weight="1"
app:layoutManager="androidx.recyclerview.widget.GridLayoutManager"
app:spanCount="3"
tools:listitem="@layout/item_pdf_pager_split" />
<TextView
android:id="@+id/tv_btn_split"
android:layout_width="338dp"
android:layout_height="48dp"
android:layout_gravity="center_horizontal"
android:layout_marginTop="20dp"
android:layout_marginBottom="35dp"
android:background="@drawable/bg_selector_btn"
android:enabled="false"
android:gravity="center"
android:text="@string/split"
android:textColor="@color/white"
android:textSize="18sp"
tools:ignore="HardcodedText" />
</LinearLayout>
\ 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:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/bg_f3f3f3_tlr25"
android:orientation="vertical">
<FrameLayout
android:id="@+id/fl"
android:layout_width="match_parent"
android:layout_height="65dp"
app:layout_constraintTop_toTopOf="parent">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginStart="16dp"
android:includeFontPadding="false"
android:text="@string/delete"
android:textColor="#333333"
android:textSize="17sp"
android:textStyle="bold"
tools:ignore="HardcodedText" />
</FrameLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white"
android:orientation="vertical"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toBottomOf="@id/fl">
<TextView
android:layout_width="match_parent"
android:layout_height="55dp"
android:layout_marginHorizontal="16dp"
android:layout_marginTop="32dp"
android:ellipsize="end"
android:gravity="center_vertical"
android:paddingHorizontal="20dp"
android:singleLine="true"
android:text="@string/are_you_sure_you_want_to_delete_it"
android:textColor="#333333"
android:textSize="18sp"
tools:ignore="Autofill,HardcodedText,LabelFor,TextFields" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="26dp"
android:layout_marginBottom="20dp">
<TextView
android:id="@+id/tv_cancel"
android:layout_width="163dp"
android:layout_height="48dp"
android:background="@drawable/bg_f1f2f6_10"
android:gravity="center"
android:text="@string/cancel"
android:textColor="#505050"
android:textSize="18sp"
tools:ignore="HardcodedText" />
<TextView
android:id="@+id/tv_delete"
android:layout_width="163dp"
android:layout_height="48dp"
android:layout_marginStart="14dp"
android:background="@drawable/bg_fb2b39_10"
android:gravity="center"
android:text="@string/delete"
android:textColor="@color/white"
android:textSize="18sp"
tools:ignore="HardcodedText" />
</LinearLayout>
</LinearLayout>
</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:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/bg_ffffff_tlr15"
android:orientation="vertical">
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/cl"
android:layout_width="match_parent"
android:layout_height="65dp"
app:layout_constraintTop_toTopOf="parent">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="15dp"
android:text="Detail"
android:textColor="#333333"
android:textStyle="bold"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:ignore="HardcodedText" />
</androidx.constraintlayout.widget.ConstraintLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white"
android:orientation="vertical"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toBottomOf="@id/cl">
<FrameLayout
android:layout_width="match_parent"
android:layout_height="85dp"
android:background="?android:selectableItemBackground">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:orientation="vertical"
tools:ignore="UselessParent">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="15dp"
android:includeFontPadding="false"
android:text="File Name"
tools:ignore="HardcodedText" />
<TextView
android:id="@+id/tv_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginHorizontal="15dp"
android:layout_marginTop="16dp"
android:includeFontPadding="false"
android:textColor="#9A9A9A"
android:textSize="14sp"
tools:text="DEMO.pdf" />
</LinearLayout>
</FrameLayout>
<FrameLayout
android:layout_width="match_parent"
android:layout_height="85dp"
android:background="?android:selectableItemBackground">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:orientation="vertical"
tools:ignore="UselessParent">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="15dp"
android:includeFontPadding="false"
android:text="Storage Path"
tools:ignore="HardcodedText" />
<TextView
android:id="@+id/tv_path"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginHorizontal="15dp"
android:layout_marginTop="16dp"
android:ellipsize="end"
android:includeFontPadding="false"
android:maxLines="2"
android:textColor="#9A9A9A"
android:textSize="14sp"
tools:text="/data/user/0/com.pdfviewer.scanner/files/ demo/DEMO.pdf" />
</LinearLayout>
</FrameLayout>
<FrameLayout
android:layout_width="match_parent"
android:layout_height="85dp"
android:background="?android:selectableItemBackground">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:orientation="vertical"
tools:ignore="UselessParent">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="15dp"
android:includeFontPadding="false"
android:text="Last View"
tools:ignore="HardcodedText" />
<TextView
android:id="@+id/tv_last_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginHorizontal="15dp"
android:layout_marginTop="16dp"
android:ellipsize="end"
android:includeFontPadding="false"
android:maxLines="2"
android:singleLine="true"
android:textColor="#9A9A9A"
android:textSize="14sp"
tools:text="2024-09-10 13:58:00" />
</LinearLayout>
</FrameLayout>
<FrameLayout
android:layout_width="match_parent"
android:layout_height="85dp"
android:background="?android:selectableItemBackground">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:orientation="vertical"
tools:ignore="UselessParent">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="15dp"
android:includeFontPadding="false"
android:text="Last Change"
tools:ignore="HardcodedText" />
<TextView
android:id="@+id/tv_last_change"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginHorizontal="15dp"
android:layout_marginTop="16dp"
android:ellipsize="end"
android:includeFontPadding="false"
android:maxLines="2"
android:singleLine="true"
android:textColor="#9A9A9A"
android:textSize="14sp"
tools:text="2024-09-10 13:58:00" />
</LinearLayout>
</FrameLayout>
<FrameLayout
android:layout_width="match_parent"
android:layout_height="85dp"
android:background="?android:selectableItemBackground">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:orientation="vertical"
tools:ignore="UselessParent">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="15dp"
android:includeFontPadding="false"
android:text="File Size"
tools:ignore="HardcodedText" />
<TextView
android:id="@+id/tv_file_size"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginHorizontal="15dp"
android:layout_marginTop="16dp"
android:ellipsize="end"
android:includeFontPadding="false"
android:maxLines="2"
android:singleLine="true"
android:textColor="#9A9A9A"
android:textSize="14sp"
tools:text="666.66 KB" />
</LinearLayout>
</FrameLayout>
<TextView
android:id="@+id/tv_btn_ok"
android:layout_width="338dp"
android:layout_height="48dp"
android:layout_gravity="center_horizontal"
android:layout_marginTop="10dp"
android:layout_marginBottom="25dp"
android:background="@drawable/bg_00b8de_10"
android:gravity="center"
android:text="OK"
android:textColor="@color/white"
android:textSize="18sp"
tools:ignore="HardcodedText" />
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
<?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:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/bg_ffffff_tlr15"
android:orientation="vertical">
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/cl"
android:layout_width="match_parent"
android:layout_height="88dp"
app:layout_constraintTop_toTopOf="parent">
<ImageView
android:id="@+id/iv_document"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="-50dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:ignore="ContentDescription" />
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginHorizontal="16dp"
android:orientation="vertical"
app:layout_constraintBottom_toBottomOf="@id/iv_document"
app:layout_constraintEnd_toStartOf="@id/iv_bookmark"
app:layout_constraintStart_toEndOf="@id/iv_document"
app:layout_constraintTop_toTopOf="@id/iv_document">
<TextView
android:id="@+id/tv_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ellipsize="end"
android:includeFontPadding="false"
android:singleLine="true"
android:textColor="@color/black"
android:textSize="17sp"
android:textStyle="bold"
tools:text="PDF_2024091.pdf" />
<TextView
android:id="@+id/tv_info"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:includeFontPadding="false"
tools:text="2024-09-10 590.23 KB" />
</LinearLayout>
<ImageView
android:id="@+id/iv_bookmark"
android:layout_width="24dp"
android:layout_height="32dp"
android:layout_marginEnd="27dp"
android:src="@mipmap/pdf_bookmark_n"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:ignore="ContentDescription" />
</androidx.constraintlayout.widget.ConstraintLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white"
android:orientation="vertical"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toBottomOf="@id/cl">
<LinearLayout
android:id="@+id/ll_rename"
android:layout_width="match_parent"
android:layout_height="60dp"
android:background="?android:selectableItemBackground"
android:orientation="horizontal">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginStart="13dp"
android:src="@mipmap/pdf_rename"
tools:ignore="ContentDescription" />
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginHorizontal="13dp"
android:layout_weight="1"
android:ellipsize="end"
android:includeFontPadding="false"
android:singleLine="true"
android:text="@string/rename"
android:textColor="#333333"
android:textSize="16sp"
tools:ignore="HardcodedText" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginEnd="20dp"
android:src="@mipmap/jianotou"
tools:ignore="ContentDescription" />
</LinearLayout>
<LinearLayout
android:id="@+id/ll_detail"
android:layout_width="match_parent"
android:layout_height="60dp"
android:background="?android:selectableItemBackground"
android:orientation="horizontal">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginStart="13dp"
android:src="@mipmap/pdf_details"
tools:ignore="ContentDescription" />
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginHorizontal="13dp"
android:layout_weight="1"
android:ellipsize="end"
android:includeFontPadding="false"
android:singleLine="true"
android:text="@string/detail"
android:textColor="#333333"
android:textSize="16sp"
tools:ignore="HardcodedText" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginEnd="20dp"
android:src="@mipmap/jianotou"
tools:ignore="ContentDescription" />
</LinearLayout>
<LinearLayout
android:id="@+id/ll_share"
android:layout_width="match_parent"
android:layout_height="60dp"
android:background="?android:selectableItemBackground"
android:orientation="horizontal">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginStart="13dp"
android:src="@mipmap/pdf_share"
tools:ignore="ContentDescription" />
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginHorizontal="13dp"
android:layout_weight="1"
android:ellipsize="end"
android:includeFontPadding="false"
android:singleLine="true"
android:text="@string/share"
android:textColor="#333333"
android:textSize="16sp"
tools:ignore="HardcodedText" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginEnd="20dp"
android:src="@mipmap/jianotou"
tools:ignore="ContentDescription" />
</LinearLayout>
<LinearLayout
android:id="@+id/ll_delete"
android:layout_width="match_parent"
android:layout_height="60dp"
android:layout_marginBottom="20dp"
android:background="?android:selectableItemBackground"
android:orientation="horizontal">
<!-- todo-->
<!-- android:src="@mipmap/delete"-->
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginStart="13dp"
tools:ignore="ContentDescription" />
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginHorizontal="13dp"
android:layout_weight="1"
android:ellipsize="end"
android:includeFontPadding="false"
android:singleLine="true"
android:text="@string/delete"
android:textColor="#333333"
android:textSize="16sp"
tools:ignore="HardcodedText" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginEnd="20dp"
android:src="@mipmap/jianotou"
tools:ignore="ContentDescription" />
</LinearLayout>
</LinearLayout>
</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:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/bg_f3f3f3_tlr25"
android:orientation="vertical">
<FrameLayout
android:id="@+id/fl"
android:layout_width="match_parent"
android:layout_height="65dp"
app:layout_constraintTop_toTopOf="parent">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginStart="16dp"
android:includeFontPadding="false"
android:text="@string/rename"
android:textColor="#333333"
android:textSize="17sp"
android:textStyle="bold"
tools:ignore="HardcodedText" />
</FrameLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white"
android:orientation="vertical"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toBottomOf="@id/fl">
<EditText
android:id="@+id/edit"
android:layout_width="match_parent"
android:layout_height="55dp"
android:layout_marginHorizontal="16dp"
android:layout_marginTop="32dp"
android:background="@drawable/bg_stoke_bababa_10"
android:ellipsize="end"
android:gravity="center_vertical"
android:paddingHorizontal="20dp"
android:singleLine="true"
android:text="DEMO.pdf"
android:textColor="#333333"
android:textSize="18sp"
tools:ignore="Autofill,HardcodedText,LabelFor,TextFields" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="26dp"
android:layout_marginBottom="20dp">
<TextView
android:id="@+id/tv_cancel"
android:layout_width="163dp"
android:layout_height="48dp"
android:background="@drawable/bg_f1f2f6_10"
android:gravity="center"
android:text="@string/cancel"
android:textColor="#505050"
android:textSize="18sp"
tools:ignore="HardcodedText" />
<TextView
android:id="@+id/tv_ok"
android:layout_width="163dp"
android:layout_height="48dp"
android:layout_marginStart="14dp"
android:background="@drawable/bg_selector_btn"
android:gravity="center"
android:text="@string/ok"
android:textColor="@color/white"
android:textSize="18sp"
tools:ignore="HardcodedText" />
</LinearLayout>
</LinearLayout>
</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:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/bg_f3f3f3_tlr25"
android:orientation="vertical">
<FrameLayout
android:id="@+id/fl"
android:layout_width="match_parent"
android:layout_height="65dp"
app:layout_constraintTop_toTopOf="parent">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginStart="16dp"
android:includeFontPadding="false"
android:text="@string/page_number"
android:textColor="#333333"
android:textSize="17sp"
android:textStyle="bold"
tools:ignore="HardcodedText" />
</FrameLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white"
android:orientation="vertical"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toBottomOf="@id/fl"
app:layout_constraintVertical_bias="0.0"
tools:layout_editor_absoluteX="35dp">
<EditText
android:maxLength="1"
android:id="@+id/edit"
android:layout_width="match_parent"
android:layout_height="55dp"
android:layout_marginHorizontal="16dp"
android:layout_marginTop="32dp"
android:background="@drawable/bg_stoke_bababa_10"
android:ellipsize="end"
android:gravity="center_vertical"
android:hint="1 - 10"
android:inputType="number"
android:paddingHorizontal="20dp"
android:singleLine="true"
android:textColor="#333333"
android:textColorHint="#C0C0C0"
android:textSize="18sp"
tools:ignore="Autofill,HardcodedText,LabelFor,TextFields" />
<TextView
android:id="@+id/tv_ok"
android:layout_width="338dp"
android:layout_height="48dp"
android:layout_gravity="center_horizontal"
android:layout_marginTop="26dp"
android:layout_marginBottom="20dp"
android:background="@drawable/bg_selector_btn"
android:enabled="false"
android:gravity="center"
android:text="@string/ok"
android:textColor="@color/white"
android:textSize="18sp"
tools:ignore="HardcodedText" />
</LinearLayout>
</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:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/bg_ffffff_tlr15"
android:orientation="vertical">
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/cl"
android:layout_width="match_parent"
android:layout_height="65dp"
app:layout_constraintTop_toTopOf="parent">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="15dp"
android:text="@string/more"
android:textColor="#333333"
android:textStyle="bold"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:ignore="HardcodedText" />
<ImageView
android:id="@+id/iv_bookmark"
android:layout_width="24dp"
android:layout_height="32dp"
android:layout_marginEnd="27dp"
android:src="@mipmap/pdf_bookmark_n"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:ignore="ContentDescription" />
</androidx.constraintlayout.widget.ConstraintLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white"
android:orientation="vertical"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toBottomOf="@id/cl">
<LinearLayout
android:id="@+id/ll_merge"
android:layout_width="match_parent"
android:layout_height="60dp"
android:background="?android:selectableItemBackground"
android:orientation="horizontal">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginStart="13dp"
android:src="@mipmap/pdf_merge"
tools:ignore="ContentDescription" />
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginHorizontal="13dp"
android:layout_weight="1"
android:ellipsize="end"
android:includeFontPadding="false"
android:singleLine="true"
android:text="@string/merge_pdf"
android:textColor="#333333"
android:textSize="16sp"
tools:ignore="HardcodedText" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginEnd="20dp"
android:src="@mipmap/jianotou"
tools:ignore="ContentDescription" />
</LinearLayout>
<LinearLayout
android:id="@+id/ll_split"
android:layout_width="match_parent"
android:layout_height="60dp"
android:background="?android:selectableItemBackground"
android:orientation="horizontal">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginStart="13dp"
android:src="@mipmap/pdf_split"
tools:ignore="ContentDescription" />
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginHorizontal="13dp"
android:layout_weight="1"
android:ellipsize="end"
android:includeFontPadding="false"
android:singleLine="true"
android:text="@string/split_pdf"
android:textColor="#333333"
android:textSize="16sp"
tools:ignore="HardcodedText" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginEnd="20dp"
android:src="@mipmap/jianotou"
tools:ignore="ContentDescription" />
</LinearLayout>
<LinearLayout
android:id="@+id/ll_jump"
android:layout_width="match_parent"
android:layout_height="60dp"
android:background="?android:selectableItemBackground"
android:orientation="horizontal">
<!-- todo-->
<!-- android:src="@mipmap/jump"-->
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginStart="13dp"
tools:ignore="ContentDescription" />
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginHorizontal="13dp"
android:layout_weight="1"
android:ellipsize="end"
android:includeFontPadding="false"
android:singleLine="true"
android:text="@string/jump_to_the_specified_page"
android:textColor="#333333"
android:textSize="16sp"
tools:ignore="HardcodedText" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginEnd="20dp"
android:src="@mipmap/jianotou"
tools:ignore="ContentDescription" />
</LinearLayout>
<LinearLayout
android:id="@+id/ll_detail"
android:layout_width="match_parent"
android:layout_height="60dp"
android:background="?android:selectableItemBackground"
android:orientation="horizontal">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginStart="13dp"
android:src="@mipmap/pdf_details"
tools:ignore="ContentDescription" />
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginHorizontal="13dp"
android:layout_weight="1"
android:ellipsize="end"
android:includeFontPadding="false"
android:singleLine="true"
android:text="@string/detail"
android:textColor="#333333"
android:textSize="16sp"
tools:ignore="HardcodedText" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginEnd="20dp"
android:src="@mipmap/jianotou"
tools:ignore="ContentDescription" />
</LinearLayout>
<LinearLayout
android:id="@+id/ll_share"
android:layout_width="match_parent"
android:layout_height="60dp"
android:background="?android:selectableItemBackground"
android:orientation="horizontal">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginStart="13dp"
android:src="@mipmap/pdf_share"
tools:ignore="ContentDescription" />
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginHorizontal="13dp"
android:layout_weight="1"
android:ellipsize="end"
android:includeFontPadding="false"
android:singleLine="true"
android:text="@string/share"
android:textColor="#333333"
android:textSize="16sp"
tools:ignore="HardcodedText" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginEnd="20dp"
android:src="@mipmap/jianotou"
tools:ignore="ContentDescription" />
</LinearLayout>
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
<?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:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/bg_f3f3f3_tlr25"
android:orientation="vertical">
<FrameLayout
android:id="@+id/fl"
android:layout_width="match_parent"
android:layout_height="65dp"
app:layout_constraintTop_toTopOf="parent">
<TextView
android:id="@+id/tv_tittle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginStart="16dp"
android:includeFontPadding="false"
android:text="@string/set_password"
android:textColor="#333333"
android:textSize="17sp"
android:textStyle="bold"
tools:ignore="HardcodedText" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical|end"
android:layout_marginEnd="26dp"
android:src="@mipmap/suo"
tools:ignore="ContentDescription" />
</FrameLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white"
android:orientation="vertical"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toBottomOf="@id/fl">
<TextView
android:id="@+id/tv_tip"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="22dp"
android:text="@string/set_password_protection_pdf"
android:textColor="#333333"
android:textSize="18sp"
tools:ignore="HardcodedText" />
<TextView
android:id="@+id/tv_input_tip"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="8dp"
android:text="@string/enter_the_password_to_open_the_file"
android:visibility="gone"
tools:ignore="HardcodedText" />
<FrameLayout
android:layout_width="match_parent"
android:layout_height="55dp"
android:layout_marginHorizontal="16dp"
android:layout_marginTop="20dp"
android:gravity="center"
app:endIconDrawable="@mipmap/weishuru"
app:endIconMode="custom"
tools:ignore="Autofill,HardcodedText,LabelFor,TextFields">
<EditText
android:id="@+id/edit"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/bg_stoke_bababa_10"
android:ellipsize="end"
android:gravity="center_vertical"
android:hint="Input..."
android:inputType="textPassword"
android:paddingHorizontal="20dp"
android:singleLine="true"
android:textColor="#333333"
android:textSize="18sp" />
<ImageView
android:id="@+id/iv_eye"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical|end"
android:layout_marginEnd="24dp"
android:src="@mipmap/weishuru"
tools:ignore="ContentDescription" />
</FrameLayout>
<TextView
android:id="@+id/tv_error_tip"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="8dp"
android:text="@string/password_error"
android:textColor="#FA2232"
android:visibility="gone"
tools:ignore="HardcodedText" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="26dp"
android:layout_marginBottom="20dp">
<TextView
android:id="@+id/tv_cancel"
android:layout_width="163dp"
android:layout_height="48dp"
android:background="@drawable/bg_f1f2f6_10"
android:gravity="center"
android:text="@string/cancel"
android:textColor="#505050"
android:textSize="18sp"
tools:ignore="HardcodedText" />
<TextView
android:id="@+id/tv_confirm"
android:layout_width="163dp"
android:layout_height="48dp"
android:layout_marginStart="14dp"
android:background="@drawable/bg_selector_btn"
android:enabled="false"
android:gravity="center"
android:text="@string/confirm"
android:textColor="@color/white"
android:textSize="18sp"
tools:ignore="HardcodedText" />
</LinearLayout>
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
android:id="@+id/tv_view_edit" android:id="@+id/tv_view_edit"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="@string/view_and_edit_fles" android:text="@string/view_and_edit_files"
android:textColor="#773636" android:textColor="#773636"
android:textSize="13sp" android:textSize="13sp"
app:layout_constraintStart_toStartOf="@id/tv_pdf" app:layout_constraintStart_toStartOf="@id/tv_pdf"
......
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/fl_ad"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#F4F5FA">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginVertical="8dp"
android:src="@mipmap/zhanweitu3"
tools:ignore="ContentDescription" />
</FrameLayout>
\ 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:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?android:attr/selectableItemBackground"
android:clickable="true"
android:focusable="true">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white"
app:layout_constraintTop_toTopOf="parent">
<ImageView
android:id="@+id/iv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginVertical="18dp"
android:layout_marginStart="15dp"
android:src="@mipmap/r_pdf"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:ignore="ContentDescription" />
<FrameLayout
android:id="@+id/fl_more"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="5dp"
android:background="?android:attr/selectableItemBackground"
android:clickable="true"
android:focusable="true"
android:padding="15dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:src="@mipmap/x_genduo"
tools:ignore="ContentDescription" />
</FrameLayout>
<FrameLayout
android:id="@+id/fl_select"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
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="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="5dp"
android:background="?android:attr/selectableItemBackground"
android:clickable="true"
android:focusable="true"
android:padding="15dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@id/fl_more"
app:layout_constraintTop_toTopOf="parent">
<ImageView
android:id="@+id/iv_bookmark"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@mipmap/pdf_bookmark_n"
tools:ignore="ContentDescription" />
</FrameLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="15dp"
android:layout_marginEnd="5dp"
android:orientation="vertical"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@id/fl_bookmark"
app:layout_constraintStart_toEndOf="@id/iv"
app:layout_constraintTop_toTopOf="parent">
<TextView
android:id="@+id/tv_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ellipsize="end"
android:includeFontPadding="false"
android:singleLine="true"
android:text="DEMO.pdf"
android:textSize="17sp"
android:textStyle="bold"
tools:ignore="HardcodedText" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp">
<TextView
android:id="@+id/tv_time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:includeFontPadding="false"
android:textColor="#999999"
android:textSize="14sp"
tools:text="2024-09-10" />
<ImageView
android:layout_width="5dp"
android:layout_height="5dp"
android:layout_gravity="center_vertical"
android:layout_marginHorizontal="8dp"
android:background="@drawable/bg_circle_c0c0c0"
tools:ignore="ContentDescription" />
<TextView
android:id="@+id/tv_size"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:includeFontPadding="false"
android:textColor="#999999"
android:textSize="14sp"
tools:text="590.23 KB" />
</LinearLayout>
</LinearLayout>
<View
android:layout_width="0dp"
android:layout_height="1px"
android:layout_marginEnd="15dp"
android:background="#ECECEC"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="@id/fl_more"
app:layout_constraintStart_toStartOf="@id/iv" />
</androidx.constraintlayout.widget.ConstraintLayout>
</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:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?android:attr/selectableItemBackground"
android:clickable="true"
android:focusable="true">
<ImageView
android:id="@+id/iv_move"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="15dp"
android:src="@mipmap/icon_move"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:ignore="ContentDescription" />
<ImageView
android:id="@+id/iv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginVertical="15dp"
android:layout_marginStart="15dp"
android:src="@mipmap/r_pdf"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toEndOf="@id/iv_move"
app:layout_constraintTop_toTopOf="parent"
tools:ignore="ContentDescription" />
<FrameLayout
android:id="@+id/fl_close"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="15dp"
android:background="?android:attr/selectableItemBackground"
android:clickable="true"
android:focusable="true"
android:padding="5dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:src="@mipmap/guanbi"
tools:ignore="ContentDescription" />
</FrameLayout>
<LinearLayout
android:id="@+id/ll"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="15dp"
android:layout_marginEnd="5dp"
android:orientation="vertical"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@id/fl_close"
app:layout_constraintStart_toEndOf="@id/iv"
app:layout_constraintTop_toTopOf="parent">
<TextView
android:id="@+id/tv_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ellipsize="end"
android:includeFontPadding="false"
android:singleLine="true"
android:text="DEMO.pdf"
android:textSize="17sp"
android:textStyle="bold"
tools:ignore="HardcodedText" />
<TextView
android:id="@+id/tv_info"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:includeFontPadding="false"
android:textColor="#999999"
android:textSize="14sp"
tools:text="2024-09-10 590.23 KB" />
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/fl_border"
android:layout_width="53dp"
android:layout_height="75dp"
android:layout_margin="4dp"
android:background="@drawable/bg_selector_pager_border">
<ImageView
android:id="@+id/iv_pager"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="2dp"
android:importantForAccessibility="no"
android:scaleType="fitXY" />
<TextView
android:id="@+id/tv_pager_index"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="5dp"
android:layout_marginTop="4dp"
android:background="@drawable/bg_selector_pager_text"
android:padding="1dp"
android:text="1"
android:textSize="8sp"
tools:ignore="HardcodedText,SmallSp" />
</FrameLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/fl_border"
android:layout_width="103dp"
android:layout_height="145dp"
android:layout_marginHorizontal="5dp"
android:layout_marginVertical="5dp"
android:background="@drawable/bg_selector_pager_border">
<ImageView
android:id="@+id/iv_pager"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="2dp"
android:importantForAccessibility="no"
android:scaleType="centerCrop" />
<ImageView
android:id="@+id/iv_selector"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="end|top"
android:layout_margin="8dp"
android:src="@drawable/bg_selector_select"
tools:ignore="ContentDescription" />
</FrameLayout>
\ No newline at end of file
<?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:id="@+id/container"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@color/transparent">
<androidx.cardview.widget.CardView
android:id="@+id/barCardView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center_horizontal"
app:cardBackgroundColor="@color/transparent"
app:cardElevation="0dp">
<View
android:id="@+id/barBackground"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/transparent" />
<View
android:id="@+id/barProgress"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/transparent" />
</androidx.cardview.widget.CardView>
<FrameLayout
android:id="@+id/maxPlaceholderLayout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:background="@color/transparent">
<ImageView
android:id="@+id/maxPlaceholder"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:contentDescription="@null" />
</FrameLayout>
<FrameLayout
android:id="@+id/minPlaceholderLayout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal|bottom"
android:background="@color/transparent">
<ImageView
android:id="@+id/minPlaceholder"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:contentDescription="@null" />
</FrameLayout>
<FrameLayout
android:id="@+id/thumb"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal">
<androidx.cardview.widget.CardView
android:id="@+id/thumbCardView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
app:cardElevation="0dp">
<ImageView
android:id="@+id/thumbPlaceholder"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:contentDescription="@null" />
</androidx.cardview.widget.CardView>
</FrameLayout>
</FrameLayout>
{"v":"5.9.4","fr":25,"ip":0,"op":25,"w":186,"h":186,"nm":"hand_zoom","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":4,"nm":"layer 2","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":1,"k":[{"i":{"x":0.667,"y":1},"o":{"x":0.333,"y":0},"t":0,"s":[21.5,104.75,0],"to":[2.667,-3.375,0],"ti":[0,0,0]},{"i":{"x":0.667,"y":1},"o":{"x":0.333,"y":0},"t":10,"s":[37.5,84.5,0],"to":[0,0,0],"ti":[2.667,-3.375,0]},{"t":19,"s":[21.5,104.75,0]}],"ix":2,"l":2},"a":{"a":0,"k":[0,0,0],"ix":1,"l":2},"s":{"a":0,"k":[100,100,100],"ix":6,"l":2}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[1.562,1.341],[-0.781,1.006],[0,0],[1.004,0.782],[0,0],[0.781,-1.006],[0,0],[1.004,0.783],[0,-2.124],[0,0],[-1.45,0.224],[0,0]],"o":[[-1.004,-0.894],[0,0],[0.892,-1.006],[0,0],[-1.004,-0.894],[0,0],[-0.892,1.006],[-1.562,-1.341],[0,0],[0,1.453],[0,0],[2.008,-0.559]],"v":[[1.282,9.6],[0.947,6.246],[13.441,-8.733],[13.106,-12.086],[9.091,-15.44],[5.744,-15.104],[-6.749,-0.125],[-10.096,0.21],[-14,2.11],[-13.888,13.624],[-11.1,15.971],[0.167,13.959]],"c":true},"ix":2},"nm":"path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"fl","c":{"a":0,"k":[1,1,1,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"bm":0,"nm":"fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[0,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"transform"}],"nm":"Group 1","np":2,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false},{"ty":"gr","it":[{"ty":"tr","p":{"a":0,"k":[0,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"transform"}],"nm":"Group 2","np":0,"cix":2,"bm":0,"ix":2,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":25,"st":0,"ct":1,"bm":0},{"ddd":0,"ind":2,"ty":4,"nm":"layer 1","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":1,"k":[{"i":{"x":0.667,"y":1},"o":{"x":0.333,"y":0},"t":0,"s":[80.375,27.25,0],"to":[-2.833,4.083,0],"ti":[0,0,0]},{"i":{"x":0.667,"y":1},"o":{"x":0.333,"y":0},"t":10,"s":[63.375,51.75,0],"to":[0,0,0],"ti":[-2.833,4.083,0]},{"t":19,"s":[80.375,27.25,0]}],"ix":2,"l":2},"a":{"a":0,"k":[0,0,0],"ix":1,"l":2},"s":{"a":0,"k":[100,100,100],"ix":6,"l":2}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[-1.122,-0.892],[0,0],[-0.786,1.003],[0,0],[-1.01,-0.892],[0,2.006],[0,0],[1.459,-0.334],[0,0],[-1.571,-1.337],[0.898,-1.003],[0,0]],"o":[[0,0],[1.01,0.78],[0,0],[0.786,-1.003],[1.571,1.226],[0,0],[0,-1.449],[0,0],[-2.02,0.446],[1.01,0.78],[0,0],[-0.786,0.78]],"v":[[-13.045,12.256],[-8.893,15.488],[-5.526,15.154],[6.706,-0.115],[10.072,-0.449],[14,-2.344],[13.663,-13.711],[10.746,-15.94],[-0.588,-13.711],[-1.598,-9.476],[-1.262,-6.133],[-13.494,9.135]],"c":true},"ix":2},"nm":"path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"fl","c":{"a":0,"k":[1,1,1,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"bm":0,"nm":"fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[0,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"transform"}],"nm":"Group 1","np":2,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false},{"ty":"gr","it":[{"ty":"tr","p":{"a":0,"k":[0,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"transform"}],"nm":"Group 2","np":0,"cix":2,"bm":0,"ix":2,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":25,"st":0,"ct":1,"bm":0},{"ddd":0,"ind":3,"ty":4,"nm":"hand_zoom contornos","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[93,106,0],"ix":2,"l":2},"a":{"a":0,"k":[180,150,0],"ix":1,"l":2},"s":{"a":0,"k":[100,100,100],"ix":6,"l":2}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[0,0],[0,0],[0,-11.984],[0,0],[0,0]],"o":[[0,0],[0,-11.984],[0,0],[0,0],[0,0]],"v":[[-7.49,33.438],[-7.49,-21.454],[7.49,-21.454],[7.49,27.003],[7.49,7.828]],"c":false},"ix":2},"nm":"path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"st","c":{"a":0,"k":[1,1,1,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":3,"ix":5},"lc":2,"lj":2,"bm":0,"nm":"Trazo 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"tr","p":{"a":0,"k":[184.917,162.762],"ix":2},"a":{"a":0,"k":[-0.652,28.499],"ix":1},"s":{"a":1,"k":[{"i":{"x":[0.833,0.833],"y":[1,0.833]},"o":{"x":[0.167,0.167],"y":[0,0.167]},"t":0,"s":[100,100]},{"i":{"x":[0.833,0.833],"y":[1,0.833]},"o":{"x":[0.167,0.167],"y":[0,0.167]},"t":10,"s":[100,90]},{"t":19,"s":[100,100]}],"ix":3},"r":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":0,"s":[0]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":10,"s":[-10]},{"t":19,"s":[0]}],"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"transform"}],"nm":"Grupo 1","np":2,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false},{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[0,0],[0,0],[-6.56,-6.271],[0,0]],"o":[[0,0],[6.56,-6.269],[0,0],[0,0]],"v":[[13.938,24.07],[-15.837,-17.801],[3.771,-15.293],[15.836,-5.393]],"c":false},"ix":2},"nm":"path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"st","c":{"a":0,"k":[1,1,1,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":3,"ix":5},"lc":1,"lj":2,"bm":0,"nm":"Trazo 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"tr","p":{"a":0,"k":[178.406,180.584],"ix":2},"a":{"a":0,"k":[16.164,7.49],"ix":1},"s":{"a":1,"k":[{"i":{"x":[0.833,0.833],"y":[0.833,1]},"o":{"x":[0.167,0.167],"y":[0.167,0]},"t":0,"s":[100,100]},{"i":{"x":[0.833,0.833],"y":[0.833,1]},"o":{"x":[0.167,0.167],"y":[0.167,0]},"t":10,"s":[73,100]},{"t":19,"s":[100,100]}],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"transform"}],"nm":"Grupo 2","np":2,"cix":2,"bm":0,"ix":2,"mn":"ADBE Vector Group","hd":false},{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[0,0],[0,0]],"o":[[0,0],[0,0]],"v":[[226.015,154.753],[226.015,164.781]],"c":false},"ix":2},"nm":"path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"st","c":{"a":0,"k":[1,1,1,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":3,"ix":5},"lc":2,"lj":1,"ml":10,"bm":0,"nm":"Trazo 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"tr","p":{"a":0,"k":[0,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"transform"}],"nm":"Grupo 5","np":2,"cix":2,"bm":0,"ix":3,"mn":"ADBE Vector Group","hd":false},{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[0,0],[0,0]],"o":[[0,0],[0,0]],"v":[[211.034,148.761],[211.034,163.094]],"c":false},"ix":2},"nm":"path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"st","c":{"a":0,"k":[1,1,1,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":3,"ix":5},"lc":2,"lj":1,"ml":10,"bm":0,"nm":"Trazo 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"tr","p":{"a":0,"k":[0,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"transform"}],"nm":"Grupo 6","np":2,"cix":2,"bm":0,"ix":4,"mn":"ADBE Vector Group","hd":false},{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[0,0],[-18.89,0],[0,0],[0,0],[4.638,0],[0,-4.433],[0,0],[4.639,0],[0,-4.434],[0,0],[4.638,0],[0,-4.433],[0,0]],"o":[[0,0],[24.06,0],[0,0],[0,-4.433],[-4.638,0],[0,0],[0,-4.434],[-4.638,0],[0,0],[0,-4.433],[-4.639,0],[0,0],[0,0]],"v":[[-32.786,23.569],[-3.077,39.531],[27.54,10.283],[32.786,-17.71],[24.917,-25.738],[17.048,-17.71],[17.048,-25.236],[8.548,-33.264],[2.068,-25.236],[2.068,-31.503],[-6.92,-39.531],[-15.908,-31.503],[-15.908,-12.327]],"c":false},"ix":2},"nm":"path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"st","c":{"a":0,"k":[1,1,1,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":3,"ix":5},"lc":1,"lj":2,"bm":0,"nm":"Trazo 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"tr","p":{"a":0,"k":[208.966,173.595],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"transform"}],"nm":"Grupo 7","np":2,"cix":2,"bm":0,"ix":5,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":750,"st":0,"ct":1,"bm":0}],"markers":[]}
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<resources>
<declare-styleable name="VerticalSeekBar">
<attr name="vsb_click_to_set_progress" format="boolean" />
<attr name="vsb_bar_corner_radius" format="dimension" />
<attr name="vsb_bar_width" format="dimension" />
<attr name="vsb_bar_background" format="reference|color" />
<attr name="vsb_bar_background_gradient_start" format="color" />
<attr name="vsb_bar_background_gradient_end" format="color" />
<attr name="vsb_bar_progress" format="reference|color" />
<attr name="vsb_bar_progress_gradient_start" format="color" />
<attr name="vsb_bar_progress_gradient_end" format="color" />
<attr name="vsb_progress" format="integer" />
<attr name="vsb_max_value" format="integer" />
<attr name="vsb_min_placeholder_position" format="enum">
<enum name="outside" value="0"/>
<enum name="inside" value="1"/>
<enum name="middle" value="2"/>
</attr>
<attr name="vsb_min_placeholder_src" format="reference" />
<attr name="vsb_max_placeholder_position" format="enum">
<enum name="outside" value="0"/>
<enum name="inside" value="1"/>
<enum name="middle" value="2"/>
</attr>
<attr name="vsb_max_placeholder_src" format="reference" />
<attr name="vsb_show_thumb" format="boolean" />
<attr name="vsb_thumb_container_corner_radius" format="dimension" />
<attr name="vsb_thumb_container_tint" format="color" />
<attr name="vsb_thumb_placeholder_src" format="integer" />
<attr name="vsb_use_thumb_to_set_progress" format="boolean" />
<attr name="android:layout_width" />
<attr name="android:layout_height" />
</declare-styleable>
</resources>
...@@ -2,4 +2,5 @@ ...@@ -2,4 +2,5 @@
<resources> <resources>
<color name="black">#FF000000</color> <color name="black">#FF000000</color>
<color name="white">#FFFFFFFF</color> <color name="white">#FFFFFFFF</color>
<color name="transparent">#00000000</color>
</resources> </resources>
\ No newline at end of file
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
<string name="menu_gallery">Gallery</string> <string name="menu_gallery">Gallery</string>
<string name="menu_slideshow">Slideshow</string> <string name="menu_slideshow">Slideshow</string>
<string name="pdf_reader">PDF Reader</string> <string name="pdf_reader">PDF Reader</string>
<string name="view_and_edit_fles">View and edit fles</string> <string name="view_and_edit_files">View and edit files</string>
<string name="other_documents">Other Documents</string> <string name="other_documents">Other Documents</string>
<string name="word_reader">Word Reader</string> <string name="word_reader">Word Reader</string>
<string name="ppt_reader">PPT Reader</string> <string name="ppt_reader">PPT Reader</string>
...@@ -30,6 +30,39 @@ ...@@ -30,6 +30,39 @@
<string name="no_recent">No recent</string> <string name="no_recent">No recent</string>
<string name="permission_required">Permission Required</string> <string name="permission_required">Permission Required</string>
<string name="allow">Allow</string> <string name="allow">Allow</string>
<string name="search_documents">Search Documents...</string> <string name="search_documents">Search Documents</string>
<string name="no_document">No Document</string> <string name="no_document">No Document</string>
<string name="merge_pdf">Merge PDF</string>
<string name="split_pdf">Split Pdf</string>
<string name="jump_to_the_specified_page">Jump to the specified page</string>
<string name="detail">Detail</string>
<string name="page_number">Page Number</string>
<string name="share_pdf">Share PDF</string>
<string name="share_ppt">Share PPT</string>
<string name="share_word">Share Word</string>
<string name="share_excel">Share Excel</string>
<string name="rename">Rename</string>
<string name="are_you_sure_you_want_to_delete_it">Are you sure you want to delete it?</string>
<string name="ok">OK</string>
<string name="glide_line">Glide Line</string>
<string name="strikethrough">Strikethrough</string>
<string name="painting_brush">Painting Brush</string>
<string name="next">Next</string>
<string name="select_a_project">Select a project</string>
<string name="set_password">Set Password</string>
<string name="delete_password">Delete Password</string>
<string name="delete_password_the_file_is_not_password_protected">Delete password, the file is not password protected</string>
<string name="set_password_protection_pdf">Set password protection pdf</string>
<string name="input_password">Input Password</string>
<string name="password_protected">%1$s password protected</string>
<string name="items_has_been_selected">%1$s items has been selected</string>
<string name="confirm">Confirm</string>
<string name="enter_the_password_to_open_the_file">Enter the password to open the file</string>
<string name="password_error">Password Error</string>
<string name="split">Split</string>
<string name="splitting_pdf_please_wait">Splitting PDF, please wait.</string>
<string name="add">Add</string>
<string name="merge">Merge</string>
</resources> </resources>
\ No newline at end of file
...@@ -27,4 +27,6 @@ dependencyResolutionManagement { ...@@ -27,4 +27,6 @@ dependencyResolutionManagement {
rootProject.name = "Pdf Reader All Pdf Reader" rootProject.name = "Pdf Reader All Pdf Reader"
include(":app") include(":app")
//include(":library")
\ No newline at end of file include(":pdflibrary")
include(":library")
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