Commit 8241b53d authored by wanglei's avatar wanglei

...

parent 15b3536e
......@@ -35,6 +35,8 @@ import com.base.pdfviewerscannerwhite.utils.LogEx
import com.base.pdfviewerscannerwhite.utils.SpStringUtils
import com.base.pdfviewerscannerwhite.utils.SpStringUtils.LAST_VIEW_KEY
import com.base.pdfviewerscannerwhite.utils.ToastUtils.toast
import com.cherry.lib.doc.office.constant.EventConstant
import com.cherry.lib.doc.office.wp.control.WPControl
import java.io.File
......@@ -111,18 +113,7 @@ class PdfActivity : BaseActivity<ActivityPdfBinding>(), PdfView {
private fun iniSetVerticalSeekbar(max: Int) {
binding.verticalSeekbar.visibility = View.VISIBLE
binding.verticalSeekbar.showThumb = true
binding.verticalSeekbar.barBackgroundStartColor=Color.TRANSPARENT
// binding.verticalSeekbar.barProgressEndColor = Color.TRANSPARENT
// binding.verticalSeekbar.barProgressStartColor = Color.TRANSPARENT
// binding.verticalSeekbar.barProgressDrawable = ContextCompat.getDrawable(this, R.drawable.bg_transparent)
// binding.verticalSeekbar.barBackgroundStartColor = Color.TRANSPARENT
// binding.verticalSeekbar.barBackgroundStartColor = Color.TRANSPARENT
// binding.verticalSeekbar.barBackgroundEndColor = Color.TRANSPARENT
// binding.verticalSeekbar.setBackgroundColor(Color.TRANSPARENT)
// binding.verticalSeekbar.background = ContextCompat.getDrawable(this, R.drawable.bg_transparent)
// binding.verticalSeekbar.barBackgroundDrawable = ContextCompat.getDrawable(this, R.drawable.bg_transparent)
binding.verticalSeekbar.barBackgroundStartColor = Color.TRANSPARENT
binding.verticalSeekbar.thumbContainerColor = Color.TRANSPARENT
binding.verticalSeekbar.thumbPlaceholderDrawable =
ContextCompat.getDrawable(this, R.mipmap.fanye)
......@@ -247,6 +238,13 @@ class PdfActivity : BaseActivity<ActivityPdfBinding>(), PdfView {
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
}
}
/**
......
......@@ -23,6 +23,9 @@ import kotlin.math.roundToInt
/**
* A nicer, redesigned and vertical SeekBar
* copy from:
* https://github.com/lukelorusso/VerticalSeekBar
*
*/
class VerticalSeekBar : FrameLayout {
private val TAG = "VerticalSeekBar"
......
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