mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 697562 - Hide soft keyboard when the focus is not in awesomebar text field [r=mfinkle]
This commit is contained in:
parent
d512940bf9
commit
2c304c8fd3
@ -43,6 +43,7 @@ import java.io.File;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Intent;
|
||||
import android.content.Context;
|
||||
import android.os.Bundle;
|
||||
import android.text.Editable;
|
||||
import android.text.TextWatcher;
|
||||
@ -50,6 +51,7 @@ import android.util.Log;
|
||||
import android.view.KeyEvent;
|
||||
import android.view.View;
|
||||
import android.view.Window;
|
||||
import android.view.inputmethod.InputMethodManager;
|
||||
import android.widget.EditText;
|
||||
|
||||
public class AwesomeBar extends Activity {
|
||||
@ -119,6 +121,15 @@ public class AwesomeBar extends Activity {
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
text.setOnFocusChangeListener(new View.OnFocusChangeListener() {
|
||||
public void onFocusChange(View v, boolean hasFocus) {
|
||||
if (!hasFocus) {
|
||||
InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
|
||||
imm.hideSoftInputFromWindow(v.getWindowToken(), 0);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void openUrlAndFinish(String url) {
|
||||
|
Loading…
Reference in New Issue
Block a user