Unverified Commit 8407c568 authored by Leonardo Aramaki's avatar Leonardo Aramaki Committed by GitHub

Merge pull request #634 from aniketsingh03/patch-1

[FIX] Dissmiss keyboard on clicking submit button in server url fragment
parents df81ef04 53378ec5
......@@ -6,6 +6,7 @@ import android.support.annotation.Nullable;
import android.support.constraint.ConstraintLayout;
import android.support.design.widget.Snackbar;
import android.view.View;
import android.view.inputmethod.InputMethodManager;
import android.widget.TextView;
import chat.rocket.android.BuildConfig;
......@@ -25,7 +26,8 @@ public class InputHostnameFragment extends AbstractFragment implements InputHost
private ConstraintLayout container;
private View waitingView;
public InputHostnameFragment() {}
public InputHostnameFragment() {
}
@Override
public void onCreate(@Nullable Bundle savedInstanceState) {
......@@ -55,9 +57,17 @@ public class InputHostnameFragment extends AbstractFragment implements InputHost
}
private void handleConnect() {
hideSoftKeyboard();
presenter.connectTo(getHostname());
}
private void hideSoftKeyboard() {
InputMethodManager inputManager = (InputMethodManager)
getActivity().getSystemService(Context.INPUT_METHOD_SERVICE);
inputManager.hideSoftInputFromWindow(getActivity().getCurrentFocus().getWindowToken(),
InputMethodManager.HIDE_NOT_ALWAYS);
}
@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment