forked from esoxjem/MovieGuide
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
searchview added to toolbar along with onQueryTextSubmit
- Loading branch information
1 parent
5f015a9
commit 6e0c394
Showing
3 changed files
with
43 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
app/src/main/java/com/esoxjem/movieguide/util/SoftKeyboardUtils.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package com.esoxjem.movieguide.util; | ||
|
||
import android.content.Context; | ||
import android.view.View; | ||
import android.view.inputmethod.InputMethodManager; | ||
|
||
public class SoftKeyboardUtils { | ||
|
||
/** | ||
* Hides soft keyboard | ||
* | ||
* @param v - view instance | ||
*/ | ||
public static void hideSoftInput(View v) { | ||
if (v != null) { | ||
((InputMethodManager) v.getContext().getSystemService(Context.INPUT_METHOD_SERVICE)). | ||
hideSoftInputFromWindow(v.getWindowToken(), 0); | ||
} | ||
} | ||
|
||
//restrict instanciation | ||
private SoftKeyboardUtils() { | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters