activity_preview.xml 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <layout xmlns:app="http://schemas.android.com/apk/res-auto"
  3. xmlns:tools="http://schemas.android.com/tools">
  4. <data>
  5. <variable
  6. name="previewViewModel"
  7. type="com.datarecovery.master.module.preview.PreviewViewModel" />
  8. <import type="com.datarecovery.master.module.preview.PreviewActivity" />
  9. </data>
  10. <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
  11. android:layout_width="match_parent"
  12. android:layout_height="match_parent"
  13. android:clipChildren="false"
  14. tools:ignore="contentDescription">
  15. <androidx.appcompat.widget.Toolbar
  16. android:id="@+id/preview_header"
  17. android:layout_width="match_parent"
  18. android:layout_height="wrap_content"
  19. app:layout_constraintTop_toTopOf="parent"
  20. app:navigationIcon="@drawable/icon_back">
  21. <TextView
  22. android:layout_width="wrap_content"
  23. android:layout_height="wrap_content"
  24. android:layout_gravity="center"
  25. android:text="@{previewViewModel.title}"
  26. android:textColor="#202020"
  27. android:textSize="17sp"
  28. android:textStyle="bold"
  29. tools:text="Preview" />
  30. </androidx.appcompat.widget.Toolbar>
  31. <View
  32. android:id="@+id/preview_background"
  33. android:layout_width="match_parent"
  34. android:layout_height="0dp"
  35. android:background="#F8F8F8"
  36. app:layout_constraintBottom_toBottomOf="parent"
  37. app:layout_constraintTop_toBottomOf="@id/preview_header" />
  38. <ImageView
  39. android:id="@+id/preview_image"
  40. android:layout_width="match_parent"
  41. android:layout_height="wrap_content"
  42. android:scaleType="fitCenter"
  43. app:imageUri="@{previewViewModel.previewUri}"
  44. app:isGone="@{previewViewModel.type != PreviewActivity.TYPE_IMG}"
  45. app:layout_constraintBottom_toBottomOf="@id/preview_background"
  46. app:layout_constraintTop_toTopOf="@id/preview_background" />
  47. <SurfaceView
  48. android:id="@+id/preview_video"
  49. android:layout_width="match_parent"
  50. android:layout_height="wrap_content"
  51. app:isGone="@{previewViewModel.type != PreviewActivity.TYPE_VIDEO}"
  52. app:layout_constraintBottom_toBottomOf="@id/preview_background"
  53. app:layout_constraintTop_toTopOf="@id/preview_background" />
  54. <ImageView
  55. android:id="@+id/preview_play"
  56. android:layout_width="0dp"
  57. android:layout_height="0dp"
  58. android:src="@drawable/icon_preview_video_play"
  59. app:isGone="@{previewViewModel.type != PreviewActivity.TYPE_VIDEO || previewViewModel.isPlaying}"
  60. app:layout_constraintBottom_toBottomOf="@id/preview_video"
  61. app:layout_constraintDimensionRatio="1:1"
  62. app:layout_constraintLeft_toLeftOf="@id/preview_video"
  63. app:layout_constraintRight_toRightOf="@id/preview_video"
  64. app:layout_constraintTop_toTopOf="@id/preview_video"
  65. app:layout_constraintWidth_percent="0.1333333333333333" />
  66. <View
  67. android:id="@+id/preview_audio_background"
  68. android:layout_width="match_parent"
  69. android:layout_height="0dp"
  70. android:layout_marginHorizontal="@dimen/app_common_page_horizontal_padding"
  71. android:background="@drawable/bg_preview_audio"
  72. app:isGone="@{previewViewModel.type != PreviewActivity.TYPE_AUDIO}"
  73. app:layout_constraintBottom_toBottomOf="@id/preview_audio_play"
  74. app:layout_constraintDimensionRatio="328:88"
  75. app:layout_constraintTop_toTopOf="@id/preview_audio_play" />
  76. <ImageView
  77. android:id="@+id/preview_audio_play"
  78. android:layout_width="0dp"
  79. android:layout_height="0dp"
  80. android:layout_marginHorizontal="@dimen/app_common_page_horizontal_padding"
  81. android:src="@{previewViewModel.isPlaying ? @drawable/icon_preview_audio_pause : @drawable/icon_preview_audio_play}"
  82. app:isGone="@{previewViewModel.type != PreviewActivity.TYPE_AUDIO}"
  83. app:layout_constraintBottom_toTopOf="@id/preview_bottom"
  84. app:layout_constraintDimensionRatio="1:1"
  85. app:layout_constraintLeft_toLeftOf="@id/preview_audio_background"
  86. app:layout_constraintTop_toTopOf="@id/preview_background"
  87. app:layout_constraintWidth_percent="0.0888888888888889"
  88. tools:src="@drawable/icon_preview_audio_pause" />
  89. <SeekBar
  90. android:id="@+id/preview_audio_seekbar"
  91. android:layout_width="0dp"
  92. android:layout_height="0dp"
  93. android:layout_marginHorizontal="@dimen/app_common_page_horizontal_padding"
  94. android:progress="10"
  95. android:progressDrawable="@drawable/shape_preview_audio_seekbar"
  96. android:splitTrack="false"
  97. android:thumb="@drawable/shape_preview_audio_seekbar_thumb"
  98. app:isGone="@{previewViewModel.type != PreviewActivity.TYPE_AUDIO}"
  99. app:layout_constraintBottom_toBottomOf="@id/preview_audio_play"
  100. app:layout_constraintDimensionRatio="252:14"
  101. app:layout_constraintLeft_toRightOf="@id/preview_audio_play"
  102. app:layout_constraintRight_toRightOf="@id/preview_audio_background"
  103. app:layout_constraintTop_toTopOf="@id/preview_audio_play" />
  104. <androidx.constraintlayout.widget.ConstraintLayout
  105. android:id="@+id/preview_bottom"
  106. android:layout_width="match_parent"
  107. android:layout_height="wrap_content"
  108. app:layout_constraintBottom_toBottomOf="parent">
  109. <View
  110. android:id="@+id/v_bottom"
  111. android:layout_width="match_parent"
  112. android:layout_height="0dp"
  113. android:background="@color/white"
  114. app:layout_constraintBottom_toBottomOf="parent"
  115. app:layout_constraintDimensionRatio="360:72" />
  116. <TextView
  117. android:layout_width="0dp"
  118. android:layout_height="0dp"
  119. android:background="@drawable/bg_common_btn"
  120. android:gravity="center"
  121. android:text="@string/export"
  122. android:textColor="@color/white"
  123. android:textSize="16sp"
  124. android:textStyle="bold"
  125. app:layout_constraintBottom_toBottomOf="@id/v_bottom"
  126. app:layout_constraintDimensionRatio="328:44"
  127. app:layout_constraintEnd_toEndOf="@+id/v_bottom"
  128. app:layout_constraintStart_toStartOf="@id/v_bottom"
  129. app:layout_constraintTop_toTopOf="@id/v_bottom"
  130. app:layout_constraintWidth_percent="0.9111111111111111" />
  131. <androidx.constraintlayout.widget.ConstraintLayout
  132. android:layout_width="match_parent"
  133. android:layout_height="wrap_content"
  134. app:isGone="@{previewViewModel.type != PreviewActivity.TYPE_IMG}"
  135. app:layout_constraintBottom_toTopOf="@+id/v_bottom">
  136. <View
  137. android:id="@+id/v_preview_img_bottom"
  138. android:layout_width="match_parent"
  139. android:layout_height="0dp"
  140. android:background="@drawable/bg_preview_img_bottom"
  141. app:layout_constraintDimensionRatio="360:103"
  142. app:layout_constraintTop_toTopOf="parent" />
  143. <TextView
  144. android:id="@+id/tv_preview_img_name"
  145. android:layout_width="wrap_content"
  146. android:layout_height="wrap_content"
  147. android:layout_marginStart="@dimen/app_common_page_horizontal_padding"
  148. android:text="@string/preview_img_create_time"
  149. android:textColor="#A7A7A7"
  150. android:textSize="12sp"
  151. app:layout_constraintBottom_toBottomOf="@+id/v_preview_img_bottom"
  152. app:layout_constraintStart_toStartOf="@+id/v_preview_img_bottom"
  153. app:layout_constraintTop_toTopOf="@+id/v_preview_img_bottom"
  154. app:layout_constraintVertical_bias="0.1627906976744186" />
  155. <TextView
  156. android:id="@+id/tv_preview_file_type"
  157. android:layout_width="wrap_content"
  158. android:layout_height="wrap_content"
  159. android:layout_marginStart="@dimen/app_common_page_horizontal_padding"
  160. android:text="@string/preview_img_file_type"
  161. android:textColor="#A7A7A7"
  162. android:textSize="12sp"
  163. app:layout_constraintBottom_toBottomOf="@+id/v_preview_img_bottom"
  164. app:layout_constraintStart_toStartOf="@+id/v_preview_img_bottom"
  165. app:layout_constraintTop_toTopOf="@+id/v_preview_img_bottom" />
  166. <TextView
  167. android:id="@+id/tv_preview_file_size"
  168. android:layout_width="wrap_content"
  169. android:layout_height="wrap_content"
  170. android:layout_marginStart="@dimen/app_common_page_horizontal_padding"
  171. android:text="@string/preview_img_file_size"
  172. android:textColor="#A7A7A7"
  173. android:textSize="12sp"
  174. app:layout_constraintBottom_toBottomOf="@+id/v_preview_img_bottom"
  175. app:layout_constraintStart_toStartOf="@+id/v_preview_img_bottom"
  176. app:layout_constraintTop_toTopOf="@+id/v_preview_img_bottom"
  177. app:layout_constraintVertical_bias="0.8372093023255814" />
  178. <TextView
  179. app:layout_constraintStart_toEndOf="@+id/tv_preview_img_name"
  180. app:layout_constraintBaseline_toBaselineOf="@+id/tv_preview_img_name"
  181. android:textColor="#404040"
  182. android:textSize="12sp"
  183. android:layout_marginStart="12dp"
  184. tools:text="2023-06-26 16:21"
  185. android:layout_width="wrap_content"
  186. android:layout_height="wrap_content" />
  187. <TextView
  188. app:layout_constraintStart_toEndOf="@+id/tv_preview_file_type"
  189. app:layout_constraintBaseline_toBaselineOf="@+id/tv_preview_file_type"
  190. android:textColor="#404040"
  191. android:textSize="12sp"
  192. android:layout_marginStart="12dp"
  193. tools:text="PNG"
  194. android:layout_width="wrap_content"
  195. android:layout_height="wrap_content" />
  196. <TextView
  197. app:layout_constraintStart_toEndOf="@+id/tv_preview_file_size"
  198. app:layout_constraintBaseline_toBaselineOf="@+id/tv_preview_file_size"
  199. android:textColor="#404040"
  200. android:textSize="12sp"
  201. android:layout_marginStart="12dp"
  202. tools:text="14.10KB"
  203. android:layout_width="wrap_content"
  204. android:layout_height="wrap_content" />
  205. </androidx.constraintlayout.widget.ConstraintLayout>
  206. </androidx.constraintlayout.widget.ConstraintLayout>
  207. </androidx.constraintlayout.widget.ConstraintLayout>
  208. </layout>