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