- Added realracing3-community.apk (71.57 MB) - Removed 32-bit support (armeabi-v7a) - Only includes arm64-v8a libraries - Decompiled source code included - Added README-community.md with analysis
149 lines
4.5 KiB
Java
149 lines
4.5 KiB
Java
package androidx.emoji2.text;
|
|
|
|
import android.os.Build;
|
|
import android.text.Spannable;
|
|
import android.text.SpannableString;
|
|
import android.text.Spanned;
|
|
import androidx.annotation.NonNull;
|
|
import androidx.annotation.RequiresApi;
|
|
import androidx.core.text.PrecomputedTextCompat;
|
|
import androidx.core.text.PrecomputedTextCompat$$ExternalSyntheticApiModelOutline0;
|
|
import java.util.stream.IntStream;
|
|
|
|
/* loaded from: classes.dex */
|
|
class UnprecomputeTextOnModificationSpannable implements Spannable {
|
|
|
|
@NonNull
|
|
private Spannable mDelegate;
|
|
private boolean mSafeToWrite = false;
|
|
|
|
public Spannable getUnwrappedSpannable() {
|
|
return this.mDelegate;
|
|
}
|
|
|
|
public UnprecomputeTextOnModificationSpannable(@NonNull Spannable spannable) {
|
|
this.mDelegate = spannable;
|
|
}
|
|
|
|
public UnprecomputeTextOnModificationSpannable(@NonNull Spanned spanned) {
|
|
this.mDelegate = new SpannableString(spanned);
|
|
}
|
|
|
|
public UnprecomputeTextOnModificationSpannable(@NonNull CharSequence charSequence) {
|
|
this.mDelegate = new SpannableString(charSequence);
|
|
}
|
|
|
|
private void ensureSafeWrites() {
|
|
Spannable spannable = this.mDelegate;
|
|
if (!this.mSafeToWrite && precomputedTextDetector().isPrecomputedText(spannable)) {
|
|
this.mDelegate = new SpannableString(spannable);
|
|
}
|
|
this.mSafeToWrite = true;
|
|
}
|
|
|
|
@Override // android.text.Spannable
|
|
public void setSpan(Object obj, int i, int i2, int i3) {
|
|
ensureSafeWrites();
|
|
this.mDelegate.setSpan(obj, i, i2, i3);
|
|
}
|
|
|
|
@Override // android.text.Spannable
|
|
public void removeSpan(Object obj) {
|
|
ensureSafeWrites();
|
|
this.mDelegate.removeSpan(obj);
|
|
}
|
|
|
|
@Override // android.text.Spanned
|
|
public <T> T[] getSpans(int i, int i2, Class<T> cls) {
|
|
return (T[]) this.mDelegate.getSpans(i, i2, cls);
|
|
}
|
|
|
|
@Override // android.text.Spanned
|
|
public int getSpanStart(Object obj) {
|
|
return this.mDelegate.getSpanStart(obj);
|
|
}
|
|
|
|
@Override // android.text.Spanned
|
|
public int getSpanEnd(Object obj) {
|
|
return this.mDelegate.getSpanEnd(obj);
|
|
}
|
|
|
|
@Override // android.text.Spanned
|
|
public int getSpanFlags(Object obj) {
|
|
return this.mDelegate.getSpanFlags(obj);
|
|
}
|
|
|
|
@Override // android.text.Spanned
|
|
public int nextSpanTransition(int i, int i2, Class cls) {
|
|
return this.mDelegate.nextSpanTransition(i, i2, cls);
|
|
}
|
|
|
|
@Override // java.lang.CharSequence
|
|
public int length() {
|
|
return this.mDelegate.length();
|
|
}
|
|
|
|
@Override // java.lang.CharSequence
|
|
public char charAt(int i) {
|
|
return this.mDelegate.charAt(i);
|
|
}
|
|
|
|
@Override // java.lang.CharSequence
|
|
@NonNull
|
|
public CharSequence subSequence(int i, int i2) {
|
|
return this.mDelegate.subSequence(i, i2);
|
|
}
|
|
|
|
@Override // java.lang.CharSequence
|
|
@NonNull
|
|
public String toString() {
|
|
return this.mDelegate.toString();
|
|
}
|
|
|
|
@Override // java.lang.CharSequence
|
|
@NonNull
|
|
@RequiresApi(api = 24)
|
|
public IntStream chars() {
|
|
return CharSequenceHelper_API24.chars(this.mDelegate);
|
|
}
|
|
|
|
@Override // java.lang.CharSequence
|
|
@NonNull
|
|
@RequiresApi(api = 24)
|
|
public IntStream codePoints() {
|
|
return CharSequenceHelper_API24.codePoints(this.mDelegate);
|
|
}
|
|
|
|
@RequiresApi(24)
|
|
public static class CharSequenceHelper_API24 {
|
|
private CharSequenceHelper_API24() {
|
|
}
|
|
|
|
public static IntStream codePoints(CharSequence charSequence) {
|
|
return charSequence.codePoints();
|
|
}
|
|
|
|
public static IntStream chars(CharSequence charSequence) {
|
|
return charSequence.chars();
|
|
}
|
|
}
|
|
|
|
public static PrecomputedTextDetector precomputedTextDetector() {
|
|
return Build.VERSION.SDK_INT < 28 ? new PrecomputedTextDetector() : new PrecomputedTextDetector_28();
|
|
}
|
|
|
|
public static class PrecomputedTextDetector {
|
|
public boolean isPrecomputedText(CharSequence charSequence) {
|
|
return charSequence instanceof PrecomputedTextCompat;
|
|
}
|
|
}
|
|
|
|
@RequiresApi(28)
|
|
public static class PrecomputedTextDetector_28 extends PrecomputedTextDetector {
|
|
@Override // androidx.emoji2.text.UnprecomputeTextOnModificationSpannable.PrecomputedTextDetector
|
|
public boolean isPrecomputedText(CharSequence charSequence) {
|
|
return PrecomputedTextCompat$$ExternalSyntheticApiModelOutline0.m(charSequence) || (charSequence instanceof PrecomputedTextCompat);
|
|
}
|
|
}
|
|
}
|