修改弹窗上的bug

This commit is contained in:
wds
2021-08-12 13:02:07 +08:00
parent 6aee99ac85
commit 1942162fa4
15 changed files with 2439 additions and 2374 deletions

View File

@@ -5,6 +5,7 @@ import android.widget.TextView;
import com.navinfo.outdoor.R; import com.navinfo.outdoor.R;
import com.navinfo.outdoor.bean.JobSearchBean; import com.navinfo.outdoor.bean.JobSearchBean;
import com.navinfo.outdoor.util.SdkFolderCreate; import com.navinfo.outdoor.util.SdkFolderCreate;
import com.sothree.slidinguppanel.SlidingUpPanelLayout;
import com.tencent.map.geolocation.TencentLocation; import com.tencent.map.geolocation.TencentLocation;
import com.tencent.tencentmap.mapsdk.maps.MapView; import com.tencent.tencentmap.mapsdk.maps.MapView;
import com.tencent.tencentmap.mapsdk.maps.model.BitmapDescriptor; import com.tencent.tencentmap.mapsdk.maps.model.BitmapDescriptor;
@@ -133,5 +134,7 @@ public class Constant {
public static final String INTENT_VIDEO_PATH = "INTENT_VIDEO_PATH"; // 拍照界面指定的视频文件保存位置 public static final String INTENT_VIDEO_PATH = "INTENT_VIDEO_PATH"; // 拍照界面指定的视频文件保存位置
public static final String INTENT_VIDEO_ORATATION = "INTENT_VIDEO_ORATATION"; // 视频拍摄时屏幕方向 0-强制横屏 其他-任意 public static final String INTENT_VIDEO_ORATATION = "INTENT_VIDEO_ORATATION"; // 视频拍摄时屏幕方向 0-强制横屏 其他-任意
public static SlidingUpPanelLayout SLIDING_LAYOUT=null;//設置
public static boolean IS_FILTER_LIST_ITEM =true;//poi页面的查重 public static boolean IS_FILTER_LIST_ITEM =true;//poi页面的查重
} }

View File

