本文整理汇总了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);
}
}
}