From 013d51345073034a42381709bd4772f0c7110fa5 Mon Sep 17 00:00:00 2001 From: Stypox Date: Fri, 21 Apr 2023 15:42:23 +0200 Subject: [PATCH] Add space above channel description (About tab) --- .../fragments/detail/BaseDescriptionFragment.java | 2 +- .../fragments/list/channel/ChannelAboutFragment.java | 9 +++++++++ app/src/main/res/layout/fragment_description.xml | 1 + 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/org/schabi/newpipe/fragments/detail/BaseDescriptionFragment.java b/app/src/main/java/org/schabi/newpipe/fragments/detail/BaseDescriptionFragment.java index fbbfdf23f..47f8598af 100644 --- a/app/src/main/java/org/schabi/newpipe/fragments/detail/BaseDescriptionFragment.java +++ b/app/src/main/java/org/schabi/newpipe/fragments/detail/BaseDescriptionFragment.java @@ -35,7 +35,7 @@ import io.reactivex.rxjava3.disposables.CompositeDisposable; public abstract class BaseDescriptionFragment extends BaseFragment { final CompositeDisposable descriptionDisposables = new CompositeDisposable(); - FragmentDescriptionBinding binding; + protected FragmentDescriptionBinding binding; @Override public View onCreateView(@NonNull final LayoutInflater inflater, diff --git a/app/src/main/java/org/schabi/newpipe/fragments/list/channel/ChannelAboutFragment.java b/app/src/main/java/org/schabi/newpipe/fragments/list/channel/ChannelAboutFragment.java index ae04e8b00..271be3939 100644 --- a/app/src/main/java/org/schabi/newpipe/fragments/list/channel/ChannelAboutFragment.java +++ b/app/src/main/java/org/schabi/newpipe/fragments/list/channel/ChannelAboutFragment.java @@ -3,7 +3,9 @@ package org.schabi.newpipe.fragments.list.channel; import static org.schabi.newpipe.extractor.stream.StreamExtractor.UNKNOWN_SUBSCRIBER_COUNT; import android.content.Context; +import android.os.Bundle; import android.view.LayoutInflater; +import android.view.View; import android.widget.LinearLayout; import androidx.annotation.Nullable; @@ -13,6 +15,7 @@ import org.schabi.newpipe.extractor.StreamingService; import org.schabi.newpipe.extractor.channel.ChannelInfo; import org.schabi.newpipe.extractor.stream.Description; import org.schabi.newpipe.fragments.detail.BaseDescriptionFragment; +import org.schabi.newpipe.util.DeviceUtils; import org.schabi.newpipe.util.Localization; import java.util.List; @@ -33,6 +36,12 @@ public class ChannelAboutFragment extends BaseDescriptionFragment { super(); } + @Override + protected void initViews(final View rootView, final Bundle savedInstanceState) { + super.initViews(rootView, savedInstanceState); + binding.constraintLayout.setPadding(0, DeviceUtils.dpToPx(8, requireContext()), 0, 0); + } + @Nullable @Override protected Description getDescription() { diff --git a/app/src/main/res/layout/fragment_description.xml b/app/src/main/res/layout/fragment_description.xml index 157b8f394..b20905d4a 100644 --- a/app/src/main/res/layout/fragment_description.xml +++ b/app/src/main/res/layout/fragment_description.xml @@ -8,6 +8,7 @@ android:scrollbars="vertical">