Commit Graph

60 Commits

Author SHA1 Message Date
DoomMortal ebae33755c AndroidX migration
Migration to AndroidX
- Update to API level 29
- Update Java sourcecode and xml import statements
- Upgrade Butterknife Version 10 AndroidX support
- Set Java 8 compile options due Butterknife needs it
2020-04-26 19:13:07 +02:00
Synced Synapse 7dfd982643 Tweak connection threads
This PR fixes some issues with connections and threading. Specifically, the  change in #618 introduced threading in `HostConnection`, which had some issues. To fix them, the following changes were made:
- A specific TCP listener thread is used and manually started, instead of using one of the threads in the pool. The TCP listener thread is a long lived thread that should always be running (as long as the connection is through TCP), blocked listening on the TCP socket, so it shouldn't be managed in a pool, where, theoretically, it can be paused and reused. 
- Changed the number of threads to 5. We shouldn't need more than this, otherwise we can overwhelm some Kodi hardware.
- Had to sprinkle some `synchronized` to avoid race conditions. For instance, through a TCP connection, as soon as Kore is opened (on the remote screen) it will call at least `GetActivePlayers`, `GetProperties`, `Ping`. If the TCP socket isn't set up yet, each of these calls would create a socket (and a TCP listener thread), so we would open 3 or more sockets when we should just open 1. A `synchronized` in `executeThroughTcp` prevents this. The others prevent similar issues.

