3
3
import android .support .v7 .app .AppCompatActivity ;
4
4
import android .os .Bundle ;
5
5
6
+ import com .github .yasic .particletextview .MovingStrategy .BidiverticalStrategy ;
7
+ import com .github .yasic .particletextview .MovingStrategy .BidizontalStrategy ;
8
+ import com .github .yasic .particletextview .MovingStrategy .CornerStrategy ;
9
+ import com .github .yasic .particletextview .MovingStrategy .HorizontalStrategy ;
10
+ import com .github .yasic .particletextview .MovingStrategy .VerticalStrategy ;
6
11
import com .github .yasic .particletextview .Object .ParticleTextViewConfig ;
7
12
import com .github .yasic .particletextview .View .ParticleTextView ;
8
13
@@ -15,48 +20,80 @@ protected void onCreate(Bundle savedInstanceState) {
15
20
16
21
ParticleTextView particleTextView1 = (ParticleTextView ) findViewById (R .id .particleTextView1 );
17
22
ParticleTextViewConfig config1 = new ParticleTextViewConfig .Builder ()
18
- .setTargetText ("YASIC " )
19
- .setReleasing (0.1 )
20
- .setParticleRadius (1.5f )
23
+ .setTargetText ("Loading " )
24
+ .setReleasing (0.4 )
25
+ .setParticleRadius (4 )
21
26
.setMiniDistance (1 )
27
+ .setTextSize (150 )
28
+ .setRowStep (9 )
29
+ .setColumnStep (9 )
22
30
.instance ();
23
31
particleTextView1 .setConfig (config1 );
24
- particleTextView1 .startAnimation ();
25
32
26
33
ParticleTextView particleTextView2 = (ParticleTextView ) findViewById (R .id .particleTextView2 );
34
+ VerticalStrategy verticalStrategy = new VerticalStrategy ();
27
35
ParticleTextViewConfig config2 = new ParticleTextViewConfig .Builder ()
28
36
.setTargetText ("ParticleTextView" )
29
- .setReleasing (0.1 )
30
- .setParticleRadius (2 )
31
- .setTextSize (80 )
32
- .setMiniDistance (0.8 )
37
+ .setReleasing (0.5 )
38
+ .setParticleRadius (3 )
39
+ .setTextSize (120 )
40
+ .setMiniDistance (0.5 )
41
+ .setColumnStep (5 )
42
+ .setRowStep (5 )
43
+ .setParticleColorArray (new String []{"#333333" , "#222222" , "#111111" })
44
+ .setMovingStrategy (verticalStrategy )
33
45
.instance ();
34
46
particleTextView2 .setConfig (config2 );
35
- particleTextView2 .startAnimation ();
36
47
37
48
ParticleTextView particleTextView3 = (ParticleTextView ) findViewById (R .id .particleTextView3 );
49
+ CornerStrategy cornerStrategy = new CornerStrategy ();
38
50
ParticleTextViewConfig config3 = new ParticleTextViewConfig .Builder ()
39
- .setTargetText ("十万嬉皮 " )
51
+ .setTargetText ("Java " )
40
52
.setReleasing (0.3 )
41
- .setParticleRadius (2 )
42
- .setTextSize (60 )
53
+ .setParticleRadius (4 )
54
+ .setTextSize (150 )
55
+ .setColumnStep (6 )
56
+ .setRowStep (6 )
57
+ .setMovingStrategy (cornerStrategy )
58
+ .setParticleColorArray (new String []{"#9933ff" })
43
59
.instance ();
44
60
particleTextView3 .setConfig (config3 );
45
- particleTextView3 .startAnimation ();
46
61
47
62
ParticleTextView particleTextView4 = (ParticleTextView ) findViewById (R .id .particleTextView4 );
63
+ BidiverticalStrategy movingStrategy4 = new BidiverticalStrategy ();
48
64
ParticleTextViewConfig config4 = new ParticleTextViewConfig .Builder ()
49
65
.setTargetText ("Android" )
50
66
.setReleasing (0.1 )
51
- .setParticleRadius (1 )
52
- .setTextSize (120 )
53
- .setMiniDistance (1 )
67
+ .setTextSize (150 )
68
+ .setMiniDistance (0.01 )
54
69
.setParticleRadius (4 )
55
70
.setColumnStep (6 )
56
71
.setRowStep (6 )
72
+ .setDelay ((long ) 500 )
73
+ .setParticleColorArray (new String []{"#99ff33" })
74
+ .setMovingStrategy (movingStrategy4 )
57
75
.instance ();
58
76
particleTextView4 .setConfig (config4 );
77
+
78
+ ParticleTextView particleTextView5 = (ParticleTextView ) findViewById (R .id .particleTextView5 );
79
+ BidizontalStrategy movingStrategy5 = new BidizontalStrategy ();
80
+ ParticleTextViewConfig config5 = new ParticleTextViewConfig .Builder ()
81
+ .setTargetText ("Canvas" )
82
+ .setReleasing (0.3 )
83
+ .setTextSize (150 )
84
+ .setMiniDistance (0.01 )
85
+ .setParticleRadius (4 )
86
+ .setColumnStep (8 )
87
+ .setRowStep (8 )
88
+ .setMovingStrategy (movingStrategy5 )
89
+ .instance ();
90
+ particleTextView5 .setConfig (config5 );
91
+
92
+ particleTextView1 .startAnimation ();
93
+ particleTextView2 .startAnimation ();
94
+ particleTextView3 .startAnimation ();
59
95
particleTextView4 .startAnimation ();
96
+ particleTextView5 .startAnimation ();
60
97
}
61
98
62
99
@ Override
0 commit comments