Android A11Y: Notify android about scroll events
QtQuick Flickable has an issue that after a scroll the previously hidden items are not added to the A11Y hierarchy. That happens because Android has no ways to detect that something has changed. This patch uses the ScrollingEnd event to notify Android A11Y backend that the Flickable was scrolled, so that it could update the A11Y hierarchy and add the previously hidden nodes. The ScrollingEnd event generation is added to QQuickFlickable in a separate commit. Task-number: QTBUG-103513 Change-Id: Ie6cd688d56343bcfe7ce9580c0b9244dd6d6c068 Reviewed-by: Ivan Solovev <ivan.solovev@qt.io> Reviewed-by: Samuel Mira <samuel.mira@qt.io> Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io> (cherry picked from commit 3c709198838866d5122c69a30cacdc806605d0cf) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
parent
04147c4585
commit
3bf1786d02
@ -941,6 +941,14 @@ public class QtActivityDelegate
|
||||
m_accessibilityDelegate.notifyValueChanged(viewId, value);
|
||||
}
|
||||
|
||||
public void notifyScrolledEvent(int viewId)
|
||||
{
|
||||
if (m_accessibilityDelegate == null)
|
||||
return;
|
||||
m_accessibilityDelegate.notifyScrolledEvent(viewId);
|
||||
}
|
||||
|
||||
|
||||
public void notifyQtAndroidPluginRunning(boolean running)
|
||||
{
|
||||
m_isPluginRunning = running;
|
||||
|
@ -985,6 +985,18 @@ public class QtNative
|
||||
});
|
||||
}
|
||||
|
||||
private static void notifyScrolledEvent(final int viewId)
|
||||
{
|
||||
runAction(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (m_activityDelegate != null) {
|
||||
m_activityDelegate.notifyScrolledEvent(viewId);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public static void notifyQtAndroidPluginRunning(final boolean running)
|
||||
{
|
||||
m_activityDelegate.notifyQtAndroidPluginRunning(running);
|
||||
|
@ -159,6 +159,11 @@ public class QtAccessibilityDelegate extends View.AccessibilityDelegate
|
||||
return true;
|
||||
}
|
||||
|
||||
public void notifyScrolledEvent(int viewId)
|
||||
{
|
||||
sendEventForVirtualViewId(viewId, AccessibilityEvent.TYPE_VIEW_SCROLLED);
|
||||
}
|
||||
|
||||
public void notifyLocationChange(int viewId)
|
||||
{
|
||||
if (m_focusedVirtualViewId == viewId)
|
||||
|
@ -131,6 +131,11 @@ namespace QtAndroidAccessibility
|
||||
QtAndroid::notifyValueChanged(accessibilityObjectId, value);
|
||||
}
|
||||
|
||||
void notifyScrolledEvent(uint accessiblityObjectId)
|
||||
{
|
||||
QtAndroid::notifyScrolledEvent(accessiblityObjectId);
|
||||
}
|
||||
|
||||
static QVarLengthArray<int, 8> childIdListForAccessibleObject_helper(int objectId)
|
||||
{
|
||||
QAccessibleInterface *iface = interfaceFromId(objectId);
|
||||
|
@ -19,6 +19,7 @@ namespace QtAndroidAccessibility
|
||||
void notifyObjectHide(uint accessibilityObjectId);
|
||||
void notifyObjectFocus(uint accessibilityObjectId);
|
||||
void notifyValueChanged(uint accessibilityObjectId);
|
||||
void notifyScrolledEvent(uint accessibilityObjectId);
|
||||
void createAccessibilityContextObject(QObject *parent);
|
||||
}
|
||||
|
||||
|
@ -198,6 +198,12 @@ namespace QtAndroid
|
||||
"(ILjava/lang/String;)V", accessibilityObjectId, value);
|
||||
}
|
||||
|
||||
void notifyScrolledEvent(uint accessibilityObjectId)
|
||||
{
|
||||
QJniObject::callStaticMethod<void>(m_applicationClass, "notifyScrolledEvent", "(I)V",
|
||||
accessibilityObjectId);
|
||||
}
|
||||
|
||||
void notifyQtAndroidPluginRunning(bool running)
|
||||
{
|
||||
QJniObject::callStaticMethod<void>(m_applicationClass, "notifyQtAndroidPluginRunning","(Z)V", running);
|
||||
|
@ -69,6 +69,7 @@ namespace QtAndroid
|
||||
void notifyObjectHide(uint accessibilityObjectId, uint parentObjectId);
|
||||
void notifyObjectFocus(uint accessibilityObjectId);
|
||||
void notifyValueChanged(uint accessibilityObjectId, jstring value);
|
||||
void notifyScrolledEvent(uint accessibilityObjectId);
|
||||
void notifyQtAndroidPluginRunning(bool running);
|
||||
|
||||
const char *classErrorMsgFmt();
|
||||
|
@ -32,6 +32,8 @@ void QAndroidPlatformAccessibility::notifyAccessibilityUpdate(QAccessibleEvent *
|
||||
QtAndroidAccessibility::notifyObjectFocus(event->uniqueId());
|
||||
} else if (event->type() == QAccessible::ValueChanged) {
|
||||
QtAndroidAccessibility::notifyValueChanged(event->uniqueId());
|
||||
} else if (event->type() == QAccessible::ScrollingEnd) {
|
||||
QtAndroidAccessibility::notifyScrolledEvent(event->uniqueId());
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user