upgrade minSdkVersion to 19

This commit is contained in:
Conny Duck 2018-04-14 13:56:48 +02:00
parent 5d5c103644
commit 28a85639ed
4 changed files with 12 additions and 28 deletions

View File

@ -8,7 +8,7 @@ android {
buildToolsVersion '27.0.3'
defaultConfig {
applicationId "com.keylesspalace.tusky"
minSdkVersion 18
minSdkVersion 19
targetSdkVersion 27
versionCode 34
versionName "1.5.2"

View File

@ -31,7 +31,6 @@ import android.graphics.PorterDuff;
import android.graphics.drawable.Drawable;
import android.net.Uri;
import android.os.AsyncTask;
import android.os.Build;
import android.os.Bundle;
import android.os.Environment;
import android.os.Parcel;
@ -972,20 +971,12 @@ public final class ComposeActivity
}
private void initiateMediaPicking() {
Intent intent;
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
intent = new Intent(Intent.ACTION_OPEN_DOCUMENT);
} else {
intent = new Intent(Intent.ACTION_GET_CONTENT);
}
Intent intent = new Intent(Intent.ACTION_OPEN_DOCUMENT);
intent.addCategory(Intent.CATEGORY_OPENABLE);
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.KITKAT) {
intent.setType("image/* video/*");
} else {
String[] mimeTypes = new String[]{"image/*", "video/*"};
intent.setType("*/*");
intent.putExtra(Intent.EXTRA_MIME_TYPES, mimeTypes);
}
String[] mimeTypes = new String[]{"image/*", "video/*"};
intent.setType("*/*");
intent.putExtra(Intent.EXTRA_MIME_TYPES, mimeTypes);
startActivityForResult(intent, MEDIA_PICK_RESULT);
}
@ -1283,7 +1274,7 @@ public final class ComposeActivity
super.onActivityResult(requestCode, resultCode, intent);
if (resultCode == RESULT_OK && requestCode == MEDIA_PICK_RESULT && intent != null) {
Uri uri = intent.getData();
if (uri != null && Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
if (uri != null) {
// this is necessary so the SendTootService can access the uri later
final int takeFlags = intent.getFlags() & Intent.FLAG_GRANT_READ_URI_PERMISSION;
getContentResolver().takePersistableUriPermission(uri, takeFlags);

View File

@ -17,7 +17,6 @@ package com.keylesspalace.tusky.adapter;
import android.content.Context;
import android.graphics.drawable.Drawable;
import android.os.Build;
import android.support.annotation.Nullable;
import android.view.View;
import android.widget.ImageView;
@ -52,11 +51,8 @@ public class StatusViewHolder extends StatusBaseViewHolder {
Context context = avatar.getContext();
boolean hasReblog = rebloggedUrl != null && !rebloggedUrl.isEmpty();
int padding = hasReblog ? Utils.dpToPx(context, 12) : 0;
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
avatar.setPaddingRelative(0, 0, padding, padding);
} else {
avatar.setPadding(0, 0, padding, padding);
}
avatar.setPaddingRelative(0, 0, padding, padding);
if (hasReblog) {
avatarReblog.setVisibility(View.VISIBLE);

View File

@ -89,21 +89,18 @@ public class NotificationHelper {
currentNotifications = new JSONArray();
}
boolean alreadyContains = false;
for (int i = 0; i < currentNotifications.length(); i++) {
try {
if (currentNotifications.getString(i).equals(body.getAccount().getName())) {
alreadyContains = true;
currentNotifications.remove(i);
break;
}
} catch (JSONException e) {
Log.d(TAG, Log.getStackTraceString(e));
}
}
if (!alreadyContains) {
currentNotifications.put(body.getAccount().getName());
}
currentNotifications.put(body.getAccount().getName());
account.setActiveNotifications(currentNotifications.toString());