Added Android code
[wl-app.git] / Android / app / src / main / res / layout / fragment_book.xml
diff --git a/Android/app/src/main/res/layout/fragment_book.xml b/Android/app/src/main/res/layout/fragment_book.xml
new file mode 100644 (file)
index 0000000..5fa675e
--- /dev/null
@@ -0,0 +1,287 @@
+<?xml version="1.0" encoding="utf-8"?>
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+                xmlns:app="http://schemas.android.com/apk/res-auto"
+                xmlns:tools="http://schemas.android.com/tools"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content">
+
+    <android.support.design.widget.CoordinatorLayout
+        android:id="@+id/clMainView"
+        android:layout_width="match_parent"
+        android:layout_height="match_parent">
+
+        <android.support.design.widget.AppBarLayout
+            android:id="@+id/app_bar_layout"
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            app:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar">
+
+            <android.support.design.widget.CollapsingToolbarLayout
+                android:id="@+id/ctlCollapse"
+                android:layout_width="match_parent"
+                android:layout_height="@dimen/book_header_height"
+                app:contentScrim="?attr/colorPrimary"
+                app:expandedTitleTextAppearance="@android:color/transparent"
+                app:layout_scrollFlags="snap">
+
+                <include
+                    layout="@layout/fragment_book_header"
+                    app:layout_collapseMode="parallax"/>
+
+                <android.support.v7.widget.Toolbar
+                    android:id="@+id/bookToolbar"
+                    android:layout_width="match_parent"
+                    android:layout_height="?attr/actionBarSize"
+                    android:minHeight="?attr/actionBarSize"
+                    app:layout_collapseMode="pin"
+                    app:popupTheme="@style/ThemeOverlay.AppCompat.Light"/>
+
+            </android.support.design.widget.CollapsingToolbarLayout>
+
+        </android.support.design.widget.AppBarLayout>
+
+        <android.support.v4.widget.NestedScrollView
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:layout_gravity="fill_vertical"
+            android:fillViewport="true"
+            app:layout_behavior="@string/appbar_scrolling_view_behavior">
+
+            <com.facebook.shimmer.ShimmerFrameLayout
+                android:id="@+id/shimmerContentContainer"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content">
+
+                <LinearLayout
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:animateLayoutChanges="true"
+                    android:orientation="vertical"
+                    tools:ignore="SpUsage">
+
+                    <LinearLayout
+                        android:id="@+id/llBookContent"
+                        android:layout_width="match_parent"
+                        android:layout_height="wrap_content"
+                        android:orientation="vertical"
+                        android:paddingEnd="@dimen/book_details_padding"
+                        android:paddingStart="@dimen/book_details_padding">
+
+                        <TextView
+                            style="@style/BookCategoriesTitleText"
+                            android:layout_width="match_parent"
+                            android:layout_height="wrap_content"
+                            android:layout_marginTop="20dp"
+                            android:text="@string/book_epoch"/>
+
+                        <TextView
+                            android:id="@+id/tvBookEpoch"
+                            style="@style/ListTitleText.Turquoise"
+                            android:layout_width="match_parent"
+                            android:layout_height="wrap_content"
+                            android:background="@color/placeholder_gray"
+                            android:textSize="18dp"/>
+
+                        <TextView
+                            style="@style/BookCategoriesTitleText"
+                            android:layout_width="match_parent"
+                            android:layout_height="wrap_content"
+                            android:layout_marginTop="10dp"
+                            android:text="@string/book_kind"/>
+
+                        <TextView
+                            android:id="@+id/tvBookKind"
+                            style="@style/ListTitleText.Turquoise"
+                            android:layout_width="match_parent"
+                            android:layout_height="wrap_content"
+                            android:background="@color/placeholder_gray"
+                            android:textSize="18dp"/>
+
+                        <TextView
+                            style="@style/BookCategoriesTitleText"
+                            android:layout_width="match_parent"
+                            android:layout_height="wrap_content"
+                            android:layout_marginTop="10dp"
+                            android:text="@string/book_genre"/>
+
+                        <TextView
+                            android:id="@+id/tvBookGenre"
+                            style="@style/ListTitleText.Turquoise"
+                            android:layout_width="match_parent"
+                            android:layout_height="wrap_content"
+                            android:background="@color/placeholder_gray"
+                            android:textSize="18dp"/>
+
+                        <View
+                            android:layout_width="match_parent"
+                            android:layout_height="1dp"
+                            android:layout_marginBottom="10dp"
+                            android:layout_marginTop="10dp"
+                            android:background="@color/gray_very_dark"/>
+
+                        <org.sufficientlysecure.htmltextview.HtmlTextView
+                            android:id="@+id/tvQuotationText"
+                            android:layout_width="match_parent"
+                            android:layout_height="wrap_content"
+                            android:background="@color/placeholder_gray"
+                            android:minLines="8"
+                            android:textSize="16dp"
+                            android:textStyle="italic"/>
+
+                        <TextView
+                            android:id="@+id/tvQuotationAuthor"
+                            android:layout_width="match_parent"
+                            android:layout_height="wrap_content"
+                            android:layout_marginTop="20dp"
+                            android:background="@color/placeholder_gray"
+                            android:gravity="end"
+                            android:textSize="12dp"/>
+
+                        <View
+                            android:id="@+id/vSecondDivider"
+                            android:layout_width="match_parent"
+                            android:layout_height="1dp"
+                            android:layout_marginBottom="10dp"
+                            android:layout_marginTop="10dp"
+                            android:background="@color/gray_very_dark"/>
+
+                    </LinearLayout>
+
+                    <RelativeLayout
+                        android:id="@+id/rlEbookButtonsContainer"
+                        android:layout_width="match_parent"
+                        android:layout_height="wrap_content"
+                        android:layout_marginBottom="10dp"
+                        android:layout_marginTop="10dp"
+                        android:visibility="gone">
+
+                        <ImageButton
+                            android:id="@+id/ibDeleteEbook"
+                            android:layout_width="@dimen/book_details_button_margin"
+                            android:layout_height="@dimen/book_details_button_margin"
+                            android:layout_alignParentEnd="true"
+                            android:layout_centerVertical="true"
+                            android:background="@null"
+                            android:src="@drawable/delete_icon_selector"
+                            android:visibility="invisible"
+                            tools:ignore="ContentDescription"/>
+
+                        <com.moiseum.wolnelektury.view.book.components.ProgressDownloadButton
+                            android:id="@+id/btnEbook"
+                            android:layout_width="match_parent"
+                            android:layout_height="45dp"
+                            android:layout_centerVertical="true"
+                            android:layout_marginLeft="@dimen/book_details_button_margin"
+                            android:layout_toStartOf="@id/ibDeleteEbook"
+                            android:paddingEnd="@dimen/book_button_padding"
+                            android:paddingStart="@dimen/book_button_padding"
+                            app:border_size="1dp"
+                            app:corner_radius="@dimen/book_details_corner_radius"
+                            app:drawable="@drawable/ic_glass_mid"
+                            app:text_color="@color/orange"
+                            app:text_downloaded="@string/download_ebook_read"
+                            app:text_initial="@string/download_ebook"
+                            app:text_inverted_color="@color/white"
+                            app:text_size="@dimen/book_button_text_size"
+                            tools:ignore="RtlHardcoded"/>
+
+                    </RelativeLayout>
+
+                    <RelativeLayout
+                        android:id="@+id/rlAudioButtonsContainer"
+                        android:layout_width="match_parent"
+                        android:layout_height="wrap_content"
+                        android:visibility="gone">
+
+                        <ImageButton
+                            android:id="@+id/ibDeleteAudiobook"
+                            android:layout_width="@dimen/book_details_button_margin"
+                            android:layout_height="@dimen/book_details_button_margin"
+                            android:layout_alignParentEnd="true"
+                            android:layout_centerVertical="true"
+                            android:background="@null"
+                            android:src="@drawable/delete_icon_selector"
+                            android:visibility="invisible"
+                            tools:ignore="ContentDescription"/>
+
+                        <com.moiseum.wolnelektury.view.book.components.ProgressDownloadButton
+                            android:id="@+id/btnAudiobook"
+                            android:layout_width="match_parent"
+                            android:layout_height="45dp"
+                            android:layout_centerVertical="true"
+                            android:layout_marginLeft="@dimen/book_details_button_margin"
+                            android:layout_toStartOf="@id/ibDeleteAudiobook"
+                            android:paddingEnd="@dimen/book_button_padding"
+                            android:paddingStart="@dimen/book_button_padding"
+                            app:border_size="1dp"
+                            app:corner_radius="@dimen/book_details_corner_radius"
+                            app:drawable="@drawable/ic_speaker_mid"
+                            app:text_color="@color/audiobook_gray"
+                            app:text_downloaded="@string/download_audiobook_read"
+                            app:text_initial="@string/download_audiobook"
+                            app:text_inverted_color="@color/white"
+                            app:text_size="@dimen/book_button_text_size"
+                            tools:ignore="RtlHardcoded"/>
+
+                    </RelativeLayout>
+
+                    <View
+                        android:layout_width="match_parent"
+                        android:layout_height="30dp" />
+
+                    <!--<Button-->
+                    <!--android:id="@+id/btnSupportUs"-->
+                    <!--style="@style/OrangeDetailsButton"-->
+                    <!--android:layout_width="match_parent"-->
+                    <!--android:layout_height="45dp"-->
+                    <!--android:layout_marginLeft="@dimen/book_details_button_margin"-->
+                    <!--android:layout_marginRight="@dimen/book_details_button_margin"-->
+                    <!--android:layout_marginTop="10dp"-->
+                    <!--android:drawableEnd="@drawable/white_star"-->
+                    <!--android:text="@string/support_us"/>-->
+
+                </LinearLayout>
+
+            </com.facebook.shimmer.ShimmerFrameLayout>
+
+        </android.support.v4.widget.NestedScrollView>
+
+        <android.support.design.widget.FloatingActionButton
+            android:id="@+id/fabShare"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_marginEnd="15dp"
+            android:src="@drawable/ic_share"
+            android:tint="@color/orange"
+            android:visibility="invisible"
+            app:backgroundTint="@color/white"
+            app:elevation="6dp"
+            app:layout_anchor="@id/app_bar_layout"
+            app:layout_anchorGravity="bottom|end"
+            app:pressedTranslationZ="8dp"
+            app:useCompatPadding="true"/>
+
+        <android.support.design.widget.FloatingActionButton
+            android:id="@+id/fabFavourite"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_gravity="center|start"
+            android:src="@drawable/ic_fav"
+            android:tint="@color/orange"
+            android:visibility="invisible"
+            app:backgroundTint="@color/white"
+            app:elevation="6dp"
+            app:layout_anchor="@id/fabShare"
+            app:layout_anchorGravity="center|start"
+            app:pressedTranslationZ="8dp"/>
+
+    </android.support.design.widget.CoordinatorLayout>
+
+    <include
+        android:id="@+id/clPremium"
+        layout="@layout/prapremiere_info"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:layout_alignParentBottom="true"/>
+
+</RelativeLayout>
\ No newline at end of file