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


Java Window.requestFeature方法代码示例

本文整理汇总了Java中android.view.Window.requestFeature方法的典型用法代码示例。如果您正苦于以下问题:Java Window.requestFeature方法的具体用法?Java Window.requestFeature怎么用?Java Window.requestFeature使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在android.view.Window的用法示例。


在下文中一共展示了Window.requestFeature方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: initDialog

import android.view.Window; //导入方法依赖的package包/类
private void initDialog() {
    contentLayout = new FrameLayout(activity);
    contentLayout.setLayoutParams(new ViewGroup.LayoutParams(WRAP_CONTENT, WRAP_CONTENT));
    contentLayout.setFocusable(true);
    contentLayout.setFocusableInTouchMode(true);
    //contentLayout.setFitsSystemWindows(true);
    dialog = new Dialog(activity);
    dialog.setCanceledOnTouchOutside(false);//触摸屏幕取消窗体
    dialog.setCancelable(false);//按返回键取消窗体
    dialog.setOnKeyListener(this);
    dialog.setOnDismissListener(this);
    Window window = dialog.getWindow();
    if (window != null) {
        window.setGravity(Gravity.BOTTOM);
        window.setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
        //AndroidRuntimeException: requestFeature() must be called before adding content
        window.requestFeature(Window.FEATURE_NO_TITLE);
        window.setContentView(contentLayout);
    }
    setSize(screenWidthPixels, WRAP_CONTENT);
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:22,代码来源:BaseDialog.java

示例2: init

import android.view.Window; //导入方法依赖的package包/类
private void init(Context context) {
    contentLayout = new FrameLayout(context);
    contentLayout.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT));
    contentLayout.setFocusable(true);
    contentLayout.setFocusableInTouchMode(true);
    dialog = new android.app.Dialog(context);
    dialog.setCanceledOnTouchOutside(true);//触摸屏幕取消窗体
    dialog.setCancelable(true);//按返回键取消窗体
    Window window = dialog.getWindow();
    window.setGravity(Gravity.BOTTOM);//位于屏幕底部
    window.setWindowAnimations(R.style.Animation_Popup);
    window.setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
    //android.util.AndroidRuntimeException: requestFeature() must be called before adding content
    window.requestFeature(Window.FEATURE_NO_TITLE);
    window.setContentView(contentLayout);
}
 
开发者ID:mainh,项目名称:MainCalendar,代码行数:17,代码来源:Popup.java

示例3: onCreateDialog

import android.view.Window; //导入方法依赖的package包/类
@NonNull
@Override
public Dialog onCreateDialog(Bundle savedInstanceState)
{
    // Idea from here
    // http://thanhcs.blogspot.ru/2014/10/android-custom-dialog-fragment.html

    Dialog dialog = new Dialog(mContext);

    Window window = dialog.getWindow();
    window.requestFeature(Window.FEATURE_NO_TITLE);
    window.setFlags(
            WindowManager.LayoutParams.FLAG_FULLSCREEN,
            WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN);
    window.setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));

    return dialog;
}
 
开发者ID:nextgis,项目名称:android_nextgis_mobile,代码行数:19,代码来源:StyledDialogFragment.java

示例4: onCreateView

import android.view.Window; //导入方法依赖的package包/类
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
    View v = inflater.inflate(R.layout.item_highlight, container);
    v.findViewById(R.id.page_part_number).setVisibility(View.GONE);
    v.findViewById(R.id.date_time).setVisibility(View.GONE);

    Dialog dialog = getDialog();
    Window window = dialog.getWindow();
    if (window != null) {
        window.setGravity(Gravity.BOTTOM);
        window.clearFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND);
        window.requestFeature(Window.FEATURE_NO_TITLE);
        getActivity().getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
    }
    return v;
}
 
开发者ID:fekracomputers,项目名称:IslamicLibraryAndroid,代码行数:18,代码来源:NotePopupFragment.java

示例5: initDialog

import android.view.Window; //导入方法依赖的package包/类
private void initDialog() {
    contentLayout = new FrameLayout(activity);
    contentLayout.setLayoutParams(new ViewGroup.LayoutParams(WRAP_CONTENT, WRAP_CONTENT));
    contentLayout.setFocusable(true);
    contentLayout.setFocusableInTouchMode(true);
    dialog = new Dialog(activity);
    dialog.setCanceledOnTouchOutside(true);//触摸屏幕取消窗体
    dialog.setCancelable(true);//按返回键取消窗体
    dialog.setOnKeyListener(this);
    dialog.setOnDismissListener(this);
    Window window = dialog.getWindow();
    if (window != null) {
        window.setGravity(Gravity.BOTTOM);
        window.setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
        //AndroidRuntimeException: requestFeature() must be called before adding content
        window.requestFeature(Window.FEATURE_NO_TITLE);
        window.setContentView(contentLayout);
    }
    setSize(screenWidthPixels, WRAP_CONTENT);
}
 
开发者ID:fengdongfei,项目名称:CXJPadProject,代码行数:21,代码来源:BasicPopup.java

示例6: onCreateView

import android.view.Window; //导入方法依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View view = inflater.inflate(R.layout.folderchooser_dialog, null);

    Window window = getDialog().getWindow();
    window.requestFeature(Window.FEATURE_NO_TITLE);

    // retrieve display dimensions
    Rect displayRectangle = new Rect();
    window.getDecorView().getWindowVisibleDisplayFrame(displayRectangle);

    int w = (int) (displayRectangle.width() * 0.95);
    int h = (int) (displayRectangle.height() * 0.9);
    window.setLayout(w, h);

    WindowManager.LayoutParams params = window.getAttributes();
    window.setAttributes(params);

    return view;
}
 
