Skip to content

Commit

Permalink
Do not force soft keyboard visible when hw exists
Browse files Browse the repository at this point in the history
  • Loading branch information
fornwall committed Jan 13, 2016
1 parent 6caaae4 commit 19eb371
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion app/src/main/java/com/termux/app/DialogUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import android.app.Activity;
import android.app.AlertDialog;
import android.content.DialogInterface;
import android.content.res.Configuration;
import android.text.Selection;
import android.util.TypedValue;
import android.view.KeyEvent;
Expand Down Expand Up @@ -69,7 +70,10 @@ public void onClick(DialogInterface dialog, int which) {
}

dialogHolder[0] = builder.create();
dialogHolder[0].getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_VISIBLE);
if ((activity.getResources().getConfiguration().hardKeyboardHidden & Configuration.HARDKEYBOARDHIDDEN_YES) == 0) {
// Show soft keyboard unless hardware keyboard available.
dialogHolder[0].getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_VISIBLE);
}
dialogHolder[0].show();
}

Expand Down

0 comments on commit 19eb371

Please sign in to comment.