Change EditText to Material TextField
This commit is contained in:
parent
e0c8f0aeb6
commit
d3ebf29efa
6 changed files with 44 additions and 31 deletions
|
@ -41,7 +41,6 @@ dependencies {
|
||||||
def room_version = "2.3.0"
|
def room_version = "2.3.0"
|
||||||
def jellyfin_version = "1.0.0-beta.7"
|
def jellyfin_version = "1.0.0-beta.7"
|
||||||
|
|
||||||
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
|
|
||||||
implementation 'androidx.core:core-ktx:1.5.0'
|
implementation 'androidx.core:core-ktx:1.5.0'
|
||||||
implementation 'androidx.appcompat:appcompat:1.3.0'
|
implementation 'androidx.appcompat:appcompat:1.3.0'
|
||||||
implementation 'com.google.android.material:material:1.3.0'
|
implementation 'com.google.android.material:material:1.3.0'
|
||||||
|
|
|
@ -32,7 +32,7 @@ class AddServerFragment : Fragment() {
|
||||||
viewModel.checkServer(serverAddress)
|
viewModel.checkServer(serverAddress)
|
||||||
binding.progressCircular.visibility = View.VISIBLE
|
binding.progressCircular.visibility = View.VISIBLE
|
||||||
} else {
|
} else {
|
||||||
binding.editTextServerAddress.error = "Empty server address"
|
binding.editTextServerAddressLayout.error = "Empty server address"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -45,7 +45,7 @@ class AddServerFragment : Fragment() {
|
||||||
})
|
})
|
||||||
|
|
||||||
viewModel.error.observe(viewLifecycleOwner, {
|
viewModel.error.observe(viewLifecycleOwner, {
|
||||||
binding.editTextServerAddress.error = it
|
binding.editTextServerAddressLayout.error = it
|
||||||
})
|
})
|
||||||
|
|
||||||
return binding.root
|
return binding.root
|
||||||
|
|
|
@ -32,7 +32,7 @@ class LoginFragment : Fragment() {
|
||||||
|
|
||||||
viewModel.error.observe(viewLifecycleOwner, {
|
viewModel.error.observe(viewLifecycleOwner, {
|
||||||
binding.progressCircular.visibility = View.GONE
|
binding.progressCircular.visibility = View.GONE
|
||||||
binding.editTextUsername.error = it
|
binding.editTextUsernameLayout.error = it
|
||||||
})
|
})
|
||||||
|
|
||||||
return binding.root
|
return binding.root
|
||||||
|
|
|
@ -51,18 +51,23 @@
|
||||||
android:text="@string/add_server"
|
android:text="@string/add_server"
|
||||||
android:textColor="?android:textColorPrimary" />
|
android:textColor="?android:textColorPrimary" />
|
||||||
|
|
||||||
<EditText
|
<com.google.android.material.textfield.TextInputLayout
|
||||||
android:id="@+id/edit_text_server_address"
|
android:id="@+id/edit_text_server_address_layout"
|
||||||
|
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginBottom="24dp"
|
android:layout_marginBottom="8dp"
|
||||||
android:autofillHints="no"
|
|
||||||
android:background="@drawable/edit_text_background"
|
|
||||||
android:hint="@string/edit_text_server_address_hint"
|
android:hint="@string/edit_text_server_address_hint"
|
||||||
android:inputType="text"
|
app:errorEnabled="true">
|
||||||
android:padding="10dp"
|
|
||||||
android:textAppearance="@style/text_subtitle"
|
<com.google.android.material.textfield.TextInputEditText
|
||||||
android:textColorHint="@color/neutral_400" />
|
android:id="@+id/edit_text_server_address"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:inputType="textUri"
|
||||||
|
android:singleLine="true" />
|
||||||
|
|
||||||
|
</com.google.android.material.textfield.TextInputLayout>
|
||||||
|
|
||||||
<RelativeLayout
|
<RelativeLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
|
|
@ -49,32 +49,40 @@
|
||||||
android:text="@string/login"
|
android:text="@string/login"
|
||||||
android:textColor="?android:textColorPrimary" />
|
android:textColor="?android:textColorPrimary" />
|
||||||
|
|
||||||
<EditText
|
<com.google.android.material.textfield.TextInputLayout
|
||||||
android:id="@+id/edit_text_username"
|
android:id="@+id/edit_text_username_layout"
|
||||||
|
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginBottom="12dp"
|
android:layout_marginBottom="12dp"
|
||||||
android:autofillHints="username"
|
android:hint="@string/edit_text_username_hint">
|
||||||
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
|
<com.google.android.material.textfield.TextInputEditText
|
||||||
android:id="@+id/edit_text_password"
|
android:id="@+id/edit_text_username"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:inputType="text"
|
||||||
|
android:autofillHints="username"/>
|
||||||
|
|
||||||
|
</com.google.android.material.textfield.TextInputLayout>
|
||||||
|
|
||||||
|
<com.google.android.material.textfield.TextInputLayout
|
||||||
|
android:id="@+id/edit_text_password_layout"
|
||||||
|
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginBottom="24dp"
|
android:layout_marginBottom="24dp"
|
||||||
android:autofillHints="password"
|
|
||||||
android:background="@drawable/edit_text_background"
|
|
||||||
android:hint="@string/edit_text_password_hint"
|
android:hint="@string/edit_text_password_hint"
|
||||||
android:inputType="textPassword"
|
app:passwordToggleEnabled="true">
|
||||||
android:padding="10dp"
|
|
||||||
android:textAppearance="@style/text_subtitle"
|
|
||||||
android:textColorHint="@color/neutral_400" />
|
|
||||||
|
|
||||||
|
<com.google.android.material.textfield.TextInputEditText
|
||||||
|
android:id="@+id/edit_text_password"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:inputType="textPassword"
|
||||||
|
android:autofillHints="password"/>
|
||||||
|
|
||||||
|
</com.google.android.material.textfield.TextInputLayout>
|
||||||
|
|
||||||
<RelativeLayout
|
<RelativeLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
|
|
@ -25,7 +25,8 @@
|
||||||
<fragment
|
<fragment
|
||||||
android:id="@+id/serverSelectFragment"
|
android:id="@+id/serverSelectFragment"
|
||||||
android:name="dev.jdtech.jellyfin.fragments.ServerSelectFragment"
|
android:name="dev.jdtech.jellyfin.fragments.ServerSelectFragment"
|
||||||
android:label="ServerSelectFragment" >
|
android:label="ServerSelectFragment"
|
||||||
|
tools:layout="@layout/fragment_server_select">
|
||||||
<action
|
<action
|
||||||
android:id="@+id/action_serverSelectFragment_to_addServerFragment"
|
android:id="@+id/action_serverSelectFragment_to_addServerFragment"
|
||||||
app:destination="@id/addServerFragment"
|
app:destination="@id/addServerFragment"
|
||||||
|
|
Loading…
Reference in a new issue