From cddb9bccb93f69ed61bd738164b14b1cd14ce287 Mon Sep 17 00:00:00 2001 From: litetex <40789489+litetex@users.noreply.github.com> Date: Thu, 4 Nov 2021 19:46:22 +0100 Subject: [PATCH 1/3] Reworked ``dialog_playback_parameter`` * Removed dependency to @dimen/video_item_search_padding as it's unrelated * Made the margins/paddings a bit smaller * Put the checkboxes inside a layout * Removed some useless attributes (maxLine) --- .../res/layout/dialog_playback_parameter.xml | 71 +++++++++++-------- 1 file changed, 41 insertions(+), 30 deletions(-) diff --git a/app/src/main/res/layout/dialog_playback_parameter.xml b/app/src/main/res/layout/dialog_playback_parameter.xml index 546602d0c06..40db9067513 100644 --- a/app/src/main/res/layout/dialog_playback_parameter.xml +++ b/app/src/main/res/layout/dialog_playback_parameter.xml @@ -4,9 +4,9 @@ android:layout_width="match_parent" android:layout_height="match_parent" android:clickable="false" - android:paddingLeft="@dimen/video_item_search_padding" - android:paddingTop="@dimen/video_item_search_padding" - android:paddingRight="@dimen/video_item_search_padding"> + android:paddingStart="6dp" + android:paddingTop="4dp" + android:paddingEnd="6dp"> @@ -344,32 +350,37 @@ android:layout_width="match_parent" android:layout_height="1dp" android:layout_below="@+id/stepSizeSelector" - android:layout_margin="@dimen/video_item_search_padding" + android:layout_marginStart="12dp" + android:layout_marginTop="6dp" + android:layout_marginEnd="12dp" + android:layout_marginBottom="6dp" android:background="?attr/separator_color" /> - - - + android:orientation="vertical"> + + + + + From f933db811711a29b7e3e61e60a33b01d799faccb Mon Sep 17 00:00:00 2001 From: litetex <40789489+litetex@users.noreply.github.com> Date: Thu, 4 Nov 2021 19:47:08 +0100 Subject: [PATCH 2/3] Added a custom title to also save some margin/padding/etc --- .../player/helper/PlaybackParameterDialog.java | 12 ++++++++---- .../layout/dialog_playback_parameter_title.xml | 18 ++++++++++++++++++ 2 files changed, 26 insertions(+), 4 deletions(-) create mode 100644 app/src/main/res/layout/dialog_playback_parameter_title.xml diff --git a/app/src/main/java/org/schabi/newpipe/player/helper/PlaybackParameterDialog.java b/app/src/main/java/org/schabi/newpipe/player/helper/PlaybackParameterDialog.java index bbe28192133..1d1e0d23a47 100644 --- a/app/src/main/java/org/schabi/newpipe/player/helper/PlaybackParameterDialog.java +++ b/app/src/main/java/org/schabi/newpipe/player/helper/PlaybackParameterDialog.java @@ -1,5 +1,8 @@ package org.schabi.newpipe.player.helper; +import static org.schabi.newpipe.player.Player.DEBUG; +import static org.schabi.newpipe.util.Localization.assureCorrectAppLanguage; + import android.app.Dialog; import android.content.Context; import android.os.Bundle; @@ -18,9 +21,6 @@ import org.schabi.newpipe.R; import org.schabi.newpipe.util.SliderStrategy; -import static org.schabi.newpipe.player.Player.DEBUG; -import static org.schabi.newpipe.util.Localization.assureCorrectAppLanguage; - public class PlaybackParameterDialog extends DialogFragment { // Minimum allowable range in ExoPlayer private static final double MINIMUM_PLAYBACK_VALUE = 0.10f; @@ -157,7 +157,11 @@ public Dialog onCreateDialog(@Nullable final Bundle savedInstanceState) { setupControlViews(view); final AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(requireActivity()) - .setTitle(R.string.playback_speed_control) + .setCustomTitle( + View.inflate( + getContext(), + R.layout.dialog_playback_parameter_title, + null)) .setView(view) .setCancelable(true) .setNegativeButton(R.string.cancel, (dialogInterface, i) -> diff --git a/app/src/main/res/layout/dialog_playback_parameter_title.xml b/app/src/main/res/layout/dialog_playback_parameter_title.xml new file mode 100644 index 00000000000..0bebf67d1d9 --- /dev/null +++ b/app/src/main/res/layout/dialog_playback_parameter_title.xml @@ -0,0 +1,18 @@ + + + + + + + From 62efb588efd056b0414cca7c191a7b48ee155281 Mon Sep 17 00:00:00 2001 From: litetex <40789489+litetex@users.noreply.github.com> Date: Sun, 7 Nov 2021 13:51:43 +0100 Subject: [PATCH 3/3] Removed obvious title from the "Playback Speed Controls" --- .../player/helper/PlaybackParameterDialog.java | 5 ----- .../layout/dialog_playback_parameter_title.xml | 18 ------------------ 2 files changed, 23 deletions(-) delete mode 100644 app/src/main/res/layout/dialog_playback_parameter_title.xml diff --git a/app/src/main/java/org/schabi/newpipe/player/helper/PlaybackParameterDialog.java b/app/src/main/java/org/schabi/newpipe/player/helper/PlaybackParameterDialog.java index 1d1e0d23a47..5139ef9cd60 100644 --- a/app/src/main/java/org/schabi/newpipe/player/helper/PlaybackParameterDialog.java +++ b/app/src/main/java/org/schabi/newpipe/player/helper/PlaybackParameterDialog.java @@ -157,11 +157,6 @@ public Dialog onCreateDialog(@Nullable final Bundle savedInstanceState) { setupControlViews(view); final AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(requireActivity()) - .setCustomTitle( - View.inflate( - getContext(), - R.layout.dialog_playback_parameter_title, - null)) .setView(view) .setCancelable(true) .setNegativeButton(R.string.cancel, (dialogInterface, i) -> diff --git a/app/src/main/res/layout/dialog_playback_parameter_title.xml b/app/src/main/res/layout/dialog_playback_parameter_title.xml deleted file mode 100644 index 0bebf67d1d9..00000000000 --- a/app/src/main/res/layout/dialog_playback_parameter_title.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - -