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


Java View.setSystemUiVisibility方法代码示例

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


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

示例1: enabledFullScreenMode

import android.view.View; //导入方法依赖的package包/类
private void enabledFullScreenMode() {
    getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
            WindowManager.LayoutParams.FLAG_FULLSCREEN);
    View decorView = getWindow().getDecorView();
    // Hide the status bar.
    int uiOptions = View.SYSTEM_UI_FLAG_FULLSCREEN;
    decorView.setSystemUiVisibility(uiOptions);
}
 
开发者ID:tranleduy2000,项目名称:javaide,代码行数:9,代码来源:FullScreenActivity.java

示例2: _setUiLayoutFullscreen

import android.view.View; //导入方法依赖的package包/类
/**
 * 设置UI沉浸式显示
 */
private void _setUiLayoutFullscreen() {
    if (Build.VERSION.SDK_INT >= 14) {
        // 获取关联 Activity 的 DecorView
        View decorView = mAttachActivity.getWindow().getDecorView();
        // 沉浸式使用这些Flag
        decorView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_STABLE |
                View.SYSTEM_UI_FLAG_FULLSCREEN |
                View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN |
                View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION |
                View.SYSTEM_UI_FLAG_HIDE_NAVIGATION |
                View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY
        );
        mAttachActivity.getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
    }
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:19,代码来源:IjkPlayerView.java

示例3: fullscreen

import android.view.View; //导入方法依赖的package包/类
private void fullscreen() {
    View decorView = getWindow().getDecorView();
    // Hide the status bar.
    int uiOptions = View.SYSTEM_UI_FLAG_FULLSCREEN;
    decorView.setSystemUiVisibility(uiOptions);
    // Remember that you should never show the action bar if the
    // status bar is hidden, so hide that too if necessary.
    //        ActionBar actionBar = getActionBar();
    //        actionBar.hide();
}
 
开发者ID:FreeSunny,项目名称:Amazing,代码行数:11,代码来源:ConstraintActivity.java

示例4: setFullScreen

import android.view.View; //导入方法依赖的package包/类
static void setFullScreen(Map message) {
    if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP ) { 
        return;
    }

    final Boolean value = (Boolean) message.get("value");
    final Activity activity = QtNative.activity();

    Runnable runnable = new Runnable () {
        public void run() {
            Window w = activity.getWindow(); // in Activity's onCreate() for instance
            View decorView = w.getDecorView();

            int config = decorView.getSystemUiVisibility();

            if (value) {
                config &= ~View.SYSTEM_UI_FLAG_FULLSCREEN;
            } else {
                config |= View.SYSTEM_UI_FLAG_FULLSCREEN | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY;
            }
            decorView.setSystemUiVisibility(config);
        }
    };

    activity.runOnUiThread(runnable);

}
 
开发者ID:benlau,项目名称:androidnative.pri,代码行数:28,代码来源:Util.java

示例5: setStatusBar

import android.view.View; //导入方法依赖的package包/类
/**
 * 设置状态栏颜色
 */
private void setStatusBar() {
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
        View decorView = getWindow().getDecorView();
        int option = View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_STABLE;
        decorView.setSystemUiVisibility(option);
        getWindow().setStatusBarColor(getResources().getColor(R.color.colorPrimary));
    }else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
        getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
    }
}
 
开发者ID:miguoer,项目名称:ApplicationCollention,代码行数:14,代码来源:TopbarActivity.java

示例6: setSystemUiVisible

import android.view.View; //导入方法依赖的package包/类
/** Toggle whether the system UI (status bar / system bar) is visible.
 *  This also toggles the action bar visibility.
 * @param show True to show the system UI, false to hide it.
 */
void setSystemUiVisible(boolean show) {
    mSystemUiVisible = show;

    Window window = getActivity().getWindow();
    WindowManager.LayoutParams winParams = window.getAttributes();
    View view = getView();
    ActionBar actionBar = getActivity().getActionBar();

    if (show) {
        // Show status bar (remove fullscreen flag)
        window.setFlags(0, WindowManager.LayoutParams.FLAG_FULLSCREEN);
        // Show system bar
        view.setSystemUiVisibility(View.STATUS_BAR_VISIBLE);
        // Show action bar
        actionBar.show();
    } else {
        // Add fullscreen flag (hide status bar)
        window.setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
            WindowManager.LayoutParams.FLAG_FULLSCREEN);
        // Hide system bar
        view.setSystemUiVisibility(View.STATUS_BAR_HIDDEN);
        // Hide action bar
        actionBar.hide();
    }
    window.setAttributes(winParams);
}
 
