Added Dark Theme

This commit is contained in:
59436419 2017-01-17 16:07:36 +05:30
parent a2e4585fe8
commit 60dc19d2bc
21 changed files with 318 additions and 256 deletions

View File

@ -32,10 +32,10 @@ android {
dependencies { dependencies {
testCompile 'junit:junit:4.12' testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:25.1.0' compile 'com.android.support:appcompat-v7:25.0.0'
compile 'com.android.support:support-v4:25.1.0' compile 'com.android.support:support-v4:25.0.0'
compile 'com.android.support:design:25.1.0' compile 'com.android.support:design:25.0.0'
compile 'com.android.support:recyclerview-v7:25.1.0' compile 'com.android.support:recyclerview-v7:25.0.0'
compile 'org.jsoup:jsoup:1.8.3' compile 'org.jsoup:jsoup:1.8.3'
compile 'org.mozilla:rhino:1.7.7' compile 'org.mozilla:rhino:1.7.7'
compile 'info.guardianproject.netcipher:netcipher:1.2' compile 'info.guardianproject.netcipher:netcipher:1.2'

View File

@ -47,7 +47,6 @@ public class MainActivity extends Themer {
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main); setContentView(R.layout.activity_main);
setVolumeControlStream(AudioManager.STREAM_MUSIC); setVolumeControlStream(AudioManager.STREAM_MUSIC);
mainFragment = getSupportFragmentManager() mainFragment = getSupportFragmentManager()
.findFragmentById(R.id.search_fragment); .findFragmentById(R.id.search_fragment);

View File

@ -2,19 +2,20 @@ package org.schabi.newpipe;
import android.os.Bundle; import android.os.Bundle;
import android.preference.PreferenceManager; import android.preference.PreferenceManager;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity; import android.support.v7.app.AppCompatActivity;
import java.util.Objects; import java.util.Objects;
import static org.schabi.newpipe.R.attr.theme;
public class Themer extends AppCompatActivity { public class Themer extends AppCompatActivity {
@Override @Override
protected void onCreate(@Nullable Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
if (Objects.equals(PreferenceManager.getDefaultSharedPreferences(this) if (Objects.equals(PreferenceManager.getDefaultSharedPreferences(this)
.getString("theme", "1"), "0")) { .getString("theme", getResources().getString(R.string.light_theme_title)), getResources().getString(R.string.dark_theme_title))) {
setTheme(R.style.DarkTheme); setTheme(R.style.DarkTheme);
} }
} }
} }

View File

@ -21,6 +21,7 @@ import android.util.Log;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.Menu; import android.view.Menu;
import android.view.MenuInflater; import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.MotionEvent; import android.view.MotionEvent;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
@ -30,7 +31,6 @@ import android.widget.LinearLayout;
import android.widget.ProgressBar; import android.widget.ProgressBar;
import android.widget.RelativeLayout; import android.widget.RelativeLayout;
import android.widget.TextView; import android.widget.TextView;
import android.view.MenuItem;
import android.widget.Toast; import android.widget.Toast;
import com.google.android.exoplayer.util.Util; import com.google.android.exoplayer.util.Util;
@ -39,26 +39,26 @@ import com.nostra13.universalimageloader.core.ImageLoader;
import com.nostra13.universalimageloader.core.assist.FailReason; import com.nostra13.universalimageloader.core.assist.FailReason;
import com.nostra13.universalimageloader.core.listener.ImageLoadingListener; import com.nostra13.universalimageloader.core.listener.ImageLoadingListener;
import java.util.Vector;
import org.schabi.newpipe.ActivityCommunicator; import org.schabi.newpipe.ActivityCommunicator;
import org.schabi.newpipe.ChannelActivity; import org.schabi.newpipe.ChannelActivity;
import org.schabi.newpipe.ReCaptchaActivity;
import org.schabi.newpipe.extractor.stream_info.StreamInfo;
import org.schabi.newpipe.extractor.stream_info.StreamPreviewInfo;
import org.schabi.newpipe.info_list.InfoItemBuilder;
import org.schabi.newpipe.report.ErrorActivity;
import org.schabi.newpipe.ImageErrorLoadingListener; import org.schabi.newpipe.ImageErrorLoadingListener;
import org.schabi.newpipe.Localization; import org.schabi.newpipe.Localization;
import org.schabi.newpipe.R; import org.schabi.newpipe.R;
import org.schabi.newpipe.ReCaptchaActivity;
import org.schabi.newpipe.download.DownloadDialog; import org.schabi.newpipe.download.DownloadDialog;
import org.schabi.newpipe.extractor.stream_info.AudioStream;
import org.schabi.newpipe.extractor.MediaFormat; import org.schabi.newpipe.extractor.MediaFormat;
import org.schabi.newpipe.extractor.NewPipe; import org.schabi.newpipe.extractor.NewPipe;
import org.schabi.newpipe.extractor.stream_info.AudioStream;
import org.schabi.newpipe.extractor.stream_info.StreamInfo;
import org.schabi.newpipe.extractor.stream_info.StreamPreviewInfo;
import org.schabi.newpipe.extractor.stream_info.VideoStream; import org.schabi.newpipe.extractor.stream_info.VideoStream;
import org.schabi.newpipe.info_list.InfoItemBuilder;
import org.schabi.newpipe.player.BackgroundPlayer; import org.schabi.newpipe.player.BackgroundPlayer;
import org.schabi.newpipe.player.PlayVideoActivity;
import org.schabi.newpipe.player.ExoPlayerActivity; import org.schabi.newpipe.player.ExoPlayerActivity;
import org.schabi.newpipe.player.PlayVideoActivity;
import org.schabi.newpipe.report.ErrorActivity;
import java.util.Vector;
import static android.app.Activity.RESULT_OK; import static android.app.Activity.RESULT_OK;
import static org.schabi.newpipe.ReCaptchaActivity.RECAPTCHA_REQUEST; import static org.schabi.newpipe.ReCaptchaActivity.RECAPTCHA_REQUEST;
@ -650,7 +650,6 @@ public class VideoItemDetailFragment extends Fragment {
public void onStart() { public void onStart() {
super.onStart(); super.onStart();
Activity a = getActivity(); Activity a = getActivity();
infoItemBuilder = new InfoItemBuilder(a, a.findViewById(android.R.id.content)); infoItemBuilder = new InfoItemBuilder(a, a.findViewById(android.R.id.content));
if (android.os.Build.VERSION.SDK_INT < 18) { if (android.os.Build.VERSION.SDK_INT < 18) {

View File

@ -13,6 +13,7 @@ import android.os.IBinder;
import android.preference.PreferenceManager; import android.preference.PreferenceManager;
import android.support.v4.app.NavUtils; import android.support.v4.app.NavUtils;
import android.support.v7.app.ActionBar; import android.support.v7.app.ActionBar;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar; import android.support.v7.widget.Toolbar;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.Menu; import android.view.Menu;
@ -27,9 +28,9 @@ import android.widget.SeekBar;
import android.widget.TextView; import android.widget.TextView;
import android.widget.Toast; import android.widget.Toast;
import org.schabi.newpipe.R;
import org.schabi.newpipe.Themer; import org.schabi.newpipe.Themer;
import org.schabi.newpipe.report.ErrorActivity; import org.schabi.newpipe.report.ErrorActivity;
import org.schabi.newpipe.R;
import org.schabi.newpipe.settings.SettingsActivity; import org.schabi.newpipe.settings.SettingsActivity;
import java.io.File; import java.io.File;

View File

@ -47,8 +47,8 @@ public class SettingsActivity extends PreferenceActivity {
@Override @Override
protected void onCreate(Bundle savedInstanceBundle) { protected void onCreate(Bundle savedInstanceBundle) {
if (Objects.equals(PreferenceManager.getDefaultSharedPreferences(this) if (Objects.equals(PreferenceManager.getDefaultSharedPreferences(this)
.getString("theme", "1"), "0")) { .getString("theme", getResources().getString(R.string.light_theme_title)), getResources().getString(R.string.dark_theme_title))) {
setTheme(R.style.DarkTheme); setTheme(R.style.DarkTheme);
} }
getDelegate().installViewFactory(); getDelegate().installViewFactory();
getDelegate().onCreate(savedInstanceBundle); getDelegate().onCreate(savedInstanceBundle);

View File

@ -21,6 +21,7 @@ import org.schabi.newpipe.App;
import org.schabi.newpipe.R; import org.schabi.newpipe.R;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Objects;
import info.guardianproject.netcipher.proxy.OrbotHelper; import info.guardianproject.netcipher.proxy.OrbotHelper;
@ -67,7 +68,7 @@ public class SettingsFragment extends PreferenceFragment
private Preference downloadPathAudioPreference; private Preference downloadPathAudioPreference;
private Preference themePreference; private Preference themePreference;
private SharedPreferences defaultPreferences; private SharedPreferences defaultPreferences;
private Preference themePreference;
@Override @Override
public void onCreate(final Bundle savedInstanceState) { public void onCreate(final Bundle savedInstanceState) {
@ -86,6 +87,7 @@ public class SettingsFragment extends PreferenceFragment
DOWNLOAD_PATH_AUDIO_PREFERENCE = getString(R.string.download_path_audio_key); DOWNLOAD_PATH_AUDIO_PREFERENCE = getString(R.string.download_path_audio_key);
THEME = getString(R.string.theme_key); THEME = getString(R.string.theme_key);
USE_TOR_KEY = getString(R.string.use_tor_key); USE_TOR_KEY = getString(R.string.use_tor_key);
THEME = getString(R.string.theme_key);
// get pref objects // get pref objects
defaultResolutionPreference = defaultResolutionPreference =

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.6 KiB

View File

@ -2,7 +2,7 @@
<layer-list xmlns:android="http://schemas.android.com/apk/res/android"> <layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item <item
android:drawable="@color/light_background_color"/> android:drawable="?android:attr/windowBackground"/>
<item> <item>
<bitmap <bitmap

View File

@ -1,20 +1,20 @@
<?xml version="1.0" encoding="utf-8"?> <?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" xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
tools:context=".detail.VideoItemDetailFragment" tools:context=".detail.VideoItemDetailFragment"
android:textIsSelectable="true" android:textIsSelectable="true"
style="?android:attr/textAppearanceLarge" style="?android:attr/textAppearanceLarge"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:id="@+id/video_item_detail"> android:id="@+id/video_item_detail">
<ProgressBar android:id="@+id/detail_progress_bar" <ProgressBar android:id="@+id/detail_progress_bar"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_centerInParent="true" android:layout_centerInParent="true"
android:indeterminate="true"/> android:indeterminate="true"/>
<com.nirhart.parallaxscroll.views.ParallaxScrollView <com.nirhart.parallaxscroll.views.ParallaxScrollView
android:id="@+id/detail_main_content" android:id="@+id/detail_main_content"
@ -35,24 +35,24 @@
android:background="?attr/selectableItemBackground"> android:background="?attr/selectableItemBackground">
<ImageView android:id="@+id/detail_thumbnail_view" <ImageView android:id="@+id/detail_thumbnail_view"
android:contentDescription="@string/detail_thumbnail_view_description" android:contentDescription="@string/detail_thumbnail_view_description"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:scaleType="fitCenter" android:scaleType="fitCenter"
android:adjustViewBounds="true" android:adjustViewBounds="true"
android:layout_alignParentLeft="true" android:layout_alignParentLeft="true"
android:layout_alignParentStart="true" android:layout_alignParentStart="true"
android:layout_alignParentTop="true" android:layout_alignParentTop="true"
android:background="@android:color/black" android:background="@android:color/black"
android:src="@drawable/dummy_thumbnail_dark"/> android:src="@drawable/dummy_thumbnail_dark"/>
<ImageView android:id="@+id/play_arrow_view" <ImageView android:id="@+id/play_arrow_view"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="@android:color/transparent" android:background="@android:color/transparent"
android:layout_centerInParent="true" android:layout_centerInParent="true"
android:src="@drawable/new_play_arrow" android:src="@drawable/new_play_arrow"
android:visibility="invisible"/> android:visibility="invisible"/>
<Button <Button
android:id="@+id/detail_stream_thumbnail_window_background_button" android:id="@+id/detail_stream_thumbnail_window_background_button"
@ -63,10 +63,11 @@
</RelativeLayout> </RelativeLayout>
<RelativeLayout android:id="@+id/detail_text_content_layout" <RelativeLayout android:id="@+id/detail_text_content_layout"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_below="@id/detail_stream_thumbnail_window_layout" android:layout_below="@id/detail_stream_thumbnail_window_layout"
android:visibility="gone"> android:background="?android:windowBackground"
android:visibility="gone">
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
@ -74,15 +75,15 @@
android:id="@+id/detailTopView"> android:id="@+id/detailTopView">
<TextView android:id="@+id/detail_video_title_view" <TextView android:id="@+id/detail_video_title_view"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_weight=".7" android:layout_weight=".7"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:textSize="@dimen/video_item_detail_title_text_size" android:textSize="@dimen/video_item_detail_title_text_size"
android:textAppearance="?android:attr/textAppearanceLarge" android:textAppearance="?android:attr/textAppearanceLarge"
android:layout_marginTop="12dp" android:layout_marginTop="12dp"
android:layout_marginLeft="12dp" android:layout_marginLeft="12dp"
android:layout_marginStart="12dp" android:layout_marginStart="12dp"
android:text="Title"/> android:text="Title"/>
<ImageView <ImageView
android:layout_width="15dp" android:layout_width="15dp"
@ -98,17 +99,17 @@
</LinearLayout> </LinearLayout>
<TextView android:id="@+id/detail_view_count_view" <TextView android:id="@+id/detail_view_count_view"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:textSize="@dimen/video_item_detail_views_text_size" android:textSize="@dimen/video_item_detail_views_text_size"
android:textAppearance="?android:attr/textAppearanceLarge" android:textAppearance="?android:attr/textAppearanceLarge"
android:layout_marginLeft="12dp" android:layout_marginLeft="12dp"
android:layout_marginStart="12dp" android:layout_marginStart="12dp"
android:text="10,069,948 views" android:text="10,069,948 views"
android:layout_below="@id/detailTopView" android:layout_below="@id/detailTopView"
android:layout_alignParentLeft="true" android:layout_alignParentLeft="true"
android:layout_alignParentStart="true" android:layout_alignParentStart="true"
android:layout_marginTop="5dp" /> android:layout_marginTop="5dp" />
<RelativeLayout <RelativeLayout
android:layout_width="match_parent" android:layout_width="match_parent"
@ -121,21 +122,21 @@
android:layout_marginEnd="12dp" android:layout_marginEnd="12dp"
android:visibility="gone"> android:visibility="gone">
<TextView android:id="@+id/detail_upload_date_view" <TextView android:id="@+id/detail_upload_date_view"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:textSize="@dimen/video_item_detail_upload_date_text_size" android:textSize="@dimen/video_item_detail_upload_date_text_size"
android:textAppearance="?android:attr/textAppearanceMedium" android:textAppearance="?android:attr/textAppearanceMedium"
android:text="Upload date" android:text="Upload date"
android:layout_marginTop="3dp" /> android:layout_marginTop="3dp" />
<TextView android:id="@+id/detail_description_view" <TextView android:id="@+id/detail_description_view"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:textSize="@dimen/video_item_detail_description_text_size" android:textSize="@dimen/video_item_detail_description_text_size"
android:textAppearance="?android:attr/textAppearanceMedium" android:textAppearance="?android:attr/textAppearanceMedium"
android:layout_below="@id/detail_upload_date_view" android:layout_below="@id/detail_upload_date_view"
android:text="Description............." android:text="Description............."
android:layout_marginTop="3dp" /> android:layout_marginTop="3dp" />
</RelativeLayout> </RelativeLayout>
<LinearLayout <LinearLayout
@ -149,32 +150,32 @@
android:layout_alignParentEnd="true" android:layout_alignParentEnd="true"
android:layout_marginTop="5dp"> android:layout_marginTop="5dp">
<ImageView android:id="@+id/detail_thumbs_up_img_view" <ImageView android:id="@+id/detail_thumbs_up_img_view"
android:contentDescription="@string/detail_likes_img_view_description" android:contentDescription="@string/detail_likes_img_view_description"
android:layout_width="@dimen/video_item_detail_like_image_width" android:layout_width="@dimen/video_item_detail_like_image_width"
android:layout_height="@dimen/video_item_detail_like_image_height" android:layout_height="@dimen/video_item_detail_like_image_height"
android:src="@drawable/thumbs_up" /> android:src="?attr/thumbs_up"/>
<TextView android:id="@+id/detail_thumbs_up_count_view" <TextView android:id="@+id/detail_thumbs_up_count_view"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:textSize="@dimen/video_item_detail_likes_text_size" android:textSize="@dimen/video_item_detail_likes_text_size"
android:textAppearance="?android:attr/textAppearanceMedium" android:textAppearance="?android:attr/textAppearanceMedium"
android:text="200" /> android:text="200" />
<ImageView android:id="@+id/detail_thumbs_down_img_view" <ImageView android:id="@+id/detail_thumbs_down_img_view"
android:contentDescription="@string/detail_dislikes_img_view_description" android:contentDescription="@string/detail_dislikes_img_view_description"
android:layout_width="@dimen/video_item_detail_like_image_width" android:layout_width="@dimen/video_item_detail_like_image_width"
android:layout_height="@dimen/video_item_detail_like_image_height" android:layout_height="@dimen/video_item_detail_like_image_height"
android:src="@drawable/thumbs_down" android:src="?attr/thumbs_down"
android:layout_marginLeft="10dp" android:layout_marginLeft="10dp"
android:layout_marginStart="10dp"/> android:layout_marginStart="10dp"/>
<TextView android:id="@+id/detail_thumbs_down_count_view" <TextView android:id="@+id/detail_thumbs_down_count_view"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:textSize="@dimen/video_item_detail_likes_text_size" android:textSize="@dimen/video_item_detail_likes_text_size"
android:textAppearance="?android:attr/textAppearanceMedium" android:textAppearance="?android:attr/textAppearanceMedium"
android:text="100" /> android:text="100" />
</LinearLayout> </LinearLayout>
<FrameLayout <FrameLayout
@ -207,17 +208,17 @@
android:layout_marginBottom="5dp"/> android:layout_marginBottom="5dp"/>
<TextView android:id="@+id/detail_uploader_view" <TextView android:id="@+id/detail_uploader_view"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:textStyle="bold" android:textStyle="bold"
android:textSize="@dimen/video_item_detail_uploader_text_size" android:textSize="@dimen/video_item_detail_uploader_text_size"
android:textAppearance="?android:attr/textAppearanceLarge" android:textAppearance="?android:attr/textAppearanceLarge"
android:text="Uploader" android:text="Uploader"
android:layout_centerVertical="true" android:layout_centerVertical="true"
android:layout_toRightOf="@+id/detail_uploader_thumbnail_view" android:layout_toRightOf="@+id/detail_uploader_thumbnail_view"
android:layout_toEndOf="@+id/detail_uploader_thumbnail_view" android:layout_toEndOf="@+id/detail_uploader_thumbnail_view"
android:layout_marginLeft="15dp" android:layout_marginLeft="15dp"
android:layout_marginStart="28dp" /> android:layout_marginStart="28dp" />
<View <View
android:background="#000" android:background="#000"
@ -234,12 +235,12 @@
</FrameLayout> </FrameLayout>
<RelativeLayout android:id="@+id/detail_next_stream_root_layout" <RelativeLayout android:id="@+id/detail_next_stream_root_layout"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_gravity="center_horizontal|bottom" android:layout_gravity="center_horizontal|bottom"
android:layout_below="@+id/detail_uploader_frame" android:layout_below="@+id/detail_uploader_frame"
android:layout_centerHorizontal="true" android:layout_centerHorizontal="true"
android:layout_marginTop="10dp"> android:layout_marginTop="10dp">
<TextView <TextView
android:id="@+id/detail_next_stream_title" android:id="@+id/detail_next_stream_title"
@ -256,14 +257,14 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:id="@+id/detail_next_stream_content"/> android:id="@+id/detail_next_stream_content"/>
<TextView android:id="@+id/detail_similar_title" <TextView android:id="@+id/detail_similar_title"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_centerHorizontal="true" android:layout_centerHorizontal="true"
android:textSize="@dimen/video_item_detail_next_text_size" android:textSize="@dimen/video_item_detail_next_text_size"
android:textAppearance="?android:attr/textAppearanceMedium" android:textAppearance="?android:attr/textAppearanceMedium"
android:text="@string/similar_videos_btn_text" android:text="@string/similar_videos_btn_text"
android:layout_below="@id/detail_next_stream_content" android:layout_below="@id/detail_next_stream_content"
android:textAllCaps="true" /> android:textAllCaps="true" />
<LinearLayout <LinearLayout
android:id="@+id/similar_streams_view" android:id="@+id/similar_streams_view"
android:orientation="vertical" android:orientation="vertical"
@ -275,4 +276,4 @@
</RelativeLayout> </RelativeLayout>
</RelativeLayout> </RelativeLayout>
</com.nirhart.parallaxscroll.views.ParallaxScrollView> </com.nirhart.parallaxscroll.views.ParallaxScrollView>
</RelativeLayout> </RelativeLayout>

View File

@ -91,6 +91,7 @@
android:id="@+id/channel_streams_view" android:id="@+id/channel_streams_view"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:background="?android:windowBackground"
app:layout_behavior="@string/appbar_scrolling_view_behavior" app:layout_behavior="@string/appbar_scrolling_view_behavior"
android:scrollbars="vertical"/> android:scrollbars="vertical"/>
</android.support.design.widget.CoordinatorLayout> </android.support.design.widget.CoordinatorLayout>

View File

@ -42,7 +42,7 @@
android:id="@+id/errorMessageView" android:id="@+id/errorMessageView"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:textColor="@android:color/black" android:textColor="?android:attr/colorAccent"
android:text="@string/info_labels"/> android:text="@string/info_labels"/>
<TextView <TextView
@ -63,7 +63,7 @@
android:id="@+id/errorInfoLabelsView" android:id="@+id/errorInfoLabelsView"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:textColor="@android:color/black" android:textColor="?android:attr/colorAccent"
android:text="@string/info_labels"/> android:text="@string/info_labels"/>
<HorizontalScrollView <HorizontalScrollView

View File

@ -1,14 +1,14 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
tools:context=".detail.VideoItemDetailFragment" tools:context=".detail.VideoItemDetailFragment"
android:textIsSelectable="true" android:textIsSelectable="true"
style="?android:attr/textAppearanceLarge" style="?android:attr/textAppearanceLarge"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:id="@+id/video_item_detail"> android:id="@+id/video_item_detail">
<com.nirhart.parallaxscroll.views.ParallaxScrollView <com.nirhart.parallaxscroll.views.ParallaxScrollView
android:id="@+id/detail_main_content" android:id="@+id/detail_main_content"
@ -29,22 +29,22 @@
android:background="?attr/selectableItemBackground"> android:background="?attr/selectableItemBackground">
<ImageView android:id="@+id/detail_thumbnail_view" <ImageView android:id="@+id/detail_thumbnail_view"
android:contentDescription="@string/detail_thumbnail_view_description" android:contentDescription="@string/detail_thumbnail_view_description"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:scaleType="fitCenter" android:scaleType="fitCenter"
android:adjustViewBounds="true" android:adjustViewBounds="true"
android:layout_alignParentLeft="true" android:layout_alignParentLeft="true"
android:layout_alignParentStart="true" android:layout_alignParentStart="true"
android:layout_alignParentTop="true" android:layout_alignParentTop="true"
android:background="@android:color/black" android:background="@android:color/black"
android:src="@drawable/dummy_thumbnail_dark"/> android:src="@drawable/dummy_thumbnail_dark"/>
<ProgressBar android:id="@+id/detail_progress_bar" <ProgressBar android:id="@+id/detail_progress_bar"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_centerInParent="true" android:layout_centerInParent="true"
android:indeterminate="true"/> android:indeterminate="true"/>
<android.support.design.widget.FloatingActionButton <android.support.design.widget.FloatingActionButton
android:id="@+id/play_video_button" android:id="@+id/play_video_button"
@ -65,10 +65,11 @@
</RelativeLayout> </RelativeLayout>
<RelativeLayout android:id="@+id/detail_text_content_layout" <RelativeLayout android:id="@+id/detail_text_content_layout"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_below="@id/detail_stream_thumbnail_window_layout" android:layout_below="@id/detail_stream_thumbnail_window_layout"
android:visibility="gone"> android:background="?android:windowBackground"
android:visibility="gone">
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
@ -76,15 +77,15 @@
android:id="@+id/detailTopView"> android:id="@+id/detailTopView">
<TextView android:id="@+id/detail_video_title_view" <TextView android:id="@+id/detail_video_title_view"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_weight=".7" android:layout_weight=".7"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:textSize="@dimen/video_item_detail_title_text_size" android:textSize="@dimen/video_item_detail_title_text_size"
android:textAppearance="?android:attr/textAppearanceLarge" android:textAppearance="?android:attr/textAppearanceLarge"
android:layout_marginTop="12dp" android:layout_marginTop="12dp"
android:layout_marginLeft="12dp" android:layout_marginLeft="12dp"
android:layout_marginStart="12dp" android:layout_marginStart="12dp"
android:text="Title"/> android:text="Title"/>
<ImageView <ImageView
android:layout_width="15dp" android:layout_width="15dp"
@ -100,17 +101,17 @@
</LinearLayout> </LinearLayout>
<TextView android:id="@+id/detail_view_count_view" <TextView android:id="@+id/detail_view_count_view"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:textSize="@dimen/video_item_detail_views_text_size" android:textSize="@dimen/video_item_detail_views_text_size"
android:textAppearance="?android:attr/textAppearanceLarge" android:textAppearance="?android:attr/textAppearanceLarge"
android:layout_marginLeft="12dp" android:layout_marginLeft="12dp"
android:layout_marginStart="12dp" android:layout_marginStart="12dp"
android:text="10,069,948 views" android:text="10,069,948 views"
android:layout_below="@id/detailTopView" android:layout_below="@id/detailTopView"
android:layout_alignParentLeft="true" android:layout_alignParentLeft="true"
android:layout_alignParentStart="true" android:layout_alignParentStart="true"
android:layout_marginTop="5dp" /> android:layout_marginTop="5dp" />
<RelativeLayout <RelativeLayout
android:layout_width="match_parent" android:layout_width="match_parent"
@ -123,21 +124,21 @@
android:layout_marginEnd="12dp" android:layout_marginEnd="12dp"
android:visibility="gone"> android:visibility="gone">
<TextView android:id="@+id/detail_upload_date_view" <TextView android:id="@+id/detail_upload_date_view"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:textSize="@dimen/video_item_detail_upload_date_text_size" android:textSize="@dimen/video_item_detail_upload_date_text_size"
android:textAppearance="?android:attr/textAppearanceMedium" android:textAppearance="?android:attr/textAppearanceMedium"
android:text="Upload date" android:text="Upload date"
android:layout_marginTop="3dp" /> android:layout_marginTop="3dp" />
<TextView android:id="@+id/detail_description_view" <TextView android:id="@+id/detail_description_view"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:textSize="@dimen/video_item_detail_description_text_size" android:textSize="@dimen/video_item_detail_description_text_size"
android:textAppearance="?android:attr/textAppearanceMedium" android:textAppearance="?android:attr/textAppearanceMedium"
android:layout_below="@id/detail_upload_date_view" android:layout_below="@id/detail_upload_date_view"
android:text="Description............." android:text="Description............."
android:layout_marginTop="3dp" /> android:layout_marginTop="3dp" />
</RelativeLayout> </RelativeLayout>
<LinearLayout <LinearLayout
@ -151,32 +152,32 @@
android:layout_alignParentEnd="true" android:layout_alignParentEnd="true"
android:layout_marginTop="5dp"> android:layout_marginTop="5dp">
<ImageView android:id="@+id/detail_thumbs_up_img_view" <ImageView android:id="@+id/detail_thumbs_up_img_view"
android:contentDescription="@string/detail_likes_img_view_description" android:contentDescription="@string/detail_likes_img_view_description"
android:layout_width="@dimen/video_item_detail_like_image_width" android:layout_width="@dimen/video_item_detail_like_image_width"
android:layout_height="@dimen/video_item_detail_like_image_height" android:layout_height="@dimen/video_item_detail_like_image_height"
android:src="@drawable/thumbs_up" /> android:src="?attr/thumbs_up" />
<TextView android:id="@+id/detail_thumbs_up_count_view" <TextView android:id="@+id/detail_thumbs_up_count_view"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:textSize="@dimen/video_item_detail_likes_text_size" android:textSize="@dimen/video_item_detail_likes_text_size"
android:textAppearance="?android:attr/textAppearanceMedium" android:textAppearance="?android:attr/textAppearanceMedium"
android:text="200" /> android:text="200" />
<ImageView android:id="@+id/detail_thumbs_down_img_view" <ImageView android:id="@+id/detail_thumbs_down_img_view"
android:contentDescription="@string/detail_dislikes_img_view_description" android:contentDescription="@string/detail_dislikes_img_view_description"
android:layout_width="@dimen/video_item_detail_like_image_width" android:layout_width="@dimen/video_item_detail_like_image_width"
android:layout_height="@dimen/video_item_detail_like_image_height" android:layout_height="@dimen/video_item_detail_like_image_height"
android:src="@drawable/thumbs_down" android:src="?attr/thumbs_down"
android:layout_marginLeft="10dp" android:layout_marginLeft="10dp"
android:layout_marginStart="10dp"/> android:layout_marginStart="10dp"/>
<TextView android:id="@+id/detail_thumbs_down_count_view" <TextView android:id="@+id/detail_thumbs_down_count_view"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:textSize="@dimen/video_item_detail_likes_text_size" android:textSize="@dimen/video_item_detail_likes_text_size"
android:textAppearance="?android:attr/textAppearanceMedium" android:textAppearance="?android:attr/textAppearanceMedium"
android:text="100" /> android:text="100" />
</LinearLayout> </LinearLayout>
<FrameLayout <FrameLayout
@ -209,17 +210,17 @@
android:layout_marginBottom="5dp"/> android:layout_marginBottom="5dp"/>
<TextView android:id="@+id/detail_uploader_view" <TextView android:id="@+id/detail_uploader_view"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:textStyle="bold" android:textStyle="bold"
android:textSize="@dimen/video_item_detail_uploader_text_size" android:textSize="@dimen/video_item_detail_uploader_text_size"
android:textAppearance="?android:attr/textAppearanceLarge" android:textAppearance="?android:attr/textAppearanceLarge"
android:text="Uploader" android:text="Uploader"
android:layout_centerVertical="true" android:layout_centerVertical="true"
android:layout_toRightOf="@+id/detail_uploader_thumbnail_view" android:layout_toRightOf="@+id/detail_uploader_thumbnail_view"
android:layout_toEndOf="@+id/detail_uploader_thumbnail_view" android:layout_toEndOf="@+id/detail_uploader_thumbnail_view"
android:layout_marginLeft="15dp" android:layout_marginLeft="15dp"
android:layout_marginStart="28dp" /> android:layout_marginStart="28dp" />
<View <View
android:background="#000" android:background="#000"
@ -236,12 +237,12 @@
</FrameLayout> </FrameLayout>
<RelativeLayout android:id="@+id/detail_next_stream_root_layout" <RelativeLayout android:id="@+id/detail_next_stream_root_layout"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_gravity="center_horizontal|bottom" android:layout_gravity="center_horizontal|bottom"
android:layout_below="@+id/detail_uploader_frame" android:layout_below="@+id/detail_uploader_frame"
android:layout_centerHorizontal="true" android:layout_centerHorizontal="true"
android:layout_marginTop="10dp"> android:layout_marginTop="10dp">
<TextView <TextView
android:id="@+id/detail_next_stream_title" android:id="@+id/detail_next_stream_title"
@ -258,14 +259,14 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:id="@+id/detail_next_stream_content"/> android:id="@+id/detail_next_stream_content"/>
<TextView android:id="@+id/detail_similar_title" <TextView android:id="@+id/detail_similar_title"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_centerHorizontal="true" android:layout_centerHorizontal="true"
android:textSize="@dimen/video_item_detail_next_text_size" android:textSize="@dimen/video_item_detail_next_text_size"
android:textAppearance="?android:attr/textAppearanceMedium" android:textAppearance="?android:attr/textAppearanceMedium"
android:text="@string/similar_videos_btn_text" android:text="@string/similar_videos_btn_text"
android:layout_below="@id/detail_next_stream_content" android:layout_below="@id/detail_next_stream_content"
android:textAllCaps="true" /> android:textAllCaps="true" />
<LinearLayout <LinearLayout
android:id="@+id/similar_streams_view" android:id="@+id/similar_streams_view"
android:orientation="vertical" android:orientation="vertical"
@ -277,4 +278,4 @@
</RelativeLayout> </RelativeLayout>
</RelativeLayout> </RelativeLayout>
</com.nirhart.parallaxscroll.views.ParallaxScrollView> </com.nirhart.parallaxscroll.views.ParallaxScrollView>
</FrameLayout> </FrameLayout>

View File

@ -5,12 +5,12 @@
<item android:id="@+id/menu_item_play_audio" <item android:id="@+id/menu_item_play_audio"
android:title="@string/play_audio" android:title="@string/play_audio"
app:showAsAction="ifRoom" app:showAsAction="ifRoom"
android:icon="@drawable/ic_headset_black" /> android:icon="?attr/audio" />
<item android:id="@+id/menu_item_download" <item android:id="@+id/menu_item_download"
app:showAsAction="ifRoom" app:showAsAction="ifRoom"
android:title="@string/download" android:title="@string/download"
android:icon="@drawable/ic_file_download_black"/> android:icon="?attr/download"/>
<item android:id="@+id/menu_item_share" <item android:id="@+id/menu_item_share"
android:title="@string/share" android:title="@string/share"

View File

@ -1,13 +1,30 @@
<resources> <resources>
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light"> <style name="AppTheme" parent="Theme.AppCompat.Light">
<item name="android:actionBarStyle">@style/NewPipeActionbarTheme</item> <item name="android:actionBarStyle">@style/NewPipeActionbarTheme</item>
<item name="actionBarStyle">@style/NewPipeActionbarTheme</item> <item name="actionBarStyle">@style/NewPipeActionbarTheme</item>
<item name="android:colorPrimary">@color/light_youtube_primary_color</item> <item name="colorPrimary">@color/light_youtube_primary_color</item>
<item name="android:colorPrimaryDark">@color/light_youtube_dark_color</item> <item name="colorPrimaryDark">@color/light_youtube_dark_color</item>
<item name="colorAccent">@color/light_youtube_accent_color</item> <item name="colorAccent">@color/light_youtube_accent_color</item>
<item name="android:colorAccent">@color/light_youtube_accent_color</item>
<item name="android:windowBackground">@color/light_background_color</item> <item name="android:windowBackground">@color/light_background_color</item>
<item name="thumbs_up">@drawable/ic_thumb_up_black_24dp</item>
<item name="thumbs_down">@drawable/ic_thumb_down_black_24dp</item>
<item name="audio">@drawable/ic_headset_black_24dp</item>
<item name="download">@drawable/ic_file_download_black_24dp</item>
</style>
<!-- Dark Theme-->
<style name="DarkTheme" parent="Theme.AppCompat">
<item name="android:actionBarStyle">@style/NewPipeActionbarTheme</item>
<item name="actionBarStyle">@style/NewPipeActionbarTheme</item>
<item name="colorPrimary">@color/dark_youtube_primary_color</item>
<item name="colorPrimaryDark">@color/light_youtube_dark_color</item>
<item name="colorAccent">@color/dark_youtube_accent_color</item>
<item name="android:windowBackground">@color/dark_background_color</item>
<item name="thumbs_up">@drawable/ic_thumb_up_white_24dp</item>
<item name="thumbs_down">@drawable/ic_thumb_down_white_24dp</item>
<item name="audio">@drawable/ic_headset_white_24dp</item>
<item name="download">@drawable/ic_file_download_white_24dp</item>
</style> </style>
<!-- Dark Theme--> <!-- Dark Theme-->

View File

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<attr name="thumbs_up" format="reference"/>
<attr name="thumbs_down" format="reference"/>
<attr name="audio" format="reference"/>
<attr name="download" format="reference"/>
<attr name="share" format="reference"/>
<attr name="cast" format="reference"/>
</resources>

View File

@ -25,14 +25,16 @@
<string name="show_play_with_kodi_key">show_play_with_kodi</string> <string name="show_play_with_kodi_key">show_play_with_kodi</string>
<string name="theme_key">theme</string> <string name="theme_key">theme</string>
<string name="default_theme_value">0</string> <string name="default_theme_value">@string/light_theme_title</string>
<string-array name="theme_description_list"> <string-array name="theme_description_list">
<item>@string/dark_theme_title</item>
<item>@string/light_theme_title</item> <item>@string/light_theme_title</item>
<item>@string/dark_theme_title</item>
<item>@string/black_theme_title</item>
</string-array> </string-array>
<string-array name="theme_list"> <string-array name="theme_list">
<item>0</item> <item>@string/light_theme_title</item>
<item>1</item> <item>@string/dark_theme_title</item>
<item>@string/black_theme_title</item>
</string-array> </string-array>
<string name="default_audio_format_key">default_audio_format</string> <string name="default_audio_format_key">default_audio_format</string>

View File

@ -46,8 +46,9 @@
<string name="webm_description">WebM — free format</string> <string name="webm_description">WebM — free format</string>
<string name="m4a_description">m4a — better quality</string> <string name="m4a_description">m4a — better quality</string>
<string name="theme_title">Theme</string> <string name="theme_title">Theme</string>
<string name="dark_theme_title">Dark</string>
<string name="light_theme_title">Light</string> <string name="light_theme_title">Light</string>
<string name="dark_theme_title">Dark</string>
<string name="black_theme_title">Black</string>
<string name="download_dialog_title">Download</string> <string name="download_dialog_title">Download</string>
<string-array name="download_options"> <string-array name="download_options">

View File

@ -1,6 +1,6 @@
<resources> <resources>
<style name="RootTheme" parent="android:Theme.Holo"></style> <style name="RootTheme" parent="android:Theme.Holo"/>
<style name="PlayerTheme" parent="@style/RootTheme"> <style name="PlayerTheme" parent="@style/RootTheme">
<item name="android:windowNoTitle">true</item> <item name="android:windowNoTitle">true</item>
@ -13,6 +13,7 @@
<item name="android:minWidth">40dp</item> <item name="android:minWidth">40dp</item>
</style> </style>
<!-- Base application theme. --> <!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light"> <style name="AppTheme" parent="Theme.AppCompat.Light">
<item name="android:actionBarStyle">@style/NewPipeActionbarTheme</item> <item name="android:actionBarStyle">@style/NewPipeActionbarTheme</item>
@ -21,6 +22,33 @@
<item name="colorPrimaryDark">@color/light_youtube_dark_color</item> <item name="colorPrimaryDark">@color/light_youtube_dark_color</item>
<item name="colorAccent">@color/light_youtube_accent_color</item> <item name="colorAccent">@color/light_youtube_accent_color</item>
<item name="android:windowBackground">@color/light_background_color</item> <item name="android:windowBackground">@color/light_background_color</item>
<item name="thumbs_up">@drawable/ic_thumb_up_black_24dp</item>
<item name="thumbs_down">@drawable/ic_thumb_down_black_24dp</item>
<item name="audio">@drawable/ic_headset_black_24dp</item>
<item name="download">@drawable/ic_file_download_black_24dp</item>
<item name="share">@drawable/ic_share_black</item>
<item name="cast">@drawable/ic_cast_black_24dp</item>
</style>
<!-- Dark Theme-->
<style name="DarkTheme" parent="Theme.AppCompat">
<item name="android:actionBarStyle">@style/NewPipeActionbarTheme</item>
<item name="actionBarStyle">@style/NewPipeActionbarTheme</item>
<item name="colorPrimary">@color/dark_youtube_primary_color</item>
<item name="colorPrimaryDark">@color/light_youtube_dark_color</item>
<item name="colorAccent">@color/dark_youtube_accent_color</item>
<item name="android:windowBackground">@color/dark_background_color</item>
<item name="thumbs_up">@drawable/ic_thumb_up_white_24dp</item>
<item name="thumbs_down">@drawable/ic_thumb_down_white_24dp</item>
<item name="audio">@drawable/ic_headset_white_24dp</item>
<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>
</style>
<style name="BlackTheme" parent="DarkTheme">
<item name="android:windowBackground">@color/light_youtube_accent_color</item>
</style> </style>
<!-- Dark Theme--> <!-- Dark Theme-->

View File

@ -43,7 +43,7 @@
android:key="@string/settings_category_appearance" android:key="@string/settings_category_appearance"
android:title="@string/settings_category_appearance_title" android:title="@string/settings_category_appearance_title"
android:textAllCaps="true"> android:textAllCaps="true">
.
<ListPreference <ListPreference
android:key="@string/theme_key" android:key="@string/theme_key"
android:title="@string/theme_title" android:title="@string/theme_title"