1
0
mirror of https://github.com/TeamNewPipe/NewPipe synced 2025-11-04 01:03:00 +00:00

Merge branch 'dev' into refactor

Had to make some adjustments to make https://github.com/TeamNewPipe/NewPipe/pull/12188 work
This commit is contained in:
Stypox
2025-05-08 15:33:57 +02:00
36 changed files with 69 additions and 18 deletions

View File

@@ -27,9 +27,9 @@ android {
if (System.properties.containsKey('versionCodeOverride')) {
versionCode System.getProperty('versionCodeOverride') as Integer
} else {
versionCode 1003
versionCode 1004
}
versionName "0.27.6"
versionName "0.27.7"
if (System.properties.containsKey('versionNameSuffix')) {
versionNameSuffix System.getProperty('versionNameSuffix')
}

View File

@@ -194,9 +194,6 @@ public abstract class BaseLocalListFragment<I, N> extends BaseStateFragment<I>
if (itemsList != null) {
animateHideRecyclerViewAllowingScrolling(itemsList);
}
if (headerRootBinding != null) {
animate(headerRootBinding.getRoot(), false, 200);
}
}
@Override
@@ -205,9 +202,6 @@ public abstract class BaseLocalListFragment<I, N> extends BaseStateFragment<I>
if (itemsList != null) {
animate(itemsList, true, 200);
}
if (headerRootBinding != null) {
animate(headerRootBinding.getRoot(), true, 200);
}
}
@Override
@@ -253,9 +247,6 @@ public abstract class BaseLocalListFragment<I, N> extends BaseStateFragment<I>
if (itemsList != null) {
animateHideRecyclerViewAllowingScrolling(itemsList);
}
if (headerRootBinding != null) {
animate(headerRootBinding.getRoot(), false, 200);
}
}
@Override

View File

@@ -99,10 +99,12 @@ fun Comment(comment: CommentsInfoItem, onCommentAuthorOpened: () -> Unit) {
}
val nameAndDate = remember(comment) {
val date = Localization.relativeTimeOrTextual(
context, comment.uploadDate, comment.textualUploadDate
Localization.concatenateStrings(
Localization.localizeUserName(comment.uploaderName),
Localization.relativeTimeOrTextual(
context, comment.uploadDate, comment.textualUploadDate
)
)
Localization.concatenateStrings(comment.uploaderName, date)
}
Text(
text = nameAndDate,

View File

@@ -11,6 +11,7 @@ import android.icu.text.CompactDecimalFormat;
import android.os.Build;
import android.text.TextUtils;
import android.text.format.DateUtils;
import android.text.BidiFormatter;
import android.util.DisplayMetrics;
import android.util.Log;
@@ -85,6 +86,25 @@ public final class Localization {
.collect(Collectors.joining(delimiter));
}
/**
* Localize a user name like <code>@foobar</code>.
*
* Will correctly handle right-to-left usernames by using a {@link BidiFormatter}.
*
* @param plainName username, with an optional leading <code>@</code>
* @return a usernames that can include RTL-characters
*/
@NonNull
public static String localizeUserName(final String plainName) {
final BidiFormatter bidi = BidiFormatter.getInstance();
if (plainName.startsWith("@")) {
return "@" + bidi.unicodeWrap(plainName.substring(1));
} else {
return bidi.unicodeWrap(plainName);
}
}
public static org.schabi.newpipe.extractor.localization.Localization getPreferredLocalization(
final Context context) {
return org.schabi.newpipe.extractor.localization.Localization