Skip to content

Commit

Permalink
adding keyboard toggle call
Browse files Browse the repository at this point in the history
  • Loading branch information
ravindu committed Jan 17, 2017
1 parent c5421ce commit 3a94edf
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions KeyboardUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewTreeObserver;
import android.content.Context;

import java.util.HashMap;

Expand Down Expand Up @@ -66,6 +67,12 @@ public static void removeAllKeyboardToggleListeners()
sListenerMap.clear();
}

public static void toggleKeyboardVisibility(Context context)
{
InputMethodManager inputMethodManager = (InputMethodManager) context.getSystemService(Context.INPUT_METHOD_SERVICE);
inputMethodManager.toggleSoftInput(InputMethodManager.SHOW_FORCED, 0);
}

private void removeListener()
{
mCallback = null;
Expand Down

0 comments on commit 3a94edf

Please sign in to comment.