<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2016 The Chromium Authors
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
-->
<!-- RadioButtonWithDescription extends RelativeLayout -->
<merge
xmlns:android="http://schemas.android.com/apk/res/android">
<RelativeLayout
android:id="@+id/radio_container"
android:layout_toStartOf="@id/end_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:gravity="center_vertical"
android:orientation="horizontal">
<RadioButton
android:id="@+id/radio_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginEnd="16dp"
android:clickable="false"
android:focusable="false"
android:background="@null" />
<org.chromium.ui.widget.ChromeImageView
android:id="@+id/icon"
android:layout_width="@dimen/radio_button_with_description_icon_size"
android:layout_height="@dimen/radio_button_with_description_icon_size"
android:layout_marginEnd="16dp"
android:layout_toEndOf="@id/radio_button"
android:layout_centerVertical="true"
android:scaleType="fitCenter"
android:tint="@macro/default_icon_color"
android:visibility="gone"
android:importantForAccessibility="no" />
<TextView
android:id="@+id/primary"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toEndOf="@id/icon"
android:textAppearance="@style/TextAppearance.TextLarge.Primary" />
<!-- This TextView is hidden if it has no text, so the initial visibility should be "gone". -->
<TextView
android:id="@+id/description"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignStart="@id/primary"
android:layout_below="@id/primary"
android:textAppearance="@style/TextAppearance.TextMedium.Secondary"
android:visibility="gone" />
</RelativeLayout>
<!-- A ViewStub placed at the end of the widget that can be replaced by a customized view -->
<ViewStub
android:id="@+id/end_view_stub"
android:inflatedId="@+id/end_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignTop="@id/radio_container"
android:layout_alignBottom="@id/radio_container"
android:layout_alignParentEnd="true"
android:background="@null" />
</merge>