Skip to content

Commit

Permalink
Merge pull request #57 from Sav22999/beta
Browse files Browse the repository at this point in the history
1.15.1.1
  • Loading branch information
Sav22999 authored Nov 10, 2023
2 parents 725736b + 06c29ef commit 44c5464
Show file tree
Hide file tree
Showing 62 changed files with 519 additions and 250 deletions.
1 change: 1 addition & 0 deletions app/.idea/.name

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions app/.idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion app/.idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions app/.idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

37 changes: 35 additions & 2 deletions app/.idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ android {
applicationId = "com.saverio.pdfviewer"
minSdk = 21
targetSdk = 33
versionCode = 60
versionName = "1.15"
versionCode = 62
versionName = "1.15.1.1"

testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
}
Expand Down
Binary file modified app/release/app-release.aab
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
package com.saverio.pdfviewer.ui

import android.app.AlertDialog
import android.text.Html
import android.content.Intent
import android.net.Uri
import androidx.core.content.ContextCompat
import com.github.barteksc.pdfviewer.PDFView
import com.github.barteksc.pdfviewer.link.DefaultLinkHandler
import com.github.barteksc.pdfviewer.link.LinkHandler
import com.github.barteksc.pdfviewer.model.LinkTapEvent
import com.saverio.pdfviewer.R


class SavPdfViewerLinkHandler(private val pdfView: PDFView) : LinkHandler {
override fun handleLinkEvent(event: LinkTapEvent) {
Expand All @@ -19,9 +22,7 @@ class SavPdfViewerLinkHandler(private val pdfView: PDFView) : LinkHandler {

private fun handleUri(uri: String) {
try {
pdfView.context.startActivity(
Intent(Intent.ACTION_VIEW, Uri.parse(uri))
)
showConfirmationDialog(uri)
} catch (e: Exception) {
error("No activity found for URI: $uri")
}
Expand All @@ -31,6 +32,31 @@ class SavPdfViewerLinkHandler(private val pdfView: PDFView) : LinkHandler {
pdfView.jumpTo(page)
}

private fun showConfirmationDialog(url: String) {
val alertDialogBuilder = AlertDialog.Builder(pdfView.context)

alertDialogBuilder.setTitle("Open link")
alertDialogBuilder.setMessage(
Html.fromHtml(
pdfView.context.getString(R.string.confirmation_open_link).replace("{{url}}", url)
)
)

alertDialogBuilder.setPositiveButton("Yes") { dialog, which ->
// Yes button
pdfView.context.startActivity(
Intent(Intent.ACTION_VIEW, Uri.parse(url))
)
}

alertDialogBuilder.setNegativeButton("No") { dialog, which ->
// No button
}

val alertDialog = alertDialogBuilder.create()
alertDialog.show()
}

companion object {
private val TAG = DefaultLinkHandler::class.java.simpleName
}
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/res/drawable/ic_all_bookmarks.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="16dp"
android:height="16dp"
android:width="20pt"
android:height="20pt"
android:viewportWidth="14"
android:viewportHeight="14">
<path
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/res/drawable/ic_back.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="16dp"
android:height="16dp"
android:width="20pt"
android:height="20pt"
android:viewportWidth="16"
android:viewportHeight="16">
<path
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/res/drawable/ic_close.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="50dp"
android:height="50dp"
android:width="20pt"
android:height="20pt"
android:viewportWidth="50"
android:viewportHeight="50">
<path
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/res/drawable/ic_dark_filter.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="18dp"
android:height="18dp"
android:width="20pt"
android:height="20pt"
android:viewportWidth="800"
android:viewportHeight="800">
<path
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/res/drawable/ic_dark_filter_disabled.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="18dp"
android:height="18dp"
android:width="20pt"
android:height="20pt"
android:viewportWidth="800"
android:viewportHeight="800">
<path
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/res/drawable/ic_dots.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="50dp"
android:height="50dp"
android:width="20pt"
android:height="20pt"
android:viewportWidth="24"
android:viewportHeight="24">
<path
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/res/drawable/ic_exit_fullscreen.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="16dp"
android:height="16dp"
android:width="20pt"
android:height="20pt"
android:viewportWidth="600"
android:viewportHeight="600">
<path
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/res/drawable/ic_fullscreen.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="16dp"
android:height="16dp"
android:width="20pt"
android:height="20pt"
android:viewportWidth="600"
android:viewportHeight="600">
<path
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/res/drawable/ic_get_help.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="16dp"
android:height="16dp"
android:width="20pt"
android:height="20pt"
android:viewportWidth="670"
android:viewportHeight="670">
<path
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/res/drawable/ic_go_to_top.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="20dp"
android:height="20dp"
android:width="20pt"
android:height="20pt"
android:viewportWidth="16"
android:viewportHeight="16">
<path
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/res/drawable/ic_light_off.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="16dp"
android:height="16dp"
android:width="20pt"
android:height="20pt"
android:viewportWidth="667"
android:viewportHeight="667">
<path
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/res/drawable/ic_light_on.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="16dp"
android:height="16dp"
android:width="20pt"
android:height="20pt"
android:viewportWidth="667"
android:viewportHeight="667">
<path
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/res/drawable/ic_no_bookmark.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="13dp"
android:height="16dp"
android:width="16pt"
android:height="20pt"
android:viewportWidth="434"
android:viewportHeight="584">
<path
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/res/drawable/ic_open_file.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="26dp"
android:height="26dp"
android:width="20pt"
android:height="20pt"
android:viewportWidth="26"
android:viewportHeight="26">
<path
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/res/drawable/ic_remove_bookmark.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="16dp"
android:height="16dp"
android:width="20pt"
android:height="20pt"
android:viewportWidth="667"
android:viewportHeight="667">
<path
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/res/drawable/ic_scroll_horizontally.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="18dp"
android:height="18dp"
android:width="20pt"
android:height="20pt"
android:viewportWidth="800"
android:viewportHeight="800">
<path
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/res/drawable/ic_scroll_vertically.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="18dp"
android:height="18dp"
android:width="20pt"
android:height="20pt"
android:viewportWidth="800"
android:viewportHeight="800">
<path
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/res/drawable/ic_share.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="18dp"
android:height="18dp"
android:width="20pt"
android:height="20pt"
android:viewportWidth="18"
android:viewportHeight="18">
<path
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/res/drawable/ic_single_page.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="18dp"
android:height="18dp"
android:width="20pt"
android:height="20pt"
android:viewportWidth="800"
android:viewportHeight="800">
<path
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/res/drawable/ic_single_page_disabled.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="18dp"
android:height="18dp"
android:width="20pt"
android:height="20pt"
android:viewportWidth="800"
android:viewportHeight="800">
<path
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/res/drawable/ic_yes_bookmark.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="13dp"
android:height="16dp"
android:width="16pt"
android:height="20pt"
android:viewportWidth="434"
android:viewportHeight="584">
<path
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/res/drawable/ic_zoom_in.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="16dp"
android:height="16dp"
android:width="20pt"
android:height="20pt"
android:viewportWidth="640"
android:viewportHeight="640">
<path
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/res/drawable/ic_zoom_out.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="16dp"
android:height="16dp"
android:width="20pt"
android:height="20pt"
android:viewportWidth="640"
android:viewportHeight="640">
<path
Expand Down
Loading

0 comments on commit 44c5464

Please sign in to comment.