本文整理匯總了Java中android.widget.Button.isEnabled方法的典型用法代碼示例。如果您正苦於以下問題:Java Button.isEnabled方法的具體用法?Java Button.isEnabled怎麽用?Java Button.isEnabled使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類android.widget.Button
的用法示例。
在下文中一共展示了Button.isEnabled方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: updateControls
import android.widget.Button; //導入方法依賴的package包/類
/**
* Updates the current state of the controls.
*/
private void updateControls() {
String str = getString(R.string.secondsOfVideo, mSecondsOfVideo);
TextView tv = (TextView) findViewById(R.id.capturedVideoDesc_text);
tv.setText(str);
boolean wantEnabled = (mCircEncoder != null) && !mFileSaveInProgress;
Button button = (Button) findViewById(R.id.capture_button);
if (button.isEnabled() != wantEnabled) {
Log.d(TAG, "setting enabled = " + wantEnabled);
button.setEnabled(wantEnabled);
}
}
示例2: validate
import android.widget.Button; //導入方法依賴的package包/類
private void validate() {
Button positiveButton = mDialog.getButton(AlertDialog.BUTTON_POSITIVE);
positiveButton.setEnabled(areInputsValid());
if (positiveButton.isEnabled() && sObserverForTest != null) {
sObserverForTest.onCardUnmaskPromptReadyToUnmask(this);
}
}
示例3: setupButtonAction
import android.widget.Button; //導入方法依賴的package包/類
private void setupButtonAction(Button goalFeedAction, final GoalFeed feed, final int position) {
goalFeedAction.setEnabled(!feed.hasVoted && !mHasVoted.contains(feed.guid));
if (goalFeedAction.isEnabled()) {
goalFeedAction.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
mProgressDialog.show(mContext.getSupportFragmentManager(), "DelayedProgressDialog");
RESTUpvote sm = new RESTUpvote(UserHelper.getInstance().getOwnerProfile().username, feed.guid);
sm.setListener(new RESTUpvote.Listener() {
@Override
public void onSuccess() {
mProgressDialog.cancel();
feed.upvoteCount++;
feed.hasVoted = true;
mHasVoted.add(feed.guid);
notifyItemChanged(position);
}
@Override
public void onFailure(String errMsg) {
mProgressDialog.cancel();
Toast.makeText(mContext, errMsg, Toast.LENGTH_SHORT).show();
}
});
sm.execute();
}
});
}
}
示例4: togglePositiveButtonVisibility
import android.widget.Button; //導入方法依賴的package包/類
public static void togglePositiveButtonVisibility(final Dialog dialog,
final boolean enable) {
if (dialog != null) {
final Button positiveButton =
((AlertDialog) dialog).getButton(DialogInterface.BUTTON_POSITIVE);
if (enable) {
if (!positiveButton.isEnabled()) {
positiveButton.setEnabled(true);
}
} else if (positiveButton.isEnabled()) {
positiveButton.setEnabled(false);
}
}
}