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

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

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

ImageButton.setEnabled介绍

暂无

代码示例

代码示例来源:origin: pili-engineering/PLDroidPlayer

private void disableUnsupportedButtons() {
  try {
    if (mPauseButton != null && !mPlayer.canPause())
      mPauseButton.setEnabled(false);
  } catch (IncompatibleClassChangeError ex) {
  }
}

代码示例来源:origin: pili-engineering/PLDroidPlayer

@Override
public void setEnabled(boolean enabled) {
  if (mPauseButton != null) {
    mPauseButton.setEnabled(enabled);
  }
  if (mFfwdButton != null) {
    mFfwdButton.setEnabled(enabled);
  }
  if (mRewButton != null) {
    mRewButton.setEnabled(enabled);
  }
  if (mProgress != null && !mDisableProgress)
    mProgress.setEnabled(enabled);
  disableUnsupportedButtons();
  super.setEnabled(enabled);
}

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

@Override
public void setEnabled(boolean enabled) {
  super.setEnabled(enabled);
  Label label = (Label) getTag(R.id.fab_label);
  if (label != null) {
    label.setEnabled(enabled);
  }
}

代码示例来源:origin: HotBitmapGG/bilibili-android-client

private void disableUnsupportedButtons() {
  if (mPauseButton != null && mTvPlay != null && !mPlayer.canPause()) {
    mPauseButton.setEnabled(false);
    mTvPlay.setEnabled(false);
  }
}

代码示例来源:origin: stackoverflow.com

item.setEnabled(enabled);
Drawable originalIcon = ctxt.getResources().getDrawable(iconResId);
Drawable icon = enabled ? originalIcon : convertDrawableToGrayScale(originalIcon);

代码示例来源:origin: HotBitmapGG/bilibili-android-client

@Override
public void setEnabled(boolean enabled) {
  if (mPauseButton != null) {
    mPauseButton.setEnabled(enabled);
  }
  if (mTvPlay != null) {
    mTvPlay.setEnabled(enabled);
  }
  if (mProgress != null) {
    mProgress.setEnabled(enabled);
  }
  disableUnsupportedButtons();
  super.setEnabled(enabled);
}

代码示例来源:origin: stackoverflow.com

case R.id.next:
   Log.i("Tag","tag");
   if(imageCounter < imageList.length)
   {
     imageCounter++;
     imagePath = imageList[imageCounter];
     if (imageCounter==(imageList.length)-1)
     {
       ImageButton next=(ImageButton)findViewBYId(R.id.next);
       next.setEnabled(false);
     }
   }
   break;
 case R.id.back:
   if(imageCounter > 0)
   {
     imageCounter--;
     imagePath = imageList[imageCounter];
     if (imageCounter==0)
     {
       ImageButton back=(ImageButton)findViewBYId(r.id.back);
       back.setEnabled(false);
     }
   }
   break;

代码示例来源:origin: fossasia/pslab-android

private void toggleSeekBtns(boolean state) {
  if (!state) {
    waveMonPropSelect.setText("");
    waveMonPropValueSelect.setText("");
    pwmMonPropSelect.setText("");
    pwmMonPropSelectValue.setText("");
  }
  imgBtnUp.setEnabled(state);
  imgBtnDown.setEnabled(state);
  seekBar.setEnabled(state);
  btnSet.setEnabled(state);
}

代码示例来源:origin: brianwernick/ExoMedia

@Override
public void showLoading(boolean initialLoad) {
  if (isLoading) {
    return;
  }
  isLoading = true;
  loadingProgressBar.setVisibility(View.VISIBLE);
  if (initialLoad) {
    controlsContainer.setVisibility(View.GONE);
  } else {
    playPauseButton.setEnabled(false);
    previousButton.setEnabled(false);
    nextButton.setEnabled(false);
  }
  show();
}

代码示例来源:origin: brianwernick/ExoMedia

@Override
public void setRewindButtonEnabled(boolean enabled) {
  if (rewindButton != null) {
    rewindButton.setEnabled(enabled);
    enabledViews.put(R.id.exomedia_controls_rewind_btn, enabled);
  }
}

代码示例来源:origin: brianwernick/ExoMedia

@Override
public void setFastForwardButtonEnabled(boolean enabled) {
  if (fastForwardButton != null) {
    fastForwardButton.setEnabled(enabled);
    enabledViews.put(R.id.exomedia_controls_fast_forward_btn, enabled);
  }
}

代码示例来源:origin: pili-engineering/PLDroidShortVideo

private void disableUnsupportedButtons() {
  try {
    if (mPauseButton != null && !mPlayer.canPause())
      mPauseButton.setEnabled(false);
  } catch (IncompatibleClassChangeError ex) {
  }
}

