Theme work profile (#3748)

* Theme work profile

* Improved close action in workedu
This commit is contained in:
John Andrew Camu
2023-11-20 19:45:28 +08:00
committed by GitHub
parent 71e6b28755
commit 30d3b8722b
8 changed files with 112 additions and 59 deletions

View File

@@ -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);