Yet Another OTP generator
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

item_otp.xml 1.9KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <layout xmlns:android="http://schemas.android.com/apk/res/android"
  3. xmlns:tools="http://schemas.android.com/tools">
  4. <data>
  5. <import type="android.view.View"/>
  6. <variable
  7. name="viewmodel"
  8. type="com.chameth.yaotp.viewmodel.OtpItemViewModel"/>
  9. </data>
  10. <RelativeLayout
  11. android:layout_width="wrap_content"
  12. android:layout_height="wrap_content"
  13. android:layout_margin="16dp">
  14. <TextView
  15. android:id="@+id/otpLabel"
  16. android:layout_width="wrap_content"
  17. android:layout_height="wrap_content"
  18. android:layout_alignParentStart="true"
  19. android:layout_toStartOf="@id/otpTimeLeft"
  20. android:textSize="16sp"
  21. android:text="@{viewmodel.label}"
  22. tools:text="Label" />
  23. <TextView
  24. android:id="@+id/otpValue"
  25. android:layout_width="wrap_content"
  26. android:layout_height="wrap_content"
  27. android:layout_below="@id/otpLabel"
  28. android:layout_alignParentStart="true"
  29. android:layout_toStartOf="@id/otpTimeLeft"
  30. android:textSize="32sp"
  31. android:text="@{viewmodel.otp.otp}"
  32. tools:text="012345" />
  33. <TextView
  34. android:id="@+id/otpTimeLeft"
  35. android:layout_width="wrap_content"
  36. android:layout_height="wrap_content"
  37. android:layout_alignParentEnd="true"
  38. android:textSize="24sp"
  39. android:layout_margin="16dp"
  40. android:visibility="@{viewmodel.showTime ? View.VISIBLE : View.GONE}"
  41. android:text="@{viewmodel.timeLeft}"
  42. tools:text="20s"/>
  43. </RelativeLayout>
  44. </layout>