com.qmuiteam.qmui.util.QMUIKeyboardHelper Java Examples

The following examples show how to use com.qmuiteam.qmui.util.QMUIKeyboardHelper. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: UserLoginActivity.java    From v9porn with MIT License 6 votes vote down vote up
private void login(String username, String password, String captcha) {

        if (TextUtils.isEmpty(username)) {
            showMessage("请填写用户名", TastyToast.INFO);
            return;
        }
        if (TextUtils.isEmpty(password)) {
            showMessage("请填写密码", TastyToast.INFO);
            return;
        }
        if (TextUtils.isEmpty(captcha)) {
            showMessage("请填写验证码", TastyToast.INFO);
            return;
        }
        QMUIKeyboardHelper.hideKeyboard(getCurrentFocus());
        presenter.login(username, password, captcha);
    }
 
Example #2
Source File: UserLoginActivity.java    From v9porn with MIT License 6 votes vote down vote up
private void login(String username, String password, String captcha) {

        if (TextUtils.isEmpty(username)) {
            showMessage("请填写用户名", TastyToast.INFO);
            return;
        }
        if (TextUtils.isEmpty(password)) {
            showMessage("请填写密码", TastyToast.INFO);
            return;
        }
        if (TextUtils.isEmpty(captcha)) {
            showMessage("请填写验证码", TastyToast.INFO);
            return;
        }
        QMUIKeyboardHelper.hideKeyboard(getCurrentFocus());
        presenter.login(username, password, captcha);
    }
 
Example #3
Source File: PersonActivity.java    From PoetryWeather with Apache License 2.0 6 votes vote down vote up
/**
 * 长文本输入对话框
 */
private void showLongEditDialog() {
    QMAutoTestDialogBuilder autoTestDialogBuilder = new QMAutoTestDialogBuilder(PersonActivity.this);
    autoTestDialogBuilder
            .addAction("取消", (dialog, index) -> dialog.dismiss())
            .addAction("确定", (dialog, index) -> {
                signature = autoTestDialogBuilder.getEditText().getText().toString();
                if (signature.length() < 50) {
                    Toast.makeText(PersonActivity.this, "您的个性签名已修改", Toast.LENGTH_SHORT).show();
                    Log.d(TAG, "showLongEditDialog: signature" + signature);
                    sharedPreferencesEdit("signature", signature);
                    signatureListView.setDetailText(signature);
                    dialog.dismiss();
                } else {
                    Toast.makeText(PersonActivity.this,"您输入的字数超出限制,请重新输入",Toast.LENGTH_SHORT).show();
                }
            });

    autoTestDialogBuilder.create(mCurrentDialogStyle).show();
    QMUIKeyboardHelper.showKeyboard(autoTestDialogBuilder.getEditText(),true);
}
 
Example #4
Source File: UserRegisterActivity.java    From v9porn with MIT License 5 votes vote down vote up
private void register(String username, String email, String passwordOne, String passwordTwo, String captcha) {
    if (TextUtils.isEmpty(username)) {
        showMessage("用户名不能为空", TastyToast.INFO);
        return;
    }
    //服务器根本不会验证邮箱格式,貌似只要有@符号和.就可以通过注册了,不过如果后期验证邮箱....
    if (TextUtils.isEmpty(email)) {
        showMessage("邮箱不能为空", TastyToast.INFO);
        return;
    }
    if (TextUtils.isEmpty(passwordOne)) {
        showMessage("密码不能为空", TastyToast.INFO);
        return;
    }
    if (TextUtils.isEmpty(passwordTwo)) {
        showMessage("确认密码不能为空", TastyToast.INFO);
        return;
    }
    if (TextUtils.isEmpty(captcha)) {
        showMessage("验证码不能为空", TastyToast.INFO);
        return;
    }
    if (!passwordOne.equals(passwordTwo)) {
        showMessage("密码不一致,请检查", TastyToast.INFO);
        return;
    }
    QMUIKeyboardHelper.hideKeyboard(getCurrentFocus());
    presenter.register(username, passwordOne, passwordTwo, email, captcha);
}
 
Example #5
Source File: ProxySettingActivity.java    From v9porn with MIT License 5 votes vote down vote up
@Override
public void onClick(View v) {
    switch (v.getId()) {
        case R.id.bt_proxy_setting_test:
            if (presenter.isSetPorn91VideoAddress()) {
                Logger.t(TAG).d("木有设置地址呀");
                showNeedSetAddressFirstDialog();
                return;
            }
            isTestSuccess = false;
            String proxyIpAddress = etDialogProxySettingIpAddress.getIpAddressStr();
            String portStr = etDialogProxySettingPort.getText().toString().trim();
            if (TextUtils.isEmpty(portStr) || TextUtils.isEmpty(proxyIpAddress) || !TextUtils.isDigitsOnly(portStr)) {
                showMessage("端口号或IP地址不正确", TastyToast.WARNING);
                return;
            }
            int proxyPort = Integer.parseInt(portStr);
            presenter.testProxy(proxyIpAddress, proxyPort);
            QMUIKeyboardHelper.hideKeyboard(v);
            break;
        case R.id.bt_proxy_setting_reset:
            etDialogProxySettingIpAddress.setIpAddressStr("");
            etDialogProxySettingPort.setText("");
            View view = getCurrentFocus();
            if (view instanceof AppCompatEditText || view instanceof EditText) {
                QMUIKeyboardHelper.showKeyboard((EditText) view, QMUIKeyboardHelper.SHOW_KEYBOARD_DELAY_TIME);
            }
            break;
        default:
    }
}
 
Example #6
Source File: UserRegisterActivity.java    From v9porn with MIT License 5 votes vote down vote up
private void register(String username, String email, String passwordOne, String passwordTwo, String captcha) {
    if (TextUtils.isEmpty(username)) {
        showMessage("用户名不能为空", TastyToast.INFO);
        return;
    }
    //服务器根本不会验证邮箱格式,貌似只要有@符号和.就可以通过注册了,不过如果后期验证邮箱....
    if (TextUtils.isEmpty(email)) {
        showMessage("邮箱不能为空", TastyToast.INFO);
        return;
    }
    if (TextUtils.isEmpty(passwordOne)) {
        showMessage("密码不能为空", TastyToast.INFO);
        return;
    }
    if (TextUtils.isEmpty(passwordTwo)) {
        showMessage("确认密码不能为空", TastyToast.INFO);
        return;
    }
    if (TextUtils.isEmpty(captcha)) {
        showMessage("验证码不能为空", TastyToast.INFO);
        return;
    }
    if (!passwordOne.equals(passwordTwo)) {
        showMessage("密码不一致,请检查", TastyToast.INFO);
        return;
    }
    QMUIKeyboardHelper.hideKeyboard(getCurrentFocus());
    presenter.register(username, passwordOne, passwordTwo, email, captcha);
}
 
Example #7
Source File: ProxySettingActivity.java    From v9porn with MIT License 5 votes vote down vote up
@Override
public void onClick(View v) {
    switch (v.getId()) {
        case R.id.bt_proxy_setting_test:
            if (presenter.isSetPorn91VideoAddress()) {
                Logger.t(TAG).d("木有设置地址呀");
                showNeedSetAddressFirstDialog();
                return;
            }
            isTestSuccess = false;
            String proxyIpAddress = etDialogProxySettingIpAddress.getIpAddressStr();
            String portStr = etDialogProxySettingPort.getText().toString().trim();
            if (TextUtils.isEmpty(portStr) || TextUtils.isEmpty(proxyIpAddress) || !TextUtils.isDigitsOnly(portStr)) {
                showMessage("端口号或IP地址不正确", TastyToast.WARNING);
                return;
            }
            int proxyPort = Integer.parseInt(portStr);
            presenter.testProxy(proxyIpAddress, proxyPort);
            QMUIKeyboardHelper.hideKeyboard(v);
            break;
        case R.id.bt_proxy_setting_reset:
            etDialogProxySettingIpAddress.setIpAddressStr("");
            etDialogProxySettingPort.setText("");
            View view = getCurrentFocus();
            if (view instanceof AppCompatEditText || view instanceof EditText) {
                QMUIKeyboardHelper.showKeyboard((EditText) view, QMUIKeyboardHelper.SHOW_KEYBOARD_DELAY_TIME);
            }
            break;
        default:
    }
}