Fix custom buttons with translated string

The reason why the buttons aren't being updated with the translated string is because the cache the views get the string from is not updated/loaded with the new language.
Rather, the update happens after the view has been inflated. With this change, when the string cache updates in bindStringCache(), we update the UI right then.

bug: 280958663
bug: 288442609
test: Manual
Change-Id: I7a49ee401d5a5f3268cfaef1abee8153e913a8ce
(cherry picked from commit 076dcdfd54)
This commit is contained in:
Brandon Dayauon committed 2023-06-28 21:49:25 +00:00
1 parent c8a2f9111b
commit dba7359d23
6 files changed
+53 -13

No files matched your search

@@ -57,6 +57,10 @@ public class WorkPausedCard extends LinearLayout implements View.OnClickListener
mBtn = findViewById(R.id.enable_work_apps);
mBtn.setOnClickListener(this);
updateStringFromCache();
}
public void updateStringFromCache() {
StringCache cache = mActivityContext.getStringCache();
if (cache != null) {
setWorkProfilePausedResources(cache);