Java Code Examples for android.view.ViewStructure#setDataIsSensitive()

The following examples show how to use android.view.ViewStructure#setDataIsSensitive() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: CustomVirtualView.java    From input-samples with Apache License 2.0 5 votes vote down vote up
@Override
public void onProvideAutofillVirtualStructure(ViewStructure structure, int flags) {
    // Build a ViewStructure that will get passed to the AutofillService by the framework
    // when it is time to find autofill suggestions.
    structure.setClassName(getClass().getName());
    int childrenSize = mVirtualViews.size();
    if (DEBUG) {
        Log.d(TAG, "onProvideAutofillVirtualStructure(): flags = " + flags + ", items = "
                + childrenSize + ", extras: " + bundleToString(structure.getExtras()));
    }
    int index = structure.addChildCount(childrenSize);
    // Traverse through the view hierarchy, including virtual child views. For each view, we
    // need to set the relevant autofill metadata and add it to the ViewStructure.
    for (int i = 0; i < childrenSize; i++) {
        Item item = mVirtualViews.valueAt(i);
        if (DEBUG) {
            Log.d(TAG, "Adding new child at index " + index + ": " + item);
        }
        ViewStructure child = structure.newChild(index);
        child.setAutofillId(structure.getAutofillId(), item.id);
        child.setAutofillHints(item.hints);
        child.setAutofillType(item.type);
        child.setAutofillValue(item.getAutofillValue());
        child.setDataIsSensitive(!item.sanitized);
        child.setFocused(item.focused);
        child.setVisibility(View.VISIBLE);
        child.setDimens(item.line.mBounds.left, item.line.mBounds.top, 0, 0,
                item.line.mBounds.width(), item.line.mBounds.height());
        child.setId(item.id, getContext().getPackageName(), null, item.idEntry);
        child.setClassName(item.getClassName());
        child.setDimens(item.line.mBounds.left, item.line.mBounds.top, 0, 0,
                item.line.mBounds.width(), item.line.mBounds.height());
        index++;
    }
}
 
Example 2
Source File: CustomVirtualView.java    From android-AutofillFramework with Apache License 2.0 5 votes vote down vote up
@Override
public void onProvideAutofillVirtualStructure(ViewStructure structure, int flags) {
    // Build a ViewStructure that will get passed to the AutofillService by the framework
    // when it is time to find autofill suggestions.
    structure.setClassName(getClass().getName());
    int childrenSize = mVirtualViews.size();
    if (DEBUG) {
        Log.d(TAG, "onProvideAutofillVirtualStructure(): flags = " + flags + ", items = "
                + childrenSize + ", extras: " + bundleToString(structure.getExtras()));
    }
    int index = structure.addChildCount(childrenSize);
    // Traverse through the view hierarchy, including virtual child views. For each view, we
    // need to set the relevant autofill metadata and add it to the ViewStructure.
    for (int i = 0; i < childrenSize; i++) {
        Item item = mVirtualViews.valueAt(i);
        if (DEBUG) {
            Log.d(TAG, "Adding new child at index " + index + ": " + item);
        }
        ViewStructure child = structure.newChild(index);
        child.setAutofillId(structure.getAutofillId(), item.id);
        child.setAutofillHints(item.hints);
        child.setAutofillType(item.type);
        child.setAutofillValue(item.getAutofillValue());
        child.setDataIsSensitive(!item.sanitized);
        child.setFocused(item.focused);
        child.setVisibility(View.VISIBLE);
        child.setDimens(item.line.mBounds.left, item.line.mBounds.top, 0, 0,
                item.line.mBounds.width(), item.line.mBounds.height());
        child.setId(item.id, getContext().getPackageName(), null, item.idEntry);
        child.setClassName(item.getClassName());
        child.setDimens(item.line.mBounds.left, item.line.mBounds.top, 0, 0,
                item.line.mBounds.width(), item.line.mBounds.height());
        index++;
    }
}
 
Example 3
Source File: RadioGroup.java    From android_9.0.0_r45 with Apache License 2.0 4 votes vote down vote up
@Override
public void onProvideAutofillStructure(ViewStructure structure, int flags) {
    super.onProvideAutofillStructure(structure, flags);
    structure.setDataIsSensitive(mCheckedId != mInitialCheckedId);
}
 
Example 4
Source File: CompoundButton.java    From android_9.0.0_r45 with Apache License 2.0 4 votes vote down vote up
@Override
public void onProvideAutofillStructure(ViewStructure structure, int flags) {
    super.onProvideAutofillStructure(structure, flags);

    structure.setDataIsSensitive(!mCheckedFromResource);
}
 
Example 5
Source File: NestedRadioGroupManager.java    From NestedRadioButton with Apache License 2.0 4 votes vote down vote up
@TargetApi(Build.VERSION_CODES.O)
public void onProvideAutofillStructure(ViewStructure structure) {
    structure.setDataIsSensitive(checkedId != initialCheckedId);
}