File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
library/src/main/java/com/flyjingfish/gradienttextviewlib Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -235,7 +235,7 @@ protected void onDraw(Canvas canvas) {
235235 textPaint .setStrokeMiter (defaultStrokeMiter );
236236 }
237237 LinearGradient linearGradient ;
238- if (gradientStrokeColor ){
238+ if (gradientStrokeColor && gradientStrokeColors != null && gradientStrokeColors . length > 1 ){
239239 float currentAngle = strokeAngle ;
240240 if (strokeRtlAngle && isRtl ){
241241 currentAngle = - strokeAngle ;
@@ -251,7 +251,7 @@ protected void onDraw(Canvas canvas) {
251251
252252 textPaint .setStrokeWidth (0 );
253253 textPaint .setStyle (oldStyle );
254- if (gradientColor ){
254+ if (gradientColor && gradientColors != null && gradientColors . length > 1 ){
255255 float currentAngle = angle ;
256256 if (rtlAngle && isRtl ){
257257 currentAngle = - angle ;
@@ -405,7 +405,7 @@ public void setGradientColors(@Nullable ColorStateList[] colorStateLists) {
405405 if (gradientColorStates .size () == 1 ){
406406 gradientColorStates .add (ColorStateList .valueOf (Color .TRANSPARENT ));
407407 }
408- gradientStrokeColor = gradientColorStates .size () > 0 ;
408+ gradientColor = gradientColorStates .size () > 0 ;
409409 if (gradientPositions != null && gradientColorStates .size () != gradientPositions .length ){
410410 this .gradientPositions = null ;
411411 }
You can’t perform that action at this time.
0 commit comments