huangcm
2025-04-09 02d4ce54b909bd733f12e9f3fa4c1b03cf2d6f45
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
package com.DeviceTest;
 
import static android.view.WindowManager.LayoutParams.*;
 
import java.io.File;
 
import com.DeviceTest.helper.ControlButtonUtil;
import com.DeviceTest.view.PointerLocationView;
import com.DeviceTest.view.PointerLocationView.OnPointCountChangeListener;
 
import android.app.Activity;
import android.graphics.Color;
import android.os.Bundle;
import android.view.KeyEvent;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
import android.view.View.OnTouchListener;
import android.view.Window;
import android.widget.Button;
import android.widget.TextView;
import android.util.Log;
 
public class TouchTestActivity extends Activity {
   TextView mText;
   TextView mTitle;
   PointerLocationView mPointerView;
   private Button passButton;
 
   
   public void onCreate(Bundle paramBundle) {
       super.onCreate(paramBundle);
 
       setTitle(getTitle() + "----("
               + getIntent().getStringExtra(DeviceTest.EXTRA_TEST_PROGRESS) + ")");
       requestWindowFeature(Window.FEATURE_NO_TITLE);
       getWindow().addFlags(FLAG_FULLSCREEN | FLAG_KEEP_SCREEN_ON);
 
       setContentView(R.layout.touchtest);
       getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_FULLSCREEN);
 
       mPointerView = (PointerLocationView) findViewById(R.id.pointerview);
       mPointerView.setBackgroundColor(Color.TRANSPARENT);
 
       mPointerView
               .setOnPointCountChangeListener(new OnPointCountChangeListener() {
 
                   
                   public void onPointCountChange(int newPointCount) {
                       Log.i("Jeffy", "Count:" + newPointCount);
                       if (newPointCount >= 20) {
//                            passButton.setVisibility(View.VISIBLE);
                           passButton.performClick();
                       }
                   }
               });
 
       ControlButtonUtil.initControlButtonView(this);
//        passButton = (Button) findViewById(R.id.btn_Pass);
//        passButton.setVisibility(View.INVISIBLE);
   }
 
   public boolean dispatchKeyEvent(KeyEvent event) {
       if (event.getKeyCode() == KeyEvent.KEYCODE_BACK) {
           return false;
       }
       return super.dispatchKeyEvent(event);
   }
 
}