Aditionally:
- Tweaked the playlist fetching code, so that it happens exclusively in `HostConnectionObserver` and when PlaylistFragment is notified of changes, it already gets the playlist data. This somewhat simplifies the code, and makes it more consistent with the Player Observer code;
- Change `EventServerConnection` to accept a Handler on which to post the result of the connection, so that the caller can control on which thread the result is called;
- Calls to the various `RegisterObserver` loose the reply immediately parameter, as it was always true.
2019-09-28 22:10:04 +02:00
Synced Synapse a2e4362564 Fix addons content sort
Don't specify a sort method in the listing of addon contents, so that the addon can sort its contents as it sees fit.
2019-07-01 20:57:53 +02:00
Martijn Brekhof cdbdd98d6a Implemented showing playlists even when not playing (#618)
Implemented showing a music/video/picture playlist in PlaylistFragment even
when playback has stopped but the playlist is still available on Kodi.
The playlist is now only cleared if the Playlist.OnClear event is received
from Kodi.

As the pictures playlist does not support moving/removing items this has
been disabled for the pictures playlist only.

Added a new package org.xbmc.kore.host.actions to hold all Callable's that
we use to handle complex interactions with Kodi that use multiple JSON RPC
calls.

Fixed issue in HostConnectionObserver in method notifySomethingIsPlaying
where hostState.lastGetItemResult.label might not be set.

Reduced calling (force)refreshPlaylist considerably as it should now be
handled by the playlist observer.
2019-03-30 11:08:58 +00:00
Synced Synapse c043c04264 Add support for OnAVStart event and tweak HostConnectionOberver 2019-02-08 22:30:48 +01:00
Erik Rudisch 2693d62702 Add addons search 2018-12-27 16:21:07 +00:00
Synced Synapse b281462f9d Fix PVR bottom bar shortcut behaviour 2018-10-27 20:53:15 +02:00
Synced Synapse de683826ad Add support for handling Player.OnResume event through TCP
As detailed in https://github.com/xbmc/xbmc/pull/13726#issuecomment-378188082, Kodi will stop using the event Player.OnPlay when resuming a video, sending a Player.OnResume event instead. This PR handles that change.
2018-05-04 21:10:06 +02:00
Synced Synapse 75f8326fe4 Simplify sharing intent handling
Redesign ApiFuture to be more generic and independent of other classes
2018-04-24 13:36:35 +02:00
Adrian 7c18df20cf Add setting to use skip steps instead of seeking (#152)
closes #147
2018-04-15 15:39:06 +01:00
Synced Synapse 246693a7cc Change the source of AlbumGenres table to support Kodi v18
As detailed in https://github.com/xbmc/xbmc/pull/13051, Kodi v18 changes the way album genres are handled, as the genre (by which i mean `genreId`) ceases to be available at the album level, being only available at the songs level.
This impacts Kore because `GetAlbums` and `GetAlbumDetails` won't return the `genreId` tag, from which the local AlbumGenres table was populated.

This PR changes the source of the local AlbumGenres table to be the `genreId` returned at the song level (by `GetSongs`), to make it somewhat more consistent with the way Kodi will handle things from now on.
2018-02-22 20:57:37 +01:00
Martijn Brekhof e2c39e35ba Redesigned playing movies on device running Kore
* Implemented a new widget "fabspeeddial"
   * Provides user with two options to play the media item. One
     option to play the item on Kodi, one to play it on the remote.
   * Replaced deprecated FAB button from
     com.melnykov:floatingactionbutton:1.3.0 with the FAB button from
     the design library
   * Implemented a busy indicator (pulsate) when fab button is clicked
     and JSON  API method is still pending
   * Added a setting to allow the user to disable local playback and
     revert back to the old behaviour
* Refactored AbstractFragmentInfo
   * Replaced RelativeLayout by CoordinatorLayout to support
     hiding/showing the FAB button when scrolling
   * Replaced the tree view observer to fade out art view when scrolling
     with a behavior for the CoordinaterLayout
* Removed empty theme file for v19
* Refactored HostConnection to allow new activities to attach its
  callbacks to any pending ApiMethod. This is required to support device
  configuration changes.
2018-02-09 11:23:52 +00:00
Mon Zafra 1e9160c733 Refactored share logic to show a notification when an item is added to the playlist (#473)
- added method to HostConnection that returns a Future object instead of
  taking a callback.
- added logic for handling null Handlers in HostConnection methods
- added method to HostManager to run a function that takes a HostConnection
  in a background thread where the Future API results above can be
  synchronously composed.
- replaced chain of callbacks in RemoteActivity with a sequence of
  future gets in OpenSharedUrl.
2018-01-26 14:03:30 +00:00
Synced Synapse 7e519ebd43 Fix NPE reported on Google Play, occurring in RemoteFragment.SetNowPlayingInfo, because the ListType.ItemsAll might be null after a call to Player.GetItem 2017-12-04 10:16:35 +00:00
Martijn Brekhof cb430aa20d Implemented a slideup panel with media controls and info (#320)
* The slideup panel is only displayed when something is
         playing. It starts collapsed showing the media poster
         and title of what is currently playing.

       * Media controls implemented are volume, progress, shuffle,
         repeat and play/pause for all items. Next and previous are only
         available when a music item is playing.

       * In collapsed mode the panel will display the mute button only
         if Kodi is muted. The mute button in expanded mode is always
         visible.

       * Panel is enabled by default. Users can disable the panel
         in Settings

       * Implemented listening to Player.OnPropertyChanged notifications
         to update shuffle and repeat button states.
2017-07-13 19:10:49 +01:00
Martijn Brekhof 134ec550e8 Implemented MediaProgressIndicator widget to allow for code sharing (#405)
* Refactored NowPlayingFragment to use the new MediaProgressIndicator
2017-06-20 19:05:27 +01:00
Ahmed I. Khalil 97b10f2b32 Fix ClassCastException when Favourites returned are empty. (#386) 2017-05-10 09:52:55 +01:00
Ahmed I. Khalil b6822fd0ad Support getting favourites in Kore (#81) (#384)
* Support getting favourites in Kore (#81)
2017-05-09 18:35:21 +01:00
tomerf b80e3e0e7a Make remote bottom bar configurable (#355)
* Make remote bottom bar configurable
* Added new translations
* Added icons
* Moved preference to remote section
2017-03-06 19:58:31 +00:00
primaeval 668feb1355 remove [] formatting (#353) 2017-02-20 19:05:49 +00:00
Aneesh Agrawal 66c145d778 Enable manual configuration of https (#338)
* Allow specifying HTTPS Hosts manually
This is not exposed in the UI, but on the manual host configuration screen, if the address starts with a  "http://" or "https://" this will be stripped and the `isHttps` flag set appropriately.

Additionally, the port can be configured as part of the address as well.
Any port specified as part of the address takes precedence over the explicit HTTP port box, to allow easy copy-pasting of an entire URL for a host.

This enables using Kore with Kodi instances available though HTTPS (e.g. via a reverse proxy).
2017-01-27 15:17:39 +00:00
Martijn Brekhof d993126c7e Fixed retrieving wrong handler for applicationNotificationsObserver (#319) 2016-12-02 11:04:17 +00:00
Martijn Brekhof c5848ce648 Implemented showing volume level on NowPlayingFragment (#312)
Replaced up/down volume buttons with a seekbar that displays the current
volume level and can be used to change the volume level
2016-11-30 12:20:21 +00:00
Synced Synapse b7ece61951 Fix for long press Info button to display codec info in v17 (#286) 2016-11-15 19:22:30 +00:00
Martijn Brekhof dadabd09c5 Implemented recursion fix for movies and tv shows (#283)
This applies the fix for issue #219 Incomplete libraries for movies and
TV shows.
For music items this was already fixed in PR #236
See commit 7330f85241
2016-09-26 18:31:22 +01:00
Bharat a4e19a5578 Fix for long press Info button to display codec info in v17 2016-09-14 01:24:01 -07:00
Synced Synapse faab6b8163 Merge branch 'call_notifications' of https://github.com/tomerf/Kore into tomerf-call_notifications 2016-05-20 10:24:58 +01:00
Martijn Brekhof 7330f85241 Fixed issue with recursing music items
Using Kodi's JSON RPC, Kodi may return less items than requested, even
if there are more items available. The old method of determining if
more items are available by checking if the amount of items returned
equals the amount requested does not work in these cases. Therefore,
we now use the returned List.LimitsReturned to determine if there are
more items available. If List.LimitsReturned.end equals
List.LimitesReturned.total we assume we retrieved all items.
2016-05-10 15:08:38 +02:00
Tomer Froumin 2e7ac6af80 Added support for pausing when phone in call 2016-01-30 17:32:00 +02:00
Martijn Brekhof d5ba611782 Implemented changing the position of items in the current playlist
This enables users to reorder the current playlist by long pressing a
list item and drag it to a different list position.
2016-01-19 12:02:08 +01:00
Synced Synapse b56384ac16 Fix time parsing/display in EPG. Always use UTC for parsing datetimes. 2015-12-16 19:05:41 +00:00
Synced Synapse 9f159460f1 Add Settings JSON RPC methods 2015-12-14 19:21:04 +00:00
Synced Synapse 7991d64581 Add recording to channels list 2015-11-29 14:59:32 +00:00
Synced Synapse 610fa85671 Added PVR recordings list 2015-11-24 22:55:56 +00:00
Synced Synapse 77145d1c28 Add recording PVR jsonrpc methods 2015-11-19 20:05:12 +00:00
Synced Synapse cc3ecdd5f5 Add support for PVR - first version. 2015-11-09 23:40:48 +00:00
Synced Synapse fe9f45bb4a Added PVR jsonrpc methods and types 2015-11-03 23:36:28 +00:00
aharonha 39afba2ae3 Fix default charset in okHttp
should fix RTL languages such as Arabic, Hebrew and Thai
2015-10-25 01:08:39 +02:00
Synced Synapse a07a819898 Add support to see all cast on now playing screen 2015-07-29 18:37:28 +01:00
Synced Synapse 17e9ad5aaf Catch an exception that is being reported in Google Play, when user enters a malformed URL as the media center address. This causes a RuntimeException on OkHttp which wasn't being handled. Ideally we should validate the hostname/ip address that the user enters, but i'm not sure that Patterns.IP_ADDRESS/Patterns.DOMAIN_NAME/Patterns.WEB_URL catches all the possible cases, so i opted for the lazy solution, catch the exception 2015-05-25 23:17:41 +01:00
Synced Synapse 5509c99243 Workaround for issue #78: https://github.com/xbmc/Kore/issues/78 2015-05-25 22:37:32 +01:00
Synced Synapse 5aa674daf4 Disable http keep-alive if we get a ProtocolException (bad status line) from the server. 2015-04-21 09:57:41 +01:00
Synced Synapse f732e0b822 Fix some log messages 2015-04-19 12:13:50 +01:00
Synced Synapse 1fc9eb3301 Switched HTTP library. Using OkHttp explicitly now, instead of the default Android one, which varies acroos OS versions.
OkHttp is also used as the backend for loading images (Picasso).
Added disk cache to image loading.
2015-04-18 10:52:31 +01:00
Synced Synapse ba54c3b4dc Fix ClassCastException on Files.GetDirectory (this can be in other places) 2015-04-15 22:23:01 +01:00
Synced Synapse 4a297c2e35 Change share intent behaviour: if a video is already playing, queue the shared file, otherwise start playing it immediately.
Defined playlist types in the correct place
2015-04-10 19:51:44 +01:00
Synced Synapse c6dfce29a4 Add reboot option to power menu 2015-03-29 12:48:51 +01:00
Synced Synapse a8f9c3e660 UI changes on files browsing 2015-03-28 18:33:48 +00:00
Synced Synapse 02dc9bac7e Extend Siles.GetDirectory method to receive all available parameters 2015-03-26 18:44:32 +00:00
Synced Synapse 0266f7f3ab Fix crash because of ClassCastException to ArrayNode.
Note: if by any chance this causes the cast list to disappear, revert it and just catch the Exception
2015-03-23 23:02:01 +00:00