diff --git a/res/drawable/widget_picker_tabs_background.xml b/res/drawable/widget_picker_tabs_background.xml index a874dd8b90..f6607b7ad1 100644 --- a/res/drawable/widget_picker_tabs_background.xml +++ b/res/drawable/widget_picker_tabs_background.xml @@ -13,36 +13,39 @@ See the License for the specific language governing permissions and limitations under the License. --> - + + - - - - - - + + + + + + - - - - - - - - + + + + + + + + - - - - - - - - - - \ No newline at end of file + + + + + + + + + + \ No newline at end of file diff --git a/res/layout/widgets_full_sheet_paged_view.xml b/res/layout/widgets_full_sheet_paged_view.xml index 8dc785af66..622f0d6aa5 100644 --- a/res/layout/widgets_full_sheet_paged_view.xml +++ b/res/layout/widgets_full_sheet_paged_view.xml @@ -104,7 +104,6 @@ android:layout_width="0dp" android:layout_height="match_parent" android:layout_marginEnd="@dimen/widget_tabs_button_horizontal_padding" - android:layout_marginVertical="@dimen/widget_apps_tabs_vertical_padding" android:layout_weight="1" android:background="@drawable/widget_picker_tabs_background" android:text="@string/widgets_full_sheet_personal_tab" @@ -117,7 +116,6 @@ android:layout_width="0dp" android:layout_height="match_parent" android:layout_marginEnd="@dimen/widget_tabs_button_horizontal_padding" - android:layout_marginVertical="@dimen/widget_apps_tabs_vertical_padding" android:layout_weight="1" android:background="@drawable/widget_picker_tabs_background" android:text="@string/widgets_full_sheet_work_tab" diff --git a/res/layout/widgets_two_pane_sheet_paged_view.xml b/res/layout/widgets_two_pane_sheet_paged_view.xml index 1f41680825..1cbd2bad43 100644 --- a/res/layout/widgets_two_pane_sheet_paged_view.xml +++ b/res/layout/widgets_two_pane_sheet_paged_view.xml @@ -115,7 +115,6 @@ android:layout_width="0dp" android:layout_height="match_parent" android:layout_marginEnd="@dimen/widget_tabs_button_horizontal_padding" - android:layout_marginVertical="@dimen/widget_apps_tabs_vertical_padding" android:layout_weight="1" android:background="@drawable/widget_picker_tabs_background" android:text="@string/widgets_full_sheet_personal_tab" @@ -128,7 +127,6 @@ android:layout_width="0dp" android:layout_height="match_parent" android:layout_marginEnd="@dimen/widget_tabs_button_horizontal_padding" - android:layout_marginVertical="@dimen/widget_apps_tabs_vertical_padding" android:layout_weight="1" android:background="@drawable/widget_picker_tabs_background" android:text="@string/widgets_full_sheet_work_tab" diff --git a/src/com/android/launcher3/widget/picker/WidgetsTwoPaneSheet.java b/src/com/android/launcher3/widget/picker/WidgetsTwoPaneSheet.java index c2cd903cde..2653514074 100644 --- a/src/com/android/launcher3/widget/picker/WidgetsTwoPaneSheet.java +++ b/src/com/android/launcher3/widget/picker/WidgetsTwoPaneSheet.java @@ -376,17 +376,14 @@ public class WidgetsTwoPaneSheet extends WidgetsFullSheet { mSuggestedWidgetsPackageUserKey = PackageUserKey.fromPackageItemInfo(packageItemInfo); final boolean isChangingHeaders = mSelectedHeader == null || !mSelectedHeader.equals(mSuggestedWidgetsPackageUserKey); - // If the initial focus view is still focused, it is likely a programmatic header - // click. - if (mSelectedHeader != null - && !getAccessibilityInitialFocusView().isAccessibilityFocused()) { - post(() -> { - mRightPaneScrollView.setAccessibilityPaneTitle(suggestionsRightPaneTitle); - mRightPaneScrollView.performAccessibilityAction( - AccessibilityNodeInfo.ACTION_ACCESSIBILITY_FOCUS, null); - }); - } if (isChangingHeaders) { + // If the initial focus view is still focused or widget picker is still opening, it + // is likely a programmatic header click. + if (mSelectedHeader != null && !mOpenCloseAnimation.getAnimationPlayer().isRunning() + && !getAccessibilityInitialFocusView().isAccessibilityFocused()) { + mRightPaneScrollView.setAccessibilityPaneTitle(suggestionsRightPaneTitle); + focusOnFirstWidgetCell(mWidgetRecommendationsView); + } // If switching from another header, unselect any WidgetCells. This is necessary // because we do not clear/recycle the WidgetCells in the recommendations container // when the header is clicked, only when onRecommendationsBound is called. That @@ -505,9 +502,10 @@ public class WidgetsTwoPaneSheet extends WidgetsFullSheet { public void onHeaderChanged(@NonNull PackageUserKey selectedHeader) { final boolean isSameHeader = mSelectedHeader != null && mSelectedHeader.equals(selectedHeader); - // If the initial focus view is still focused, it is likely a programmatic header - // click. + // If the initial focus view is still focused or widget picker is still opening, it + // is likely a programmatic header click. final boolean isUserClick = mSelectedHeader != null + && !mOpenCloseAnimation.getAnimationPlayer().isRunning() && !getAccessibilityInitialFocusView().isAccessibilityFocused(); mSelectedHeader = selectedHeader; final boolean showDefaultWidgets = mWidgetOptionsMenuState != null