[android] Added UGC UI in PP

This commit is contained in:
Александр Зацепин 2017-06-19 17:13:44 +03:00 committed by Yuri Gorshenin
parent 94dff2d90e
commit 87bf0b9421
3 changed files with 211 additions and 0 deletions

View file

@ -0,0 +1,115 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<View
android:id="@+id/v__divider"
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginLeft="@dimen/margin_base"
android:layout_marginRight="@dimen/margin_base"
android:background="?dividerHorizontal"/>
<TextView
android:id="@+id/tv__user_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/margin_base"
android:layout_marginStart="@dimen/margin_base"
android:layout_marginTop="@dimen/margin_base"
android:layout_toLeftOf="@+id/tv__comment_date"
android:layout_toStartOf="@+id/tv__comment_date"
android:layout_below="@id/v__divider"
android:textAppearance="@style/MwmTextAppearance.Body3"
tools:text="Аleksey"/>
<TextView
android:id="@+id/tv__comment_date"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/margin_base"
android:layout_marginRight="@dimen/margin_base"
android:layout_marginEnd="@dimen/margin_base"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:layout_alignParentTop="true"
android:textAppearance="@style/MwmTextAppearance.Body4"
tools:text="March 29, 2016"/>
<TextView
android:id="@+id/tv__review"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/margin_base"
android:layout_marginStart="@dimen/margin_base"
android:layout_marginRight="@dimen/margin_base"
android:layout_marginEnd="@dimen/margin_base"
android:layout_marginTop="@dimen/margin_half_plus"
android:layout_below="@id/tv__user_name"
android:textAppearance="@style/MwmTextAppearance.Body3.Primary"
android:visibility="gone"
tools:visibility="visible"
tools:text="Interesting place among SoHo, Little Italy and China town. Modern design. Great view from roof. Near subway. Free refreshment every afternoon. The staff was very friendly."/>
<ImageView
android:id="@+id/like"
android:layout_marginLeft="@dimen/margin_base"
android:layout_marginStart="@dimen/margin_base"
android:layout_marginTop="@dimen/margin_base"
android:src="@android:drawable/star_on"
android:layout_below="@id/tv__review"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
<TextView
android:id="@+id/like_count"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toRightOf="@id/like"
android:layout_toEndOf="@id/like"
android:layout_alignBottom="@id/like"
android:layout_marginLeft="@dimen/margin_quarter_plus"
android:layout_marginStart="@dimen/margin_quarter_plus"
android:textAppearance="@style/MwmTextAppearance.Body3"
tools:text="2"/>
<ImageView
android:id="@+id/dislike"
android:layout_marginLeft="@dimen/margin_base"
android:layout_marginStart="@dimen/margin_base"
android:layout_marginTop="@dimen/margin_base"
android:layout_toRightOf="@id/like_count"
android:layout_toEndOf="@id/like_count"
android:src="@android:drawable/star_on"
android:layout_below="@id/tv__review"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
<TextView
android:id="@+id/dislike_count"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toRightOf="@id/dislike"
android:layout_toEndOf="@id/dislike"
android:layout_alignBottom="@id/dislike"
android:layout_marginLeft="@dimen/margin_quarter_plus"
android:layout_marginStart="@dimen/margin_quarter_plus"
android:layout_toLeftOf="@+id/tv__original"
android:layout_toStartOf="@+id/tv__original"
android:textAppearance="@style/MwmTextAppearance.Body3"
tools:text="0"/>
<TextView
android:id="@+id/tv__original"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
style="@style/MwmTextAppearance.Body4"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_alignBottom="@id/dislike_count"
android:layout_marginEnd="@dimen/margin_base"
android:layout_marginRight="@dimen/margin_base"
android:text="Show original"/>
</RelativeLayout>

View file

@ -44,6 +44,8 @@
<include layout="@layout/place_page_hotel_nearby"/>
<include layout="@layout/place_page_hotel_rating"/>
<include layout="@layout/place_page_ugc"/>
<include layout="@layout/place_page_placename"/>

View file

@ -0,0 +1,94 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/ll__place_hotel_rating"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:visibility="gone"
tools:visibility="visible">
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="158dp"
android:padding="@dimen/margin_base"
android:gravity="center_horizontal"
android:background="?ppRatingBackground">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/margin_base"
android:textAppearance="@style/MwmTextAppearance.Body1"
android:textColor="?ppRatingText"
tools:text="How was it? Tap to rate."/>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/margin_base"
android:orientation="horizontal">
<ImageButton
android:id="@+id/one_star"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_marginRight="@dimen/margin_half"
android:layout_marginEnd="@dimen/margin_half"/>
<ImageButton
android:id="@+id/two_stars"
android:layout_marginLeft="@dimen/margin_half"
android:layout_marginStart="@dimen/margin_half"
android:layout_marginRight="@dimen/margin_half"
android:layout_marginEnd="@dimen/margin_half"
android:layout_width="40dp"
android:layout_height="40dp"/>
<ImageButton
android:id="@+id/three_stars"
android:layout_marginLeft="@dimen/margin_half"
android:layout_marginStart="@dimen/margin_half"
android:layout_marginRight="@dimen/margin_half"
android:layout_marginEnd="@dimen/margin_half"
android:layout_width="40dp"
android:layout_height="40dp"/>
<ImageButton
android:id="@+id/four_stars"
android:layout_marginLeft="@dimen/margin_half"
android:layout_marginStart="@dimen/margin_half"
android:layout_marginRight="@dimen/margin_half"
android:layout_marginEnd="@dimen/margin_half"
android:layout_width="40dp"
android:layout_height="40dp"/>
<ImageButton
android:id="@+id/five_stars"
android:layout_marginLeft="@dimen/margin_half"
android:layout_marginStart="@dimen/margin_half"
android:layout_width="40dp"
android:layout_height="40dp"/>
</LinearLayout>
<Button
android:id="@+id/write_review"
android:layout_width="match_parent"
android:layout_height="36dp"
android:textAllCaps="true"
android:text="Write a review"/>
</LinearLayout>
<android.support.v7.widget.RecyclerView
android:id="@+id/rv__place_ugc_review"
android:layout_width="match_parent"
android:layout_height="wrap_content"
tools:listitem="@layout/item_ugc_comment"/>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginLeft="@dimen/margin_base"
android:layout_marginRight="@dimen/margin_base"
android:background="?dividerHorizontal"/>
<TextView
android:id="@+id/tv__place_ugc_reviews_more"
style="@style/PlacePageMetadataText.Button"
android:height="@dimen/height_block_base"
android:background="?clickableBackground"
android:gravity="center"
android:text="More reviews"/>
<include layout="@layout/divider_horizontal"/>
</LinearLayout>