Merge pull request #11475 from osmandapp/fix_jumping_map_controls

Fix jumping map controls
This commit is contained in:
Vitaliy 2021-04-20 11:18:36 +03:00 committed by GitHub
commit cc70fcede4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 303 additions and 269 deletions

View file

@ -16,7 +16,16 @@
android:focusable="true"
android:orientation="vertical"
android:clickable="true"
tools:background="@drawable/bg_bottom_menu_dark">
tools:ignore="UselessParent">
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<View
android:layout_width="match_parent"
android:layout_height="0dp"
android:background="@drawable/bg_contextmenu_shadow_top_light" />
<ProgressBar
android:id="@+id/snap_to_road_progress_bar"
@ -24,12 +33,17 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="0dp"
android:visibility="gone"
android:background="?attr/list_background_color"
android:visibility="invisible"
tools:visibility="visible" />
</FrameLayout>
<LinearLayout
android:id="@+id/main_content"
android:layout_width="match_parent"
android:layout_height="match_parent">
android:layout_height="match_parent"
android:background="?attr/list_background_color">
<RelativeLayout
android:id="@+id/up_down_row"

View file

@ -13,10 +13,19 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:background="@drawable/bg_bottom_menu_dark"
android:orientation="vertical"
android:clickable="true"
android:focusable="true">
android:focusable="true"
tools:ignore="UselessParent">
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<View
android:layout_width="match_parent"
android:layout_height="0dp"
android:background="@drawable/bg_contextmenu_shadow_top_light" />
<ProgressBar
android:id="@+id/snap_to_road_progress_bar"
@ -24,9 +33,19 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="0dp"
android:visibility="gone"
android:background="?attr/list_background_color"
android:visibility="invisible"
tools:visibility="visible" />
</FrameLayout>
<LinearLayout
android:id="@+id/main_content"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/list_background_color"
android:orientation="vertical">
<RelativeLayout
android:id="@+id/up_down_row"
android:layout_width="match_parent"
@ -305,4 +324,6 @@
</LinearLayout>
</LinearLayout>
</FrameLayout>

View file

@ -261,7 +261,7 @@ public class MeasurementToolFragment extends BaseOsmAndFragment implements Route
@Override
public void hideProgressBar() {
((ProgressBar) mainView.findViewById(R.id.snap_to_road_progress_bar)).setVisibility(View.GONE);
((ProgressBar) mainView.findViewById(R.id.snap_to_road_progress_bar)).setVisibility(View.INVISIBLE);
progressBarVisible = false;
updateInfoView();
updateCardContainerSize();
@ -287,7 +287,6 @@ public class MeasurementToolFragment extends BaseOsmAndFragment implements Route
.inflate(R.layout.fragment_measurement_tool, container, false);
mainView = view.findViewById(R.id.main_view);
AndroidUtils.setBackground(mapActivity, mainView, nightMode, R.drawable.bg_bottom_menu_light, R.drawable.bg_bottom_menu_dark);
detailsMenu = new GraphDetailsMenu();
if (portrait) {
cardsContainer = mainView.findViewById(R.id.cards_container);
@ -1390,7 +1389,7 @@ public class MeasurementToolFragment extends BaseOsmAndFragment implements Route
editingCtx.cancelSnapToRoad();
MapActivity mapActivity = getMapActivity();
if (mapActivity != null) {
mainView.findViewById(R.id.snap_to_road_progress_bar).setVisibility(View.GONE);
mainView.findViewById(R.id.snap_to_road_progress_bar).setVisibility(View.INVISIBLE);
mapActivity.refreshMap();
}
}