<commit_before>package com.alexvasilkov.gestures.sample.activities;

import android.annotation.SuppressLint;
import android.app.Activity;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.v4.view.ViewPager;
import android.support.v7.widget.DefaultItemAnimator;
import android.support.v7.widget.GridLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.Toolbar;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.alexvasilkov.android.commons.state.InstanceState;
import com.alexvasilkov.android.commons.texts.SpannableBuilder;
import com.alexvasilkov.android.commons.utils.Views;
import com.alexvasilkov.events.Events;
import com.alexvasilkov.events.Events.Failure;
import com.alexvasilkov.events.Events.Result;
import com.alexvasilkov.gestures.animation.ViewPositionAnimator;
import com.alexvasilkov.gestures.sample.R;
import com.alexvasilkov.gestures.sample.adapters.EndlessRecyclerAdapter;
import com.alexvasilkov.gestures.sample.adapters.FlickrPhotoListAdapter;
import com.alexvasilkov.gestures.sample.adapters.FlickrPhotoPagerAdapter;
import com.alexvasilkov.gestures.sample.logic.FlickrApi;
import com.alexvasilkov.gestures.sample.utils.DecorUtils;
import com.alexvasilkov.gestures.sample.utils.GestureSettingsMenu;
import com.alexvasilkov.gestures.sample.views.DepthPageTransformer;
import com.alexvasilkov.gestures.transition.SimpleViewsTracker;
import com.alexvasilkov.gestures.transition.ViewsCoordinator;
import com.alexvasilkov.gestures.transition.ViewsTransitionAnimator;
import com.alexvasilkov.gestures.transition.ViewsTransitionBuilder;
import com.alexvasilkov.gestures.views.utils.RecyclePagerAdapter;
import com.googlecode.flickrjandroid.photos.Photo;

import java.util.List;

public class AdvancedDemoActivity extends BaseActivity implements
        ViewPositionAnimator.PositionUpdateListener,
        FlickrPhotoListAdapter.OnPhotoListener {

    private static final int PAGE_SIZE = 30;

    private ViewHolder mViews;
    private ViewsTransitionAnimator<Integer> mAnimator;
    private FlickrPhotoListAdapter mGridAdapter;
    private FlickrPhotoPagerAdapter mPagerAdapter;
    private ViewPager.OnPageChangeListener mPagerListener;
    private GestureSettingsMenu mSettingsMenu;

    @InstanceState
    private int mPagerPhotoPosition = -1;
    @InstanceState
    private int mGridPosition = -1;
    @InstanceState
    private int mGridPositionFromTop;
    @InstanceState
    private int mPhotoCount;

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

        setContentView(R.layout.activity_advanced_demo);
        mViews = new ViewHolder(this);

        setSupportActionBar(mViews.toolbar);
        getSupportActionBar().setDisplayHomeAsUpEnabled(true);

        initDecorMargins();
        initGrid();
        initPager();
        initAnimator();

        mSettingsMenu = new GestureSettingsMenu();
        mSettingsMenu.onRestoreInstanceState(savedInstanceState);

        if (mPagerPhotoPosition != -1) {
            // Photo was show in pager, we should switch to pager mode instantly
            onPositionUpdate(1f, false);
        }
    }
<commit_msg>Fixed settings for advanced demo<commit_after>package com.alexvasilkov.gestures.sample.activities;

import android.annotation.SuppressLint;
import android.app.Activity;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.v4.view.ViewPager;
import android.support.v7.widget.DefaultItemAnimator;
import android.support.v7.widget.GridLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.Toolbar;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.alexvasilkov.android.commons.state.InstanceState;
import com.alexvasilkov.android.commons.texts.SpannableBuilder;
import com.alexvasilkov.android.commons.utils.Views;
import com.alexvasilkov.events.Events;
import com.alexvasilkov.events.Events.Failure;
import com.alexvasilkov.events.Events.Result;
import com.alexvasilkov.gestures.animation.ViewPositionAnimator;
import com.alexvasilkov.gestures.sample.R;
import com.alexvasilkov.gestures.sample.adapters.EndlessRecyclerAdapter;
import com.alexvasilkov.gestures.sample.adapters.FlickrPhotoListAdapter;
import com.alexvasilkov.gestures.sample.adapters.FlickrPhotoPagerAdapter;
import com.alexvasilkov.gestures.sample.logic.FlickrApi;
import com.alexvasilkov.gestures.sample.utils.DecorUtils;
import com.alexvasilkov.gestures.sample.utils.GestureSettingsMenu;
import com.alexvasilkov.gestures.sample.views.DepthPageTransformer;
import com.alexvasilkov.gestures.transition.SimpleViewsTracker;
import com.alexvasilkov.gestures.transition.ViewsCoordinator;
import com.alexvasilkov.gestures.transition.ViewsTransitionAnimator;
import com.alexvasilkov.gestures.transition.ViewsTransitionBuilder;
import com.alexvasilkov.gestures.views.utils.RecyclePagerAdapter;
import com.googlecode.flickrjandroid.photos.Photo;

import java.util.List;

public class AdvancedDemoActivity extends BaseActivity implements
        ViewPositionAnimator.PositionUpdateListener,
        FlickrPhotoListAdapter.OnPhotoListener {

    private static final int PAGE_SIZE = 30;

    private ViewHolder mViews;
    private ViewsTransitionAnimator<Integer> mAnimator;
    private FlickrPhotoListAdapter mGridAdapter;
    private FlickrPhotoPagerAdapter mPagerAdapter;
    private ViewPager.OnPageChangeListener mPagerListener;
    private GestureSettingsMenu mSettingsMenu;

    @InstanceState
    private int mPagerPhotoPosition = -1;
    @InstanceState
    private int mGridPosition = -1;
    @InstanceState
    private int mGridPositionFromTop;
    @InstanceState
    private int mPhotoCount;

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

        setContentView(R.layout.activity_advanced_demo);
        mViews = new ViewHolder(this);

        mSettingsMenu = new GestureSettingsMenu();
        mSettingsMenu.onRestoreInstanceState(savedInstanceState);

        setSupportActionBar(mViews.toolbar);
        getSupportActionBar().setDisplayHomeAsUpEnabled(true);

        initDecorMargins();
        initGrid();
        initPager();
        initAnimator();

        if (mPagerPhotoPosition != -1) {
            // Photo was show in pager, we should switch to pager mode instantly
            onPositionUpdate(1f, false);
        }
    }

{'fraction_non_alphanumeric': 0.0799880614833607, 'fraction_numerical': 0.0032830920758095804, 'mean_word_length': 5.010762331838565, 'pattern_counts': {'":': 0, '<': 5, '<?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': '4828349', 'n_tokens_mistral': 2011, 'n_tokens_neox': 1892, 'n_words': 326}