当前位置: 首页>>代码示例>>Java>>正文


Java OnHierarchyChangeListener类代码示例

本文整理汇总了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);
            }
        }
    }
}
 
开发者ID:Phonemetra,项目名称:TurboLauncher,代码行数:25,代码来源:HideFromAccessibilityHelper.java

示例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);
}
 
开发者ID:Pixate,项目名称:pixate-freestyle-android,代码行数:22,代码来源:PXHierarchyListener.java

示例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);
            }
        }
    }
}
 
开发者ID:Kwamecorp,项目名称:Fairphone,代码行数:24,代码来源:HideFromAccessibilityHelper.java

示例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;
    }

}
 
开发者ID:Pixate,项目名称:pixate-freestyle-android,代码行数:31,代码来源:PXHierarchyListener.java

示例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());
    }
}
 
开发者ID:Pixate,项目名称:pixate-freestyle-android,代码行数:17,代码来源:PXHierarchyListener.java

示例6: setOnHierarchyChangeListener

import android.view.ViewGroup.OnHierarchyChangeListener; //导入依赖的package包/类
/**
* @see ViewGroup#setOnHierarchyChangeListener(OnHierarchyChangeListener)
*/
 public W setOnHierarchyChangeListener(OnHierarchyChangeListener listener) {
     mView.setOnHierarchyChangeListener(listener);
     return (W) this;
 }
 
开发者ID:AnthZh,项目名称:AndroidViewHelper,代码行数:8,代码来源:ViewGroupWrapper.java

示例7: setOnHierarchyChangeListener

import android.view.ViewGroup.OnHierarchyChangeListener; //导入依赖的package包/类
public void setOnHierarchyChangeListener(OnHierarchyChangeListener onHierarchyChangeListener) {
    this.mOnHierarchyChangeListener = onHierarchyChangeListener;
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:4,代码来源:CoordinatorLayout.java

示例8: onHierarchyChange

import android.view.ViewGroup.OnHierarchyChangeListener; //导入依赖的package包/类
public Disposable onHierarchyChange(final OnHierarchyChangeListener onNext) {
    return onHierarchyChange(onNext, Fu.ON_ERROR_MISSING);
}
 
开发者ID:landawn,项目名称:AbacusUtil,代码行数:4,代码来源:Observer.java

示例9: setOnHierarchyChangeListener

import android.view.ViewGroup.OnHierarchyChangeListener; //导入依赖的package包/类
public void setOnHierarchyChangeListener(ViewGroup.OnHierarchyChangeListener paramOnHierarchyChangeListener)
{
  this.mOnHierarchyChangeListener = paramOnHierarchyChangeListener;
}
 
开发者ID:ChiangC,项目名称:FMTech,代码行数:5,代码来源:CoordinatorLayout.java

示例10: PXHierarchyListener

import android.view.ViewGroup.OnHierarchyChangeListener; //导入依赖的package包/类
public PXHierarchyListener(OnHierarchyChangeListener existingListener) {
    mExistingListener = existingListener;
}
 
开发者ID:Pixate,项目名称:pixate-freestyle-android,代码行数:4,代码来源:PXHierarchyListener.java


注:本文中的android.view.ViewGroup.OnHierarchyChangeListener类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。