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

View File

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

View File

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