Merge "Fix not show translation if call startTranslation after pauseTranslation" into sc-qpr1-dev am: e82a38a8ee am: d8b714a0ec
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16001112 Change-Id: I8ded71f8811d8d95f7e39c4fa7d4f3177f0ffb3a
This commit is contained in:
@@ -426,15 +426,19 @@ public class UiTranslationController {
|
||||
continue;
|
||||
}
|
||||
mActivity.runOnUiThread(() -> {
|
||||
ViewTranslationCallback callback = view.getViewTranslationCallback();
|
||||
if (view.getViewTranslationResponse() != null
|
||||
&& view.getViewTranslationResponse().equals(response)) {
|
||||
if (DEBUG) {
|
||||
Log.d(TAG, "Duplicate ViewTranslationResponse for " + autofillId
|
||||
+ ". Ignoring.");
|
||||
if (callback instanceof TextViewTranslationCallback) {
|
||||
if (((TextViewTranslationCallback) callback).isShowingTranslation()) {
|
||||
if (DEBUG) {
|
||||
Log.d(TAG, "Duplicate ViewTranslationResponse for " + autofillId
|
||||
+ ". Ignoring.");
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
ViewTranslationCallback callback = view.getViewTranslationCallback();
|
||||
if (callback == null) {
|
||||
if (view instanceof TextView) {
|
||||
// developer doesn't provide their override, we set the default TextView
|
||||
|
||||
Reference in New Issue
Block a user