diff --git a/res/drawable/rounded_action_button.xml b/res/drawable/rounded_action_button.xml index b9942c0c92..81e94f7e2b 100644 --- a/res/drawable/rounded_action_button.xml +++ b/res/drawable/rounded_action_button.xml @@ -18,10 +18,11 @@ + + android:color="?androidprv:attr/colorSurfaceVariant" /> diff --git a/res/layout/work_apps_edu.xml b/res/layout/work_apps_edu.xml index 73200de591..f3b3053e13 100644 --- a/res/layout/work_apps_edu.xml +++ b/res/layout/work_apps_edu.xml @@ -16,9 +16,9 @@ - + android:orientation="horizontal"> + android:padding="@dimen/rounded_button_padding"> + android:padding="@dimen/x_icon_padding" + android:src="@drawable/ic_remove_no_shadow" /> - diff --git a/res/layout/work_mode_fab.xml b/res/layout/work_mode_fab.xml index c536d77b43..d2fa5fa066 100644 --- a/res/layout/work_mode_fab.xml +++ b/res/layout/work_mode_fab.xml @@ -21,14 +21,14 @@ android:layout_width="wrap_content" android:gravity="center" android:includeFontPadding="false" + android:textDirection="locale" android:drawableTint="@color/all_apps_tab_text" android:textColor="@color/all_apps_tab_text" android:textSize="14sp" android:background="@drawable/work_apps_toggle_background" android:drawablePadding="8dp" android:drawableStart="@drawable/ic_corp_off" - android:layout_marginBottom="@dimen/work_fab_margin" - android:layout_marginEnd="@dimen/work_fab_margin" + android:layout_marginBottom="@dimen/work_fab_margin_bottom" android:paddingLeft="@dimen/work_mode_fab_padding" android:paddingRight="@dimen/work_mode_fab_padding" android:text="@string/work_apps_pause_btn_text" /> \ No newline at end of file diff --git a/res/values/dimens.xml b/res/values/dimens.xml index 2c3f5ed6d8..a8ee72101a 100644 --- a/res/values/dimens.xml +++ b/res/values/dimens.xml @@ -129,6 +129,7 @@ 6dp 0dp 40dp + 16dp 2dp @@ -148,10 +149,12 @@ 10dp 52dp 16dp + 20dp 16dp 20dp 16dp 16dp + 26dp 24dp diff --git a/res/values/strings.xml b/res/values/strings.xml index ffa1e3f79e..ee5e024dac 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -428,7 +428,7 @@ Got it - Turn off work apps + Pause work apps Turn on work apps diff --git a/src/com/android/launcher3/allapps/BaseAllAppsContainerView.java b/src/com/android/launcher3/allapps/BaseAllAppsContainerView.java index f913aa9093..be012e832b 100644 --- a/src/com/android/launcher3/allapps/BaseAllAppsContainerView.java +++ b/src/com/android/launcher3/allapps/BaseAllAppsContainerView.java @@ -140,7 +140,7 @@ public abstract class BaseAllAppsContainerView allApps, - SharedPreferences preferences) { + SharedPreferences preferences, DeviceProfile deviceProfile) { mUserManager = userManager; mAllApps = allApps; + mDeviceProfile = deviceProfile; mAdapterProvider = new WorkAdapterProvider(allApps.mActivityContext, preferences); mMatcher = mAllApps.mPersonalMatcher.negate(); } @@ -141,8 +143,11 @@ public class WorkProfileManager implements PersonalWorkSlidingTabStrip.OnActiveP mWorkModeSwitch = (WorkModeSwitch) mAllApps.getLayoutInflater().inflate( R.layout.work_mode_fab, mAllApps, false); } + ViewGroup.MarginLayoutParams lp = + (ViewGroup.MarginLayoutParams) mWorkModeSwitch.getLayoutParams(); int workFabMarginBottom = - mWorkModeSwitch.getResources().getDimensionPixelSize(R.dimen.work_fab_margin); + mWorkModeSwitch.getResources().getDimensionPixelSize( + R.dimen.work_fab_margin_bottom); if (FeatureFlags.ENABLE_FLOATING_SEARCH_BAR.get()) { workFabMarginBottom <<= 1; // Double margin to add space above search bar. workFabMarginBottom += @@ -151,8 +156,11 @@ public class WorkProfileManager implements PersonalWorkSlidingTabStrip.OnActiveP if (!mAllApps.mActivityContext.getDeviceProfile().isGestureMode){ workFabMarginBottom += mAllApps.mActivityContext.getDeviceProfile().getInsets().bottom; } - ((ViewGroup.MarginLayoutParams) mWorkModeSwitch.getLayoutParams()).bottomMargin = - workFabMarginBottom; + lp.bottomMargin = workFabMarginBottom; + int totalScreenWidth = mDeviceProfile.widthPx; + int personalWorkTabWidth = + mAllApps.mActivityContext.getAppsView().getActiveRecyclerView().getTabWidth(); + lp.rightMargin = lp.leftMargin = (totalScreenWidth - personalWorkTabWidth) / 2; if (mWorkModeSwitch.getParent() != mAllApps) { mAllApps.addView(mWorkModeSwitch); }