TubeLab-App-Android/app/src/main/res/layout/activity_sepia_search.xml

377 lines
22 KiB
XML

<?xml version="1.0" encoding="utf-8"?><!--
Copyright 2020 Thomas Schneider
This file is a part of TubeLab
This program is free software; you can redistribute it and/or modify it under the terms of the
GNU General Public License as published by the Free Software Foundation; either version 3 of the
License, or (at your option) any later version.
TubeLab is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
Public License for more details.
You should have received a copy of the GNU General Public License along with TubeLab; if not,
see <http://www.gnu.org/licenses>.
-->
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
xmlns:TagsEditText="http://schemas.android.com/apk/res-auto"
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
tools:context=".activities.SepiaSearchActivity">
<com.google.android.material.appbar.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fitsSystemWindows="true"
app:theme="@style/popupTheme">
<com.google.android.material.appbar.CollapsingToolbarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fitsSystemWindows="true"
app:contentScrim="?attr/colorPrimary"
app:expandedTitleMarginEnd="64dp"
app:expandedTitleMarginStart="48dp"
android:background="?android:colorBackground"
app:layout_scrollFlags="scroll|exitUntilCollapsed">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_marginStart="@dimen/fab_margin"
android:layout_marginEnd="@dimen/fab_margin"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintTop_toTopOf="parent"
android:id="@+id/header"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent">
<com.mancj.materialsearchbar.MaterialSearchBar
style="@style/searchBarSepia"
app:mt_speechMode="false"
app:mt_backIconTint="?attr/colorAccent"
app:mt_clearIconTint="?attr/colorAccent"
app:mt_menuIconTint="?attr/colorAccent"
app:mt_searchIconTint="?attr/colorAccent"
app:mt_hint="@string/sepia_search_hint"
app:mt_maxSuggestionsCount="10"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
android:animateLayoutChanges="false"
android:id="@+id/searchBar" />
<TextView
android:layout_marginTop="5dp"
app:layout_constraintTop_toBottomOf="@+id/searchBar"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textColor="?attr/colorAccent"
android:id="@+id/explanations"
android:text="@string/sepia_indication"
/>
<Button
android:id="@+id/filter"
style="@style/Base.Widget.AppCompat.Button.Colored"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/filter"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/explanations"
android:drawableEnd="@drawable/ic_baseline_arrow_drop_down_24"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@+id/explanations"
app:layout_constraintEnd_toStartOf="@+id/sort_by"
android:text="@string/sort_by"
android:labelFor="@+id/sort_by"/>
<Spinner
android:id="@+id/sort_by"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@+id/explanations"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/filter_elements"
android:visibility="gone"
android:animateLayoutChanges="true"
app:layout_constraintTop_toBottomOf="@+id/header"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:labelFor="@+id/sepia_element_nsfw"
android:text="@string/sepia_element_nsfw"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toStartOf="parent"
android:id="@+id/sepia_element_nsfw_label"
/>
<RadioGroup
android:id="@+id/sepia_element_nsfw"
android:layout_width="wrap_content"
android:layout_height="0dp"
android:paddingTop="5dp"
android:paddingBottom="5dp"
android:orientation="horizontal"
app:layout_constraintTop_toBottomOf="@+id/sepia_element_nsfw_label"
app:layout_constraintStart_toStartOf="parent"
>
<RadioButton
android:id="@+id/sepia_element_nsfw_yes"
android:text="@string/yes"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
<RadioButton
android:id="@+id/sepia_element_nsfw_no"
android:text="@string/no"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
</RadioGroup>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:labelFor="@+id/sepia_element_published_date"
android:text="@string/sepia_element_published_date"
app:layout_constraintTop_toBottomOf="@+id/sepia_element_nsfw"
app:layout_constraintStart_toStartOf="parent"
android:id="@+id/sepia_element_published_date_label"
/>
<HorizontalScrollView
android:layout_width="wrap_content"
android:id="@+id/sepia_element_published_date"
android:layout_height="wrap_content"
android:paddingTop="5dp"
android:paddingBottom="5dp"
app:layout_constraintTop_toBottomOf="@+id/sepia_element_published_date_label"
app:layout_constraintStart_toStartOf="parent">
<RadioGroup
android:id="@+id/radio_date"
android:orientation="horizontal"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
>
<RadioButton
android:id="@+id/sepia_element_published_date_any"
android:text="@string/any"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
<RadioButton
android:id="@+id/sepia_element_published_date_today"
android:text="@string/today"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
<RadioButton
android:id="@+id/sepia_element_published_date_last_7_days"
android:text="@string/last_7_days"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
<RadioButton
android:id="@+id/sepia_element_published_date_last_30_days"
android:text="@string/last_30_days"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
<RadioButton
android:id="@+id/sepia_element_published_date_last_365_days"
android:text="@string/last_365_days"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
</RadioGroup>
</HorizontalScrollView>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:labelFor="@+id/sepia_element_duration"
android:text="@string/sepia_element_duration"
app:layout_constraintTop_toBottomOf="@+id/sepia_element_published_date"
app:layout_constraintStart_toStartOf="parent"
android:id="@+id/sepia_element_duration_label"
/>
<HorizontalScrollView
android:layout_width="wrap_content"
android:id="@+id/sepia_element_duration"
android:layout_height="wrap_content"
android:paddingTop="5dp"
android:paddingBottom="5dp"
app:layout_constraintTop_toBottomOf="@+id/sepia_element_duration_label"
app:layout_constraintStart_toStartOf="parent">
<RadioGroup
android:id="@+id/duration"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
>
<RadioButton
android:id="@+id/sepia_element_duration_any"
android:text="@string/any"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
<RadioButton
android:id="@+id/sepia_element_duration_short"
android:text="@string/duration_short"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
<RadioButton
android:id="@+id/sepia_element_duration_medium"
android:text="@string/duration_medium"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
<RadioButton
android:id="@+id/sepia_element_duration_long"
android:text="@string/duration_long"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
</RadioGroup>
</HorizontalScrollView>
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:labelFor="@+id/sepia_element_category"
android:text="@string/category"
app:layout_constraintTop_toBottomOf="@+id/sepia_element_duration"
app:layout_constraintStart_toStartOf="parent"
android:id="@+id/sepia_element_category_label"
/>
<Spinner
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintTop_toBottomOf="@+id/sepia_element_category_label"
app:layout_constraintStart_toStartOf="@+id/sepia_element_category_label"
android:id="@+id/sepia_element_category"
/>
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:labelFor="@+id/sepia_element_license"
android:text="@string/license"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/sepia_element_category"
android:id="@+id/sepia_element_license_label"
/>
<Spinner
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/category"
app:layout_constraintTop_toBottomOf="@+id/sepia_element_license_label"
app:layout_constraintStart_toStartOf="@+id/sepia_element_license_label"
android:id="@+id/sepia_element_license"
/>
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:labelFor="@+id/sepia_element_language"
android:text="@string/language"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/sepia_element_license"
android:id="@+id/sepia_element_language_label"
/>
<Spinner
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/category"
app:layout_constraintTop_toBottomOf="@+id/sepia_element_language_label"
app:layout_constraintStart_toStartOf="@+id/sepia_element_language_label"
android:id="@+id/sepia_element_language"
/>
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:labelFor="@+id/sepia_element_all_of_tags"
android:text="@string/all_of_these_tags"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/sepia_element_language"
app:layout_constraintEnd_toEndOf="parent"
android:id="@+id/sepia_element_all_of_tags_label"
/>
<mabbas007.tagsedittext.TagsEditText
android:id="@+id/sepia_element_all_of_tags"
app:layout_constraintTop_toBottomOf="@+id/sepia_element_all_of_tags_label"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="textMultiLine"
android:lines="2"
android:minLines="2"
TagsEditText:allowSpaceInTag="true"
TagsEditText:tagsCloseImagePadding="@dimen/defaultTagsCloseImagePadding"
TagsEditText:tagsCloseImageRight="@drawable/tag_close"
TagsEditText:tagsTextColor="?colorAccent"
TagsEditText:tagsTextSize="@dimen/defaultTagsTextSize" />
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:labelFor="@+id/sepia_element_one_of_tags"
android:text="@string/one_of_these_tags"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/sepia_element_all_of_tags"
app:layout_constraintEnd_toEndOf="parent"
android:id="@+id/sepia_element_one_of_tags_label"
/>
<mabbas007.tagsedittext.TagsEditText
android:id="@+id/sepia_element_one_of_tags"
app:layout_constraintTop_toBottomOf="@+id/sepia_element_one_of_tags_label"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="textMultiLine"
android:lines="2"
android:minLines="2"
TagsEditText:allowSpaceInTag="true"
TagsEditText:tagsCloseImagePadding="@dimen/defaultTagsCloseImagePadding"
TagsEditText:tagsCloseImageRight="@drawable/tag_close"
TagsEditText:tagsTextColor="?colorAccent"
TagsEditText:tagsTextSize="@dimen/defaultTagsTextSize" />
<Button
android:id="@+id/apply_filter"
style="@style/Base.Widget.AppCompat.Button.Colored"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/apply_filter"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@+id/sepia_element_one_of_tags"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</com.google.android.material.appbar.CollapsingToolbarLayout>
</com.google.android.material.appbar.AppBarLayout>
<FrameLayout
android:layout_marginStart="@dimen/fab_margin"
android:layout_marginEnd="@dimen/fab_margin"
app:layout_behavior="@string/appbar_scrolling_view_behavior"
android:id="@+id/container"
android:layout_width="match_parent"
android:layout_height="match_parent"
/>
</androidx.coordinatorlayout.widget.CoordinatorLayout>