<commit_before>package com.ppamorim.library;

import android.content.Context;
import android.support.annotation.NonNull;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.view.View;
import android.widget.ListView;
import java.util.ArrayList;

public class PagerListView extends ListView {

  private Context mContext;
  private PagerAdapter mPagerAdapter;
  private View mRootView;
  private ParallaxListViewHelper helper;

  public PagerListView(Context context, AttributeSet attrs) {
    super(context, attrs);
    this.mContext = context;
    init(context, attrs);
  }

  public PagerListView(Context context, AttributeSet attrs, int defStyleAttr) {
    super(context, attrs, defStyleAttr);
    init(context, attrs);
  }

  protected void init(Context context, AttributeSet attrs) {
    helper = new ParallaxListViewHelper(context, attrs, this);
    super.setOnScrollListener(helper);
  }

  public void setAdapter(View rootView, ArrayList<ItemView> views) {
    mPagerAdapter = new PagerAdapter(mContext, views, listViewInterface);
    mPagerAdapter.setAdapterHeight(rootView.getHeight());
    setAdapter(mPagerAdapter);
  }

  public View getRooteView() {
    return mRootView;
  }

  public void setRootView(View mRootView) {
    this.mRootView = mRootView;
  }

  public void setIsCicular(boolean isCicular) {
    helper.setIsCircular(isCicular);
  }

  public void setAlphaFactor(float alphaFactor) {
    helper.setAlphaFactor(alphaFactor);
  }

  @Override public boolean dispatchTouchEvent(@NonNull MotionEvent ev){
    return ev.getAction()==MotionEvent.ACTION_MOVE || super.dispatchTouchEvent(ev);
  }

  @Override public void setOnScrollListener(OnScrollListener scrollListener) {
    helper.setOnScrollListener(scrollListener);
  }

  public void addParallaxedHeaderView(View v) {
    super.addHeaderView(v);
    helper.addParallaxedHeaderView(v);
  }

  public void addParallaxedHeaderView(View v, Object data, boolean isSelectable) {
    super.addHeaderView(v, data, isSelectable);
    helper.addParallaxedHeaderView(v, data, isSelectable);
  }

  private PagerAdapter.ListViewInterface listViewInterface = new PagerAdapter.ListViewInterface() {

    @Override public void addPosition() {
      smoothScrollToPosition(1);
    }

    @Override public void removePosition() {
      smoothScrollToPosition(0);
    }

  };

}<commit_msg>Some corrections on PagerListView class<commit_after>package com.ppamorim.library;

import android.content.Context;
import android.support.annotation.NonNull;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.view.View;
import android.widget.ListView;
import java.util.ArrayList;

public class PagerListView extends ListView {

  private Context mContext;
  private PagerAdapter mPagerAdapter;
  private View mRootView;
  private ParallaxListViewHelper helper;

  public PagerListView(Context context, AttributeSet attrs) {
    super(context, attrs);
    this.mContext = context;
    init(context, attrs);
  }

  public PagerListView(Context context, AttributeSet attrs, int defStyleAttr) {
    super(context, attrs, defStyleAttr);
    init(context, attrs);
  }

  protected void init(Context context, AttributeSet attrs) {
    helper = new ParallaxListViewHelper(context, attrs, this);
    super.setOnScrollListener(helper);
  }

  public void setAdapter(View rootView, ArrayList<ItemView> views) {
    mPagerAdapter = new PagerAdapter(mContext, views, listViewInterface);
    mPagerAdapter.setAdapterHeight(rootView.getHeight());
    setAdapter(mPagerAdapter);
  }

  public View getRooteView() {
    return mRootView;
  }

  public void setRootView(View mRootView) {
    this.mRootView = mRootView;
  }

  public void setIsCicular(boolean isCicular) {
    helper.setIsCircular(isCicular);
  }

  public void setAlphaFactor(float alphaFactor) {
    helper.setAlphaFactor(alphaFactor);
  }

  @Override public boolean dispatchTouchEvent(@NonNull MotionEvent ev){
    return ev.getAction()==MotionEvent.ACTION_MOVE || super.dispatchTouchEvent(ev);
  }

  @Override public void setOnScrollListener(OnScrollListener scrollListener) {
    helper.setOnScrollListener(scrollListener);
  }

  public void addParallaxedHeaderView(View v) {
    super.addHeaderView(v);
    helper.addParallaxedHeaderView(v);
  }

  public void addParallaxedHeaderView(View v, Object data, boolean isSelectable) {
    super.addHeaderView(v, data, isSelectable);
    helper.addParallaxedHeaderView(v, data, isSelectable);
  }

  private PagerAdapter.ListViewInterface listViewInterface = new PagerAdapter.ListViewInterface() {

    @Override public void addPosition() {
      smoothScrollToPosition(getLastVisiblePosition() + 1);
    }

    @Override public void removePosition() {
      smoothScrollToPosition(getFirstVisiblePosition() - 1);
    }

  };

}
{'fraction_non_alphanumeric': 0.08878794135866198, 'fraction_numerical': 0.0008259343382201115, 'mean_word_length': 4.836144578313253, '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': '533654', 'n_tokens_mistral': 1452, 'n_tokens_neox': 1413, 'n_words': 310}