开发者ID:victordiaz,项目名称:phonk,代码行数:21,代码来源:FileManagerDialog.java

示例7: setSceneTransitionAnimation

import android.view.Window; //导入方法依赖的package包/类
public void setSceneTransitionAnimation() {
	if (Build.VERSION.SDK_INT < 21) return;
	Transition slide = new Slide(Gravity.RIGHT);
	slide.excludeTarget(android.R.id.statusBarBackground, true);
	slide.excludeTarget(android.R.id.navigationBarBackground, true);
	Window window = getWindow();
	window.requestFeature(Window.FEATURE_CONTENT_TRANSITIONS);
	window.setExitTransition(slide);
	window.setEnterTransition(slide);
	window.setTransitionBackgroundFadeDuration(getResources()
			.getInteger(android.R.integer.config_longAnimTime));
	window.setBackgroundDrawableResource(android.R.color.transparent);
}
 
开发者ID:rafjordao,项目名称:Nird2,代码行数:14,代码来源:BriarActivity.java

示例8: initPushInAnim

import android.view.Window; //导入方法依赖的package包/类
private void initPushInAnim() {

        Window window = getWindow();
        window.requestFeature(Window.FEATURE_CONTENT_TRANSITIONS);

        TransitionInflater inflater = TransitionInflater.from(mContext);
        Transition pushDownIn = inflater.inflateTransition(R.transition.explode_in);

        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
            window.setEnterTransition(pushDownIn); // 第一次进入时使用
            window.setReenterTransition(pushDownIn); // 再次进入时使用
            window.setExitTransition(pushDownIn);
        }

    }
 
开发者ID:ifadai,项目名称:SuperNote,代码行数:16,代码来源:LockActivity.java

示例9: onCreateView

import android.view.Window; //导入方法依赖的package包/类
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
    //设置无标题
    getDialog().requestWindowFeature(Window.FEATURE_NO_TITLE);
    //设置从底部弹出
    Window window = getDialog().getWindow();
    WindowManager.LayoutParams params = window.getAttributes();
    params.gravity = Gravity.BOTTOM | Gravity.CENTER_HORIZONTAL;
    window.requestFeature(Window.FEATURE_NO_TITLE);
    window.setAttributes(params);
    return null;
}
 
开发者ID:liying2008,项目名称:Simpler,代码行数:14,代码来源:BaseDialogFragment.java

示例10: onCreateView

import android.view.Window; //导入方法依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View view = inflater.inflate(R.layout.folderchooser_dialog, null);

    Window window = getDialog().getWindow();
    window.requestFeature(Window.FEATURE_NO_TITLE);
    //window.setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
    //window.setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
    //window.setGravity(Gravity.TOP | Gravity.LEFT);

    // retrieve display dimensions
    Rect displayRectangle = new Rect();
    window.getDecorView().getWindowVisibleDisplayFrame(displayRectangle);

    int w = (int) (displayRectangle.width() * 0.95);
    int h = (int) (displayRectangle.height() * 0.9);
    window.setLayout(w, h);

    // after that, setting values for x and y works "naturally"
    WindowManager.LayoutParams params = window.getAttributes();
    //params.x = 280;
    //params.y = 280;
    //params.height = 200;
    //params.dimAmount = 0f;


    window.setAttributes(params);


    return view;
}
 
开发者ID:victordiaz,项目名称:phonk,代码行数:32,代码来源:FolderChooserDialog.java

示例11: loadActivityStyle

import android.view.Window; //导入方法依赖的package包/类
/**
 * 基本样式
 */
protected void loadActivityStyle() {
    final Window window = getWindow();
    window.requestFeature(Window.FEATURE_NO_TITLE);
    final ActionBar supportActionBar = getSupportActionBar();
    if (supportActionBar != null) {
        supportActionBar.hide();
    }
}
 
开发者ID:angcyo,项目名称:RLibrary,代码行数:12,代码来源:StyleActivity.java

示例12: onCreate

import android.view.Window; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    Log.d(TAG, "onCreate");
    /** NO_TITLE  SCREEN_ON   FULLSCREEN */
    Window win = getWindow();
    win.addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
    win.setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
    win.requestFeature(Window.FEATURE_NO_TITLE);
    /**摄像头方向*/
    isOritationLanscape = getIntent().getBooleanExtra("oritation_landscape", false);
    if (isOritationLanscape) {
        setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
        setContentView(R.layout.activity_streaming_landscape);
    } else {
        setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
        setContentView(R.layout.activity_streaming_portrait);
    }
    /**推流视频宽度*/
    mVideoWidth = getIntent().getIntExtra("res_w", 1280);
    /**推流视频高度*/
    mVideoHeight = getIntent().getIntExtra("res_h", 720);
    /**视频帧率*/
    mFrameRate = getIntent().getIntExtra("frame_rate", 15);
    /**视频码率*/
    mBitrate = getIntent().getIntExtra("bitrate", 1024) * 1000;
    /**推流地址*/
    mStreamingUrl = getIntent().getStringExtra("push_url");

    initUIElements();

    /**摄像头为前置摄像头*/
    mCurrentCamera = LiveConfig.CAMERA_FACING_FRONT;
    /**是否开始散光灯*/
    isFlashOn = false;
    initUIEventHandler();
    /**推流状态的监听*/
    initStateListener();
    /**初始化推流会话*/
    initRTMPSession(mCameraView.getHolder());

    mDetector = new GestureDetectorCompat(this, this);
    mDetector.setOnDoubleTapListener(this);
}
 
开发者ID:LiuJunb,项目名称:Android-LSS,代码行数:45,代码来源:StreamingActivity.java


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