Bug fix: Move the implementation out from View.onTranslationResponse.
Keep onTranslationResponse() only to save TranslationResponse. We can move set TransformationMethod logic to TextViewTranslationCallback. With the current implementation, if the developers overrides onTranslationResponse(), they don't have a chance to use the TextView default ViewTranslationCallback implementation because they don't set the TranslationTransformation, they must implement their solution. If we move logic to TextViewViewTranslationCallback and the developers only overrides onTranslationResponse(), they still have a chance to use the default TextViewViewTranslationCallback if the developers set the TranslationResponse for View. Bug: 178353965 Test: manual to make sure translation still works. Test: atest CtsTranslationTestCases Change-Id: Iada7f3efbbc7705ecf962c78e275ed942816707f
Loading
Please register or sign in to comment