Skip to content

Commit

Permalink
Add another SimplePullRefreshLayout constructor, make DecelerateInter…
Browse files Browse the repository at this point in the history
…polator as default interpolator
  • Loading branch information
baurine committed Feb 15, 2017
1 parent 4eaf9f3 commit 13aa9f2
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions SimplePullRefreshLayout/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ dependencies {
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:25.1.0'
compile 'com.github.baurine:multi-type-adapter:1.0.6'
compile 'com.android.support:appcompat-v7:25.1.1'
compile 'com.github.baurine:multi-type-adapter:1.0.7'
testCompile 'junit:junit:4.12'
compile project(':simplepullrefreshlayout')
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

public class ImageItem implements MultiTypeAdapter.IItem {
@Override
public int getType() {
public int getLayout() {
return R.layout.item_image;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
import android.view.View;
import android.view.ViewConfiguration;
import android.view.ViewGroup;
import android.view.animation.DecelerateInterpolator;
import android.view.animation.Interpolator;
import android.view.animation.OvershootInterpolator;
import android.widget.RelativeLayout;
import android.widget.Scroller;

Expand All @@ -27,10 +27,7 @@ public interface RefreshStateView {
}

/////////////////////////////////////////////
private Interpolator interpolator;

public void setInterpolator(Interpolator interpolator) {
this.interpolator = interpolator;
scroller = new Scroller(getContext(), interpolator);
}

Expand All @@ -47,12 +44,15 @@ public void setDragCoefficient(float dragCoefficient) {
private int touchSlop;
private Scroller scroller;

public SimplePullRefreshLayout(Context context) {
this(context, null);
}

public SimplePullRefreshLayout(Context context, AttributeSet attrs) {
super(context, attrs);
parseAttrs(context, attrs);
touchSlop = ViewConfiguration.get(context).getScaledTouchSlop();
// setInterpolator(new DecelerateInterpolator());
setInterpolator(new OvershootInterpolator());
setInterpolator(new DecelerateInterpolator());
}

private void parseAttrs(Context context, AttributeSet attrs) {
Expand Down

0 comments on commit 13aa9f2

Please sign in to comment.