Use SDK 33
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing

This commit is contained in:
Michel Roux 2023-03-22 11:13:10 +01:00
parent 0e71b36361
commit a1260ae536
4 changed files with 21 additions and 8 deletions

View File

@ -3,16 +3,15 @@ plugins {
} }
android { android {
compileSdkVersion 32 compileSdkVersion 33
namespace "net.crystalyx.setaswallpaper" namespace "net.crystalyx.setaswallpaper"
defaultConfig { defaultConfig {
applicationId "net.crystalyx.setaswallpaper" applicationId "net.crystalyx.setaswallpaper"
minSdk 5 minSdk 5
//noinspection OldTargetApi targetSdkVersion 33
targetSdkVersion 32 versionCode 10
versionCode 9 versionName "3.3"
versionName "3.2"
} }
signingConfigs { signingConfigs {
@ -41,3 +40,7 @@ android {
targetCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8
} }
} }
tasks.withType(JavaCompile) {
options.deprecation = true
}

View File

@ -6,6 +6,7 @@ import android.content.Intent;
import android.graphics.Bitmap; import android.graphics.Bitmap;
import android.graphics.BitmapFactory; import android.graphics.BitmapFactory;
import android.net.Uri; import android.net.Uri;
import android.os.Build;
import android.os.Bundle; import android.os.Bundle;
import android.widget.Toast; import android.widget.Toast;
@ -26,11 +27,20 @@ public class SetWallpaperActivity extends Activity {
if ("text/plain".equals(type)) { if ("text/plain".equals(type)) {
handleUrl(intent.getStringExtra(Intent.EXTRA_TEXT)); handleUrl(intent.getStringExtra(Intent.EXTRA_TEXT));
} else if (type.startsWith("image/")) { } else if (type.startsWith("image/")) {
handleStream(intent.getParcelableExtra(Intent.EXTRA_STREAM)); handleStream(getParcelableExtraStream(intent));
} }
} }
} }
@SuppressWarnings("deprecation")
private Uri getParcelableExtraStream(Intent intent) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
return intent.getParcelableExtra(Intent.EXTRA_STREAM, Uri.class);
}
return intent.getParcelableExtra(Intent.EXTRA_STREAM);
}
private void handleUrl(String textUrl) { private void handleUrl(String textUrl) {
URL url; URL url;

View File

@ -18,4 +18,4 @@ android.useAndroidX=true
# Enables namespacing of each library's R class so that its R class includes only the # Enables namespacing of each library's R class so that its R class includes only the
# resources declared in the library itself and none from the library's dependencies, # resources declared in the library itself and none from the library's dependencies,
# thereby reducing the size of the R class for that library # thereby reducing the size of the R class for that library
android.nonTransitiveRClass=true android.nonTransitiveRClass=true

View File

@ -1,8 +1,8 @@
pluginManagement { pluginManagement {
repositories { repositories {
gradlePluginPortal()
google() google()
mavenCentral() mavenCentral()
gradlePluginPortal()
} }
} }
dependencyResolutionManagement { dependencyResolutionManagement {