1- package com .allen .androidcustomview ;
1+ package com .allen .androidcustomview . activity ;
22
33import android .content .Intent ;
44import android .os .Bundle ;
55import android .support .v7 .app .AppCompatActivity ;
66import android .view .View ;
77import android .widget .Button ;
8- import android .widget .Toast ;
98
9+ import com .allen .androidcustomview .R ;
1010import com .allen .androidcustomview .tagview .TagActivity ;
11- import com .allen .androidcustomview .widget .PayPsdInputView ;
1211
1312
1413public class MainActivity extends AppCompatActivity {
@@ -19,9 +18,11 @@ public class MainActivity extends AppCompatActivity {
1918 private Button button_radar ;
2019 private Button button_tag ;
2120 private Button animation_btn ;
21+ private Button pay_psd_view_btn ;
22+ private Button progress_btn ;
23+
2224
2325
24- private PayPsdInputView passwordInputView ;
2526 @ Override
2627 protected void onCreate (Bundle savedInstanceState ) {
2728 super .onCreate (savedInstanceState );
@@ -33,23 +34,8 @@ protected void onCreate(Bundle savedInstanceState) {
3334 button_radar = (Button ) findViewById (R .id .radar_view_btn );
3435 button_tag = (Button ) findViewById (R .id .tag_view_btn );
3536 animation_btn = (Button ) findViewById (R .id .animation_btn );
36-
37- passwordInputView = (PayPsdInputView ) findViewById (R .id .password );
38-
39- passwordInputView .setComparePassword ("123456" , new PayPsdInputView .onPasswordListener () {
40- @ Override
41- public void onDifference () {
42- // TODO: 2017/5/7 和上次输入的密码不一致 做相应的业务逻辑处理
43- Toast .makeText (MainActivity .this ,"两次密码输入不同" ,Toast .LENGTH_SHORT ).show ();
44- }
45-
46- @ Override
47- public void onEqual (String psd ) {
48- // TODO: 2017/5/7 两次输入密码相同,那就去进行支付楼
49- Toast .makeText (MainActivity .this ,"密码相同" +psd ,Toast .LENGTH_SHORT ).show ();
50-
51- }
52- });
37+ pay_psd_view_btn = (Button ) findViewById (R .id .pay_psd_view_btn );
38+ progress_btn = (Button ) findViewById (R .id .progress_btn );
5339
5440 button_bubble .setOnClickListener (new View .OnClickListener () {
5541 @ Override
@@ -88,6 +74,19 @@ public void onClick(View view) {
8874 }
8975 });
9076
77+ pay_psd_view_btn .setOnClickListener (new View .OnClickListener () {
78+ @ Override
79+ public void onClick (View view ) {
80+ startActivity (new Intent (MainActivity .this , PayPsdViewActivity .class ));
81+ }
82+ });
83+ progress_btn .setOnClickListener (new View .OnClickListener () {
84+ @ Override
85+ public void onClick (View view ) {
86+ startActivity (new Intent (MainActivity .this , ProgressBarActivity .class ));
87+ }
88+ });
89+
9190 }
9291
9392}
0 commit comments