// Path: common-android-utils/src/main/java/com/common/android/utils/ContextHelper.java
// @Nullable
// public static Activity getActivity() {
//     if (context == null)
//         return null;
// 
//     return context.get() instanceof Activity
//             ? (Activity) context.get()
//             : null;
// }
// 
// Path: common-android-utils/src/main/java/com/common/android/utils/ContextHelper.java
// @Nullable
// public static Context getContext() {
//     return context != null
//             ? context.get()
//             : null;
// }
// 
// Path: common-android-utils/src/main/java/com/common/android/utils/ContextHelper.java
// @Nullable
// public static FragmentActivity getFragmentActivity() {
//     if (context == null)
//         return null;
// 
//     return context.get() instanceof FragmentActivity
//             ? (FragmentActivity) context.get()
//             : null;
// }


import android.app.Activity;
import android.app.ActivityManager;
import android.app.Service;
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.provider.Settings;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v7.app.ActionBar;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
import static android.os.Build.VERSION.SDK_INT;
import static android.os.Build.VERSION_CODES.KITKAT;
import static com.common.android.utils.ContextHelper.getActivity;
import static com.common.android.utils.ContextHelper.getContext;
import static com.common.android.utils.ContextHelper.getFragmentActivity;

            window.getDecorView().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
                            | View.SYSTEM_UI_FLAG_FULLSCREEN
                            | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY);
        });
    }

    /**
     * This snippet hides the system bars.
     */
    public static void hideSystemUI() {
        // 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.
        getActivity().getWindow().getDecorView().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);
    }

    public static void onWindowFocusChanged(final boolean hasFocus) {
        if (hasFocus) {
            getActivity().getWindow().getDecorView().setSystemUiVisibility(
// Path: common-android-utils/src/main/java/com/common/android/utils/ContextHelper.java
// @Nullable
// public static Activity getActivity() {
//     if (context == null)
//         return null;
// 
//     return context.get() instanceof Activity
//             ? (Activity) context.get()
//             : null;
// }
// 
// Path: common-android-utils/src/main/java/com/common/android/utils/ContextHelper.java
// @Nullable
// public static Context getContext() {
//     return context != null
//             ? context.get()
//             : null;
// }
// 
// Path: common-android-utils/src/main/java/com/common/android/utils/ContextHelper.java
// @Nullable
// public static FragmentActivity getFragmentActivity() {
//     if (context == null)
//         return null;
// 
//     return context.get() instanceof FragmentActivity
//             ? (FragmentActivity) context.get()
//             : null;
// }


// Path: common-android-utils/src/main/java/com/common/android/utils/extensions/ActivityExtensions.java
import android.app.Activity;
import android.app.ActivityManager;
import android.app.Service;
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.provider.Settings;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v7.app.ActionBar;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
import static android.os.Build.VERSION.SDK_INT;
import static android.os.Build.VERSION_CODES.KITKAT;
import static com.common.android.utils.ContextHelper.getActivity;
import static com.common.android.utils.ContextHelper.getContext;
import static com.common.android.utils.ContextHelper.getFragmentActivity;


            window.getDecorView().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
                            | View.SYSTEM_UI_FLAG_FULLSCREEN
                            | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY);
        });
    }

    /**
     * This snippet hides the system bars.
     */
    public static void hideSystemUI() {
        // 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.
        getActivity().getWindow().getDecorView().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);
    }

    public static void onWindowFocusChanged(final boolean hasFocus) {
        if (hasFocus) {
            getActivity().getWindow().getDecorView().setSystemUiVisibility(
                    View.SYSTEM_UI_FLAG_LAYOUT_STABLE