Search in sources :

Example 1 with RxDialogScaleView

use of com.vondear.rxtools.view.dialog.RxDialogScaleView in project RxTools by vondear.

the class ActivityDialog method onClick.

@OnClick({ R.id.button_DialogScaleView, R.id.button_DialogLoadingspinkit, R.id.button_tran, R.id.button_DialogSure, R.id.button_DialogSureCancle, R.id.button_DialogEditTextSureCancle, R.id.button_DialogWheelYearMonthDay, R.id.button_DialogShapeLoading, R.id.button_DialogLoadingProgressAcfunVideo })
public void onClick(View view) {
    switch(view.getId()) {
        case R.id.button_tran:
            RxDialog rxDialog = new RxDialog(mContext, R.style.tran_dialog);
            View view1 = LayoutInflater.from(mContext).inflate(R.layout.image, null);
            ImageView pageItem = (ImageView) view1.findViewById(R.id.page_item);
            pageItem.setImageResource(R.drawable.coin);
            rxDialog.setContentView(view1);
            rxDialog.show();
            break;
        case R.id.button_DialogSure:
            // 提示弹窗
            final RxDialogSure rxDialogSure = new RxDialogSure(mContext);
            rxDialogSure.getLogoView().setImageResource(R.drawable.logo);
            rxDialogSure.getSureView().setOnClickListener(new View.OnClickListener() {

                @Override
                public void onClick(View v) {
                    rxDialogSure.cancel();
                }
            });
            rxDialogSure.show();
            break;
        case R.id.button_DialogSureCancle:
            // 提示弹窗
            final RxDialogSureCancel rxDialogSureCancel = new RxDialogSureCancel(mContext);
            rxDialogSureCancel.getTitleView().setBackgroundResource(R.drawable.logo);
            rxDialogSureCancel.getSureView().setOnClickListener(new View.OnClickListener() {

                @Override
                public void onClick(View v) {
                    rxDialogSureCancel.cancel();
                }
            });
            rxDialogSureCancel.getCancelView().setOnClickListener(new View.OnClickListener() {

                @Override
                public void onClick(View v) {
                    rxDialogSureCancel.cancel();
                }
            });
            rxDialogSureCancel.show();
            break;
        case R.id.button_DialogEditTextSureCancle:
            // 提示弹窗
            final RxDialogEditSureCancel rxDialogEditSureCancel = new RxDialogEditSureCancel(mContext);
            rxDialogEditSureCancel.getTitleView().setBackgroundResource(R.drawable.logo);
            rxDialogEditSureCancel.getSureView().setOnClickListener(new View.OnClickListener() {

                @Override
                public void onClick(View v) {
                    rxDialogEditSureCancel.cancel();
                }
            });
            rxDialogEditSureCancel.getCancelView().setOnClickListener(new View.OnClickListener() {

                @Override
                public void onClick(View v) {
                    rxDialogEditSureCancel.cancel();
                }
            });
            rxDialogEditSureCancel.show();
            break;
        case R.id.button_DialogWheelYearMonthDay:
            if (mRxDialogWheelYearMonthDay == null) {
                initWheelYearMonthDayDialog();
            }
            mRxDialogWheelYearMonthDay.show();
            break;
        case R.id.button_DialogShapeLoading:
            RxDialogShapeLoading rxDialogShapeLoading = new RxDialogShapeLoading(this);
            rxDialogShapeLoading.show();
            break;
        case R.id.button_DialogLoadingProgressAcfunVideo:
            new RxDialogAcfunVideoLoading(this).show();
            break;
        case R.id.button_DialogLoadingspinkit:
            RxDialogLoading rxDialogLoading = new RxDialogLoading(mContext);
            rxDialogLoading.show();
            // rxDialogLoading.cancel(RxDialogLoading.RxCancelType.error,"");
            break;
        case R.id.button_DialogScaleView:
            RxDialogScaleView rxDialogScaleView = new RxDialogScaleView(mContext);
            rxDialogScaleView.setImageAssets("squirrel.jpg");
            rxDialogScaleView.show();
            break;
        default:
            break;
    }
}
Also used : RxDialogEditSureCancel(com.vondear.rxtools.view.dialog.RxDialogEditSureCancel) RxDialog(com.vondear.rxtools.view.dialog.RxDialog) RxDialogLoading(com.vondear.rxtools.view.dialog.RxDialogLoading) RxDialogShapeLoading(com.vondear.rxtools.view.dialog.RxDialogShapeLoading) ImageView(android.widget.ImageView) RxDialogScaleView(com.vondear.rxtools.view.dialog.RxDialogScaleView) ImageView(android.widget.ImageView) BindView(butterknife.BindView) View(android.view.View) RxDialogScaleView(com.vondear.rxtools.view.dialog.RxDialogScaleView) RxDialogSure(com.vondear.rxtools.view.dialog.RxDialogSure) RxDialogSureCancel(com.vondear.rxtools.view.dialog.RxDialogSureCancel) RxDialogAcfunVideoLoading(com.vondear.rxtools.view.dialog.RxDialogAcfunVideoLoading) OnClick(butterknife.OnClick)

