Skip to content

Commit f933db8

Browse files
committed
Added a custom title
to also save some margin/padding/etc
1 parent cddb9bc commit f933db8

2 files changed

Lines changed: 26 additions & 4 deletions

File tree

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

Lines changed: 8 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,11 @@ 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)
160+
.setCustomTitle(
161+
View.inflate(
162+
getContext(),
163+
R.layout.dialog_playback_parameter_title,
164+
null))
161165
.setView(view)
162166
.setCancelable(true)
163167
.setNegativeButton(R.string.cancel, (dialogInterface, i) ->
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!-- Title for the dialog of the playback parameters -->
3+
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
4+
android:layout_width="match_parent"
5+
android:layout_height="wrap_content"
6+
android:gravity="center"
7+
android:orientation="vertical">
8+
9+
<org.schabi.newpipe.views.NewPipeTextView
10+
android:layout_width="wrap_content"
11+
android:layout_height="wrap_content"
12+
android:paddingTop="4dp"
13+
android:text="@string/playback_speed_control"
14+
android:textColor="?attr/colorAccent"
15+
android:textSize="18sp"
16+
android:textStyle="bold" />
17+
18+
</LinearLayout>

0 commit comments

Comments
 (0)