<commit_before>package com.github.ayltai.newspaper.app;

import javax.inject.Inject;

import android.arch.lifecycle.LifecycleObserver;
import android.content.Context;
import android.os.Bundle;
import android.support.annotation.CallSuper;
import android.support.annotation.Nullable;
import android.support.v4.app.FrameMetricsAggregator;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.app.AppCompatDelegate;
import android.util.Log;
import android.util.SparseIntArray;
import android.view.MenuItem;
import android.view.MotionEvent;

import com.google.firebase.perf.FirebasePerformance;
import com.google.firebase.perf.metrics.Trace;

import com.akaita.java.rxjava2debug.RxJava2Debug;
import com.github.ayltai.newspaper.Constants;
import com.github.ayltai.newspaper.R;
import com.github.ayltai.newspaper.analytics.AppOpenEvent;
import com.github.ayltai.newspaper.analytics.Attribute;
import com.github.ayltai.newspaper.app.config.UserConfig;
import com.github.ayltai.newspaper.data.DataManager;
import com.github.ayltai.newspaper.media.FaceCenterFinder;
import com.github.ayltai.newspaper.util.ContextUtils;
import com.github.ayltai.newspaper.util.DevUtils;
import com.github.ayltai.newspaper.util.Irrelevant;
import com.github.ayltai.newspaper.util.RxUtils;
import com.github.ayltai.newspaper.view.RxFlow;
import com.github.piasy.biv.loader.ImageLoader;
import com.instabug.library.Instabug;
import com.instabug.library.InstabugColorTheme;
import com.instabug.library.InstabugCustomTextPlaceHolder;
import com.instabug.library.InstabugTrackingDelegate;

import io.github.inflationx.viewpump.ViewPumpContextWrapper;
import io.reactivex.Single;
import io.realm.Realm;

public final class MainActivity extends AppCompatActivity {
    static {
        AppCompatDelegate.setCompatVectorFromResourcesEnabled(true);
    }

    @Inject UserConfig userConfig;

    private RxFlow flow;
    private Realm  realm;

    //region Performance monitoring

    private Trace                  trace;
    private FrameMetricsAggregator aggregator;

    //endregion

    @CallSuper
    @Override
    protected void onCreate(@Nullable final Bundle savedInstanceState) {
        this.setContentView(R.layout.activity_main);

        ComponentFactory.init();
        this.getLifecycle().addObserver(ComponentFactory.getInstance());

        super.onCreate(savedInstanceState);

        ComponentFactory.getInstance()
            .getConfigComponent(this)
            .inject(this);

        this.setTheme(this.userConfig.getTheme() == Constants.THEME_LIGHT ? R.style.AppTheme_Light : R.style.AppTheme_Dark);
<commit_msg>Set status bar color according to app theme<commit_after>package com.github.ayltai.newspaper.app;

import javax.inject.Inject;

import android.arch.lifecycle.LifecycleObserver;
import android.content.Context;
import android.os.Build;
import android.os.Bundle;
import android.support.annotation.CallSuper;
import android.support.annotation.Nullable;
import android.support.v4.app.FrameMetricsAggregator;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.app.AppCompatDelegate;
import android.util.Log;
import android.util.SparseIntArray;
import android.view.MenuItem;
import android.view.MotionEvent;
import android.view.Window;
import android.view.WindowManager;

import com.google.firebase.perf.FirebasePerformance;
import com.google.firebase.perf.metrics.Trace;

import com.akaita.java.rxjava2debug.RxJava2Debug;
import com.github.ayltai.newspaper.Constants;
import com.github.ayltai.newspaper.R;
import com.github.ayltai.newspaper.analytics.AppOpenEvent;
import com.github.ayltai.newspaper.analytics.Attribute;
import com.github.ayltai.newspaper.app.config.UserConfig;
import com.github.ayltai.newspaper.data.DataManager;
import com.github.ayltai.newspaper.media.FaceCenterFinder;
import com.github.ayltai.newspaper.util.ContextUtils;
import com.github.ayltai.newspaper.util.DevUtils;
import com.github.ayltai.newspaper.util.Irrelevant;
import com.github.ayltai.newspaper.util.RxUtils;
import com.github.ayltai.newspaper.view.RxFlow;
import com.github.piasy.biv.loader.ImageLoader;
import com.instabug.library.Instabug;
import com.instabug.library.InstabugColorTheme;
import com.instabug.library.InstabugCustomTextPlaceHolder;
import com.instabug.library.InstabugTrackingDelegate;

import io.github.inflationx.viewpump.ViewPumpContextWrapper;
import io.reactivex.Single;
import io.realm.Realm;

public final class MainActivity extends AppCompatActivity {
    static {
        AppCompatDelegate.setCompatVectorFromResourcesEnabled(true);
    }

    @Inject UserConfig userConfig;

    private RxFlow flow;
    private Realm  realm;

    //region Performance monitoring

    private Trace                  trace;
    private FrameMetricsAggregator aggregator;

    //endregion

    @CallSuper
    @Override
    protected void onCreate(@Nullable final Bundle savedInstanceState) {
        this.setContentView(R.layout.activity_main);

        ComponentFactory.init();
        this.getLifecycle().addObserver(ComponentFactory.getInstance());

        super.onCreate(savedInstanceState);

        ComponentFactory.getInstance()
            .getConfigComponent(this)
            .inject(this);

        this.setTheme(this.userConfig.getTheme() == Constants.THEME_LIGHT ? R.style.AppTheme_Light : R.style.AppTheme_Dark);

        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
            final Window window = this.getWindow();
            window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
            window.setStatusBarColor(ContextUtils.getColor(this, R.attr.primaryColorDark));
        }

{'fraction_non_alphanumeric': 0.09505368773103327, 'fraction_numerical': 0.0017602534765006161, 'mean_word_length': 4.699097291875627, 'pattern_counts': {'":': 0, '<': 3, '<?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': '6203828', 'n_tokens_mistral': 1766, 'n_tokens_neox': 1743, 'n_words': 263}