<commit_before><?xml version="1.0" encoding="utf-8"?>
<!--
  ~ Copyright 2018 Google LLC
  ~
  ~ 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
  ~
  ~     https://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">

    <data>

        <variable
            name="viewModel"
            type="com.google.samples.apps.iosched.ui.schedule.ScheduleViewModel" />

        <variable
            name="headerAlpha"
            type="androidx.databinding.ObservableFloat" />

        <variable
            name="descriptionAlpha"
            type="androidx.databinding.ObservableFloat" />

        <variable
            name="recyclerviewAlpha"
            type="androidx.databinding.ObservableFloat" />
    </data>

    <androidx.constraintlayout.widget.ConstraintLayout
        android:id="@+id/filter_sheet"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="@drawable/filters_sheet_background"
        android:backgroundTint="?attr/colorSurface"
        android:clickable="true"
        android:elevation="@dimen/bottom_sheet_elevation"
        android:focusable="true"
        tools:ignore="Overdraw">

        <androidx.constraintlayout.widget.Guideline
            android:id="@+id/guide_peek_height"
            android:layout_width="0dp"
            android:layout_height="0dp"
            android:orientation="horizontal"
            app:layout_constraintGuide_begin="@dimen/bottom_sheet_peek_height" />

        <androidx.recyclerview.widget.RecyclerView
            android:id="@+id/recyclerview"
            android:layout_width="0dp"
            android:layout_height="0dp"
            android:alpha="@{recyclerviewAlpha}"
            android:clipToPadding="false"
            android:nestedScrollingEnabled="false"
            android:orientation="vertical"
            android:padding="@dimen/margin_normal"
            android:scrollbarStyle="outsideOverlay"
            android:scrollbars="vertical"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintLeft_toLeftOf="parent"
            app:layout_constraintRight_toRightOf="parent"
            app:layout_constraintTop_toBottomOf="@id/guide_peek_height"
            app:layoutManager="GridLayoutManager"
            app:spanCount="2"
            tools:listitem="@layout/item_event_filter"
            tools:targetApi="o" />

        <!--
          ~ Mimics raising the elevation of a container around the header elements (like when an
          ~ AppBarLayout reaches the collapsed state). We fake this because (a) there is no
          ~ container view around these views, and (b) the extra elevation shows along the top of
          ~ the sheet, particularly around the rounded corners, and doesn't look good.
          -->
        <View
            android:id="@+id/filters_header_shadow"
            android:layout_width="0dp"
            android:layout_height="4dp"
            android:alpha="0"
            android:background="@drawable/filters_sheet_header_shadow"
            android:stateListAnimator="@animator/active_alpha"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@id/guide_peek_height" />

        <!-- Description view shown when tag filters are active -->
        <androidx.recyclerview.widget.RecyclerView
            android:id="@+id/filter_description_tags"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_marginStart="@dimen/margin_normal"
            android:alpha="@{descriptionAlpha}"
            android:fadingEdgeLength="@dimen/margin_large"
            android:orientation="horizontal"
            android:requiresFadingEdge="horizontal"
            app:layout_constraintBottom_toTopOf="@id/guide_peek_height"
            app:layout_constraintEnd_toStartOf="@id/clear_filters_shortcut"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="parent"
            app:goneUnless="@{viewModel.hasAnyFilters}"
            app:layoutManager="LinearLayoutManager"
            app:selectedFilters="@{viewModel.selectedFilters}"
            tools:listitem="@layout/item_event_filter"
            tools:visibility="gone" />

        <!-- Shortcut for clearing the current filters, shown with the filters description -->
        <ImageButton
            android:id="@+id/clear_filters_shortcut"
            android:layout_width="@dimen/a11y_min_touch_target"
            android:layout_height="@dimen/a11y_min_touch_target"
            android:layout_marginEnd="@dimen/margin_small"
            android:alpha="@{descriptionAlpha}"
            android:background="?selectableItemBackgroundBorderless"
            android:clickable="@{descriptionAlpha > 0f}"
            android:contentDescription="@string/a11y_clear_tag_filters"
            android:onClick="@{(v) -> viewModel.clearFilters()}"
            android:scaleType="center"
            android:tint="?attr/colorControlNormal"
            app:layout_constraintBottom_toTopOf="@id/guide_peek_height"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintTop_toTopOf="parent"
            app:goneUnless="@{viewModel.hasAnyFilters}"
            app:srcCompat="@drawable/ic_clear_all"
            tools:visibility="gone" />

        <View
            android:id="@+id/expand"
            android:layout_width="0dp"
            android:layout_height="0dp"
            app:layout_constraintBottom_toTopOf="@id/guide_peek_height"
            app:layout_constraintEnd_toStartOf="@id/clear_filters_shortcut"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="parent" />

        <!-- Header views shown when the sheet is expanded -->

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center"
            android:alpha="@{headerAlpha}"
            android:textAppearance="?android:textAppearanceMedium"
            android:textColor="?android:textColorPrimary"
            app:layout_constraintBottom_toTopOf="@id/guide_peek_height"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="parent"
            app:eventCount="@{viewModel.eventCount}"
            app:hasFilters="@{viewModel.hasAnyFilters}"
            tools:text="@string/filters" />

        <Button
            android:id="@+id/reset"
            style="?borderlessButtonStyle"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center_vertical|start"
            android:alpha="@{headerAlpha}"
            android:clickable="@{headerAlpha > 0f}"
            android:minWidth="0dp"
            android:paddingStart="@dimen/margin_normal"
            android:paddingEnd="@dimen/margin_normal"
            android:text="@string/reset"
            app:layout_constraintBottom_toTopOf="@id/guide_peek_height"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="parent"
            app:animatedOnClick="@{() -> viewModel.clearFilters()}"
            app:eventFilters="@{recyclerview}"
            app:goneUnless="@{viewModel.hasAnyFilters}"
            tools:targetApi="o"
            tools:visibility="visible" />

        <ImageButton<commit_msg>Adjust reset button position<commit_after><?xml version="1.0" encoding="utf-8"?>
<!--
  ~ Copyright 2018 Google LLC
  ~
  ~ 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
  ~
  ~     https://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">

    <data>

        <variable
            name="viewModel"
            type="com.google.samples.apps.iosched.ui.schedule.ScheduleViewModel" />

        <variable
            name="headerAlpha"
            type="androidx.databinding.ObservableFloat" />

        <variable
            name="descriptionAlpha"
            type="androidx.databinding.ObservableFloat" />

        <variable
            name="recyclerviewAlpha"
            type="androidx.databinding.ObservableFloat" />
    </data>

    <androidx.constraintlayout.widget.ConstraintLayout
        android:id="@+id/filter_sheet"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="@drawable/filters_sheet_background"
        android:backgroundTint="?attr/colorSurface"
        android:clickable="true"
        android:elevation="@dimen/bottom_sheet_elevation"
        android:focusable="true"
        tools:ignore="Overdraw">

        <androidx.constraintlayout.widget.Guideline
            android:id="@+id/guide_peek_height"
            android:layout_width="0dp"
            android:layout_height="0dp"
            android:orientation="horizontal"
            app:layout_constraintGuide_begin="@dimen/bottom_sheet_peek_height" />

        <androidx.recyclerview.widget.RecyclerView
            android:id="@+id/recyclerview"
            android:layout_width="0dp"
            android:layout_height="0dp"
            android:alpha="@{recyclerviewAlpha}"
            android:clipToPadding="false"
            android:nestedScrollingEnabled="false"
            android:orientation="vertical"
            android:padding="@dimen/margin_normal"
            android:scrollbarStyle="outsideOverlay"
            android:scrollbars="vertical"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintLeft_toLeftOf="parent"
            app:layout_constraintRight_toRightOf="parent"
            app:layout_constraintTop_toBottomOf="@id/guide_peek_height"
            app:layoutManager="GridLayoutManager"
            app:spanCount="2"
            tools:listitem="@layout/item_event_filter"
            tools:targetApi="o" />

        <!--
          ~ Mimics raising the elevation of a container around the header elements (like when an
          ~ AppBarLayout reaches the collapsed state). We fake this because (a) there is no
          ~ container view around these views, and (b) the extra elevation shows along the top of
          ~ the sheet, particularly around the rounded corners, and doesn't look good.
          -->
        <View
            android:id="@+id/filters_header_shadow"
            android:layout_width="0dp"
            android:layout_height="4dp"
            android:alpha="0"
            android:background="@drawable/filters_sheet_header_shadow"
            android:stateListAnimator="@animator/active_alpha"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@id/guide_peek_height" />

        <!-- Description view shown when tag filters are active -->
        <androidx.recyclerview.widget.RecyclerView
            android:id="@+id/filter_description_tags"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_marginStart="@dimen/margin_normal"
            android:alpha="@{descriptionAlpha}"
            android:fadingEdgeLength="@dimen/margin_large"
            android:orientation="horizontal"
            android:requiresFadingEdge="horizontal"
            app:layout_constraintBottom_toTopOf="@id/guide_peek_height"
            app:layout_constraintEnd_toStartOf="@id/clear_filters_shortcut"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="parent"
            app:goneUnless="@{viewModel.hasAnyFilters}"
            app:layoutManager="LinearLayoutManager"
            app:selectedFilters="@{viewModel.selectedFilters}"
            tools:listitem="@layout/item_event_filter"
            tools:visibility="gone" />

        <!-- Shortcut for clearing the current filters, shown with the filters description -->
        <ImageButton
            android:id="@+id/clear_filters_shortcut"
            android:layout_width="@dimen/a11y_min_touch_target"
            android:layout_height="@dimen/a11y_min_touch_target"
            android:layout_marginEnd="@dimen/margin_small"
            android:alpha="@{descriptionAlpha}"
            android:background="?selectableItemBackgroundBorderless"
            android:clickable="@{descriptionAlpha > 0f}"
            android:contentDescription="@string/a11y_clear_tag_filters"
            android:onClick="@{(v) -> viewModel.clearFilters()}"
            android:scaleType="center"
            android:tint="?attr/colorControlNormal"
            app:layout_constraintBottom_toTopOf="@id/guide_peek_height"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintTop_toTopOf="parent"
            app:goneUnless="@{viewModel.hasAnyFilters}"
            app:srcCompat="@drawable/ic_clear_all"
            tools:visibility="gone" />

        <View
            android:id="@+id/expand"
            android:layout_width="0dp"
            android:layout_height="0dp"
            app:layout_constraintBottom_toTopOf="@id/guide_peek_height"
            app:layout_constraintEnd_toStartOf="@id/clear_filters_shortcut"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="parent" />

        <!-- Header views shown when the sheet is expanded -->

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center"
            android:alpha="@{headerAlpha}"
            android:textAppearance="?android:textAppearanceMedium"
            android:textColor="?android:textColorPrimary"
            app:layout_constraintBottom_toTopOf="@id/guide_peek_height"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="parent"
            app:eventCount="@{viewModel.eventCount}"
            app:hasFilters="@{viewModel.hasAnyFilters}"
            tools:text="@string/filters" />

        <Button
            android:id="@+id/reset"
            style="?borderlessButtonStyle"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginStart="@dimen/spacing_normal"
            android:alpha="@{headerAlpha}"
            android:clickable="@{headerAlpha > 0f}"
            android:minWidth="0dp"
            android:paddingStart="@dimen/margin_normal"
            android:paddingEnd="@dimen/margin_normal"
            android:text="@string/reset"
            app:layout_constraintBottom_toTopOf="@id/guide_peek_height"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="parent"
            app:animatedOnClick="@{() -> viewModel.clearFilters()}"
            app:eventFilters="@{recyclerview}"
            app:goneUnless="@{viewModel.hasAnyFilters}"
            tools:targetApi="o"
            tools:visibility="visible" />

        <ImageButton
{'fraction_non_alphanumeric': 0.103254564328021, 'fraction_numerical': 0.0037857971545460097, 'mean_word_length': 2.7728633955309836, 'pattern_counts': {'":': 0, '<': 49, '<?xml version=': 2, '>': 55, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, 'xml': 8}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7245881', 'n_tokens_mistral': 4483, 'n_tokens_neox': 4248, 'n_words': 622}