Merge pull request #108 from lishoujun/develop

Add login values check.
This commit is contained in:
Stefan Schüller 2019-01-14 09:05:50 +01:00 committed by GitHub
commit 172fb3901d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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 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
String apiBaseURL = APIUrlHelper.getUrlWithVersion(this);

View File

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