Example usage for android.view View getId

List of usage examples for android.view View getId

Introduction

In this page you can find the example usage for android.view View getId.

Prototype

@IdRes
@ViewDebug.CapturedViewProperty
public int getId() 

Source Link

Document

Returns this view's identifier.

Usage

From source file:zjut.soft.finalwork.fragment.LeftFragment.java

@Override
public void onClick(View v) {
    switch (v.getId()) {
    case R.id.sliding_activity_user_manage:
    case R.id.sliding_activity_pay_query:
    case R.id.sliding_activity_query_system:
    case R.id.sliding_activity_about_us:
    case R.id.sliding_activity_unregister_user:
    case R.id.sliding_activity_regist_system:
    case R.id.sliding_activity_pick_course_system:
    case R.id.sliding_activity_student_rating:
        selectedItemWithArrow(v.getId());
        instance.onItemClick(v.getId());
        break;/*from  w  w w  .j a  v a2s .  com*/
    }
}

From source file:es.hol.ecotiffins.view.LoginActivity.java

@Override
public void onClick(View v) {
    switch (v.getId()) {
    case R.id.btnNext:
        //Validating user to fill the required field & entered number should be in four digits
        //If user satisfies the conditions, we will register the license number
        //Otherwise set error to TextInputLayout
        if (Patterns.EMAIL_ADDRESS.matcher(editEmail.getText().toString().trim()).matches()) {
            //Setting up animation to view flipper and moving to the next state
            viewFlipper.setInAnimation(LoginActivity.this, R.anim.slide_in_from_right);
            viewFlipper.setOutAnimation(LoginActivity.this, R.anim.slide_out_to_left);
            viewFlipper.showNext();/*from   ww  w. j a  v  a 2  s.c  om*/
            ((TextView) findViewById(R.id.txtEmailAddress)).setText(editEmail.getText().toString());
        } else {
            setValidationError(findViewById(R.id.txtInputLayoutEmail),
                    getResources().getString(R.string.error_email));
        }
        break;

    case R.id.btnLogin:
        if (editPassword.getText().toString().trim().equals("")) {
            setValidationError(findViewById(R.id.txtInputLayoutPassword),
                    getResources().getString(R.string.error_password));
        } else if (editPassword.getText().toString().trim().length() < 6) {
            setValidationError(findViewById(R.id.txtInputLayoutPassword),
                    getResources().getString(R.string.error_password_min_lenth));
        } else {
            loginUser();
        }
        break;
    case R.id.imgBack:
        //Setting up animation to view flipper
        viewFlipper.setInAnimation(LoginActivity.this, R.anim.slide_in_from_left);
        viewFlipper.setOutAnimation(LoginActivity.this, R.anim.slide_out_to_right);
        viewFlipper.showPrevious();
        break;

    case R.id.txtRegister:
        startActivity(new Intent(this, RegisterActivity.class));
        break;
    case R.id.txtForget:
        Intent intent = new Intent(LoginActivity.this, ForgetPasswordActivity.class);
        intent.putExtra("EMAIL", editEmail.getText().toString());
        startActivity(intent);
        break;
    }
}

From source file:com.hybris.mobile.activity.CheckoutActivity.java

public void selectTermsAndConditions(View view) {
    if (view.getId() == R.id.containerTerms) {
        CheckBox checkBoxTerms = (CheckBox) findViewById(R.id.checkBoxTerms);
        checkBoxTerms.setChecked(!checkBoxTerms.isChecked());
    }/* www  . j  a v a2 s .  com*/
    updateUI();
}

From source file:cn.net_show.doctor.activity.AuthActivity.java

