From 50ac1174d0cd30a762743b7e845ea452a9911b4c Mon Sep 17 00:00:00 2001 From: Skalii Date: Fri, 26 Mar 2021 17:22:17 +0200 Subject: [PATCH] fix padding between title and description --- .../LiveUpdatesSettingsBottomSheet.java | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/liveupdates/LiveUpdatesSettingsBottomSheet.java b/OsmAnd/src/net/osmand/plus/liveupdates/LiveUpdatesSettingsBottomSheet.java index 83e66200ca..21828d812a 100644 --- a/OsmAnd/src/net/osmand/plus/liveupdates/LiveUpdatesSettingsBottomSheet.java +++ b/OsmAnd/src/net/osmand/plus/liveupdates/LiveUpdatesSettingsBottomSheet.java @@ -77,6 +77,7 @@ public class LiveUpdatesSettingsBottomSheet extends MenuBottomSheetDialogFragmen private OsmandApplication app; private OsmandSettings settings; + private BaseBottomSheetItem itemTitle; private BaseBottomSheetItem itemLastCheck; private BaseBottomSheetItem itemSwitchLiveUpdate; private BaseBottomSheetItem itemFrequencyHelpMessage; @@ -117,11 +118,12 @@ public class LiveUpdatesSettingsBottomSheet extends MenuBottomSheetDialogFragmen int dp40 = getDimen(R.dimen.list_header_height); int dp48 = getDimen(R.dimen.context_menu_buttons_bottom_height); - items.add(new SimpleBottomSheetItem.Builder() + itemTitle = new SimpleBottomSheetItem.Builder() .setTitle(getNameToDisplay(fileName, app)) .setTitleColorId(getPrimaryTextColorId(nightMode)) .setLayoutId(R.layout.bottom_sheet_item_title_big) - .create()); + .create(); + items.add(itemTitle); itemLastCheck = new ShortDescriptionItem.Builder() .setDescription(getLastCheckString()) @@ -334,6 +336,19 @@ public class LiveUpdatesSettingsBottomSheet extends MenuBottomSheetDialogFragmen @Override public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup parent, Bundle savedInstanceState) { View view = super.onCreateView(inflater, parent, savedInstanceState); + + int titleHeight = getResources().getDimensionPixelSize(R.dimen.bottom_sheet_descr_height); + TextViewEx titleView = (TextViewEx) itemTitle.getView(); + titleView.setMinimumHeight(titleHeight); + titleView.getLayoutParams().height = titleHeight; + titleView.setPadding(titleView.getPaddingLeft(), getResources().getDimensionPixelSize(R.dimen.bottom_sheet_title_padding_top), + titleView.getPaddingRight(), titleView.getPaddingBottom()); + + int descriptionHeight = getResources().getDimensionPixelSize(R.dimen.bottom_sheet_title_height); + TextViewEx descriptionView = (TextViewEx) itemLastCheck.getView(); + descriptionView.setMinimumHeight(descriptionHeight); + descriptionView.getLayoutParams().height = descriptionHeight; + CommonPreference localUpdatePreference = preferenceForLocalIndex(fileName, settings); setStateViaWiFiButton(localUpdatePreference); return view;