Better TV support, icons, activity_main refactoring

- on Android TV you'll be able to navigate with D-pad in main fragment and in the player. But not between them for now
- play/pause/next/previous buttons are smaller now
- replaced ic_list with previous version of it
- activity_main looks better which helps with Android TV support
This commit is contained in:
Avently 2020-07-22 01:20:30 +03:00
parent 77cd3182f1
commit 3ecbbea7cb
10 changed files with 53 additions and 74 deletions

View file

@ -1,8 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="43.2dp"
android:width="24dp"
android:height="24dp"
android:viewportWidth="18"
android:viewportHeight="10">
<path android:fillColor="#000000"
android:pathData="M0,6L2,6L2,4L0,4L0,6L0,6ZM0,10L2,10L2,8L0,8L0,10L0,10ZM0,2L2,2L2,0L0,0L0,2L0,2ZM4,6L18,6L18,4L4,4L4,6L4,6ZM4,10L18,10L18,8L4,8L4,10L4,10ZM4,0L4,2L18,2L18,0L4,0L4,0Z"/>
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="#FF000000"
android:pathData="M3,13h2v-2L3,11v2zM3,17h2v-2L3,15v2zM3,9h2L5,7L3,7v2zM7,13h14v-2L7,11v2zM7,17h14v-2L7,15v2zM7,7v2h14L21,7L7,7z"/>
</vector>

View file

@ -1,9 +1,5 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="43.2dp"
android:height="24dp"
android:viewportWidth="18"
android:viewportHeight="10">
<path
android:fillColor="#ffffff"
android:pathData="M0,6L2,6L2,4L0,4L0,6L0,6ZM0,10L2,10L2,8L0,8L0,10L0,10ZM0,2L2,2L2,0L0,0L0,2L0,2ZM4,6L18,6L18,4L4,4L4,6L4,6ZM4,10L18,10L18,8L4,8L4,10L4,10ZM4,0L4,2L18,2L18,0L4,0L4,0Z"/>
<vector android:height="24dp" android:tint="#FFFFFF"
android:viewportHeight="24.0" android:viewportWidth="24.0"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#FF000000" android:pathData="M3,13h2v-2L3,11v2zM3,17h2v-2L3,15v2zM3,9h2L5,7L3,7v2zM7,13h14v-2L7,11v2zM7,17h14v-2L7,15v2zM7,7v2h14L21,7L7,7z"/>
</vector>

View file

@ -247,9 +247,12 @@
<androidx.appcompat.widget.AppCompatImageButton
android:id="@+id/queueButton"
android:layout_width="40dp"
android:layout_width="35dp"
android:layout_height="35dp"
android:padding="10dp"
android:paddingTop="5dp"
android:paddingStart="3dp"
android:paddingEnd="3dp"
android:paddingBottom="3dp"
android:layout_marginEnd="8dp"
android:clickable="true"
android:focusable="true"
@ -477,14 +480,13 @@
android:gravity="center"
android:orientation="horizontal"
android:weightSum="5.5">
<!--tools:visibility="gone">-->
<androidx.appcompat.widget.AppCompatImageButton
android:id="@+id/playPreviousButton"
android:layout_width="0dp"
android:layout_height="100dp"
android:layout_height="50dp"
android:layout_weight="1"
android:layout_marginEnd="30dp"
android:layout_marginEnd="10dp"
android:clickable="true"
android:focusable="true"
android:background="?attr/selectableItemBackgroundBorderless"
@ -496,7 +498,7 @@
<androidx.appcompat.widget.AppCompatImageButton
android:id="@+id/playPauseButton"
android:layout_width="0dp"
android:layout_height="100dp"
android:layout_height="70dp"
android:layout_weight="1"
android:background="?attr/selectableItemBackgroundBorderless"
android:scaleType="fitCenter"
@ -506,9 +508,9 @@
<androidx.appcompat.widget.AppCompatImageButton
android:id="@+id/playNextButton"
android:layout_width="0dp"
android:layout_height="100dp"
android:layout_height="50dp"
android:layout_weight="1"
android:layout_marginStart="30dp"
android:layout_marginStart="10dp"
android:clickable="true"
android:focusable="true"
android:background="?attr/selectableItemBackgroundBorderless"

View file

