From 326a434ed47e817bef82e2e6533bba968ef248e7 Mon Sep 17 00:00:00 2001 From: tibbi Date: Sun, 15 May 2022 23:29:05 +0200 Subject: [PATCH] use the primary color at PDF scrollbar --- app/build.gradle | 2 +- .../filemanager/pro/activities/PDFViewerActivity.kt | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 78cab067..a10c6fca 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -65,10 +65,10 @@ android { dependencies { implementation 'com.github.SimpleMobileTools:Simple-Commons:d6434b3912' + implementation 'com.github.tibbi:AndroidPdfViewer:2c16b98f21' implementation 'com.github.Stericson:RootTools:df729dcb13' implementation 'com.github.Stericson:RootShell:1.6' implementation 'com.alexvasilkov:gesture-views:2.5.2' implementation 'androidx.documentfile:documentfile:1.0.1' implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0' - implementation 'com.github.barteksc:android-pdf-viewer:2.8.2' } diff --git a/app/src/main/kotlin/com/simplemobiletools/filemanager/pro/activities/PDFViewerActivity.kt b/app/src/main/kotlin/com/simplemobiletools/filemanager/pro/activities/PDFViewerActivity.kt index 92c865a0..c2571d58 100644 --- a/app/src/main/kotlin/com/simplemobiletools/filemanager/pro/activities/PDFViewerActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/filemanager/pro/activities/PDFViewerActivity.kt @@ -6,10 +6,8 @@ import android.print.PrintAttributes import android.print.PrintManager import android.view.Menu import android.view.MenuItem -import com.simplemobiletools.commons.extensions.checkAppSideloading -import com.simplemobiletools.commons.extensions.getFilenameFromPath -import com.simplemobiletools.commons.extensions.getFilenameFromUri -import com.simplemobiletools.commons.extensions.getProperBackgroundColor +import com.github.barteksc.pdfviewer.scroll.DefaultScrollHandle +import com.simplemobiletools.commons.extensions.* import com.simplemobiletools.commons.helpers.REAL_FILE_PATH import com.simplemobiletools.filemanager.pro.R import com.simplemobiletools.filemanager.pro.helpers.PdfDocumentAdapter @@ -63,8 +61,10 @@ class PDFViewerActivity : SimpleActivity() { title = filename } + val primaryColor = getProperPrimaryColor() pdf_viewer.setBackgroundColor(getProperBackgroundColor()) pdf_viewer.fromUri(uri) + .scrollHandle(DefaultScrollHandle(this, primaryColor.getContrastColor(), primaryColor)) .spacing(15) .load() }