Redesign and some REPAIRS
This commit is contained in:
		
							parent
							
								
									1cb797f307
								
							
						
					
					
						commit
						a41235a4d5
					
				| @ -59,8 +59,12 @@ class AuthFragment: Fragment(R.layout.fragment_auth) { | ||||
|                 val username = s.toString() | ||||
|                 val valid = isUsernameValid(username) | ||||
| 
 | ||||
| 
 | ||||
|                 binding.hint.visibility = if(valid) View.INVISIBLE else View.VISIBLE | ||||
|                 if (valid) { | ||||
|                     binding.hint.visibility = View.INVISIBLE | ||||
|                 }else{ | ||||
|                     binding.login.error = getString(R.string.login_hint) | ||||
|                 } | ||||
| //                binding.hint.visibility = if(valid) View.INVISIBLE else View.VISIBLE | ||||
|                 binding.next.isEnabled = valid | ||||
|                 val color = if (valid) R.color.primary else R.color.secondary | ||||
|                 binding.next.backgroundTintList = ContextCompat.getColorStateList(requireContext(), color) | ||||
| @ -121,6 +125,7 @@ class AuthFragment: Fragment(R.layout.fragment_auth) { | ||||
|         val login = binding.login.text.toString() | ||||
|         val password = binding.password.text.toString() | ||||
|         if (login.isEmpty()) return | ||||
| 
 | ||||
|         viewModel.login(login, password) | ||||
|     } | ||||
| 
 | ||||
|  | ||||
							
								
								
									
										14
									
								
								app/src/main/res/drawable/administrator.xml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										14
									
								
								app/src/main/res/drawable/administrator.xml
									
									
									
									
									
										Normal file
									
								
							
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							| @ -11,7 +11,7 @@ | ||||
|     <item | ||||
|         android:id="@+id/nav_admin" | ||||
| 
 | ||||
|         android:icon="@drawable/_user_" | ||||
|         android:icon="@drawable/administrator" | ||||
|         android:title="@string/admin" /> | ||||
| 
 | ||||
| </menu> | ||||
|  | ||||
| @ -6,7 +6,7 @@ | ||||
|     <string name="hello">Здравствуйте!</string> | ||||
|     <string name="continue_">Продолжить</string> | ||||
|     <string name="logout">Выйти из аккаунта</string> | ||||
|     <string name="login_hint">Login must be at least 3 characters long,\start with a letter,\contain only letters and numbers.</string> | ||||
|     <string name="login_hint">Логин должен содержать не менее 3 символов, начинаться с буквы и содержать только буквы и цифры.</string> | ||||
|     <string name="close_button">Закрыть</string> | ||||
|     <string name="scan">Сканировать</string> | ||||
|     <string name="cancel">Вход был отменён</string> | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user