diff --git a/android/app/src/main/java/app/organicmaps/downloader/OnmapDownloader.java b/android/app/src/main/java/app/organicmaps/downloader/OnmapDownloader.java index c61f92e631..d338ba623f 100644 --- a/android/app/src/main/java/app/organicmaps/downloader/OnmapDownloader.java +++ b/android/app/src/main/java/app/organicmaps/downloader/OnmapDownloader.java @@ -31,6 +31,7 @@ public class OnmapDownloader implements MwmActivity.LeftAnimationTrackListener private final TextView mParent; private final TextView mTitle; private final TextView mSize; + private final TextView mError; private final WheelProgressView mProgress; private final Button mButton; @@ -52,6 +53,8 @@ public class OnmapDownloader implements MwmActivity.LeftAnimationTrackListener if (!item.isLeafNode) continue; + mError.setVisibility(View.GONE); + if (item.newStatus == CountryItem.STATUS_FAILED) MapManager.showError(mActivity, item, null); @@ -172,6 +175,15 @@ public class OnmapDownloader implements MwmActivity.LeftAnimationTrackListener } } + if (failed) + { + mError.setVisibility(View.VISIBLE); + + if (!ConnectionState.INSTANCE.isConnected()) + mError.setText(mActivity.getString(R.string.common_check_internet_connection_dialog)); + else + mError.setText(mActivity.getString(R.string.download_has_failed)); + } mButton.setText(failed ? R.string.downloader_retry : R.string.download); } @@ -191,6 +203,7 @@ public class OnmapDownloader implements MwmActivity.LeftAnimationTrackListener mParent = mFrame.findViewById(R.id.downloader_parent); mTitle = mFrame.findViewById(R.id.downloader_title); mSize = mFrame.findViewById(R.id.downloader_size); + mError = mFrame.findViewById(R.id.downloader_error); View controls = mFrame.findViewById(R.id.downloader_controls_frame); mProgress = controls.findViewById(R.id.wheel_downloader_progress); @@ -208,6 +221,8 @@ public class OnmapDownloader implements MwmActivity.LeftAnimationTrackListener if (mCurrentCountry == null) return; + mError.setVisibility(View.GONE); + boolean retry = (mCurrentCountry.status == CountryItem.STATUS_FAILED); if (retry) { diff --git a/android/app/src/main/res/layout/onmap_downloader.xml b/android/app/src/main/res/layout/onmap_downloader.xml index df6c3b856f..276ccbddb6 100644 --- a/android/app/src/main/res/layout/onmap_downloader.xml +++ b/android/app/src/main/res/layout/onmap_downloader.xml @@ -46,6 +46,16 @@ android:textAppearance="@style/MwmTextAppearance.Body2" android:gravity="center_horizontal" tools:text="1000 MB"/> +