From ed4b4a1a3ca0ccf570d275a07ced98555cd32105 Mon Sep 17 00:00:00 2001 From: Alec Holmes Date: Fri, 1 Feb 2019 13:02:28 +0000 Subject: [PATCH 1/7] Updated search fragment to be amazon fire tv friendly --- .../java/org/schabi/newpipe/firetv/FireTvUtils.java | 11 +++++++++++ .../fragments/list/search/SearchFragment.java | 13 +++++++++---- app/src/main/res/layout/toolbar_search_layout.xml | 4 +++- 3 files changed, 23 insertions(+), 5 deletions(-) create mode 100644 app/src/main/java/org/schabi/newpipe/firetv/FireTvUtils.java diff --git a/app/src/main/java/org/schabi/newpipe/firetv/FireTvUtils.java b/app/src/main/java/org/schabi/newpipe/firetv/FireTvUtils.java new file mode 100644 index 000000000..305c29ee7 --- /dev/null +++ b/app/src/main/java/org/schabi/newpipe/firetv/FireTvUtils.java @@ -0,0 +1,11 @@ +package org.schabi.newpipe.firetv; + +import android.content.Context; +import org.schabi.newpipe.App; + +public class FireTvUtils { + public static boolean isFireTv(){ + final String AMAZON_FEATURE_FIRE_TV = "amazon.hardware.fire_tv"; + return App.getApp().getPackageManager().hasSystemFeature(AMAZON_FEATURE_FIRE_TV); + } +} diff --git a/app/src/main/java/org/schabi/newpipe/fragments/list/search/SearchFragment.java b/app/src/main/java/org/schabi/newpipe/fragments/list/search/SearchFragment.java index 2833abb8d..0e8aad01d 100644 --- a/app/src/main/java/org/schabi/newpipe/fragments/list/search/SearchFragment.java +++ b/app/src/main/java/org/schabi/newpipe/fragments/list/search/SearchFragment.java @@ -39,6 +39,7 @@ import org.schabi.newpipe.extractor.StreamingService; import org.schabi.newpipe.extractor.exceptions.ParsingException; import org.schabi.newpipe.extractor.search.SearchExtractor; import org.schabi.newpipe.extractor.search.SearchInfo; +import org.schabi.newpipe.firetv.FireTvUtils; import org.schabi.newpipe.fragments.BackPressable; import org.schabi.newpipe.fragments.list.BaseListFragment; import org.schabi.newpipe.local.history.HistoryRecordManager; @@ -449,6 +450,9 @@ public class SearchFragment if (isSuggestionsEnabled && errorPanelRoot.getVisibility() != View.VISIBLE) { showSuggestionsPanel(); } + if(FireTvUtils.isFireTv()){ + showKeyboardSearch(); + } }); searchEditText.setOnFocusChangeListener((View v, boolean hasFocus) -> { @@ -499,7 +503,9 @@ public class SearchFragment if (DEBUG) { Log.d(TAG, "onEditorAction() called with: v = [" + v + "], actionId = [" + actionId + "], event = [" + event + "]"); } - if (event != null + if(actionId == EditorInfo.IME_ACTION_PREVIOUS){ + hideKeyboardSearch(); + } else if (event != null && (event.getKeyCode() == KeyEvent.KEYCODE_ENTER || event.getAction() == EditorInfo.IME_ACTION_SEARCH)) { search(searchEditText.getText().toString(), new String[0], ""); @@ -541,7 +547,7 @@ public class SearchFragment if (searchEditText.requestFocus()) { InputMethodManager imm = (InputMethodManager) activity.getSystemService( Context.INPUT_METHOD_SERVICE); - imm.showSoftInput(searchEditText, InputMethodManager.SHOW_IMPLICIT); + imm.showSoftInput(searchEditText, InputMethodManager.SHOW_FORCED); } } @@ -551,8 +557,7 @@ public class SearchFragment InputMethodManager imm = (InputMethodManager) activity.getSystemService( Context.INPUT_METHOD_SERVICE); - imm.hideSoftInputFromWindow(searchEditText.getWindowToken(), - InputMethodManager.HIDE_NOT_ALWAYS); + imm.hideSoftInputFromWindow(searchEditText.getWindowToken(), InputMethodManager.RESULT_UNCHANGED_SHOWN); searchEditText.clearFocus(); } diff --git a/app/src/main/res/layout/toolbar_search_layout.xml b/app/src/main/res/layout/toolbar_search_layout.xml index 797eea48e..9e9e51442 100644 --- a/app/src/main/res/layout/toolbar_search_layout.xml +++ b/app/src/main/res/layout/toolbar_search_layout.xml @@ -30,7 +30,9 @@ android:layout_width="48dp" android:layout_height="48dp" android:layout_gravity="right|center_vertical" - tools:ignore="RtlHardcoded"> + android:focusable="true" + tools:ignore="RtlHardcoded" + android:background="?attr/selectableItemBackground"> Date: Sat, 9 Feb 2019 12:30:14 +0100 Subject: [PATCH 2/7] added support for youtube-nocookie.com --- app/src/main/AndroidManifest.xml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 06d621016..db2d5f13c 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -183,6 +183,19 @@ + + + + + + + + + + + + + From 9437f057d0e2a5f242cf8aae9ce5376c8b3b4f72 Mon Sep 17 00:00:00 2001 From: Redirion Date: Thu, 14 Feb 2019 09:52:46 +0100 Subject: [PATCH 3/7] Fix delayed ducking of Audio Scenario: listening to a video on NewPipe over Bluetooth and a Notification Sound causes audio focus event AUDIOFOCUS_LOSS_TRANSIENT_CAN_DUCK. Problem: With the current implementation animateAudio would cause the audio to reach the target volume AFTER the notification sound is played, which is irritating and annoying. Solution: animateAudio should just be used on focusGain where it is sensible to increase audio gradually. On ducking event the reaction should be immediate. This very simple fix does this. Please approve. --- .../java/org/schabi/newpipe/player/helper/AudioReactor.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/org/schabi/newpipe/player/helper/AudioReactor.java b/app/src/main/java/org/schabi/newpipe/player/helper/AudioReactor.java index 46d20c7e1..f148aed27 100644 --- a/app/src/main/java/org/schabi/newpipe/player/helper/AudioReactor.java +++ b/app/src/main/java/org/schabi/newpipe/player/helper/AudioReactor.java @@ -131,7 +131,7 @@ public class AudioReactor implements AudioManager.OnAudioFocusChangeListener, private void onAudioFocusLossCanDuck() { Log.d(TAG, "onAudioFocusLossCanDuck() called"); // Set the volume to 1/10 on ducking - animateAudio(player.getVolume(), DUCK_AUDIO_TO); + player.setVolume(DUCK_AUDIO_TO); } private void animateAudio(final float from, final float to) { From db9cf9564820fbf1bbd6087d3e6b3189d69d2e13 Mon Sep 17 00:00:00 2001 From: TobiGr Date: Sun, 17 Feb 2019 09:52:05 +0100 Subject: [PATCH 4/7] Remove old player from the manifest See https://github.com/TeamNewPipe/NewPipe/pull/1884 for more info --- app/src/main/AndroidManifest.xml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 06d621016..af6dda798 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -35,12 +35,6 @@ - - From 4dd572063ef5b38d9c31e66b306e47727702e106 Mon Sep 17 00:00:00 2001 From: kapodamy Date: Sun, 17 Feb 2019 16:59:35 -0300 Subject: [PATCH 5/7] fix crash while switching from popup to fullscreen player, or closing the popup player. --- .../main/java/org/schabi/newpipe/player/PopupVideoPlayer.java | 1 + 1 file changed, 1 insertion(+) 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 f5c731ed9..8ea3d509c 100644 --- a/app/src/main/java/org/schabi/newpipe/player/PopupVideoPlayer.java +++ b/app/src/main/java/org/schabi/newpipe/player/PopupVideoPlayer.java @@ -626,6 +626,7 @@ public final class PopupVideoPlayer extends Service { @Override public void onLoadingComplete(String imageUri, View view, Bitmap loadedImage) { super.onLoadingComplete(imageUri, view, loadedImage); + if (playerImpl == null) return; // rebuild notification here since remote view does not release bitmaps, // causing memory leaks resetNotification(); From 4b5591d8844a3255e3e83eada605cd3b4b781f29 Mon Sep 17 00:00:00 2001 From: Christian Schabesberger Date: Tue, 19 Feb 2019 14:57:49 +0100 Subject: [PATCH 6/7] move firetv utils into utils package --- .../schabi/newpipe/fragments/list/search/SearchFragment.java | 2 +- .../java/org/schabi/newpipe/{firetv => util}/FireTvUtils.java | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) rename app/src/main/java/org/schabi/newpipe/{firetv => util}/FireTvUtils.java (80%) diff --git a/app/src/main/java/org/schabi/newpipe/fragments/list/search/SearchFragment.java b/app/src/main/java/org/schabi/newpipe/fragments/list/search/SearchFragment.java index 87ebf14d2..e20d6bad3 100644 --- a/app/src/main/java/org/schabi/newpipe/fragments/list/search/SearchFragment.java +++ b/app/src/main/java/org/schabi/newpipe/fragments/list/search/SearchFragment.java @@ -39,7 +39,7 @@ import org.schabi.newpipe.extractor.StreamingService; import org.schabi.newpipe.extractor.exceptions.ParsingException; import org.schabi.newpipe.extractor.search.SearchExtractor; import org.schabi.newpipe.extractor.search.SearchInfo; -import org.schabi.newpipe.firetv.FireTvUtils; +import org.schabi.newpipe.util.FireTvUtils; import org.schabi.newpipe.fragments.BackPressable; import org.schabi.newpipe.fragments.list.BaseListFragment; import org.schabi.newpipe.local.history.HistoryRecordManager; diff --git a/app/src/main/java/org/schabi/newpipe/firetv/FireTvUtils.java b/app/src/main/java/org/schabi/newpipe/util/FireTvUtils.java similarity index 80% rename from app/src/main/java/org/schabi/newpipe/firetv/FireTvUtils.java rename to app/src/main/java/org/schabi/newpipe/util/FireTvUtils.java index 305c29ee7..69666463e 100644 --- a/app/src/main/java/org/schabi/newpipe/firetv/FireTvUtils.java +++ b/app/src/main/java/org/schabi/newpipe/util/FireTvUtils.java @@ -1,6 +1,5 @@ -package org.schabi.newpipe.firetv; +package org.schabi.newpipe.util; -import android.content.Context; import org.schabi.newpipe.App; public class FireTvUtils { From 7981f9dc9129f232d5dce75e7277d19f55316e40 Mon Sep 17 00:00:00 2001 From: Christian Schabesberger Date: Tue, 19 Feb 2019 16:03:10 +0100 Subject: [PATCH 7/7] add database doc in dia --- assets/db.dia | Bin 0 -> 2520 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 assets/db.dia diff --git a/assets/db.dia b/assets/db.dia new file mode 100644 index 0000000000000000000000000000000000000000..59b090c882231a47746e961a41c36b1c82b238b0 GIT binary patch literal 2520 zcmV;}2`Ba+iwFP!000021MOYga;rENeLr8}@_9`Z?w3v{T{F`))elqERWoOvDH#-- zJ{UYgB*!oF?Je2l0vO)_cSx42asdl1NoYx%rM<<^zx-GxlSjt$I7{!QI?<*RmWEjr zr}Mk%f4}|n+ME7z|K;Z>ra#G_Ij75sydurj(cN?*#OkM;o2REIlB{zoGES1XAUV7F zKTQ&PBNN?B@4rkYZ!?Ifpz2(CmI}e+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