├── .gitignore ├── .idea ├── compiler.xml ├── copyright │ └── profiles_settings.xml ├── gradle.xml ├── kotlinc.xml ├── misc.xml ├── modules.xml ├── runConfigurations.xml └── vcs.xml ├── README.md ├── app ├── .gitignore ├── build.gradle ├── proguard-rules.pro └── src │ ├── androidTest │ └── java │ │ └── com │ │ └── stone │ │ └── goodjob │ │ └── ExampleInstrumentedTest.java │ ├── main │ ├── AndroidManifest.xml │ ├── java │ │ └── com │ │ │ └── stone │ │ │ └── goodjob │ │ │ ├── MainActivity.java │ │ │ └── view │ │ │ ├── GoodJobView.java │ │ │ └── GoodJobView2.java │ └── res │ │ ├── layout │ │ └── activity_main.xml │ │ ├── mipmap-hdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-mdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xhdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xxhdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xxxhdpi │ │ ├── ic_launcher.png │ │ ├── ic_launcher_round.png │ │ ├── ic_messages_like_selected.png │ │ ├── ic_messages_like_selected_shining.png │ │ └── ic_messages_like_unselected.png │ │ └── values │ │ ├── attrs.xml │ │ ├── colors.xml │ │ ├── strings.xml │ │ └── styles.xml │ └── test │ └── java │ └── com │ └── stone │ └── goodjob │ └── ExampleUnitTest.java ├── build.gradle ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── jpg └── demo.gif └── settings.gradle /.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/workspace.xml 5 | /.idea/libraries 6 | .DS_Store 7 | /build 8 | /captures 9 | .externalNativeBuild 10 | -------------------------------------------------------------------------------- /.idea/compiler.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /.idea/copyright/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /.idea/gradle.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 17 | 18 | -------------------------------------------------------------------------------- /.idea/kotlinc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | -------------------------------------------------------------------------------- /.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 19 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 46 | -------------------------------------------------------------------------------- /.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/runConfigurations.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 11 | 12 | -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # GoodJob 2 | HenCoder「仿写酷界面」- 即刻App 点赞效果 3 | 4 | ![Alt text](/jpg/demo.gif) 5 | 6 | 一开始,没看清楚文字动效,还以为是透明度渐变,实际上并木有。 7 | -------------------------------------------------------------------------------- /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | android { 4 | compileSdkVersion 25 5 | buildToolsVersion "25.0.3" 6 | defaultConfig { 7 | applicationId "com.stone.goodjob" 8 | minSdkVersion 18 9 | targetSdkVersion 25 10 | versionCode 1 11 | versionName "1.0" 12 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 13 | } 14 | buildTypes { 15 | release { 16 | minifyEnabled false 17 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 18 | } 19 | } 20 | } 21 | 22 | dependencies { 23 | compile fileTree(dir: 'libs', include: ['*.jar']) 24 | androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', { 25 | exclude group: 'com.android.support', module: 'support-annotations' 26 | }) 27 | compile 'com.android.support:appcompat-v7:25.3.1' 28 | testCompile 'junit:junit:4.12' 29 | } 30 | -------------------------------------------------------------------------------- /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 C:\Develop\Android\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 | 19 | # Uncomment this to preserve the line number information for 20 | # debugging stack traces. 21 | #-keepattributes SourceFile,LineNumberTable 22 | 23 | # If you keep the line number information, uncomment this to 24 | # hide the original source file name. 25 | #-renamesourcefileattribute SourceFile 26 | -------------------------------------------------------------------------------- /app/src/androidTest/java/com/stone/goodjob/ExampleInstrumentedTest.java: -------------------------------------------------------------------------------- 1 | package com.stone.goodjob; 2 | 3 | import android.content.Context; 4 | import android.support.test.InstrumentationRegistry; 5 | import android.support.test.runner.AndroidJUnit4; 6 | 7 | import org.junit.Test; 8 | import org.junit.runner.RunWith; 9 | 10 | import static org.junit.Assert.*; 11 | 12 | /** 13 | * Instrumentation test, which will execute on an Android device. 14 | * 15 | * @see Testing documentation 16 | */ 17 | @RunWith(AndroidJUnit4.class) 18 | public class ExampleInstrumentedTest { 19 | @Test 20 | public void useAppContext() throws Exception { 21 | // Context of the app under test. 22 | Context appContext = InstrumentationRegistry.getTargetContext(); 23 | 24 | assertEquals("com.stone.goodjob", appContext.getPackageName()); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /app/src/main/java/com/stone/goodjob/MainActivity.java: -------------------------------------------------------------------------------- 1 | package com.stone.goodjob; 2 | 3 | import android.support.v7.app.AppCompatActivity; 4 | import android.os.Bundle; 5 | 6 | public class MainActivity extends AppCompatActivity { 7 | 8 | @Override 9 | protected void onCreate(Bundle savedInstanceState) { 10 | super.onCreate(savedInstanceState); 11 | setContentView(R.layout.activity_main); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /app/src/main/java/com/stone/goodjob/view/GoodJobView.java: -------------------------------------------------------------------------------- 1 | package com.stone.goodjob.view; 2 | 3 | import android.animation.AnimatorSet; 4 | import android.animation.ObjectAnimator; 5 | import android.content.Context; 6 | import android.content.res.Resources; 7 | import android.content.res.TypedArray; 8 | import android.graphics.Bitmap; 9 | import android.graphics.BitmapFactory; 10 | import android.graphics.Canvas; 11 | import android.graphics.Color; 12 | import android.graphics.Paint; 13 | import android.graphics.Rect; 14 | import android.support.annotation.Keep; 15 | import android.support.annotation.Nullable; 16 | import android.util.AttributeSet; 17 | import android.view.MotionEvent; 18 | import android.view.View; 19 | 20 | import com.stone.goodjob.R; 21 | 22 | /** 23 | * 透明度版本 24 | * Created by jiayuanbin on 2017/10/13. 25 | */ 26 | 27 | public class GoodJobView extends View { 28 | 29 | private int goodNum; 30 | private int textMoveHeight;//文字上下移动的距离的上限 31 | private int duration = 200; 32 | 33 | private float textDy;//文字上下移动的动态值 34 | private float shiningAlpha; 35 | private float shiningScale; 36 | private float handScale = 1.0f; 37 | private float textAlpha; 38 | private float[] widths; 39 | 40 | private boolean isSelected; 41 | 42 | private Bitmap unselected; 43 | private Bitmap selected; 44 | private Bitmap shining; 45 | private Rect textBounds; 46 | 47 | private Paint bitmapPaint; 48 | private Paint textPaint; 49 | private Paint oldTextPaint; 50 | 51 | public GoodJobView(Context context) { 52 | this(context, null); 53 | } 54 | 55 | public GoodJobView(Context context, @Nullable AttributeSet attrs) { 56 | this(context, attrs, 0); 57 | } 58 | 59 | public GoodJobView(Context context, @Nullable AttributeSet attrs, int defStyleAttr) { 60 | super(context, attrs, defStyleAttr); 61 | 62 | TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.GoodJobView); 63 | goodNum = a.getInt(R.styleable.GoodJobView_good_num, 2022); 64 | a.recycle(); 65 | 66 | textBounds = new Rect(); 67 | widths = new float[6];//默认支持到6位数 68 | 69 | bitmapPaint = new Paint(Paint.ANTI_ALIAS_FLAG); 70 | textPaint = new Paint(Paint.ANTI_ALIAS_FLAG); 71 | oldTextPaint = new Paint(Paint.ANTI_ALIAS_FLAG); 72 | 73 | //初始化文字相关配置 74 | textPaint.setColor(Color.GRAY); 75 | textPaint.setTextSize(spToPx(14)); 76 | oldTextPaint.setColor(Color.GRAY); 77 | oldTextPaint.setTextSize(spToPx(14)); 78 | } 79 | 80 | @Override 81 | protected void onAttachedToWindow() { 82 | super.onAttachedToWindow(); 83 | Resources resources = getResources(); 84 | unselected = BitmapFactory.decodeResource(resources, R.mipmap.ic_messages_like_unselected); 85 | selected = BitmapFactory.decodeResource(resources, R.mipmap.ic_messages_like_selected); 86 | shining = BitmapFactory.decodeResource(resources, R.mipmap.ic_messages_like_selected_shining); 87 | } 88 | 89 | @Override 90 | protected void onDetachedFromWindow() { 91 | super.onDetachedFromWindow(); 92 | unselected.recycle(); 93 | selected.recycle(); 94 | shining.recycle(); 95 | } 96 | 97 | @Override 98 | protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { 99 | //高度默认限定为bitmap的高度加上上下margin各10dp 100 | heightMeasureSpec = MeasureSpec.makeMeasureSpec(selected.getHeight() + dpToPx(20), MeasureSpec.EXACTLY); 101 | //宽度默认为bitmap的宽度加上左右margin各10dp,文字的宽度和文字右侧10dp 102 | String s = String.valueOf(goodNum); 103 | float textWidth = textPaint.measureText(s, 0, s.length()); 104 | widthMeasureSpec = MeasureSpec.makeMeasureSpec((int) (selected.getWidth() + textWidth + dpToPx(30)), MeasureSpec.EXACTLY); 105 | super.onMeasure(widthMeasureSpec, heightMeasureSpec); 106 | } 107 | 108 | 109 | @Override 110 | protected void onDraw(Canvas canvas) { 111 | super.onDraw(canvas); 112 | 113 | int width = getWidth(); 114 | int height = getHeight(); 115 | int centerY = height / 2; 116 | Bitmap handBitmap = isSelected ? selected : unselected; 117 | int handBitmapWidth = handBitmap.getWidth(); 118 | int handBitmapHeight = handBitmap.getHeight(); 119 | 120 | //画小手 121 | int handTop = (height - handBitmapHeight) / 2; 122 | canvas.save(); 123 | canvas.scale(handScale, handScale, handBitmapWidth / 2, centerY); 124 | canvas.drawBitmap(handBitmap, 0, handTop, bitmapPaint); 125 | canvas.restore(); 126 | 127 | //画shining 128 | int shiningTop = handTop - shining.getHeight() + dpToPx(6);//手动加上6dp的margin 129 | bitmapPaint.setAlpha((int) (255 * shiningAlpha)); 130 | canvas.save(); 131 | canvas.scale(shiningScale, shiningScale, handBitmapWidth / 2, handTop); 132 | canvas.drawBitmap(shining, 0, shiningTop, bitmapPaint); 133 | canvas.restore(); 134 | //恢复bitmapPaint透明度 135 | bitmapPaint.setAlpha(255); 136 | 137 | String value = String.valueOf(goodNum); 138 | String oldValue; 139 | if (isSelected) { 140 | oldValue = String.valueOf(goodNum - 1); 141 | } else { 142 | oldValue = String.valueOf(goodNum + 1); 143 | } 144 | int length = value.length(); 145 | //获取文字绘制的坐标 146 | textPaint.getTextBounds(value, 0, length, textBounds); 147 | int textY = height / 2 - (textBounds.top + textBounds.bottom) / 2; 148 | int textX = handBitmapWidth + dpToPx(10);//手动加上10dp的margin 149 | if (length != oldValue.length() || textMoveHeight == 0) { 150 | //直接绘制文字 没找到即刻App里面对这种情况的处理效果 151 | canvas.drawText(value, textX, textY, textPaint); 152 | return; 153 | } 154 | //把文字拆解成一个一个的字符 155 | textPaint.getTextWidths(value, widths); 156 | char[] chars = value.toCharArray(); 157 | char[] oldChars = oldValue.toCharArray(); 158 | for (int i = 0; i < chars.length; i++) { 159 | if (oldChars[i] == chars[i]) { 160 | textPaint.setAlpha(255); 161 | canvas.drawText(String.valueOf(chars[i]), textX, textY, textPaint); 162 | } else { 163 | if (isSelected) { 164 | oldTextPaint.setAlpha((int) (255 * (1 - textAlpha))); 165 | canvas.drawText(String.valueOf(oldChars[i]), textX, textY - textMoveHeight + textDy, oldTextPaint); 166 | textPaint.setAlpha((int) (255 * textAlpha)); 167 | canvas.drawText(String.valueOf(chars[i]), textX, textY + textDy, textPaint); 168 | } else { 169 | oldTextPaint.setAlpha((int) (255 * (1 - textAlpha))); 170 | canvas.drawText(String.valueOf(oldChars[i]), textX, textY + textMoveHeight + textDy, oldTextPaint); 171 | textPaint.setAlpha((int) (255 * textAlpha)); 172 | canvas.drawText(String.valueOf(chars[i]), textX, textY + textDy, textPaint); 173 | } 174 | } 175 | textX += widths[i]; 176 | } 177 | } 178 | 179 | @Override 180 | public boolean onTouchEvent(MotionEvent event) { 181 | switch (event.getAction()) { 182 | case MotionEvent.ACTION_DOWN: 183 | toggle(); 184 | break; 185 | } 186 | return super.onTouchEvent(event); 187 | } 188 | 189 | private void toggle() { 190 | isSelected = !isSelected; 191 | if (isSelected) { 192 | ObjectAnimator handScaleAnim = ObjectAnimator.ofFloat(this, "handScale", 1f, 0.8f, 1f); 193 | handScaleAnim.setDuration(duration); 194 | 195 | ObjectAnimator shiningAlphaAnim = ObjectAnimator.ofFloat(this, "shiningAlpha", 0f, 1f); 196 | handScaleAnim.setDuration(duration); 197 | 198 | ObjectAnimator shiningScaleAnim = ObjectAnimator.ofFloat(this, "shiningScale", 0f, 1f); 199 | handScaleAnim.setDuration(duration); 200 | 201 | AnimatorSet set = new AnimatorSet(); 202 | set.playTogether(handScaleAnim, shiningAlphaAnim, shiningScaleAnim); 203 | set.start(); 204 | setGoodNum(++goodNum); 205 | } else { 206 | ObjectAnimator handScaleAnim = ObjectAnimator.ofFloat(this, "handScale", 1f, 0.8f, 1f); 207 | handScaleAnim.setDuration(duration); 208 | handScaleAnim.start(); 209 | 210 | setShiningAlpha(0); 211 | setGoodNum(--goodNum); 212 | } 213 | } 214 | 215 | @Keep 216 | public void setTextAlpha(float textAlpha) { 217 | this.textAlpha = textAlpha; 218 | invalidate(); 219 | } 220 | 221 | @Keep 222 | public void setTextDy(float textDy) { 223 | this.textDy = textDy; 224 | invalidate(); 225 | } 226 | 227 | public void setGoodNum(int goodNum) { 228 | float startY; 229 | textMoveHeight = dpToPx(20); 230 | if (isSelected) { 231 | startY = textMoveHeight; 232 | } else { 233 | startY = -textMoveHeight; 234 | } 235 | 236 | ObjectAnimator textInAlphaAnim = ObjectAnimator.ofFloat(this, "textAlpha", 0f, 1f); 237 | textInAlphaAnim.setDuration(duration); 238 | ObjectAnimator dyAnim = ObjectAnimator.ofFloat(this, "textDy", startY, 0); 239 | dyAnim.setDuration(duration); 240 | 241 | AnimatorSet set = new AnimatorSet(); 242 | set.playTogether(textInAlphaAnim, dyAnim); 243 | set.start(); 244 | } 245 | 246 | @Keep 247 | public void setShiningAlpha(float shiningAlpha) { 248 | this.shiningAlpha = shiningAlpha; 249 | invalidate(); 250 | } 251 | 252 | @Keep 253 | public void setShiningScale(float shiningScale) { 254 | this.shiningScale = shiningScale; 255 | invalidate(); 256 | } 257 | 258 | @Keep 259 | public void setHandScale(float handScale) { 260 | this.handScale = handScale; 261 | invalidate(); 262 | } 263 | 264 | private int dpToPx(float dp) { 265 | float density = getContext().getResources().getDisplayMetrics().density; 266 | return (int) (dp * density + 0.5f * (dp >= 0 ? 1 : -1)); 267 | } 268 | 269 | public int spToPx(float spValue) { 270 | float fontScale = getContext().getResources().getDisplayMetrics().scaledDensity; 271 | return (int) (spValue * fontScale + 0.5f); 272 | } 273 | } 274 | -------------------------------------------------------------------------------- /app/src/main/java/com/stone/goodjob/view/GoodJobView2.java: -------------------------------------------------------------------------------- 1 | package com.stone.goodjob.view; 2 | 3 | import android.animation.AnimatorSet; 4 | import android.animation.ObjectAnimator; 5 | import android.content.Context; 6 | import android.content.res.Resources; 7 | import android.content.res.TypedArray; 8 | import android.graphics.Bitmap; 9 | import android.graphics.BitmapFactory; 10 | import android.graphics.Canvas; 11 | import android.graphics.Color; 12 | import android.graphics.Paint; 13 | import android.graphics.Rect; 14 | import android.support.annotation.Keep; 15 | import android.support.annotation.Nullable; 16 | import android.util.AttributeSet; 17 | import android.view.MotionEvent; 18 | import android.view.View; 19 | 20 | import com.stone.goodjob.R; 21 | 22 | /** 23 | * 无透明度版本 24 | * Created by jiayuanbin on 2017/10/13. 25 | */ 26 | 27 | public class GoodJobView2 extends View { 28 | 29 | private int goodNum = 2189; 30 | private int textMoveHeight;//文字上下移动的距离的上限 31 | private int duration = 200; 32 | 33 | private float textDy;//文字上下移动的动态值 34 | private float shiningAlpha; 35 | private float shiningScale; 36 | private float handScale = 1.0f; 37 | private float[] widths; 38 | 39 | private boolean isSelected; 40 | 41 | private Bitmap unselected; 42 | private Bitmap selected; 43 | private Bitmap shining; 44 | private Rect textBounds; 45 | 46 | private Paint bitmapPaint; 47 | private Paint textPaint; 48 | private Paint oldTextPaint; 49 | 50 | public GoodJobView2(Context context) { 51 | this(context, null); 52 | } 53 | 54 | public GoodJobView2(Context context, @Nullable AttributeSet attrs) { 55 | this(context, attrs, 0); 56 | } 57 | 58 | public GoodJobView2(Context context, @Nullable AttributeSet attrs, int defStyleAttr) { 59 | super(context, attrs, defStyleAttr); 60 | 61 | TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.GoodJobView2); 62 | goodNum = a.getInt(R.styleable.GoodJobView2_good_num2, 2022); 63 | a.recycle(); 64 | 65 | textBounds = new Rect(); 66 | widths = new float[6];//默认支持到6位数 67 | 68 | bitmapPaint = new Paint(Paint.ANTI_ALIAS_FLAG); 69 | textPaint = new Paint(Paint.ANTI_ALIAS_FLAG); 70 | oldTextPaint = new Paint(Paint.ANTI_ALIAS_FLAG); 71 | 72 | //初始化文字相关配置 73 | textPaint.setColor(Color.GRAY); 74 | textPaint.setTextSize(spToPx(14)); 75 | oldTextPaint.setColor(Color.GRAY); 76 | oldTextPaint.setTextSize(spToPx(14)); 77 | } 78 | 79 | @Override 80 | protected void onAttachedToWindow() { 81 | super.onAttachedToWindow(); 82 | Resources resources = getResources(); 83 | unselected = BitmapFactory.decodeResource(resources, R.mipmap.ic_messages_like_unselected); 84 | selected = BitmapFactory.decodeResource(resources, R.mipmap.ic_messages_like_selected); 85 | shining = BitmapFactory.decodeResource(resources, R.mipmap.ic_messages_like_selected_shining); 86 | } 87 | 88 | @Override 89 | protected void onDetachedFromWindow() { 90 | super.onDetachedFromWindow(); 91 | unselected.recycle(); 92 | selected.recycle(); 93 | shining.recycle(); 94 | } 95 | 96 | @Override 97 | protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { 98 | //高度默认限定为bitmap的高度加上上下margin各10dp 99 | heightMeasureSpec = MeasureSpec.makeMeasureSpec(selected.getHeight() + dpToPx(20), MeasureSpec.EXACTLY); 100 | //宽度默认为bitmap的宽度加上左右margin各10dp,文字的宽度和文字右侧10dp 101 | String s = String.valueOf(goodNum); 102 | float textWidth = textPaint.measureText(s, 0, s.length()); 103 | widthMeasureSpec = MeasureSpec.makeMeasureSpec((int) (selected.getWidth() + textWidth + dpToPx(30)), MeasureSpec.EXACTLY); 104 | super.onMeasure(widthMeasureSpec, heightMeasureSpec); 105 | } 106 | 107 | @Override 108 | protected void onDraw(Canvas canvas) { 109 | super.onDraw(canvas); 110 | 111 | int width = getWidth(); 112 | int height = getHeight(); 113 | int centerY = height / 2; 114 | Bitmap handBitmap = isSelected ? selected : unselected; 115 | int handBitmapWidth = handBitmap.getWidth(); 116 | int handBitmapHeight = handBitmap.getHeight(); 117 | 118 | //画小手 119 | int handTop = (height - handBitmapHeight) / 2; 120 | canvas.save(); 121 | canvas.scale(handScale, handScale, handBitmapWidth / 2, centerY); 122 | canvas.drawBitmap(handBitmap, 0, handTop, bitmapPaint); 123 | canvas.restore(); 124 | 125 | //画shining 126 | int shiningTop = handTop - shining.getHeight() + dpToPx(6);//手动加上6dp的margin 127 | bitmapPaint.setAlpha((int) (255 * shiningAlpha)); 128 | canvas.save(); 129 | canvas.scale(shiningScale, shiningScale, handBitmapWidth / 2, handTop); 130 | canvas.drawBitmap(shining, 0, shiningTop, bitmapPaint); 131 | canvas.restore(); 132 | //恢复bitmapPaint透明度 133 | bitmapPaint.setAlpha(255); 134 | 135 | String value = String.valueOf(goodNum); 136 | String oldValue; 137 | if (isSelected) { 138 | oldValue = String.valueOf(goodNum - 1); 139 | } else { 140 | oldValue = String.valueOf(goodNum + 1); 141 | } 142 | int length = value.length(); 143 | //获取文字绘制的坐标 144 | textPaint.getTextBounds(value, 0, length, textBounds); 145 | int textY = height / 2 - (textBounds.top + textBounds.bottom) / 2; 146 | int textX = handBitmapWidth + dpToPx(10);//手动加上10dp的margin 147 | if (length != oldValue.length() || textMoveHeight == 0) { 148 | //直接绘制文字 没找到即刻App里面对这种情况的处理效果 149 | canvas.drawText(value, textX, textY, textPaint); 150 | return; 151 | } 152 | //把文字拆解成一个一个的字符 153 | textPaint.getTextWidths(value, widths); 154 | char[] chars = value.toCharArray(); 155 | char[] oldChars = oldValue.toCharArray(); 156 | for (int i = 0; i < chars.length; i++) { 157 | if (oldChars[i] == chars[i]) { 158 | canvas.drawText(String.valueOf(chars[i]), textX, textY, textPaint); 159 | } else { 160 | if (isSelected) { 161 | canvas.drawText(String.valueOf(oldChars[i]), textX, textY - textMoveHeight + textDy, oldTextPaint); 162 | canvas.drawText(String.valueOf(chars[i]), textX, textY + textDy, textPaint); 163 | } else { 164 | canvas.drawText(String.valueOf(oldChars[i]), textX, textY + textMoveHeight + textDy, oldTextPaint); 165 | canvas.drawText(String.valueOf(chars[i]), textX, textY + textDy, textPaint); 166 | } 167 | } 168 | textX += widths[i]; 169 | } 170 | } 171 | 172 | @Override 173 | public boolean onTouchEvent(MotionEvent event) { 174 | switch (event.getAction()) { 175 | case MotionEvent.ACTION_DOWN: 176 | toggle(); 177 | break; 178 | } 179 | return super.onTouchEvent(event); 180 | } 181 | 182 | private void toggle() { 183 | isSelected = !isSelected; 184 | if (isSelected) { 185 | ObjectAnimator handScaleAnim = ObjectAnimator.ofFloat(this, "handScale", 1f, 0.8f, 1f); 186 | handScaleAnim.setDuration(duration); 187 | 188 | ObjectAnimator shiningAlphaAnim = ObjectAnimator.ofFloat(this, "shiningAlpha", 0f, 1f); 189 | handScaleAnim.setDuration(duration); 190 | 191 | ObjectAnimator shiningScaleAnim = ObjectAnimator.ofFloat(this, "shiningScale", 0f, 1f); 192 | handScaleAnim.setDuration(duration); 193 | 194 | AnimatorSet set = new AnimatorSet(); 195 | set.playTogether(handScaleAnim, shiningAlphaAnim, shiningScaleAnim); 196 | set.start(); 197 | setGoodNum(++goodNum); 198 | } else { 199 | ObjectAnimator handScaleAnim = ObjectAnimator.ofFloat(this, "handScale", 1f, 0.8f, 1f); 200 | handScaleAnim.setDuration(duration); 201 | handScaleAnim.start(); 202 | 203 | setShiningAlpha(0); 204 | setGoodNum(--goodNum); 205 | } 206 | } 207 | 208 | @Keep 209 | public void setTextDy(float textDy) { 210 | this.textDy = textDy; 211 | invalidate(); 212 | } 213 | 214 | public void setGoodNum(int goodNum) { 215 | float startY; 216 | textMoveHeight = dpToPx(30); 217 | if (isSelected) { 218 | startY = textMoveHeight; 219 | } else { 220 | startY = -textMoveHeight; 221 | } 222 | 223 | ObjectAnimator dyAnim = ObjectAnimator.ofFloat(this, "textDy", startY, 0); 224 | dyAnim.setDuration(duration); 225 | dyAnim.start(); 226 | } 227 | 228 | @Keep 229 | public void setShiningAlpha(float shiningAlpha) { 230 | this.shiningAlpha = shiningAlpha; 231 | invalidate(); 232 | } 233 | 234 | @Keep 235 | public void setShiningScale(float shiningScale) { 236 | this.shiningScale = shiningScale; 237 | invalidate(); 238 | } 239 | 240 | @Keep 241 | public void setHandScale(float handScale) { 242 | this.handScale = handScale; 243 | invalidate(); 244 | } 245 | 246 | private int dpToPx(float dp) { 247 | float density = getContext().getResources().getDisplayMetrics().density; 248 | return (int) (dp * density + 0.5f * (dp >= 0 ? 1 : -1)); 249 | } 250 | 251 | public int spToPx(float spValue) { 252 | float fontScale = getContext().getResources().getDisplayMetrics().scaledDensity; 253 | return (int) (spValue * fontScale + 0.5f); 254 | } 255 | } 256 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 13 | 14 | 20 | 21 | 27 | 28 | 34 | 35 | 41 | 42 | 47 | 48 | 54 | 55 | 61 | 62 | 68 | 69 | 75 | 76 | 77 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunnyxibei/GoodJob/76e665dbfb2c0bb2e7d49e93668d430bd24246d3/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunnyxibei/GoodJob/76e665dbfb2c0bb2e7d49e93668d430bd24246d3/app/src/main/res/mipmap-hdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunnyxibei/GoodJob/76e665dbfb2c0bb2e7d49e93668d430bd24246d3/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunnyxibei/GoodJob/76e665dbfb2c0bb2e7d49e93668d430bd24246d3/app/src/main/res/mipmap-mdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunnyxibei/GoodJob/76e665dbfb2c0bb2e7d49e93668d430bd24246d3/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunnyxibei/GoodJob/76e665dbfb2c0bb2e7d49e93668d430bd24246d3/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunnyxibei/GoodJob/76e665dbfb2c0bb2e7d49e93668d430bd24246d3/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunnyxibei/GoodJob/76e665dbfb2c0bb2e7d49e93668d430bd24246d3/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunnyxibei/GoodJob/76e665dbfb2c0bb2e7d49e93668d430bd24246d3/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunnyxibei/GoodJob/76e665dbfb2c0bb2e7d49e93668d430bd24246d3/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_messages_like_selected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunnyxibei/GoodJob/76e665dbfb2c0bb2e7d49e93668d430bd24246d3/app/src/main/res/mipmap-xxxhdpi/ic_messages_like_selected.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_messages_like_selected_shining.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunnyxibei/GoodJob/76e665dbfb2c0bb2e7d49e93668d430bd24246d3/app/src/main/res/mipmap-xxxhdpi/ic_messages_like_selected_shining.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_messages_like_unselected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunnyxibei/GoodJob/76e665dbfb2c0bb2e7d49e93668d430bd24246d3/app/src/main/res/mipmap-xxxhdpi/ic_messages_like_unselected.png -------------------------------------------------------------------------------- /app/src/main/res/values/attrs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #3F51B5 4 | #303F9F 5 | #FF4081 6 | 7 | -------------------------------------------------------------------------------- /app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | GoodJob 3 | 4 | -------------------------------------------------------------------------------- /app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /app/src/test/java/com/stone/goodjob/ExampleUnitTest.java: -------------------------------------------------------------------------------- 1 | package com.stone.goodjob; 2 | 3 | import org.junit.Test; 4 | 5 | import static org.junit.Assert.*; 6 | 7 | /** 8 | * Example local unit test, which will execute on the development machine (host). 9 | * 10 | * @see Testing documentation 11 | */ 12 | public class ExampleUnitTest { 13 | @Test 14 | public void addition_isCorrect() throws Exception { 15 | assertEquals(4, 2 + 2); 16 | } 17 | } -------------------------------------------------------------------------------- /build.gradle: -------------------------------------------------------------------------------- 1 | // Top-level build file where you can add configuration options common to all sub-projects/modules. 2 | 3 | buildscript { 4 | repositories { 5 | jcenter() 6 | } 7 | dependencies { 8 | classpath 'com.android.tools.build:gradle:2.3.3' 9 | 10 | // NOTE: Do not place your application dependencies here; they belong 11 | // in the individual module build.gradle files 12 | } 13 | } 14 | 15 | allprojects { 16 | repositories { 17 | jcenter() 18 | } 19 | } 20 | 21 | task clean(type: Delete) { 22 | delete rootProject.buildDir 23 | } 24 | -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | 3 | # IDE (e.g. Android Studio) users: 4 | # Gradle settings configured through the IDE *will override* 5 | # any settings specified in this file. 6 | 7 | # For more details on how to configure your build environment visit 8 | # http://www.gradle.org/docs/current/userguide/build_environment.html 9 | 10 | # Specifies the JVM arguments used for the daemon process. 11 | # The setting is particularly useful for tweaking memory settings. 12 | org.gradle.jvmargs=-Xmx1536m 13 | 14 | # When configured, Gradle will run in incubating parallel mode. 15 | # This option should only be used with decoupled projects. More details, visit 16 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 17 | # org.gradle.parallel=true 18 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunnyxibei/GoodJob/76e665dbfb2c0bb2e7d49e93668d430bd24246d3/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Fri Oct 13 16:36:43 CST 2017 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip 7 | -------------------------------------------------------------------------------- /gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ############################################################################## 4 | ## 5 | ## Gradle start up script for UN*X 6 | ## 7 | ############################################################################## 8 | 9 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 10 | DEFAULT_JVM_OPTS="" 11 | 12 | APP_NAME="Gradle" 13 | APP_BASE_NAME=`basename "$0"` 14 | 15 | # Use the maximum available, or set MAX_FD != -1 to use that value. 16 | MAX_FD="maximum" 17 | 18 | warn ( ) { 19 | echo "$*" 20 | } 21 | 22 | die ( ) { 23 | echo 24 | echo "$*" 25 | echo 26 | exit 1 27 | } 28 | 29 | # OS specific support (must be 'true' or 'false'). 30 | cygwin=false 31 | msys=false 32 | darwin=false 33 | case "`uname`" in 34 | CYGWIN* ) 35 | cygwin=true 36 | ;; 37 | Darwin* ) 38 | darwin=true 39 | ;; 40 | MINGW* ) 41 | msys=true 42 | ;; 43 | esac 44 | 45 | # Attempt to set APP_HOME 46 | # Resolve links: $0 may be a link 47 | PRG="$0" 48 | # Need this for relative symlinks. 49 | while [ -h "$PRG" ] ; do 50 | ls=`ls -ld "$PRG"` 51 | link=`expr "$ls" : '.*-> \(.*\)$'` 52 | if expr "$link" : '/.*' > /dev/null; then 53 | PRG="$link" 54 | else 55 | PRG=`dirname "$PRG"`"/$link" 56 | fi 57 | done 58 | SAVED="`pwd`" 59 | cd "`dirname \"$PRG\"`/" >/dev/null 60 | APP_HOME="`pwd -P`" 61 | cd "$SAVED" >/dev/null 62 | 63 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 64 | 65 | # Determine the Java command to use to start the JVM. 66 | if [ -n "$JAVA_HOME" ] ; then 67 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 68 | # IBM's JDK on AIX uses strange locations for the executables 69 | JAVACMD="$JAVA_HOME/jre/sh/java" 70 | else 71 | JAVACMD="$JAVA_HOME/bin/java" 72 | fi 73 | if [ ! -x "$JAVACMD" ] ; then 74 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 75 | 76 | Please set the JAVA_HOME variable in your environment to match the 77 | location of your Java installation." 78 | fi 79 | else 80 | JAVACMD="java" 81 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 82 | 83 | Please set the JAVA_HOME variable in your environment to match the 84 | location of your Java installation." 85 | fi 86 | 87 | # Increase the maximum file descriptors if we can. 88 | if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then 89 | MAX_FD_LIMIT=`ulimit -H -n` 90 | if [ $? -eq 0 ] ; then 91 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 92 | MAX_FD="$MAX_FD_LIMIT" 93 | fi 94 | ulimit -n $MAX_FD 95 | if [ $? -ne 0 ] ; then 96 | warn "Could not set maximum file descriptor limit: $MAX_FD" 97 | fi 98 | else 99 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 100 | fi 101 | fi 102 | 103 | # For Darwin, add options to specify how the application appears in the dock 104 | if $darwin; then 105 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 106 | fi 107 | 108 | # For Cygwin, switch paths to Windows format before running java 109 | if $cygwin ; then 110 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 111 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 112 | JAVACMD=`cygpath --unix "$JAVACMD"` 113 | 114 | # We build the pattern for arguments to be converted via cygpath 115 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 116 | SEP="" 117 | for dir in $ROOTDIRSRAW ; do 118 | ROOTDIRS="$ROOTDIRS$SEP$dir" 119 | SEP="|" 120 | done 121 | OURCYGPATTERN="(^($ROOTDIRS))" 122 | # Add a user-defined pattern to the cygpath arguments 123 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 124 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 125 | fi 126 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 127 | i=0 128 | for arg in "$@" ; do 129 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 130 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 131 | 132 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 133 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 134 | else 135 | eval `echo args$i`="\"$arg\"" 136 | fi 137 | i=$((i+1)) 138 | done 139 | case $i in 140 | (0) set -- ;; 141 | (1) set -- "$args0" ;; 142 | (2) set -- "$args0" "$args1" ;; 143 | (3) set -- "$args0" "$args1" "$args2" ;; 144 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;; 145 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 146 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 147 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 148 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 149 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 150 | esac 151 | fi 152 | 153 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules 154 | function splitJvmOpts() { 155 | JVM_OPTS=("$@") 156 | } 157 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS 158 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" 159 | 160 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" 161 | -------------------------------------------------------------------------------- /gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 12 | set DEFAULT_JVM_OPTS= 13 | 14 | set DIRNAME=%~dp0 15 | if "%DIRNAME%" == "" set DIRNAME=. 16 | set APP_BASE_NAME=%~n0 17 | set APP_HOME=%DIRNAME% 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windowz variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /jpg/demo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunnyxibei/GoodJob/76e665dbfb2c0bb2e7d49e93668d430bd24246d3/jpg/demo.gif -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | --------------------------------------------------------------------------------