代码示例来源:origin: brianwernick/ExoMedia

/**
 * Sets the button state for the Next button.  This will just
 * change the images specified with {@link #setNextDrawable(Drawable)},
 * or use the defaults if they haven't been set, and block any click events.
 * <p>
 * This method will NOT re-add buttons that have previously been removed with
 * {@link #setPreviousButtonRemoved(boolean)}.
 *
 * @param enabled If the Next button is enabled [default: false]
 */
public void setNextButtonEnabled(boolean enabled) {
  nextButton.setEnabled(enabled);
  enabledViews.put(R.id.exomedia_controls_next_btn, enabled);
}

代码示例来源:origin: brianwernick/ExoMedia

/**
 * Sets the button state for the Previous button.  This will just
 * change the images specified with {@link #setPreviousDrawable(Drawable)},
 * or use the defaults if they haven't been set, and block any click events.
 * <p>
 * This method will NOT re-add buttons that have previously been removed with
 * {@link #setNextButtonRemoved(boolean)}.
 *
 * @param enabled If the Previous button is enabled [default: false]
 */
public void setPreviousButtonEnabled(boolean enabled) {
  previousButton.setEnabled(enabled);
  enabledViews.put(R.id.exomedia_controls_previous_btn, enabled);
}

代码示例来源:origin: pili-engineering/PLDroidShortVideo

@Override
  public void setEnabled(boolean enabled) {
    if (mPauseButton != null) {
      mPauseButton.setEnabled(enabled);
    }
    if (mFfwdButton != null) {
      mFfwdButton.setEnabled(enabled);
    }
    if (mRewButton != null) {
      mRewButton.setEnabled(enabled);
    }
    if (mProgress != null && !mDisableProgress)
      mProgress.setEnabled(enabled);
    disableUnsupportedButtons();
    super.setEnabled(enabled);
  }
}

代码示例来源:origin: brianwernick/ExoMedia

@Override
public void finishLoading() {
  if (!isLoading) {
    return;
  }
  isLoading = false;
  loadingProgressBar.setVisibility(View.GONE);
  controlsContainer.setVisibility(View.VISIBLE);
  playPauseButton.setEnabled(true);
  previousButton.setEnabled(enabledViews.get(R.id.exomedia_controls_previous_btn, true));
  nextButton.setEnabled(enabledViews.get(R.id.exomedia_controls_next_btn, true));
  updatePlaybackState(videoView != null && videoView.isPlaying());
}

代码示例来源:origin: guoxiaoxing/phoenix

@Override
public void setEnabled(boolean enabled) {
  super.setEnabled(enabled);
  if (Build.VERSION.SDK_INT > 10) {
    if (enabled) {
      setAlpha(1f);
    } else {
      setAlpha(0.5f);
    }
  }
}

代码示例来源:origin: guoxiaoxing/phoenix

@Override
public void setEnabled(boolean enabled) {
  super.setEnabled(enabled);
  if (Build.VERSION.SDK_INT > 10) {
    if (enabled) {
      setAlpha(1f);
    } else {
      setAlpha(0.5f);
    }
  }
}

代码示例来源:origin: curtis2/SuperVideoPlayer

/**
 * 设置MediaController的可用状态。包括进度条和播放/暂停按钮。
 */
@Override
public void setEnabled(boolean enabled) {
  if (mPauseButton != null)
    mPauseButton.setEnabled(enabled);
  if (mProgress != null)
    mProgress.setEnabled(enabled);
  super.setEnabled(enabled);
}

代码示例来源:origin: chrisk44/Hijacker

void goToDirectory(RootFile file){
  while(!file.exists()){
    file = new RootFile(file.getParentPath());
  }
  current = file;
  list = file.listFiles();
  for(int i=0;i<list.size();i++){
    if((toSelect==SELECT_DIR && !list.get(i).isDirectory()) || list.get(i).isUnknownType()){
      list.remove(i);
      i--;
    }
  }
  Collections.sort(list, new Comparator<RootFile>(){
    @Override
    public int compare(RootFile o1, RootFile o2){
      if(o1.isFile() && o2.isDirectory()) return 1;
      else if(o1.isDirectory() && o2.isFile()) return -1;
      else return o1.getName().compareToIgnoreCase(o2.getName());
    }
  });
  file_explorer_adapter.notifyDataSetChanged();
  backButton.setEnabled(!current.getAbsolutePath().equals("/"));
  currentDir.setText(current.getAbsolutePath());
}
void onSelect(RootFile file){

相关文章

ImageButton类方法