You've already forked android_translation_layer
mirror of
https://gitlab.com/android_translation_layer/android_translation_layer.git
synced 2025-10-27 11:48:10 -07:00
add APIs needed for non legacy NewPipe version
This commit is contained in:
@@ -108,4 +108,20 @@ public class TextUtils {
|
||||
float avail, TruncateAt where) {
|
||||
return text;
|
||||
}
|
||||
|
||||
public static void getChars(CharSequence s, int start, int end, char[] dest, int destoff) {
|
||||
Class<? extends CharSequence> c = s.getClass();
|
||||
if (c == String.class)
|
||||
((String) s).getChars(start, end, dest, destoff);
|
||||
else if (c == StringBuffer.class)
|
||||
((StringBuffer) s).getChars(start, end, dest, destoff);
|
||||
else if (c == StringBuilder.class)
|
||||
((StringBuilder) s).getChars(start, end, dest, destoff);
|
||||
else if (s instanceof GetChars)
|
||||
((GetChars) s).getChars(start, end, dest, destoff);
|
||||
else {
|
||||
for (int i = start; i < end; i++)
|
||||
dest[destoff++] = s.charAt(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user