Compile with SDK 33

This commit is contained in:
M66B 2022-06-09 10:19:14 +02:00
parent 86ed20a1bd
commit 6b5de123e8
3 changed files with 9 additions and 7 deletions

View File

@ -16,7 +16,7 @@ if (rootProject.file("local.properties").exists())
localProperties.load(new FileInputStream(rootProject.file("local.properties")))
android {
compileSdkVersion 32
compileSdkVersion 33
namespace 'eu.faircode.email'
// https://apilevels.com/

View File

@ -58,6 +58,7 @@ import android.provider.CalendarContract;
import android.provider.ContactsContract;
import android.provider.MediaStore;
import android.provider.Settings;
import android.text.Layout;
import android.text.Spannable;
import android.text.SpannableString;
import android.text.SpannableStringBuilder;
@ -879,7 +880,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
tvBody = vsBody.findViewById(R.id.tvBody);
if (BuildConfig.DEBUG && BuildCompat.isAtLeastT()) {
tvBody.setHyphenationFrequency(4 /* HYPHENATION_FREQUENCY_FULL_FAST */);
tvBody.setHyphenationFrequency(Layout.HYPHENATION_FREQUENCY_FULL_FAST);
tvBody.setBreakStrategy(LineBreaker.BREAK_STRATEGY_HIGH_QUALITY);
}
wvBody = vsBody.findViewById(R.id.wvBody);

View File

@ -3045,13 +3045,14 @@ public class FragmentCompose extends FragmentBase {
} else {
// https://developer.android.com/reference/android/provider/MediaStore#ACTION_PICK_IMAGES
// Android 12: cmd device_config put storage_native_boot picker_intent_enabled true
Intent picker = new Intent("android.provider.action.PICK_IMAGES");
picker.putExtra("android.provider.extra.PICK_IMAGES_MAX", 10);
Intent picker = new Intent(MediaStore.ACTION_PICK_IMAGES);
picker.setType("image/*");
if (BuildCompat.isAtLeastT() &&
picker.resolveActivity(pm) != null)
if (BuildCompat.isAtLeastT() && picker.resolveActivity(pm) != null) {
Log.i("Using photo picker");
picker.putExtra(MediaStore.EXTRA_PICK_IMAGES_MAX, MediaStore.getPickImagesMaxLimit());
startActivityForResult(picker, REQUEST_IMAGE_FILE);
else {
} else {
Log.i("Using file picker");
Intent intent = new Intent(Intent.ACTION_GET_CONTENT);
intent.addCategory(Intent.CATEGORY_OPENABLE);
intent.setType("image/*");