Fix live notifications

This commit is contained in:
tom79 2020-01-05 18:38:12 +01:00
parent 66f41358af
commit 49e5b0431a
2 changed files with 13 additions and 6 deletions

View File

@ -138,8 +138,8 @@ dependencies {
implementation "ch.acra:acra-notification:$acraVersion"
implementation 'com.github.stom79:Android-WYSIWYG-Editor:3.2.1'
implementation 'com.github.duanhong169:colorpicker:1.1.6'
implementation 'com.github.penfeizhou.android.animation:apng:1.3.1'
implementation 'com.github.penfeizhou.android.animation:gif:1.3.1'
implementation 'com.github.penfeizhou.android.animation:apng:1.1.0'
implementation 'com.github.penfeizhou.android.animation:gif:1.1.0'
implementation 'com.github.PhilJay:MPAndroidChart:v3.1.0'
implementation 'com.github.smarteist:autoimageslider:1.3.2'
//debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.0'

View File

@ -1057,9 +1057,16 @@ public class Status implements Parcelable {
if (endPosition <= contentSpan.toString().length() && endPosition >= startPosition) {
ImageSpan imageSpan;
if (!disableAnimatedEmoji) {
resource.setBounds(0, 0, (int) Helper.convertDpToPixel(20, context), (int) Helper.convertDpToPixel(20, context));
resource.setVisible(true, true);
imageSpan = new ImageSpan(resource);
try {
resource.setBounds(0, 0, (int) Helper.convertDpToPixel(20, context), (int) Helper.convertDpToPixel(20, context));
resource.setVisible(true, true);
imageSpan = new ImageSpan(resource);
}catch (Exception e) {
Bitmap bitmap = drawableToBitmap(resource.getCurrent());
imageSpan = new ImageSpan(context,
Bitmap.createScaledBitmap(bitmap, (int) Helper.convertDpToPixel(20, context),
(int) Helper.convertDpToPixel(20, context), false));
}
} else {
Bitmap bitmap = drawableToBitmap(resource.getCurrent());
@ -1126,7 +1133,7 @@ public class Status implements Parcelable {
SharedPreferences sharedpreferences = context.getSharedPreferences(Helper.APP_PREFS, Context.MODE_PRIVATE);
boolean disableAnimatedEmoji = sharedpreferences.getBoolean(Helper.SET_DISABLE_ANIMATED_EMOJI, false);
Poll poll = status.getReblog() == null ? status.getPoll() : status.getReblog().getPoll();
if (poll == null) {
if (poll == null || poll.getOptionsList() == null) {
status.setPollEmojiFound(true);
return;
}