mirror of
https://github.com/oxen-io/session-android.git
synced 2024-12-28 18:57:43 +00:00
Close giphy keyboard when search button is pressed
Fixes #5807 // FREEBIE
This commit is contained in:
parent
2bcbbb0601
commit
11dbb82bf1
@ -9,11 +9,15 @@ import android.text.Editable;
|
||||
import android.text.InputType;
|
||||
import android.text.TextWatcher;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.KeyEvent;
|
||||
import android.view.TouchDelegate;
|
||||
import android.view.View;
|
||||
import android.view.inputmethod.EditorInfo;
|
||||
import android.view.inputmethod.InputMethodManager;
|
||||
import android.widget.EditText;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import org.thoughtcrime.securesms.R;
|
||||
import org.thoughtcrime.securesms.components.AnimatingToggle;
|
||||
@ -96,6 +100,18 @@ public class GiphyActivityToolbar extends Toolbar {
|
||||
}
|
||||
});
|
||||
|
||||
this.searchText.setOnEditorActionListener(new TextView.OnEditorActionListener() {
|
||||
@Override
|
||||
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
|
||||
if (actionId == EditorInfo.IME_ACTION_SEARCH) {
|
||||
InputMethodManager inputMethodManager = (InputMethodManager)getContext().getSystemService(Context.INPUT_METHOD_SERVICE);
|
||||
inputMethodManager.hideSoftInputFromWindow(searchText.getWindowToken(), 0);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
expandTapArea(this, action);
|
||||
expandTapArea(toggleContainer, gridToggle);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user