<commit_before>package com.ez.gallery.utils;

import android.app.Activity;
import android.os.Build;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;

import java.lang.reflect.Field;
import java.lang.reflect.Method;

/**
 * com.liuliangduoduo.util.personal
 * TODO : ${todo}
 * Designed by ezhuwx on 2017/1/26.8:51
 *
 * @E-malil : <EMAIL>
 * Update on 2017/1/26.8:51 by ezhuwx
 *  @version V2.0 
 */

public class WindowsFitUtils {

    public static void setWindowsFitColor(Activity activity) {
        Window window = activity.getWindow();
        if (OSUtils.isMIUI()) {
            MIUISetStatusBarLightMode(window, true);
            return;
        }else if (OSUtils.isFlyme()){
            FlymeSetStatusBarLightMode(window, true);
            return;
        }
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
            window.getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR);
        }
    }

    /**
     * 设置状态栏图标为深色和魅族特定的文字风格，Flyme4.0以上
     * 可以用来判断是否为Flyme用户
     *
     * @param window 需要设置的窗口
     * @param dark   是否把状态栏字体及图标颜色设置为深色
     * @return boolean 成功执行返回true
     */
    private static boolean FlymeSetStatusBarLightMode(Window window, boolean dark) {
        boolean result = false;
        if (window != null) {
            try {
                WindowManager.LayoutParams lp = window.getAttributes();<commit_msg>适配状态栏修复<commit_after>package com.ez.gallery.utils;

import android.app.Activity;
import android.os.Build;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;

import java.lang.reflect.Field;
import java.lang.reflect.Method;

/**
 * com.liuliangduoduo.util.personal
 * TODO : ${todo}
 * Designed by ezhuwx on 2017/1/26.8:51
 *
 * @E-malil : <EMAIL>
 * Update on 2017/1/26.8:51 by ezhuwx
 *  @version V2.0 
 */

public class WindowsFitUtils {

    public static void setWindowsFitColor(Activity activity) {
        Window window = activity.getWindow();
        if (OSUtils.isMIUI()) {
            MIUISetStatusBarLightMode(window, true);
            return;
        } else if (OSUtils.isFlyme()) {
            FlymeSetStatusBarLightMode(window, true);
            return;
        }
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
            window.getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR);
        }
    }

    /**
     * 设置状态栏图标为深色和魅族特定的文字风格，Flyme4.0以上
     * 可以用来判断是否为Flyme用户
     *
     * @param window 需要设置的窗口
     * @param dark   是否把状态栏字体及图标颜色设置为深色
     * @return boolean 成功执行返回true
     */
    private static boolean FlymeSetStatusBarLightMode(Window window, boolean dark) {
        boolean result = false;
        if (window != null) {
            try {
                WindowManager.LayoutParams lp = window.getAttributes();
{'fraction_non_alphanumeric': 0.10500695410292073, 'fraction_numerical': 0.016689847009735744, 'mean_word_length': 2.6790281329923276, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5526548', 'n_tokens_mistral': 1050, 'n_tokens_neox': 1043, 'n_words': 174}