17
17
import android .app .Activity ;
18
18
import android .content .Context ;
19
19
import android .content .Intent ;
20
- import android .content .SharedPreferences ;
21
20
import android .os .Bundle ;
22
- import android .os .Handler ;
23
21
import android .view .MotionEvent ;
24
22
import android .view .View ;
25
23
import android .view .Window ;
31
29
32
30
import apijson .demo .R ;
33
31
import apijson .demo .application .DemoApplication ;
34
- import zuo .biao .apijson .JSON ;
35
32
36
33
37
34
/**自动 UI 测试,需要用 UIAuto 发请求到这个设备
@@ -118,7 +115,6 @@ public static Intent createIntent(Context context, String list) {
118
115
119
116
private JSONArray touchList ;
120
117
121
- SharedPreferences cache ;
122
118
private long flowId = 0 ;
123
119
@ Override
124
120
protected void onCreate (Bundle savedInstanceState ) {
@@ -132,7 +128,7 @@ protected void onCreate(Bundle savedInstanceState) {
132
128
133
129
134
130
flowId = getIntent ().getLongExtra (INTENT_FLOW_ID , flowId );
135
- touchList = JSON .parseArray (getIntent ().getStringExtra (INTENT_TOUCH_LIST ));
131
+ //太卡 touchList = JSON.parseArray(getIntent().getStringExtra(INTENT_TOUCH_LIST));
136
132
137
133
//
138
134
// DisplayMetrics outMetrics = new DisplayMetrics();
@@ -157,7 +153,7 @@ protected void onCreate(Bundle savedInstanceState) {
157
153
158
154
if (touchList != null && touchList .isEmpty () == false ) { //TODO 回放操作
159
155
// recover(touchList);
160
- startActivityForResult (UIAutoListActivity .createIntent (DemoApplication .getInstance (), touchList == null ? null : touchList .toJSONString ()), REQUEST_UI_AUTO_LIST );
156
+ startActivity (UIAutoListActivity .createIntent (DemoApplication .getInstance (), touchList == null ? null : touchList .toJSONString ()));
161
157
// return;
162
158
}
163
159
@@ -364,11 +360,11 @@ public void onClick(View v) {
364
360
}
365
361
366
362
public void toRemote (View v ) {
367
- startActivityForResult (UIAutoListActivity .createIntent (context , false ), REQUEST_UI_AUTO_LIST );
363
+ startActivity (UIAutoListActivity .createIntent (context , false ));
368
364
}
369
365
370
366
public void toLocal (View v ) {
371
- startActivityForResult (UIAutoListActivity .createIntent (context , true ), REQUEST_UI_AUTO_LIST );
367
+ startActivity (UIAutoListActivity .createIntent (context , true ));
372
368
}
373
369
374
370
public void record (View v ) {
@@ -379,7 +375,7 @@ public void record(View v) {
379
375
// finish();
380
376
381
377
DemoApplication .getInstance ().onUIAutoActivityCreate (this );
382
- DemoApplication .getInstance ().record ( );
378
+ DemoApplication .getInstance ().prepareRecord ( this );
383
379
finish ();
384
380
}
385
381
@@ -806,35 +802,7 @@ public void record(View v) {
806
802
// return touchList;
807
803
// }
808
804
809
-
810
-
811
- public static final int REQUEST_UI_AUTO_LIST = 1 ;
812
-
813
- @ Override
814
- protected void onActivityResult (int requestCode , int resultCode , Intent data ) {
815
- super .onActivityResult (requestCode , resultCode , data );
816
-
817
- if (resultCode != RESULT_OK ) {
818
- return ;
819
- }
820
-
821
- if (requestCode == REQUEST_UI_AUTO_LIST ) {
822
- JSONArray array = data == null ? null : JSON .parseArray (data .getStringExtra (UIAutoListActivity .RESULT_LIST ));
823
- finish ();
824
-
825
- new Handler ().postDelayed (new Runnable () {
826
- @ Override
827
- public void run () {
828
- touchList = new JSONArray ();
829
- DemoApplication .getInstance ().recover (array );
830
- }
831
- }, 1000 );
832
- }
833
-
834
- }
835
-
836
-
837
- //
805
+ //
838
806
// private static class Node<E> {
839
807
// E item;
840
808
// Node<E> next;
0 commit comments