activity_login.xml 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
  3. xmlns:app="http://schemas.android.com/apk/res-auto"
  4. xmlns:tools="http://schemas.android.com/tools"
  5. android:layout_width="match_parent"
  6. android:layout_height="match_parent"
  7. android:background="@color/color_orange_800"
  8. tools:context=".screen.login.LoginActivity">
  9. <androidx.constraintlayout.widget.Guideline
  10. android:id="@+id/left_guideline"
  11. android:layout_width="wrap_content"
  12. android:layout_height="wrap_content"
  13. android:orientation="vertical"
  14. app:layout_constraintGuide_percent="0.10" />
  15. <androidx.constraintlayout.widget.Guideline
  16. android:id="@+id/right_guideline"
  17. android:layout_width="wrap_content"
  18. android:layout_height="wrap_content"
  19. android:orientation="vertical"
  20. app:layout_constraintGuide_percent="0.90" />
  21. <View
  22. android:id="@+id/v_bg"
  23. android:layout_width="0dp"
  24. android:layout_height="350dp"
  25. android:background="@drawable/bg_white_login"
  26. app:layout_constraintBottom_toBottomOf="parent"
  27. app:layout_constraintEnd_toEndOf="@+id/right_guideline"
  28. app:layout_constraintStart_toStartOf="@+id/left_guideline"
  29. app:layout_constraintTop_toTopOf="parent" />
  30. <View
  31. android:id="@+id/v_header"
  32. android:layout_width="0dp"
  33. android:layout_height="1dp"
  34. android:layout_marginTop="50dp"
  35. app:layout_constraintEnd_toEndOf="@+id/right_guideline"
  36. app:layout_constraintStart_toStartOf="@+id/left_guideline"
  37. app:layout_constraintTop_toTopOf="@+id/v_bg" />
  38. <ImageView
  39. android:id="@+id/iv_logo"
  40. android:layout_width="100dp"
  41. android:layout_height="100dp"
  42. android:adjustViewBounds="true"
  43. android:scaleType="fitXY"
  44. android:src="@drawable/ic_logo_big"
  45. app:layout_constraintBottom_toTopOf="@+id/v_header"
  46. app:layout_constraintEnd_toEndOf="@+id/right_guideline"
  47. app:layout_constraintStart_toStartOf="@+id/left_guideline" />
  48. <TextView
  49. android:id="@+id/tv_member_label"
  50. android:layout_width="0dp"
  51. android:layout_height="wrap_content"
  52. android:layout_marginTop="8dp"
  53. android:layout_marginBottom="16dp"
  54. android:gravity="center"
  55. android:text="Member Login"
  56. android:textColor="@color/color_black"
  57. android:textSize="18sp"
  58. android:textStyle="bold"
  59. app:layout_constraintEnd_toEndOf="@id/v_bg"
  60. app:layout_constraintStart_toStartOf="@+id/v_bg"
  61. app:layout_constraintTop_toBottomOf="@id/v_header" />
  62. <TextView
  63. android:id="@+id/tv_username_label"
  64. android:layout_width="0dp"
  65. android:layout_height="wrap_content"
  66. android:layout_marginStart="36dp"
  67. android:layout_marginTop="20dp"
  68. android:text="Username"
  69. android:textColor="@color/color_black"
  70. app:layout_constraintEnd_toEndOf="@+id/v_bg"
  71. app:layout_constraintStart_toStartOf="@+id/v_bg"
  72. app:layout_constraintTop_toBottomOf="@id/tv_member_label" />
  73. <com.google.android.material.textfield.TextInputLayout
  74. android:id="@+id/til_username"
  75. style="@style/GDTTextInputLayout.ClearText"
  76. android:layout_width="0dp"
  77. android:layout_height="35dp"
  78. android:layout_marginStart="24dp"
  79. android:layout_marginTop="4dp"
  80. android:layout_marginEnd="24dp"
  81. app:boxCornerRadiusBottomEnd="@dimen/login_edit_text_corner"
  82. app:boxCornerRadiusBottomStart="@dimen/login_edit_text_corner"
  83. app:boxCornerRadiusTopEnd="@dimen/login_edit_text_corner"
  84. app:boxCornerRadiusTopStart="@dimen/login_edit_text_corner"
  85. app:hintEnabled="false"
  86. app:layout_constraintEnd_toEndOf="@+id/v_bg"
  87. app:layout_constraintStart_toStartOf="@+id/v_bg"
  88. app:layout_constraintTop_toBottomOf="@id/tv_username_label"
  89. app:startIconDrawable="@drawable/ic_user1"
  90. app:startIconTint="@color/color_login_icon">
  91. <androidx.appcompat.widget.AppCompatEditText
  92. android:id="@+id/et_username"
  93. android:layout_width="match_parent"
  94. android:layout_height="wrap_content"
  95. android:inputType="text"
  96. android:maxLength="50"
  97. android:padding="0dp"
  98. android:textColor="@color/colorPrimary"
  99. android:textSize="12sp" />
  100. </com.google.android.material.textfield.TextInputLayout>
  101. <TextView
  102. android:id="@+id/tv_password_label"
  103. android:layout_width="0dp"
  104. android:layout_height="wrap_content"
  105. android:layout_marginStart="36dp"
  106. android:layout_marginTop="16dp"
  107. android:text="Password"
  108. android:textColor="@color/color_black"
  109. app:layout_constraintEnd_toEndOf="@+id/v_bg"
  110. app:layout_constraintStart_toStartOf="@+id/v_bg"
  111. app:layout_constraintTop_toBottomOf="@id/til_username" />
  112. <com.google.android.material.textfield.TextInputLayout
  113. android:id="@+id/til_password"
  114. style="@style/GDTTextInputLayout.PasswordToggle"
  115. android:layout_width="0dp"
  116. android:layout_height="35dp"
  117. android:layout_marginStart="24dp"
  118. android:layout_marginTop="4dp"
  119. android:layout_marginEnd="24dp"
  120. app:boxCornerRadiusBottomEnd="@dimen/login_edit_text_corner"
  121. app:boxCornerRadiusBottomStart="@dimen/login_edit_text_corner"
  122. app:boxCornerRadiusTopEnd="@dimen/login_edit_text_corner"
  123. app:boxCornerRadiusTopStart="@dimen/login_edit_text_corner"
  124. app:hintEnabled="false"
  125. app:layout_constraintEnd_toEndOf="@+id/v_bg"
  126. app:layout_constraintStart_toStartOf="@+id/v_bg"
  127. app:layout_constraintTop_toBottomOf="@id/tv_password_label"
  128. app:startIconDrawable="@drawable/ic_lock"
  129. app:startIconTint="@color/color_login_icon">
  130. <androidx.appcompat.widget.AppCompatEditText
  131. android:id="@+id/et_password"
  132. android:layout_width="match_parent"
  133. android:layout_height="wrap_content"
  134. android:inputType="textPassword"
  135. android:maxLength="50"
  136. android:padding="0dp"
  137. android:textColor="@color/colorPrimary"
  138. android:textSize="12sp" />
  139. </com.google.android.material.textfield.TextInputLayout>
  140. <com.google.android.material.button.MaterialButton
  141. android:id="@+id/btn_login"
  142. android:layout_width="wrap_content"
  143. android:layout_height="wrap_content"
  144. android:layout_gravity="center"
  145. android:layout_marginTop="24dp"
  146. android:backgroundTint="@color/colorPrimary"
  147. android:gravity="center"
  148. android:padding="12dp"
  149. android:paddingStart="36dp"
  150. android:paddingEnd="36dp"
  151. android:text="LOGIN"
  152. android:textColor="@color/color_white"
  153. android:textSize="16sp"
  154. app:cornerRadius="12dp"
  155. app:layout_constraintEnd_toEndOf="@+id/v_bg"
  156. app:layout_constraintStart_toStartOf="@+id/v_bg"
  157. app:layout_constraintTop_toBottomOf="@id/til_password" />
  158. <TextView
  159. android:id="@+id/tv_error"
  160. android:layout_width="0dp"
  161. android:layout_height="wrap_content"
  162. android:layout_marginTop="8dp"
  163. android:gravity="center"
  164. android:textColor="@color/color_red_800"
  165. app:layout_constraintEnd_toEndOf="@+id/v_bg"
  166. app:layout_constraintStart_toStartOf="@+id/v_bg"
  167. app:layout_constraintTop_toBottomOf="@id/btn_login" />
  168. </androidx.constraintlayout.widget.ConstraintLayout>