本文整理汇总了Java中android.view.ViewGroup.OnHierarchyChangeListener类的典型用法代码示例。如果您正苦于以下问题:Java OnHierarchyChangeListener类的具体用法?Java OnHierarchyChangeListener怎么用?Java OnHierarchyChangeListener使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
OnHierarchyChangeListener类属于android.view.ViewGroup包,在下文中一共展示了OnHierarchyChangeListener类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: restoreImportantForAccessibilityHelper
import android.view.ViewGroup.OnHierarchyChangeListener; //导入依赖的package包/类
private void restoreImportantForAccessibilityHelper(View v) {
Integer important = mPreviousValues.get(v);
v.setImportantForAccessibility(important);
mPreviousValues.remove(v);
// Call method on children recursively
if (v instanceof ViewGroup) {
ViewGroup vg = (ViewGroup) v;
// We assume if a class implements OnHierarchyChangeListener, it listens
// to changes to any of its children (happens to be the case in Launcher)
if (vg instanceof OnHierarchyChangeListener) {
vg.setOnHierarchyChangeListener((OnHierarchyChangeListener) vg);
} else {
vg.setOnHierarchyChangeListener(null);
}
for (int i = 0; i < vg.getChildCount(); i++) {
View child = vg.getChildAt(i);
if (includeView(child)) {
restoreImportantForAccessibilityHelper(child);
}
}
}
}
示例2: setFor
import android.view.ViewGroup.OnHierarchyChangeListener; //导入依赖的package包/类
public static void setFor(ViewGroup group) {
if (group == null) {
return;
}
OnHierarchyChangeListener currentListener = getCurrentListener(group);
if (currentListener instanceof PXHierarchyListener) {
// We've already added ours to it, so nothing more to do.
return;
}
// RadioGroup check to avoid StackOverflow issues. The RadioGroup uses a
// similar delegation technique that trigger a StackOverflow, so we
// should not pass the currentListener to it.
if (!(group instanceof RadioGroup)) {
group.setOnHierarchyChangeListener(new PXHierarchyListener(currentListener));
} else {
group.setOnHierarchyChangeListener(new PXHierarchyListener(null));
}
addGlobalLayoutListener(group);
}
示例3: restoreImportantForAccessibilityHelper
import android.view.ViewGroup.OnHierarchyChangeListener; //导入依赖的package包/类
private void restoreImportantForAccessibilityHelper(View v) {
v.setImportantForAccessibility(mPreviousValues.get(v));
mPreviousValues.remove(v);
// Call method on children recursively
if (v instanceof ViewGroup) {
ViewGroup vg = (ViewGroup) v;
// We assume if a class implements OnHierarchyChangeListener, it listens
// to changes to any of its children (happens to be the case in Launcher)
if (vg instanceof OnHierarchyChangeListener) {
vg.setOnHierarchyChangeListener((OnHierarchyChangeListener) vg);
} else {
vg.setOnHierarchyChangeListener(null);
}
for (int i = 0; i < vg.getChildCount(); i++) {
View child = vg.getChildAt(i);
if (includeView(child)) {
restoreImportantForAccessibilityHelper(child);
}
}
}
}
示例4: getCurrentListener
import android.view.ViewGroup.OnHierarchyChangeListener; //导入依赖的package包/类
public static OnHierarchyChangeListener getCurrentListener(ViewGroup viewGroup) {
if (sHierarchyListenerField == null) {
initReflection();
}
if (sHierarchyListenerField == null) {
PXLog.w(TAG, "Unable to fetch the ViewGroup's current hierarchy listener. "
+ "Reflection failed.");
return null;
}
Object listener;
try {
listener = sHierarchyListenerField.get(viewGroup);
} catch (Exception e) {
PXLog.e(TAG, "Unable to fetch the ViewGroup's current hierarchy listener. "
+ "Reflection failed.");
return null;
}
if (listener == null || listener instanceof OnHierarchyChangeListener) {
return (OnHierarchyChangeListener) listener;
} else {
PXLog.w(TAG, "A hierarchy listener was found, but its type is unexpected: %s", listener
.getClass().getName());
return null;
}
}
示例5: logCurrentListener
import android.view.ViewGroup.OnHierarchyChangeListener; //导入依赖的package包/类
/**
* Just used for debug purposes. TODO delete.
*
* @param viewGroup
*/
public static void logCurrentListener(ViewGroup viewGroup) {
OnHierarchyChangeListener currentListener = getCurrentListener(viewGroup);
if (currentListener == null) {
PXLog.d(TAG, "%s has no hierarchy listener.", viewGroup.getClass().getSimpleName());
} else {
PXLog.d(TAG, "%s has hierarchy listener {1}", viewGroup.getClass().getSimpleName(),
currentListener.getClass().getSimpleName());
}
}
示例6: setOnHierarchyChangeListener
import android.view.ViewGroup.OnHierarchyChangeListener; //导入依赖的package包/类
/**
* @see ViewGroup#setOnHierarchyChangeListener(OnHierarchyChangeListener)
*/
public W setOnHierarchyChangeListener(OnHierarchyChangeListener listener) {
mView.setOnHierarchyChangeListener(listener);
return (W) this;
}
示例7: setOnHierarchyChangeListener
import android.view.ViewGroup.OnHierarchyChangeListener; //导入依赖的package包/类
public void setOnHierarchyChangeListener(OnHierarchyChangeListener onHierarchyChangeListener) {
this.mOnHierarchyChangeListener = onHierarchyChangeListener;
}
示例8: onHierarchyChange
import android.view.ViewGroup.OnHierarchyChangeListener; //导入依赖的package包/类
public Disposable onHierarchyChange(final OnHierarchyChangeListener onNext) {
return onHierarchyChange(onNext, Fu.ON_ERROR_MISSING);
}
示例9: setOnHierarchyChangeListener
import android.view.ViewGroup.OnHierarchyChangeListener; //导入依赖的package包/类
public void setOnHierarchyChangeListener(ViewGroup.OnHierarchyChangeListener paramOnHierarchyChangeListener)
{
this.mOnHierarchyChangeListener = paramOnHierarchyChangeListener;
}
示例10: PXHierarchyListener
import android.view.ViewGroup.OnHierarchyChangeListener; //导入依赖的package包/类
public PXHierarchyListener(OnHierarchyChangeListener existingListener) {
mExistingListener = existingListener;
}