Skip to content
Snippets Groups Projects
Commit f9795130 authored by Geoffrey Métais's avatar Geoffrey Métais
Browse files

Util method setKeyboardVisibility

parent 983558b2
No related branches found
No related tags found
No related merge requests found
......@@ -23,6 +23,7 @@
package org.videolan.vlc.gui.helpers;
import android.app.Activity;
import android.content.Context;
import android.content.SharedPreferences;
import android.content.res.TypedArray;
......@@ -41,6 +42,7 @@ import android.view.animation.Animation;
import android.view.animation.AnimationSet;
import android.view.animation.DecelerateInterpolator;
import android.view.animation.RotateAnimation;
import android.view.inputmethod.InputMethodManager;
import android.widget.ImageView;
import android.widget.TextView;
......@@ -195,4 +197,17 @@ public class UiTools {
}
});
}
public static void setKeyboardVisibility(final View v, final boolean show) {
final InputMethodManager inputMethodManager = (InputMethodManager) VLCApplication.getAppContext().getSystemService(Activity.INPUT_METHOD_SERVICE);
sHandler.post(new Runnable() {
@Override
public void run() {
if (show)
inputMethodManager.showSoftInput(v, InputMethodManager.SHOW_FORCED);
else
inputMethodManager.hideSoftInputFromWindow(v.getWindowToken(), 0);
}
});
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment