Java Code Examples for com.qmuiteam.qmui.util.QMUIKeyboardHelper#hideKeyboard()

The following examples show how to use com.qmuiteam.qmui.util.QMUIKeyboardHelper#hideKeyboard() . 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: 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 4
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 5
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 6
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:
    }
}