当前位置: 首页>>代码示例>>Java>>正文


Java AppCompatButton.setOnClickListener方法代码示例

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

}
 
开发者ID:kunalrmhatre,项目名称:fussroll,代码行数:23,代码来源:RegisterActivity.java

示例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);
    }
}
 
开发者ID:ArnauBlanch,项目名称:civify-app,代码行数:26,代码来源:IssueDetailsFragment.java

示例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);
    }
}
 
开发者ID:ArnauBlanch,项目名称:civify-app,代码行数:25,代码来源:IssueDetailsFragment.java

示例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);

}
 
开发者ID:ArnauBlanch,项目名称:civify-app,代码行数:18,代码来源:LoginActivity.java

示例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);
}
 
开发者ID:codeestX,项目名称:ECardFlow,代码行数:20,代码来源:MainActivity.java

示例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();
        }
    });
}
 
开发者ID:kunalrmhatre,项目名称:fussroll,代码行数:25,代码来源:DeleteActivity.java

示例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);


}
 
开发者ID:rasoulmiri,项目名称:Skeleton,代码行数:22,代码来源:MainActivity.java

示例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();
}
 
开发者ID:googlecodelabs,项目名称:appauth-android-codelab,代码行数:22,代码来源:MainActivity.java

示例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());
}
 
开发者ID:googlecodelabs,项目名称:appauth-android-codelab,代码行数:19,代码来源:MainActivity.java

示例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;
        }
    });
}
 
开发者ID:niniloveyou,项目名称:UCLayout,代码行数:21,代码来源:MainActivity.java

示例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()));


}
 
开发者ID:asifali22,项目名称:Focus-Android-App,代码行数:26,代码来源:RegisterActivity.java

示例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();
}
 
开发者ID:Mfrenchy77,项目名称:HorseandRidersCompanion,代码行数:27,代码来源:MainActivity.java

示例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();
        }
    });
}
 
开发者ID:jemshit,项目名称:EliteMvp,代码行数:24,代码来源:Sample7Activity.java

示例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));
}
 
开发者ID:joy-inc,项目名称:joy-app,代码行数:26,代码来源:OrderBookProfileActivity.java


注:本文中的android.support.v7.widget.AppCompatButton.setOnClickListener方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。