本文整理汇总了Java中android.view.Window.setSoftInputMode方法的典型用法代码示例。如果您正苦于以下问题:Java Window.setSoftInputMode方法的具体用法?Java Window.setSoftInputMode怎么用?Java Window.setSoftInputMode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.view.Window
的用法示例。
在下文中一共展示了Window.setSoftInputMode方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setupDialog
import android.view.Window; //导入方法依赖的package包/类
@Override
public void setupDialog(Dialog dialog, int style) {
LogUtils.footPrint();
super.setupDialog(dialog, style);
View contentView = View.inflate(getContext(), R.layout.fragment_add_list_dialog, null);
dialog.setContentView(contentView);
CoordinatorLayout.LayoutParams params = (CoordinatorLayout.LayoutParams) ((View) contentView.getParent()).getLayoutParams();
CoordinatorLayout.Behavior behavior = params.getBehavior();
if (behavior != null && behavior instanceof BottomSheetBehavior) {
BottomSheetBehavior bottomSheetBehavior = ((BottomSheetBehavior) behavior);
bottomSheetBehavior.setBottomSheetCallback(bottomSheetBehaviorCallback);
}
ButterKnife.bind(this, contentView);
Window window = dialog.getWindow();
if (window != null) {
window.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_VISIBLE);
}
presenter = new AddListPresenter(TodoRepository.getInstance());
presenter.attachView(this);
}
示例2: setActivity
import android.view.Window; //导入方法依赖的package包/类
public void setActivity(Activity activity) {
super.setActivity(activity);
Window win = activity.getWindow();
int orientation = activity.getResources().getConfiguration().orientation;
if (orientation == Configuration.ORIENTATION_LANDSCAPE) {
win.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN
| WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN);
} else {
win.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE
| WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN);
}
}
示例3: onCreate
import android.view.Window; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Window window = getWindow();
if (window != null) {
if (Build.VERSION.SDK_INT >= 21) {
window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
}
window.setLayout(ViewGroup.LayoutParams.MATCH_PARENT,
ViewGroup.LayoutParams.MATCH_PARENT);
window.setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
window.clearFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND);
window.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE);
window.clearFlags(WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE | WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM);
}
}
示例4: showDialog
import android.view.Window; //导入方法依赖的package包/类
@Override
protected void showDialog(Bundle state) {
super.showDialog(state);
// Nexus 7 needs the keyboard hiding explicitly.
// A flag on the activity in the manifest doesn't
// apply to the dialog, so needs to be in code:
Window window = getDialog().getWindow();
window.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_HIDDEN);
}
示例5: BottomDialog
import android.view.Window; //导入方法依赖的package包/类
public BottomDialog(@NonNull Context context, boolean isTranslucentStatus) {
super(context);
Window window = getWindow();
if (window != null) {
window.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE |
WindowManager.LayoutParams.SOFT_INPUT_STATE_HIDDEN);
if (isTranslucentStatus)
window.addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
}
}
示例6: onResume
import android.view.Window; //导入方法依赖的package包/类
@Override
public void onResume() {
super.onResume();
Window window = getActivity().getWindow();
window.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE);
}
示例7: setActivity
import android.view.Window; //导入方法依赖的package包/类
public void setActivity(Activity activity) {
super.setActivity(activity);
Window win = activity.getWindow();
if (activity.getResources().getConfiguration().orientation == 2) {
win.setSoftInputMode(35);
} else {
win.setSoftInputMode(37);
}
}
示例8: onViewCreated
import android.view.Window; //导入方法依赖的package包/类
@Override
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
Dialog dialog = getDialog();
if (dialog != null) {
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
Window window = dialog.getWindow();
if (window != null) {
window.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_HIDDEN);
window.setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
window.getAttributes().windowAnimations = R.style.DialogAnimation;
}
}
}
示例9: onActivityCreated
import android.view.Window; //导入方法依赖的package包/类
@Override
public void onActivityCreated(Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
final Dialog dialog = getDialog();
if (dialog != null) {
final Window window = dialog.getWindow();
if (window != null) {
window.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_VISIBLE);
}
}
}
示例10: temporarilyDisableDialogFocus
import android.view.Window; //导入方法依赖的package包/类
/**
* Apply a hack to temporarily set the window to not focusable, so that the navigation bar
* will not show up during the transition.
*/
private static void temporarilyDisableDialogFocus(final Window window) {
window.setFlags(WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE,
WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE);
// Add the SOFT_INPUT_IS_FORWARD_NAVIGATION_FLAG. This is normally done by the system when
// FLAG_NOT_FOCUSABLE is not set. Setting this flag allows IME to be shown automatically
// if the dialog has editable text fields.
window.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_IS_FORWARD_NAVIGATION);
new Handler().post(new Runnable() {
@Override
public void run() {
window.clearFlags(WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE);
}
});
}
示例11: requestInputMethod
import android.view.Window; //导入方法依赖的package包/类
/**
* Copied from DialogPreference.java
*/
private void requestInputMethod(Dialog dialog) {
Window window = dialog.getWindow();
if (window == null) return;
window.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE);
}
示例12: onCreate
import android.view.Window; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
if (mBubbleLayout == null)
{
mBubbleLayout = new BubbleLayout(getContext());
}
if (mAddView != null)
{
mBubbleLayout.addView(mAddView);
}
setContentView(mBubbleLayout);
final Window window = getWindow();
if (window == null) return;
if (mSoftShowUp)
{
window.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE | WindowManager.LayoutParams.SOFT_INPUT_STATE_HIDDEN);
}
window.setLayout(LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.WRAP_CONTENT);
onAutoPosition();
setLook();
// mBubbleLayout.post(new Runnable()
// {
// @Override
// public void run()
// {
// dialogPosition();
// }
// });
mOnGlobalLayoutListener = new ViewTreeObserver.OnGlobalLayoutListener()
{
int lastWidth, lastHeight;
@Override
public void onGlobalLayout()
{
if (lastWidth == mBubbleLayout.getWidth() && lastHeight == mBubbleLayout.getHeight()) return;
dialogPosition();
lastWidth = mBubbleLayout.getWidth();
lastHeight = mBubbleLayout.getHeight();
}
};
mBubbleLayout.getViewTreeObserver().addOnGlobalLayoutListener(mOnGlobalLayoutListener);
mBubbleLayout.setOnClickEdgeListener(new BubbleLayout.OnClickEdgeListener()
{
@Override
public void edge()
{
if (BubbleDialog.this.mCancelable)
{
dismiss();
}
}
});
}
示例13: setAdjustResize
import android.view.Window; //导入方法依赖的package包/类
public void setAdjustResize() {
Window window = ((Activity) getContext()).getWindow();
window.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE);
window.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE);
}
示例14: setAdjustNothing
import android.view.Window; //导入方法依赖的package包/类
public void setAdjustNothing() {
Window window = ((Activity) getContext()).getWindow();
window.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_NOTHING);
}