Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0b071a08 authored by Dianne Hackborn's avatar Dianne Hackborn
Browse files

Add view ID, rework assist API.

Add view ID information to the assist structure.

Also rework the API to simplify how it works by removing
the ViewNode wrapper around ViewNodeImpl -- these are now
just the same thing.  And then add complexity by introducing
a formal WindowNode object that contains the top-level window
information (so I can add in some more window-specific info
in the future).

Change-Id: I5d525cf61ab6a73193e5cceb4c09d2d21cc27bae
parent 79ec42e6
Loading
Loading
Loading
Loading
+17 −5
Original line number Diff line number Diff line
@@ -3977,22 +3977,25 @@ package android.app {
    method public int describeContents();
    method public android.content.ComponentName getActivityComponent();
    method public static android.app.AssistStructure getAssistStructure(android.os.Bundle);
    method public void getWindowAt(int, android.app.AssistStructure.ViewNode);
    method public int getWindowCount();
    method public android.app.AssistStructure.WindowNode getWindowNodeAt(int);
    method public int getWindowNodeCount();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final java.lang.String ASSIST_KEY = "android:assist_structure";
    field public static final android.os.Parcelable.Creator<android.app.AssistStructure> CREATOR;
  }
  public static class AssistStructure.ViewNode {
    ctor public AssistStructure.ViewNode();
    method public void getChildAt(int, android.app.AssistStructure.ViewNode);
    method public android.app.AssistStructure.ViewNode getChildAt(int);
    method public int getChildCount();
    method public java.lang.String getClassName();
    method public java.lang.String getContentDescription();
    method public java.lang.CharSequence getContentDescription();
    method public android.os.Bundle getExtras();
    method public int getHeight();
    method public java.lang.String getHint();
    method public int getId();
    method public java.lang.String getIdEntry();
    method public java.lang.String getIdPackage();
    method public java.lang.String getIdType();
    method public int getLeft();
    method public int getScrollX();
    method public int getScrollY();
@@ -4023,6 +4026,15 @@ package android.app {
    field public static final int TEXT_STYLE_UNDERLINE = 4; // 0x4
  }
  public static class AssistStructure.WindowNode {
    method public int getHeight();
    method public int getLeft();
    method public android.app.AssistStructure.ViewNode getRootViewNode();
    method public java.lang.CharSequence getTitle();
    method public int getTop();
    method public int getWidth();
  }
  public class DatePickerDialog extends android.app.AlertDialog implements android.widget.DatePicker.OnDateChangedListener android.content.DialogInterface.OnClickListener {
    ctor public DatePickerDialog(android.content.Context, android.app.DatePickerDialog.OnDateSetListener, int, int, int);
    ctor public DatePickerDialog(android.content.Context, int, android.app.DatePickerDialog.OnDateSetListener, int, int, int);
+17 −5
Original line number Diff line number Diff line
@@ -4067,22 +4067,25 @@ package android.app {
    method public int describeContents();
    method public android.content.ComponentName getActivityComponent();
    method public static android.app.AssistStructure getAssistStructure(android.os.Bundle);
    method public void getWindowAt(int, android.app.AssistStructure.ViewNode);
    method public int getWindowCount();
    method public android.app.AssistStructure.WindowNode getWindowNodeAt(int);
    method public int getWindowNodeCount();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final java.lang.String ASSIST_KEY = "android:assist_structure";
    field public static final android.os.Parcelable.Creator<android.app.AssistStructure> CREATOR;
  }
  public static class AssistStructure.ViewNode {
    ctor public AssistStructure.ViewNode();
    method public void getChildAt(int, android.app.AssistStructure.ViewNode);
    method public android.app.AssistStructure.ViewNode getChildAt(int);
    method public int getChildCount();
    method public java.lang.String getClassName();
    method public java.lang.String getContentDescription();
    method public java.lang.CharSequence getContentDescription();
    method public android.os.Bundle getExtras();
    method public int getHeight();
    method public java.lang.String getHint();
    method public int getId();
    method public java.lang.String getIdEntry();
    method public java.lang.String getIdPackage();
    method public java.lang.String getIdType();
    method public int getLeft();
    method public int getScrollX();
    method public int getScrollY();
@@ -4113,6 +4116,15 @@ package android.app {
    field public static final int TEXT_STYLE_UNDERLINE = 4; // 0x4
  }
  public static class AssistStructure.WindowNode {
    method public int getHeight();
    method public int getLeft();
    method public android.app.AssistStructure.ViewNode getRootViewNode();
    method public java.lang.CharSequence getTitle();
    method public int getTop();
    method public int getWidth();
  }
  public class DatePickerDialog extends android.app.AlertDialog implements android.widget.DatePicker.OnDateChangedListener android.content.DialogInterface.OnClickListener {
    ctor public DatePickerDialog(android.content.Context, android.app.DatePickerDialog.OnDateSetListener, int, int, int);
    ctor public DatePickerDialog(android.content.Context, int, android.app.DatePickerDialog.OnDateSetListener, int, int, int);
+212 −93

File changed.

Preview size limit exceeded, changes collapsed.

+5 −6
Original line number Diff line number Diff line
@@ -47,12 +47,12 @@ public class AssistVisualizer extends View {
    public void setAssistStructure(AssistStructure as) {
        mAssistStructure = as;
        mTextRects.clear();
        final int N = as.getWindowCount();
        final int N = as.getWindowNodeCount();
        if (N > 0) {
            AssistStructure.ViewNode window = new AssistStructure.ViewNode();
            for (int i=0; i<N; i++) {
                as.getWindowAt(i, window);
                buildTextRects(window, 0, 0);
                AssistStructure.WindowNode windowNode = as.getWindowNodeAt(i);
                buildTextRects(windowNode.getRootViewNode(), windowNode.getLeft(),
                        windowNode.getTop());
            }
        }
        invalidate();
@@ -79,9 +79,8 @@ public class AssistVisualizer extends View {
        if (N > 0) {
            left -= root.getScrollX();
            top -= root.getScrollY();
            AssistStructure.ViewNode child = new AssistStructure.ViewNode();
            for (int i=0; i<N; i++) {
                root.getChildAt(i, child);
                AssistStructure.ViewNode child = root.getChildAt(i);
                buildTextRects(child, left, top);
            }
        }