Commit graph

58 commits

Author SHA1 Message Date
TiA4f8R
e44495af9a Apply the requested changes and little improvements
Apply the requested changes, use ShareUtils.shareText to share an stream in the play queue and optimize imports for Java files, using Android Studio functionality.

Apply the requested changes and do little improvements
Apply the requested changes, use ShareUtils.shareText to share an stream in the play queue and optimize imports for Java files, using Android Studio functionality.
2021-01-16 13:23:42 +01:00
Isira Seneviratne
0f66853a9a Convert AnimationUtils functions to extension functions. 2021-01-16 14:49:37 +05:30
TacoTheDank
04f9272706 Lint: Inner class may be static 2020-11-18 18:02:33 -05:00
TacoTheDank
497e145c70 Lint: Make a bunch of stuff final 2020-11-18 17:50:00 -05:00
TacoTheDank
dfefb90d26 Fix some version checks to use android.os.Build 2020-10-31 15:54:02 -04:00
Avently
73eca41204 Fixed player's ZOOM mode for KitKat devices 2020-09-27 04:25:06 +03:00
Avently
771edd0916 Added a comment and excluded automatic switch of orientation on tablets and Android TVs 2020-09-19 17:21:01 +03:00
Avently
d8d4fa6afe Fix for multiple listeners of insets 2020-09-16 04:49:26 +03:00
Avently
0d5cc050ef Reimagined player positioning 2020-09-15 14:43:43 +03:00
TacoTheDank
7db90c0561 Clean up SDK version checks 2020-09-06 12:55:30 +02:00
TacoTheDank
537a87c3f8 Use enhanced 'for' loops 2020-09-06 12:52:43 +02:00
wb9688
25b56bf5e4 Use final where possible 2020-08-16 10:25:09 +02:00
Avently
24e7a11067 Merged the latest code 2020-07-25 04:18:41 +03:00
Avently
39de879c32 Android TV: ability to select all buttons in the main player, as well as in the main fragment 2020-07-25 04:14:29 +03:00
Alexander--
8cf76f7515 Add @NonNull annotation to method argument
Co-authored-by: Tobias Groza <TobiGr@users.noreply.github.com>
2020-07-22 07:57:04 -04:00
Alexander--
05dc8280d4 Use View.isShown() to avoid focus overlay glitches
A View can become focused while being invisible, if it's
parent is invisible. Use global draw listener and
View.isShown() to catch such cases.
2020-07-22 06:21:25 +06:59
Avently
5cd7ca5dab AndroidTvUtils -> DeviceUtils 2020-07-21 01:43:49 +03:00
Avently
a6894644d1 Made checkStyle happy 2020-07-14 20:21:32 +03:00
Avently
aef78ace88 Merged the latest changes 2020-07-13 04:17:21 +03:00
Avently
b99b756435 Marked many (too many) variables as final 2020-07-12 03:59:47 +03:00
Avently
60fd42dfa3 Changes for review 2020-06-27 06:25:50 +03:00
wb9688
205c5ff2ca Optimize imports 2020-05-01 20:13:01 +02:00
Alexander--
cfb5c56800 When drawer opens, always place focus at it's start 2020-04-12 09:39:32 +06:59
Alexander--
a5e28105ac Comply with Checkstyle rules 2020-04-11 09:02:22 +06:59
Alexander--
2cac8a739d Merge remote-tracking branch 'newpipe/dev' into rebase 2020-04-11 08:24:05 +06:59
wb9688
9c8349a8ed Move things back to its original place 2020-04-02 15:57:50 +02:00
wb9688
ac264464ef Improve code style to be more consistent 2020-04-02 15:57:50 +02:00
Alexander--
5c86e436a3 Prevent foocus from escaping open navigation drawer
When contents of NewPipe navigation drawer change, NavigationMenuView
(which is actually a RecyclerView) removes and re-adds all its adapter
children, which leads to temporary loss of focus on currently focused drawer
child. This situation was not anticipated by developers of original
support library DrawerLayout: while NavigationMenuView itself is able
to keep focus from escaping via onRequestFocusInDescendants(),
the implementation of that method in DrawerLayout does not pass focus
to previously focused View. In fact it does not pass focus correctly at all
because the AOSP implementation of that method does not call addFocusables()
and simply focuses the first available VISIBLE View, without regard
to state of drawers.
2020-03-15 09:37:29 +06:59
Alexander--
d37706f814 Fix navigating to action bar buttons on API 28
Keyboard focus clusters prevent that from working, so
we simply remove all focus clusters.

