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


Java ViewGroup.getVisibility方法代码示例

本文整理汇总了Java中android.view.ViewGroup.getVisibility方法的典型用法代码示例。如果您正苦于以下问题:Java ViewGroup.getVisibility方法的具体用法?Java ViewGroup.getVisibility怎么用?Java ViewGroup.getVisibility使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在android.view.ViewGroup的用法示例。


在下文中一共展示了ViewGroup.getVisibility方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: invalidateDisplayListInt

import android.view.ViewGroup; //导入方法依赖的package包/类
private void invalidateDisplayListInt(ViewGroup viewGroup, boolean invalidateThis) {
    for (int i = viewGroup.getChildCount() - 1; i >= 0; i--) {
        final View view = viewGroup.getChildAt(i);
        if (view instanceof ViewGroup) {
            invalidateDisplayListInt((ViewGroup) view, true);
        }
    }
    if (!invalidateThis) {
        return;
    }
    // we need to force it to become invisible
    if (viewGroup.getVisibility() == View.INVISIBLE) {
        viewGroup.setVisibility(View.VISIBLE);
        viewGroup.setVisibility(View.INVISIBLE);
    } else {
        final int visibility = viewGroup.getVisibility();
        viewGroup.setVisibility(View.INVISIBLE);
        viewGroup.setVisibility(visibility);
    }
}
 
开发者ID:MLNO,项目名称:airgram,代码行数:21,代码来源:RecyclerView.java

示例2: invalidateDisplayListInt

import android.view.ViewGroup; //导入方法依赖的package包/类
private void invalidateDisplayListInt(ViewGroup viewGroup, boolean invalidateThis) {
    for (int i = viewGroup.getChildCount() - 1; i >= 0; i--) {
        View view = viewGroup.getChildAt(i);
        if (view instanceof ViewGroup) {
            invalidateDisplayListInt((ViewGroup) view, true);
        }
    }
    if (!invalidateThis) {
        return;
    }
    if (viewGroup.getVisibility() == 4) {
        viewGroup.setVisibility(0);
        viewGroup.setVisibility(4);
        return;
    }
    int visibility = viewGroup.getVisibility();
    viewGroup.setVisibility(4);
    viewGroup.setVisibility(visibility);
}
 
开发者ID:JackChan1999,项目名称:letv,代码行数:20,代码来源:RecyclerView.java

示例3: findCanScrollView

import android.view.ViewGroup; //导入方法依赖的package包/类
private View findCanScrollView(View v) {
    if (v instanceof ViewGroup) {
        ViewGroup target = (ViewGroup) v;
        if ((target instanceof UltraViewPager || target instanceof RecyclerView)
            && target.getVisibility() == View.VISIBLE) {
            return target;
        } else {
            for (int i = 0; i < target.getChildCount(); ++i) {
                View view = findCanScrollView(target.getChildAt(i));
                if (view != null) {
                    return view;
                }
            }
            return null;
        }
    } else {
        return null;
    }
}
 
开发者ID:alibaba,项目名称:Tangram-Android,代码行数:20,代码来源:SwipeItemTouchListener.java

示例4: filterViewGroup

import android.view.ViewGroup; //导入方法依赖的package包/类
void filterViewGroup(MotionEvent ev) {
    int downX = Math.round(ev.getX());
    int downY = Math.round(ev.getY());
    int size = mChildViewGroups.size();
    mInAreaViewGroups.clear();
    for (int i = 0; i < size; i++) {
        ViewGroup child = mChildViewGroups.get(i);
        if (child == null || child.getVisibility() == View.GONE)
            continue;
        if (downX > child.getLeft() && downX < child.getRight() && downY > child.getTop() && downY < child.getBottom())
            mInAreaViewGroups.add(child);
    }
}
 
开发者ID:Sunzxyong,项目名称:PullToLoad,代码行数:14,代码来源:PullToRefreshLayout.java

示例5: canScrollUp

import android.view.ViewGroup; //导入方法依赖的package包/类
boolean canScrollUp() {
    int size = mInAreaViewGroups.size();
    for (int i = 0; i < size; i++) {
        ViewGroup viewGroup = mInAreaViewGroups.get(i);
        if (viewGroup != null && viewGroup.isEnabled() && viewGroup.getVisibility() != GONE) {
            if (viewGroup instanceof RecyclerView
                    || viewGroup instanceof AbsListView
                    || viewGroup instanceof ScrollView)
                return ViewCompat.canScrollVertically(viewGroup, -1);
        }
    }
    return mRootView == null || ViewCompat.canScrollVertically(mRootView, -1);
}
 
开发者ID:Sunzxyong,项目名称:PullToLoad,代码行数:14,代码来源:PullToRefreshLayout.java

示例6: isViewCovered

import android.view.ViewGroup; //导入方法依赖的package包/类
public static boolean isViewCovered(final View view) {
    View currentView = view;

    Rect currentViewRect = new Rect();
    boolean partVisible = currentView.getGlobalVisibleRect(currentViewRect);
    boolean totalHeightVisible = (currentViewRect.bottom - currentViewRect.top) >= view.getMeasuredHeight();
    boolean totalWidthVisible = (currentViewRect.right - currentViewRect.left) >= view.getMeasuredWidth();
    boolean totalViewVisible = partVisible && totalHeightVisible && totalWidthVisible;
    if (!totalViewVisible)
        return true;

    while (currentView.getParent() instanceof ViewGroup) {
        ViewGroup currentParent = (ViewGroup) currentView.getParent();
        if (currentParent.getVisibility() != View.VISIBLE)
            return true;

        int start = indexOfViewInParent(currentView, currentParent);
        for (int i = start + 1; i < currentParent.getChildCount(); i++) {
            Rect viewRect = new Rect();
            view.getGlobalVisibleRect(viewRect);
            View otherView = currentParent.getChildAt(i);
            Rect otherViewRect = new Rect();
            otherView.getGlobalVisibleRect(otherViewRect);
            if (Rect.intersects(viewRect, otherViewRect))
                return true;
        }
        currentView = currentParent;
    }
    return false;
}
 
开发者ID:warkiz,项目名称:IndicatorSeekBar,代码行数:31,代码来源:IndicatorUtils.java

示例7: onSingleTapUp

import android.view.ViewGroup; //导入方法依赖的package包/类
@Override
public boolean onSingleTapUp(MotionEvent e) {
    int position = mDecor.findHeaderPositionUnder((int) e.getX(), (int) e.getY());
    if (position != -1) {
        ViewGroup headerView = (ViewGroup) mDecor.getHeaderCell(mRecyclerView, position).itemView;
        mRecyclerView.playSoundEffect(SoundEffectConstants.CLICK);
        headerView.onTouchEvent(e);
        if (headerView.getVisibility() == View.VISIBLE) {
            viewClick(headerView, e);
            return true;
        }
    }
    return false;
}
 
开发者ID:xiaoshanlin000,项目名称:SLTableView,代码行数:15,代码来源:StickyRecyclerHeadersTouchListener.java


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