當前位置: 首頁>>代碼示例>>Java>>正文


Java ImageButton.getVisibility方法代碼示例

本文整理匯總了Java中android.widget.ImageButton.getVisibility方法的典型用法代碼示例。如果您正苦於以下問題:Java ImageButton.getVisibility方法的具體用法?Java ImageButton.getVisibility怎麽用?Java ImageButton.getVisibility使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在android.widget.ImageButton的用法示例。


在下文中一共展示了ImageButton.getVisibility方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: onClick

import android.widget.ImageButton; //導入方法依賴的package包/類
@Override
public void onClick(View v) {
    final View deleteView = v;
    final ImageButton deleteButton = v.findViewById(R.id.deleteButton);

    if (deleteButton.getVisibility() == View.VISIBLE) {
        deleteView.setBackgroundColor(Color.TRANSPARENT);
        deleteButton.setVisibility(View.INVISIBLE);
    } else {
        deleteView.setBackgroundColor(Color.RED);
        deleteButton.setVisibility(View.VISIBLE);
        deleteButton.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                if (view == deleteButton) {
                    Toast.makeText(getApplicationContext(), "Will be deleted", Toast.LENGTH_SHORT).show();
                    deleteButton.setVisibility(View.INVISIBLE);
                    deleteView.setBackgroundColor(Color.TRANSPARENT);
                }
            }
        });
    }
}
 
開發者ID:RobIsr,項目名稱:OneMoreRepFitness,代碼行數:24,代碼來源:ShowResults.java

示例2: run

import android.widget.ImageButton; //導入方法依賴的package包/類
@Override
public void run() {
	DragAdapter.isShowAdd = false;
	for (int i = 0; i < getChildCount(); i++) {
		final View mGridItemView = getChildAt(i);
		mDeleteButton = (ImageButton) mGridItemView
				.findViewById(R.id.ic_close);
		// mDeleteButton.setOnClickListener(DragGridView.this);
		if (mDeleteButton.getVisibility() != View.VISIBLE) {
			mDeleteButton.setVisibility(View.VISIBLE);
		}
		if (mNeedShake) {
			mStartShake = true;
			shakeAnimation(mGridItemView);
		}

	}
}
 
開發者ID:smartbeng,項目名稱:PaoMovie,代碼行數:19,代碼來源:DragGridView.java

示例3: onFinishInflate

import android.widget.ImageButton; //導入方法依賴的package包/類
@Override
public void onFinishInflate() {
    super.onFinishInflate();
    mLocationBar = (LocationBarTablet) findViewById(R.id.location_bar);

    mHomeButton = (TintedImageButton) findViewById(R.id.home_button);
    mBackButton = (TintedImageButton) findViewById(R.id.back_button);
    mForwardButton = (TintedImageButton) findViewById(R.id.forward_button);
    mReloadButton = (TintedImageButton) findViewById(R.id.refresh_button);
    mShowTabStack = DeviceClassManager.isAccessibilityModeEnabled(getContext())
            || CommandLine.getInstance().hasSwitch(ChromeSwitches.ENABLE_TABLET_TAB_STACK);

    mTabSwitcherButtonDrawable =
            TabSwitcherDrawable.createTabSwitcherDrawable(getResources(), false);
    mTabSwitcherButtonDrawableLight =
            TabSwitcherDrawable.createTabSwitcherDrawable(getResources(), true);

    mAccessibilitySwitcherButton = (ImageButton) findViewById(R.id.tab_switcher_button);
    mAccessibilitySwitcherButton.setImageDrawable(mTabSwitcherButtonDrawable);
    updateSwitcherButtonVisibility(mShowTabStack);

    mBookmarkButton = (TintedImageButton) findViewById(R.id.bookmark_button);

    mMenuButton = (TintedImageButton) findViewById(R.id.menu_button);
    mMenuButtonWrapper.setVisibility(View.VISIBLE);

    if (mAccessibilitySwitcherButton.getVisibility() == View.GONE
            && mMenuButtonWrapper.getVisibility() == View.GONE) {
        ApiCompatibilityUtils.setPaddingRelative((View) mMenuButtonWrapper.getParent(), 0, 0,
                getResources().getDimensionPixelSize(R.dimen.tablet_toolbar_end_padding), 0);
    }

    mSaveOfflineButton = (TintedImageButton) findViewById(R.id.save_offline_button);

    // Initialize values needed for showing/hiding toolbar buttons when the activity size
    // changes.
    mShouldAnimateButtonVisibilityChange = false;
    mToolbarButtonsVisible = true;
    mToolbarButtons = new TintedImageButton[] {mBackButton, mForwardButton, mReloadButton};
}
 
開發者ID:rkshuai,項目名稱:chromium-for-android-56-debug-video,代碼行數:41,代碼來源:ToolbarTablet.java


注:本文中的android.widget.ImageButton.getVisibility方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。