From 029814e14efa444b41b42fac18d2e78aa7331dc2 Mon Sep 17 00:00:00 2001 From: lishoujun Date: Sat, 12 Jan 2019 20:40:32 +0800 Subject: [PATCH] add login values check. update Chinese translate. --- .../net/schueller/peertube/activity/LoginActivity.java | 9 +++++++++ app/src/main/res/values-zh-rCN/strings.xml | 5 ++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/net/schueller/peertube/activity/LoginActivity.java b/app/src/main/java/net/schueller/peertube/activity/LoginActivity.java index 56fa0e4..853b117 100644 --- a/app/src/main/java/net/schueller/peertube/activity/LoginActivity.java +++ b/app/src/main/java/net/schueller/peertube/activity/LoginActivity.java @@ -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); diff --git a/app/src/main/res/values-zh-rCN/strings.xml b/app/src/main/res/values-zh-rCN/strings.xml index d1ba83b..0fe712e 100644 --- a/app/src/main/res/values-zh-rCN/strings.xml +++ b/app/src/main/res/values-zh-rCN/strings.xml @@ -1,6 +1,5 @@ - PeerTube 登录 登录 登录 @@ -16,8 +15,8 @@ PeerTube 服务器 显示NSFW 版本 - 邮箱 - 密码(可选) + 邮箱/用户名 + 密码 建议 搜索 正常