[UI/Login] Fix login summary list not showing all profiles.

This commit is contained in:
Kuba Szczodrzyński 2020-01-05 14:39:52 +01:00
parent 1589a05a37
commit 21ad38d33f
3 changed files with 34 additions and 160 deletions

View File

@ -82,7 +82,7 @@ class LoginActivity : AppCompatActivity(), CoroutineScope {
b = ActivityLoginBinding.inflate(layoutInflater)
setContentView(b.root)
errorSnackbar.setCoordinator(b.coordinator, null)
errorSnackbar.setCoordinator(b.coordinator, b.snackbarAnchor)
launch {
app.config.loginFinished = app.db.profileDao().count > 0

View File

@ -2,7 +2,7 @@
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<LinearLayout
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
@ -10,7 +10,8 @@
<Space
android:layout_width="0dp"
android:layout_height="32dp" />
android:layout_height="32dp"
android:visibility="gone" />
<androidx.coordinatorlayout.widget.CoordinatorLayout
android:id="@+id/coordinator"
@ -33,136 +34,15 @@
app:navGraph="@navigation/nav_login" />
</androidx.coordinatorlayout.widget.CoordinatorLayout>
<!--<io.codetail.widget.RevealFrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:visibility="gone">
<LinearLayout
android:id="@+id/revealView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/colorPrimary"
android:gravity="center"
android:orientation="vertical"
android:visibility="visible">
<TextView
android:id="@+id/title1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:gravity="center"
android:text="Witaj w Szkolny.eu!"
android:textColor="@color/md_white_1000"
android:textSize="32sp"
android:textStyle="bold"
android:visibility="invisible" />
<TextView
android:id="@+id/title2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:gravity="center"
android:text="Z jakiego e-dziennika korzystasz?"
android:textColor="@color/md_white_1000"
android:textSize="24sp"
android:visibility="invisible" />
</LinearLayout>
</io.codetail.widget.RevealFrameLayout>-->
<!--<android.support.design.widget.TextInputLayout
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginLeft="8dp"
android:layout_marginEnd="8dp"
android:layout_marginRight="8dp"
app:errorEnabled="true">
<android.support.design.widget.TextInputEditText
android:id="@+id/loginUsername"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Login" />
</android.support.design.widget.TextInputLayout>
<android.support.design.widget.TextInputLayout
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginLeft="8dp"
android:layout_marginEnd="8dp"
android:layout_marginRight="8dp"
app:errorEnabled="true"
app:passwordToggleEnabled="true">
<android.support.design.widget.TextInputEditText
android:id="@+id/loginPassword"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Hasło"
android:inputType="textPassword" />
</android.support.design.widget.TextInputLayout>
<android.support.design.widget.TextInputLayout
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginLeft="8dp"
android:layout_marginEnd="8dp"
android:layout_marginRight="8dp"
app:errorEnabled="true">
<android.support.design.widget.TextInputEditText
android:id="@+id/loginServerAddress"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Adres" />
</android.support.design.widget.TextInputLayout>
&lt;!&ndash;<android.support.design.widget.TextInputLayout
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginLeft="8dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="8dp"
android:layout_marginRight="8dp"
app:errorEnabled="true"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="1.0"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/name_text_input">
<pl.szczodrzynski.edziennik.utils.TextInputDropDown
android:id="@+id/buttontest"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:drawableEnd="@drawable/dropdown_arrow"
android:paddingRight="6.0dip"
android:hint="Waga"
android:paddingEnd="6.0dip"
android:drawableRight="@drawable/dropdown_arrow" />
</android.support.design.widget.TextInputLayout>&ndash;&gt;
<android.support.design.button.MaterialButton
android:id="@+id/loginButton"
<com.google.android.material.button.MaterialButton
android:id="@+id/snackbarAnchor"
style="@style/Widget.MaterialComponents.Button"
android:layout_width="wrap_content"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="end"
android:layout_marginTop="8dp"
android:layout_marginEnd="8dp"
android:layout_marginRight="8dp"
android:text="Zaloguj"
android:textAllCaps="false" />-->
android:layout_marginBottom="16dp"
android:layout_gravity="bottom"
android:text="@string/done"
android:visibility="invisible"/>
</LinearLayout>
</FrameLayout>
</layout>

View File

@ -7,7 +7,7 @@
android:layout_height="match_parent"
android:orientation="vertical">
<ScrollView
<androidx.core.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1">
@ -61,38 +61,32 @@
android:layout_width="match_parent"
android:layout_height="16dp" />
<LinearLayout
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/profileListView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
android:layout_height="wrap_content"
android:layout_marginLeft="24dp"
android:layout_marginRight="24dp"
android:clipToPadding="false"
tools:listitem="@layout/row_login_profile_list_item"
tools:itemCount="10">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/profileListView"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_marginLeft="24dp"
android:layout_marginRight="24dp"
android:layout_weight="1"
tools:listitem="@layout/row_login_profile_list_item">
</androidx.recyclerview.widget.RecyclerView>
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/registerMeSwitch"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="24dp"
android:layout_marginRight="24dp"
android:checked="true"
android:paddingTop="16dp"
android:paddingBottom="16dp"
android:text="@string/login_allow_registration" />
</LinearLayout>
</androidx.recyclerview.widget.RecyclerView>
</LinearLayout>
</LinearLayout>
</ScrollView>
</androidx.core.widget.NestedScrollView>
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/registerMeSwitch"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="24dp"
android:layout_marginRight="24dp"
android:checked="true"
android:paddingTop="16dp"
android:paddingBottom="16dp"
android:text="@string/login_allow_registration" />
<LinearLayout
android:layout_width="match_parent"