Use SDK 33
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/tag Build is passing Details

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 {
compileSdkVersion 32
compileSdkVersion 33
namespace "net.crystalyx.setaswallpaper"
defaultConfig {
applicationId "net.crystalyx.setaswallpaper"
minSdk 5
//noinspection OldTargetApi
targetSdkVersion 32
versionCode 9
versionName "3.2"
targetSdkVersion 33
versionCode 10
versionName "3.3"
}
signingConfigs {
@ -41,3 +40,7 @@ android {
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.BitmapFactory;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.widget.Toast;
@ -26,11 +27,20 @@ public class SetWallpaperActivity extends Activity {
if ("text/plain".equals(type)) {
handleUrl(intent.getStringExtra(Intent.EXTRA_TEXT));
} 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) {
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
# resources declared in the library itself and none from the library's dependencies,
# thereby reducing the size of the R class for that library
android.nonTransitiveRClass=true
android.nonTransitiveRClass=true

View File

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