Use SDK 33
This commit is contained in:
parent
0e71b36361
commit
a1260ae536
@ -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
|
||||
}
|
||||
|
@ -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;
|
||||
|
||||
|
@ -1,8 +1,8 @@
|
||||
pluginManagement {
|
||||
repositories {
|
||||
gradlePluginPortal()
|
||||
google()
|
||||
mavenCentral()
|
||||
gradlePluginPortal()
|
||||
}
|
||||
}
|
||||
dependencyResolutionManagement {
|
||||
|
Loading…
Reference in New Issue
Block a user