summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas <tschneider.ac@gmail.com>2020-07-09 11:44:09 +0200
committerThomas <tschneider.ac@gmail.com>2020-07-09 11:44:09 +0200
commit63338b466100ab914d18d20f01b5a242328178ff (patch)
treeaf2be78b2f9761ebbbfbf57d9c46771d2a36ad94
parent89899557dfe2e4f3a5e68f483d287e8d6473dff1 (diff)
parent6cbbd7032a9ba10b5257078439bb5846c67a4d89 (diff)
Merge branch 'develop'
-rw-r--r--app/build.gradle4
-rw-r--r--app/src/main/assets/changelogs/375.txt20
-rw-r--r--app/src/main/java/app/fedilab/android/helper/Helper.java79
3 files changed, 63 insertions, 40 deletions
diff --git a/app/build.gradle b/app/build.gradle
index e3bad0031..c0269d71c 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -6,8 +6,8 @@ android {
defaultConfig {
minSdkVersion 19
targetSdkVersion 29
- versionCode 374
- versionName "2.36.0"
+ versionCode 375
+ versionName "2.36.1"
multiDexEnabled true
renderscriptTargetApi 28 as int
renderscriptSupportModeEnabled true
diff --git a/app/src/main/assets/changelogs/375.txt b/app/src/main/assets/changelogs/375.txt
new file mode 100644
index 000000000..9966180ef
--- /dev/null
+++ b/app/src/main/assets/changelogs/375.txt
@@ -0,0 +1,20 @@
+Added:
+- Select text for media description
+
+changed:
+- Increase media description length to 1500 chars
+- More details about accounts in notifications
+- Media management in timelines
+- Allow cross-account replies on followed instances
+
+Fixed:
+- Crash when having custom emoji in display name
+- Crash when adding media
+- Remove extra spaces at the bottom of messages
+- Some issue with custom emoji
+- Fix issue with "Your toots/notifications"
+- Fix issue with CW and Pixelfed
+- Fix some media not loaded in profiles
+- Scheduled toots from server side have an incorrect date
+- Incorrect feeds when checking instance admin account
+- Some crashes \ No newline at end of file
diff --git a/app/src/main/java/app/fedilab/android/helper/Helper.java b/app/src/main/java/app/fedilab/android/helper/Helper.java
index 688464427..1cf932db7 100644
--- a/app/src/main/java/app/fedilab/android/helper/Helper.java
+++ b/app/src/main/java/app/fedilab/android/helper/Helper.java
@@ -1972,8 +1972,9 @@ public class Helper {
activity.finish(); //User is logged out to get a new token
} else {
- makeEmojis(activity, username, account.getDisplayNameSpan(), account.getEmojis());
+
username.setText(String.format("@%s", account.getUsername() + "@" + account.getInstance()));
+ makeEmojis(activity, displayedName, account.getDisplayNameSpan(), account.getEmojis());
displayedName.setText(account.getDisplayNameSpan(), TextView.BufferType.SPANNABLE);
loadGiF(activity, account, profilePicture);
String urlHeader = !disableGif ? account.getHeader() : account.getHeader_static();
@@ -4411,51 +4412,53 @@ public class Helper {
if (emojis != null && emojis.size() > 0) {
for (final Emojis emoji : emojis) {
- Glide.with(context)
- .asDrawable()
- .load(disableAnimatedEmoji ? emoji.getStatic_url() : emoji.getUrl())
- .into(new CustomTarget<Drawable>() {
- @Override
- public void onResourceReady(@NonNull Drawable resource, @Nullable Transition<? super Drawable> transition) {
- final String targetedEmoji = ":" + emoji.getShortcode() + ":";
- if (contentSpan != null && contentSpan.toString().contains(targetedEmoji)) {
- //emojis can be used several times so we have to loop
- for (int startPosition = -1; (startPosition = contentSpan.toString().indexOf(targetedEmoji, startPosition + 1)) != -1; startPosition++) {
- final int endPosition = startPosition + targetedEmoji.length();
- if (endPosition <= contentSpan.toString().length() && endPosition >= startPosition) {
- ImageSpan imageSpan;
- try {
- resource.setBounds(0, 0, (int) Helper.convertDpToPixel(20, context), (int) Helper.convertDpToPixel(20, context));
- resource.setVisible(true, true);
- imageSpan = new ImageSpan(resource);
- contentSpan.setSpan(
- imageSpan, startPosition,
- endPosition, Spannable.SPAN_INCLUSIVE_EXCLUSIVE);
- if (customTextView instanceof CustomTextView) {
- ((CustomTextView) customTextView).setText(contentSpan, TextView.BufferType.SPANNABLE);
- } else if (customTextView instanceof RadioButton) {
- ((RadioButton) customTextView).setText(contentSpan, TextView.BufferType.SPANNABLE);
- } else if (customTextView instanceof CheckBox) {
- ((CheckBox) customTextView).setText(contentSpan, TextView.BufferType.SPANNABLE);
- } else if (customTextView instanceof AppCompatTextView) {
- ((AppCompatTextView) customTextView).setText(contentSpan, TextView.BufferType.SPANNABLE);
- } else if (customTextView instanceof TextView) {
- ((TextView) customTextView).setText(contentSpan, TextView.BufferType.SPANNABLE);
+ if (isValidContextForGlide(context)) {
+ Glide.with(context)
+ .asDrawable()
+ .load(disableAnimatedEmoji ? emoji.getStatic_url() : emoji.getUrl())
+ .into(new CustomTarget<Drawable>() {
+ @Override
+ public void onResourceReady(@NonNull Drawable resource, @Nullable Transition<? super Drawable> transition) {
+ final String targetedEmoji = ":" + emoji.getShortcode() + ":";
+ if (contentSpan != null && contentSpan.toString().contains(targetedEmoji)) {
+ //emojis can be used several times so we have to loop
+ for (int startPosition = -1; (startPosition = contentSpan.toString().indexOf(targetedEmoji, startPosition + 1)) != -1; startPosition++) {
+ final int endPosition = startPosition + targetedEmoji.length();
+ if (endPosition <= contentSpan.toString().length() && endPosition >= startPosition) {
+ ImageSpan imageSpan;
+ try {
+ resource.setBounds(0, 0, (int) Helper.convertDpToPixel(20, context), (int) Helper.convertDpToPixel(20, context));
+ resource.setVisible(true, true);
+ imageSpan = new ImageSpan(resource);
+ contentSpan.setSpan(
+ imageSpan, startPosition,
+ endPosition, Spannable.SPAN_INCLUSIVE_EXCLUSIVE);
+ if (customTextView instanceof CustomTextView) {
+ ((CustomTextView) customTextView).setText(contentSpan, TextView.BufferType.SPANNABLE);
+ } else if (customTextView instanceof RadioButton) {
+ ((RadioButton) customTextView).setText(contentSpan, TextView.BufferType.SPANNABLE);
+ } else if (customTextView instanceof CheckBox) {
+ ((CheckBox) customTextView).setText(contentSpan, TextView.BufferType.SPANNABLE);
+ } else if (customTextView instanceof AppCompatTextView) {
+ ((AppCompatTextView) customTextView).setText(contentSpan, TextView.BufferType.SPANNABLE);
+ } else if (customTextView instanceof TextView) {
+ ((TextView) customTextView).setText(contentSpan, TextView.BufferType.SPANNABLE);
+ }
+
+ } catch (Exception ignored) {
}
-
- } catch (Exception ignored) {
}
}
}
}
- }
- @Override
- public void onLoadCleared(@Nullable Drawable placeholder) {
+ @Override
+ public void onLoadCleared(@Nullable Drawable placeholder) {
- }
- });
+ }
+ });
+ }
}
}
}