<?xml version="1.0" encoding="utf-8"?><!--
- ~ Copyright © 2019 Damyan Ivanov.
+ ~ Copyright © 2020 Damyan Ivanov.
~ This file is part of MoLe.
~ MoLe is free software: you can distribute it and/or modify it
~ under the term of the GNU General Public License as published by
android:layout_height="match_parent"
android:orientation="vertical"
android:padding="16dp"
- tools:context=".ui.profiles.ProfileDetailFragment">
+ tools:context=".ui.profiles.ProfileDetailFragment"
+ >
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/profile_name_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:layout_marginBottom="16dp">
+ android:layout_marginBottom="16dp"
+ >
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/profile_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:ems="10"
android:hint="@string/profile_name_label"
- android:inputType="textPersonName" />
+ android:inputType="textPersonName"
+ />
</com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.textfield.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="16dp"
- android:orientation="vertical">
+ android:orientation="vertical"
+ >
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/url"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:ems="10"
android:hint="@string/url_label"
android:inputType="textUri"
- android:text="@string/pref_default_backend_url" />
+ android:text="@string/pref_default_backend_url"
+ />
</com.google.android.material.textfield.TextInputLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:animateLayoutChanges="true"
- android:orientation="vertical">
-
- <Switch
- android:id="@+id/profile_permit_posting"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_marginBottom="16dp"
- android:textAppearance="?android:textAppearanceListItem"
- android:text="@string/posting_permitted" />
+ android:orientation="vertical"
+ >
- <LinearLayout
- android:id="@+id/future_dates_layout"
- android:layout_width="match_parent"
- android:layout_marginBottom="16dp"
- android:layout_height="wrap_content"
- android:orientation="vertical">
-
- <TextView
- android:id="@+id/future_dates_title"
- android:textAppearance="?android:textAppearanceListItem"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:text="@string/profile_future_dates_label" />
-
- <TextView
- android:id="@+id/future_dates_text"
- android:textAppearance="?android:textAppearanceListItemSecondary"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:textColor="?attr/textColor"/>
- </LinearLayout>
-
- <Switch
+ <com.google.android.material.switchmaterial.SwitchMaterial
android:id="@+id/enable_http_auth"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="16dp"
+ android:text="@string/pref_title_use_http_auth"
android:textAppearance="?android:textAppearanceListItem"
- android:text="@string/pref_title_use_http_auth" />
+ />
<LinearLayout
android:id="@+id/auth_params"
android:layout_width="match_parent"
android:layout_height="wrap_content"
+ android:layout_marginBottom="16dp"
android:animateLayoutChanges="true"
android:orientation="vertical"
android:paddingStart="8dp"
- tools:ignore="RtlSymmetry">
+ tools:ignore="RtlSymmetry"
+ >
<LinearLayout
android:id="@+id/insecure_scheme_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/activity_vertical_margin"
- android:background="@color/error_background"
+ android:background="?colorError"
android:padding="@dimen/activity_vertical_margin"
- android:visibility="gone">
+ android:visibility="gone"
+ >
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:text="@string/insecure_scheme_with_auth" />
+ android:text="@string/insecure_scheme_with_auth"
+ android:textColor="?colorOnError"
+ />
</LinearLayout>
<com.google.android.material.textfield.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="16dp"
- android:orientation="vertical">
+ android:orientation="vertical"
+ >
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/auth_user_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:ems="10"
android:hint="@string/pref_title_backend_auth_user"
- android:inputType="textPersonName" />
+ android:inputType="textPersonName"
+ />
</com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.textfield.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
- app:passwordToggleEnabled="true">
+ app:passwordToggleEnabled="true"
+ >
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/password"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:ems="10"
android:hint="@string/pref_title_backend_auth_password"
- android:inputType="textWebPassword" />
+ android:inputType="textWebPassword"
+ />
</com.google.android.material.textfield.TextInputLayout>
</LinearLayout>
- <com.google.android.material.textfield.TextInputLayout
- android:id="@+id/preferred_accounts_accounts_filter_layout"
+ <androidx.constraintlayout.widget.ConstraintLayout
+ android:id="@+id/server_version_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="16dp"
- android:orientation="vertical">
+ >
- <com.google.android.material.textfield.TextInputEditText
- android:id="@+id/preferred_accounts_filter_filter"
+ <TextView
+ android:id="@+id/server_version_label"
+ android:layout_width="0dp"
+ android:layout_height="wrap_content"
+ android:text="@string/profile_server_version_title"
+ android:textAppearance="?android:textAppearanceListItem"
+ app:layout_constraintEnd_toStartOf="@id/server_version_detect_button"
+ app:layout_constraintStart_toStartOf="parent"
+ app:layout_constraintTop_toTopOf="parent"
+ />
+
+ <TextView
+ android:id="@+id/detected_server_version_text"
+ android:layout_width="0dp"
+ android:layout_height="wrap_content"
+ android:layout_marginEnd="8dp"
+ android:gravity="start"
+ android:textAppearance="?android:textAppearanceListItemSecondary"
+ android:textColor="?attr/textColor"
+ android:text="@string/server_version_unknown_label"
+ app:layout_constraintEnd_toStartOf="@id/server_version_detect_button"
+ app:layout_constraintBottom_toBottomOf="parent"
+ app:layout_constraintStart_toStartOf="parent"
+ app:layout_constraintTop_toBottomOf="@id/server_version_label"
+ />
+ <ProgressBar
+ android:layout_height="24dp"
+ android:id="@+id/server_version_detect_button"
+ android:layout_width="24dp"
+ android:indeterminate="true"
+ android:foregroundGravity="bottom"
+ app:layout_constraintBottom_toBottomOf="parent"
+ app:layout_constraintEnd_toEndOf="parent"
+ app:layout_constraintStart_toEndOf="@id/detected_server_version_text"
+ android:visibility="invisible"
+ />
+ </androidx.constraintlayout.widget.ConstraintLayout>
+
+ <androidx.constraintlayout.widget.ConstraintLayout
+ android:id="@+id/api_version_layout"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_marginBottom="16dp"
+ >
+
+ <TextView
+ android:id="@+id/api_version_label"
+ android:layout_width="0dp"
+ android:layout_height="wrap_content"
+ android:layout_marginEnd="24dp"
+ android:text="@string/profile_api_version_title"
+ android:textAppearance="?android:textAppearanceListItem"
+ app:layout_constraintEnd_toEndOf="parent"
+ app:layout_constraintStart_toStartOf="parent"
+ app:layout_constraintTop_toTopOf="parent"
+ />
+
+ <TextView
+ android:id="@+id/api_version_text"
+ android:layout_width="0dp"
+ android:layout_height="wrap_content"
+ android:layout_marginEnd="24dp"
+ android:textAppearance="?android:textAppearanceListItemSecondary"
+ android:textColor="?attr/textColor"
+ app:layout_constraintEnd_toEndOf="parent"
+ app:layout_constraintStart_toStartOf="parent"
+ app:layout_constraintTop_toBottomOf="@id/api_version_label"
+ />
+ </androidx.constraintlayout.widget.ConstraintLayout>
+
+ <com.google.android.material.switchmaterial.SwitchMaterial
+ android:id="@+id/profile_permit_posting"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_marginBottom="16dp"
+ android:text="@string/posting_permitted"
+ android:textAppearance="?android:textAppearanceListItem"
+ />
+
+ <LinearLayout
+ android:id="@+id/posting_sub_items"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:orientation="vertical"
+ >
+
+ <LinearLayout
+ android:id="@+id/default_commodity_layout"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_marginBottom="16dp"
+ android:clickable="true"
+ android:focusable="true"
+ android:orientation="vertical"
+ >
+
+ <TextView
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:text="@string/profile_default_commodity"
+ android:textAppearance="?android:textAppearanceListItem"
+ />
+
+ <TextView
+ android:id="@+id/default_commodity_text"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:text="@string/btn_no_currency"
+ android:textAppearance="?android:textAppearanceListItemSecondary"
+ android:textColor="?attr/textColor"
+ />
+ </LinearLayout>
+
+ <com.google.android.material.switchmaterial.SwitchMaterial
+ android:id="@+id/profile_show_commodity"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_marginBottom="16dp"
+ android:text="@string/currency_input_by_default"
+ android:textAppearance="?android:textAppearanceListItem"
+ />
+
+ <com.google.android.material.switchmaterial.SwitchMaterial
+ android:id="@+id/profile_show_comments"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_marginBottom="16dp"
+ android:text="@string/show_comment_input_by_default"
+ android:textAppearance="?android:textAppearanceListItem"
+ />
+
+ <LinearLayout
+ android:id="@+id/future_dates_layout"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_marginBottom="16dp"
+ android:orientation="vertical"
+ >
+
+ <TextView
+ android:id="@+id/future_dates_title"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:text="@string/profile_future_dates_label"
+ android:textAppearance="?android:textAppearanceListItem"
+ />
+
+ <TextView
+ android:id="@+id/future_dates_text"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:textAppearance="?android:textAppearanceListItemSecondary"
+ android:textColor="?attr/textColor"
+ />
+ </LinearLayout>
+
+ <com.google.android.material.textfield.TextInputLayout
+ android:id="@+id/preferred_accounts_accounts_filter_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:ems="10"
- android:fontFamily="monospace"
- android:hint="@string/pref_preferred_autocompletion_account_filter_hint"
- android:inputType="text"
- android:textColor="?attr/editTextColor" />
- </com.google.android.material.textfield.TextInputLayout>
+ android:layout_marginBottom="16dp"
+ android:orientation="vertical"
+ >
+
+ <com.google.android.material.textfield.TextInputEditText
+ android:id="@+id/preferred_accounts_filter_filter"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:fontFamily="monospace"
+ android:hint="@string/pref_preferred_autocompletion_account_filter_hint"
+ android:inputType="text"
+ android:textColor="?attr/editTextColor"
+ />
+ </com.google.android.material.textfield.TextInputLayout>
+ </LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
- android:orientation="horizontal">
+ android:orientation="horizontal"
+ >
<TextView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_weight="100"
android:gravity="center_vertical"
+ android:text="@string/profile_color_label"
android:textAppearance="?android:textAppearanceListItem"
- android:text="@string/profile_color_label" />
+ />
<ImageButton
android:id="@+id/btn_pick_ring_color"
android:layout_weight="1"
android:background="?colorPrimary"
android:contentDescription="@string/btn_color_picker_button"
- android:src="@drawable/ic_palette_black_24dp"
- android:tint="?drawer_background" />
+ android:tint="?colorOnPrimarySurface"
+ app:srcCompat="@drawable/ic_palette_black_24dp"
+ />
</LinearLayout>