While they are generally a good idea, focus clusters were created
with Chrome OS and it's keyboard-driven interface in mind - there is no
documented way to move focus between clusters using only IR remote.
As such, there are no negative consequences to disabling them on Android TV.
2020-03-14 14:47:02 +06:59
Alexander--
06e987dafd Fix focus getting stuck by cycling within the same list item 2020-03-12 05:29:37 +06:59
Alexander--
5559898332 NewPipeRecyclerView should allow scrolling down by default 2020-02-26 06:40:46 +06:59
Avently
c7c4c2172a Mini player, ExpandableSurfaceView with ZOOM support, popup
- mini player's title, image and author information will be updated in many situations but the main idea is that the info will be the same as currently playing stream. If nothing played then you'll see the info about currently opened stream in fragment. When MainPlayer service stops the info updates too
- made ExpandableSurfaceView to replace AspectRatioFrameLayout. The reason for that is to make possible to use aspect ratio mode ZOOM. It's impossible to show a stream inside AspectRatioFrameLayout with ZOOM mode and to fit the video view to a screen space at the same time. Now the new view able to do that and to show vertical videos in a slightly wide space for them
- refactored some methods to make the code more understandable
- made fixes for player view for landscape-to-landscape orientation change
- added Java docs
- adapted swipe tracking inside bottom sheet
- fixed PlayQueue crashes on clearing
- paddings for popup player now as small as possible
2020-02-05 08:59:30 +03:00
Alexander--
909d1bbccc Rename FireTvUtils to AndroidTvUtils and isFireTv() to isTV()
Because those methods are no longer exclusive to Amazon devices
2020-01-29 03:16:33 +06:59
Alexander--
b1a2612958 Merge remote-tracking branch 'newpipe/dev' into rebase 2020-01-29 03:10:16 +06:59
Paweł Matuszewski
5b3481d3d3 improve code consistency in ScrollableTabLayout 2020-01-02 13:02:14 +01:00
Paweł Matuszewski
f6965f7277 fix ScrollableTabLayout content width calculation
fix bug where only minimum width requested by tab was counted even if actual content was wider
2020-01-02 13:02:14 +01:00
Paweł Matuszewski
3111b390d5 simplify ScrollableTabLayout tabs width checking 2020-01-02 13:02:14 +01:00
Paweł Matuszewski
d154e56fa2 hide main page tab selector with single tab 2020-01-02 13:02:14 +01:00
Paweł Matuszewski
fae26b94b8 make main page tabs scrollable 2020-01-02 13:02:14 +01:00
Alexander--
72d23158c3 Release seekbar on any confirmation key, not just DPAD_CENTER 2019-12-01 12:41:11 +06:59
Alexander--
86fc9c0785 Special MovementMethod for video description
Video descriptions can be very long. Some of them are
basically walls of text with couple of lines at top or bottom.
They are also not scrolled within TextView itself, - instead
NewPipe expects user to scroll their containing ViewGroup.
This renders all builtin MovementMethod implementations useless.

This commit adds a new MovementMethod, that uses requestRectangleOnScreen
to intelligently re-position the TextView within it's scrollable container.
2019-12-01 12:41:11 +06:59
Alexander--
ac28cc7364 Remove FixedGridLayoutManager 2019-12-01 12:41:11 +06:59
Alexander--
10e38f7ea4 RecyclerView scroll fixes
* Move all focus-related work arouns to NewPipeRecyclerView
* Try to pass focus within closer parents first
* Do small arrow scroll if there are not more focusables in move direction
2019-12-01 12:41:11 +06:59
Alexander
2f30802d29 More robust focus search in SuperScrollLayoutManager
FocusFinder has glitches when some of target Views have different size.
Fortunately LayoutManager can redefine focus search strategy to override
the default behavior.
2019-12-01 12:41:11 +06:59
Alexander
924fb49eb0 Implement global focus highlight 2019-12-01 12:41:11 +06:59
Alexander
feea320116 Focus drawer when it opens
It is still buggy because of NavigationView (why the hell
is NavigationMenuView marked as focusable?) but at least initial
opening works as intended
2019-12-01 12:41:10 +06:59
Alexander
ddc609e8d8 Support for seeking videos in directional navigation mode 2019-12-01 12:41:10 +06:59
Alexander
9329c2f7f1 Do not allow focus to escape from open DrawerLayout
Upstream DrawerLayout does override addFocusables, but
incorrectly checks for isDrawerOpen instread of isDrawerVisible
2019-12-01 12:41:10 +06:59
Alexander
2b8bd2c890 When child of CoordinatorLayout wants focus, show it!
The same logic is present in RecyclerView, ScrollView etc.
Android really should default to this behavior for all Views
with isScrollContainer = true
2019-12-01 12:41:10 +06:59
Alexander
b1aa3b018b Fix scrolling in main screen grid
GridLayoutManager is buggy - https://issuetracker.google.com/issues/37067220:
it randomly loses or incorrectly assigns focus when being scrolled via
direction-based navigation. This commit reimplements onFocusSearchFailed()
on top of scrollBy() to work around that problem.

Ordinary touch-based navigation should not be affected.
2019-12-01 12:41:10 +06:59