Skip to content

Commit

Permalink
Code cleanup.
Browse files Browse the repository at this point in the history
  • Loading branch information
GIGAMOLE committed Jul 5, 2016
1 parent de2738a commit 026c72f
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -792,10 +792,13 @@ public void setModelIndex(int index) {
}

// Set model index from touch or programmatically
public void setModelIndex(int index, boolean force) {
public void setModelIndex(final int modelIndex, final boolean isForce) {
if (mAnimator.isRunning()) return;
if (mModels.isEmpty()) return;

int index = modelIndex;
boolean force = isForce;

// This check gives us opportunity to have an non selected model
if (mIndex == INVALID_INDEX) force = true;
// Detect if last is the same
Expand Down Expand Up @@ -1466,8 +1469,6 @@ private void updateTint() {

@Override
public void onPageScrolled(int position, float positionOffset, final int positionOffsetPixels) {
//Fix the wrong position problem for some devices
position = position + (int) positionOffset;
if (mOnPageChangeListener != null)
mOnPageChangeListener.onPageScrolled(position, positionOffset, positionOffsetPixels);

Expand Down

0 comments on commit 026c72f

Please # to comment.