diff --git a/app/build.gradle b/app/build.gradle index ebba81b6..7ec2ff17 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -55,9 +55,9 @@ dependencies { implementation 'androidx.constraintlayout:constraintlayout:2.1.4' implementation 'androidx.cardview:cardview:1.0.0' implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0' - implementation 'androidx.media3:media3-exoplayer:1.2.1' - implementation 'androidx.media3:media3-ui:1.2.1' - implementation 'androidx.media3:media3-datasource-okhttp:1.2.1' + implementation 'androidx.media3:media3-exoplayer:1.3.0' + implementation 'androidx.media3:media3-ui:1.3.0' + implementation 'androidx.media3:media3-datasource-okhttp:1.3.0' implementation 'androidx.viewpager2:viewpager2:1.0.0' //noinspection GradleDependency implementation 'com.squareup.okhttp3:okhttp:4.12.0' diff --git a/app/src/main/java/org/nuclearfog/twidda/backend/async/TextEmojiLoader.java b/app/src/main/java/org/nuclearfog/twidda/backend/async/TextEmojiLoader.java index c4ed8a48..3736747b 100644 --- a/app/src/main/java/org/nuclearfog/twidda/backend/async/TextEmojiLoader.java +++ b/app/src/main/java/org/nuclearfog/twidda/backend/async/TextEmojiLoader.java @@ -73,10 +73,21 @@ public class TextEmojiLoader extends AsyncExecutor images) { this.images = images; this.spannable = spannable; diff --git a/app/src/main/java/org/nuclearfog/twidda/ui/activities/ProfileActivity.java b/app/src/main/java/org/nuclearfog/twidda/ui/activities/ProfileActivity.java index ae084853..36481750 100644 --- a/app/src/main/java/org/nuclearfog/twidda/ui/activities/ProfileActivity.java +++ b/app/src/main/java/org/nuclearfog/twidda/ui/activities/ProfileActivity.java @@ -652,6 +652,8 @@ public class ProfileActivity extends AppCompatActivity implements OnClickListene follower.setVisibility(View.VISIBLE); user_createdAt.setVisibility(View.VISIBLE); screenName.setText(user.getScreenname()); + // set user join date + user_createdAt.setText(SimpleDateFormat.getDateInstance().format(user.getTimestamp())); // set status count if (user.getStatusCount() >= 0) { tabSelector.setLabel(0, StringUtils.NUMBER_FORMAT.format(user.getStatusCount())); @@ -665,22 +667,28 @@ public class ProfileActivity extends AppCompatActivity implements OnClickListene tabSelector.setLabel(1, ""); } // set username and emojis - if (!user.getUsername().trim().isEmpty() && user.getEmojis().length > 0) { + if (!user.getUsername().trim().isEmpty()) { Spannable usernameSpan = new SpannableString(user.getUsername()); - usernameSpan = EmojiUtils.removeTags(usernameSpan); - username.setText(usernameSpan); - } else { - username.setText(user.getUsername()); - } - // set user join date - user_createdAt.setText(SimpleDateFormat.getDateInstance().format(user.getTimestamp())); - // set user description - if (!user.getDescription().isEmpty()) { - Spannable descriptionSpan = Tagger.makeTextWithLinks(user.getDescription(), settings.getHighlightColor(), this); - if (user.getEmojis().length > 0) { - descriptionSpan = EmojiUtils.removeTags(descriptionSpan); + if (settings.imagesEnabled() && user.getEmojis().length > 0) { + TextEmojiLoader.Param param = new TextEmojiLoader.Param(user.getEmojis(), usernameSpan, getResources().getDimensionPixelSize(R.dimen.profile_icon_size)); + emojiLoader.execute(param, usernameUpdate); + username.setText(EmojiUtils.removeTags(usernameSpan)); + } else { + username.setText(usernameSpan); + } + } else { + username.setText(""); + } + // set user description + if (!user.getDescription().trim().isEmpty()) { + Spannable descriptionSpan = Tagger.makeTextWithLinks(user.getDescription(), settings.getHighlightColor(), this); + if (settings.imagesEnabled() && user.getEmojis().length > 0) { + TextEmojiLoader.Param param = new TextEmojiLoader.Param(user.getEmojis(), descriptionSpan, getResources().getDimensionPixelSize(R.dimen.profile_icon_size)); + emojiLoader.execute(param, userDescriptionUpdate); + description.setText(EmojiUtils.removeTags(descriptionSpan)); + } else { + description.setText(descriptionSpan); } - description.setText(descriptionSpan); description.setVisibility(View.VISIBLE); } else { description.setVisibility(View.GONE); @@ -746,19 +754,6 @@ public class ProfileActivity extends AppCompatActivity implements OnClickListene } else { profileImage.setImageDrawable(placeholder); } - // initialize emoji loading for username/description - if (settings.imagesEnabled() && user.getEmojis().length > 0) { - if (!user.getUsername().isEmpty()) { - SpannableString usernameSpan = new SpannableString(user.getUsername()); - TextEmojiLoader.Param param = new TextEmojiLoader.Param(user.getEmojis(), usernameSpan, getResources().getDimensionPixelSize(R.dimen.profile_icon_size)); - emojiLoader.execute(param, usernameUpdate); - } - if (!user.getDescription().trim().isEmpty()) { - Spannable descriptionSpan = new SpannableString(user.getDescription()); - TextEmojiLoader.Param param = new TextEmojiLoader.Param(user.getEmojis(), descriptionSpan, getResources().getDimensionPixelSize(R.dimen.profile_icon_size)); - emojiLoader.execute(param, userDescriptionUpdate); - } - } } /** diff --git a/app/src/main/java/org/nuclearfog/twidda/ui/adapter/recyclerview/holder/FieldHolder.java b/app/src/main/java/org/nuclearfog/twidda/ui/adapter/recyclerview/holder/FieldHolder.java index cf66591e..fbeba9ab 100644 --- a/app/src/main/java/org/nuclearfog/twidda/ui/adapter/recyclerview/holder/FieldHolder.java +++ b/app/src/main/java/org/nuclearfog/twidda/ui/adapter/recyclerview/holder/FieldHolder.java @@ -2,6 +2,7 @@ package org.nuclearfog.twidda.ui.adapter.recyclerview.holder; import android.graphics.Color; import android.text.Spannable; +import android.text.SpannableString; import android.text.method.LinkMovementMethod; import android.view.LayoutInflater; import android.view.View; @@ -31,7 +32,7 @@ import java.util.Random; * * @author nuclearfog */ -public class FieldHolder extends ViewHolder implements AsyncCallback { +public class FieldHolder extends ViewHolder { private static final Random RND = new Random(); @@ -42,6 +43,9 @@ public class FieldHolder extends ViewHolder implements AsyncCallback resultValue = this::onValueResult; + private AsyncCallback resultKey = this::onKeyResult; + private long tagId = RND.nextLong(); /** @@ -64,9 +68,20 @@ public class FieldHolder extends ViewHolder implements AsyncCallback 0) { + if (emojis.length > 0 && settings.imagesEnabled()) { + // set emojis of the value field TextEmojiLoader.Param param = new TextEmojiLoader.Param(tagId, emojis, valueSpan, value.getResources().getDimensionPixelSize(R.dimen.item_field_emoji_size)); - emojiLoader.execute(param, this); + emojiLoader.execute(param, resultValue); value.setText(EmojiUtils.removeTags(valueSpan)); + // set emojis of the key field + param = new TextEmojiLoader.Param(tagId, emojis, keySpan, value.getResources().getDimensionPixelSize(R.dimen.item_field_emoji_size)); + emojiLoader.execute(param, resultKey); + key.setText(EmojiUtils.removeTags(keySpan)); } else { value.setText(valueSpan); + key.setText(keySpan); } } } \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index ccebba77..d64cd491 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index ac7cb7a1..db8c3baa 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -3,5 +3,6 @@ distributionPath=wrapper/dists distributionSha256Sum=9d926787066a081739e8200858338b4a69e837c3a821a33aca9db09dd4a41026 distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew index 79a61d42..1aa94a42 100755 --- a/gradlew +++ b/gradlew @@ -83,10 +83,8 @@ done # This is normally unused # shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit - -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum @@ -133,10 +131,13 @@ location of your Java installation." fi else JAVACMD=java - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + if ! command -v java >/dev/null 2>&1 + then + die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. Please set the JAVA_HOME variable in your environment to match the location of your Java installation." + fi fi # Increase the maximum file descriptors if we can. @@ -144,7 +145,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then case $MAX_FD in #( max*) # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 + # shellcheck disable=SC2039,SC3045 MAX_FD=$( ulimit -H -n ) || warn "Could not query maximum file descriptor limit" esac @@ -152,7 +153,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then '' | soft) :;; #( *) # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 + # shellcheck disable=SC2039,SC3045 ulimit -n "$MAX_FD" || warn "Could not set maximum file descriptor limit to $MAX_FD" esac @@ -197,11 +198,15 @@ if "$cygwin" || "$msys" ; then done fi -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ "-Dorg.gradle.appname=$APP_BASE_NAME" \