Migrate to fragments and improvements

- Migrate to fragments
- Fix #487
- Don't show "Open in popup mode" to channel links
- New backstack of videos
- Change the subscribers count to format using `NumberFormat`, for example some locales use `.`  others `,`, this handles it automatically (and the old method had a bug for leading zero, e.g. 4.82.125 instead of 4.082.125)
- Add string 'subscribers' for channels with more than 1 subscriber (plural)
- Popup player chooses the default format and resolution based on the new preference (format)
- Fix taskaffinity of the router activities
- Show title before loading, as it is available from the items already loaded
This commit is contained in:
Mauricio Colli 2017-04-09 14:34:00 -03:00
parent 9318bb5306
commit 746c2a15bf
39 changed files with 2026 additions and 1506 deletions

View file

@ -1,15 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="org.schabi.newpipe.MainActivity"
android:orientation="vertical">
android:orientation="vertical"
tools:context="org.schabi.newpipe.MainActivity">
<fragment
android:id="@+id/search_fragment"
<FrameLayout
android:id="@+id/fragment_holder"
android:name="org.schabi.newpipe.search_fragment.SearchInfoItemFragment"
android:layout_width="match_parent"
android:layout_height="match_parent" />
android:layout_height="match_parent"/>
</RelativeLayout>

View file

@ -3,24 +3,22 @@
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:tools="http://schemas.android.com/tools"
android:orientation="vertical"
android:title="Channel">
android:title="@string/channel">
<android.support.v7.widget.RecyclerView
android:id="@+id/channel_streams_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="?android:windowBackground"
android:scrollbars="vertical"/>
android:scrollbars="vertical"
tools:listitem="@layout/stream_item"/>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/channel_loading">
<ProgressBar android:id="@+id/progressBar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:indeterminate="true"/>
</RelativeLayout>
<ProgressBar
android:id="@+id/loading_progress_bar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:indeterminate="true"/>
</RelativeLayout>

View file

@ -5,7 +5,7 @@
android:layout_height="match_parent"
android:layout_width="match_parent"
android:name="org.schabi.newpipe.SearchInfoItemFragment"
tools:context=".search_fragment.SearchInfoItemFragment">
tools:context=".fragments.search.SearchFragment">
<include layout="@layout/main_bg" />
@ -17,10 +17,11 @@
tools:listitem="@layout/stream_item"
android:scrollbars="vertical"/>
<ProgressBar android:id="@+id/progressBar"
<ProgressBar android:id="@+id/loading_progress_bar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:indeterminate="true"
android:visibility="gone"/>
android:visibility="gone"
tools:visibility="visible"/>
</RelativeLayout>

View file

@ -17,6 +17,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content">
<!-- THUMBNAIL -->
<RelativeLayout
android:id="@+id/detail_thumbnail_root_layout"
android:layout_width="match_parent"
@ -57,14 +58,13 @@
</RelativeLayout>
<!-- TITLE -->
<RelativeLayout
android:id="@+id/detail_content_root_layout"
android:id="@+id/detail_title_background"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@id/detail_thumbnail_root_layout"
android:background="?android:windowBackground"
android:visibility="gone"
tools:visibility="visible">
android:layout_height="wrap_content"
android:layout_below="@+id/detail_thumbnail_root_layout"
android:background="?android:windowBackground">
<RelativeLayout
android:id="@+id/detail_title_root_layout"
@ -106,13 +106,25 @@
</RelativeLayout>
</RelativeLayout>
<!-- CONTENT -->
<RelativeLayout
android:id="@+id/detail_content_root_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@+id/detail_title_background"
android:background="?android:windowBackground"
android:visibility="gone"
tools:visibility="visible">
<TextView
android:id="@+id/detail_view_count_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_below="@id/detail_title_root_layout"
android:layout_marginLeft="12dp"
android:layout_marginRight="12dp"
android:layout_marginTop="5dp"
@ -309,14 +321,15 @@
</RelativeLayout>
<!-- LOADING BAR -->
<ProgressBar
android:id="@+id/detail_loading_progress_bar"
style="@style/Widget.AppCompat.ProgressBar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/detail_thumbnail_root_layout"
android:layout_below="@+id/detail_title_background"
android:layout_centerHorizontal="true"
android:layout_marginTop="30dp"
android:layout_marginTop="20dp"
android:indeterminate="true"/>
</RelativeLayout>

View file

@ -4,7 +4,7 @@
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/mainBG"
tools:context=".detail.VideoItemDetailActivity">
tools:context=".fragments.detail.VideoDetailFragment">
<TextView
android:layout_width="wrap_content"