app/src/main/res/layout/activity_login_account.xml
author Da Risk <da_risk@geekorum.com>
Sat, 24 Nov 2018 17:54:27 -0800
changeset 0 14443efede32
child 62 c9d5f3546fc1
permissions -rw-r--r--
Initial commit
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
     1
<!--
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
     2
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
     3
    Geekttrss is a RSS feed reader application on the Android Platform.
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
     4
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
     5
    Copyright (C) 2017-2018 by Frederic-Charles Barthelery.
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
     6
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
     7
    This file is part of Geekttrss.
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
     8
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
     9
    Geekttrss is free software: you can redistribute it and/or modify
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    10
    it under the terms of the GNU General Public License as published by
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    11
    the Free Software Foundation, either version 3 of the License, or
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    12
    (at your option) any later version.
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    13
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    14
    Geekttrss is distributed in the hope that it will be useful,
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    15
    but WITHOUT ANY WARRANTY; without even the implied warranty of
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    16
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    17
    GNU General Public License for more details.
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    18
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    19
    You should have received a copy of the GNU General Public License
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    20
    along with Geekttrss.  If not, see <http://www.gnu.org/licenses/>.
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    21
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    22
-->
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    23
<layout xmlns:android="http://schemas.android.com/apk/res/android"
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    24
        xmlns:tools="http://schemas.android.com/tools" xmlns:app="http://schemas.android.com/apk/res-auto">
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    25
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    26
    <data>
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    27
        <import type="com.geekorum.ttrss.accounts.LoginViewModel" />
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    28
        <variable name="viewModel" type="com.geekorum.ttrss.accounts.LoginViewModel" />
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    29
    </data>
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    30
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    31
<androidx.constraintlayout.widget.ConstraintLayout
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    32
    android:layout_width="match_parent"
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    33
    android:layout_height="match_parent"
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    34
    android:paddingBottom="@dimen/activity_vertical_margin"
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    35
    android:paddingLeft="@dimen/activity_horizontal_margin"
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    36
    android:paddingRight="@dimen/activity_horizontal_margin"
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    37
    android:paddingTop="@dimen/activity_vertical_margin"
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    38
    tools:context="com.geekorum.ttrss.accounts.LoginActivity">
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    39
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    40
    <!-- Login progress -->
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    41
    <ProgressBar
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    42
            android:id="@+id/login_progress"
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    43
            style="?android:attr/progressBarStyleLarge"
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    44
            android:layout_width="wrap_content"
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    45
            android:layout_height="wrap_content"
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    46
            app:layout_constraintStart_toStartOf="parent"
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    47
            app:layout_constraintEnd_toEndOf="parent"
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    48
            app:layout_constraintTop_toTopOf="parent"
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    49
            app:layout_constraintBottom_toBottomOf="parent"
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    50
            app:layout_constraintVertical_bias="0.1"
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    51
            android:visibility="gone" />
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    52
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    53
    <ScrollView
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    54
        android:id="@+id/login_form"
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    55
        android:layout_width="0dp"
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    56
        android:layout_height="match_parent"
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    57
        app:layout_constraintStart_toStartOf="parent"
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    58
        app:layout_constraintEnd_toEndOf="parent"
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    59
        app:layout_constraintWidth_max="320dp"  >
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    60
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    61
        <LinearLayout
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    62
            android:id="@+id/username_login_form"
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    63
            android:layout_width="match_parent"
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    64
            android:layout_height="wrap_content"
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    65
            android:orientation="vertical">
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    66
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    67
            <com.google.android.material.textfield.TextInputLayout
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    68
                    android:layout_width="match_parent"
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    69
                    android:layout_height="wrap_content">
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    70
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    71
                <EditText
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    72
                        android:id="@+id/url"
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    73
                        android:layout_width="match_parent"
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    74
                        android:layout_height="wrap_content"
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    75
                        android:hint="@string/prompt_url"
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    76
                        android:inputType="textUri"
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    77
                        android:maxLines="1"
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    78
                        android:text="@={LoginViewModel.convertHttpUrlToString(viewModel.httpUrl)}"
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    79
                        android:afterTextChanged="@{viewModel::checkValidUrl}"
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    80
                        android:enabled="@{viewModel.canChangeUsernameOrUrl}"
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    81
                        android:autofillHints="text"
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    82
                        tools:ignore="UnusedAttribute" />
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    83
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    84
            </com.google.android.material.textfield.TextInputLayout>
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    85
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    86
            <com.google.android.material.textfield.TextInputLayout
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    87
                android:layout_width="match_parent"
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    88
                android:layout_height="wrap_content">
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    89
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    90
                <EditText
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    91
                    android:id="@+id/username"
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    92
                    android:layout_width="match_parent"
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    93
                    android:layout_height="wrap_content"
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    94
                    android:hint="@string/prompt_username"
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    95
                    android:inputType="textPersonName"
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    96
                    android:maxLines="1"
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    97
                    android:text="@={viewModel.username}"
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    98
                    android:afterTextChanged="@{viewModel::checkNonEmptyUsername}"
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    99
                    android:enabled="@{viewModel.canChangeUsernameOrUrl}"
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
   100
                    android:autofillHints="username"
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
   101
                    tools:ignore="UnusedAttribute" />
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
   102
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
   103
            </com.google.android.material.textfield.TextInputLayout>
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
   104
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
   105
            <com.google.android.material.textfield.TextInputLayout
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
   106
                android:layout_width="match_parent"
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
   107
                android:layout_height="wrap_content">
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
   108
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
   109
                <EditText
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
   110
                    android:id="@+id/password"
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
   111
                    android:layout_width="match_parent"
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
   112
                    android:layout_height="wrap_content"
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
   113
                    android:hint="@string/prompt_password"
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
   114
                    android:imeActionId="@integer/ime_action_done"
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
   115
                    android:imeActionLabel="@string/action_sign_in_short"
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
   116
                    android:imeOptions="actionUnspecified"
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
   117
                    android:inputType="textPassword"
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
   118
                    android:maxLines="1"
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
   119
                    android:text="@={viewModel.password}"
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
   120
                    android:afterTextChanged="@{viewModel::checkNonEmptyPassword}"
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
   121
                    android:onEditorAction="@{(view, actionId, keyEvent) -> viewModel.confirmLogin(actionId)}"
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
   122
                    android:autofillHints="password"
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
   123
                    tools:ignore="UnusedAttribute" />
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
   124
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
   125
            </com.google.android.material.textfield.TextInputLayout>
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
   126
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
   127
            <Button
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
   128
                android:id="@+id/email_sign_in_button"
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
   129
                style="?android:textAppearanceSmall"
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
   130
                android:layout_width="match_parent"
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
   131
                android:layout_height="wrap_content"
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
   132
                android:layout_marginTop="16dp"
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
   133
                android:text="@string/action_sign_in"
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
   134
                android:textStyle="bold"
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
   135
                android:enabled="@{safeUnbox(viewModel.areFieldsCorrect)}"
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
   136
                android:onClickListener="@{() -> viewModel.confirmLogin()}"
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
   137
                />
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
   138
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
   139
        </LinearLayout>
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
   140
    </ScrollView>
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
   141
</androidx.constraintlayout.widget.ConstraintLayout>
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
   142
</layout>