Skip to content

Commit

Permalink
Multidex removed
Browse files Browse the repository at this point in the history
File download related changes
  • Loading branch information
afreakyelf committed Dec 2, 2023
1 parent 2d9f92c commit 80e6e5f
Show file tree
Hide file tree
Showing 7 changed files with 42 additions and 20 deletions.
36 changes: 35 additions & 1 deletion .idea/deploymentTargetDropDown.xml

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

4 changes: 0 additions & 4 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ android {
targetSdk = 34
versionCode = 2
versionName = "1.1"
multiDexEnabled = true
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables {
useSupportLibrary = true
Expand Down Expand Up @@ -79,15 +78,12 @@ dependencies {
testImplementation("junit:junit:4.13.2")
androidTestImplementation("androidx.test.ext:junit:1.1.5")
androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1")
implementation("androidx.multidex:multidex:2.0.1")
implementation(project(":pdfViewer"))

testImplementation("androidx.test:core:1.5.0")
androidTestImplementation("androidx.test:runner:1.5.2")
androidTestImplementation("androidx.test:rules:1.5.0")
androidTestImplementation("androidx.test.ext:junit-ktx:1.1.5")


// compose
implementation(platform("androidx.compose:compose-bom:2023.10.01"))
androidTestImplementation(platform("androidx.compose:compose-bom:2023.10.01"))
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<uses-permission android:name="android.permission.ACCESS_MEDIA_LOCATION" />
<uses-permission
android:name="android.permission.WRITE_EXTERNAL_STORAGE"
tools:ignore="ScopedStorage" />
android:maxSdkVersion="28" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class MainActivity : AppCompatActivity() {
setContentView(view)

binding.onlinePdf.setOnClickListener {
launchPdfFromUrl(download_file_url1)
launchPdfFromUrl(download_file_url)
}

binding.pickPdfButton.setOnClickListener {
Expand Down
2 changes: 0 additions & 2 deletions pdfViewer/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ android {

defaultConfig {
minSdk = 21
multiDexEnabled = true
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
consumerProguardFiles("consumer-rules.pro")
}
Expand Down Expand Up @@ -58,7 +57,6 @@ dependencies {
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.3")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.7.3")
implementation("com.google.android.material:material:1.10.0")
implementation("androidx.multidex:multidex:2.0.1")
testImplementation("junit:junit:4.13.2")
androidTestImplementation("androidx.test.ext:junit:1.1.5")
androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1")
Expand Down
5 changes: 2 additions & 3 deletions pdfViewer/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"
android:maxSdkVersion="32" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"
android:maxSdkVersion="32" />
android:maxSdkVersion="28" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

Expand Down
11 changes: 3 additions & 8 deletions pdfViewer/src/main/java/com/rajat/pdfviewer/PdfViewerActivity.kt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.rajat.pdfviewer

import android.Manifest
import android.Manifest.permission
import android.app.Activity
import android.app.AlertDialog
Expand Down Expand Up @@ -109,12 +110,6 @@ class PdfViewerActivity : AppCompatActivity() {
}
}

private fun isActionBarPresent(): Boolean {
val typedValue = TypedValue()
theme.resolveAttribute(android.R.attr.windowActionBar, typedValue, true)
return typedValue.data != 0
}

private fun configureToolbar() {
val typedArray = theme.obtainStyledAttributes(R.styleable.PdfRendererView_toolbar)
try {
Expand Down Expand Up @@ -434,8 +429,8 @@ class PdfViewerActivity : AppCompatActivity() {
}

private fun checkAndStartDownload() {
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.TIRAMISU) {
// For OS versions below Android 13, use the old method
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.R) {
// For OS versions below Android 11, use the old method
if (ContextCompat.checkSelfPermission(
this, permission.WRITE_EXTERNAL_STORAGE
) == PackageManager.PERMISSION_GRANTED
Expand Down

0 comments on commit 80e6e5f

Please sign in to comment.