Move channel header to collapsible app bar
This commit is contained in:
parent
193c3e5b3d
commit
e3614cb932
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -433,7 +433,7 @@ public abstract class Tab {
|
||||
|
||||
@Override
|
||||
public ChannelVideosFragment getFragment(final Context context) {
|
||||
return ChannelVideosFragment.getInstance(channelServiceId, channelUrl, channelName);
|
||||
return new ChannelVideosFragment(channelServiceId, channelUrl, channelName);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@ -109,7 +109,11 @@ public final class PicassoHelper {
|
||||
}
|
||||
|
||||
public static RequestCreator loadBanner(final String url) {
|
||||
return loadImageDefault(url, R.drawable.placeholder_channel_banner);
|
||||
if (!shouldLoadImages || isBlank(url)) {
|
||||
return picassoInstance.load((String) null);
|
||||
} else {
|
||||
return picassoInstance.load(url);
|
||||
}
|
||||
}
|
||||
|
||||
public static RequestCreator loadPlaylistThumbnail(final String url) {
|
||||
|
||||
@ -1,131 +0,0 @@
|
||||
<?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:background="?attr/contrast_background_color">
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/channel_metadata"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/channel_banner_image"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="70dp"
|
||||
android:background="@android:color/black"
|
||||
android:fitsSystemWindows="true"
|
||||
android:scaleType="fitCenter"
|
||||
android:src="@drawable/placeholder_channel_banner"
|
||||
tools:ignore="ContentDescription" />
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/avatars_layout"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="8dp"
|
||||
android:layout_marginTop="50dp">
|
||||
|
||||
<com.google.android.material.imageview.ShapeableImageView
|
||||
android:id="@+id/channel_avatar_view"
|
||||
android:layout_width="@dimen/channel_avatar_size"
|
||||
android:layout_height="@dimen/channel_avatar_size"
|
||||
android:padding="1dp"
|
||||
android:src="@drawable/placeholder_person"
|
||||
app:shapeAppearance="@style/CircularImageView"
|
||||
app:strokeColor="#ffffff"
|
||||
app:strokeWidth="2dp" />
|
||||
|
||||
<com.google.android.material.imageview.ShapeableImageView
|
||||
android:id="@+id/sub_channel_avatar_view"
|
||||
android:layout_width="@dimen/sub_channel_avatar_size"
|
||||
android:layout_height="@dimen/sub_channel_avatar_size"
|
||||
android:layout_gravity="bottom|right"
|
||||
android:padding="1dp"
|
||||
android:src="@drawable/placeholder_person"
|
||||
android:visibility="gone"
|
||||
app:shapeAppearance="@style/CircularImageView"
|
||||
app:strokeColor="#ffffff"
|
||||
app:strokeWidth="2dp"
|
||||
tools:ignore="RtlHardcoded"
|
||||
tools:visibility="visible" />
|
||||
</FrameLayout>
|
||||
|
||||
<org.schabi.newpipe.views.NewPipeTextView
|
||||
android:id="@+id/channel_title_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/channel_banner_image"
|
||||
android:layout_marginLeft="8dp"
|
||||
android:layout_marginTop="6dp"
|
||||
android:layout_marginRight="8dp"
|
||||
android:layout_toLeftOf="@id/channel_subscribe_button"
|
||||
android:layout_toRightOf="@id/avatars_layout"
|
||||
android:ellipsize="end"
|
||||
android:lines="1"
|
||||
android:textAppearance="?android:attr/textAppearanceLarge"
|
||||
android:textSize="@dimen/video_item_detail_title_text_size"
|
||||
tools:ignore="RtlHardcoded"
|
||||
tools:text="Lorem ipsum dolor" />
|
||||
|
||||
<org.schabi.newpipe.views.NewPipeTextView
|
||||
android:id="@+id/sub_channel_title_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/channel_title_view"
|
||||
android:layout_alignLeft="@id/channel_title_view"
|
||||
android:layout_alignRight="@id/channel_title_view"
|
||||
android:ellipsize="end"
|
||||
android:gravity="center|left"
|
||||
android:lines="1"
|
||||
android:textAppearance="?android:attr/textAppearanceLarge"
|
||||
android:textSize="12dp"
|
||||
tools:ignore="RtlHardcoded"
|
||||
tools:layout_below="@id/channel_title_view"
|
||||
tools:text="Lorem ipsum dolor" />
|
||||
|
||||
<org.schabi.newpipe.views.NewPipeTextView
|
||||
android:id="@+id/channel_subscriber_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/sub_channel_title_view"
|
||||
android:layout_alignLeft="@id/channel_title_view"
|
||||
android:layout_alignRight="@id/channel_title_view"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="2"
|
||||
android:textSize="@dimen/channel_subscribers_text_size"
|
||||
android:visibility="gone"
|
||||
tools:ignore="RtlHardcoded"
|
||||
tools:text="123,141,411 subscribers"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatButton
|
||||
android:id="@+id/channel_subscribe_button"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@+id/channel_banner_image"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_gravity="center_vertical|right"
|
||||
android:layout_marginRight="2dp"
|
||||
android:text="@string/subscribe_button_title"
|
||||
android:textSize="@dimen/channel_rss_title_size"
|
||||
android:theme="@style/ServiceColoredButton"
|
||||
android:visibility="gone"
|
||||
tools:ignore="RtlHardcoded"
|
||||
tools:visibility="visible" />
|
||||
</RelativeLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/channel_metadata">
|
||||
|
||||
<include
|
||||
android:id="@+id/playlist_control"
|
||||
layout="@layout/playlist_control" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</RelativeLayout>
|
||||
@ -1,75 +1,207 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<androidx.coordinatorlayout.widget.CoordinatorLayout 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="match_parent">
|
||||
|
||||
<com.google.android.material.tabs.TabLayout
|
||||
android:id="@+id/tab_layout"
|
||||
<com.google.android.material.appbar.AppBarLayout
|
||||
android:id="@+id/app_bar_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?attr/colorPrimary"
|
||||
app:tabIndicatorColor="@color/white"
|
||||
app:tabMode="scrollable"
|
||||
app:tabRippleColor="@color/white"
|
||||
app:tabTextColor="@color/white" />
|
||||
app:elevation="0dp">
|
||||
|
||||
<androidx.viewpager.widget.ViewPager
|
||||
android:id="@+id/view_pager"
|
||||
<org.schabi.newpipe.views.CustomCollapsingToolbarLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:fitsSystemWindows="true"
|
||||
app:layout_scrollFlags="scroll|exitUntilCollapsed">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/channel_metadata"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:fitsSystemWindows="true"
|
||||
android:scaleType="centerCrop"
|
||||
app:layout_collapseMode="parallax">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/channel_banner_image"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:adjustViewBounds="true"
|
||||
android:scaleType="centerCrop"
|
||||
tools:src="@drawable/placeholder_channel_banner"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:ignore="ContentDescription" />
|
||||
|
||||
<com.google.android.material.imageview.ShapeableImageView
|
||||
android:id="@+id/channel_avatar_view"
|
||||
android:layout_width="@dimen/channel_avatar_size"
|
||||
android:layout_height="@dimen/channel_avatar_size"
|
||||
android:layout_marginVertical="8dp"
|
||||
android:layout_marginStart="8dp"
|
||||
android:padding="1dp"
|
||||
android:src="@drawable/placeholder_person"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintVertical_bias="1.0"
|
||||
app:shapeAppearance="@style/CircularImageView"
|
||||
app:strokeColor="#ffffff"
|
||||
app:strokeWidth="2dp" />
|
||||
|
||||
<com.google.android.material.imageview.ShapeableImageView
|
||||
android:id="@+id/sub_channel_avatar_view"
|
||||
android:layout_width="@dimen/sub_channel_avatar_size"
|
||||
android:layout_height="@dimen/sub_channel_avatar_size"
|
||||
android:padding="1dp"
|
||||
android:src="@drawable/placeholder_person"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toBottomOf="@id/channel_avatar_view"
|
||||
app:layout_constraintEnd_toEndOf="@id/channel_avatar_view"
|
||||
app:shapeAppearance="@style/CircularImageView"
|
||||
app:strokeColor="#ffffff"
|
||||
app:strokeWidth="2dp"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<org.schabi.newpipe.views.NewPipeTextView
|
||||
android:id="@+id/channel_title_view"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginEnd="4dp"
|
||||
android:ellipsize="end"
|
||||
android:lines="1"
|
||||
android:textAppearance="?android:attr/textAppearanceLarge"
|
||||
android:textSize="16sp"
|
||||
app:layout_constraintBottom_toTopOf="@+id/sub_channel_title_view"
|
||||
app:layout_constraintEnd_toStartOf="@+id/channel_subscribe_button"
|
||||
app:layout_constraintStart_toEndOf="@+id/channel_avatar_view"
|
||||
app:layout_constraintTop_toBottomOf="@+id/channel_banner_image"
|
||||
tools:text="@tools:sample/lorem[10]" />
|
||||
|
||||
<org.schabi.newpipe.views.NewPipeTextView
|
||||
android:id="@+id/sub_channel_title_view"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_marginEnd="4dp"
|
||||
android:ellipsize="end"
|
||||
android:lines="1"
|
||||
android:textAppearance="?android:attr/textAppearanceLarge"
|
||||
android:textSize="14sp"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toTopOf="@+id/channel_subscriber_view"
|
||||
app:layout_constraintEnd_toStartOf="@+id/channel_subscribe_button"
|
||||
app:layout_constraintStart_toEndOf="@+id/channel_avatar_view"
|
||||
app:layout_constraintTop_toBottomOf="@+id/channel_title_view"
|
||||
tools:text="@tools:sample/lorem[10]"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<org.schabi.newpipe.views.NewPipeTextView
|
||||
android:id="@+id/channel_subscriber_view"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_marginTop="2dp"
|
||||
android:layout_marginEnd="4dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:textSize="12sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@+id/channel_subscribe_button"
|
||||
app:layout_constraintStart_toEndOf="@+id/channel_avatar_view"
|
||||
app:layout_constraintTop_toBottomOf="@+id/sub_channel_title_view"
|
||||
tools:text="123,141,411 subscribers" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatButton
|
||||
android:id="@+id/channel_subscribe_button"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/subscribe_button_title"
|
||||
android:textSize="@dimen/channel_rss_title_size"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/channel_banner_image" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</org.schabi.newpipe.views.CustomCollapsingToolbarLayout>
|
||||
</com.google.android.material.appbar.AppBarLayout>
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_below="@id/tab_layout" />
|
||||
|
||||
<ProgressBar
|
||||
android:id="@+id/loading_progress_bar"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerInParent="true"
|
||||
android:indeterminate="true"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/empty_state_view"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerInParent="true"
|
||||
android:layout_below="@id/app_bar_layout"
|
||||
android:orientation="vertical"
|
||||
android:paddingTop="90dp"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible">
|
||||
app:layout_behavior="@string/appbar_scrolling_view_behavior">
|
||||
|
||||
<org.schabi.newpipe.views.NewPipeTextView
|
||||
android:id="@+id/channel_kaomoji"
|
||||
<com.google.android.material.tabs.TabLayout
|
||||
android:id="@+id/tab_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?attr/colorPrimary"
|
||||
app:tabGravity="fill"
|
||||
app:tabIndicatorColor="@color/white"
|
||||
app:tabMode="scrollable"
|
||||
app:tabRippleColor="@color/white"
|
||||
app:tabTextColor="@color/white" />
|
||||
|
||||
<androidx.viewpager.widget.ViewPager
|
||||
android:id="@+id/view_pager"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_below="@id/tab_layout" />
|
||||
|
||||
<ProgressBar
|
||||
android:id="@+id/loading_progress_bar"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginBottom="10dp"
|
||||
android:fontFamily="monospace"
|
||||
android:text="(︶︹︺)"
|
||||
android:textSize="35sp"
|
||||
tools:ignore="HardcodedText,UnusedAttribute" />
|
||||
android:layout_centerInParent="true"
|
||||
android:indeterminate="true"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<org.schabi.newpipe.views.NewPipeTextView
|
||||
android:id="@+id/error_content_not_supported"
|
||||
<LinearLayout
|
||||
android:id="@+id/empty_state_view"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="20dp"
|
||||
android:text="@string/content_not_supported"
|
||||
android:textSize="15sp"
|
||||
android:visibility="gone" />
|
||||
android:layout_centerInParent="true"
|
||||
android:orientation="vertical"
|
||||
android:paddingTop="90dp"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible">
|
||||
|
||||
</LinearLayout>
|
||||
<org.schabi.newpipe.views.NewPipeTextView
|
||||
android:id="@+id/channel_kaomoji"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginBottom="10dp"
|
||||
android:fontFamily="monospace"
|
||||
android:text="(︶︹︺)"
|
||||
android:textSize="35sp"
|
||||
tools:ignore="HardcodedText" />
|
||||
|
||||
<!--ERROR PANEL-->
|
||||
<include
|
||||
android:id="@+id/error_panel"
|
||||
layout="@layout/error_panel"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerInParent="true"
|
||||
android:layout_marginTop="50dp"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible" />
|
||||
</RelativeLayout>
|
||||
<org.schabi.newpipe.views.NewPipeTextView
|
||||
android:id="@+id/error_content_not_supported"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="20dp"
|
||||
android:text="@string/content_not_supported"
|
||||
android:textSize="15sp"
|
||||
android:visibility="gone" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<!--ERROR PANEL-->
|
||||
<include
|
||||
android:id="@+id/error_panel"
|
||||
layout="@layout/error_panel"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerInParent="true"
|
||||
android:layout_marginTop="50dp"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible" />
|
||||
</RelativeLayout>
|
||||
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
||||
@ -32,7 +32,6 @@
|
||||
<dimen name="video_item_detail_sub_channel_text_size">16sp</dimen>
|
||||
<dimen name="video_item_detail_upload_date_text_size">14sp</dimen>
|
||||
<dimen name="video_item_detail_description_text_size">14sp</dimen>
|
||||
<dimen name="channel_subscribers_text_size">14sp</dimen>
|
||||
<dimen name="channel_rss_title_size">14sp</dimen>
|
||||
<!-- Elements Size -->
|
||||
<dimen name="video_item_detail_uploader_image_size">42dp</dimen>
|
||||
|
||||
@ -75,7 +75,6 @@
|
||||
<dimen name="video_item_detail_sub_channel_text_size">14sp</dimen>
|
||||
<dimen name="video_item_detail_upload_date_text_size">13sp</dimen>
|
||||
<dimen name="video_item_detail_description_text_size">13sp</dimen>
|
||||
<dimen name="channel_subscribers_text_size">12sp</dimen>
|
||||
<dimen name="channel_rss_title_size">12sp</dimen>
|
||||
<!-- Elements Size -->
|
||||
<dimen name="video_item_detail_uploader_image_size">32dp</dimen>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user