Skip to content

Commit 344fbff

Browse files
authored
Merge pull request #7363 from litetex/playback-speed-ctrls-simple-landscape-improvements
Simple playback-speed-controls improvements
2 parents e39a816 + 62efb58 commit 344fbff

2 files changed

Lines changed: 44 additions & 34 deletions

File tree

app/src/main/java/org/schabi/newpipe/player/helper/PlaybackParameterDialog.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
package org.schabi.newpipe.player.helper;
22

3+
import static org.schabi.newpipe.player.Player.DEBUG;
4+
import static org.schabi.newpipe.util.Localization.assureCorrectAppLanguage;
5+
36
import android.app.Dialog;
47
import android.content.Context;
58
import android.os.Bundle;
@@ -18,9 +21,6 @@
1821
import org.schabi.newpipe.R;
1922
import org.schabi.newpipe.util.SliderStrategy;
2023

21-
import static org.schabi.newpipe.player.Player.DEBUG;
22-
import static org.schabi.newpipe.util.Localization.assureCorrectAppLanguage;
23-
2424
public class PlaybackParameterDialog extends DialogFragment {
2525
// Minimum allowable range in ExoPlayer
2626
private static final double MINIMUM_PLAYBACK_VALUE = 0.10f;
@@ -157,7 +157,6 @@ public Dialog onCreateDialog(@Nullable final Bundle savedInstanceState) {
157157
setupControlViews(view);
158158

159159
final AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(requireActivity())
160-
.setTitle(R.string.playback_speed_control)
161160
.setView(view)
162161
.setCancelable(true)
163162
.setNegativeButton(R.string.cancel, (dialogInterface, i) ->

app/src/main/res/layout/dialog_playback_parameter.xml

Lines changed: 41 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
android:layout_width="match_parent"
55
android:layout_height="match_parent"
66
android:clickable="false"
7-
android:paddingLeft="@dimen/video_item_search_padding"
8-
android:paddingTop="@dimen/video_item_search_padding"
9-
android:paddingRight="@dimen/video_item_search_padding">
7+
android:paddingStart="6dp"
8+
android:paddingTop="4dp"
9+
android:paddingEnd="6dp">
1010

1111
<RelativeLayout
1212
android:layout_width="match_parent"
@@ -31,7 +31,7 @@
3131
android:layout_width="match_parent"
3232
android:layout_height="40dp"
3333
android:layout_below="@id/tempoControlText"
34-
android:layout_marginTop="4dp"
34+
android:layout_marginTop="3dp"
3535
android:orientation="horizontal">
3636

3737
<org.schabi.newpipe.views.NewPipeTextView
@@ -137,7 +137,10 @@
137137
android:layout_width="match_parent"
138138
android:layout_height="1dp"
139139
android:layout_below="@id/tempoControl"
140-
android:layout_margin="@dimen/video_item_search_padding"
140+
android:layout_marginStart="12dp"
141+
android:layout_marginTop="6dp"
142+
android:layout_marginEnd="6dp"
143+
android:layout_marginBottom="6dp"
141144
android:background="?attr/separator_color" />
142145

143146
<org.schabi.newpipe.views.NewPipeTextView
@@ -156,7 +159,7 @@
156159
android:layout_width="match_parent"
157160
android:layout_height="40dp"
158161
android:layout_below="@id/pitchControlText"
159-
android:layout_marginTop="4dp"
162+
android:layout_marginTop="3dp"
160163
android:orientation="horizontal">
161164

162165
<org.schabi.newpipe.views.NewPipeTextView
@@ -263,13 +266,16 @@
263266
android:layout_width="match_parent"
264267
android:layout_height="1dp"
265268
android:layout_below="@+id/pitchControl"
266-
android:layout_margin="@dimen/video_item_search_padding"
269+
android:layout_marginStart="12dp"
270+
android:layout_marginTop="6dp"
271+
android:layout_marginEnd="12dp"
272+
android:layout_marginBottom="6dp"
267273
android:background="?attr/separator_color" />
268274

269275
<LinearLayout
270276
android:id="@+id/stepSizeSelector"
271277
android:layout_width="match_parent"
272-
android:layout_height="40dp"
278+
android:layout_height="32dp"
273279
android:layout_below="@id/separatorStepSizeSelector"
274280
android:orientation="horizontal">
275281

@@ -344,32 +350,37 @@
344350
android:layout_width="match_parent"
345351
android:layout_height="1dp"
346352
android:layout_below="@+id/stepSizeSelector"
347-
android:layout_margin="@dimen/video_item_search_padding"
353+
android:layout_marginStart="12dp"
354+
android:layout_marginTop="6dp"
355+
android:layout_marginEnd="12dp"
356+
android:layout_marginBottom="6dp"
348357
android:background="?attr/separator_color" />
349358

350-
<CheckBox
351-
android:id="@+id/unhookCheckbox"
359+
<LinearLayout
360+
android:id="@+id/additionalOptions"
352361
android:layout_width="match_parent"
353-
android:layout_height="wrap_content"
362+
android:layout_height="match_parent"
354363
android:layout_below="@id/separatorCheckbox"
355-
android:layout_centerHorizontal="true"
356-
android:checked="false"
357-
android:clickable="true"
358-
android:focusable="true"
359-
android:maxLines="1"
360-
android:text="@string/unhook_checkbox" />
361-
362-
<CheckBox
363-
android:id="@+id/skipSilenceCheckbox"
364-
android:layout_width="match_parent"
365-
android:layout_height="wrap_content"
366-
android:layout_below="@id/unhookCheckbox"
367-
android:layout_centerHorizontal="true"
368-
android:checked="false"
369-
android:clickable="true"
370-
android:focusable="true"
371-
android:maxLines="1"
372-
android:text="@string/skip_silence_checkbox" />
364+
android:orientation="vertical">
365+
366+
<CheckBox
367+
android:id="@+id/unhookCheckbox"
368+
android:layout_width="match_parent"
369+
android:layout_height="wrap_content"
370+
android:checked="false"
371+
android:clickable="true"
372+
android:focusable="true"
373+
android:text="@string/unhook_checkbox" />
374+
375+
<CheckBox
376+
android:id="@+id/skipSilenceCheckbox"
377+
android:layout_width="match_parent"
378+
android:layout_height="wrap_content"
379+
android:checked="false"
380+
android:clickable="true"
381+
android:focusable="true"
382+
android:text="@string/skip_silence_checkbox" />
383+
</LinearLayout>
373384

374385
<!-- END HERE -->
375386

0 commit comments

Comments
 (0)