File tree Expand file tree Collapse file tree
src/main/java/com/example/liangmutian/randomtextviewlibrary Expand file tree Collapse file tree Load Diff This file was deleted.
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ apply plugin: 'com.android.application'
22
33android {
44 compileSdkVersion 23
5- buildToolsVersion " 23.0.2 "
5+ buildToolsVersion " 23.0.1 "
66 defaultConfig {
77 applicationId " com.example.liangmutian.randomtextview"
88 minSdkVersion 15
Original file line number Diff line number Diff line change @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
33distributionPath =wrapper/dists
44zipStoreBase =GRADLE_USER_HOME
55zipStorePath =wrapper/dists
6- distributionUrl =https\://services.gradle.org/distributions/gradle-2.14.1 -all.zip
6+ distributionUrl =https\://services.gradle.org/distributions/gradle-3.3 -all.zip
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ apply plugin: 'com.android.library'
22apply plugin : ' com.github.dcendents.android-maven'
33android {
44 compileSdkVersion 23
5- buildToolsVersion " 23.0.2 "
5+ buildToolsVersion " 23.0.1 "
66
77 defaultConfig {
88 minSdkVersion 15
Original file line number Diff line number Diff line change 11package com .example .liangmutian .randomtextviewlibrary ;
22
3+ import android .annotation .SuppressLint ;
34import android .content .Context ;
45import android .graphics .Canvas ;
56import android .graphics .Paint ;
1415 * Created by lmt on 16/11/1.
1516 */
1617
18+ @ SuppressLint ("AppCompatCustomView" )
1719public class RandomTextView extends TextView {
1820 //高位快
1921 public static final int FIRSTF_FIRST = 0 ;
@@ -115,6 +117,7 @@ public void setPianyilian(int[] list) {
115117 @ Override
116118 protected void onDraw (Canvas canvas ) {
117119
120+ Log .d ("RandomTextView" ,"draw" );
118121 if (firstIn ) {
119122 firstIn = false ;
120123 super .onDraw (canvas );
@@ -159,9 +162,12 @@ private void drawNumber(Canvas canvas) {
159162 auto += overLine [k ];
160163 }
161164 if (auto == numLength * 2 - 1 ) {
162- this . auto = false ;
165+
163166 handler .removeCallbacks (task );
167+ //修复停止后绘制问题
168+ if (this .auto )
164169 invalidate ();
170+ this .auto = false ;
165171 }
166172
167173 }
@@ -258,6 +264,7 @@ public void destroy() {
258264 public void run () {
259265 // TODO Auto-generated method stub
260266 if (auto ) {
267+ Log .d ("RandomTextView" ,"" +auto );
261268 handler .postDelayed (this , 20 );
262269
263270 for (int j = 0 ; j < numLength ; j ++) {
You can’t perform that action at this time.
0 commit comments