<?xml version="1.0" encoding="utf-8"?>
<!--
  ~ The MIT License (MIT)
  ~ Copyright © 2018 NBCO Yandex.Money LLC
  ~
  ~ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
  ~ associated documentation files (the “Software”), to deal in the Software without restriction, including
  ~ without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
  ~ of the Software, and to permit persons to whom the Software is furnished to do so, subject to the
  ~ following conditions:
  ~
  ~ The above copyright notice and this permission notice shall be included in all copies or substantial
  ~ portions of the Software.
  ~
  ~ THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
  ~ INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
  ~ PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
  ~ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT
  ~ OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
  ~ OTHER DEALINGS IN THE SOFTWARE.
  -->

<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:minHeight="@dimen/ym_space_4xl"
    android:background="?android:attr/selectableItemBackground"
    tools:ignore="RtlSymmetry">

    <ImageView
        android:id="@+id/image"
        android:layout_width="@dimen/ym_icon_size_3xl"
        android:layout_height="@dimen/ym_icon_size_3xl"
        android:layout_marginLeft="@dimen/ym_space_m"
        android:layout_marginStart="@dimen/ym_space_m"
        android:scaleType="fitCenter"
        android:contentDescription="@null"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent"
        tools:src="@drawable/ym_ic_cardbrand_cup"/>

    <TextView
        style="@style/ym_Text.Common"
        android:id="@+id/primaryText"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginLeft="@dimen/ym_screen_indentStart"
        android:layout_marginStart="@dimen/ym_screen_indentStart"
        app:layout_constraintBottom_toTopOf="@+id/secondaryText"
        app:layout_constraintEnd_toStartOf="@+id/endText"
        app:layout_constraintHorizontal_bias="0.0"
        app:layout_constraintStart_toEndOf="@+id/image"
        app:layout_constraintTop_toTopOf="parent"
        app:layout_constraintVertical_chainStyle="packed"
        app:layout_goneMarginStart="@dimen/ym_screen_indentStart"
        tools:text="Primary text"
        tools:targetApi="jelly_bean" />

    <TextView
        style="@style/ym_Text.Common"
        android:id="@+id/secondaryText"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:visibility="gone"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintStart_toStartOf="@+id/primaryText"
        app:layout_constraintEnd_toStartOf="@+id/endText"
        app:layout_constraintTop_toBottomOf="@+id/primaryText"
        app:layout_constraintVertical_chainStyle="packed"
        tools:text="Secondary text"
        tools:visibility="visible" />

    <TextView
        android:id="@+id/endText"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:drawablePadding="@dimen/ym_iconPlusText_iconMargin_xl"
        android:layout_marginEnd="@dimen/ym_screen_indentEnd"
        android:layout_marginRight="@dimen/ym_screen_indentEnd"
        android:padding="@dimen/ym_space_xs"
        app:layout_constraintTop_toTopOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintBottom_toBottomOf="parent"
        tools:drawableEnd="@drawable/ym_ic_add_card"
        tools:text="* 1234"/>

    <include
        layout="@layout/ym_divider"
        android:id="@+id/divider"
        android:layout_width="0dp"
        android:layout_height="1dp"
        android:visibility="gone"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintLeft_toLeftOf="@+id/primaryText"
        app:layout_constraintRight_toRightOf="parent"/>
</android.support.constraint.ConstraintLayout>