Search in sources :

Example 81 with OnClick

use of butterknife.OnClick in project GwellDemo by dxsdyhm.

the class MainActivity method AlarmEmail.

@OnClick(R.id.btn_alarm_email)
public void AlarmEmail() {
    Intent alarmEmail = new Intent(this, AlarmEmailActivity.class);
    startActivity(alarmEmail);
}
Also used : Intent(android.content.Intent) OnClick(butterknife.OnClick)

Example 82 with OnClick

use of butterknife.OnClick in project curb by irijwj.

the class InformationCreateFragment method onM_AddInfoEditTimeClicked.

@OnClick(R.id.add_info_edit_time)
public void onM_AddInfoEditTimeClicked() {
    TimePicker lc_timePicker = new TimePicker(m_activity);
    lc_timePicker.setElevation(3);
    ConstraintLayout.LayoutParams lc_layoutParams = new ConstraintLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
    m_InfoDetailConstraintLayout.addView(lc_timePicker, lc_layoutParams);
    lc_timePicker.setVisibility(View.VISIBLE);
    lc_timePicker.setOnTimeChangedListener(new TimePicker.OnTimeChangedListener() {

        @Override
        public void onTimeChanged(TimePicker view, int hourOfDay, int minute) {
            setTime(hourOfDay, minute);
        }
    });
}
Also used : TimePicker(android.widget.TimePicker) ConstraintLayout(android.support.constraint.ConstraintLayout) OnClick(butterknife.OnClick)

Example 83 with OnClick

use of butterknife.OnClick in project curb by irijwj.

the class SmallDataFragment method onM_SdContentImagebuttonResultClicked.

@OnClick(R.id.sd_content_imagebutton_result)
public void onM_SdContentImagebuttonResultClicked() {
    Intent lc_intent = new Intent(presenter.getContextInPresenter(), ResultActivity.class);
    lc_intent.putExtra("summary_id", m_sdSummaries.get(indexForSummary).getId());
    startActivity(lc_intent);
}
Also used : Intent(android.content.Intent) OnClick(butterknife.OnClick)

Example 84 with OnClick

use of butterknife.OnClick in project Palm300Heroes by nicolite.

the class UserInfoActivity method onViewClicked.

@OnClick({ R.id.rl_user_avatar, R.id.rl_nickName, R.id.rl_user_pwd, R.id.rl_user_gender, R.id.user_logout })
public void onViewClicked(View view) {
    switch(view.getId()) {
        case R.id.rl_user_avatar:
            Matisse.from(this).choose(MimeType.of(MimeType.PNG, MimeType.JPEG)).countable(true).maxSelectable(1).restrictOrientation(ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED).thumbnailScale(0.85f).imageEngine(new GlideEngine()).forResult(REQUEST_CODE_CHOOSE_PICTURE);
            break;
        case R.id.rl_nickName:
            LinearLayout editor = (LinearLayout) getLayoutInflater().inflate(R.layout.item_single_eidtor, null, false);
            final EditText edInput = (EditText) editor.findViewById(R.id.ed_input);
            new AlertDialog.Builder(this).setTitle("请输入昵称").setView(editor).setPositiveButton("确定", new DialogInterface.OnClickListener() {

                @Override
                public void onClick(DialogInterface dialogInterface, int i) {
                    String nickNameText = edInput.getText().toString();
                    if (TextUtils.isEmpty(nickNameText)) {
                        ToastUtils.showToastShort("昵称不能为空");
                        return;
                    }
                    nickName.setText(nickNameText);
                    user.setNickName(nickNameText);
                    saveUserInfo(user);
                }
            }).setNegativeButton("取消", null).show();
            break;
        case R.id.rl_user_pwd:
            LinearLayout changePwd = (LinearLayout) getLayoutInflater().inflate(R.layout.item_change_password, null, false);
            final EditText originPwd = (EditText) changePwd.findViewById(R.id.et_origin_pwd);
            final EditText newPwd = (EditText) changePwd.findViewById(R.id.et_new_pwd);
            final EditText newPwd2 = (EditText) changePwd.findViewById(R.id.et_new_pwd2);
            new AlertDialog.Builder(this).setTitle("修改密码").setView(changePwd).setPositiveButton("确认", new DialogInterface.OnClickListener() {

                @Override
                public void onClick(DialogInterface dialogInterface, int i) {
                    String originPassword = originPwd.getText().toString();
                    String newPassword = newPwd.getText().toString();
                    String newPassword2 = newPwd2.getText().toString();
                    if (TextUtils.isEmpty(originPassword) || TextUtils.isEmpty(newPassword) || TextUtils.isEmpty(newPassword2)) {
                        ToastUtils.showToastShort("请填写完整");
                        return;
                    } else if (!newPassword.equals(newPassword2)) {
                        ToastUtils.showToastShort("两次输入的密码不一致");
                        return;
                    }
                    BmobUser.updateCurrentUserPassword(originPassword, newPassword, new UpdateListener() {

                        @Override
                        public void done(BmobException e) {
                            if (e == null) {
                                ToastUtils.showToastShort("修改成功!");
                                BmobUser.logOut();
                                UserInfoActivity.this.setResult(2);
                                finish();
                            } else {
                                ToastUtils.showToastShort("修改失败!");
                            }
                        }
                    });
                }
            }).setNegativeButton("取消", null).show();
            break;
        case R.id.rl_user_gender:
            final String[] items = { "男", "女" };
            selected = userData.getGender() == null ? 0 : (userData.getGender() ? 0 : 1);
            new AlertDialog.Builder(this).setTitle("请选择").setSingleChoiceItems(items, selected, new DialogInterface.OnClickListener() {

                @Override
                public void onClick(DialogInterface dialogInterface, int i) {
                    selected = i;
                }
            }).setPositiveButton("确定", new DialogInterface.OnClickListener() {

                @Override
                public void onClick(DialogInterface dialogInterface, int i) {
                    userGender.setImageResource(items[selected].equals("男") ? R.drawable.male : R.drawable.female);
                    user.setGender(items[selected].equals("男"));
                    saveUserInfo(user);
                }
            }).setNegativeButton("取消", null).show();
            break;
        case R.id.user_logout:
            BmobUser.logOut();
            UserInfoActivity.this.setResult(2);
            finish();
            break;
    }
}
Also used : EditText(android.widget.EditText) AlertDialog(android.support.v7.app.AlertDialog) BmobException(cn.bmob.v3.exception.BmobException) GlideEngine(com.zhihu.matisse.engine.impl.GlideEngine) DialogInterface(android.content.DialogInterface) UpdateListener(cn.bmob.v3.listener.UpdateListener) LinearLayout(android.widget.LinearLayout) OnClick(butterknife.OnClick)

