[android] Fixed place page dividers and shadows

This commit is contained in:
Александр Зацепин 2017-10-19 15:15:46 +03:00 committed by r.kuznetsov
parent a2b848738e
commit e2e3480051
9 changed files with 38 additions and 42 deletions

View file

@ -1,5 +1,5 @@
<View
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="?dividerHorizontal"/>
android:layout_height="@dimen/divider_height"
android:background="?dividerHorizontal"/>

View file

@ -30,6 +30,7 @@
<TextView
android:id="@+id/tv__bookmark_edit"
style="@style/PlacePageMetadataText.Button"
android:gravity="center"
android:layout_height="@dimen/height_block_base"
android:background="?clickableBackground"
android:paddingEnd="@dimen/margin_base"
@ -40,4 +41,4 @@
<include
layout="@layout/divider_horizontal"/>
</LinearLayout>
</LinearLayout>

View file

@ -11,11 +11,7 @@
android:background="?windowBackgroundForced"
android:orientation="vertical">
<include
layout="@layout/divider_horizontal"
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginBottom="@dimen/margin_half"/>
<include layout="@layout/place_page_fat_shadow"/>
<include layout="@layout/place_page_sponsored_gallery"/>
@ -67,37 +63,32 @@
<include layout="@layout/place_page_latlon"/>
<include layout="@layout/divider_horizontal"/>
<include layout="@layout/place_page_more"/>
<include layout="@layout/place_page_local_ad"/>
</LinearLayout>
<include
android:id="@+id/place_page_taxi_divider"
layout="@layout/divider_horizontal"
android:id="@+id/place_page_taxi_shadow"
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginTop="@dimen/margin_half"/>
android:layout_height="wrap_content"
layout="@layout/place_page_fat_shadow"/>
<include
android:id="@+id/place_page_taxi_divider"
android:layout_width="match_parent"
android:layout_height="@dimen/divider_height"
layout="@layout/divider_horizontal"/>
<include layout="@layout/place_page_taxi"/>
<include layout="@layout/place_page_ugc"/>
<FrameLayout
<include
layout="@layout/place_page_fat_shadow"
android:id="@+id/edit_top_space"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<android.support.v4.widget.Space
android:id="@+id/edit_top_space"
android:layout_width="match_parent"
android:layout_height="@dimen/margin_base"/>
<ImageView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:src="@drawable/shadow_card"
android:scaleType="fitXY"/>
</FrameLayout>
android:layout_height="wrap_content"/>
<include layout="@layout/place_page_editor"/>

View file

@ -7,7 +7,7 @@
tools:showIn="@layout/place_page_ugc">
<android.support.v4.widget.Space
android:layout_width="match_parent"
android:layout_height="@dimen/margin_base"/>
android:layout_height="@dimen/margin_half"/>
<ImageView
android:layout_width="match_parent"
android:layout_height="wrap_content"

View file

@ -6,6 +6,7 @@
android:layout_height="wrap_content"
android:orientation="vertical"
tools:visibility="visible">
<include layout="@layout/divider_horizontal"/>
<TextView
android:id="@+id/tv__local_ad"
style="@style/PlacePageMetadataText.Button"
@ -13,7 +14,4 @@
android:background="?clickableBackground"
android:gravity="center"
android:text="@string/placepage_add_place_button"/>
<include layout="@layout/divider_horizontal"/>
</LinearLayout>

View file

@ -7,13 +7,12 @@
android:layout_height="wrap_content"
android:orientation="vertical">
<include layout="@layout/divider_horizontal"/>
<TextView
style="@style/PlacePageMetadataText.Button"
android:height="@dimen/height_block_base"
android:background="?clickableBackground"
android:gravity="center"
android:text="@string/details_on_bookingcom"/>
<include layout="@layout/divider_horizontal"/>
</LinearLayout>

View file

