From 1e63a8291579043659f86dbb46d4d63d3225c471 Mon Sep 17 00:00:00 2001 From: Christian Schneppe Date: Sun, 23 Sep 2018 16:42:56 +0200 Subject: preview media before sending them and allow sharing and attaching of multiple files --- src/main/java/de/pixart/messenger/utils/IrregularUnicodeDetector.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/main/java/de/pixart/messenger/utils') diff --git a/src/main/java/de/pixart/messenger/utils/IrregularUnicodeDetector.java b/src/main/java/de/pixart/messenger/utils/IrregularUnicodeDetector.java index b54f8d074..c0c8ca770 100644 --- a/src/main/java/de/pixart/messenger/utils/IrregularUnicodeDetector.java +++ b/src/main/java/de/pixart/messenger/utils/IrregularUnicodeDetector.java @@ -50,7 +50,7 @@ import java.util.regex.Matcher; import java.util.regex.Pattern; import de.pixart.messenger.R; -import de.pixart.messenger.ui.util.Color; +import de.pixart.messenger.ui.util.StyledAttributes; import rocks.xmpp.addr.Jid; public class IrregularUnicodeDetector { @@ -73,7 +73,7 @@ public class IrregularUnicodeDetector { } public static Spannable style(Context context, Jid jid) { - return style(jid, Color.get(context, R.attr.color_warning)); + return style(jid, StyledAttributes.get(context, R.attr.color_warning)); } private static Spannable style(Jid jid, @ColorInt int color) { -- cgit v1.2.3 From f873cd2b5f9ea6fdf76bfe6e5b283543ac3d97d7 Mon Sep 17 00:00:00 2001 From: Christian Schneppe Date: Sun, 23 Sep 2018 19:58:11 +0200 Subject: show media preview in messagebubble like text messages --- src/main/java/de/pixart/messenger/utils/IrregularUnicodeDetector.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/main/java/de/pixart/messenger/utils') diff --git a/src/main/java/de/pixart/messenger/utils/IrregularUnicodeDetector.java b/src/main/java/de/pixart/messenger/utils/IrregularUnicodeDetector.java index c0c8ca770..3cd715a4c 100644 --- a/src/main/java/de/pixart/messenger/utils/IrregularUnicodeDetector.java +++ b/src/main/java/de/pixart/messenger/utils/IrregularUnicodeDetector.java @@ -73,7 +73,7 @@ public class IrregularUnicodeDetector { } public static Spannable style(Context context, Jid jid) { - return style(jid, StyledAttributes.get(context, R.attr.color_warning)); + return style(jid, StyledAttributes.getColor(context, R.attr.color_warning)); } private static Spannable style(Jid jid, @ColorInt int color) { -- cgit v1.2.3 From 3237fc518d4025a6e39786a5e443b9dcb144e431 Mon Sep 17 00:00:00 2001 From: Christian Schneppe Date: Wed, 26 Sep 2018 21:34:37 +0200 Subject: do not use BC provider on android 22+ --- src/main/java/de/pixart/messenger/utils/Compatibility.java | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/main/java/de/pixart/messenger/utils') diff --git a/src/main/java/de/pixart/messenger/utils/Compatibility.java b/src/main/java/de/pixart/messenger/utils/Compatibility.java index 95d7b4ef2..640a74083 100644 --- a/src/main/java/de/pixart/messenger/utils/Compatibility.java +++ b/src/main/java/de/pixart/messenger/utils/Compatibility.java @@ -30,6 +30,10 @@ public class Compatibility { return Build.VERSION.SDK_INT >= Build.VERSION_CODES.O; } + public static boolean twentyTwo() { + return Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP_MR1; + } + private static boolean getBooleanPreference(Context context, String name, @BoolRes int res) { return getPreferences(context).getBoolean(name, context.getResources().getBoolean(res)); } -- cgit v1.2.3 From f4ac1f68feac3e3b19ab5932ede9d79dd14bff27 Mon Sep 17 00:00:00 2001 From: Christian Schneppe Date: Wed, 26 Sep 2018 21:48:57 +0200 Subject: do not show media overview in contact/conference details when missing storage permission --- src/main/java/de/pixart/messenger/utils/Compatibility.java | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/main/java/de/pixart/messenger/utils') diff --git a/src/main/java/de/pixart/messenger/utils/Compatibility.java b/src/main/java/de/pixart/messenger/utils/Compatibility.java index 640a74083..3ebc7c4f6 100644 --- a/src/main/java/de/pixart/messenger/utils/Compatibility.java +++ b/src/main/java/de/pixart/messenger/utils/Compatibility.java @@ -2,12 +2,14 @@ package de.pixart.messenger.utils; import android.content.Context; import android.content.SharedPreferences; +import android.content.pm.PackageManager; import android.os.Build; import android.preference.Preference; import android.preference.PreferenceCategory; import android.preference.PreferenceManager; import android.preference.PreferenceScreen; import android.support.annotation.BoolRes; +import android.support.v4.content.ContextCompat; import java.util.Arrays; import java.util.Collections; @@ -26,6 +28,10 @@ public class Compatibility { "vibrate_on_notification"); private static final List UNUESD_SETTINGS_PRE_TWENTYSIX = Collections.singletonList("more_notification_settings"); + public static boolean hasStoragePermission(Context context) { + return Build.VERSION.SDK_INT < Build.VERSION_CODES.M || ContextCompat.checkSelfPermission(context, android.Manifest.permission.WRITE_EXTERNAL_STORAGE) == PackageManager.PERMISSION_GRANTED; + } + public static boolean twentySix() { return Build.VERSION.SDK_INT >= Build.VERSION_CODES.O; } -- cgit v1.2.3