diff options
author | Dmitry Donskoy <donskdmitry@mail.ru> | 2018-09-19 18:59:35 +0300 |
---|---|---|
committer | Aleksandr Zatsepin <alexzatsepin@users.noreply.github.com> | 2018-09-21 13:34:45 +0300 |
commit | 6d29224966c566470c06f5d689a441e963910b0b (patch) | |
tree | 245ca7ab05581e750af8f8bf505deaf42cb4ee42 /android | |
parent | df74ac10a032f8d86408168571e7b91ea4c664c5 (diff) |
[android] Improved filter hotels
Diffstat (limited to 'android')
-rw-r--r-- | android/res/color/booking_filter_title_color.xml | 5 | ||||
-rw-r--r-- | android/res/color/booking_filter_title_color_night.xml | 5 | ||||
-rw-r--r-- | android/res/drawable-v21/button_with_border.xml | 2 | ||||
-rw-r--r-- | android/res/drawable-v21/button_with_border_night.xml | 2 | ||||
-rw-r--r-- | android/res/drawable/button_with_border.xml | 2 | ||||
-rw-r--r-- | android/res/drawable/button_with_border_night.xml | 2 | ||||
-rw-r--r-- | android/res/layout/fragment_search_filter.xml | 4 | ||||
-rw-r--r-- | android/res/values/attrs.xml | 2 | ||||
-rw-r--r-- | android/res/values/colors.xml | 11 | ||||
-rw-r--r-- | android/res/values/styles-text.xml | 4 | ||||
-rw-r--r-- | android/res/values/themes-base.xml | 4 | ||||
-rw-r--r-- | android/src/com/mapswithme/maps/search/FilterFragment.java | 17 |
12 files changed, 48 insertions, 12 deletions
diff --git a/android/res/color/booking_filter_title_color.xml b/android/res/color/booking_filter_title_color.xml new file mode 100644 index 0000000000..8af3201149 --- /dev/null +++ b/android/res/color/booking_filter_title_color.xml @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="utf-8"?> +<selector xmlns:android="http://schemas.android.com/apk/res/android"> + <item android:color="@color/text_dark_subtitle" android:state_enabled="false"/> + <item android:color="@color/black_56"/> +</selector> diff --git a/android/res/color/booking_filter_title_color_night.xml b/android/res/color/booking_filter_title_color_night.xml new file mode 100644 index 0000000000..dc616462b4 --- /dev/null +++ b/android/res/color/booking_filter_title_color_night.xml @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="utf-8"?> +<selector xmlns:android="http://schemas.android.com/apk/res/android"> + <item android:color="@color/text_light_subtitle" android:state_enabled="false"/> + <item android:color="@color/white_56"/> +</selector> diff --git a/android/res/drawable-v21/button_with_border.xml b/android/res/drawable-v21/button_with_border.xml index f4a647244f..fa5ce78f7c 100644 --- a/android/res/drawable-v21/button_with_border.xml +++ b/android/res/drawable-v21/button_with_border.xml @@ -13,7 +13,7 @@ <item android:state_enabled="false"> <shape android:shape="rectangle"> - <solid android:color="?windowBackgroundForced"/> + <solid android:color="?borderedBtnBgDisabled"/> <stroke android:width="@dimen/divider_height" android:color="?dividerHorizontal"/> </shape> </item> diff --git a/android/res/drawable-v21/button_with_border_night.xml b/android/res/drawable-v21/button_with_border_night.xml index f4a647244f..fa5ce78f7c 100644 --- a/android/res/drawable-v21/button_with_border_night.xml +++ b/android/res/drawable-v21/button_with_border_night.xml @@ -13,7 +13,7 @@ <item android:state_enabled="false"> <shape android:shape="rectangle"> - <solid android:color="?windowBackgroundForced"/> + <solid android:color="?borderedBtnBgDisabled"/> <stroke android:width="@dimen/divider_height" android:color="?dividerHorizontal"/> </shape> </item> diff --git a/android/res/drawable/button_with_border.xml b/android/res/drawable/button_with_border.xml index 24e0b59318..1974022fb8 100644 --- a/android/res/drawable/button_with_border.xml +++ b/android/res/drawable/button_with_border.xml @@ -9,7 +9,7 @@ <item android:state_enabled="false"> <shape android:shape="rectangle"> - <solid android:color="@color/bg_window"/> + <solid android:color="@color/white_40"/> <stroke android:width="@dimen/divider_height" android:color="@color/divider"/> </shape> </item> diff --git a/android/res/drawable/button_with_border_night.xml b/android/res/drawable/button_with_border_night.xml index 5c52dbdd97..86d4fe21a5 100644 --- a/android/res/drawable/button_with_border_night.xml +++ b/android/res/drawable/button_with_border_night.xml @@ -9,7 +9,7 @@ <item android:state_enabled="false"> <shape android:shape="rectangle"> - <solid android:color="@color/bg_window_night"/> + <solid android:color="@color/black_40"/> <stroke android:width="@dimen/divider_height" android:color="@color/divider_night"/> </shape> </item> diff --git a/android/res/layout/fragment_search_filter.xml b/android/res/layout/fragment_search_filter.xml index 7ace11ad3f..03c9854d48 100644 --- a/android/res/layout/fragment_search_filter.xml +++ b/android/res/layout/fragment_search_filter.xml @@ -67,9 +67,11 @@ android:gravity="start" android:layout_height="wrap_content"> <TextView + android:id="@+id/checkIn_title" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginBottom="@dimen/margin_half" + android:textColor="?attr/bookingFilterTitleColor" android:textAppearance="@style/MwmTextAppearance.BookingFilter.Title" android:text="@string/booking_filters_check_in"/> <TextView @@ -89,9 +91,11 @@ android:gravity="start" android:layout_height="wrap_content"> <TextView + android:id="@+id/checkOut_title" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginBottom="@dimen/margin_half" + android:textColor="?attr/bookingFilterTitleColor" android:textAppearance="@style/MwmTextAppearance.BookingFilter.Title" android:text="@string/booking_filters_check_out"/> <TextView diff --git a/android/res/values/attrs.xml b/android/res/values/attrs.xml index c546473ed3..0714ce5862 100644 --- a/android/res/values/attrs.xml +++ b/android/res/values/attrs.xml @@ -98,4 +98,6 @@ <attr name="subwayMenuDisabled" format="reference"/> <attr name="accentTextColorSelector" format="color"/> <attr name="accentDot" format="reference"/> + <attr name="borderedBtnBgDisabled" format="color"/> + <attr name="bookingFilterTitleColor" format="color"/> </resources> diff --git a/android/res/values/colors.xml b/android/res/values/colors.xml index ab03fe7a59..1519853dcd 100644 --- a/android/res/values/colors.xml +++ b/android/res/values/colors.xml @@ -26,6 +26,8 @@ <color name="black_20">#33000000</color> <!-- 20% black --> <color name="black_24">#3D000000</color> <!-- 24% black --> <color name="black_38">#61000000</color> <!-- 38% black --> + <color name="black_40">#66000000</color> <!-- 40% black --> + <color name="black_56">#8F000000</color> <!-- 56% black --> <color name="black_60">#99000000</color> <!-- 60% black --> <color name="white_primary">#FFFFFFFF</color> <!-- 100% white --> <color name="white_secondary">#B3FFFFFF</color> <!-- 70% white --> @@ -37,10 +39,13 @@ <color name="white_20">#33FFFFFF</color> <!-- 20% white --> <color name="white_24">#3DFFFFFF</color> <!-- 24% white --> <color name="white_38">#61FFFFFF</color> <!-- 38% white --> + <color name="white_40">#66FFFFFF</color> <!-- 40% white --> + <color name="white_56">#8FFFFFFF</color> <!-- 56% white --> <color name="white_60">#99FFFFFF</color> <!-- 60% white --> <color name="warm_gray">#FF999691</color> <color name="warm_gray_night">#FF999691</color> - + <color name="dark_gray">#8B000000</color> + <color name="light_gray">#F5F5F5</color> <color name="icon_tint">#FF757575</color> <color name="icon_tint_night">#FFC4C6C7</color> @@ -185,10 +190,10 @@ <color name="rating_none">#FF888A82</color> <color name="rating_coming_soon">#FF1E96F0</color> - <color name="tips_and_triks_bg_night">#B8000000</color> + <color name="tips_and_triks_bg_night">@color/dark_gray</color> <color name="tips_and_triks_bg">#B8FFFFFF</color> <color name="tips_and_triks_primary_text">#FFFFFF</color> <color name="tips_and_triks_primary_text_night">#000000</color> <color name="tips_and_triks_secondary_text">#B3FFFFFF</color> - <color name="tips_and_triks_secondary_text_night">#B8000000</color> + <color name="tips_and_triks_secondary_text_night">@color/dark_gray</color> </resources> diff --git a/android/res/values/styles-text.xml b/android/res/values/styles-text.xml index c11794d4e5..2fbe194fd1 100644 --- a/android/res/values/styles-text.xml +++ b/android/res/values/styles-text.xml @@ -221,8 +221,8 @@ </style> <style name="MwmTextAppearance.BookingFilter.Warning" parent="MwmTextAppearance.Body3"> - <item name="android:fontFamily" tools:ignore="NewApi">@string/robotoMedium</item> - <item name="android:textColor">@color/button_red</item> + <item name="android:fontFamily" tools:ignore="NewApi">@string/robotoRegular</item> + <item name="android:textColor">@color/dark_gray</item> </style> <style name="MwmTextAppearance.BookingFilter.DateTextView" parent="MwmTextAppearance.Body3"> diff --git a/android/res/values/themes-base.xml b/android/res/values/themes-base.xml index 7a322875a6..8e48241f5a 100644 --- a/android/res/values/themes-base.xml +++ b/android/res/values/themes-base.xml @@ -18,6 +18,7 @@ <item name="android:statusBarColor" tools:targetApi="lollipop">@android:color/transparent</item> <item name="alertDialogTheme">@style/MwmTheme.AlertDialog</item> <item name="windowBackgroundForced">@color/bg_window</item> + <item name="borderedBtnBgDisabled">@color/white_40</item> <item name="cardFrame">@drawable/card_frame</item> <item name="cardBackground">@color/bg_cards</item> <item name="fullscreenDialogTheme">@style/MwmTheme.DialogFragment.Fullscreen</item> @@ -126,6 +127,7 @@ <item name="transitPedestrianBackground">@color/black_4</item> <item name="transitStepDivider">@drawable/dot_divider</item> <item name="filterPropertyBackground">@drawable/button_with_border</item> + <item name="bookingFilterTitleColor">@color/booking_filter_title_color</item> <item name="adChoicesIcon">@drawable/ic_ad_light</item> <item name="saleIcon">@drawable/ic_deal_light</item> <item name="nav_bg_subway">@drawable/bg_subway_light</item> @@ -158,6 +160,7 @@ <item name="alertDialogTheme">@style/MwmTheme.Night.AlertDialog</item> <item name="windowBackgroundForced">@color/bg_window_night</item> + <item name="borderedBtnBgDisabled">@color/black_40</item> <item name="cardFrame">@drawable/card_frame_night</item> <item name="cardBackground">@color/bg_cards_night</item> <item name="fullscreenDialogTheme">@style/MwmTheme.DialogFragment.Fullscreen.Night</item> @@ -266,6 +269,7 @@ <item name="transitPedestrianBackground">@color/white_4</item> <item name="transitStepDivider">@drawable/dot_divider_night</item> <item name="filterPropertyBackground">@drawable/button_with_border_night</item> + <item name="bookingFilterTitleColor">@color/booking_filter_title_color_night</item> <item name="adChoicesIcon">@drawable/ic_ad_dark</item> <item name="saleIcon">@drawable/ic_deal_dark</item> <item name="nav_bg_subway">@drawable/bg_subway_night</item> diff --git a/android/src/com/mapswithme/maps/search/FilterFragment.java b/android/src/com/mapswithme/maps/search/FilterFragment.java index 976c093c75..8d6afea443 100644 --- a/android/src/com/mapswithme/maps/search/FilterFragment.java +++ b/android/src/com/mapswithme/maps/search/FilterFragment.java @@ -70,6 +70,12 @@ public class FilterFragment extends BaseMwmToolbarFragment private TextView mCheckOut; @SuppressWarnings("NullableProblems") @NonNull + private TextView mCheckInTitle; + @SuppressWarnings("NullableProblems") + @NonNull + private TextView mCheckOutTitle; + @SuppressWarnings("NullableProblems") + @NonNull private TextView mOfflineWarning; @NonNull private final Drawable mTagsDecorator @@ -242,8 +248,10 @@ public class FilterFragment extends BaseMwmToolbarFragment { mCheckIn = root.findViewById(R.id.checkIn); mCheckIn.setOnClickListener(v -> onCheckInClicked()); + mCheckInTitle = root.findViewById(R.id.checkIn_title); mCheckOut = root.findViewById(R.id.checkOut); mCheckOut.setOnClickListener(v -> onCheckOutClicked()); + mCheckOutTitle = root.findViewById(R.id.checkOut_title); mOfflineWarning = root.findViewById(R.id.offlineWarning); @@ -282,9 +290,12 @@ public class FilterFragment extends BaseMwmToolbarFragment private void enableDateViewsIfConnected() { - UiUtils.showIf(!ConnectionState.isConnected(), mOfflineWarning); - mCheckIn.setEnabled(ConnectionState.isConnected()); - mCheckOut.setEnabled(ConnectionState.isConnected()); + boolean connected = ConnectionState.isConnected(); + UiUtils.showIf(!connected, mOfflineWarning); + mCheckIn.setEnabled(connected); + mCheckOut.setEnabled(connected); + mCheckInTitle.setEnabled(connected); + mCheckOutTitle.setEnabled(connected); } @NonNull |