@ -80,10 +80,7 @@
android:layout_height="wrap_content"
android:background="?cardBackground"
android:gravity="center_horizontal">
<View
android:layout_width="match_parent"
android:layout_height="@dimen/divider_height"
android:background="?dividerHorizontal"/>
<include layout="@layout/divider_horizontal"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
@ -226,9 +223,12 @@
</LinearLayout>
</LinearLayout>
<include layout="@layout/place_page_fat_shadow"/>
<!-- User review block -->
<include
android:id="@+id/user_review_divider"
android:layout_width="match_parent"
android:layout_height="@dimen/divider_height"
layout="@layout/divider_horizontal"/>
<include
layout="@layout/item_ugc_comment"
android:id="@+id/rl_user_review"
@ -238,7 +238,7 @@
android:id="@+id/user_rating_records"
layout="@layout/place_page_rating_records"/>
<View
android:id="@+id/user_review_divider"
android:id="@+id/ugc_review_list_divider"
android:layout_width="match_parent"
android:layout_height="@dimen/divider_height"
android:background="?dividerHorizontal"/>

View file

@ -53,6 +53,8 @@ public class UGCController implements View.OnClickListener, UGC.UGCListener
@NonNull
private final View mUserReviewDivider;
@NonNull
private final View mReviewListDivider;
@NonNull
private final View mSummaryRootView;
@NonNull
private final TextView mSummaryReviewCount;
@ -136,6 +138,7 @@ public class UGCController implements View.OnClickListener, UGC.UGCListener
mUserReviewView = mPlacePage.findViewById(R.id.rl_user_review);
mUserReviewView.findViewById(R.id.rating).setVisibility(View.GONE);
mReviewListDivider = mPlacePage.findViewById(R.id.ugc_review_list_divider);
mUserReviewDivider = mPlacePage.findViewById(R.id.user_review_divider);
UGC.setListener(this);
@ -218,6 +221,7 @@ public class UGCController implements View.OnClickListener, UGC.UGCListener
List<UGC.Review> reviews = ugc.getReviews();
if (reviews != null)
mUGCReviewAdapter.setItems(ugc.getReviews());
UiUtils.showIf(reviews != null, mReviewListDivider);
UiUtils.showIf(reviews != null && reviews.size() > UGCReviewAdapter.MAX_COUNT, mUgcMoreReviews);
}
@ -250,7 +254,8 @@ public class UGCController implements View.OnClickListener, UGC.UGCListener
private void setUserReviewAndRatingsView(@Nullable UGCUpdate update)
{
UiUtils.showIf(update != null, mUserReviewView, mUserReviewDivider, mUserRatingRecordsContainer);
UiUtils.showIf(update != null, mUserReviewView, mUserReviewDivider,
mUserRatingRecordsContainer);
if (update == null)
return;
TextView name = (TextView) mUserReviewView.findViewById(R.id.name);

View file

@ -168,6 +168,7 @@ public class PlacePageView extends RelativeLayout
private View mWiki;
private View mEntrance;
private TextView mTvEntrance;
private View mTaxiShadow;
private View mTaxiDivider;
private View mTaxi;
private View mEditPlace;
@ -387,6 +388,7 @@ public class PlacePageView extends RelativeLayout
mWiki.setOnClickListener(this);
mEntrance = mDetails.findViewById(R.id.ll__place_entrance);
mTvEntrance = (TextView) mEntrance.findViewById(R.id.tv__place_entrance);
mTaxiShadow = mDetails.findViewById(R.id.place_page_taxi_shadow);
mTaxiDivider = mDetails.findViewById(R.id.place_page_taxi_divider);
mTaxi = mDetails.findViewById(R.id.ll__place_page_taxi);
TextView orderTaxi = (TextView) mTaxi.findViewById(R.id.tv__place_page_order_taxi);
@ -1559,7 +1561,7 @@ public class PlacePageView extends RelativeLayout
boolean showTaxiOffer = taxiTypes != null && !taxiTypes.isEmpty() &&
LocationHelper.INSTANCE.getMyPosition() != null &&
ConnectionState.isConnected();
UiUtils.showIf(showTaxiOffer, mTaxi, mTaxiDivider);
UiUtils.showIf(showTaxiOffer, mTaxi, mTaxiShadow, mTaxiDivider);
if (!showTaxiOffer)
return;