Guest User

Untitled

a guest
Dec 22nd, 2018
165
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.75 KB | None | 0 0
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <layout 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. tools:context=".ui.detail.DetailFragment">
  6.  
  7. <data>
  8.  
  9. <variable
  10. name="movie"
  11. type="com.sample.android.tmdb.vo.Movie" />
  12.  
  13. <variable
  14. name="vm"
  15. type="com.sample.android.tmdb.ui.detail.MovieDetailViewModel" />
  16. </data>
  17.  
  18. <android.support.constraint.motion.MotionLayout
  19. android:id="@+id/details_motion"
  20. android:layout_width="match_parent"
  21. android:layout_height="match_parent"
  22. app:layoutDescription="@xml/scene_show_details">
  23.  
  24. <ImageView
  25. android:id="@+id/details_backdrop"
  26. android:layout_width="0dp"
  27. android:layout_height="0dp"
  28. android:scaleType="centerCrop"
  29. app:imageUrl="@{movie.backdropPath}"
  30. tools:ignore="ContentDescription" />
  31.  
  32. <View
  33. android:id="@+id/details_backdrop_scrim"
  34. android:layout_width="0dp"
  35. android:layout_height="0dp"
  36. app:layout_constraintBottom_toBottomOf="@id/details_backdrop"
  37. app:layout_constraintEnd_toEndOf="@id/details_backdrop"
  38. app:layout_constraintStart_toStartOf="@id/details_backdrop"
  39. app:layout_constraintTop_toTopOf="@id/details_backdrop" />
  40.  
  41. <android.support.v7.widget.AppCompatImageView
  42. android:id="@+id/details_poster"
  43. android:layout_width="0dp"
  44. android:layout_height="0dp"
  45. android:background="@drawable/placeholder"
  46. android:scaleType="centerCrop"
  47. android:transformPivotX="0px"
  48. android:transformPivotY="0px"
  49. android:transitionName="@string/view_name_header_image"
  50. app:imageUrl="@{movie.posterPath}" />
  51.  
  52. <!-- Needed to fill a rounding error gap in MotionLayout. See https://issuetracker.google.com/112728689 -->
  53. <View
  54. android:id="@+id/details_gap_filler"
  55. android:layout_width="match_parent"
  56. android:layout_height="2px"
  57. android:background="@color/window_background"
  58. app:layout_constraintBottom_toTopOf="@id/details_rv"
  59. tools:ignore="PxUsage" />
  60.  
  61. <com.sample.android.tmdb.widget.TopLeftCutoutBackgroundView
  62. android:id="@+id/details_appbar_background"
  63. android:layout_width="0dp"
  64. android:layout_height="0dp"
  65. app:backgroundColor="@color/window_background"
  66. app:topLeftCutSize="@dimen/details_corner_cutout" />
  67.  
  68. <android.support.v7.widget.AppCompatTextView
  69. android:id="@+id/details_title"
  70. android:layout_width="0dp"
  71. android:layout_height="0dp"
  72. android:ellipsize="end"
  73. android:text="@{movie.title}"
  74. android:textAppearance="@style/TextAppearance.AppCompat.Title"
  75. android:transitionName="@string/view_name_header_title" />
  76.  
  77. <android.support.v7.widget.Toolbar
  78. android:id="@+id/details_toolbar"
  79. android:layout_width="match_parent"
  80. android:layout_height="wrap_content"
  81. android:minHeight="?attr/actionBarSize"
  82. app:theme="@style/Toolbar" />
  83.  
  84. <android.support.v4.widget.NestedScrollView
  85. android:id="@+id/details_rv"
  86. android:layout_width="0dp"
  87. android:layout_height="0dp"
  88. android:background="@color/window_background"
  89. app:layout_constraintBottom_toBottomOf="parent"
  90. app:layout_constraintEnd_toEndOf="parent"
  91. app:layout_constraintStart_toStartOf="parent"
  92. app:layout_constraintTop_toBottomOf="@id/details_appbar_background">
  93.  
  94. <LinearLayout
  95. android:layout_width="match_parent"
  96. android:layout_height="match_parent"
  97. android:orientation="vertical">
  98.  
  99. <TextView
  100. android:layout_width="wrap_content"
  101. android:layout_height="wrap_content"
  102. android:layout_marginLeft="@dimen/padding_normal"
  103. android:layout_marginTop="@dimen/padding_normal"
  104. android:layout_marginRight="@dimen/padding_normal"
  105. android:layout_marginBottom="@dimen/padding_micro"
  106. android:fontFamily="sans-serif-light"
  107. android:text="@{@string/release_date(movie.releaseDate)}"
  108. android:textAppearance="@style/TextAppearance.AppCompat.Small" />
  109.  
  110. <TextView
  111. android:layout_width="wrap_content"
  112. android:layout_height="wrap_content"
  113. android:layout_marginLeft="@dimen/padding_normal"
  114. android:layout_marginRight="@dimen/padding_normal"
  115. android:fontFamily="sans-serif-light"
  116. android:text="@{@string/rating(movie.voteAverage)}"
  117. android:textAppearance="@style/TextAppearance.AppCompat.Small" />
  118.  
  119. <TextView
  120. android:layout_width="wrap_content"
  121. android:layout_height="wrap_content"
  122. android:layout_marginLeft="@dimen/padding_normal"
  123. android:layout_marginTop="@dimen/padding_large"
  124. android:layout_marginRight="@dimen/padding_normal"
  125. android:text="@string/summary"
  126. android:textAppearance="@style/TextAppearance.AppCompat.Title" />
  127.  
  128. <TextView
  129. android:layout_width="wrap_content"
  130. android:layout_height="wrap_content"
  131. android:layout_margin="@dimen/padding_normal"
  132. android:fontFamily="sans-serif-light"
  133. android:text="@{movie.overview}"
  134. android:textAppearance="@style/TextAppearance.AppCompat.Body1" />
  135.  
  136. <include
  137. layout="@layout/trailers"
  138. android:layout_width="match_parent"
  139. android:layout_height="wrap_content"
  140. android:layout_marginLeft="@dimen/padding_normal"
  141. android:layout_marginTop="@dimen/padding_normal"
  142. android:layout_marginBottom="@dimen/padding_normal"
  143. app:vm="@{vm}"
  144. tools:ignore="RtlHardcoded" />
  145.  
  146. <TextView
  147. android:layout_width="wrap_content"
  148. android:layout_height="wrap_content"
  149. android:layout_marginLeft="@dimen/padding_normal"
  150. android:layout_marginRight="@dimen/padding_normal"
  151. android:layout_marginBottom="12dp"
  152. android:text="@string/actors"
  153. android:textAppearance="@style/TextAppearance.AppCompat.Title"
  154. app:visibleGone="@{vm.isActorsVisible}" />
  155.  
  156. <android.support.v7.widget.RecyclerView
  157. android:id="@+id/actors"
  158. android:layout_width="match_parent"
  159. android:layout_height="match_parent"
  160. app:items="@{vm.casts}"
  161. app:layout_behavior="@string/appbar_scrolling_view_behavior" />
  162.  
  163. </LinearLayout>
  164.  
  165. </android.support.v4.widget.NestedScrollView>
  166.  
  167.  
  168. <!-- This needs to be updated to use WindowInsets. See https://issuetracker.google.com/issues/112605433 -->
  169. <View
  170. android:id="@+id/details_status_bar_anchor"
  171. android:layout_width="match_parent"
  172. android:layout_height="24dp"
  173. android:background="@color/status_bar_scrim_translucent_dark" />
  174.  
  175. </android.support.constraint.motion.MotionLayout>
  176.  
  177. </layout>
Add Comment
Please, Sign In to add comment