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