<commit_before>package com.martin.kantidroid.ui.fachview;

import android.content.DialogInterface;
import android.content.Intent;
import android.os.Bundle;
import android.support.design.widget.CollapsingToolbarLayout;
import android.support.design.widget.FloatingActionButton;
import android.support.v7.app.ActionBar;
import android.support.v7.app.AlertDialog;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.Toolbar;
import android.view.MenuItem;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.martin.kantidroid.R;
import com.martin.kantidroid.logic.DatabaseHandler;
import com.martin.kantidroid.logic.Fach;
import com.martin.kantidroid.logic.Util;
import com.martin.kantidroid.ui.util.DividerItemDecoration;

import java.util.ArrayList;
import java.util.Arrays;

public class DetailActivity extends AppCompatActivity implements GradesAdapter.OnClickListener, KontAdapter.OnClickListener {

    private int mId, mSemester, mType;
    private Fach fach;
    private TextView mData;
    private RecyclerView mItems;
    private GradesAdapter mGradesAdapter;
    private KontAdapter mKontAdapter;

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

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

        final ActionBar ab = getSupportActionBar();
        ab.setDisplayHomeAsUpEnabled(true);

        Intent intent = getIntent();
        mId = intent.getIntExtra("id", -1);
        mSemester = intent.getIntExtra("semester", -1);
        mType = intent.getIntExtra("type", -1);
        fach = new DatabaseHandler(this).getFach(mId);

        CollapsingToolbarLayout ctl = (CollapsingToolbarLayout) findViewById(R.id.collapsing_toolbar);
        ctl.setTitle(fach.getName());
        ctl.setBackgroundColor(Util.getLight(this, fach.getColor()));

        mItems = (RecyclerView) findViewById(R.id.rvContents);
        LinearLayoutManager layoutManager = new LinearLayoutManager(this);
        layoutManager.setOrientation(LinearLayoutManager.VERTICAL);
        mItems.setLayoutManager(layoutManager);
        mItems.setHasFixedSize(true);
        mItems.addItemDecoration(new DividerItemDecoration(this, DividerItemDecoration.VERTICAL_LIST));

        mData = (TextView) findViewById(R.id.tvData);
        ((TextView) findViewById(R.id.tvSem)).setText(mSemester + getString(R.string.n_semester));
        ImageView backdrop = (ImageView) findViewById(R.id.backdrop);
        if (mType == 1) {<commit_msg>Setting subject colors to StatusBar and ContentScrim<commit_after>package com.martin.kantidroid.ui.fachview;

import android.content.DialogInterface;
import android.content.Intent;
import android.os.Build;
import android.os.Bundle;
import android.support.design.widget.CollapsingToolbarLayout;
import android.support.design.widget.FloatingActionButton;
import android.support.v7.app.ActionBar;
import android.support.v7.app.AlertDialog;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.Toolbar;
import android.view.MenuItem;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
import android.widget.ImageView;
import android.widget.TextView;

import com.martin.kantidroid.R;
import com.martin.kantidroid.logic.DatabaseHandler;
import com.martin.kantidroid.logic.Fach;
import com.martin.kantidroid.logic.Util;
import com.martin.kantidroid.ui.util.DividerItemDecoration;

import java.util.ArrayList;
import java.util.Arrays;

public class DetailActivity extends AppCompatActivity implements GradesAdapter.OnClickListener, KontAdapter.OnClickListener {

    private int mId, mSemester, mType;
    private Fach fach;
    private TextView mData;
    private RecyclerView mItems;
    private GradesAdapter mGradesAdapter;
    private KontAdapter mKontAdapter;

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

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

        final ActionBar ab = getSupportActionBar();
        ab.setDisplayHomeAsUpEnabled(true);

        Intent intent = getIntent();
        mId = intent.getIntExtra("id", -1);
        mSemester = intent.getIntExtra("semester", -1);
        mType = intent.getIntExtra("type", -1);
        fach = new DatabaseHandler(this).getFach(mId);

        CollapsingToolbarLayout ctl = (CollapsingToolbarLayout) findViewById(R.id.collapsing_toolbar);
        ctl.setTitle(fach.getName());
        ctl.setBackgroundColor(Util.getLight(this, fach.getColor()));
        ctl.setContentScrimColor(Util.getLight(this, fach.getColor()));

        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
            Window window = getWindow();
            window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
            window.setStatusBarColor(Util.getDark(this, fach.getColor()));
        }

        mItems = (RecyclerView) findViewById(R.id.rvContents);
        LinearLayoutManager layoutManager = new LinearLayoutManager(this);
        layoutManager.setOrientation(LinearLayoutManager.VERTICAL);
        mItems.setLayoutManager(layoutManager);
        mItems.setHasFixedSize(true);
        mItems.addItemDecoration(new DividerItemDecoration(this, DividerItemDecoration.VERTICAL_LIST));

        mData = (TextView) findViewById(R.id.tvData);
        ((TextView) findViewById(R.id.tvSem)).setText(mSemester + getString(R.string.n_semester));
        ImageView backdrop = (ImageView) findViewById(R.id.backdrop);
        if (mType == 1) {
{'fraction_non_alphanumeric': 0.1009950248756219, 'fraction_numerical': 0.003316749585406302, 'mean_word_length': 4.404121863799283, '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': '7322396', 'n_tokens_mistral': 1814, 'n_tokens_neox': 1744, 'n_words': 301}