开发者ID:sdrausty,项目名称:buildAPKsSamples,代码行数:31,代码来源:ContentFragment.java

示例7: clearLightStatusBar

import android.view.View; //导入方法依赖的package包/类
public static void clearLightStatusBar(@NonNull View view) {
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
        int flags = view.getSystemUiVisibility();
        flags &= ~View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR;
        view.setSystemUiVisibility(flags);
    }
}
 
开发者ID:xxczaki,项目名称:music-player,代码行数:8,代码来源:ViewUtils.java

示例8: setLightStatusBar

import android.view.View; //导入方法依赖的package包/类
public static void setLightStatusBar(View view, Activity activity){
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {

        int flags = view.getSystemUiVisibility();
        flags |= View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR;
        view.setSystemUiVisibility(flags);
        activity.getWindow().setStatusBarColor(Color.WHITE);
    }
}
 
开发者ID:ahmadnurhidayat,项目名称:TravelJournal,代码行数:10,代码来源:BaseActivity.java

示例9: enableImmersiveMode

import android.view.View; //导入方法依赖的package包/类
public void enableImmersiveMode(final View decorViewOfActivity) {
    decorViewOfActivity.setSystemUiVisibility(getImmersiveUiVisibility());
    decorViewOfActivity.setOnSystemUiVisibilityChangeListener(new View.OnSystemUiVisibilityChangeListener() {
        @Override
        public void onSystemUiVisibilityChange(int visibility) {
            if ((visibility & View.SYSTEM_UI_FLAG_FULLSCREEN) == 0) {
                decorViewOfActivity.setSystemUiVisibility(getImmersiveUiVisibility());
            }
        }
    });
}
 
开发者ID:gsantner,项目名称:memetastic,代码行数:12,代码来源:ContextUtils.java

示例10: onCreate

import android.view.View; //导入方法依赖的package包/类
@Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        View decorView = getWindow().getDecorView();
// Hide the status bar.
        int uiOptions = View.SYSTEM_UI_FLAG_FULLSCREEN;
        decorView.setSystemUiVisibility(uiOptions);
// Remember that you should never show the action bar if the
// status bar is hidden, so hide that too if necessary.
        //android.app.ActionBar actionBar = getActionBar();
        // actionBar.hide();
        setContentView(R.layout.activity_ppt_web_view);

//        mVisible = true;
//        mControlsView = findViewById(R.id.fullscreen_content_controls);
//        mContentView = findViewById(R.id.fullscreen_content);
//
//
//        // Set up the user interaction to manually show or hide the system UI.
//        mContentView.setOnClickListener(new View.OnClickListener() {
//            @Override
//            public void onClick(View view) {
//                toggle();
//            }
//        });

        Intent intent=getIntent();
        String url=intent.getStringExtra("modulelink");
        url=url.replaceAll(" ","%20");
        webView = (WebView)findViewById(R.id.webView2);
        webView.getSettings().setJavaScriptEnabled(true);
        Uri uri = Uri.parse("https://www.example.com");
        //  webView.loadUrl("https://view.officeapps.live.com/op/view.aspx?src=http%3a%2f%2fvideo.ch9.ms%2fbuild%2f2011%2fslides%2fTOOL-532T_Sutter.pptx");
        // webView.loadUrl("https://view.officeapps.live.com/op/view.aspx?src=https://www.dropbox.com/s/2scazhwg7o5l2z3/SE1.pptx?dl=1");
        //   webView.loadUrl("https://view.officeapps.live.com/op/view.aspx?src=https://www.dropbox.com/s/n775vtevnwlqzlg/test.pptx?dl=1");


        webView.getSettings().setLoadsImagesAutomatically(true);
        webView.getSettings().setJavaScriptEnabled(true);
        webView.getSettings().setCacheMode(WebSettings.LOAD_NO_CACHE);
        webView.setWebViewClient(new WebViewClient());
        webView.setScrollBarStyle(View.SCROLLBARS_INSIDE_OVERLAY);
