修改poi录像和道路录像的bug,抽屉滑动的bug

This commit is contained in:
wds
2021-08-11 11:04:52 +08:00
parent 74956539a7
commit 2ebe3377fb
16 changed files with 201 additions and 149 deletions

View File

@@ -105,8 +105,6 @@ public class LoginActivity extends BaseActivity implements View.OnClickListener
startActivity(forgetPaw);
break;
case R.id.btn_login:
Intent intent = new Intent(LoginActivity.this, HomeActivity.class);
startActivity(intent);
String name = etLoginName.getText().toString().trim();
if (name == null||name.equals("")) {
Toast.makeText(this, "请输入账号", Toast.LENGTH_SHORT).show();
@@ -117,7 +115,7 @@ public class LoginActivity extends BaseActivity implements View.OnClickListener
Toast.makeText(this, "请输入密码", Toast.LENGTH_SHORT).show();
return;
}
//initLogIn(name,paw);
initLogIn(name,paw);
break;
}
}

View File

@@ -116,8 +116,8 @@ public class MainActivity extends BaseActivity {
@Override
public void onGranted(List<String> permissions, boolean all) {
if (all) {
// initCheckVersion();
initTime();
initCheckVersion();
//initTime();
} else {
initPermission();
}

View File

@@ -19,6 +19,7 @@ import com.navinfo.outdoor.room.ChargingPileEntity;
import com.navinfo.outdoor.room.PoiEntity;
import com.navinfo.outdoor.util.FragmentBackHandler;
import com.navinfo.outdoor.util.GPSUtils;
import com.sothree.slidinguppanel.SlidingUpPanelLayout;
import com.tencent.tencentmap.mapsdk.maps.model.LatLng;
import org.greenrobot.eventbus.EventBus;
@@ -29,7 +30,7 @@ import org.greenrobot.eventbus.EventBus;
public abstract class BaseDrawerFragment extends BaseFragment {
public boolean isSliding = true; // fragment被销毁时true-抽屉收回false-抽屉状态不变
protected PoiEntity showPoiEntity;
public SlidingUpPanelLayout slidingPaneLayout;
@Override
protected void initData() {
super.initData();
@@ -81,7 +82,11 @@ public abstract class BaseDrawerFragment extends BaseFragment {
EventBus.getDefault().post(obtain);
}
}
public void setSlidingUpPanelLayout(SlidingUpPanelLayout slidingUpPanelLayout) {
if (slidingUpPanelLayout!=null) {
this.slidingPaneLayout = slidingUpPanelLayout;
}
}
@Override
public void onDestroy() {
super.onDestroy();

View File

@@ -26,6 +26,7 @@ import android.widget.Toast;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.widget.NestedScrollView;
import com.bumptech.glide.Glide;
import com.google.gson.Gson;
@@ -114,6 +115,7 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
private int taskId;
private Integer chargingPileBody;
private ArrayList<File> phoneLists;
private NestedScrollView nestedScrollView;
public static ChargingPileFragment newInstance(Bundle bundle) {
ChargingPileFragment fragment = new ChargingPileFragment();
@@ -361,6 +363,10 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
}
});
nestedScrollView = findViewById(R.id.nested_scroll_view);
if (slidingPaneLayout!=null) {
slidingPaneLayout.setScrollableView(nestedScrollView);
}
rlPanorama = findViewById(R.id.rl_panorama);
rlPanorama.setOnClickListener(this::onClick);
ivPanorama = findViewById(R.id.iv_panorama);

View File

@@ -27,6 +27,7 @@ import android.widget.Toast;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.widget.NestedScrollView;
import androidx.recyclerview.widget.GridLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
@@ -124,6 +125,7 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
// private ArrayList<File> fileList;
private File photoFile; // 拍照保存的路径
private NestedScrollView nestedScrollView;
public static ChargingStationFragment newInstance(Bundle bundle) {
ChargingStationFragment fragment = new ChargingStationFragment();
@@ -160,11 +162,6 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
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();
}
@@ -193,6 +190,10 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
chargingPileDao = poiDatabase.getChargingPileDao();
checkBoxLife = findViewById(R.id.check_pot_life);
checkBoxRight = findViewById(R.id.check_pot_right);
nestedScrollView = findViewById(R.id.nested_scroll_view);
if (slidingPaneLayout!=null) {
slidingPaneLayout.setScrollableView(nestedScrollView);
}
//添加桩
linearChargingPile = findViewById(R.id.linear_charging_pile);
linearChargingPile.setOnClickListener(this::onClick);
@@ -1329,10 +1330,10 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
if (EventBus.getDefault().isRegistered(this))//加上判断
EventBus.getDefault().unregister(this);
super.onDestroy();
new Thread(new Runnable() {
@Override
public void run() {
if (showPoiEntity.getId()!=null){
if (showPoiEntity!=null){
new Thread(new Runnable() {
@Override
public void run() {
PoiEntity poiDaoPoiEntity = poiDao.getPoiEntity(showPoiEntity.getId());
if (poiDaoPoiEntity != null) {
if (poiDaoPoiEntity.getTaskStatus() == 5) {
@@ -1341,8 +1342,8 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
}
}
}
}).start();
}).start();
}
}
@Override

View File

@@ -13,6 +13,7 @@ import androidx.appcompat.app.AppCompatActivity;
import androidx.constraintlayout.widget.ConstraintLayout;
import androidx.recyclerview.widget.DividerItemDecoration;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.slidingpanelayout.widget.SlidingPaneLayout;
import com.jcodecraeer.xrecyclerview.ProgressStyle;
import com.jcodecraeer.xrecyclerview.XRecyclerView;
@@ -28,6 +29,7 @@ import com.navinfo.outdoor.room.PoiDao;
import com.navinfo.outdoor.room.PoiDatabase;
import com.navinfo.outdoor.room.PoiEntity;
import com.navinfo.outdoor.util.GeometryTools;
import com.sothree.slidinguppanel.SlidingUpPanelLayout;
import com.tencent.tencentmap.mapsdk.maps.model.LatLng;
import com.vividsolutions.jts.geom.Geometry;
@@ -54,6 +56,7 @@ public class FilterFragment extends BaseDrawerFragment implements View.OnClickLi
private List<PoiEntity> allPoi;
public static FilterFragment newInstance(Bundle bundle) {
FilterFragment fragment = new FilterFragment();
fragment.setArguments(bundle);
@@ -247,6 +250,9 @@ public class FilterFragment extends BaseDrawerFragment implements View.OnClickLi
btnFilter = findViewById(R.id.btn_filter);
btnFilter.setOnClickListener(this::onClick);
recyclerFilter = findViewById(R.id.recycler_filter);
if (slidingPaneLayout!=null) {
slidingPaneLayout.setScrollableView(recyclerFilter);
}
//设置下划线
recyclerFilter.setLayoutManager(new LinearLayoutManager(getActivity()));
@@ -291,6 +297,8 @@ public class FilterFragment extends BaseDrawerFragment implements View.OnClickLi
});
}
@Override
public void onClick(View v) {
switch (v.getId()) {
@@ -299,11 +307,6 @@ public class FilterFragment extends BaseDrawerFragment implements View.OnClickLi
obtain.what = Constant.TREASURE_FRAGMENT;
obtain.obj = true;
EventBus.getDefault().post(obtain);
Message mainButtonVisiableMsg = Message.obtain();
mainButtonVisiableMsg.what = Constant.MAIN_BUTTON_VISIABLE;
mainButtonVisiableMsg.obj = View.VISIBLE;
EventBus.getDefault().post(mainButtonVisiableMsg);
break;
case R.id.cl_number:
BottomMenu.show((AppCompatActivity) getContext(), new String[]{"200", "500", "1000"}, new OnMenuItemClickListener() {

View File

@@ -590,10 +590,10 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
if (EventBus.getDefault().isRegistered(this))//加上判断
EventBus.getDefault().unregister(this);
super.onDestroy();
new Thread(new Runnable() {
@Override
public void run() {
if (showPoiEntity.getId()!=null){
if (showPoiEntity!=null){
new Thread(new Runnable() {
@Override
public void run() {
PoiEntity poiDaoPoiEntity = poiDao.getPoiEntity(showPoiEntity.getId());
if (poiDaoPoiEntity != null) {
if (poiDaoPoiEntity.getTaskStatus() == 5) {
@@ -602,8 +602,8 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
}
}
}
}).start();
}).start();
}
}
@Override

View File

@@ -26,6 +26,7 @@ import android.widget.Toast;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.widget.NestedScrollView;
import com.bumptech.glide.Glide;
import com.github.lazylibrary.util.StringUtils;
@@ -108,7 +109,7 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
private ArrayList<File> poiPicList;
private String tagPanorama;
private File file;
private NestedScrollView nestedScrollView;
public static PoiFragment newInstance(Bundle bundle) {
@@ -184,6 +185,12 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
}
});
nestedScrollView = findViewById(R.id.nested_scroll_view);
if (slidingPaneLayout!=null) {
slidingPaneLayout.setScrollableView(nestedScrollView);
}
checkBoxRight.setVisibility(View.GONE);
btnSaveLocal = findViewById(R.id.btn_save_local);
btnSaveLocal.setOnClickListener(this::onClick);
@@ -972,18 +979,20 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
if (EventBus.getDefault().isRegistered(this))//加上判断
EventBus.getDefault().unregister(this);
super.onDestroy();
new Thread(new Runnable() {
@Override
public void run() {
PoiEntity poiDaoPoiEntity = poiDao.getPoiEntity(showPoiEntity.getId());
if (poiDaoPoiEntity != null) {
if (poiDaoPoiEntity.getTaskStatus() == 5) {
poiDao.deletePoiEntity(poiDaoPoiEntity);
}
if (showPoiEntity!=null){
new Thread(new Runnable() {
@Override
public void run() {
PoiEntity poiDaoPoiEntity = poiDao.getPoiEntity(showPoiEntity.getId());
if (poiDaoPoiEntity != null) {
if (poiDaoPoiEntity.getTaskStatus() == 5) {
poiDao.deletePoiEntity(poiDaoPoiEntity);
}
}
}
}
}).start();
}).start();
}
}
@Override

View File

@@ -261,6 +261,7 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
public void onEvent(Message data) {
if (data.what == Constant.PICTURE_VIDEO_WORD) {
if ((boolean)data.obj){
initPoiVideoSharePre();
}
}
@@ -557,10 +558,10 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
if (EventBus.getDefault().isRegistered(this))//加上判断
EventBus.getDefault().unregister(this);
super.onDestroy();
new Thread(new Runnable() {
@Override
public void run() {
if (showPoiEntity.getId()!=null){
if (showPoiEntity!=null){
new Thread(new Runnable() {
@Override
public void run() {
PoiEntity poiDaoPoiEntity = poiDao.getPoiEntity(showPoiEntity.getId());
if (poiDaoPoiEntity != null) {
if (poiDaoPoiEntity.getTaskStatus() == 5) {
@@ -569,8 +570,8 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
}
}
}
}).start();
}).start();
}
}
@Override
@@ -619,6 +620,12 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
poiEntity.setType(3);
poiEntity.setTaskStatus(2);
poiEntity.setIsLocalData(1);
if (fmPoiVideoPic.getTag()==null){
List<File> videoFileListByUUID = AWMp4ParserHelper.getInstance().getVideoFileListByUUID(showPoiEntity.getId());
if (videoFileListByUUID!=null){
fmPoiVideoPic.setTag(videoFileListByUUID);
}
}
if (fmPoiVideoPic.getTag() != null &&!((List<File>) fmPoiVideoPic.getTag()).isEmpty()) {
List<LatLng> lineStringByVideoFileList = AWMp4ParserHelper.getInstance().getLineStringByVideoFileList((List<File>) fmPoiVideoPic.getTag());
String lineString = GeometryTools.getLineString(lineStringByVideoFileList);

View File

@@ -597,10 +597,10 @@ public class RoadFragment extends BaseDrawerFragment implements View.OnClickList
if (EventBus.getDefault().isRegistered(this))//加上判断
EventBus.getDefault().unregister(this);
super.onDestroy();
new Thread(new Runnable() {
@Override
public void run() {
if (showPoiEntity.getId()!=null){
if (showPoiEntity!=null){
new Thread(new Runnable() {
@Override
public void run() {
PoiEntity poiDaoPoiEntity = poiDao.getPoiEntity(showPoiEntity.getId());
if (poiDaoPoiEntity != null) {
if (poiDaoPoiEntity.getTaskStatus() == 5) {
@@ -609,8 +609,8 @@ public class RoadFragment extends BaseDrawerFragment implements View.OnClickList
}
}
}
}).start();
}).start();
}
}
@Override
@@ -659,6 +659,12 @@ public class RoadFragment extends BaseDrawerFragment implements View.OnClickList
poiEntity.setType(4);
poiEntity.setTaskStatus(2);
poiEntity.setIsLocalData(1);
if (fmRoadPic.getTag()==null){
List<File> videoFileListByUUID = AWMp4ParserHelper.getInstance().getVideoFileListByUUID(showPoiEntity.getId());
if (videoFileListByUUID!=null){
fmRoadPic.setTag(videoFileListByUUID);
}
}
if (fmRoadPic.getTag() != null &&!((List<File>) fmRoadPic.getTag()).isEmpty()) {
List<LatLng> lineStringByVideoFileList = AWMp4ParserHelper.getInstance().getLineStringByVideoFileList((List<File>) fmRoadPic.getTag());
String lineString = GeometryTools.getLineString(lineStringByVideoFileList);

View File

@@ -1476,6 +1476,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
break;
case R.id.iv_filter:
FilterFragment filterFragment = FilterFragment.newInstance(new Bundle());
filterFragment.setSlidingUpPanelLayout(sliding_layout);
showSlidingFragment(filterFragment);
refreshFilterData();
break;