Search in sources :

Example 1 with RoundImageView

use of com.example.menfer.byoureyes.NewViews.RoundImageView in project YourEyes by SevenLJY.

the class MapActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_map);
    img_toNavi = (RoundImageView) findViewById(R.id.img_toNavi);
    img_toHelp = (RoundImageView) findViewById(R.id.img_toHelp);
    //初始化传感器
    sensorManager = (SensorManager) getSystemService(Context.SENSOR_SERVICE);
    //初始化地图对象
    mapView = (MapView) findViewById(R.id.map);
    mapView.onCreate(savedInstanceState);
    //初始化AMap对象
    init();
    /**
         * 给定位图标添加点击事件
         * 点击后简单的跳转到输入目的地界面
         * */
    img_toNavi.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View view) {
            Intent intent = new Intent(MapActivity.this, PoiSearchActivity.class);
            startActivity(intent);
        }
    });
    img_toHelp.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View view) {
            Intent intent = new Intent(MapActivity.this, MenuActivity.class);
            startActivity(intent);
        }
    });
}
Also used : Intent(android.content.Intent) MapView(com.amap.api.maps.MapView) View(android.view.View) RoundImageView(com.example.menfer.byoureyes.NewViews.RoundImageView)

Example 2 with RoundImageView

use of com.example.menfer.byoureyes.NewViews.RoundImageView in project YourEyes by SevenLJY.

the class TestActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_test);
    btn_get = (Button) findViewById(R.id.btn_get);
    btn_post = (Button) findViewById(R.id.btn_post);
    tv_show = (TextView) findViewById(R.id.tv_show);
    iv_photo = (RoundImageView) findViewById(R.id.iv_photo);
    btn_getPhoto = (Button) findViewById(R.id.btn_getPhoto);
    btn_getGpsInfo = (Button) findViewById(R.id.btn_getGpsInfo);
    tv_gpsinfo = (TextView) findViewById(R.id.tv_gpsinfo);
    btn_bindService = (Button) findViewById(R.id.bindService);
    et_test = (EditText) findViewById(R.id.et_test);
    SpeechUtility.createUtility(TestActivity.this, SpeechConstant.APPID + "=58593564");
    final Intent serviceIntent = new Intent(TestActivity.this, LocationService.class);
    btn_get.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View view) {
            VoiceUtil.speak(TestActivity.this, "你好");
        }
    });
    btn_post.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View view) {
            VoiceUtil.voiceInput(TestActivity.this, et_test);
        }
    });
    btn_getPhoto.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View view) {
            new Thread() {

                @Override
                public void run() {
                    PhotoUtils.downloadPhoto(FixedValue.serverIP + "photo.jpg");
                    handler.sendEmptyMessage(0x124);
                }
            }.start();
        }
    });
    btn_getGpsInfo.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View view) {
            LocationUtils.startLocation(TestActivity.this);
            longitude = LocationUtils.getLongitude();
            tv_gpsinfo.setText(Double.toString(longitude));
        }
    });
    btn_bindService.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View view) {
            bindService(serviceIntent, conn, Service.BIND_AUTO_CREATE);
        }
    });
}
Also used : Intent(android.content.Intent) View(android.view.View) RoundImageView(com.example.menfer.byoureyes.NewViews.RoundImageView) TextView(android.widget.TextView)

Aggregations

Intent (android.content.Intent)2 View (android.view.View)2 RoundImageView (com.example.menfer.byoureyes.NewViews.RoundImageView)2 TextView (android.widget.TextView)1 MapView (com.amap.api.maps.MapView)1