本文整理汇总了Java中android.support.v7.widget.AppCompatButton.setOnClickListener方法的典型用法代码示例。如果您正苦于以下问题:Java AppCompatButton.setOnClickListener方法的具体用法?Java AppCompatButton.setOnClickListener怎么用?Java AppCompatButton.setOnClickListener使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.support.v7.widget.AppCompatButton
的用法示例。
在下文中一共展示了AppCompatButton.setOnClickListener方法的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: 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);
}
}
示例3: 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);
}
}
示例4: 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);
}
示例5: 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);
}
示例6: 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();
}
});
}
示例7: 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);
}
示例8: 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();
}
示例9: 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());
}
示例10: 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
示例11: 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;
}
});
}
示例12: onCreate
import android.support.v7.widget.AppCompatButton; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(com.hybrid.freeopensourceusers.R.layout.activity_register);
myApplication = MyApplication.getInstance();
volleySingleton = VolleySingleton.getInstance();
requestQueue = volleySingleton.getRequestQueue();
sharedPrefManager = new SharedPrefManager(this);
circleImageView = (CircleImageView) findViewById(R.id.userProfile);
changeProfile = (AppCompatButton) findViewById(R.id.btn_change);
input_nameRegister = (EditText) findViewById(R.id.input_nameRegister);
input_emailRegister = (EditText) findViewById(R.id.input_emailRegister);
input_passwordRegister = (EditText) findViewById(R.id.input_passwordRegister);
input_retypepasswordRegister = (EditText) findViewById(R.id.input_retypepasswordRegister);
changeProfile.setOnClickListener(this);
mExecutor = Executors.newSingleThreadExecutor();
final Uri uri = getIntent().getData();
if(uri != null)
mExecutor.submit(new RegisterActivity.LoadScaledImageTask(this, uri, circleImageView, calcImageSize()));
}
示例13: onCreate
import android.support.v7.widget.AppCompatButton; //导入方法依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
activityComponent().inject(this);
mPresenter.attachView(this);
mPresenter.getRiderProfile(getIntent().getStringExtra(EMAIL));
horseList = (ListView) findViewById(R.id.horses_list);
horseList.setOnItemClickListener((adapterView, view, i, l) -> onHorseSelected(i));
horseList.setOnItemLongClickListener((adapterView, view, i, l) -> onHorseLongClicked(i));
TextView emptyList = (TextView) findViewById(R.id.empty_horse_list);
emptyList.setOnClickListener(view -> emptyHorseListClicked());
AppCompatButton skillTreeButton = (AppCompatButton) findViewById(R.id.button_skill_tree);
skillTreeButton.setOnClickListener(view -> openSkillTree());
AppCompatButton addHorseButton = (AppCompatButton) findViewById(R.id.add_horse_button);
addHorseButton.setOnClickListener(view -> addHorseClicked());
viewFlipperHorse = (ViewFlipper) findViewById(R.id.owned_horses_view_flipper);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar_hnr);
setSupportActionBar(toolbar);
toolbar.setTitle(riderProfile.getName());
setupToolbar(toolbar);
setUpNavigationDrawer();
}
示例14: onCreate
import android.support.v7.widget.AppCompatButton; //导入方法依赖的package包/类
@Override protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_sample_rx);
if (getSupportActionBar() != null) {
getSupportActionBar().setTitle(getString(R.string.example_null_view_rx1));
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
}
// Initialize Presenter
presenter = new Sample7Presenter(Sample7Contract.View.class);
// Attach View to it
presenter.attachView(this);
// FindViewByIds, ClickListeners
textView = (TextView) findViewById(R.id.text_sampleRx_list);
AppCompatButton buttonGenerate = (AppCompatButton) findViewById(R.id.button_sampleRx_generate);
buttonGenerate.setOnClickListener(new View.OnClickListener() {
@Override public void onClick(View view) {
// Call Presenter Method
presenter.createList();
}
});
}
示例15: initContentView
import android.support.v7.widget.AppCompatButton; //导入方法依赖的package包/类
@Override
protected void initContentView() {
mSdvPhoto = (FrescoIv) findViewById(R.id.sdvPhoto);
mTvTitle = (TextView) findViewById(R.id.tvTitle);
mEtName = (EditText) findViewById(R.id.etName);
mEtPhone = (EditText) findViewById(R.id.etPhone);
mEtEmail = (EditText) findViewById(R.id.etEmail);
mTvPrice = (TextView) findViewById(R.id.tvTotalPrice);
mAcbNext = (AppCompatButton) findViewById(R.id.acbNext);
mAcbNext.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
checkProfileThenSubmit();
}
});
mSdvPhoto.setImageURI(mPhotoUrl);
mTvTitle.setText(mTitle);
mTvPrice.setText(JTextSpanUtil.getFormatUnitStr(mTotalPrice));
}