修改我的页面布局优化
This commit is contained in:
@@ -117,6 +117,7 @@ public class PictureActivity extends BaseActivity implements View.OnClickListene
|
||||
private int oratation = -1; // 是否强制横屏拍摄,默认不强制,0-强制横屏 其他-任意
|
||||
private List<Removable> removables;
|
||||
private String uuId;
|
||||
private ImageView ivPic;
|
||||
|
||||
@Override
|
||||
protected int getLayout() {
|
||||
@@ -130,7 +131,7 @@ public class PictureActivity extends BaseActivity implements View.OnClickListene
|
||||
protected void initView() {
|
||||
super.initView();
|
||||
|
||||
if (getIntent()!=null) {
|
||||
if (getIntent() != null) {
|
||||
finalVideoPath = getIntent().getStringExtra(Constant.INTENT_VIDEO_PATH);
|
||||
uuId = getIntent().getStringExtra("uuId");
|
||||
oratation = getIntent().getIntExtra(Constant.INTENT_VIDEO_ORATATION, -1);
|
||||
@@ -153,6 +154,7 @@ public class PictureActivity extends BaseActivity implements View.OnClickListene
|
||||
btnSwitch.setOnClickListener(this::onClick);
|
||||
// capturePicture = (ImageButton) findViewById(R.id.capturePicture);
|
||||
// capturePicture.setOnClickListener(this::onClick);
|
||||
ivPic = findViewById(R.id.iv_pic);
|
||||
//相机记录器
|
||||
CameraLogger.setLogLevel(CameraLogger.LEVEL_VERBOSE);
|
||||
camera = findViewById(R.id.camera);
|
||||
@@ -164,7 +166,7 @@ public class PictureActivity extends BaseActivity implements View.OnClickListene
|
||||
if (isChecked) { // 开始采集,设置按钮文字内容为“结束采集”
|
||||
if (oratation == 0) { // oratation为0时,拍摄视频必须为横屏
|
||||
// 如果当前手机是竖向,则不允许拍摄
|
||||
if (camera.getVideoSize().getWidth()<camera.getVideoSize().getHeight()) {
|
||||
if (camera.getVideoSize().getWidth() < camera.getVideoSize().getHeight()) {
|
||||
Toast.makeText(PictureActivity.this, "不允许竖向拍摄...", Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
}
|
||||
@@ -196,10 +198,10 @@ public class PictureActivity extends BaseActivity implements View.OnClickListene
|
||||
SizeSelector dimensions = SizeSelectors.and(width, height); // Matches sizes bigger than 1000x2000.
|
||||
// 获取屏幕信息
|
||||
int[] density = DensityUtil.getDeviceInfo(this);
|
||||
int x=1920, y=1440;
|
||||
if (density!=null&&density.length>1) {
|
||||
x = (density[0]>=density[1]?density[0]:density[1]);
|
||||
y = (density[0]>=density[1]?density[1]:density[0]);
|
||||
int x = 1920, y = 1440;
|
||||
if (density != null && density.length > 1) {
|
||||
x = (density[0] >= density[1] ? density[0] : density[1]);
|
||||
y = (density[0] >= density[1] ? density[1] : density[0]);
|
||||
}
|
||||
SizeSelector ratio = SizeSelectors.aspectRatio(AspectRatio.of(x, y), 0); // Matches 1:1 sizes.
|
||||
|
||||
@@ -209,7 +211,7 @@ public class PictureActivity extends BaseActivity implements View.OnClickListene
|
||||
SizeSelectors.biggest() // If none is found, take the biggest
|
||||
);
|
||||
camera.setVideoSize(result);
|
||||
camera.setVideoBitRate(1920*1440);
|
||||
camera.setVideoBitRate(1920 * 1440);
|
||||
// camera.setAudioBitRate();
|
||||
|
||||
//获取地图
|
||||
@@ -331,8 +333,8 @@ public class PictureActivity extends BaseActivity implements View.OnClickListene
|
||||
* 获取当前视频的时间,记录csv文件时使用
|
||||
* */
|
||||
// long currentTime = AWMp4ParserHelper.getInstance().getVedioTotalTime(new File(finalVideoPath));
|
||||
timerTask = new CsvTimerTask(new File(finalVideoPath+".txt"));
|
||||
timer.schedule(timerTask, 0, period*1000);
|
||||
timerTask = new CsvTimerTask(new File(finalVideoPath + ".txt"));
|
||||
timer.schedule(timerTask, 0, period * 1000);
|
||||
// // 开始采集,每隔2秒实时记录位置信息、视频时间以及设备时间
|
||||
// if (currentTime == 0) {
|
||||
// timer.schedule(timerTask, 0, period*1000);
|
||||
@@ -346,16 +348,16 @@ public class PictureActivity extends BaseActivity implements View.OnClickListene
|
||||
@Override
|
||||
public void onVideoRecordingEnd() {
|
||||
super.onVideoRecordingEnd();
|
||||
if (timerTask!=null){
|
||||
if (timerTask != null) {
|
||||
timerTask.cancel();
|
||||
}else {
|
||||
} else {
|
||||
// Toast.makeText(PictureActivity.this, "请先拍照", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
// 一段视频拍摄完成自动将当前拍摄路径加1
|
||||
File finalVideoFile = new File(finalVideoPath);
|
||||
if (finalVideoFile.exists()) {
|
||||
int videoIndex = Integer.parseInt(finalVideoFile.getName().replace(".mp4", ""));
|
||||
finalVideoPath = finalVideoFile.getParentFile().getAbsolutePath()+"/"+(videoIndex+1)+".mp4";
|
||||
finalVideoPath = finalVideoFile.getParentFile().getAbsolutePath() + "/" + (videoIndex + 1) + ".mp4";
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -364,18 +366,18 @@ public class PictureActivity extends BaseActivity implements View.OnClickListene
|
||||
DisplayMetrics dm = new DisplayMetrics();
|
||||
getWindowManager().getDefaultDisplay().getMetrics(dm);
|
||||
FrameLayout.LayoutParams layoutParamsMap = (FrameLayout.LayoutParams) ivMap.getLayoutParams();//相机的宽高
|
||||
layoutParamsMap.height = dm.widthPixels/3;
|
||||
layoutParamsMap.width = dm.heightPixels/3;
|
||||
layoutParamsMap.height = dm.widthPixels / 3;
|
||||
layoutParamsMap.width = dm.heightPixels / 3;
|
||||
ivMap.setLayoutParams(layoutParamsMap);
|
||||
}
|
||||
|
||||
|
||||
// 将秒转化成小时分钟秒
|
||||
private String formatMiss(long miss){
|
||||
String hh=miss/3600>9?miss/3600+"":"0"+miss/3600;
|
||||
String mm=(miss % 3600)/60>9?(miss % 3600)/60+"":"0"+(miss % 3600)/60;
|
||||
String ss=(miss % 3600) % 60>9?(miss % 3600) % 60+"":"0"+(miss % 3600) % 60;
|
||||
return hh+":"+mm+":"+ss;
|
||||
private String formatMiss(long miss) {
|
||||
String hh = miss / 3600 > 9 ? miss / 3600 + "" : "0" + miss / 3600;
|
||||
String mm = (miss % 3600) / 60 > 9 ? (miss % 3600) / 60 + "" : "0" + (miss % 3600) / 60;
|
||||
String ss = (miss % 3600) % 60 > 9 ? (miss % 3600) % 60 + "" : "0" + (miss % 3600) % 60;
|
||||
return hh + ":" + mm + ":" + ss;
|
||||
}
|
||||
|
||||
private void message(String content, Boolean important) {
|
||||
@@ -422,15 +424,16 @@ public class PictureActivity extends BaseActivity implements View.OnClickListene
|
||||
|
||||
|
||||
public void stopVideoAndFinish() {
|
||||
if (timerTask!=null){
|
||||
if (timerTask != null) {
|
||||
timerTask.cancel();
|
||||
Intent intent = new Intent();
|
||||
intent.putExtra(Constant.INTENT_VIDEO_PATH, finalVideoPath);
|
||||
setResult(0x101, intent);
|
||||
}else {
|
||||
} else {
|
||||
Toast.makeText(this, "本段视频没有计时!", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
if (camera.isTakingVideo()) {
|
||||
showLoadingDialog();
|
||||
isFinishActivity = true;
|
||||
camera.stopVideo();
|
||||
} else {
|
||||
@@ -449,7 +452,7 @@ public class PictureActivity extends BaseActivity implements View.OnClickListene
|
||||
// String formatVideoName = formatter.format(calendar.getTime());
|
||||
//文件
|
||||
// String path = finalVideoPath.substring(finalVideoPath.length()-20);
|
||||
if (finalVideoPath!=null){
|
||||
if (finalVideoPath != null) {
|
||||
File file = new File(finalVideoPath);
|
||||
if (file.exists()) {
|
||||
try {
|
||||
@@ -464,7 +467,7 @@ public class PictureActivity extends BaseActivity implements View.OnClickListene
|
||||
} else {
|
||||
camera.takeVideo(file);
|
||||
}
|
||||
}else {
|
||||
} else {
|
||||
Toast.makeText(this, "请录像", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
|
||||
@@ -587,14 +590,6 @@ public class PictureActivity extends BaseActivity implements View.OnClickListene
|
||||
break;
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public void onSaveInstanceState(@NonNull Bundle outState) {
|
||||
super.onSaveInstanceState(outState);
|
||||
Message obtain = Message.obtain();
|
||||
obtain.what = Constant.PICTURE_VIDEO_WORD;
|
||||
obtain.obj = true;
|
||||
EventBus.getDefault().post(obtain);
|
||||
}
|
||||
|
||||
/**
|
||||
* 记录视频拍摄的时间及经纬度
|
||||
@@ -626,19 +621,19 @@ public class PictureActivity extends BaseActivity implements View.OnClickListene
|
||||
sb.append(",");
|
||||
sb.append(Constant.currentLocation.getLongitude());
|
||||
sb.append(",");
|
||||
LatLng latLng = new LatLng(Constant.currentLocation.getLatitude(), Constant.currentLocation.getLongitude());
|
||||
Marker marker = tencentMap.addMarker(new MarkerOptions(latLng).alpha(0.9f)
|
||||
.flat(true)
|
||||
.clockwise(false));
|
||||
removables.add(marker);
|
||||
if (Constant.currentLocation.getBearing()!=0) {
|
||||
sb.append(Constant.currentLocation.getBearing());
|
||||
} else {
|
||||
sb.append(Constant.currentLocation.getDirection());
|
||||
}
|
||||
sb.append("\r\n");
|
||||
LatLng latLng = new LatLng(Constant.currentLocation.getLatitude(), Constant.currentLocation.getLongitude());
|
||||
Marker marker = tencentMap.addMarker(new MarkerOptions(latLng).alpha(0.9f)
|
||||
.flat(true)
|
||||
.clockwise(false));
|
||||
removables.add(marker);
|
||||
FileUtils.writeFile(csvFile.getAbsolutePath(), sb.toString(), true);
|
||||
currentVideoTime = currentVideoTime+period; //
|
||||
currentVideoTime = currentVideoTime + period; //
|
||||
recordingTime += period;
|
||||
runOnUiThread(updateTimeRunnable);
|
||||
}
|
||||
|
||||
@@ -43,6 +43,8 @@ import java.util.List;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import static com.tencent.mapsdk.internal.aaa.getContext;
|
||||
|
||||
/**
|
||||
* 用户资料
|
||||
*/
|
||||
@@ -162,6 +164,7 @@ public class UserActivity extends BaseActivity implements View.OnClickListener {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
netWork();
|
||||
break;
|
||||
}
|
||||
@@ -182,11 +185,12 @@ public class UserActivity extends BaseActivity implements View.OnClickListener {
|
||||
public void onSuccess(Response<UserBean> response) {
|
||||
dismissLoadingDialog();
|
||||
Log.d("TAG", "onSuccess: " + response.toString() + "sssssssssssss");
|
||||
|
||||
if (response.body().equals("0")) {
|
||||
MessageDialog.show(UserActivity.this, "是否保存", "取消", "确定", "取消").setOkButton(new OnDialogButtonClickListener() {
|
||||
@Override
|
||||
public boolean onClick(BaseDialog baseDialog, View v) {
|
||||
// Toast.makeText(getContext(), "点击了确定", Toast.LENGTH_SHORT).show();
|
||||
Toast.makeText(getContext(), "点击了确定", Toast.LENGTH_SHORT).show();
|
||||
return false;
|
||||
}
|
||||
});
|
||||
@@ -194,7 +198,7 @@ public class UserActivity extends BaseActivity implements View.OnClickListener {
|
||||
MessageDialog.show(UserActivity.this, "是否保存", "确定", "确定", "取消").setOkButton(new OnDialogButtonClickListener() {
|
||||
@Override
|
||||
public boolean onClick(BaseDialog baseDialog, View v) {
|
||||
// Toast.makeText(getContext(), "点击了确定", Toast.LENGTH_SHORT).show();
|
||||
Toast.makeText(getContext(), "点击了取消", Toast.LENGTH_SHORT).show();
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
@@ -200,15 +200,6 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
|
||||
ivPoiVideoPicture.setImageDrawable(null);
|
||||
}
|
||||
}
|
||||
// File videoFile = (File) fmPoiVideoPic.getTag();
|
||||
// if (videoFile != null) {
|
||||
// videoFile.delete();
|
||||
// //获取文件名
|
||||
// String csvFileName = videoFile.getName() + ".txt";
|
||||
// File cavFile = new File(videoFile.getParent(), csvFileName);
|
||||
// cavFile.delete();
|
||||
// ivPoiVideoPicture.setImageDrawable(null);
|
||||
// }
|
||||
return false;
|
||||
}
|
||||
});
|
||||
@@ -424,7 +415,6 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
|
||||
});
|
||||
}
|
||||
}).start();
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -484,8 +474,6 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
|
||||
} else {
|
||||
Toast.makeText(getActivity(), "" + poiVideoBean.getMessage(), Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -495,8 +495,6 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
Toast.makeText(getActivity(), "请求数据为空", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
Message obtain = Message.obtain();
|
||||
obtain.what = Constant.JOB_SEARCH_WORD;
|
||||
@@ -553,12 +551,13 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
Polygon polygon = tencentMap.addPolygon(new PolygonOptions().
|
||||
//连接封闭图形的点
|
||||
addAll(latPolygon).
|
||||
//填充颜色为红色
|
||||
//填充颜色为浅蓝色
|
||||
fillColor(Color.parseColor("#97E0E7EC")).
|
||||
//边线颜色为黑色
|
||||
strokeColor(0xff000000).
|
||||
//边线宽度15像素
|
||||
strokeWidth(25));
|
||||
|
||||
polygon.setZIndex(1);
|
||||
removablesMarker.add(polygon);
|
||||
com.vividsolutions.jts.geom.Point centroid = geometry.getCentroid();
|
||||
@@ -638,6 +637,8 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
List<LatLng> latLineString = GeometryTools.getLatLngs(geo);
|
||||
// 构造 PolylineOpitons
|
||||
PolylineOptions polylineOptions = new PolylineOptions()
|
||||
.alpha(0.5f)
|
||||
|
||||
.addAll(latLineString)
|
||||
// 折线设置圆形线头
|
||||
.lineCap(true)
|
||||
@@ -660,8 +661,8 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
Polygon polygon = tencentMap.addPolygon(new PolygonOptions().
|
||||
//连接封闭图形的点
|
||||
addAll(latPolygon).
|
||||
//填充颜色为红色
|
||||
fillColor(Color.parseColor("#97E0E74C")).
|
||||
//填充颜色为浅蓝色
|
||||
fillColor(Color.parseColor("#97E0E7EC")).
|
||||
//边线颜色为黑色
|
||||
strokeColor(0xff00ff00).
|
||||
//边线宽度15像素
|
||||
|
||||
@@ -14,6 +14,12 @@ import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
import com.kongzue.dialog.interfaces.OnDialogButtonClickListener;
|
||||
import com.kongzue.dialog.util.BaseDialog;
|
||||
import com.kongzue.dialog.util.DialogSettings;
|
||||
import com.kongzue.dialog.v3.MessageDialog;
|
||||
import com.lzy.okgo.model.HttpParams;
|
||||
import com.navinfo.outdoor.R;
|
||||
import com.navinfo.outdoor.activity.FragmentManagement;
|
||||
@@ -47,6 +53,7 @@ public class WithdrawFragment extends BaseFragment implements View.OnClickListen
|
||||
private TextView otherReportMoney;
|
||||
private SharedPreferences navInfo;
|
||||
private CheckBox checkBox;
|
||||
private String bankAccount;
|
||||
|
||||
public static WithdrawFragment newInstance(Bundle bundle) {
|
||||
WithdrawFragment fragment = new WithdrawFragment();
|
||||
@@ -82,10 +89,10 @@ public class WithdrawFragment extends BaseFragment implements View.OnClickListen
|
||||
@Override
|
||||
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
|
||||
if (isChecked){
|
||||
checkBox.setChecked(false);
|
||||
checkBox.setChecked(true);
|
||||
navInfo = getActivity().getSharedPreferences("navInfo", Context.MODE_PRIVATE);
|
||||
String bankAccount = navInfo.getString("bankAccount", null);
|
||||
if (bankAccount==null||bankAccount.equals("")){
|
||||
bankAccount = navInfo.getString("bankAccount", null);
|
||||
if (bankAccount ==null|| bankAccount.equals("")){
|
||||
String attestationName = navInfo.getString("attestationName", null);
|
||||
if (attestationName == null || attestationName.equals("")) {
|
||||
Intent attestationIntent = new Intent(getContext(), FragmentManagement.class);
|
||||
@@ -104,7 +111,6 @@ public class WithdrawFragment extends BaseFragment implements View.OnClickListen
|
||||
});
|
||||
btWithdraw = findViewById(R.id.button);
|
||||
btWithdraw.setOnClickListener(this::onClick);
|
||||
|
||||
poiPushMoney = (TextView) findViewById(R.id.poi_push_money);
|
||||
poiReportMoney = (TextView) findViewById(R.id.poi_report_money);
|
||||
poiVideoPushMoney = (TextView) findViewById(R.id.poiVideo_push_money);
|
||||
@@ -190,7 +196,20 @@ public class WithdrawFragment extends BaseFragment implements View.OnClickListen
|
||||
Toast.makeText(getContext(), "请勾选银行卡", Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
}
|
||||
immediatelyPrice();
|
||||
if (bankAccount!=null){
|
||||
DialogSettings.style = DialogSettings.STYLE.STYLE_KONGZUE;
|
||||
MessageDialog.show((AppCompatActivity) getContext(), "提示", "是否提取到"+bankAccount.substring(bankAccount.length()-4)+"的银行卡", "确定", "取消").setOkButton(new OnDialogButtonClickListener() {
|
||||
@Override
|
||||
public boolean onClick(BaseDialog baseDialog, View v) {
|
||||
immediatelyPrice();
|
||||
return false;
|
||||
}
|
||||
});
|
||||
}else {
|
||||
Toast.makeText(getContext(), "请先绑定银行卡", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
|
||||
|
||||
break;
|
||||
case R.id.tv_all:
|
||||
etAllPrice.setText(canExchangePrice + "");
|
||||
@@ -215,7 +234,13 @@ public class WithdrawFragment extends BaseFragment implements View.OnClickListen
|
||||
public void onSuccess(UserPriceExchangeBean response, int id) {
|
||||
dismissLoadingDialog();
|
||||
Toast.makeText(getContext(), response.getMessage(), Toast.LENGTH_SHORT).show();
|
||||
|
||||
if (response.getCode()==200){
|
||||
String unit = tvUnit.getText().toString();
|
||||
String price = etAllPrice.getText().toString();
|
||||
double v = Double.valueOf(unit) - Double.valueOf(price);
|
||||
String s = String.format("%.2f", v).toString();
|
||||
tvUnit.setText(s);
|
||||
}
|
||||
etAllPrice.getText().clear();
|
||||
|
||||
Log.d("TAG", "onSuccess: " + response.toString() + "tttttttt");
|
||||
|
||||
Reference in New Issue
Block a user