[android] Implemented bookmark payment ui layout

This commit is contained in:
Александр Зацепин 2018-11-14 21:16:58 +03:00 committed by yoksnod
parent 2a177a3235
commit 0f8b2fb0fb
15 changed files with 112 additions and 25 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 88 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 163 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 51 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 88 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 133 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 257 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 238 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 442 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 373 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 648 KiB

View file

@ -0,0 +1,23 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:id="@+id/image"
android:layout_width="@dimen/bookmark_purchase_img_width"
android:layout_height="match_parent"
android:layout_alignParentStart="true"
android:layout_alignParentLeft="true"
android:scaleType="centerCrop"
android:src="@drawable/img_guides_placeholder_land"/>
<android.support.v4.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_toRightOf="@id/image"
android:layout_toEndOf="@id/image"
android:layout_alignParentTop="true"
android:fillViewport="true">
<include layout="@layout/bookmark_payment_layout"/>
</android.support.v4.widget.NestedScrollView>
</RelativeLayout>

View file

@ -0,0 +1,71 @@
<?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:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:showIn="@layout/fragment_bookmark_payment">
<TextView
android:id="@+id/product_store_name"
android:textAppearance="?android:textAppearanceSmall"
tools:text="Store name localized product id"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="@dimen/margin_base_plus"
android:gravity="start"
android:textAllCaps="true"/>
<include layout="@layout/divider_horizontal"/>
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="@dimen/margin_base_plus">
<TextView
android:id="@+id/product_catalog_name"
android:textAppearance="?android:textAppearanceLarge"
tools:text="Have a dinner with Hemingway and Castro in Havana"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="start"/>
<TextView
android:id="@+id/author_name"
android:textAppearance="?android:textAppearanceSmall"
tools:text="by Julio Mulio"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/margin_base"
android:gravity="start"/>
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/margin_base_plus"
android:layout_marginBottom="@dimen/margin_base"
android:layout_gravity="center">
<Button
android:id="@+id/buy_btn"
style="@style/MwmWidget.Button.Primary"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:text="BUY FOR $1.99"/>
<ProgressBar
android:id="@+id/progress"
android:layout_width="@dimen/margin_base_plus"
android:layout_height="@dimen/margin_base_plus"
style="@android:style/Widget.Holo.ProgressBar.Large"
android:layout_gravity="center"
android:visibility="visible"
tools:visibility="visible"/>
</FrameLayout>
<TextView
android:id="@+id/cancel_btn"
android:textAppearance="?android:textAppearanceSmall"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="@dimen/margin_half_plus_eight"
android:textColor="?colorAccent"
android:text="@string/cancel"
android:gravity="center"
android:textAllCaps="true"/>
</LinearLayout>
</LinearLayout>

View file

@ -1,22 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
<android.support.v4.widget.NestedScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center">
<Button
android:id="@+id/query_inapps"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Query inapps"/>
<Button
android:id="@+id/buy_inapp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Buy inapps"/>
<Button
android:id="@+id/consume_apps"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Consume apps"/>
</LinearLayout>
android:fillViewport="true">
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:id="@+id/image"
android:layout_width="match_parent"
android:layout_height="@dimen/bookmark_purchase_img_height"
android:scaleType="centerCrop"
android:src="@drawable/img_guides_placeholder"/>
<include layout="@layout/bookmark_payment_layout"/>
</LinearLayout>
</android.support.v4.widget.NestedScrollView>

View file

@ -4,7 +4,6 @@
<dimen name="track_circle_size">40dp</dimen>
<!-- margins -->
<dimen name="margin_eighth">2dp</dimen>
<dimen name="margin_quarter">4dp</dimen>
<dimen name="margin_quarter_plus">6dp</dimen>
@ -257,4 +256,6 @@
<dimen name="ads_removal_pay_button_min_width">240dp</dimen>
<dimen name="dot_size">6dp</dimen>
<dimen name="sharing_options_img_size">18dp</dimen>
<dimen name="bookmark_purchase_img_height">258dp</dimen>
<dimen name="bookmark_purchase_img_width">280dp</dimen>
</resources>

View file

@ -65,12 +65,7 @@ public class BookmarkPaymentFragment extends BaseMwmFragment
Bundle savedInstanceState)
{
View root = inflater.inflate(R.layout.fragment_bookmark_payment, container, false);
// TODO: temporary launch of billing flow.
root.findViewById(R.id.buy_inapp).setOnClickListener(v -> startPurchaseTransaction());
root.findViewById(R.id.query_inapps).setOnClickListener(v -> mPurchaseController.queryPurchaseDetails());
root.findViewById(R.id.consume_apps).setOnClickListener(v -> {
});
// TODO: implementation coming soon.
return root;
}