//        webView.loadUrl("https://view.officeapps.live.com/op/view.aspx?src=http%3a%2f%2fvideo.ch9.ms%2fbuild%2f2011%2fslides%2fTOOL-532T_Sutter.pptx");
        webView.loadUrl("https://view.officeapps.live.com/op/view.aspx?src="+url);


        // Upon interacting with UI controls, delay any scheduled hide()
        // operations to prevent the jarring behavior of controls going away
        // while interacting with the UI.
        // findViewById(R.id.dummy_button).setOnTouchListener(mDelayHideTouchListener);
    }
 
开发者ID:goutham-kalikrishna,项目名称:ShotsNewsApp,代码行数:52,代码来源:PptWebViewActivity.java

示例11: hideLandscapeSystemUI

import android.view.View; //导入方法依赖的package包/类
private void hideLandscapeSystemUI() {
    final View decorView = getActivity().getWindow().getDecorView();

    // Set the IMMERSIVE flag.
    // Set the content to appear under the system bars so that the content
    // doesn't resize when the system bars hide and show.
    decorView.setSystemUiVisibility(
            View.SYSTEM_UI_FLAG_LAYOUT_STABLE
                    | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
                    | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
                    | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION // hide nav bar
                    | View.SYSTEM_UI_FLAG_FULLSCREEN // hide status bar
                    | View.SYSTEM_UI_FLAG_IMMERSIVE);
}
 
开发者ID:SalmanTKhan,项目名称:MyAnimeViewer,代码行数:15,代码来源:OfflineVideoDetailsFragment.java

示例12: clearFlag

import android.view.View; //导入方法依赖的package包/类
public static void clearFlag(Activity activity, int flag){
    if (Build.VERSION.SDK_INT >= 19){
        View decorView = activity.getWindow().getDecorView();
        int option = decorView.getSystemUiVisibility() & (~flag);
        decorView.setSystemUiVisibility(option);
    }
}
 
开发者ID:newbiechen1024,项目名称:NovelReader,代码行数:8,代码来源:SystemBarUtils.java

示例13: hideStatusbar

import android.view.View; //导入方法依赖的package包/类
public static void hideStatusbar(Activity context) {
    if (Build.VERSION.SDK_INT < 16) {
        context.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
                WindowManager.LayoutParams.FLAG_FULLSCREEN);
    } else {
        View decorView = context.getWindow().getDecorView();
        int uiOptions = View.SYSTEM_UI_FLAG_FULLSCREEN;
        decorView.setSystemUiVisibility(uiOptions);
    }
}
 
开发者ID:akshay2211,项目名称:Ariana,代码行数:11,代码来源:Utils.java

示例14: hideStatusBar

import android.view.View; //导入方法依赖的package包/类
private void hideStatusBar() {
    // If the Android version is lower than Jellybean, use this call to hide
    // the status bar.
    if (Build.VERSION.SDK_INT < 16) {
        getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
                WindowManager.LayoutParams.FLAG_FULLSCREEN);
    }

    //Hide the Status Bar on Android 4.1 and Higher
    View decorView = getWindow().getDecorView();
    // Hide the status bar.
    int uiOptions = View.SYSTEM_UI_FLAG_FULLSCREEN;
    decorView.setSystemUiVisibility(uiOptions);
}
 
开发者ID:CommonsLab,项目名称:CommonsLab,代码行数:15,代码来源:SplashScreenActivity.java

示例15: showLandscapeSystemUI

import android.view.View; //导入方法依赖的package包/类
private void showLandscapeSystemUI() {
    final View decorView = getWindow().getDecorView();

    decorView.setSystemUiVisibility(
            View.SYSTEM_UI_FLAG_LAYOUT_STABLE
                    | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
                    | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN);

}
 
开发者ID:SalmanTKhan,项目名称:MyAnimeViewer,代码行数:10,代码来源:VideoPlayerActivity.java


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