Example 2 with RxDialogScaleView

use of com.vondear.rxtools.view.dialog.RxDialogScaleView in project RxTools by vondear.

the class ActivityRxExifTool method onViewClicked.

@OnClick({ R.id.btn_take_camera, R.id.iv_pic })
public void onViewClicked(View view) {
    switch(view.getId()) {
        case R.id.btn_take_camera:
            RxCameraTool.takePic(mContext, mCameraView);
            break;
        case R.id.iv_pic:
            if (photo == null) {
                RxToast.normal("请先拍照");
            } else {
                RxDialogScaleView rxDialogScaleView = new RxDialogScaleView(mContext);
                rxDialogScaleView.setImagePath(photo.getAbsolutePath());
                rxDialogScaleView.show();
            }
            break;
    }
}
Also used : RxDialogScaleView(com.vondear.rxtools.view.dialog.RxDialogScaleView) OnClick(butterknife.OnClick)

Example 3 with RxDialogScaleView

use of com.vondear.rxtools.view.dialog.RxDialogScaleView in project RxTools by vondear.

the class ActivityRxPhoto method initView.

protected void initView() {
    Resources r = mContext.getResources();
    resultUri = Uri.parse(ContentResolver.SCHEME_ANDROID_RESOURCE + "://" + r.getResourcePackageName(R.drawable.circle_elves_ball) + "/" + r.getResourceTypeName(R.drawable.circle_elves_ball) + "/" + r.getResourceEntryName(R.drawable.circle_elves_ball));
    mRxTitle.setLeftFinish(mContext);
    mIvAvatar.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View view) {
            initDialogChooseImage();
        }
    });
    mIvAvatar.setOnLongClickListener(new View.OnLongClickListener() {

        @Override
        public boolean onLongClick(View view) {
            // RxImageTool.showBigImageView(mContext, resultUri);
            RxDialogScaleView rxDialogScaleView = new RxDialogScaleView(mContext);
            rxDialogScaleView.setImageUri(resultUri);
            rxDialogScaleView.show();
            return false;
        }
    });
}
Also used : Resources(android.content.res.Resources) RxDialogScaleView(com.vondear.rxtools.view.dialog.RxDialogScaleView) ImageView(android.widget.ImageView) BindView(butterknife.BindView) View(android.view.View) RxDialogScaleView(com.vondear.rxtools.view.dialog.RxDialogScaleView) TextView(android.widget.TextView)

Example 4 with RxDialogScaleView

use of com.vondear.rxtools.view.dialog.RxDialogScaleView in project yoo_home_Android by culturer.

the class UserActivity method initBaseView.

