完成寻宝-道路部分布局
This commit is contained in:
@@ -18,6 +18,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.PoiFragment;
|
||||
import com.navinfo.outdoor.fragment.PrivilegeFragment;
|
||||
import com.navinfo.outdoor.fragment.RecordFragment;
|
||||
import com.navinfo.outdoor.fragment.SetFragment;
|
||||
@@ -29,6 +30,7 @@ import com.navinfo.outdoor.fragment.TaskPrefectureFragment;
|
||||
import com.navinfo.outdoor.fragment.RegisterFragment;
|
||||
import com.navinfo.outdoor.fragment.TreasureFragment;
|
||||
import com.navinfo.outdoor.fragment.UserAttestationFragment;
|
||||
import com.navinfo.outdoor.fragment.RoadFragment;
|
||||
import com.navinfo.outdoor.fragment.WithdrawFragment;
|
||||
import com.gyf.immersionbar.ImmersionBar;
|
||||
import com.navinfo.outdoor.fragment.WithdrawalRecordFragment;
|
||||
@@ -71,6 +73,8 @@ public class FragmentManagement extends BaseActivity {
|
||||
private GatheringFragment gatheringFragment;//我的-用户资料-收款信息的fragment -24
|
||||
private UserAttestationFragment userAttestationFragment;//我的-用户资料-实名认证的fragment -25
|
||||
private WithdrawalRecordFragment withdrawalRecordFragment;//我的-提现-提现记录的fragment -26
|
||||
private PoiFragment poiFragment;//寻宝-上传-POI的fragment -27
|
||||
private RoadFragment roadFragment;//寻宝-上传-道路的fragment -28
|
||||
|
||||
|
||||
|
||||
@@ -142,8 +146,12 @@ public class FragmentManagement extends BaseActivity {
|
||||
fragmentTransaction.hide(gatheringFragment);
|
||||
if (userAttestationFragment!=null)//我的-用户资料-实名认证的fragment-25
|
||||
fragmentTransaction.hide(userAttestationFragment);
|
||||
if (withdrawalRecordFragment!=null)
|
||||
if (withdrawalRecordFragment!=null)//我的-提现-提现记录的fragment -26
|
||||
fragmentTransaction.hide(withdrawalRecordFragment);
|
||||
if (poiFragment !=null) //寻宝-上传-POI的fragment -27
|
||||
fragmentTransaction.hide(poiFragment);
|
||||
if (roadFragment !=null) //寻宝-上传-道路的fragment -28
|
||||
fragmentTransaction.hide(roadFragment);
|
||||
|
||||
|
||||
|
||||
@@ -356,7 +364,7 @@ public class FragmentManagement extends BaseActivity {
|
||||
fragmentTransaction.show(userAttestationFragment);
|
||||
}
|
||||
break;
|
||||
case 26:
|
||||
case 26://我的-提现-提现记录的fragment
|
||||
if (withdrawalRecordFragment ==null){
|
||||
withdrawalRecordFragment=new WithdrawalRecordFragment();
|
||||
fragmentTransaction.add(R.id.frame_layout,withdrawalRecordFragment);
|
||||
@@ -364,6 +372,22 @@ public class FragmentManagement extends BaseActivity {
|
||||
fragmentTransaction.show(withdrawalRecordFragment);
|
||||
}
|
||||
break;
|
||||
case 27://寻宝-上传-POI的fragment -
|
||||
if (poiFragment ==null){
|
||||
poiFragment=new PoiFragment();
|
||||
fragmentTransaction.add(R.id.frame_layout,poiFragment);
|
||||
}else {
|
||||
fragmentTransaction.show(poiFragment);
|
||||
}
|
||||
break;
|
||||
case 28://寻宝-上传-道路的fragment
|
||||
if (roadFragment ==null){
|
||||
roadFragment =new RoadFragment();
|
||||
fragmentTransaction.add(R.id.frame_layout, roadFragment);
|
||||
}else {
|
||||
fragmentTransaction.show(roadFragment);
|
||||
}
|
||||
break;
|
||||
}
|
||||
fragmentTransaction.commit();
|
||||
}
|
||||
@@ -450,6 +474,12 @@ public class FragmentManagement extends BaseActivity {
|
||||
case 26:
|
||||
withdrawalRecordFragment.onActivityResult(requestCode,resultCode,data);
|
||||
break;
|
||||
case 27:
|
||||
poiFragment.onActivityResult(requestCode,resultCode,data);
|
||||
break;
|
||||
case 28:
|
||||
roadFragment.onActivityResult(requestCode,resultCode,data);
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,64 @@
|
||||
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;
|
||||
|
||||
/**
|
||||
* 寻宝-点击上传弹窗点击poi
|
||||
*/
|
||||
public class PoiFragment extends Fragment {
|
||||
|
||||
// TODO: Rename parameter arguments, choose names that match
|
||||
// the fragment initialization parameters, e.g. ARG_ITEM_NUMBER
|
||||
private static final String ARG_PARAM1 = "param1";
|
||||
private static final String ARG_PARAM2 = "param2";
|
||||
|
||||
// TODO: Rename and change types of parameters
|
||||
private String mParam1;
|
||||
private String mParam2;
|
||||
|
||||
public PoiFragment() {
|
||||
// Required empty public constructor
|
||||
}
|
||||
|
||||
/**
|
||||
* Use this factory method to create a new instance of
|
||||
* this fragment using the provided parameters.
|
||||
*
|
||||
* @param param1 Parameter 1.
|
||||
* @param param2 Parameter 2.
|
||||
* @return A new instance of fragment PoiFragment.
|
||||
*/
|
||||
// TODO: Rename and change types and number of parameters
|
||||
public static PoiFragment newInstance(String param1, String param2) {
|
||||
PoiFragment fragment = new PoiFragment();
|
||||
Bundle args = new Bundle();
|
||||
args.putString(ARG_PARAM1, param1);
|
||||
args.putString(ARG_PARAM2, param2);
|
||||
fragment.setArguments(args);
|
||||
return fragment;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
if (getArguments() != null) {
|
||||
mParam1 = getArguments().getString(ARG_PARAM1);
|
||||
mParam2 = getArguments().getString(ARG_PARAM2);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
||||
Bundle savedInstanceState) {
|
||||
// Inflate the layout for this fragment
|
||||
return inflater.inflate(R.layout.fragment_poi, container, false);
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
/**
|
||||
* 寻宝-点击上传弹窗-道路
|
||||
*/
|
||||
public class RoadFragment extends BaseFragment implements View.OnClickListener {
|
||||
|
||||
|
||||
@Override
|
||||
protected int getLayout() {
|
||||
return R.layout.fragment_road;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initView() {
|
||||
super.initView();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initData() {
|
||||
super.initData();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -20,8 +20,10 @@ import android.widget.ImageView;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.fragment.app.FragmentManager;
|
||||
|
||||
import com.navinfo.outdoor.R;
|
||||
import com.navinfo.outdoor.activity.FragmentManagement;
|
||||
import com.navinfo.outdoor.api.Constant;
|
||||
import com.navinfo.outdoor.base.BaseFragment;
|
||||
import com.navinfo.outdoor.util.NetWorkUtils;
|
||||
@@ -59,6 +61,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
private MyLocationStyle locationStyle;
|
||||
private OnLocationChangedListener locationChangedListener;
|
||||
private ImageView ivLocation;
|
||||
private ImageView ivRefish;
|
||||
|
||||
@Override
|
||||
protected int getLayout() {
|
||||
@@ -68,6 +71,8 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
@Override
|
||||
protected void initView() {
|
||||
super.initView();
|
||||
ivRefish = findViewById(R.id.iv_refrish);
|
||||
ivRefish.setOnClickListener(this::onClick);
|
||||
treasureMap = (MapView) findViewById(R.id.treasure_map);
|
||||
tencentMap = treasureMap.getMap();
|
||||
cbMapType = (CheckBox) findViewById(R.id.cb_map_type);
|
||||
@@ -130,7 +135,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
//创建定位请求
|
||||
locationRequest = TencentLocationRequest.create();
|
||||
//设置定位周期(位置监听器回调周期)为3s
|
||||
locationRequest.setInterval(3000);
|
||||
// locationRequest.setInterval(3000);
|
||||
//地图上设置定位数据源
|
||||
tencentMap.setLocationSource(this);
|
||||
//设置当前位置可见
|
||||
@@ -211,6 +216,11 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
0)); //目标旋转角 0~360° (正北方为0)
|
||||
tencentMap.animateCamera(cameraSigma);
|
||||
break;
|
||||
case R.id.iv_refrish://
|
||||
Intent road = new Intent(getActivity(), FragmentManagement.class);
|
||||
road.putExtra("tag",28);
|
||||
startActivity(road);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user