added check for titleProgressContainer and changed context menu paddings

This commit is contained in:
Chumva 2018-05-15 16:15:15 +03:00
parent e4b93c9d2f
commit dc5ea297df
2 changed files with 11 additions and 8 deletions

View file

@ -26,6 +26,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:paddingBottom="@dimen/context_menu_padding_margin_tiny"
android:paddingLeft="@dimen/context_menu_padding_margin_default"
android:paddingRight="@dimen/context_menu_padding_margin_default">
@ -82,7 +83,7 @@
android:paddingBottom="@dimen/context_menu_transport_grid_spacing"
android:paddingLeft="@dimen/context_menu_padding_margin_default"
android:paddingRight="@dimen/context_menu_padding_margin_default"
android:paddingTop="@dimen/context_menu_transport_padding_top"
android:paddingTop="@dimen/context_menu_padding_margin_tiny"
android:verticalSpacing="@dimen/context_menu_transport_grid_spacing"
android:visibility="gone"/>
@ -96,7 +97,8 @@
android:orientation="horizontal"
android:paddingLeft="@dimen/context_menu_padding_margin_default"
android:paddingRight="@dimen/context_menu_padding_margin_default"
android:paddingTop="3dp">
android:paddingTop="3dp"
tools:visibility="gone">
<net.osmand.plus.widgets.TextViewEx
android:id="@+id/nearby_routes_within_text_view"
@ -124,7 +126,6 @@
android:layout_width="wrap_content"
android:layout_height= "wrap_content"
android:layout_marginBottom="@dimen/context_menu_direction_margin"
android:layout_marginTop="@dimen/context_menu_padding_margin_tiny"
android:gravity="top"
android:orientation="horizontal"
android:paddingTop="3dp"

View file

@ -1488,21 +1488,23 @@ public class MapContextMenuFragment extends BaseOsmAndFragment implements Downlo
updateDistanceDirection();
compassView.setVisibility(View.VISIBLE);
} else {
compassView.setVisibility(View.GONE);
compassView.setVisibility(View.INVISIBLE);
}
}
}
private void updateAdditionalInfoVisibility() {
TextView line3 = (TextView) view.findViewById(R.id.context_menu_line3);
ImageView additionalInfoImageView = (ImageView) view.findViewById(R.id.additional_info_image_view);
TextView additionalInfoTextView = (TextView) view.findViewById(R.id.additional_info_text_view);
View line3 = (TextView) view.findViewById(R.id.context_menu_line3);
View additionalInfoImageView = (ImageView) view.findViewById(R.id.additional_info_image_view);
View additionalInfoTextView = (TextView) view.findViewById(R.id.additional_info_text_view);
View compassView = view.findViewById(R.id.compass_layout);
View titleProgressContainer = view.findViewById(R.id.title_progress_container);
if (line3.getVisibility() == View.GONE
&& additionalInfoImageView.getVisibility() == View.GONE
&& additionalInfoTextView.getVisibility() == View.GONE
&& compassView.getVisibility() == View.GONE) {
&& titleProgressContainer.getVisibility() == View.VISIBLE
&& compassView.getVisibility() == View.INVISIBLE) {
view.findViewById(R.id.additional_info_row).setVisibility(View.GONE);
} else {
view.findViewById(R.id.additional_info_row).setVisibility(View.VISIBLE);