[android]: Fixed the appearance of an extra margin in the dialog when there is no title.

Also, add a tools:text attribute to the dialog_missed_maps.xml layout
for better preview in Android Studio.
This commit is contained in:
Mihail Mitrofanov
2025-06-17 11:50:34 +02:00
committed by Konstantin Pastbin
parent 92d7499012
commit 957afb1709
2 changed files with 12 additions and 9 deletions

View File

@@ -38,6 +38,8 @@ public class RoutingErrorDialogFragment extends BaseRoutingErrorDialogFragment
ResultCodesHelper.getDialogTitleSubtitle(requireContext(), mResultCode, mMissingMaps.size());
Pair<String, String> titleMessage = resHolder.getTitleMessage();
if (!TextUtils.isEmpty(titleMessage.first))
{
TextView titleView = new TextView(requireContext());
titleView.setText(titleMessage.first);
titleView.setPadding(65, 32, 32, 16);
@@ -46,7 +48,7 @@ public class RoutingErrorDialogFragment extends BaseRoutingErrorDialogFragment
titleView.setEllipsize(TextUtils.TruncateAt.END);
titleView.setTypeface(null, Typeface.BOLD);
builder.setCustomTitle(titleView);
}
mMessage = titleMessage.second;
builder.setNegativeButton(resHolder.getCancelBtnResId(), null);
if (ResultCodesHelper.isDownloadable(mResultCode, mMissingMaps.size()))

View File

@@ -15,6 +15,7 @@
android:paddingEnd="@dimen/margin_base_plus"
android:textAppearance="@style/MwmTextAppearance.Body2"
android:visibility="gone"
tools:text="Select maps to download"
tools:visibility="visible"/>
<View