private void initBaseView() {
    Resources r = context.getResources();
    resultUri = Uri.parse(ContentResolver.SCHEME_ANDROID_RESOURCE + "://" + r.getResourcePackageName(R.drawable.logo_black) + "/" + r.getResourceTypeName(R.drawable.logo_black) + "/" + r.getResourceEntryName(R.drawable.logo_black));
    mTvBg = contentView.findViewById(R.id.tv_bg);
    mIvAvatar = contentView.findViewById(R.id.iv_avatar);
    mLlAnchorLeft = contentView.findViewById(R.id.ll_anchor_left);
    mRlAvatar = contentView.findViewById(R.id.rl_avatar);
    mTvName = contentView.findViewById(R.id.tv_name);
    mTvConstellation = contentView.findViewById(R.id.tv_constellation);
    mTvBirthday = contentView.findViewById(R.id.tv_birthday);
    mTvAddress = contentView.findViewById(R.id.tv_address);
    mTvLables = contentView.findViewById(R.id.tv_lables);
    mTextView2 = contentView.findViewById(R.id.textView2);
    mEditText2 = contentView.findViewById(R.id.editText2);
    mBtnExit = contentView.findViewById(R.id.btn_exit);
    mActivityUser = contentView.findViewById(R.id.activity_user);
    tv_family = contentView.findViewById(R.id.tv_family);
    ib_setting = contentView.findViewById(R.id.ib_setting);
    if (user != null) {
        // 设置用户名
        mTvName.setText(user.getUsername());
        // 设置家庭
        tv_family.setText(user.getFamilyName());
        // 设置星座
        mTvConstellation.setText("处女座");
        // 设置生日
        mTvBirthday.setText(user.getBirth());
        // 设置地址
        mTvAddress.setText("中国");
        // 设置标签
        mTvLables.setText("二货少年");
        // 设置签名
        mEditText2.setText(user.getNMsg());
    }
    // 进入设置页面
    ib_setting.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            Intent intent = new Intent(UserActivity.this, SettingActivity.class);
            startActivity(intent);
        }
    });
    // 单击选择头像
    mIvAvatar.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View view) {
            initDialogChooseImage();
        }
    });
    // 长按显示头像大图
    mIvAvatar.setOnLongClickListener(new View.OnLongClickListener() {

        @Override
        public boolean onLongClick(View view) {
            RxDialogScaleView rxDialogScaleView = new RxDialogScaleView(context);
            rxDialogScaleView.setImage(resultUri);
            rxDialogScaleView.show();
            return false;
        }
    });
    // 退出应用
    mBtnExit.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            new AlertDialog.Builder(context).setTitle("确定退出应用?").setNegativeButton("取消", new DialogInterface.OnClickListener() {

                @Override
                public void onClick(DialogInterface dialog, int which) {
                    dialog.dismiss();
                }
            }).setPositiveButton("确定", new DialogInterface.OnClickListener() {

                @Override
                public void onClick(DialogInterface dialog, int which) {
                    // 杀掉当前的应用
                    int pid = Process.myPid();
                    Process.killProcess(pid);
                    finish();
                }
            }).create().show();
        }
    });
}
Also used : DialogInterface(android.content.DialogInterface) Intent(android.content.Intent) ImageView(android.widget.ImageView) View(android.view.View) RxDialogScaleView(com.vondear.rxtools.view.dialog.RxDialogScaleView) TextView(android.widget.TextView) Resources(android.content.res.Resources) RxDialogScaleView(com.vondear.rxtools.view.dialog.RxDialogScaleView)

Aggregations

RxDialogScaleView (com.vondear.rxtools.view.dialog.RxDialogScaleView)4 View (android.view.View)3 ImageView (android.widget.ImageView)3 Resources (android.content.res.Resources)2 TextView (android.widget.TextView)2 BindView (butterknife.BindView)2 OnClick (butterknife.OnClick)2 DialogInterface (android.content.DialogInterface)1 Intent (android.content.Intent)1 RxDialog (com.vondear.rxtools.view.dialog.RxDialog)1 RxDialogAcfunVideoLoading (com.vondear.rxtools.view.dialog.RxDialogAcfunVideoLoading)1 RxDialogEditSureCancel (com.vondear.rxtools.view.dialog.RxDialogEditSureCancel)1 RxDialogLoading (com.vondear.rxtools.view.dialog.RxDialogLoading)1 RxDialogShapeLoading (com.vondear.rxtools.view.dialog.RxDialogShapeLoading)1 RxDialogSure (com.vondear.rxtools.view.dialog.RxDialogSure)1 RxDialogSureCancel (com.vondear.rxtools.view.dialog.RxDialogSureCancel)1