@ -1,19 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<org.schabi.newpipe.views.FocusAwareDrawerLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true">
<FrameLayout
<org.schabi.newpipe.views.FocusAwareCoordinator
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context="org.schabi.newpipe.MainActivity">
android:layout_height="match_parent">
<FrameLayout
android:id="@+id/fragment_holder"
android:layout_width="match_parent"
@ -21,24 +18,18 @@
android:layout_marginTop="?attr/actionBarSize" />
<include layout="@layout/toolbar_layout" />
</FrameLayout>
<androidx.coordinatorlayout.widget.CoordinatorLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<FrameLayout
android:id="@+id/fragment_player_holder"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center_horizontal"
app:behavior_hideable="true"
app:behavior_peekHeight="0dp"
app:layout_behavior="org.schabi.newpipe.player.event.CustomBottomSheetBehavior">
android:id="@+id/fragment_player_holder"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center_horizontal"
app:behavior_hideable="true"
app:behavior_peekHeight="0dp"
app:layout_behavior="org.schabi.newpipe.player.event.CustomBottomSheetBehavior">
</FrameLayout>
</androidx.coordinatorlayout.widget.CoordinatorLayout>
</org.schabi.newpipe.views.FocusAwareCoordinator>
<include layout="@layout/drawer_layout"/>

View file

@ -250,9 +250,12 @@
<androidx.appcompat.widget.AppCompatImageButton
android:id="@+id/queueButton"
android:layout_width="40dp"
android:layout_width="35dp"
android:layout_height="35dp"
android:padding="10dp"
android:paddingTop="5dp"
android:paddingStart="3dp"
android:paddingEnd="3dp"
android:paddingBottom="3dp"
android:layout_marginEnd="8dp"
android:clickable="true"
android:focusable="true"
@ -478,14 +481,13 @@
android:gravity="center"
android:orientation="horizontal"
android:weightSum="5.5">
<!--tools:visibility="gone">-->
<androidx.appcompat.widget.AppCompatImageButton
android:id="@+id/playPreviousButton"
android:layout_width="0dp"
android:layout_height="100dp"
android:layout_height="40dp"
android:layout_weight="1"
android:layout_marginEnd="30dp"
android:layout_marginEnd="10dp"
android:clickable="true"
android:focusable="true"
android:background="?attr/selectableItemBackgroundBorderless"
@ -497,7 +499,7 @@
<androidx.appcompat.widget.AppCompatImageButton
android:id="@+id/playPauseButton"
android:layout_width="0dp"
android:layout_height="100dp"
android:layout_height="60dp"
android:layout_weight="1"
android:background="?attr/selectableItemBackgroundBorderless"
android:scaleType="fitCenter"
@ -507,9 +509,9 @@
<androidx.appcompat.widget.AppCompatImageButton
android:id="@+id/playNextButton"
android:layout_width="0dp"
android:layout_height="100dp"
android:layout_height="40dp"
android:layout_weight="1"
android:layout_marginStart="30dp"
android:layout_marginStart="10dp"
android:clickable="true"
android:focusable="true"
android:background="?attr/selectableItemBackgroundBorderless"

View file

@ -186,8 +186,8 @@
<androidx.appcompat.widget.AppCompatImageButton
android:id="@+id/control_backward"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_width="32dp"
android:layout_height="32dp"
android:layout_centerVertical="true"
android:layout_marginLeft="5dp"
android:layout_toLeftOf="@+id/control_fast_rewind"
@ -265,8 +265,8 @@
<androidx.appcompat.widget.AppCompatImageButton
android:id="@+id/control_forward"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_width="32dp"
android:layout_height="32dp"
android:layout_centerVertical="true"
android:layout_marginRight="5dp"
android:layout_toRightOf="@+id/control_fast_forward"

View file

@ -72,7 +72,7 @@
<string name="use_inexact_seek_title">Use fast inexact seek</string>
<string name="use_inexact_seek_summary">Inexact seek allows the player to seek to positions faster with reduced precision. Seeking for 5, 15 or 25 seconds doesn\'t work with this.</string>
<string name="seek_duration_title">Fast-forward/-rewind seek duration</string>
<string name="clear_queue_confirmation_title">Ask confirmation before clearing a queue</string>
<string name="clear_queue_confirmation_title">Ask for confirmation before clearing a queue</string>
<string name="clear_queue_confirmation_summary">After switching from one player to another your queue may be replaced</string>
<string name="clear_queue_confirmation_description">Queue from the active player will be replaced</string>
<string name="download_thumbnail_title">Load thumbnails</string>