完成‘其他’页面的布局展示和添加回退按钮
This commit is contained in:
@@ -21,6 +21,7 @@ import com.navinfo.outdoor.fragment.IssueFragment;
|
||||
import com.navinfo.outdoor.fragment.IssueWebFragment;
|
||||
import com.navinfo.outdoor.fragment.MapDownloadFragment;
|
||||
import com.navinfo.outdoor.fragment.MineFragment;
|
||||
import com.navinfo.outdoor.fragment.OtherFragment;
|
||||
import com.navinfo.outdoor.fragment.PoiFragment;
|
||||
import com.navinfo.outdoor.fragment.PoiTaskFragment;
|
||||
import com.navinfo.outdoor.fragment.PrivilegeFragment;
|
||||
@@ -84,7 +85,7 @@ public class FragmentManagement extends BaseActivity {
|
||||
private HasSubmitFragment hasSubmitFragment;//记录-已提交的fragment -30
|
||||
private PoiTaskFragment poiTaskFragment;//记录-已提交-POI任务列表的fragment -31
|
||||
private FilterFragment filterFragment;//寻宝-筛选界面 -32
|
||||
|
||||
private OtherFragment otherFragment;//寻宝-上传-其他的fragment -33
|
||||
@Override
|
||||
protected int getLayout() {
|
||||
return R.layout.management_fragment;
|
||||
@@ -165,8 +166,10 @@ public class FragmentManagement extends BaseActivity {
|
||||
fragmentTransaction.hide(hasSubmitFragment);
|
||||
if (poiTaskFragment != null) //记录-已提交-任务列表的fragment -31
|
||||
fragmentTransaction.hide(poiTaskFragment);
|
||||
if (filterFragment != null)//寻宝-删选
|
||||
if (filterFragment != null)//寻宝-筛选 -32
|
||||
fragmentTransaction.hide(filterFragment);
|
||||
if (otherFragment != null)//寻宝-上传-其他 -33
|
||||
fragmentTransaction.hide(otherFragment);
|
||||
|
||||
|
||||
}
|
||||
@@ -426,7 +429,7 @@ public class FragmentManagement extends BaseActivity {
|
||||
fragmentTransaction.show(poiTaskFragment);
|
||||
}
|
||||
break;
|
||||
case 32://寻宝- 删选
|
||||
case 32://寻宝- 筛选
|
||||
if (filterFragment == null) {
|
||||
filterFragment = FilterFragment.newInstance(new Bundle());
|
||||
fragmentTransaction.add(R.id.frame_layout, filterFragment);
|
||||
@@ -434,6 +437,14 @@ public class FragmentManagement extends BaseActivity {
|
||||
fragmentTransaction.show(filterFragment);
|
||||
}
|
||||
break;
|
||||
case 33://寻宝- 上传-其他
|
||||
if (otherFragment == null) {
|
||||
otherFragment = OtherFragment.newInstance(new Bundle());
|
||||
fragmentTransaction.add(R.id.frame_layout, otherFragment);
|
||||
} else {
|
||||
fragmentTransaction.show(otherFragment);
|
||||
}
|
||||
break;
|
||||
}
|
||||
fragmentTransaction.commit();
|
||||
}
|
||||
|
||||
@@ -105,7 +105,6 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
||||
obtain.what = Constant.MAIN_HEADER;
|
||||
obtain.obj = header;
|
||||
EventBus.getDefault().post(obtain);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -6,6 +6,7 @@ import android.util.Log;
|
||||
import android.view.LayoutInflater;
|
||||
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;
|
||||
@@ -52,6 +53,7 @@ public class FilterFragment extends BaseDrawerFragment implements View.OnClickLi
|
||||
obtain.what = Constant.MAIN_HEADER;
|
||||
obtain.obj = header;
|
||||
EventBus.getDefault().post(obtain);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,30 +1,57 @@
|
||||
package com.navinfo.outdoor.fragment;
|
||||
|
||||
import android.os.Bundle;
|
||||
|
||||
import androidx.fragment.app.Fragment;
|
||||
|
||||
import android.os.Message;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.EditText;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.slidingpanelayout.widget.SlidingPaneLayout;
|
||||
|
||||
import com.navinfo.outdoor.R;
|
||||
import com.navinfo.outdoor.base.BaseFragment;
|
||||
import com.navinfo.outdoor.api.Constant;
|
||||
import com.navinfo.outdoor.base.BaseDrawerFragment;
|
||||
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
|
||||
/**
|
||||
* 寻宝-上报-其他的fragment
|
||||
*/
|
||||
public class OtherFragment extends BaseFragment implements View.OnClickListener{
|
||||
public class OtherFragment extends BaseDrawerFragment implements View.OnClickListener {
|
||||
|
||||
private ImageView ivOtherFinal;
|
||||
|
||||
|
||||
public static OtherFragment newInstance(Bundle bundle) {
|
||||
OtherFragment fragment = new OtherFragment();
|
||||
fragment.setArguments(bundle);
|
||||
return fragment;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getLayout() {
|
||||
return R.layout.fragment_other;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStart() {
|
||||
super.onStart();
|
||||
View header = LayoutInflater.from(getActivity()).inflate(R.layout.other_header, null);
|
||||
Message obtain = Message.obtain();
|
||||
obtain.what = Constant.MAIN_HEADER;
|
||||
obtain.obj = header;
|
||||
EventBus.getDefault().post(obtain);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void initView() {
|
||||
super.initView();
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -34,6 +61,8 @@ public class OtherFragment extends BaseFragment implements View.OnClickListener
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
switch (v.getId()) {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,17 +1,10 @@
|
||||
package com.navinfo.outdoor.fragment;
|
||||
|
||||
import android.Manifest;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.Intent;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.Matrix;
|
||||
import android.media.ExifInterface;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.os.Message;
|
||||
import android.util.Log;
|
||||
import android.view.KeyEvent;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
@@ -34,11 +27,12 @@ import com.hjq.permissions.OnPermissionCallback;
|
||||
import com.hjq.permissions.Permission;
|
||||
import com.hjq.permissions.XXPermissions;
|
||||
import com.kongzue.dialog.interfaces.OnDialogButtonClickListener;
|
||||
import com.kongzue.dialog.interfaces.OnDismissListener;
|
||||
import com.kongzue.dialog.util.BaseDialog;
|
||||
import com.kongzue.dialog.util.DialogSettings;
|
||||
import com.kongzue.dialog.v3.MessageDialog;
|
||||
import com.kongzue.dialog.v3.ShareDialog;
|
||||
import com.navinfo.outdoor.R;
|
||||
import com.navinfo.outdoor.activity.FragmentManagement;
|
||||
import com.navinfo.outdoor.adapter.PoiRecycleAdapter;
|
||||
import com.navinfo.outdoor.api.Constant;
|
||||
import com.navinfo.outdoor.base.BaseDrawerFragment;
|
||||
@@ -47,14 +41,11 @@ import com.navinfo.outdoor.bean.PoiBean;
|
||||
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.navinfo.outdoor.util.ToastUtil;
|
||||
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
import org.greenrobot.eventbus.Subscribe;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.text.DateFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
@@ -109,12 +100,14 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
||||
if (!EventBus.getDefault().isRegistered(this)) {//加上判断
|
||||
EventBus.getDefault().register(this);
|
||||
}
|
||||
|
||||
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);
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -156,23 +149,25 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
||||
rlInternalPhotos.setOnClickListener(this::onClick);
|
||||
rlCard = findViewById(R.id.rl_card);
|
||||
rlCard.setOnClickListener(this::onClick);
|
||||
|
||||
rlElse = findViewById(R.id.rl_else);
|
||||
rlElse.setOnClickListener(this::onClick);
|
||||
recyclerPhone = findViewById(R.id.recycler_phone);
|
||||
|
||||
// 添加信息:
|
||||
showPoiEntity = (PoiEntity) getArguments().getSerializable("PoiEntity");
|
||||
if (showPoiEntity !=null){
|
||||
if (showPoiEntity != null) {
|
||||
editNameContent.setText(showPoiEntity.getName());
|
||||
inode= showPoiEntity.getX()+","+ showPoiEntity.getY();
|
||||
inode = showPoiEntity.getX() + "," + showPoiEntity.getY();
|
||||
editSiteContent.setText(showPoiEntity.getAddress());
|
||||
editDescribe.setText(showPoiEntity.getDescribe());
|
||||
phoneData.add(showPoiEntity.getTelPhone());
|
||||
phone= showPoiEntity.getTelPhone();
|
||||
if (showPoiEntity.getPhotoInfo()!=null){
|
||||
if (showPoiEntity.getPhotoInfo().get(0).getPhoto()!=null){
|
||||
phone = showPoiEntity.getTelPhone();
|
||||
if (showPoiEntity.getPhotoInfo() != null) {
|
||||
if (showPoiEntity.getPhotoInfo().get(0).getPhoto() != null) {
|
||||
Glide.with(getActivity()).load(showPoiEntity.getPhotoInfo().get(0).getPhoto()).into(ivPanorama);
|
||||
}
|
||||
if (showPoiEntity.getPhotoInfo().get(1).getPhoto()!=null){
|
||||
if (showPoiEntity.getPhotoInfo().get(1).getPhoto() != null) {
|
||||
Glide.with(getActivity()).load(showPoiEntity.getPhotoInfo().get(1).getPhoto()).into(ivName);
|
||||
}
|
||||
|
||||
@@ -213,8 +208,10 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
||||
//禁用所有可操作控件
|
||||
//disables();
|
||||
|
||||
|
||||
}
|
||||
//禁用所有可操作性控件
|
||||
|
||||
//禁用所有可操作性控件
|
||||
private void disables() {
|
||||
checkBoxLife.setEnabled(false);
|
||||
editNameContent.setEnabled(false);
|
||||
@@ -242,8 +239,6 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@Subscribe
|
||||
public void onEvent(Message data) {
|
||||
if (data.what == Constant.POI_WORD) {
|
||||
@@ -324,9 +319,9 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
||||
new Thread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (showPoiEntity!=null){
|
||||
if (showPoiEntity != null) {
|
||||
poiDao.updatePoiEntity(poiEntity);
|
||||
}else {
|
||||
} else {
|
||||
poiDao.insertPoiEntity(poiEntity);
|
||||
}
|
||||
|
||||
@@ -383,6 +378,7 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
||||
Intent intentElse = new Intent("android.media.action.IMAGE_CAPTURE");
|
||||
startActivityForResult(intentElse, 105);
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -72,6 +72,14 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
|
||||
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() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
getActivity().finish();
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -15,7 +15,6 @@ import android.widget.RadioGroup;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.bumptech.glide.Glide;
|
||||
import com.google.gson.Gson;
|
||||
import com.hjq.permissions.OnPermissionCallback;
|
||||
import com.hjq.permissions.Permission;
|
||||
@@ -24,9 +23,6 @@ import com.navinfo.outdoor.R;
|
||||
import com.navinfo.outdoor.activity.PictureActivity;
|
||||
import com.navinfo.outdoor.api.Constant;
|
||||
import com.navinfo.outdoor.base.BaseDrawerFragment;
|
||||
import com.navinfo.outdoor.base.BaseFragment;
|
||||
import com.navinfo.outdoor.bean.Info;
|
||||
import com.navinfo.outdoor.bean.JsonBean;
|
||||
import com.navinfo.outdoor.bean.RoadExtend;
|
||||
import com.navinfo.outdoor.room.PoiDao;
|
||||
import com.navinfo.outdoor.room.PoiDatabase;
|
||||
@@ -36,7 +32,6 @@ import org.greenrobot.eventbus.EventBus;
|
||||
|
||||
import java.text.DateFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Calendar;
|
||||
import java.util.List;
|
||||
|
||||
@@ -59,6 +54,7 @@ public class RoadFragment extends BaseDrawerFragment implements View.OnClickList
|
||||
private PoiDatabase poiDatabase;
|
||||
private PoiDao poiDao;
|
||||
private PoiEntity showPoiEntity;
|
||||
private ImageView ivRoadFinal;
|
||||
|
||||
public static RoadFragment newInstance(Bundle bundle) {
|
||||
RoadFragment fragment = new RoadFragment();
|
||||
@@ -79,8 +75,8 @@ public class RoadFragment extends BaseDrawerFragment implements View.OnClickList
|
||||
obtain.what = Constant.MAIN_HEADER;
|
||||
obtain.obj = header;
|
||||
EventBus.getDefault().post(obtain);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
@@ -92,7 +88,7 @@ public class RoadFragment extends BaseDrawerFragment implements View.OnClickList
|
||||
tvPictures.setOnClickListener(this::onClick);
|
||||
etRoadName = (EditText) findViewById(R.id.et_road_name);
|
||||
ivRoadPicture = (ImageView) findViewById(R.id.iv_road_picture);
|
||||
// Glide.with(getContext()).load(getLocalVideoBitmap(String.valueOf(R.drawable.bg_01))).into(ivRoadPicture);
|
||||
// Glide.with(getContext()).load(getLocalVideoBitmap(String.valueOf(R.drawable.bg_01))).into(ivRoadPicture);
|
||||
rbCar = (RadioButton) findViewById(R.id.rb_car);
|
||||
rbBicycle = (RadioButton) findViewById(R.id.rb_bicycle);
|
||||
rbWalking = (RadioButton) findViewById(R.id.rb_walking);
|
||||
@@ -105,6 +101,7 @@ public class RoadFragment extends BaseDrawerFragment implements View.OnClickList
|
||||
//禁用可操作性控件
|
||||
// disables();
|
||||
//获取
|
||||
|
||||
}
|
||||
|
||||
private void disables() {
|
||||
@@ -119,7 +116,7 @@ public class RoadFragment extends BaseDrawerFragment implements View.OnClickList
|
||||
@Override
|
||||
protected void initData() {
|
||||
super.initData();
|
||||
// infos = new ArrayList<>();
|
||||
// infos = new ArrayList<>();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -164,9 +161,9 @@ public class RoadFragment extends BaseDrawerFragment implements View.OnClickList
|
||||
}
|
||||
RoadExtend roadExtend = new RoadExtend();
|
||||
int type = getPictureType();
|
||||
if (type== -1){
|
||||
if (type == -1) {
|
||||
Toast.makeText(getContext(), "请选择拍照方式", Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
return;
|
||||
}
|
||||
roadExtend.setType(type);
|
||||
Gson gson = new Gson();
|
||||
@@ -187,7 +184,7 @@ public class RoadFragment extends BaseDrawerFragment implements View.OnClickList
|
||||
new Thread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (showPoiEntity!=null){
|
||||
if (showPoiEntity != null) {
|
||||
poiDao.updatePoiEntity(poiEntity);
|
||||
}
|
||||
poiDao.insertPoiEntity(poiEntity);
|
||||
@@ -213,6 +210,7 @@ public class RoadFragment extends BaseDrawerFragment implements View.OnClickList
|
||||
Intent intent = new Intent(getContext(), PictureActivity.class);
|
||||
startActivity(intent);
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -224,7 +222,7 @@ public class RoadFragment extends BaseDrawerFragment implements View.OnClickList
|
||||
return 1;
|
||||
} else if (rbWalking != null && rbWalking.isChecked()) {
|
||||
return 2;
|
||||
}else if (rbManual != null && rbManual.isChecked()) {
|
||||
} else if (rbManual != null && rbManual.isChecked()) {
|
||||
return 3;
|
||||
}
|
||||
return -1;
|
||||
|
||||
@@ -146,12 +146,10 @@ public class StaySubmitFragment extends BaseFragment implements View.OnClickList
|
||||
case 0:
|
||||
List<PoiEntity> poiEntities = initRoadWord(0);
|
||||
staySubmitAdapter.setAllRoad(poiEntities);
|
||||
// Toast.makeText(getContext(), "poi类型的数据"+poiEntities.toString(), Toast.LENGTH_SHORT).show();
|
||||
break;
|
||||
case 1:
|
||||
List<PoiEntity> poiEntitiesList = initRoadWord(1);
|
||||
staySubmitAdapter.setAllRoad(poiEntitiesList);
|
||||
// Toast.makeText(getContext(), "道路类型的数据"+poiEntitiesList.toString(), Toast.LENGTH_SHORT).show();
|
||||
break;
|
||||
}
|
||||
tvStayType.setText(text);
|
||||
|
||||
@@ -159,7 +159,7 @@ public class TaskPrefectureFragment extends BaseFragment implements View.OnClick
|
||||
public void onClick(View v) {
|
||||
switch (v.getId()){
|
||||
case R.id.iv_find_task:
|
||||
getActivity().finish();
|
||||
getActivity().finish();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -174,10 +174,10 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
fragmentTransaction.replace(R.id.frame_layout, gatherGetFragment);
|
||||
fragmentTransaction.commit();
|
||||
} else if (data.what == Constant.GATHER_GET) { // 点击开始采集
|
||||
PoiEntity poiEntity = (PoiEntity) data.obj;
|
||||
PoiEntity poiEntity = (PoiEntity) data.obj;
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putBoolean("isSliding", false); // 通知抽屉不收回
|
||||
bundle.putSerializable("PoiEntity",poiEntity);
|
||||
bundle.putSerializable("PoiEntity", poiEntity);
|
||||
frameLayout.setVisibility(View.GONE);
|
||||
fragmentTransaction.remove(gatherGetFragment);
|
||||
switch (poiEntity.getType()) {
|
||||
@@ -195,17 +195,20 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
break;
|
||||
case 3:
|
||||
break;
|
||||
case 4:
|
||||
OtherFragment otherFragment = OtherFragment.newInstance(new Bundle());
|
||||
showSlidingFragment(otherFragment);
|
||||
break;
|
||||
}
|
||||
} else if (data.what == Constant.FILTER_LIST) { // 筛选列表所有数据地图显示
|
||||
List<PoiEntity> poiEntities = (List<PoiEntity>) data.obj;
|
||||
initFilterMarker(poiEntities);
|
||||
} else if (data.what == Constant.TREASURE_WORD) { // POI采集-移动位置
|
||||
initPoiMarker(Boolean.valueOf((Boolean) data.obj),Constant.POI_WORD);
|
||||
initPoiMarker(Boolean.valueOf((Boolean) data.obj), Constant.POI_WORD);
|
||||
|
||||
}else if (data.what==Constant.MAIN_CHARGING_STATION){//道路采集-移动位置
|
||||
initPoiMarker(Boolean.valueOf((Boolean) data.obj),Constant.CHARGING_STATION_WORD);
|
||||
}
|
||||
else if (data.what == Constant.TREASURE_FRAGMENT) {
|
||||
} else if (data.what == Constant.MAIN_CHARGING_STATION) {//道路采集-移动位置
|
||||
initPoiMarker(Boolean.valueOf((Boolean) data.obj), Constant.CHARGING_STATION_WORD);
|
||||
} else if (data.what == Constant.TREASURE_FRAGMENT) {
|
||||
if ((boolean) data.obj == true) {
|
||||
frameLayout.setVisibility(View.GONE);
|
||||
sliding_layout.setPanelHeight(0);
|
||||
@@ -216,16 +219,16 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
}
|
||||
} else if (data.what == Constant.MAIN_BUTTON_VISIABLE) {
|
||||
setMainButtonVisiable((Integer) data.obj);
|
||||
}else if (data.what==Constant.MAIN_HEADER){
|
||||
} else if (data.what == Constant.MAIN_HEADER) {
|
||||
View view = (View) data.obj;
|
||||
initHeader(view);
|
||||
}else if (data.what==Constant.MAIN_REMOVE){
|
||||
if ((boolean)data.obj){
|
||||
} else if (data.what == Constant.MAIN_REMOVE) {
|
||||
if ((boolean) data.obj) {
|
||||
dragView.removeAllViews();
|
||||
}
|
||||
|
||||
}else if (data.what==Constant.GATHER_GET_RETURN){//item 点击页面的返回事件的处理
|
||||
if ((boolean)data.obj){
|
||||
} else if (data.what == Constant.GATHER_GET_RETURN) {//item 点击页面的返回事件的处理
|
||||
if ((boolean) data.obj) {
|
||||
frameLayout.setVisibility(View.GONE);
|
||||
sliding_layout.setPanelHeight(1000);
|
||||
sliding_layout.setPanelState(SlidingUpPanelLayout.PanelState.COLLAPSED);
|
||||
@@ -237,7 +240,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
|
||||
/**
|
||||
* 控制主界面各个按钮的显示状态
|
||||
* */
|
||||
*/
|
||||
private void setMainButtonVisiable(int visiable) {
|
||||
ivZoomAdd.setVisibility(visiable);
|
||||
ivZoomDel.setVisibility(visiable);
|
||||
@@ -259,7 +262,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
}
|
||||
|
||||
|
||||
private void initPoiMarker(Boolean t,int aInt) {
|
||||
private void initPoiMarker(Boolean t, int aInt) {
|
||||
if (t == true) {
|
||||
//移动地图
|
||||
CameraUpdate cameraSigma =
|
||||
@@ -293,7 +296,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
Constant.markerLatitude = latLng.latitude;
|
||||
Constant.markerLongitude = latLng.longitude;
|
||||
Message obtain = Message.obtain();
|
||||
obtain.what =aInt;
|
||||
obtain.what = aInt;
|
||||
obtain.obj = Constant.markerLatitude + "," + Constant.markerLongitude;
|
||||
EventBus.getDefault().post(obtain);
|
||||
|
||||
@@ -446,7 +449,8 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
showSlidingFragment(chargingStationFragment);
|
||||
break;
|
||||
case 4:
|
||||
Toast.makeText(getContext(), "其他", Toast.LENGTH_SHORT).show();
|
||||
OtherFragment otherFragment = OtherFragment.newInstance(new Bundle());
|
||||
showSlidingFragment(otherFragment);
|
||||
break;
|
||||
}
|
||||
return false;
|
||||
@@ -462,11 +466,21 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
|
||||
/**
|
||||
* header 头部布局
|
||||
*
|
||||
* @param view
|
||||
*/
|
||||
public void initHeader(View view){
|
||||
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);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -483,6 +497,12 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
fragmentTransaction.hide(filterFragment);
|
||||
}
|
||||
}
|
||||
if (!(fragment instanceof PoiFragment)) {
|
||||
PoiFragment poiFragment = (PoiFragment) supportFragmentManager.findFragmentByTag(PoiFragment.class.getName());
|
||||
if (poiFragment != null) {
|
||||
fragmentTransaction.hide(poiFragment);
|
||||
}
|
||||
}
|
||||
fragmentTransaction.show(fragment);
|
||||
fragmentTransaction.addToBackStack(null);
|
||||
fragmentTransaction.commit();
|
||||
|
||||
Reference in New Issue
Block a user