Fix mapillary layer activity after rotation

This commit is contained in:
Alexey Kulish 2017-07-26 14:46:36 +03:00
parent dcb50e7cfc
commit 92d5ced23c
2 changed files with 2 additions and 1 deletions

View file

@ -793,6 +793,7 @@ public class DashboardOnMap implements ObservableScrollViewCallbacks, DynamicLis
if (swipeDismissListener != null) { if (swipeDismissListener != null) {
swipeDismissListener.discardUndo(); swipeDismissListener.discardUndo();
} }
removeMapillaryFiltersFragment();
if (visible) { if (visible) {
mapActivity.getContextMenu().hideMenues(); mapActivity.getContextMenu().hideMenues();
@ -818,7 +819,6 @@ public class DashboardOnMap implements ObservableScrollViewCallbacks, DynamicLis
View listViewLayout = dashboardView.findViewById(R.id.dash_list_view_layout); View listViewLayout = dashboardView.findViewById(R.id.dash_list_view_layout);
ScrollView scrollView = (ScrollView) dashboardView.findViewById(R.id.main_scroll); ScrollView scrollView = (ScrollView) dashboardView.findViewById(R.id.main_scroll);
if (visibleType == DashboardType.DASHBOARD || visibleType == DashboardType.MAPILLARY) { if (visibleType == DashboardType.DASHBOARD || visibleType == DashboardType.MAPILLARY) {
removeMapillaryFiltersFragment();
if (visibleType == DashboardType.DASHBOARD) { if (visibleType == DashboardType.DASHBOARD) {
addOrUpdateDashboardFragments(); addOrUpdateDashboardFragments();
} else { } else {

View file

@ -79,6 +79,7 @@ public class MapillaryFiltersFragment extends BaseOsmAndFragment {
final Drawable drawable = getIcon(toggleIconId, toggleIconColorId); final Drawable drawable = getIcon(toggleIconId, toggleIconColorId);
((AppCompatImageView) toggleRow.findViewById(R.id.toggle_row_icon)).setImageDrawable(drawable); ((AppCompatImageView) toggleRow.findViewById(R.id.toggle_row_icon)).setImageDrawable(drawable);
final CompoundButton toggle = (CompoundButton) toggleRow.findViewById(R.id.toggle_row_toggle); final CompoundButton toggle = (CompoundButton) toggleRow.findViewById(R.id.toggle_row_toggle);
toggle.setOnCheckedChangeListener(null);
toggle.setChecked(selected); toggle.setChecked(selected);
toggle.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { toggle.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override @Override