当前位置: 首页>>代码示例>>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;未经允许,请勿转载。