1
0

Add a selection of multiple students to login (#318)

This commit is contained in:
Rafał Borcz
2019-04-18 12:18:58 +02:00
committed by Mikołaj Pich
parent 034b99c7ab
commit 7431738366
17 changed files with 141 additions and 74 deletions

View File

@ -30,7 +30,7 @@
android:layout_height="wrap_content"
android:layout_marginStart="32dp"
android:layout_marginLeft="32dp"
android:layout_marginTop="48dp"
android:layout_marginTop="32dp"
android:layout_marginEnd="32dp"
android:layout_marginRight="32dp"
android:gravity="center_horizontal"
@ -150,7 +150,7 @@
android:layout_marginTop="48dp"
android:layout_marginEnd="24dp"
android:layout_marginRight="24dp"
android:layout_marginBottom="48dp"
android:layout_marginBottom="16dp"
android:text="@string/login_sign_in"
android:textAppearance="?android:textAppearanceSmall"
android:textColor="@android:color/white"

View File

@ -1,4 +1,5 @@
<FrameLayout 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"
android:layout_width="match_parent"
android:layout_height="match_parent"
@ -12,10 +13,60 @@
android:indeterminate="true"
android:visibility="gone" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/loginStudentSelectRecycler"
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/loginStudentSelectContent"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:itemCount="5"
tools:listitem="@layout/item_login_student_select" />
android:layout_height="match_parent">
<TextView
android:id="@+id/loginStudentSelectHeader"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="32dp"
android:layout_marginLeft="32dp"
android:layout_marginTop="32dp"
android:layout_marginEnd="32dp"
android:layout_marginRight="32dp"
android:layout_marginBottom="32dp"
android:gravity="center_horizontal"
android:text="@string/login_select_student"
android:textSize="16sp"
app:fontFamily="sans-serif-light"
app:layout_constraintBottom_toTopOf="@id/loginStudentSelectRecycler"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_chainStyle="packed" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/loginStudentSelectRecycler"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="144dp"
app:layout_constrainedHeight="true"
app:layout_constraintBottom_toTopOf="@id/loginStudentSelectSignIn"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHeight_max="432dp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/loginStudentSelectHeader"
tools:itemCount="6"
tools:listitem="@layout/item_login_student_select" />
<com.google.android.material.button.MaterialButton
android:id="@+id/loginStudentSelectSignIn"
style="@style/Widget.MaterialComponents.Button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="32dp"
android:layout_marginEnd="24dp"
android:layout_marginRight="24dp"
android:layout_marginBottom="32dp"
android:text="@string/login_sign_in"
android:textAppearance="?android:textAppearanceSmall"
android:textColor="@android:color/white"
android:textStyle="bold"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@id/loginStudentSelectRecycler" />
</androidx.constraintlayout.widget.ConstraintLayout>
</FrameLayout>

View File

@ -29,7 +29,7 @@
android:layout_height="wrap_content"
android:layout_marginStart="32dp"
android:layout_marginLeft="32dp"
android:layout_marginTop="48dp"
android:layout_marginTop="32dp"
android:layout_marginEnd="32dp"
android:layout_marginRight="32dp"
android:gravity="center_horizontal"
@ -79,11 +79,10 @@
style="@style/Widget.MaterialComponents.Button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginTop="48dp"
android:layout_marginEnd="24dp"
android:layout_marginRight="24dp"
android:layout_marginBottom="48dp"
android:layout_marginBottom="16dp"
android:text="@string/login_sign_in"
android:textAppearance="?android:textAppearanceSmall"
android:textColor="@android:color/white"
@ -91,8 +90,7 @@
app:backgroundTint="@color/colorPrimary"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@+id/loginSymbolNameLayout"
app:layout_constraintVertical_bias="1" />
app:layout_constraintTop_toBottomOf="@+id/loginSymbolNameLayout" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.core.widget.NestedScrollView>
</FrameLayout>

View File

@ -1,46 +1,42 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout 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"
android:id="@+id/loginItemContainer"
android:layout_width="match_parent"
android:layout_height="72dp"
android:background="?attr/selectableItemBackground"
android:clickable="true"
android:focusable="true"
android:padding="16dp"
tools:context=".ui.modules.login.studentselect.LoginStudentSelectItem">
android:background="?selectableItemBackground"
android:orientation="horizontal">
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/loginItemImage"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_marginEnd="16dp"
android:layout_marginRight="16dp"
app:srcCompat="@drawable/ic_all_account_24dp"
app:tint="?android:textColorPrimary" />
<CheckBox
android:id="@+id/loginItemCheck"
android:layout_width="26dp"
android:layout_height="24dp"
android:layout_marginStart="16dp"
android:layout_marginLeft="16dp"
android:layout_marginTop="16dp"
android:layout_marginEnd="32dp"
android:layout_marginRight="32dp"
tools:text=" " />
<TextView
android:id="@+id/loginItemName"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toEndOf="@id/loginItemImage"
android:layout_toRightOf="@id/loginItemImage"
android:ellipsize="end"
android:maxLines="1"
android:text="@string/app_name"
android:layout_toEndOf="@id/loginItemCheck"
android:layout_toRightOf="@id/loginItemCheck"
android:textSize="16sp"
app:firstBaselineToTopHeight="16dp" />
app:firstBaselineToTopHeight="32dp"
tools:text="Jan Kowalski" />
<TextView
android:id="@+id/loginItemSchool"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toEndOf="@id/loginItemImage"
android:layout_toRightOf="@id/loginItemImage"
android:ellipsize="end"
android:maxLines="1"
android:text="@string/app_name"
android:layout_below="@id/loginItemName"
android:layout_toEndOf="@id/loginItemCheck"
android:layout_toRightOf="@id/loginItemCheck"
android:textColor="?android:textColorSecondary"
android:textSize="12sp"
app:firstBaselineToTopHeight="36dp" />
app:firstBaselineToTopHeight="20dp"
tools:text="Szkoła Wulkanowego nr 1" />
</RelativeLayout>

View File

@ -3,7 +3,7 @@
<!--Activity/Fragment title-->
<string name="login_title">Wybierz ucznia</string>
<string name="login_title">Logowanie</string>
<string name="main_title">Wulkanowy</string>
<string name="grade_title">Oceny</string>
<string name="attendance_title">Frekwencja</string>
@ -31,8 +31,9 @@
<string name="login_incorrect_password">Dane logowania są niepoprawne</string>
<string name="login_incorrect_symbol">Nie znaleziono ucznia. Sprawdź symbol</string>
<string name="login_field_required">To pole jest wymagane</string>
<string name="login_duplicate_student">Ten student jest już zalogowany</string>
<string name="login_duplicate_student">Wybrany uczeń jest już zalogowany</string>
<string name="login_symbol_helper">Symbol znajduje się na stronie dziennika w zakładce Dostęp Mobilny</string>
<string name="login_select_student">Wybierz uczniów do zalogowania w aplikacji</string>
<string name="login_privacy_policy">Polityka prywatności</string>

View File

@ -3,7 +3,7 @@
<!--Activity/Fragment title-->
<string name="login_title">Select student</string>
<string name="login_title">Login</string>
<string name="main_title">Wulkanowy</string>
<string name="grade_title">Grades</string>
<string name="attendance_title">Attendance</string>
@ -31,8 +31,9 @@
<string name="login_incorrect_password">Login details are incorrect</string>
<string name="login_incorrect_symbol">Student not found. Check the symbol</string>
<string name="login_field_required">This field is required</string>
<string name="login_duplicate_student">This student has already been logged in</string>
<string name="login_duplicate_student">The selected student is already logged in</string>
<string name="login_symbol_helper">The symbol is located on the register page in the Mobile Access tab</string>
<string name="login_select_student">Select students to log in to the application</string>
<string name="login_privacy_policy">Privacy policy</string>