Loading res/layout/all_apps_personal_work_tabs.xml +3 −1 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ <com.android.launcher3.workprofile.PersonalWorkSlidingTabStrip xmlns:android="http://schemas.android.com/apk/res/android" xmlns:launcher="http://schemas.android.com/apk/res-auto" android:id="@+id/tabs" android:layout_width="match_parent" android:layout_height="@dimen/all_apps_header_pill_height" Loading @@ -24,7 +25,8 @@ android:paddingBottom="@dimen/all_apps_tabs_vertical_padding" android:layout_marginTop="@dimen/all_apps_tabs_margin_top" android:orientation="horizontal" style="@style/TextHeadline"> style="@style/TextHeadline" launcher:alignOnIcon="true"> <Button android:id="@+id/tab_personal" Loading res/layout/widgets_full_sheet_paged_view.xml +1 −2 Original line number Diff line number Diff line Loading @@ -89,8 +89,7 @@ android:gravity="center_horizontal" android:orientation="horizontal" android:paddingVertical="8dp" android:paddingLeft="@dimen/widget_tabs_horizontal_padding" android:paddingRight="@dimen/widget_tabs_horizontal_padding" android:layout_marginHorizontal="@dimen/widget_list_horizontal_margin" android:background="?android:attr/colorBackground" style="@style/TextHeadline" launcher:layout_sticky="true"> Loading res/values/attrs.xml +4 −0 Original line number Diff line number Diff line Loading @@ -214,6 +214,10 @@ <attr name="c" format="float|dimension" /> </declare-styleable> <declare-styleable name="PersonalWorkSlidingTabStrip"> <attr name="alignOnIcon" format="boolean" /> </declare-styleable> <declare-styleable name="ProfileDisplayOption"> <attr name="name" /> <attr name="minWidthDps" format="float" /> Loading src/com/android/launcher3/workprofile/PersonalWorkSlidingTabStrip.java +9 −1 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ package com.android.launcher3.workprofile; import android.content.Context; import android.content.res.TypedArray; import android.util.AttributeSet; import android.widget.Button; import android.widget.LinearLayout; Loading @@ -24,6 +25,7 @@ import androidx.annotation.NonNull; import androidx.annotation.Nullable; import com.android.launcher3.DeviceProfile; import com.android.launcher3.R; import com.android.launcher3.pageindicators.PageIndicator; import com.android.launcher3.views.ActivityContext; Loading @@ -31,11 +33,17 @@ import com.android.launcher3.views.ActivityContext; * Supports two indicator colors, dedicated for personal and work tabs. */ public class PersonalWorkSlidingTabStrip extends LinearLayout implements PageIndicator { private final boolean mIsAlignOnIcon; private OnActivePageChangedListener mOnActivePageChangedListener; private int mLastActivePage = 0; public PersonalWorkSlidingTabStrip(@NonNull Context context, @Nullable AttributeSet attrs) { super(context, attrs); TypedArray typedArray = context.obtainStyledAttributes(attrs, R.styleable.PersonalWorkSlidingTabStrip); mIsAlignOnIcon = typedArray.getBoolean( R.styleable.PersonalWorkSlidingTabStrip_alignOnIcon, false); typedArray.recycle(); } /** Loading Loading @@ -76,7 +84,7 @@ public class PersonalWorkSlidingTabStrip extends LinearLayout implements PageInd @Override protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { if (getPaddingLeft() == 0 && getPaddingRight() == 0) { if (mIsAlignOnIcon) { // If any padding is not specified, restrict the width to emulate padding int size = MeasureSpec.getSize(widthMeasureSpec); size = getTabWidth(getContext(), size); Loading Loading
res/layout/all_apps_personal_work_tabs.xml +3 −1 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ <com.android.launcher3.workprofile.PersonalWorkSlidingTabStrip xmlns:android="http://schemas.android.com/apk/res/android" xmlns:launcher="http://schemas.android.com/apk/res-auto" android:id="@+id/tabs" android:layout_width="match_parent" android:layout_height="@dimen/all_apps_header_pill_height" Loading @@ -24,7 +25,8 @@ android:paddingBottom="@dimen/all_apps_tabs_vertical_padding" android:layout_marginTop="@dimen/all_apps_tabs_margin_top" android:orientation="horizontal" style="@style/TextHeadline"> style="@style/TextHeadline" launcher:alignOnIcon="true"> <Button android:id="@+id/tab_personal" Loading
res/layout/widgets_full_sheet_paged_view.xml +1 −2 Original line number Diff line number Diff line Loading @@ -89,8 +89,7 @@ android:gravity="center_horizontal" android:orientation="horizontal" android:paddingVertical="8dp" android:paddingLeft="@dimen/widget_tabs_horizontal_padding" android:paddingRight="@dimen/widget_tabs_horizontal_padding" android:layout_marginHorizontal="@dimen/widget_list_horizontal_margin" android:background="?android:attr/colorBackground" style="@style/TextHeadline" launcher:layout_sticky="true"> Loading
res/values/attrs.xml +4 −0 Original line number Diff line number Diff line Loading @@ -214,6 +214,10 @@ <attr name="c" format="float|dimension" /> </declare-styleable> <declare-styleable name="PersonalWorkSlidingTabStrip"> <attr name="alignOnIcon" format="boolean" /> </declare-styleable> <declare-styleable name="ProfileDisplayOption"> <attr name="name" /> <attr name="minWidthDps" format="float" /> Loading
src/com/android/launcher3/workprofile/PersonalWorkSlidingTabStrip.java +9 −1 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ package com.android.launcher3.workprofile; import android.content.Context; import android.content.res.TypedArray; import android.util.AttributeSet; import android.widget.Button; import android.widget.LinearLayout; Loading @@ -24,6 +25,7 @@ import androidx.annotation.NonNull; import androidx.annotation.Nullable; import com.android.launcher3.DeviceProfile; import com.android.launcher3.R; import com.android.launcher3.pageindicators.PageIndicator; import com.android.launcher3.views.ActivityContext; Loading @@ -31,11 +33,17 @@ import com.android.launcher3.views.ActivityContext; * Supports two indicator colors, dedicated for personal and work tabs. */ public class PersonalWorkSlidingTabStrip extends LinearLayout implements PageIndicator { private final boolean mIsAlignOnIcon; private OnActivePageChangedListener mOnActivePageChangedListener; private int mLastActivePage = 0; public PersonalWorkSlidingTabStrip(@NonNull Context context, @Nullable AttributeSet attrs) { super(context, attrs); TypedArray typedArray = context.obtainStyledAttributes(attrs, R.styleable.PersonalWorkSlidingTabStrip); mIsAlignOnIcon = typedArray.getBoolean( R.styleable.PersonalWorkSlidingTabStrip_alignOnIcon, false); typedArray.recycle(); } /** Loading Loading @@ -76,7 +84,7 @@ public class PersonalWorkSlidingTabStrip extends LinearLayout implements PageInd @Override protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { if (getPaddingLeft() == 0 && getPaddingRight() == 0) { if (mIsAlignOnIcon) { // If any padding is not specified, restrict the width to emulate padding int size = MeasureSpec.getSize(widthMeasureSpec); size = getTabWidth(getContext(), size); Loading