MVVM for web series activity
new fragment for WebShowFragment load more api integration for episodes and teasers caching data in same viewmodel
This commit is contained in:
562
app/src/main/res/layout/fragment_web_show.xml
Normal file
562
app/src/main/res/layout/fragment_web_show.xml
Normal file
@@ -0,0 +1,562 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.core.widget.NestedScrollView 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:id="@+id/main"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/color_primary"
|
||||
tools:context=".webseries.views.SeasonActivity">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/img_season_bg"
|
||||
android:orientation="vertical"
|
||||
android:paddingHorizontal="15dp"
|
||||
android:paddingTop="15dp"
|
||||
android:paddingBottom="40dp">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/back_btn"
|
||||
android:layout_width="@dimen/_25sdp"
|
||||
android:layout_height="@dimen/_25sdp"
|
||||
android:contentDescription="@string/back_btn"
|
||||
android:scaleType="fitXY"
|
||||
android:src="@drawable/ic_arrow_back_full"
|
||||
|
||||
android:translationZ="1dp"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
|
||||
app:tint="@color/color_primary" />
|
||||
|
||||
<androidx.cardview.widget.CardView
|
||||
android:id="@+id/trailer_card"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
|
||||
android:layout_marginTop="10dp"
|
||||
|
||||
app:cardBackgroundColor="@color/white"
|
||||
app:cardCornerRadius="5dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/back_btn">
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/_140sdp"
|
||||
android:layout_margin="10dp">
|
||||
|
||||
<com.woka.utils.AdiImageView
|
||||
android:id="@+id/image"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:contentDescription="@string/masila"
|
||||
android:scaleType="fitXY"
|
||||
android:src="@android:color/darker_gray"
|
||||
app:imageCornerRadius="5dp"
|
||||
tools:src="@drawable/img_masila_tn_small" />
|
||||
|
||||
<com.woka.utils.PressableCard
|
||||
android:id="@+id/play_trailer"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerInParent="true"
|
||||
android:background="@drawable/round_25"
|
||||
android:backgroundTint="@color/color_primary"
|
||||
android:visibility="gone">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
|
||||
android:layout_marginHorizontal="15dp"
|
||||
android:layout_marginVertical="10dp"
|
||||
android:fontFamily="@font/exo_2_bold"
|
||||
|
||||
android:text="@string/play_trailer"
|
||||
android:textColor="@color/white"
|
||||
|
||||
/>
|
||||
|
||||
</com.woka.utils.PressableCard>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
</androidx.cardview.widget.CardView>
|
||||
|
||||
<com.facebook.shimmer.ShimmerFrameLayout
|
||||
android:id="@+id/details_progressive_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toBottomOf="@id/trailer_card">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="30dp"
|
||||
|
||||
android:layout_marginTop="15dp"
|
||||
android:background="@color/black_50" />
|
||||
|
||||
<View
|
||||
android:layout_width="200dp"
|
||||
android:layout_height="30dp"
|
||||
|
||||
android:layout_marginTop="15dp"
|
||||
android:background="@color/black_50" />
|
||||
|
||||
<View
|
||||
android:layout_width="100dp"
|
||||
android:layout_height="30dp"
|
||||
|
||||
android:layout_marginTop="15dp"
|
||||
android:background="@color/black_50" />
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="30dp"
|
||||
|
||||
android:layout_marginTop="15dp"
|
||||
android:background="@color/black_50" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</com.facebook.shimmer.ShimmerFrameLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/details_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintTop_toBottomOf="@id/trailer_card">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/season_title"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
|
||||
android:layout_marginTop="10dp"
|
||||
android:fontFamily="@font/exo_2_extrabold"
|
||||
android:textColor="@color/color_primary"
|
||||
android:textSize="@dimen/_16ssp"
|
||||
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
|
||||
tools:text="HIP HIPPO’S ADVENTURES"
|
||||
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/season_year"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
|
||||
android:layout_marginTop="5dp"
|
||||
android:fontFamily="@font/exo_2"
|
||||
android:textColor="@color/color_primary"
|
||||
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
|
||||
app:layout_constraintTop_toBottomOf="@id/season_title"
|
||||
tools:text="2022"
|
||||
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/episode_number"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
|
||||
android:layout_marginStart="25dp"
|
||||
android:layout_marginTop="5dp"
|
||||
android:fontFamily="@font/exo_2"
|
||||
|
||||
android:textColor="@color/color_primary"
|
||||
app:layout_constraintStart_toEndOf="@id/season_year"
|
||||
|
||||
app:layout_constraintTop_toBottomOf="@id/season_title"
|
||||
tools:text="5 EPISODES"
|
||||
|
||||
/>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
|
||||
android:orientation="horizontal"
|
||||
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/season_title">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="25dp"
|
||||
android:layout_height="25dp"
|
||||
android:contentDescription="@string/image"
|
||||
android:src="@drawable/ic_like_filled" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/like_count"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
|
||||
android:layout_marginStart="3dp"
|
||||
android:layout_marginTop="2dp"
|
||||
android:fontFamily="@font/exo_2_semibold"
|
||||
android:textAlignment="center"
|
||||
|
||||
android:textColor="@color/color_primary"
|
||||
|
||||
android:textSize="@dimen/_14ssp"
|
||||
tools:text="10"
|
||||
|
||||
/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/season_description"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
|
||||
android:layout_marginTop="8dp"
|
||||
android:fontFamily="@font/exo_2"
|
||||
android:textColor="@color/color_primary"
|
||||
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/season_year"
|
||||
tools:text="Adventures of a powerful but dimwitted cyborg police inspector named Gadget as he investigates the criminal schemes of Dr. Claw and his organization, M.A.D"
|
||||
|
||||
/>
|
||||
|
||||
<Button
|
||||
android:id="@+id/watch_card"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/round_bg_25"
|
||||
|
||||
android:backgroundTint="#5E1FC4"
|
||||
android:drawableStart="@drawable/ic_play_filled"
|
||||
android:drawablePadding="15dp"
|
||||
|
||||
android:fontFamily="@font/exo_2_extrabold"
|
||||
android:paddingVertical="10dp"
|
||||
|
||||
android:paddingStart="15dp"
|
||||
android:paddingEnd="20dp"
|
||||
|
||||
android:text="@string/watch"
|
||||
|
||||
android:textColor="@color/white"
|
||||
|
||||
android:visibility="visible"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/season_description"
|
||||
|
||||
/>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/rate_season_ll"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
|
||||
android:layout_marginEnd="5dp"
|
||||
android:gravity="center_horizontal"
|
||||
android:orientation="vertical"
|
||||
|
||||
app:layout_constraintBottom_toBottomOf="@id/watch_card"
|
||||
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
|
||||
app:layout_constraintTop_toTopOf="@id/watch_card">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/like_season"
|
||||
android:layout_width="25dp"
|
||||
android:layout_height="25dp"
|
||||
android:contentDescription="@string/image"
|
||||
android:src="@drawable/ic_like_selector" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
|
||||
android:layout_marginTop="5dp"
|
||||
|
||||
android:fontFamily="@font/exo_2"
|
||||
android:text="@string/rate"
|
||||
android:textColor="@color/color_primary" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<View
|
||||
android:id="@+id/divider_1"
|
||||
android:layout_width="0.5dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_marginEnd="15dp"
|
||||
|
||||
android:background="@color/color_primary"
|
||||
|
||||
app:layout_constraintBottom_toBottomOf="@id/watch_card"
|
||||
app:layout_constraintEnd_toStartOf="@id/rate_season_ll"
|
||||
app:layout_constraintTop_toTopOf="@id/watch_card"
|
||||
|
||||
/>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/share_season_ll"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
|
||||
android:layout_marginEnd="10dp"
|
||||
android:gravity="center_horizontal"
|
||||
android:orientation="vertical"
|
||||
|
||||
app:layout_constraintBottom_toBottomOf="@id/watch_card"
|
||||
|
||||
app:layout_constraintEnd_toStartOf="@id/divider_1"
|
||||
|
||||
app:layout_constraintTop_toTopOf="@id/watch_card">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/share_season"
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:contentDescription="@string/image"
|
||||
android:src="@drawable/ic_share" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
|
||||
android:layout_marginTop="5dp"
|
||||
|
||||
android:fontFamily="@font/exo_2"
|
||||
android:text="@string/share"
|
||||
android:textColor="@color/color_primary" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<View
|
||||
android:id="@+id/divider_2"
|
||||
android:layout_width="0.5dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_marginEnd="15dp"
|
||||
|
||||
android:background="@color/color_primary"
|
||||
|
||||
app:layout_constraintBottom_toBottomOf="@id/watch_card"
|
||||
app:layout_constraintEnd_toStartOf="@id/share_season_ll"
|
||||
app:layout_constraintTop_toTopOf="@id/watch_card"
|
||||
|
||||
/>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/fav_season_LL"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
|
||||
android:layout_marginEnd="10dp"
|
||||
android:gravity="center_horizontal"
|
||||
android:orientation="vertical"
|
||||
|
||||
app:layout_constraintBottom_toBottomOf="@id/watch_card"
|
||||
|
||||
app:layout_constraintEnd_toStartOf="@id/divider_2"
|
||||
|
||||
app:layout_constraintTop_toTopOf="@id/watch_card">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/fav_season"
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:contentDescription="@string/image"
|
||||
android:src="@drawable/ic_heart_select" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
|
||||
android:layout_marginTop="3dp"
|
||||
|
||||
android:fontFamily="@font/exo_2"
|
||||
android:text="@string/add"
|
||||
android:textColor="@color/color_primary" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<com.facebook.shimmer.ShimmerFrameLayout
|
||||
android:id="@+id/season_progress_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="15dp"
|
||||
android:visibility="gone"
|
||||
app:shimmer_auto_start="true"
|
||||
app:shimmer_base_alpha="0.6"
|
||||
app:shimmer_highlight_alpha="0.5">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<View
|
||||
android:layout_width="100dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_marginStart="15dp"
|
||||
android:background="@drawable/round_bg_25"
|
||||
|
||||
android:backgroundTint="@color/white_50" />
|
||||
|
||||
<View
|
||||
android:layout_width="100dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_marginStart="15dp"
|
||||
android:background="@drawable/round_bg_25"
|
||||
|
||||
android:backgroundTint="@color/white_50" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</com.facebook.shimmer.ShimmerFrameLayout>
|
||||
|
||||
<com.google.android.material.tabs.TabLayout
|
||||
android:id="@+id/seasons_tab"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="60dp"
|
||||
android:layout_marginStart="5dp"
|
||||
android:layout_marginTop="15dp"
|
||||
app:tabBackground="@drawable/season_tab_bg"
|
||||
app:tabGravity="start"
|
||||
app:tabIndicatorHeight="0dp"
|
||||
app:tabMode="scrollable"
|
||||
app:tabPaddingEnd="25dp"
|
||||
app:tabPaddingStart="25dp"
|
||||
app:tabRippleColor="@android:color/transparent"
|
||||
app:tabSelectedTextColor="@color/white"
|
||||
app:tabTextColor="@color/color_primary" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/season_media_type"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="15dp"
|
||||
|
||||
android:layout_marginTop="15dp"
|
||||
android:fontFamily="@font/exo_2_bold"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/_14ssp"
|
||||
|
||||
android:visibility="gone"
|
||||
tools:text="Episodes" />
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/rv_episodes"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="15dp"
|
||||
android:orientation="vertical"
|
||||
android:visibility="gone"
|
||||
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
|
||||
tools:listitem="@layout/episode_view_holder" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/ep_load_more_btn"
|
||||
android:visibility="gone"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
|
||||
android:text="@string/load_more"
|
||||
android:fontFamily="@font/exo_2_bold"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/_12ssp"
|
||||
|
||||
android:paddingHorizontal="25dp"
|
||||
android:layout_marginVertical="15dp"
|
||||
|
||||
android:background="@drawable/round_25"
|
||||
android:backgroundTint="@color/night_status"
|
||||
|
||||
android:layout_gravity="center_horizontal"
|
||||
|
||||
/>
|
||||
|
||||
<com.facebook.shimmer.ShimmerFrameLayout
|
||||
android:id="@+id/ep_shimmer"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:visibility="gone"
|
||||
app:shimmer_auto_start="true"
|
||||
app:shimmer_base_alpha="0.6"
|
||||
app:shimmer_highlight_alpha="0.5">
|
||||
|
||||
<ScrollView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:scrollbars="none">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<include layout="@layout/episode_view_holder" />
|
||||
|
||||
<include layout="@layout/episode_view_holder" />
|
||||
|
||||
<include layout="@layout/episode_view_holder" />
|
||||
|
||||
<include layout="@layout/episode_view_holder" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</ScrollView>
|
||||
|
||||
</com.facebook.shimmer.ShimmerFrameLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/teaser_txt"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="15dp"
|
||||
|
||||
android:layout_marginTop="10dp"
|
||||
android:fontFamily="@font/exo_2_bold"
|
||||
android:text="@string/teasers"
|
||||
android:textColor="@color/white"
|
||||
|
||||
android:textSize="@dimen/_14ssp"
|
||||
android:visibility="gone" />
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/rv_teaser"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="15dp"
|
||||
android:orientation="vertical"
|
||||
android:visibility="gone"
|
||||
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
|
||||
tools:listitem="@layout/episode_view_holder" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</androidx.core.widget.NestedScrollView>
|
||||
@@ -27,4 +27,5 @@
|
||||
<color name="light_blue_A200">#FF40C4FF</color>
|
||||
<color name="light_blue_A400">#FF00B0FF</color>
|
||||
<color name="black_overlay">#66000000</color>
|
||||
<color name="web_show_bg">#D3EFF8</color>
|
||||
</resources>
|
||||
Reference in New Issue
Block a user