From 3d1cc348c832d598ac29dda32d0cc361a8547b02 Mon Sep 17 00:00:00 2001
From: Christian Schabesberger
Date: Tue, 31 Oct 2017 14:18:38 +0100
Subject: [PATCH 01/12] fix getUploaderName() and move on to v0.10.2
---
app/build.gradle | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/app/build.gradle b/app/build.gradle
index 5d718ea0e..17eac337d 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -8,8 +8,8 @@ android {
applicationId "org.schabi.newpipe"
minSdkVersion 15
targetSdkVersion 26
- versionCode 39
- versionName "0.10.1"
+ versionCode 40
+ versionName "0.10.2"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true
@@ -48,7 +48,8 @@ dependencies {
exclude module: 'support-annotations'
}
- compile 'com.github.TeamNewPipe:NewPipeExtractor:1df3f67'
+ compile 'com.github.TeamNewPipe:NewPipeExtractor:b9d0941'
+
testCompile 'junit:junit:4.12'
testCompile 'org.mockito:mockito-core:1.10.19'
From c485e7e167971eb82b8d5b10f5a67b565926eab9 Mon Sep 17 00:00:00 2001
From: Christian Schabesberger
Date: Sun, 5 Nov 2017 21:00:05 +0100
Subject: [PATCH 02/12] merge master
---
app/build.gradle | 5 -----
1 file changed, 5 deletions(-)
diff --git a/app/build.gradle b/app/build.gradle
index c127868b9..f7af72968 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -8,13 +8,8 @@ android {
applicationId "org.schabi.newpipe"
minSdkVersion 15
targetSdkVersion 26
-<<<<<<< HEAD
- versionCode 40
- versionName "0.10.2"
-=======
versionCode 41
versionName "0.11.0"
->>>>>>> dev
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true
From 91ff301d53c6b2654606c7b905045c9ef3c5266e Mon Sep 17 00:00:00 2001
From: John
Date: Wed, 6 Dec 2017 18:19:56 -0600
Subject: [PATCH 03/12] Pull up support lib version so all always match
---
app/build.gradle | 15 +++++++++------
build.gradle | 2 +-
2 files changed, 10 insertions(+), 7 deletions(-)
diff --git a/app/build.gradle b/app/build.gradle
index a761f5ccc..c8c615b0c 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -47,6 +47,9 @@ android {
}
}
+ext {
+ supportLibVersion = '27.0.2'
+}
dependencies {
androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2') {
exclude module: 'support-annotations'
@@ -57,11 +60,11 @@ dependencies {
testImplementation 'junit:junit:4.12'
testImplementation 'org.mockito:mockito-core:1.10.19'
- implementation 'com.android.support:appcompat-v7:27.0.1'
- implementation 'com.android.support:support-v4:27.0.1'
- implementation 'com.android.support:design:27.0.1'
- implementation 'com.android.support:recyclerview-v7:27.0.1'
- implementation 'com.android.support:preference-v14:27.0.1'
+ implementation "com.android.support:appcompat-v7:$supportLibVersion"
+ implementation "com.android.support:support-v4:$supportLibVersion"
+ implementation "com.android.support:design:$supportLibVersion"
+ implementation "com.android.support:recyclerview-v7:$supportLibVersion"
+ implementation "com.android.support:preference-v14:$supportLibVersion"
implementation 'com.google.code.gson:gson:2.8.2'
implementation 'ch.acra:acra:4.9.2'
@@ -76,7 +79,7 @@ dependencies {
debugImplementation 'com.facebook.stetho:stetho-urlconnection:1.5.0'
debugImplementation 'com.android.support:multidex:1.0.2'
- implementation 'io.reactivex.rxjava2:rxjava:2.1.6'
+ implementation 'io.reactivex.rxjava2:rxjava:2.1.7'
implementation 'io.reactivex.rxjava2:rxandroid:2.0.1'
implementation 'com.jakewharton.rxbinding2:rxbinding:2.0.0'
diff --git a/build.gradle b/build.gradle
index c0c46fdc2..fea1f7422 100644
--- a/build.gradle
+++ b/build.gradle
@@ -6,7 +6,7 @@ buildscript {
google()
}
dependencies {
- classpath 'com.android.tools.build:gradle:3.0.0'
+ classpath 'com.android.tools.build:gradle:3.0.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
From 0119d62a35ca111cf8a7600b64405343277b9b8e Mon Sep 17 00:00:00 2001
From: TobiGr
Date: Wed, 20 Dec 2017 16:13:33 +0100
Subject: [PATCH 04/12] change notification bar icon for popup and background
player
---
.../schabi/newpipe/player/BackgroundPlayer.java | 2 +-
.../schabi/newpipe/player/PopupVideoPlayer.java | 2 +-
.../drawable-hdpi/ic_newpipe_triangle_white.png | Bin 0 -> 570 bytes
.../drawable-mdpi/ic_newpipe_triangle_white.png | Bin 0 -> 328 bytes
.../drawable-xhdpi/ic_newpipe_triangle_white.png | Bin 0 -> 628 bytes
.../ic_newpipe_triangle_white.png | Bin 0 -> 1194 bytes
.../ic_newpipe_triangle_white.png | Bin 0 -> 1299 bytes
7 files changed, 2 insertions(+), 2 deletions(-)
create mode 100644 app/src/main/res/drawable-hdpi/ic_newpipe_triangle_white.png
create mode 100644 app/src/main/res/drawable-mdpi/ic_newpipe_triangle_white.png
create mode 100644 app/src/main/res/drawable-xhdpi/ic_newpipe_triangle_white.png
create mode 100644 app/src/main/res/drawable-xxhdpi/ic_newpipe_triangle_white.png
create mode 100644 app/src/main/res/drawable-xxxhdpi/ic_newpipe_triangle_white.png
diff --git a/app/src/main/java/org/schabi/newpipe/player/BackgroundPlayer.java b/app/src/main/java/org/schabi/newpipe/player/BackgroundPlayer.java
index f260b86a6..482f8f803 100644
--- a/app/src/main/java/org/schabi/newpipe/player/BackgroundPlayer.java
+++ b/app/src/main/java/org/schabi/newpipe/player/BackgroundPlayer.java
@@ -177,7 +177,7 @@ public final class BackgroundPlayer extends Service {
NotificationCompat.Builder builder = new NotificationCompat.Builder(this, getString(R.string.notification_channel_id))
.setOngoing(true)
- .setSmallIcon(R.drawable.ic_play_circle_filled_white_24dp)
+ .setSmallIcon(R.drawable.ic_newpipe_triangle_white)
.setVisibility(NotificationCompat.VISIBILITY_PUBLIC)
.setCustomContentView(notRemoteView)
.setCustomBigContentView(bigNotRemoteView);
diff --git a/app/src/main/java/org/schabi/newpipe/player/PopupVideoPlayer.java b/app/src/main/java/org/schabi/newpipe/player/PopupVideoPlayer.java
index d141dfaae..d4c374dfc 100644
--- a/app/src/main/java/org/schabi/newpipe/player/PopupVideoPlayer.java
+++ b/app/src/main/java/org/schabi/newpipe/player/PopupVideoPlayer.java
@@ -275,7 +275,7 @@ public final class PopupVideoPlayer extends Service {
return new NotificationCompat.Builder(this, getString(R.string.notification_channel_id))
.setOngoing(true)
- .setSmallIcon(R.drawable.ic_play_arrow_white)
+ .setSmallIcon(R.drawable.ic_newpipe_triangle_white)
.setVisibility(NotificationCompat.VISIBILITY_PUBLIC)
.setContent(notRemoteView);
}
diff --git a/app/src/main/res/drawable-hdpi/ic_newpipe_triangle_white.png b/app/src/main/res/drawable-hdpi/ic_newpipe_triangle_white.png
new file mode 100644
index 0000000000000000000000000000000000000000..cb26a5f65ea9524f064f423d5ccdf4a707bf8659
GIT binary patch
literal 570
zcmV-A0>%A_P)L=|;Nsv?>rk<%n~UNgif9G#
zYY+rc5T{xk9Q;5*v5I=_{Tz~mLoU7CM=m$?S@S0OC3*P2@0%c)uNn*8SdZSUEkO_j
z0rD8ZS!}|BtU)U=fp2(-6Bx)EbYECA_<$SOgTAamrTUF`IFGgH%oSrL2y?1Z&EgRbL~pnD
zX(%bEY{*A7+7pv8i-qk?p#6H}_7xBF^iK7^lW-wv}ZbwgFsea(1uupolVCqknOIcl+h
zPCl`PnWBIjyyQU7SS|uMMFo3!&4Dhkh;lH{wLX@<(RT*oTR
zv0>1(^#d~ZHSm_RZP%z50qpkxE`tFiSjBBl@jcdqw+NHCLn~9BxZvcvcV`ddsC#uLRp!TBwNYCiex3($U>3@nSX$>K^9ULk_8J3
z79$$JYUD>|JTo7Qd!L?Z^v=ES-8pyaeb?vSzTbP#IrrWB+S*#QC_q+$0#<;*MKVDa2b7N4EUN}=@5S6C>EC~;0O+3
zEHL6Xo?uT|0`{e2dT~Q?M?#p!b!;p}Ksv4y{kR(#0UvQek-JrBK+X6r$y|S)A>`1)pYTk0k;FiE4Yevg^A}37^x%v3y-j?aPa~HzT*J8
z=S;py0pqxcHFGN7gn%i$!ulxUHBxy3UgDr4cb8By1`Oj;Da5N}4Cpn_KJMoFIX$P;
z3D^vOKi6wW(2&!Ky0T>qye9C0?T9jWX62|qq{|mF#Z6F7vTgoH!`yT
O0000J9Ki9tVq04#_C}hv6k}e(!IBZ06EAsRPOOzsBIKpW4x~slWjPQv3QL^qgkdqn
z0U^sv!xkZC_QJNu^X&dO_}%|JJ>9n5|F`RZKfAx@_w~Q7Z};zi{eHjey6-V#`t<43
zr{Q2M#$jygxik_?#RAO5;i>1-IB*=E#0FfCV=y80yc$DW&?>-@CdyJ#70>5Lhpr|i!0VX#>R2hQWjB
zEW_)fM9C{>5TA>kZIQAw@45wH8kXQ$v1R8iNm?RhcpjIkDmSW2kl4Kziu3(X@K;VT
zMAPjp+^FiCCv^zIOx!Hq5nJUCry+cWdvUrtj+LquBw7|r@QQc|7pd^Kiev6`#qGD=
zEj2{zV*#GRcVY|9%K+AiQe`H_SM6lvVoDPvw(X;FyW&-ROLQu46YY*Pee1FW;V{vF
ze-k?t>jMpmaGEFeWvwyBL#aSuVSD16{BzwIXPMs)0&;-1S2StCmcf+X@B?uZTPC1*K>=mJ?pixg>&;jT|&|1t*
zJ>S|n2tnJ#@o?{D!DX-?K?CAPy~{D*XnhGEhz^2U;-dEooT+KIPU~ibpdIaSI$zve
zt@i|>iL?c+6gMNT6aD2w^EdLH(EoFj{iFZ)IDPu`>63(i0eb*pfwyLL-2eap07*qo
IM6N<$f+8q9FaQ7m
literal 0
HcmV?d00001
diff --git a/app/src/main/res/drawable-xxxhdpi/ic_newpipe_triangle_white.png b/app/src/main/res/drawable-xxxhdpi/ic_newpipe_triangle_white.png
new file mode 100644
index 0000000000000000000000000000000000000000..93cfda12d8424237caeb1d2ba40e3f0bb3170ad3
GIT binary patch
literal 1299
zcmV+u1?>8XP)eS4jwjw%!i
zg+ifFC=|K_EW@hQar7;?1|wLFt5e6*cT@zx5MIVSOiLYGUob{Mo8Rzo>e%{%!w6`z
z4l6J-b(}rR5d^?KyoWidW9>=CA)w8EJb=?v$J|p)Kmd$l3znyjyJwi7fGY1}S?c(^
zo+$`u^At`rN--omWZxpf5*1hmACyH{QnL)cIydLjtPYhuNv~&V~d6M({0eOr3icBoI*L9V|>;
zgQO%D0Ne2*j!RvOBxE3<&G)zk$E2=FqsT`9;k9)wE=^sR#xOYnYlQuuSZu@dI6HNH
zqGNIbp2pl(k@nYH`wsTuR?J9Ur)Zd@fXd%5!3Q-LzRHNO$#-SSIz_`21+=a)4L9M}
zNnC5Z4C5u7k*ZcvP=kQVwdUb*;n5L`Ex2E=Olqi6K;@d};8S5EE*9TlC5~;XR#6Z^
zK24t$PQ9_z0&qQL8A3B%pHr>9`j^*IWAzcH=QDh*_&Bh%BITpILZQm_Loh
zPF#ZNF=`bB4GE~+ZzwuTG@wBi`Ra_p$J?49hvCw0d@C1fI?
z63;9=ioa_vewEF5NDfUPnF$yZ+n2&bb}Y8xJSqQ4%Ui%eE55b$*1dxRLT~!aCUQDd
zlGzFv6Xz57v*zND
z94XPP1mG;ZE^b@%Ct=zmeOpr|0&qO;#NK*qeUMS%f5>Zf$37)wAOM#OkDHjynh$Y4
zj;=HIDI;A!U^*5HU9wmV3#0JY*HNn|NFV@n@T{=&8S9;XNZ4?jt2AT|-fISK5O=P0
z5O3&~?+!HAlwXAJgvUZGeh_AoN>jda{RMaqf7M&-4z}WM-FRezc!OCpg{A%OdTZUm
zzj#Fsjg`qF&S>I7d@ekXW3d{S$*spbQN$5&g?J72jksA3tJpfwJp%UP8JyNsZ5l!T
z0*3IJFj3b%Z#Uy5a{-%Lg&%0D9*vW!fUS5^sz!N}WF}w;Ur5y)NkJw8Mp}ixPOrS(
zjF$`q{2^@2b?;(oDkKyzD12wUsHt4DB!Pef!lc`^P34$14GY*KoFi8bY--bxfE~i<
zM}I$V4n<@E!@^>!e@;J{C=mtxC~Qaf*K6fOi6r18-M&rS6fp!8CO{F8m?9uCML=RE
zC}30==U$mQ?w(-+0(RjMftO?Xhhono7U
zF#<+~kCyX3;-#0U2v{Q=mXX&7484x>gU*FQp-?Ck3WY*9^B+Ke<~kb1Tb%#^002ov
JPDHLkV1n*lPV@i(
literal 0
HcmV?d00001
From ec8fff421a732662c889327368bec7bbc034dd11 Mon Sep 17 00:00:00 2001
From: Christian Schabesberger
Date: Fri, 22 Dec 2017 16:53:43 +0100
Subject: [PATCH 05/12] fix avatar not vissible on info screen bug
---
.../schabi/newpipe/fragments/detail/VideoDetailFragment.java | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/app/src/main/java/org/schabi/newpipe/fragments/detail/VideoDetailFragment.java b/app/src/main/java/org/schabi/newpipe/fragments/detail/VideoDetailFragment.java
index 2f73e7582..5b445e813 100644
--- a/app/src/main/java/org/schabi/newpipe/fragments/detail/VideoDetailFragment.java
+++ b/app/src/main/java/org/schabi/newpipe/fragments/detail/VideoDetailFragment.java
@@ -545,8 +545,8 @@ public class VideoDetailFragment extends BaseStateFragment implement
}
});
}
-
- if (TextUtils.isEmpty(info.getUploaderAvatarUrl())) {
+
+ if (!TextUtils.isEmpty(info.getUploaderAvatarUrl())) {
imageLoader.displayImage(info.getUploaderAvatarUrl(), uploaderThumb, DISPLAY_AVATAR_OPTIONS);
}
}
From 3c941f6c4bb440c01f960f66fa5f0a7c619fb673 Mon Sep 17 00:00:00 2001
From: Tobias Groza
Date: Sat, 23 Dec 2017 16:35:40 +0100
Subject: [PATCH 06/12] Add website, blog and press kit to README.MD
---
README.md | 1 +
1 file changed, 1 insertion(+)
diff --git a/README.md b/README.md
index 08d3fb49e..030963a89 100644
--- a/README.md
+++ b/README.md
@@ -13,6 +13,7 @@
Screenshots • Description • Features • Contribution • Donate • License
+Website • Blog • Press
WARNING: PUTTING NEWPIPE OR ANY FORK OF IT INTO GOOGLE PLAYSTORE VIOLATES THEIR TERMS OF CONDITIONS.
From 9f5d4034e3f22d4f0633f8d62947d4f605bb247d Mon Sep 17 00:00:00 2001
From: Schabi
Date: Sat, 23 Dec 2017 17:34:47 +0100
Subject: [PATCH 07/12] fix fullscreen button on popup
---
.../java/org/schabi/newpipe/player/PopupVideoPlayer.java | 9 +++++++++
.../main/java/org/schabi/newpipe/player/VideoPlayer.java | 8 +++++++-
app/src/main/res/layout/player_popup.xml | 1 +
3 files changed, 17 insertions(+), 1 deletion(-)
diff --git a/app/src/main/java/org/schabi/newpipe/player/PopupVideoPlayer.java b/app/src/main/java/org/schabi/newpipe/player/PopupVideoPlayer.java
index d4c374dfc..50a02beec 100644
--- a/app/src/main/java/org/schabi/newpipe/player/PopupVideoPlayer.java
+++ b/app/src/main/java/org/schabi/newpipe/player/PopupVideoPlayer.java
@@ -44,6 +44,7 @@ import android.view.Gravity;
import android.view.MotionEvent;
import android.view.View;
import android.view.WindowManager;
+import android.widget.ImageButton;
import android.widget.PopupMenu;
import android.widget.RemoteViews;
import android.widget.SeekBar;
@@ -401,6 +402,7 @@ public final class PopupVideoPlayer extends Service {
protected class VideoPlayerImpl extends VideoPlayer {
private TextView resizingIndicator;
+ private ImageButton fullScreenButton;
@Override
public void handleIntent(Intent intent) {
@@ -418,6 +420,13 @@ public final class PopupVideoPlayer extends Service {
public void initViews(View rootView) {
super.initViews(rootView);
resizingIndicator = rootView.findViewById(R.id.resizing_indicator);
+ fullScreenButton = rootView.findViewById(R.id.fullScreenButton);
+ fullScreenButton.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ onFullScreenButtonClicked();
+ }
+ });
}
@Override
diff --git a/app/src/main/java/org/schabi/newpipe/player/VideoPlayer.java b/app/src/main/java/org/schabi/newpipe/player/VideoPlayer.java
index c3d52aeae..a3c8b53dc 100644
--- a/app/src/main/java/org/schabi/newpipe/player/VideoPlayer.java
+++ b/app/src/main/java/org/schabi/newpipe/player/VideoPlayer.java
@@ -75,7 +75,13 @@ import static org.schabi.newpipe.util.AnimationUtils.animateView;
* @author mauriciocolli
*/
@SuppressWarnings({"WeakerAccess", "unused"})
-public abstract class VideoPlayer extends BasePlayer implements SimpleExoPlayer.VideoListener, SeekBar.OnSeekBarChangeListener, View.OnClickListener, Player.EventListener, PopupMenu.OnMenuItemClickListener, PopupMenu.OnDismissListener {
+public abstract class VideoPlayer extends BasePlayer
+ implements SimpleExoPlayer.VideoListener,
+ SeekBar.OnSeekBarChangeListener,
+ View.OnClickListener,
+ Player.EventListener,
+ PopupMenu.OnMenuItemClickListener,
+ PopupMenu.OnDismissListener {
public static final boolean DEBUG = BasePlayer.DEBUG;
public final String TAG;
diff --git a/app/src/main/res/layout/player_popup.xml b/app/src/main/res/layout/player_popup.xml
index fb3d6920e..299b3b110 100644
--- a/app/src/main/res/layout/player_popup.xml
+++ b/app/src/main/res/layout/player_popup.xml
@@ -92,6 +92,7 @@
android:layout_alignParentRight="true"
android:background="#00ffffff"
android:clickable="true"
+ android:focusable="true"
android:scaleType="fitCenter"
android:src="@drawable/ic_fullscreen_white"
tools:ignore="ContentDescription,RtlHardcoded"/>
From 7db8d3713711748539c4b8b87e017d0467b6ccb3 Mon Sep 17 00:00:00 2001
From: Schabi
Date: Sun, 24 Dec 2017 12:17:41 +0100
Subject: [PATCH 08/12] update extractor and move on to version v0.11.2
---
app/build.gradle | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/app/build.gradle b/app/build.gradle
index 08b6b77fd..46e63a082 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -8,8 +8,8 @@ android {
applicationId "org.schabi.newpipe"
minSdkVersion 15
targetSdkVersion 27
- versionCode 42
- versionName "0.11.1"
+ versionCode 43
+ versionName "0.11.2"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true
@@ -55,7 +55,7 @@ dependencies {
exclude module: 'support-annotations'
}
- implementation 'com.github.TeamNewPipe:NewPipeExtractor:17ce9f537e8df'
+ implementation 'com.github.TeamNewPipe:NewPipeExtractor:2d191c4ca'
testImplementation 'junit:junit:4.12'
testImplementation 'org.mockito:mockito-core:1.10.19'
From a7a76d4f58ed267b288e06d5d51c04fd3215a9af Mon Sep 17 00:00:00 2001
From: Schabi
Date: Tue, 26 Dec 2017 14:48:06 +0100
Subject: [PATCH 09/12] add beta 2 logo
---
assets/new_pipe_icon_5_beta2.svg | 565 +++++++++++++++++++++++++++++++
1 file changed, 565 insertions(+)
create mode 100644 assets/new_pipe_icon_5_beta2.svg
diff --git a/assets/new_pipe_icon_5_beta2.svg b/assets/new_pipe_icon_5_beta2.svg
new file mode 100644
index 000000000..d74fd8722
--- /dev/null
+++ b/assets/new_pipe_icon_5_beta2.svg
@@ -0,0 +1,565 @@
+
+
From 50c5314eaff78bddd956a2f6d8d1d78dc885a64b Mon Sep 17 00:00:00 2001
From: Schabi
Date: Fri, 29 Dec 2017 15:02:23 +0100
Subject: [PATCH 10/12] fix yt trending content language
---
app/build.gradle | 2 +-
.../fragments/list/kiosk/KioskFragment.java | 7 ++++++-
.../schabi/newpipe/util/ExtractorHelper.java | 19 ++++++++++++++++---
3 files changed, 23 insertions(+), 5 deletions(-)
diff --git a/app/build.gradle b/app/build.gradle
index 46e63a082..50fa6ab12 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -55,7 +55,7 @@ dependencies {
exclude module: 'support-annotations'
}
- implementation 'com.github.TeamNewPipe:NewPipeExtractor:2d191c4ca'
+ implementation 'com.github.TeamNewPipe:NewPipeExtractor:044b8fe32f47e28'
testImplementation 'junit:junit:4.12'
testImplementation 'org.mockito:mockito-core:1.10.19'
diff --git a/app/src/main/java/org/schabi/newpipe/fragments/list/kiosk/KioskFragment.java b/app/src/main/java/org/schabi/newpipe/fragments/list/kiosk/KioskFragment.java
index c50a8a66a..ad0d0432f 100644
--- a/app/src/main/java/org/schabi/newpipe/fragments/list/kiosk/KioskFragment.java
+++ b/app/src/main/java/org/schabi/newpipe/fragments/list/kiosk/KioskFragment.java
@@ -5,6 +5,7 @@ import android.preference.PreferenceManager;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v7.app.ActionBar;
+import android.util.Log;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuInflater;
@@ -153,7 +154,11 @@ public class KioskFragment extends BaseListInfoFragment {
@Override
public Single loadMoreItemsLogic() {
- return ExtractorHelper.getMoreKioskItems(serviceId, url, currentNextItemsUrl);
+ String contentCountry = PreferenceManager
+ .getDefaultSharedPreferences(activity)
+ .getString(getString(R.string.search_language_key),
+ getString(R.string.default_language_value));
+ return ExtractorHelper.getMoreKioskItems(serviceId, url, currentNextItemsUrl, contentCountry);
}
/*//////////////////////////////////////////////////////////////////////////
diff --git a/app/src/main/java/org/schabi/newpipe/util/ExtractorHelper.java b/app/src/main/java/org/schabi/newpipe/util/ExtractorHelper.java
index 4763b6a02..5293ff3d6 100644
--- a/app/src/main/java/org/schabi/newpipe/util/ExtractorHelper.java
+++ b/app/src/main/java/org/schabi/newpipe/util/ExtractorHelper.java
@@ -143,16 +143,16 @@ public final class ExtractorHelper {
return checkCache(forceLoad, serviceId, url, Single.fromCallable(new Callable() {
@Override
public KioskInfo call() throws Exception {
- return KioskInfo.getInfo(NewPipe.getService(serviceId), url, contentCountry);
+ return KioskInfo.getInfo(NewPipe.getService(serviceId), url, toUpperCase(contentCountry));
}
}));
}
- public static Single getMoreKioskItems(final int serviceId, final String url, final String nextStreamsUrl) {
+ public static Single getMoreKioskItems(final int serviceId, final String url, final String nextStreamsUrl, final String contentCountry) {
return Single.fromCallable(new Callable() {
@Override
public NextItemsResult call() throws Exception {
- return KioskInfo.getMoreItems(NewPipe.getService(serviceId), url, nextStreamsUrl);
+ return KioskInfo.getMoreItems(NewPipe.getService(serviceId), url, nextStreamsUrl, toUpperCase(contentCountry));
}
});
}
@@ -267,4 +267,17 @@ public final class ExtractorHelper {
public static boolean isInterruptedCaused(Throwable throwable) {
return ExtractorHelper.hasExactCauseThrowable(throwable, InterruptedIOException.class, InterruptedException.class);
}
+
+ public static String toUpperCase(String value) {
+ StringBuilder sb = new StringBuilder(value);
+ for (int index = 0; index < sb.length(); index++) {
+ char c = sb.charAt(index);
+ if (Character.isLowerCase(c)) {
+ sb.setCharAt(index, Character.toUpperCase(c));
+ } else {
+ sb.setCharAt(index, Character.toLowerCase(c));
+ }
+ }
+ return sb.toString();
+ }
}
From 11e8e38f2cf879f6f4a4d62ed6278dcbe17e3b9f Mon Sep 17 00:00:00 2001
From: Schabi
Date: Fri, 29 Dec 2017 17:29:15 +0100
Subject: [PATCH 11/12] setup context for making notifications open via
setContextIntent()
---
.../newpipe/player/BackgroundPlayer.java | 7 ++----
.../schabi/newpipe/util/NavigationHelper.java | 22 +++++++++++++++----
.../main/res/layout/player_notification.xml | 2 --
.../layout/player_notification_expanded.xml | 2 --
4 files changed, 20 insertions(+), 13 deletions(-)
diff --git a/app/src/main/java/org/schabi/newpipe/player/BackgroundPlayer.java b/app/src/main/java/org/schabi/newpipe/player/BackgroundPlayer.java
index 482f8f803..2334031ee 100644
--- a/app/src/main/java/org/schabi/newpipe/player/BackgroundPlayer.java
+++ b/app/src/main/java/org/schabi/newpipe/player/BackgroundPlayer.java
@@ -180,7 +180,8 @@ public final class BackgroundPlayer extends Service {
.setSmallIcon(R.drawable.ic_newpipe_triangle_white)
.setVisibility(NotificationCompat.VISIBILITY_PUBLIC)
.setCustomContentView(notRemoteView)
- .setCustomBigContentView(bigNotRemoteView);
+ .setCustomBigContentView(bigNotRemoteView)
+ .setContentIntent(NavigationHelper.getServicePlayerControlPendingIntent(this, BackgroundPlayerActivity.class));
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.JELLY_BEAN) builder.setPriority(NotificationCompat.PRIORITY_MAX);
return builder;
}
@@ -453,7 +454,6 @@ public final class BackgroundPlayer extends Service {
super.setupBroadcastReceiver(intentFilter);
intentFilter.addAction(ACTION_CLOSE);
intentFilter.addAction(ACTION_PLAY_PAUSE);
- intentFilter.addAction(ACTION_OPEN_CONTROLS);
intentFilter.addAction(ACTION_REPEAT);
intentFilter.addAction(ACTION_PLAY_PREVIOUS);
intentFilter.addAction(ACTION_PLAY_NEXT);
@@ -478,9 +478,6 @@ public final class BackgroundPlayer extends Service {
case ACTION_PLAY_PAUSE:
onVideoPlayPause();
break;
- case ACTION_OPEN_CONTROLS:
- NavigationHelper.openBackgroundPlayerControl(getApplicationContext());
- break;
case ACTION_REPEAT:
onRepeatClicked();
break;
diff --git a/app/src/main/java/org/schabi/newpipe/util/NavigationHelper.java b/app/src/main/java/org/schabi/newpipe/util/NavigationHelper.java
index e59ad10b2..4475356fa 100644
--- a/app/src/main/java/org/schabi/newpipe/util/NavigationHelper.java
+++ b/app/src/main/java/org/schabi/newpipe/util/NavigationHelper.java
@@ -1,6 +1,7 @@
package org.schabi.newpipe.util;
import android.app.Activity;
+import android.app.PendingIntent;
import android.content.ActivityNotFoundException;
import android.content.Context;
import android.content.Intent;
@@ -45,6 +46,8 @@ import org.schabi.newpipe.settings.SettingsActivity;
public class NavigationHelper {
public static final String MAIN_FRAGMENT_TAG = "main_fragment_tag";
+ public static final int PENDING_INTENT_OPEN_PLAYER_ACTIVITY = 1546;
+
/*//////////////////////////////////////////////////////////////////////////
// Players
//////////////////////////////////////////////////////////////////////////*/
@@ -269,13 +272,24 @@ public class NavigationHelper {
openServicePlayerControl(context, PopupVideoPlayerActivity.class);
}
- private static void openServicePlayerControl(final Context context, final Class clazz) {
- final Intent intent = new Intent(context, clazz);
+ private static void openServicePlayerControl(final Context context, final Class activityClass) {
+ Intent intent = getServicePlayerControlIntent(context, activityClass);
+ context.startActivity(intent);
+ context.sendBroadcast(new Intent(Intent.ACTION_CLOSE_SYSTEM_DIALOGS));
+ }
+
+ public static Intent getServicePlayerControlIntent(final Context context, final Class activityClass) {
+ final Intent intent = new Intent(context, activityClass);
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.N) {
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
}
- context.startActivity(intent);
- context.sendBroadcast(new Intent(Intent.ACTION_CLOSE_SYSTEM_DIALOGS));
+ return intent;
+ }
+
+ public static PendingIntent getServicePlayerControlPendingIntent(final Context context, final Class activityClass) {
+ Intent intent = getServicePlayerControlIntent(context, activityClass);
+ PendingIntent pIntent = PendingIntent.getActivity(context, PENDING_INTENT_OPEN_PLAYER_ACTIVITY, intent, 0);
+ return pIntent;
}
/*//////////////////////////////////////////////////////////////////////////
diff --git a/app/src/main/res/layout/player_notification.xml b/app/src/main/res/layout/player_notification.xml
index 2a3e7aff3..bab0c9db3 100644
--- a/app/src/main/res/layout/player_notification.xml
+++ b/app/src/main/res/layout/player_notification.xml
@@ -11,8 +11,6 @@
android:layout_width="match_parent"
android:layout_height="64dp"
android:background="@color/background_notification_color"
- android:clickable="true"
- android:focusable="true"
android:gravity="center_vertical"
android:orientation="horizontal">
diff --git a/app/src/main/res/layout/player_notification_expanded.xml b/app/src/main/res/layout/player_notification_expanded.xml
index 7d59720e0..090642303 100644
--- a/app/src/main/res/layout/player_notification_expanded.xml
+++ b/app/src/main/res/layout/player_notification_expanded.xml
@@ -6,8 +6,6 @@
android:layout_width="match_parent"
android:layout_height="128dp"
android:background="@color/background_notification_color"
- android:clickable="true"
- android:focusable="true"
android:gravity="center_vertical"
android:orientation="horizontal">
From 7f88c3d0a93e9f6ec31c57feb6eb5b080b9784bd Mon Sep 17 00:00:00 2001
From: Schabi
Date: Sat, 30 Dec 2017 00:27:29 +0100
Subject: [PATCH 12/12] roleback wrong fix
---
.../java/org/schabi/newpipe/player/BackgroundPlayer.java | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/app/src/main/java/org/schabi/newpipe/player/BackgroundPlayer.java b/app/src/main/java/org/schabi/newpipe/player/BackgroundPlayer.java
index 2334031ee..482f8f803 100644
--- a/app/src/main/java/org/schabi/newpipe/player/BackgroundPlayer.java
+++ b/app/src/main/java/org/schabi/newpipe/player/BackgroundPlayer.java
@@ -180,8 +180,7 @@ public final class BackgroundPlayer extends Service {
.setSmallIcon(R.drawable.ic_newpipe_triangle_white)
.setVisibility(NotificationCompat.VISIBILITY_PUBLIC)
.setCustomContentView(notRemoteView)
- .setCustomBigContentView(bigNotRemoteView)
- .setContentIntent(NavigationHelper.getServicePlayerControlPendingIntent(this, BackgroundPlayerActivity.class));
+ .setCustomBigContentView(bigNotRemoteView);
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.JELLY_BEAN) builder.setPriority(NotificationCompat.PRIORITY_MAX);
return builder;
}
@@ -454,6 +453,7 @@ public final class BackgroundPlayer extends Service {
super.setupBroadcastReceiver(intentFilter);
intentFilter.addAction(ACTION_CLOSE);
intentFilter.addAction(ACTION_PLAY_PAUSE);
+ intentFilter.addAction(ACTION_OPEN_CONTROLS);
intentFilter.addAction(ACTION_REPEAT);
intentFilter.addAction(ACTION_PLAY_PREVIOUS);
intentFilter.addAction(ACTION_PLAY_NEXT);
@@ -478,6 +478,9 @@ public final class BackgroundPlayer extends Service {
case ACTION_PLAY_PAUSE:
onVideoPlayPause();
break;
+ case ACTION_OPEN_CONTROLS:
+ NavigationHelper.openBackgroundPlayerControl(getApplicationContext());
+ break;
case ACTION_REPEAT:
onRepeatClicked();
break;