add select activity for multiserver authentication

This commit is contained in:
dkanada 2021-04-17 15:36:04 +09:00
commit e769131452
9 changed files with 300 additions and 4 deletions

View file

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="?cardBackgroundColor"/>
<corners android:radius="8dp"/>
</shape>

View file

@ -4,11 +4,9 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context=".activities.LoginActivity">
<include layout="@layout/status_bar"
android:id="@+id/status_bar"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent" />
@ -127,11 +125,28 @@
android:id="@+id/login"
android:layout_width="match_parent"
android:layout_height="64dp"
android:layout_margin="32dp"
android:layout_marginHorizontal="32dp"
android:layout_marginTop="32dp"
android:layout_marginBottom="16dp"
android:text="@string/login"
app:cornerRadius="24dp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintBottom_toBottomOf="parent" />
app:layout_constraintBottom_toTopOf="@id/select" />
<com.google.android.material.button.MaterialButton
android:id="@+id/select"
android:layout_width="match_parent"
android:layout_height="64dp"
android:layout_marginHorizontal="32dp"
android:layout_marginTop="0dp"
android:layout_marginBottom="32dp"
android:text="@string/select"
android:backgroundTint="?cardBackgroundColor"
app:cornerRadius="24dp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
tools:ignore="UnusedAttribute" />
</androidx.constraintlayout.widget.ConstraintLayout>

View file

@ -0,0 +1,46 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout 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"
tools:context=".activities.SelectActivity">
<include layout="@layout/status_bar"
android:id="@+id/status_bar"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent" />
<androidx.appcompat.widget.Toolbar
style="@style/Toolbar"
android:id="@+id/toolbar"
android:background="@android:color/transparent"
app:layout_constraintTop_toBottomOf="@id/status_bar"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recycler_view"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_marginVertical="20dp"
android:scrollbars="vertical"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintBottom_toTopOf="@id/add"
app:layout_constraintTop_toBottomOf="@id/toolbar" />
<com.google.android.material.button.MaterialButton
android:id="@+id/add"
android:layout_width="match_parent"
android:layout_height="64dp"
android:layout_margin="32dp"
android:text="@string/add"
app:cornerRadius="24dp"
app:backgroundTint="?colorPrimary"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintBottom_toBottomOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>

View file

@ -0,0 +1,58 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="100dp"
android:layout_margin="20dp"
android:background="@drawable/card_server"
android:elevation="4dp"
tools:ignore="UnusedAttribute">
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:paddingStart="20dp"
android:paddingEnd="20dp"
android:orientation="vertical"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toStartOf="@id/delete"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toTopOf="parent">
<TextView
android:id="@+id/name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:singleLine="true"
android:textAppearance="@style/TextAppearance.AppCompat.Headline"
tools:text="Server" />
<TextView
android:id="@+id/url"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:singleLine="true"
android:textAppearance="@style/TextAppearance.AppCompat.Body1"
android:textColor="?android:textColorSecondary"
tools:text="https://jellyfin.org" />
</LinearLayout>
<com.dkanada.gramophone.views.IconImageView
android:id="@+id/delete"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/select"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@drawable/ic_delete_white_24dp"
style="@style/OverFlowButton" />
<com.dkanada.gramophone.views.IconImageView
android:id="@+id/select"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@drawable/ic_keyboard_arrow_right_white_24dp"
style="@style/OverFlowButton" />
</androidx.constraintlayout.widget.ConstraintLayout>

View file

@ -187,6 +187,8 @@
<string name="widget_classic">Classic</string>
<string name="widget_card">Card</string>
<string name="select">Select</string>
<string name="add">Add</string>
<string name="login">Login</string>
<string name="disable">Disable</string>
<string name="ignore">Ignore</string>