diff --git a/lawnchair/res/drawable/ic_close.xml b/lawnchair/res/drawable/ic_close.xml new file mode 100644 index 0000000000..b1f8850dfb --- /dev/null +++ b/lawnchair/res/drawable/ic_close.xml @@ -0,0 +1,11 @@ + + + + \ No newline at end of file diff --git a/lawnchair/res/layout/work_apps_edu.xml b/lawnchair/res/layout/work_apps_edu.xml new file mode 100644 index 0000000000..0afffba2a3 --- /dev/null +++ b/lawnchair/res/layout/work_apps_edu.xml @@ -0,0 +1,65 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/lawnchair/src/app/lawnchair/theme/drawable/DrawableTokens.kt b/lawnchair/src/app/lawnchair/theme/drawable/DrawableTokens.kt index 1b760bd975..dfee2d62a5 100644 --- a/lawnchair/src/app/lawnchair/theme/drawable/DrawableTokens.kt +++ b/lawnchair/src/app/lawnchair/theme/drawable/DrawableTokens.kt @@ -88,18 +88,17 @@ object DrawableTokens { val list = StateListDrawable() list.setEnterFadeDuration(100) - val cornerRadius = context.resources - .getDimensionPixelSize(R.dimen.all_apps_header_pill_corner_radius).toFloat() + val unselected = AppCompatResources.getDrawable( + context, + R.drawable.all_apps_tabs_background, + ) + unselected?.setTint(ColorTokens.Surface.resolveColor(context, scheme, uiColorMode)) - val unselected = GradientDrawable() - unselected.shape = GradientDrawable.RECTANGLE - unselected.cornerRadius = cornerRadius - unselected.setColor(ColorTokens.Surface.resolveColor(context, scheme, uiColorMode)) - - val selected = GradientDrawable() - selected.shape = GradientDrawable.RECTANGLE - selected.cornerRadius = cornerRadius - selected.setColor(ColorTokens.AllAppsTabBackgroundSelected.resolveColor(context, scheme, uiColorMode)) + val selected = AppCompatResources.getDrawable( + context, + R.drawable.all_apps_tabs_background, + ) + selected?.setTint(ColorTokens.AllAppsTabBackgroundSelected.resolveColor(context, scheme, uiColorMode)) list.addState(intArrayOf(-android.R.attr.state_selected), unselected) list.addState(intArrayOf(android.R.attr.state_selected), selected) diff --git a/src/com/android/launcher3/allapps/ActivityAllAppsContainerView.java b/src/com/android/launcher3/allapps/ActivityAllAppsContainerView.java index e8fc788893..101b42fc84 100644 --- a/src/com/android/launcher3/allapps/ActivityAllAppsContainerView.java +++ b/src/com/android/launcher3/allapps/ActivityAllAppsContainerView.java @@ -1034,13 +1034,11 @@ public class ActivityAllAppsContainerView } private void setDeviceManagementResources() { - if (mActivityContext.getStringCache() != null) { - Button personalTab = findViewById(R.id.tab_personal); - personalTab.setText(mActivityContext.getStringCache().allAppsPersonalTab); + Button personalTab = findViewById(R.id.tab_personal); + personalTab.setText(R.string.all_apps_personal_tab); - Button workTab = findViewById(R.id.tab_work); - workTab.setText(mActivityContext.getStringCache().allAppsWorkTab); - } + Button workTab = findViewById(R.id.tab_work); + workTab.setText(R.string.all_apps_work_tab); } protected boolean shouldShowTabs() { diff --git a/src/com/android/launcher3/allapps/WorkEduCard.java b/src/com/android/launcher3/allapps/WorkEduCard.java index f46321ff0b..1b8fc08ff8 100644 --- a/src/com/android/launcher3/allapps/WorkEduCard.java +++ b/src/com/android/launcher3/allapps/WorkEduCard.java @@ -83,18 +83,10 @@ public class WorkEduCard extends FrameLayout implements @Override protected void onFinishInflate() { super.onFinishInflate(); - - Button button = ViewCompat.requireViewById(this, R.id.action_btn); - button.setOnClickListener(this); - button.setAllCaps(false); - FontManager.INSTANCE.get(getContext()).setCustomFont(button, R.id.font_button); - - StringCache cache = mActivityContext.getStringCache(); - if (cache != null) { - TextView title = findViewById(R.id.work_apps_paused_title); - title.setText(cache.workProfileEdu); - title.setTextColor(ColorTokens.TextColorPrimary.resolveColor(getContext())); - } + findViewById(R.id.action_btn).setOnClickListener(this); + TextView title = findViewById(R.id.work_apps_paused_title); + title.setText(R.string.work_profile_edu_work_apps); + title.setTextColor(ColorTokens.TextColorPrimary.resolveColor(getContext())); } @Override diff --git a/src/com/android/launcher3/allapps/WorkModeSwitch.java b/src/com/android/launcher3/allapps/WorkModeSwitch.java index 398650ce9a..3eb6dbf3a3 100644 --- a/src/com/android/launcher3/allapps/WorkModeSwitch.java +++ b/src/com/android/launcher3/allapps/WorkModeSwitch.java @@ -82,9 +82,6 @@ public class WorkModeSwitch extends LinearLayout implements Insettable, public WorkModeSwitch(@NonNull Context context, @NonNull AttributeSet attrs, int defStyleAttr) { super(context, attrs, defStyleAttr); - if(mTextView != null){ - FontManager.INSTANCE.get(context).overrideFont(mTextView, attrs); - } mScrollThreshold = Utilities.dpToPx(SCROLL_THRESHOLD_DP); mActivityContext = ActivityContext.lookupContext(getContext()); mStatsLogManager = mActivityContext.getStatsLogManager(); @@ -95,6 +92,7 @@ public class WorkModeSwitch extends LinearLayout implements Insettable, super.onFinishInflate(); mIcon = findViewById(R.id.work_icon); mTextView = findViewById(R.id.pause_text); + FontManager.INSTANCE.get(getContext()).setCustomFont(mTextView, R.id.font_body_medium); setSelected(true); if (Utilities.ATLEAST_R) { @@ -109,10 +107,7 @@ public class WorkModeSwitch extends LinearLayout implements Insettable, DeviceProfile grid = BaseDraggingActivity.fromContext(getContext()).getDeviceProfile(); setInsets(grid.getInsets()); setInsets(mActivityContext.getDeviceProfile().getInsets()); - StringCache cache = mActivityContext.getStringCache(); - if (cache != null) { - mTextView.setText(cache.workProfilePauseButton); - } + mTextView.setText(R.string.work_apps_pause_btn_text); mIcon.setColorFilter(mTextView.getCurrentTextColor()); getLayoutTransition().enableTransitionType(LayoutTransition.CHANGING); diff --git a/src/com/android/launcher3/allapps/WorkPausedCard.java b/src/com/android/launcher3/allapps/WorkPausedCard.java index 9614809881..b30fcee99c 100644 --- a/src/com/android/launcher3/allapps/WorkPausedCard.java +++ b/src/com/android/launcher3/allapps/WorkPausedCard.java @@ -41,8 +41,6 @@ import app.lawnchair.theme.color.ColorTokens; public class WorkPausedCard extends LinearLayout implements View.OnClickListener { private final ActivityContext mActivityContext; - private Button mBtn; - public WorkPausedCard(Context context) { this(context, null, 0); } @@ -59,27 +57,24 @@ public class WorkPausedCard extends LinearLayout implements View.OnClickListener @Override protected void onFinishInflate() { super.onFinishInflate(); - mBtn = findViewById(R.id.enable_work_apps); - mBtn.setOnClickListener(this); - - mBtn.setAllCaps(false); - FontManager.INSTANCE.get(getContext()).setCustomFont(mBtn, R.id.font_button); - - StringCache cache = mActivityContext.getStringCache(); - if (cache != null) { - setWorkProfilePausedResources(cache); - } + setWorkProfilePausedResources(); } - private void setWorkProfilePausedResources(StringCache cache) { + private void setWorkProfilePausedResources() { TextView title = findViewById(R.id.work_apps_paused_title); - title.setText(cache.workProfilePausedTitle); + title.setText(R.string.work_apps_paused_title); + title.setTextColor(ColorTokens.TextColorPrimary.resolveColor(getContext())); + FontManager.INSTANCE.get(getContext()).setCustomFont(title, R.id.font_heading); TextView body = findViewById(R.id.work_apps_paused_content); - body.setText(cache.workProfilePausedDescription); + body.setText(R.string.work_apps_paused_body); + body.setTextColor(ColorTokens.TextColorPrimary.resolveColor(getContext())); + FontManager.INSTANCE.get(getContext()).setCustomFont(title, R.id.font_body_medium); - TextView button = findViewById(R.id.enable_work_apps); - button.setText(cache.workProfileEnableButton); + Button button = findViewById(R.id.enable_work_apps); + button.setText(R.string.work_apps_enable_btn_text); + FontManager.INSTANCE.get(getContext()).setCustomFont(title, R.id.font_button); + button.setOnClickListener(this); } @Override diff --git a/src/com/android/launcher3/widget/picker/WidgetsFullSheet.java b/src/com/android/launcher3/widget/picker/WidgetsFullSheet.java index 84de427684..9977be3c95 100644 --- a/src/com/android/launcher3/widget/picker/WidgetsFullSheet.java +++ b/src/com/android/launcher3/widget/picker/WidgetsFullSheet.java @@ -360,13 +360,11 @@ public class WidgetsFullSheet extends BaseWidgetSheet } private void setDeviceManagementResources() { - if (mActivityContext.getStringCache() != null) { - Button personalTab = findViewById(R.id.tab_personal); - personalTab.setText(mActivityContext.getStringCache().widgetsPersonalTab); + Button personalTab = findViewById(R.id.tab_personal); + personalTab.setText(R.string.all_apps_personal_tab); - Button workTab = findViewById(R.id.tab_work); - workTab.setText(mActivityContext.getStringCache().widgetsWorkTab); - } + Button workTab = findViewById(R.id.tab_work); + workTab.setText(R.string.all_apps_work_tab); } @Override