android.view.ViewGroup#getVisibility ( )源码实例Demo

下面列出了android.view.ViewGroup#getVisibility ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: HaoReader   文件: BookFloatingActionMenu.java
private void expandInternal() {
    if (!isExpanded) {
        isExpanded = true;

        int index = 0;
        for (int i = getChildCount() - 2; i >= 0; i--) {
            ViewGroup childGroup = (ViewGroup) getChildAt(i);
            if (childGroup.getVisibility() != VISIBLE) {
                childGroup.setVisibility(VISIBLE);
            }
            View labelView = childGroup.getChildAt(0);
            FloatingActionButton btnView = (FloatingActionButton) childGroup.getChildAt(1);
            postDelayed(() -> {
                btnView.show();
                animateShowLabelView(labelView);
            }, 50 * index);
            index++;
        }
    }
}
 
源代码2 项目: Tangram-Android   文件: SwipeItemTouchListener.java
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;
    }
}
 
源代码3 项目: Tangram-Android   文件: SwipeItemTouchListener.java
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;
    }
}
 
源代码4 项目: Android_accordion_view   文件: WidgetHelper.java
/***
 * This function returns the actual height the layout. The getHeight() function returns the current height which might be zero if
 * the layout's visibility is GONE
 * @param layout
 * @return
 */
public static int getFullHeight(ViewGroup layout) {
    int specWidth = View.MeasureSpec.makeMeasureSpec(0 /* any */, View.MeasureSpec.UNSPECIFIED);
    int specHeight = View.MeasureSpec.makeMeasureSpec(0 /* any */, View.MeasureSpec.UNSPECIFIED);


    layout.measure(specWidth,specHeight);
    int totalHeight = 0;//layout.getMeasuredHeight();
    int initialVisibility = layout.getVisibility();
    layout.setVisibility(View.VISIBLE);
    int numberOfChildren = layout.getChildCount();
    for(int i = 0;i<numberOfChildren;i++) {
        View child = layout.getChildAt(i);
        if(child instanceof ViewGroup) {
            totalHeight+=getFullHeight((ViewGroup)child);
        }else {
            int desiredWidth = View.MeasureSpec.makeMeasureSpec(layout.getWidth(),
                    View.MeasureSpec.AT_MOST);
            child.measure(desiredWidth, View.MeasureSpec.UNSPECIFIED);
            totalHeight+=child.getMeasuredHeight();
        }

    }
    layout.setVisibility(initialVisibility);
    return totalHeight;
}
 
源代码5 项目: BlurView   文件: BlurBehindView.java
private void printViewsBehind(ViewGroup rootView) {
    if (!this.isInEditMode() && !(rootView instanceof BlurBehindView) && rootView.getVisibility() == View.VISIBLE && rootView.getAlpha() != 0.0F) {
        if (rootView.getBackground() != null) {
            this.blurCanvas.save();
            this.blurCanvas.translate((float) (this.childPositionInWindow[0] - this.thisPositionInWindow[0] + this.halfPaddingOnSides), (float) (this.halfPaddingOnSides + this.childPositionInWindow[1] - this.thisPositionInWindow[1]));
            rootView.getBackground().draw(this.blurCanvas);
            this.blurCanvas.restore();
        }

        for (int i = 0; i < rootView.getChildCount(); ++i) {
            View childView = rootView.getChildAt(i);
            if (childView.findViewWithTag(TAG_VIEW) != null & rootView.getVisibility() == View.VISIBLE) {
                this.printViewsBehind((ViewGroup) childView);
            } else if (childView.getVisibility() == View.VISIBLE) {
                this.blurCanvas.save();
                childView.getLocationOnScreen(this.childPositionInWindow);
                this.blurCanvas.translate((float) (this.halfPaddingOnSides + this.childPositionInWindow[0] - this.thisPositionInWindow[0]), (float) (this.halfPaddingOnSides + this.childPositionInWindow[1] - this.thisPositionInWindow[1]));
                this.blurCanvas.scale(childView.getScaleX(), childView.getScaleY());
                childView.draw(this.blurCanvas);
                this.blurCanvas.restore();
            }
        }
    }
}
 