Example 85 with OnClick

use of butterknife.OnClick in project Palm300Heroes by nicolite.

the class MoreFragment method onViewClick.

@OnClick({ R.id.theme_music, R.id.update, R.id.help, R.id.about, R.id.share, R.id.joinqq, R.id.user_root_view })
public void onViewClick(View view) {
    switch(view.getId()) {
        case R.id.theme_music:
            // Intent intent = new Intent(getActivity(), WebViewActivity.class);
            // Bundle bundle = new Bundle();
            // bundle.putInt("type", WebViewActivity.TYPE_THEME_MUSIC);
            // bundle.putString("url", Constants.MISSEVAN_PLAYLIST_URL);
            // bundle.putString("title", "主题曲");
            // intent.putExtras(bundle);
            // startActivity(intent);
            Intent intent = new Intent(getActivity(), ContainerActivity.class);
            Bundle bundle = new Bundle();
            bundle.putString("title", "主题曲");
            bundle.putInt("type", ContainerActivity.TYPE_THEME_MUSIC);
            intent.putExtras(bundle);
            startActivity(intent);
            break;
        case R.id.update:
            Beta.checkUpgrade();
            break;
        case R.id.help:
            Intent help = new Intent(getActivity(), HelpActivity.class);
            startActivity(help);
            break;
        case R.id.about:
            Intent about = new Intent(getActivity(), AboutActivity.class);
            startActivity(about);
            break;
        case R.id.share:
            Intent share = new Intent(Intent.ACTION_SEND);
            share.putExtra(Intent.EXTRA_TEXT, "掌上300英雄\n" + getString(R.string.mainPage));
            share.setType("text/plain");
            startActivity(share);
            break;
        case R.id.joinqq:
            joinQQGroup("wRl6tmw4JNr0iufx47gR2WXCqKyWPIXC");
            break;
        case R.id.user_root_view:
            User currentUser = BmobUser.getCurrentUser(User.class);
            if (currentUser == null) {
                Intent login = new Intent(getActivity(), LoginActivity.class);
                startActivityForResult(login, 200);
            } else {
                Intent userInfo = new Intent(getActivity(), UserInfoActivity.class);
                userInfo.putExtra("user_data", currentUser);
                startActivityForResult(userInfo, 100);
            }
            break;
    }
}
Also used : User(cn.nicolite.palm300heroes.model.bean.User) BmobUser(cn.bmob.v3.BmobUser) Bundle(android.os.Bundle) Intent(android.content.Intent) OnClick(butterknife.OnClick)

Aggregations

OnClick (butterknife.OnClick)202 Intent (android.content.Intent)88 AlertDialog (android.support.v7.app.AlertDialog)11 View (android.view.View)11 DialogInterface (android.content.DialogInterface)10 Action0 (rx.functions.Action0)10 Bundle (android.os.Bundle)8 GCM (com.kickstarter.models.pushdata.GCM)8 PushNotificationEnvelope (com.kickstarter.services.apiresponses.PushNotificationEnvelope)8 File (java.io.File)8 TextView (android.widget.TextView)7 ActivityOptions (android.app.ActivityOptions)6 LzyResponse (com.lzy.demo.model.LzyResponse)6 ServerModel (com.lzy.demo.model.ServerModel)6 Subscription (rx.Subscription)6 NonNull (android.support.annotation.NonNull)5 ActivityOptionsCompat (android.support.v4.app.ActivityOptionsCompat)5 CustomBubblePopup (com.flyco.dialogsamples.extra.CustomBubblePopup)5 Activity (com.kickstarter.models.pushdata.Activity)5 ArrayList (java.util.ArrayList)5