Loading core/java/com/android/internal/widget/remotecompose/accessibility/CoreDocumentAccessibility.java +5 −2 Original line number Diff line number Diff line Loading @@ -21,6 +21,7 @@ import android.os.Bundle; import com.android.internal.widget.remotecompose.core.CoreDocument; import com.android.internal.widget.remotecompose.core.Operation; import com.android.internal.widget.remotecompose.core.RemoteContext; import com.android.internal.widget.remotecompose.core.operations.layout.ClickModifierOperation; import com.android.internal.widget.remotecompose.core.operations.layout.Component; import com.android.internal.widget.remotecompose.core.operations.layout.LayoutComponent; Loading @@ -45,9 +46,11 @@ import java.util.stream.Stream; */ public class CoreDocumentAccessibility implements RemoteComposeDocumentAccessibility { private final CoreDocument mDocument; private final RemoteContext mRemoteContext; public CoreDocumentAccessibility(CoreDocument document) { public CoreDocumentAccessibility(CoreDocument document, RemoteContext remoteContext) { this.mDocument = document; this.mRemoteContext = remoteContext; } @Nullable Loading Loading @@ -95,7 +98,7 @@ public class CoreDocumentAccessibility implements RemoteComposeDocumentAccessibi @Override public boolean performAction(Component component, int action, Bundle arguments) { if (action == ACTION_CLICK) { mDocument.performClick(component.getComponentId()); mDocument.performClick(mRemoteContext, component.getComponentId()); return true; } else { return false; Loading core/java/com/android/internal/widget/remotecompose/accessibility/PlatformRemoteComposeAccessibilityRegistrar.java +3 −1 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ import android.annotation.NonNull; import android.view.View; import com.android.internal.widget.remotecompose.core.CoreDocument; import com.android.internal.widget.remotecompose.core.RemoteContextAware; /** * Trivial wrapper for calling setAccessibilityDelegate on a View. This exists primarily because the Loading @@ -31,7 +32,8 @@ public class PlatformRemoteComposeAccessibilityRegistrar View player, @NonNull CoreDocument coreDocument) { return new PlatformRemoteComposeTouchHelper( player, new CoreDocumentAccessibility(coreDocument), new CoreDocumentAccessibility( coreDocument, ((RemoteContextAware) player).getRemoteContext()), new AndroidPlatformSemanticNodeApplier()); } Loading core/java/com/android/internal/widget/remotecompose/accessibility/PlatformRemoteComposeTouchHelper.java +3 −1 Original line number Diff line number Diff line Loading @@ -28,6 +28,7 @@ import android.view.accessibility.AccessibilityNodeInfo; import com.android.internal.widget.ExploreByTouchHelper; import com.android.internal.widget.remotecompose.core.CoreDocument; import com.android.internal.widget.remotecompose.core.RemoteContextAware; import com.android.internal.widget.remotecompose.core.operations.layout.Component; import com.android.internal.widget.remotecompose.core.semantics.AccessibilitySemantics; import com.android.internal.widget.remotecompose.core.semantics.AccessibleComponent.Mode; Loading Loading @@ -55,7 +56,8 @@ public class PlatformRemoteComposeTouchHelper extends ExploreByTouchHelper { View player, @NonNull CoreDocument coreDocument) { return new PlatformRemoteComposeTouchHelper( player, new CoreDocumentAccessibility(coreDocument), new CoreDocumentAccessibility( coreDocument, ((RemoteContextAware) player).getRemoteContext()), new AndroidPlatformSemanticNodeApplier()); } Loading core/java/com/android/internal/widget/remotecompose/core/CoreDocument.java +8 −2 Original line number Diff line number Diff line Loading @@ -62,7 +62,7 @@ public class CoreDocument { // We also keep a more fine-grained BUILD number, exposed as // ID_API_LEVEL = DOCUMENT_API_LEVEL + BUILD static final float BUILD = 0.3f; static final float BUILD = 0.4f; @NonNull ArrayList<Operation> mOperations = new ArrayList<>(); Loading Loading @@ -860,16 +860,22 @@ public class CoreDocument { * * @param id the click area id */ public void performClick(int id) { public void performClick(@NonNull RemoteContext context, int id) { for (ClickAreaRepresentation clickArea : mClickAreas) { if (clickArea.mId == id) { warnClickListeners(clickArea); return; } } for (IdActionCallback listener : mIdActionListeners) { listener.onAction(id, ""); } Component component = getComponent(id); if (component != null) { component.onClick(context, this, -1, -1); } } /** Warn click listeners when a click area is activated */ Loading core/java/com/android/internal/widget/remotecompose/core/Operations.java +14 −2 Original line number Diff line number Diff line Loading @@ -18,6 +18,7 @@ package com.android.internal.widget.remotecompose.core; import android.annotation.NonNull; import com.android.internal.widget.remotecompose.core.operations.BitmapData; import com.android.internal.widget.remotecompose.core.operations.BitmapFontData; import com.android.internal.widget.remotecompose.core.operations.ClickArea; import com.android.internal.widget.remotecompose.core.operations.ClipPath; import com.android.internal.widget.remotecompose.core.operations.ClipRect; Loading @@ -30,6 +31,7 @@ import com.android.internal.widget.remotecompose.core.operations.DataMapIds; import com.android.internal.widget.remotecompose.core.operations.DataMapLookup; import com.android.internal.widget.remotecompose.core.operations.DrawArc; import com.android.internal.widget.remotecompose.core.operations.DrawBitmap; import com.android.internal.widget.remotecompose.core.operations.DrawBitmapFontText; import com.android.internal.widget.remotecompose.core.operations.DrawBitmapInt; import com.android.internal.widget.remotecompose.core.operations.DrawBitmapScaled; import com.android.internal.widget.remotecompose.core.operations.DrawCircle; Loading @@ -45,6 +47,8 @@ import com.android.internal.widget.remotecompose.core.operations.DrawTextOnPath; import com.android.internal.widget.remotecompose.core.operations.DrawTweenPath; import com.android.internal.widget.remotecompose.core.operations.FloatConstant; import com.android.internal.widget.remotecompose.core.operations.FloatExpression; import com.android.internal.widget.remotecompose.core.operations.FloatFunctionCall; import com.android.internal.widget.remotecompose.core.operations.FloatFunctionDefine; import com.android.internal.widget.remotecompose.core.operations.Header; import com.android.internal.widget.remotecompose.core.operations.IntegerExpression; import com.android.internal.widget.remotecompose.core.operations.MatrixRestore; Loading Loading @@ -147,12 +151,14 @@ public class Operations { public static final int DATA_BITMAP = 101; public static final int DATA_SHADER = 45; public static final int DATA_TEXT = 102; public static final int DATA_BITMAP_FONT = 167; ///////////////////////////// ===================== public static final int CLIP_PATH = 38; public static final int CLIP_RECT = 39; public static final int PAINT_VALUES = 40; public static final int DRAW_RECT = 42; public static final int DRAW_BITMAP_FONT_TEXT_RUN = 48; public static final int DRAW_TEXT_RUN = 43; public static final int DRAW_CIRCLE = 46; public static final int DRAW_LINE = 47; Loading Loading @@ -196,11 +202,13 @@ public class Operations { public static final int PATH_TWEEN = 158; public static final int PATH_CREATE = 159; public static final int PATH_ADD = 160; public static final int PARTICLE_CREATE = 161; public static final int PARTICLE_DEFINE = 161; public static final int PARTICLE_PROCESS = 162; public static final int PARTICLE_LOOP = 163; public static final int IMPULSE_START = 164; public static final int IMPULSE_PROCESS = 165; public static final int FUNCTION_CALL = 166; public static final int FUNCTION_DEFINE = 168; ///////////////////////////////////////// ====================== Loading Loading @@ -276,6 +284,7 @@ public class Operations { map.put(HEADER, Header::read); map.put(DRAW_BITMAP_INT, DrawBitmapInt::read); map.put(DATA_BITMAP, BitmapData::read); map.put(DATA_BITMAP_FONT, BitmapFontData::read); map.put(DATA_TEXT, TextData::read); map.put(THEME, Theme::read); map.put(CLICK_AREA, ClickArea::read); Loading @@ -292,6 +301,7 @@ public class Operations { map.put(DRAW_ROUND_RECT, DrawRoundRect::read); map.put(DRAW_TEXT_ON_PATH, DrawTextOnPath::read); map.put(DRAW_TEXT_RUN, DrawText::read); map.put(DRAW_BITMAP_FONT_TEXT_RUN, DrawBitmapFontText::read); map.put(DRAW_TWEEN_PATH, DrawTweenPath::read); map.put(DATA_PATH, PathData::read); map.put(PAINT_VALUES, PaintData::read); Loading Loading @@ -389,8 +399,10 @@ public class Operations { map.put(PATH_ADD, PathAppend::read); map.put(IMPULSE_START, ImpulseOperation::read); map.put(IMPULSE_PROCESS, ImpulseProcess::read); map.put(PARTICLE_CREATE, ParticlesCreate::read); map.put(PARTICLE_DEFINE, ParticlesCreate::read); map.put(PARTICLE_LOOP, ParticlesLoop::read); map.put(FUNCTION_CALL, FloatFunctionCall::read); map.put(FUNCTION_DEFINE, FloatFunctionDefine::read); map.put(ACCESSIBILITY_SEMANTICS, CoreSemantics::read); // map.put(ACCESSIBILITY_CUSTOM_ACTION, CoreSemantics::read); Loading Loading
core/java/com/android/internal/widget/remotecompose/accessibility/CoreDocumentAccessibility.java +5 −2 Original line number Diff line number Diff line Loading @@ -21,6 +21,7 @@ import android.os.Bundle; import com.android.internal.widget.remotecompose.core.CoreDocument; import com.android.internal.widget.remotecompose.core.Operation; import com.android.internal.widget.remotecompose.core.RemoteContext; import com.android.internal.widget.remotecompose.core.operations.layout.ClickModifierOperation; import com.android.internal.widget.remotecompose.core.operations.layout.Component; import com.android.internal.widget.remotecompose.core.operations.layout.LayoutComponent; Loading @@ -45,9 +46,11 @@ import java.util.stream.Stream; */ public class CoreDocumentAccessibility implements RemoteComposeDocumentAccessibility { private final CoreDocument mDocument; private final RemoteContext mRemoteContext; public CoreDocumentAccessibility(CoreDocument document) { public CoreDocumentAccessibility(CoreDocument document, RemoteContext remoteContext) { this.mDocument = document; this.mRemoteContext = remoteContext; } @Nullable Loading Loading @@ -95,7 +98,7 @@ public class CoreDocumentAccessibility implements RemoteComposeDocumentAccessibi @Override public boolean performAction(Component component, int action, Bundle arguments) { if (action == ACTION_CLICK) { mDocument.performClick(component.getComponentId()); mDocument.performClick(mRemoteContext, component.getComponentId()); return true; } else { return false; Loading
core/java/com/android/internal/widget/remotecompose/accessibility/PlatformRemoteComposeAccessibilityRegistrar.java +3 −1 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ import android.annotation.NonNull; import android.view.View; import com.android.internal.widget.remotecompose.core.CoreDocument; import com.android.internal.widget.remotecompose.core.RemoteContextAware; /** * Trivial wrapper for calling setAccessibilityDelegate on a View. This exists primarily because the Loading @@ -31,7 +32,8 @@ public class PlatformRemoteComposeAccessibilityRegistrar View player, @NonNull CoreDocument coreDocument) { return new PlatformRemoteComposeTouchHelper( player, new CoreDocumentAccessibility(coreDocument), new CoreDocumentAccessibility( coreDocument, ((RemoteContextAware) player).getRemoteContext()), new AndroidPlatformSemanticNodeApplier()); } Loading
core/java/com/android/internal/widget/remotecompose/accessibility/PlatformRemoteComposeTouchHelper.java +3 −1 Original line number Diff line number Diff line Loading @@ -28,6 +28,7 @@ import android.view.accessibility.AccessibilityNodeInfo; import com.android.internal.widget.ExploreByTouchHelper; import com.android.internal.widget.remotecompose.core.CoreDocument; import com.android.internal.widget.remotecompose.core.RemoteContextAware; import com.android.internal.widget.remotecompose.core.operations.layout.Component; import com.android.internal.widget.remotecompose.core.semantics.AccessibilitySemantics; import com.android.internal.widget.remotecompose.core.semantics.AccessibleComponent.Mode; Loading Loading @@ -55,7 +56,8 @@ public class PlatformRemoteComposeTouchHelper extends ExploreByTouchHelper { View player, @NonNull CoreDocument coreDocument) { return new PlatformRemoteComposeTouchHelper( player, new CoreDocumentAccessibility(coreDocument), new CoreDocumentAccessibility( coreDocument, ((RemoteContextAware) player).getRemoteContext()), new AndroidPlatformSemanticNodeApplier()); } Loading
core/java/com/android/internal/widget/remotecompose/core/CoreDocument.java +8 −2 Original line number Diff line number Diff line Loading @@ -62,7 +62,7 @@ public class CoreDocument { // We also keep a more fine-grained BUILD number, exposed as // ID_API_LEVEL = DOCUMENT_API_LEVEL + BUILD static final float BUILD = 0.3f; static final float BUILD = 0.4f; @NonNull ArrayList<Operation> mOperations = new ArrayList<>(); Loading Loading @@ -860,16 +860,22 @@ public class CoreDocument { * * @param id the click area id */ public void performClick(int id) { public void performClick(@NonNull RemoteContext context, int id) { for (ClickAreaRepresentation clickArea : mClickAreas) { if (clickArea.mId == id) { warnClickListeners(clickArea); return; } } for (IdActionCallback listener : mIdActionListeners) { listener.onAction(id, ""); } Component component = getComponent(id); if (component != null) { component.onClick(context, this, -1, -1); } } /** Warn click listeners when a click area is activated */ Loading
core/java/com/android/internal/widget/remotecompose/core/Operations.java +14 −2 Original line number Diff line number Diff line Loading @@ -18,6 +18,7 @@ package com.android.internal.widget.remotecompose.core; import android.annotation.NonNull; import com.android.internal.widget.remotecompose.core.operations.BitmapData; import com.android.internal.widget.remotecompose.core.operations.BitmapFontData; import com.android.internal.widget.remotecompose.core.operations.ClickArea; import com.android.internal.widget.remotecompose.core.operations.ClipPath; import com.android.internal.widget.remotecompose.core.operations.ClipRect; Loading @@ -30,6 +31,7 @@ import com.android.internal.widget.remotecompose.core.operations.DataMapIds; import com.android.internal.widget.remotecompose.core.operations.DataMapLookup; import com.android.internal.widget.remotecompose.core.operations.DrawArc; import com.android.internal.widget.remotecompose.core.operations.DrawBitmap; import com.android.internal.widget.remotecompose.core.operations.DrawBitmapFontText; import com.android.internal.widget.remotecompose.core.operations.DrawBitmapInt; import com.android.internal.widget.remotecompose.core.operations.DrawBitmapScaled; import com.android.internal.widget.remotecompose.core.operations.DrawCircle; Loading @@ -45,6 +47,8 @@ import com.android.internal.widget.remotecompose.core.operations.DrawTextOnPath; import com.android.internal.widget.remotecompose.core.operations.DrawTweenPath; import com.android.internal.widget.remotecompose.core.operations.FloatConstant; import com.android.internal.widget.remotecompose.core.operations.FloatExpression; import com.android.internal.widget.remotecompose.core.operations.FloatFunctionCall; import com.android.internal.widget.remotecompose.core.operations.FloatFunctionDefine; import com.android.internal.widget.remotecompose.core.operations.Header; import com.android.internal.widget.remotecompose.core.operations.IntegerExpression; import com.android.internal.widget.remotecompose.core.operations.MatrixRestore; Loading Loading @@ -147,12 +151,14 @@ public class Operations { public static final int DATA_BITMAP = 101; public static final int DATA_SHADER = 45; public static final int DATA_TEXT = 102; public static final int DATA_BITMAP_FONT = 167; ///////////////////////////// ===================== public static final int CLIP_PATH = 38; public static final int CLIP_RECT = 39; public static final int PAINT_VALUES = 40; public static final int DRAW_RECT = 42; public static final int DRAW_BITMAP_FONT_TEXT_RUN = 48; public static final int DRAW_TEXT_RUN = 43; public static final int DRAW_CIRCLE = 46; public static final int DRAW_LINE = 47; Loading Loading @@ -196,11 +202,13 @@ public class Operations { public static final int PATH_TWEEN = 158; public static final int PATH_CREATE = 159; public static final int PATH_ADD = 160; public static final int PARTICLE_CREATE = 161; public static final int PARTICLE_DEFINE = 161; public static final int PARTICLE_PROCESS = 162; public static final int PARTICLE_LOOP = 163; public static final int IMPULSE_START = 164; public static final int IMPULSE_PROCESS = 165; public static final int FUNCTION_CALL = 166; public static final int FUNCTION_DEFINE = 168; ///////////////////////////////////////// ====================== Loading Loading @@ -276,6 +284,7 @@ public class Operations { map.put(HEADER, Header::read); map.put(DRAW_BITMAP_INT, DrawBitmapInt::read); map.put(DATA_BITMAP, BitmapData::read); map.put(DATA_BITMAP_FONT, BitmapFontData::read); map.put(DATA_TEXT, TextData::read); map.put(THEME, Theme::read); map.put(CLICK_AREA, ClickArea::read); Loading @@ -292,6 +301,7 @@ public class Operations { map.put(DRAW_ROUND_RECT, DrawRoundRect::read); map.put(DRAW_TEXT_ON_PATH, DrawTextOnPath::read); map.put(DRAW_TEXT_RUN, DrawText::read); map.put(DRAW_BITMAP_FONT_TEXT_RUN, DrawBitmapFontText::read); map.put(DRAW_TWEEN_PATH, DrawTweenPath::read); map.put(DATA_PATH, PathData::read); map.put(PAINT_VALUES, PaintData::read); Loading Loading @@ -389,8 +399,10 @@ public class Operations { map.put(PATH_ADD, PathAppend::read); map.put(IMPULSE_START, ImpulseOperation::read); map.put(IMPULSE_PROCESS, ImpulseProcess::read); map.put(PARTICLE_CREATE, ParticlesCreate::read); map.put(PARTICLE_DEFINE, ParticlesCreate::read); map.put(PARTICLE_LOOP, ParticlesLoop::read); map.put(FUNCTION_CALL, FloatFunctionCall::read); map.put(FUNCTION_DEFINE, FloatFunctionDefine::read); map.put(ACCESSIBILITY_SEMANTICS, CoreSemantics::read); // map.put(ACCESSIBILITY_CUSTOM_ACTION, CoreSemantics::read); Loading