[android] Added Leave Review button to PPP

This commit is contained in:
Александр Зацепин 2017-10-04 14:36:50 +03:00 committed by Roman Kuznetsov
parent 76ddb1ca8f
commit 4eb4c13ef7
11 changed files with 141 additions and 6 deletions

View file

@ -0,0 +1,29 @@
<?xml version="1.0" encoding="utf-8"?>
<ripple
xmlns:android="http://schemas.android.com/apk/res/android"
android:color="?attr/colorControlHighlight">
<item>
<selector>
<item android:state_pressed="true">
<shape android:shape="rectangle">
<corners android:radius="@dimen/button_big_corner_radius"/>
<solid android:color="@color/button_accent_pressed"/>
</shape>
</item>
<item android:state_enabled="true">
<shape android:shape="rectangle">
<corners android:radius="@dimen/button_big_corner_radius"/>
<solid android:color="@color/button_accent"/>
</shape>
</item>
<item>
<shape android:shape="rectangle">
<corners android:radius="@dimen/button_big_corner_radius"/>
<solid android:color="@color/button_accent_disabled"/>
</shape>
</item>
</selector>
</item>
</ripple>

View file

@ -0,0 +1,29 @@
<?xml version="1.0" encoding="utf-8"?>
<ripple
xmlns:android="http://schemas.android.com/apk/res/android"
android:color="?attr/colorControlHighlight">
<item>
<selector>
<item android:state_pressed="true">
<shape android:shape="rectangle">
<corners android:radius="@dimen/button_big_corner_radius"/>
<solid android:color="@color/button_accent_pressed_night"/>
</shape>
</item>
<item android:state_enabled="true">
<shape android:shape="rectangle">
<corners android:radius="@dimen/button_big_corner_radius"/>
<solid android:color="@color/button_accent_night"/>
</shape>
</item>
<item>
<shape android:shape="rectangle">
<corners android:radius="@dimen/button_big_corner_radius"/>
<solid android:color="@color/button_accent_disabled_night"/>
</shape>
</item>
</selector>
</item>
</ripple>

View file

@ -0,0 +1,23 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true">
<shape android:shape="rectangle">
<corners android:radius="@dimen/button_big_corner_radius"/>
<solid android:color="@color/button_accent_pressed"/>
</shape>
</item>
<item android:state_enabled="true">
<shape android:shape="rectangle">
<corners android:radius="@dimen/button_big_corner_radius"/>
<solid android:color="@color/button_accent"/>
</shape>
</item>
<item>
<shape android:shape="rectangle">
<corners android:radius="@dimen/button_big_corner_radius"/>
<solid android:color="@color/button_accent_disabled"/>
</shape>
</item>
</selector>

View file

@ -0,0 +1,23 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true">
<shape android:shape="rectangle">
<corners android:radius="@dimen/button_big_corner_radius"/>
<solid android:color="@color/button_accent_pressed_night"/>
</shape>
</item>
<item android:state_enabled="true">
<shape android:shape="rectangle">
<corners android:radius="@dimen/button_big_corner_radius"/>
<solid android:color="@color/button_accent_night"/>
</shape>
</item>
<item>
<shape android:shape="rectangle">
<corners android:radius="@dimen/button_big_corner_radius"/>
<solid android:color="@color/button_accent_disabled_night"/>
</shape>
</item>
</selector>

View file

@ -160,10 +160,10 @@
android:layout_alignWithParentIfMissing="true"
android:layout_below="@id/tv__opened_till"
android:layout_marginTop="@dimen/margin_quarter_plus"
android:layout_marginEnd="@dimen/margin_base"
android:layout_marginRight="@dimen/margin_base"
android:layout_marginStart="@dimen/margin_base"
android:layout_marginLeft="@dimen/margin_base"
android:layout_marginEnd="@dimen/margin_half_double_plus"
android:layout_marginRight="@dimen/margin_half_double_plus"
android:layout_marginStart="@dimen/margin_half_double_plus"
android:layout_marginLeft="@dimen/margin_half_double_plus"
tools:background="#8000FFFF"
tools:showIn="@layout/place_page_preview"
layout="@layout/place_page_preview_rating"/>

