This commit is contained in:
Devarsh Chintanbhai Vasani 2025-03-13 21:08:55 +05:30 committed by GitHub
commit c8dcfa2710
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 25 additions and 0 deletions

View file

@ -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);
@ -171,6 +174,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);
}
@ -190,6 +202,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);
@ -207,6 +220,8 @@ public class OnmapDownloader implements MwmActivity.LeftAnimationTrackListener
if (mCurrentCountry == null)
return;
mError.setVisibility(View.GONE);
boolean retry = (mCurrentCountry.status == CountryItem.STATUS_FAILED);
if (retry)
{

View file

@ -47,6 +47,16 @@
android:textAppearance="@style/MwmTextAppearance.Body2"
android:gravity="center_horizontal"
tools:text="1000 MB"/>
<TextView
android:id="@+id/downloader_error"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/margin_eighth"
android:textAppearance="@style/MwmTextAppearance.Body4"
android:gravity="center_horizontal"
android:visibility="gone"
android:textColor="@color/base_red"
tools:text="some error very loooooooooong error"/>
<FrameLayout
android:id="@+id/downloader_controls_frame"
android:layout_width="180dp"