activity_login.xml 9.1 KB

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