mirror of
https://github.com/SimpleMobileTools/Simple-File-Manager.git
synced 2025-06-05 22:09:15 +02:00
add margin inbetween pages at the pdf viewer
This commit is contained in:
@ -65,7 +65,7 @@ android {
|
||||
|
||||
dependencies {
|
||||
implementation 'com.github.SimpleMobileTools:Simple-Commons:b452494768'
|
||||
implementation 'com.github.tibbi:PdfViewPager:dd7da8173c'
|
||||
implementation 'com.github.tibbi:PdfViewPager:d2af24208d'
|
||||
implementation 'com.github.Stericson:RootTools:df729dcb13'
|
||||
implementation 'com.github.Stericson:RootShell:1.6'
|
||||
implementation 'com.alexvasilkov:gesture-views:2.5.2'
|
||||
|
@ -9,6 +9,7 @@ import android.print.PrintManager
|
||||
import android.view.View
|
||||
import android.view.WindowManager
|
||||
import androidx.constraintlayout.widget.ConstraintLayout
|
||||
import androidx.viewpager2.widget.MarginPageTransformer
|
||||
import androidx.viewpager2.widget.ViewPager2
|
||||
import androidx.viewpager2.widget.ViewPager2.OnPageChangeCallback
|
||||
import com.simplemobiletools.commons.extensions.*
|
||||
@ -110,6 +111,7 @@ class PDFViewerActivity : SimpleActivity() {
|
||||
|
||||
val errorHandler = PdfErrorHandler { throwable -> showErrorToast(throwable.toString()) }
|
||||
|
||||
pdf_viewer.setPageTransformer(MarginPageTransformer(resources.getDimension(R.dimen.activity_margin).toInt()))
|
||||
pdf_viewer.orientation = ViewPager2.ORIENTATION_VERTICAL
|
||||
pdf_viewer.adapter = PDFPagerAdapter(this, clickListener, errorHandler, uri.toString(), getProperBackgroundColor())
|
||||
pdf_viewer.registerOnPageChangeCallback(object : OnPageChangeCallback() {
|
||||
|
Reference in New Issue
Block a user