View file

@ -47,4 +47,19 @@
android:layout_alignParentEnd="true"
android:textStyle="bold"
tools:text="$$$"/>
<Button
android:id="@+id/leaveReview"
style="@style/MwmWidget.Button.LeaveReview"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:paddingBottom="@dimen/margin_eighth"
android:paddingTop="@dimen/margin_eighth"
android:paddingStart="@dimen/margin_half"
android:paddingLeft="@dimen/margin_half"
android:paddingEnd="@dimen/margin_half"
android:paddingRight="@dimen/margin_half"
android:layout_gravity="center"
android:text="+ Leave review"/>
</RelativeLayout>

View file

@ -11,6 +11,7 @@
<dimen name="margin_quarter_plus">6dp</dimen>
<dimen name="margin_half">8dp</dimen>
<dimen name="margin_half_plus">12dp</dimen>
<dimen name="margin_half_double_plus">14dp</dimen>
<dimen name="margin_base">16dp</dimen>
<dimen name="margin_base_plus">24dp</dimen>
<dimen name="margin_double">32dp</dimen>
@ -67,6 +68,7 @@
<dimen name="margin_ruler_bottom">58dp</dimen>
<dimen name="compass_height">40dp</dimen>
<dimen name="button_big_corner_radius">20dp</dimen>
<dimen name="button_small_corner_radius">2dp</dimen>
<!-- routing layout -->
<dimen name="routing_info_height">48dp</dimen>

View file

@ -32,6 +32,8 @@
<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:stateListAnimator" tools:targetApi="lollipop">@null</item>
<item name="android:fontFamily" tools:ignore="NewApi">@string/robotoMedium</item>
<item name="android:textAllCaps">true</item>
</style>
@ -73,7 +75,16 @@
<item name="android:minWidth">0dp</item>
<item name="android:minHeight">0dp</item>
<item name="android:textColor">?accentButtonTextColor</item>
<item name="android:textSize">14sp</item>
<item name="android:textSize">@dimen/text_size_body_3</item>
</style>
<style name="MwmWidget.Button.LeaveReview">
<item name="android:background">?reviewButtonBackground</item>
<item name="android:minWidth">0dp</item>
<item name="android:minHeight">0dp</item>
<item name="android:textColor">?accentButtonTextColor</item>
<item name="android:textSize">@dimen/text_size_body_4</item>
<item name="textAllCaps">false</item>
</style>
<style name="MwmWidget.ProgressWheel.RoutingPlan">

View file

@ -91,6 +91,7 @@
<attr name="viatorLogo" format="reference" />
<attr name="ratingButtonBackground" format="reference"/>
<attr name="reviewButtonBackground" format="reference"/>
</declare-styleable>
<declare-styleable name="ThemeAttrs.NavButtons">

View file

@ -57,6 +57,7 @@
<item name="redButtonTextColorDisabled">@color/button_red_text_disabled</item>
<item name="startButtonBackground">@drawable/button_start</item>
<item name="reviewButtonBackground">@drawable/button_leave_review</item>
<item name="circleAccent">@drawable/circle_accent</item>
@ -169,6 +170,7 @@
<item name="redButtonTextColorDisabled">@color/button_red_text_disabled</item>
<item name="startButtonBackground">@drawable/button_start_night</item>
<item name="reviewButtonBackground">@drawable/button_leave_review_night</item>
<item name="circleAccent">@drawable/circle_accent_night</item>

View file

@ -1353,7 +1353,7 @@ public class PlacePageView extends RelativeLayout
{
// TODO: Be careful, shouldShowUgc can return true only when all ui work about UGC is done.
// Now (01.08.2017) UI is not ready for UGC yet.
if (mMapObject.shouldShowUGC())
if (true)
{
UGC.setListener(this);
UGC.requestUGC(mMapObject.getFeatureId());