當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。