源代码6 项目: BlurView   文件: BlurDrawable.java
private void printView(View bluredView) {
    if (!(bluredView instanceof ViewGroup)) {
        bluredView.draw(mBlurCanvas);
        return;
    }

    ViewGroup rootView = (ViewGroup) bluredView;

    if (rootView.getVisibility() == View.VISIBLE && rootView.getAlpha() != 0.0F) {
        if (rootView.findViewById(mDrawableContainerId) == null) {
            rootView.draw(mBlurCanvas);
            return;
        }

        for (int i = 0; i < rootView.getChildCount(); ++i) {
            View childView = rootView.getChildAt(i);

            if (childView.findViewById(mDrawableContainerId) != null & rootView.getVisibility() == View.VISIBLE) {
                this.printView(childView);
            } else if (childView.getVisibility() == View.VISIBLE) {
                childView.draw(mBlurCanvas);
            }
        }
    }
}
 
源代码7 项目: o2oa   文件: SwipeLayout.java
/**
 * prevent bottom view get any touch event. Especially in LayDown mode.
 */
private void safeBottomView() {
    Status status = getOpenStatus();
    ViewGroup bottom = getBottomView();

    if (status == Status.Close) {
        if (bottom.getVisibility() != INVISIBLE)
            bottom.setVisibility(INVISIBLE);
    } else {
        if (bottom.getVisibility() != VISIBLE)
            bottom.setVisibility(VISIBLE);
    }
}
 
源代码8 项目: o2oa   文件: SwipeLayoutConv.java
/**
 * prevent bottom view get any touch event. Especially in LayDown mode.
 */
private void safeBottomView() {
    Status status = getOpenStatus();
    ViewGroup bottom = getBottomView();

    if (status == Status.Close) {
        if (bottom.getVisibility() != INVISIBLE)
            bottom.setVisibility(INVISIBLE);
    } else {
        if (bottom.getVisibility() != VISIBLE)
            bottom.setVisibility(VISIBLE);
    }
}
 
源代码9 项目: AutoLoadListView   文件: ZSwipeItem.java
/**
 * 防止底布局获取到任何的触摸事件,特别是在LayDown模式
 */
private void safeBottomView() {
	Status status = getOpenStatus();
	ViewGroup bottom = getBottomView();

	if (status == Status.Close) {
		if (bottom.getVisibility() != INVISIBLE)
			bottom.setVisibility(INVISIBLE);
	} else {
		if (bottom.getVisibility() != VISIBLE)
			bottom.setVisibility(VISIBLE);
	}
}
 
源代码10 项目: ZListVIew   文件: ZSwipeItem.java
/**
 * 防止底布局获取到任何的触摸事件,特别是在LayDown模式
 */
private void safeBottomView() {
	Status status = getOpenStatus();
	ViewGroup bottom = getBottomView();

	if (status == Status.Close) {
		if (bottom.getVisibility() != INVISIBLE)
			bottom.setVisibility(INVISIBLE);
	} else {
		if (bottom.getVisibility() != VISIBLE)
			bottom.setVisibility(VISIBLE);
	}
}
 
源代码11 项目: UltimateAndroid   文件: SwipeLayout.java
/**
 * prevent bottom view get any touch event. Especially in LayDown mode.
 */
private void safeBottomView(){
    Status status = getOpenStatus();
    ViewGroup bottom = getBottomView();

    if(status == Status.Close){
        if(bottom.getVisibility() != INVISIBLE)
            bottom.setVisibility(INVISIBLE);
    }else {
        if(bottom.getVisibility() != VISIBLE)
            bottom.setVisibility(VISIBLE);
    }
}
 
 方法所在类