payment_view.xml 13.0 KB
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <ScrollView
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_gravity="center">

        <LinearLayout
            android:id="@+id/main_card"
            android:layout_width="300dp"
            android:layout_height="wrap_content"
            android:layout_gravity="center_horizontal"
            android:background="@drawable/main_card_bg"
            android:gravity="center"
            android:orientation="vertical">

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:gravity="center_vertical"
                android:orientation="horizontal"
                android:paddingLeft="12dp"
                android:paddingTop="8dp"
                android:paddingRight="12dp"
                android:paddingBottom="8dp">

                <Space
                    android:layout_width="0dp"
                    android:layout_height="wrap_content"
                    android:layout_weight="1" />

                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="订单支付"
                    android:textColor="@android:color/black"
                    android:textSize="18sp" />

                <LinearLayout
                    android:layout_width="0dp"
                    android:layout_height="wrap_content"
                    android:layout_weight="1"
                    android:gravity="end|center_vertical"
                    android:orientation="horizontal">

                    <ImageButton
                        android:id="@+id/close_btn"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:background="?android:attr/selectableItemBackgroundBorderless"
                        android:padding="4dp"
                        android:src="@drawable/baseline_close_24" />
                </LinearLayout>
            </LinearLayout>

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:background="#eee"
                android:orientation="horizontal"
                android:paddingLeft="8dp"
                android:paddingTop="4dp"
                android:paddingRight="8dp"
                android:paddingBottom="4dp">

                <TextView
                    android:id="@+id/order_name_tv"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:textColor="@android:color/black"
                    android:textSize="14sp" />

                <Space
                    android:layout_width="0dp"
                    android:layout_height="wrap_content"
                    android:layout_weight="1" />

                <TextView
                    android:id="@+id/order_amount_tv"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="订单:0.01元"
                    android:textColor="@android:color/black"
                    android:textSize="14sp" />
            </LinearLayout>

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:orientation="vertical"
                android:paddingLeft="12dp"
                android:paddingTop="8dp"
                android:paddingRight="12dp"
                android:paddingBottom="8dp">

                <FrameLayout
                    android:id="@+id/coins_bg_view"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:background="@drawable/payment_coins_bg">

                    <LinearLayout
                        android:id="@+id/coins_view"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:background="?android:attr/listChoiceBackgroundIndicator"
                        android:clickable="true"
                        android:focusable="true"
                        android:gravity="center_vertical"
                        android:orientation="horizontal"
                        android:paddingLeft="8dp"
                        android:paddingTop="4dp"
                        android:paddingRight="8dp"
                        android:paddingBottom="4dp">

                        <ImageView
                            android:id="@+id/coins_img"
                            android:layout_width="16dp"
                            android:layout_height="16dp"
                            android:src="@drawable/ic_right_off_s" />

                        <TextView
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:layout_marginLeft="4dp"
                            android:text="使用平台币抵消"
                            android:textColor="@android:color/black"
                            android:textSize="14sp" />

                        <Space
                            android:layout_width="0dp"
                            android:layout_height="wrap_content"
                            android:layout_weight="1" />

                        <TextView
                            android:id="@+id/coins_tv"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:text="余额:0元"
                            android:textColor="@android:color/black"
                            android:textSize="14sp" />
                    </LinearLayout>
                </FrameLayout>

                <GridLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="8dp"
                    android:layout_marginBottom="8dp"
                    android:columnCount="3"
                    android:orientation="horizontal">

                    <FrameLayout
                        android:layout_width="0dp"
                        android:layout_columnWeight="1">

                        <ImageView
                            android:id="@+id/payment_type_alipay_iv"
                            android:layout_width="match_parent"
                            android:layout_height="wrap_content"
                            android:src="@drawable/img_recharge_alipay_off" />

                        <TextView
                            android:id="@+id/payment_type_alipay_tv"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:layout_gravity="center_horizontal|bottom"
                            android:layout_marginBottom="2dp"
                            android:text="支付宝"
                            android:textColor="@android:color/black"
                            android:textSize="12sp" />

                        <FrameLayout
                            android:id="@+id/payment_type_alipay_v"
                            android:layout_width="match_parent"
                            android:layout_height="match_parent"
                            android:clickable="true"
                            android:focusable="true"
                            android:foreground="?android:attr/listChoiceBackgroundIndicator" />
                    </FrameLayout>

                    <FrameLayout
                        android:layout_width="0dp"
                        android:layout_columnWeight="1"
                        android:layout_marginLeft="8dp"
                        android:background="?android:attr/listChoiceBackgroundIndicator"
                        android:clickable="true"
                        android:focusable="true">

                        <ImageView
                            android:id="@+id/payment_type_wechat_iv"
                            android:layout_width="match_parent"
                            android:layout_height="wrap_content"
                            android:src="@drawable/img_recharge_wechat_off" />

                        <TextView
                            android:id="@+id/payment_type_wechat_tv"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:layout_gravity="center_horizontal|bottom"
                            android:layout_marginBottom="2dp"
                            android:text="微信支付"
                            android:textColor="@android:color/black"
                            android:textSize="12sp" />

                        <FrameLayout
                            android:id="@+id/payment_type_wechat_v"
                            android:layout_width="match_parent"
                            android:layout_height="match_parent"
                            android:clickable="true"
                            android:focusable="true"
                            android:foreground="?android:attr/listChoiceBackgroundIndicator" />
                    </FrameLayout>

                    <FrameLayout
                        android:layout_width="0dp"
                        android:layout_columnWeight="1"
                        android:layout_marginLeft="8dp">

                        <ImageView
                            android:id="@+id/payment_type_alipay_qr_iv"
                            android:layout_width="match_parent"
                            android:layout_height="wrap_content"
                            android:src="@drawable/img_recharge_alipay_off" />

                        <TextView
                            android:id="@+id/payment_type_alipay_qr_tv"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:layout_gravity="center_horizontal|bottom"
                            android:layout_marginBottom="2dp"
                            android:text="支付宝扫码"
                            android:textColor="@android:color/black"
                            android:textSize="12sp" />

                        <FrameLayout
                            android:id="@+id/payment_type_alipay_qr_v"
                            android:layout_width="match_parent"
                            android:layout_height="match_parent"
                            android:clickable="true"
                            android:focusable="true"
                            android:foreground="?android:attr/listChoiceBackgroundIndicator" />
                    </FrameLayout>

                    <FrameLayout
                        android:layout_width="0dp"
                        android:layout_columnWeight="1"
                        android:layout_marginTop="8dp">

                        <ImageView
                            android:id="@+id/payment_type_wechat_qr_iv"
                            android:layout_width="match_parent"
                            android:layout_height="wrap_content"
                            android:src="@drawable/img_recharge_wechat_off" />

                        <TextView
                            android:id="@+id/payment_type_wechat_qr_tv"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:layout_gravity="center_horizontal|bottom"
                            android:layout_marginBottom="2dp"
                            android:text="微信扫码"
                            android:textColor="@android:color/black"
                            android:textSize="12sp" />

                        <FrameLayout
                            android:id="@+id/payment_type_wechat_qr_v"
                            android:layout_width="match_parent"
                            android:layout_height="match_parent"
                            android:clickable="true"
                            android:focusable="true"
                            android:foreground="?android:attr/listChoiceBackgroundIndicator" />
                    </FrameLayout>
                </GridLayout>

                <Button
                    android:id="@+id/confirm_btn"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:text="立即支付"
                    android:textSize="16sp" />
            </LinearLayout>
        </LinearLayout>
    </ScrollView>
</FrameLayout>