Merge pull request #5518 from osmandapp/FixContextMenuPadding

Context menu Ui improving
This commit is contained in:
Alexey 2018-05-30 16:26:46 +03:00 committed by GitHub
commit 74d887a755
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 5 deletions

View file

@ -122,7 +122,7 @@
</LinearLayout>
<LinearLayout
android:id="@+id/additional_info_row"
android:id="@+id/additional_info_row_container"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
@ -137,7 +137,12 @@
android:paddingBottom="3dp"
android:paddingLeft="@dimen/context_menu_padding_margin_default"
android:paddingRight="@dimen/context_menu_padding_margin_default">
<LinearLayout
android:id="@+id/additional_info_row"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<net.osmand.plus.widgets.TextViewEx
android:id="@+id/context_menu_line3"
style="@style/TextAppearance.ContextMenuSubtitle"
@ -194,6 +199,7 @@
tools:textColor="?android:textColorSecondary"/>
</LinearLayout>
</LinearLayout>
</LinearLayout>

View file

@ -1287,7 +1287,7 @@ public class MapContextMenuFragment extends BaseOsmAndFragment implements Downlo
}
int line3Height = 0;
View line3Container = view.findViewById(R.id.additional_info_row);
View line3Container = view.findViewById(R.id.additional_info_row_container);
if (line3Container.getVisibility() == View.VISIBLE) {
line3Height = line3Container.getMeasuredHeight();
}
@ -1520,10 +1520,13 @@ public class MapContextMenuFragment extends BaseOsmAndFragment implements Downlo
&& compassView.getVisibility() == View.INVISIBLE
&& titleButtonContainer.getVisibility() == View.GONE
&& downloadButtonsContainer.getVisibility() == View.GONE
&& titleBottomButtonContainer.getVisibility() == View.GONE
&& titleProgressContainer.getVisibility() == View.VISIBLE) {
&& titleBottomButtonContainer.getVisibility() == View.GONE) {
if (titleProgressContainer.getVisibility() == View.VISIBLE) {
view.findViewById(R.id.additional_info_row_container).setVisibility(View.GONE);
}
view.findViewById(R.id.additional_info_row).setVisibility(View.GONE);
} else {
view.findViewById(R.id.additional_info_row_container).setVisibility(View.VISIBLE);
view.findViewById(R.id.additional_info_row).setVisibility(View.VISIBLE);
}
}
@ -1909,6 +1912,7 @@ public class MapContextMenuFragment extends BaseOsmAndFragment implements Downlo
private void doAfterMenuStateChange(int previousState, int newState) {
updateCompassVisibility();
updateAdditionalInfoVisibility();
runLayoutListener();
}
}