添加禁止操作控件方法和完成记录待提交布局展示

This commit is contained in:
md
2021-06-16 18:22:26 +08:00
parent 51086db7dc
commit 4a2f21d13f
17 changed files with 609 additions and 145 deletions

View File

@@ -24,6 +24,7 @@ import com.navinfo.outdoor.fragment.PoiTaskFragment;
import com.navinfo.outdoor.fragment.PrivilegeFragment;
import com.navinfo.outdoor.fragment.RecordFragment;
import com.navinfo.outdoor.fragment.RoadFragment;
import com.navinfo.outdoor.fragment.RoadTaskFragment;
import com.navinfo.outdoor.fragment.SetFragment;
import com.navinfo.outdoor.fragment.StaySubmitFragment;
import com.navinfo.outdoor.fragment.TaskExWebFragment;
@@ -78,10 +79,10 @@ public class FragmentManagement extends BaseActivity {
private WithdrawalRecordFragment withdrawalRecordFragment;//我的-提现-提现记录的fragment -26
private PoiFragment poiFragment;//寻宝-上传-POI的fragment -27
private RoadFragment roadFragment;//寻宝-上传-道路的fragment -28
private StaySubmitFragment staySubmitFragment;//记录-待提交的fragment -29
private HasSubmitFragment hasSubmitFragment;//记录-已提交的fragment -30
//private PoiTaskFragment poiTaskFragment;//记录-已提交-POI任务列表的fragment -31
private PoiTaskFragment poiTaskFragment;//记录-已提交-POI任务列表的fragment -31
private RoadTaskFragment roadTaskFragment;//记录-已提交-道路任务列表的fragment -32
@Override
@@ -162,7 +163,10 @@ public class FragmentManagement extends BaseActivity {
fragmentTransaction.hide(staySubmitFragment);
if (hasSubmitFragment !=null) //记录-已提交的fragment -30
fragmentTransaction.hide(hasSubmitFragment);
if (poiTaskFragment !=null) //记录-已提交-任务列表的fragment -31
fragmentTransaction.hide(poiTaskFragment);
if (roadTaskFragment !=null) //记录-已提交-任务列表的fragment -31
fragmentTransaction.hide(roadTaskFragment);
}
@@ -414,6 +418,14 @@ public class FragmentManagement extends BaseActivity {
fragmentTransaction.show(hasSubmitFragment);
}
break;
case 31://记录-已提交-任务列表的fragment
if (poiTaskFragment ==null){
poiTaskFragment =new PoiTaskFragment();
fragmentTransaction.add(R.id.frame_layout, poiTaskFragment);
}else {
fragmentTransaction.show(poiTaskFragment);
}
break;
}
fragmentTransaction.commit();
}

View File

