forked from organicmaps/organicmaps
[routing][android] fix: Hide map list in routing error dialog if not downloadable.
This commit is contained in:
parent
9738ac58b8
commit
48179a4e46
2 changed files with 15 additions and 1 deletions
|
@ -18,6 +18,7 @@
|
|||
tools:visibility="visible"/>
|
||||
|
||||
<View
|
||||
android:id="@+id/divider_top"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:background="?dividerHorizontal"/>
|
||||
|
@ -31,6 +32,7 @@
|
|||
android:drawSelectorOnTop="true"/>
|
||||
|
||||
<View
|
||||
android:id="@+id/divider_bottom"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:background="?dividerHorizontal"/>
|
||||
|
|
|
@ -38,6 +38,8 @@ abstract class BaseRoutingErrorDialogFragment extends BaseMwmDialogFragment
|
|||
|
||||
final List<CountryItem> mMissingMaps = new ArrayList<>();
|
||||
String[] mMapsArray;
|
||||
|
||||
private boolean mCancelRoute = true;
|
||||
boolean mCancelled;
|
||||
|
||||
void beforeDialogCreated(AlertDialog.Builder builder) {}
|
||||
|
@ -83,7 +85,7 @@ abstract class BaseRoutingErrorDialogFragment extends BaseMwmDialogFragment
|
|||
@Override
|
||||
public void onDismiss(DialogInterface dialog)
|
||||
{
|
||||
if (mCancelled)
|
||||
if (mCancelled && mCancelRoute)
|
||||
RoutingController.get().cancel();
|
||||
|
||||
super.onDismiss(dialog);
|
||||
|
@ -118,6 +120,16 @@ abstract class BaseRoutingErrorDialogFragment extends BaseMwmDialogFragment
|
|||
final View countriesView = View.inflate(getActivity(), R.layout.dialog_missed_maps, null);
|
||||
|
||||
final ExpandableListView listView = (ExpandableListView) countriesView.findViewById(R.id.items_frame);
|
||||
if (mMissingMaps.isEmpty())
|
||||
{
|
||||
mCancelRoute = false;
|
||||
|
||||
UiUtils.hide(listView);
|
||||
UiUtils.hide(countriesView.findViewById(R.id.divider_top));
|
||||
UiUtils.hide(countriesView.findViewById(R.id.divider_bottom));
|
||||
return countriesView;
|
||||
}
|
||||
|
||||
listView.setAdapter(buildAdapter());
|
||||
listView.setChildDivider(new ColorDrawable(getResources().getColor(android.R.color.transparent)));
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue