-Increased save join debounce time to 2 seconds.

-Added add to playlist option for videos available as base list items.
-Moved video count to second row on local playlist header.
-Removed bottom line on playlist control UI.
This commit is contained in:
John Zhen Mo 2018-01-30 18:17:27 -08:00
parent 1ff8b5fb9f
commit 53a1833e26
4 changed files with 100 additions and 109 deletions

View File

@ -29,6 +29,7 @@ import org.schabi.newpipe.util.OnClickGesture;
import org.schabi.newpipe.util.StateSaver;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Queue;
@ -194,12 +195,11 @@ public abstract class BaseListFragment<I, N> extends BaseStateFragment<I> implem
final String[] commands = new String[]{
context.getResources().getString(R.string.enqueue_on_background),
context.getResources().getString(R.string.enqueue_on_popup)
context.getResources().getString(R.string.enqueue_on_popup),
context.getResources().getString(R.string.append_playlist)
};
final DialogInterface.OnClickListener actions = new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
final DialogInterface.OnClickListener actions = (dialogInterface, i) -> {
switch (i) {
case 0:
NavigationHelper.enqueueOnBackgroundPlayer(context, new SinglePlayQueue(item));
@ -207,10 +207,15 @@ public abstract class BaseListFragment<I, N> extends BaseStateFragment<I> implem
case 1:
NavigationHelper.enqueueOnPopupPlayer(activity, new SinglePlayQueue(item));
break;
case 2:
if (getFragmentManager() != null) {
PlaylistAppendDialog.fromStreamInfoItems(Collections.singletonList(item))
.show(getFragmentManager(), TAG);
}
break;
default:
break;
}
}
};
new InfoItemDialog(getActivity(), item, commands, actions).show();

View File

@ -47,7 +47,7 @@ import static org.schabi.newpipe.util.AnimationUtils.animateView;
public class LocalPlaylistFragment extends BaseLocalListFragment<List<PlaylistStreamEntry>, Void> {
private static final long SAVE_DEBOUNCE_MILLIS = 1000;
private static final long SAVE_DEBOUNCE_MILLIS = 2000;
private View headerRootLayout;
private TextView headerTitleView;

View File

@ -5,20 +5,17 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="6dp"
android:background="?attr/contrast_background_color">
<TextView
android:id="@+id/playlist_title_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="6dp"
android:paddingBottom="6dp"
android:paddingLeft="12dp"
android:paddingRight="12dp"
android:padding="6dp"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_toLeftOf="@id/playlist_stream_count"
android:layout_toStartOf="@id/playlist_stream_count"
android:layout_alignParentTop="true"
android:background="?attr/selectableItemBackground"
android:clickable="true"
android:focusable="true"
@ -35,9 +32,11 @@
android:id="@+id/playlist_stream_count"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="@id/playlist_title_view"
android:layout_alignParentRight="true"
android:padding="6dp"
android:layout_below="@id/playlist_title_view"
android:layout_alignParentLeft="true"
android:paddingLeft="6dp"
android:paddingRight="6dp"
android:paddingBottom="6dp"
android:ellipsize="end"
android:gravity="right|center_vertical"
android:maxLines="1"

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
xmlns:tools="http://schemas.android.com/tools"
@ -9,14 +9,10 @@
android:visibility="invisible"
tools:visibility="visible">
<LinearLayout
android:id="@+id/playlist_panel"
android:layout_width="match_parent"
android:layout_height="@dimen/playlist_ctrl_height">
<LinearLayout
android:id="@+id/playlist_ctrl_play_bg_button"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_height="@dimen/playlist_ctrl_height"
android:layout_weight="1"
android:gravity="center"
android:clickable="true"
@ -88,13 +84,4 @@
android:drawableLeft="?attr/popup"
android:drawableStart="?attr/popup"/>
</LinearLayout>
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_below="@+id/playlist_panel"
android:layout_marginLeft="8dp"
android:layout_marginRight="8dp"
android:background="?attr/separator_color"/>
</RelativeLayout>
</LinearLayout>