<commit_before>package net.mabako.steamgifts.activities;

import android.graphics.Bitmap;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.util.Log;
import android.view.View;
import android.webkit.CookieManager;
import android.webkit.JavascriptInterface;
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.ProgressBar;

import net.mabako.steamgifts.R;
import net.mabako.steamgifts.web.WebUserData;

import org.jsoup.Jsoup;

public class LoginActivity extends AppCompatActivity {
    private static final String TAG = LoginActivity.class.getSimpleName();
    private static final String LOGIN_URL = "http://www.steamgifts.com/?login";
    private static final String REDIRECTED_URL = "http://www.steamgifts.com/";
    private static final String STEAM_OPENID_URL = "https://steamcommunity.com/openid/";

    private WebView webView;
    private ProgressBar progressBar;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_login);

        setSupportActionBar((Toolbar) findViewById(R.id.toolbar));
        progressBar = (ProgressBar) findViewById(R.id.progressBar);

        webView = (WebView) findViewById(R.id.webview);
        WebSettings webSettings = webView.getSettings();
        webSettings.setJavaScriptEnabled(true);
        webView.addJavascriptInterface(new JavaScriptContentHandler(), "contenthandler");

        webView.setWebViewClient(new LoginWebViewClient());
        webView.loadUrl(LOGIN_URL);
    }

    private class LoginWebViewClient extends WebViewClient {

        @Override
        public void onPageStarted(WebView view, String url, Bitmap favicon) {
            Log.d(TAG, "Page started: " + url);

            if (REDIRECTED_URL.equals(url)) {
                webView.setVisibility(View.GONE);
                progressBar.setVisibility(View.VISIBLE);
            }
<commit_msg>theme is now applied to LoginActivity as well<commit_after>package net.mabako.steamgifts.activities;

import android.content.SharedPreferences;
import android.graphics.Bitmap;
import android.os.Bundle;
import android.preference.PreferenceManager;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.util.Log;
import android.view.View;
import android.webkit.CookieManager;
import android.webkit.JavascriptInterface;
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.ProgressBar;

import net.mabako.steamgifts.R;
import net.mabako.steamgifts.web.WebUserData;

import org.jsoup.Jsoup;

public class LoginActivity extends AppCompatActivity {
    private static final String TAG = LoginActivity.class.getSimpleName();
    private static final String LOGIN_URL = "http://www.steamgifts.com/?login";
    private static final String REDIRECTED_URL = "http://www.steamgifts.com/";
    private static final String STEAM_OPENID_URL = "https://steamcommunity.com/openid/";

    private WebView webView;
    private ProgressBar progressBar;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);
        boolean nightMode = prefs.getBoolean("preference_theme_nightmode", false);
        setTheme(nightMode ? R.style.AppTheme_Dark : R.style.AppTheme_Light);

        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_login);

        setSupportActionBar((Toolbar) findViewById(R.id.toolbar));
        progressBar = (ProgressBar) findViewById(R.id.progressBar);

        webView = (WebView) findViewById(R.id.webview);
        WebSettings webSettings = webView.getSettings();
        webSettings.setJavaScriptEnabled(true);
        webView.addJavascriptInterface(new JavaScriptContentHandler(), "contenthandler");

        webView.setWebViewClient(new LoginWebViewClient());
        webView.loadUrl(LOGIN_URL);
    }

    private class LoginWebViewClient extends WebViewClient {

        @Override
        public void onPageStarted(WebView view, String url, Bitmap favicon) {
            Log.d(TAG, "Page started: " + url);

            if (REDIRECTED_URL.equals(url)) {
                webView.setVisibility(View.GONE);
                progressBar.setVisibility(View.VISIBLE);
            }

{'fraction_non_alphanumeric': 0.09454061251664447, 'fraction_numerical': 0.000887705281846427, 'mean_word_length': 3.9691289966923926, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 4, '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': '4154770', 'n_tokens_mistral': 1302, 'n_tokens_neox': 1248, 'n_words': 249}