修改相机地图切换问题(存在bug)
This commit is contained in:
parent
1eebd16086
commit
c45468154a
@ -155,7 +155,6 @@ public class PicturesActivity extends BaseActivity implements View.OnClickListen
|
|||||||
ivLocation = findViewById(R.id.iv_location);
|
ivLocation = findViewById(R.id.iv_location);
|
||||||
ivLocation.setOnClickListener(this);
|
ivLocation.setOnClickListener(this);
|
||||||
camera = findViewById(R.id.camera);
|
camera = findViewById(R.id.camera);
|
||||||
camera.setOnClickListener(this);
|
|
||||||
capturePicture = findViewById(R.id.capture_picture);
|
capturePicture = findViewById(R.id.capture_picture);
|
||||||
if (type == 3) {
|
if (type == 3) {
|
||||||
capturePicture.setText("拍摄");
|
capturePicture.setText("拍摄");
|
||||||
@ -212,10 +211,23 @@ public class PicturesActivity extends BaseActivity implements View.OnClickListen
|
|||||||
public void onMapClick(LatLng latLng) {
|
public void onMapClick(LatLng latLng) {
|
||||||
btnSwitch.setEnabled(false);
|
btnSwitch.setEnabled(false);
|
||||||
handler.sendEmptyMessageDelayed(0x102, 2000);// 利用handler延迟发送更改状态信息
|
handler.sendEmptyMessageDelayed(0x102, 2000);// 利用handler延迟发送更改状态信息
|
||||||
|
DisplayMetrics dm = new DisplayMetrics();
|
||||||
|
getWindowManager().getDefaultDisplay().getMetrics(dm);
|
||||||
|
System.out.println("width-display :" + dm.widthPixels);
|
||||||
|
System.out.println("height-display :" + dm.heightPixels);
|
||||||
|
FrameLayout.LayoutParams layoutParamsMap = (FrameLayout.LayoutParams) ivMap.getLayoutParams();//地图的宽高
|
||||||
|
int heightMap = ivMap.getMeasuredHeight();
|
||||||
|
int widthMap = ivMap.getMeasuredWidth();
|
||||||
|
FrameLayout.LayoutParams layoutParamsCamera = (FrameLayout.LayoutParams) camera.getLayoutParams();//相机的宽高
|
||||||
|
int heightCamera = camera.getMeasuredHeight();
|
||||||
|
int widthCamera = camera.getMeasuredWidth();
|
||||||
|
if (heightMap<heightCamera){
|
||||||
benSwitch();
|
benSwitch();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
camera.addCameraListener(new CameraListener() {//相机预览监听
|
camera.addCameraListener(new CameraListener() {//相机预览监听
|
||||||
@Override
|
@Override
|
||||||
public void onPictureTaken(@NonNull @NotNull PictureResult result) {
|
public void onPictureTaken(@NonNull @NotNull PictureResult result) {
|
||||||
@ -280,6 +292,29 @@ public class PicturesActivity extends BaseActivity implements View.OnClickListen
|
|||||||
layoutParamsMap.height = dm.widthPixels / 3;
|
layoutParamsMap.height = dm.widthPixels / 3;
|
||||||
layoutParamsMap.width = dm.heightPixels / 3;
|
layoutParamsMap.width = dm.heightPixels / 3;
|
||||||
ivMap.setLayoutParams(layoutParamsMap);
|
ivMap.setLayoutParams(layoutParamsMap);
|
||||||
|
//相机监听
|
||||||
|
camera.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
benSwitch();
|
||||||
|
Toast.makeText(PicturesActivity.this, "dianjile1", Toast.LENGTH_SHORT).show();
|
||||||
|
// btnSwitch.setEnabled(false);
|
||||||
|
// handler.sendEmptyMessageDelayed(0x102, 2000);// 利用handler延迟发送更改状态信息
|
||||||
|
// DisplayMetrics dm = new DisplayMetrics();
|
||||||
|
// getWindowManager().getDefaultDisplay().getMetrics(dm);
|
||||||
|
// System.out.println("width-display :" + dm.widthPixels);
|
||||||
|
// System.out.println("height-display :" + dm.heightPixels);
|
||||||
|
// FrameLayout.LayoutParams layoutParamsMap = (FrameLayout.LayoutParams) ivMap.getLayoutParams();//地图的宽高
|
||||||
|
// int heightMap = ivMap.getMeasuredHeight();
|
||||||
|
// int widthMap = ivMap.getMeasuredWidth();
|
||||||
|
// FrameLayout.LayoutParams layoutParamsCamera = (FrameLayout.LayoutParams) camera.getLayoutParams();//相机的宽高
|
||||||
|
// int heightCamera = camera.getMeasuredHeight();
|
||||||
|
// int widthCamera = camera.getMeasuredWidth();
|
||||||
|
// if (heightMap>heightCamera){
|
||||||
|
// benSwitch();
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private void message(String content) {
|
private void message(String content) {
|
||||||
|
@ -441,6 +441,9 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void onLongDelPic() {
|
private void onLongDelPic() {
|
||||||
|
if (ivAvailable.getTag()!=null){
|
||||||
|
|
||||||
|
}
|
||||||
rlAvailable.setOnLongClickListener(new View.OnLongClickListener() {
|
rlAvailable.setOnLongClickListener(new View.OnLongClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public boolean onLongClick(View v) {
|
public boolean onLongClick(View v) {
|
||||||
|
@ -274,6 +274,7 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onNothingSelected(AdapterView<?> parent) {
|
public void onNothingSelected(AdapterView<?> parent) {
|
||||||
}
|
}
|
||||||
@ -286,6 +287,7 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
|||||||
|
|
||||||
//拍照长按删除
|
//拍照长按删除
|
||||||
private void onLongDel() {
|
private void onLongDel() {
|
||||||
|
if (ivPanorama.getTag() != null || ivName.getTag() != null || ivElse.getTag() != null || ivInternal.getTag() != null || ivCard.getTag() != null) {
|
||||||
rlPanorama.setOnLongClickListener(new View.OnLongClickListener() {
|
rlPanorama.setOnLongClickListener(new View.OnLongClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public boolean onLongClick(View v) {
|
public boolean onLongClick(View v) {
|
||||||
@ -300,6 +302,8 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
rlName.setOnLongClickListener(new View.OnLongClickListener() {
|
rlName.setOnLongClickListener(new View.OnLongClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public boolean onLongClick(View v) {
|
public boolean onLongClick(View v) {
|
||||||
@ -357,6 +361,7 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void initShowPoi() {
|
private void initShowPoi() {
|
||||||
// 添加信息:
|
// 添加信息:
|
||||||
@ -1051,13 +1056,14 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
|||||||
super.onSaveInstanceState(outState);
|
super.onSaveInstanceState(outState);
|
||||||
initPoiSharePre();
|
initPoiSharePre();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onDestroyView() {
|
public void onDestroyView() {
|
||||||
super.onDestroyView();
|
super.onDestroyView();
|
||||||
if (showPoiEntity != null) {
|
if (showPoiEntity != null) {
|
||||||
if (showPoiEntity.getTaskStatus() == 5) {
|
if (showPoiEntity.getTaskStatus() == 5) {
|
||||||
initEndReceiveTask(HttpInterface.UNRECEIVED_POLYGON_TASK, showPoiEntity);
|
initEndReceiveTask(HttpInterface.UNRECEIVED_POLYGON_TASK, showPoiEntity);
|
||||||
}else {
|
} else {
|
||||||
Message obtain = Message.obtain();
|
Message obtain = Message.obtain();
|
||||||
obtain.what = Constant.JOB_WORD_MONITOR;
|
obtain.what = Constant.JOB_WORD_MONITOR;
|
||||||
obtain.obj = true;
|
obtain.obj = true;
|
||||||
@ -1077,7 +1083,7 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void initEndReceiveTask(String url,PoiEntity poiEntity) {
|
private void initEndReceiveTask(String url, PoiEntity poiEntity) {
|
||||||
if (poiEntity.getTaskId() == 0) {
|
if (poiEntity.getTaskId() == 0) {
|
||||||
Toast.makeText(getActivity(), "无此任务", Toast.LENGTH_SHORT).show();
|
Toast.makeText(getActivity(), "无此任务", Toast.LENGTH_SHORT).show();
|
||||||
return;
|
return;
|
||||||
|
@ -3,9 +3,9 @@ package com.navinfo.outdoor.http;
|
|||||||
import com.navinfo.outdoor.api.Constant;
|
import com.navinfo.outdoor.api.Constant;
|
||||||
|
|
||||||
public class HttpInterface {
|
public class HttpInterface {
|
||||||
public static final String IP_TEST = "http://dtxbmaps.navinfo.com/dtxb/m4";//正式接口
|
public static final String IP = "http://dtxbmaps.navinfo.com/dtxb/m4";//正式接口
|
||||||
public static final String DATA_IP = "http://172.23.139.4:9999/m4";//接口
|
public static final String DATA_IP = "http://172.23.139.4:9999/m4";//接口
|
||||||
public static final String IP = "http://dtxbmaps.navinfo.com/dtxb_test/m4";//测试接口
|
public static final String IP_TEST = "http://dtxbmaps.navinfo.com/dtxb_test/m4";//测试接口
|
||||||
public static final String TEST_GUIDANCE_IP = "http://172.21.98.90:9999/m4";//引导页完成接口
|
public static final String TEST_GUIDANCE_IP = "http://172.21.98.90:9999/m4";//引导页完成接口
|
||||||
public static final String APKIP = "http://172.23.139.4:8001/";
|
public static final String APKIP = "http://172.23.139.4:8001/";
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user