Skip to content

Commit bb90558

Browse files
committed
updating the pdf viewer style
1 parent 6c815df commit bb90558

File tree

3 files changed

+10
-11
lines changed

3 files changed

+10
-11
lines changed

app/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ android {
6464
}
6565

6666
dependencies {
67-
implementation 'com.github.SimpleMobileTools:Simple-Commons:1123a20745'
67+
implementation 'com.github.SimpleMobileTools:Simple-Commons:bb9c9e8714'
6868
implementation 'com.github.tibbi:AndroidPdfViewer:da57ff410e'
6969
implementation 'com.github.Stericson:RootTools:df729dcb13'
7070
implementation 'com.github.Stericson:RootShell:1.6'

app/src/main/AndroidManifest.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,8 @@
9494
<activity
9595
android:name=".activities.PDFViewerActivity"
9696
android:exported="true"
97-
android:label="@string/pdf_viewer">
97+
android:label="@string/pdf_viewer"
98+
android:theme="@style/TranslucentTheme">
9899

99100
<intent-filter>
100101
<action android:name="android.intent.action.VIEW" />

app/src/main/kotlin/com/simplemobiletools/filemanager/pro/activities/PDFViewerActivity.kt

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,12 @@ import android.graphics.Color
55
import android.os.Bundle
66
import android.print.PrintAttributes
77
import android.print.PrintManager
8-
import android.view.WindowInsetsController
98
import android.view.WindowManager
109
import android.widget.RelativeLayout
1110
import com.github.barteksc.pdfviewer.scroll.DefaultScrollHandle
1211
import com.simplemobiletools.commons.extensions.*
1312
import com.simplemobiletools.commons.helpers.REAL_FILE_PATH
1413
import com.simplemobiletools.commons.helpers.isPiePlus
15-
import com.simplemobiletools.commons.helpers.isRPlus
1614
import com.simplemobiletools.filemanager.pro.R
1715
import com.simplemobiletools.filemanager.pro.extensions.hideSystemUI
1816
import com.simplemobiletools.filemanager.pro.extensions.showSystemUI
@@ -24,7 +22,7 @@ class PDFViewerActivity : SimpleActivity() {
2422
private var isFullScreen = false
2523

2624
override fun onCreate(savedInstanceState: Bundle?) {
27-
useDynamicTheme = false
25+
showTransparentTop = true
2826

2927
super.onCreate(savedInstanceState)
3028
setContentView(R.layout.activity_pdf_viewer)
@@ -33,8 +31,12 @@ class PDFViewerActivity : SimpleActivity() {
3331
return
3432
}
3533

36-
window.decorView.setBackgroundColor(getProperBackgroundColor())
3734
checkNotchSupport()
35+
pdf_viewer_toolbar.apply {
36+
setTitleTextColor(Color.WHITE)
37+
overflowIcon = resources.getColoredDrawableWithColor(R.drawable.ic_three_dots_vector, Color.WHITE)
38+
navigationIcon = resources.getColoredDrawableWithColor(R.drawable.ic_arrow_left_vector, Color.WHITE)
39+
}
3840

3941
if (intent.extras?.containsKey(REAL_FILE_PATH) == true) {
4042
realFilePath = intent.extras?.get(REAL_FILE_PATH)?.toString() ?: ""
@@ -43,15 +45,11 @@ class PDFViewerActivity : SimpleActivity() {
4345

4446
setupMenu()
4547
checkIntent()
46-
if (isRPlus()) {
47-
window.insetsController?.setSystemBarsAppearance(0, WindowInsetsController.APPEARANCE_LIGHT_STATUS_BARS)
48-
}
4948
}
5049

5150
override fun onResume() {
5251
super.onResume()
53-
window.statusBarColor = Color.TRANSPARENT
54-
setTranslucentNavigation()
52+
window.navigationBarColor = Color.TRANSPARENT
5553
}
5654

5755
private fun setupMenu() {

0 commit comments

Comments
 (0)