GeezerVison is showing github.com — 完成compile 'com.scwang.smartrefresh:SmartRefreshLayout:1.0.0-alpha-1' · StandOpen/SmartRefreshLayout@7f437c2
File treeExpand file treeCollapse file tree Open diff view settings refresh-header/src/main/java/com/scwang/smartrefresh/header refresh-layout/src/main/java/com/scwang/smartrefresh/layout
Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: refresh-header/src/main/java/com/scwang/smartrefresh/header/CircleHeader.java +4-6Lines changed: 4 additions & 6 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -239,12 +239,13 @@ private void drawFinish(Canvas canvas, int viewWidth) { | 239 | 239 |
| 240 | 240 | //</editor-fold> | 241 | 241 |
| 242 | | - //<editor-fold desc="SizeObserver"> | | 242 | + //<editor-fold desc="RefreshHeader"> | | 243 | + | 243 | 244 | @Override | 244 | 245 | public void onSizeDefined(RefreshKernel kernel, int height, int extendHeight) { | 245 | 246 | kernel.registHeaderHook(new RefreshLayoutHeaderHooker() { | 246 | 247 | @Override | 247 | | - public void onHookFinishRefresh(SuperMethod method, RefreshLayout layout) { | | 248 | + public void onHookFinishRefresh(SuperMethod supper, RefreshLayout layout) { | 248 | 249 | mShowOuter = false; | 249 | 250 | mShowBoll = false; | 250 | 251 | ValueAnimator animator = ValueAnimator.ofFloat(0, 1); | @@ -257,16 +258,13 @@ public void onHookFinishRefresh(SuperMethod method, RefreshLayout layout) { | 257 | 258 | animator.addListener(new AnimatorListenerAdapter() { | 258 | 259 | @Override | 259 | 260 | public void onAnimationEnd(Animator animation) { | 260 | | - method.invoke(0); | | 261 | + supper.invoke(0); | 261 | 262 | } | 262 | 263 | }); | 263 | 264 | animator.start(); | 264 | 265 | } | 265 | 266 | }); | 266 | 267 | } | 267 | | - //</editor-fold> | 268 | | - | 269 | | - //<editor-fold desc="RefreshHeader"> | 270 | 268 |
| 271 | 269 | @Override | 272 | 270 | public void onPullingDown(float percent, int offset, int headHeight, int extendHeight) { | |
Collapse file Copy file name to clipboardExpand all lines: refresh-header/src/main/java/com/scwang/smartrefresh/header/CircleRefreshHeader.java +2-2Lines changed: 2 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -520,9 +520,9 @@ public void onSizeDefined(RefreshKernel kernel, int height, int extendHeight) { | 520 | 520 | PULL_DELTA = height / 2; | 521 | 521 | kernel.registHeaderHook(new RefreshLayoutHeaderHooker() { | 522 | 522 | @Override | 523 | | - public void onHookFinishRefresh(SuperMethod method, RefreshLayout layout) { | | 523 | + public void onHookFinishRefresh(SuperMethod supper, RefreshLayout layout) { | 524 | 524 | setRefreshing(false); | 525 | | - setOnViewAniDone(method::invoke); | | 525 | + setOnViewAniDone(supper::invoke); | 526 | 526 | } | 527 | 527 | }); | 528 | 528 | } | |
Collapse file Copy file name to clipboardExpand all lines: refresh-header/src/main/java/com/scwang/smartrefresh/header/FlyRefreshHeader.java +2-2Lines changed: 2 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -158,11 +158,11 @@ public void onSizeDefined(RefreshKernel kernel, int height, int extendHeight) { | 158 | 158 | mRefreshLayout = kernel.getRefreshLayout(); | 159 | 159 | mRefreshKernel.registHeaderHook(new RefreshLayoutHeaderHooker() { | 160 | 160 | @Override | 161 | | - public void onHookFinishRefresh(SuperMethod method, RefreshLayout layout) { | | 161 | + public void onHookFinishRefresh(SuperMethod supper, RefreshLayout layout) { | 162 | 162 | if (mIsRefreshing) { | 163 | 163 | finishRefresh(null); | 164 | 164 | } else { | 165 | | - method.invoke(); | | 165 | + supper.invoke(); | 166 | 166 | } | 167 | 167 | } | 168 | 168 | }); | |
Collapse file Copy file name to clipboardExpand all lines: refresh-header/src/main/java/com/scwang/smartrefresh/header/FunGameBattleCityHeader.java -7Lines changed: 0 additions & 7 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 8 | 8 | import android.util.SparseArray; | 9 | 9 |
| 10 | 10 | import com.scwang.smartrefresh.header.fungame.FunGameView; | 11 | | -import com.scwang.smartrefresh.layout.api.RefreshKernel; | 12 | 11 |
| 13 | 12 | import java.util.LinkedList; | 14 | 13 | import java.util.Queue; | @@ -391,10 +390,4 @@ private int apperanceOption() { | 391 | 390 | return random.nextInt(TANK_ROW_NUM); | 392 | 391 | } | 393 | 392 |
| 394 | | - //<editor-fold desc="Description"> | 395 | | - @Override | 396 | | - public void onSizeDefined(RefreshKernel kernel, int height, int extendHeight) { | 397 | | - super.onSizeDefined(kernel, height, extendHeight); | 398 | | - } | 399 | | - //</editor-fold> | 400 | 393 | } |
Collapse file Copy file name to clipboardExpand all lines: refresh-header/src/main/java/com/scwang/smartrefresh/header/FunGameHitBlockHeader.java +2-11Lines changed: 2 additions & 11 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 10 | 10 | import android.util.AttributeSet; | 11 | 11 |
| 12 | 12 | import com.scwang.smartrefresh.header.fungame.FunGameView; | 13 | | -import com.scwang.smartrefresh.layout.api.RefreshKernel; | 14 | 13 | import com.scwang.smartrefresh.layout.util.DensityUtil; | 15 | 14 |
| 16 | 15 | import java.util.ArrayList; | @@ -133,7 +132,7 @@ protected void drawGame(Canvas canvas, int width, int height) { | 133 | 132 | if (status == STATUS_GAME_PLAY | 134 | 133 | || status == STATUS_GAME_FINISHED | 135 | 134 | || isInEditMode()) { | 136 | | - makeBallPath(canvas, width, height); | | 135 | + makeBallPath(canvas, width); | 137 | 136 | } | 138 | 137 | } | 139 | 138 |
| @@ -168,9 +167,8 @@ private void drawRacket(Canvas canvas) { | 168 | 167 | * 绘制并处理小球运动的轨迹 | 169 | 168 | * @param canvas 默认画布 | 170 | 169 | * @param width | 171 | | - * @param height | 172 | 170 | */ | 173 | | - private void makeBallPath(Canvas canvas, int width, int height) { | | 171 | + private void makeBallPath(Canvas canvas, int width) { | 174 | 172 | mPaint.setColor(mModelColor); | 175 | 173 |
| 176 | 174 | if (cx <= blockLeft + blockHorizontalNum * blockWidth + (blockHorizontalNum - 1) * DIVIDING_LINE_SIZE + BALL_RADIUS) { // 小球进入到色块区域 | @@ -284,11 +282,4 @@ private void drawColorBlock(Canvas canvas) { | 284 | 282 | canvas.drawRect(left, top, left + blockWidth, top + blockHeight, blockPaint); | 285 | 283 | } | 286 | 284 | } | 287 | | - | 288 | | - //<editor-fold desc="Description"> | 289 | | - @Override | 290 | | - public void onSizeDefined(RefreshKernel kernel, int height, int extendHeight) { | 291 | | - super.onSizeDefined(kernel, height, extendHeight); | 292 | | - } | 293 | | - //</editor-fold> | 294 | 285 | } |
Collapse file Copy file name to clipboardExpand all lines: refresh-header/src/main/java/com/scwang/smartrefresh/header/MaterialHeader.java +7-4Lines changed: 7 additions & 4 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -283,10 +283,6 @@ public void setPrimaryColors(int... colors) { | 283 | 283 | //mProgress.setColorSchemeColors(colors); | 284 | 284 | } | 285 | 285 |
| 286 | | - public void setColorSchemeColors(int... colors) { | 287 | | - mProgress.setColorSchemeColors(colors); | 288 | | - } | 289 | | - | 290 | 286 | @NonNull | 291 | 287 | @Override | 292 | 288 | public View getView() { | @@ -299,4 +295,11 @@ public SpinnerStyle getSpinnerStyle() { | 299 | 295 | } | 300 | 296 | //</editor-fold> | 301 | 297 |
| | 298 | + | | 299 | + //<editor-fold desc="API"> | | 300 | + public MaterialHeader setColorSchemeColors(int... colors) { | | 301 | + mProgress.setColorSchemeColors(colors); | | 302 | + return this; | | 303 | + } | | 304 | + //</editor-fold> | 302 | 305 | } |
Collapse file Copy file name to clipboardExpand all lines: refresh-header/src/main/java/com/scwang/smartrefresh/header/PhoenixHeader.java +8-1Lines changed: 8 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
| 29 | 29 |
| 30 | 30 | public class PhoenixHeader extends View implements RefreshHeader/*, SizeDefinition*/ { | 31 | 31 |
| | 32 | + //<editor-fold desc="static"> | 32 | 33 | private static final int ANIMATION_DURATION = 1000; | 33 | 34 | private static final float SUN_INITIAL_ROTATE_GROWTH = 1.2f; | 34 | 35 | private static final Interpolator LINEAR_INTERPOLATOR = new LinearInterpolator(); | @@ -92,6 +93,7 @@ public class PhoenixHeader extends View implements RefreshHeader/*, SizeDefiniti | 92 | 93 | "m109.1,226.62c-0.79,-0.95 -1.06,-6.89 -0.87,-19.14 0.24,-15.65 0.48,-17.89 2.02,-18.86 1.28,-0.8 2.22,-0.8 3.5,0 1.54,0.97 1.78,3.22 2.02,18.86C116.06,225.82 115.66,228 112,228c-0.97,0 -2.27,-0.62 -2.9,-1.38zM56.2,211.8c-0.66,-0.66 -1.2,-1.75 -1.2,-2.42 0,-0.67 3.91,-8 8.68,-16.3C71.62,179.3 72.61,178 75.16,178c5.4,0 4.68,3.34 -3.95,18.26 -4.35,7.52 -8.48,14.36 -9.18,15.2C60.5,213.3 57.85,213.45 56.2,211.8ZM165.97,211.47c-0.7,-0.84 -4.83,-7.68 -9.18,-15.2C148.16,181.34 147.43,178 152.84,178c2.56,0 3.55,1.3 11.48,15.08 4.78,8.3 8.68,15.63 8.68,16.3 0,3.33 -4.81,4.76 -7.03,2.08zM16.2,171.8c-1.65,-1.65 -1.5,-4.3 0.33,-5.83 0.84,-0.7 7.68,-4.83 15.2,-9.18C46.66,148.16 50,147.43 50,152.84c0,2.56 -1.3,3.55 -15.08,11.48C26.62,169.09 19.29,173 18.62,173 17.95,173 16.86,172.46 16.2,171.8ZM192.75,164.26C179.38,156.4 178,155.33 178,152.81c0,-5.44 3.35,-4.67 18.95,4.39 7.89,4.58 14.83,9.1 15.44,10.06 1.38,2.19 -0.25,5.15 -2.99,5.45 -1.04,0.12 -8.54,-3.69 -16.65,-8.46zM105.06,164.91C90.72,162.1 75.91,150.34 69.37,136.56 48.31,92.21 94.21,46.31 138.56,67.37c10.34,4.91 19.16,13.73 24.07,24.07 18.52,38.99 -15.04,81.81 -57.58,73.47zM125.2,156.89c12.02,-2.51 23.55,-11.32 29.53,-22.54 13.91,-26.1 -2.19,-58.49 -31.58,-63.53 -29.3,-5.02 -55.36,21.03 -50.33,50.33 4.23,24.68 27.93,40.85 52.38,35.74zM1.22,118.82C0.55,118.15 0,116.85 0,115.92c0,-3.57 2.26,-3.98 20.52,-3.7 15.65,0.24 17.89,0.48 18.86,2.02 0.8,1.28 0.8,2.22 -0,3.5 -0.97,1.54 -3.22,1.78 -19.02,2.02 -13.09,0.2 -18.25,-0.06 -19.14,-0.95zM189.22,118.82C188.55,118.15 188,116.85 188,115.92c0,-3.57 2.26,-3.98 20.52,-3.7 15.65,0.24 17.89,0.48 18.86,2.02 0.8,1.28 0.8,2.22 -0,3.5 -0.97,1.54 -3.22,1.78 -19.02,2.02 -13.09,0.2 -18.25,-0.06 -19.14,-0.95zM30.61,70.66c-7.64,-4.49 -14.39,-8.95 -14.99,-9.91 -1.28,-2.02 0.14,-5.06 2.59,-5.54 0.82,-0.16 8.31,3.63 16.64,8.43C48.51,71.51 50,72.63 50,75.08c0,2.57 -1.65,4.04 -4.33,3.84 -0.64,-0.05 -7.42,-3.76 -15.06,-8.25zM179.25,78.34C178.56,78.06 178,76.6 178,75.1c0,-2.48 1.44,-3.56 15.16,-11.46 8.34,-4.8 15.83,-8.59 16.64,-8.43 2.44,0.48 3.86,3.52 2.59,5.53 -1.22,1.93 -28.89,18.3 -30.73,18.18 -0.64,-0.04 -1.72,-0.31 -2.41,-0.58zM63.65,34.92C58.83,26.62 55.02,19.13 55.19,18.27c0.49,-2.51 3.51,-3.95 5.55,-2.66 0.96,0.6 5.48,7.55 10.06,15.44C79.85,46.65 80.63,50 75.19,50 72.66,50 71.62,48.63 63.65,34.92ZM149.46,47.69c-0.43,-1.71 1.57,-6.01 7.74,-16.65 4.58,-7.89 9.1,-14.83 10.06,-15.44 2.02,-1.27 5.05,0.15 5.53,2.59 0.16,0.82 -3.63,8.31 -8.43,16.64C156.39,48.7 155.39,50 152.84,50c-2.09,0 -2.95,-0.59 -3.38,-2.31zM109.1,38.62c-0.79,-0.95 -1.06,-6.89 -0.87,-19.14 0.24,-15.65 0.48,-17.89 2.02,-18.86 1.28,-0.8 2.22,-0.8 3.5,0 1.54,0.97 1.78,3.22 2.02,18.86C116.06,37.82 115.66,40 112,40c-0.97,0 -2.27,-0.62 -2.9,-1.38z", | 93 | 94 | "M105.5,156.61C83.66,151.3 69.02,129.01 72.82,106.85 76.91,83 99.57,66.78 123.15,70.82c23.85,4.09 40.07,26.75 36.03,50.33 -4.31,25.12 -29.03,41.45 -53.68,35.46z" | 94 | 95 | }; | | 96 | + //</editor-fold> | 95 | 97 |
| 96 | 98 | private PathsDrawable mDrawableSun; | 97 | 99 | private PathsDrawable mDrawableSky; | @@ -104,6 +106,7 @@ public class PhoenixHeader extends View implements RefreshHeader/*, SizeDefiniti | 104 | 106 | private boolean isRefreshing; | 105 | 107 | private Animation mAnimation; | 106 | 108 |
| | 109 | + //<editor-fold desc="View"> | 107 | 110 | public PhoenixHeader(Context context) { | 108 | 111 | this(context,null); | 109 | 112 | } | @@ -180,7 +183,9 @@ private void setupPathsDrawable() { | 180 | 183 | mDrawableSun.parserColors(sunColors); | 181 | 184 | mDrawableSun.setBounds(0, 0, mSunSize, mSunSize); | 182 | 185 | } | | 186 | + //</editor-fold> | 183 | 187 |
| | 188 | + //<editor-fold desc="RefreshHeader"> | 184 | 189 | @Override | 185 | 190 | public void onSizeDefined(RefreshKernel layout, int height, int extendHeight) { | 186 | 191 |
| @@ -238,7 +243,7 @@ public View getView() { | 238 | 243 | public SpinnerStyle getSpinnerStyle() { | 239 | 244 | return SpinnerStyle.Scale; | 240 | 245 | } | 241 | | - | | 246 | + //</editor-fold> | 242 | 247 |
| 243 | 248 | // @Override | 244 | 249 | // public int defineHeight() { | @@ -250,6 +255,7 @@ public SpinnerStyle getSpinnerStyle() { | 250 | 255 | // return (int) (defineHeight() * 0.3f); | 251 | 256 | // } | 252 | 257 |
| | 258 | + //<editor-fold desc="draw"> | 253 | 259 | @Override | 254 | 260 | public void onDraw(Canvas canvas) { | 255 | 261 | int width = getWidth(); | @@ -348,6 +354,7 @@ private void drawSun(Canvas canvas, int width, int height) { | 348 | 354 | mDrawableSun.draw(canvas); | 349 | 355 | canvas.restoreToCount(saveCount); | 350 | 356 | } | | 357 | + //</editor-fold> | 351 | 358 |
| 352 | 359 | } | 353 | 360 |
| |
|