Added basic channel subscription and feed pages (#620)
Added basic channel subscription and feed pages - Room Persistence for sqlite support. - RxJava2 for reactive async support. - Stetho for database inspection support. - Enabled Multidex for debug build.
This commit is contained in:
parent
cb5b0ff764
commit
10c4f7b465
33 changed files with 1775 additions and 32 deletions
|
|
@ -68,7 +68,7 @@
|
|||
tools:visibility="visible"/>
|
||||
|
||||
<Button
|
||||
android:id="@+id/channel_rss_button"
|
||||
android:id="@+id/channel_subscribe_button"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentRight="true"
|
||||
|
|
@ -76,8 +76,7 @@
|
|||
android:layout_gravity="center_vertical|right"
|
||||
android:layout_marginRight="4dp"
|
||||
android:layout_marginTop="2dp"
|
||||
android:drawableLeft="@drawable/ic_rss_feed_white_24dp"
|
||||
android:text="@string/rss_button_title"
|
||||
android:text="@string/subscribe_button_title"
|
||||
android:textSize="@dimen/channel_rss_title_size"
|
||||
android:theme="@style/RedButton"
|
||||
android:visibility="gone"
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@
|
|||
android:layout_below="@id/channel_banner_image"
|
||||
android:layout_marginLeft="8dp"
|
||||
android:layout_marginTop="6dp"
|
||||
android:layout_toLeftOf="@+id/channel_rss_button"
|
||||
android:layout_toLeftOf="@+id/channel_subscribe_button"
|
||||
android:layout_toRightOf="@+id/channel_avatar_layout"
|
||||
android:textAppearance="?android:attr/textAppearanceLarge"
|
||||
android:textSize="@dimen/video_item_detail_title_text_size"
|
||||
|
|
@ -70,15 +70,14 @@
|
|||
tools:visibility="visible"/>
|
||||
|
||||
<Button
|
||||
android:id="@+id/channel_rss_button"
|
||||
android:id="@+id/channel_subscribe_button"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_below="@+id/channel_banner_image"
|
||||
android:layout_gravity="center_vertical|right"
|
||||
android:layout_marginRight="2dp"
|
||||
android:drawableLeft="@drawable/ic_rss_feed_white_24dp"
|
||||
android:text="@string/rss_button_title"
|
||||
android:text="@string/subscribe_button_title"
|
||||
android:textSize="@dimen/channel_rss_title_size"
|
||||
android:theme="@style/RedButton"
|
||||
android:visibility="gone"
|
||||
|
|
|
|||
17
app/src/main/res/layout/empty_view_panel.xml
Normal file
17
app/src/main/res/layout/empty_view_panel.xml
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
android:gravity="center">
|
||||
<TextView
|
||||
android:textAppearance="?android:attr/textAppearanceLarge"
|
||||
android:text="¯\\_(ツ)_/¯"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" />
|
||||
<TextView
|
||||
android:text="Nothing Here But Crickets"
|
||||
android:layout_gravity="center"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" />
|
||||
</LinearLayout>
|
||||
19
app/src/main/res/layout/fragment_blank.xml
Normal file
19
app/src/main/res/layout/fragment_blank.xml
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout 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">
|
||||
|
||||
<include layout="@layout/main_bg" />
|
||||
|
||||
<include
|
||||
android:id="@+id/error_panel"
|
||||
layout="@layout/error_retry"
|
||||
tools:visibility="visible"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_marginTop="50dp"
|
||||
android:visibility="gone" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
|
@ -32,4 +32,14 @@
|
|||
android:visibility="gone"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<include
|
||||
android:id="@+id/empty_panel"
|
||||
layout="@layout/empty_view_panel"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerInParent="true"
|
||||
android:layout_marginTop="50dp"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible"/>
|
||||
|
||||
</RelativeLayout>
|
||||
|
|
|
|||
|
|
@ -1,8 +1,21 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_width="match_parent">
|
||||
android:layout_width="match_parent"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
<include layout="@layout/main_bg" />
|
||||
|
||||
<android.support.design.widget.TabLayout
|
||||
android:id="@+id/main_tab_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentBottom="true"
|
||||
app:tabGravity="fill"/>
|
||||
|
||||
<android.support.v4.view.ViewPager
|
||||
android:id="@+id/pager"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="fill_parent"
|
||||
android:layout_above="@id/main_tab_layout"/>
|
||||
|
||||
</RelativeLayout>
|
||||
|
|
|
|||
49
app/src/main/res/layout/fragment_subscription.xml
Normal file
49
app/src/main/res/layout/fragment_subscription.xml
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout
|
||||
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="match_parent"
|
||||
android:focusable="true"
|
||||
android:focusableInTouchMode="true">
|
||||
|
||||
<android.support.v7.widget.RecyclerView
|
||||
android:id="@+id/result_list_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:scrollbars="vertical"
|
||||
app:layoutManager="LinearLayoutManager"
|
||||
tools:listitem="@layout/channel_item"/>
|
||||
|
||||
<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"
|
||||
tools:visibility="visible"/>
|
||||
|
||||
<!--ERROR PANEL-->
|
||||
<include
|
||||
android:id="@+id/error_panel"
|
||||
layout="@layout/error_retry"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_marginTop="50dp"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible"/>
|
||||
|
||||
<include
|
||||
android:id="@+id/empty_panel"
|
||||
layout="@layout/empty_view_panel"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerInParent="true"
|
||||
android:layout_marginTop="50dp"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible"/>
|
||||
|
||||
</RelativeLayout>
|
||||
28
app/src/main/res/layout/load_item_footer.xml
Normal file
28
app/src/main/res/layout/load_item_footer.xml
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/itemRoot"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/video_item_search_height"
|
||||
android:background="?attr/selectableItemBackground"
|
||||
android:clickable="false"
|
||||
android:padding="@dimen/video_item_search_padding">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/load_more_text"
|
||||
android:text="Load More"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerInParent="true"
|
||||
android:textAppearance="?android:attr/textAppearanceLarge"
|
||||
android:textSize="@dimen/header_footer_text_size"
|
||||
android:visibility="gone"/>
|
||||
|
||||
<ProgressBar
|
||||
android:id="@+id/paginate_progress_bar"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerInParent="true"
|
||||
android:visibility="gone"/>
|
||||
|
||||
</RelativeLayout>
|
||||
33
app/src/main/res/layout/subscription_header.xml
Normal file
33
app/src/main/res/layout/subscription_header.xml
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/channel_header_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="12dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/whatsNew"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="50dp"
|
||||
android:paddingLeft="12dp"
|
||||
android:paddingRight="12dp"
|
||||
android:drawableLeft="?attr/rss"
|
||||
android:drawablePadding="5dp"
|
||||
android:text="@string/fragment_whats_new"
|
||||
android:textAppearance="?android:attr/textAppearanceLarge"
|
||||
android:textSize="@dimen/header_footer_text_size"
|
||||
android:gravity="left|center"
|
||||
android:clickable="true"
|
||||
tools:ignore="RtlHardcoded"/>
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1px"
|
||||
android:layout_marginLeft="8dp"
|
||||
android:layout_marginRight="8dp"
|
||||
android:layout_below="@id/whatsNew"
|
||||
android:background="?attr/colorAccent" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
|
@ -7,6 +7,11 @@
|
|||
app:showAsAction="never"
|
||||
android:title="@string/open_in_browser" />
|
||||
|
||||
<item android:id="@+id/menu_item_rss"
|
||||
app:showAsAction="ifRoom"
|
||||
android:title="@string/rss_button_title"
|
||||
android:icon="?attr/rss"/>
|
||||
|
||||
<item android:id="@+id/menu_item_share"
|
||||
android:title="@string/share"
|
||||
app:showAsAction="ifRoom"
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@
|
|||
<dimen name="video_item_search_duration_text_size">12sp</dimen>
|
||||
<dimen name="video_item_search_uploader_text_size">14sp</dimen>
|
||||
<dimen name="video_item_search_upload_date_text_size">14sp</dimen>
|
||||
<dimen name="header_footer_text_size">18sp</dimen>
|
||||
<!-- Elements Size -->
|
||||
<!-- 16 / 9 ratio-->
|
||||
<dimen name="video_item_search_thumbnail_image_width">142dp</dimen>
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@
|
|||
<dimen name="video_item_search_duration_text_size">11sp</dimen>
|
||||
<dimen name="video_item_search_uploader_text_size">11sp</dimen>
|
||||
<dimen name="video_item_search_upload_date_text_size">12sp</dimen>
|
||||
<dimen name="header_footer_text_size">16sp</dimen>
|
||||
<!-- Elements Size -->
|
||||
<!-- 16 / 9 ratio-->
|
||||
<dimen name="video_item_search_thumbnail_image_width">124dp</dimen>
|
||||
|
|
|
|||
|
|
@ -23,6 +23,16 @@
|
|||
<string name="use_external_audio_player_title">Use external audio player</string>
|
||||
<string name="popup_mode_share_menu_title">NewPipe Popup mode</string>
|
||||
<string name="rss_button_title" translatable="false">RSS</string>
|
||||
<string name="subscribe_button_title">Subscribe</string>
|
||||
<string name="subscribed_button_title">Subscribed</string>
|
||||
<string name="channel_unsubscribed">Channel unsubscribed</string>
|
||||
<string name="subscription_change_failed">Unable to change subscription</string>
|
||||
<string name="subscription_update_failed">Unable to update subscription</string>
|
||||
|
||||
<string name="tab_main">Main</string>
|
||||
<string name="tab_subscriptions">Subscriptions</string>
|
||||
|
||||
<string name="fragment_whats_new">What\'s New</string>
|
||||
|
||||
<string name="controls_background_title">Background</string>
|
||||
<string name="controls_popup_title">Popup</string>
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@
|
|||
<item name="download">@drawable/ic_file_download_white_24dp</item>
|
||||
<item name="share">@drawable/ic_share_white_24dp</item>
|
||||
<item name="cast">@drawable/ic_cast_white_24dp</item>
|
||||
<item name="rss">@drawable/ic_rss_feed_black_24dp</item>
|
||||
<item name="rss">@drawable/ic_rss_feed_white_24dp</item>
|
||||
<item name="search">@drawable/ic_search_white_24dp</item>
|
||||
<item name="close">@drawable/ic_close_white_24dp</item>
|
||||
<item name="filter">@drawable/ic_filter_list_white_24dp</item>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue