<commit_before>package org.zmc.qutils;

import android.util.Log;
import android.graphics.Color;
import android.view.Window;

import android.view.WindowManager;
import android.view.WindowManager.LayoutParams;
import android.view.View;

import android.os.Build;

// qutils
import org.zmc.qutils.notification.CppCallbacks;
import org.zmc.qutils.QutilsActivity;
// Qt
import org.qtproject.qt5.android.bindings.QtActivity;

public class AndroidUtils extends QtActivity
{
    private static QutilsActivity m_MainContext;

    public AndroidUtils(QutilsActivity mainActivity)
    {
        m_MainContext = mainActivity;
    }

    public static void setStatusBarColor(String colorHexStr)
    {
        Window window = m_MainContext.getWindow();
        // clear FLAG_TRANSLUCENT_STATUS flag:
        window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
        // add FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS flag to the window
        window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
        // finally change the color
        window.setStatusBarColor(Color.parseColor(colorHexStr));
    }

    public static void setStatusBarVisible(boolean visible)
    {
        if (Build.VERSION.SDK_INT < 16) {<commit_msg>Check for valid SDK version<commit_after>package org.zmc.qutils;

import android.util.Log;
import android.graphics.Color;
import android.view.Window;

import android.view.WindowManager;
import android.view.WindowManager.LayoutParams;
import android.view.View;

import android.os.Build;

// qutils
import org.zmc.qutils.notification.CppCallbacks;
import org.zmc.qutils.QutilsActivity;
// Qt
import org.qtproject.qt5.android.bindings.QtActivity;

public class AndroidUtils extends QtActivity
{
    private static QutilsActivity m_MainContext;

    public AndroidUtils(QutilsActivity mainActivity)
    {
        m_MainContext = mainActivity;
    }

    public static void setStatusBarColor(String colorHexStr)
    {
        if (android.os.Build.VERSION.SDK_INT >= 21) {
            Window window = m_MainContext.getWindow();
            // clear FLAG_TRANSLUCENT_STATUS flag:
            window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
            // add FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS flag to the window
            window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
            // finally change the color
            window.setStatusBarColor(Color.parseColor(colorHexStr));
        }
    }

    public static void setStatusBarVisible(boolean visible)
    {
        if (Build.VERSION.SDK_INT < 16) {
{'fraction_non_alphanumeric': 0.0800615858352579, 'fraction_numerical': 0.003079291762894534, 'mean_word_length': 3.6493738819320214, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 4, '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': '7579263', 'n_tokens_mistral': 779, 'n_tokens_neox': 756, 'n_words': 147}