[android] Added elevation to 'PRO' label view in catalog promo gallery

This commit is contained in:
Александр Зацепин 2019-08-07 17:58:43 +03:00 committed by Aleksey Belousov
parent cd62ffd18f
commit 54464fb155
3 changed files with 10 additions and 3 deletions

View file

@ -62,11 +62,12 @@
</LinearLayout>
<TextView
android:id="@+id/label"
android:text="PRO"
android:elevation="@dimen/default_elevation"
android:layout_gravity="top"
android:paddingTop="@dimen/margin_eighth"
android:paddingBottom="@dimen/margin_eighth"
android:paddingLeft="@dimen/margin_half_plus"
android:paddingStart="@dimen/margin_half_plus"
android:paddingRight="@dimen/margin_half_plus"
android:paddingEnd="@dimen/margin_half_plus"
android:layout_marginTop="@dimen/pro_label_margin"
@ -75,6 +76,9 @@
app:fontFamily="@string/robotoMedium"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingStart="@dimen/margin_half_plus"/>
tools:background="@color/base_accent_night"
tools:text="PRO"
tools:visibility="visible"
tools:targetApi="lollipop"/>
</android.support.v7.widget.CardView>
</FrameLayout>

View file

@ -35,6 +35,7 @@
<dimen name="primary_button_min_height">36dp</dimen>
<dimen name="primary_button_min_width">64dp</dimen>
<dimen name="dialog_min_width">288dp</dimen>
<dimen name="default_elevation">2dp</dimen>
<dimen name="dialog_max_height">320dp</dimen>
<dimen name="search_item_height">56dp</dimen>

View file

@ -23,6 +23,7 @@ import com.bumptech.glide.Glide;
import com.bumptech.glide.request.target.BitmapImageViewTarget;
import com.mapswithme.HotelUtils;
import com.mapswithme.maps.R;
import com.mapswithme.maps.promo.PromoCityGallery;
import com.mapswithme.maps.promo.PromoEntity;
import com.mapswithme.maps.search.Popularity;
import com.mapswithme.maps.ugc.Impress;
@ -467,7 +468,8 @@ public class Holders
private void bindProLabel(@NonNull PromoEntity item)
{
mProLabel.setVisibility(item.getCategory() == null ? View.GONE : View.VISIBLE);
PromoCityGallery.LuxCategory category = item.getCategory();
UiUtils.showIf(category != null && !TextUtils.isEmpty(category.getName()), mProLabel);
if (item.getCategory() == null)
return;