<?xml version="1.0" encoding="utf-8"?><!--
  ~ Copyright 2019, The Android Open Source Project
  ~
  ~ Licensed under the Apache License, Version 2.0 (the "License");
  ~ you may not use this file except in compliance with the License.
  ~ You may obtain a copy of the License at
  ~
  ~     http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~ Unless required by applicable law or agreed to in writing, software
  ~ distributed under the License is distributed on an "AS IS" BASIS,
  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  ~ See the License for the specific language governing permissions and
  ~ limitations under the License.
  -->

<layout 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:id="@+id/layout">

    <data>

        <variable
            name="chapter"
            type="com.example.android.gdgfinder.network.GdgChapter" />

        <variable
            name="clickListener"
            type="com.example.android.gdgfinder.search.GdgClickListener" />
    </data>

    <androidx.constraintlayout.widget.ConstraintLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:onClick="@{() -> clickListener.onClick(chapter)}"
        tools:context="com.example.android.gdg.gdglist.GdgListFragment">

        <ImageView
            android:id="@+id/gdg_image"
            android:layout_width="50dp"
            android:layout_height="76dp"
            android:layout_marginLeft="16dp"
            android:layout_marginTop="26dp"
            android:layout_marginBottom="26dp"
            android:contentDescription="TODO"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintLeft_toLeftOf="parent"
            app:layout_constraintTop_toTopOf="parent"
            app:srcCompat="@drawable/ic_gdg" />

        <TextView
            android:id="@+id/chapter_name"
            android:layout_width="0dp"
            android:layout_height="0dp"
            android:layout_marginStart="16dp"
            android:layout_marginEnd="16dp"
            android:gravity="center_vertical"
            android:text="@{chapter.name}"
            android:textAppearance="?textAppearanceHeadline6"
            app:layout_constraintBottom_toBottomOf="@+id/gdg_image"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toEndOf="@+id/gdg_image"
            app:layout_constraintTop_toTopOf="@+id/gdg_image"
            app:layout_constraintVertical_chainStyle="packed"
            tools:text="GDG Mountain View is really long so it will wrap in tools" />
    </androidx.constraintlayout.widget.ConstraintLayout>
</layout>