add login values check.

update Chinese translate.
This commit is contained in:
lishoujun 2019-01-12 20:40:32 +08:00
parent a67f6591e3
commit 029814e14e
2 changed files with 11 additions and 3 deletions

View File

@ -103,6 +103,15 @@ public class LoginActivity extends CommonActivity {
String email = mEmailView.getText().toString(); String email = mEmailView.getText().toString();
String password = mPasswordView.getText().toString(); String password = mPasswordView.getText().toString();
//check values
if (email.isEmpty()) {
Toast.makeText(LoginActivity.this, "Email/Username is empty", Toast.LENGTH_LONG).show();
return;
}
if (password.isEmpty()) {
Toast.makeText(LoginActivity.this, "Password is empty", Toast.LENGTH_LONG).show();
return;
}
// make http call to login and save access tokens // make http call to login and save access tokens
String apiBaseURL = APIUrlHelper.getUrlWithVersion(this); String apiBaseURL = APIUrlHelper.getUrlWithVersion(this);

View File

@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<resources> <resources>
<string name="app_name">PeerTube</string>
<string name="action_sign_in_short">登录</string> <string name="action_sign_in_short">登录</string>
<string name="action_sign_in">登录</string> <string name="action_sign_in">登录</string>
<string name="title_activity_login">登录</string> <string name="title_activity_login">登录</string>
@ -16,8 +15,8 @@
<string name="pref_title_peertube_server">PeerTube 服务器</string> <string name="pref_title_peertube_server">PeerTube 服务器</string>
<string name="pref_title_show_nsfw">显示NSFW</string> <string name="pref_title_show_nsfw">显示NSFW</string>
<string name="pref_title_version">版本</string> <string name="pref_title_version">版本</string>
<string name="prompt_email">邮箱</string> <string name="prompt_email">邮箱/用户名</string>
<string name="prompt_password">密码(可选)</string> <string name="prompt_password">密码</string>
<string name="search_hint">建议</string> <string name="search_hint">建议</string>
<string name="title_activity_search">搜索</string> <string name="title_activity_search">搜索</string>
<string name="video_speed_10">正常</string> <string name="video_speed_10">正常</string>