android.widget.ImageButton.setVisibility()方法的使用及代码示例

x33g5p2x  于2022-01-20 转载在 其他  
字(7.3k)|赞(0)|评价(0)|浏览(186)

本文整理了Java中android.widget.ImageButton.setVisibility()方法的一些代码示例,展示了ImageButton.setVisibility()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ImageButton.setVisibility()方法的具体详情如下:
包路径:android.widget.ImageButton
类名称:ImageButton
方法名:setVisibility

ImageButton.setVisibility介绍

暂无

代码示例

代码示例来源:origin: TangoAgency/material-intro-screen

/**
 * Hides any back button
 */
@SuppressWarnings("unused")
public void hideBackButton() {
  backButton.setVisibility(View.INVISIBLE);
  skipButton.setVisibility(View.GONE);
}

代码示例来源:origin: GitLqr/LQRWeChat

@Override
public void initView() {
  mIbAddMenu.setVisibility(View.GONE);
}

代码示例来源:origin: TangoAgency/material-intro-screen

/**
 * Set back button visible
 */
public void setBackButtonVisible() {
  skipButton.setVisibility(GONE);
  backButton.setVisibility(View.VISIBLE);
  backButton.setOnClickListener(new View.OnClickListener() {
    @Override
    public void onClick(View v) {
      viewPager.setCurrentItem(viewPager.getPreviousItem(), true);
    }
  });
}

代码示例来源:origin: ivacf/archi

@Override
public void onTextChanged(CharSequence charSequence, int start, int before, int count) {
  searchButton.setVisibility(charSequence.length() > 0 ? View.VISIBLE : View.GONE);
}

代码示例来源:origin: ivacf/archi

@Override
public void onTextChanged(CharSequence charSequence, int start, int before, int count) {
  searchButton.setVisibility(charSequence.length() > 0 ? View.VISIBLE : View.GONE);
}

代码示例来源:origin: TangoAgency/material-intro-screen

/**
 * Set skip button instead of back button
 */
@SuppressWarnings("unused")
public void setSkipButtonVisible() {
  backButton.setVisibility(GONE);
  skipButton.setVisibility(View.VISIBLE);
  skipButton.setOnClickListener(new View.OnClickListener() {
    @Override
    public void onClick(View v) {
      for (int position = viewPager.getCurrentItem(); position < adapter.getCount(); position++) {
        if (!adapter.getItem(position).canMoveFurther()) {
          viewPager.setCurrentItem(position, true);
          showError(adapter.getItem(position).cantMoveFurtherErrorMessage());
          return;
        }
      }
      viewPager.setCurrentItem(adapter.getLastItemPosition(), true);
    }
  });
}

代码示例来源:origin: wdullaer/MaterialDateTimePicker

private void updateButtonVisibility(int position) {
  final boolean isHorizontal = controller.getScrollOrientation() == DatePickerDialog.ScrollOrientation.HORIZONTAL;
  final boolean hasPrev = position > 0;
  final boolean hasNext = position < (dayPickerView.getCount() - 1);
  prevButton.setVisibility(isHorizontal && hasPrev ? View.VISIBLE : View.INVISIBLE);
  nextButton.setVisibility(isHorizontal && hasNext ? View.VISIBLE : View.INVISIBLE);
}

代码示例来源:origin: GitLqr/LQRWeChat

@Override
public void initView() {
  selectBottomOne(0);
  mIbToolbarMore.setVisibility(View.VISIBLE);
}

代码示例来源:origin: GitLqr/LQRWeChat

@Override
public void initView() {
  if (mUserInfo == null) {
    finish();
    return;
  }
  mIbToolbarMore.setVisibility(View.VISIBLE);
}

代码示例来源:origin: TeamNewPipe/NewPipe

private void onStateChanged(final int state) {
  switch (state) {
    case BasePlayer.STATE_PAUSED:
      playPauseButton.setImageResource(R.drawable.ic_play_arrow_white);
      break;
    case BasePlayer.STATE_PLAYING:
      playPauseButton.setImageResource(R.drawable.ic_pause_white);
      break;
    case BasePlayer.STATE_COMPLETED:
      playPauseButton.setImageResource(R.drawable.ic_replay_white);
      break;
    default:
      break;
  }
  switch (state) {
    case BasePlayer.STATE_PAUSED:
    case BasePlayer.STATE_PLAYING:
    case BasePlayer.STATE_COMPLETED:
      playPauseButton.setClickable(true);
      playPauseButton.setVisibility(View.VISIBLE);
      progressBar.setVisibility(View.GONE);
      break;
    default:
      playPauseButton.setClickable(false);
      playPauseButton.setVisibility(View.INVISIBLE);
      progressBar.setVisibility(View.VISIBLE);
      break;
  }
}

代码示例来源:origin: Clans/FloatingActionButton

@Override
public void setVisibility(int visibility) {
  super.setVisibility(visibility);
  Label label = (Label) getTag(R.id.fab_label);
  if (label != null) {
    label.setVisibility(visibility);
  }
}

