<?xml version="1.0" encoding="utf-8"?>
<!--
  ~ Copyright (C) 2024 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.
  -->

<androidx.appcompat.widget.LinearLayoutCompat
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/measurement_fragment"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical">
    <androidx.core.widget.NestedScrollView
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:scrollbars="vertical"
        android:focusableInTouchMode="true">

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="vertical">
            <View
                android:id="@+id/adservices_ppapi_title_spacing"
                android:visibility="@integer/adservices_ppapi_title_spacing"
                android:layout_height="@dimen/adservices_ppapi_title_spacing_height"
                android:layout_width="match_parent"/>
            <TextView
                android:paddingHorizontal="@dimen/adservices_content_horizontal_padding"
                android:text="@string/settingsUI_measurement_view_intro_text"
                style="@style/MainStyle.Body2" />
            <View
                android:id="@+id/measurement_switch_bar_spacing"
                android:visibility="@integer/measurement_switch_bar_spacing"
                android:layout_height="@dimen/measurement_switch_bar_spacing_height"
                android:layout_width="match_parent"/>

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:orientation="horizontal"
                android:padding="@dimen/adservices_content_padding"
                android:background="?android:attr/selectableItemBackground">
                <TextView
                    android:layout_width="0dp"
                    android:layout_height="wrap_content"
                    android:layout_weight="1"
                    android:text="@string/settingsUI_measurement_switch_title"
                    android:textAppearance="@style/TextAppearance.H5" />
                <Switch
                    android:id="@+id/measurement_switch_bar"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"/>
            </LinearLayout>

            <LinearLayout
                android:id="@+id/reset_measurement_button"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:orientation="horizontal"
                android:padding="@dimen/adservices_content_padding"
                android:background="?android:attr/selectableItemBackground" >
                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="match_parent"
                    android:key="reset_measurement"
                    android:gravity="center_vertical"
                    android:text="@string/settingsUI_measurement_view_reset_title"
                    android:textAppearance="@style/TextAppearance.H5"
                    android:drawableStart="@drawable/ic_restart_alt_24dp"
                    android:drawablePadding="@dimen/adservices_drawable_padding"/>
            </LinearLayout>

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:paddingHorizontal="@dimen/adservices_content_horizontal_padding"
                android:paddingBottom="@dimen/adservices_content_2x_padding"
                android:focusable="false"
                android:orientation="vertical">
                <ImageView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="@dimen/adservices_footer_content_half_padding"
                    android:layout_marginBottom="@dimen/adservices_footer_content_padding"
                    android:src="@drawable/ic_info_icon"
                    tools:ignore="ContentDescription" />
                <TextView
                    android:id="@+id/measurement_footer"
                    android:text="@string/settingsUI_measurement_view_footer_text"
                    style="@style/MainStyle.Body2" />
            </LinearLayout>
        </LinearLayout>
    </androidx.core.widget.NestedScrollView>
</androidx.appcompat.widget.LinearLayoutCompat>
