diff options
Diffstat (limited to 'src/com/android/launcher3/widget/WidgetsFullSheet.java')
-rw-r--r-- | src/com/android/launcher3/widget/WidgetsFullSheet.java | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/com/android/launcher3/widget/WidgetsFullSheet.java b/src/com/android/launcher3/widget/WidgetsFullSheet.java index a622624dc..e94d81d75 100644 --- a/src/com/android/launcher3/widget/WidgetsFullSheet.java +++ b/src/com/android/launcher3/widget/WidgetsFullSheet.java @@ -21,8 +21,10 @@ import android.animation.PropertyValuesHolder; import android.content.Context; import android.graphics.Rect; import android.util.AttributeSet; +import android.util.Pair; import android.view.LayoutInflater; import android.view.MotionEvent; +import android.view.View; import android.view.animation.AnimationUtils; import com.android.launcher3.Insettable; @@ -55,6 +57,7 @@ public class WidgetsFullSheet extends BaseWidgetSheet mAdapter = new WidgetsListAdapter(context, LayoutInflater.from(context), apps.getWidgetCache(), apps.getIconCache(), this, this); + } public WidgetsFullSheet(Context context, AttributeSet attrs) { @@ -77,6 +80,12 @@ public class WidgetsFullSheet extends BaseWidgetSheet } @Override + protected Pair<View, String> getAccessibilityTarget() { + return Pair.create(mRecyclerView, getContext().getString( + mIsOpen ? R.string.widgets_list : R.string.widgets_list_closed)); + } + + @Override protected void onAttachedToWindow() { super.onAttachedToWindow(); mLauncher.getAppWidgetHost().addProviderChangeListener(this); @@ -149,10 +158,6 @@ public class WidgetsFullSheet extends BaseWidgetSheet } private void open(boolean animate) { - if (mIsOpen) { - return; - } - mIsOpen = true; if (animate) { if (mLauncher.getDragLayer().getInsets().bottom > 0) { mContent.setAlpha(0); @@ -180,6 +185,7 @@ public class WidgetsFullSheet extends BaseWidgetSheet } else { setTranslationShift(TRANSLATION_SHIFT_OPENED); mAdapter.setApplyBitmapDeferred(false, mRecyclerView); + post(this::announceAccessibilityChanges); } } @@ -212,6 +218,7 @@ public class WidgetsFullSheet extends BaseWidgetSheet public static WidgetsFullSheet show(Launcher launcher, boolean animate) { WidgetsFullSheet sheet = (WidgetsFullSheet) launcher.getLayoutInflater() .inflate(R.layout.widgets_full_sheet, launcher.getDragLayer(), false); + sheet.mIsOpen = true; launcher.getDragLayer().addView(sheet); sheet.open(animate); return sheet; |