aboutsummaryrefslogtreecommitdiffstats
path: root/app/src/main/java/mygram/droid/SetupActivity.java
diff options
context:
space:
mode:
Diffstat (limited to 'app/src/main/java/mygram/droid/SetupActivity.java')
-rw-r--r--app/src/main/java/mygram/droid/SetupActivity.java11
1 files changed, 8 insertions, 3 deletions
diff --git a/app/src/main/java/mygram/droid/SetupActivity.java b/app/src/main/java/mygram/droid/SetupActivity.java
index 3f33d76..79686e6 100644
--- a/app/src/main/java/mygram/droid/SetupActivity.java
+++ b/app/src/main/java/mygram/droid/SetupActivity.java
@@ -18,6 +18,7 @@ import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.text.InputType;
+import android.view.View;
import android.widget.EditText;
import android.widget.LinearLayout;
import android.widget.TextView;
@@ -61,7 +62,8 @@ public final class SetupActivity extends Activity {
t.setPadding(p * 2, p, p * 2, p);
Ui.focusable(t);
t.setOnClickListener(v -> choose(e.getKey()));
- box.addView(t);
+ box.addView(t, new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT,
+ LinearLayout.LayoutParams.WRAP_CONTENT)); // full width the zoom clips the text
}
actions();
box.getChildAt(1).requestFocus();
@@ -106,7 +108,7 @@ public final class SetupActivity extends Activity {
reset("Viewer password for " + base);
EditText pw = Ui.field(this, "Password", Ui.password());
box.addView(pw);
- box.addView(Ui.iconButton(this, R.drawable.ic_check, "Log in", v -> {
+ View login = Ui.iconButton(this, R.drawable.ic_check, "Log in", v -> {
String s = pw.getText().toString();
Api.async(() -> {
Api.login(base, s);
@@ -114,7 +116,10 @@ public final class SetupActivity extends Activity {
}, ok -> save(base, s), e -> Toast.makeText(this,
e instanceof Api.HttpError && ((Api.HttpError) e).code == 401 ? "Wrong password" : e.getMessage(),
Toast.LENGTH_LONG).show());
- }));
+ });
+ box.addView(login);
+ // The keyboard's done key logs in; the D-pad cannot leave the keyboard.
+ pw.setOnEditorActionListener((v, action, event) -> login.performClick());
pw.requestFocus();
}