Added Android code
[wl-app.git] / Android / app / src / main / res / layout / fragment_book.xml
1 <?xml version="1.0" encoding="utf-8"?>
2 <RelativeLayout 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="wrap_content">
7
8     <android.support.design.widget.CoordinatorLayout
9         android:id="@+id/clMainView"
10         android:layout_width="match_parent"
11         android:layout_height="match_parent">
12
13         <android.support.design.widget.AppBarLayout
14             android:id="@+id/app_bar_layout"
15             android:layout_width="match_parent"
16             android:layout_height="wrap_content"
17             app:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar">
18
19             <android.support.design.widget.CollapsingToolbarLayout
20                 android:id="@+id/ctlCollapse"
21                 android:layout_width="match_parent"
22                 android:layout_height="@dimen/book_header_height"
23                 app:contentScrim="?attr/colorPrimary"
24                 app:expandedTitleTextAppearance="@android:color/transparent"
25                 app:layout_scrollFlags="snap">
26
27                 <include
28                     layout="@layout/fragment_book_header"
29                     app:layout_collapseMode="parallax"/>
30
31                 <android.support.v7.widget.Toolbar
32                     android:id="@+id/bookToolbar"
33                     android:layout_width="match_parent"
34                     android:layout_height="?attr/actionBarSize"
35                     android:minHeight="?attr/actionBarSize"
36                     app:layout_collapseMode="pin"
37                     app:popupTheme="@style/ThemeOverlay.AppCompat.Light"/>
38
39             </android.support.design.widget.CollapsingToolbarLayout>
40
41         </android.support.design.widget.AppBarLayout>
42
43         <android.support.v4.widget.NestedScrollView
44             android:layout_width="match_parent"
45             android:layout_height="wrap_content"
46             android:layout_gravity="fill_vertical"
47             android:fillViewport="true"
48             app:layout_behavior="@string/appbar_scrolling_view_behavior">
49
50             <com.facebook.shimmer.ShimmerFrameLayout
51                 android:id="@+id/shimmerContentContainer"
52                 android:layout_width="match_parent"
53                 android:layout_height="wrap_content">
54
55                 <LinearLayout
56                     android:layout_width="match_parent"
57                     android:layout_height="wrap_content"
58                     android:animateLayoutChanges="true"
59                     android:orientation="vertical"
60                     tools:ignore="SpUsage">
61
62                     <LinearLayout
63                         android:id="@+id/llBookContent"
64                         android:layout_width="match_parent"
65                         android:layout_height="wrap_content"
66                         android:orientation="vertical"
67                         android:paddingEnd="@dimen/book_details_padding"
68                         android:paddingStart="@dimen/book_details_padding">
69
70                         <TextView
71                             style="@style/BookCategoriesTitleText"
72                             android:layout_width="match_parent"
73                             android:layout_height="wrap_content"
74                             android:layout_marginTop="20dp"
75                             android:text="@string/book_epoch"/>
76
77                         <TextView
78                             android:id="@+id/tvBookEpoch"
79                             style="@style/ListTitleText.Turquoise"
80                             android:layout_width="match_parent"
81                             android:layout_height="wrap_content"
82                             android:background="@color/placeholder_gray"
83                             android:textSize="18dp"/>
84
85                         <TextView
86                             style="@style/BookCategoriesTitleText"
87                             android:layout_width="match_parent"
88                             android:layout_height="wrap_content"
89                             android:layout_marginTop="10dp"
90                             android:text="@string/book_kind"/>
91
92                         <TextView
93                             android:id="@+id/tvBookKind"
94                             style="@style/ListTitleText.Turquoise"
95                             android:layout_width="match_parent"
96                             android:layout_height="wrap_content"
97                             android:background="@color/placeholder_gray"
98                             android:textSize="18dp"/>
99
100                         <TextView
101                             style="@style/BookCategoriesTitleText"
102                             android:layout_width="match_parent"
103                             android:layout_height="wrap_content"
104                             android:layout_marginTop="10dp"
105                             android:text="@string/book_genre"/>
106
107                         <TextView
108                             android:id="@+id/tvBookGenre"
109                             style="@style/ListTitleText.Turquoise"
110                             android:layout_width="match_parent"
111                             android:layout_height="wrap_content"
112                             android:background="@color/placeholder_gray"
113                             android:textSize="18dp"/>
114
115                         <View
116                             android:layout_width="match_parent"
117                             android:layout_height="1dp"
118                             android:layout_marginBottom="10dp"
119                             android:layout_marginTop="10dp"
120                             android:background="@color/gray_very_dark"/>
121
122                         <org.sufficientlysecure.htmltextview.HtmlTextView
123                             android:id="@+id/tvQuotationText"
124                             android:layout_width="match_parent"
125                             android:layout_height="wrap_content"
126                             android:background="@color/placeholder_gray"
127                             android:minLines="8"
128                             android:textSize="16dp"
129                             android:textStyle="italic"/>
130
131                         <TextView
132                             android:id="@+id/tvQuotationAuthor"
133                             android:layout_width="match_parent"
134                             android:layout_height="wrap_content"
135                             android:layout_marginTop="20dp"
136                             android:background="@color/placeholder_gray"
137                             android:gravity="end"
138                             android:textSize="12dp"/>
139
140                         <View
141                             android:id="@+id/vSecondDivider"
142                             android:layout_width="match_parent"
143                             android:layout_height="1dp"
144                             android:layout_marginBottom="10dp"
145                             android:layout_marginTop="10dp"
146                             android:background="@color/gray_very_dark"/>
147
148                     </LinearLayout>
149
150                     <RelativeLayout
151                         android:id="@+id/rlEbookButtonsContainer"
152                         android:layout_width="match_parent"
153                         android:layout_height="wrap_content"
154                         android:layout_marginBottom="10dp"
155                         android:layout_marginTop="10dp"
156                         android:visibility="gone">
157
158                         <ImageButton
159                             android:id="@+id/ibDeleteEbook"
160                             android:layout_width="@dimen/book_details_button_margin"
161                             android:layout_height="@dimen/book_details_button_margin"
162                             android:layout_alignParentEnd="true"
163                             android:layout_centerVertical="true"
164                             android:background="@null"
165                             android:src="@drawable/delete_icon_selector"
166                             android:visibility="invisible"
167                             tools:ignore="ContentDescription"/>
168
169                         <com.moiseum.wolnelektury.view.book.components.ProgressDownloadButton
170                             android:id="@+id/btnEbook"
171                             android:layout_width="match_parent"
172                             android:layout_height="45dp"
173                             android:layout_centerVertical="true"
174                             android:layout_marginLeft="@dimen/book_details_button_margin"
175                             android:layout_toStartOf="@id/ibDeleteEbook"
176                             android:paddingEnd="@dimen/book_button_padding"
177                             android:paddingStart="@dimen/book_button_padding"
178                             app:border_size="1dp"
179                             app:corner_radius="@dimen/book_details_corner_radius"
180                             app:drawable="@drawable/ic_glass_mid"
181                             app:text_color="@color/orange"
182                             app:text_downloaded="@string/download_ebook_read"
183                             app:text_initial="@string/download_ebook"
184                             app:text_inverted_color="@color/white"
185                             app:text_size="@dimen/book_button_text_size"
186                             tools:ignore="RtlHardcoded"/>
187
188                     </RelativeLayout>
189
190                     <RelativeLayout
191                         android:id="@+id/rlAudioButtonsContainer"
192                         android:layout_width="match_parent"
193                         android:layout_height="wrap_content"
194                         android:visibility="gone">
195
196                         <ImageButton
197                             android:id="@+id/ibDeleteAudiobook"
198                             android:layout_width="@dimen/book_details_button_margin"
199                             android:layout_height="@dimen/book_details_button_margin"
200                             android:layout_alignParentEnd="true"
201                             android:layout_centerVertical="true"
202                             android:background="@null"
203                             android:src="@drawable/delete_icon_selector"
204                             android:visibility="invisible"
205                             tools:ignore="ContentDescription"/>
206
207                         <com.moiseum.wolnelektury.view.book.components.ProgressDownloadButton
208                             android:id="@+id/btnAudiobook"
209                             android:layout_width="match_parent"
210                             android:layout_height="45dp"
211                             android:layout_centerVertical="true"
212                             android:layout_marginLeft="@dimen/book_details_button_margin"
213                             android:layout_toStartOf="@id/ibDeleteAudiobook"
214                             android:paddingEnd="@dimen/book_button_padding"
215                             android:paddingStart="@dimen/book_button_padding"
216                             app:border_size="1dp"
217                             app:corner_radius="@dimen/book_details_corner_radius"
218                             app:drawable="@drawable/ic_speaker_mid"
219                             app:text_color="@color/audiobook_gray"
220                             app:text_downloaded="@string/download_audiobook_read"
221                             app:text_initial="@string/download_audiobook"
222                             app:text_inverted_color="@color/white"
223                             app:text_size="@dimen/book_button_text_size"
224                             tools:ignore="RtlHardcoded"/>
225
226                     </RelativeLayout>
227
228                     <View
229                         android:layout_width="match_parent"
230                         android:layout_height="30dp" />
231
232                     <!--<Button-->
233                     <!--android:id="@+id/btnSupportUs"-->
234                     <!--style="@style/OrangeDetailsButton"-->
235                     <!--android:layout_width="match_parent"-->
236                     <!--android:layout_height="45dp"-->
237                     <!--android:layout_marginLeft="@dimen/book_details_button_margin"-->
238                     <!--android:layout_marginRight="@dimen/book_details_button_margin"-->
239                     <!--android:layout_marginTop="10dp"-->
240                     <!--android:drawableEnd="@drawable/white_star"-->
241                     <!--android:text="@string/support_us"/>-->
242
243                 </LinearLayout>
244
245             </com.facebook.shimmer.ShimmerFrameLayout>
246
247         </android.support.v4.widget.NestedScrollView>
248
249         <android.support.design.widget.FloatingActionButton
250             android:id="@+id/fabShare"
251             android:layout_width="wrap_content"
252             android:layout_height="wrap_content"
253             android:layout_marginEnd="15dp"
254             android:src="@drawable/ic_share"
255             android:tint="@color/orange"
256             android:visibility="invisible"
257             app:backgroundTint="@color/white"
258             app:elevation="6dp"
259             app:layout_anchor="@id/app_bar_layout"
260             app:layout_anchorGravity="bottom|end"
261             app:pressedTranslationZ="8dp"
262             app:useCompatPadding="true"/>
263
264         <android.support.design.widget.FloatingActionButton
265             android:id="@+id/fabFavourite"
266             android:layout_width="wrap_content"
267             android:layout_height="wrap_content"
268             android:layout_gravity="center|start"
269             android:src="@drawable/ic_fav"
270             android:tint="@color/orange"
271             android:visibility="invisible"
272             app:backgroundTint="@color/white"
273             app:elevation="6dp"
274             app:layout_anchor="@id/fabShare"
275             app:layout_anchorGravity="center|start"
276             app:pressedTranslationZ="8dp"/>
277
278     </android.support.design.widget.CoordinatorLayout>
279
280     <include
281         android:id="@+id/clPremium"
282         layout="@layout/prapremiere_info"
283         android:layout_width="match_parent"
284         android:layout_height="wrap_content"
285         android:layout_alignParentBottom="true"/>
286
287 </RelativeLayout>