forked from nextcloud/android
-
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.
Commit id: 4fb3fb3 from branch bug/NMC-1652.
- Loading branch information
1 parent
2e55cc5
commit 4ec17af
Showing
3 changed files
with
28 additions
and
0 deletions.
There are no files selected for viewing
21 changes: 21 additions & 0 deletions
21
app/src/main/java/com/nmc/android/utils/KeyboardUtils.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,21 @@ | ||
package com.nmc.android.utils; | ||
|
||
import android.app.Activity; | ||
import android.content.Context; | ||
import android.view.View; | ||
import android.view.inputmethod.InputMethodManager; | ||
|
||
public class KeyboardUtils { | ||
|
||
public static void showSoftKeyboard(Context context, View view) { | ||
view.requestFocus(); | ||
InputMethodManager imm = (InputMethodManager) context.getSystemService(Context.INPUT_METHOD_SERVICE); | ||
imm.showSoftInput(view, InputMethodManager.SHOW_IMPLICIT); | ||
} | ||
|
||
public static void hideKeyboardFrom(Context context, View view) { | ||
view.clearFocus(); | ||
InputMethodManager imm = (InputMethodManager) context.getSystemService(Activity.INPUT_METHOD_SERVICE); | ||
imm.hideSoftInputFromWindow(view.getWindowToken(), 0); | ||
} | ||
} |
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
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