From 2e75d01e497474fc3d64736df9d77912af7808fc Mon Sep 17 00:00:00 2001 From: Chumva Date: Tue, 1 May 2018 15:22:59 +0300 Subject: [PATCH] fix text on buttons --- .../WikivoyageShowPicturesDialogFragment.java | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/wikivoyage/WikivoyageShowPicturesDialogFragment.java b/OsmAnd/src/net/osmand/plus/wikivoyage/WikivoyageShowPicturesDialogFragment.java index 24e268b670..7112497f39 100644 --- a/OsmAnd/src/net/osmand/plus/wikivoyage/WikivoyageShowPicturesDialogFragment.java +++ b/OsmAnd/src/net/osmand/plus/wikivoyage/WikivoyageShowPicturesDialogFragment.java @@ -42,7 +42,7 @@ public class WikivoyageShowPicturesDialogFragment extends BottomSheetDialogFragm }); TextView buttonDownload = view.findViewById(R.id.button_download); if (getMyApplication().getSettings().isWifiConnected()) { - buttonDownload.setText(R.string.shared_string_do); + buttonDownload.setText(R.string.shared_string_only_with_wifi); buttonDownload.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { @@ -55,7 +55,7 @@ public class WikivoyageShowPicturesDialogFragment extends BottomSheetDialogFragm } }); } else { - buttonDownload.setText(R.string.shared_string_only_with_wifi); + buttonDownload.setText(R.string.shared_string_do); buttonDownload.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { @@ -100,7 +100,9 @@ public class WikivoyageShowPicturesDialogFragment extends BottomSheetDialogFragm if (activity != null) { final int screenHeight = AndroidUtils.getScreenHeight(activity); final int statusBarHeight = AndroidUtils.getStatusBarHeight(activity); - final int contentHeight = getContentHeight(screenHeight - statusBarHeight - AndroidUtils.getNavBarHeight(activity)); + final int contentHeight = screenHeight - statusBarHeight + - AndroidUtils.getNavBarHeight(activity) + - getResources().getDimensionPixelSize(R.dimen.bottom_sheet_descr_height); mainView.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() { @Override @@ -120,10 +122,4 @@ public class WikivoyageShowPicturesDialogFragment extends BottomSheetDialogFragm }); } } - - private int getContentHeight(int availableScreenHeight) { - return availableScreenHeight - - AndroidUtils.dpToPx(getContext(), 1) // divider height - - getResources().getDimensionPixelSize(R.dimen.bottom_sheet_descr_height); - } }