forked from android-cn/android-open-project-demo
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of https://github.com/android-cn/android-open-p…
- Loading branch information
Showing
448 changed files
with
7,464 additions
and
692 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
31 changes: 0 additions & 31 deletions
31
...src/main/java/com/grumoon/androidultrapulltorefreshdemo/ui/ContentScrollViewFragment.java
This file was deleted.
Oops, something went wrong.
31 changes: 0 additions & 31 deletions
31
.../app/src/main/java/com/grumoon/androidultrapulltorefreshdemo/ui/CustomHeaderFragment.java
This file was deleted.
Oops, something went wrong.
31 changes: 0 additions & 31 deletions
31
...p/src/main/java/com/grumoon/androidultrapulltorefreshdemo/ui/GetMoreListViewFragment.java
This file was deleted.
Oops, something went wrong.
Binary file removed
BIN
-5.97 KB
android-Ultra-Pull-To-Refresh-demo/app/src/main/res/drawable-hdpi/ic_empty.png
Binary file not shown.
Binary file removed
BIN
-9.18 KB
android-Ultra-Pull-To-Refresh-demo/app/src/main/res/drawable-hdpi/ic_launcher.png
Binary file not shown.
Binary file removed
BIN
-5.11 KB
android-Ultra-Pull-To-Refresh-demo/app/src/main/res/drawable-mdpi/ic_launcher.png
Binary file not shown.
Binary file removed
BIN
-14 KB
android-Ultra-Pull-To-Refresh-demo/app/src/main/res/drawable-xhdpi/ic_launcher.png
Binary file not shown.
Binary file removed
BIN
-18.9 KB
...oid-Ultra-Pull-To-Refresh-demo/app/src/main/res/drawable-xxhdpi/ic_launcher.png
Binary file not shown.
11 changes: 0 additions & 11 deletions
11
android-Ultra-Pull-To-Refresh-demo/app/src/main/res/layout/fragment_content_scroll_view.xml
This file was deleted.
Oops, something went wrong.
13 changes: 0 additions & 13 deletions
13
android-Ultra-Pull-To-Refresh-demo/app/src/main/res/layout/grid_view_item.xml
This file was deleted.
Oops, something went wrong.
25 changes: 0 additions & 25 deletions
25
android-Ultra-Pull-To-Refresh-demo/app/src/main/res/values/strings.xml
This file was deleted.
Oops, something went wrong.
Binary file removed
BIN
-48.7 KB
android-Ultra-Pull-To-Refresh-demo/gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
UltraPTR Demo | ||
================================ | ||
###1.Demo Download | ||
[本地下载](./apk/UltraPTR-demo.apk?raw=true) | ||
|
||
###2.Screenshot | ||
####包含内容 | ||
![TextView](image/content_text_view.gif)![ImageView](image/content_image_view.gif)![ScrollView](image/content_scroll_view.gif)![ListView](image/content_list_view.gif)![GridView](image/content_grid_view.gif)![WebView](image/content_web_view.gif)![RecyclerView](image/content_recycler_view.gif) | ||
####刷新类型 | ||
![ReleaseToRefresh](image/release_to_refresh.gif)![PullToRefresh](image/pull_to_refresh.gif)![AutoRefresh](image/auto_refresh.gif) | ||
####头部 | ||
![StoreHouseHeader](image/store_house_header.gif)![MaterialHeader](image/material_header.gif)![CustomHeader](image/custom_header.gif) | ||
####自定义加载更多 | ||
![GetMoreListView](image/get_more_list_view.gif) |
File renamed without changes.
Binary file not shown.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
112 changes: 112 additions & 0 deletions
112
.../app/src/main/java/com/grumoon/androidultrapulltorefreshdemo/header/WindmillDrawable.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,112 @@ | ||
package com.grumoon.androidultrapulltorefreshdemo.header; | ||
|
||
|
||
import android.content.Context; | ||
import android.content.res.Resources; | ||
import android.graphics.Bitmap; | ||
import android.graphics.BitmapFactory; | ||
import android.graphics.Canvas; | ||
import android.graphics.ColorFilter; | ||
import android.graphics.Matrix; | ||
import android.graphics.Paint; | ||
|
||
import android.graphics.drawable.Animatable; | ||
import android.graphics.drawable.Drawable; | ||
import android.view.View; | ||
import android.view.animation.Animation; | ||
import android.view.animation.LinearInterpolator; | ||
import android.view.animation.RotateAnimation; | ||
|
||
import com.grumoon.androidultrapulltorefreshdemo.R; | ||
|
||
|
||
/** | ||
* Created by grumoon on 2015/1/20. | ||
*/ | ||
public class WindmillDrawable extends Drawable implements Animatable { | ||
|
||
private static final String TAG = WindmillDrawable.class.getSimpleName(); | ||
|
||
private Resources resources; | ||
|
||
private Bitmap windmill; | ||
|
||
private Matrix matrix; | ||
|
||
private View parent; | ||
|
||
|
||
private Animation animation; | ||
|
||
private boolean isFirstDraw = true; | ||
|
||
private boolean isAnimating; | ||
|
||
public WindmillDrawable(Context context, View parent) { | ||
resources = context.getResources(); | ||
windmill = BitmapFactory.decodeResource(resources, R.drawable.windmill); | ||
|
||
matrix = new Matrix(); | ||
|
||
this.parent = parent; | ||
|
||
|
||
animation = new RotateAnimation(360, 0, RotateAnimation.RELATIVE_TO_SELF, 0.5f, RotateAnimation.RELATIVE_TO_SELF, 0.5f); | ||
animation.setInterpolator(new LinearInterpolator()); | ||
animation.setDuration(800); | ||
animation.setRepeatMode(Animation.RESTART); | ||
animation.setRepeatCount(Animation.INFINITE); | ||
animation.setFillAfter(true); | ||
|
||
} | ||
|
||
|
||
@Override | ||
public void draw(Canvas canvas) { | ||
if (isFirstDraw) { | ||
isFirstDraw = false; | ||
matrix.setTranslate((getBounds().width() - windmill.getWidth()) / 2, (getBounds().height() - windmill.getHeight()) / 2); | ||
} | ||
|
||
Paint p = new Paint(); | ||
canvas.drawBitmap(windmill, matrix, p); | ||
} | ||
|
||
@Override | ||
public void setAlpha(int alpha) { | ||
|
||
} | ||
|
||
@Override | ||
public void setColorFilter(ColorFilter cf) { | ||
|
||
} | ||
|
||
@Override | ||
public int getOpacity() { | ||
return 0; | ||
} | ||
|
||
public void postRotation(int degree) { | ||
|
||
matrix.postRotate(degree, getBounds().exactCenterX(), getBounds().exactCenterY()); | ||
invalidateSelf(); | ||
} | ||
|
||
@Override | ||
public void start() { | ||
parent.startAnimation(animation); | ||
isAnimating = true; | ||
} | ||
|
||
@Override | ||
public void stop() { | ||
parent.clearAnimation(); | ||
isAnimating = false; | ||
} | ||
|
||
@Override | ||
public boolean isRunning() { | ||
return isAnimating; | ||
} | ||
} |
Oops, something went wrong.