本文整理匯總了Java中android.support.v7.widget.AppCompatButton類的典型用法代碼示例。如果您正苦於以下問題:Java AppCompatButton類的具體用法?Java AppCompatButton怎麽用?Java AppCompatButton使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
AppCompatButton類屬於android.support.v7.widget包,在下文中一共展示了AppCompatButton類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: onCreate
import android.support.v7.widget.AppCompatButton; //導入依賴的package包/類
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_register);
editText = (EditText) findViewById(R.id.editText);
spinner = (Spinner) findViewById(R.id.spinner);
textInputLayout = (TextInputLayout) findViewById(R.id.textInputLayout);
ArrayAdapter<CharSequence> arrayAdapter = ArrayAdapter.createFromResource(this, R.array.countries, R.layout.spinner_layout);
arrayAdapter.setDropDownViewResource(R.layout.spinner_layout);
spinner.setAdapter(arrayAdapter);
AppCompatButton appCompatButton = (AppCompatButton) findViewById(R.id.button);
appCompatButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
register();
}
});
}
示例2: showInfo
import android.support.v7.widget.AppCompatButton; //導入依賴的package包/類
protected void showInfo(String header, String desc, @Nullable Drawable drawable, boolean error) {
hideKeyboard();
AppCompatTextView infoHeader = (AppCompatTextView) llBottomSheet.findViewById(R.id.info_header);
AppCompatTextView infoDesc = (AppCompatTextView) llBottomSheet.findViewById(R.id.info_desc);
AppCompatImageView infoImg = (AppCompatImageView) llBottomSheet.findViewById(R.id.info_img);
if (error) {
llBottomSheet.findViewById(R.id.info_img).setVisibility(View.GONE);
((AppCompatButton) findViewById(R.id.ok_dimiss)).setText("Close");
} else {
llBottomSheet.findViewById(R.id.info_img).setVisibility(View.VISIBLE);
((AppCompatButton) findViewById(R.id.ok_dimiss)).setText("Ok");
}
infoHeader.setText(header);
infoDesc.setText(desc);
if (drawable != null)
infoImg.setImageDrawable(drawable);
bottomSheetBehavior.setState(BottomSheetBehavior.STATE_EXPANDED);
}
示例3: AbsStepHolder
import android.support.v7.widget.AppCompatButton; //導入依賴的package包/類
public AbsStepHolder(ViewGroup parent, int internalLayoutRes, int stepIndex) {
super(createVerticalMainHolderView(parent));
this.index = stepIndex;
this.counterRoot = itemView.findViewById(R.id.counter_root);
this.counterText = (TextView) itemView.findViewById(R.id.counter);
this.titleText = (TextView) itemView.findViewById(R.id.title);
this.line = itemView.findViewById(R.id.step_line);
this.buttonNext = (AppCompatButton) itemView.findViewById(R.id.buttonNext);
this.buttonCancel = (Button) itemView.findViewById(R.id.buttonCancel);
this.content = (ViewGroup) itemView.findViewById(R.id.content);
this.contentRoot = itemView.findViewById(R.id.content_root);
this.mContentView = LayoutInflater.from(itemView.getContext()).inflate(internalLayoutRes, parent, false);
this.content.addView(mContentView);
initInternalView(mContentView);
}
示例4: setupConfirmButton
import android.support.v7.widget.AppCompatButton; //導入依賴的package包/類
private void setupConfirmButton() {
AppCompatButton button = (AppCompatButton) mViewDetails.findViewById(R.id.confirmButton);
String issueUserToken = mIssue.getUserAuthToken();
String userToken = UserAdapter.getCurrentUser().getUserAuthToken();
if (issueUserToken.equals(userToken)) {
button.setAlpha(DISABLED_ALPHA);
button.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
Snackbar.make(getView(), R.string.cant_confirm_own_issue, Snackbar.LENGTH_SHORT)
.show();
}
});
} else {
if (mIssue.getConfirmedByAuthUser()) {
changeButtonStyle(button, IssueButton.UNCONFIRM);
}
IssueButtonListener buttonListener =
new IssueButtonListener(this, mViewDetails, mIssue,
IssueButton.CONFIRM, IssueButton.UNCONFIRM);
button.setOnClickListener(buttonListener);
}
}
示例5: setupReportButton
import android.support.v7.widget.AppCompatButton; //導入依賴的package包/類
private void setupReportButton() {
AppCompatButton button = (AppCompatButton) mViewDetails.findViewById(R.id.reportButton);
String issueUserToken = mIssue.getUserAuthToken();
String userToken = UserAdapter.getCurrentUser().getUserAuthToken();
if (issueUserToken.equals(userToken)) {
button.setAlpha(DISABLED_ALPHA);
button.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
Snackbar.make(getView(), R.string.cant_report_own_issue, Snackbar.LENGTH_SHORT)
.show();
}
});
} else {
if (mIssue.getReportedByAuthUser()) {
changeButtonStyle(button, IssueButton.UNREPORT);
}
IssueButtonListener buttonListener =
new IssueButtonListener(this, mViewDetails, mIssue,
IssueButton.REPORT, IssueButton.UNREPORT);
button.setOnClickListener(buttonListener);
}
}
示例6: onCreate
import android.support.v7.widget.AppCompatButton; //導入依賴的package包/類
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_login);
mBlogin = (AppCompatButton) findViewById(R.id.bsignin);
mBlogin.setOnClickListener(mListen);
mUser = (EditText) findViewById(R.id.login_email_input);
mPassw = (EditText) findViewById(R.id.login_password_input);
mPassforgot = (TextView) findViewById(R.id.login_forgot);
mIconFirstCredential = (ImageView) findViewById(R.id.email_errors_icon);
mMessageFirstCredential = (TextView) findViewById(R.id.email_errors_text);
mIconPassword = (ImageView) findViewById(R.id.password_errors_icon);
mMessagePassword = (TextView) findViewById(R.id.password_errors_text);
mPassforgot.setOnClickListener(mListen);
mLoginAdapter = AdapterFactory.getInstance().getLoginAdapter(this);
}
示例7: initViews
import android.support.v7.widget.AppCompatButton; //導入依賴的package包/類
/**
* This method is to initialize views
*/
private void initViews() {
nestedScrollView = (NestedScrollView) findViewById(R.id.nestedScrollView);
textInputLayoutName = (TextInputLayout) findViewById(R.id.textInputLayoutName);
textInputLayoutEmail = (TextInputLayout) findViewById(R.id.textInputLayoutEmail);
textInputLayoutPassword = (TextInputLayout) findViewById(R.id.textInputLayoutPassword);
textInputLayoutConfirmPassword = (TextInputLayout) findViewById(R.id.textInputLayoutConfirmPassword);
textInputEditTextName = (TextInputEditText) findViewById(R.id.textInputEditTextName);
textInputEditTextEmail = (TextInputEditText) findViewById(R.id.textInputEditTextEmail);
textInputEditTextPassword = (TextInputEditText) findViewById(R.id.textInputEditTextPassword);
textInputEditTextConfirmPassword = (TextInputEditText) findViewById(R.id.textInputEditTextConfirmPassword);
appCompatButtonRegister = (AppCompatButton) findViewById(R.id.appCompatButtonRegister);
appCompatTextViewLoginLink = (AppCompatTextView) findViewById(R.id.appCompatTextViewLoginLink);
}
示例8: showInfo
import android.support.v7.widget.AppCompatButton; //導入依賴的package包/類
private void showInfo(String header, String desc, @Nullable Drawable drawable, boolean error) {
hideKeyboard();
AppCompatTextView infoHeader = (AppCompatTextView) llBottomSheet.findViewById(R.id.info_header);
AppCompatTextView infoDesc = (AppCompatTextView) llBottomSheet.findViewById(R.id.info_desc);
AppCompatImageView infoImg = (AppCompatImageView) llBottomSheet.findViewById(R.id.info_img);
if (error) {
llBottomSheet.findViewById(R.id.info_img).setVisibility(View.GONE);
((AppCompatButton) findViewById(R.id.ok_dimiss)).setText("Close");
} else {
llBottomSheet.findViewById(R.id.info_img).setVisibility(View.VISIBLE);
((AppCompatButton) findViewById(R.id.ok_dimiss)).setText("Ok");
}
infoHeader.setText(header);
infoDesc.setText(desc);
if (drawable != null)
infoImg.setImageDrawable(drawable);
bottomSheetBehavior.setState(BottomSheetBehavior.STATE_EXPANDED);
}
示例9: onCreate
import android.support.v7.widget.AppCompatButton; //導入依賴的package包/類
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
btnCard = (AppCompatButton) findViewById(R.id.btn_card);
btnLayout = (AppCompatButton) findViewById(R.id.btn_layout);
btnLayoutBlur = (AppCompatButton) findViewById(R.id.btn_layout_blur);
btnLayoutMove = (AppCompatButton) findViewById(R.id.btn_layout_move);
btnLayoutScale = (AppCompatButton) findViewById(R.id.btn_layout_scale);
btnLayoutCrossMove = (AppCompatButton) findViewById(R.id.btn_layout_cross);
btnCard.setOnClickListener(this);
btnLayout.setOnClickListener(this);
btnLayoutBlur.setOnClickListener(this);
btnLayoutMove.setOnClickListener(this);
btnLayoutScale.setOnClickListener(this);
btnLayoutCrossMove.setOnClickListener(this);
}
示例10: onCreate
import android.support.v7.widget.AppCompatButton; //導入依賴的package包/類
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_delete);
Toolbar toolbar = (Toolbar) findViewById(R.id.app_bar);
setSupportActionBar(toolbar);
editText = (EditText) findViewById(R.id.editText);
textInputLayout = (TextInputLayout) findViewById(R.id.textInputLayout);
if(getSupportActionBar() != null) {
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
getSupportActionBar().setDisplayShowHomeEnabled(true);
}
AppCompatButton appCompatButton = (AppCompatButton) findViewById(R.id.button);
appCompatButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
delete();
}
});
}
示例11: onCreate
import android.support.v7.widget.AppCompatButton; //導入依賴的package包/類
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
//find view
sample1Btn = (AppCompatButton) findViewById(R.id.sample1Btn);
sample2Btn = (AppCompatButton) findViewById(R.id.sample2Btn);
sample3Btn = (AppCompatButton) findViewById(R.id.sample3Btn);
sample4Btn = (AppCompatButton) findViewById(R.id.sample4Btn);
sample5Btn = (AppCompatButton) findViewById(R.id.sample5Btn);
//set on click listener for buttons
sample1Btn.setOnClickListener(this);
sample2Btn.setOnClickListener(this);
sample3Btn.setOnClickListener(this);
sample4Btn.setOnClickListener(this);
sample5Btn.setOnClickListener(this);
}
示例12: onCreate
import android.support.v7.widget.AppCompatButton; //導入依賴的package包/類
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
mMainApplication = (MainApplication) getApplication();
mAuthorize = (AppCompatButton) findViewById(R.id.authorize);
mMakeApiCall = (AppCompatButton) findViewById(R.id.makeApiCall);
mSignOut = (AppCompatButton) findViewById(R.id.signOut);
mGivenName = (AppCompatTextView) findViewById(R.id.givenName);
mFamilyName = (AppCompatTextView) findViewById(R.id.familyName);
mFullName = (AppCompatTextView) findViewById(R.id.fullName);
mProfileView = (ImageView) findViewById(R.id.profileImage);
enablePostAuthorizationFlows();
// wire click listeners
mAuthorize.setOnClickListener(new AuthorizeListener(this));
// Retrieve app restrictions and take appropriate action
getAppRestrictions();
}
示例13: onCreate
import android.support.v7.widget.AppCompatButton; //導入依賴的package包/類
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
mMainApplication = (MainApplication) getApplication();
mAuthorize = (AppCompatButton) findViewById(R.id.authorize);
mMakeApiCall = (AppCompatButton) findViewById(R.id.makeApiCall);
mSignOut = (AppCompatButton) findViewById(R.id.signOut);
mGivenName = (AppCompatTextView) findViewById(R.id.givenName);
mFamilyName = (AppCompatTextView) findViewById(R.id.familyName);
mFullName = (AppCompatTextView) findViewById(R.id.fullName);
mProfileView = (ImageView) findViewById(R.id.profileImage);
enablePostAuthorizationFlows();
// wire click listeners
mAuthorize.setOnClickListener(new AuthorizeListener());
}
示例14: onCreate
import android.support.v7.widget.AppCompatButton; //導入依賴的package包/類
@Override
protected void onCreate(Bundle savedInstanceState){
super.onCreate(savedInstanceState);
setContentView(R.layout.login);
context = LoginActivity.this;
pDialog = new ProgressDialog(context);
editTextEmail = (EditText) findViewById(R.id.editTextEmail);
editTextPassword = (EditText) findViewById(R.id.editTextPassword);
buttonLogin = (AppCompatButton) findViewById(R.id.buttonLogin);
buttonLogin.setOnClickListener(new View.OnClickListener(){
@Override
public void onClick(View v){
login();
}
});
}
開發者ID:ProposalProyekIT2,項目名稱:SISTEM-INFORMASI-GEOGRAFIS-LOKASI-RESTORAN-DI-KOTA-BANDUNG-SUB-MODUL-ANDROID-BASE-APPLICATION-,代碼行數:19,代碼來源:LoginActivity.java
示例15: onCreate
import android.support.v7.widget.AppCompatButton; //導入依賴的package包/類
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
voiceView = (UcVoiceView) findViewById(R.id.ucVoice);
start = (AppCompatButton) findViewById(R.id.start);
start.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if(!visible){
voiceView.showVoice();
}else{
voiceView.hideVoice();
}
visible = !visible;
}
});
}