updating the pdf viewer style

This commit is contained in:
tibbi 2022-07-24 23:13:16 +02:00
parent 6c815df53d
commit bb90558e65
3 changed files with 10 additions and 11 deletions

View File

@ -64,7 +64,7 @@ android {
} }
dependencies { dependencies {
implementation 'com.github.SimpleMobileTools:Simple-Commons:1123a20745' implementation 'com.github.SimpleMobileTools:Simple-Commons:bb9c9e8714'
implementation 'com.github.tibbi:AndroidPdfViewer:da57ff410e' implementation 'com.github.tibbi:AndroidPdfViewer:da57ff410e'
implementation 'com.github.Stericson:RootTools:df729dcb13' implementation 'com.github.Stericson:RootTools:df729dcb13'
implementation 'com.github.Stericson:RootShell:1.6' implementation 'com.github.Stericson:RootShell:1.6'

View File

@ -94,7 +94,8 @@
<activity <activity
android:name=".activities.PDFViewerActivity" android:name=".activities.PDFViewerActivity"
android:exported="true" android:exported="true"
android:label="@string/pdf_viewer"> android:label="@string/pdf_viewer"
android:theme="@style/TranslucentTheme">
<intent-filter> <intent-filter>
<action android:name="android.intent.action.VIEW" /> <action android:name="android.intent.action.VIEW" />

View File

@ -5,14 +5,12 @@ import android.graphics.Color
import android.os.Bundle import android.os.Bundle
import android.print.PrintAttributes import android.print.PrintAttributes
import android.print.PrintManager import android.print.PrintManager
import android.view.WindowInsetsController
import android.view.WindowManager import android.view.WindowManager
import android.widget.RelativeLayout import android.widget.RelativeLayout
import com.github.barteksc.pdfviewer.scroll.DefaultScrollHandle import com.github.barteksc.pdfviewer.scroll.DefaultScrollHandle
import com.simplemobiletools.commons.extensions.* import com.simplemobiletools.commons.extensions.*
import com.simplemobiletools.commons.helpers.REAL_FILE_PATH import com.simplemobiletools.commons.helpers.REAL_FILE_PATH
import com.simplemobiletools.commons.helpers.isPiePlus import com.simplemobiletools.commons.helpers.isPiePlus
import com.simplemobiletools.commons.helpers.isRPlus
import com.simplemobiletools.filemanager.pro.R import com.simplemobiletools.filemanager.pro.R
import com.simplemobiletools.filemanager.pro.extensions.hideSystemUI import com.simplemobiletools.filemanager.pro.extensions.hideSystemUI
import com.simplemobiletools.filemanager.pro.extensions.showSystemUI import com.simplemobiletools.filemanager.pro.extensions.showSystemUI
@ -24,7 +22,7 @@ class PDFViewerActivity : SimpleActivity() {
private var isFullScreen = false private var isFullScreen = false
override fun onCreate(savedInstanceState: Bundle?) { override fun onCreate(savedInstanceState: Bundle?) {
useDynamicTheme = false showTransparentTop = true
super.onCreate(savedInstanceState) super.onCreate(savedInstanceState)
setContentView(R.layout.activity_pdf_viewer) setContentView(R.layout.activity_pdf_viewer)
@ -33,8 +31,12 @@ class PDFViewerActivity : SimpleActivity() {
return return
} }
window.decorView.setBackgroundColor(getProperBackgroundColor())
checkNotchSupport() checkNotchSupport()
pdf_viewer_toolbar.apply {
setTitleTextColor(Color.WHITE)
overflowIcon = resources.getColoredDrawableWithColor(R.drawable.ic_three_dots_vector, Color.WHITE)
navigationIcon = resources.getColoredDrawableWithColor(R.drawable.ic_arrow_left_vector, Color.WHITE)
}
if (intent.extras?.containsKey(REAL_FILE_PATH) == true) { if (intent.extras?.containsKey(REAL_FILE_PATH) == true) {
realFilePath = intent.extras?.get(REAL_FILE_PATH)?.toString() ?: "" realFilePath = intent.extras?.get(REAL_FILE_PATH)?.toString() ?: ""
@ -43,15 +45,11 @@ class PDFViewerActivity : SimpleActivity() {
setupMenu() setupMenu()
checkIntent() checkIntent()
if (isRPlus()) {
window.insetsController?.setSystemBarsAppearance(0, WindowInsetsController.APPEARANCE_LIGHT_STATUS_BARS)
}
} }
override fun onResume() { override fun onResume() {
super.onResume() super.onResume()
window.statusBarColor = Color.TRANSPARENT window.navigationBarColor = Color.TRANSPARENT
setTranslucentNavigation()
} }
private fun setupMenu() { private fun setupMenu() {