本文整理汇总了Java中android.view.ViewStructure类的典型用法代码示例。如果您正苦于以下问题:Java ViewStructure类的具体用法?Java ViewStructure怎么用?Java ViewStructure使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ViewStructure类属于android.view包,在下文中一共展示了ViewStructure类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: dispatchProvideAutofillStructure
import android.view.ViewStructure; //导入依赖的package包/类
@Override
public void dispatchProvideAutofillStructure(ViewStructure structure, int flags) {
if (mOriginalHint == null || mEditText == null) {
super.dispatchProvideAutofillStructure(structure, flags);
return;
}
// Temporarily sets child's hint to its original value so it is properly set in the
// child's ViewStructure.
final CharSequence hint = mEditText.getHint();
mEditText.setHint(mOriginalHint);
try {
super.dispatchProvideAutofillStructure(structure, flags);
} finally {
mEditText.setHint(hint);
}
}
开发者ID:commonsguy,项目名称:cwac-crossport,代码行数:18,代码来源:TextInputLayout.java
示例2: dispatchProvideAutofillStructure
import android.view.ViewStructure; //导入依赖的package包/类
@Override
public void dispatchProvideAutofillStructure(ViewStructure structure, int flags) {
if (originalHint == null || editText == null) {
super.dispatchProvideAutofillStructure(structure, flags);
return;
}
// Temporarily sets child's hint to its original value so it is properly set in the
// child's ViewStructure.
final CharSequence hint = editText.getHint();
editText.setHint(originalHint);
try {
super.dispatchProvideAutofillStructure(structure, flags);
} finally {
editText.setHint(hint);
}
}
开发者ID:material-components,项目名称:material-components-android,代码行数:18,代码来源:TextInputLayout.java
示例3: onProvideVirtualStructure
import android.view.ViewStructure; //导入依赖的package包/类
@TargetApi(Build.VERSION_CODES.M)
public void onProvideVirtualStructure(
final ViewStructure structure, final boolean ignoreScrollOffset) {
// Do not collect accessibility tree in incognito mode
if (getWebContents().isIncognito()) {
structure.setChildCount(0);
return;
}
structure.setChildCount(1);
final ViewStructure viewRoot = structure.asyncNewChild(0);
getWebContents().requestAccessibilitySnapshot(new AccessibilitySnapshotCallback() {
@Override
public void onAccessibilitySnapshot(AccessibilitySnapshotNode root) {
viewRoot.setClassName("");
viewRoot.setHint(mProductVersion);
if (root == null) {
viewRoot.asyncCommit();
return;
}
createVirtualStructure(viewRoot, root, ignoreScrollOffset);
}
});
}
开发者ID:mogoweb,项目名称:365browser,代码行数:24,代码来源:ContentViewCore.java
示例4: onProvideStructure
import android.view.ViewStructure; //导入依赖的package包/类
@Override
public void onProvideStructure(ViewStructure structure) {
super.onProvideStructure(structure);
if (allowAssistant && Build.VERSION.SDK_INT >= 23) {
if (currentMessageObject.messageText != null && currentMessageObject.messageText.length() > 0) {
structure.setText(currentMessageObject.messageText);
} else if (currentMessageObject.caption != null && currentMessageObject.caption.length() > 0) {
structure.setText(currentMessageObject.caption);
}
}
}
开发者ID:MLNO,项目名称:airgram,代码行数:12,代码来源:ChatMessageCell.java
示例5: onProvideAutofillVirtualStructure
import android.view.ViewStructure; //导入依赖的package包/类
@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++;
}
}
开发者ID:googlesamples,项目名称:android-AutofillFramework,代码行数:34,代码来源:CustomVirtualView.java
示例6: dispatchProvideAutofillStructure
import android.view.ViewStructure; //导入依赖的package包/类
@TargetApi(Build.VERSION_CODES.O)
@Override
public void dispatchProvideAutofillStructure(ViewStructure structure, int flags) {
// This view is self-sufficient for autofill, so it needs to call
// onProvideAutoFillStructure() to fill itself, but it does not need to call
// dispatchProvideAutoFillStructure() to fill its children.
structure.setAutofillId(getAutofillId());
onProvideAutofillStructure(structure, flags);
}
开发者ID:Gericop,项目名称:DateTimePicker,代码行数:10,代码来源:TimePicker.java
示例7: newChild
import android.view.ViewStructure; //导入依赖的package包/类
@Override
public ViewStructure newChild(int index) {
final ViewStructureImpl child = new ViewStructureImpl();
children[index] = child;
return child;
}
开发者ID:material-components,项目名称:material-components-android,代码行数:7,代码来源:ViewStructureImpl.java
示例8: asyncNewChild
import android.view.ViewStructure; //导入依赖的package包/类
@Override
public ViewStructure asyncNewChild(int index) {
return newChild(index);
}
开发者ID:material-components,项目名称:material-components-android,代码行数:5,代码来源:ViewStructureImpl.java
示例9: onProvideVirtualStructure
import android.view.ViewStructure; //导入依赖的package包/类
@Override
public void onProvideVirtualStructure(final ViewStructure structure) {
mContentViewCore.onProvideVirtualStructure(structure, false);
}
开发者ID:mogoweb,项目名称:365browser,代码行数:5,代码来源:ContentView.java
示例10: createVirtualStructure
import android.view.ViewStructure; //导入依赖的package包/类
@TargetApi(Build.VERSION_CODES.M)
private void createVirtualStructure(ViewStructure viewNode, AccessibilitySnapshotNode node,
final boolean ignoreScrollOffset) {
viewNode.setClassName(node.className);
if (node.hasSelection) {
viewNode.setText(node.text, node.startSelection, node.endSelection);
} else {
viewNode.setText(node.text);
}
int left = (int) mRenderCoordinates.fromLocalCssToPix(node.x);
int top = (int) mRenderCoordinates.fromLocalCssToPix(node.y);
int width = (int) mRenderCoordinates.fromLocalCssToPix(node.width);
int height = (int) mRenderCoordinates.fromLocalCssToPix(node.height);
Rect boundsInParent = new Rect(left, top, left + width, top + height);
if (node.isRootNode) {
// Offset of the web content relative to the View.
boundsInParent.offset(0, (int) mRenderCoordinates.getContentOffsetYPix());
if (!ignoreScrollOffset) {
boundsInParent.offset(-(int) mRenderCoordinates.getScrollXPix(),
-(int) mRenderCoordinates.getScrollYPix());
}
}
viewNode.setDimens(boundsInParent.left, boundsInParent.top, 0, 0, width, height);
viewNode.setChildCount(node.children.size());
if (node.hasStyle) {
// The text size should be in physical pixels, not CSS pixels.
float textSize = mRenderCoordinates.fromLocalCssToPix(node.textSize);
int style = (node.bold ? ViewNode.TEXT_STYLE_BOLD : 0)
| (node.italic ? ViewNode.TEXT_STYLE_ITALIC : 0)
| (node.underline ? ViewNode.TEXT_STYLE_UNDERLINE : 0)
| (node.lineThrough ? ViewNode.TEXT_STYLE_STRIKE_THRU : 0);
viewNode.setTextStyle(textSize, node.color, node.bgcolor, style);
}
for (int i = 0; i < node.children.size(); i++) {
createVirtualStructure(viewNode.asyncNewChild(i), node.children.get(i), true);
}
viewNode.asyncCommit();
}
开发者ID:mogoweb,项目名称:365browser,代码行数:42,代码来源:ContentViewCore.java
示例11: setAutofillId
import android.view.ViewStructure; //导入依赖的package包/类
public void setAutofillId(ViewStructure parent, int virtualId) {}
开发者ID:material-components,项目名称:material-components-android,代码行数:2,代码来源:ViewStructureImpl.java
注:本文中的android.view.ViewStructure类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论