Search in sources :

Example 6 with MyViewDialogFragment

use of com.lingtuan.firefly.util.MyViewDialogFragment in project SmartMesh_Android by SmartMeshFoundation.

the class BindEmailUI method sendVerificationCode.

/**
 * Send verification code
 */
private void sendVerificationCode() {
    String phoneNumber = emailEt.getText().toString().trim();
    if (TextUtils.isEmpty(phoneNumber)) {
        showToast(getString(R.string.enter_email_number));
        return;
    }
    MyViewDialogFragment mdf = new MyViewDialogFragment();
    mdf.setTitleAndContentText(getString(R.string.confirm_email_number), getString(R.string.send_verification_warning, phoneNumber));
    mdf.setOkCallback(new MyViewDialogFragment.OkCallback() {

        @Override
        public void okBtn() {
            sendSmsc();
        }
    });
    mdf.show(getSupportFragmentManager(), "mdf");
}
Also used : MyViewDialogFragment(com.lingtuan.firefly.util.MyViewDialogFragment)

Example 7 with MyViewDialogFragment

use of com.lingtuan.firefly.util.MyViewDialogFragment in project SmartMesh_Android by SmartMeshFoundation.

the class BindMobileUI method sendVerificationCode.

/**
 * Send verification code
 */
private void sendVerificationCode() {
    String phoneNumber = phoneEt.getText().toString().trim();
    if (TextUtils.isEmpty(phoneNumber)) {
        showToast(getString(R.string.enter_phone_number));
        return;
    }
    MyViewDialogFragment mdf = new MyViewDialogFragment();
    mdf.setTitleAndContentText(getString(R.string.confirm_phone_number), getString(R.string.send_verification_warning, phoneNumber));
    mdf.setOkCallback(new MyViewDialogFragment.OkCallback() {

        @Override
        public void okBtn() {
            sendSmsc();
        }
    });
    mdf.show(getSupportFragmentManager(), "mdf");
}
Also used : MyViewDialogFragment(com.lingtuan.firefly.util.MyViewDialogFragment)

Example 8 with MyViewDialogFragment

use of com.lingtuan.firefly.util.MyViewDialogFragment in project SmartMesh_Android by SmartMeshFoundation.

the class BlackListUI method onItemLongClick.

@Override
public boolean onItemLongClick(AdapterView<?> parent, View view, final int position, long id) {
    MyViewDialogFragment mdf = new MyViewDialogFragment();
    mdf.setTitleAndContentText(getString(R.string.black_list_remove_title), getString(R.string.black_list_remove));
    mdf.setOkCallback(new MyViewDialogFragment.OkCallback() {

        @Override
        public void okBtn() {
            removeBlackListMethod(position);
        }
    });
    mdf.show(getSupportFragmentManager(), "mdf");
    return true;
}
Also used : MyViewDialogFragment(com.lingtuan.firefly.util.MyViewDialogFragment)

Example 9 with MyViewDialogFragment

use of com.lingtuan.firefly.util.MyViewDialogFragment in project SmartMesh_Android by SmartMeshFoundation.

the class SettingUI method checkLogOut.

/**
 * check logout
 */
private void checkLogOut() {
    if (NextApplication.myInfo != null && TextUtils.isEmpty(NextApplication.myInfo.getMid()) && TextUtils.isEmpty(NextApplication.myInfo.getMobile()) && TextUtils.isEmpty(NextApplication.myInfo.getEmail())) {
        MyViewDialogFragment mdf = new MyViewDialogFragment(MyViewDialogFragment.DIALOG_CHECK_LOGOUT);
        mdf.setTitleAndContentText(getString(R.string.account_logout_mid_warn), getString(R.string.account_logout_mid_hint));
        mdf.setOkCallback(new MyViewDialogFragment.OkCallback() {

            @Override
            public void okBtn() {
                checkLogOutAgain();
            }
        });
        mdf.setCancelCallback(new MyViewDialogFragment.CancelCallback() {

            @Override
            public void cancelBtn() {
                startActivity(new Intent(SettingUI.this, SecurityUI.class));
                Utils.openNewActivityAnim(SettingUI.this, false);
            }
        });
        mdf.show(getSupportFragmentManager(), "mdf");
    } else {
        MyViewDialogFragment mdf = new MyViewDialogFragment();
        mdf.setTitleAndContentText(getString(R.string.account_logout_warn), getString(R.string.account_logout_hint));
        mdf.setOkCallback(new MyViewDialogFragment.OkCallback() {

            @Override
            public void okBtn() {
                if (TextUtils.isEmpty(NextApplication.myInfo.getToken())) {
                    exitApp();
                } else {
                    logOutMethod();
                }
            }
        });
        mdf.show(getSupportFragmentManager(), "mdf");
    }
}
Also used : MyViewDialogFragment(com.lingtuan.firefly.util.MyViewDialogFragment) Intent(android.content.Intent)

Example 10 with MyViewDialogFragment

use of com.lingtuan.firefly.util.MyViewDialogFragment in project SmartMesh_Android by SmartMeshFoundation.

the class SettingUI method checkLogOutAgain.

/**
 * check logout again
 */
private void checkLogOutAgain() {
    MyViewDialogFragment mdf = new MyViewDialogFragment(MyViewDialogFragment.DIALOG_CHECK_LOGOUT_AGAIBN);
    mdf.setTitleAndContentText(getString(R.string.account_logout_mid_warn), getString(R.string.account_logout_mid_hint_again));
    mdf.setOkCallback(new MyViewDialogFragment.OkCallback() {

        @Override
        public void okBtn() {
            if (TextUtils.isEmpty(NextApplication.myInfo.getToken())) {
                exitApp();
            } else {
                logOutMethod();
            }
        }
    });
    mdf.setCancelCallback(new MyViewDialogFragment.CancelCallback() {

        @Override
        public void cancelBtn() {
            finish();
        }
    });
    mdf.show(getSupportFragmentManager(), "mdf");
}
Also used : MyViewDialogFragment(com.lingtuan.firefly.util.MyViewDialogFragment)

Aggregations

MyViewDialogFragment (com.lingtuan.firefly.util.MyViewDialogFragment)16 Intent (android.content.Intent)4 ChatMsg (com.lingtuan.firefly.vo.ChatMsg)2 FragmentManager (android.support.v4.app.FragmentManager)1 CaptureActivity (com.lingtuan.firefly.quickmark.CaptureActivity)1 ArrayList (java.util.ArrayList)1 Map (java.util.Map)1