From 7f86872139ae3ff35813e1c5b843188c83636b0c Mon Sep 17 00:00:00 2001 From: Christian Schabesberger Date: Wed, 25 Nov 2015 21:08:19 +0100 Subject: [PATCH 01/21] Categorized settings & moved AbstractVideoInfo into service folder --- .../java/org/schabi/newpipe/VideoInfo.java | 2 + .../org/schabi/newpipe/VideoPreviewInfo.java | 2 + .../{ => services}/AbstractVideoInfo.java | 2 +- app/src/main/res/values-de/strings.xml | 3 + app/src/main/res/values/settings_keys.xml | 5 + app/src/main/res/values/strings.xml | 3 + app/src/main/res/xml/settings_screen.xml | 110 ++++++++++-------- 7 files changed, 79 insertions(+), 48 deletions(-) rename app/src/main/java/org/schabi/newpipe/{ => services}/AbstractVideoInfo.java (92%) diff --git a/app/src/main/java/org/schabi/newpipe/VideoInfo.java b/app/src/main/java/org/schabi/newpipe/VideoInfo.java index 5b8321a61..80e5d3861 100644 --- a/app/src/main/java/org/schabi/newpipe/VideoInfo.java +++ b/app/src/main/java/org/schabi/newpipe/VideoInfo.java @@ -2,6 +2,8 @@ package org.schabi.newpipe; import android.graphics.Bitmap; +import org.schabi.newpipe.services.AbstractVideoInfo; + import java.util.List; /** diff --git a/app/src/main/java/org/schabi/newpipe/VideoPreviewInfo.java b/app/src/main/java/org/schabi/newpipe/VideoPreviewInfo.java index f49bd0a0e..1e2f96891 100644 --- a/app/src/main/java/org/schabi/newpipe/VideoPreviewInfo.java +++ b/app/src/main/java/org/schabi/newpipe/VideoPreviewInfo.java @@ -4,6 +4,8 @@ import android.graphics.Bitmap; import android.os.Parcel; import android.os.Parcelable; +import org.schabi.newpipe.services.AbstractVideoInfo; + /** * Created by Christian Schabesberger on 26.08.15. * diff --git a/app/src/main/java/org/schabi/newpipe/AbstractVideoInfo.java b/app/src/main/java/org/schabi/newpipe/services/AbstractVideoInfo.java similarity index 92% rename from app/src/main/java/org/schabi/newpipe/AbstractVideoInfo.java rename to app/src/main/java/org/schabi/newpipe/services/AbstractVideoInfo.java index 43839b1f0..72d43ebde 100644 --- a/app/src/main/java/org/schabi/newpipe/AbstractVideoInfo.java +++ b/app/src/main/java/org/schabi/newpipe/services/AbstractVideoInfo.java @@ -1,4 +1,4 @@ -package org.schabi.newpipe; +package org.schabi.newpipe.services; import android.graphics.Bitmap; diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml index 7a93ed30d..2676edd52 100644 --- a/app/src/main/res/values-de/strings.xml +++ b/app/src/main/res/values-de/strings.xml @@ -49,4 +49,7 @@ Zeige nächstes und ähnliche Videos URL wird nicht unterstützt. Ähnliche Videos + VIDEO & AUDIO + INFO + ETC diff --git a/app/src/main/res/values/settings_keys.xml b/app/src/main/res/values/settings_keys.xml index 3c4b90e65..f1cd7ebaf 100644 --- a/app/src/main/res/values/settings_keys.xml +++ b/app/src/main/res/values/settings_keys.xml @@ -1,5 +1,10 @@ + + settings_categoery_video_audio + settings_category_video_info + settings_category_etc + download_path_preference use_external_player autoplay_through_intent diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index a3529fc25..fa3a118dd 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -50,4 +50,7 @@ URL not supported. Similar videos Preferable content language + VIDEO & AUDIO + INFO + ETC diff --git a/app/src/main/res/xml/settings_screen.xml b/app/src/main/res/xml/settings_screen.xml index a72dc87df..59ed1b28f 100644 --- a/app/src/main/res/xml/settings_screen.xml +++ b/app/src/main/res/xml/settings_screen.xml @@ -3,59 +3,75 @@ android:title="@string/title_activity_settings" android:key="general_preferences"> - + - + - + - + - + + - + - + - + - - + + + + + + + + + + + \ No newline at end of file From d6d144c927a1dda25a3a9a0d4e8a55aa5752454e Mon Sep 17 00:00:00 2001 From: Christian Schabesberger Date: Thu, 26 Nov 2015 17:29:26 +0100 Subject: [PATCH 02/21] renamed Extractor into VideoExtractor --- .../newpipe/VideoItemDetailActivity.java | 10 ++++------ .../newpipe/VideoItemDetailFragment.java | 18 +++++++++--------- .../newpipe/services/StreamingService.java | 2 +- .../{Extractor.java => VideoExtractor.java} | 6 +++--- .../services/youtube/YoutubeSearchEngine.java | 2 +- .../services/youtube/YoutubeService.java | 6 +++--- ...tractor.java => YoutubeVideoExtractor.java} | 10 +++++----- 7 files changed, 26 insertions(+), 28 deletions(-) rename app/src/main/java/org/schabi/newpipe/services/{Extractor.java => VideoExtractor.java} (96%) rename app/src/main/java/org/schabi/newpipe/services/youtube/{YoutubeExtractor.java => YoutubeVideoExtractor.java} (98%) diff --git a/app/src/main/java/org/schabi/newpipe/VideoItemDetailActivity.java b/app/src/main/java/org/schabi/newpipe/VideoItemDetailActivity.java index 0b87b7b7f..e5b224222 100644 --- a/app/src/main/java/org/schabi/newpipe/VideoItemDetailActivity.java +++ b/app/src/main/java/org/schabi/newpipe/VideoItemDetailActivity.java @@ -5,12 +5,11 @@ import android.os.Bundle; import android.preference.PreferenceManager; import android.support.v4.app.NavUtils; import android.support.v7.app.AppCompatActivity; -import android.util.Log; import android.view.Menu; import android.view.MenuItem; import android.widget.Toast; -import org.schabi.newpipe.services.Extractor; +import org.schabi.newpipe.services.VideoExtractor; import org.schabi.newpipe.services.ServiceList; import org.schabi.newpipe.services.StreamingService; @@ -64,14 +63,13 @@ public class VideoItemDetailActivity extends AppCompatActivity { // this means the video was called though another app if (getIntent().getData() != null) { videoUrl = getIntent().getData().toString(); - //Log.i(TAG, "video URL passed:\"" + videoUrl + "\""); StreamingService[] serviceList = ServiceList.getServices(); - Extractor extractor = null; + VideoExtractor videoExtractor = null; for (int i = 0; i < serviceList.length; i++) { if (serviceList[i].acceptUrl(videoUrl)) { arguments.putInt(VideoItemDetailFragment.STREAMING_SERVICE, i); currentStreamingService = i; - //extractor = ServiceList.getService(i).getExtractorInstance(); + //videoExtractor = ServiceList.getService(i).getExtractorInstance(); break; } } @@ -80,7 +78,7 @@ public class VideoItemDetailActivity extends AppCompatActivity { .show(); } //arguments.putString(VideoItemDetailFragment.VIDEO_URL, - // extractor.getVideoUrl(extractor.getVideoId(videoUrl)));//cleans URL + // videoExtractor.getVideoUrl(videoExtractor.getVideoId(videoUrl)));//cleans URL arguments.putString(VideoItemDetailFragment.VIDEO_URL, videoUrl); arguments.putBoolean(VideoItemDetailFragment.AUTO_PLAY, diff --git a/app/src/main/java/org/schabi/newpipe/VideoItemDetailFragment.java b/app/src/main/java/org/schabi/newpipe/VideoItemDetailFragment.java index c883e7f8d..8211962d0 100644 --- a/app/src/main/java/org/schabi/newpipe/VideoItemDetailFragment.java +++ b/app/src/main/java/org/schabi/newpipe/VideoItemDetailFragment.java @@ -39,7 +39,7 @@ import java.util.Date; import java.util.Locale; import java.util.Vector; -import org.schabi.newpipe.services.Extractor; +import org.schabi.newpipe.services.VideoExtractor; import org.schabi.newpipe.services.ServiceList; import org.schabi.newpipe.services.StreamingService; @@ -79,7 +79,7 @@ public class VideoItemDetailFragment extends Fragment { private ActionBarHandler actionBarHandler; private boolean autoPlayEnabled = false; - private Thread extractorThread = null; + private Thread videoExtractorThread = null; private VideoInfo currentVideoInfo = null; private boolean showNextVideoItem = false; @@ -89,21 +89,21 @@ public class VideoItemDetailFragment extends Fragment { private OnInvokeCreateOptionsMenuListener onInvokeCreateOptionsMenuListener = null; - private class ExtractorRunnable implements Runnable { + private class VideoExtractorRunnable implements Runnable { private Handler h = new Handler(); - private Extractor extractor; + private VideoExtractor videoExtractor; private StreamingService service; private String videoUrl; - public ExtractorRunnable(String videoUrl, StreamingService service, VideoItemDetailFragment f) { + public VideoExtractorRunnable(String videoUrl, StreamingService service, VideoItemDetailFragment f) { this.service = service; this.videoUrl = videoUrl; } @Override public void run() { try { - this.extractor = service.getExtractorInstance(videoUrl); - VideoInfo videoInfo = extractor.getVideoInfo(); + this.videoExtractor = service.getExtractorInstance(videoUrl); + VideoInfo videoInfo = videoExtractor.getVideoInfo(); h.post(new VideoResultReturnedRunnable(videoInfo)); if (videoInfo.videoAvailableStatus == VideoInfo.VIDEO_AVAILABLE) { h.post(new SetThumbnailRunnable( @@ -360,11 +360,11 @@ public class VideoItemDetailFragment extends Fragment { try { StreamingService streamingService = ServiceList.getService( getArguments().getInt(STREAMING_SERVICE)); - extractorThread = new Thread(new ExtractorRunnable( + videoExtractorThread = new Thread(new VideoExtractorRunnable( getArguments().getString(VIDEO_URL), streamingService, this)); autoPlayEnabled = getArguments().getBoolean(AUTO_PLAY); - extractorThread.start(); + videoExtractorThread.start(); } catch (Exception e) { e.printStackTrace(); } diff --git a/app/src/main/java/org/schabi/newpipe/services/StreamingService.java b/app/src/main/java/org/schabi/newpipe/services/StreamingService.java index 4321340c6..d243ae4ad 100644 --- a/app/src/main/java/org/schabi/newpipe/services/StreamingService.java +++ b/app/src/main/java/org/schabi/newpipe/services/StreamingService.java @@ -25,7 +25,7 @@ public interface StreamingService { public String name = ""; } ServiceInfo getServiceInfo(); - Extractor getExtractorInstance(String url); + VideoExtractor getExtractorInstance(String url); SearchEngine getSearchEngineInstance(); /**When a VIEW_ACTION is caught this function will test if the url delivered within the calling diff --git a/app/src/main/java/org/schabi/newpipe/services/Extractor.java b/app/src/main/java/org/schabi/newpipe/services/VideoExtractor.java similarity index 96% rename from app/src/main/java/org/schabi/newpipe/services/Extractor.java rename to app/src/main/java/org/schabi/newpipe/services/VideoExtractor.java index a38b13f13..5aefc35d7 100644 --- a/app/src/main/java/org/schabi/newpipe/services/Extractor.java +++ b/app/src/main/java/org/schabi/newpipe/services/VideoExtractor.java @@ -4,7 +4,7 @@ package org.schabi.newpipe.services; * Created by Christian Schabesberger on 10.08.15. * * Copyright (C) Christian Schabesberger 2015 - * Extractor.java is part of NewPipe. + * VideoExtractor.java is part of NewPipe. * * NewPipe is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -23,11 +23,11 @@ package org.schabi.newpipe.services; import org.schabi.newpipe.VideoInfo; /**Scrapes information from a video streaming service (eg, YouTube).*/ -public abstract class Extractor { +public abstract class VideoExtractor { public String pageUrl; public VideoInfo videoInfo; - public Extractor(String url) { + public VideoExtractor(String url) { this.pageUrl = url; } diff --git a/app/src/main/java/org/schabi/newpipe/services/youtube/YoutubeSearchEngine.java b/app/src/main/java/org/schabi/newpipe/services/youtube/YoutubeSearchEngine.java index d01718ed2..9074e4724 100644 --- a/app/src/main/java/org/schabi/newpipe/services/youtube/YoutubeSearchEngine.java +++ b/app/src/main/java/org/schabi/newpipe/services/youtube/YoutubeSearchEngine.java @@ -101,7 +101,7 @@ public class YoutubeSearchEngine implements SearchEngine { // video item type } else if(!((el = item.select("div[class*=\"yt-lockup-video\"").first()) == null)) { - //todo: de-duplicate this with YoutubeExtractor.getVideoPreviewInfo() + //todo: de-duplicate this with YoutubeVideoExtractor.getVideoPreviewInfo() VideoPreviewInfo resultItem = new VideoPreviewInfo(); Element dl = el.select("h3").first().select("a").first(); resultItem.webpage_url = dl.attr("abs:href"); diff --git a/app/src/main/java/org/schabi/newpipe/services/youtube/YoutubeService.java b/app/src/main/java/org/schabi/newpipe/services/youtube/YoutubeService.java index e606c805d..576d8c065 100644 --- a/app/src/main/java/org/schabi/newpipe/services/youtube/YoutubeService.java +++ b/app/src/main/java/org/schabi/newpipe/services/youtube/YoutubeService.java @@ -1,7 +1,7 @@ package org.schabi.newpipe.services.youtube; import org.schabi.newpipe.services.StreamingService; -import org.schabi.newpipe.services.Extractor; +import org.schabi.newpipe.services.VideoExtractor; import org.schabi.newpipe.services.SearchEngine; @@ -33,9 +33,9 @@ public class YoutubeService implements StreamingService { return serviceInfo; } @Override - public Extractor getExtractorInstance(String url) { + public VideoExtractor getExtractorInstance(String url) { if(acceptUrl(url)) { - return new YoutubeExtractor(url); + return new YoutubeVideoExtractor(url); } else { throw new IllegalArgumentException("supplied String is not a valid Youtube URL"); diff --git a/app/src/main/java/org/schabi/newpipe/services/youtube/YoutubeExtractor.java b/app/src/main/java/org/schabi/newpipe/services/youtube/YoutubeVideoExtractor.java similarity index 98% rename from app/src/main/java/org/schabi/newpipe/services/youtube/YoutubeExtractor.java rename to app/src/main/java/org/schabi/newpipe/services/youtube/YoutubeVideoExtractor.java index cb996d2ef..2ff272bad 100644 --- a/app/src/main/java/org/schabi/newpipe/services/youtube/YoutubeExtractor.java +++ b/app/src/main/java/org/schabi/newpipe/services/youtube/YoutubeVideoExtractor.java @@ -13,7 +13,7 @@ import org.mozilla.javascript.Context; import org.mozilla.javascript.Function; import org.mozilla.javascript.ScriptableObject; import org.schabi.newpipe.Downloader; -import org.schabi.newpipe.services.Extractor; +import org.schabi.newpipe.services.VideoExtractor; import org.schabi.newpipe.MediaFormat; import org.schabi.newpipe.VideoInfo; import org.schabi.newpipe.VideoPreviewInfo; @@ -31,7 +31,7 @@ import java.util.regex.Pattern; * Created by Christian Schabesberger on 06.08.15. * * Copyright (C) Christian Schabesberger 2015 - * YoutubeExtractor.java is part of NewPipe. + * YoutubeVideoExtractor.java is part of NewPipe. * * NewPipe is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -47,9 +47,9 @@ import java.util.regex.Pattern; * along with NewPipe. If not, see . */ -public class YoutubeExtractor extends Extractor { +public class YoutubeVideoExtractor extends VideoExtractor { - private static final String TAG = YoutubeExtractor.class.toString(); + private static final String TAG = YoutubeVideoExtractor.class.toString(); private String pageContents; private Document doc; private JSONObject jsonObj; @@ -62,7 +62,7 @@ public class YoutubeExtractor extends Extractor { private static volatile String decryptionCode = ""; - public YoutubeExtractor(String pageUrl) { + public YoutubeVideoExtractor(String pageUrl) { super(pageUrl);//most common videoInfo fields are now set in our superclass, for all services pageContents = Downloader.download(cleanUrl(pageUrl)); doc = Jsoup.parse(pageContents, pageUrl); From f6ff41cfb4c4d048abc50317f849f0dfdbac20c0 Mon Sep 17 00:00:00 2001 From: Christian Schabesberger Date: Thu, 26 Nov 2015 18:26:28 +0100 Subject: [PATCH 03/21] removed obsolete translations --- app/src/main/res/values-es/strings.xml | 2 -- app/src/main/res/values-fa/strings.xml | 1 - app/src/main/res/values-hu/strings.xml | 1 - app/src/main/res/values-nl/strings.xml | 4 +--- app/src/main/res/values-ru/strings.xml | 3 +-- app/src/main/res/values-sr/strings.xml | 5 ++--- 6 files changed, 4 insertions(+), 12 deletions(-) diff --git a/app/src/main/res/values-es/strings.xml b/app/src/main/res/values-es/strings.xml index 9bed1ea7b..9de74b846 100644 --- a/app/src/main/res/values-es/strings.xml +++ b/app/src/main/res/values-es/strings.xml @@ -42,8 +42,6 @@ m4a - mejor calidad Descargar Siguiente vídeo - Mostrar la opción \"Siguiente vídeo\". URL no soportada. Vídeos similares - País del contenido del vídeo diff --git a/app/src/main/res/values-fa/strings.xml b/app/src/main/res/values-fa/strings.xml index b24529f59..603175949 100644 --- a/app/src/main/res/values-fa/strings.xml +++ b/app/src/main/res/values-fa/strings.xml @@ -46,6 +46,5 @@ صدا ویدئوی بعدی - نمایش گزینه‌ی «ویدئوی بعدی». پیوند پشتیبانی نمی‌شود. diff --git a/app/src/main/res/values-hu/strings.xml b/app/src/main/res/values-hu/strings.xml index d95ebf03a..990bb81b0 100644 --- a/app/src/main/res/values-hu/strings.xml +++ b/app/src/main/res/values-hu/strings.xml @@ -46,7 +46,6 @@ Hang Következő videó - \"Következő videó\" elem mutatása A webcím nem támogatott. Hasonló videók diff --git a/app/src/main/res/values-nl/strings.xml b/app/src/main/res/values-nl/strings.xml index f096ffc82..899e2d813 100644 --- a/app/src/main/res/values-nl/strings.xml +++ b/app/src/main/res/values-nl/strings.xml @@ -35,15 +35,13 @@ https://f-droid.org/repository/browse/?fdfilter=Kore&fdid=org.xbmc.kore Toon \"Speel af met Kodi\" optie Toont een optie om een video op een Kodi media center af te spelen. -Video inhoud land -Afspeel knop aan de linker kant weergeven. + Afspeel knop aan de linker kant weergeven. Audio Standaard audio formaat Webam - open formaat m4a - betere kwaliteit Download Volgende video - \"Volgende video\" weergeven URL wordt niet ondersteund. Vergelijkbare videos Laat volgende en vergelijkbare videos zien diff --git a/app/src/main/res/values-ru/strings.xml b/app/src/main/res/values-ru/strings.xml index 73475f175..affc0c2c3 100644 --- a/app/src/main/res/values-ru/strings.xml +++ b/app/src/main/res/values-ru/strings.xml @@ -46,9 +46,8 @@ Аудио Следующее видео - Показать \"Следующее видео\". URL не поддерживается. Похожие видео -Показывать следующее и предложенные видео + Показывать следующее и предложенные видео Предпочитаемый язык контента diff --git a/app/src/main/res/values-sr/strings.xml b/app/src/main/res/values-sr/strings.xml index 89e4d4ce1..3296cf2e0 100644 --- a/app/src/main/res/values-sr/strings.xml +++ b/app/src/main/res/values-sr/strings.xml @@ -45,10 +45,9 @@ Видео Аудио -Следећи видео - Приказ ставке „Следећи видео“. + Следећи видео УРЛ није подржан. -Прикажи следећи и слични видео + Прикажи следећи и слични видео Слични видео Пожељни језик садржаја From 451e2b2182ff269509dd1628da63ad827e42d0a0 Mon Sep 17 00:00:00 2001 From: Christian Schabesberger Date: Thu, 26 Nov 2015 18:29:00 +0100 Subject: [PATCH 04/21] removed hardcoded strings --- .../layout-land/fragment_videoitem_detail.xml | 22 ++++++------------- .../fragment_videoitem_detail.xml | 22 ++++++------------- .../res/layout/fragment_videoitem_detail.xml | 22 ++++++------------- app/src/main/res/layout/video_item.xml | 12 +++------- 4 files changed, 24 insertions(+), 54 deletions(-) diff --git a/app/src/main/res/layout-land/fragment_videoitem_detail.xml b/app/src/main/res/layout-land/fragment_videoitem_detail.xml index 0ff3bfe19..a0138a3bb 100644 --- a/app/src/main/res/layout-land/fragment_videoitem_detail.xml +++ b/app/src/main/res/layout-land/fragment_videoitem_detail.xml @@ -55,8 +55,7 @@ android:textStyle="bold" android:paddingBottom="5dp" android:textSize="@dimen/text_video_title_land_size" - android:textAppearance="?android:attr/textAppearanceLarge" - android:text="Video title placeholder"/> + android:textAppearance="?android:attr/textAppearanceLarge"/> + android:textAppearance="?android:attr/textAppearanceLarge" /> + android:textAppearance="?android:attr/textAppearanceLarge"/> + android:textAppearance="?android:attr/textAppearanceMedium" /> + android:textAppearance="?android:attr/textAppearanceMedium" /> + android:textAppearance="?android:attr/textAppearanceLarge" /> + android:textAppearance="?android:attr/textAppearanceMedium" /> diff --git a/app/src/main/res/layout-sw600dp/fragment_videoitem_detail.xml b/app/src/main/res/layout-sw600dp/fragment_videoitem_detail.xml index 33edf8ab9..374d6f993 100644 --- a/app/src/main/res/layout-sw600dp/fragment_videoitem_detail.xml +++ b/app/src/main/res/layout-sw600dp/fragment_videoitem_detail.xml @@ -55,8 +55,7 @@ android:textStyle="bold" android:paddingBottom="5dp" android:textSize="@dimen/text_video_title_sw600dp_size" - android:textAppearance="?android:attr/textAppearanceLarge" - android:text="Video title placeholder"/> + android:textAppearance="?android:attr/textAppearanceLarge"/> + android:textAppearance="?android:attr/textAppearanceLarge"/> + android:textAppearance="?android:attr/textAppearanceLarge"/> + android:textAppearance="?android:attr/textAppearanceMedium"/> + android:textAppearance="?android:attr/textAppearanceMedium" /> + android:textAppearance="?android:attr/textAppearanceLarge" /> + android:textAppearance="?android:attr/textAppearanceMedium" /> diff --git a/app/src/main/res/layout/fragment_videoitem_detail.xml b/app/src/main/res/layout/fragment_videoitem_detail.xml index f8e3224c0..a6668a39a 100644 --- a/app/src/main/res/layout/fragment_videoitem_detail.xml +++ b/app/src/main/res/layout/fragment_videoitem_detail.xml @@ -55,8 +55,7 @@ android:textStyle="bold" android:paddingBottom="3dp" android:textSize="@dimen/text_video_title_size" - android:textAppearance="?android:attr/textAppearanceLarge" - android:text="Video title placeholder"/> + android:textAppearance="?android:attr/textAppearanceLarge"/> + android:textAppearance="?android:attr/textAppearanceLarge" /> + android:textAppearance="?android:attr/textAppearanceLarge" /> + android:textAppearance="?android:attr/textAppearanceMedium" /> + android:textAppearance="?android:attr/textAppearanceMedium"/> + android:textAppearance="?android:attr/textAppearanceLarge" /> + android:textAppearance="?android:attr/textAppearanceMedium" /> diff --git a/app/src/main/res/layout/video_item.xml b/app/src/main/res/layout/video_item.xml index eb376c53f..98bd2ab73 100644 --- a/app/src/main/res/layout/video_item.xml +++ b/app/src/main/res/layout/video_item.xml @@ -21,9 +21,7 @@ android:layout_toRightOf="@id/itemThumbnailView" android:layout_alignParentTop="true" android:textAppearance="?android:attr/textAppearanceLarge" - android:textSize="@dimen/text_search_title_size" - android:text="title" - /> + android:textSize="@dimen/text_search_title_size"/> + android:textSize="@dimen/text_search_uploader_size"/> + android:textColor="@color/durationText"/> \ No newline at end of file From 6b9a4d5e0a06af2a10595898635344baa40d39d0 Mon Sep 17 00:00:00 2001 From: Christian Schabesberger Date: Thu, 26 Nov 2015 18:32:06 +0100 Subject: [PATCH 05/21] add ellipsis character to spanish translation --- app/src/main/res/values-es/strings.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/res/values-es/strings.xml b/app/src/main/res/values-es/strings.xml index 9de74b846..704ed7454 100644 --- a/app/src/main/res/values-es/strings.xml +++ b/app/src/main/res/values-es/strings.xml @@ -23,7 +23,7 @@ rotación Ajustes Usar reproductor externo - Descargar en... + Descargar en… Ruta donde guardar los vídeos descargados. Localización del directorio de descargas Reproducción automática From 189bee3e4464c5cbb7b4b0c53c1b8281279393f6 Mon Sep 17 00:00:00 2001 From: Christian Schabesberger Date: Thu, 26 Nov 2015 18:37:40 +0100 Subject: [PATCH 06/21] named drawable folder drawable-nodpi and moved orig. gema image to assets --- .../main/res/{drawable => drawable-nodpi}/buddy.png | Bin .../dummy_thumbnail.png | Bin .../gruese_die_gema_unangebracht.png | Bin .../ic_arrow_back_white.png | Bin .../{drawable => drawable-nodpi}/ic_cast_black.png | Bin .../ic_file_download_black.png | Bin .../ic_headset_black.png | Bin .../ic_play_arrow_black.png | Bin .../ic_screen_rotation_white.png | Bin .../{drawable => drawable-nodpi}/ic_share_black.png | Bin .../{drawable => drawable-nodpi}/ic_share_white.png | Bin .../new_pipe_watermark.png | Bin .../not_available_monkey.png | Bin .../{drawable => drawable-nodpi}/thumbs_down.png | Bin .../res/{drawable => drawable-nodpi}/thumbs_up.png | Bin .../gruese_die_gema_original.png | Bin 16 files changed, 0 insertions(+), 0 deletions(-) rename app/src/main/res/{drawable => drawable-nodpi}/buddy.png (100%) rename app/src/main/res/{drawable => drawable-nodpi}/dummy_thumbnail.png (100%) rename app/src/main/res/{drawable => drawable-nodpi}/gruese_die_gema_unangebracht.png (100%) rename app/src/main/res/{drawable => drawable-nodpi}/ic_arrow_back_white.png (100%) rename app/src/main/res/{drawable => drawable-nodpi}/ic_cast_black.png (100%) rename app/src/main/res/{drawable => drawable-nodpi}/ic_file_download_black.png (100%) rename app/src/main/res/{drawable => drawable-nodpi}/ic_headset_black.png (100%) rename app/src/main/res/{drawable => drawable-nodpi}/ic_play_arrow_black.png (100%) rename app/src/main/res/{drawable => drawable-nodpi}/ic_screen_rotation_white.png (100%) rename app/src/main/res/{drawable => drawable-nodpi}/ic_share_black.png (100%) rename app/src/main/res/{drawable => drawable-nodpi}/ic_share_white.png (100%) rename app/src/main/res/{drawable => drawable-nodpi}/new_pipe_watermark.png (100%) rename app/src/main/res/{drawable => drawable-nodpi}/not_available_monkey.png (100%) rename app/src/main/res/{drawable => drawable-nodpi}/thumbs_down.png (100%) rename app/src/main/res/{drawable => drawable-nodpi}/thumbs_up.png (100%) rename {app/src/main/res/drawable => assets}/gruese_die_gema_original.png (100%) diff --git a/app/src/main/res/drawable/buddy.png b/app/src/main/res/drawable-nodpi/buddy.png similarity index 100% rename from app/src/main/res/drawable/buddy.png rename to app/src/main/res/drawable-nodpi/buddy.png diff --git a/app/src/main/res/drawable/dummy_thumbnail.png b/app/src/main/res/drawable-nodpi/dummy_thumbnail.png similarity index 100% rename from app/src/main/res/drawable/dummy_thumbnail.png rename to app/src/main/res/drawable-nodpi/dummy_thumbnail.png diff --git a/app/src/main/res/drawable/gruese_die_gema_unangebracht.png b/app/src/main/res/drawable-nodpi/gruese_die_gema_unangebracht.png similarity index 100% rename from app/src/main/res/drawable/gruese_die_gema_unangebracht.png rename to app/src/main/res/drawable-nodpi/gruese_die_gema_unangebracht.png diff --git a/app/src/main/res/drawable/ic_arrow_back_white.png b/app/src/main/res/drawable-nodpi/ic_arrow_back_white.png similarity index 100% rename from app/src/main/res/drawable/ic_arrow_back_white.png rename to app/src/main/res/drawable-nodpi/ic_arrow_back_white.png diff --git a/app/src/main/res/drawable/ic_cast_black.png b/app/src/main/res/drawable-nodpi/ic_cast_black.png similarity index 100% rename from app/src/main/res/drawable/ic_cast_black.png rename to app/src/main/res/drawable-nodpi/ic_cast_black.png diff --git a/app/src/main/res/drawable/ic_file_download_black.png b/app/src/main/res/drawable-nodpi/ic_file_download_black.png similarity index 100% rename from app/src/main/res/drawable/ic_file_download_black.png rename to app/src/main/res/drawable-nodpi/ic_file_download_black.png diff --git a/app/src/main/res/drawable/ic_headset_black.png b/app/src/main/res/drawable-nodpi/ic_headset_black.png similarity index 100% rename from app/src/main/res/drawable/ic_headset_black.png rename to app/src/main/res/drawable-nodpi/ic_headset_black.png diff --git a/app/src/main/res/drawable/ic_play_arrow_black.png b/app/src/main/res/drawable-nodpi/ic_play_arrow_black.png similarity index 100% rename from app/src/main/res/drawable/ic_play_arrow_black.png rename to app/src/main/res/drawable-nodpi/ic_play_arrow_black.png diff --git a/app/src/main/res/drawable/ic_screen_rotation_white.png b/app/src/main/res/drawable-nodpi/ic_screen_rotation_white.png similarity index 100% rename from app/src/main/res/drawable/ic_screen_rotation_white.png rename to app/src/main/res/drawable-nodpi/ic_screen_rotation_white.png diff --git a/app/src/main/res/drawable/ic_share_black.png b/app/src/main/res/drawable-nodpi/ic_share_black.png similarity index 100% rename from app/src/main/res/drawable/ic_share_black.png rename to app/src/main/res/drawable-nodpi/ic_share_black.png diff --git a/app/src/main/res/drawable/ic_share_white.png b/app/src/main/res/drawable-nodpi/ic_share_white.png similarity index 100% rename from app/src/main/res/drawable/ic_share_white.png rename to app/src/main/res/drawable-nodpi/ic_share_white.png diff --git a/app/src/main/res/drawable/new_pipe_watermark.png b/app/src/main/res/drawable-nodpi/new_pipe_watermark.png similarity index 100% rename from app/src/main/res/drawable/new_pipe_watermark.png rename to app/src/main/res/drawable-nodpi/new_pipe_watermark.png diff --git a/app/src/main/res/drawable/not_available_monkey.png b/app/src/main/res/drawable-nodpi/not_available_monkey.png similarity index 100% rename from app/src/main/res/drawable/not_available_monkey.png rename to app/src/main/res/drawable-nodpi/not_available_monkey.png diff --git a/app/src/main/res/drawable/thumbs_down.png b/app/src/main/res/drawable-nodpi/thumbs_down.png similarity index 100% rename from app/src/main/res/drawable/thumbs_down.png rename to app/src/main/res/drawable-nodpi/thumbs_down.png diff --git a/app/src/main/res/drawable/thumbs_up.png b/app/src/main/res/drawable-nodpi/thumbs_up.png similarity index 100% rename from app/src/main/res/drawable/thumbs_up.png rename to app/src/main/res/drawable-nodpi/thumbs_up.png diff --git a/app/src/main/res/drawable/gruese_die_gema_original.png b/assets/gruese_die_gema_original.png similarity index 100% rename from app/src/main/res/drawable/gruese_die_gema_original.png rename to assets/gruese_die_gema_original.png From 2afee89de374717f50ef930635c67092ea348fdf Mon Sep 17 00:00:00 2001 From: Christian Schabesberger Date: Thu, 26 Nov 2015 18:47:36 +0100 Subject: [PATCH 07/21] added contentDescription for better accesebility --- app/src/main/res/layout-land/fragment_videoitem_detail.xml | 4 ++++ .../main/res/layout-sw600dp/fragment_videoitem_detail.xml | 4 ++++ app/src/main/res/layout/fragment_videoitem_detail.xml | 4 ++++ app/src/main/res/layout/video_item.xml | 1 + app/src/main/res/values/strings.xml | 7 +++++++ 5 files changed, 20 insertions(+) diff --git a/app/src/main/res/layout-land/fragment_videoitem_detail.xml b/app/src/main/res/layout-land/fragment_videoitem_detail.xml index a0138a3bb..dbbff1e45 100644 --- a/app/src/main/res/layout-land/fragment_videoitem_detail.xml +++ b/app/src/main/res/layout-land/fragment_videoitem_detail.xml @@ -31,6 +31,7 @@ android:layout_height="wrap_content"> VIDEO & AUDIO INFO ETC + + + Video preview thumbnail + Video preview thumbnail + Uploader thumbnail + Unlikes + Likes From 6ca9e52f2f3f1d75bb6c8e10fa654a68a4cbf66a Mon Sep 17 00:00:00 2001 From: Christian Schabesberger Date: Thu, 26 Nov 2015 19:11:31 +0100 Subject: [PATCH 08/21] made lint ignore some code and layout warnings --- app/src/main/AndroidManifest.xml | 4 +++- .../java/org/schabi/newpipe/VideoItemDetailFragment.java | 2 ++ .../res/layout-sw600dp-land/activity_videoitem_list.xml | 6 ++++-- app/src/main/res/values/settings_keys.xml | 2 +- 4 files changed, 10 insertions(+), 4 deletions(-) diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 07029455e..e29d0101d 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -1,5 +1,6 @@ @@ -10,7 +11,8 @@ android:icon="@mipmap/ic_launcher" android:logo="@mipmap/ic_launcher" android:label="@string/app_name" - android:theme="@style/AppTheme" > + android:theme="@style/AppTheme" + tools:ignore="AllowBackup"> diff --git a/app/src/main/java/org/schabi/newpipe/VideoItemDetailFragment.java b/app/src/main/java/org/schabi/newpipe/VideoItemDetailFragment.java index 8211962d0..3fe8a1548 100644 --- a/app/src/main/java/org/schabi/newpipe/VideoItemDetailFragment.java +++ b/app/src/main/java/org/schabi/newpipe/VideoItemDetailFragment.java @@ -1,5 +1,6 @@ package org.schabi.newpipe; +import android.annotation.SuppressLint; import android.app.Activity; import android.content.Intent; import android.content.SharedPreferences; @@ -241,6 +242,7 @@ public class VideoItemDetailFragment extends Fragment { thumbsUpView.setText(nf.format(info.like_count)); thumbsDownView.setText(nf.format(info.dislike_count)); + @SuppressLint("SimpleDateFormat") SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd"); Date datum = null; try { diff --git a/app/src/main/res/layout-sw600dp-land/activity_videoitem_list.xml b/app/src/main/res/layout-sw600dp-land/activity_videoitem_list.xml index bdf17b8af..ea7b16d2c 100644 --- a/app/src/main/res/layout-sw600dp-land/activity_videoitem_list.xml +++ b/app/src/main/res/layout-sw600dp-land/activity_videoitem_list.xml @@ -25,7 +25,8 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:iconifiedByDefault="false" - android:focusable="false"/> + android:focusable="false" + tools:ignore="InconsistentLayout" /> + android:layout_height="match_parent" + tools:ignore="InconsistentLayout" /> diff --git a/app/src/main/res/values/settings_keys.xml b/app/src/main/res/values/settings_keys.xml index f1cd7ebaf..de60976d7 100644 --- a/app/src/main/res/values/settings_keys.xml +++ b/app/src/main/res/values/settings_keys.xml @@ -1,5 +1,5 @@ - + settings_categoery_video_audio settings_category_video_info From e41c46c075f85f1a05e76e8497f7f1cad8d35bf5 Mon Sep 17 00:00:00 2001 From: Christian Schabesberger Date: Thu, 26 Nov 2015 19:28:50 +0100 Subject: [PATCH 09/21] made lint ignore that parentActivityName is not compatible to sdk 15 --- app/src/main/AndroidManifest.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index e29d0101d..896c914b7 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -71,7 +71,7 @@ android:configChanges="orientation|keyboardHidden|screenSize" android:theme="@style/FullscreenTheme" android:parentActivityName=".VideoItemDetailActivity" - > + tools:ignore="UnusedAttribute"> Date: Thu, 26 Nov 2015 19:36:14 +0100 Subject: [PATCH 10/21] update gradle/libs and use Perference.Editor.apply() instead of commit() --- app/build.gradle | 6 +++--- app/src/main/java/org/schabi/newpipe/PlayVideoActivity.java | 2 +- app/src/main/java/org/schabi/newpipe/SettingsActivity.java | 2 +- build.gradle | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index fb41271d9..e14fcbf16 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -21,9 +21,9 @@ android { dependencies { compile fileTree(include: ['*.jar'], dir: 'libs') - compile 'com.android.support:appcompat-v7:23.1.0' - compile 'com.android.support:support-v4:23.1.0' - compile 'com.android.support:design:23.1.0' + compile 'com.android.support:appcompat-v7:23.1.1' + compile 'com.android.support:support-v4:23.1.1' + compile 'com.android.support:design:23.1.1' compile 'org.jsoup:jsoup:1.8.3' compile 'org.mozilla:rhino:1.7.7' } diff --git a/app/src/main/java/org/schabi/newpipe/PlayVideoActivity.java b/app/src/main/java/org/schabi/newpipe/PlayVideoActivity.java index cf1593903..33a4b0b72 100644 --- a/app/src/main/java/org/schabi/newpipe/PlayVideoActivity.java +++ b/app/src/main/java/org/schabi/newpipe/PlayVideoActivity.java @@ -348,6 +348,6 @@ public class PlayVideoActivity extends AppCompatActivity { } SharedPreferences.Editor editor = prefs.edit(); editor.putBoolean(PREF_IS_LANDSCAPE, isLandscape); - editor.commit(); + editor.apply(); } } diff --git a/app/src/main/java/org/schabi/newpipe/SettingsActivity.java b/app/src/main/java/org/schabi/newpipe/SettingsActivity.java index 705978801..11313124d 100644 --- a/app/src/main/java/org/schabi/newpipe/SettingsActivity.java +++ b/app/src/main/java/org/schabi/newpipe/SettingsActivity.java @@ -162,7 +162,7 @@ public class SettingsActivity extends PreferenceActivity { Environment.getExternalStorageDirectory().getAbsolutePath() + "/NewPipe"; spEditor.putString(context.getString(R.string.downloadPathPreference) , newPipeDownloadStorage); - spEditor.commit(); + spEditor.apply(); } } } diff --git a/build.gradle b/build.gradle index 1b7886d14..a6fcfe1fe 100644 --- a/build.gradle +++ b/build.gradle @@ -5,7 +5,7 @@ buildscript { jcenter() } dependencies { - classpath 'com.android.tools.build:gradle:1.3.0' + classpath 'com.android.tools.build:gradle:1.5.0' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files From 237282db287249ed6fb04bf45034195884b600eb Mon Sep 17 00:00:00 2001 From: Christian Schabesberger Date: Thu, 26 Nov 2015 19:54:13 +0100 Subject: [PATCH 11/21] refactored VideoPlayer theme --- app/src/main/AndroidManifest.xml | 2 +- app/src/main/res/layout/activity_play_video.xml | 1 - app/src/main/res/values-v21/styles.xml | 9 +++++---- app/src/main/res/values/styles.xml | 9 +++++---- 4 files changed, 11 insertions(+), 10 deletions(-) diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 896c914b7..ea64136cb 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -69,7 +69,7 @@ diff --git a/app/src/main/res/layout/activity_play_video.xml b/app/src/main/res/layout/activity_play_video.xml index 433930f71..017c39ca9 100644 --- a/app/src/main/res/layout/activity_play_video.xml +++ b/app/src/main/res/layout/activity_play_video.xml @@ -2,7 +2,6 @@ xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" - android:background="@android:color/black" tools:context="org.schabi.newpipe.PlayVideoActivity" android:gravity="center"> diff --git a/app/src/main/res/values-v21/styles.xml b/app/src/main/res/values-v21/styles.xml index 7a7d2adb6..6c4c1939d 100644 --- a/app/src/main/res/values-v21/styles.xml +++ b/app/src/main/res/values-v21/styles.xml @@ -16,17 +16,18 @@ @color/primaryColorYoutube - - - - -