Search in sources :

Example 1 with ILVView

use of com.taobao.luaview.view.interfaces.ILVView in project LuaViewSDK by alibaba.

the class DestroyUtil method clearViews.

public static void clearViews(ViewGroup viewGroup) {
    LogUtil.d("onDestory", "clearViews", viewGroup);
    if (viewGroup != null) {
        View child = null;
        UDView udView = null;
        for (int i = 0; i < viewGroup.getChildCount(); i++) {
            child = viewGroup.getChildAt(i);
            if (child instanceof ViewGroup) {
                clearViews((ViewGroup) child);
            } else if (child instanceof ILVView) {
                udView = ((ILVView) child).getUserdata();
                if (udView != null) {
                    udView.onDestroy();
                }
            }
        }
        if (viewGroup instanceof ILVView) {
            udView = ((ILVView) viewGroup).getUserdata();
            if (udView != null) {
                udView.onDestroy();
            }
        }
    }
}
Also used : ILVView(com.taobao.luaview.view.interfaces.ILVView) UDView(com.taobao.luaview.userdata.ui.UDView) ViewGroup(android.view.ViewGroup) UDView(com.taobao.luaview.userdata.ui.UDView) View(android.view.View) ILVView(com.taobao.luaview.view.interfaces.ILVView)

Aggregations

View (android.view.View)1 ViewGroup (android.view.ViewGroup)1 UDView (com.taobao.luaview.userdata.ui.UDView)1 ILVView (com.taobao.luaview.view.interfaces.ILVView)1