forked from organicmaps/organicmaps
[android] fix: Route map download dialog UI fixes.
This commit is contained in:
parent
a86d61742d
commit
476424040e
6 changed files with 30 additions and 54 deletions
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout
|
||||
<RelativeLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
|
@ -17,20 +17,24 @@
|
|||
android:id="@+id/divider_top"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1px"
|
||||
android:layout_below="@id/tv__message"
|
||||
android:background="?android:attr/listDivider"/>
|
||||
|
||||
<ExpandableListView
|
||||
android:id="@+id/elv__items"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/divider_top"
|
||||
android:background="@color/base_bg_secondary"
|
||||
android:listSelector="?attr/clickableBackground"/>
|
||||
android:listSelector="?attr/clickableBackground"
|
||||
android:drawSelectorOnTop="true"/>
|
||||
|
||||
<View
|
||||
android:id="@+id/divider_bottom"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1px"
|
||||
android:layout_below="@id/elv__items"
|
||||
android:background="?android:attr/listDivider"/>
|
||||
|
||||
</LinearLayout>
|
||||
</RelativeLayout>
|
||||
|
||||
|
|
|
@ -15,20 +15,17 @@
|
|||
android:textAppearance="@style/MwmTextAppearance.Body2"/>
|
||||
|
||||
<View
|
||||
android:id="@+id/divider_top"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:background="?attr/dividerHorizontal"/>
|
||||
|
||||
<include
|
||||
android:id="@+id/item"
|
||||
layout="@layout/item_country_dialog"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@color/base_bg_secondary"/>
|
||||
|
||||
<View
|
||||
android:id="@+id/divider_bottom"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:background="?attr/dividerHorizontal"/>
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout
|
||||
android:id="@+id/item"
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/item"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
|
@ -9,22 +10,20 @@
|
|||
android:orientation="horizontal"
|
||||
android:paddingLeft="@dimen/margin_base_plus"
|
||||
android:paddingRight="@dimen/margin_base_plus">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv__title"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:textAppearance="@style/MwmTextAppearance.Body1"/>
|
||||
android:textAppearance="@style/MwmTextAppearance.Body1"
|
||||
tools:text="Country name"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv__size"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginRight="@dimen/margin_base_plus"
|
||||
android:maxLines="1"
|
||||
android:textAppearance="@style/MwmTextAppearance.Body1"
|
||||
android:visibility="gone"/>
|
||||
|
||||
tools:text="256 MB"/>
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
|
|
|
@ -1,30 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout
|
||||
android:id="@+id/item"
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:minHeight="60dp"
|
||||
android:orientation="horizontal"
|
||||
android:paddingLeft="@dimen/margin_base_plus"
|
||||
android:paddingRight="@dimen/margin_base_plus">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv__title"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:textAppearance="@style/MwmTextAppearance.Body1"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv__size"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="0"
|
||||
android:maxLines="1"
|
||||
android:textAppearance="@style/MwmTextAppearance.Body1"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
|
@ -1,7 +1,8 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout
|
||||
android:id="@+id/item"
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/item"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
|
@ -9,24 +10,24 @@
|
|||
android:orientation="horizontal"
|
||||
android:paddingLeft="@dimen/margin_base_plus"
|
||||
android:paddingRight="@dimen/margin_base_plus">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv__title"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:textAppearance="@style/MwmTextAppearance.Body1"
|
||||
android:textColor="@color/text_green"/>
|
||||
android:textColor="@color/text_green"
|
||||
tools:text="Country name"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv__size"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="0"
|
||||
android:layout_marginRight="@dimen/margin_base_plus"
|
||||
android:maxLines="1"
|
||||
android:textAppearance="@style/MwmTextAppearance.Body1"
|
||||
android:textColor="@color/text_green"/>
|
||||
|
||||
android:textColor="@color/text_green"
|
||||
tools:text="256 MB"/>
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
|
|
|
@ -10,11 +10,11 @@ import android.support.annotation.NonNull;
|
|||
import android.support.v7.app.AlertDialog;
|
||||
import android.util.Pair;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.ViewTreeObserver;
|
||||
import android.widget.ExpandableListAdapter;
|
||||
import android.widget.ExpandableListView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.mapswithme.country.StorageOptions;
|
||||
import com.mapswithme.maps.MapStorage;
|
||||
import com.mapswithme.maps.R;
|
||||
|
@ -148,9 +148,14 @@ public class RoutingErrorDialogFragment extends BaseMwmDialogFragment
|
|||
@SuppressLint("InflateParams") final View countryView = getActivity().getLayoutInflater().
|
||||
inflate(R.layout.dialog_download_single_item, null);
|
||||
((TextView) countryView.findViewById(R.id.tv__title)).setText(MapStorage.INSTANCE.countryName(index));
|
||||
final String size = StringUtils.getFileSizeString(MapStorage.INSTANCE.countryRemoteSizeInBytes(index, option));
|
||||
UiUtils.setTextAndShow(((TextView) countryView.findViewById(R.id.tv__size)), size);
|
||||
UiUtils.setTextAndShow(((TextView) countryView.findViewById(R.id.tv__message)), message);
|
||||
((TextView) countryView.findViewById(R.id.tv__message)).setText(message);
|
||||
|
||||
final TextView szView = (TextView) countryView.findViewById(R.id.tv__size);
|
||||
szView.setText(StringUtils.getFileSizeString(MapStorage.INSTANCE.countryRemoteSizeInBytes(index, option)));
|
||||
ViewGroup.MarginLayoutParams lp = (ViewGroup.MarginLayoutParams) szView.getLayoutParams();
|
||||
lp.rightMargin = 0;
|
||||
szView.setLayoutParams(lp);
|
||||
|
||||
return countryView;
|
||||
}
|
||||
|
||||
|
@ -221,7 +226,7 @@ public class RoutingErrorDialogFragment extends BaseMwmDialogFragment
|
|||
return new DisabledChildSimpleExpandableListAdapter(getActivity(),
|
||||
groupData,
|
||||
R.layout.item_country_group_dialog_expanded,
|
||||
R.layout.item_country_group_dialog,
|
||||
R.layout.item_country_dialog,
|
||||
new String[]{GROUP_NAME, GROUP_SIZE},
|
||||
new int[]{R.id.tv__title, R.id.tv__size},
|
||||
childData,
|
||||
|
|
Loading…
Add table
Reference in a new issue