181 lines
8.9 KiB
XML
181 lines
8.9 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<layout xmlns:tools="http://schemas.android.com/tools"
|
|
xmlns:app="http://schemas.android.com/apk/res-auto">
|
|
<data>
|
|
<variable
|
|
name="viewModel"
|
|
type="com.tommasoberlose.anotherwidget.ui.viewmodels.CustomDateViewModel" />
|
|
<variable
|
|
name="isdCapitalizeEnabled"
|
|
type="Boolean" />
|
|
</data>
|
|
|
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
|
android:layout_width="match_parent"
|
|
android:layout_height="match_parent"
|
|
android:orientation="vertical"
|
|
android:background="@color/colorPrimaryDark">
|
|
<com.google.android.material.card.MaterialCardView
|
|
android:layout_width="match_parent"
|
|
android:layout_height="wrap_content"
|
|
app:cardElevation="2dp"
|
|
app:cardCornerRadius="0dp"
|
|
android:id="@+id/toolbar"
|
|
app:cardBackgroundColor="@color/colorPrimary">
|
|
<RelativeLayout
|
|
android:layout_width="match_parent"
|
|
android:layout_height="56dp"
|
|
android:gravity="center_vertical"
|
|
android:paddingLeft="8dp"
|
|
android:paddingRight="8dp">
|
|
<androidx.appcompat.widget.AppCompatImageView
|
|
android:layout_width="48dp"
|
|
android:layout_height="48dp"
|
|
android:padding="10dp"
|
|
android:background="?attr/selectableItemBackgroundBorderless"
|
|
android:layout_centerVertical="true"
|
|
android:id="@+id/action_back"
|
|
android:layout_alignParentLeft="true"
|
|
android:tint="@color/colorPrimaryText"
|
|
android:src="@drawable/round_arrow_back" />
|
|
<TextView
|
|
android:layout_width="wrap_content"
|
|
android:layout_height="match_parent"
|
|
android:layout_centerInParent="true"
|
|
android:text="@string/custom_date_format"
|
|
android:gravity="center"
|
|
style="@style/AnotherWidget.Main.Title"/>
|
|
<TextView
|
|
android:layout_width="wrap_content"
|
|
android:layout_height="wrap_content"
|
|
android:text="@string/action_save"
|
|
android:gravity="center"
|
|
android:layout_centerVertical="true"
|
|
android:padding="16dp"
|
|
android:layout_alignParentRight="true"
|
|
android:textColor="@color/colorAccent"
|
|
android:id="@+id/action_save"
|
|
android:textAppearance="@style/TextAppearance.MaterialComponents.Button"/>
|
|
</RelativeLayout>
|
|
</com.google.android.material.card.MaterialCardView>
|
|
<com.google.android.material.card.MaterialCardView
|
|
android:layout_width="match_parent"
|
|
android:layout_height="wrap_content"
|
|
app:cardElevation="2dp"
|
|
app:cardCornerRadius="0dp"
|
|
app:cardBackgroundColor="@color/colorPrimary">
|
|
<com.google.android.material.card.MaterialCardView
|
|
android:layout_width="match_parent"
|
|
android:layout_height="wrap_content"
|
|
app:cardBackgroundColor="@color/colorPrimaryDark"
|
|
app:cardCornerRadius="9dp"
|
|
app:cardElevation="0dp"
|
|
android:layout_marginTop="8dp"
|
|
android:layout_marginLeft="16dp"
|
|
android:layout_marginRight="16dp">
|
|
<RelativeLayout
|
|
android:layout_width="match_parent"
|
|
android:layout_height="wrap_content">
|
|
<EditText
|
|
android:layout_width="match_parent"
|
|
android:layout_height="48dp"
|
|
android:background="@color/colorPrimaryDark"
|
|
android:paddingStart="16dp"
|
|
android:paddingEnd="56dp"
|
|
android:id="@+id/date_format"
|
|
android:gravity="center_vertical|start"
|
|
android:textDirection="locale"
|
|
android:textAlignment="viewStart"
|
|
android:lines="1"
|
|
android:maxLines="1"
|
|
android:singleLine="true"
|
|
android:hint="@string/settings_date_format_title"
|
|
android:fontFamily="@font/product_sans"
|
|
android:text="@={viewModel.dateInput}"
|
|
android:autofillHints=""
|
|
tools:ignore="TextFields" />
|
|
<androidx.appcompat.widget.AppCompatImageView
|
|
android:layout_width="40dp"
|
|
android:layout_height="40dp"
|
|
android:padding="8dp"
|
|
android:layout_centerVertical="true"
|
|
android:src="@drawable/round_help_outline"
|
|
android:layout_alignParentEnd="true"
|
|
android:clickable="true"
|
|
android:focusable="true"
|
|
android:background="?attr/selectableItemBackgroundBorderless"
|
|
app:tint="@color/colorSecondaryText"
|
|
android:layout_marginEnd="4dp"
|
|
android:id="@+id/action_date_format_info" />
|
|
</RelativeLayout>
|
|
</com.google.android.material.card.MaterialCardView>
|
|
</com.google.android.material.card.MaterialCardView>
|
|
<com.google.android.material.card.MaterialCardView
|
|
android:layout_width="match_parent"
|
|
android:layout_height="wrap_content"
|
|
app:cardElevation="2dp"
|
|
app:cardCornerRadius="0dp"
|
|
app:cardBackgroundColor="@color/colorPrimary">
|
|
<RelativeLayout
|
|
android:layout_width="match_parent"
|
|
android:layout_height="wrap_content">
|
|
<androidx.appcompat.widget.AppCompatTextView
|
|
android:layout_width="match_parent"
|
|
android:layout_height="48dp"
|
|
android:id="@+id/date_format_value"
|
|
android:textAppearance="@style/AnotherWidget.Settings.Title"
|
|
android:letterSpacing="0"
|
|
android:textColor="@color/colorPrimaryText"
|
|
android:textSize="20sp"
|
|
app:textAllCaps="false"
|
|
android:gravity="center_vertical|start"
|
|
android:paddingEnd="32dp"
|
|
android:layout_centerVertical="true"
|
|
android:textAlignment="viewStart"
|
|
android:maxLines="1"
|
|
android:lines="1"
|
|
android:singleLine="true"
|
|
android:ellipsize="end"
|
|
android:layout_marginTop="8dp"
|
|
android:layout_marginLeft="32dp"
|
|
android:layout_marginRight="32dp"
|
|
android:layout_marginBottom="16dp" />
|
|
<androidx.appcompat.widget.AppCompatImageView
|
|
android:layout_width="40dp"
|
|
android:layout_height="40dp"
|
|
android:padding="5dp"
|
|
android:layout_centerVertical="true"
|
|
android:src="@drawable/round_publish"
|
|
android:layout_alignParentEnd="true"
|
|
android:clickable="true"
|
|
android:focusable="true"
|
|
android:background="?attr/selectableItemBackgroundBorderless"
|
|
app:tint="@color/colorPrimaryText"
|
|
android:layout_marginEnd="20dp"
|
|
android:alpha="@{isdCapitalizeEnabled ? 1f : 0.3f, default=0.3}"
|
|
android:id="@+id/action_capitalize" />
|
|
</RelativeLayout>
|
|
</com.google.android.material.card.MaterialCardView>
|
|
<RelativeLayout
|
|
android:layout_width="match_parent"
|
|
android:layout_height="0dp"
|
|
android:layout_weight="1">
|
|
<androidx.core.widget.ContentLoadingProgressBar
|
|
android:layout_width="match_parent"
|
|
android:layout_height="wrap_content"
|
|
android:indeterminate="true"
|
|
android:indeterminateTint="@color/colorAccent"
|
|
android:layout_marginTop="-7dp"
|
|
android:id="@+id/loader"
|
|
style="@style/Widget.AppCompat.ProgressBar.Horizontal" />
|
|
<androidx.recyclerview.widget.RecyclerView
|
|
android:layout_width="match_parent"
|
|
android:layout_height="match_parent"
|
|
android:paddingBottom="16dp"
|
|
android:paddingTop="16dp"
|
|
android:clipToPadding="false"
|
|
android:id="@+id/list_view" />
|
|
</RelativeLayout>
|
|
</LinearLayout>
|
|
|
|
</layout> |