Files
rr3-apk/decompiled/sources/androidx/appcompat/widget/AppCompatTextClassifierHelper.java
Daniel Elliott f9d20bb3fc Add decompiled APK source code (JADX)
- 28,932 files
- Full Java source code
- Smali files
- Resources

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-02-18 14:52:23 -08:00

50 lines
1.6 KiB
Java

package androidx.appcompat.widget;
import android.view.textclassifier.TextClassificationManager;
import android.view.textclassifier.TextClassifier;
import android.widget.TextView;
import androidx.annotation.DoNotInline;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.RequiresApi;
import androidx.core.util.Preconditions;
/* loaded from: classes.dex */
final class AppCompatTextClassifierHelper {
@Nullable
private TextClassifier mTextClassifier;
@NonNull
private TextView mTextView;
@RequiresApi(api = 26)
public void setTextClassifier(@Nullable TextClassifier textClassifier) {
this.mTextClassifier = textClassifier;
}
public AppCompatTextClassifierHelper(@NonNull TextView textView) {
this.mTextView = (TextView) Preconditions.checkNotNull(textView);
}
@NonNull
@RequiresApi(api = 26)
public TextClassifier getTextClassifier() {
TextClassifier textClassifier = this.mTextClassifier;
return textClassifier == null ? Api26Impl.getTextClassifier(this.mTextView) : textClassifier;
}
@RequiresApi(26)
public static final class Api26Impl {
private Api26Impl() {
}
@NonNull
@DoNotInline
public static TextClassifier getTextClassifier(@NonNull TextView textView) {
TextClassificationManager textClassificationManager = (TextClassificationManager) textView.getContext().getSystemService(TextClassificationManager.class);
return textClassificationManager != null ? textClassificationManager.getTextClassifier() : TextClassifier.NO_OP;
}
}
}