代码示例来源:origin: Clans/FloatingActionButton

/**
 * Makes the <b>FloatingActionButton</b> to disappear and sets its visibility to {@link #INVISIBLE}
 *
 * @param animate if true - plays "hide animation"
 */
public void hide(boolean animate) {
  if (!isHidden()) {
    if (animate) {
      playHideAnimation();
    }
    super.setVisibility(INVISIBLE);
  }
}

代码示例来源:origin: Clans/FloatingActionButton

/**
 * Makes the <b>FloatingActionButton</b> to appear and sets its visibility to {@link #VISIBLE}
 *
 * @param animate if true - plays "show animation"
 */
public void show(boolean animate) {
  if (isHidden()) {
    if (animate) {
      playShowAnimation();
    }
    super.setVisibility(VISIBLE);
  }
}

代码示例来源:origin: GitLqr/LQRWeChat

@Override
public void initView() {
  setToolbarTitle(UIUtils.getString(R.string.header_pic));
  mIbToolbarMore.setVisibility(View.VISIBLE);
  if (TextUtils.isEmpty(mUrl)) {
    finish();
    return;
  }
  mPv.enable();// 启用图片缩放功能
  Glide.with(this).load(Uri.parse(mUrl)).placeholder(R.mipmap.default_image).centerCrop().into(mPv);
}

代码示例来源:origin: GitLqr/LQRWeChat

@Override
public void initView() {
  mIbToolbarMore.setImageResource(R.mipmap.ic_session_info);
  mIbToolbarMore.setVisibility(View.VISIBLE);
  mElEmotion.attachEditText(mEtContent);
  initEmotionKeyboard();
  initRefreshLayout();
  setTitle();
}

代码示例来源:origin: nickbutcher/plaid

private void showPostingProgress() {
  ensurePostingProgressInflated();
  fabPosting.setVisibility(View.VISIBLE);
  // if stub has just been inflated then it will not have been laid out yet
  if (fabPosting.isLaidOut()) {
    revealPostingProgress();
  } else {
    fabPosting.addOnLayoutChangeListener(new View.OnLayoutChangeListener() {
      @Override
      public void onLayoutChange(View v, int l, int t, int r, int b,
                    int oldL, int oldT, int oldR, int oldB) {
        fabPosting.removeOnLayoutChangeListener(this);
        revealPostingProgress();
      }
    });
  }
}

代码示例来源:origin: TeamNewPipe/NewPipe

relatedStreamExpandButton.setVisibility(View.VISIBLE);
} else {
  if (info.getNextVideo() == null) setRelatedStreamsVisibility(View.GONE);
  relatedStreamExpandButton.setVisibility(View.GONE);

代码示例来源:origin: GitLqr/LQRWeChat

@Override
public void initView() {
  setToolbarTitle(UIUtils.getString(R.string.app_name));
  mIbAddMenu.setVisibility(View.VISIBLE);
  //等待全局数据获取完毕
  showWaitingDialog(UIUtils.getString(R.string.please_wait));
  //默认选中第一个
  setTransparency();
  mTvMessagePress.getBackground().setAlpha(255);
  mTvMessageTextPress.setTextColor(Color.argb(255, 69, 192, 26));
  //设置ViewPager的最大缓存页面
  mVpContent.setOffscreenPageLimit(3);
  mFragmentList.add(FragmentFactory.getInstance().getRecentMessageFragment());
  mFragmentList.add(FragmentFactory.getInstance().getContactsFragment());
  mFragmentList.add(FragmentFactory.getInstance().getDiscoveryFragment());
  mFragmentList.add(FragmentFactory.getInstance().getMeFragment());
  mVpContent.setAdapter(new CommonFragmentPagerAdapter(getSupportFragmentManager(), mFragmentList));
}

代码示例来源:origin: nickbutcher/plaid

fabPosting.setImageDrawable(complete);
complete.start();
fabPosting.postDelayed(() -> fabPosting.setVisibility(View.GONE), 2100); // length of R.drawable.avd_upload_complete

代码示例来源:origin: GitLqr/LQRWeChat

@Override
public void initView() {
  mIbToolbarMore.setVisibility(View.VISIBLE);
  //设置webView
  WebSettings settings = mWebView.getSettings();
  settings.setRenderPriority(WebSettings.RenderPriority.HIGH);
  settings.setSupportMultipleWindows(true);
  settings.setJavaScriptEnabled(true);
  settings.setSavePassword(false);
  settings.setJavaScriptCanOpenWindowsAutomatically(true);
  settings.setMinimumFontSize(settings.getMinimumLogicalFontSize() + 8);
  settings.setAllowFileAccess(false);
  settings.setTextSize(WebSettings.TextSize.NORMAL);
  mWebView.setVerticalScrollbarOverlay(true);
  mWebView.setWebViewClient(new MyWebViewClient());
  mWebView.loadUrl(mUrl);
  setToolbarTitle(TextUtils.isEmpty(mTitle) ? mWebView.getTitle() : mTitle);
}

相关文章

ImageButton类方法