Skip to content

Commit f44aaa4

Browse files
committed
fix
1 parent 4ff9814 commit f44aaa4

File tree

2 files changed

+11
-10
lines changed

2 files changed

+11
-10
lines changed

course/src/main/java/in/testpress/course/ui/PdfViewerActivity.kt

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,10 @@ import `in`.testpress.course.util.PdfDownloadListener
99
import android.os.Bundle
1010
import android.view.View
1111
import android.view.WindowManager
12-
import androidx.appcompat.app.AppCompatActivity
12+
import `in`.testpress.ui.BaseToolBarActivity
13+
import androidx.core.view.isVisible
1314

14-
class PdfViewerActivity : AppCompatActivity(), PdfDownloadListener, DisplayPDFListener {
15+
class PdfViewerActivity : BaseToolBarActivity(), PdfDownloadListener, DisplayPDFListener {
1516
private lateinit var binding: LayoutPdfViewerBinding
1617
private lateinit var pdfDownloadManager: PDFDownloadManager
1718

@@ -25,9 +26,9 @@ class PdfViewerActivity : AppCompatActivity(), PdfDownloadListener, DisplayPDFLi
2526

2627
override fun onCreate(savedInstanceState: Bundle?) {
2728
super.onCreate(savedInstanceState)
28-
disableScreenShot()
2929
binding = LayoutPdfViewerBinding.inflate(layoutInflater)
3030
setContentView(binding.root)
31+
hideToolBar()
3132
hideStatusBar()
3233
getDataFromBundle()
3334
pdfDownloadManager = PDFDownloadManager(this,this,fileName)
@@ -38,13 +39,6 @@ class PdfViewerActivity : AppCompatActivity(), PdfDownloadListener, DisplayPDFLi
3839
}
3940
}
4041

41-
private fun disableScreenShot() {
42-
window.setFlags(
43-
WindowManager.LayoutParams.FLAG_SECURE,
44-
WindowManager.LayoutParams.FLAG_SECURE
45-
)
46-
}
47-
4842
private fun hideStatusBar() {
4943
window.decorView.systemUiVisibility = View.SYSTEM_UI_FLAG_FULLSCREEN
5044
this.window.setFlags(
@@ -53,6 +47,10 @@ class PdfViewerActivity : AppCompatActivity(), PdfDownloadListener, DisplayPDFLi
5347
)
5448
}
5549

50+
private fun hideToolBar() {
51+
binding.toolBar.root.isVisible = false
52+
}
53+
5654
private fun getDataFromBundle() {
5755
pageNumber = intent.getIntExtra("pageNumber", 0)
5856
password = intent.getStringExtra("password") ?: ""

course/src/main/res/layout/layout_pdf_viewer.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66
xmlns:tools="http://schemas.android.com/tools"
77
android:orientation="vertical">
88

9+
<include android:id="@+id/tool_bar"
10+
layout="@layout/testpress_toolbar" />
11+
912
<com.github.barteksc.pdfviewer.PDFView
1013
android:id="@+id/pdfView"
1114
android:layout_width="0dp"

0 commit comments

Comments
 (0)