Skip to content

Commit

Permalink
Fix Transport Lines fragment after UI Review
Browse files Browse the repository at this point in the history
  • Loading branch information
nazar-kutz committed May 4, 2022
1 parent 8a49628 commit 9cf1053
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
1 change: 1 addition & 0 deletions OsmAnd/res/layout/bottom_sheet_item_with_switch_56dp.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
android:layout_height="wrap_content"
android:layout_gravity="center_vertical|end"
android:background="@null"
android:saveEnabled="false"
android:clickable="false"
android:focusable="false"
android:focusableInTouchMode="false"/>
Expand Down
4 changes: 4 additions & 0 deletions OsmAnd/res/layout/fragment_transport_lines.xml
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,10 @@

<include layout="@layout/card_bottom_divider" />

<View
android:layout_width="match_parent"
android:layout_height="@dimen/card_row_min_height" />

</LinearLayout>

</LinearLayout>
Expand Down
12 changes: 6 additions & 6 deletions OsmAnd/src/net/osmand/plus/transport/TransportLinesMenu.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import net.osmand.plus.settings.backend.OsmandSettings;
import net.osmand.plus.settings.backend.preferences.CommonPreference;
import net.osmand.plus.utils.AndroidUtils;
import net.osmand.plus.views.MapLayers;
import net.osmand.plus.views.OsmandMapTileView;
import net.osmand.render.RenderingRuleProperty;
import net.osmand.util.Algorithms;

Expand Down Expand Up @@ -55,8 +55,8 @@ public void toggleTransportType(@NonNull MapActivity mapActivity, @NonNull Strin
idsToSave.add(p.getId());
}
}
settings.DISPLAYED_TRANSPORT_SETTINGS.setModeValues(
appMode, !Algorithms.isEmpty(idsToSave) ? idsToSave : null);
idsToSave = !Algorithms.isEmpty(idsToSave) ? idsToSave : null;
settings.DISPLAYED_TRANSPORT_SETTINGS.setModeValues(appMode, idsToSave);
refreshMap(mapActivity);
}

Expand Down Expand Up @@ -117,9 +117,9 @@ private void hideAllTransport(@NonNull MapActivity mapActivity) {
}

private void refreshMap(@NonNull MapActivity mapActivity) {
mapActivity.refreshMapComplete();
MapLayers mapLayers = mapActivity.getMapLayers();
mapLayers.updateLayers(mapActivity);
OsmandMapTileView mapView = mapActivity.getMapView();
mapView.refreshMap(true);
mapActivity.updateLayers();
}

private ApplicationMode getAppMode() {
Expand Down

0 comments on commit 9cf1053

Please sign in to comment.