返回键和充电站充电桩逻辑
This commit is contained in:
parent
e209eae9a0
commit
57db365390
@ -3,7 +3,7 @@ apply plugin: 'com.android.application'
|
||||
android {
|
||||
compileSdkVersion 29
|
||||
buildToolsVersion '29.0.2'
|
||||
ndkVersion '23.0.7123448'
|
||||
// ndkVersion '23.0.7123448'
|
||||
|
||||
defaultConfig {
|
||||
applicationId "com.navinfo.outdoor"
|
||||
|
@ -0,0 +1,57 @@
|
||||
package com.navinfo.outdoor.adapter;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.bumptech.glide.Glide;
|
||||
import com.navinfo.outdoor.R;
|
||||
import com.navinfo.outdoor.room.ChargingPileEntity;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class ChargingPileAdapter extends RecyclerView.Adapter<ChargingPileAdapter.ViewHolder> {
|
||||
private Context context;
|
||||
private List<ChargingPileEntity> chargingPileEntities=new ArrayList<>();
|
||||
|
||||
public ChargingPileAdapter(Context context) {
|
||||
this.context = context;
|
||||
}
|
||||
|
||||
public void setChargingPileEntities(List<ChargingPileEntity> chargingPileEntities) {
|
||||
this.chargingPileEntities.addAll(chargingPileEntities);
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
View inflate = LayoutInflater.from(context).inflate(R.layout.item_charging_pile, parent, false);
|
||||
return new ViewHolder(inflate);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull ViewHolder holder, int position) {
|
||||
String photo = chargingPileEntities.get(position).getPhotoInfo().get(0).getPhoto();
|
||||
Glide.with(context).load(photo).into(holder.imageView);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return chargingPileEntities.size();
|
||||
}
|
||||
|
||||
public class ViewHolder extends RecyclerView.ViewHolder {
|
||||
ImageView imageView;
|
||||
public ViewHolder(@NonNull View itemView) {
|
||||
super(itemView);
|
||||
imageView=itemView.findViewById(R.id.image);
|
||||
}
|
||||
}
|
||||
}
|
@ -52,6 +52,7 @@ public class Constant {
|
||||
public static final int CHARGING_STATION = 16;//跳转到充电桩
|
||||
public static final int MAIN_CHARGING_PILE= 18;//充电桩的Fragment 对地图页面marker 的一个展示
|
||||
public static final int CHARGING_PILE_WORD = 20;//地图页面marker 的经纬都回传
|
||||
public static final int CHARGING_PILE_STATION = 22;//将充电桩的数据回传给充电站
|
||||
/**
|
||||
* 用户当前位置
|
||||
*/
|
||||
|
@ -30,6 +30,7 @@ import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@ -158,6 +159,8 @@ public class CapacityMeasurementFragment extends BaseFragment implements View.On
|
||||
json.put("answer", examBeans.get(i).getAnswer());
|
||||
jsonArray.put(json);
|
||||
}
|
||||
|
||||
|
||||
examBeans.clear();
|
||||
Log.d("TAG", "initExamSubmit: " + jsonArray.toString());
|
||||
OkGoBuilder.getInstance()
|
||||
|
@ -41,6 +41,8 @@ import com.navinfo.outdoor.api.Constant;
|
||||
import com.navinfo.outdoor.base.BaseDrawerFragment;
|
||||
import com.navinfo.outdoor.bean.Info;
|
||||
import com.navinfo.outdoor.bean.PoiBean;
|
||||
import com.navinfo.outdoor.room.ChargingPileDao;
|
||||
import com.navinfo.outdoor.room.ChargingPileEntity;
|
||||
import com.navinfo.outdoor.room.PoiDao;
|
||||
import com.navinfo.outdoor.room.PoiDatabase;
|
||||
import com.navinfo.outdoor.room.PoiEntity;
|
||||
@ -65,7 +67,6 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
|
||||
private EditText editDescribe, editNameContent;
|
||||
private Button btnSaveLocal;
|
||||
private PoiDatabase poiDatabase;
|
||||
private PoiDao poiDao;
|
||||
private String inode;
|
||||
private List<Info> photoBean;
|
||||
private CheckBox checkBoxLife, checkBoxRight;
|
||||
@ -78,6 +79,7 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
|
||||
private RadioButton radioButton1, radioButton2, radioButton3, radioButton4, radioButton5, radioButton6;
|
||||
private RelativeLayout rlPanorama, rlCoding, rlEquipment, rlFacility, rlUsable, rlAvailable, rlParking, rlNumber;
|
||||
private ImageView ivPanorama, ivCoding, ivEquipment, ivFacility, ivUsable, ivAvailable, ivParking, ivNumber;
|
||||
private ChargingPileDao chargingPileDao;
|
||||
|
||||
public static ChargingPileFragment newInstance(Bundle bundle) {
|
||||
ChargingPileFragment fragment = new ChargingPileFragment();
|
||||
@ -96,18 +98,46 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
|
||||
if (!EventBus.getDefault().isRegistered(this)) {//加上判断
|
||||
EventBus.getDefault().register(this);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
View header = LayoutInflater.from(getActivity()).inflate(R.layout.charging_pile_header, null);
|
||||
Message obtain = Message.obtain();
|
||||
obtain.what = Constant.MAIN_HEADER;
|
||||
obtain.obj = header;
|
||||
EventBus.getDefault().post(obtain);
|
||||
header.findViewById(R.id.iv_final).setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
Bundle arguments = getArguments();
|
||||
if (arguments!=null) {
|
||||
isSliding= arguments.getBoolean("isSliding",true);
|
||||
Log.d("TAG", "onCreatessss: "+isSliding);
|
||||
}
|
||||
if (isSliding) {
|
||||
// 监听到返回按钮点击事件
|
||||
Message obtain = Message.obtain();
|
||||
obtain.what= Constant.TREASURE_FRAGMENT;
|
||||
obtain.obj=isSliding;
|
||||
EventBus.getDefault().post(obtain);
|
||||
|
||||
Message mainButtonVisiableMsg = Message.obtain();
|
||||
mainButtonVisiableMsg.what= Constant.MAIN_BUTTON_VISIABLE;
|
||||
mainButtonVisiableMsg.obj= View.VISIBLE;
|
||||
EventBus.getDefault().post(mainButtonVisiableMsg);
|
||||
}
|
||||
onBackPressed();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initView() {
|
||||
super.initView();
|
||||
poiDatabase = PoiDatabase.getInstance(getContext());
|
||||
poiDao = poiDatabase.getPoiDao();
|
||||
chargingPileDao = poiDatabase.getChargingPileDao();
|
||||
checkBoxLife = findViewById(R.id.check_pot_life);
|
||||
checkBoxRight = findViewById(R.id.check_pot_right);
|
||||
checkBoxLife.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
||||
@ -240,47 +270,46 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
|
||||
public void onGranted(List<String> permissions, boolean all) {
|
||||
if (all) {
|
||||
//保存数据库:
|
||||
PoiEntity poiEntity = new PoiEntity();
|
||||
ChargingPileEntity chargingPileEntity = new ChargingPileEntity();
|
||||
String name = editNameContent.getText().toString().trim();//名称
|
||||
if (name == null || name.equals("")) {
|
||||
Toast.makeText(getActivity(), "请输入 名称", Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
} else {
|
||||
poiEntity.setName(name);
|
||||
chargingPileEntity.setName(name);
|
||||
}
|
||||
if (inode == null || inode.equals("")) {
|
||||
Toast.makeText(getActivity(), "请确定点位", Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
} else {
|
||||
String[] split = inode.split(",");
|
||||
poiEntity.setX(split[0]);
|
||||
poiEntity.setY(split[1]);
|
||||
chargingPileEntity.setX(split[0]);
|
||||
chargingPileEntity.setY(split[1]);
|
||||
}
|
||||
String describe = editDescribe.getText().toString().trim();
|
||||
if (describe == null || describe.equals("")) {
|
||||
Toast.makeText(getActivity(), "请输入任务描述", Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
} else {
|
||||
poiEntity.setDescribe(describe);
|
||||
chargingPileEntity.setDescribe(describe);
|
||||
}
|
||||
if (photoBean.size() < 0) {
|
||||
Toast.makeText(getActivity(), "请拍照", Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
} else {
|
||||
poiEntity.setPhotoInfo(photoBean);
|
||||
chargingPileEntity.setPhotoInfo(photoBean);
|
||||
}
|
||||
DateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
calendar.setTimeInMillis(System.currentTimeMillis());
|
||||
String format = formatter.format(calendar.getTime());
|
||||
poiEntity.setCreateTime(format);
|
||||
poiEntity.setTaskStatus(0);
|
||||
new Thread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
poiDao.insertPoiEntity(poiEntity);
|
||||
}
|
||||
}).start();
|
||||
chargingPileEntity.setCreateTime(format);
|
||||
|
||||
Message obtain = Message.obtain();
|
||||
obtain.what = Constant.CHARGING_PILE_STATION;
|
||||
obtain.obj = chargingPileEntity;
|
||||
EventBus.getDefault().post(obtain);
|
||||
|
||||
Message obtains = Message.obtain();
|
||||
obtains.what = Constant.TREASURE_FRAGMENT;
|
||||
obtains.obj = false;
|
||||
|
@ -23,6 +23,7 @@ import android.widget.Toast;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.recyclerview.widget.DividerItemDecoration;
|
||||
import androidx.recyclerview.widget.GridLayoutManager;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
@ -35,15 +36,18 @@ import com.kongzue.dialog.util.BaseDialog;
|
||||
import com.kongzue.dialog.util.DialogSettings;
|
||||
import com.kongzue.dialog.v3.MessageDialog;
|
||||
import com.navinfo.outdoor.R;
|
||||
import com.navinfo.outdoor.adapter.ChargingPileAdapter;
|
||||
import com.navinfo.outdoor.adapter.PoiRecycleAdapter;
|
||||
import com.navinfo.outdoor.api.Constant;
|
||||
import com.navinfo.outdoor.base.BaseDrawerFragment;
|
||||
import com.navinfo.outdoor.bean.Info;
|
||||
import com.navinfo.outdoor.bean.PoiBean;
|
||||
import com.navinfo.outdoor.room.ChargingPileEntity;
|
||||
import com.navinfo.outdoor.room.PoiDao;
|
||||
import com.navinfo.outdoor.room.PoiDatabase;
|
||||
import com.navinfo.outdoor.room.PoiEntity;
|
||||
import com.navinfo.outdoor.util.PhotoPathUtil;
|
||||
import com.sothree.slidinguppanel.SlidingUpPanelLayout;
|
||||
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
import org.greenrobot.eventbus.Subscribe;
|
||||
@ -84,10 +88,11 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
||||
String[] ctype = new String[]{"全部", "poi", "道路", "充电站", "其他"};
|
||||
private ArrayAdapter<String> adapter;
|
||||
private LinearLayout linearChargingPile;
|
||||
private static ChargingStationFragment fragment;
|
||||
private RecyclerView recyclerStation;
|
||||
private ChargingPileAdapter chargingPileAdapter;
|
||||
|
||||
public static ChargingStationFragment newInstance(Bundle bundle) {
|
||||
fragment = new ChargingStationFragment();
|
||||
ChargingStationFragment fragment = new ChargingStationFragment();
|
||||
fragment.setArguments(bundle);
|
||||
return fragment;
|
||||
}
|
||||
@ -106,8 +111,7 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
||||
obtain.what = Constant.MAIN_HEADER;
|
||||
obtain.obj = header;
|
||||
EventBus.getDefault().post(obtain);
|
||||
ImageView ivChargingFinal = header.findViewById(R.id.iv_charging_final);
|
||||
ivChargingFinal.setOnClickListener(new View.OnClickListener() {
|
||||
header.findViewById(R.id.iv_final).setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
Bundle arguments = getArguments();
|
||||
@ -126,6 +130,7 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
||||
mainButtonVisiableMsg.obj= View.VISIBLE;
|
||||
EventBus.getDefault().post(mainButtonVisiableMsg);
|
||||
}
|
||||
onBackPressed();
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -136,34 +141,39 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
||||
if (!EventBus.getDefault().isRegistered(this)) {//加上判断
|
||||
EventBus.getDefault().register(this);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
View header = LayoutInflater.from(getActivity()).inflate(R.layout.charging_station_header, null);
|
||||
Message obtain = Message.obtain();
|
||||
obtain.what = Constant.MAIN_HEADER;
|
||||
obtain.obj = header;
|
||||
EventBus.getDefault().post(obtain);
|
||||
// ImageView ivChargingFinal = header.findViewById(R.id.iv_charging_final);
|
||||
// ivChargingFinal.setOnClickListener(new View.OnClickListener() {
|
||||
// @Override
|
||||
// public void onClick(View v) {
|
||||
// // fragment.dismissLoadingDialog();
|
||||
// Bundle arguments = getArguments();
|
||||
// if (arguments!=null) {
|
||||
// isSliding= arguments.getBoolean("isSliding",true);
|
||||
// Log.d("TAG", "onCreatessss: "+isSliding);
|
||||
// }
|
||||
// if (isSliding) {
|
||||
// // 监听到返回按钮点击事件
|
||||
// Message obtain = Message.obtain();
|
||||
// obtain.what= Constant.TREASURE_FRAGMENT;
|
||||
// obtain.obj=isSliding;
|
||||
// EventBus.getDefault().post(obtain);
|
||||
// Message mainButtonVisiableMsg = Message.obtain();
|
||||
// mainButtonVisiableMsg.what= Constant.MAIN_BUTTON_VISIABLE;
|
||||
// mainButtonVisiableMsg.obj= View.VISIBLE;
|
||||
// EventBus.getDefault().post(mainButtonVisiableMsg);
|
||||
// }
|
||||
// }
|
||||
// });
|
||||
header.findViewById(R.id.iv_final).setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
Bundle arguments = getArguments();
|
||||
if (arguments!=null) {
|
||||
isSliding= arguments.getBoolean("isSliding",true);
|
||||
Log.d("TAG", "onCreatessss: "+isSliding);
|
||||
}
|
||||
if (isSliding) {
|
||||
// 监听到返回按钮点击事件
|
||||
Message obtain = Message.obtain();
|
||||
obtain.what= Constant.TREASURE_FRAGMENT;
|
||||
obtain.obj=isSliding;
|
||||
EventBus.getDefault().post(obtain);
|
||||
|
||||
Message mainButtonVisiableMsg = Message.obtain();
|
||||
mainButtonVisiableMsg.what= Constant.MAIN_BUTTON_VISIABLE;
|
||||
mainButtonVisiableMsg.obj= View.VISIBLE;
|
||||
EventBus.getDefault().post(mainButtonVisiableMsg);
|
||||
}
|
||||
onBackPressed();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -257,6 +267,10 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
||||
}
|
||||
}
|
||||
});
|
||||
recyclerStation = findViewById(R.id.recycler_station);
|
||||
recyclerStation.setLayoutManager(new GridLayoutManager(getContext(),3));
|
||||
chargingPileAdapter = new ChargingPileAdapter(getContext());
|
||||
recyclerStation.setAdapter(chargingPileAdapter);
|
||||
//禁用所有可操作控件
|
||||
//disables();
|
||||
|
||||
@ -296,6 +310,11 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
||||
if (data.what == Constant.CHARGING_STATION_WORD) {
|
||||
inode = data.obj.toString();
|
||||
Toast.makeText(getContext(), inode, Toast.LENGTH_SHORT).show();
|
||||
}else if (data.what==Constant.CHARGING_PILE_STATION){
|
||||
ChargingPileEntity chargingPileEntity = (ChargingPileEntity) data.obj;
|
||||
ArrayList<ChargingPileEntity> chargingPileEntities = new ArrayList<>();
|
||||
chargingPileEntities.add(chargingPileEntity);
|
||||
chargingPileAdapter.setChargingPileEntities(chargingPileEntities);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -8,12 +8,10 @@ import android.view.View;
|
||||
import android.widget.Button;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.constraintlayout.widget.ConstraintLayout;
|
||||
import androidx.recyclerview.widget.DividerItemDecoration;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
|
||||
import com.jcodecraeer.xrecyclerview.ProgressStyle;
|
||||
import com.jcodecraeer.xrecyclerview.XRecyclerView;
|
||||
import com.kongzue.dialog.interfaces.OnMenuItemClickListener;
|
||||
@ -25,17 +23,15 @@ import com.navinfo.outdoor.base.BaseDrawerFragment;
|
||||
import com.navinfo.outdoor.room.PoiDao;
|
||||
import com.navinfo.outdoor.room.PoiDatabase;
|
||||
import com.navinfo.outdoor.room.PoiEntity;
|
||||
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class FilterFragment extends BaseDrawerFragment implements View.OnClickListener {
|
||||
private Button btnFilter;
|
||||
private XRecyclerView recyclerFilter;
|
||||
private TextView tvType, tvExclusive, tvPhotograph, tvNumber;
|
||||
private ConstraintLayout clPhotograph, clExclusive, clType, clNumber;
|
||||
private TextView tvType, tvExclusive, tvPhotograph,tvNumber;
|
||||
private ConstraintLayout clPhotograph, clExclusive, clType,clNumber;
|
||||
private PoiDatabase poiDatabase;
|
||||
private PoiDao poiDao;
|
||||
private FilterAdapter filterAdapter;
|
||||
@ -57,37 +53,32 @@ public class FilterFragment extends BaseDrawerFragment implements View.OnClickLi
|
||||
obtain.what = Constant.MAIN_HEADER;
|
||||
obtain.obj = header;
|
||||
EventBus.getDefault().post(obtain);
|
||||
ImageView ivFilterFinal = header.findViewById(R.id.iv_filter_final);
|
||||
ivFilterFinal.setOnClickListener(new View.OnClickListener() {
|
||||
header.findViewById(R.id.iv_final).setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
Bundle arguments = getArguments();
|
||||
if (arguments != null) {
|
||||
isSliding = arguments.getBoolean("isSliding", true);
|
||||
Log.d("TAG", "onCreatessss: " + isSliding);
|
||||
if (arguments!=null) {
|
||||
isSliding= arguments.getBoolean("isSliding",true);
|
||||
Log.d("TAG", "onCreatessss: "+isSliding);
|
||||
}
|
||||
if (isSliding) {
|
||||
// 监听到返回按钮点击事件
|
||||
Message obtain = Message.obtain();
|
||||
obtain.what = Constant.TREASURE_FRAGMENT;
|
||||
obtain.obj = isSliding;
|
||||
obtain.what= Constant.TREASURE_FRAGMENT;
|
||||
obtain.obj=isSliding;
|
||||
EventBus.getDefault().post(obtain);
|
||||
|
||||
Message mainButtonVisiableMsg = Message.obtain();
|
||||
mainButtonVisiableMsg.what = Constant.MAIN_BUTTON_VISIABLE;
|
||||
mainButtonVisiableMsg.obj = View.VISIBLE;
|
||||
mainButtonVisiableMsg.what= Constant.MAIN_BUTTON_VISIABLE;
|
||||
mainButtonVisiableMsg.obj= View.VISIBLE;
|
||||
EventBus.getDefault().post(mainButtonVisiableMsg);
|
||||
}
|
||||
onBackPressed();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStart() {
|
||||
super.onStart();
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
@ -96,28 +87,29 @@ public class FilterFragment extends BaseDrawerFragment implements View.OnClickLi
|
||||
obtain.what = Constant.MAIN_HEADER;
|
||||
obtain.obj = header;
|
||||
EventBus.getDefault().post(obtain);
|
||||
// ImageView ivFilterFinal = header.findViewById(R.id.iv_filter_final);
|
||||
// ivFilterFinal.setOnClickListener(new View.OnClickListener() {
|
||||
// @Override
|
||||
// public void onClick(View v) {
|
||||
// Bundle arguments = getArguments();
|
||||
// if (arguments != null) {
|
||||
// isSliding = arguments.getBoolean("isSliding", true);
|
||||
// Log.d("TAG", "onCreatessss: " + isSliding);
|
||||
// }
|
||||
// if (isSliding) {
|
||||
// // 监听到返回按钮点击事件
|
||||
// Message obtain = Message.obtain();
|
||||
// obtain.what = Constant.TREASURE_FRAGMENT;
|
||||
// obtain.obj = isSliding;
|
||||
// EventBus.getDefault().post(obtain);
|
||||
// Message mainButtonVisiableMsg = Message.obtain();
|
||||
// mainButtonVisiableMsg.what = Constant.MAIN_BUTTON_VISIABLE;
|
||||
// mainButtonVisiableMsg.obj = View.VISIBLE;
|
||||
// EventBus.getDefault().post(mainButtonVisiableMsg);
|
||||
// }
|
||||
// }
|
||||
// });
|
||||
header.findViewById(R.id.iv_final).setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
Bundle arguments = getArguments();
|
||||
if (arguments!=null) {
|
||||
isSliding= arguments.getBoolean("isSliding",true);
|
||||
Log.d("TAG", "onCreatessss: "+isSliding);
|
||||
}
|
||||
if (isSliding) {
|
||||
// 监听到返回按钮点击事件
|
||||
Message obtain = Message.obtain();
|
||||
obtain.what= Constant.TREASURE_FRAGMENT;
|
||||
obtain.obj=isSliding;
|
||||
EventBus.getDefault().post(obtain);
|
||||
|
||||
Message mainButtonVisiableMsg = Message.obtain();
|
||||
mainButtonVisiableMsg.what= Constant.MAIN_BUTTON_VISIABLE;
|
||||
mainButtonVisiableMsg.obj= View.VISIBLE;
|
||||
EventBus.getDefault().post(mainButtonVisiableMsg);
|
||||
}
|
||||
onBackPressed();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -125,11 +117,6 @@ public class FilterFragment extends BaseDrawerFragment implements View.OnClickLi
|
||||
return R.layout.fragment_filter;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPause() {
|
||||
super.onPause();
|
||||
poiEntities.clear();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initView() {
|
||||
@ -217,7 +204,7 @@ public class FilterFragment extends BaseDrawerFragment implements View.OnClickLi
|
||||
EventBus.getDefault().post(obtain);
|
||||
break;
|
||||
case R.id.cl_number:
|
||||
BottomMenu.show((AppCompatActivity) getContext(), new String[]{"200", "500", "1000"}, new OnMenuItemClickListener() {
|
||||
BottomMenu.show((AppCompatActivity) getContext(), new String[]{"200", "500","1000"}, new OnMenuItemClickListener() {
|
||||
@Override
|
||||
public void onClick(String text, int index) {
|
||||
tvNumber.setText(text);
|
||||
@ -225,7 +212,7 @@ public class FilterFragment extends BaseDrawerFragment implements View.OnClickLi
|
||||
});
|
||||
break;
|
||||
case R.id.cl_photograph:
|
||||
BottomMenu.show((AppCompatActivity) getContext(), new String[]{"全部", "专属任务", "普通任务"}, new OnMenuItemClickListener() {
|
||||
BottomMenu.show((AppCompatActivity) getContext(), new String[]{"全部","专属任务", "普通任务"}, new OnMenuItemClickListener() {
|
||||
@Override
|
||||
public void onClick(String text, int index) {
|
||||
tvPhotograph.setText(text);
|
||||
@ -234,7 +221,7 @@ public class FilterFragment extends BaseDrawerFragment implements View.OnClickLi
|
||||
});
|
||||
break;
|
||||
case R.id.cl_exclusive:
|
||||
BottomMenu.show((AppCompatActivity) getContext(), new String[]{"全部", "poi", "道路", "充电站", "其他"}, new OnMenuItemClickListener() {
|
||||
BottomMenu.show((AppCompatActivity) getContext(), new String[]{"全部","poi", "道路", "充电站", "其他"}, new OnMenuItemClickListener() {
|
||||
@Override
|
||||
public void onClick(String text, int index) {
|
||||
tvExclusive.setText(text);
|
||||
@ -242,12 +229,12 @@ public class FilterFragment extends BaseDrawerFragment implements View.OnClickLi
|
||||
});
|
||||
break;
|
||||
case R.id.cl_type:
|
||||
BottomMenu.show((AppCompatActivity) getContext(), new String[]{"全部", "已领取", "待提交", "未领取"}, new OnMenuItemClickListener() {
|
||||
BottomMenu.show((AppCompatActivity) getContext(), new String[]{"全部","已领取", "待提交","未领取"}, new OnMenuItemClickListener() {
|
||||
@Override
|
||||
public void onClick(String text, int index) {
|
||||
tvType.setText(text);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -23,6 +23,7 @@ public class ForgetPawFragment extends BaseFragment implements View.OnClickListe
|
||||
fragment.setArguments(bundle);
|
||||
return fragment;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getLayout() {
|
||||
return R.layout.fragment_forget_paw;
|
||||
|
@ -67,6 +67,7 @@ public class IssueFragment extends BaseFragment implements View.OnClickListener
|
||||
public void onSuccess(TaskExplainInfo taskExplainInfo, int id) {
|
||||
dismissLoadingDialog();
|
||||
issueProblemAdapter.setExplainList(taskExplainInfo.getBody().getData());
|
||||
|
||||
Log.d("TAG", "onSuccess: " + taskExplainInfo.getMsg() + "");
|
||||
}
|
||||
@Override
|
||||
|
@ -82,7 +82,6 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
||||
private CheckBox checkBoxRight;
|
||||
private String phone;
|
||||
private PoiEntity showPoiEntity;
|
||||
private View ivPoiFinal;
|
||||
|
||||
public static PoiFragment newInstance(Bundle bundle) {
|
||||
PoiFragment fragment = new PoiFragment();
|
||||
@ -102,13 +101,17 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
||||
EventBus.getDefault().register(this);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
View header = LayoutInflater.from(getActivity()).inflate(R.layout.poi_header, null);
|
||||
Message obtain = Message.obtain();
|
||||
obtain.what = Constant.MAIN_HEADER;
|
||||
obtain.obj = header;
|
||||
EventBus.getDefault().post(obtain);
|
||||
ImageView ivPoiFinal = header.findViewById(R.id.iv_poi_final);
|
||||
ivPoiFinal.setOnClickListener(new View.OnClickListener() {
|
||||
header.findViewById(R.id.iv_final).setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
Bundle arguments = getArguments();
|
||||
@ -118,15 +121,17 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
||||
}
|
||||
if (isSliding) {
|
||||
// 监听到返回按钮点击事件
|
||||
Message obtain1 = Message.obtain();
|
||||
obtain1.what= Constant.TREASURE_FRAGMENT;
|
||||
obtain1.obj=isSliding;
|
||||
EventBus.getDefault().post(obtain1);
|
||||
Message obtain = Message.obtain();
|
||||
obtain.what= Constant.TREASURE_FRAGMENT;
|
||||
obtain.obj=isSliding;
|
||||
EventBus.getDefault().post(obtain);
|
||||
|
||||
Message mainButtonVisiableMsg = Message.obtain();
|
||||
mainButtonVisiableMsg.what= Constant.MAIN_BUTTON_VISIABLE;
|
||||
mainButtonVisiableMsg.obj= View.VISIBLE;
|
||||
EventBus.getDefault().post(mainButtonVisiableMsg);
|
||||
}
|
||||
onBackPressed();
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -170,8 +175,7 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
||||
rlInternalPhotos.setOnClickListener(this::onClick);
|
||||
rlCard = findViewById(R.id.rl_card);
|
||||
rlCard.setOnClickListener(this::onClick);
|
||||
// ivPoiFinal = findViewById(R.id.iv_poi_final);
|
||||
// ivPoiFinal.setOnClickListener(this::onClick);
|
||||
|
||||
rlElse = findViewById(R.id.rl_else);
|
||||
rlElse.setOnClickListener(this::onClick);
|
||||
recyclerPhone = findViewById(R.id.recycler_phone);
|
||||
@ -401,7 +405,6 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
||||
startActivityForResult(intentElse, 105);
|
||||
break;
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -66,15 +66,14 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStart() {
|
||||
super.onStart();
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
View header = LayoutInflater.from(getActivity()).inflate(R.layout.poi_video_header, null);
|
||||
Message obtain = Message.obtain();
|
||||
obtain.what = Constant.MAIN_HEADER;
|
||||
obtain.obj = header;
|
||||
EventBus.getDefault().post(obtain);
|
||||
ImageView ivPoiVideoFinal = header.findViewById(R.id.iv_poiVideo_final);
|
||||
ivPoiVideoFinal.setOnClickListener(new View.OnClickListener() {
|
||||
header.findViewById(R.id.iv_final).setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
Bundle arguments = getArguments();
|
||||
@ -88,18 +87,20 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
|
||||
obtain.what= Constant.TREASURE_FRAGMENT;
|
||||
obtain.obj=isSliding;
|
||||
EventBus.getDefault().post(obtain);
|
||||
|
||||
Message mainButtonVisiableMsg = Message.obtain();
|
||||
mainButtonVisiableMsg.what= Constant.MAIN_BUTTON_VISIABLE;
|
||||
mainButtonVisiableMsg.obj= View.VISIBLE;
|
||||
EventBus.getDefault().post(mainButtonVisiableMsg);
|
||||
}
|
||||
onBackPressed();
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
protected void initView() {
|
||||
super.initView();
|
||||
|
@ -69,15 +69,14 @@ public class RoadFragment extends BaseDrawerFragment implements View.OnClickList
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStart() {
|
||||
super.onStart();
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
View header = LayoutInflater.from(getActivity()).inflate(R.layout.road_header, null);
|
||||
Message obtain = Message.obtain();
|
||||
obtain.what = Constant.MAIN_HEADER;
|
||||
obtain.obj = header;
|
||||
EventBus.getDefault().post(obtain);
|
||||
ImageView ivRoadFinal = header.findViewById(R.id.iv_road_final);
|
||||
ivRoadFinal.setOnClickListener(new View.OnClickListener() {
|
||||
header.findViewById(R.id.iv_final).setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
Bundle arguments = getArguments();
|
||||
@ -91,20 +90,17 @@ public class RoadFragment extends BaseDrawerFragment implements View.OnClickList
|
||||
obtain.what= Constant.TREASURE_FRAGMENT;
|
||||
obtain.obj=isSliding;
|
||||
EventBus.getDefault().post(obtain);
|
||||
|
||||
Message mainButtonVisiableMsg = Message.obtain();
|
||||
mainButtonVisiableMsg.what= Constant.MAIN_BUTTON_VISIABLE;
|
||||
mainButtonVisiableMsg.obj= View.VISIBLE;
|
||||
EventBus.getDefault().post(mainButtonVisiableMsg);
|
||||
}
|
||||
onBackPressed();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPause() {
|
||||
super.onPause();
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initView() {
|
||||
@ -143,7 +139,7 @@ public class RoadFragment extends BaseDrawerFragment implements View.OnClickList
|
||||
@Override
|
||||
protected void initData() {
|
||||
super.initData();
|
||||
|
||||
// infos = new ArrayList<>();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -194,6 +194,8 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
showSlidingFragment(chargingStationFragment);
|
||||
break;
|
||||
case 3:
|
||||
OtherFragment otherFragment = OtherFragment.newInstance(new Bundle());
|
||||
showSlidingFragment(otherFragment);
|
||||
break;
|
||||
}
|
||||
} else if (data.what == Constant.FILTER_LIST) { // 筛选列表所有数据地图显示
|
||||
@ -477,15 +479,6 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
public void initHeader(View view) {
|
||||
dragView.removeAllViews();
|
||||
dragView.addView(view);
|
||||
// view.findViewById(R.id.iv_final).setOnClickListener(new View.OnClickListener() {
|
||||
// @Override
|
||||
// public void onClick(View v) {
|
||||
// frameLayout.setVisibility(View.GONE);
|
||||
// sliding_layout.setPanelHeight(0);
|
||||
// sliding_layout.setPanelState(SlidingUpPanelLayout.PanelState.HIDDEN);
|
||||
// setMainButtonVisiable(View.VISIBLE);
|
||||
// }
|
||||
// });
|
||||
}
|
||||
|
||||
/**
|
||||
@ -502,7 +495,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
fragmentTransaction.hide(filterFragment);
|
||||
}
|
||||
}
|
||||
if (!(fragment instanceof FilterFragment)) {
|
||||
if (!(fragment instanceof ChargingStationFragment)) {
|
||||
ChargingStationFragment chargingStationFragment = (ChargingStationFragment) supportFragmentManager.findFragmentByTag(ChargingStationFragment.class.getName());
|
||||
if (chargingStationFragment != null) {
|
||||
fragmentTransaction.hide(chargingStationFragment);
|
||||
|
@ -3,6 +3,32 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
<LinearLayout
|
||||
android:id="@+id/rl_chargingStation"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="#1BA5F1"
|
||||
android:orientation="horizontal"
|
||||
android:paddingTop="@dimen/top_pind_sp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_final"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="45dp"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_marginLeft="15dp"
|
||||
android:src="@drawable/icon_arrow" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_charging"
|
||||
style="@style/text_style_toolbar_title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_toRightOf="@id/iv_find_task"
|
||||
android:text="充电桩" />
|
||||
</LinearLayout>
|
||||
<ImageView
|
||||
android:id="@+id/road_bg"
|
||||
android:layout_width="wrap_content"
|
||||
@ -11,7 +37,7 @@
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/rl_chargingStation"
|
||||
app:layout_constraintVertical_bias="1.0" />
|
||||
|
||||
<TextView
|
||||
|
@ -459,40 +459,38 @@
|
||||
android:id="@+id/tv_03"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="03.描述"
|
||||
android:text="03.添加"
|
||||
android:layout_margin="10dp"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/linear_photograph" />
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/recycler_station"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tv_03" />
|
||||
<LinearLayout
|
||||
android:id="@+id/linear_charging_pile"
|
||||
android:layout_width="120dp"
|
||||
android:layout_height="120dp"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="10dp"
|
||||
android:layout_marginStart="10dp"
|
||||
android:orientation="vertical"
|
||||
android:background="@drawable/underline"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/tv_03">
|
||||
app:layout_constraintTop_toBottomOf="@id/recycler_station">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:background="@drawable/plus"
|
||||
android:layout_gravity="center"
|
||||
android:layout_height="wrap_content" />
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="添加桩"
|
||||
android:textColor="#D1CBCB"
|
||||
android:layout_gravity="center"
|
||||
/>
|
||||
android:background="@drawable/plus" />
|
||||
</LinearLayout>
|
||||
<TextView
|
||||
android:id="@+id/tv_04"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="03.描述"
|
||||
android:text="04.描述"
|
||||
android:layout_margin="10dp"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/linear_charging_pile" />
|
||||
|
@ -15,7 +15,7 @@
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_charging_final"
|
||||
android:id="@+id/iv_final"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="45dp"
|
||||
android:layout_alignParentLeft="true"
|
||||
@ -27,7 +27,7 @@
|
||||
style="@style/text_style_toolbar_title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_toRightOf="@id/iv_find_task"
|
||||
android:text="道路" />
|
||||
android:text="充电站" />
|
||||
</LinearLayout>
|
||||
<ImageView
|
||||
android:id="@+id/road_bg"
|
||||
|
@ -16,7 +16,7 @@
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_filter_final"
|
||||
android:id="@+id/iv_final"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="45dp"
|
||||
android:layout_alignParentLeft="true"
|
||||
|
14
app/src/main/res/layout/item_charging_pile.xml
Normal file
14
app/src/main/res/layout/item_charging_pile.xml
Normal file
@ -0,0 +1,14 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/image"
|
||||
android:layout_width="120dp"
|
||||
android:layout_height="120dp"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
@ -16,7 +16,7 @@
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_poi_final"
|
||||
android:id="@+id/iv_final"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="45dp"
|
||||
android:layout_alignParentLeft="true"
|
||||
|
@ -15,7 +15,7 @@
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_poiVideo_final"
|
||||
android:id="@+id/iv_final"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="45dp"
|
||||
android:layout_alignParentLeft="true"
|
||||
|
@ -15,7 +15,7 @@
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_road_final"
|
||||
android:id="@+id/iv_final"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="45dp"
|
||||
android:layout_alignParentLeft="true"
|
||||
|
Loading…
x
Reference in New Issue
Block a user