Commit 62375ff9 authored by Nicolas Pomepuy's avatar Nicolas Pomepuy Committed by Geoffrey Métais

Migrate time picker and playback speed to BottomSheetDialog

parent 85907b9d
<?xml version="1.0" encoding="UTF-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/ic_backspace_pressed" android:state_focused="true" android:state_pressed="true" />
<item android:drawable="@drawable/ic_backspace_pressed" android:state_focused="true" />
<item android:drawable="@drawable/ic_backspace_pressed" android:state_pressed="true" />
<item android:drawable="@drawable/ic_backspace" />
</selector>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
<androidx.constraintlayout.widget.ConstraintLayout 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:layout_marginLeft="@dimen/default_margin"
android:layout_marginRight="@dimen/default_margin"
android:orientation="horizontal"
android:padding="@dimen/half_default_margin">
android:orientation="horizontal">
<LinearLayout
<TextView
android:id="@+id/textView12"
style="@style/Theme.VLC.BottomSheetTitle"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:layout_weight="1"
android:gravity="center"
android:orientation="vertical">
android:text="@string/playback_speed"
android:textStyle="bold"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal">
<ImageView
android:id="@+id/playback_speed_icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:focusable="true"
android:src="?attr/ic_speed_normal_style" />
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/half_default_margin"
android:layout_marginRight="@dimen/half_default_margin"
android:layout_weight="1"
android:text="@string/playback_speed"
android:textSize="20sp"
android:textStyle="bold" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="bottom"
android:orientation="horizontal">
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="bottom"
android:paddingLeft="@dimen/default_margin"
android:text="0.25"
android:textSize="12sp" />
<TextView
android:id="@+id/playback_speed_value"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:text="1.00x"
android:textSize="20sp"
android:textStyle="bold" />
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="bottom|right"
android:paddingRight="@dimen/default_margin"
android:text="4.00"
android:textSize="12sp" />
</LinearLayout>
<SeekBar
android:id="@+id/playback_speed_seek"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:focusable="true"
android:indeterminate="false"
android:max="200"
android:maxHeight="@dimen/seekbar_height"
android:minHeight="@dimen/seekbar_height"
android:nextFocusUp="@+id/playback_speed_icon"
android:nextFocusDown="@+id/playback_speed_plus"
android:progress="100"
android:progressDrawable="@drawable/po_seekbar"
android:splitTrack="false"
android:thumb="@drawable/seekbar_thumb" />
</LinearLayout>
<LinearLayout
<TextView
android:id="@+id/textView13"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_weight="1"
android:text="0.25"
android:textSize="12sp"
app:layout_constraintBaseline_toBaselineOf="@id/playback_speed_value"
app:layout_constraintEnd_toStartOf="@+id/playback_speed_value"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintHorizontal_chainStyle="spread_inside"
app:layout_constraintStart_toStartOf="parent" />
<TextView
android:id="@+id/playback_speed_value"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:layout_weight="1"
android:text="1.00x"
android:textAlignment="center"
android:textSize="20sp"
android:textStyle="bold"
app:layout_constraintEnd_toStartOf="@+id/textView14"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toEndOf="@+id/textView13"
app:layout_constraintTop_toBottomOf="@+id/textView12" />
<TextView
android:id="@+id/textView14"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginEnd="16dp"
android:layout_weight="1"
android:gravity="bottom|right"
android:text="4.00"
android:textSize="12sp"
app:layout_constraintBaseline_toBaselineOf="@id/playback_speed_value"
app:layout_constraintEnd_toStartOf="@+id/playback_speed_plus"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toEndOf="@+id/playback_speed_value" />
<SeekBar
android:id="@+id/playback_speed_seek"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="8dp"
android:layout_marginBottom="8dp"
android:focusable="true"
android:indeterminate="false"
android:max="200"
android:maxHeight="@dimen/seekbar_height"
android:minHeight="@dimen/seekbar_height"
android:nextFocusUp="@+id/playback_speed_icon"
android:nextFocusDown="@+id/playback_speed_plus"
android:progress="100"
android:progressDrawable="@drawable/po_seekbar"
android:splitTrack="false"
android:thumb="@drawable/seekbar_thumb"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/playback_speed_minus"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/playback_speed_value" />
<ImageView
android:id="@+id/playback_speed_plus"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:orientation="vertical">
<ImageView
android:id="@+id/playback_speed_plus"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/half_default_margin"
android:clickable="true"
android:focusable="true"
android:nextFocusUp="@+id/playback_speed_seek"
android:nextFocusDown="@+id/playback_speed_minus"
android:src="@drawable/ic_plus_circle" />
<ImageView
android:id="@+id/playback_speed_minus"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:clickable="true"
android:focusable="true"
android:nextFocusUp="@+id/playback_speed_plus"
android:nextFocusDown="@+id/playback_speed_icon"
android:src="@drawable/ic_minus_circle" />
</LinearLayout>
</LinearLayout>
android:layout_marginEnd="8dp"
android:layout_marginBottom="8dp"
android:clickable="true"
android:focusable="true"
android:nextFocusUp="@+id/playback_speed_seek"
android:nextFocusDown="@+id/playback_speed_minus"
android:src="@drawable/ic_plus_circle"
app:layout_constraintBottom_toTopOf="@+id/playback_speed_minus"
app:layout_constraintEnd_toEndOf="parent" />
<ImageView
android:id="@+id/playback_speed_minus"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="8dp"
android:layout_marginBottom="8dp"
android:clickable="true"
android:focusable="true"
android:nextFocusUp="@+id/playback_speed_plus"
android:nextFocusDown="@+id/playback_speed_icon"
android:src="@drawable/ic_minus_circle"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
<?xml version="1.0" encoding="UTF-8"?>
<resources xmlns:android="http://schemas.android.com/apk/res/android">
<style name="Theme.VLC" parent="Theme.VLC.21"/>
<style name="Theme.VLC.Black" parent="Theme.VLC.Black.21"/>
<style name="Theme.VLC.Player" parent="Theme.VLC.Player.21"/>
<!--<style name="Theme.VLC" parent="Theme.VLC.21"/>-->
<!--<style name="Theme.VLC.Black" parent="Theme.VLC.Black.21"/>-->
<!--<style name="Theme.VLC.Player" parent="Theme.VLC.Player.21"/>-->
<style name="Theme.VLC.21" parent="Theme.VLC.7">
<item name="android:popupMenuStyle">@style/PopupMenuStyle.Light</item>
</style>
<style name="Theme.VLC.Black.21" parent="Theme.VLC.Black.7">
<item name="android:popupMenuStyle">@style/PopupMenuStyle</item>
<item name="android:navigationBarColor">?attr/background_actionbar</item>
</style>
<style name="Theme.VLC.Player.21" parent="Theme.VLC.Player.19">
<item name="android:windowTranslucentStatus">false</item>">
<item name="android:windowTranslucentNavigation">false</item>
<item name="android:navigationBarColor">@color/transparent</item>
</style>
<style name="Toolbar.VLC" parent="ThemeOverlay.AppCompat.Dark.ActionBar">
<item name="android:textCursorDrawable">@drawable/cursor_w</item>
</style>
<style name="PopupMenuStyle.Light" parent="@style/Widget.AppCompat.Light.PopupMenu">
<item name="android:overlapAnchor">true</item>
</style>
<style name="PopupMenuStyle" parent="@style/Widget.AppCompat.PopupMenu">
<item name="android:overlapAnchor">true</item>
</style>
<!--<style name="Theme.VLC.21" parent="Theme.VLC.7">-->
<!--<item name="android:popupMenuStyle">@style/PopupMenuStyle.Light</item>-->
<!--</style>-->
<!--<style name="Theme.VLC.Black.21" parent="Theme.VLC.Black.7">-->
<!--<item name="android:popupMenuStyle">@style/PopupMenuStyle</item>-->
<!--<item name="android:navigationBarColor">?attr/background_actionbar</item>-->
<!--</style>-->
<!--<style name="Theme.VLC.Player.21" parent="Theme.VLC.Player.19">-->
<!--<item name="android:windowTranslucentStatus">false</item>">-->
<!--<item name="android:windowTranslucentNavigation">false</item>-->
<!--<item name="android:navigationBarColor">@color/transparent</item>-->
<!--</style>-->
<!--<style name="Toolbar.VLC" parent="ThemeOverlay.AppCompat.Dark.ActionBar">-->
<!--<item name="android:textCursorDrawable">@drawable/cursor_w</item>-->
<!--</style>-->
<!--<style name="PopupMenuStyle.Light" parent="@style/Widget.AppCompat.Light.PopupMenu">-->
<!--<item name="android:overlapAnchor">true</item>-->
<!--</style>-->
<!--<style name="PopupMenuStyle" parent="@style/Widget.AppCompat.PopupMenu">-->
<!--<item name="android:overlapAnchor">true</item>-->
<!--</style>-->
</resources>
......@@ -271,6 +271,9 @@
<item name="windowActionBarOverlay">true</item>
<item name="android:windowLayoutInDisplayCutoutMode" tools:targetApi="p">shortEdges</item>
<item name="bottomSheetDialogTheme">@style/AppBottomSheetDialogTheme</item>
<item name="colorPrimary">@color/orange800</item>
<item name="colorPrimaryDark">@color/transparent</item>
<item name="colorAccent">@color/orange800</item>
......
......@@ -30,9 +30,9 @@ import androidx.fragment.app.FragmentActivity
import androidx.lifecycle.Lifecycle
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import com.google.android.material.bottomsheet.BottomSheetBehavior
import org.videolan.vlc.R
import org.videolan.vlc.databinding.ContextItemBinding
import org.videolan.vlc.gui.helpers.BottomSheetBehavior
import org.videolan.vlc.util.*
const val CTX_TITLE_KEY = "CTX_TITLE_KEY"
......@@ -40,6 +40,9 @@ const val CTX_POSITION_KEY = "CTX_POSITION_KEY"
const val CTX_FLAGS_KEY = "CTX_FLAGS_KEY"
class ContextSheet : VLCBottomSheetDialogFragment() {
override fun getDefaultState(): Int = BottomSheetBehavior.STATE_EXPANDED
override fun needToManageOrientation(): Boolean = false
private lateinit var options : List<CtxOption>
lateinit var receiver : CtxActionReceiver
......@@ -47,7 +50,6 @@ class ContextSheet : VLCBottomSheetDialogFragment() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
defaultState = BottomSheetBehavior.STATE_EXPANDED
itemPosition = arguments?.getInt(CTX_POSITION_KEY) ?: -1
if (!this::receiver.isInitialized) restoreReceiver(savedInstanceState)
}
......
package org.videolan.vlc.gui.dialogs;
import android.app.Dialog;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.DialogFragment;
import androidx.appcompat.app.AppCompatDialog;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.ProgressBar;
import android.widget.TextView;
import org.videolan.vlc.R;
public class DownloaderDialogFragment extends DialogFragment implements View.OnClickListener {
private static final int DOWNLOAD_PROGRESS = 40;
private static final int DOWNLOAD_INDETERMINATE = 41;
public static final String KEY_URL = "url";
public static final String KEY_TITLE = "title";
ProgressBar mProgress;
TextView mText;
Button mCancelButton;
private String mUrl, mtitle;
public DownloaderDialogFragment() {
startDownload();
}
@NonNull
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
return new AppCompatDialog(getActivity(), getTheme());
}
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
Bundle args = getArguments();
mtitle = args.getString(KEY_TITLE);
mUrl = args.getString(KEY_URL);
View view = inflater.inflate(R.layout.dialog_download, container);
mProgress = (ProgressBar) view.findViewById(R.id.download_progress);
mText = (TextView) view.findViewById(R.id.download_text);
mCancelButton = (Button) view.findViewById(R.id.download_cancel);
mCancelButton.setOnClickListener(this);
mText.setText("Downloading " + mtitle);
return view;
}
private void startDownload() {
//TODO
}
Handler mHandler = new Handler() {
@Override
public void handleMessage(Message msg) {
switch (msg.what) {
case DOWNLOAD_PROGRESS:
mProgress.setProgress(msg.arg1);
break;
case DOWNLOAD_INDETERMINATE:
mProgress.setIndeterminate(true);
break;
}
}
};
@Override
public void onClick(View v) {
switch (v.getId()) {
case R.id.download_cancel:
//TODO
}
}
}
......@@ -51,8 +51,5 @@ public class JumpToTimeDialog extends PickTimeFragment {
return R.string.jump_to_time;
}
@Override
protected int getIcon() {
return R.attr.ic_jumpto_normal_style;
}
}
......@@ -26,24 +26,21 @@ import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import org.videolan.vlc.PlaybackService;
import org.videolan.vlc.R;
import org.videolan.vlc.gui.helpers.UiTools;
import org.videolan.vlc.gui.helpers.BottomSheetBehavior;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.lifecycle.Observer;
public abstract class PickTimeFragment extends DismissDialogFragment implements View.OnClickListener, View.OnFocusChangeListener,
public abstract class PickTimeFragment extends VLCBottomSheetDialogFragment implements View.OnClickListener, View.OnFocusChangeListener,
Observer<PlaybackService> {
public final static String TAG = "VLC/PickTimeFragment";
public static final int ACTION_JUMP_TO_TIME = 0;
public static final int ACTION_SLEEP_TIMER = 1;
protected int mTextColor;
......@@ -58,13 +55,28 @@ public abstract class PickTimeFragment extends DismissDialogFragment implements
protected PlaybackService mService;
@Override
public int getDefaultState() {
return BottomSheetBehavior.STATE_EXPANDED;
}
@Override
public boolean needToManageOrientation() {
return true;
}
@Override
public void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.dialog_time_picker, container);
mTVTimeToJump = (TextView) view.findViewById(R.id.tim_pic_timetojump);
((TextView)view.findViewById(R.id.tim_pic_title)).setText(getTitle());
((ImageView) view.findViewById(R.id.tim_pic_icon)).setImageResource(UiTools.getResourceFromAttribute(getActivity(), getIcon()));
view.findViewById(R.id.tim_pic_1).setOnClickListener(this);
view.findViewById(R.id.tim_pic_1).setOnFocusChangeListener(this);
......@@ -90,8 +102,6 @@ public abstract class PickTimeFragment extends DismissDialogFragment implements
view.findViewById(R.id.tim_pic_00).setOnFocusChangeListener(this);
view.findViewById(R.id.tim_pic_30).setOnClickListener(this);
view.findViewById(R.id.tim_pic_30).setOnFocusChangeListener(this);
view.findViewById(R.id.tim_pic_cancel).setOnClickListener(this);
view.findViewById(R.id.tim_pic_cancel).setOnFocusChangeListener(this);
view.findViewById(R.id.tim_pic_delete).setOnClickListener(this);
view.findViewById(R.id.tim_pic_delete).setOnFocusChangeListener(this);
view.findViewById(R.id.tim_pic_ok).setOnClickListener(this);
......@@ -99,25 +109,20 @@ public abstract class PickTimeFragment extends DismissDialogFragment implements
mTextColor = mTVTimeToJump.getCurrentTextColor();
getDialog().setCancelable(true);
getDialog().setCanceledOnTouchOutside(true);
if (getDialog() != null) {
int dialogWidth = getResources().getDimensionPixelSize(R.dimen.dialog_time_picker_width);
int dialogHeight = ViewGroup.LayoutParams.WRAP_CONTENT;
getDialog().getWindow().setLayout(dialogWidth, dialogHeight);
getDialog().getWindow().setBackgroundDrawableResource(UiTools.getResourceFromAttribute(getActivity(), R.attr.rounded_bg));
}
return view;
}
@Override
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
PlaybackService.Companion.getService().observe(this, this);
super.onViewCreated(view, savedInstanceState);
}
@Override
public void onFocusChange(View v, boolean hasFocus) {
((TextView)v).setTextColor(hasFocus ? getResources().getColor(R.color.orange500) : mTextColor);
if (v instanceof TextView) {
((TextView) v).setTextColor(hasFocus ? getResources().getColor(R.color.orange500) : mTextColor);
}
}
@Override
......@@ -159,9 +164,6 @@ public abstract class PickTimeFragment extends DismissDialogFragment implements
case R.id.tim_pic_30:
updateValue("30");
break;
case R.id.tim_pic_cancel:
dismiss();
break;
case R.id.tim_pic_delete:
deleteLastNumber();
break;
......@@ -223,6 +225,5 @@ public abstract class PickTimeFragment extends DismissDialogFragment implements
}
abstract protected int getTitle();
abstract protected int getIcon();
abstract protected void executeAction();
}
......@@ -25,29 +25,26 @@ import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.Window;
import android.view.WindowManager;
import android.widget.ImageView;
import android.widget.SeekBar;
import android.widget.TextView;
import org.videolan.vlc.PlaybackService;
import org.videolan.vlc.R;
import org.videolan.vlc.gui.helpers.BottomSheetBehavior;
import org.videolan.vlc.gui.helpers.OnRepeatListener;
import org.videolan.vlc.gui.helpers.UiTools;
import org.videolan.vlc.util.Strings;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.lifecycle.Observer;
public class PlaybackSpeedDialog extends DismissDialogFragment implements Observer<PlaybackService> {
public class PlaybackSpeedDialog extends VLCBottomSheetDialogFragment implements Observer<PlaybackService> {
public final static String TAG = "VLC/PlaybackSpeedDialog";
private TextView mSpeedValue;
private SeekBar mSeekSpeed;
private ImageView mPlaybackSpeedIcon;
private PlaybackService mService;
private int mTextColor;
......@@ -62,12 +59,10 @@ public class PlaybackSpeedDialog extends DismissDialogFragment implements Observ
View view = inflater.inflate(R.layout.dialog_playback_speed, container);
mSpeedValue = view.findViewById(R.id.playback_speed_value);
mSeekSpeed = view.findViewById(R.id.playback_speed_seek);
mPlaybackSpeedIcon = view.findViewById(R.id.playback_speed_icon);
final ImageView playbackSpeedPlus = view.findViewById(R.id.playback_speed_plus);
final ImageView playbackSpeedMinus = view.findViewById(R.id.playback_speed_minus);
mSeekSpeed.setOnSeekBarChangeListener(mSeekBarListener);
mPlaybackSpeedIcon.setOnClickListener(mResetListener);
playbackSpeedPlus.setOnClickListener(mSpeedUpListener);
playbackSpeedMinus.setOnClickListener(mSpeedDownListener);
mSpeedValue.setOnClickListener(mResetListener);
......@@ -79,14 +74,12 @@ public class PlaybackSpeedDialog extends DismissDialogFragment implements Observ
getDialog().setCancelable(true);
getDialog().setCanceledOnTouchOutside(true);
Window window = getDialog().getWindow();
window.setBackgroundDrawableResource(UiTools.getResourceFromAttribute(getActivity(), R.attr.rounded_bg));
window.setLayout(WindowManager.LayoutParams.WRAP_CONTENT, WindowManager.LayoutParams.WRAP_CONTENT);
return view;
}
@Override
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
PlaybackService.Companion.getService().observe(this, this);
}
......@@ -163,10 +156,8 @@ public class PlaybackSpeedDialog extends DismissDialogFragment implements Observ
float rate = mService.getRate();
mSpeedValue.setText(Strings.formatRateString(rate));
if (rate != 1.0f) {
mPlaybackSpeedIcon.setImageResource(R.drawable.ic_speed_reset);
mSpeedValue.setTextColor(getResources().getColor(R.color.orange500));
} else {
mPlaybackSpeedIcon.setImageResource(UiTools.getResourceFromAttribute(requireContext(), R.attr.ic_speed_normal_style));
mSpeedValue.setTextColor(mTextColor);
}
......@@ -179,4 +170,14 @@ public class PlaybackSpeedDialog extends DismissDialogFragment implements Observ
setRateProgress();
} else mService = null;
}
@Override
public int getDefaultState() {
return BottomSheetBehavior.STATE_EXPANDED;
}
@Override
public boolean needToManageOrientation() {
return true;
}
}
......@@ -34,7 +34,6 @@ import android.widget.EditText
import android.widget.TextView
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import com.google.android.material.bottomsheet.BottomSheetBehavior
import com.google.android.material.textfield.TextInputLayout
import org.videolan.medialibrary.Medialibrary
import org.videolan.medialibrary.Tools
......@@ -44,10 +43,14 @@ import org.videolan.medialibrary.media.Playlist
import org.videolan.vlc.R
import org.videolan.vlc.VLCApplication
import org.videolan.vlc.gui.SimpleAdapter
import org.videolan.vlc.gui.helpers.BottomSheetBehavior
import org.videolan.vlc.util.runIO
import java.util.*
class SavePlaylistDialog : VLCBottomSheetDialogFragment(), View.OnClickListener, TextView.OnEditorActionListener, SimpleAdapter.ClickHandler {
override fun getDefaultState(): Int = BottomSheetBehavior.STATE_EXPANDED
override fun needToManageOrientation(): Boolean = false
private var mEditText: EditText? = null
private lateinit var mListView: RecyclerView
......@@ -61,7 +64,6 @@ class SavePlaylistDialog : VLCBottomSheetDialogFragment(), View.OnClickListener,
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
defaultState = BottomSheetBehavior.STATE_EXPANDED
mMedialibrary = VLCApplication.getMLInstance()
mAdapter = SimpleAdapter(this)
mTracks = try {
......
......@@ -74,9 +74,5 @@ public class SleepTimerDialog extends PickTimeFragment {
return R.string.sleep_in;
}
@Override
protected int getIcon() {
return R.attr.ic_sleep_normal_style;
}
}
\ No newline at end of file