diff options
author | Alexander Marchuk <alexm@maps.me> | 2016-02-29 13:48:54 +0300 |
---|---|---|
committer | Sergey Yershov <yershov@corp.mail.ru> | 2016-03-23 16:49:25 +0300 |
commit | 0c283351ea8a2807d5aee2a1201ace5fe2fcc1f0 (patch) | |
tree | 7f45ab6247375fc3e1f194a9d59aabfd002f5e6a /android | |
parent | 5ced9801810559e9592c03425795259b67bdedac (diff) |
[new downloader][android] fix: Various UI fixes.
Diffstat (limited to 'android')
-rw-r--r-- | android/res/drawable-v21/button.xml | 2 | ||||
-rw-r--r-- | android/res/drawable-v21/button_accent_normal.xml (renamed from android/res/drawable-v21/button_accent.xml) | 0 | ||||
-rw-r--r-- | android/res/drawable-v21/button_accent_normal_night.xml (renamed from android/res/drawable-v21/button_accent_night.xml) | 0 | ||||
-rw-r--r-- | android/res/layout-land/fragment_suggest_country_download.xml | 11 | ||||
-rw-r--r-- | android/res/layout/fragment_suggest_country_download.xml | 9 | ||||
-rw-r--r-- | android/res/layout/onmap_downloader.xml | 4 | ||||
-rw-r--r-- | android/res/values/dimens.xml | 1 | ||||
-rw-r--r-- | android/res/values/styles.xml | 2 | ||||
-rw-r--r-- | android/src/com/mapswithme/maps/downloader/OnmapDownloader.java | 8 | ||||
-rw-r--r-- | android/src/com/mapswithme/maps/widget/HeightLimitedFrameLayout.java | 14 |
10 files changed, 25 insertions, 26 deletions
diff --git a/android/res/drawable-v21/button.xml b/android/res/drawable-v21/button.xml index 09613c9d90..49bdf00c32 100644 --- a/android/res/drawable-v21/button.xml +++ b/android/res/drawable-v21/button.xml @@ -4,7 +4,7 @@ <item android:id="@android:id/mask"> <shape android:shape="rectangle"> <solid android:color="@android:color/white"/> - <corners android:radius="12dp"/> + <corners android:radius="2dp"/> </shape> </item> </ripple>
\ No newline at end of file diff --git a/android/res/drawable-v21/button_accent.xml b/android/res/drawable-v21/button_accent_normal.xml index 34ed5bd979..34ed5bd979 100644 --- a/android/res/drawable-v21/button_accent.xml +++ b/android/res/drawable-v21/button_accent_normal.xml diff --git a/android/res/drawable-v21/button_accent_night.xml b/android/res/drawable-v21/button_accent_normal_night.xml index 6429dfd9e7..6429dfd9e7 100644 --- a/android/res/drawable-v21/button_accent_night.xml +++ b/android/res/drawable-v21/button_accent_normal_night.xml diff --git a/android/res/layout-land/fragment_suggest_country_download.xml b/android/res/layout-land/fragment_suggest_country_download.xml index 298b8a8cfc..d0fd2dd3ed 100644 --- a/android/res/layout-land/fragment_suggest_country_download.xml +++ b/android/res/layout-land/fragment_suggest_country_download.xml @@ -32,8 +32,8 @@ android:id="@+id/ll__location_determined" android:layout_width="match_parent" android:layout_height="wrap_content" - android:gravity="center_horizontal" - android:orientation="vertical"> + android:orientation="vertical" + android:gravity="center_horizontal"> <TextView android:id="@+id/tv__country_name" @@ -46,8 +46,6 @@ <Button android:id="@+id/btn__download_map" style="@style/MwmWidget.Button.Accent" - android:layout_width="280dp" - android:layout_height="@dimen/height_block_base" android:layout_marginTop="@dimen/margin_quarter" android:text="@string/downloader_download_map" android:textAppearance="@style/MwmTextAppearance.Body1"/> @@ -55,8 +53,6 @@ <Button android:id="@+id/btn__select_other_map" style="@style/MwmWidget.Button" - android:layout_width="280dp" - android:layout_height="@dimen/height_block_base" android:layout_marginTop="@dimen/margin_base_plus" android:text="@string/search_select_other_map" android:textAppearance="@style/MwmTextAppearance.Body3" @@ -68,6 +64,7 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical" + android:gravity="center_horizontal" android:visibility="gone"> <TextView @@ -80,7 +77,7 @@ <Button android:id="@+id/btn__select_map" - style="@style/MwmWidget.Button" + style="@style/MwmWidget.Button.Accent" android:layout_width="280dp" android:layout_height="@dimen/height_block_base" android:layout_marginTop="@dimen/margin_half" diff --git a/android/res/layout/fragment_suggest_country_download.xml b/android/res/layout/fragment_suggest_country_download.xml index c2eb910f99..8fce139482 100644 --- a/android/res/layout/fragment_suggest_country_download.xml +++ b/android/res/layout/fragment_suggest_country_download.xml @@ -51,8 +51,6 @@ <Button android:id="@+id/btn__download_map" style="@style/MwmWidget.Button.Accent" - android:layout_width="match_parent" - android:layout_height="@dimen/height_block_base" android:layout_marginTop="@dimen/margin_half" android:text="@string/downloader_download_map" android:textAppearance="@style/MwmTextAppearance.Body1"/> @@ -63,6 +61,7 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical" + android:gravity="center_horizontal" android:visibility="gone" tools:visibility="visible"> <TextView @@ -75,9 +74,7 @@ <Button android:id="@+id/btn__select_map" - style="@style/MwmWidget.Button" - android:layout_width="match_parent" - android:layout_height="@dimen/height_block_base" + style="@style/MwmWidget.Button.Accent" android:layout_marginTop="@dimen/margin_half" android:text="@string/search_select_map" android:textAppearance="@style/MwmTextAppearance.Body1"/> @@ -85,8 +82,6 @@ <Button android:id="@+id/btn__select_other_map" style="@style/MwmWidget.Button" - android:layout_width="match_parent" - android:layout_height="@dimen/height_block_base" android:layout_marginTop="@dimen/margin_base_plus" android:text="@string/search_select_other_map" android:textAppearance="@style/MwmTextAppearance.Body3" diff --git a/android/res/layout/onmap_downloader.xml b/android/res/layout/onmap_downloader.xml index bd0a5d7280..86378a1333 100644 --- a/android/res/layout/onmap_downloader.xml +++ b/android/res/layout/onmap_downloader.xml @@ -47,14 +47,12 @@ <FrameLayout android:id="@+id/downloader_controls_frame" - android:layout_width="200dp" + android:layout_width="@dimen/button_width" android:layout_height="wrap_content" android:clipChildren="false"> <Button android:id="@+id/downloader_button" style="@style/MwmWidget.Button.Accent" - android:layout_width="match_parent" - android:layout_height="wrap_content" android:visibility="gone"/> <com.mapswithme.maps.widget.WheelProgressView diff --git a/android/res/values/dimens.xml b/android/res/values/dimens.xml index 40c81762a4..052a6d5576 100644 --- a/android/res/values/dimens.xml +++ b/android/res/values/dimens.xml @@ -43,6 +43,7 @@ <dimen name="search_progress_size">32dp</dimen> <dimen name="panel_width">360dp</dimen> + <dimen name="button_width">240dp</dimen> <!-- direction fragment --> <dimen name="margin_direction_small">8dp</dimen> diff --git a/android/res/values/styles.xml b/android/res/values/styles.xml index 849c042e70..a11acb8597 100644 --- a/android/res/values/styles.xml +++ b/android/res/values/styles.xml @@ -21,6 +21,8 @@ </style> <style name="MwmWidget.Button"> + <item name="android:layout_width">@dimen/button_width</item> + <item name="android:layout_height">@dimen/height_block_base</item> <item name="android:background">?buttonBackground</item> <item name="android:textAllCaps">true</item> </style> diff --git a/android/src/com/mapswithme/maps/downloader/OnmapDownloader.java b/android/src/com/mapswithme/maps/downloader/OnmapDownloader.java index 37d7663354..dab9e17425 100644 --- a/android/src/com/mapswithme/maps/downloader/OnmapDownloader.java +++ b/android/src/com/mapswithme/maps/downloader/OnmapDownloader.java @@ -74,18 +74,20 @@ public class OnmapDownloader implements MwmActivity.LeftAnimationTrackListener if (showFrame) { + boolean hasParent = !TextUtils.isEmpty(mCurrentCountry.parentName); + UiUtils.showIf(showProgress, mProgress); UiUtils.showIf(!showProgress, mButton); - UiUtils.showIf(!TextUtils.isEmpty(mCurrentCountry.parentName), mParent); + UiUtils.showIf(hasParent, mParent); - if (!TextUtils.isEmpty(mCurrentCountry.parentName)) + if (hasParent) mParent.setText(mCurrentCountry.parentName); mTitle.setText(mCurrentCountry.name); mSize.setText(StringUtils.getFileSizeString(mCurrentCountry.totalSize)); if (showProgress) - mProgress.setProgress((int)(mCurrentCountry.progress * 100 / mCurrentCountry.totalSize)); + mProgress.setProgress((int)(mCurrentCountry.progress * 100L / mCurrentCountry.totalSize)); else { boolean failed = (mCurrentCountry.status == CountryItem.STATUS_FAILED); diff --git a/android/src/com/mapswithme/maps/widget/HeightLimitedFrameLayout.java b/android/src/com/mapswithme/maps/widget/HeightLimitedFrameLayout.java index d5f38aa5ec..a982acb6f1 100644 --- a/android/src/com/mapswithme/maps/widget/HeightLimitedFrameLayout.java +++ b/android/src/com/mapswithme/maps/widget/HeightLimitedFrameLayout.java @@ -5,20 +5,21 @@ import android.util.AttributeSet; import android.view.View; import android.view.ViewGroup; import android.widget.FrameLayout; -import com.mapswithme.maps.MwmApplication; -import com.mapswithme.maps.R; -import com.mapswithme.util.UiUtils; import java.util.ArrayList; import java.util.List; +import com.mapswithme.maps.MwmApplication; +import com.mapswithme.maps.R; +import com.mapswithme.util.UiUtils; + /** * FrameLayout which presses out the children which can not be fully fit by height.<br/> * Child views should be marked with {@code @string/tag_height_limited} tag. */ public class HeightLimitedFrameLayout extends FrameLayout { - private static final String TAG_LIMIT = MwmApplication.get().getString(R.string.tag_height_limited); + private String mTag; private final List<View> mLimitedViews = new ArrayList<>(); public HeightLimitedFrameLayout(Context context, AttributeSet attrs) @@ -28,7 +29,10 @@ public class HeightLimitedFrameLayout extends FrameLayout private void collectViews(View v) { - if (TAG_LIMIT.equals(v.getTag())) + if (mTag == null) + mTag = MwmApplication.get().getString(R.string.tag_height_limited); + + if (mTag.equals(v.getTag())) { mLimitedViews.add(v); return; |