<commit_before>package net.solutinno.websearch;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.support.v4.view.GravityCompat;
import android.support.v4.widget.DrawerLayout;
import android.support.v7.app.ActionBarActivity;
import android.util.DisplayMetrics;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;

import net.solutinno.util.SoftKeyboardHelper;
import net.solutinno.websearch.data.SearchEngine;
import net.solutinno.websearch.data.SearchEngineCursor;

import java.util.UUID;

public class MainActivity extends ActionBarActivity {

    int mActiveFragment = 0;

    Menu mMainMenu;
    DrawerLayout mDrawerLayout;
    boolean mHasDrawerLayout;

    ListFragment mListFragment;
    DetailFragment mDetailFragment;

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

        mListFragment = (ListFragment) getSupportFragmentManager().findFragmentById(R.id.fragment_list);
        mListFragment.RegisterSelectItemListener(mSelectItemListener);

        mDetailFragment = (DetailFragment) getSupportFragmentManager().findFragmentById(R.id.fragment_detail);

        mDrawerLayout = (DrawerLayout) findViewById(R.id.main_drawer_layout);
        mHasDrawerLayout = mDrawerLayout != null;

        if (mHasDrawerLayout) {
            mDrawerLayout.setDrawerLockMode(DrawerLayout.LOCK_MODE_LOCKED_CLOSED);
            mDrawerLayout.setDrawerListener(mDrawerListener);
            mListFragment.RegisterSelectItemListener(mDetailFragment);
            mDetailFragment.SetDetailController(mDetailController);

            DisplayMetrics metrics = new DisplayMetrics();
            getWindowManager().getDefaultDisplay().getMetrics(metrics);
            final View detail = mDrawerLayout.getChildAt(1);
            if (detail != null) {
                ViewGroup.LayoutParams layoutParams = detail.getLayoutParams();
                if (layoutParams != null) {
                    layoutParams.width = (metrics.widthPixels / 3) * 2;
                    detail.setLayoutParams(layoutParams);
                }
            }
        }
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {<commit_msg>Small fixes<commit_after>package net.solutinno.websearch;

import android.app.Activity;
import android.content.Intent;
import android.content.res.Configuration;
import android.os.Bundle;
import android.support.v4.view.GravityCompat;
import android.support.v4.widget.DrawerLayout;
import android.support.v7.app.ActionBarActivity;
import android.util.DisplayMetrics;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;

import net.solutinno.util.SoftKeyboardHelper;
import net.solutinno.websearch.data.SearchEngine;
import net.solutinno.websearch.data.SearchEngineCursor;

import java.util.UUID;

public class MainActivity extends ActionBarActivity {

    int mActiveFragment = 0;

    Menu mMainMenu;
    DrawerLayout mDrawerLayout;
    boolean mHasDrawerLayout;

    ListFragment mListFragment;
    DetailFragment mDetailFragment;

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

        mListFragment = (ListFragment) getSupportFragmentManager().findFragmentById(R.id.fragment_list);
        mListFragment.RegisterSelectItemListener(mSelectItemListener);

        mDetailFragment = (DetailFragment) getSupportFragmentManager().findFragmentById(R.id.fragment_detail);

        mDrawerLayout = (DrawerLayout) findViewById(R.id.main_drawer_layout);
        mHasDrawerLayout = mDrawerLayout != null;

        if (mHasDrawerLayout) {
            mDrawerLayout.setDrawerLockMode(DrawerLayout.LOCK_MODE_LOCKED_CLOSED);
            mDrawerLayout.setDrawerListener(mDrawerListener);
            mListFragment.RegisterSelectItemListener(mDetailFragment);
            mDetailFragment.SetDetailController(mDetailController);

            DisplayMetrics metrics = getResources().getDisplayMetrics();
            int orientation = getResources().getConfiguration().orientation;
            final View detail = mDrawerLayout.getChildAt(1);
            if (detail != null && orientation == Configuration.ORIENTATION_LANDSCAPE) {
                ViewGroup.LayoutParams layoutParams = detail.getLayoutParams();
                if (layoutParams != null) {
                    layoutParams.width = (metrics.widthPixels / 3) * 2;
                    detail.setLayoutParams(layoutParams);
                }
            }
        }
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
{'fraction_non_alphanumeric': 0.08345473465140478, 'fraction_numerical': 0.0029136316337148803, 'mean_word_length': 3.538243626062323, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '3632980', 'n_tokens_mistral': 1318, 'n_tokens_neox': 1272, 'n_words': 214}