Add login fragment
This commit is contained in:
parent
805b9687f5
commit
8b299694c2
3 changed files with 96 additions and 0 deletions
16
app/src/main/java/dev/jdtech/jellyfin/LoginFragment.kt
Normal file
16
app/src/main/java/dev/jdtech/jellyfin/LoginFragment.kt
Normal file
|
@ -0,0 +1,16 @@
|
|||
package dev.jdtech.jellyfin
|
||||
|
||||
import android.os.Bundle
|
||||
import androidx.fragment.app.Fragment
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
|
||||
class LoginFragment : Fragment() {
|
||||
override fun onCreateView(
|
||||
inflater: LayoutInflater, container: ViewGroup?,
|
||||
savedInstanceState: Bundle?
|
||||
): View? {
|
||||
return inflater.inflate(R.layout.fragment_login, container, false)
|
||||
}
|
||||
}
|
76
app/src/main/res/layout/fragment_login.xml
Normal file
76
app/src/main/res/layout/fragment_login.xml
Normal file
|
@ -0,0 +1,76 @@
|
|||
<?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=".LoginFragment">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/image_banner"
|
||||
android:layout_width="268dp"
|
||||
android:layout_height="75dp"
|
||||
android:layout_marginTop="64dp"
|
||||
android:contentDescription="@string/jellyfin_banner"
|
||||
android:src="@drawable/ic_banner"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/linearLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="24dp"
|
||||
android:layout_marginEnd="24dp"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/image_banner"
|
||||
app:layout_constraintVertical_bias="0.36">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/text_login"
|
||||
style="@style/text_header"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="32dp"
|
||||
android:text="@string/login"
|
||||
android:textColor="?android:textColorPrimary" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/edit_text_username"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="12dp"
|
||||
android:autofillHints="username"
|
||||
android:background="@drawable/edit_text_background"
|
||||
android:hint="@string/edit_text_username_hint"
|
||||
android:inputType="text"
|
||||
android:padding="10dp"
|
||||
android:textAppearance="@style/text_subtitle"
|
||||
android:textColorHint="@color/neutral_400" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/edit_text_password"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="24dp"
|
||||
android:autofillHints="password"
|
||||
android:background="@drawable/edit_text_background"
|
||||
android:hint="@string/edit_text_password_hint"
|
||||
android:inputType="textPassword"
|
||||
android:padding="10dp"
|
||||
android:textAppearance="@style/text_subtitle"
|
||||
android:textColorHint="@color/neutral_400" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/button_login"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="48dp"
|
||||
android:background="@drawable/button_setup_background"
|
||||
android:text="@string/button_login" />
|
||||
</LinearLayout>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
|
@ -2,6 +2,10 @@
|
|||
<string name="app_name">Jellyfin</string>
|
||||
<string name="jellyfin_banner">Jellyfin banner</string>
|
||||
<string name="add_server">Add server</string>
|
||||
<string name="login">Login</string>
|
||||
<string name="edit_text_server_address_hint">Server address</string>
|
||||
<string name="edit_text_username_hint">Username</string>
|
||||
<string name="edit_text_password_hint">Password</string>
|
||||
<string name="button_connect">Connect</string>
|
||||
<string name="button_login">Login</string>
|
||||
</resources>
|
Loading…
Reference in a new issue