reader_activity.xml 9.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213
  1. <androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
  2. xmlns:app="http://schemas.android.com/apk/res-auto"
  3. xmlns:tools="http://schemas.android.com/tools"
  4. android:layout_width="match_parent"
  5. android:layout_height="match_parent"
  6. android:gravity="center">
  7. <FrameLayout
  8. android:id="@+id/reader_container"
  9. android:layout_width="match_parent"
  10. android:layout_height="match_parent">
  11. <FrameLayout
  12. android:id="@+id/viewer_container"
  13. android:layout_width="match_parent"
  14. android:layout_height="match_parent" />
  15. <eu.kanade.tachiyomi.ui.reader.PageIndicatorTextView
  16. android:id="@+id/page_number"
  17. style="@style/TextAppearance.Regular.Caption"
  18. android:layout_width="wrap_content"
  19. android:layout_height="wrap_content"
  20. android:layout_gravity="bottom|center_horizontal"
  21. android:padding="4dp"
  22. android:textDirection="ltr"
  23. android:textStyle="bold" />
  24. </FrameLayout>
  25. <eu.kanade.tachiyomi.ui.reader.ReaderColorFilterView
  26. android:id="@+id/color_overlay"
  27. android:layout_width="match_parent"
  28. android:layout_height="match_parent"
  29. android:visibility="gone" />
  30. <eu.kanade.tachiyomi.ui.reader.ReaderNavigationOverlayView
  31. android:id="@+id/navigation_overlay"
  32. android:layout_width="match_parent"
  33. android:layout_height="match_parent"
  34. android:visibility="gone" />
  35. <FrameLayout
  36. android:id="@+id/reader_menu"
  37. android:layout_width="match_parent"
  38. android:layout_height="match_parent"
  39. android:theme="?attr/actionBarTheme"
  40. android:visibility="invisible"
  41. tools:visibility="visible">
  42. <com.google.android.material.appbar.MaterialToolbar
  43. android:id="@+id/toolbar"
  44. android:layout_width="match_parent"
  45. android:layout_height="wrap_content"
  46. android:minHeight="?attr/actionBarSize" />
  47. <LinearLayout
  48. android:id="@+id/reader_menu_bottom"
  49. android:layout_width="match_parent"
  50. android:layout_height="wrap_content"
  51. android:layout_gravity="bottom"
  52. android:orientation="vertical">
  53. <LinearLayout
  54. android:id="@+id/reader_nav"
  55. android:layout_width="match_parent"
  56. android:layout_height="wrap_content"
  57. android:layout_marginStart="8dp"
  58. android:layout_marginEnd="8dp"
  59. android:layout_marginBottom="16dp"
  60. android:layoutDirection="ltr"
  61. android:orientation="horizontal">
  62. <ImageButton
  63. android:id="@+id/left_chapter"
  64. android:layout_width="48dp"
  65. android:layout_height="48dp"
  66. android:layout_marginEnd="8dp"
  67. android:background="@drawable/reader_seekbar_button"
  68. android:contentDescription="@string/action_previous_chapter"
  69. android:padding="@dimen/screen_edge_margin"
  70. app:srcCompat="@drawable/ic_skip_previous_24dp"
  71. app:tint="?attr/colorOnToolbar" />
  72. <LinearLayout
  73. android:id="@+id/reader_seekbar"
  74. android:layout_width="0dp"
  75. android:layout_height="match_parent"
  76. android:layout_weight="1"
  77. android:background="@drawable/reader_seekbar_background"
  78. android:clickable="true"
  79. android:paddingStart="8dp"
  80. android:paddingEnd="8dp"
  81. tools:ignore="KeyboardInaccessibleWidget">
  82. <TextView
  83. android:id="@+id/left_page_text"
  84. android:layout_width="32dp"
  85. android:layout_height="match_parent"
  86. android:gravity="center"
  87. android:textColor="?attr/colorOnToolbar"
  88. android:textSize="15sp"
  89. tools:text="1" />
  90. <!--
  91. Wonky way of setting height due to issues with horizontally centering the thumb in Android 5.
  92. See https://stackoverflow.com/questions/15701767/android-thumb-is-not-centered-in-seekbar
  93. -->
  94. <eu.kanade.tachiyomi.ui.reader.ReaderSeekBar
  95. android:id="@+id/page_seekbar"
  96. android:layout_width="0dp"
  97. android:layout_height="wrap_content"
  98. android:layout_weight="1"
  99. android:maxHeight="?attr/actionBarSize"
  100. android:minHeight="?attr/actionBarSize" />
  101. <TextView
  102. android:id="@+id/right_page_text"
  103. android:layout_width="32dp"
  104. android:layout_height="match_parent"
  105. android:gravity="center"
  106. android:textColor="?attr/colorOnToolbar"
  107. android:textSize="15sp"
  108. tools:text="15" />
  109. </LinearLayout>
  110. <ImageButton
  111. android:id="@+id/right_chapter"
  112. android:layout_width="48dp"
  113. android:layout_height="48dp"
  114. android:layout_marginStart="8dp"
  115. android:background="@drawable/reader_seekbar_button"
  116. android:contentDescription="@string/action_next_chapter"
  117. android:padding="@dimen/screen_edge_margin"
  118. app:srcCompat="@drawable/ic_skip_next_24dp"
  119. app:tint="?attr/colorOnToolbar" />
  120. </LinearLayout>
  121. <androidx.constraintlayout.widget.ConstraintLayout
  122. android:id="@+id/toolbar_bottom"
  123. android:layout_width="match_parent"
  124. android:layout_height="?attr/actionBarSize"
  125. android:layout_gravity="bottom"
  126. android:background="?attr/colorToolbar"
  127. android:clickable="true"
  128. tools:ignore="KeyboardInaccessibleWidget">
  129. <ImageButton
  130. android:id="@+id/action_reading_mode"
  131. android:layout_width="wrap_content"
  132. android:layout_height="match_parent"
  133. android:background="?attr/selectableItemBackgroundBorderless"
  134. android:contentDescription="@string/viewer"
  135. android:padding="@dimen/screen_edge_margin"
  136. app:layout_constraintEnd_toStartOf="@id/action_crop_borders"
  137. app:layout_constraintStart_toStartOf="parent"
  138. app:layout_constraintTop_toTopOf="parent"
  139. app:srcCompat="@drawable/ic_reader_default_24dp"
  140. app:tint="?attr/colorOnToolbar" />
  141. <ImageButton
  142. android:id="@+id/action_crop_borders"
  143. android:layout_width="wrap_content"
  144. android:layout_height="match_parent"
  145. android:background="?attr/selectableItemBackgroundBorderless"
  146. android:contentDescription="@string/pref_crop_borders"
  147. android:padding="@dimen/screen_edge_margin"
  148. app:layout_constraintEnd_toStartOf="@id/action_rotation"
  149. app:layout_constraintStart_toEndOf="@+id/action_reading_mode"
  150. app:layout_constraintTop_toTopOf="parent"
  151. app:srcCompat="@drawable/ic_crop_24dp"
  152. app:tint="?attr/colorOnToolbar" />
  153. <ImageButton
  154. android:id="@+id/action_rotation"
  155. android:layout_width="wrap_content"
  156. android:layout_height="match_parent"
  157. android:background="?attr/selectableItemBackgroundBorderless"
  158. android:contentDescription="@string/pref_rotation_type"
  159. android:padding="@dimen/screen_edge_margin"
  160. app:layout_constraintEnd_toStartOf="@id/action_settings"
  161. app:layout_constraintStart_toEndOf="@+id/action_crop_borders"
  162. app:layout_constraintTop_toTopOf="parent"
  163. app:srcCompat="@drawable/ic_screen_rotation_24dp"
  164. app:tint="?attr/colorOnToolbar" />
  165. <ImageButton
  166. android:id="@+id/action_settings"
  167. android:layout_width="wrap_content"
  168. android:layout_height="match_parent"
  169. android:background="?attr/selectableItemBackgroundBorderless"
  170. android:contentDescription="@string/action_settings"
  171. android:padding="@dimen/screen_edge_margin"
  172. app:layout_constraintEnd_toEndOf="parent"
  173. app:layout_constraintStart_toEndOf="@id/action_rotation"
  174. app:layout_constraintTop_toTopOf="parent"
  175. app:srcCompat="@drawable/ic_settings_24dp"
  176. app:tint="?attr/colorOnToolbar" />
  177. </androidx.constraintlayout.widget.ConstraintLayout>
  178. </LinearLayout>
  179. </FrameLayout>
  180. <View
  181. android:id="@+id/brightness_overlay"
  182. android:layout_width="match_parent"
  183. android:layout_height="match_parent"
  184. android:visibility="gone" />
  185. </androidx.coordinatorlayout.widget.CoordinatorLayout>