fix text on buttons
This commit is contained in:
parent
930d8c51e3
commit
2e75d01e49
1 changed files with 5 additions and 9 deletions
|
@ -42,7 +42,7 @@ public class WikivoyageShowPicturesDialogFragment extends BottomSheetDialogFragm
|
||||||
});
|
});
|
||||||
TextView buttonDownload = view.findViewById(R.id.button_download);
|
TextView buttonDownload = view.findViewById(R.id.button_download);
|
||||||
if (getMyApplication().getSettings().isWifiConnected()) {
|
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() {
|
buttonDownload.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
|
@ -55,7 +55,7 @@ public class WikivoyageShowPicturesDialogFragment extends BottomSheetDialogFragm
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
buttonDownload.setText(R.string.shared_string_only_with_wifi);
|
buttonDownload.setText(R.string.shared_string_do);
|
||||||
buttonDownload.setOnClickListener(new View.OnClickListener() {
|
buttonDownload.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
|
@ -100,7 +100,9 @@ public class WikivoyageShowPicturesDialogFragment extends BottomSheetDialogFragm
|
||||||
if (activity != null) {
|
if (activity != null) {
|
||||||
final int screenHeight = AndroidUtils.getScreenHeight(activity);
|
final int screenHeight = AndroidUtils.getScreenHeight(activity);
|
||||||
final int statusBarHeight = AndroidUtils.getStatusBarHeight(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() {
|
mainView.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {
|
||||||
@Override
|
@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);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue