mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-20 19:38:21 +00:00
Manually marking widgets recycler as non-scrollable of frozen
There was hope that freezing automatically marks it as non-scrollable, but this happened to be not true. Sending accessibility event per pweaver@'s instructions. Bug: 152354290 Change-Id: Idd04c69cef9e8e621775ef86112f35e3d9d9d2da
This commit is contained in:
@@ -16,17 +16,21 @@
|
||||
|
||||
package com.android.launcher3;
|
||||
|
||||
import static android.view.accessibility.AccessibilityEvent.TYPE_WINDOW_CONTENT_CHANGED;
|
||||
|
||||
import android.content.Context;
|
||||
import android.util.AttributeSet;
|
||||
import android.util.Log;
|
||||
import android.view.MotionEvent;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.accessibility.AccessibilityNodeInfo;
|
||||
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.android.launcher3.compat.AccessibilityManagerCompat;
|
||||
import com.android.launcher3.testing.TestProtocol;
|
||||
import com.android.launcher3.views.ActivityContext;
|
||||
import com.android.launcher3.views.RecyclerViewFastScroller;
|
||||
|
||||
|
||||
@@ -187,4 +191,28 @@ public abstract class BaseRecyclerView extends RecyclerView {
|
||||
AccessibilityManagerCompat.sendScrollFinishedEventToTest(getContext());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onInitializeAccessibilityNodeInfo(AccessibilityNodeInfo info) {
|
||||
super.onInitializeAccessibilityNodeInfo(info);
|
||||
if (isLayoutSuppressed()) info.setScrollable(false);
|
||||
if (Utilities.IS_RUNNING_IN_TEST_HARNESS) {
|
||||
Log.d(TestProtocol.NO_SCROLL_END_WIDGETS,
|
||||
"onInitializeAccessibilityNodeInfo, scrollable: " + info.isScrollable());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setLayoutFrozen(boolean frozen) {
|
||||
final boolean changing = frozen != isLayoutSuppressed();
|
||||
super.setLayoutFrozen(frozen);
|
||||
if (changing) {
|
||||
if (Utilities.IS_RUNNING_IN_TEST_HARNESS) {
|
||||
Log.d(TestProtocol.NO_SCROLL_END_WIDGETS, "setLayoutFrozen " + frozen
|
||||
+ " @ " + Log.getStackTraceString(new Throwable()));
|
||||
ActivityContext.lookupContext(getContext()).getDragLayer()
|
||||
.sendAccessibilityEvent(TYPE_WINDOW_CONTENT_CHANGED);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user