Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix some bug #49

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions library/src/main/java/com/cjj/MaterialHeaderView.java
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,9 @@ public void onRefreshing(MaterialRefreshLayout materialRefreshLayout) {
materialWaveView.onRefreshing(materialRefreshLayout);
}
if (circleProgressBar != null) {
ViewCompat.setScaleX(circleProgressBar, 1f);
ViewCompat.setScaleY(circleProgressBar, 1f);
ViewCompat.setAlpha(circleProgressBar, 1f);
circleProgressBar.onRefreshing(materialRefreshLayout);
}
}
Expand Down
27 changes: 18 additions & 9 deletions library/src/main/java/com/cjj/MaterialRefreshLayout.java
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
package com.cjj;

import android.animation.ObjectAnimator;
import android.animation.ValueAnimator;
import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Color;
import android.os.Build;
import android.support.v4.view.ViewCompat;
import android.support.v4.view.ViewPropertyAnimatorCompat;
import android.support.v4.view.ViewPropertyAnimatorUpdateListener;
import android.util.AttributeSet;
import android.util.Log;
import android.view.Gravity;
Expand Down Expand Up @@ -414,14 +415,15 @@ public void setIsOverLay(boolean isOverLay) {
// }

public void createAnimatorTranslationY(final View v, final float h, final FrameLayout fl) {
ViewPropertyAnimatorCompat viewPropertyAnimatorCompat = ViewCompat.animate(v);
viewPropertyAnimatorCompat.setDuration(250);
viewPropertyAnimatorCompat.setInterpolator(new DecelerateInterpolator());
viewPropertyAnimatorCompat.translationY(h);
viewPropertyAnimatorCompat.start();
viewPropertyAnimatorCompat.setUpdateListener(new ViewPropertyAnimatorUpdateListener() {
//use ObjectAnimator instead of ViewPropertyAnimatorCompat
//because Prior to API 19, ViewPropertyAnimatorUpdateListener will do nothing
ObjectAnimator animator = ObjectAnimator.ofFloat(v, "translationY", h);
animator.setDuration(250);
animator.setInterpolator(new DecelerateInterpolator());
animator.start();
animator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
@Override
public void onAnimationUpdate(View view) {
public void onAnimationUpdate(ValueAnimator animation) {
float height = ViewCompat.getTranslationY(v);
fl.getLayoutParams().height = (int) height;
fl.requestLayout();
Expand Down Expand Up @@ -549,5 +551,12 @@ public void setHeaderHeight(float headHeight) {
public void setMaterialRefreshListener(MaterialRefreshListener refreshListener) {
this.refreshListener = refreshListener;
}


public boolean getIsRefreshing() {
return isRefreshing;
}

public boolean getIsLoadMoreing() {
return isLoadMoreing;
}
}