public void onClick(View v) {
    switch (v.getId()) {
    case R.id.btn_back:
        this.finish();
        break;/*from w  w  w  .ja  va 2s .  c om*/
    case R.id.authImage:
        Intent intent = new Intent(Intent.ACTION_PICK);
        intent.setDataAndType(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, "image/*");
        startActivityForResult(intent, 1111);
        break;
    case R.id.btn_auth:
        if (isUpload) {
            Toast.makeText(this, "???", Toast.LENGTH_SHORT).show();
            return;
        }
        if (uri == null) {
            Toast.makeText(this, "?", Toast.LENGTH_SHORT).show();
            return;
        } else {
            if (pd == null) {
                getProcessDialog();
            }
            pd.show();
            String key = "";
            if (rdgroup.getCheckedRadioButtonId() == R.id.rd_qw) {
                key = "license";
            } else {
                key = "plate";
            }
            auth(key);
        }
        break;
    default:
        break;
    }
}

From source file:com.mobshep.insufficienttls.InsufficientTLS.java

@Override
public void onClick(View v) {
    // TODO Auto-generated method stub
    switch (v.getId()) {

    case (R.id.theFirstButton):
        sendNetworkData();//  w w  w .  j  a v a2  s  .  com
        break;
    case (R.id.buttonPrefs):
        settings();
        break;
    }

}

From source file:li.barter.fragments.PasswordResetFragment.java

@Override
public void onClick(final View v) {

    switch (v.getId()) {

    case R.id.button_reset_password: {
        if (isInputValid()) {
            GoogleAnalyticsManager.getInstance()
                    .sendEvent(new EventBuilder(Categories.CONVERSION, Actions.SIGN_IN_ATTEMPT)
                            .set(ParamKeys.TYPE, ParamValues.RESET));
            callPasswordReset(mTokenEditText.getText().toString(), mNewPasswordEditText.getText().toString(),
                    mEmailId);//  w w w. j ava2  s . c  om
        }
        break;
    }

    }
}

From source file:in.com.ralarm.AlarmActivity.java

@Override
public void onClick(View v) {
    if (v.getId() == R.id.checkBox_alarm_active) {
        CheckBox checkBox = (CheckBox) v;
        Alarm alarm = (Alarm) alarmListAdapter.getItem((Integer) checkBox.getTag());
        alarm.setAlarmActive(checkBox.isChecked());
        Database.update(alarm);/*w w w.ja  va 2s.c o m*/
        AlarmActivity.this.callMathAlarmScheduleService();
        if (checkBox.isChecked()) {
            Toast.makeText(AlarmActivity.this, alarm.getTimeUntilNextAlarmMessage(), Toast.LENGTH_LONG).show();
        }
    }

}

From source file:or.tango.android.activity.PicActivity.java

@Override
public void onClick(View v) {
    if (v.getId() == R.id.right_btn) {
        if (uploadFile.exists()) {//
            getRightBtn().setEnabled(false);

            uploadingTipDialog = ProgressDialog.show(PicActivity.this, "", "...", true);
            uploadingTipDialog.show();//from www  .ja  v a2 s  .  com
            singleThread.execute(new Runnable() {
                @Override
                public void run() {
                    try {
                        PictureUpload.upload(uploadFile, uploadProgressHandler, singleThread);
                    } catch (Exception e) {
                        e.printStackTrace();//
                        runOnUiThread(new Runnable() {
                            @Override
                            public void run() {
                                uploadingTipDialog.dismiss();
                                getRightBtn().setEnabled(true);
                                showToastMsg("ip?");
                            }
                        });
                    }
                }
            });
        } else {
            showToastMsg("?");
        }
    }
}

From source file:com.toppatch.mv.ui.activities.LoginActivity2.java

@Override
public void onClick(View v) {
    switch (v.getId()) {
    case R.id.submit:
        startLoginCheck();/*from   w w  w.  j ava  2  s. c o m*/
    }
}

From source file:hongik.android.project.best.HistoryActivity.java

public void historyClick(View view) {
    if (view.getId() == R.id.history_user) {
        Intent userIntent = new Intent(this, AccountActivity.class);
        userIntent.putExtra("CID", cid);
        startActivityForResult(userIntent, 1);
    } else if (view.getId() == R.id.history_qrcode) {
        IntentIntegrator.initiateScan(this);
    }//from  w ww  .  j av a 2 s  .  c  o  m
}