├── .gitignore ├── .idea ├── .name ├── compiler.xml ├── copyright │ └── profiles_settings.xml ├── dictionaries │ └── gavinguo.xml ├── encodings.xml ├── gradle.xml ├── misc.xml ├── modules.xml ├── scopes │ └── scope_settings.xml └── vcs.xml ├── CustomAccelerateBall.iml ├── README.md ├── app ├── .gitignore ├── app.iml ├── build.gradle ├── proguard-rules.pro └── src │ ├── androidTest │ └── java │ │ └── com │ │ └── test │ │ └── gavinguo │ │ └── customaccelerateball │ │ └── ApplicationTest.java │ └── main │ ├── AndroidManifest.xml │ ├── java │ └── com │ │ └── test │ │ └── gavinguo │ │ └── customaccelerateball │ │ ├── AccelerateBallView.java │ │ └── CustomAccelerateBallActivity.java │ └── res │ ├── drawable-hdpi │ └── ic_launcher.png │ ├── drawable-mdpi │ └── ic_launcher.png │ ├── drawable-xhdpi │ ├── background.jpg │ ├── ic_launcher.png │ ├── lever.png │ └── taskmanager_water_top.png │ ├── drawable-xxhdpi │ └── ic_launcher.png │ ├── drawable │ └── task_killer_full_clip.xml │ ├── layout │ ├── custom_accelerate_ball_activity.xml │ └── custome_accelerate.xml │ ├── menu │ └── custom_accelerate_ball.xml │ ├── values-v21 │ └── styles.xml │ ├── values-w820dp │ └── dimens.xml │ └── values │ ├── accelerateball_attrs.xml │ ├── accelerateball_defaults.xml │ ├── dimens.xml │ ├── strings.xml │ └── styles.xml ├── build.gradle ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── pic.gif └── settings.gradle /.gitignore: -------------------------------------------------------------------------------- 1 | .gradle 2 | /local.properties 3 | /.idea/workspace.xml 4 | /.idea/libraries 5 | .DS_Store 6 | /build 7 | -------------------------------------------------------------------------------- /.idea/.name: -------------------------------------------------------------------------------- 1 | CustomAccelerateBall -------------------------------------------------------------------------------- /.idea/compiler.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /.idea/copyright/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /.idea/dictionaries/gavinguo.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /.idea/encodings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /.idea/gradle.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | Android 15 | 16 | 17 | Android Lint 18 | 19 | 20 | Java language level migration aids 21 | 22 | 23 | 24 | 25 | Abstraction issues 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | Android API 18 Platform 39 | 40 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | -------------------------------------------------------------------------------- /.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/scopes/scope_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /CustomAccelerateBall.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # CustomAccelerateBall 2 | accelerate ball,加速球效果,也就是圆形的ProgressBar的效果。 3 | 4 | ##效果图 5 | 录制效果不是很好 6 | > 7 | ![Screenshot](https://github.com/guoGavin/CustomAccelerateBall/blob/master/pic.gif) 8 | 9 | ##功能 10 | * 可以设置目标位置,让它自己加速到特定位置。 11 | * 可以设置不适用加速的动画效果,直接设置到特定位置。 12 | * 可以设置是否显示Percent。 13 | * 可以设置刷新速度,RefreshSpeed。 14 | * 可以设置加速动画涨幅,Speed。 15 | * 可以设置加速过程监听,每次变化监听回调,加速结束回调,AccelerateBallUpdateListener。 16 | 17 | ##layout 18 | ```xml 19 | 29 | ``` 30 | 31 | ##展示类型 32 | ```java 33 | public enum GalleryType{ 34 | NoneAnimationAndPercent,//没有动画和百分比文字 35 | NoneAnimationHavePercent,//没有动画但是有文本 36 | AnimationOnly,//只有动画 37 | AnimationAndPercent,//具有动画和百分比,default 38 | } 39 | ``` 40 | 41 | ##动画涨幅 42 | ```java 43 | public enum Speed{ 44 | slow,//低速 45 | medium,//中速,default 46 | fast,//高速 47 | superFast,//超高速 48 | random,//随机速度 49 | } 50 | ``` 51 | 52 | ##刷新速度 53 | ```java 54 | public enum RefreshSpeed{ 55 | slow,//低速 56 | medium,//中速,default 57 | fast,//高速 58 | superFast,//超高速 59 | } 60 | ``` 61 | 62 | ##过程监听 63 | ```java 64 | public interface AccelerateBallUpdateListener{ 65 | /** 66 | * 每次变化 67 | * @param currentPercent 当前百分比 68 | */ 69 | void updateLeveUp(int currentPercent); 70 | 71 | /** 72 | * 上涨结束调用 73 | * @param endPercent 结束时候的百分比 74 | */ 75 | void endLeveUp(int endPercent); 76 | } 77 | ``` 78 | ##设置参数以及启动 79 | ```java 80 | ball = (AccelerateBallView) findViewById(R.id.ball); 81 | ball.setSpeedType(AccelerateBallView.Speed.superFast); 82 | ball.setRefreshSpeedType(AccelerateBallView.RefreshSpeed.superFast); 83 | ball.setGalleryType(AccelerateBallView.GalleryType.AnimationAndPercent); 84 | ball.setAccelerateBallUpdateListener(new AccelerateBallView.AccelerateBallUpdateListener() { 85 | @Override 86 | public void updateLeveUp(int currentPercent) { 87 | //do nothing 88 | } 89 | 90 | @Override 91 | public void endLeveUp(int endPercent) { 92 | //do nothing 93 | } 94 | }); 95 | start.setOnClickListener(this); 96 | ball.setTotalLevel(totalLevel); 97 | ``` 98 | Total可以不停的去设置,加速球最终会停止在最后设置的位置。 99 | 100 | 101 | 102 | -------------------------------------------------------------------------------- /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /app/app.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 8 | 9 | 10 | 11 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | -------------------------------------------------------------------------------- /app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | android { 4 | compileSdkVersion 21 5 | buildToolsVersion "20.0.0" 6 | 7 | defaultConfig { 8 | applicationId "com.test.gavinguo.customaccelerateball" 9 | minSdkVersion 15 10 | targetSdkVersion 21 11 | versionCode 1 12 | versionName "1.0" 13 | } 14 | buildTypes { 15 | release { 16 | runProguard false 17 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 18 | } 19 | } 20 | } 21 | 22 | dependencies { 23 | compile fileTree(dir: 'libs', include: ['*.jar']) 24 | } 25 | -------------------------------------------------------------------------------- /app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in D:\developerTool\as\install\sdk/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | -------------------------------------------------------------------------------- /app/src/androidTest/java/com/test/gavinguo/customaccelerateball/ApplicationTest.java: -------------------------------------------------------------------------------- 1 | package com.test.gavinguo.customaccelerateball; 2 | 3 | import android.app.Application; 4 | import android.test.ApplicationTestCase; 5 | 6 | /** 7 | * Testing Fundamentals 8 | */ 9 | public class ApplicationTest extends ApplicationTestCase { 10 | public ApplicationTest() { 11 | super(Application.class); 12 | } 13 | } -------------------------------------------------------------------------------- /app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 10 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /app/src/main/java/com/test/gavinguo/customaccelerateball/AccelerateBallView.java: -------------------------------------------------------------------------------- 1 | package com.test.gavinguo.customaccelerateball; 2 | 3 | import android.content.Context; 4 | import android.content.res.Resources; 5 | import android.content.res.TypedArray; 6 | import android.graphics.drawable.ClipDrawable; 7 | import android.os.Handler; 8 | import android.util.AttributeSet; 9 | import android.util.Log; 10 | import android.view.LayoutInflater; 11 | import android.view.View; 12 | import android.widget.ImageView; 13 | import android.widget.RelativeLayout; 14 | import android.widget.TextView; 15 | 16 | /** 17 | * Created by gavinguo on 5/11/2015. 18 | */ 19 | public class AccelerateBallView extends RelativeLayout { 20 | 21 | /** 上下文 **/ 22 | private Context mContext; 23 | /** 加载的View **/ 24 | private View contentView; 25 | /** 加速球的透明遮罩层 **/ 26 | private ImageView maskView; 27 | /** 加速球的level **/ 28 | private ImageView levelView; 29 | /** 显示百分比的文字控件 **/ 30 | private TextView percentView; 31 | /** 目标水平 **/ 32 | private int totalLevel; 33 | /** 当前位置 **/ 34 | private int currentLevel; 35 | 36 | /** 最大水平不能超过10000 **/ 37 | private final int MAX_LEVEL = 10000; 38 | private final int slowLength = 5; 39 | private final int mediumLength = 10; 40 | private final int fastLength = 15; 41 | private final int superFastLength = 50; 42 | private final int slowRefresh = 15; 43 | private final int mediumRefresh = 10; 44 | private final int fastRefresh = 5; 45 | private final int superFastRefresh = 1; 46 | 47 | /** 变化速度 **/ 48 | private int levelUpSpeed = slowLength; 49 | /** 刷新速度 **/ 50 | private int refreshSpeed = fastRefresh; 51 | 52 | /** 控制上涨动画 **/ 53 | private Handler mHandler = null; 54 | private Runnable levelUpRunnable = null; 55 | 56 | /** 标记当前是否正在运行中,处理多次设置totalLevel问题 **/ 57 | private boolean isRuning = false; 58 | 59 | /** 变化监听接口 **/ 60 | private AccelerateBallUpdateListener accelerateBallUpdateListener; 61 | 62 | /** 标记展示类型,默认是具有动画的百分比文字 **/ 63 | private GalleryType galleryType = GalleryType.AnimationAndPercent; 64 | /** 65 | * 提供展示类型 66 | */ 67 | public enum GalleryType{ 68 | NoneAnimationAndPercent,//没有动画和百分比文字 69 | NoneAnimationHavePercent,//没有动画但是有文本 70 | AnimationOnly,//只有动画 71 | AnimationAndPercent,//具有动画和百分比,默认 72 | } 73 | 74 | /** 标记上涨速度类型 **/ 75 | private Speed speedType = Speed.medium; 76 | /** 77 | * 提供上涨速度 78 | */ 79 | public enum Speed{ 80 | slow,//低速 81 | medium,//中速 82 | fast,//高速 83 | superFast,//超高速 84 | random,//随机速度 85 | } 86 | 87 | /** 标记刷新类型 **/ 88 | private RefreshSpeed refreshSpeedType = RefreshSpeed.medium; 89 | /** 90 | * 刷新速度 91 | */ 92 | public enum RefreshSpeed{ 93 | slow,//低速 94 | medium,//中速 95 | fast,//高速 96 | superFast,//超高速 97 | } 98 | 99 | /** 100 | * 加速球变化监听 101 | */ 102 | public interface AccelerateBallUpdateListener{ 103 | /** 104 | * 每次变化 105 | * @param currentPercent 当前百分比 106 | */ 107 | void updateLeveUp(int currentPercent); 108 | 109 | /** 110 | * 上涨结束调用 111 | * @param endPercent 结束时候的百分比 112 | */ 113 | void endLeveUp(int endPercent); 114 | } 115 | 116 | /** 117 | * 构造方法 118 | * @param context 119 | * @param attrs 120 | */ 121 | public AccelerateBallView(Context context, AttributeSet attrs) { 122 | super(context, attrs); 123 | this.mContext = context; 124 | LayoutInflater inflater=(LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE); 125 | contentView = inflater.inflate(R.layout.custome_accelerate, this); 126 | 127 | Resources resources = context.getResources(); 128 | TypedArray arr = context.obtainStyledAttributes(attrs,R.styleable.accelerateBallView); 129 | int galleryTypeArr = arr.getInt(R.styleable.accelerateBallView_galleryType,resources.getInteger(R.integer.accelerateball_gallerytype_default)); 130 | galleryType = GalleryType.values()[galleryTypeArr]; 131 | int speedArr = arr.getInt(R.styleable.accelerateBallView_speed,resources.getInteger(R.integer.accelerateball_speed_default)); 132 | setSpeedType(Speed.values()[speedArr]); 133 | int refreshSpeedArr = arr.getInt(R.styleable.accelerateBallView_refreshSpeed,resources.getInteger(R.integer.accelerateball_refreshspeed_default)); 134 | setRefreshSpeedType(RefreshSpeed.values()[refreshSpeedArr]); 135 | currentLevel = arr.getInt(R.styleable.accelerateBallView_initLevel,resources.getInteger(R.integer.accelerateball_gallerytype_initlevel)); 136 | if(currentLevel > MAX_LEVEL){ 137 | throw new IllegalArgumentException("initLevel can't more than " + MAX_LEVEL); 138 | } 139 | arr.recycle(); 140 | 141 | initView(); 142 | } 143 | 144 | /** 145 | * 初始化控件 146 | */ 147 | private void initView(){ 148 | maskView = (ImageView) contentView.findViewById(R.id.image_mask); 149 | levelView = (ImageView) contentView.findViewById(R.id.image_level); 150 | percentView = (TextView) contentView.findViewById(R.id.percent); 151 | //是否需要显示 152 | if(galleryType == GalleryType.AnimationAndPercent){ 153 | int percentValue = (int)(currentLevel * 100 / MAX_LEVEL); 154 | percentView.setVisibility(View.VISIBLE); 155 | percentView.setText(percentValue+"%"); 156 | }else{ 157 | percentView.setVisibility(View.GONE); 158 | } 159 | ClipDrawable clip = (ClipDrawable) levelView.getDrawable(); 160 | clip.setLevel(currentLevel); 161 | percentView.setText("0%"); 162 | } 163 | 164 | /** 165 | * 设置目标位置 166 | * @param totalLevelParam 167 | */ 168 | public void setTotalLevel(int totalLevelParam) { 169 | if(totalLevelParam > MAX_LEVEL){ 170 | throw new IllegalArgumentException("totalLevel can't more than " + MAX_LEVEL); 171 | } 172 | this.totalLevel = totalLevelParam; 173 | if(galleryType == GalleryType.AnimationAndPercent || galleryType == GalleryType.AnimationOnly){ 174 | if(mHandler == null && levelUpRunnable == null){ 175 | mHandler = new Handler(); 176 | levelUpRunnable = new Runnable(){ 177 | 178 | @Override 179 | public void run() { 180 | 181 | //是否需要随机生成上涨速度 182 | if(speedType == Speed.random){ 183 | levelUpSpeed = (int)(Math.random()*fastLength); 184 | } 185 | 186 | currentLevel = currentLevel+levelUpSpeed; 187 | 188 | if(currentLevel > totalLevel){ 189 | currentLevel = totalLevel; 190 | } 191 | 192 | ClipDrawable clip = (ClipDrawable) levelView.getDrawable(); 193 | clip.setLevel(currentLevel); 194 | 195 | int percentValue = (int)(currentLevel * 100 / MAX_LEVEL); 196 | 197 | //调用接口返回变化监听 198 | if(accelerateBallUpdateListener != null){ 199 | accelerateBallUpdateListener.updateLeveUp(percentValue); 200 | } 201 | 202 | //是否需要显示 203 | if(galleryType == GalleryType.AnimationAndPercent){ 204 | percentView.setVisibility(View.VISIBLE); 205 | percentView.setText(percentValue+"%"); 206 | }else{ 207 | percentView.setVisibility(View.GONE); 208 | } 209 | 210 | //到达目标位置则暂停 211 | if(currentLevel != totalLevel){ 212 | //刷新频率为15ms每次 213 | mHandler.postDelayed(levelUpRunnable,refreshSpeed); 214 | }else{ 215 | isRuning = false; 216 | pauseLevelUp(); 217 | //调用接口返回结束监听 218 | if(accelerateBallUpdateListener != null){ 219 | accelerateBallUpdateListener.endLeveUp(percentValue); 220 | } 221 | } 222 | 223 | } 224 | }; 225 | } 226 | //不是false的话,说明正在运行,那么就不需要重新启动,修改了totalLevel就可以了。 227 | if(!isRuning){ 228 | isRuning = true; 229 | startLevelUp(); 230 | } 231 | }else{ 232 | ClipDrawable clip = (ClipDrawable) levelView.getDrawable(); 233 | clip.setLevel(totalLevel); 234 | if(galleryType == GalleryType.NoneAnimationHavePercent){ 235 | int percentValue = (int)(totalLevel * 100 / MAX_LEVEL); 236 | percentView.setText(percentValue+"%"); 237 | } 238 | } 239 | } 240 | 241 | public GalleryType getGalleryType() { 242 | return galleryType; 243 | } 244 | 245 | /** 246 | *暂停上涨 247 | */ 248 | public void pauseLevelUp(){ 249 | mHandler.removeCallbacks(levelUpRunnable); 250 | } 251 | 252 | /** 253 | * 开始上涨 254 | */ 255 | public void startLevelUp(){ 256 | mHandler.post(levelUpRunnable); 257 | } 258 | 259 | /** 260 | * 结束上涨,最好在不适用该控件的地方调用这个方法,对于暂时,请调用@pauseLevelUp(),否则,会出现异常 261 | */ 262 | public void stopLevelUp(){ 263 | mHandler.removeCallbacks(levelUpRunnable); 264 | mHandler = null; 265 | levelUpRunnable = null; 266 | } 267 | 268 | /** 269 | * 设置展示类型 270 | * @param galleryType 271 | */ 272 | public void setGalleryType(GalleryType galleryType) { 273 | this.galleryType = galleryType; 274 | } 275 | 276 | public Speed getSpeedType() { 277 | return speedType; 278 | } 279 | 280 | /** 281 | * 设置展示速度 282 | */ 283 | public void setSpeedType(Speed speedType) { 284 | this.speedType = speedType; 285 | switch (speedType){ 286 | case slow: 287 | levelUpSpeed = slowLength; 288 | break; 289 | case medium: 290 | levelUpSpeed = mediumLength; 291 | break; 292 | case fast: 293 | levelUpSpeed = fastLength; 294 | break; 295 | case superFast: 296 | levelUpSpeed = superFastLength; 297 | break; 298 | case random: 299 | //该类型在每次上涨的时候具体生成 300 | break; 301 | } 302 | } 303 | 304 | public RefreshSpeed getRefreshSpeedType() { 305 | return refreshSpeedType; 306 | } 307 | 308 | /** 309 | * 设置刷新速度 310 | * @param refreshSpeedType 311 | */ 312 | public void setRefreshSpeedType(RefreshSpeed refreshSpeedType) { 313 | this.refreshSpeedType = refreshSpeedType; 314 | switch (refreshSpeedType){ 315 | case slow: 316 | refreshSpeed = slowRefresh; 317 | break; 318 | case medium: 319 | refreshSpeed = mediumRefresh; 320 | break; 321 | case fast: 322 | refreshSpeed = fastRefresh; 323 | break; 324 | case superFast: 325 | refreshSpeed = superFastRefresh; 326 | break; 327 | } 328 | } 329 | 330 | public int getTotalLevel() { 331 | return totalLevel; 332 | } 333 | 334 | public AccelerateBallUpdateListener getAccelerateBallUpdateListener() { 335 | return accelerateBallUpdateListener; 336 | } 337 | 338 | public void setAccelerateBallUpdateListener(AccelerateBallUpdateListener accelerateBallUpdateListener) { 339 | this.accelerateBallUpdateListener = accelerateBallUpdateListener; 340 | } 341 | 342 | } 343 | -------------------------------------------------------------------------------- /app/src/main/java/com/test/gavinguo/customaccelerateball/CustomAccelerateBallActivity.java: -------------------------------------------------------------------------------- 1 | package com.test.gavinguo.customaccelerateball; 2 | 3 | import android.app.Activity; 4 | import android.os.Bundle; 5 | import android.util.Log; 6 | import android.view.View; 7 | import android.widget.Button; 8 | import android.widget.EditText; 9 | 10 | /** 11 | * Created by gavinguo on 5/6/2015. 12 | */ 13 | public class CustomAccelerateBallActivity extends Activity implements View.OnClickListener{ 14 | 15 | private EditText percent; 16 | private Button start; 17 | private AccelerateBallView ball; 18 | 19 | @Override 20 | protected void onCreate(Bundle savedInstanceState) { 21 | super.onCreate(savedInstanceState); 22 | setContentView(R.layout.custom_accelerate_ball_activity); 23 | percent = (EditText) findViewById(R.id.percent_content); 24 | start = (Button) findViewById(R.id.start); 25 | ball = (AccelerateBallView) findViewById(R.id.ball); 26 | // ball.setSpeedType(AccelerateBallView.Speed.superFast); 27 | // ball.setRefreshSpeedType(AccelerateBallView.RefreshSpeed.superFast); 28 | // ball.setGalleryType(AccelerateBallView.GalleryType.AnimationAndPercent); 29 | ball.setAccelerateBallUpdateListener(new AccelerateBallView.AccelerateBallUpdateListener() { 30 | @Override 31 | public void updateLeveUp(int currentPercent) { 32 | //do nothing 33 | } 34 | 35 | @Override 36 | public void endLeveUp(int endPercent) { 37 | //do nothing 38 | } 39 | }); 40 | start.setOnClickListener(this); 41 | } 42 | 43 | @Override 44 | public void onClick(View v) { 45 | int totalLevel = Integer.parseInt(percent.getText().toString()); 46 | ball.setTotalLevel(totalLevel); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guoGavin/CustomAccelerateBall/e47cba714c74833f42e656f272cb781e36d2ecdc/app/src/main/res/drawable-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guoGavin/CustomAccelerateBall/e47cba714c74833f42e656f272cb781e36d2ecdc/app/src/main/res/drawable-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/background.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guoGavin/CustomAccelerateBall/e47cba714c74833f42e656f272cb781e36d2ecdc/app/src/main/res/drawable-xhdpi/background.jpg -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guoGavin/CustomAccelerateBall/e47cba714c74833f42e656f272cb781e36d2ecdc/app/src/main/res/drawable-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/lever.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guoGavin/CustomAccelerateBall/e47cba714c74833f42e656f272cb781e36d2ecdc/app/src/main/res/drawable-xhdpi/lever.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/taskmanager_water_top.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guoGavin/CustomAccelerateBall/e47cba714c74833f42e656f272cb781e36d2ecdc/app/src/main/res/drawable-xhdpi/taskmanager_water_top.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guoGavin/CustomAccelerateBall/e47cba714c74833f42e656f272cb781e36d2ecdc/app/src/main/res/drawable-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/task_killer_full_clip.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/layout/custom_accelerate_ball_activity.xml: -------------------------------------------------------------------------------- 1 | 7 | 8 | 12 | 13 |