ADD week 5

This commit is contained in:
2025-03-31 16:33:42 +02:00
parent 86f265f22d
commit bf645048e6
4927 changed files with 544053 additions and 0 deletions

View File

@ -0,0 +1,38 @@
package androidx.appcompat.widget;
import android.view.textclassifier.TextClassificationManager;
import android.view.textclassifier.TextClassifier;
import android.widget.TextView;
import androidx.core.util.Preconditions;
/* loaded from: classes.dex */
final class AppCompatTextClassifierHelper {
private TextClassifier mTextClassifier;
private TextView mTextView;
public void setTextClassifier(TextClassifier textClassifier) {
this.mTextClassifier = textClassifier;
}
AppCompatTextClassifierHelper(TextView textView) {
this.mTextView = (TextView) Preconditions.checkNotNull(textView);
}
public TextClassifier getTextClassifier() {
TextClassifier textClassifier = this.mTextClassifier;
return textClassifier == null ? Api26Impl.getTextClassifier(this.mTextView) : textClassifier;
}
private static final class Api26Impl {
private Api26Impl() {
}
static TextClassifier getTextClassifier(TextView textView) {
TextClassificationManager textClassificationManager = (TextClassificationManager) textView.getContext().getSystemService(TextClassificationManager.class);
if (textClassificationManager != null) {
return textClassificationManager.getTextClassifier();
}
return TextClassifier.NO_OP;
}
}
}