当前位置: 首页>>代码示例>>Java>>正文


Java Window.setSoftInputMode方法代码示例

本文整理汇总了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);
}
 
开发者ID:mengdd,项目名称:TodoRealm,代码行数:25,代码来源:AddListDialogFragment.java

示例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);
	}
}
 
开发者ID:liupengandroid,项目名称:ywApplication,代码行数:13,代码来源:EditPage.java

示例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);
    }
}
 
开发者ID:MCMrARM,项目名称:revolution-irc,代码行数:18,代码来源:SearchDialog.java

示例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);
}
 
开发者ID:salim3dd,项目名称:hsv-alpha-color-picker,代码行数:10,代码来源:ColorPreference.java

示例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);
    }
}
 
开发者ID:hsj-xiaokang,项目名称:OSchina_resources_android,代码行数:11,代码来源:BottomDialog.java

示例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);
}
 
开发者ID:StephanBezoen,项目名称:tumblrlikes,代码行数:8,代码来源:LoginFragment.java

示例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);
    }
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:10,代码来源:EditPage.java

示例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;
        }
    }
}
 
开发者ID:rudsonlive,项目名称:liveomvp,代码行数:15,代码来源:BaseDialog.java

示例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);
        }
    }
}
 
开发者ID:mozilla-mobile,项目名称:firefox-tv,代码行数:12,代码来源:AddToHomescreenDialogFragment.java

示例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);
        }
    });
}
 
开发者ID:Trumeet,项目名称:SetupWizardLibCompat,代码行数:19,代码来源:SystemBarHelper.java

示例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);
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:9,代码来源:MaterialEditTextPreference.java

示例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();
                }
            }
        });
    }
 
开发者ID:xujiaji,项目名称:HappyBubble,代码行数:63,代码来源:BubbleDialog.java

示例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);
}
 
开发者ID:hsj-xiaokang,项目名称:OSchina_resources_android,代码行数:6,代码来源:RichEditLayout.java

示例14: setAdjustNothing

import android.view.Window; //导入方法依赖的package包/类
public void setAdjustNothing() {
    Window window = ((Activity) getContext()).getWindow();
    window.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_NOTHING);
}
 
开发者ID:hsj-xiaokang,项目名称:OSchina_resources_android,代码行数:5,代码来源:RichEditLayout.java


注:本文中的android.view.Window.setSoftInputMode方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。