Improve PasswordActivity by

* removing screen border visible on small screens
* showing noticeable error message on wrong password input
* showing keyboard again after entering wrong password
* making lost password link easier to recognize as link
* renaming keyboard toggle method from 'hide' to 'toggle'
This commit is contained in:
Torsten Grote
2016-01-06 16:31:42 -02:00
parent 6e26391e03
commit 4460d69a06
9 changed files with 114 additions and 68 deletions

View File

@@ -5,6 +5,7 @@ import android.content.SharedPreferences;
import android.content.res.Configuration;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.view.inputmethod.InputMethodManager;
import com.google.inject.Inject;
@@ -31,6 +32,7 @@ import roboguice.util.RoboContext;
import static android.view.WindowManager.LayoutParams.FLAG_SECURE;
import static android.view.inputmethod.InputMethodManager.HIDE_IMPLICIT_ONLY;
import static android.view.inputmethod.InputMethodManager.SHOW_IMPLICIT;
import static org.briarproject.android.TestingConstants.PREVENT_SCREENSHOTS;
public abstract class BaseActivity extends AppCompatActivity
@@ -155,8 +157,13 @@ public abstract class BaseActivity extends AppCompatActivity
gotoAndFinish(classInstance, Integer.MIN_VALUE);
}
protected void hideSoftKeyboard() {
protected void toggleSoftKeyboard() {
Object o = getSystemService(INPUT_METHOD_SERVICE);
((InputMethodManager) o).toggleSoftInput(HIDE_IMPLICIT_ONLY, 0);
}
protected void showSoftKeyboard(View view) {
Object o = getSystemService(INPUT_METHOD_SERVICE);
((InputMethodManager) o).showSoftInput(view, SHOW_IMPLICIT);
}
}