Skip to content

Commit ff11df0

Browse files
quh4gko8thestinger
authored andcommitted
Build against android 13, resolve new deprecated APIs
1 parent fa2db54 commit ff11df0

2 files changed

Lines changed: 7 additions & 2 deletions

File tree

app/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ android {
3232
}
3333
}
3434

35-
compileSdk = 32
35+
compileSdk = 33
3636
buildToolsVersion = "33.0.0"
3737

3838
defaultConfig {

app/src/main/java/app/grapheneos/pdfviewer/PdfViewer.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import android.content.res.ColorStateList;
77
import android.graphics.Color;
88
import android.net.Uri;
9+
import android.os.Build;
910
import android.os.Bundle;
1011
import android.util.Log;
1112
import android.view.Gravity;
@@ -376,7 +377,11 @@ public void onZoomEnd() {
376377
}
377378

378379
if (savedInstanceState != null) {
379-
mUri = savedInstanceState.getParcelable(STATE_URI);
380+
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.TIRAMISU) {
381+
mUri = savedInstanceState.getParcelable(STATE_URI);
382+
} else {
383+
mUri = savedInstanceState.getParcelable(STATE_URI, Uri.class);
384+
}
380385
mPage = savedInstanceState.getInt(STATE_PAGE);
381386
mZoomRatio = savedInstanceState.getFloat(STATE_ZOOM_RATIO);
382387
mDocumentOrientationDegrees = savedInstanceState.getInt(STATE_DOCUMENT_ORIENTATION_DEGREES);

0 commit comments

Comments
 (0)