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


Java LinearLayout.getVisibility方法代码示例

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


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

示例1: setColorPreview

import android.widget.LinearLayout; //导入方法依赖的package包/类
public void setColorPreview(LinearLayout colorPreview, Integer selectedColor) {
	if (colorPreview == null)
		return;
	this.colorPreview = colorPreview;
	if (selectedColor == null)
		selectedColor = 0;
	int children = colorPreview.getChildCount();
	if (children == 0 || colorPreview.getVisibility() != View.VISIBLE)
		return;

	for (int i = 0; i < children; i++) {
		View childView = colorPreview.getChildAt(i);
		if (!(childView instanceof LinearLayout))
			continue;
		LinearLayout childLayout = (LinearLayout) childView;
		if (i == selectedColor) {
			childLayout.setBackgroundColor(Color.WHITE);
		}
		ImageView childImage = (ImageView) childLayout.findViewById(R.id.image_preview);
		childImage.setClickable(true);
		childImage.setTag(i);
		childImage.setOnClickListener(new OnClickListener() {
			@Override
			public void onClick(View v) {
				if (v == null)
					return;
				Object tag = v.getTag();
				if (tag == null || !(tag instanceof Integer))
					return;
				setSelectedColor((int) tag);
			}
		});
	}
}
 
开发者ID:l465659833,项目名称:Bigbang,代码行数:35,代码来源:ColorPickerView.java

示例2: hidePages

import android.widget.LinearLayout; //导入方法依赖的package包/类
protected void hidePages()
{
	LinearLayout pages = (LinearLayout) findViewById(R.id.pages_container);
	if (null == pages)
		return;

	if (pages.getVisibility() == View.GONE)
		return;

	pages.setVisibility(View.GONE);
	ViewTreeObserver observer = mDocView.getViewTreeObserver();
	observer.addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener()
	{
		@Override
		public void onGlobalLayout()
		{
			mDocView.getViewTreeObserver().removeOnGlobalLayoutListener(this);
			mDocView.onHidePages();
		}
	});
}
 
开发者ID:ArtifexSoftware,项目名称:mupdf-android-viewer-nui,代码行数:22,代码来源:DocActivityView.java

示例3: toggleVoltageAdjustmentControls

import android.widget.LinearLayout; //导入方法依赖的package包/类
private void toggleVoltageAdjustmentControls(View rootView) {
    boolean isEnabled = AppState.getInstance().isLiPoMonitorEnabled;
    LinearLayout layout = (LinearLayout) rootView.findViewById(R.id.adjustmentLayout);
    boolean isVisible = layout.getVisibility() == View.VISIBLE;
    if (!isVisible) {
        if (isEnabled) {
            layout.setVisibility(View.VISIBLE);
        }
    } else {
        layout.setVisibility(View.GONE);
    }
}
 
开发者ID:voroshkov,项目名称:Chorus-RF-Laptimer,代码行数:13,代码来源:RaceSetupFragment.java

示例4: showPages

import android.widget.LinearLayout; //导入方法依赖的package包/类
protected void showPages()
{
	LinearLayout pages = (LinearLayout) findViewById(R.id.pages_container);
	if (null == pages)
		return;

	if (pages.getVisibility() == View.VISIBLE)
		return;

	pages.setVisibility(View.VISIBLE);

	final ViewTreeObserver observer = mDocView.getViewTreeObserver();
	observer.addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener()
	{
		@Override
		public void onGlobalLayout()
		{
			observer.removeOnGlobalLayoutListener(this);
			mDocView.onShowPages();
		}
	});

	final ViewTreeObserver observer2 = getViewTreeObserver();
	observer2.addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener()
	{
		@Override
		public void onGlobalLayout()
		{
			observer2.removeOnGlobalLayoutListener(this);
			mDocPagesView.onOrientationChange();
			int page = mDocView.getMostVisiblePage();
			mDocPagesView.setCurrentPage(page);
			mDocPagesView.scrollToPage(page);
		}
	});
}
 
开发者ID:ArtifexSoftware,项目名称:mupdf-android-viewer-nui,代码行数:37,代码来源:DocActivityView.java


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