@@ -113,8 +113,7 @@ public class PictureActivity extends BaseActivity implements View.OnClickListene
//设置拍照的宽高
//camera.setVideoSize(SizeSelectors.or(SizeSelectors.maxHeight(1000), SizeSelectors.smallest(), SizeSelectors.aspectRatio(AspectRatio.of(1, 1), 0)));
camera.setVideoSize(SizeSelectors.or(SizeSelectors.maxHeight(Integer.parseInt(getIntent().getStringExtra("pic"))), SizeSelectors.aspectRatio(AspectRatio.of(1, 1), 0)));
//
// camera.setVideoSize(SizeSelectors.or(SizeSelectors.maxHeight(Integer.parseInt(getIntent().getStringExtra("pic"))), SizeSelectors.aspectRatio(AspectRatio.of(1, 1), 0)));
SdkFolderCreate.mkdirs(Constant.PICTURE_FOLDER);
//获取地图
tencentMap = ivMap.getMap();
@@ -194,9 +193,6 @@ public class PictureActivity extends BaseActivity implements View.OnClickListene
camera.takePicture();
}
break;
case R.id.btn_video:
// camera.stopVideo();
break;
case R.id.btn_switch:
btnSwich();
break;
@@ -216,7 +212,7 @@ public class PictureActivity extends BaseActivity implements View.OnClickListene
* 定位的一些初始化设置
*/
private void initLocation() {
//用于访问腾讯定位服务的类, 周期性向客户端提供位置更新
//用于访问腾讯定位服务的类, 周期性向客户端提供位置更新
locationManager = TencentLocationManager.getInstance(this);
//设置坐标系
locationManager.setCoordinateType(TencentLocationManager.COORDINATE_TYPE_GCJ02);

View File

@@ -0,0 +1,63 @@
package com.navinfo.outdoor.adapter;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.CheckBox;
import android.widget.LinearLayout;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import com.navinfo.outdoor.R;
import com.navinfo.outdoor.bean.CapacityMeasureBean;
import com.navinfo.outdoor.room.PoiEntity;
import org.jetbrains.annotations.NotNull;
import java.util.ArrayList;
import java.util.List;
public class StaySubmitAdapter extends RecyclerView.Adapter<StaySubmitAdapter.ViewHolder> {
private Context context;
public StaySubmitAdapter(Context context) {
this.context = context;
}
@NonNull
@NotNull
@Override
public ViewHolder onCreateViewHolder(@NonNull @NotNull ViewGroup parent, int viewType) {
View inflate = LayoutInflater.from(context).inflate(R.layout.stay_item, parent, false);
return new ViewHolder(inflate);
}
@Override
public void onBindViewHolder(@NonNull @NotNull ViewHolder holder, int position) {
}
@Override
public int getItemCount() {
return 0;
}
public class ViewHolder extends RecyclerView.ViewHolder {
private TextView tvCs1;
private TextView tvDay;
private CheckBox cbAll;
public ViewHolder(@NonNull @NotNull View itemView) {
super(itemView);
tvCs1 = itemView.findViewById(R.id.tv_cs1);
tvDay = itemView.findViewById(R.id.tv_day);
cbAll = itemView.findViewById(R.id.cb_all);
}
}
}

View File

@@ -48,14 +48,17 @@ public class HasSubmitFragment extends BaseFragment implements View.OnClickListe
auditProcess = (TextView) findViewById(R.id.audit_process);
auditThrough = (TextView) findViewById(R.id.audit_through);
auditNotThrough = (TextView) findViewById(R.id.audit_not_through);
clCharging = (ConstraintLayout) findViewById(R.id.cl_charging);
chargingAuditProcess = (TextView) findViewById(R.id.charging_audit_process);
chargingAuditThrough = (TextView) findViewById(R.id.charging_audit_through);
chargingAuditNotThrough = (TextView) findViewById(R.id.charging_audit_not_through);
clRoad = (ConstraintLayout) findViewById(R.id.cl_road);
clRoad.setOnClickListener(this::onClick);
roadAuditProcess = (TextView) findViewById(R.id.road_audit_process);
roadAuditThrough = (TextView) findViewById(R.id.road_audit_through);
roadAuditNotThrough = (TextView) findViewById(R.id.road_audit_not_through);
clCharging = (ConstraintLayout) findViewById(R.id.cl_charging);
clCharging.setOnClickListener(this::onClick);
chargingAuditProcess = (TextView) findViewById(R.id.charging_audit_process);
chargingAuditThrough = (TextView) findViewById(R.id.charging_audit_through);
chargingAuditNotThrough = (TextView) findViewById(R.id.charging_audit_not_through);
clOther = (ConstraintLayout) findViewById(R.id.cl_other);
otherAuditProcess = (TextView) findViewById(R.id.other_audit_process);
otherAuditThrough = (TextView) findViewById(R.id.other_audit_through);
@@ -70,8 +73,15 @@ public class HasSubmitFragment extends BaseFragment implements View.OnClickListe
@Override
public void onClick(View v) {
switch (v.getId()) {
case R.id.iv_poi:
// Intent hasIntent = new Intent(getContext(), FragmentManagement.class);
case R.id.cl_poi:
Intent hasIntent = new Intent(getContext(), FragmentManagement.class);
hasIntent.putExtra("tag",31);
startActivity(hasIntent);
break;
case R.id.cl_road:
break;
case R.id.cl_charging:
break;
}

View File

@@ -87,6 +87,8 @@ public class PoiFragment extends BaseDialogFragment implements View.OnClickListe
private List<Info> photoBean;
private boolean aBoolean = false;
private boolean bBoolean = false;
private CheckBox checkBoxLife;
private CheckBox checkBoxRight;
@Override
protected int getLayout() {
@@ -105,10 +107,12 @@ public class PoiFragment extends BaseDialogFragment implements View.OnClickListe
@Override
protected void initView() {
super.initView();
poiDatabase = PoiDatabase.getInstance(getContext());
poiDao = poiDatabase.getPoiDao();
CheckBox checkBoxLife = findViewById(R.id.check_pot_life);
CheckBox checkBoxRight = findViewById(R.id.check_pot_right);
checkBoxLife = findViewById(R.id.check_pot_life);
checkBoxRight = findViewById(R.id.check_pot_right);
checkBoxLife.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
@@ -180,7 +184,23 @@ public class PoiFragment extends BaseDialogFragment implements View.OnClickListe
}
}
});
//禁用所有可操作控件
// disables();
}
//禁用所有可操作性控件
private void disables() {
checkBoxLife.setEnabled(false);
editNameContent.setEnabled(false);
tvExamine.setEnabled(false);
editSiteContent.setEnabled(false);
recyclerPhone.setEnabled(false);
ivPanorama.setEnabled(false);
ivName.setEnabled(false);
ivInternal.setEnabled(false);
ivCard.setEnabled(false);
ivElse.setEnabled(false);
editDescribe.setEnabled(false);
btnSaveLocal.setEnabled(false);
}
@Override