@@ -101,8 +101,6 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
private String station; private String station;
private LatLng latLng; private LatLng latLng;
private File file; private File file;
private String takePhotoPath1; private String takePhotoPath1;
private String takePhotoPath2; private String takePhotoPath2;
private String takePhotoPath3; private String takePhotoPath3;
@@ -302,8 +300,6 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
case 9: case 9:
cp_floor = -5; cp_floor = -5;
break; break;
} }
} }
@@ -372,6 +368,7 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
} }
}); });
setSlidingUpPanelLayout(Constant.SLIDING_LAYOUT);
nestedScrollView = findViewById(R.id.nested_scroll_view); nestedScrollView = findViewById(R.id.nested_scroll_view);
if (slidingPaneLayout!=null) { if (slidingPaneLayout!=null) {
slidingPaneLayout.setScrollableView(nestedScrollView); slidingPaneLayout.setScrollableView(nestedScrollView);
@@ -421,9 +418,7 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
btnSaveLocal.setOnClickListener(this::onClick); btnSaveLocal.setOnClickListener(this::onClick);
//展示数据 //展示数据
initShowPileSharePre(); initShowPileSharePre();
onLongDelPic(); onLongDelPic();
} }
private void onLongDelPic() { private void onLongDelPic() {

View File

@@ -143,7 +143,12 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
public void onHiddenChanged(boolean hidden) { public void onHiddenChanged(boolean hidden) {
super.onHiddenChanged(hidden); super.onHiddenChanged(hidden);
if (!hidden) { if (!hidden) {
setSlidingUpPanelLayout(Constant.SLIDING_LAYOUT);
if (slidingPaneLayout!=null) {
slidingPaneLayout.setScrollableView(nestedScrollView);
}
initHeader(); initHeader();
} }
} }
@@ -183,14 +188,15 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
if (!EventBus.getDefault().isRegistered(this)) {//加上判断 if (!EventBus.getDefault().isRegistered(this)) {//加上判断
EventBus.getDefault().register(this); EventBus.getDefault().register(this);
} }
} }
@Override @Override
public void onResume() { public void onResume() {
super.onResume(); super.onResume();
initHeader(); initHeader();
}
}
@Override @Override
protected void initView() { protected void initView() {
super.initView(); super.initView();
@@ -200,6 +206,7 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
checkBoxLife = findViewById(R.id.check_pot_life); checkBoxLife = findViewById(R.id.check_pot_life);
checkBoxRight = findViewById(R.id.check_pot_right); checkBoxRight = findViewById(R.id.check_pot_right);
nestedScrollView = findViewById(R.id.nested_scroll_view); nestedScrollView = findViewById(R.id.nested_scroll_view);
setSlidingUpPanelLayout(Constant.SLIDING_LAYOUT);
if (slidingPaneLayout!=null) { if (slidingPaneLayout!=null) {
slidingPaneLayout.setScrollableView(nestedScrollView); slidingPaneLayout.setScrollableView(nestedScrollView);
} }

View File

@@ -67,6 +67,10 @@ public class FilterFragment extends BaseDrawerFragment implements View.OnClickLi
public void onHiddenChanged(boolean hidden) { public void onHiddenChanged(boolean hidden) {
super.onHiddenChanged(hidden); super.onHiddenChanged(hidden);
if (!hidden) { if (!hidden) {
setSlidingUpPanelLayout(Constant.SLIDING_LAYOUT);
if (slidingPaneLayout!=null) {
slidingPaneLayout.setScrollableView(recyclerFilter);
}
initHeader(); initHeader();
} }
} }
@@ -250,6 +254,7 @@ public class FilterFragment extends BaseDrawerFragment implements View.OnClickLi
btnFilter = findViewById(R.id.btn_filter); btnFilter = findViewById(R.id.btn_filter);
btnFilter.setOnClickListener(this::onClick); btnFilter.setOnClickListener(this::onClick);
setSlidingUpPanelLayout(Constant.SLIDING_LAYOUT);
recyclerFilter = findViewById(R.id.recycler_filter); recyclerFilter = findViewById(R.id.recycler_filter);
if (slidingPaneLayout!=null) { if (slidingPaneLayout!=null) {
slidingPaneLayout.setScrollableView(recyclerFilter); slidingPaneLayout.setScrollableView(recyclerFilter);
@@ -266,6 +271,17 @@ public class FilterFragment extends BaseDrawerFragment implements View.OnClickLi
recyclerFilter.setLoadingMoreEnabled(false); recyclerFilter.setLoadingMoreEnabled(false);
filterAdapter = new FilterAdapter(getContext(), poiEntities); filterAdapter = new FilterAdapter(getContext(), poiEntities);
recyclerFilter.setAdapter(filterAdapter); recyclerFilter.setAdapter(filterAdapter);
recyclerFilter.setScrollAlphaChangeListener(new XRecyclerView.ScrollAlphaChangeListener() {
@Override
public void onAlphaChange(int alpha) {
}
@Override
public int setLimitHeight() {
return 0;
}
});
recyclerFilter.getDefaultFootView().setNoMoreHint("成功加载完毕"); recyclerFilter.getDefaultFootView().setNoMoreHint("成功加载完毕");
recyclerFilter.setLoadingListener(new XRecyclerView.LoadingListener() { recyclerFilter.setLoadingListener(new XRecyclerView.LoadingListener() {

View File

@@ -194,6 +194,7 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
} }
}); });
setSlidingUpPanelLayout(Constant.SLIDING_LAYOUT);
nestedScrollView = findViewById(R.id.nested_scroll_view); nestedScrollView = findViewById(R.id.nested_scroll_view);
if (slidingPaneLayout!=null) { if (slidingPaneLayout!=null) {
slidingPaneLayout.setScrollableView(nestedScrollView); slidingPaneLayout.setScrollableView(nestedScrollView);

View File

@@ -158,6 +158,7 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
poiDao = poiDatabase.getPoiDao(); poiDao = poiDatabase.getPoiDao();
tvPictures = (TextView) findViewById(R.id.tv_pictures); tvPictures = (TextView) findViewById(R.id.tv_pictures);
tvPictures.setOnClickListener(this::onClick); tvPictures.setOnClickListener(this::onClick);
setSlidingUpPanelLayout(Constant.SLIDING_LAYOUT);
nestedScrollView = findViewById(R.id.nested_scroll_view); nestedScrollView = findViewById(R.id.nested_scroll_view);
if (slidingPaneLayout!=null){ if (slidingPaneLayout!=null){
slidingPaneLayout.setScrollableView(nestedScrollView); slidingPaneLayout.setScrollableView(nestedScrollView);

View File

@@ -157,6 +157,7 @@ public class RoadFragment extends BaseDrawerFragment implements View.OnClickList
poiDao = poiDatabase.getPoiDao(); poiDao = poiDatabase.getPoiDao();
tvPictures = (TextView) findViewById(R.id.tv_pictures); tvPictures = (TextView) findViewById(R.id.tv_pictures);
tvPictures.setOnClickListener(this::onClick); tvPictures.setOnClickListener(this::onClick);
setSlidingUpPanelLayout(Constant.SLIDING_LAYOUT);
nestedScrollView = findViewById(R.id.nested_scroll_view); nestedScrollView = findViewById(R.id.nested_scroll_view);
if (slidingPaneLayout!=null){ if (slidingPaneLayout!=null){
slidingPaneLayout.setScrollableView(nestedScrollView); slidingPaneLayout.setScrollableView(nestedScrollView);

View File

@@ -28,12 +28,14 @@ import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity; import androidx.appcompat.app.AppCompatActivity;
import androidx.core.widget.NestedScrollView; import androidx.core.widget.NestedScrollView;
import androidx.fragment.app.FragmentTransaction; import androidx.fragment.app.FragmentTransaction;
import androidx.recyclerview.widget.RecyclerView;
import com.github.lazylibrary.util.DensityUtil; import com.github.lazylibrary.util.DensityUtil;
import com.google.gson.Gson; import com.google.gson.Gson;
import com.hjq.permissions.OnPermissionCallback; import com.hjq.permissions.OnPermissionCallback;
import com.hjq.permissions.Permission; import com.hjq.permissions.Permission;
import com.hjq.permissions.XXPermissions; import com.hjq.permissions.XXPermissions;
import com.jcodecraeer.xrecyclerview.XRecyclerView;
import com.kongzue.dialog.interfaces.OnDialogButtonClickListener; import com.kongzue.dialog.interfaces.OnDialogButtonClickListener;
import com.kongzue.dialog.util.BaseDialog; import com.kongzue.dialog.util.BaseDialog;
import com.kongzue.dialog.util.DialogSettings; import com.kongzue.dialog.util.DialogSettings;
@@ -191,7 +193,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
// ivMessage.setVisibility(View.GONE); // ivMessage.setVisibility(View.GONE);
// } // }
cbMapType = (CheckBox) findViewById(R.id.cb_map_type); cbMapType = (CheckBox) findViewById(R.id.cb_map_type);
//sliding_layout.setScrollableViewHelper(new NestedScrollableViewHelper()); sliding_layout.setScrollableViewHelper(new NestedScrollableViewHelper());
//地图转换 //地图转换
cbMapType.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { cbMapType.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override @Override
@@ -363,6 +365,14 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
View child = nsv.getChildAt(0); View child = nsv.getChildAt(0);
return (child.getBottom() - (nsv.getHeight() + nsv.getScrollY())); return (child.getBottom() - (nsv.getHeight() + nsv.getScrollY()));
} }
} else if (mScrollableView instanceof XRecyclerView) {
if (isSlidingUp) {
return ((XRecyclerView) mScrollableView).getScrollDyCounter();
} else {
XRecyclerView nsv = ((XRecyclerView) mScrollableView);
View child = nsv.getChildAt(0);
return (child.getBottom() - (nsv.getHeight() + nsv.getScrollY()));
}
}else { }else {
return 0; return 0;
} }
@@ -1546,6 +1556,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
} else if (item.getText().equals("其他")) { } else if (item.getText().equals("其他")) {
showPoiMarkerByType(5, newPoiLatLng); showPoiMarkerByType(5, newPoiLatLng);
OtherFragment otherFragment = OtherFragment.newInstance(bundle); OtherFragment otherFragment = OtherFragment.newInstance(bundle);
otherFragment.setSlidingUpPanelLayout(sliding_layout);
showSlidingFragment(otherFragment); showSlidingFragment(otherFragment);
} }
return false; return false;
@@ -1554,7 +1565,6 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
break; break;
case R.id.iv_filter: case R.id.iv_filter:
FilterFragment filterFragment = FilterFragment.newInstance(new Bundle()); FilterFragment filterFragment = FilterFragment.newInstance(new Bundle());
filterFragment.setSlidingUpPanelLayout(sliding_layout);
showSlidingFragment(filterFragment); showSlidingFragment(filterFragment);
refreshFilterData(); refreshFilterData();
break; break;
@@ -1588,6 +1598,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
int[] deviceInfo = DensityUtil.getDeviceInfo(getActivity()); int[] deviceInfo = DensityUtil.getDeviceInfo(getActivity());
sliding_layout.setPanelHeight(deviceInfo[1] / 2); sliding_layout.setPanelHeight(deviceInfo[1] / 2);
sliding_layout.setPanelState(SlidingUpPanelLayout.PanelState.COLLAPSED); sliding_layout.setPanelState(SlidingUpPanelLayout.PanelState.COLLAPSED);
Constant.SLIDING_LAYOUT=sliding_layout;
fragmentTransaction.add(R.id.scroll_view, fragment, fragment.getClass().getName()); fragmentTransaction.add(R.id.scroll_view, fragment, fragment.getClass().getName());
if (!(fragment instanceof FilterFragment)) { if (!(fragment instanceof FilterFragment)) {
FilterFragment filterFragment = (FilterFragment) supportFragmentManager.findFragmentByTag(FilterFragment.class.getName()); FilterFragment filterFragment = (FilterFragment) supportFragmentManager.findFragmentByTag(FilterFragment.class.getName());

View File

@@ -18,8 +18,11 @@
<androidx.core.widget.NestedScrollView <androidx.core.widget.NestedScrollView
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:id="@+id/nested_scroll_view" android:id="@+id/nested_scroll_view">
> <LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<androidx.constraintlayout.widget.ConstraintLayout <androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
@@ -839,5 +842,6 @@
</LinearLayout> </LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>
</LinearLayout>
</androidx.core.widget.NestedScrollView> </androidx.core.widget.NestedScrollView>
</LinearLayout> </LinearLayout>

View File

@@ -19,6 +19,10 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
> >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<androidx.constraintlayout.widget.ConstraintLayout <androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="match_parent">
@@ -638,6 +642,8 @@
android:text="上传" /> android:text="上传" />
</LinearLayout> </LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>
</LinearLayout>
</androidx.core.widget.NestedScrollView> </androidx.core.widget.NestedScrollView>

View File

@@ -213,6 +213,5 @@
<com.jcodecraeer.xrecyclerview.XRecyclerView <com.jcodecraeer.xrecyclerview.XRecyclerView
android:id="@+id/recycler_filter" android:id="@+id/recycler_filter"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent" />
/>
</LinearLayout> </LinearLayout>

View File

@@ -15,8 +15,13 @@
</include> </include>
<androidx.core.widget.NestedScrollView <androidx.core.widget.NestedScrollView
android:id="@+id/nested_scroll_view"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:orientation="vertical"
> >
<androidx.constraintlayout.widget.ConstraintLayout <androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent" android:layout_width="match_parent"
@@ -337,5 +342,7 @@
android:text="上传" /> android:text="上传" />
</LinearLayout> </LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>
</LinearLayout>
</androidx.core.widget.NestedScrollView> </androidx.core.widget.NestedScrollView>
</LinearLayout> </LinearLayout>

View File

@@ -18,9 +18,13 @@
android:id="@+id/nested_scroll_view" android:id="@+id/nested_scroll_view"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<androidx.constraintlayout.widget.ConstraintLayout <androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="wrap_content">
<TextView <TextView
android:id="@+id/tv_01" android:id="@+id/tv_01"
android:layout_width="wrap_content" android:layout_width="wrap_content"
@@ -550,6 +554,7 @@
</LinearLayout> </LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>
</LinearLayout>
</androidx.core.widget.NestedScrollView> </androidx.core.widget.NestedScrollView>

View File

@@ -20,6 +20,10 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
> >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<androidx.constraintlayout.widget.ConstraintLayout <androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
@@ -307,5 +311,6 @@
android:text="上传" /> android:text="上传" />
</LinearLayout> </LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>
</LinearLayout>
</androidx.core.widget.NestedScrollView> </androidx.core.widget.NestedScrollView>
</LinearLayout> </LinearLayout>

View File

@@ -875,6 +875,10 @@ public class XRecyclerView extends RecyclerView {
} }
} }
public int getScrollDyCounter() {
return scrollDyCounter;
}
private ScrollAlphaChangeListener scrollAlphaChangeListener; private ScrollAlphaChangeListener scrollAlphaChangeListener;
public void setScrollAlphaChangeListener( public void setScrollAlphaChangeListener(
ScrollAlphaChangeListener scrollAlphaChangeListener ScrollAlphaChangeListener scrollAlphaChangeListener