<commit_before>package com.lukekorth.photo_paper;

import android.content.Intent;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.support.v4.view.ViewPager;
import android.support.v7.app.ActionBar;
import android.support.v7.app.AppCompatActivity;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.WindowManager;

import com.lukekorth.photo_paper.adapters.PhotoPagerAdapter;
import com.lukekorth.photo_paper.models.Photos;
import com.xgc1986.parallaxPagerTransformer.ParallaxPagerTransformer;

import io.realm.Realm;

public class ViewPhotoActivity extends AppCompatActivity implements ViewPager.OnPageChangeListener {

    public static final String PHOTO_POSITION_KEY = "com.lukekorth.photo_paper.ViewPhotoActivity.PHOTO_POSITION_KEY";

    private ActionBar mActionBar;
    private Realm mRealm;
    private int mCurrentPhoto;
    private PhotoPagerAdapter mAdapter;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
                WindowManager.LayoutParams.FLAG_FULLSCREEN);

        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
            getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN);
        }

        setContentView(R.layout.view_photo);

        mRealm = Realm.getDefaultInstance();

        mCurrentPhoto = getIntent().getIntExtra(PHOTO_POSITION_KEY, 0);

        ViewPager viewPager = (ViewPager) findViewById(R.id.view_pager);
        viewPager.setPageTransformer(false, new ParallaxPagerTransformer(R.id.photo));
        viewPager.setOnPageChangeListener(this);
        mAdapter = new PhotoPagerAdapter(this, mRealm, viewPager, Photos.getRecentlySeenPhotos(mRealm));
        viewPager.setAdapter(mAdapter);
        viewPager.setCurrentItem(mCurrentPhoto);<commit_msg>Increase offscreen page limit to improve photo paging<commit_after>package com.lukekorth.photo_paper;

import android.content.Intent;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.support.v4.view.ViewPager;
import android.support.v7.app.ActionBar;
import android.support.v7.app.AppCompatActivity;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.WindowManager;

import com.lukekorth.photo_paper.adapters.PhotoPagerAdapter;
import com.lukekorth.photo_paper.models.Photos;
import com.xgc1986.parallaxPagerTransformer.ParallaxPagerTransformer;

import io.realm.Realm;

public class ViewPhotoActivity extends AppCompatActivity implements ViewPager.OnPageChangeListener {

    public static final String PHOTO_POSITION_KEY = "com.lukekorth.photo_paper.ViewPhotoActivity.PHOTO_POSITION_KEY";

    private ActionBar mActionBar;
    private Realm mRealm;
    private int mCurrentPhoto;
    private PhotoPagerAdapter mAdapter;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
                WindowManager.LayoutParams.FLAG_FULLSCREEN);

        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
            getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN);
        }

        setContentView(R.layout.view_photo);

        mRealm = Realm.getDefaultInstance();

        mCurrentPhoto = getIntent().getIntExtra(PHOTO_POSITION_KEY, 0);

        ViewPager viewPager = (ViewPager) findViewById(R.id.view_pager);
        viewPager.setOffscreenPageLimit(4);
        viewPager.setPageTransformer(false, new ParallaxPagerTransformer(R.id.photo));
        viewPager.setOnPageChangeListener(this);
        mAdapter = new PhotoPagerAdapter(this, mRealm, viewPager, Photos.getRecentlySeenPhotos(mRealm));
        viewPager.setAdapter(mAdapter);
        viewPager.setCurrentItem(mCurrentPhoto);
{'fraction_non_alphanumeric': 0.0861812778603269, 'fraction_numerical': 0.004210004952947003, 'mean_word_length': 4.672752808988764, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '680869', 'n_tokens_mistral': 1262, 'n_tokens_neox': 1218, 'n_words': 189}