Skip to content

Commit

Permalink
Remove unused pdf engine (#141)
Browse files Browse the repository at this point in the history
  • Loading branch information
4brunu authored Jan 18, 2025
1 parent d1271dd commit ea785ac
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ import androidx.recyclerview.widget.DividerItemDecoration
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import androidx.recyclerview.widget.RecyclerView.NO_POSITION
import com.rajat.pdfviewer.util.PdfEngine
import java.io.File
import java.io.FileNotFoundException

Expand All @@ -42,7 +41,6 @@ class PdfRendererView @JvmOverloads constructor(
private lateinit var pageNo: TextView
private lateinit var pdfRendererCore: PdfRendererCore
private lateinit var pdfViewAdapter: PdfViewAdapter
private var engine = PdfEngine.INTERNAL
private var showDivider = true
private var divider: Drawable? = null
private var runnable = Runnable {}
Expand Down Expand Up @@ -252,9 +250,6 @@ class PdfRendererView @JvmOverloads constructor(
}

private fun setTypeArray(typedArray: TypedArray) {
val engineValue =
typedArray.getInt(R.styleable.PdfRendererView_pdfView_engine, PdfEngine.INTERNAL.value)
engine = PdfEngine.values().first { it.value == engineValue }
showDivider = typedArray.getBoolean(R.styleable.PdfRendererView_pdfView_showDivider, true)
divider = typedArray.getDrawable(R.styleable.PdfRendererView_pdfView_divider)
enableLoadingForPages = typedArray.getBoolean(R.styleable.PdfRendererView_pdfView_enableLoadingForPages, enableLoadingForPages)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ import com.rajat.pdfviewer.util.FileUtils.createPdfDocumentUri
import com.rajat.pdfviewer.util.FileUtils.fileFromAsset
import com.rajat.pdfviewer.util.FileUtils.uriToFile
import com.rajat.pdfviewer.util.NetworkUtil.checkInternetConnection
import com.rajat.pdfviewer.util.PdfEngine
import com.rajat.pdfviewer.util.saveTo
import java.io.File

Expand Down Expand Up @@ -68,7 +67,6 @@ class PdfViewerActivity : AppCompatActivity() {
const val FILE_TITLE = "pdf_file_title"
const val ENABLE_FILE_DOWNLOAD = "enable_download"
const val FROM_ASSETS = "from_assests"
var engine = PdfEngine.INTERNAL
var enableDownload = false
var isPDFFromPath = false
var isFromAssets = false
Expand Down Expand Up @@ -203,8 +201,6 @@ class PdfViewerActivity : AppCompatActivity() {
false
)

engine = PdfEngine.INTERNAL

val typedArray = obtainStyledAttributes(R.styleable.PdfRendererView_Strings)
error_pdf_corrupted =
typedArray.getString(R.styleable.PdfRendererView_Strings_error_pdf_corrupted)
Expand Down
10 changes: 0 additions & 10 deletions pdfViewer/src/main/java/com/rajat/pdfviewer/util/PdfEngine.kt

This file was deleted.

4 changes: 0 additions & 4 deletions pdfViewer/src/main/res/values/attrs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@
<enum name="normal" value="2" />
<enum name="enhanced" value="3" />
</attr>
<attr name="pdfView_engine" format="enum">
<enum name="internal" value="100" />
<enum name="google" value="200" />
</attr>
<attr name="pdfView_showDivider" format="boolean" />
<attr name="pdfView_divider" format="reference" />
<attr name="pdfView_enableLoadingForPages" format="reference|boolean" />
Expand Down

0 comments on commit ea785ac

Please sign in to comment.