Skip to content
This repository was archived by the owner on Jul 25, 2024. It is now read-only.

Commit 6f3f92c

Browse files
saketkumartimabbott
authored andcommitted
Fixes #246: Disable auto showing up the soft keyboard in login activity
1 parent 56e33de commit 6f3f92c

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

app/src/main/AndroidManifest.xml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,7 @@
4444
</activity>
4545
<activity
4646
android:name=".activities.LoginActivity"
47-
android:label="@string/app_name"
48-
android:windowSoftInputMode="stateHidden" >
47+
android:label="@string/app_name" >
4948
</activity>
5049
<activity
5150
android:name=".activities.LegalActivity"

app/src/main/java/com/zulip/android/activities/LoginActivity.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package com.zulip.android.activities;
22

33
import android.app.ProgressDialog;
4+
import android.content.Context;
45
import android.content.DialogInterface;
56
import android.content.Intent;
67
import android.content.IntentSender.SendIntentException;
@@ -13,6 +14,7 @@
1314
import android.util.Log;
1415
import android.util.Patterns;
1516
import android.view.View;
17+
import android.view.inputmethod.InputMethodManager;
1618
import android.widget.Button;
1719
import android.widget.EditText;
1820
import android.widget.Toast;
@@ -221,6 +223,12 @@ private void showBackends(String httpScheme, String serverURL) {
221223

222224
@Override
223225
public void onSuccess(Call<ZulipBackendResponse> call, Response<ZulipBackendResponse> response) {
226+
View view = LoginActivity.this.getCurrentFocus();
227+
if (view != null) {
228+
InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
229+
imm.hideSoftInputFromWindow(view.getWindowToken(), 0);
230+
}
231+
224232
if (response.body().isPassword()) {
225233
findViewById(R.id.passwordAuthLayout).setVisibility(View.VISIBLE);
226234
}

0 commit comments

Comments
 (0)