mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-12 10:49:06 +01:00
Code cleanup.
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
package org.briarproject.android.util;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.bluetooth.BluetoothAdapter;
|
||||
import android.content.Context;
|
||||
import android.os.Build;
|
||||
@@ -53,10 +52,9 @@ public class AndroidUtils {
|
||||
|
||||
private static final String STORED_REPORTS = "dev-reports";
|
||||
|
||||
@SuppressLint("NewApi")
|
||||
@SuppressWarnings("deprecation")
|
||||
public static Collection<String> getSupportedArchitectures() {
|
||||
List<String> abis = new ArrayList<String>();
|
||||
List<String> abis = new ArrayList<>();
|
||||
if (Build.VERSION.SDK_INT >= 21) {
|
||||
abis.addAll(Arrays.asList(Build.SUPPORTED_ABIS));
|
||||
} else {
|
||||
@@ -67,17 +65,12 @@ public class AndroidUtils {
|
||||
}
|
||||
|
||||
public static void setError(TextInputLayout til, String error,
|
||||
boolean condition) {
|
||||
if (condition) {
|
||||
if (til.getError() == null)
|
||||
til.setError(error);
|
||||
} else
|
||||
boolean set) {
|
||||
if (set) {
|
||||
if (til.getError() == null) til.setError(error);
|
||||
} else {
|
||||
til.setError(null);
|
||||
}
|
||||
|
||||
public static void setError(TextInputLayout til, int res,
|
||||
boolean condition) {
|
||||
setError(til, til.getContext().getString(res), condition);
|
||||
}
|
||||
}
|
||||
|
||||
public static String getBluetoothAddress(Context ctx,
|
||||
@@ -128,9 +121,8 @@ public class AndroidUtils {
|
||||
MIN_RESOLUTION, WEEK_IN_MILLIS, flags).toString();
|
||||
}
|
||||
// otherwise just show "...ago" or date string
|
||||
return DateUtils
|
||||
.getRelativeTimeSpanString(time, System.currentTimeMillis(),
|
||||
MIN_RESOLUTION, flags).toString();
|
||||
return DateUtils.getRelativeTimeSpanString(time,
|
||||
System.currentTimeMillis(), MIN_RESOLUTION, flags).toString();
|
||||
}
|
||||
|
||||
public static SpannableStringBuilder getTeaser(Context ctx, Spanned body) {
|
||||
|
||||
Reference in New Issue
Block a user