Commit 8241b53d authored by wanglei's avatar wanglei

...

parent 15b3536e
...@@ -35,6 +35,8 @@ import com.base.pdfviewerscannerwhite.utils.LogEx ...@@ -35,6 +35,8 @@ import com.base.pdfviewerscannerwhite.utils.LogEx
import com.base.pdfviewerscannerwhite.utils.SpStringUtils import com.base.pdfviewerscannerwhite.utils.SpStringUtils
import com.base.pdfviewerscannerwhite.utils.SpStringUtils.LAST_VIEW_KEY import com.base.pdfviewerscannerwhite.utils.SpStringUtils.LAST_VIEW_KEY
import com.base.pdfviewerscannerwhite.utils.ToastUtils.toast 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 import java.io.File
...@@ -111,18 +113,7 @@ class PdfActivity : BaseActivity<ActivityPdfBinding>(), PdfView { ...@@ -111,18 +113,7 @@ class PdfActivity : BaseActivity<ActivityPdfBinding>(), PdfView {
private fun iniSetVerticalSeekbar(max: Int) { private fun iniSetVerticalSeekbar(max: Int) {
binding.verticalSeekbar.visibility = View.VISIBLE binding.verticalSeekbar.visibility = View.VISIBLE
binding.verticalSeekbar.showThumb = true binding.verticalSeekbar.showThumb = true
binding.verticalSeekbar.barBackgroundStartColor=Color.TRANSPARENT 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.thumbContainerColor = Color.TRANSPARENT binding.verticalSeekbar.thumbContainerColor = Color.TRANSPARENT
binding.verticalSeekbar.thumbPlaceholderDrawable = binding.verticalSeekbar.thumbPlaceholderDrawable =
ContextCompat.getDrawable(this, R.mipmap.fanye) ContextCompat.getDrawable(this, R.mipmap.fanye)
...@@ -247,6 +238,13 @@ class PdfActivity : BaseActivity<ActivityPdfBinding>(), PdfView { ...@@ -247,6 +238,13 @@ class PdfActivity : BaseActivity<ActivityPdfBinding>(), PdfView {
binding.ivXuanzhuan.setOnClickListener { binding.ivXuanzhuan.setOnClickListener {
switchOrientation() 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 ...@@ -23,6 +23,9 @@ import kotlin.math.roundToInt
/** /**
* A nicer, redesigned and vertical SeekBar * A nicer, redesigned and vertical SeekBar
* copy from:
* https://github.com/lukelorusso/VerticalSeekBar
*
*/ */
class VerticalSeekBar : FrameLayout { class VerticalSeekBar : FrameLayout {
private val TAG = "VerticalSeekBar" private val TAG = "VerticalSeekBar"
...@@ -267,7 +270,7 @@ class VerticalSeekBar : FrameLayout { ...@@ -267,7 +270,7 @@ class VerticalSeekBar : FrameLayout {
R.styleable.VerticalSeekBar_android_layout_height, R.styleable.VerticalSeekBar_android_layout_height,
minLayoutHeight minLayoutHeight
).also { ).also {
container.layoutParams.height = container.layoutParams.height =
if (it != -1 && it < minLayoutHeight) minLayoutHeight // wrap_content if (it != -1 && it < minLayoutHeight) minLayoutHeight // wrap_content
else it else it
} }
......
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