Fix translation doesn't work on ViewGroup
The system will add requested view reference into cache but it is possible the requested translation view is a viewgroup, we don't add this into view reference list that cause the translation doesn't work on ViewGroup. Bug: 200233857 Test: atest CtsTranslationTestCases Test: manual. Use a sample code to request translation for a viewgroup and make sure it is added into view reference list. Test: manual verify with issue client app, it works. Change-Id: Ie593a1a436fd046373412ae2955a78057d22b892
This commit is contained in:
@@ -598,9 +598,8 @@ public class UiTranslationController {
|
||||
final View rootView = roots.get(rootNum).getView();
|
||||
if (rootView instanceof ViewGroup) {
|
||||
findViewsTraversalByAutofillIds((ViewGroup) rootView, sourceViewIds);
|
||||
} else {
|
||||
addViewIfNeeded(sourceViewIds, rootView);
|
||||
}
|
||||
addViewIfNeeded(sourceViewIds, rootView);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -611,9 +610,8 @@ public class UiTranslationController {
|
||||
final View child = viewGroup.getChildAt(i);
|
||||
if (child instanceof ViewGroup) {
|
||||
findViewsTraversalByAutofillIds((ViewGroup) child, sourceViewIds);
|
||||
} else {
|
||||
addViewIfNeeded(sourceViewIds, child);
|
||||
}
|
||||
addViewIfNeeded(sourceViewIds, child);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user