View File

@@ -1,26 +1,73 @@
package com.navinfo.outdoor.fragment;
import android.os.Bundle;
import androidx.fragment.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import androidx.recyclerview.widget.DividerItemDecoration;
import androidx.recyclerview.widget.LinearLayoutManager;
import com.jcodecraeer.xrecyclerview.ArrowRefreshHeader;
import com.jcodecraeer.xrecyclerview.ProgressStyle;
import com.jcodecraeer.xrecyclerview.XRecyclerView;
import com.navinfo.outdoor.R;
import com.navinfo.outdoor.adapter.TaskExplainAdapter2;
import com.navinfo.outdoor.base.BaseFragment;
import com.umeng.commonsdk.debug.D;
/**
* 记录-已提交-poi任务列表
*/
public class PoiTaskFragment extends BaseFragment {
public class PoiTaskFragment extends BaseFragment implements View.OnClickListener {
private ImageView ivPoiTaskFinish;
private XRecyclerView poiTaskXrv;
@Override
protected int getLayout() {
return R.layout.fragment_poi_task;
}
@Override
protected void initView() {
super.initView();
ivPoiTaskFinish = (ImageView) findViewById(R.id.iv_poiTask_finish);
ivPoiTaskFinish.setOnClickListener(this::onClick);
poiTaskXrv = (XRecyclerView) findViewById(R.id.poiTask_xrv);
poiTaskXrv.setLayoutManager(new LinearLayoutManager(getContext()));
poiTaskXrv.addItemDecoration(new DividerItemDecoration(getContext(),DividerItemDecoration.VERTICAL));
poiTaskXrv.setRefreshProgressStyle(ProgressStyle.BallSpinFadeLoader);
poiTaskXrv.setLoadingMoreProgressStyle(ProgressStyle.BallRotate);
//取消上拉加载,刷新功能。
poiTaskXrv.setPullRefreshEnabled(false);
poiTaskXrv.setLoadingMoreEnabled(false);
poiTaskXrv.getDefaultFootView().setNoMoreHint("加载完毕");
poiTaskXrv.setLoadingListener(new XRecyclerView.LoadingListener() {
@Override
public void onRefresh() {
}
@Override
public void onLoadMore() {
}
});
}
@Override
protected void initData() {
super.initData();
}
@Override
public void onClick(View v) {
switch (v.getId()) {
case R.id.iv_poiTask_finish:
getActivity().finish();
break;
}
}
}

View File

@@ -1,32 +1,16 @@
package com.navinfo.outdoor.fragment;
import android.content.Intent;
import android.os.Bundle;
import android.os.Message;
import android.text.Editable;
import android.text.TextWatcher;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.RadioButton;
import android.widget.RadioGroup;
import android.widget.TextView;
import android.widget.Toast;
import androidx.fragment.app.FragmentActivity;
import com.navinfo.outdoor.R;
import com.navinfo.outdoor.activity.PictureActivity;
import com.navinfo.outdoor.api.Constant;
import com.navinfo.outdoor.base.BaseFragment;
import com.otaliastudios.cameraview.size.AspectRatio;
import com.otaliastudios.cameraview.size.SizeSelectors;
import org.greenrobot.eventbus.EventBus;
import org.greenrobot.eventbus.Subscribe;
import org.greenrobot.eventbus.ThreadMode;
import org.greenrobot.eventbus.EventBus;
import org.greenrobot.eventbus.Subscribe;
import org.greenrobot.eventbus.ThreadMode;
/**
* 寻宝-点击上传弹窗-道路
@@ -34,7 +18,15 @@ import org.greenrobot.eventbus.ThreadMode;
public class RoadFragment extends BaseFragment {
private TextView tvPictures;
private EditText etHeight;
private EditText etRoadName;
private ImageView ivRoadPicture;
private RadioButton rbCar;
private RadioButton rbBicycle;
private RadioButton rbWalking;
private RadioButton rbManual;
private EditText etDesc;
private Button btnRoadSave;
private RadioGroup rgType;
@Override
@@ -46,17 +38,31 @@ public class RoadFragment extends BaseFragment {
protected void initView() {
super.initView();
tvPictures = (TextView) findViewById(R.id.tv_pictures);
etHeight = (EditText) findViewById(R.id.et_height);
tvPictures.setOnClickListener(v -> {
String trim = etHeight.getText().toString().trim();
Intent intent = new Intent(getContext(), PictureActivity.class);
if (trim != null) {
intent.putExtra("pic", trim);
}else {
intent.putExtra("pic", 1000);
}
startActivity(intent);
});
etRoadName = (EditText) findViewById(R.id.et_road_name);
ivRoadPicture = (ImageView) findViewById(R.id.iv_road_picture);
rbCar = (RadioButton) findViewById(R.id.rb_car);
rbBicycle = (RadioButton) findViewById(R.id.rb_bicycle);
rbWalking = (RadioButton) findViewById(R.id.rb_walking);
rbManual = (RadioButton) findViewById(R.id.rb_manual);
etDesc = (EditText) findViewById(R.id.et_desc);
btnRoadSave = (Button) findViewById(R.id.btn_road_save);
rgType = (RadioGroup) findViewById(R.id.rg_type);
//禁用可操作性控件
// disables();
}
private void disables() {
etRoadName.setEnabled(false);
rgType.setEnabled(false);
ivRoadPicture.setEnabled(false);
tvPictures.setEnabled(false);
etDesc.setEnabled(false);
btnRoadSave.setEnabled(false);
}
@Override

View File

@@ -0,0 +1,39 @@
package com.navinfo.outdoor.fragment;
import android.os.Bundle;
import androidx.fragment.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.navinfo.outdoor.R;
import com.navinfo.outdoor.base.BaseFragment;
/**
* 记录-已提交-道路任务列表的fragment
*/
public class RoadTaskFragment extends BaseFragment implements View.OnClickListener {
@Override
protected int getLayout() {
return R.layout.fragment_road_task;
}
@Override
protected void initView() {
super.initView();
}
@Override
protected void initData() {
super.initData();
}
@Override
public void onClick(View v) {
}
}

View File

@@ -1,21 +1,38 @@
package com.navinfo.outdoor.fragment;
import android.os.Bundle;
import androidx.fragment.app.Fragment;
import android.view.LayoutInflater;
import android.util.Log;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.CheckBox;
import android.widget.TextView;
import android.widget.Toast;
import androidx.constraintlayout.widget.ConstraintLayout;
import androidx.recyclerview.widget.DividerItemDecoration;
import com.jcodecraeer.xrecyclerview.ProgressStyle;
import com.jcodecraeer.xrecyclerview.XRecyclerView;
import com.kongzue.dialog.interfaces.OnMenuItemClickListener;
import com.kongzue.dialog.v3.BottomMenu;
import com.navinfo.outdoor.R;
import com.navinfo.outdoor.adapter.StaySubmitAdapter;
import com.navinfo.outdoor.api.UserApplication;
import com.navinfo.outdoor.base.BaseFragment;
import com.navinfo.outdoor.room.PoiDao;
import com.navinfo.outdoor.room.PoiDatabase;
import com.navinfo.outdoor.room.PoiEntity;
import java.util.List;
/**
* 记录-待提交的fragment
*/
public class StaySubmitFragment extends BaseFragment implements View.OnClickListener {
private XRecyclerView stayXrv;
private CheckBox cbSelect;
private TextView tvDelete;
private Button btnStaySubmit;
private StaySubmitAdapter staySubmitAdapter;
private PoiDatabase poiDatabase;
private PoiDao poiDao;
private TextView tvStayType;
private TextView tvStayResult;
@Override
protected int getLayout() {
@@ -25,15 +42,66 @@ public class StaySubmitFragment extends BaseFragment implements View.OnClickList
@Override
protected void initView() {
super.initView();
poiDatabase = PoiDatabase.getInstance(getContext());
poiDao = poiDatabase.getPoiDao();
ConstraintLayout clStayType = findViewById(R.id.cl_stay_type);
clStayType.setOnClickListener(this::onClick);
tvStayType = findViewById(R.id.tv_stay_type);
tvStayResult = findViewById(R.id.tv_stay_result);
tvStayResult.setOnClickListener(this::onClick);
stayXrv = (XRecyclerView) findViewById(R.id.stay_xrv);
cbSelect = (CheckBox) findViewById(R.id.cb_select);
tvDelete = (TextView) findViewById(R.id.tv_delete);
btnStaySubmit = (Button) findViewById(R.id.btn_stay_submit);
stayXrv.addItemDecoration(new DividerItemDecoration(getContext(), DividerItemDecoration.VERTICAL));
stayXrv.setRefreshProgressStyle(ProgressStyle.BallSpinFadeLoader);
stayXrv.setLoadingMoreProgressStyle(ProgressStyle.BallRotate);
//取消上拉加载,刷新功能。
stayXrv.setPullRefreshEnabled(false);
stayXrv.setLoadingMoreEnabled(false);
staySubmitAdapter = new StaySubmitAdapter(getContext());
stayXrv.setAdapter(staySubmitAdapter);
stayXrv.getDefaultFootView().setNoMoreHint("加载完毕");
stayXrv.setLoadingListener(new XRecyclerView.LoadingListener() {
@Override
public void onRefresh() {
}
@Override
public void onLoadMore() {
}
});
}
@Override
protected void initData() {
super.initData();
}
@Override
public void onClick(View v) {
switch (v.getId()) {
case R.id.tv_stay_result:
Toast.makeText(getContext(), "点击了", Toast.LENGTH_SHORT).show();
new Thread(new Runnable() {
@Override
public void run() {
List<PoiEntity> allPoi = poiDao.getAllPoi();
Log.d("TAG", "run: " + allPoi.toString());
}
}).start();
break;
case R.id.cl_stay_type:
// BottomMenu.show(UserApplication.getUserApplication(), new String[]{"poi", "道路", "充电站", "其他"}, new OnMenuItemClickListener() {
// @Override
// public void onClick(String text, int index) {
// tvStayType.setText(text);
// }
// });
break;
}
}
}

View File

@@ -49,6 +49,7 @@ public class TaskExplainFragment2 extends BaseFragment implements View.OnClickLi
taskExplain2Recycler = findViewById(R.id.task_explain2_recycler);
ivTaskExplain2.setOnClickListener(this::onClick);
taskExplain2Recycler.setLayoutManager(new LinearLayoutManager(getActivity()));
//下划线
taskExplain2Recycler.addItemDecoration(new DividerItemDecoration(getActivity(),DividerItemDecoration.VERTICAL));
taskExplain2Recycler.setRefreshProgressStyle(ProgressStyle.BallSpinFadeLoader);
taskExplain2Recycler.setLoadingMoreProgressStyle(ProgressStyle.BallRotate);