android.widget.Button.setClickable()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(5.4k)|赞(0)|评价(0)|浏览(198)

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

Button.setClickable介绍

暂无

代码示例

代码示例来源:origin: termux/termux-app

button.setClickable(true);
} else {
  button = new Button(getContext(), null, android.R.attr.buttonBarButtonStyle);

代码示例来源:origin: scola/Qart

@Override
  public void onTextChanged(CharSequence s, int start,
               int before, int count) {
    String text = mEditTextView.getText().toString().trim();
    if (text != null && text.isEmpty() == false) {
      setTextButton.setClickable(true);
      setTextButton.setTextColor(ContextCompat.getColor(MainActivity.this, android.R.color.black));
    } else {
      setTextButton.setClickable(false);
      setTextButton.setTextColor(ContextCompat.getColor(MainActivity.this, R.color.reply_button_text_disable));
    }
  }
};

代码示例来源:origin: cn-ljb/rxjava_for_android

@Override
  public void call(Boolean aBoolean) {
    btn_login.setClickable(aBoolean);
    btn_login.setBackgroundResource(aBoolean ? R.color.can_login : R.color.not_login);
  }
});

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

@Override
  public void onClick(View v) {
    buttonSensorAutoScan.setClickable(false);
    tvSensorScan.setText(getResources().getString(R.string.scanning));
    new PopulateSensors().execute();
  }
});

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

@Override
  protected void onPostExecute(Void aVoid) {
    super.onPostExecute(aVoid);
    if (data != null) {
      for (Integer myInt : data) {
        if (myInt != null && sensorAddr.get(myInt) != null) {
          dataAddress.add(String.valueOf(myInt));
        }
      }
      tvData = "";
      for (String s : dataAddress) {
        tvData += s + ":" + sensorAddr.get(Integer.parseInt(s)) + "\n";
      }
    } else {
      tvData = getResources().getString(R.string.sensor_not_connected);
    }
    for (int key : sensorAddr.keySet()) {
      dataName.add(sensorAddr.get(key));
    }
    if (scienceLab.isConnected()) {
      tvSensorScan.setText(tvData);
    } else {
      tvSensorScan.setText(getString(R.string.not_connected));
    }
    adapter.notifyDataSetChanged();
    buttonSensorAutoScan.setClickable(true);
  }
}

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

buttonSwitch.setClickable(false);
topLayout.setEnabled(false);
  topLayout.layout(oldLeft, oldTop, oldLeft + topLayout.getMeasuredWidth(), oldTop + topLayout.getMeasuredHeight() );
  menuOpen = false;
  buttonSwitch.setClickable(true);
  topLayout.setEnabled(true);
} else if(menuOpen == false) {
  topLayout.setEnabled(true);
  menuOpen = true;
  buttonSwitch.setClickable(true);

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

analyze_button.setClickable(true);

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

analyze_button.setClickable(true);

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

analyze_button.setClickable(true);

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

((LogicalAnalyzerActivity) getActivity()).setStatus(false);
  Toast.makeText(getContext(), getResources().getString(R.string.no_data_generated), Toast.LENGTH_SHORT).show();
  analyze_button.setClickable(true);
analyze_button.setClickable(true);

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

if (channelMode > 0) {
  if (scienceLab.isConnected()) {
    analyze_button.setClickable(false);

代码示例来源:origin: Zweihui/RxFingerPrinter

private void enableButton(boolean enable){
    mBtnOpen.setClickable(enable);
    mBtnOpen.setEnabled(enable);
  }
}

代码示例来源:origin: fanatic-mobile-developer-for-android/A-week-to-develop-android-app-plan

private void setButtonStatusOff() {
  getVerifiCodeButton.setText(String.format(
      mContext.getResources().getString(R.string.count_down), recLen--));
  getVerifiCodeButton.setClickable(false);
  getVerifiCodeButton.setTextColor(Color.parseColor("#f3f4f8"));
  getVerifiCodeButton.setBackgroundColor(Color.parseColor("#b1b1b3"));
}

代码示例来源:origin: fanatic-mobile-developer-for-android/A-week-to-develop-android-app-plan

private void setButtonStatusOn() {
  timer.cancel();
  getVerifiCodeButton.setText("重新发送");
  getVerifiCodeButton.setTextColor(Color.parseColor("#b1b1b3"));
  getVerifiCodeButton.setBackgroundColor(Color.parseColor("#f3f4f8"));
  recLen = 60;
  getVerifiCodeButton.setClickable(true);
}

代码示例来源:origin: fanatic-mobile-developer-for-android/A-week-to-develop-android-app-plan

private void setButtonStatusOn() {
  timer.cancel();
  getVerifiCodeButton.setText("重新发送");
  getVerifiCodeButton.setTextColor(Color.parseColor("#b1b1b3"));
  getVerifiCodeButton.setBackgroundColor(Color.parseColor("#f3f4f8"));
  recLen = 60;
  getVerifiCodeButton.setClickable(true);
}

代码示例来源:origin: zhpanvip/Retrofit2

@Override
  public void onComplete() {  //  运行在主线程中
    ToastUtils.show("文件下载成功");
    btn.setClickable(true);
  }
});

代码示例来源:origin: zhpanvip/Retrofit2

/**
 * 取消下载
 *
 * @param view
 */
public void cancelDownload(View view) {
  if (downloadUtils != null) {
    downloadUtils.cancelDownload();
    btn.setClickable(true);
  }
}

代码示例来源:origin: bytehala/android-mqtt-quickstart

@Override
public void onClick(View v) {
  if(((CheckBox)v).isChecked())
  {
    ((Button)findViewById(R.id.sslKeyBut)).setClickable(true);
  }else
  {
    ((Button)findViewById(R.id.sslKeyBut)).setClickable(false);
  }
  
}});

代码示例来源:origin: onlyloveyd/JuheNews

@OnTextChanged(R.id.et_search)
public void onTextChange(CharSequence text) {
  keyword = text.toString();
  if (text.toString().equals("") || text.length() == 0) {
    mBtSearch.setTextColor(getResources().getColor(R.color.colorToolbar));
    mBtSearch.setClickable(false);
  } else {
    mBtSearch.setTextColor(getResources().getColor(R.color.colorWhite));
    mBtSearch.setClickable(true);
  }
}

代码示例来源:origin: HelloChenJinJun/TestChat

@Override
public void onSuccess(ChatMessage chatMessage) {
  dismissLoadDialog();
  ToastUtils.showShortToast("发送好友请求成功");
  LogUtil.e("发送好友请求成功");
  add.setClickable(false);
}

相关文章

Button类方法