From 658559699f5cd482bb19ade298db43a65d750664 Mon Sep 17 00:00:00 2001 From: daniel oeh Date: Sat, 11 Oct 2014 17:43:07 +0200 Subject: [PATCH] Moved core classes into subproject --- app/build.gradle | 6 +- app/core/build.gradle | 83 -- app/src/main/AndroidManifest.xml | 4 +- .../java/com/aocate/media/MediaPlayer.java | 1296 ----------------- .../java/de/danoeh/antennapod/PodcastApp.java | 1 - .../activity/AudioplayerActivity.java | 4 +- .../antennapod/activity/FeedInfoActivity.java | 2 +- .../antennapod/activity/MainActivity.java | 2 +- .../activity/MediaplayerActivity.java | 2 +- .../activity/OpmlImportBaseActivity.java | 4 +- .../activity/PreferenceActivity.java | 2 +- .../asynctask/OpmlExportWorker.java | 118 ++ .../{core => }/asynctask/OpmlFeedQueuer.java | 4 +- .../asynctask/OpmlImportWorker.java | 6 +- .../config/ApplicationCallbacksImpl.java | 23 + .../antennapod/config/ClientConfigurator.java | 19 + .../config/DownloadServiceCallbacksImpl.java | 49 + .../config/FlattrCallbacksImpl.java | 53 + .../config/GpodnetCallbacksImpl.java | 22 + .../config/PlaybackServiceCallbacksImpl.java | 21 + .../config/StorageCallbacksImpl.java | 107 ++ .../core/asynctask/FlattrTokenFetcher.java | 95 -- .../core/asynctask/OpmlExportWorker.java | 114 -- .../core/service/download/Downloader.java | 69 - .../antennapod/core/util/StorageUtils.java | 66 - .../antennapod/core/util/ThemeUtils.java | 22 - .../antennapod/dialog/FeedItemDialog.java | 2 +- .../{core => }/dialog/TimeDialog.java | 4 +- .../antennapod/fragment/ItemlistFragment.java | 6 +- .../fragment/NewEpisodesFragment.java | 4 +- .../fragment/PlaybackHistoryFragment.java | 4 +- .../antennapod/fragment/QueueFragment.java | 4 +- .../antennapod/fragment/SearchFragment.java | 4 +- .../fragment/gpodnet/PodcastListFragment.java | 4 +- .../fragment/gpodnet/SearchListFragment.java | 4 +- .../fragment/gpodnet/TagListFragment.java | 4 +- .../menuhandler/FeedItemMenuHandler.java | 4 +- .../menuhandler/FeedMenuHandler.java | 4 +- .../util => }/menuhandler/MenuItemUtils.java | 4 +- .../menuhandler/NavDrawerActivity.java | 2 +- .../{core => }/receiver/PlayerWidget.java | 15 +- .../PlayerWidgetService.java | 8 +- core/.gitignore | 1 + core/build.gradle | 43 + core/proguard-rules.pro | 17 + .../antennapod/core/ApplicationTest.java | 13 + core/src/main/AndroidManifest.xml | 11 + .../presto/service/IDeathCallback_0_8.aidl | 0 ...OnBufferingUpdateListenerCallback_0_8.aidl | 0 .../IOnCompletionListenerCallback_0_8.aidl | 0 .../service/IOnErrorListenerCallback_0_8.aidl | 0 .../service/IOnInfoListenerCallback_0_8.aidl | 0 ...tAvailableChangedListenerCallback_0_8.aidl | 0 .../IOnPreparedListenerCallback_0_8.aidl | 0 .../IOnSeekCompleteListenerCallback_0_8.aidl | 0 ...tAvailableChangedListenerCallback_0_8.aidl | 0 .../aocate/presto/service/IPlayMedia_0_8.aidl | 0 .../com/aocate/media/AndroidMediaPlayer.java | 0 .../java/com/aocate/media/MediaPlayer.java | 1278 ++++++++++++++++ .../com/aocate/media/MediaPlayerImpl.java | 0 .../media/ServiceBackedMediaPlayer.java | 0 .../media/SpeedAdjustmentAlgorithm.java | 0 .../antennapod/core/ApplicationCallbacks.java | 22 + .../danoeh/antennapod/core/ClientConfig.java | 4 + .../core/DownloadServiceCallbacks.java | 7 +- .../antennapod/core/FlattrCallbacks.java | 14 +- .../antennapod/core/GpodnetCallbacks.java | 3 +- .../core/PlaybackServiceCallbacks.java | 3 +- .../antennapod/core/StorageCallbacks.java | 0 .../core/asynctask/DownloadObserver.java | 2 +- .../core/asynctask/FeedRemover.java | 2 +- .../core/asynctask/FlattrClickWorker.java | 13 +- .../core/asynctask/FlattrStatusFetcher.java | 2 +- .../core/asynctask/FlattrTokenFetcher.java | 92 ++ .../core/asynctask/PicassoImageResource.java | 0 .../core/asynctask/PicassoProvider.java | 0 .../core/backup/OpmlBackupAgent.java | 2 +- .../core/dialog/ConfirmationDialog.java | 4 +- .../DownloadRequestErrorDialogCreator.java | 2 +- .../danoeh/antennapod/core/feed/Chapter.java | 0 .../core/feed/EventDistributor.java | 2 +- .../de/danoeh/antennapod/core/feed/Feed.java | 0 .../antennapod/core/feed/FeedComponent.java | 0 .../danoeh/antennapod/core/feed/FeedFile.java | 0 .../antennapod/core/feed/FeedImage.java | 0 .../danoeh/antennapod/core/feed/FeedItem.java | 12 +- .../antennapod/core/feed/FeedMedia.java | 14 +- .../antennapod/core/feed/FeedPreferences.java | 0 .../antennapod/core/feed/ID3Chapter.java | 0 .../antennapod/core/feed/MediaType.java | 0 .../antennapod/core/feed/SearchResult.java | 0 .../antennapod/core/feed/SimpleChapter.java | 0 .../core/feed/VorbisCommentChapter.java | 0 .../core/gpoddernet/GpodnetService.java | 0 ...GpodnetServiceAuthenticationException.java | 0 .../GpodnetServiceBadStatusCodeException.java | 0 .../gpoddernet/GpodnetServiceException.java | 0 .../core/gpoddernet/model/GpodnetDevice.java | 0 .../core/gpoddernet/model/GpodnetPodcast.java | 0 .../model/GpodnetSubscriptionChange.java | 0 .../core/gpoddernet/model/GpodnetTag.java | 0 .../model/GpodnetUploadChangesResponse.java | 0 .../antennapod/core/opml/OpmlElement.java | 0 .../antennapod/core/opml/OpmlReader.java | 2 +- .../antennapod/core/opml/OpmlSymbols.java | 0 .../antennapod/core/opml/OpmlWriter.java | 2 +- .../core/preferences/GpodnetPreferences.java | 15 +- .../core/preferences/PlaybackPreferences.java | 2 +- .../core/preferences/UserPreferences.java | 4 +- .../core/receiver/AlarmUpdateReceiver.java | 2 +- .../receiver/ConnectivityActionReceiver.java | 2 +- .../core/receiver/FeedUpdateReceiver.java | 2 +- .../core/receiver/MediaButtonReceiver.java | 2 +- .../core/service/GpodnetSyncService.java | 40 +- .../service/download/APRedirectHandler.java | 2 +- .../download/AntennapodHttpClient.java | 8 +- .../service/download/DownloadRequest.java | 0 .../service/download/DownloadService.java | 52 +- .../core/service/download/DownloadStatus.java | 0 .../core/service/download/Downloader.java | 73 + .../service/download/DownloaderCallback.java | 0 .../core/service/download/HttpDownloader.java | 24 +- .../service/playback/PlaybackService.java | 32 +- .../playback/PlaybackServiceMediaPlayer.java | 2 +- .../playback/PlaybackServiceTaskManager.java | 2 +- .../core/service/playback/PlayerStatus.java | 0 .../antennapod/core/storage/DBReader.java | 2 +- .../antennapod/core/storage/DBTasks.java | 2 +- .../antennapod/core/storage/DBWriter.java | 2 +- .../storage/DownloadRequestException.java | 0 .../core/storage/DownloadRequester.java | 2 +- .../core/storage/FeedItemStatistics.java | 0 .../antennapod/core/storage/FeedSearcher.java | 2 +- .../antennapod/core/storage/PodDBAdapter.java | 93 +- .../core/syndication/handler/FeedHandler.java | 0 .../handler/FeedHandlerResult.java | 0 .../syndication/handler/HandlerState.java | 0 .../core/syndication/handler/SyndHandler.java | 2 +- .../core/syndication/handler/TypeGetter.java | 2 +- .../handler/UnsupportedFeedtypeException.java | 0 .../core/syndication/namespace/NSContent.java | 0 .../core/syndication/namespace/NSITunes.java | 0 .../core/syndication/namespace/NSMedia.java | 2 +- .../core/syndication/namespace/NSRSS20.java | 2 +- .../namespace/NSSimpleChapters.java | 0 .../core/syndication/namespace/Namespace.java | 0 .../syndication/namespace/SyndElement.java | 0 .../syndication/namespace/atom/AtomText.java | 0 .../syndication/namespace/atom/NSAtom.java | 2 +- .../core/syndication/util/SyndDateUtils.java | 0 .../core/syndication/util/SyndTypeUtils.java | 0 .../antennapod/core/util/ChapterUtils.java | 2 +- .../antennapod/core/util/Converter.java | 0 .../antennapod/core/util/DownloadError.java | 2 +- .../danoeh/antennapod/core/util/DuckType.java | 2 +- .../antennapod/core/util/EpisodeFilter.java | 0 .../core/util/FeedtitleComparator.java | 0 .../core/util/FileNameGenerator.java | 0 .../core/util/InvalidFeedException.java | 0 .../antennapod/core/util/LangUtils.java | 0 .../antennapod/core/util/NetworkUtils.java | 2 +- .../antennapod/core/util/QueueAccess.java | 0 .../antennapod/core/util/ShareUtils.java | 0 .../core/util/ShownotesProvider.java | 0 .../antennapod/core/util/StorageUtils.java | 67 + .../antennapod/core/util/ThemeUtils.java | 23 + .../danoeh/antennapod/core/util/URIUtil.java | 2 +- .../antennapod/core/util/URLChecker.java | 2 +- .../core/util/UndoBarController.java | 2 +- .../ChapterStartTimeComparator.java | 0 .../comparator/DownloadStatusComparator.java | 0 .../comparator/FeedItemPubdateComparator.java | 0 .../PlaybackCompletionDateComparator.java | 0 .../SearchResultValueComparator.java | 0 .../exception/MediaFileNotFoundException.java | 0 .../util/flattr/FlattrServiceCreator.java | 2 +- .../core/util/flattr/FlattrStatus.java | 0 .../core/util/flattr/FlattrThing.java | 0 .../core/util/flattr/FlattrUtils.java | 29 +- .../core/util/flattr/SimpleFlattrThing.java | 0 .../core/util/gui/FeedItemUndoToken.java | 0 .../core/util/id3reader/ChapterReader.java | 2 +- .../core/util/id3reader/ID3Reader.java | 0 .../util/id3reader/ID3ReaderException.java | 0 .../util/id3reader/model/FrameHeader.java | 0 .../core/util/id3reader/model/Header.java | 0 .../core/util/id3reader/model/TagHeader.java | 0 .../core/util/playback/AudioPlayer.java | 0 .../core/util/playback/ExternalMedia.java | 0 .../core/util/playback/IPlayer.java | 0 .../core/util/playback/MediaPlayerError.java | 2 +- .../core/util/playback/Playable.java | 0 .../util/playback/PlaybackController.java | 4 +- .../core/util/playback/Timeline.java | 2 +- .../core/util/playback/VideoPlayer.java | 0 .../core/util/syndication/FeedDiscoverer.java | 0 .../vorbiscommentreader/OggInputStream.java | 0 .../VorbisCommentChapterReader.java | 2 +- .../VorbisCommentHeader.java | 0 .../VorbisCommentReader.java | 0 .../VorbisCommentReaderException.java | 0 .../res/drawable-hdpi-v11/ic_stat_antenna.png | Bin .../ic_stat_authentication.png | Bin .../drawable-hdpi-v11/stat_notify_sync.png | Bin .../stat_notify_sync_error.png | Bin .../main/res/drawable-hdpi/action_about.png | Bin .../res/drawable-hdpi/action_about_dark.png | Bin .../main/res/drawable-hdpi/action_search.png | Bin .../res/drawable-hdpi/action_search_dark.png | Bin .../res/drawable-hdpi/action_settings.png | Bin .../drawable-hdpi/action_settings_dark.png | Bin .../main/res/drawable-hdpi/action_stream.png | Bin .../res/drawable-hdpi/action_stream_dark.png | Bin .../main/res/drawable-hdpi/av_download.png | Bin .../res/drawable-hdpi/av_download_dark.png | Bin .../res/drawable-hdpi/av_fast_forward.png | Bin .../drawable-hdpi/av_fast_forward_dark.png | Bin .../src/main/res/drawable-hdpi/av_pause.png | Bin .../main/res/drawable-hdpi/av_pause_dark.png | Bin .../src/main/res/drawable-hdpi/av_play.png | Bin .../main/res/drawable-hdpi/av_play_dark.png | Bin .../src/main/res/drawable-hdpi/av_rewind.png | Bin .../main/res/drawable-hdpi/av_rewind_dark.png | Bin .../res/drawable-hdpi/content_discard.png | Bin .../drawable-hdpi/content_discard_dark.png | Bin .../main/res/drawable-hdpi/content_new.png | Bin .../res/drawable-hdpi/content_new_dark.png | Bin .../main/res/drawable-hdpi/default_cover.png | Bin .../res/drawable-hdpi/default_cover_dark.png | Bin .../res/drawable-hdpi/device_access_time.png | Bin .../drawable-hdpi/device_access_time_dark.png | Bin .../res/drawable-hdpi/ic_action_overflow.png | Bin .../drawable-hdpi/ic_action_overflow_dark.png | Bin .../ic_action_pause_over_video.png | Bin .../ic_action_play_over_video.png | Bin .../main/res/drawable-hdpi/ic_drag_handle.png | Bin .../res/drawable-hdpi/ic_drag_handle_dark.png | Bin .../src/main/res/drawable-hdpi/ic_drawer.png | Bin .../main/res/drawable-hdpi/ic_drawer_dark.png | Bin .../main/res/drawable-hdpi/ic_launcher.png | Bin .../src/main/res/drawable-hdpi/ic_new.png | Bin .../main/res/drawable-hdpi/ic_new_dark.png | Bin .../res/drawable-hdpi/ic_stat_antenna.png | Bin .../drawable-hdpi/ic_stat_authentication.png | Bin .../res/drawable-hdpi/location_web_site.png | Bin .../drawable-hdpi/location_web_site_dark.png | Bin .../res/drawable-hdpi/navigation_accept.png | Bin .../drawable-hdpi/navigation_accept_dark.png | Bin .../res/drawable-hdpi/navigation_cancel.png | Bin .../drawable-hdpi/navigation_cancel_dark.png | Bin .../res/drawable-hdpi/navigation_chapters.png | Bin .../navigation_chapters_dark.png | Bin .../res/drawable-hdpi/navigation_collapse.png | Bin .../navigation_collapse_dark.png | Bin .../res/drawable-hdpi/navigation_expand.png | Bin .../drawable-hdpi/navigation_expand_dark.png | Bin .../res/drawable-hdpi/navigation_refresh.png | Bin .../drawable-hdpi/navigation_refresh_dark.png | Bin .../drawable-hdpi/navigation_shownotes.png | Bin .../navigation_shownotes_dark.png | Bin .../main/res/drawable-hdpi/navigation_up.png | Bin .../res/drawable-hdpi/navigation_up_dark.png | Bin .../main/res/drawable-hdpi/social_share.png | Bin .../res/drawable-hdpi/social_share_dark.png | Bin .../res/drawable-hdpi/spinner_button.9.png | Bin .../drawable-hdpi/spinner_button_dark.9.png | Bin .../res/drawable-hdpi/stat_notify_sync.png | Bin .../drawable-hdpi/stat_notify_sync_error.png | Bin .../main/res/drawable-hdpi/stat_playlist.png | Bin .../res/drawable-hdpi/stat_playlist_dark.png | Bin .../src/main/res/drawable-hdpi/type_audio.png | Bin .../res/drawable-hdpi/type_audio_dark.png | Bin .../src/main/res/drawable-hdpi/type_video.png | Bin .../res/drawable-hdpi/type_video_dark.png | Bin .../res/drawable-ldpi-v11/ic_stat_antenna.png | Bin .../main/res/drawable-ldpi/action_stream.png | Bin .../res/drawable-ldpi/action_stream_dark.png | Bin .../main/res/drawable-ldpi/ic_launcher.png | Bin .../res/drawable-ldpi/ic_stat_antenna.png | Bin .../main/res/drawable-ldpi/stat_playlist.png | Bin .../res/drawable-ldpi/stat_playlist_dark.png | Bin .../res/drawable-mdpi-v11/ic_stat_antenna.png | Bin .../ic_stat_authentication.png | Bin .../drawable-mdpi-v11/stat_notify_sync.png | Bin .../stat_notify_sync_error.png | Bin .../main/res/drawable-mdpi/action_about.png | Bin .../res/drawable-mdpi/action_about_dark.png | Bin .../main/res/drawable-mdpi/action_search.png | Bin .../res/drawable-mdpi/action_search_dark.png | Bin .../res/drawable-mdpi/action_settings.png | Bin .../drawable-mdpi/action_settings_dark.png | Bin .../main/res/drawable-mdpi/action_stream.png | Bin .../res/drawable-mdpi/action_stream_dark.png | Bin .../main/res/drawable-mdpi/av_download.png | Bin .../res/drawable-mdpi/av_download_dark.png | Bin .../res/drawable-mdpi/av_fast_forward.png | Bin .../drawable-mdpi/av_fast_forward_dark.png | Bin .../src/main/res/drawable-mdpi/av_pause.png | Bin .../main/res/drawable-mdpi/av_pause_dark.png | Bin .../src/main/res/drawable-mdpi/av_play.png | Bin .../main/res/drawable-mdpi/av_play_dark.png | Bin .../src/main/res/drawable-mdpi/av_rewind.png | Bin .../main/res/drawable-mdpi/av_rewind_dark.png | Bin .../res/drawable-mdpi/content_discard.png | Bin .../drawable-mdpi/content_discard_dark.png | Bin .../main/res/drawable-mdpi/content_new.png | Bin .../res/drawable-mdpi/content_new_dark.png | Bin .../main/res/drawable-mdpi/default_cover.png | Bin .../res/drawable-mdpi/default_cover_dark.png | Bin .../res/drawable-mdpi/device_access_time.png | Bin .../drawable-mdpi/device_access_time_dark.png | Bin .../res/drawable-mdpi/ic_action_overflow.png | Bin .../drawable-mdpi/ic_action_overflow_dark.png | Bin .../ic_action_pause_over_video.png | Bin .../ic_action_play_over_video.png | Bin .../main/res/drawable-mdpi/ic_drag_handle.png | Bin .../res/drawable-mdpi/ic_drag_handle_dark.png | Bin .../src/main/res/drawable-mdpi/ic_drawer.png | Bin .../main/res/drawable-mdpi/ic_drawer_dark.png | Bin .../main/res/drawable-mdpi/ic_launcher.png | Bin .../src/main/res/drawable-mdpi/ic_new.png | Bin .../main/res/drawable-mdpi/ic_new_dark.png | Bin .../res/drawable-mdpi/ic_stat_antenna.png | Bin .../drawable-mdpi/ic_stat_authentication.png | Bin .../res/drawable-mdpi/location_web_site.png | Bin .../drawable-mdpi/location_web_site_dark.png | Bin .../res/drawable-mdpi/navigation_accept.png | Bin .../drawable-mdpi/navigation_accept_dark.png | Bin .../res/drawable-mdpi/navigation_cancel.png | Bin .../drawable-mdpi/navigation_cancel_dark.png | Bin .../res/drawable-mdpi/navigation_chapters.png | Bin .../navigation_chapters_dark.png | Bin .../res/drawable-mdpi/navigation_collapse.png | Bin .../navigation_collapse_dark.png | Bin .../res/drawable-mdpi/navigation_expand.png | Bin .../drawable-mdpi/navigation_expand_dark.png | Bin .../res/drawable-mdpi/navigation_refresh.png | Bin .../drawable-mdpi/navigation_refresh_dark.png | Bin .../drawable-mdpi/navigation_shownotes.png | Bin .../navigation_shownotes_dark.png | Bin .../main/res/drawable-mdpi/navigation_up.png | Bin .../res/drawable-mdpi/navigation_up_dark.png | Bin .../main/res/drawable-mdpi/social_share.png | Bin .../res/drawable-mdpi/social_share_dark.png | Bin .../res/drawable-mdpi/spinner_button.9.png | Bin .../drawable-mdpi/spinner_button_dark.9.png | Bin .../res/drawable-mdpi/stat_notify_sync.png | Bin .../drawable-mdpi/stat_notify_sync_error.png | Bin .../main/res/drawable-mdpi/stat_playlist.png | Bin .../res/drawable-mdpi/stat_playlist_dark.png | Bin .../src/main/res/drawable-mdpi/type_audio.png | Bin .../res/drawable-mdpi/type_audio_dark.png | Bin .../src/main/res/drawable-mdpi/type_video.png | Bin .../res/drawable-mdpi/type_video_dark.png | Bin .../drawable-xhdpi-v11/ic_stat_antenna.png | Bin .../ic_stat_authentication.png | Bin .../drawable-xhdpi-v11/stat_notify_sync.png | Bin .../stat_notify_sync_error.png | Bin .../main/res/drawable-xhdpi/action_about.png | Bin .../res/drawable-xhdpi/action_about_dark.png | Bin .../main/res/drawable-xhdpi/action_search.png | Bin .../res/drawable-xhdpi/action_search_dark.png | Bin .../res/drawable-xhdpi/action_settings.png | Bin .../drawable-xhdpi/action_settings_dark.png | Bin .../main/res/drawable-xhdpi/action_stream.png | Bin .../res/drawable-xhdpi/action_stream_dark.png | Bin .../main/res/drawable-xhdpi/av_download.png | Bin .../res/drawable-xhdpi/av_download_dark.png | Bin .../res/drawable-xhdpi/av_fast_forward.png | Bin .../drawable-xhdpi/av_fast_forward_dark.png | Bin .../src/main/res/drawable-xhdpi/av_pause.png | Bin .../main/res/drawable-xhdpi/av_pause_dark.png | Bin .../src/main/res/drawable-xhdpi/av_play.png | Bin .../main/res/drawable-xhdpi/av_play_dark.png | Bin .../src/main/res/drawable-xhdpi/av_rewind.png | Bin .../res/drawable-xhdpi/av_rewind_dark.png | Bin .../res/drawable-xhdpi/content_discard.png | Bin .../drawable-xhdpi/content_discard_dark.png | Bin .../main/res/drawable-xhdpi/content_new.png | Bin .../res/drawable-xhdpi/content_new_dark.png | Bin .../res/drawable-xhdpi/content_remove.png | Bin .../drawable-xhdpi/content_remove_dark.png | Bin .../main/res/drawable-xhdpi/default_cover.png | Bin .../res/drawable-xhdpi/default_cover_dark.png | Bin .../res/drawable-xhdpi/device_access_time.png | Bin .../device_access_time_dark.png | Bin .../res/drawable-xhdpi/ic_action_overflow.png | Bin .../ic_action_overflow_dark.png | Bin .../ic_action_pause_over_video.png | Bin .../ic_action_play_over_video.png | Bin .../res/drawable-xhdpi/ic_drag_handle.png | Bin .../drawable-xhdpi/ic_drag_handle_dark.png | Bin .../src/main/res/drawable-xhdpi/ic_drawer.png | Bin .../res/drawable-xhdpi/ic_drawer_dark.png | Bin .../main/res/drawable-xhdpi/ic_launcher.png | Bin .../src/main/res/drawable-xhdpi/ic_new.png | Bin .../main/res/drawable-xhdpi/ic_new_dark.png | Bin .../res/drawable-xhdpi/ic_stat_antenna.png | Bin .../drawable-xhdpi/ic_stat_authentication.png | Bin .../res/drawable-xhdpi/ic_undobar_undo.png | Bin .../res/drawable-xhdpi/location_web_site.png | Bin .../drawable-xhdpi/location_web_site_dark.png | Bin .../res/drawable-xhdpi/navigation_accept.png | Bin .../drawable-xhdpi/navigation_accept_dark.png | Bin .../res/drawable-xhdpi/navigation_cancel.png | Bin .../drawable-xhdpi/navigation_cancel_dark.png | Bin .../drawable-xhdpi/navigation_chapters.png | Bin .../navigation_chapters_dark.png | Bin .../drawable-xhdpi/navigation_collapse.png | Bin .../navigation_collapse_dark.png | Bin .../res/drawable-xhdpi/navigation_expand.png | Bin .../drawable-xhdpi/navigation_expand_dark.png | Bin .../res/drawable-xhdpi/navigation_refresh.png | Bin .../navigation_refresh_dark.png | Bin .../drawable-xhdpi/navigation_shownotes.png | Bin .../navigation_shownotes_dark.png | Bin .../main/res/drawable-xhdpi/navigation_up.png | Bin .../res/drawable-xhdpi/navigation_up_dark.png | Bin .../main/res/drawable-xhdpi/social_share.png | Bin .../res/drawable-xhdpi/social_share_dark.png | Bin .../res/drawable-xhdpi/spinner_button.9.png | Bin .../drawable-xhdpi/spinner_button_dark.9.png | Bin .../main/res/drawable-xhdpi/stat_playlist.png | Bin .../res/drawable-xhdpi/stat_playlist_dark.png | Bin .../main/res/drawable-xhdpi/type_audio.png | Bin .../res/drawable-xhdpi/type_audio_dark.png | Bin .../main/res/drawable-xhdpi/type_video.png | Bin .../res/drawable-xhdpi/type_video_dark.png | Bin .../src/main/res/drawable-xhdpi/undobar.9.png | Bin .../undobar_button_focused.9.png | Bin .../undobar_button_pressed.9.png | Bin .../res/drawable-xhdpi/undobar_divider.9.png | Bin .../drawable-xxhdpi/ic_action_overflow.png | Bin .../ic_action_overflow_dark.png | Bin .../ic_action_pause_over_video.png | Bin .../ic_action_play_over_video.png | Bin .../res/drawable-xxhdpi/ic_drag_handle.png | Bin .../drawable-xxhdpi/ic_drag_handle_dark.png | Bin .../main/res/drawable-xxhdpi/ic_drawer.png | Bin .../res/drawable-xxhdpi/ic_drawer_dark.png | Bin .../main/res/drawable-xxhdpi/ic_launcher.png | Bin .../src/main/res/drawable-xxhdpi/ic_new.png | Bin .../main/res/drawable-xxhdpi/ic_new_dark.png | Bin .../ic_stat_authentication.png | Bin {app => core}/src/main/res/drawable/badge.xml | 0 .../main/res/drawable/borderless_button.xml | 0 .../res/drawable/borderless_button_dark.xml | 0 .../res/drawable/horizontal_divider.9.png | Bin .../overlay_button_circle_background.xml | 0 .../main/res/drawable/overlay_drawable.xml | 0 .../res/drawable/overlay_drawable_dark.xml | 0 .../src/main/res/drawable/type_audio.png | Bin .../src/main/res/drawable/type_video.png | Bin .../src/main/res/drawable/undobar_button.xml | 0 .../main/res/drawable/vertical_divider.9.png | Bin .../src/main/res/drawable/white_circle.xml | 0 .../src/main/res/values-az/strings.xml | 0 .../src/main/res/values-ca/strings.xml | 0 .../src/main/res/values-cs-rCZ/strings.xml | 0 .../src/main/res/values-da/strings.xml | 0 .../src/main/res/values-de/strings.xml | 0 .../src/main/res/values-es-rES/strings.xml | 0 .../src/main/res/values-es/strings.xml | 0 .../src/main/res/values-fr/strings.xml | 0 .../src/main/res/values-hi-rIN/strings.xml | 0 .../src/main/res/values-it-rIT/strings.xml | 0 .../src/main/res/values-iw-rIL/strings.xml | 0 .../src/main/res/values-ko/strings.xml | 0 .../src/main/res/values-land/styles.xml | 0 .../src/main/res/values-large/dimens.xml | 0 .../src/main/res/values-nl/strings.xml | 0 .../src/main/res/values-pl-rPL/strings.xml | 0 .../src/main/res/values-pt-rBR/strings.xml | 0 .../src/main/res/values-pt/strings.xml | 0 .../src/main/res/values-ro-rRO/strings.xml | 0 .../src/main/res/values-ru/strings.xml | 0 .../src/main/res/values-sv-rSE/strings.xml | 0 .../src/main/res/values-uk-rUA/strings.xml | 0 .../src/main/res/values-v11/colors.xml | 0 .../src/main/res/values-v14/dimens.xml | 0 .../src/main/res/values-v14/styles.xml | 0 .../src/main/res/values-v16/styles.xml | 0 .../src/main/res/values-v19/colors.xml | 0 .../src/main/res/values-zh-rCN/strings.xml | 0 {app => core}/src/main/res/values/arrays.xml | 0 {app => core}/src/main/res/values/attrs.xml | 0 {app => core}/src/main/res/values/colors.xml | 0 {app => core}/src/main/res/values/dimens.xml | 0 {app => core}/src/main/res/values/ids.xml | 0 .../src/main/res/values/integers.xml | 0 {app => core}/src/main/res/values/strings.xml | 0 {app => core}/src/main/res/values/styles.xml | 0 settings.gradle | 2 +- 493 files changed, 2293 insertions(+), 2071 deletions(-) delete mode 100644 app/core/build.gradle delete mode 100644 app/src/main/java/com/aocate/media/MediaPlayer.java create mode 100644 app/src/main/java/de/danoeh/antennapod/asynctask/OpmlExportWorker.java rename app/src/main/java/de/danoeh/antennapod/{core => }/asynctask/OpmlFeedQueuer.java (96%) rename app/src/main/java/de/danoeh/antennapod/{core => }/asynctask/OpmlImportWorker.java (95%) create mode 100644 app/src/main/java/de/danoeh/antennapod/config/ApplicationCallbacksImpl.java create mode 100644 app/src/main/java/de/danoeh/antennapod/config/ClientConfigurator.java create mode 100644 app/src/main/java/de/danoeh/antennapod/config/DownloadServiceCallbacksImpl.java create mode 100644 app/src/main/java/de/danoeh/antennapod/config/FlattrCallbacksImpl.java create mode 100644 app/src/main/java/de/danoeh/antennapod/config/GpodnetCallbacksImpl.java create mode 100644 app/src/main/java/de/danoeh/antennapod/config/PlaybackServiceCallbacksImpl.java create mode 100644 app/src/main/java/de/danoeh/antennapod/config/StorageCallbacksImpl.java delete mode 100644 app/src/main/java/de/danoeh/antennapod/core/asynctask/FlattrTokenFetcher.java delete mode 100644 app/src/main/java/de/danoeh/antennapod/core/asynctask/OpmlExportWorker.java delete mode 100644 app/src/main/java/de/danoeh/antennapod/core/service/download/Downloader.java delete mode 100644 app/src/main/java/de/danoeh/antennapod/core/util/StorageUtils.java delete mode 100644 app/src/main/java/de/danoeh/antennapod/core/util/ThemeUtils.java rename app/src/main/java/de/danoeh/antennapod/{core => }/dialog/TimeDialog.java (98%) rename app/src/main/java/de/danoeh/antennapod/{core/util => }/menuhandler/FeedItemMenuHandler.java (98%) rename app/src/main/java/de/danoeh/antennapod/{core/util => }/menuhandler/FeedMenuHandler.java (96%) rename app/src/main/java/de/danoeh/antennapod/{core/util => }/menuhandler/MenuItemUtils.java (92%) rename app/src/main/java/de/danoeh/antennapod/{core/util => }/menuhandler/NavDrawerActivity.java (74%) rename app/src/main/java/de/danoeh/antennapod/{core => }/receiver/PlayerWidget.java (66%) rename app/src/main/java/de/danoeh/antennapod/{core/service/playback => service}/PlayerWidgetService.java (95%) create mode 100644 core/.gitignore create mode 100644 core/build.gradle create mode 100644 core/proguard-rules.pro create mode 100644 core/src/androidTest/java/de/danoeh/antennapod/core/ApplicationTest.java create mode 100644 core/src/main/AndroidManifest.xml rename {app => core}/src/main/aidl/com/aocate/presto/service/IDeathCallback_0_8.aidl (100%) rename {app => core}/src/main/aidl/com/aocate/presto/service/IOnBufferingUpdateListenerCallback_0_8.aidl (100%) rename {app => core}/src/main/aidl/com/aocate/presto/service/IOnCompletionListenerCallback_0_8.aidl (100%) rename {app => core}/src/main/aidl/com/aocate/presto/service/IOnErrorListenerCallback_0_8.aidl (100%) rename {app => core}/src/main/aidl/com/aocate/presto/service/IOnInfoListenerCallback_0_8.aidl (100%) rename {app => core}/src/main/aidl/com/aocate/presto/service/IOnPitchAdjustmentAvailableChangedListenerCallback_0_8.aidl (100%) rename {app => core}/src/main/aidl/com/aocate/presto/service/IOnPreparedListenerCallback_0_8.aidl (100%) rename {app => core}/src/main/aidl/com/aocate/presto/service/IOnSeekCompleteListenerCallback_0_8.aidl (100%) rename {app => core}/src/main/aidl/com/aocate/presto/service/IOnSpeedAdjustmentAvailableChangedListenerCallback_0_8.aidl (100%) rename {app => core}/src/main/aidl/com/aocate/presto/service/IPlayMedia_0_8.aidl (100%) rename {app => core}/src/main/java/com/aocate/media/AndroidMediaPlayer.java (100%) create mode 100644 core/src/main/java/com/aocate/media/MediaPlayer.java rename {app => core}/src/main/java/com/aocate/media/MediaPlayerImpl.java (100%) rename {app => core}/src/main/java/com/aocate/media/ServiceBackedMediaPlayer.java (100%) rename {app => core}/src/main/java/com/aocate/media/SpeedAdjustmentAlgorithm.java (100%) create mode 100644 core/src/main/java/de/danoeh/antennapod/core/ApplicationCallbacks.java rename {app => core}/src/main/java/de/danoeh/antennapod/core/ClientConfig.java (85%) rename {app => core}/src/main/java/de/danoeh/antennapod/core/DownloadServiceCallbacks.java (85%) rename {app => core}/src/main/java/de/danoeh/antennapod/core/FlattrCallbacks.java (58%) rename {app => core}/src/main/java/de/danoeh/antennapod/core/GpodnetCallbacks.java (92%) rename {app => core}/src/main/java/de/danoeh/antennapod/core/PlaybackServiceCallbacks.java (81%) rename {app => core}/src/main/java/de/danoeh/antennapod/core/StorageCallbacks.java (100%) rename {app => core}/src/main/java/de/danoeh/antennapod/core/asynctask/DownloadObserver.java (99%) rename {app => core}/src/main/java/de/danoeh/antennapod/core/asynctask/FeedRemover.java (97%) rename {app => core}/src/main/java/de/danoeh/antennapod/core/asynctask/FlattrClickWorker.java (95%) rename {app => core}/src/main/java/de/danoeh/antennapod/core/asynctask/FlattrStatusFetcher.java (97%) create mode 100644 core/src/main/java/de/danoeh/antennapod/core/asynctask/FlattrTokenFetcher.java rename {app => core}/src/main/java/de/danoeh/antennapod/core/asynctask/PicassoImageResource.java (100%) rename {app => core}/src/main/java/de/danoeh/antennapod/core/asynctask/PicassoProvider.java (100%) rename {app => core}/src/main/java/de/danoeh/antennapod/core/backup/OpmlBackupAgent.java (99%) rename {app => core}/src/main/java/de/danoeh/antennapod/core/dialog/ConfirmationDialog.java (95%) rename {app => core}/src/main/java/de/danoeh/antennapod/core/dialog/DownloadRequestErrorDialogCreator.java (96%) rename {app => core}/src/main/java/de/danoeh/antennapod/core/feed/Chapter.java (100%) rename {app => core}/src/main/java/de/danoeh/antennapod/core/feed/EventDistributor.java (98%) rename {app => core}/src/main/java/de/danoeh/antennapod/core/feed/Feed.java (100%) rename {app => core}/src/main/java/de/danoeh/antennapod/core/feed/FeedComponent.java (100%) rename {app => core}/src/main/java/de/danoeh/antennapod/core/feed/FeedFile.java (100%) rename {app => core}/src/main/java/de/danoeh/antennapod/core/feed/FeedImage.java (100%) rename {app => core}/src/main/java/de/danoeh/antennapod/core/feed/FeedItem.java (97%) rename {app => core}/src/main/java/de/danoeh/antennapod/core/feed/FeedMedia.java (94%) rename {app => core}/src/main/java/de/danoeh/antennapod/core/feed/FeedPreferences.java (100%) rename {app => core}/src/main/java/de/danoeh/antennapod/core/feed/ID3Chapter.java (100%) rename {app => core}/src/main/java/de/danoeh/antennapod/core/feed/MediaType.java (100%) rename {app => core}/src/main/java/de/danoeh/antennapod/core/feed/SearchResult.java (100%) rename {app => core}/src/main/java/de/danoeh/antennapod/core/feed/SimpleChapter.java (100%) rename {app => core}/src/main/java/de/danoeh/antennapod/core/feed/VorbisCommentChapter.java (100%) rename {app => core}/src/main/java/de/danoeh/antennapod/core/gpoddernet/GpodnetService.java (100%) rename {app => core}/src/main/java/de/danoeh/antennapod/core/gpoddernet/GpodnetServiceAuthenticationException.java (100%) rename {app => core}/src/main/java/de/danoeh/antennapod/core/gpoddernet/GpodnetServiceBadStatusCodeException.java (100%) rename {app => core}/src/main/java/de/danoeh/antennapod/core/gpoddernet/GpodnetServiceException.java (100%) rename {app => core}/src/main/java/de/danoeh/antennapod/core/gpoddernet/model/GpodnetDevice.java (100%) rename {app => core}/src/main/java/de/danoeh/antennapod/core/gpoddernet/model/GpodnetPodcast.java (100%) rename {app => core}/src/main/java/de/danoeh/antennapod/core/gpoddernet/model/GpodnetSubscriptionChange.java (100%) rename {app => core}/src/main/java/de/danoeh/antennapod/core/gpoddernet/model/GpodnetTag.java (100%) rename {app => core}/src/main/java/de/danoeh/antennapod/core/gpoddernet/model/GpodnetUploadChangesResponse.java (100%) rename {app => core}/src/main/java/de/danoeh/antennapod/core/opml/OpmlElement.java (100%) rename {app => core}/src/main/java/de/danoeh/antennapod/core/opml/OpmlReader.java (98%) rename {app => core}/src/main/java/de/danoeh/antennapod/core/opml/OpmlSymbols.java (100%) rename {app => core}/src/main/java/de/danoeh/antennapod/core/opml/OpmlWriter.java (97%) rename {app => core}/src/main/java/de/danoeh/antennapod/core/preferences/GpodnetPreferences.java (95%) rename {app => core}/src/main/java/de/danoeh/antennapod/core/preferences/PlaybackPreferences.java (99%) rename {app => core}/src/main/java/de/danoeh/antennapod/core/preferences/UserPreferences.java (99%) rename {app => core}/src/main/java/de/danoeh/antennapod/core/receiver/AlarmUpdateReceiver.java (95%) rename {app => core}/src/main/java/de/danoeh/antennapod/core/receiver/ConnectivityActionReceiver.java (97%) rename {app => core}/src/main/java/de/danoeh/antennapod/core/receiver/FeedUpdateReceiver.java (97%) rename {app => core}/src/main/java/de/danoeh/antennapod/core/receiver/MediaButtonReceiver.java (96%) rename {app => core}/src/main/java/de/danoeh/antennapod/core/service/GpodnetSyncService.java (89%) rename {app => core}/src/main/java/de/danoeh/antennapod/core/service/download/APRedirectHandler.java (97%) rename {app => core}/src/main/java/de/danoeh/antennapod/core/service/download/AntennapodHttpClient.java (95%) rename {app => core}/src/main/java/de/danoeh/antennapod/core/service/download/DownloadRequest.java (100%) rename {app => core}/src/main/java/de/danoeh/antennapod/core/service/download/DownloadService.java (94%) rename {app => core}/src/main/java/de/danoeh/antennapod/core/service/download/DownloadStatus.java (100%) create mode 100644 core/src/main/java/de/danoeh/antennapod/core/service/download/Downloader.java rename {app => core}/src/main/java/de/danoeh/antennapod/core/service/download/DownloaderCallback.java (100%) rename {app => core}/src/main/java/de/danoeh/antennapod/core/service/download/HttpDownloader.java (96%) rename {app => core}/src/main/java/de/danoeh/antennapod/core/service/playback/PlaybackService.java (97%) rename {app => core}/src/main/java/de/danoeh/antennapod/core/service/playback/PlaybackServiceMediaPlayer.java (99%) rename {app => core}/src/main/java/de/danoeh/antennapod/core/service/playback/PlaybackServiceTaskManager.java (99%) rename {app => core}/src/main/java/de/danoeh/antennapod/core/service/playback/PlayerStatus.java (100%) rename {app => core}/src/main/java/de/danoeh/antennapod/core/storage/DBReader.java (99%) rename {app => core}/src/main/java/de/danoeh/antennapod/core/storage/DBTasks.java (99%) rename {app => core}/src/main/java/de/danoeh/antennapod/core/storage/DBWriter.java (99%) rename {app => core}/src/main/java/de/danoeh/antennapod/core/storage/DownloadRequestException.java (100%) rename {app => core}/src/main/java/de/danoeh/antennapod/core/storage/DownloadRequester.java (99%) rename {app => core}/src/main/java/de/danoeh/antennapod/core/storage/FeedItemStatistics.java (100%) rename {app => core}/src/main/java/de/danoeh/antennapod/core/storage/FeedSearcher.java (98%) rename {app => core}/src/main/java/de/danoeh/antennapod/core/storage/PodDBAdapter.java (92%) rename {app => core}/src/main/java/de/danoeh/antennapod/core/syndication/handler/FeedHandler.java (100%) rename {app => core}/src/main/java/de/danoeh/antennapod/core/syndication/handler/FeedHandlerResult.java (100%) rename {app => core}/src/main/java/de/danoeh/antennapod/core/syndication/handler/HandlerState.java (100%) rename {app => core}/src/main/java/de/danoeh/antennapod/core/syndication/handler/SyndHandler.java (98%) rename {app => core}/src/main/java/de/danoeh/antennapod/core/syndication/handler/TypeGetter.java (98%) rename {app => core}/src/main/java/de/danoeh/antennapod/core/syndication/handler/UnsupportedFeedtypeException.java (100%) rename {app => core}/src/main/java/de/danoeh/antennapod/core/syndication/namespace/NSContent.java (100%) rename {app => core}/src/main/java/de/danoeh/antennapod/core/syndication/namespace/NSITunes.java (100%) rename {app => core}/src/main/java/de/danoeh/antennapod/core/syndication/namespace/NSMedia.java (97%) rename {app => core}/src/main/java/de/danoeh/antennapod/core/syndication/namespace/NSRSS20.java (99%) rename {app => core}/src/main/java/de/danoeh/antennapod/core/syndication/namespace/NSSimpleChapters.java (100%) rename {app => core}/src/main/java/de/danoeh/antennapod/core/syndication/namespace/Namespace.java (100%) rename {app => core}/src/main/java/de/danoeh/antennapod/core/syndication/namespace/SyndElement.java (100%) rename {app => core}/src/main/java/de/danoeh/antennapod/core/syndication/namespace/atom/AtomText.java (100%) rename {app => core}/src/main/java/de/danoeh/antennapod/core/syndication/namespace/atom/NSAtom.java (99%) rename {app => core}/src/main/java/de/danoeh/antennapod/core/syndication/util/SyndDateUtils.java (100%) rename {app => core}/src/main/java/de/danoeh/antennapod/core/syndication/util/SyndTypeUtils.java (100%) rename {app => core}/src/main/java/de/danoeh/antennapod/core/util/ChapterUtils.java (99%) rename {app => core}/src/main/java/de/danoeh/antennapod/core/util/Converter.java (100%) rename {app => core}/src/main/java/de/danoeh/antennapod/core/util/DownloadError.java (97%) rename {app => core}/src/main/java/de/danoeh/antennapod/core/util/DuckType.java (98%) rename {app => core}/src/main/java/de/danoeh/antennapod/core/util/EpisodeFilter.java (100%) rename {app => core}/src/main/java/de/danoeh/antennapod/core/util/FeedtitleComparator.java (100%) rename {app => core}/src/main/java/de/danoeh/antennapod/core/util/FileNameGenerator.java (100%) rename {app => core}/src/main/java/de/danoeh/antennapod/core/util/InvalidFeedException.java (100%) rename {app => core}/src/main/java/de/danoeh/antennapod/core/util/LangUtils.java (100%) rename {app => core}/src/main/java/de/danoeh/antennapod/core/util/NetworkUtils.java (98%) rename {app => core}/src/main/java/de/danoeh/antennapod/core/util/QueueAccess.java (100%) rename {app => core}/src/main/java/de/danoeh/antennapod/core/util/ShareUtils.java (100%) rename {app => core}/src/main/java/de/danoeh/antennapod/core/util/ShownotesProvider.java (100%) create mode 100644 core/src/main/java/de/danoeh/antennapod/core/util/StorageUtils.java create mode 100644 core/src/main/java/de/danoeh/antennapod/core/util/ThemeUtils.java rename {app => core}/src/main/java/de/danoeh/antennapod/core/util/URIUtil.java (95%) rename {app => core}/src/main/java/de/danoeh/antennapod/core/util/URLChecker.java (97%) rename {app => core}/src/main/java/de/danoeh/antennapod/core/util/UndoBarController.java (99%) rename {app => core}/src/main/java/de/danoeh/antennapod/core/util/comparator/ChapterStartTimeComparator.java (100%) rename {app => core}/src/main/java/de/danoeh/antennapod/core/util/comparator/DownloadStatusComparator.java (100%) rename {app => core}/src/main/java/de/danoeh/antennapod/core/util/comparator/FeedItemPubdateComparator.java (100%) rename {app => core}/src/main/java/de/danoeh/antennapod/core/util/comparator/PlaybackCompletionDateComparator.java (100%) rename {app => core}/src/main/java/de/danoeh/antennapod/core/util/comparator/SearchResultValueComparator.java (100%) rename {app => core}/src/main/java/de/danoeh/antennapod/core/util/exception/MediaFileNotFoundException.java (100%) rename {app => core}/src/main/java/de/danoeh/antennapod/core/util/flattr/FlattrServiceCreator.java (93%) rename {app => core}/src/main/java/de/danoeh/antennapod/core/util/flattr/FlattrStatus.java (100%) rename {app => core}/src/main/java/de/danoeh/antennapod/core/util/flattr/FlattrThing.java (100%) rename {app => core}/src/main/java/de/danoeh/antennapod/core/util/flattr/FlattrUtils.java (91%) rename {app => core}/src/main/java/de/danoeh/antennapod/core/util/flattr/SimpleFlattrThing.java (100%) rename {app => core}/src/main/java/de/danoeh/antennapod/core/util/gui/FeedItemUndoToken.java (100%) rename {app => core}/src/main/java/de/danoeh/antennapod/core/util/id3reader/ChapterReader.java (98%) rename {app => core}/src/main/java/de/danoeh/antennapod/core/util/id3reader/ID3Reader.java (100%) rename {app => core}/src/main/java/de/danoeh/antennapod/core/util/id3reader/ID3ReaderException.java (100%) rename {app => core}/src/main/java/de/danoeh/antennapod/core/util/id3reader/model/FrameHeader.java (100%) rename {app => core}/src/main/java/de/danoeh/antennapod/core/util/id3reader/model/Header.java (100%) rename {app => core}/src/main/java/de/danoeh/antennapod/core/util/id3reader/model/TagHeader.java (100%) rename {app => core}/src/main/java/de/danoeh/antennapod/core/util/playback/AudioPlayer.java (100%) rename {app => core}/src/main/java/de/danoeh/antennapod/core/util/playback/ExternalMedia.java (100%) rename {app => core}/src/main/java/de/danoeh/antennapod/core/util/playback/IPlayer.java (100%) rename {app => core}/src/main/java/de/danoeh/antennapod/core/util/playback/MediaPlayerError.java (94%) rename {app => core}/src/main/java/de/danoeh/antennapod/core/util/playback/Playable.java (100%) rename {app => core}/src/main/java/de/danoeh/antennapod/core/util/playback/PlaybackController.java (99%) rename {app => core}/src/main/java/de/danoeh/antennapod/core/util/playback/Timeline.java (99%) rename {app => core}/src/main/java/de/danoeh/antennapod/core/util/playback/VideoPlayer.java (100%) rename {app => core}/src/main/java/de/danoeh/antennapod/core/util/syndication/FeedDiscoverer.java (100%) rename {app => core}/src/main/java/de/danoeh/antennapod/core/util/vorbiscommentreader/OggInputStream.java (100%) rename {app => core}/src/main/java/de/danoeh/antennapod/core/util/vorbiscommentreader/VorbisCommentChapterReader.java (98%) rename {app => core}/src/main/java/de/danoeh/antennapod/core/util/vorbiscommentreader/VorbisCommentHeader.java (100%) rename {app => core}/src/main/java/de/danoeh/antennapod/core/util/vorbiscommentreader/VorbisCommentReader.java (100%) rename {app => core}/src/main/java/de/danoeh/antennapod/core/util/vorbiscommentreader/VorbisCommentReaderException.java (100%) rename {app => core}/src/main/res/drawable-hdpi-v11/ic_stat_antenna.png (100%) rename {app => core}/src/main/res/drawable-hdpi-v11/ic_stat_authentication.png (100%) rename {app => core}/src/main/res/drawable-hdpi-v11/stat_notify_sync.png (100%) rename {app => core}/src/main/res/drawable-hdpi-v11/stat_notify_sync_error.png (100%) rename {app => core}/src/main/res/drawable-hdpi/action_about.png (100%) rename {app => core}/src/main/res/drawable-hdpi/action_about_dark.png (100%) rename {app => core}/src/main/res/drawable-hdpi/action_search.png (100%) rename {app => core}/src/main/res/drawable-hdpi/action_search_dark.png (100%) rename {app => core}/src/main/res/drawable-hdpi/action_settings.png (100%) rename {app => core}/src/main/res/drawable-hdpi/action_settings_dark.png (100%) rename {app => core}/src/main/res/drawable-hdpi/action_stream.png (100%) rename {app => core}/src/main/res/drawable-hdpi/action_stream_dark.png (100%) rename {app => core}/src/main/res/drawable-hdpi/av_download.png (100%) rename {app => core}/src/main/res/drawable-hdpi/av_download_dark.png (100%) rename {app => core}/src/main/res/drawable-hdpi/av_fast_forward.png (100%) rename {app => core}/src/main/res/drawable-hdpi/av_fast_forward_dark.png (100%) rename {app => core}/src/main/res/drawable-hdpi/av_pause.png (100%) rename {app => core}/src/main/res/drawable-hdpi/av_pause_dark.png (100%) rename {app => core}/src/main/res/drawable-hdpi/av_play.png (100%) rename {app => core}/src/main/res/drawable-hdpi/av_play_dark.png (100%) rename {app => core}/src/main/res/drawable-hdpi/av_rewind.png (100%) rename {app => core}/src/main/res/drawable-hdpi/av_rewind_dark.png (100%) rename {app => core}/src/main/res/drawable-hdpi/content_discard.png (100%) rename {app => core}/src/main/res/drawable-hdpi/content_discard_dark.png (100%) rename {app => core}/src/main/res/drawable-hdpi/content_new.png (100%) rename {app => core}/src/main/res/drawable-hdpi/content_new_dark.png (100%) rename {app => core}/src/main/res/drawable-hdpi/default_cover.png (100%) rename {app => core}/src/main/res/drawable-hdpi/default_cover_dark.png (100%) rename {app => core}/src/main/res/drawable-hdpi/device_access_time.png (100%) rename {app => core}/src/main/res/drawable-hdpi/device_access_time_dark.png (100%) rename {app => core}/src/main/res/drawable-hdpi/ic_action_overflow.png (100%) rename {app => core}/src/main/res/drawable-hdpi/ic_action_overflow_dark.png (100%) rename {app => core}/src/main/res/drawable-hdpi/ic_action_pause_over_video.png (100%) rename {app => core}/src/main/res/drawable-hdpi/ic_action_play_over_video.png (100%) rename {app => core}/src/main/res/drawable-hdpi/ic_drag_handle.png (100%) rename {app => core}/src/main/res/drawable-hdpi/ic_drag_handle_dark.png (100%) rename {app => core}/src/main/res/drawable-hdpi/ic_drawer.png (100%) rename {app => core}/src/main/res/drawable-hdpi/ic_drawer_dark.png (100%) rename {app => core}/src/main/res/drawable-hdpi/ic_launcher.png (100%) rename {app => core}/src/main/res/drawable-hdpi/ic_new.png (100%) rename {app => core}/src/main/res/drawable-hdpi/ic_new_dark.png (100%) rename {app => core}/src/main/res/drawable-hdpi/ic_stat_antenna.png (100%) rename {app => core}/src/main/res/drawable-hdpi/ic_stat_authentication.png (100%) rename {app => core}/src/main/res/drawable-hdpi/location_web_site.png (100%) rename {app => core}/src/main/res/drawable-hdpi/location_web_site_dark.png (100%) rename {app => core}/src/main/res/drawable-hdpi/navigation_accept.png (100%) rename {app => core}/src/main/res/drawable-hdpi/navigation_accept_dark.png (100%) rename {app => core}/src/main/res/drawable-hdpi/navigation_cancel.png (100%) rename {app => core}/src/main/res/drawable-hdpi/navigation_cancel_dark.png (100%) rename {app => core}/src/main/res/drawable-hdpi/navigation_chapters.png (100%) rename {app => core}/src/main/res/drawable-hdpi/navigation_chapters_dark.png (100%) rename {app => core}/src/main/res/drawable-hdpi/navigation_collapse.png (100%) rename {app => core}/src/main/res/drawable-hdpi/navigation_collapse_dark.png (100%) rename {app => core}/src/main/res/drawable-hdpi/navigation_expand.png (100%) rename {app => core}/src/main/res/drawable-hdpi/navigation_expand_dark.png (100%) rename {app => core}/src/main/res/drawable-hdpi/navigation_refresh.png (100%) rename {app => core}/src/main/res/drawable-hdpi/navigation_refresh_dark.png (100%) rename {app => core}/src/main/res/drawable-hdpi/navigation_shownotes.png (100%) rename {app => core}/src/main/res/drawable-hdpi/navigation_shownotes_dark.png (100%) rename {app => core}/src/main/res/drawable-hdpi/navigation_up.png (100%) rename {app => core}/src/main/res/drawable-hdpi/navigation_up_dark.png (100%) rename {app => core}/src/main/res/drawable-hdpi/social_share.png (100%) rename {app => core}/src/main/res/drawable-hdpi/social_share_dark.png (100%) rename {app => core}/src/main/res/drawable-hdpi/spinner_button.9.png (100%) rename {app => core}/src/main/res/drawable-hdpi/spinner_button_dark.9.png (100%) rename {app => core}/src/main/res/drawable-hdpi/stat_notify_sync.png (100%) rename {app => core}/src/main/res/drawable-hdpi/stat_notify_sync_error.png (100%) rename {app => core}/src/main/res/drawable-hdpi/stat_playlist.png (100%) rename {app => core}/src/main/res/drawable-hdpi/stat_playlist_dark.png (100%) rename {app => core}/src/main/res/drawable-hdpi/type_audio.png (100%) rename {app => core}/src/main/res/drawable-hdpi/type_audio_dark.png (100%) rename {app => core}/src/main/res/drawable-hdpi/type_video.png (100%) rename {app => core}/src/main/res/drawable-hdpi/type_video_dark.png (100%) rename {app => core}/src/main/res/drawable-ldpi-v11/ic_stat_antenna.png (100%) rename {app => core}/src/main/res/drawable-ldpi/action_stream.png (100%) rename {app => core}/src/main/res/drawable-ldpi/action_stream_dark.png (100%) rename {app => core}/src/main/res/drawable-ldpi/ic_launcher.png (100%) rename {app => core}/src/main/res/drawable-ldpi/ic_stat_antenna.png (100%) rename {app => core}/src/main/res/drawable-ldpi/stat_playlist.png (100%) rename {app => core}/src/main/res/drawable-ldpi/stat_playlist_dark.png (100%) rename {app => core}/src/main/res/drawable-mdpi-v11/ic_stat_antenna.png (100%) rename {app => core}/src/main/res/drawable-mdpi-v11/ic_stat_authentication.png (100%) rename {app => core}/src/main/res/drawable-mdpi-v11/stat_notify_sync.png (100%) rename {app => core}/src/main/res/drawable-mdpi-v11/stat_notify_sync_error.png (100%) rename {app => core}/src/main/res/drawable-mdpi/action_about.png (100%) rename {app => core}/src/main/res/drawable-mdpi/action_about_dark.png (100%) rename {app => core}/src/main/res/drawable-mdpi/action_search.png (100%) rename {app => core}/src/main/res/drawable-mdpi/action_search_dark.png (100%) rename {app => core}/src/main/res/drawable-mdpi/action_settings.png (100%) rename {app => core}/src/main/res/drawable-mdpi/action_settings_dark.png (100%) rename {app => core}/src/main/res/drawable-mdpi/action_stream.png (100%) rename {app => core}/src/main/res/drawable-mdpi/action_stream_dark.png (100%) rename {app => core}/src/main/res/drawable-mdpi/av_download.png (100%) rename {app => core}/src/main/res/drawable-mdpi/av_download_dark.png (100%) rename {app => core}/src/main/res/drawable-mdpi/av_fast_forward.png (100%) rename {app => core}/src/main/res/drawable-mdpi/av_fast_forward_dark.png (100%) rename {app => core}/src/main/res/drawable-mdpi/av_pause.png (100%) rename {app => core}/src/main/res/drawable-mdpi/av_pause_dark.png (100%) rename {app => core}/src/main/res/drawable-mdpi/av_play.png (100%) rename {app => core}/src/main/res/drawable-mdpi/av_play_dark.png (100%) rename {app => core}/src/main/res/drawable-mdpi/av_rewind.png (100%) rename {app => core}/src/main/res/drawable-mdpi/av_rewind_dark.png (100%) rename {app => core}/src/main/res/drawable-mdpi/content_discard.png (100%) rename {app => core}/src/main/res/drawable-mdpi/content_discard_dark.png (100%) rename {app => core}/src/main/res/drawable-mdpi/content_new.png (100%) rename {app => core}/src/main/res/drawable-mdpi/content_new_dark.png (100%) rename {app => core}/src/main/res/drawable-mdpi/default_cover.png (100%) rename {app => core}/src/main/res/drawable-mdpi/default_cover_dark.png (100%) rename {app => core}/src/main/res/drawable-mdpi/device_access_time.png (100%) rename {app => core}/src/main/res/drawable-mdpi/device_access_time_dark.png (100%) rename {app => core}/src/main/res/drawable-mdpi/ic_action_overflow.png (100%) rename {app => core}/src/main/res/drawable-mdpi/ic_action_overflow_dark.png (100%) rename {app => core}/src/main/res/drawable-mdpi/ic_action_pause_over_video.png (100%) rename {app => core}/src/main/res/drawable-mdpi/ic_action_play_over_video.png (100%) rename {app => core}/src/main/res/drawable-mdpi/ic_drag_handle.png (100%) rename {app => core}/src/main/res/drawable-mdpi/ic_drag_handle_dark.png (100%) rename {app => core}/src/main/res/drawable-mdpi/ic_drawer.png (100%) rename {app => core}/src/main/res/drawable-mdpi/ic_drawer_dark.png (100%) rename {app => core}/src/main/res/drawable-mdpi/ic_launcher.png (100%) rename {app => core}/src/main/res/drawable-mdpi/ic_new.png (100%) rename {app => core}/src/main/res/drawable-mdpi/ic_new_dark.png (100%) rename {app => core}/src/main/res/drawable-mdpi/ic_stat_antenna.png (100%) rename {app => core}/src/main/res/drawable-mdpi/ic_stat_authentication.png (100%) rename {app => core}/src/main/res/drawable-mdpi/location_web_site.png (100%) rename {app => core}/src/main/res/drawable-mdpi/location_web_site_dark.png (100%) rename {app => core}/src/main/res/drawable-mdpi/navigation_accept.png (100%) rename {app => core}/src/main/res/drawable-mdpi/navigation_accept_dark.png (100%) rename {app => core}/src/main/res/drawable-mdpi/navigation_cancel.png (100%) rename {app => core}/src/main/res/drawable-mdpi/navigation_cancel_dark.png (100%) rename {app => core}/src/main/res/drawable-mdpi/navigation_chapters.png (100%) rename {app => core}/src/main/res/drawable-mdpi/navigation_chapters_dark.png (100%) rename {app => core}/src/main/res/drawable-mdpi/navigation_collapse.png (100%) rename {app => core}/src/main/res/drawable-mdpi/navigation_collapse_dark.png (100%) rename {app => core}/src/main/res/drawable-mdpi/navigation_expand.png (100%) rename {app => core}/src/main/res/drawable-mdpi/navigation_expand_dark.png (100%) rename {app => core}/src/main/res/drawable-mdpi/navigation_refresh.png (100%) rename {app => core}/src/main/res/drawable-mdpi/navigation_refresh_dark.png (100%) rename {app => core}/src/main/res/drawable-mdpi/navigation_shownotes.png (100%) rename {app => core}/src/main/res/drawable-mdpi/navigation_shownotes_dark.png (100%) rename {app => core}/src/main/res/drawable-mdpi/navigation_up.png (100%) rename {app => core}/src/main/res/drawable-mdpi/navigation_up_dark.png (100%) rename {app => core}/src/main/res/drawable-mdpi/social_share.png (100%) rename {app => core}/src/main/res/drawable-mdpi/social_share_dark.png (100%) rename {app => core}/src/main/res/drawable-mdpi/spinner_button.9.png (100%) rename {app => core}/src/main/res/drawable-mdpi/spinner_button_dark.9.png (100%) rename {app => core}/src/main/res/drawable-mdpi/stat_notify_sync.png (100%) rename {app => core}/src/main/res/drawable-mdpi/stat_notify_sync_error.png (100%) rename {app => core}/src/main/res/drawable-mdpi/stat_playlist.png (100%) rename {app => core}/src/main/res/drawable-mdpi/stat_playlist_dark.png (100%) rename {app => core}/src/main/res/drawable-mdpi/type_audio.png (100%) rename {app => core}/src/main/res/drawable-mdpi/type_audio_dark.png (100%) rename {app => core}/src/main/res/drawable-mdpi/type_video.png (100%) rename {app => core}/src/main/res/drawable-mdpi/type_video_dark.png (100%) rename {app => core}/src/main/res/drawable-xhdpi-v11/ic_stat_antenna.png (100%) rename {app => core}/src/main/res/drawable-xhdpi-v11/ic_stat_authentication.png (100%) rename {app => core}/src/main/res/drawable-xhdpi-v11/stat_notify_sync.png (100%) rename {app => core}/src/main/res/drawable-xhdpi-v11/stat_notify_sync_error.png (100%) rename {app => core}/src/main/res/drawable-xhdpi/action_about.png (100%) rename {app => core}/src/main/res/drawable-xhdpi/action_about_dark.png (100%) rename {app => core}/src/main/res/drawable-xhdpi/action_search.png (100%) rename {app => core}/src/main/res/drawable-xhdpi/action_search_dark.png (100%) rename {app => core}/src/main/res/drawable-xhdpi/action_settings.png (100%) rename {app => core}/src/main/res/drawable-xhdpi/action_settings_dark.png (100%) rename {app => core}/src/main/res/drawable-xhdpi/action_stream.png (100%) rename {app => core}/src/main/res/drawable-xhdpi/action_stream_dark.png (100%) rename {app => core}/src/main/res/drawable-xhdpi/av_download.png (100%) rename {app => core}/src/main/res/drawable-xhdpi/av_download_dark.png (100%) rename {app => core}/src/main/res/drawable-xhdpi/av_fast_forward.png (100%) rename {app => core}/src/main/res/drawable-xhdpi/av_fast_forward_dark.png (100%) rename {app => core}/src/main/res/drawable-xhdpi/av_pause.png (100%) rename {app => core}/src/main/res/drawable-xhdpi/av_pause_dark.png (100%) rename {app => core}/src/main/res/drawable-xhdpi/av_play.png (100%) rename {app => core}/src/main/res/drawable-xhdpi/av_play_dark.png (100%) rename {app => core}/src/main/res/drawable-xhdpi/av_rewind.png (100%) rename {app => core}/src/main/res/drawable-xhdpi/av_rewind_dark.png (100%) rename {app => core}/src/main/res/drawable-xhdpi/content_discard.png (100%) rename {app => core}/src/main/res/drawable-xhdpi/content_discard_dark.png (100%) rename {app => core}/src/main/res/drawable-xhdpi/content_new.png (100%) rename {app => core}/src/main/res/drawable-xhdpi/content_new_dark.png (100%) rename {app => core}/src/main/res/drawable-xhdpi/content_remove.png (100%) rename {app => core}/src/main/res/drawable-xhdpi/content_remove_dark.png (100%) rename {app => core}/src/main/res/drawable-xhdpi/default_cover.png (100%) rename {app => core}/src/main/res/drawable-xhdpi/default_cover_dark.png (100%) rename {app => core}/src/main/res/drawable-xhdpi/device_access_time.png (100%) rename {app => core}/src/main/res/drawable-xhdpi/device_access_time_dark.png (100%) rename {app => core}/src/main/res/drawable-xhdpi/ic_action_overflow.png (100%) rename {app => core}/src/main/res/drawable-xhdpi/ic_action_overflow_dark.png (100%) rename {app => core}/src/main/res/drawable-xhdpi/ic_action_pause_over_video.png (100%) rename {app => core}/src/main/res/drawable-xhdpi/ic_action_play_over_video.png (100%) rename {app => core}/src/main/res/drawable-xhdpi/ic_drag_handle.png (100%) rename {app => core}/src/main/res/drawable-xhdpi/ic_drag_handle_dark.png (100%) rename {app => core}/src/main/res/drawable-xhdpi/ic_drawer.png (100%) rename {app => core}/src/main/res/drawable-xhdpi/ic_drawer_dark.png (100%) rename {app => core}/src/main/res/drawable-xhdpi/ic_launcher.png (100%) rename {app => core}/src/main/res/drawable-xhdpi/ic_new.png (100%) rename {app => core}/src/main/res/drawable-xhdpi/ic_new_dark.png (100%) rename {app => core}/src/main/res/drawable-xhdpi/ic_stat_antenna.png (100%) rename {app => core}/src/main/res/drawable-xhdpi/ic_stat_authentication.png (100%) rename {app => core}/src/main/res/drawable-xhdpi/ic_undobar_undo.png (100%) rename {app => core}/src/main/res/drawable-xhdpi/location_web_site.png (100%) rename {app => core}/src/main/res/drawable-xhdpi/location_web_site_dark.png (100%) rename {app => core}/src/main/res/drawable-xhdpi/navigation_accept.png (100%) rename {app => core}/src/main/res/drawable-xhdpi/navigation_accept_dark.png (100%) rename {app => core}/src/main/res/drawable-xhdpi/navigation_cancel.png (100%) rename {app => core}/src/main/res/drawable-xhdpi/navigation_cancel_dark.png (100%) rename {app => core}/src/main/res/drawable-xhdpi/navigation_chapters.png (100%) rename {app => core}/src/main/res/drawable-xhdpi/navigation_chapters_dark.png (100%) rename {app => core}/src/main/res/drawable-xhdpi/navigation_collapse.png (100%) rename {app => core}/src/main/res/drawable-xhdpi/navigation_collapse_dark.png (100%) rename {app => core}/src/main/res/drawable-xhdpi/navigation_expand.png (100%) rename {app => core}/src/main/res/drawable-xhdpi/navigation_expand_dark.png (100%) rename {app => core}/src/main/res/drawable-xhdpi/navigation_refresh.png (100%) rename {app => core}/src/main/res/drawable-xhdpi/navigation_refresh_dark.png (100%) rename {app => core}/src/main/res/drawable-xhdpi/navigation_shownotes.png (100%) rename {app => core}/src/main/res/drawable-xhdpi/navigation_shownotes_dark.png (100%) rename {app => core}/src/main/res/drawable-xhdpi/navigation_up.png (100%) rename {app => core}/src/main/res/drawable-xhdpi/navigation_up_dark.png (100%) rename {app => core}/src/main/res/drawable-xhdpi/social_share.png (100%) rename {app => core}/src/main/res/drawable-xhdpi/social_share_dark.png (100%) rename {app => core}/src/main/res/drawable-xhdpi/spinner_button.9.png (100%) rename {app => core}/src/main/res/drawable-xhdpi/spinner_button_dark.9.png (100%) rename {app => core}/src/main/res/drawable-xhdpi/stat_playlist.png (100%) rename {app => core}/src/main/res/drawable-xhdpi/stat_playlist_dark.png (100%) rename {app => core}/src/main/res/drawable-xhdpi/type_audio.png (100%) rename {app => core}/src/main/res/drawable-xhdpi/type_audio_dark.png (100%) rename {app => core}/src/main/res/drawable-xhdpi/type_video.png (100%) rename {app => core}/src/main/res/drawable-xhdpi/type_video_dark.png (100%) rename {app => core}/src/main/res/drawable-xhdpi/undobar.9.png (100%) rename {app => core}/src/main/res/drawable-xhdpi/undobar_button_focused.9.png (100%) rename {app => core}/src/main/res/drawable-xhdpi/undobar_button_pressed.9.png (100%) rename {app => core}/src/main/res/drawable-xhdpi/undobar_divider.9.png (100%) rename {app => core}/src/main/res/drawable-xxhdpi/ic_action_overflow.png (100%) rename {app => core}/src/main/res/drawable-xxhdpi/ic_action_overflow_dark.png (100%) rename {app => core}/src/main/res/drawable-xxhdpi/ic_action_pause_over_video.png (100%) rename {app => core}/src/main/res/drawable-xxhdpi/ic_action_play_over_video.png (100%) rename {app => core}/src/main/res/drawable-xxhdpi/ic_drag_handle.png (100%) rename {app => core}/src/main/res/drawable-xxhdpi/ic_drag_handle_dark.png (100%) rename {app => core}/src/main/res/drawable-xxhdpi/ic_drawer.png (100%) rename {app => core}/src/main/res/drawable-xxhdpi/ic_drawer_dark.png (100%) rename {app => core}/src/main/res/drawable-xxhdpi/ic_launcher.png (100%) rename {app => core}/src/main/res/drawable-xxhdpi/ic_new.png (100%) rename {app => core}/src/main/res/drawable-xxhdpi/ic_new_dark.png (100%) rename {app => core}/src/main/res/drawable-xxhdpi/ic_stat_authentication.png (100%) rename {app => core}/src/main/res/drawable/badge.xml (100%) rename {app => core}/src/main/res/drawable/borderless_button.xml (100%) rename {app => core}/src/main/res/drawable/borderless_button_dark.xml (100%) rename {app => core}/src/main/res/drawable/horizontal_divider.9.png (100%) rename {app => core}/src/main/res/drawable/overlay_button_circle_background.xml (100%) rename {app => core}/src/main/res/drawable/overlay_drawable.xml (100%) rename {app => core}/src/main/res/drawable/overlay_drawable_dark.xml (100%) rename {app => core}/src/main/res/drawable/type_audio.png (100%) rename {app => core}/src/main/res/drawable/type_video.png (100%) rename {app => core}/src/main/res/drawable/undobar_button.xml (100%) rename {app => core}/src/main/res/drawable/vertical_divider.9.png (100%) rename {app => core}/src/main/res/drawable/white_circle.xml (100%) rename {app => core}/src/main/res/values-az/strings.xml (100%) rename {app => core}/src/main/res/values-ca/strings.xml (100%) rename {app => core}/src/main/res/values-cs-rCZ/strings.xml (100%) rename {app => core}/src/main/res/values-da/strings.xml (100%) rename {app => core}/src/main/res/values-de/strings.xml (100%) rename {app => core}/src/main/res/values-es-rES/strings.xml (100%) rename {app => core}/src/main/res/values-es/strings.xml (100%) rename {app => core}/src/main/res/values-fr/strings.xml (100%) rename {app => core}/src/main/res/values-hi-rIN/strings.xml (100%) rename {app => core}/src/main/res/values-it-rIT/strings.xml (100%) rename {app => core}/src/main/res/values-iw-rIL/strings.xml (100%) rename {app => core}/src/main/res/values-ko/strings.xml (100%) rename {app => core}/src/main/res/values-land/styles.xml (100%) rename {app => core}/src/main/res/values-large/dimens.xml (100%) rename {app => core}/src/main/res/values-nl/strings.xml (100%) rename {app => core}/src/main/res/values-pl-rPL/strings.xml (100%) rename {app => core}/src/main/res/values-pt-rBR/strings.xml (100%) rename {app => core}/src/main/res/values-pt/strings.xml (100%) rename {app => core}/src/main/res/values-ro-rRO/strings.xml (100%) rename {app => core}/src/main/res/values-ru/strings.xml (100%) rename {app => core}/src/main/res/values-sv-rSE/strings.xml (100%) rename {app => core}/src/main/res/values-uk-rUA/strings.xml (100%) rename {app => core}/src/main/res/values-v11/colors.xml (100%) rename {app => core}/src/main/res/values-v14/dimens.xml (100%) rename {app => core}/src/main/res/values-v14/styles.xml (100%) rename {app => core}/src/main/res/values-v16/styles.xml (100%) rename {app => core}/src/main/res/values-v19/colors.xml (100%) rename {app => core}/src/main/res/values-zh-rCN/strings.xml (100%) rename {app => core}/src/main/res/values/arrays.xml (100%) rename {app => core}/src/main/res/values/attrs.xml (100%) rename {app => core}/src/main/res/values/colors.xml (100%) rename {app => core}/src/main/res/values/dimens.xml (100%) rename {app => core}/src/main/res/values/ids.xml (100%) rename {app => core}/src/main/res/values/integers.xml (100%) rename {app => core}/src/main/res/values/strings.xml (100%) rename {app => core}/src/main/res/values/styles.xml (100%) diff --git a/app/build.gradle b/app/build.gradle index 1295a81dc..2e4b1da7d 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -15,7 +15,7 @@ dependencies { compile 'com.android.support:support-v4:20.0.0' compile 'com.android.support:appcompat-v7:20.0.0' compile 'org.apache.commons:commons-lang3:3.3.2' - compile ('org.shredzone.flattr4j:flattr4j-core:2.10') { + compile('org.shredzone.flattr4j:flattr4j-core:2.10') { exclude group: 'org.apache.httpcomponents', module: 'httpcore' exclude group: 'org.apache.httpcomponents', module: 'httpclient' exclude group: 'org.json', module: 'json' @@ -23,9 +23,8 @@ dependencies { compile 'commons-io:commons-io:2.4' compile 'com.nineoldandroids:library:2.4.0' compile project('dslv:library') - compile 'com.jayway.android.robotium:robotium-solo:5.2.1' - compile ("com.doomonafireball.betterpickers:library:1.5.2") { + compile('com.doomonafireball.betterpickers:library:1.5.2') { exclude group: 'com.android.support', module: 'support-v4' } compile 'org.jsoup:jsoup:1.7.3' @@ -33,6 +32,7 @@ dependencies { compile 'com.squareup.okhttp:okhttp:2.0.0' compile 'com.squareup.okhttp:okhttp-urlconnection:2.0.0' compile 'com.squareup.okio:okio:1.0.0' + compile project(':core') } android { diff --git a/app/core/build.gradle b/app/core/build.gradle deleted file mode 100644 index a552f8313..000000000 --- a/app/core/build.gradle +++ /dev/null @@ -1,83 +0,0 @@ -buildscript { - repositories { - mavenCentral() - } - dependencies { - classpath 'com.android.tools.build:gradle:0.12.2' - } -} -apply plugin: 'android-library' - -repositories { - mavenCentral() -} -dependencies { - compile 'com.android.support:support-v4:20.0.0' - compile 'com.android.support:appcompat-v7:20.0.0' - compile 'org.apache.commons:commons-lang3:3.3.2' - compile ('org.shredzone.flattr4j:flattr4j-core:2.10') { - exclude group: 'org.apache.httpcomponents', module: 'httpcore' - exclude group: 'org.apache.httpcomponents', module: 'httpclient' - exclude group: 'org.json', module: 'json' - } - compile 'commons-io:commons-io:2.4' - compile 'com.nineoldandroids:library:2.4.0' - compile project('dslv:library') - - compile 'com.jayway.android.robotium:robotium-solo:5.2.1' - compile ("com.doomonafireball.betterpickers:library:1.5.2") { - exclude group: 'com.android.support', module: 'support-v4' - } - compile 'org.jsoup:jsoup:1.7.3' - compile 'com.squareup.picasso:picasso:2.3.4' - compile 'com.squareup.okhttp:okhttp:2.0.0' - compile 'com.squareup.okhttp:okhttp-urlconnection:2.0.0' - compile 'com.squareup.okio:okio:1.0.0' -} - -android { - compileSdkVersion 19 - buildToolsVersion "20.0" - - defaultConfig { - minSdkVersion 10 - targetSdkVersion 19 - testApplicationId "de.test.antennapod" - testInstrumentationRunner "de.test.antennapod.AntennaPodTestRunner" - } - - buildTypes { - def STRING = "String" - def FLATTR_APP_KEY = "FLATTR_APP_KEY" - def FLATTR_APP_SECRET = "FLATTR_APP_SECRET" - def mFlattrAppKey = (project.hasProperty('flattrAppKey')) ? flattrAppKey : "\"\"" - def mFlattrAppSecret = (project.hasProperty('flattrAppSecret')) ? flattrAppSecret : "\"\"" - - debug { - applicationIdSuffix ".debug" - buildConfigField STRING, FLATTR_APP_KEY, mFlattrAppKey - buildConfigField STRING, FLATTR_APP_SECRET, mFlattrAppSecret - } - release { - runProguard true - proguardFile 'proguard.cfg' - signingConfig signingConfigs.releaseConfig - buildConfigField STRING, FLATTR_APP_KEY, mFlattrAppKey - buildConfigField STRING, FLATTR_APP_SECRET, mFlattrAppSecret - } - } - - packagingOptions { - exclude 'META-INF/LICENSE.txt' - exclude 'META-INF/NOTICE.txt' - } - - lintOptions { - abortOnError false - } - - compileOptions { - sourceCompatibility JavaVersion.VERSION_1_7 - targetCompatibility JavaVersion.VERSION_1_7 - } -} diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 768a4abb0..3410d9d53 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -112,12 +112,12 @@ - + diff --git a/app/src/main/java/com/aocate/media/MediaPlayer.java b/app/src/main/java/com/aocate/media/MediaPlayer.java deleted file mode 100644 index 04ecd58a9..000000000 --- a/app/src/main/java/com/aocate/media/MediaPlayer.java +++ /dev/null @@ -1,1296 +0,0 @@ -// Copyright 2011, Aocate, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package com.aocate.media; - -import java.io.IOException; -import java.util.List; -import java.util.concurrent.locks.ReentrantLock; - -import android.content.ComponentName; -import android.content.Context; -import android.content.Intent; -import android.content.ServiceConnection; -import android.content.pm.PackageManager; -import android.content.pm.ResolveInfo; -import android.media.AudioManager; -import android.net.Uri; -import android.os.Handler; -import android.os.IBinder; -import android.os.Message; -import android.os.Handler.Callback; -import android.util.Log; - -import de.danoeh.antennapod.BuildConfig; - -public class MediaPlayer { - public interface OnBufferingUpdateListener { - public abstract void onBufferingUpdate(MediaPlayer arg0, int percent); - } - - public interface OnCompletionListener { - public abstract void onCompletion(MediaPlayer arg0); - } - - public interface OnErrorListener { - public abstract boolean onError(MediaPlayer arg0, int what, int extra); - } - - public interface OnInfoListener { - public abstract boolean onInfo(MediaPlayer arg0, int what, int extra); - } - - public interface OnPitchAdjustmentAvailableChangedListener { - /** - * - * @param arg0 - * The owning media player - * @param pitchAdjustmentAvailable - * True if pitch adjustment is available, false if not - */ - public abstract void onPitchAdjustmentAvailableChanged( - MediaPlayer arg0, boolean pitchAdjustmentAvailable); - } - - public interface OnPreparedListener { - public abstract void onPrepared(MediaPlayer arg0); - } - - public interface OnSeekCompleteListener { - public abstract void onSeekComplete(MediaPlayer arg0); - } - - public interface OnSpeedAdjustmentAvailableChangedListener { - /** - * - * @param arg0 - * The owning media player - * @param speedAdjustmentAvailable - * True if speed adjustment is available, false if not - */ - public abstract void onSpeedAdjustmentAvailableChanged( - MediaPlayer arg0, boolean speedAdjustmentAvailable); - } - - public enum State { - IDLE, INITIALIZED, PREPARED, STARTED, PAUSED, STOPPED, PREPARING, PLAYBACK_COMPLETED, END, ERROR - } - - private static Uri SPEED_ADJUSTMENT_MARKET_URI = Uri - .parse("market://details?id=com.aocate.presto"); - - private static Intent prestoMarketIntent = null; - - public static final int MEDIA_ERROR_SERVER_DIED = android.media.MediaPlayer.MEDIA_ERROR_SERVER_DIED; - public static final int MEDIA_ERROR_UNKNOWN = android.media.MediaPlayer.MEDIA_ERROR_UNKNOWN; - public static final int MEDIA_ERROR_NOT_VALID_FOR_PROGRESSIVE_PLAYBACK = android.media.MediaPlayer.MEDIA_ERROR_NOT_VALID_FOR_PROGRESSIVE_PLAYBACK; - - /** - * Indicates whether the specified action can be used as an intent. This - * method queries the package manager for installed packages that can - * respond to an intent with the specified action. If no suitable package is - * found, this method returns false. - * - * @param context - * The application's environment. - * @param action - * The Intent action to check for availability. - * - * @return True if an Intent with the specified action can be sent and - * responded to, false otherwise. - */ - public static boolean isIntentAvailable(Context context, String action) { - final PackageManager packageManager = context.getPackageManager(); - final Intent intent = new Intent(action); - List list = packageManager.queryIntentServices(intent, - PackageManager.MATCH_DEFAULT_ONLY); - return list.size() > 0; - } - - /** - * Indicates whether the Presto library is installed - * - * @param context - * The context to use to query the package manager. - * @return True if the Presto library is installed, false if not. - */ - public static boolean isPrestoLibraryInstalled(Context context) { - return isIntentAvailable(context, ServiceBackedMediaPlayer.INTENT_NAME); - } - - /** - * Return an Intent that opens the Android Market page for the speed - * alteration library - * - * @return The Intent for the Presto library on the Android Market - */ - public static Intent getPrestoMarketIntent() { - if (prestoMarketIntent == null) { - prestoMarketIntent = new Intent(Intent.ACTION_VIEW, - SPEED_ADJUSTMENT_MARKET_URI); - } - return prestoMarketIntent; - } - - /** - * Open the Android Market page for the Presto library - * - * @param context - * The context from which to open the Android Market page - */ - public static void openPrestoMarketIntent(Context context) { - context.startActivity(getPrestoMarketIntent()); - } - - private static final String MP_TAG = "AocateReplacementMediaPlayer"; - - private static final double PITCH_STEP_CONSTANT = 1.0594630943593; - - private AndroidMediaPlayer amp = null; - // This is whether speed adjustment should be enabled (by the Service) - // To avoid the Service entirely, set useService to false - protected boolean enableSpeedAdjustment = true; - private int lastKnownPosition = 0; - // In some cases, we're going to have to replace the - // android.media.MediaPlayer on the fly, and we don't want to touch the - // wrong media player, so lock it way too much. - ReentrantLock lock = new ReentrantLock(); - private int mAudioStreamType = AudioManager.STREAM_MUSIC; - private Context mContext; - private boolean mIsLooping = false; - private float mLeftVolume = 1f; - private float mPitchStepsAdjustment = 0f; - private float mRightVolume = 1f; - private float mSpeedMultiplier = 1f; - private int mWakeMode = 0; - MediaPlayerImpl mpi = null; - protected boolean pitchAdjustmentAvailable = false; - private ServiceBackedMediaPlayer sbmp = null; - protected boolean speedAdjustmentAvailable = false; - - private Handler mServiceDisconnectedHandler = null; - - // Some parts of state cannot be found by calling MediaPlayerImpl functions, - // so store our own state. This also helps copy state when changing - // implementations - State state = State.INITIALIZED; - String stringDataSource = null; - Uri uriDataSource = null; - private boolean useService = false; - - // Naming Convention for Listeners - // Most listeners can both be set by clients and called by MediaPlayImpls - // There are a few that have to do things in this class as well as calling - // the function. In all cases, onX is what is called by MediaPlayerImpl - // If there is work to be done in this class, then the listener that is - // set by setX is X (with the first letter lowercase). - OnBufferingUpdateListener onBufferingUpdateListener = null; - OnCompletionListener onCompletionListener = null; - OnErrorListener onErrorListener = null; - OnInfoListener onInfoListener = null; - - // Special case. Pitch adjustment ceases to be available when we switch - // to the android.media.MediaPlayer (though it is not guaranteed to be - // available when using the ServiceBackedMediaPlayer) - OnPitchAdjustmentAvailableChangedListener onPitchAdjustmentAvailableChangedListener = new OnPitchAdjustmentAvailableChangedListener() { - public void onPitchAdjustmentAvailableChanged(MediaPlayer arg0, - boolean pitchAdjustmentAvailable) { - lock.lock(); - try { - Log - .d( - MP_TAG, - "onPitchAdjustmentAvailableChangedListener.onPitchAdjustmentAvailableChanged being called"); - if (MediaPlayer.this.pitchAdjustmentAvailable != pitchAdjustmentAvailable) { - Log.d(MP_TAG, "Pitch adjustment state has changed from " - + MediaPlayer.this.pitchAdjustmentAvailable - + " to " + pitchAdjustmentAvailable); - MediaPlayer.this.pitchAdjustmentAvailable = pitchAdjustmentAvailable; - if (MediaPlayer.this.pitchAdjustmentAvailableChangedListener != null) { - MediaPlayer.this.pitchAdjustmentAvailableChangedListener - .onPitchAdjustmentAvailableChanged(arg0, - pitchAdjustmentAvailable); - } - } - } finally { - lock.unlock(); - } - } - }; - OnPitchAdjustmentAvailableChangedListener pitchAdjustmentAvailableChangedListener = null; - - MediaPlayer.OnPreparedListener onPreparedListener = new MediaPlayer.OnPreparedListener() { - public void onPrepared(MediaPlayer arg0) { - Log.d(MP_TAG, "onPreparedListener 242 setting state to PREPARED"); - MediaPlayer.this.state = State.PREPARED; - if (MediaPlayer.this.preparedListener != null) { - Log.d(MP_TAG, "Calling preparedListener"); - MediaPlayer.this.preparedListener.onPrepared(arg0); - } - Log.d(MP_TAG, "Wrap up onPreparedListener"); - } - }; - - OnPreparedListener preparedListener = null; - OnSeekCompleteListener onSeekCompleteListener = null; - - // Special case. Speed adjustment ceases to be available when we switch - // to the android.media.MediaPlayer (though it is not guaranteed to be - // available when using the ServiceBackedMediaPlayer) - OnSpeedAdjustmentAvailableChangedListener onSpeedAdjustmentAvailableChangedListener = new OnSpeedAdjustmentAvailableChangedListener() { - public void onSpeedAdjustmentAvailableChanged(MediaPlayer arg0, - boolean speedAdjustmentAvailable) { - lock.lock(); - try { - Log - .d( - MP_TAG, - "onSpeedAdjustmentAvailableChangedListener.onSpeedAdjustmentAvailableChanged being called"); - if (MediaPlayer.this.speedAdjustmentAvailable != speedAdjustmentAvailable) { - Log.d(MP_TAG, "Speed adjustment state has changed from " - + MediaPlayer.this.speedAdjustmentAvailable - + " to " + speedAdjustmentAvailable); - MediaPlayer.this.speedAdjustmentAvailable = speedAdjustmentAvailable; - if (MediaPlayer.this.speedAdjustmentAvailableChangedListener != null) { - MediaPlayer.this.speedAdjustmentAvailableChangedListener - .onSpeedAdjustmentAvailableChanged(arg0, - speedAdjustmentAvailable); - } - } - } finally { - lock.unlock(); - } - } - }; - OnSpeedAdjustmentAvailableChangedListener speedAdjustmentAvailableChangedListener = null; - - private int speedAdjustmentAlgorithm = SpeedAdjustmentAlgorithm.SONIC; - - public MediaPlayer(final Context context) { - this(context, true); - } - - public MediaPlayer(final Context context, boolean useService) { - this.mContext = context; - this.useService = useService; - - // So here's the major problem - // Sometimes the service won't exist or won't be connected, - // so start with an android.media.MediaPlayer, and when - // the service is connected, use that from then on - this.mpi = this.amp = new AndroidMediaPlayer(this, context); - - // setupMpi will go get the Service, if it can, then bring that - // implementation into sync - Log.d(MP_TAG, "setupMpi"); - setupMpi(context); - } - - private boolean invalidServiceConnectionConfiguration() { - if (!(this.mpi instanceof ServiceBackedMediaPlayer)) { - if (this.useService && isPrestoLibraryInstalled()) { - // In this case, the Presto library has been installed - // or something while playing sound - // We could be using the service, but we're not - Log.d(MP_TAG, "We could be using the service, but we're not 316"); - return true; - } - // If useService is false, then we shouldn't be using the SBMP - // If the Presto library isn't installed, ditto - Log.d(MP_TAG, "this.mpi is not a ServiceBackedMediaPlayer, but we couldn't use it anyway 321"); - return false; - } else { - if (BuildConfig.DEBUG && !(this.mpi instanceof ServiceBackedMediaPlayer)) throw new AssertionError(); - if (this.useService && isPrestoLibraryInstalled()) { - // We should be using the service, and we are. Great! - Log.d(MP_TAG, "We could be using a ServiceBackedMediaPlayer and we are 327"); - return false; - } - // We're trying to use the service when we shouldn't, - // that's an invalid configuration - Log.d(MP_TAG, "We're trying to use a ServiceBackedMediaPlayer but we shouldn't be 332"); - return true; - } - } - - private void setupMpi(final Context context) { - lock.lock(); - try { - Log.d(MP_TAG, "setupMpi 336"); - // Check if the client wants to use the service at all, - // then if we're already using the right kind of media player - if (this.useService && isPrestoLibraryInstalled()) { - if ((this.mpi != null) - && (this.mpi instanceof ServiceBackedMediaPlayer)) { - Log.d(MP_TAG, "Already using ServiceBackedMediaPlayer"); - return; - } - if (this.sbmp == null) { - Log.d(MP_TAG, "Instantiating new ServiceBackedMediaPlayer 346"); - this.sbmp = new ServiceBackedMediaPlayer(this, context, - new ServiceConnection() { - public void onServiceConnected( - ComponentName className, - final IBinder service) { - Thread t = new Thread(new Runnable() { - public void run() { - // This lock probably isn't granular - // enough - MediaPlayer.this.lock.lock(); - Log.d(MP_TAG, - "onServiceConnected 257"); - try { - MediaPlayer.this - .switchMediaPlayerImpl( - MediaPlayer.this.amp, - MediaPlayer.this.sbmp); - Log.d(MP_TAG, "End onServiceConnected 362"); - } finally { - MediaPlayer.this.lock.unlock(); - } - } - }); - t.start(); - } - - public void onServiceDisconnected( - ComponentName className) { - MediaPlayer.this.lock.lock(); - try { - // Can't get any more useful information - // out of sbmp - if (MediaPlayer.this.sbmp != null) { - MediaPlayer.this.sbmp.release(); - } - // Unlike most other cases, sbmp gets set - // to null since there's nothing useful - // backing it now - MediaPlayer.this.sbmp = null; - - if (mServiceDisconnectedHandler == null) { - mServiceDisconnectedHandler = new Handler(new Callback() { - public boolean handleMessage(Message msg) { - // switchMediaPlayerImpl won't try to - // clone anything from null - lock.lock(); - try { - if (MediaPlayer.this.amp == null) { - // This should never be in this state - MediaPlayer.this.amp = new AndroidMediaPlayer( - MediaPlayer.this, - MediaPlayer.this.mContext); - } - // Use sbmp instead of null in case by some miracle it's - // been restored in the meantime - MediaPlayer.this.switchMediaPlayerImpl( - MediaPlayer.this.sbmp, - MediaPlayer.this.amp); - return true; - } - finally { - lock.unlock(); - } - } - }); - } - - // This code needs to execute on the - // original thread to instantiate - // the new object in the right place - mServiceDisconnectedHandler - .sendMessage( - mServiceDisconnectedHandler - .obtainMessage()); - // Note that we do NOT want to set - // useService. useService is about - // what the user wants, not what they - // get - } finally { - MediaPlayer.this.lock.unlock(); - } - } - } - ); - } - switchMediaPlayerImpl(this.amp, this.sbmp); - } else { - if ((this.mpi != null) - && (this.mpi instanceof AndroidMediaPlayer)) { - Log.d(MP_TAG, "Already using AndroidMediaPlayer"); - return; - } - if (this.amp == null) { - Log.d(MP_TAG, "Instantiating new AndroidMediaPlayer (this should be impossible)"); - this.amp = new AndroidMediaPlayer(this, context); - } - switchMediaPlayerImpl(this.sbmp, this.amp); - } - } finally { - lock.unlock(); - } - } - - private void switchMediaPlayerImpl(MediaPlayerImpl from, MediaPlayerImpl to) { - lock.lock(); - try { - Log.d(MP_TAG, "switchMediaPlayerImpl"); - if ((from == to) - // Same object, nothing to synchronize - || (to == null) - // Nothing to copy to (maybe this should throw an error?) - || ((to instanceof ServiceBackedMediaPlayer) && !((ServiceBackedMediaPlayer) to).isConnected()) - // ServiceBackedMediaPlayer hasn't yet connected, onServiceConnected will take care of the transition - || (MediaPlayer.this.state == State.END)) { - // State.END is after a release(), no further functions should - // be called on this class and from is likely to have problems - // retrieving state that won't be used anyway - return; - } - // Extract all that we can from the existing implementation - // and copy it to the new implementation - - Log.d(MP_TAG, "switchMediaPlayerImpl(), current state is " - + this.state.toString()); - - to.reset(); - - // Do this first so we don't have to prepare the same - // data file twice - to.setEnableSpeedAdjustment(MediaPlayer.this.enableSpeedAdjustment); - - // This is a reasonable place to set all of these, - // none of them require prepare() or the like first - to.setAudioStreamType(this.mAudioStreamType); - to.setSpeedAdjustmentAlgorithm(this.speedAdjustmentAlgorithm); - to.setLooping(this.mIsLooping); - to.setPitchStepsAdjustment(this.mPitchStepsAdjustment); - Log.d(MP_TAG, "Setting playback speed to " + this.mSpeedMultiplier); - to.setPlaybackSpeed(this.mSpeedMultiplier); - to.setVolume(MediaPlayer.this.mLeftVolume, - MediaPlayer.this.mRightVolume); - to.setWakeMode(this.mContext, this.mWakeMode); - - Log.d(MP_TAG, "asserting at least one data source is null"); - assert ((MediaPlayer.this.stringDataSource == null) || (MediaPlayer.this.uriDataSource == null)); - - if (uriDataSource != null) { - Log.d(MP_TAG, "switchMediaPlayerImpl(): uriDataSource != null"); - try { - to.setDataSource(this.mContext, uriDataSource); - } catch (IllegalArgumentException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } catch (IllegalStateException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } catch (IOException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - } - if (stringDataSource != null) { - Log.d(MP_TAG, - "switchMediaPlayerImpl(): stringDataSource != null"); - try { - to.setDataSource(stringDataSource); - } catch (IllegalArgumentException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } catch (IllegalStateException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } catch (IOException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - } - if ((this.state == State.PREPARED) - || (this.state == State.PREPARING) - || (this.state == State.PAUSED) - || (this.state == State.STOPPED) - || (this.state == State.STARTED) - || (this.state == State.PLAYBACK_COMPLETED)) { - Log.d(MP_TAG, "switchMediaPlayerImpl(): prepare and seek"); - // Use prepare here instead of prepareAsync so that - // we wait for it to be ready before we try to use it - try { - to.muteNextOnPrepare(); - to.prepare(); - } catch (IllegalStateException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } catch (IOException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - - int seekPos = 0; - if (from != null) { - seekPos = from.getCurrentPosition(); - } else if (this.lastKnownPosition < to.getDuration()) { - // This can happen if the Service unexpectedly - // disconnected. Because it would result in too much - // information being passed around, we don't constantly - // poll for the lastKnownPosition, but we'll save it - // when getCurrentPosition is called - seekPos = this.lastKnownPosition; - } - to.muteNextSeek(); - to.seekTo(seekPos); - } - if ((from != null) - && from.isPlaying()) { - from.pause(); - } - if ((this.state == State.STARTED) - || (this.state == State.PAUSED) - || (this.state == State.STOPPED)) { - Log.d(MP_TAG, "switchMediaPlayerImpl(): start"); - if (to != null) { - to.start(); - } - } - - if (this.state == State.PAUSED) { - Log.d(MP_TAG, "switchMediaPlayerImpl(): paused"); - if (to != null) { - to.pause(); - } - } else if (this.state == State.STOPPED) { - Log.d(MP_TAG, "switchMediaPlayerImpl(): stopped"); - if (to != null) { - to.stop(); - } - } - - this.mpi = to; - - // Cheating here by relying on the side effect in - // on(Pitch|Speed)AdjustmentAvailableChanged - if ((to.canSetPitch() != this.pitchAdjustmentAvailable) - && (this.onPitchAdjustmentAvailableChangedListener != null)) { - this.onPitchAdjustmentAvailableChangedListener - .onPitchAdjustmentAvailableChanged(this, to - .canSetPitch()); - } - if ((to.canSetSpeed() != this.speedAdjustmentAvailable) - && (this.onSpeedAdjustmentAvailableChangedListener != null)) { - this.onSpeedAdjustmentAvailableChangedListener - .onSpeedAdjustmentAvailableChanged(this, to - .canSetSpeed()); - } - Log.d(MP_TAG, "switchMediaPlayerImpl() 625 " + this.state.toString()); - } finally { - lock.unlock(); - } - } - - /** - * Returns true if pitch can be changed at this moment - * - * @return True if pitch can be changed - */ - public boolean canSetPitch() { - lock.lock(); - try { - return this.mpi.canSetPitch(); - } finally { - lock.unlock(); - } - } - - /** - * Returns true if speed can be changed at this moment - * - * @return True if speed can be changed - */ - public boolean canSetSpeed() { - lock.lock(); - try { - return this.mpi.canSetSpeed(); - } finally { - lock.unlock(); - } - } - - protected void finalize() throws Throwable { - lock.lock(); - try { - Log.d(MP_TAG, "finalize() 626"); - this.release(); - } finally { - lock.unlock(); - } - } - - /** - * Returns the number of steps (in a musical scale) by which playback is - * currently shifted. When greater than zero, pitch is shifted up. When less - * than zero, pitch is shifted down. - * - * @return The number of steps pitch is currently shifted by - */ - public float getCurrentPitchStepsAdjustment() { - lock.lock(); - try { - return this.mpi.getCurrentPitchStepsAdjustment(); - } finally { - lock.unlock(); - } - } - - /** - * Functions identically to android.media.MediaPlayer.getCurrentPosition() - * Accurate only to frame size of encoded data (26 ms for MP3s) - * - * @return Current position (in milliseconds) - */ - public int getCurrentPosition() { - lock.lock(); - try { - return (this.lastKnownPosition = this.mpi.getCurrentPosition()); - } finally { - lock.unlock(); - } - } - - /** - * Returns the current speed multiplier. Defaults to 1.0 (normal speed) - * - * @return The current speed multiplier - */ - public float getCurrentSpeedMultiplier() { - lock.lock(); - try { - return this.mpi.getCurrentSpeedMultiplier(); - } finally { - lock.unlock(); - } - } - - /** - * Functions identically to android.media.MediaPlayer.getDuration() - * - * @return Length of the track (in milliseconds) - */ - public int getDuration() { - lock.lock(); - try { - return this.mpi.getDuration(); - } finally { - lock.unlock(); - } - } - - /** - * Get the maximum value that can be passed to setPlaybackSpeed - * - * @return The maximum speed multiplier - */ - public float getMaxSpeedMultiplier() { - lock.lock(); - try { - return this.mpi.getMaxSpeedMultiplier(); - } finally { - lock.unlock(); - } - } - - /** - * Get the minimum value that can be passed to setPlaybackSpeed - * - * @return The minimum speed multiplier - */ - public float getMinSpeedMultiplier() { - lock.lock(); - try { - return this.mpi.getMinSpeedMultiplier(); - } finally { - lock.unlock(); - } - } - - /** - * Gets the version code of the backing service - * @return -1 if ServiceBackedMediaPlayer is not used, 0 if the service is not - * connected, otherwise the version code retrieved from the service - */ - public int getServiceVersionCode() { - lock.lock(); - try { - if (this.mpi instanceof ServiceBackedMediaPlayer) { - return ((ServiceBackedMediaPlayer) this.mpi).getServiceVersionCode(); - } - else { - return -1; - } - } - finally { - lock.unlock(); - } - } - - /** - * Gets the version name of the backing service - * @return null if ServiceBackedMediaPlayer is not used, empty string if - * the service is not connected, otherwise the version name retrieved from - * the service - */ - public String getServiceVersionName() { - lock.lock(); - try { - if (this.mpi instanceof ServiceBackedMediaPlayer) { - return ((ServiceBackedMediaPlayer) this.mpi).getServiceVersionName(); - } - else { - return null; - } - } - finally { - lock.unlock(); - } - } - - /** - * Functions identically to android.media.MediaPlayer.isLooping() - * - * @return True if the track is looping - */ - public boolean isLooping() { - lock.lock(); - try { - return this.mpi.isLooping(); - } finally { - lock.unlock(); - } - } - - /** - * Functions identically to android.media.MediaPlayer.isPlaying() - * - * @return True if the track is playing - */ - public boolean isPlaying() { - lock.lock(); - try { - return this.mpi.isPlaying(); - } finally { - lock.unlock(); - } - } - - /** - * Returns true if this MediaPlayer has access to the Presto - * library - * - * @return True if the Presto library is installed - */ - public boolean isPrestoLibraryInstalled() { - if ((this.mpi == null) || (this.mpi.mContext == null)) { - return false; - } - return isPrestoLibraryInstalled(this.mpi.mContext); - } - - /** - * Open the Android Market page in the same context as this MediaPlayer - */ - public void openPrestoMarketIntent() { - if ((this.mpi != null) && (this.mpi.mContext != null)) { - openPrestoMarketIntent(this.mpi.mContext); - } - } - - /** - * Functions identically to android.media.MediaPlayer.pause() Pauses the - * track - */ - public void pause() { - lock.lock(); - try { - if (invalidServiceConnectionConfiguration()) { - setupMpi(this.mpi.mContext); - } - this.state = State.PAUSED; - this.mpi.pause(); - } finally { - lock.unlock(); - } - } - - /** - * Functions identically to android.media.MediaPlayer.prepare() Prepares the - * track. This or prepareAsync must be called before start() - */ - public void prepare() throws IllegalStateException, IOException { - lock.lock(); - try { - Log.d(MP_TAG, "prepare() 746 using " + ((this.mpi == null) ? "null (this shouldn't happen)" : this.mpi.getClass().toString()) + " state " + this.state.toString()); - Log.d(MP_TAG, "onPreparedListener is: " + ((this.onPreparedListener == null) ? "null" : "non-null")); - Log.d(MP_TAG, "preparedListener is: " + ((this.preparedListener == null) ? "null" : "non-null")); - if (invalidServiceConnectionConfiguration()) { - setupMpi(this.mpi.mContext); - } - this.mpi.prepare(); - this.state = State.PREPARED; - Log.d(MP_TAG, "prepare() finished 778"); - } finally { - lock.unlock(); - } - } - - /** - * Functions identically to android.media.MediaPlayer.prepareAsync() - * Prepares the track. This or prepare must be called before start() - */ - public void prepareAsync() { - lock.lock(); - try { - Log.d(MP_TAG, "prepareAsync() 779"); - if (invalidServiceConnectionConfiguration()) { - setupMpi(this.mpi.mContext); - } - this.state = State.PREPARING; - this.mpi.prepareAsync(); - } finally { - lock.unlock(); - } - } - - /** - * Functions identically to android.media.MediaPlayer.release() Releases the - * underlying resources used by the media player. - */ - public void release() { - lock.lock(); - try { - Log.d(MP_TAG, "Releasing MediaPlayer 791"); - - this.state = State.END; - if (this.amp != null) { - this.amp.release(); - } - if (this.sbmp != null) { - this.sbmp.release(); - } - - this.onBufferingUpdateListener = null; - this.onCompletionListener = null; - this.onErrorListener = null; - this.onInfoListener = null; - this.preparedListener = null; - this.onPitchAdjustmentAvailableChangedListener = null; - this.pitchAdjustmentAvailableChangedListener = null; - Log.d(MP_TAG, "Setting onSeekCompleteListener to null 871"); - this.onSeekCompleteListener = null; - this.onSpeedAdjustmentAvailableChangedListener = null; - this.speedAdjustmentAvailableChangedListener = null; - } finally { - lock.unlock(); - } - } - - /** - * Functions identically to android.media.MediaPlayer.reset() Resets the - * track to idle state - */ - public void reset() { - lock.lock(); - try { - this.state = State.IDLE; - this.stringDataSource = null; - this.uriDataSource = null; - this.mpi.reset(); - } finally { - lock.unlock(); - } - } - - /** - * Functions identically to android.media.MediaPlayer.seekTo(int msec) Seeks - * to msec in the track - */ - public void seekTo(int msec) throws IllegalStateException { - lock.lock(); - try { - this.mpi.seekTo(msec); - } finally { - lock.unlock(); - } - } - - /** - * Functions identically to android.media.MediaPlayer.setAudioStreamType(int - * streamtype) Sets the audio stream type. - */ - public void setAudioStreamType(int streamtype) { - lock.lock(); - try { - this.mAudioStreamType = streamtype; - this.mpi.setAudioStreamType(streamtype); - } finally { - lock.unlock(); - } - } - - /** - * Functions identically to android.media.MediaPlayer.setDataSource(Context - * context, Uri uri) Sets uri as data source in the context given - */ - public void setDataSource(Context context, Uri uri) - throws IllegalArgumentException, IllegalStateException, IOException { - lock.lock(); - try { - Log.d(MP_TAG, "In setDataSource(context, " + uri.toString() + "), using " + this.mpi.getClass().toString()); - if (invalidServiceConnectionConfiguration()) { - setupMpi(this.mpi.mContext); - } - this.state = State.INITIALIZED; - this.stringDataSource = null; - this.uriDataSource = uri; - this.mpi.setDataSource(context, uri); - } finally { - lock.unlock(); - } - } - - /** - * Functions identically to android.media.MediaPlayer.setDataSource(String - * path) Sets the data source of the track to a file given. - */ - public void setDataSource(String path) throws IllegalArgumentException, - IllegalStateException, IOException { - lock.lock(); - try { - Log.d(MP_TAG, "In setDataSource(context, " + path + ")"); - if (invalidServiceConnectionConfiguration()) { - setupMpi(this.mpi.mContext); - } - this.state = State.INITIALIZED; - this.stringDataSource = path; - this.uriDataSource = null; - this.mpi.setDataSource(path); - } finally { - lock.unlock(); - } - } - - /** - * Sets whether to use speed adjustment or not. Speed adjustment on is more - * computation-intensive than with it off. - * - * @param enableSpeedAdjustment - * Whether speed adjustment should be supported. - */ - public void setEnableSpeedAdjustment(boolean enableSpeedAdjustment) { - lock.lock(); - try { - this.enableSpeedAdjustment = enableSpeedAdjustment; - this.mpi.setEnableSpeedAdjustment(enableSpeedAdjustment); - } finally { - lock.unlock(); - } - } - - /** - * Functions identically to android.media.MediaPlayer.setLooping(boolean - * loop) Sets the track to loop infinitely if loop is true, play once if - * loop is false - */ - public void setLooping(boolean loop) { - lock.lock(); - try { - this.mIsLooping = loop; - this.mpi.setLooping(loop); - } finally { - lock.unlock(); - } - } - - /** - * Sets the number of steps (in a musical scale) by which playback is - * currently shifted. When greater than zero, pitch is shifted up. When less - * than zero, pitch is shifted down. - * - * @param pitchSteps - * The number of steps by which to shift playback - */ - public void setPitchStepsAdjustment(float pitchSteps) { - lock.lock(); - try { - this.mPitchStepsAdjustment = pitchSteps; - this.mpi.setPitchStepsAdjustment(pitchSteps); - } finally { - lock.unlock(); - } - } - - /** - * Set the algorithm to use for changing the speed and pitch of audio - * See SpeedAdjustmentAlgorithm constants for more details - * @param algorithm The algorithm to use. - */ - public void setSpeedAdjustmentAlgorithm(int algorithm) { - lock.lock(); - try { - this.speedAdjustmentAlgorithm = algorithm; - if (this.mpi != null) { - this.mpi.setSpeedAdjustmentAlgorithm(algorithm); - } - } - finally { - lock.unlock(); - } - } - - private static float getPitchStepsAdjustment(float pitch) { - return (float) (Math.log(pitch) / (2 * Math.log(PITCH_STEP_CONSTANT))); - } - - /** - * Sets the percentage by which pitch is currently shifted. When greater - * than zero, pitch is shifted up. When less than zero, pitch is shifted - * down - * - * @param f - * The percentage to shift pitch - */ - public void setPlaybackPitch(float pitch) { - lock.lock(); - try { - this.mPitchStepsAdjustment = getPitchStepsAdjustment(pitch); - this.mpi.setPlaybackPitch(pitch); - } finally { - lock.unlock(); - } - } - - /** - * Set playback speed. 1.0 is normal speed, 2.0 is double speed, and so on. - * Speed should never be set to 0 or below. - * - * @param f - * The speed multiplier to use for further playback - */ - public void setPlaybackSpeed(float f) { - lock.lock(); - try { - this.mSpeedMultiplier = f; - this.mpi.setPlaybackSpeed(f); - } finally { - lock.unlock(); - } - } - - /** - * Sets whether to use speed adjustment or not. Speed adjustment on is more - * computation-intensive than with it off. - * - * @param enableSpeedAdjustment - * Whether speed adjustment should be supported. - */ - public void setUseService(boolean useService) { - lock.lock(); - try { - this.useService = useService; - setupMpi(this.mpi.mContext); - } finally { - lock.unlock(); - } - } - - /** - * Functions identically to android.media.MediaPlayer.setVolume(float - * leftVolume, float rightVolume) Sets the stereo volume - */ - public void setVolume(float leftVolume, float rightVolume) { - lock.lock(); - try { - this.mLeftVolume = leftVolume; - this.mRightVolume = rightVolume; - this.mpi.setVolume(leftVolume, rightVolume); - } finally { - lock.unlock(); - } - } - - /** - * Functions identically to android.media.MediaPlayer.setWakeMode(Context - * context, int mode) Acquires a wake lock in the context given. You must - * request the appropriate permissions in your AndroidManifest.xml file. - */ - public void setWakeMode(Context context, int mode) { - lock.lock(); - try { - this.mWakeMode = mode; - this.mpi.setWakeMode(context, mode); - } finally { - lock.unlock(); - } - } - - /** - * Functions identically to - * android.media.MediaPlayer.setOnCompletionListener(OnCompletionListener - * listener) Sets a listener to be used when a track completes playing. - */ - public void setOnBufferingUpdateListener(OnBufferingUpdateListener listener) { - lock.lock(); - try { - this.onBufferingUpdateListener = listener; - } finally { - lock.unlock(); - } - } - - /** - * Functions identically to - * android.media.MediaPlayer.setOnCompletionListener(OnCompletionListener - * listener) Sets a listener to be used when a track completes playing. - */ - public void setOnCompletionListener(OnCompletionListener listener) { - lock.lock(); - try { - this.onCompletionListener = listener; - } finally { - lock.unlock(); - } - } - - /** - * Functions identically to - * android.media.MediaPlayer.setOnErrorListener(OnErrorListener listener) - * Sets a listener to be used when a track encounters an error. - */ - public void setOnErrorListener(OnErrorListener listener) { - lock.lock(); - try { - this.onErrorListener = listener; - } finally { - lock.unlock(); - } - } - - /** - * Functions identically to - * android.media.MediaPlayer.setOnInfoListener(OnInfoListener listener) Sets - * a listener to be used when a track has info. - */ - public void setOnInfoListener(OnInfoListener listener) { - lock.lock(); - try { - this.onInfoListener = listener; - } finally { - lock.unlock(); - } - } - - /** - * Sets a listener that will fire when pitch adjustment becomes available or - * stops being available - */ - public void setOnPitchAdjustmentAvailableChangedListener( - OnPitchAdjustmentAvailableChangedListener listener) { - lock.lock(); - try { - this.pitchAdjustmentAvailableChangedListener = listener; - } finally { - lock.unlock(); - } - } - - /** - * Functions identically to - * android.media.MediaPlayer.setOnPreparedListener(OnPreparedListener - * listener) Sets a listener to be used when a track finishes preparing. - */ - public void setOnPreparedListener(OnPreparedListener listener) { - lock.lock(); - Log.d(MP_TAG, " ++++++++++++++++++++++++++++++++++++++++++++ setOnPreparedListener"); - try { - this.preparedListener = listener; - // For this one, we do not explicitly set the MediaPlayer or the - // Service listener. This is because in addition to calling the - // listener provided by the client, it's necessary to change - // state to PREPARED. See prepareAsync for implementation details - } finally { - lock.unlock(); - } - } - - /** - * Functions identically to - * android.media.MediaPlayer.setOnSeekCompleteListener - * (OnSeekCompleteListener listener) Sets a listener to be used when a track - * finishes seeking. - */ - public void setOnSeekCompleteListener(OnSeekCompleteListener listener) { - lock.lock(); - try { - this.onSeekCompleteListener = listener; - } finally { - lock.unlock(); - } - } - - /** - * Sets a listener that will fire when speed adjustment becomes available or - * stops being available - */ - public void setOnSpeedAdjustmentAvailableChangedListener( - OnSpeedAdjustmentAvailableChangedListener listener) { - lock.lock(); - try { - this.speedAdjustmentAvailableChangedListener = listener; - } finally { - lock.unlock(); - } - } - - /** - * Functions identically to android.media.MediaPlayer.start() Starts a track - * playing - */ - public void start() { - lock.lock(); - try { - Log.d(MP_TAG, "start() 1149"); - if (invalidServiceConnectionConfiguration()) { - setupMpi(this.mpi.mContext); - } - this.state = State.STARTED; - Log.d(MP_TAG, "start() 1154"); - this.mpi.start(); - } finally { - lock.unlock(); - } - } - - /** - * Functions identically to android.media.MediaPlayer.stop() Stops a track - * playing and resets its position to the start. - */ - public void stop() { - lock.lock(); - try { - if (invalidServiceConnectionConfiguration()) { - setupMpi(this.mpi.mContext); - } - this.state = State.STOPPED; - this.mpi.stop(); - } finally { - lock.unlock(); - } - } -} \ No newline at end of file diff --git a/app/src/main/java/de/danoeh/antennapod/PodcastApp.java b/app/src/main/java/de/danoeh/antennapod/PodcastApp.java index 25aa9fb68..12213d6f9 100644 --- a/app/src/main/java/de/danoeh/antennapod/PodcastApp.java +++ b/app/src/main/java/de/danoeh/antennapod/PodcastApp.java @@ -12,7 +12,6 @@ import de.danoeh.antennapod.spa.SPAUtil; public class PodcastApp extends Application { private static final String TAG = "PodcastApp"; - public static final String EXPORT_DIR = "export/"; private static float LOGICAL_DENSITY; diff --git a/app/src/main/java/de/danoeh/antennapod/activity/AudioplayerActivity.java b/app/src/main/java/de/danoeh/antennapod/activity/AudioplayerActivity.java index 5622bc987..f9001adad 100644 --- a/app/src/main/java/de/danoeh/antennapod/activity/AudioplayerActivity.java +++ b/app/src/main/java/de/danoeh/antennapod/activity/AudioplayerActivity.java @@ -43,8 +43,8 @@ import de.danoeh.antennapod.fragment.ItemDescriptionFragment; import de.danoeh.antennapod.core.preferences.UserPreferences; import de.danoeh.antennapod.core.service.playback.PlaybackService; import de.danoeh.antennapod.core.storage.DBReader; -import de.danoeh.antennapod.core.util.menuhandler.MenuItemUtils; -import de.danoeh.antennapod.core.util.menuhandler.NavDrawerActivity; +import de.danoeh.antennapod.menuhandler.MenuItemUtils; +import de.danoeh.antennapod.menuhandler.NavDrawerActivity; import de.danoeh.antennapod.core.util.playback.ExternalMedia; import de.danoeh.antennapod.core.util.playback.Playable; import de.danoeh.antennapod.core.util.playback.PlaybackController; diff --git a/app/src/main/java/de/danoeh/antennapod/activity/FeedInfoActivity.java b/app/src/main/java/de/danoeh/antennapod/activity/FeedInfoActivity.java index 80484df37..3000cfaeb 100644 --- a/app/src/main/java/de/danoeh/antennapod/activity/FeedInfoActivity.java +++ b/app/src/main/java/de/danoeh/antennapod/activity/FeedInfoActivity.java @@ -21,7 +21,7 @@ import de.danoeh.antennapod.core.storage.DBReader; import de.danoeh.antennapod.core.storage.DBWriter; import de.danoeh.antennapod.core.storage.DownloadRequestException; import de.danoeh.antennapod.core.util.LangUtils; -import de.danoeh.antennapod.core.util.menuhandler.FeedMenuHandler; +import de.danoeh.antennapod.menuhandler.FeedMenuHandler; /** * Displays information about a feed. diff --git a/app/src/main/java/de/danoeh/antennapod/activity/MainActivity.java b/app/src/main/java/de/danoeh/antennapod/activity/MainActivity.java index 2c660019c..7029fd32c 100644 --- a/app/src/main/java/de/danoeh/antennapod/activity/MainActivity.java +++ b/app/src/main/java/de/danoeh/antennapod/activity/MainActivity.java @@ -31,7 +31,7 @@ import de.danoeh.antennapod.fragment.*; import de.danoeh.antennapod.core.preferences.UserPreferences; import de.danoeh.antennapod.core.storage.DBReader; import de.danoeh.antennapod.core.util.StorageUtils; -import de.danoeh.antennapod.core.util.menuhandler.NavDrawerActivity; +import de.danoeh.antennapod.menuhandler.NavDrawerActivity; import java.util.List; diff --git a/app/src/main/java/de/danoeh/antennapod/activity/MediaplayerActivity.java b/app/src/main/java/de/danoeh/antennapod/activity/MediaplayerActivity.java index 249a3c5c3..14cb2727f 100644 --- a/app/src/main/java/de/danoeh/antennapod/activity/MediaplayerActivity.java +++ b/app/src/main/java/de/danoeh/antennapod/activity/MediaplayerActivity.java @@ -22,7 +22,7 @@ import com.doomonafireball.betterpickers.hmspicker.HmsPickerBuilder; import com.doomonafireball.betterpickers.hmspicker.HmsPickerDialogFragment; import de.danoeh.antennapod.BuildConfig; import de.danoeh.antennapod.R; -import de.danoeh.antennapod.core.dialog.TimeDialog; +import de.danoeh.antennapod.dialog.TimeDialog; import de.danoeh.antennapod.core.feed.FeedItem; import de.danoeh.antennapod.core.feed.FeedMedia; import de.danoeh.antennapod.core.preferences.UserPreferences; diff --git a/app/src/main/java/de/danoeh/antennapod/activity/OpmlImportBaseActivity.java b/app/src/main/java/de/danoeh/antennapod/activity/OpmlImportBaseActivity.java index 2e66978fd..d974e0e1b 100644 --- a/app/src/main/java/de/danoeh/antennapod/activity/OpmlImportBaseActivity.java +++ b/app/src/main/java/de/danoeh/antennapod/activity/OpmlImportBaseActivity.java @@ -4,8 +4,8 @@ import android.content.Intent; import android.support.v7.app.ActionBarActivity; import android.util.Log; import de.danoeh.antennapod.BuildConfig; -import de.danoeh.antennapod.core.asynctask.OpmlFeedQueuer; -import de.danoeh.antennapod.core.asynctask.OpmlImportWorker; +import de.danoeh.antennapod.asynctask.OpmlFeedQueuer; +import de.danoeh.antennapod.asynctask.OpmlImportWorker; import de.danoeh.antennapod.core.opml.OpmlElement; import java.io.Reader; diff --git a/app/src/main/java/de/danoeh/antennapod/activity/PreferenceActivity.java b/app/src/main/java/de/danoeh/antennapod/activity/PreferenceActivity.java index 65efcc230..484550a6a 100644 --- a/app/src/main/java/de/danoeh/antennapod/activity/PreferenceActivity.java +++ b/app/src/main/java/de/danoeh/antennapod/activity/PreferenceActivity.java @@ -22,7 +22,7 @@ import android.widget.Toast; import de.danoeh.antennapod.BuildConfig; import de.danoeh.antennapod.R; import de.danoeh.antennapod.core.asynctask.FlattrClickWorker; -import de.danoeh.antennapod.core.asynctask.OpmlExportWorker; +import de.danoeh.antennapod.asynctask.OpmlExportWorker; import de.danoeh.antennapod.dialog.AuthenticationDialog; import de.danoeh.antennapod.dialog.AutoFlattrPreferenceDialog; import de.danoeh.antennapod.dialog.GpodnetSetHostnameDialog; diff --git a/app/src/main/java/de/danoeh/antennapod/asynctask/OpmlExportWorker.java b/app/src/main/java/de/danoeh/antennapod/asynctask/OpmlExportWorker.java new file mode 100644 index 000000000..6bba956a6 --- /dev/null +++ b/app/src/main/java/de/danoeh/antennapod/asynctask/OpmlExportWorker.java @@ -0,0 +1,118 @@ +package de.danoeh.antennapod.asynctask; + +import android.annotation.SuppressLint; +import android.app.AlertDialog; +import android.app.ProgressDialog; +import android.content.Context; +import android.content.DialogInterface; +import android.os.AsyncTask; +import android.util.Log; + +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.OutputStreamWriter; + +import de.danoeh.antennapod.core.R; +import de.danoeh.antennapod.core.opml.OpmlWriter; +import de.danoeh.antennapod.core.preferences.UserPreferences; +import de.danoeh.antennapod.core.storage.DBReader; +import de.danoeh.antennapod.core.util.LangUtils; + +/** + * Writes an OPML file into the export directory in the background. + */ +public class OpmlExportWorker extends AsyncTask { + private static final String TAG = "OpmlExportWorker"; + private static final String DEFAULT_OUTPUT_NAME = "antennapod-feeds.opml"; + public static final String EXPORT_DIR = "export/"; + + private Context context; + private File output; + + private ProgressDialog progDialog; + private Exception exception; + + public OpmlExportWorker(Context context, File output) { + this.context = context; + this.output = output; + } + + public OpmlExportWorker(Context context) { + this.context = context; + } + + @Override + protected Void doInBackground(Void... params) { + OpmlWriter opmlWriter = new OpmlWriter(); + if (output == null) { + output = new File( + UserPreferences.getDataFolder(context, EXPORT_DIR), + DEFAULT_OUTPUT_NAME); + if (output.exists()) { + Log.w(TAG, "Overwriting previously exported file."); + output.delete(); + } + } + OutputStreamWriter writer = null; + try { + writer = new OutputStreamWriter(new FileOutputStream(output), LangUtils.UTF_8); + opmlWriter.writeDocument(DBReader.getFeedList(context), writer); + } catch (IOException e) { + e.printStackTrace(); + exception = e; + } finally { + if (writer != null) { + try { + writer.close(); + } catch (IOException ioe) { + exception = ioe; + } + } + } + return null; + } + + @Override + protected void onPostExecute(Void result) { + progDialog.dismiss(); + AlertDialog.Builder alert = new AlertDialog.Builder(context) + .setNeutralButton(android.R.string.ok, + new DialogInterface.OnClickListener() { + + @Override + public void onClick(DialogInterface dialog, + int which) { + dialog.dismiss(); + } + }); + if (exception != null) { + alert.setTitle(R.string.export_error_label); + alert.setMessage(exception.getMessage()); + } else { + alert.setTitle(R.string.opml_export_success_title); + alert.setMessage(context + .getString(R.string.opml_export_success_sum) + + output.toString()); + } + alert.create().show(); + } + + @Override + protected void onPreExecute() { + progDialog = new ProgressDialog(context); + progDialog.setMessage(context.getString(R.string.exporting_label)); + progDialog.setIndeterminate(true); + progDialog.show(); + } + + @SuppressLint("NewApi") + public void executeAsync() { + if (android.os.Build.VERSION.SDK_INT > android.os.Build.VERSION_CODES.GINGERBREAD_MR1) { + executeOnExecutor(THREAD_POOL_EXECUTOR); + } else { + execute(); + } + } + +} diff --git a/app/src/main/java/de/danoeh/antennapod/core/asynctask/OpmlFeedQueuer.java b/app/src/main/java/de/danoeh/antennapod/asynctask/OpmlFeedQueuer.java similarity index 96% rename from app/src/main/java/de/danoeh/antennapod/core/asynctask/OpmlFeedQueuer.java rename to app/src/main/java/de/danoeh/antennapod/asynctask/OpmlFeedQueuer.java index 13144faa9..cb9197b8e 100644 --- a/app/src/main/java/de/danoeh/antennapod/core/asynctask/OpmlFeedQueuer.java +++ b/app/src/main/java/de/danoeh/antennapod/asynctask/OpmlFeedQueuer.java @@ -1,10 +1,10 @@ -package de.danoeh.antennapod.core.asynctask; +package de.danoeh.antennapod.asynctask; import android.annotation.SuppressLint; import android.app.ProgressDialog; import android.content.Context; import android.os.AsyncTask; -import de.danoeh.antennapod.R; +import de.danoeh.antennapod.core.R; import de.danoeh.antennapod.activity.OpmlImportHolder; import de.danoeh.antennapod.core.feed.Feed; import de.danoeh.antennapod.core.opml.OpmlElement; diff --git a/app/src/main/java/de/danoeh/antennapod/core/asynctask/OpmlImportWorker.java b/app/src/main/java/de/danoeh/antennapod/asynctask/OpmlImportWorker.java similarity index 95% rename from app/src/main/java/de/danoeh/antennapod/core/asynctask/OpmlImportWorker.java rename to app/src/main/java/de/danoeh/antennapod/asynctask/OpmlImportWorker.java index a4308be9b..cfe0703ca 100644 --- a/app/src/main/java/de/danoeh/antennapod/core/asynctask/OpmlImportWorker.java +++ b/app/src/main/java/de/danoeh/antennapod/asynctask/OpmlImportWorker.java @@ -1,4 +1,4 @@ -package de.danoeh.antennapod.core.asynctask; +package de.danoeh.antennapod.asynctask; import android.annotation.SuppressLint; import android.app.AlertDialog; @@ -8,8 +8,8 @@ import android.content.DialogInterface; import android.content.DialogInterface.OnClickListener; import android.os.AsyncTask; import android.util.Log; -import de.danoeh.antennapod.BuildConfig; -import de.danoeh.antennapod.R; +import de.danoeh.antennapod.core.BuildConfig; +import de.danoeh.antennapod.core.R; import de.danoeh.antennapod.core.opml.OpmlElement; import de.danoeh.antennapod.core.opml.OpmlReader; import org.xmlpull.v1.XmlPullParserException; diff --git a/app/src/main/java/de/danoeh/antennapod/config/ApplicationCallbacksImpl.java b/app/src/main/java/de/danoeh/antennapod/config/ApplicationCallbacksImpl.java new file mode 100644 index 000000000..fdbb2139d --- /dev/null +++ b/app/src/main/java/de/danoeh/antennapod/config/ApplicationCallbacksImpl.java @@ -0,0 +1,23 @@ +package de.danoeh.antennapod.config; + + +import android.app.Application; +import android.content.Context; +import android.content.Intent; + +import de.danoeh.antennapod.PodcastApp; +import de.danoeh.antennapod.activity.StorageErrorActivity; +import de.danoeh.antennapod.core.ApplicationCallbacks; + +public class ApplicationCallbacksImpl implements ApplicationCallbacks { + + @Override + public Application getApplicationInstance() { + return PodcastApp.getInstance(); + } + + @Override + public Intent getStorageErrorActivity(Context context) { + return new Intent(context, StorageErrorActivity.class); + } +} diff --git a/app/src/main/java/de/danoeh/antennapod/config/ClientConfigurator.java b/app/src/main/java/de/danoeh/antennapod/config/ClientConfigurator.java new file mode 100644 index 000000000..5dc3416c6 --- /dev/null +++ b/app/src/main/java/de/danoeh/antennapod/config/ClientConfigurator.java @@ -0,0 +1,19 @@ +package de.danoeh.antennapod.config; + +import de.danoeh.antennapod.core.ClientConfig; + +/** + * Configures the ClientConfig class of the core package. + */ +public class ClientConfigurator { + + static { + ClientConfig.USER_AGENT = "AntennaPod/0.9.9.3"; + ClientConfig.applicationCallbacks = new ApplicationCallbacksImpl(); + ClientConfig.downloadServiceCallbacks = new DownloadServiceCallbacksImpl(); + ClientConfig.gpodnetCallbacks = new GpodnetCallbacksImpl(); + ClientConfig.playbackServiceCallbacks = new PlaybackServiceCallbacksImpl(); + ClientConfig.storageCallbacks = new StorageCallbacksImpl(); + ClientConfig.flattrCallbacks = new FlattrCallbacksImpl(); + } +} diff --git a/app/src/main/java/de/danoeh/antennapod/config/DownloadServiceCallbacksImpl.java b/app/src/main/java/de/danoeh/antennapod/config/DownloadServiceCallbacksImpl.java new file mode 100644 index 000000000..0f180e9c5 --- /dev/null +++ b/app/src/main/java/de/danoeh/antennapod/config/DownloadServiceCallbacksImpl.java @@ -0,0 +1,49 @@ +package de.danoeh.antennapod.config; + +import android.app.PendingIntent; +import android.content.Context; +import android.content.Intent; +import android.os.Bundle; + +import de.danoeh.antennapod.activity.DownloadAuthenticationActivity; +import de.danoeh.antennapod.activity.MainActivity; +import de.danoeh.antennapod.adapter.NavListAdapter; +import de.danoeh.antennapod.core.DownloadServiceCallbacks; +import de.danoeh.antennapod.core.service.download.DownloadRequest; +import de.danoeh.antennapod.fragment.DownloadsFragment; + + +public class DownloadServiceCallbacksImpl implements DownloadServiceCallbacks { + + @Override + public PendingIntent getNotificationContentIntent(Context context) { + Intent intent = new Intent(context, MainActivity.class); + intent.putExtra(MainActivity.EXTRA_NAV_TYPE, NavListAdapter.VIEW_TYPE_NAV); + intent.putExtra(MainActivity.EXTRA_NAV_INDEX, MainActivity.POS_DOWNLOADS); + Bundle args = new Bundle(); + args.putInt(DownloadsFragment.ARG_SELECTED_TAB, DownloadsFragment.POS_RUNNING); + intent.putExtra(MainActivity.EXTRA_FRAGMENT_ARGS, args); + + return PendingIntent.getActivity(context, 0, intent, + PendingIntent.FLAG_UPDATE_CURRENT); + } + + @Override + public PendingIntent getAuthentificationNotificationContentIntent(Context context, DownloadRequest request) { + final Intent activityIntent = new Intent(context.getApplicationContext(), DownloadAuthenticationActivity.class); + activityIntent.putExtra(DownloadAuthenticationActivity.ARG_DOWNLOAD_REQUEST, request); + activityIntent.putExtra(DownloadAuthenticationActivity.ARG_SEND_TO_DOWNLOAD_REQUESTER_BOOL, true); + return PendingIntent.getActivity(context.getApplicationContext(), 0, activityIntent, PendingIntent.FLAG_ONE_SHOT); + } + + @Override + public PendingIntent getReportNotificationContentIntent(Context context) { + Intent intent = new Intent(context, MainActivity.class); + intent.putExtra(MainActivity.EXTRA_NAV_TYPE, NavListAdapter.VIEW_TYPE_NAV); + intent.putExtra(MainActivity.EXTRA_NAV_INDEX, MainActivity.POS_DOWNLOADS); + Bundle args = new Bundle(); + args.putInt(DownloadsFragment.ARG_SELECTED_TAB, DownloadsFragment.POS_LOG); + intent.putExtra(MainActivity.EXTRA_FRAGMENT_ARGS, args); + return PendingIntent.getActivity(context, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT); + } +} diff --git a/app/src/main/java/de/danoeh/antennapod/config/FlattrCallbacksImpl.java b/app/src/main/java/de/danoeh/antennapod/config/FlattrCallbacksImpl.java new file mode 100644 index 000000000..3817db6de --- /dev/null +++ b/app/src/main/java/de/danoeh/antennapod/config/FlattrCallbacksImpl.java @@ -0,0 +1,53 @@ +package de.danoeh.antennapod.config; + + +import android.app.PendingIntent; +import android.content.Context; +import android.content.Intent; +import android.util.Log; + +import org.shredzone.flattr4j.oauth.AccessToken; + +import de.danoeh.antennapod.BuildConfig; +import de.danoeh.antennapod.activity.FlattrAuthActivity; +import de.danoeh.antennapod.activity.MainActivity; +import de.danoeh.antennapod.core.FlattrCallbacks; + +public class FlattrCallbacksImpl implements FlattrCallbacks { + private static final String TAG = "FlattrCallbacksImpl"; + + @Override + public boolean flattrEnabled() { + return true; + } + + @Override + public Intent getFlattrAuthenticationActivityIntent(Context context) { + return new Intent(context, FlattrAuthActivity.class); + } + + @Override + public PendingIntent getFlattrFailedNotificationContentIntent(Context context) { + return PendingIntent.getActivity(context, 0, new Intent(context, MainActivity.class), 0); + } + + @Override + public String getFlattrAppKey() { + return BuildConfig.FLATTR_APP_KEY; + } + + @Override + public String getFlattrAppSecret() { + return BuildConfig.FLATTR_APP_SECRET; + } + + @Override + public void handleFlattrAuthenticationSuccess(AccessToken token) { + FlattrAuthActivity instance = FlattrAuthActivity.getInstance(); + if (instance != null) { + instance.handleAuthenticationSuccess(); + } else { + Log.e(TAG, "FlattrAuthActivity instance was null"); + } + } +} diff --git a/app/src/main/java/de/danoeh/antennapod/config/GpodnetCallbacksImpl.java b/app/src/main/java/de/danoeh/antennapod/config/GpodnetCallbacksImpl.java new file mode 100644 index 000000000..5f8da6894 --- /dev/null +++ b/app/src/main/java/de/danoeh/antennapod/config/GpodnetCallbacksImpl.java @@ -0,0 +1,22 @@ +package de.danoeh.antennapod.config; + +import android.app.PendingIntent; +import android.content.Context; +import android.content.Intent; + +import de.danoeh.antennapod.activity.MainActivity; +import de.danoeh.antennapod.core.GpodnetCallbacks; + + +public class GpodnetCallbacksImpl implements GpodnetCallbacks { + @Override + public boolean gpodnetEnabled() { + return true; + } + + @Override + public PendingIntent getGpodnetSyncServiceErrorNotificationPendingIntent(Context context) { + return PendingIntent.getActivity(context, 0, new Intent(context, MainActivity.class), + PendingIntent.FLAG_UPDATE_CURRENT); + } +} diff --git a/app/src/main/java/de/danoeh/antennapod/config/PlaybackServiceCallbacksImpl.java b/app/src/main/java/de/danoeh/antennapod/config/PlaybackServiceCallbacksImpl.java new file mode 100644 index 000000000..d1e3a8379 --- /dev/null +++ b/app/src/main/java/de/danoeh/antennapod/config/PlaybackServiceCallbacksImpl.java @@ -0,0 +1,21 @@ +package de.danoeh.antennapod.config; + +import android.content.Context; +import android.content.Intent; + +import de.danoeh.antennapod.activity.AudioplayerActivity; +import de.danoeh.antennapod.activity.VideoplayerActivity; +import de.danoeh.antennapod.core.PlaybackServiceCallbacks; +import de.danoeh.antennapod.core.feed.MediaType; + + +public class PlaybackServiceCallbacksImpl implements PlaybackServiceCallbacks { + @Override + public Intent getPlayerActivityIntent(Context context, MediaType mediaType) { + if (mediaType == MediaType.VIDEO) { + return new Intent(context, VideoplayerActivity.class); + } else { + return new Intent(context, AudioplayerActivity.class); + } + } +} diff --git a/app/src/main/java/de/danoeh/antennapod/config/StorageCallbacksImpl.java b/app/src/main/java/de/danoeh/antennapod/config/StorageCallbacksImpl.java new file mode 100644 index 000000000..ec133aed1 --- /dev/null +++ b/app/src/main/java/de/danoeh/antennapod/config/StorageCallbacksImpl.java @@ -0,0 +1,107 @@ +package de.danoeh.antennapod.config; + + +import android.content.ContentValues; +import android.database.Cursor; +import android.database.sqlite.SQLiteDatabase; +import android.util.Log; + +import de.danoeh.antennapod.core.StorageCallbacks; +import de.danoeh.antennapod.core.storage.PodDBAdapter; + +public class StorageCallbacksImpl implements StorageCallbacks { + + @Override + public int getDatabaseVersion() { + return 12; + } + + @Override + public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) { + Log.w("DBAdapter", "Upgrading from version " + oldVersion + " to " + + newVersion + "."); + if (oldVersion <= 1) { + db.execSQL("ALTER TABLE " + PodDBAdapter.TABLE_NAME_FEEDS + " ADD COLUMN " + + PodDBAdapter.KEY_TYPE + " TEXT"); + } + if (oldVersion <= 2) { + db.execSQL("ALTER TABLE " + PodDBAdapter.TABLE_NAME_SIMPLECHAPTERS + + " ADD COLUMN " + PodDBAdapter.KEY_LINK + " TEXT"); + } + if (oldVersion <= 3) { + db.execSQL("ALTER TABLE " + PodDBAdapter.TABLE_NAME_FEED_ITEMS + + " ADD COLUMN " + PodDBAdapter.KEY_ITEM_IDENTIFIER + " TEXT"); + } + if (oldVersion <= 4) { + db.execSQL("ALTER TABLE " + PodDBAdapter.TABLE_NAME_FEEDS + " ADD COLUMN " + + PodDBAdapter.KEY_FEED_IDENTIFIER + " TEXT"); + } + if (oldVersion <= 5) { + db.execSQL("ALTER TABLE " + PodDBAdapter.TABLE_NAME_DOWNLOAD_LOG + + " ADD COLUMN " + PodDBAdapter.KEY_REASON_DETAILED + " TEXT"); + db.execSQL("ALTER TABLE " + PodDBAdapter.TABLE_NAME_DOWNLOAD_LOG + + " ADD COLUMN " + PodDBAdapter.KEY_DOWNLOADSTATUS_TITLE + " TEXT"); + } + if (oldVersion <= 6) { + db.execSQL("ALTER TABLE " + PodDBAdapter.TABLE_NAME_SIMPLECHAPTERS + + " ADD COLUMN " + PodDBAdapter.KEY_CHAPTER_TYPE + " INTEGER"); + } + if (oldVersion <= 7) { + db.execSQL("ALTER TABLE " + PodDBAdapter.TABLE_NAME_FEED_MEDIA + + " ADD COLUMN " + PodDBAdapter.KEY_PLAYBACK_COMPLETION_DATE + + " INTEGER"); + } + if (oldVersion <= 8) { + final int KEY_ID_POSITION = 0; + final int KEY_MEDIA_POSITION = 1; + + // Add feeditem column to feedmedia table + db.execSQL("ALTER TABLE " + PodDBAdapter.TABLE_NAME_FEED_MEDIA + + " ADD COLUMN " + PodDBAdapter.KEY_FEEDITEM + + " INTEGER"); + Cursor feeditemCursor = db.query(PodDBAdapter.TABLE_NAME_FEED_ITEMS, + new String[]{PodDBAdapter.KEY_ID, PodDBAdapter.KEY_MEDIA}, "? > 0", + new String[]{PodDBAdapter.KEY_MEDIA}, null, null, null); + if (feeditemCursor.moveToFirst()) { + db.beginTransaction(); + ContentValues contentValues = new ContentValues(); + do { + long mediaId = feeditemCursor.getLong(KEY_MEDIA_POSITION); + contentValues.put(PodDBAdapter.KEY_FEEDITEM, feeditemCursor.getLong(KEY_ID_POSITION)); + db.update(PodDBAdapter.TABLE_NAME_FEED_MEDIA, contentValues, PodDBAdapter.KEY_ID + "=?", new String[]{String.valueOf(mediaId)}); + contentValues.clear(); + } while (feeditemCursor.moveToNext()); + db.setTransactionSuccessful(); + db.endTransaction(); + } + feeditemCursor.close(); + } + if (oldVersion <= 9) { + db.execSQL("ALTER TABLE " + PodDBAdapter.TABLE_NAME_FEEDS + + " ADD COLUMN " + PodDBAdapter.KEY_AUTO_DOWNLOAD + + " INTEGER DEFAULT 1"); + } + if (oldVersion <= 10) { + db.execSQL("ALTER TABLE " + PodDBAdapter.TABLE_NAME_FEEDS + + " ADD COLUMN " + PodDBAdapter.KEY_FLATTR_STATUS + + " INTEGER"); + db.execSQL("ALTER TABLE " + PodDBAdapter.TABLE_NAME_FEED_ITEMS + + " ADD COLUMN " + PodDBAdapter.KEY_FLATTR_STATUS + + " INTEGER"); + db.execSQL("ALTER TABLE " + PodDBAdapter.TABLE_NAME_FEED_MEDIA + + " ADD COLUMN " + PodDBAdapter.KEY_PLAYED_DURATION + + " INTEGER"); + } + if (oldVersion <= 11) { + db.execSQL("ALTER TABLE " + PodDBAdapter.TABLE_NAME_FEEDS + + " ADD COLUMN " + PodDBAdapter.KEY_USERNAME + + " TEXT"); + db.execSQL("ALTER TABLE " + PodDBAdapter.TABLE_NAME_FEEDS + + " ADD COLUMN " + PodDBAdapter.KEY_PASSWORD + + " TEXT"); + db.execSQL("ALTER TABLE " + PodDBAdapter.TABLE_NAME_FEED_ITEMS + + " ADD COLUMN " + PodDBAdapter.KEY_IMAGE + + " INTEGER"); + } + } +} diff --git a/app/src/main/java/de/danoeh/antennapod/core/asynctask/FlattrTokenFetcher.java b/app/src/main/java/de/danoeh/antennapod/core/asynctask/FlattrTokenFetcher.java deleted file mode 100644 index 6f8319c7d..000000000 --- a/app/src/main/java/de/danoeh/antennapod/core/asynctask/FlattrTokenFetcher.java +++ /dev/null @@ -1,95 +0,0 @@ -package de.danoeh.antennapod.core.asynctask; - - -import android.annotation.SuppressLint; -import android.app.ProgressDialog; -import android.content.Context; -import android.net.Uri; -import android.os.AsyncTask; -import android.util.Log; -import de.danoeh.antennapod.BuildConfig; -import de.danoeh.antennapod.R; -import de.danoeh.antennapod.activity.FlattrAuthActivity; -import de.danoeh.antennapod.core.util.flattr.FlattrUtils; -import org.shredzone.flattr4j.exception.FlattrException; -import org.shredzone.flattr4j.oauth.AccessToken; -import org.shredzone.flattr4j.oauth.AndroidAuthenticator; - -/** Fetches the access token in the background in order to avoid networkOnMainThread exception. */ - -public class FlattrTokenFetcher extends AsyncTask { - private static final String TAG = "FlattrTokenFetcher"; - Context context; - AndroidAuthenticator auth; - AccessToken token; - Uri uri; - ProgressDialog dialog; - FlattrException exception; - - public FlattrTokenFetcher(Context context, AndroidAuthenticator auth, Uri uri) { - super(); - this.context = context; - this.auth = auth; - this.uri = uri; - } - - @Override - protected void onPostExecute(AccessToken result) { - if (result != null) { - FlattrUtils.storeToken(result); - } - dialog.dismiss(); - if (exception == null) { - FlattrAuthActivity instance = FlattrAuthActivity.getInstance(); - if (instance != null) { - instance.handleAuthenticationSuccess(); - } else { - Log.e(TAG, "FlattrAuthActivity instance was null"); - } - } else { - FlattrUtils.showErrorDialog(context, exception.getMessage()); - } - } - - - - @Override - protected void onPreExecute() { - super.onPreExecute(); - dialog = new ProgressDialog(context); - dialog.setMessage(context.getString(R.string.processing_label)); - dialog.setIndeterminate(true); - dialog.setCancelable(false); - dialog.show(); - } - - - - @Override - protected AccessToken doInBackground(Void... params) { - try { - token = auth.fetchAccessToken(uri); - } catch (FlattrException e) { - e.printStackTrace(); - exception = e; - return null; - } - if (token != null) { - if (BuildConfig.DEBUG) Log.d(TAG, "Successfully got token"); - return token; - } else { - Log.w(TAG, "Flattr token was null"); - return null; - } - } - - @SuppressLint("NewApi") - public void executeAsync() { - if (android.os.Build.VERSION.SDK_INT > android.os.Build.VERSION_CODES.GINGERBREAD_MR1) { - executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR); - } else { - execute(); - } - } - -} diff --git a/app/src/main/java/de/danoeh/antennapod/core/asynctask/OpmlExportWorker.java b/app/src/main/java/de/danoeh/antennapod/core/asynctask/OpmlExportWorker.java deleted file mode 100644 index 9f887bda6..000000000 --- a/app/src/main/java/de/danoeh/antennapod/core/asynctask/OpmlExportWorker.java +++ /dev/null @@ -1,114 +0,0 @@ -package de.danoeh.antennapod.core.asynctask; - -import android.annotation.SuppressLint; -import android.app.AlertDialog; -import android.app.ProgressDialog; -import android.content.Context; -import android.content.DialogInterface; -import android.os.AsyncTask; -import android.util.Log; -import de.danoeh.antennapod.PodcastApp; -import de.danoeh.antennapod.R; -import de.danoeh.antennapod.core.opml.OpmlWriter; -import de.danoeh.antennapod.core.preferences.UserPreferences; -import de.danoeh.antennapod.core.storage.DBReader; -import de.danoeh.antennapod.core.util.LangUtils; - -import java.io.File; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.OutputStreamWriter; - -/** Writes an OPML file into the export directory in the background. */ -public class OpmlExportWorker extends AsyncTask { - private static final String TAG = "OpmlExportWorker"; - private static final String DEFAULT_OUTPUT_NAME = "antennapod-feeds.opml"; - private Context context; - private File output; - - private ProgressDialog progDialog; - private Exception exception; - - public OpmlExportWorker(Context context, File output) { - this.context = context; - this.output = output; - } - - public OpmlExportWorker(Context context) { - this.context = context; - } - - @Override - protected Void doInBackground(Void... params) { - OpmlWriter opmlWriter = new OpmlWriter(); - if (output == null) { - output = new File( - UserPreferences.getDataFolder(context, PodcastApp.EXPORT_DIR), - DEFAULT_OUTPUT_NAME); - if (output.exists()) { - Log.w(TAG, "Overwriting previously exported file."); - output.delete(); - } - } - OutputStreamWriter writer = null; - try { - writer = new OutputStreamWriter(new FileOutputStream(output), LangUtils.UTF_8); - opmlWriter.writeDocument(DBReader.getFeedList(context), writer); - } catch (IOException e) { - e.printStackTrace(); - exception = e; - } finally { - if (writer != null) { - try { - writer.close(); - } catch (IOException ioe) { - exception = ioe; - } - } - } - return null; - } - - @Override - protected void onPostExecute(Void result) { - progDialog.dismiss(); - AlertDialog.Builder alert = new AlertDialog.Builder(context) - .setNeutralButton(android.R.string.ok, - new DialogInterface.OnClickListener() { - - @Override - public void onClick(DialogInterface dialog, - int which) { - dialog.dismiss(); - } - }); - if (exception != null) { - alert.setTitle(R.string.export_error_label); - alert.setMessage(exception.getMessage()); - } else { - alert.setTitle(R.string.opml_export_success_title); - alert.setMessage(context - .getString(R.string.opml_export_success_sum) - + output.toString()); - } - alert.create().show(); - } - - @Override - protected void onPreExecute() { - progDialog = new ProgressDialog(context); - progDialog.setMessage(context.getString(R.string.exporting_label)); - progDialog.setIndeterminate(true); - progDialog.show(); - } - - @SuppressLint("NewApi") - public void executeAsync() { - if (android.os.Build.VERSION.SDK_INT > android.os.Build.VERSION_CODES.GINGERBREAD_MR1) { - executeOnExecutor(THREAD_POOL_EXECUTOR); - } else { - execute(); - } - } - -} diff --git a/app/src/main/java/de/danoeh/antennapod/core/service/download/Downloader.java b/app/src/main/java/de/danoeh/antennapod/core/service/download/Downloader.java deleted file mode 100644 index 5af9c2d05..000000000 --- a/app/src/main/java/de/danoeh/antennapod/core/service/download/Downloader.java +++ /dev/null @@ -1,69 +0,0 @@ -package de.danoeh.antennapod.core.service.download; - -import android.content.Context; -import android.net.wifi.WifiManager; -import de.danoeh.antennapod.PodcastApp; -import de.danoeh.antennapod.R; - -import java.util.concurrent.Callable; - -/** Downloads files */ -public abstract class Downloader implements Callable { - private static final String TAG = "Downloader"; - - protected volatile boolean finished; - - protected volatile boolean cancelled; - - protected DownloadRequest request; - protected DownloadStatus result; - - public Downloader(DownloadRequest request) { - super(); - this.request = request; - this.request.setStatusMsg(R.string.download_pending); - this.cancelled = false; - this.result = new DownloadStatus(request, null, false, false, null); - } - - protected abstract void download(); - - public final Downloader call() { - WifiManager wifiManager = (WifiManager) PodcastApp.getInstance().getSystemService(Context.WIFI_SERVICE); - WifiManager.WifiLock wifiLock = null; - if (wifiManager != null) { - wifiLock = wifiManager.createWifiLock(TAG); - wifiLock.acquire(); - } - - download(); - - if (wifiLock != null) { - wifiLock.release(); - } - - if (result == null) { - throw new IllegalStateException( - "Downloader hasn't created DownloadStatus object"); - } - finished = true; - return this; - } - - public DownloadRequest getDownloadRequest() { - return request; - } - - public DownloadStatus getResult() { - return result; - } - - public boolean isFinished() { - return finished; - } - - public void cancel() { - cancelled = true; - } - -} \ No newline at end of file diff --git a/app/src/main/java/de/danoeh/antennapod/core/util/StorageUtils.java b/app/src/main/java/de/danoeh/antennapod/core/util/StorageUtils.java deleted file mode 100644 index f899c211f..000000000 --- a/app/src/main/java/de/danoeh/antennapod/core/util/StorageUtils.java +++ /dev/null @@ -1,66 +0,0 @@ -package de.danoeh.antennapod.core.util; - -import android.app.Activity; -import android.content.Context; -import android.content.Intent; -import android.os.Build; -import android.os.StatFs; -import android.util.Log; -import de.danoeh.antennapod.BuildConfig; -import de.danoeh.antennapod.PodcastApp; -import de.danoeh.antennapod.activity.StorageErrorActivity; -import de.danoeh.antennapod.core.preferences.UserPreferences; - -import java.io.File; - -/** Utility functions for handling storage errors */ -public class StorageUtils { - private static final String TAG = "StorageUtils"; - - public static boolean storageAvailable(Context context) { - File dir = UserPreferences.getDataFolder(context, null); - if (dir != null) { - return dir.exists() && dir.canRead() && dir.canWrite(); - } else { - if (BuildConfig.DEBUG) - Log.d(TAG, "Storage not available: data folder is null"); - return false; - } - } - - /** - * Checks if external storage is available. If external storage isn't - * available, the current activity is finsished an an error activity is - * launched. - * - * @param activity - * the activity which would be finished if no storage is - * available - * @return true if external storage is available - */ - public static boolean checkStorageAvailability(Activity activity) { - boolean storageAvailable = storageAvailable(activity); - if (!storageAvailable) { - activity.finish(); - activity.startActivity(new Intent(activity, - StorageErrorActivity.class)); - } - return storageAvailable; - } - - /** Get the number of free bytes that are available on the external storage. */ - public static long getFreeSpaceAvailable() { - StatFs stat = new StatFs(UserPreferences.getDataFolder( - PodcastApp.getInstance(), null).getAbsolutePath()); - long availableBlocks; - long blockSize; - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR2) { - availableBlocks = stat.getAvailableBlocksLong(); - blockSize = stat.getBlockSizeLong(); - } else { - availableBlocks = stat.getAvailableBlocks(); - blockSize = stat.getBlockSize(); - } - return availableBlocks * blockSize; - } -} diff --git a/app/src/main/java/de/danoeh/antennapod/core/util/ThemeUtils.java b/app/src/main/java/de/danoeh/antennapod/core/util/ThemeUtils.java deleted file mode 100644 index 72d73138d..000000000 --- a/app/src/main/java/de/danoeh/antennapod/core/util/ThemeUtils.java +++ /dev/null @@ -1,22 +0,0 @@ -package de.danoeh.antennapod.core.util; - -import android.util.Log; -import de.danoeh.antennapod.R; -import de.danoeh.antennapod.core.preferences.UserPreferences; - -public class ThemeUtils { - private static final String TAG = "ThemeUtils"; - - public static int getSelectionBackgroundColor() { - switch (UserPreferences.getTheme()) { - case R.style.Theme_AntennaPod_Dark: - return R.color.selection_background_color_dark; - case R.style.Theme_AntennaPod_Light: - return R.color.selection_background_color_light; - default: - Log.e(TAG, - "getSelectionBackgroundColor could not match the current theme to any color!"); - return R.color.selection_background_color_light; - } - } -} diff --git a/app/src/main/java/de/danoeh/antennapod/dialog/FeedItemDialog.java b/app/src/main/java/de/danoeh/antennapod/dialog/FeedItemDialog.java index e62daa08b..8cdddc121 100644 --- a/app/src/main/java/de/danoeh/antennapod/dialog/FeedItemDialog.java +++ b/app/src/main/java/de/danoeh/antennapod/dialog/FeedItemDialog.java @@ -42,7 +42,7 @@ import de.danoeh.antennapod.core.storage.DownloadRequestException; import de.danoeh.antennapod.core.storage.DownloadRequester; import de.danoeh.antennapod.core.util.QueueAccess; import de.danoeh.antennapod.core.util.ShownotesProvider; -import de.danoeh.antennapod.core.util.menuhandler.FeedItemMenuHandler; +import de.danoeh.antennapod.menuhandler.FeedItemMenuHandler; /** * Shows information about a specific FeedItem and provides actions like playing, downloading, etc. diff --git a/app/src/main/java/de/danoeh/antennapod/core/dialog/TimeDialog.java b/app/src/main/java/de/danoeh/antennapod/dialog/TimeDialog.java similarity index 98% rename from app/src/main/java/de/danoeh/antennapod/core/dialog/TimeDialog.java rename to app/src/main/java/de/danoeh/antennapod/dialog/TimeDialog.java index a95e8c6c5..6561d501e 100644 --- a/app/src/main/java/de/danoeh/antennapod/core/dialog/TimeDialog.java +++ b/app/src/main/java/de/danoeh/antennapod/dialog/TimeDialog.java @@ -1,4 +1,4 @@ -package de.danoeh.antennapod.core.dialog; +package de.danoeh.antennapod.dialog; import android.app.Dialog; import android.content.Context; @@ -10,7 +10,7 @@ import android.view.View; import android.view.Window; import android.view.inputmethod.InputMethodManager; import android.widget.*; -import de.danoeh.antennapod.BuildConfig; +import de.danoeh.antennapod.core.BuildConfig; import de.danoeh.antennapod.R; import java.util.concurrent.TimeUnit; diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/ItemlistFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/ItemlistFragment.java index b16e4f930..9eaeb56dd 100644 --- a/app/src/main/java/de/danoeh/antennapod/fragment/ItemlistFragment.java +++ b/app/src/main/java/de/danoeh/antennapod/fragment/ItemlistFragment.java @@ -48,9 +48,9 @@ import de.danoeh.antennapod.core.storage.DBReader; import de.danoeh.antennapod.core.storage.DownloadRequestException; import de.danoeh.antennapod.core.storage.DownloadRequester; import de.danoeh.antennapod.core.util.QueueAccess; -import de.danoeh.antennapod.core.util.menuhandler.FeedMenuHandler; -import de.danoeh.antennapod.core.util.menuhandler.MenuItemUtils; -import de.danoeh.antennapod.core.util.menuhandler.NavDrawerActivity; +import de.danoeh.antennapod.menuhandler.FeedMenuHandler; +import de.danoeh.antennapod.menuhandler.MenuItemUtils; +import de.danoeh.antennapod.menuhandler.NavDrawerActivity; /** * Displays a list of FeedItems. diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/NewEpisodesFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/NewEpisodesFragment.java index 4f37f4613..d126f2980 100644 --- a/app/src/main/java/de/danoeh/antennapod/fragment/NewEpisodesFragment.java +++ b/app/src/main/java/de/danoeh/antennapod/fragment/NewEpisodesFragment.java @@ -33,8 +33,8 @@ import de.danoeh.antennapod.core.storage.DBTasks; import de.danoeh.antennapod.core.storage.DBWriter; import de.danoeh.antennapod.core.storage.DownloadRequester; import de.danoeh.antennapod.core.util.QueueAccess; -import de.danoeh.antennapod.core.util.menuhandler.MenuItemUtils; -import de.danoeh.antennapod.core.util.menuhandler.NavDrawerActivity; +import de.danoeh.antennapod.menuhandler.MenuItemUtils; +import de.danoeh.antennapod.menuhandler.NavDrawerActivity; import java.util.List; import java.util.concurrent.atomic.AtomicReference; diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/PlaybackHistoryFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/PlaybackHistoryFragment.java index 61e4ae1bb..4a07ce2b7 100644 --- a/app/src/main/java/de/danoeh/antennapod/fragment/PlaybackHistoryFragment.java +++ b/app/src/main/java/de/danoeh/antennapod/fragment/PlaybackHistoryFragment.java @@ -25,8 +25,8 @@ import de.danoeh.antennapod.core.service.download.Downloader; import de.danoeh.antennapod.core.storage.DBReader; import de.danoeh.antennapod.core.storage.DBWriter; import de.danoeh.antennapod.core.util.QueueAccess; -import de.danoeh.antennapod.core.util.menuhandler.MenuItemUtils; -import de.danoeh.antennapod.core.util.menuhandler.NavDrawerActivity; +import de.danoeh.antennapod.menuhandler.MenuItemUtils; +import de.danoeh.antennapod.menuhandler.NavDrawerActivity; import java.util.List; import java.util.concurrent.atomic.AtomicReference; diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/QueueFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/QueueFragment.java index c1191d933..3192a84de 100644 --- a/app/src/main/java/de/danoeh/antennapod/fragment/QueueFragment.java +++ b/app/src/main/java/de/danoeh/antennapod/fragment/QueueFragment.java @@ -37,8 +37,8 @@ import de.danoeh.antennapod.core.service.download.Downloader; import de.danoeh.antennapod.core.storage.DBReader; import de.danoeh.antennapod.core.storage.DBWriter; import de.danoeh.antennapod.core.util.QueueAccess; -import de.danoeh.antennapod.core.util.menuhandler.MenuItemUtils; -import de.danoeh.antennapod.core.util.menuhandler.NavDrawerActivity; +import de.danoeh.antennapod.menuhandler.MenuItemUtils; +import de.danoeh.antennapod.menuhandler.NavDrawerActivity; /** * Shows all items in the queue diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/SearchFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/SearchFragment.java index 23cc1d0b8..c16ba426e 100644 --- a/app/src/main/java/de/danoeh/antennapod/fragment/SearchFragment.java +++ b/app/src/main/java/de/danoeh/antennapod/fragment/SearchFragment.java @@ -20,8 +20,8 @@ import de.danoeh.antennapod.core.feed.*; import de.danoeh.antennapod.core.storage.DBReader; import de.danoeh.antennapod.core.storage.FeedSearcher; import de.danoeh.antennapod.core.util.QueueAccess; -import de.danoeh.antennapod.core.util.menuhandler.MenuItemUtils; -import de.danoeh.antennapod.core.util.menuhandler.NavDrawerActivity; +import de.danoeh.antennapod.menuhandler.MenuItemUtils; +import de.danoeh.antennapod.menuhandler.NavDrawerActivity; import java.util.List; diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/gpodnet/PodcastListFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/gpodnet/PodcastListFragment.java index 14b3a9c40..15a0b55b1 100644 --- a/app/src/main/java/de/danoeh/antennapod/fragment/gpodnet/PodcastListFragment.java +++ b/app/src/main/java/de/danoeh/antennapod/fragment/gpodnet/PodcastListFragment.java @@ -18,8 +18,8 @@ import de.danoeh.antennapod.adapter.gpodnet.PodcastListAdapter; import de.danoeh.antennapod.core.gpoddernet.GpodnetService; import de.danoeh.antennapod.core.gpoddernet.GpodnetServiceException; import de.danoeh.antennapod.core.gpoddernet.model.GpodnetPodcast; -import de.danoeh.antennapod.core.util.menuhandler.MenuItemUtils; -import de.danoeh.antennapod.core.util.menuhandler.NavDrawerActivity; +import de.danoeh.antennapod.menuhandler.MenuItemUtils; +import de.danoeh.antennapod.menuhandler.NavDrawerActivity; import java.util.List; diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/gpodnet/SearchListFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/gpodnet/SearchListFragment.java index b099953a8..635842196 100644 --- a/app/src/main/java/de/danoeh/antennapod/fragment/gpodnet/SearchListFragment.java +++ b/app/src/main/java/de/danoeh/antennapod/fragment/gpodnet/SearchListFragment.java @@ -13,8 +13,8 @@ import de.danoeh.antennapod.R; import de.danoeh.antennapod.core.gpoddernet.GpodnetService; import de.danoeh.antennapod.core.gpoddernet.GpodnetServiceException; import de.danoeh.antennapod.core.gpoddernet.model.GpodnetPodcast; -import de.danoeh.antennapod.core.util.menuhandler.MenuItemUtils; -import de.danoeh.antennapod.core.util.menuhandler.NavDrawerActivity; +import de.danoeh.antennapod.menuhandler.MenuItemUtils; +import de.danoeh.antennapod.menuhandler.NavDrawerActivity; /** * Performs a search on the gpodder.net directory and displays the results. diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/gpodnet/TagListFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/gpodnet/TagListFragment.java index 819a28c2d..24e0e4caa 100644 --- a/app/src/main/java/de/danoeh/antennapod/fragment/gpodnet/TagListFragment.java +++ b/app/src/main/java/de/danoeh/antennapod/fragment/gpodnet/TagListFragment.java @@ -21,8 +21,8 @@ import de.danoeh.antennapod.activity.MainActivity; import de.danoeh.antennapod.core.gpoddernet.GpodnetService; import de.danoeh.antennapod.core.gpoddernet.GpodnetServiceException; import de.danoeh.antennapod.core.gpoddernet.model.GpodnetTag; -import de.danoeh.antennapod.core.util.menuhandler.MenuItemUtils; -import de.danoeh.antennapod.core.util.menuhandler.NavDrawerActivity; +import de.danoeh.antennapod.menuhandler.MenuItemUtils; +import de.danoeh.antennapod.menuhandler.NavDrawerActivity; public class TagListFragment extends ListFragment { private static final String TAG = "TagListFragment"; diff --git a/app/src/main/java/de/danoeh/antennapod/core/util/menuhandler/FeedItemMenuHandler.java b/app/src/main/java/de/danoeh/antennapod/menuhandler/FeedItemMenuHandler.java similarity index 98% rename from app/src/main/java/de/danoeh/antennapod/core/util/menuhandler/FeedItemMenuHandler.java rename to app/src/main/java/de/danoeh/antennapod/menuhandler/FeedItemMenuHandler.java index f85ac412d..8ccbdafc6 100644 --- a/app/src/main/java/de/danoeh/antennapod/core/util/menuhandler/FeedItemMenuHandler.java +++ b/app/src/main/java/de/danoeh/antennapod/menuhandler/FeedItemMenuHandler.java @@ -1,10 +1,10 @@ -package de.danoeh.antennapod.core.util.menuhandler; +package de.danoeh.antennapod.menuhandler; import android.content.Context; import android.content.Intent; import android.net.Uri; -import de.danoeh.antennapod.BuildConfig; +import de.danoeh.antennapod.core.BuildConfig; import de.danoeh.antennapod.R; import de.danoeh.antennapod.core.feed.FeedItem; import de.danoeh.antennapod.core.service.playback.PlaybackService; diff --git a/app/src/main/java/de/danoeh/antennapod/core/util/menuhandler/FeedMenuHandler.java b/app/src/main/java/de/danoeh/antennapod/menuhandler/FeedMenuHandler.java similarity index 96% rename from app/src/main/java/de/danoeh/antennapod/core/util/menuhandler/FeedMenuHandler.java rename to app/src/main/java/de/danoeh/antennapod/menuhandler/FeedMenuHandler.java index 757cc5f56..62ae28820 100644 --- a/app/src/main/java/de/danoeh/antennapod/core/util/menuhandler/FeedMenuHandler.java +++ b/app/src/main/java/de/danoeh/antennapod/menuhandler/FeedMenuHandler.java @@ -1,4 +1,4 @@ -package de.danoeh.antennapod.core.util.menuhandler; +package de.danoeh.antennapod.menuhandler; import android.content.Context; import android.content.Intent; @@ -7,7 +7,7 @@ import android.util.Log; import android.view.Menu; import android.view.MenuInflater; import android.view.MenuItem; -import de.danoeh.antennapod.BuildConfig; +import de.danoeh.antennapod.core.BuildConfig; import de.danoeh.antennapod.R; import de.danoeh.antennapod.core.feed.Feed; import de.danoeh.antennapod.core.service.download.DownloadService; diff --git a/app/src/main/java/de/danoeh/antennapod/core/util/menuhandler/MenuItemUtils.java b/app/src/main/java/de/danoeh/antennapod/menuhandler/MenuItemUtils.java similarity index 92% rename from app/src/main/java/de/danoeh/antennapod/core/util/menuhandler/MenuItemUtils.java rename to app/src/main/java/de/danoeh/antennapod/menuhandler/MenuItemUtils.java index 4258c4d22..c4a96ac3f 100644 --- a/app/src/main/java/de/danoeh/antennapod/core/util/menuhandler/MenuItemUtils.java +++ b/app/src/main/java/de/danoeh/antennapod/menuhandler/MenuItemUtils.java @@ -1,11 +1,11 @@ -package de.danoeh.antennapod.core.util.menuhandler; +package de.danoeh.antennapod.menuhandler; import android.support.v4.view.MenuItemCompat; import android.support.v7.widget.SearchView; import android.view.Menu; import android.view.MenuItem; -import de.danoeh.antennapod.R; +import de.danoeh.antennapod.core.R; /** * Utilities for menu items diff --git a/app/src/main/java/de/danoeh/antennapod/core/util/menuhandler/NavDrawerActivity.java b/app/src/main/java/de/danoeh/antennapod/menuhandler/NavDrawerActivity.java similarity index 74% rename from app/src/main/java/de/danoeh/antennapod/core/util/menuhandler/NavDrawerActivity.java rename to app/src/main/java/de/danoeh/antennapod/menuhandler/NavDrawerActivity.java index 61bf9960f..6ceaaada4 100644 --- a/app/src/main/java/de/danoeh/antennapod/core/util/menuhandler/NavDrawerActivity.java +++ b/app/src/main/java/de/danoeh/antennapod/menuhandler/NavDrawerActivity.java @@ -1,4 +1,4 @@ -package de.danoeh.antennapod.core.util.menuhandler; +package de.danoeh.antennapod.menuhandler; /** * Defines useful methods for activities that have a navigation drawer diff --git a/app/src/main/java/de/danoeh/antennapod/core/receiver/PlayerWidget.java b/app/src/main/java/de/danoeh/antennapod/receiver/PlayerWidget.java similarity index 66% rename from app/src/main/java/de/danoeh/antennapod/core/receiver/PlayerWidget.java rename to app/src/main/java/de/danoeh/antennapod/receiver/PlayerWidget.java index 3dcfecdbd..7ab386edf 100644 --- a/app/src/main/java/de/danoeh/antennapod/core/receiver/PlayerWidget.java +++ b/app/src/main/java/de/danoeh/antennapod/receiver/PlayerWidget.java @@ -1,4 +1,4 @@ -package de.danoeh.antennapod.core.receiver; +package de.danoeh.antennapod.receiver; import android.appwidget.AppWidgetManager; import android.appwidget.AppWidgetProvider; @@ -8,19 +8,18 @@ import android.util.Log; import org.apache.commons.lang3.StringUtils; -import de.danoeh.antennapod.BuildConfig; -import de.danoeh.antennapod.core.service.playback.PlayerWidgetService; +import de.danoeh.antennapod.core.BuildConfig; +import de.danoeh.antennapod.core.service.playback.PlaybackService; +import de.danoeh.antennapod.service.PlayerWidgetService; public class PlayerWidget extends AppWidgetProvider { private static final String TAG = "PlayerWidget"; - public static final String FORCE_WIDGET_UPDATE = "de.danoeh.antennapod.FORCE_WIDGET_UPDATE"; - public static final String STOP_WIDGET_UPDATE = "de.danoeh.antennapod.STOP_WIDGET_UPDATE"; - @Override + @Override public void onReceive(Context context, Intent intent) { - if (StringUtils.equals(intent.getAction(), FORCE_WIDGET_UPDATE)) { + if (StringUtils.equals(intent.getAction(), PlaybackService.FORCE_WIDGET_UPDATE)) { startUpdate(context); - } else if (StringUtils.equals(intent.getAction(), STOP_WIDGET_UPDATE)) { + } else if (StringUtils.equals(intent.getAction(), PlaybackService.STOP_WIDGET_UPDATE)) { stopUpdate(context); } diff --git a/app/src/main/java/de/danoeh/antennapod/core/service/playback/PlayerWidgetService.java b/app/src/main/java/de/danoeh/antennapod/service/PlayerWidgetService.java similarity index 95% rename from app/src/main/java/de/danoeh/antennapod/core/service/playback/PlayerWidgetService.java rename to app/src/main/java/de/danoeh/antennapod/service/PlayerWidgetService.java index 495e2c0f2..514cbb74e 100644 --- a/app/src/main/java/de/danoeh/antennapod/core/service/playback/PlayerWidgetService.java +++ b/app/src/main/java/de/danoeh/antennapod/service/PlayerWidgetService.java @@ -1,4 +1,4 @@ -package de.danoeh.antennapod.core.service.playback; +package de.danoeh.antennapod.service; import android.app.PendingIntent; import android.app.Service; @@ -12,10 +12,12 @@ import android.util.Log; import android.view.KeyEvent; import android.view.View; import android.widget.RemoteViews; -import de.danoeh.antennapod.BuildConfig; +import de.danoeh.antennapod.core.BuildConfig; import de.danoeh.antennapod.R; import de.danoeh.antennapod.core.receiver.MediaButtonReceiver; -import de.danoeh.antennapod.core.receiver.PlayerWidget; +import de.danoeh.antennapod.receiver.PlayerWidget; +import de.danoeh.antennapod.core.service.playback.PlaybackService; +import de.danoeh.antennapod.core.service.playback.PlayerStatus; import de.danoeh.antennapod.core.util.Converter; import de.danoeh.antennapod.core.util.playback.Playable; diff --git a/core/.gitignore b/core/.gitignore new file mode 100644 index 000000000..796b96d1c --- /dev/null +++ b/core/.gitignore @@ -0,0 +1 @@ +/build diff --git a/core/build.gradle b/core/build.gradle new file mode 100644 index 000000000..132d68084 --- /dev/null +++ b/core/build.gradle @@ -0,0 +1,43 @@ +apply plugin: 'com.android.library' + +android { + compileSdkVersion 20 + buildToolsVersion "20.0.0" + + defaultConfig { + applicationId "de.danoeh.antennapod.core" + minSdkVersion 10 + targetSdkVersion 20 + versionCode 1 + versionName "1.0" + } + buildTypes { + release { + runProguard false + proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' + } + } +} + +dependencies { + compile fileTree(dir: 'libs', include: ['*.jar']) + compile 'com.android.support:appcompat-v7:20.0.0' + compile 'com.android.support:support-v4:20.0.0' + compile 'org.apache.commons:commons-lang3:3.3.2' + compile ('org.shredzone.flattr4j:flattr4j-core:2.10') { + exclude group: 'org.apache.httpcomponents', module: 'httpcore' + exclude group: 'org.apache.httpcomponents', module: 'httpclient' + exclude group: 'org.json', module: 'json' + } + compile 'commons-io:commons-io:2.4' + compile 'com.nineoldandroids:library:2.4.0' + compile 'com.jayway.android.robotium:robotium-solo:5.2.1' + compile ("com.doomonafireball.betterpickers:library:1.5.2") { + exclude group: 'com.android.support', module: 'support-v4' + } + compile 'org.jsoup:jsoup:1.7.3' + compile 'com.squareup.picasso:picasso:2.3.4' + compile 'com.squareup.okhttp:okhttp:2.0.0' + compile 'com.squareup.okhttp:okhttp-urlconnection:2.0.0' + compile 'com.squareup.okio:okio:1.0.0' +} diff --git a/core/proguard-rules.pro b/core/proguard-rules.pro new file mode 100644 index 000000000..41a9efda7 --- /dev/null +++ b/core/proguard-rules.pro @@ -0,0 +1,17 @@ +# Add project specific ProGuard rules here. +# By default, the flags in this file are appended to flags specified +# in /Users/daniel/bin/android-sdk/tools/proguard/proguard-android.txt +# You can edit the include path and order by changing the proguardFiles +# directive in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# Add any project specific keep options here: + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} diff --git a/core/src/androidTest/java/de/danoeh/antennapod/core/ApplicationTest.java b/core/src/androidTest/java/de/danoeh/antennapod/core/ApplicationTest.java new file mode 100644 index 000000000..894bcfa63 --- /dev/null +++ b/core/src/androidTest/java/de/danoeh/antennapod/core/ApplicationTest.java @@ -0,0 +1,13 @@ +package de.danoeh.antennapod.core; + +import android.app.Application; +import android.test.ApplicationTestCase; + +/** + * Testing Fundamentals + */ +public class ApplicationTest extends ApplicationTestCase { + public ApplicationTest() { + super(Application.class); + } +} \ No newline at end of file diff --git a/core/src/main/AndroidManifest.xml b/core/src/main/AndroidManifest.xml new file mode 100644 index 000000000..db67b8003 --- /dev/null +++ b/core/src/main/AndroidManifest.xml @@ -0,0 +1,11 @@ + + + + + + + diff --git a/app/src/main/aidl/com/aocate/presto/service/IDeathCallback_0_8.aidl b/core/src/main/aidl/com/aocate/presto/service/IDeathCallback_0_8.aidl similarity index 100% rename from app/src/main/aidl/com/aocate/presto/service/IDeathCallback_0_8.aidl rename to core/src/main/aidl/com/aocate/presto/service/IDeathCallback_0_8.aidl diff --git a/app/src/main/aidl/com/aocate/presto/service/IOnBufferingUpdateListenerCallback_0_8.aidl b/core/src/main/aidl/com/aocate/presto/service/IOnBufferingUpdateListenerCallback_0_8.aidl similarity index 100% rename from app/src/main/aidl/com/aocate/presto/service/IOnBufferingUpdateListenerCallback_0_8.aidl rename to core/src/main/aidl/com/aocate/presto/service/IOnBufferingUpdateListenerCallback_0_8.aidl diff --git a/app/src/main/aidl/com/aocate/presto/service/IOnCompletionListenerCallback_0_8.aidl b/core/src/main/aidl/com/aocate/presto/service/IOnCompletionListenerCallback_0_8.aidl similarity index 100% rename from app/src/main/aidl/com/aocate/presto/service/IOnCompletionListenerCallback_0_8.aidl rename to core/src/main/aidl/com/aocate/presto/service/IOnCompletionListenerCallback_0_8.aidl diff --git a/app/src/main/aidl/com/aocate/presto/service/IOnErrorListenerCallback_0_8.aidl b/core/src/main/aidl/com/aocate/presto/service/IOnErrorListenerCallback_0_8.aidl similarity index 100% rename from app/src/main/aidl/com/aocate/presto/service/IOnErrorListenerCallback_0_8.aidl rename to core/src/main/aidl/com/aocate/presto/service/IOnErrorListenerCallback_0_8.aidl diff --git a/app/src/main/aidl/com/aocate/presto/service/IOnInfoListenerCallback_0_8.aidl b/core/src/main/aidl/com/aocate/presto/service/IOnInfoListenerCallback_0_8.aidl similarity index 100% rename from app/src/main/aidl/com/aocate/presto/service/IOnInfoListenerCallback_0_8.aidl rename to core/src/main/aidl/com/aocate/presto/service/IOnInfoListenerCallback_0_8.aidl diff --git a/app/src/main/aidl/com/aocate/presto/service/IOnPitchAdjustmentAvailableChangedListenerCallback_0_8.aidl b/core/src/main/aidl/com/aocate/presto/service/IOnPitchAdjustmentAvailableChangedListenerCallback_0_8.aidl similarity index 100% rename from app/src/main/aidl/com/aocate/presto/service/IOnPitchAdjustmentAvailableChangedListenerCallback_0_8.aidl rename to core/src/main/aidl/com/aocate/presto/service/IOnPitchAdjustmentAvailableChangedListenerCallback_0_8.aidl diff --git a/app/src/main/aidl/com/aocate/presto/service/IOnPreparedListenerCallback_0_8.aidl b/core/src/main/aidl/com/aocate/presto/service/IOnPreparedListenerCallback_0_8.aidl similarity index 100% rename from app/src/main/aidl/com/aocate/presto/service/IOnPreparedListenerCallback_0_8.aidl rename to core/src/main/aidl/com/aocate/presto/service/IOnPreparedListenerCallback_0_8.aidl diff --git a/app/src/main/aidl/com/aocate/presto/service/IOnSeekCompleteListenerCallback_0_8.aidl b/core/src/main/aidl/com/aocate/presto/service/IOnSeekCompleteListenerCallback_0_8.aidl similarity index 100% rename from app/src/main/aidl/com/aocate/presto/service/IOnSeekCompleteListenerCallback_0_8.aidl rename to core/src/main/aidl/com/aocate/presto/service/IOnSeekCompleteListenerCallback_0_8.aidl diff --git a/app/src/main/aidl/com/aocate/presto/service/IOnSpeedAdjustmentAvailableChangedListenerCallback_0_8.aidl b/core/src/main/aidl/com/aocate/presto/service/IOnSpeedAdjustmentAvailableChangedListenerCallback_0_8.aidl similarity index 100% rename from app/src/main/aidl/com/aocate/presto/service/IOnSpeedAdjustmentAvailableChangedListenerCallback_0_8.aidl rename to core/src/main/aidl/com/aocate/presto/service/IOnSpeedAdjustmentAvailableChangedListenerCallback_0_8.aidl diff --git a/app/src/main/aidl/com/aocate/presto/service/IPlayMedia_0_8.aidl b/core/src/main/aidl/com/aocate/presto/service/IPlayMedia_0_8.aidl similarity index 100% rename from app/src/main/aidl/com/aocate/presto/service/IPlayMedia_0_8.aidl rename to core/src/main/aidl/com/aocate/presto/service/IPlayMedia_0_8.aidl diff --git a/app/src/main/java/com/aocate/media/AndroidMediaPlayer.java b/core/src/main/java/com/aocate/media/AndroidMediaPlayer.java similarity index 100% rename from app/src/main/java/com/aocate/media/AndroidMediaPlayer.java rename to core/src/main/java/com/aocate/media/AndroidMediaPlayer.java diff --git a/core/src/main/java/com/aocate/media/MediaPlayer.java b/core/src/main/java/com/aocate/media/MediaPlayer.java new file mode 100644 index 000000000..c73c5219e --- /dev/null +++ b/core/src/main/java/com/aocate/media/MediaPlayer.java @@ -0,0 +1,1278 @@ +// Copyright 2011, Aocate, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package com.aocate.media; + +import android.content.ComponentName; +import android.content.Context; +import android.content.Intent; +import android.content.ServiceConnection; +import android.content.pm.PackageManager; +import android.content.pm.ResolveInfo; +import android.media.AudioManager; +import android.net.Uri; +import android.os.Handler; +import android.os.Handler.Callback; +import android.os.IBinder; +import android.os.Message; +import android.util.Log; + +import java.io.IOException; +import java.util.List; +import java.util.concurrent.locks.ReentrantLock; + +import de.danoeh.antennapod.core.BuildConfig; + +public class MediaPlayer { + public interface OnBufferingUpdateListener { + public abstract void onBufferingUpdate(MediaPlayer arg0, int percent); + } + + public interface OnCompletionListener { + public abstract void onCompletion(MediaPlayer arg0); + } + + public interface OnErrorListener { + public abstract boolean onError(MediaPlayer arg0, int what, int extra); + } + + public interface OnInfoListener { + public abstract boolean onInfo(MediaPlayer arg0, int what, int extra); + } + + public interface OnPitchAdjustmentAvailableChangedListener { + /** + * @param arg0 The owning media player + * @param pitchAdjustmentAvailable True if pitch adjustment is available, false if not + */ + public abstract void onPitchAdjustmentAvailableChanged( + MediaPlayer arg0, boolean pitchAdjustmentAvailable); + } + + public interface OnPreparedListener { + public abstract void onPrepared(MediaPlayer arg0); + } + + public interface OnSeekCompleteListener { + public abstract void onSeekComplete(MediaPlayer arg0); + } + + public interface OnSpeedAdjustmentAvailableChangedListener { + /** + * @param arg0 The owning media player + * @param speedAdjustmentAvailable True if speed adjustment is available, false if not + */ + public abstract void onSpeedAdjustmentAvailableChanged( + MediaPlayer arg0, boolean speedAdjustmentAvailable); + } + + public enum State { + IDLE, INITIALIZED, PREPARED, STARTED, PAUSED, STOPPED, PREPARING, PLAYBACK_COMPLETED, END, ERROR + } + + private static Uri SPEED_ADJUSTMENT_MARKET_URI = Uri + .parse("market://details?id=com.aocate.presto"); + + private static Intent prestoMarketIntent = null; + + public static final int MEDIA_ERROR_SERVER_DIED = android.media.MediaPlayer.MEDIA_ERROR_SERVER_DIED; + public static final int MEDIA_ERROR_UNKNOWN = android.media.MediaPlayer.MEDIA_ERROR_UNKNOWN; + public static final int MEDIA_ERROR_NOT_VALID_FOR_PROGRESSIVE_PLAYBACK = android.media.MediaPlayer.MEDIA_ERROR_NOT_VALID_FOR_PROGRESSIVE_PLAYBACK; + + /** + * Indicates whether the specified action can be used as an intent. This + * method queries the package manager for installed packages that can + * respond to an intent with the specified action. If no suitable package is + * found, this method returns false. + * + * @param context The application's environment. + * @param action The Intent action to check for availability. + * @return True if an Intent with the specified action can be sent and + * responded to, false otherwise. + */ + public static boolean isIntentAvailable(Context context, String action) { + final PackageManager packageManager = context.getPackageManager(); + final Intent intent = new Intent(action); + List list = packageManager.queryIntentServices(intent, + PackageManager.MATCH_DEFAULT_ONLY); + return list.size() > 0; + } + + /** + * Indicates whether the Presto library is installed + * + * @param context The context to use to query the package manager. + * @return True if the Presto library is installed, false if not. + */ + public static boolean isPrestoLibraryInstalled(Context context) { + return isIntentAvailable(context, ServiceBackedMediaPlayer.INTENT_NAME); + } + + /** + * Return an Intent that opens the Android Market page for the speed + * alteration library + * + * @return The Intent for the Presto library on the Android Market + */ + public static Intent getPrestoMarketIntent() { + if (prestoMarketIntent == null) { + prestoMarketIntent = new Intent(Intent.ACTION_VIEW, + SPEED_ADJUSTMENT_MARKET_URI); + } + return prestoMarketIntent; + } + + /** + * Open the Android Market page for the Presto library + * + * @param context The context from which to open the Android Market page + */ + public static void openPrestoMarketIntent(Context context) { + context.startActivity(getPrestoMarketIntent()); + } + + private static final String MP_TAG = "AocateReplacementMediaPlayer"; + + private static final double PITCH_STEP_CONSTANT = 1.0594630943593; + + private AndroidMediaPlayer amp = null; + // This is whether speed adjustment should be enabled (by the Service) + // To avoid the Service entirely, set useService to false + protected boolean enableSpeedAdjustment = true; + private int lastKnownPosition = 0; + // In some cases, we're going to have to replace the + // android.media.MediaPlayer on the fly, and we don't want to touch the + // wrong media player, so lock it way too much. + ReentrantLock lock = new ReentrantLock(); + private int mAudioStreamType = AudioManager.STREAM_MUSIC; + private Context mContext; + private boolean mIsLooping = false; + private float mLeftVolume = 1f; + private float mPitchStepsAdjustment = 0f; + private float mRightVolume = 1f; + private float mSpeedMultiplier = 1f; + private int mWakeMode = 0; + MediaPlayerImpl mpi = null; + protected boolean pitchAdjustmentAvailable = false; + private ServiceBackedMediaPlayer sbmp = null; + protected boolean speedAdjustmentAvailable = false; + + private Handler mServiceDisconnectedHandler = null; + + // Some parts of state cannot be found by calling MediaPlayerImpl functions, + // so store our own state. This also helps copy state when changing + // implementations + State state = State.INITIALIZED; + String stringDataSource = null; + Uri uriDataSource = null; + private boolean useService = false; + + // Naming Convention for Listeners + // Most listeners can both be set by clients and called by MediaPlayImpls + // There are a few that have to do things in this class as well as calling + // the function. In all cases, onX is what is called by MediaPlayerImpl + // If there is work to be done in this class, then the listener that is + // set by setX is X (with the first letter lowercase). + OnBufferingUpdateListener onBufferingUpdateListener = null; + OnCompletionListener onCompletionListener = null; + OnErrorListener onErrorListener = null; + OnInfoListener onInfoListener = null; + + // Special case. Pitch adjustment ceases to be available when we switch + // to the android.media.MediaPlayer (though it is not guaranteed to be + // available when using the ServiceBackedMediaPlayer) + OnPitchAdjustmentAvailableChangedListener onPitchAdjustmentAvailableChangedListener = new OnPitchAdjustmentAvailableChangedListener() { + public void onPitchAdjustmentAvailableChanged(MediaPlayer arg0, + boolean pitchAdjustmentAvailable) { + lock.lock(); + try { + Log + .d( + MP_TAG, + "onPitchAdjustmentAvailableChangedListener.onPitchAdjustmentAvailableChanged being called"); + if (MediaPlayer.this.pitchAdjustmentAvailable != pitchAdjustmentAvailable) { + Log.d(MP_TAG, "Pitch adjustment state has changed from " + + MediaPlayer.this.pitchAdjustmentAvailable + + " to " + pitchAdjustmentAvailable); + MediaPlayer.this.pitchAdjustmentAvailable = pitchAdjustmentAvailable; + if (MediaPlayer.this.pitchAdjustmentAvailableChangedListener != null) { + MediaPlayer.this.pitchAdjustmentAvailableChangedListener + .onPitchAdjustmentAvailableChanged(arg0, + pitchAdjustmentAvailable); + } + } + } finally { + lock.unlock(); + } + } + }; + OnPitchAdjustmentAvailableChangedListener pitchAdjustmentAvailableChangedListener = null; + + MediaPlayer.OnPreparedListener onPreparedListener = new MediaPlayer.OnPreparedListener() { + public void onPrepared(MediaPlayer arg0) { + Log.d(MP_TAG, "onPreparedListener 242 setting state to PREPARED"); + MediaPlayer.this.state = State.PREPARED; + if (MediaPlayer.this.preparedListener != null) { + Log.d(MP_TAG, "Calling preparedListener"); + MediaPlayer.this.preparedListener.onPrepared(arg0); + } + Log.d(MP_TAG, "Wrap up onPreparedListener"); + } + }; + + OnPreparedListener preparedListener = null; + OnSeekCompleteListener onSeekCompleteListener = null; + + // Special case. Speed adjustment ceases to be available when we switch + // to the android.media.MediaPlayer (though it is not guaranteed to be + // available when using the ServiceBackedMediaPlayer) + OnSpeedAdjustmentAvailableChangedListener onSpeedAdjustmentAvailableChangedListener = new OnSpeedAdjustmentAvailableChangedListener() { + public void onSpeedAdjustmentAvailableChanged(MediaPlayer arg0, + boolean speedAdjustmentAvailable) { + lock.lock(); + try { + Log + .d( + MP_TAG, + "onSpeedAdjustmentAvailableChangedListener.onSpeedAdjustmentAvailableChanged being called"); + if (MediaPlayer.this.speedAdjustmentAvailable != speedAdjustmentAvailable) { + Log.d(MP_TAG, "Speed adjustment state has changed from " + + MediaPlayer.this.speedAdjustmentAvailable + + " to " + speedAdjustmentAvailable); + MediaPlayer.this.speedAdjustmentAvailable = speedAdjustmentAvailable; + if (MediaPlayer.this.speedAdjustmentAvailableChangedListener != null) { + MediaPlayer.this.speedAdjustmentAvailableChangedListener + .onSpeedAdjustmentAvailableChanged(arg0, + speedAdjustmentAvailable); + } + } + } finally { + lock.unlock(); + } + } + }; + OnSpeedAdjustmentAvailableChangedListener speedAdjustmentAvailableChangedListener = null; + + private int speedAdjustmentAlgorithm = SpeedAdjustmentAlgorithm.SONIC; + + public MediaPlayer(final Context context) { + this(context, true); + } + + public MediaPlayer(final Context context, boolean useService) { + this.mContext = context; + this.useService = useService; + + // So here's the major problem + // Sometimes the service won't exist or won't be connected, + // so start with an android.media.MediaPlayer, and when + // the service is connected, use that from then on + this.mpi = this.amp = new AndroidMediaPlayer(this, context); + + // setupMpi will go get the Service, if it can, then bring that + // implementation into sync + Log.d(MP_TAG, "setupMpi"); + setupMpi(context); + } + + private boolean invalidServiceConnectionConfiguration() { + if (!(this.mpi instanceof ServiceBackedMediaPlayer)) { + if (this.useService && isPrestoLibraryInstalled()) { + // In this case, the Presto library has been installed + // or something while playing sound + // We could be using the service, but we're not + Log.d(MP_TAG, "We could be using the service, but we're not 316"); + return true; + } + // If useService is false, then we shouldn't be using the SBMP + // If the Presto library isn't installed, ditto + Log.d(MP_TAG, "this.mpi is not a ServiceBackedMediaPlayer, but we couldn't use it anyway 321"); + return false; + } else { + if (BuildConfig.DEBUG && !(this.mpi instanceof ServiceBackedMediaPlayer)) + throw new AssertionError(); + if (this.useService && isPrestoLibraryInstalled()) { + // We should be using the service, and we are. Great! + Log.d(MP_TAG, "We could be using a ServiceBackedMediaPlayer and we are 327"); + return false; + } + // We're trying to use the service when we shouldn't, + // that's an invalid configuration + Log.d(MP_TAG, "We're trying to use a ServiceBackedMediaPlayer but we shouldn't be 332"); + return true; + } + } + + private void setupMpi(final Context context) { + lock.lock(); + try { + Log.d(MP_TAG, "setupMpi 336"); + // Check if the client wants to use the service at all, + // then if we're already using the right kind of media player + if (this.useService && isPrestoLibraryInstalled()) { + if ((this.mpi != null) + && (this.mpi instanceof ServiceBackedMediaPlayer)) { + Log.d(MP_TAG, "Already using ServiceBackedMediaPlayer"); + return; + } + if (this.sbmp == null) { + Log.d(MP_TAG, "Instantiating new ServiceBackedMediaPlayer 346"); + this.sbmp = new ServiceBackedMediaPlayer(this, context, + new ServiceConnection() { + public void onServiceConnected( + ComponentName className, + final IBinder service) { + Thread t = new Thread(new Runnable() { + public void run() { + // This lock probably isn't granular + // enough + MediaPlayer.this.lock.lock(); + Log.d(MP_TAG, + "onServiceConnected 257"); + try { + MediaPlayer.this + .switchMediaPlayerImpl( + MediaPlayer.this.amp, + MediaPlayer.this.sbmp); + Log.d(MP_TAG, "End onServiceConnected 362"); + } finally { + MediaPlayer.this.lock.unlock(); + } + } + }); + t.start(); + } + + public void onServiceDisconnected( + ComponentName className) { + MediaPlayer.this.lock.lock(); + try { + // Can't get any more useful information + // out of sbmp + if (MediaPlayer.this.sbmp != null) { + MediaPlayer.this.sbmp.release(); + } + // Unlike most other cases, sbmp gets set + // to null since there's nothing useful + // backing it now + MediaPlayer.this.sbmp = null; + + if (mServiceDisconnectedHandler == null) { + mServiceDisconnectedHandler = new Handler(new Callback() { + public boolean handleMessage(Message msg) { + // switchMediaPlayerImpl won't try to + // clone anything from null + lock.lock(); + try { + if (MediaPlayer.this.amp == null) { + // This should never be in this state + MediaPlayer.this.amp = new AndroidMediaPlayer( + MediaPlayer.this, + MediaPlayer.this.mContext); + } + // Use sbmp instead of null in case by some miracle it's + // been restored in the meantime + MediaPlayer.this.switchMediaPlayerImpl( + MediaPlayer.this.sbmp, + MediaPlayer.this.amp); + return true; + } finally { + lock.unlock(); + } + } + }); + } + + // This code needs to execute on the + // original thread to instantiate + // the new object in the right place + mServiceDisconnectedHandler + .sendMessage( + mServiceDisconnectedHandler + .obtainMessage()); + // Note that we do NOT want to set + // useService. useService is about + // what the user wants, not what they + // get + } finally { + MediaPlayer.this.lock.unlock(); + } + } + } + ); + } + switchMediaPlayerImpl(this.amp, this.sbmp); + } else { + if ((this.mpi != null) + && (this.mpi instanceof AndroidMediaPlayer)) { + Log.d(MP_TAG, "Already using AndroidMediaPlayer"); + return; + } + if (this.amp == null) { + Log.d(MP_TAG, "Instantiating new AndroidMediaPlayer (this should be impossible)"); + this.amp = new AndroidMediaPlayer(this, context); + } + switchMediaPlayerImpl(this.sbmp, this.amp); + } + } finally { + lock.unlock(); + } + } + + private void switchMediaPlayerImpl(MediaPlayerImpl from, MediaPlayerImpl to) { + lock.lock(); + try { + Log.d(MP_TAG, "switchMediaPlayerImpl"); + if ((from == to) + // Same object, nothing to synchronize + || (to == null) + // Nothing to copy to (maybe this should throw an error?) + || ((to instanceof ServiceBackedMediaPlayer) && !((ServiceBackedMediaPlayer) to).isConnected()) + // ServiceBackedMediaPlayer hasn't yet connected, onServiceConnected will take care of the transition + || (MediaPlayer.this.state == State.END)) { + // State.END is after a release(), no further functions should + // be called on this class and from is likely to have problems + // retrieving state that won't be used anyway + return; + } + // Extract all that we can from the existing implementation + // and copy it to the new implementation + + Log.d(MP_TAG, "switchMediaPlayerImpl(), current state is " + + this.state.toString()); + + to.reset(); + + // Do this first so we don't have to prepare the same + // data file twice + to.setEnableSpeedAdjustment(MediaPlayer.this.enableSpeedAdjustment); + + // This is a reasonable place to set all of these, + // none of them require prepare() or the like first + to.setAudioStreamType(this.mAudioStreamType); + to.setSpeedAdjustmentAlgorithm(this.speedAdjustmentAlgorithm); + to.setLooping(this.mIsLooping); + to.setPitchStepsAdjustment(this.mPitchStepsAdjustment); + Log.d(MP_TAG, "Setting playback speed to " + this.mSpeedMultiplier); + to.setPlaybackSpeed(this.mSpeedMultiplier); + to.setVolume(MediaPlayer.this.mLeftVolume, + MediaPlayer.this.mRightVolume); + to.setWakeMode(this.mContext, this.mWakeMode); + + Log.d(MP_TAG, "asserting at least one data source is null"); + assert ((MediaPlayer.this.stringDataSource == null) || (MediaPlayer.this.uriDataSource == null)); + + if (uriDataSource != null) { + Log.d(MP_TAG, "switchMediaPlayerImpl(): uriDataSource != null"); + try { + to.setDataSource(this.mContext, uriDataSource); + } catch (IllegalArgumentException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } catch (IllegalStateException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } catch (IOException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + if (stringDataSource != null) { + Log.d(MP_TAG, + "switchMediaPlayerImpl(): stringDataSource != null"); + try { + to.setDataSource(stringDataSource); + } catch (IllegalArgumentException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } catch (IllegalStateException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } catch (IOException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + if ((this.state == State.PREPARED) + || (this.state == State.PREPARING) + || (this.state == State.PAUSED) + || (this.state == State.STOPPED) + || (this.state == State.STARTED) + || (this.state == State.PLAYBACK_COMPLETED)) { + Log.d(MP_TAG, "switchMediaPlayerImpl(): prepare and seek"); + // Use prepare here instead of prepareAsync so that + // we wait for it to be ready before we try to use it + try { + to.muteNextOnPrepare(); + to.prepare(); + } catch (IllegalStateException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } catch (IOException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + + int seekPos = 0; + if (from != null) { + seekPos = from.getCurrentPosition(); + } else if (this.lastKnownPosition < to.getDuration()) { + // This can happen if the Service unexpectedly + // disconnected. Because it would result in too much + // information being passed around, we don't constantly + // poll for the lastKnownPosition, but we'll save it + // when getCurrentPosition is called + seekPos = this.lastKnownPosition; + } + to.muteNextSeek(); + to.seekTo(seekPos); + } + if ((from != null) + && from.isPlaying()) { + from.pause(); + } + if ((this.state == State.STARTED) + || (this.state == State.PAUSED) + || (this.state == State.STOPPED)) { + Log.d(MP_TAG, "switchMediaPlayerImpl(): start"); + if (to != null) { + to.start(); + } + } + + if (this.state == State.PAUSED) { + Log.d(MP_TAG, "switchMediaPlayerImpl(): paused"); + if (to != null) { + to.pause(); + } + } else if (this.state == State.STOPPED) { + Log.d(MP_TAG, "switchMediaPlayerImpl(): stopped"); + if (to != null) { + to.stop(); + } + } + + this.mpi = to; + + // Cheating here by relying on the side effect in + // on(Pitch|Speed)AdjustmentAvailableChanged + if ((to.canSetPitch() != this.pitchAdjustmentAvailable) + && (this.onPitchAdjustmentAvailableChangedListener != null)) { + this.onPitchAdjustmentAvailableChangedListener + .onPitchAdjustmentAvailableChanged(this, to + .canSetPitch()); + } + if ((to.canSetSpeed() != this.speedAdjustmentAvailable) + && (this.onSpeedAdjustmentAvailableChangedListener != null)) { + this.onSpeedAdjustmentAvailableChangedListener + .onSpeedAdjustmentAvailableChanged(this, to + .canSetSpeed()); + } + Log.d(MP_TAG, "switchMediaPlayerImpl() 625 " + this.state.toString()); + } finally { + lock.unlock(); + } + } + + /** + * Returns true if pitch can be changed at this moment + * + * @return True if pitch can be changed + */ + public boolean canSetPitch() { + lock.lock(); + try { + return this.mpi.canSetPitch(); + } finally { + lock.unlock(); + } + } + + /** + * Returns true if speed can be changed at this moment + * + * @return True if speed can be changed + */ + public boolean canSetSpeed() { + lock.lock(); + try { + return this.mpi.canSetSpeed(); + } finally { + lock.unlock(); + } + } + + protected void finalize() throws Throwable { + lock.lock(); + try { + Log.d(MP_TAG, "finalize() 626"); + this.release(); + } finally { + lock.unlock(); + } + } + + /** + * Returns the number of steps (in a musical scale) by which playback is + * currently shifted. When greater than zero, pitch is shifted up. When less + * than zero, pitch is shifted down. + * + * @return The number of steps pitch is currently shifted by + */ + public float getCurrentPitchStepsAdjustment() { + lock.lock(); + try { + return this.mpi.getCurrentPitchStepsAdjustment(); + } finally { + lock.unlock(); + } + } + + /** + * Functions identically to android.media.MediaPlayer.getCurrentPosition() + * Accurate only to frame size of encoded data (26 ms for MP3s) + * + * @return Current position (in milliseconds) + */ + public int getCurrentPosition() { + lock.lock(); + try { + return (this.lastKnownPosition = this.mpi.getCurrentPosition()); + } finally { + lock.unlock(); + } + } + + /** + * Returns the current speed multiplier. Defaults to 1.0 (normal speed) + * + * @return The current speed multiplier + */ + public float getCurrentSpeedMultiplier() { + lock.lock(); + try { + return this.mpi.getCurrentSpeedMultiplier(); + } finally { + lock.unlock(); + } + } + + /** + * Functions identically to android.media.MediaPlayer.getDuration() + * + * @return Length of the track (in milliseconds) + */ + public int getDuration() { + lock.lock(); + try { + return this.mpi.getDuration(); + } finally { + lock.unlock(); + } + } + + /** + * Get the maximum value that can be passed to setPlaybackSpeed + * + * @return The maximum speed multiplier + */ + public float getMaxSpeedMultiplier() { + lock.lock(); + try { + return this.mpi.getMaxSpeedMultiplier(); + } finally { + lock.unlock(); + } + } + + /** + * Get the minimum value that can be passed to setPlaybackSpeed + * + * @return The minimum speed multiplier + */ + public float getMinSpeedMultiplier() { + lock.lock(); + try { + return this.mpi.getMinSpeedMultiplier(); + } finally { + lock.unlock(); + } + } + + /** + * Gets the version code of the backing service + * + * @return -1 if ServiceBackedMediaPlayer is not used, 0 if the service is not + * connected, otherwise the version code retrieved from the service + */ + public int getServiceVersionCode() { + lock.lock(); + try { + if (this.mpi instanceof ServiceBackedMediaPlayer) { + return ((ServiceBackedMediaPlayer) this.mpi).getServiceVersionCode(); + } else { + return -1; + } + } finally { + lock.unlock(); + } + } + + /** + * Gets the version name of the backing service + * + * @return null if ServiceBackedMediaPlayer is not used, empty string if + * the service is not connected, otherwise the version name retrieved from + * the service + */ + public String getServiceVersionName() { + lock.lock(); + try { + if (this.mpi instanceof ServiceBackedMediaPlayer) { + return ((ServiceBackedMediaPlayer) this.mpi).getServiceVersionName(); + } else { + return null; + } + } finally { + lock.unlock(); + } + } + + /** + * Functions identically to android.media.MediaPlayer.isLooping() + * + * @return True if the track is looping + */ + public boolean isLooping() { + lock.lock(); + try { + return this.mpi.isLooping(); + } finally { + lock.unlock(); + } + } + + /** + * Functions identically to android.media.MediaPlayer.isPlaying() + * + * @return True if the track is playing + */ + public boolean isPlaying() { + lock.lock(); + try { + return this.mpi.isPlaying(); + } finally { + lock.unlock(); + } + } + + /** + * Returns true if this MediaPlayer has access to the Presto + * library + * + * @return True if the Presto library is installed + */ + public boolean isPrestoLibraryInstalled() { + if ((this.mpi == null) || (this.mpi.mContext == null)) { + return false; + } + return isPrestoLibraryInstalled(this.mpi.mContext); + } + + /** + * Open the Android Market page in the same context as this MediaPlayer + */ + public void openPrestoMarketIntent() { + if ((this.mpi != null) && (this.mpi.mContext != null)) { + openPrestoMarketIntent(this.mpi.mContext); + } + } + + /** + * Functions identically to android.media.MediaPlayer.pause() Pauses the + * track + */ + public void pause() { + lock.lock(); + try { + if (invalidServiceConnectionConfiguration()) { + setupMpi(this.mpi.mContext); + } + this.state = State.PAUSED; + this.mpi.pause(); + } finally { + lock.unlock(); + } + } + + /** + * Functions identically to android.media.MediaPlayer.prepare() Prepares the + * track. This or prepareAsync must be called before start() + */ + public void prepare() throws IllegalStateException, IOException { + lock.lock(); + try { + Log.d(MP_TAG, "prepare() 746 using " + ((this.mpi == null) ? "null (this shouldn't happen)" : this.mpi.getClass().toString()) + " state " + this.state.toString()); + Log.d(MP_TAG, "onPreparedListener is: " + ((this.onPreparedListener == null) ? "null" : "non-null")); + Log.d(MP_TAG, "preparedListener is: " + ((this.preparedListener == null) ? "null" : "non-null")); + if (invalidServiceConnectionConfiguration()) { + setupMpi(this.mpi.mContext); + } + this.mpi.prepare(); + this.state = State.PREPARED; + Log.d(MP_TAG, "prepare() finished 778"); + } finally { + lock.unlock(); + } + } + + /** + * Functions identically to android.media.MediaPlayer.prepareAsync() + * Prepares the track. This or prepare must be called before start() + */ + public void prepareAsync() { + lock.lock(); + try { + Log.d(MP_TAG, "prepareAsync() 779"); + if (invalidServiceConnectionConfiguration()) { + setupMpi(this.mpi.mContext); + } + this.state = State.PREPARING; + this.mpi.prepareAsync(); + } finally { + lock.unlock(); + } + } + + /** + * Functions identically to android.media.MediaPlayer.release() Releases the + * underlying resources used by the media player. + */ + public void release() { + lock.lock(); + try { + Log.d(MP_TAG, "Releasing MediaPlayer 791"); + + this.state = State.END; + if (this.amp != null) { + this.amp.release(); + } + if (this.sbmp != null) { + this.sbmp.release(); + } + + this.onBufferingUpdateListener = null; + this.onCompletionListener = null; + this.onErrorListener = null; + this.onInfoListener = null; + this.preparedListener = null; + this.onPitchAdjustmentAvailableChangedListener = null; + this.pitchAdjustmentAvailableChangedListener = null; + Log.d(MP_TAG, "Setting onSeekCompleteListener to null 871"); + this.onSeekCompleteListener = null; + this.onSpeedAdjustmentAvailableChangedListener = null; + this.speedAdjustmentAvailableChangedListener = null; + } finally { + lock.unlock(); + } + } + + /** + * Functions identically to android.media.MediaPlayer.reset() Resets the + * track to idle state + */ + public void reset() { + lock.lock(); + try { + this.state = State.IDLE; + this.stringDataSource = null; + this.uriDataSource = null; + this.mpi.reset(); + } finally { + lock.unlock(); + } + } + + /** + * Functions identically to android.media.MediaPlayer.seekTo(int msec) Seeks + * to msec in the track + */ + public void seekTo(int msec) throws IllegalStateException { + lock.lock(); + try { + this.mpi.seekTo(msec); + } finally { + lock.unlock(); + } + } + + /** + * Functions identically to android.media.MediaPlayer.setAudioStreamType(int + * streamtype) Sets the audio stream type. + */ + public void setAudioStreamType(int streamtype) { + lock.lock(); + try { + this.mAudioStreamType = streamtype; + this.mpi.setAudioStreamType(streamtype); + } finally { + lock.unlock(); + } + } + + /** + * Functions identically to android.media.MediaPlayer.setDataSource(Context + * context, Uri uri) Sets uri as data source in the context given + */ + public void setDataSource(Context context, Uri uri) + throws IllegalArgumentException, IllegalStateException, IOException { + lock.lock(); + try { + Log.d(MP_TAG, "In setDataSource(context, " + uri.toString() + "), using " + this.mpi.getClass().toString()); + if (invalidServiceConnectionConfiguration()) { + setupMpi(this.mpi.mContext); + } + this.state = State.INITIALIZED; + this.stringDataSource = null; + this.uriDataSource = uri; + this.mpi.setDataSource(context, uri); + } finally { + lock.unlock(); + } + } + + /** + * Functions identically to android.media.MediaPlayer.setDataSource(String + * path) Sets the data source of the track to a file given. + */ + public void setDataSource(String path) throws IllegalArgumentException, + IllegalStateException, IOException { + lock.lock(); + try { + Log.d(MP_TAG, "In setDataSource(context, " + path + ")"); + if (invalidServiceConnectionConfiguration()) { + setupMpi(this.mpi.mContext); + } + this.state = State.INITIALIZED; + this.stringDataSource = path; + this.uriDataSource = null; + this.mpi.setDataSource(path); + } finally { + lock.unlock(); + } + } + + /** + * Sets whether to use speed adjustment or not. Speed adjustment on is more + * computation-intensive than with it off. + * + * @param enableSpeedAdjustment Whether speed adjustment should be supported. + */ + public void setEnableSpeedAdjustment(boolean enableSpeedAdjustment) { + lock.lock(); + try { + this.enableSpeedAdjustment = enableSpeedAdjustment; + this.mpi.setEnableSpeedAdjustment(enableSpeedAdjustment); + } finally { + lock.unlock(); + } + } + + /** + * Functions identically to android.media.MediaPlayer.setLooping(boolean + * loop) Sets the track to loop infinitely if loop is true, play once if + * loop is false + */ + public void setLooping(boolean loop) { + lock.lock(); + try { + this.mIsLooping = loop; + this.mpi.setLooping(loop); + } finally { + lock.unlock(); + } + } + + /** + * Sets the number of steps (in a musical scale) by which playback is + * currently shifted. When greater than zero, pitch is shifted up. When less + * than zero, pitch is shifted down. + * + * @param pitchSteps The number of steps by which to shift playback + */ + public void setPitchStepsAdjustment(float pitchSteps) { + lock.lock(); + try { + this.mPitchStepsAdjustment = pitchSteps; + this.mpi.setPitchStepsAdjustment(pitchSteps); + } finally { + lock.unlock(); + } + } + + /** + * Set the algorithm to use for changing the speed and pitch of audio + * See SpeedAdjustmentAlgorithm constants for more details + * + * @param algorithm The algorithm to use. + */ + public void setSpeedAdjustmentAlgorithm(int algorithm) { + lock.lock(); + try { + this.speedAdjustmentAlgorithm = algorithm; + if (this.mpi != null) { + this.mpi.setSpeedAdjustmentAlgorithm(algorithm); + } + } finally { + lock.unlock(); + } + } + + private static float getPitchStepsAdjustment(float pitch) { + return (float) (Math.log(pitch) / (2 * Math.log(PITCH_STEP_CONSTANT))); + } + + /** + * Sets the percentage by which pitch is currently shifted. When greater + * than zero, pitch is shifted up. When less than zero, pitch is shifted + * down + * + * @param f The percentage to shift pitch + */ + public void setPlaybackPitch(float pitch) { + lock.lock(); + try { + this.mPitchStepsAdjustment = getPitchStepsAdjustment(pitch); + this.mpi.setPlaybackPitch(pitch); + } finally { + lock.unlock(); + } + } + + /** + * Set playback speed. 1.0 is normal speed, 2.0 is double speed, and so on. + * Speed should never be set to 0 or below. + * + * @param f The speed multiplier to use for further playback + */ + public void setPlaybackSpeed(float f) { + lock.lock(); + try { + this.mSpeedMultiplier = f; + this.mpi.setPlaybackSpeed(f); + } finally { + lock.unlock(); + } + } + + /** + * Sets whether to use speed adjustment or not. Speed adjustment on is more + * computation-intensive than with it off. + * + * @param enableSpeedAdjustment Whether speed adjustment should be supported. + */ + public void setUseService(boolean useService) { + lock.lock(); + try { + this.useService = useService; + setupMpi(this.mpi.mContext); + } finally { + lock.unlock(); + } + } + + /** + * Functions identically to android.media.MediaPlayer.setVolume(float + * leftVolume, float rightVolume) Sets the stereo volume + */ + public void setVolume(float leftVolume, float rightVolume) { + lock.lock(); + try { + this.mLeftVolume = leftVolume; + this.mRightVolume = rightVolume; + this.mpi.setVolume(leftVolume, rightVolume); + } finally { + lock.unlock(); + } + } + + /** + * Functions identically to android.media.MediaPlayer.setWakeMode(Context + * context, int mode) Acquires a wake lock in the context given. You must + * request the appropriate permissions in your AndroidManifest.xml file. + */ + public void setWakeMode(Context context, int mode) { + lock.lock(); + try { + this.mWakeMode = mode; + this.mpi.setWakeMode(context, mode); + } finally { + lock.unlock(); + } + } + + /** + * Functions identically to + * android.media.MediaPlayer.setOnCompletionListener(OnCompletionListener + * listener) Sets a listener to be used when a track completes playing. + */ + public void setOnBufferingUpdateListener(OnBufferingUpdateListener listener) { + lock.lock(); + try { + this.onBufferingUpdateListener = listener; + } finally { + lock.unlock(); + } + } + + /** + * Functions identically to + * android.media.MediaPlayer.setOnCompletionListener(OnCompletionListener + * listener) Sets a listener to be used when a track completes playing. + */ + public void setOnCompletionListener(OnCompletionListener listener) { + lock.lock(); + try { + this.onCompletionListener = listener; + } finally { + lock.unlock(); + } + } + + /** + * Functions identically to + * android.media.MediaPlayer.setOnErrorListener(OnErrorListener listener) + * Sets a listener to be used when a track encounters an error. + */ + public void setOnErrorListener(OnErrorListener listener) { + lock.lock(); + try { + this.onErrorListener = listener; + } finally { + lock.unlock(); + } + } + + /** + * Functions identically to + * android.media.MediaPlayer.setOnInfoListener(OnInfoListener listener) Sets + * a listener to be used when a track has info. + */ + public void setOnInfoListener(OnInfoListener listener) { + lock.lock(); + try { + this.onInfoListener = listener; + } finally { + lock.unlock(); + } + } + + /** + * Sets a listener that will fire when pitch adjustment becomes available or + * stops being available + */ + public void setOnPitchAdjustmentAvailableChangedListener( + OnPitchAdjustmentAvailableChangedListener listener) { + lock.lock(); + try { + this.pitchAdjustmentAvailableChangedListener = listener; + } finally { + lock.unlock(); + } + } + + /** + * Functions identically to + * android.media.MediaPlayer.setOnPreparedListener(OnPreparedListener + * listener) Sets a listener to be used when a track finishes preparing. + */ + public void setOnPreparedListener(OnPreparedListener listener) { + lock.lock(); + Log.d(MP_TAG, " ++++++++++++++++++++++++++++++++++++++++++++ setOnPreparedListener"); + try { + this.preparedListener = listener; + // For this one, we do not explicitly set the MediaPlayer or the + // Service listener. This is because in addition to calling the + // listener provided by the client, it's necessary to change + // state to PREPARED. See prepareAsync for implementation details + } finally { + lock.unlock(); + } + } + + /** + * Functions identically to + * android.media.MediaPlayer.setOnSeekCompleteListener + * (OnSeekCompleteListener listener) Sets a listener to be used when a track + * finishes seeking. + */ + public void setOnSeekCompleteListener(OnSeekCompleteListener listener) { + lock.lock(); + try { + this.onSeekCompleteListener = listener; + } finally { + lock.unlock(); + } + } + + /** + * Sets a listener that will fire when speed adjustment becomes available or + * stops being available + */ + public void setOnSpeedAdjustmentAvailableChangedListener( + OnSpeedAdjustmentAvailableChangedListener listener) { + lock.lock(); + try { + this.speedAdjustmentAvailableChangedListener = listener; + } finally { + lock.unlock(); + } + } + + /** + * Functions identically to android.media.MediaPlayer.start() Starts a track + * playing + */ + public void start() { + lock.lock(); + try { + Log.d(MP_TAG, "start() 1149"); + if (invalidServiceConnectionConfiguration()) { + setupMpi(this.mpi.mContext); + } + this.state = State.STARTED; + Log.d(MP_TAG, "start() 1154"); + this.mpi.start(); + } finally { + lock.unlock(); + } + } + + /** + * Functions identically to android.media.MediaPlayer.stop() Stops a track + * playing and resets its position to the start. + */ + public void stop() { + lock.lock(); + try { + if (invalidServiceConnectionConfiguration()) { + setupMpi(this.mpi.mContext); + } + this.state = State.STOPPED; + this.mpi.stop(); + } finally { + lock.unlock(); + } + } +} \ No newline at end of file diff --git a/app/src/main/java/com/aocate/media/MediaPlayerImpl.java b/core/src/main/java/com/aocate/media/MediaPlayerImpl.java similarity index 100% rename from app/src/main/java/com/aocate/media/MediaPlayerImpl.java rename to core/src/main/java/com/aocate/media/MediaPlayerImpl.java diff --git a/app/src/main/java/com/aocate/media/ServiceBackedMediaPlayer.java b/core/src/main/java/com/aocate/media/ServiceBackedMediaPlayer.java similarity index 100% rename from app/src/main/java/com/aocate/media/ServiceBackedMediaPlayer.java rename to core/src/main/java/com/aocate/media/ServiceBackedMediaPlayer.java diff --git a/app/src/main/java/com/aocate/media/SpeedAdjustmentAlgorithm.java b/core/src/main/java/com/aocate/media/SpeedAdjustmentAlgorithm.java similarity index 100% rename from app/src/main/java/com/aocate/media/SpeedAdjustmentAlgorithm.java rename to core/src/main/java/com/aocate/media/SpeedAdjustmentAlgorithm.java diff --git a/core/src/main/java/de/danoeh/antennapod/core/ApplicationCallbacks.java b/core/src/main/java/de/danoeh/antennapod/core/ApplicationCallbacks.java new file mode 100644 index 000000000..69a959ba8 --- /dev/null +++ b/core/src/main/java/de/danoeh/antennapod/core/ApplicationCallbacks.java @@ -0,0 +1,22 @@ +package de.danoeh.antennapod.core; + +import android.app.Application; +import android.content.Context; +import android.content.Intent; + +/** + * Callbacks related to the application in general + */ +public interface ApplicationCallbacks { + + /** + * Returns a non-null instance of the application class + */ + public Application getApplicationInstance(); + + /** + * Returns a non-null intent that starts the storage error + * activity. + */ + public Intent getStorageErrorActivity(Context context); +} diff --git a/app/src/main/java/de/danoeh/antennapod/core/ClientConfig.java b/core/src/main/java/de/danoeh/antennapod/core/ClientConfig.java similarity index 85% rename from app/src/main/java/de/danoeh/antennapod/core/ClientConfig.java rename to core/src/main/java/de/danoeh/antennapod/core/ClientConfig.java index bf28c17ea..e5e609f5f 100644 --- a/app/src/main/java/de/danoeh/antennapod/core/ClientConfig.java +++ b/core/src/main/java/de/danoeh/antennapod/core/ClientConfig.java @@ -11,11 +11,15 @@ public class ClientConfig { */ public static String USER_AGENT; + public static ApplicationCallbacks applicationCallbacks; + public static DownloadServiceCallbacks downloadServiceCallbacks; public static PlaybackServiceCallbacks playbackServiceCallbacks; public static GpodnetCallbacks gpodnetCallbacks; + public static FlattrCallbacks flattrCallbacks; + public static StorageCallbacks storageCallbacks; } diff --git a/app/src/main/java/de/danoeh/antennapod/core/DownloadServiceCallbacks.java b/core/src/main/java/de/danoeh/antennapod/core/DownloadServiceCallbacks.java similarity index 85% rename from app/src/main/java/de/danoeh/antennapod/core/DownloadServiceCallbacks.java rename to core/src/main/java/de/danoeh/antennapod/core/DownloadServiceCallbacks.java index 9e4ed8e2b..55b69fdec 100644 --- a/app/src/main/java/de/danoeh/antennapod/core/DownloadServiceCallbacks.java +++ b/core/src/main/java/de/danoeh/antennapod/core/DownloadServiceCallbacks.java @@ -1,6 +1,7 @@ package de.danoeh.antennapod.core; import android.app.PendingIntent; +import android.content.Context; import de.danoeh.antennapod.core.service.download.DownloadRequest; @@ -17,7 +18,7 @@ public interface DownloadServiceCallbacks { * * @return A non-null PendingIntent for the notification. */ - public PendingIntent getNotificationContentIntent(); + public PendingIntent getNotificationContentIntent(Context context); /** * Returns a PendingIntent for a notification that tells the user to enter a username @@ -28,7 +29,7 @@ public interface DownloadServiceCallbacks { * * @return A non-null PendingIntent for the notification. */ - public PendingIntent getAuthentificationNotificationContentIntent(DownloadRequest request); + public PendingIntent getAuthentificationNotificationContentIntent(Context context, DownloadRequest request); /** * Returns a PendingIntent for notification that notifies the user about the completion of downloads @@ -38,6 +39,6 @@ public interface DownloadServiceCallbacks { * * @return A non-null PendingIntent for the notification. */ - public PendingIntent getReportNotificationContentIntent(); + public PendingIntent getReportNotificationContentIntent(Context context); } diff --git a/app/src/main/java/de/danoeh/antennapod/core/FlattrCallbacks.java b/core/src/main/java/de/danoeh/antennapod/core/FlattrCallbacks.java similarity index 58% rename from app/src/main/java/de/danoeh/antennapod/core/FlattrCallbacks.java rename to core/src/main/java/de/danoeh/antennapod/core/FlattrCallbacks.java index 2dde4d8f3..cee1029d8 100644 --- a/app/src/main/java/de/danoeh/antennapod/core/FlattrCallbacks.java +++ b/core/src/main/java/de/danoeh/antennapod/core/FlattrCallbacks.java @@ -1,7 +1,11 @@ package de.danoeh.antennapod.core; +import android.app.PendingIntent; +import android.content.Context; import android.content.Intent; +import org.shredzone.flattr4j.oauth.AccessToken; + /** * Callbacks for the flattr integration of the app. */ @@ -20,5 +24,13 @@ public interface FlattrCallbacks { * @return The intent that starts the authentication activity or null * if flattr integration is disabled (i.e. flattrEnabled() == false). */ - public Intent getFlattrAuthenticationActivityIntent(); + public Intent getFlattrAuthenticationActivityIntent(Context context); + + public PendingIntent getFlattrFailedNotificationContentIntent(Context context); + + public String getFlattrAppKey(); + + public String getFlattrAppSecret(); + + public void handleFlattrAuthenticationSuccess(AccessToken token); } diff --git a/app/src/main/java/de/danoeh/antennapod/core/GpodnetCallbacks.java b/core/src/main/java/de/danoeh/antennapod/core/GpodnetCallbacks.java similarity index 92% rename from app/src/main/java/de/danoeh/antennapod/core/GpodnetCallbacks.java rename to core/src/main/java/de/danoeh/antennapod/core/GpodnetCallbacks.java index e937bf35c..6174bce29 100644 --- a/app/src/main/java/de/danoeh/antennapod/core/GpodnetCallbacks.java +++ b/core/src/main/java/de/danoeh/antennapod/core/GpodnetCallbacks.java @@ -1,6 +1,7 @@ package de.danoeh.antennapod.core; import android.app.PendingIntent; +import android.content.Context; /** * Callbacks related to the gpodder.net integration of the core module @@ -22,5 +23,5 @@ public interface GpodnetCallbacks { * @return A PendingIntent for the notification or null if gpodder.net integration * has been disabled (i.e. gpodnetEnabled() == false). */ - public PendingIntent getGpodnetSyncServiceErrorNotificationPendingIntent(); + public PendingIntent getGpodnetSyncServiceErrorNotificationPendingIntent(Context context); } diff --git a/app/src/main/java/de/danoeh/antennapod/core/PlaybackServiceCallbacks.java b/core/src/main/java/de/danoeh/antennapod/core/PlaybackServiceCallbacks.java similarity index 81% rename from app/src/main/java/de/danoeh/antennapod/core/PlaybackServiceCallbacks.java rename to core/src/main/java/de/danoeh/antennapod/core/PlaybackServiceCallbacks.java index a74c441c4..e37c8fcfd 100644 --- a/app/src/main/java/de/danoeh/antennapod/core/PlaybackServiceCallbacks.java +++ b/core/src/main/java/de/danoeh/antennapod/core/PlaybackServiceCallbacks.java @@ -1,5 +1,6 @@ package de.danoeh.antennapod.core; +import android.content.Context; import android.content.Intent; import de.danoeh.antennapod.core.feed.MediaType; @@ -16,5 +17,5 @@ public interface PlaybackServiceCallbacks { * @param mediaType The type of media that is being played. * @return A non-null activity intent. */ - public Intent getPlayerActivityIntent(MediaType mediaType); + public Intent getPlayerActivityIntent(Context context, MediaType mediaType); } diff --git a/app/src/main/java/de/danoeh/antennapod/core/StorageCallbacks.java b/core/src/main/java/de/danoeh/antennapod/core/StorageCallbacks.java similarity index 100% rename from app/src/main/java/de/danoeh/antennapod/core/StorageCallbacks.java rename to core/src/main/java/de/danoeh/antennapod/core/StorageCallbacks.java diff --git a/app/src/main/java/de/danoeh/antennapod/core/asynctask/DownloadObserver.java b/core/src/main/java/de/danoeh/antennapod/core/asynctask/DownloadObserver.java similarity index 99% rename from app/src/main/java/de/danoeh/antennapod/core/asynctask/DownloadObserver.java rename to core/src/main/java/de/danoeh/antennapod/core/asynctask/DownloadObserver.java index 8b3635af8..a13130082 100644 --- a/app/src/main/java/de/danoeh/antennapod/core/asynctask/DownloadObserver.java +++ b/core/src/main/java/de/danoeh/antennapod/core/asynctask/DownloadObserver.java @@ -8,7 +8,7 @@ import android.util.Log; import org.apache.commons.lang3.Validate; -import de.danoeh.antennapod.BuildConfig; +import de.danoeh.antennapod.core.BuildConfig; import de.danoeh.antennapod.core.service.download.DownloadService; import de.danoeh.antennapod.core.service.download.Downloader; diff --git a/app/src/main/java/de/danoeh/antennapod/core/asynctask/FeedRemover.java b/core/src/main/java/de/danoeh/antennapod/core/asynctask/FeedRemover.java similarity index 97% rename from app/src/main/java/de/danoeh/antennapod/core/asynctask/FeedRemover.java rename to core/src/main/java/de/danoeh/antennapod/core/asynctask/FeedRemover.java index 2201dfbe7..255b95119 100644 --- a/app/src/main/java/de/danoeh/antennapod/core/asynctask/FeedRemover.java +++ b/core/src/main/java/de/danoeh/antennapod/core/asynctask/FeedRemover.java @@ -6,7 +6,7 @@ import android.content.Context; import android.content.DialogInterface; import android.content.DialogInterface.OnCancelListener; import android.os.AsyncTask; -import de.danoeh.antennapod.R; +import de.danoeh.antennapod.core.R; import de.danoeh.antennapod.core.feed.Feed; import de.danoeh.antennapod.core.storage.DBWriter; diff --git a/app/src/main/java/de/danoeh/antennapod/core/asynctask/FlattrClickWorker.java b/core/src/main/java/de/danoeh/antennapod/core/asynctask/FlattrClickWorker.java similarity index 95% rename from app/src/main/java/de/danoeh/antennapod/core/asynctask/FlattrClickWorker.java rename to core/src/main/java/de/danoeh/antennapod/core/asynctask/FlattrClickWorker.java index 44ad91981..5d2d5d441 100644 --- a/app/src/main/java/de/danoeh/antennapod/core/asynctask/FlattrClickWorker.java +++ b/core/src/main/java/de/danoeh/antennapod/core/asynctask/FlattrClickWorker.java @@ -5,7 +5,6 @@ import android.app.Notification; import android.app.NotificationManager; import android.app.PendingIntent; import android.content.Context; -import android.content.Intent; import android.os.AsyncTask; import android.support.v4.app.NotificationCompat; import android.util.Log; @@ -19,10 +18,9 @@ import java.util.List; import java.util.concurrent.ExecutionException; import java.util.concurrent.Future; -import de.danoeh.antennapod.BuildConfig; -import de.danoeh.antennapod.R; -import de.danoeh.antennapod.activity.FlattrAuthActivity; -import de.danoeh.antennapod.activity.MainActivity; +import de.danoeh.antennapod.core.BuildConfig; +import de.danoeh.antennapod.core.ClientConfig; +import de.danoeh.antennapod.core.R; import de.danoeh.antennapod.core.storage.DBReader; import de.danoeh.antennapod.core.storage.DBWriter; import de.danoeh.antennapod.core.util.NetworkUtils; @@ -177,7 +175,8 @@ public class FlattrClickWorker extends AsyncTask { + private static final String TAG = "FlattrTokenFetcher"; + Context context; + AndroidAuthenticator auth; + AccessToken token; + Uri uri; + ProgressDialog dialog; + FlattrException exception; + + public FlattrTokenFetcher(Context context, AndroidAuthenticator auth, Uri uri) { + super(); + this.context = context; + this.auth = auth; + this.uri = uri; + } + + @Override + protected void onPostExecute(AccessToken result) { + if (result != null) { + FlattrUtils.storeToken(result); + } + dialog.dismiss(); + if (exception == null) { + ClientConfig.flattrCallbacks.handleFlattrAuthenticationSuccess(result); + } else { + FlattrUtils.showErrorDialog(context, exception.getMessage()); + } + } + + + @Override + protected void onPreExecute() { + super.onPreExecute(); + dialog = new ProgressDialog(context); + dialog.setMessage(context.getString(R.string.processing_label)); + dialog.setIndeterminate(true); + dialog.setCancelable(false); + dialog.show(); + } + + + @Override + protected AccessToken doInBackground(Void... params) { + try { + token = auth.fetchAccessToken(uri); + } catch (FlattrException e) { + e.printStackTrace(); + exception = e; + return null; + } + if (token != null) { + if (BuildConfig.DEBUG) Log.d(TAG, "Successfully got token"); + return token; + } else { + Log.w(TAG, "Flattr token was null"); + return null; + } + } + + @SuppressLint("NewApi") + public void executeAsync() { + if (android.os.Build.VERSION.SDK_INT > android.os.Build.VERSION_CODES.GINGERBREAD_MR1) { + executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR); + } else { + execute(); + } + } + +} diff --git a/app/src/main/java/de/danoeh/antennapod/core/asynctask/PicassoImageResource.java b/core/src/main/java/de/danoeh/antennapod/core/asynctask/PicassoImageResource.java similarity index 100% rename from app/src/main/java/de/danoeh/antennapod/core/asynctask/PicassoImageResource.java rename to core/src/main/java/de/danoeh/antennapod/core/asynctask/PicassoImageResource.java diff --git a/app/src/main/java/de/danoeh/antennapod/core/asynctask/PicassoProvider.java b/core/src/main/java/de/danoeh/antennapod/core/asynctask/PicassoProvider.java similarity index 100% rename from app/src/main/java/de/danoeh/antennapod/core/asynctask/PicassoProvider.java rename to core/src/main/java/de/danoeh/antennapod/core/asynctask/PicassoProvider.java diff --git a/app/src/main/java/de/danoeh/antennapod/core/backup/OpmlBackupAgent.java b/core/src/main/java/de/danoeh/antennapod/core/backup/OpmlBackupAgent.java similarity index 99% rename from app/src/main/java/de/danoeh/antennapod/core/backup/OpmlBackupAgent.java rename to core/src/main/java/de/danoeh/antennapod/core/backup/OpmlBackupAgent.java index 72b5066b3..1535e2e9a 100644 --- a/app/src/main/java/de/danoeh/antennapod/core/backup/OpmlBackupAgent.java +++ b/core/src/main/java/de/danoeh/antennapod/core/backup/OpmlBackupAgent.java @@ -8,7 +8,7 @@ import android.content.Context; import android.os.ParcelFileDescriptor; import android.util.Log; -import de.danoeh.antennapod.BuildConfig; +import de.danoeh.antennapod.core.BuildConfig; import org.xmlpull.v1.XmlPullParserException; import java.io.ByteArrayOutputStream; diff --git a/app/src/main/java/de/danoeh/antennapod/core/dialog/ConfirmationDialog.java b/core/src/main/java/de/danoeh/antennapod/core/dialog/ConfirmationDialog.java similarity index 95% rename from app/src/main/java/de/danoeh/antennapod/core/dialog/ConfirmationDialog.java rename to core/src/main/java/de/danoeh/antennapod/core/dialog/ConfirmationDialog.java index e51d70708..ba1add895 100644 --- a/app/src/main/java/de/danoeh/antennapod/core/dialog/ConfirmationDialog.java +++ b/core/src/main/java/de/danoeh/antennapod/core/dialog/ConfirmationDialog.java @@ -4,8 +4,8 @@ import android.app.AlertDialog; import android.content.Context; import android.content.DialogInterface; import android.util.Log; -import de.danoeh.antennapod.BuildConfig; -import de.danoeh.antennapod.R; +import de.danoeh.antennapod.core.BuildConfig; +import de.danoeh.antennapod.core.R; /** * Creates an AlertDialog which asks the user to confirm something. Other diff --git a/app/src/main/java/de/danoeh/antennapod/core/dialog/DownloadRequestErrorDialogCreator.java b/core/src/main/java/de/danoeh/antennapod/core/dialog/DownloadRequestErrorDialogCreator.java similarity index 96% rename from app/src/main/java/de/danoeh/antennapod/core/dialog/DownloadRequestErrorDialogCreator.java rename to core/src/main/java/de/danoeh/antennapod/core/dialog/DownloadRequestErrorDialogCreator.java index a1c3a4c6a..3d174bd8e 100644 --- a/app/src/main/java/de/danoeh/antennapod/core/dialog/DownloadRequestErrorDialogCreator.java +++ b/core/src/main/java/de/danoeh/antennapod/core/dialog/DownloadRequestErrorDialogCreator.java @@ -3,7 +3,7 @@ package de.danoeh.antennapod.core.dialog; import android.app.AlertDialog; import android.content.Context; import android.content.DialogInterface; -import de.danoeh.antennapod.R; +import de.danoeh.antennapod.core.R; /** Creates Alert Dialogs if a DownloadRequestException has happened. */ public class DownloadRequestErrorDialogCreator { diff --git a/app/src/main/java/de/danoeh/antennapod/core/feed/Chapter.java b/core/src/main/java/de/danoeh/antennapod/core/feed/Chapter.java similarity index 100% rename from app/src/main/java/de/danoeh/antennapod/core/feed/Chapter.java rename to core/src/main/java/de/danoeh/antennapod/core/feed/Chapter.java diff --git a/app/src/main/java/de/danoeh/antennapod/core/feed/EventDistributor.java b/core/src/main/java/de/danoeh/antennapod/core/feed/EventDistributor.java similarity index 98% rename from app/src/main/java/de/danoeh/antennapod/core/feed/EventDistributor.java rename to core/src/main/java/de/danoeh/antennapod/core/feed/EventDistributor.java index 65c55a361..f8815dcf0 100644 --- a/app/src/main/java/de/danoeh/antennapod/core/feed/EventDistributor.java +++ b/core/src/main/java/de/danoeh/antennapod/core/feed/EventDistributor.java @@ -5,7 +5,7 @@ import android.util.Log; import org.apache.commons.lang3.Validate; -import de.danoeh.antennapod.BuildConfig; +import de.danoeh.antennapod.core.BuildConfig; import java.util.AbstractQueue; import java.util.Observable; diff --git a/app/src/main/java/de/danoeh/antennapod/core/feed/Feed.java b/core/src/main/java/de/danoeh/antennapod/core/feed/Feed.java similarity index 100% rename from app/src/main/java/de/danoeh/antennapod/core/feed/Feed.java rename to core/src/main/java/de/danoeh/antennapod/core/feed/Feed.java diff --git a/app/src/main/java/de/danoeh/antennapod/core/feed/FeedComponent.java b/core/src/main/java/de/danoeh/antennapod/core/feed/FeedComponent.java similarity index 100% rename from app/src/main/java/de/danoeh/antennapod/core/feed/FeedComponent.java rename to core/src/main/java/de/danoeh/antennapod/core/feed/FeedComponent.java diff --git a/app/src/main/java/de/danoeh/antennapod/core/feed/FeedFile.java b/core/src/main/java/de/danoeh/antennapod/core/feed/FeedFile.java similarity index 100% rename from app/src/main/java/de/danoeh/antennapod/core/feed/FeedFile.java rename to core/src/main/java/de/danoeh/antennapod/core/feed/FeedFile.java diff --git a/app/src/main/java/de/danoeh/antennapod/core/feed/FeedImage.java b/core/src/main/java/de/danoeh/antennapod/core/feed/FeedImage.java similarity index 100% rename from app/src/main/java/de/danoeh/antennapod/core/feed/FeedImage.java rename to core/src/main/java/de/danoeh/antennapod/core/feed/FeedImage.java diff --git a/app/src/main/java/de/danoeh/antennapod/core/feed/FeedItem.java b/core/src/main/java/de/danoeh/antennapod/core/feed/FeedItem.java similarity index 97% rename from app/src/main/java/de/danoeh/antennapod/core/feed/FeedItem.java rename to core/src/main/java/de/danoeh/antennapod/core/feed/FeedItem.java index 55143b13b..8a513de43 100644 --- a/app/src/main/java/de/danoeh/antennapod/core/feed/FeedItem.java +++ b/core/src/main/java/de/danoeh/antennapod/core/feed/FeedItem.java @@ -2,17 +2,17 @@ package de.danoeh.antennapod.core.feed; import android.net.Uri; -import de.danoeh.antennapod.PodcastApp; +import java.util.Date; +import java.util.List; +import java.util.concurrent.Callable; + +import de.danoeh.antennapod.core.ClientConfig; import de.danoeh.antennapod.core.asynctask.PicassoImageResource; import de.danoeh.antennapod.core.storage.DBReader; import de.danoeh.antennapod.core.util.ShownotesProvider; import de.danoeh.antennapod.core.util.flattr.FlattrStatus; import de.danoeh.antennapod.core.util.flattr.FlattrThing; -import java.util.Date; -import java.util.List; -import java.util.concurrent.Callable; - /** * Data Object for a XML message * @@ -253,7 +253,7 @@ public class FeedItem extends FeedComponent implements ShownotesProvider, Flattr public String call() throws Exception { if (contentEncoded == null || description == null) { - DBReader.loadExtraInformationOfFeedItem(PodcastApp.getInstance(), FeedItem.this); + DBReader.loadExtraInformationOfFeedItem(ClientConfig.applicationCallbacks.getApplicationInstance(), FeedItem.this); } return (contentEncoded != null) ? contentEncoded : description; diff --git a/app/src/main/java/de/danoeh/antennapod/core/feed/FeedMedia.java b/core/src/main/java/de/danoeh/antennapod/core/feed/FeedMedia.java similarity index 94% rename from app/src/main/java/de/danoeh/antennapod/core/feed/FeedMedia.java rename to core/src/main/java/de/danoeh/antennapod/core/feed/FeedMedia.java index ab87e822d..37186ee79 100644 --- a/app/src/main/java/de/danoeh/antennapod/core/feed/FeedMedia.java +++ b/core/src/main/java/de/danoeh/antennapod/core/feed/FeedMedia.java @@ -10,7 +10,7 @@ import java.util.Date; import java.util.List; import java.util.concurrent.Callable; -import de.danoeh.antennapod.PodcastApp; +import de.danoeh.antennapod.core.ClientConfig; import de.danoeh.antennapod.core.preferences.PlaybackPreferences; import de.danoeh.antennapod.core.storage.DBReader; import de.danoeh.antennapod.core.storage.DBWriter; @@ -239,7 +239,7 @@ public class FeedMedia extends FeedFile implements Playable { @Override public void loadMetadata() throws PlayableException { if (item == null && itemID != 0) { - item = DBReader.getFeedItem(PodcastApp.getInstance(), itemID); + item = DBReader.getFeedItem(ClientConfig.applicationCallbacks.getApplicationInstance(), itemID); } } @@ -248,7 +248,7 @@ public class FeedMedia extends FeedFile implements Playable { if (getChapters() == null && !localFileAvailable()) { ChapterUtils.loadChaptersFromStreamUrl(this); if (getChapters() != null && item != null) { - DBWriter.setFeedItem(PodcastApp.getInstance(), + DBWriter.setFeedItem(ClientConfig.applicationCallbacks.getApplicationInstance(), item); } } @@ -327,7 +327,7 @@ public class FeedMedia extends FeedFile implements Playable { @Override public void saveCurrentPosition(SharedPreferences pref, int newPosition) { setPosition(newPosition); - DBWriter.setFeedMediaPlaybackInformation(PodcastApp.getInstance(), this); + DBWriter.setFeedMediaPlaybackInformation(ClientConfig.applicationCallbacks.getApplicationInstance(), this); } @Override @@ -355,10 +355,12 @@ public class FeedMedia extends FeedFile implements Playable { @Override public String call() throws Exception { if (item == null) { - item = DBReader.getFeedItem(PodcastApp.getInstance(), itemID); + item = DBReader.getFeedItem( + ClientConfig.applicationCallbacks.getApplicationInstance(), itemID); } if (item.getContentEncoded() == null || item.getDescription() == null) { - DBReader.loadExtraInformationOfFeedItem(PodcastApp.getInstance(), item); + DBReader.loadExtraInformationOfFeedItem( + ClientConfig.applicationCallbacks.getApplicationInstance(), item); } return (item.getContentEncoded() != null) ? item.getContentEncoded() : item.getDescription(); diff --git a/app/src/main/java/de/danoeh/antennapod/core/feed/FeedPreferences.java b/core/src/main/java/de/danoeh/antennapod/core/feed/FeedPreferences.java similarity index 100% rename from app/src/main/java/de/danoeh/antennapod/core/feed/FeedPreferences.java rename to core/src/main/java/de/danoeh/antennapod/core/feed/FeedPreferences.java diff --git a/app/src/main/java/de/danoeh/antennapod/core/feed/ID3Chapter.java b/core/src/main/java/de/danoeh/antennapod/core/feed/ID3Chapter.java similarity index 100% rename from app/src/main/java/de/danoeh/antennapod/core/feed/ID3Chapter.java rename to core/src/main/java/de/danoeh/antennapod/core/feed/ID3Chapter.java diff --git a/app/src/main/java/de/danoeh/antennapod/core/feed/MediaType.java b/core/src/main/java/de/danoeh/antennapod/core/feed/MediaType.java similarity index 100% rename from app/src/main/java/de/danoeh/antennapod/core/feed/MediaType.java rename to core/src/main/java/de/danoeh/antennapod/core/feed/MediaType.java diff --git a/app/src/main/java/de/danoeh/antennapod/core/feed/SearchResult.java b/core/src/main/java/de/danoeh/antennapod/core/feed/SearchResult.java similarity index 100% rename from app/src/main/java/de/danoeh/antennapod/core/feed/SearchResult.java rename to core/src/main/java/de/danoeh/antennapod/core/feed/SearchResult.java diff --git a/app/src/main/java/de/danoeh/antennapod/core/feed/SimpleChapter.java b/core/src/main/java/de/danoeh/antennapod/core/feed/SimpleChapter.java similarity index 100% rename from app/src/main/java/de/danoeh/antennapod/core/feed/SimpleChapter.java rename to core/src/main/java/de/danoeh/antennapod/core/feed/SimpleChapter.java diff --git a/app/src/main/java/de/danoeh/antennapod/core/feed/VorbisCommentChapter.java b/core/src/main/java/de/danoeh/antennapod/core/feed/VorbisCommentChapter.java similarity index 100% rename from app/src/main/java/de/danoeh/antennapod/core/feed/VorbisCommentChapter.java rename to core/src/main/java/de/danoeh/antennapod/core/feed/VorbisCommentChapter.java diff --git a/app/src/main/java/de/danoeh/antennapod/core/gpoddernet/GpodnetService.java b/core/src/main/java/de/danoeh/antennapod/core/gpoddernet/GpodnetService.java similarity index 100% rename from app/src/main/java/de/danoeh/antennapod/core/gpoddernet/GpodnetService.java rename to core/src/main/java/de/danoeh/antennapod/core/gpoddernet/GpodnetService.java diff --git a/app/src/main/java/de/danoeh/antennapod/core/gpoddernet/GpodnetServiceAuthenticationException.java b/core/src/main/java/de/danoeh/antennapod/core/gpoddernet/GpodnetServiceAuthenticationException.java similarity index 100% rename from app/src/main/java/de/danoeh/antennapod/core/gpoddernet/GpodnetServiceAuthenticationException.java rename to core/src/main/java/de/danoeh/antennapod/core/gpoddernet/GpodnetServiceAuthenticationException.java diff --git a/app/src/main/java/de/danoeh/antennapod/core/gpoddernet/GpodnetServiceBadStatusCodeException.java b/core/src/main/java/de/danoeh/antennapod/core/gpoddernet/GpodnetServiceBadStatusCodeException.java similarity index 100% rename from app/src/main/java/de/danoeh/antennapod/core/gpoddernet/GpodnetServiceBadStatusCodeException.java rename to core/src/main/java/de/danoeh/antennapod/core/gpoddernet/GpodnetServiceBadStatusCodeException.java diff --git a/app/src/main/java/de/danoeh/antennapod/core/gpoddernet/GpodnetServiceException.java b/core/src/main/java/de/danoeh/antennapod/core/gpoddernet/GpodnetServiceException.java similarity index 100% rename from app/src/main/java/de/danoeh/antennapod/core/gpoddernet/GpodnetServiceException.java rename to core/src/main/java/de/danoeh/antennapod/core/gpoddernet/GpodnetServiceException.java diff --git a/app/src/main/java/de/danoeh/antennapod/core/gpoddernet/model/GpodnetDevice.java b/core/src/main/java/de/danoeh/antennapod/core/gpoddernet/model/GpodnetDevice.java similarity index 100% rename from app/src/main/java/de/danoeh/antennapod/core/gpoddernet/model/GpodnetDevice.java rename to core/src/main/java/de/danoeh/antennapod/core/gpoddernet/model/GpodnetDevice.java diff --git a/app/src/main/java/de/danoeh/antennapod/core/gpoddernet/model/GpodnetPodcast.java b/core/src/main/java/de/danoeh/antennapod/core/gpoddernet/model/GpodnetPodcast.java similarity index 100% rename from app/src/main/java/de/danoeh/antennapod/core/gpoddernet/model/GpodnetPodcast.java rename to core/src/main/java/de/danoeh/antennapod/core/gpoddernet/model/GpodnetPodcast.java diff --git a/app/src/main/java/de/danoeh/antennapod/core/gpoddernet/model/GpodnetSubscriptionChange.java b/core/src/main/java/de/danoeh/antennapod/core/gpoddernet/model/GpodnetSubscriptionChange.java similarity index 100% rename from app/src/main/java/de/danoeh/antennapod/core/gpoddernet/model/GpodnetSubscriptionChange.java rename to core/src/main/java/de/danoeh/antennapod/core/gpoddernet/model/GpodnetSubscriptionChange.java diff --git a/app/src/main/java/de/danoeh/antennapod/core/gpoddernet/model/GpodnetTag.java b/core/src/main/java/de/danoeh/antennapod/core/gpoddernet/model/GpodnetTag.java similarity index 100% rename from app/src/main/java/de/danoeh/antennapod/core/gpoddernet/model/GpodnetTag.java rename to core/src/main/java/de/danoeh/antennapod/core/gpoddernet/model/GpodnetTag.java diff --git a/app/src/main/java/de/danoeh/antennapod/core/gpoddernet/model/GpodnetUploadChangesResponse.java b/core/src/main/java/de/danoeh/antennapod/core/gpoddernet/model/GpodnetUploadChangesResponse.java similarity index 100% rename from app/src/main/java/de/danoeh/antennapod/core/gpoddernet/model/GpodnetUploadChangesResponse.java rename to core/src/main/java/de/danoeh/antennapod/core/gpoddernet/model/GpodnetUploadChangesResponse.java diff --git a/app/src/main/java/de/danoeh/antennapod/core/opml/OpmlElement.java b/core/src/main/java/de/danoeh/antennapod/core/opml/OpmlElement.java similarity index 100% rename from app/src/main/java/de/danoeh/antennapod/core/opml/OpmlElement.java rename to core/src/main/java/de/danoeh/antennapod/core/opml/OpmlElement.java diff --git a/app/src/main/java/de/danoeh/antennapod/core/opml/OpmlReader.java b/core/src/main/java/de/danoeh/antennapod/core/opml/OpmlReader.java similarity index 98% rename from app/src/main/java/de/danoeh/antennapod/core/opml/OpmlReader.java rename to core/src/main/java/de/danoeh/antennapod/core/opml/OpmlReader.java index aa484954d..775129d09 100644 --- a/app/src/main/java/de/danoeh/antennapod/core/opml/OpmlReader.java +++ b/core/src/main/java/de/danoeh/antennapod/core/opml/OpmlReader.java @@ -1,7 +1,7 @@ package de.danoeh.antennapod.core.opml; import android.util.Log; -import de.danoeh.antennapod.BuildConfig; +import de.danoeh.antennapod.core.BuildConfig; import org.xmlpull.v1.XmlPullParser; import org.xmlpull.v1.XmlPullParserException; import org.xmlpull.v1.XmlPullParserFactory; diff --git a/app/src/main/java/de/danoeh/antennapod/core/opml/OpmlSymbols.java b/core/src/main/java/de/danoeh/antennapod/core/opml/OpmlSymbols.java similarity index 100% rename from app/src/main/java/de/danoeh/antennapod/core/opml/OpmlSymbols.java rename to core/src/main/java/de/danoeh/antennapod/core/opml/OpmlSymbols.java diff --git a/app/src/main/java/de/danoeh/antennapod/core/opml/OpmlWriter.java b/core/src/main/java/de/danoeh/antennapod/core/opml/OpmlWriter.java similarity index 97% rename from app/src/main/java/de/danoeh/antennapod/core/opml/OpmlWriter.java rename to core/src/main/java/de/danoeh/antennapod/core/opml/OpmlWriter.java index fe14b4954..641190f62 100644 --- a/app/src/main/java/de/danoeh/antennapod/core/opml/OpmlWriter.java +++ b/core/src/main/java/de/danoeh/antennapod/core/opml/OpmlWriter.java @@ -2,7 +2,7 @@ package de.danoeh.antennapod.core.opml; import android.util.Log; import android.util.Xml; -import de.danoeh.antennapod.BuildConfig; +import de.danoeh.antennapod.core.BuildConfig; import de.danoeh.antennapod.core.feed.Feed; import org.xmlpull.v1.XmlSerializer; diff --git a/app/src/main/java/de/danoeh/antennapod/core/preferences/GpodnetPreferences.java b/core/src/main/java/de/danoeh/antennapod/core/preferences/GpodnetPreferences.java similarity index 95% rename from app/src/main/java/de/danoeh/antennapod/core/preferences/GpodnetPreferences.java rename to core/src/main/java/de/danoeh/antennapod/core/preferences/GpodnetPreferences.java index 716a74f53..af04df017 100644 --- a/app/src/main/java/de/danoeh/antennapod/core/preferences/GpodnetPreferences.java +++ b/core/src/main/java/de/danoeh/antennapod/core/preferences/GpodnetPreferences.java @@ -3,16 +3,17 @@ package de.danoeh.antennapod.core.preferences; import android.content.Context; import android.content.SharedPreferences; import android.util.Log; -import de.danoeh.antennapod.BuildConfig; -import de.danoeh.antennapod.PodcastApp; -import de.danoeh.antennapod.core.gpoddernet.GpodnetService; -import de.danoeh.antennapod.core.service.GpodnetSyncService; import java.util.Collection; import java.util.HashSet; import java.util.Set; import java.util.concurrent.locks.ReentrantLock; +import de.danoeh.antennapod.core.BuildConfig; +import de.danoeh.antennapod.core.ClientConfig; +import de.danoeh.antennapod.core.gpoddernet.GpodnetService; +import de.danoeh.antennapod.core.service.GpodnetSyncService; + /** * Manages preferences for accessing gpodder.net service */ @@ -48,7 +49,7 @@ public class GpodnetPreferences { private static boolean preferencesLoaded = false; private static SharedPreferences getPreferences() { - return PodcastApp.getInstance().getSharedPreferences(PREF_NAME, Context.MODE_PRIVATE); + return ClientConfig.applicationCallbacks.getApplicationInstance().getSharedPreferences(PREF_NAME, Context.MODE_PRIVATE); } private static synchronized void ensurePreferencesLoaded() { @@ -148,7 +149,7 @@ public class GpodnetPreferences { writePreference(PREF_SYNC_REMOVED, removedFeeds); } feedListLock.unlock(); - GpodnetSyncService.sendSyncIntent(PodcastApp.getInstance()); + GpodnetSyncService.sendSyncIntent(ClientConfig.applicationCallbacks.getApplicationInstance()); } public static void addRemovedFeed(String feed) { @@ -161,7 +162,7 @@ public class GpodnetPreferences { writePreference(PREF_SYNC_ADDED, addedFeeds); } feedListLock.unlock(); - GpodnetSyncService.sendSyncIntent(PodcastApp.getInstance()); + GpodnetSyncService.sendSyncIntent(ClientConfig.applicationCallbacks.getApplicationInstance()); } public static Set getAddedFeedsCopy() { diff --git a/app/src/main/java/de/danoeh/antennapod/core/preferences/PlaybackPreferences.java b/core/src/main/java/de/danoeh/antennapod/core/preferences/PlaybackPreferences.java similarity index 99% rename from app/src/main/java/de/danoeh/antennapod/core/preferences/PlaybackPreferences.java rename to core/src/main/java/de/danoeh/antennapod/core/preferences/PlaybackPreferences.java index 756b4067c..d88543f73 100644 --- a/app/src/main/java/de/danoeh/antennapod/core/preferences/PlaybackPreferences.java +++ b/core/src/main/java/de/danoeh/antennapod/core/preferences/PlaybackPreferences.java @@ -7,7 +7,7 @@ import android.util.Log; import org.apache.commons.lang3.Validate; -import de.danoeh.antennapod.BuildConfig; +import de.danoeh.antennapod.core.BuildConfig; /** * Provides access to preferences set by the playback service. A private diff --git a/app/src/main/java/de/danoeh/antennapod/core/preferences/UserPreferences.java b/core/src/main/java/de/danoeh/antennapod/core/preferences/UserPreferences.java similarity index 99% rename from app/src/main/java/de/danoeh/antennapod/core/preferences/UserPreferences.java rename to core/src/main/java/de/danoeh/antennapod/core/preferences/UserPreferences.java index 1669fc601..5cac4837d 100644 --- a/app/src/main/java/de/danoeh/antennapod/core/preferences/UserPreferences.java +++ b/core/src/main/java/de/danoeh/antennapod/core/preferences/UserPreferences.java @@ -19,8 +19,8 @@ import java.util.LinkedList; import java.util.List; import java.util.concurrent.TimeUnit; -import de.danoeh.antennapod.BuildConfig; -import de.danoeh.antennapod.R; +import de.danoeh.antennapod.core.BuildConfig; +import de.danoeh.antennapod.core.R; import de.danoeh.antennapod.core.receiver.FeedUpdateReceiver; /** diff --git a/app/src/main/java/de/danoeh/antennapod/core/receiver/AlarmUpdateReceiver.java b/core/src/main/java/de/danoeh/antennapod/core/receiver/AlarmUpdateReceiver.java similarity index 95% rename from app/src/main/java/de/danoeh/antennapod/core/receiver/AlarmUpdateReceiver.java rename to core/src/main/java/de/danoeh/antennapod/core/receiver/AlarmUpdateReceiver.java index 2057b0881..0777a7a2e 100644 --- a/app/src/main/java/de/danoeh/antennapod/core/receiver/AlarmUpdateReceiver.java +++ b/core/src/main/java/de/danoeh/antennapod/core/receiver/AlarmUpdateReceiver.java @@ -7,7 +7,7 @@ import android.util.Log; import org.apache.commons.lang3.StringUtils; -import de.danoeh.antennapod.BuildConfig; +import de.danoeh.antennapod.core.BuildConfig; import de.danoeh.antennapod.core.preferences.UserPreferences; /** Listens for events that make it necessary to reset the update alarm. */ diff --git a/app/src/main/java/de/danoeh/antennapod/core/receiver/ConnectivityActionReceiver.java b/core/src/main/java/de/danoeh/antennapod/core/receiver/ConnectivityActionReceiver.java similarity index 97% rename from app/src/main/java/de/danoeh/antennapod/core/receiver/ConnectivityActionReceiver.java rename to core/src/main/java/de/danoeh/antennapod/core/receiver/ConnectivityActionReceiver.java index e6b1a1b49..6a9a4166a 100644 --- a/app/src/main/java/de/danoeh/antennapod/core/receiver/ConnectivityActionReceiver.java +++ b/core/src/main/java/de/danoeh/antennapod/core/receiver/ConnectivityActionReceiver.java @@ -9,7 +9,7 @@ import android.util.Log; import org.apache.commons.lang3.StringUtils; -import de.danoeh.antennapod.BuildConfig; +import de.danoeh.antennapod.core.BuildConfig; import de.danoeh.antennapod.core.storage.DBTasks; import de.danoeh.antennapod.core.storage.DownloadRequester; import de.danoeh.antennapod.core.util.NetworkUtils; diff --git a/app/src/main/java/de/danoeh/antennapod/core/receiver/FeedUpdateReceiver.java b/core/src/main/java/de/danoeh/antennapod/core/receiver/FeedUpdateReceiver.java similarity index 97% rename from app/src/main/java/de/danoeh/antennapod/core/receiver/FeedUpdateReceiver.java rename to core/src/main/java/de/danoeh/antennapod/core/receiver/FeedUpdateReceiver.java index ec63bc2ae..6ce30763d 100644 --- a/app/src/main/java/de/danoeh/antennapod/core/receiver/FeedUpdateReceiver.java +++ b/core/src/main/java/de/danoeh/antennapod/core/receiver/FeedUpdateReceiver.java @@ -9,7 +9,7 @@ import android.util.Log; import org.apache.commons.lang3.StringUtils; -import de.danoeh.antennapod.BuildConfig; +import de.danoeh.antennapod.core.BuildConfig; import de.danoeh.antennapod.core.preferences.UserPreferences; import de.danoeh.antennapod.core.storage.DBTasks; diff --git a/app/src/main/java/de/danoeh/antennapod/core/receiver/MediaButtonReceiver.java b/core/src/main/java/de/danoeh/antennapod/core/receiver/MediaButtonReceiver.java similarity index 96% rename from app/src/main/java/de/danoeh/antennapod/core/receiver/MediaButtonReceiver.java rename to core/src/main/java/de/danoeh/antennapod/core/receiver/MediaButtonReceiver.java index be54148cf..a900248d2 100644 --- a/app/src/main/java/de/danoeh/antennapod/core/receiver/MediaButtonReceiver.java +++ b/core/src/main/java/de/danoeh/antennapod/core/receiver/MediaButtonReceiver.java @@ -5,7 +5,7 @@ import android.content.Context; import android.content.Intent; import android.util.Log; import android.view.KeyEvent; -import de.danoeh.antennapod.BuildConfig; +import de.danoeh.antennapod.core.BuildConfig; import de.danoeh.antennapod.core.service.playback.PlaybackService; /** Receives media button events. */ diff --git a/app/src/main/java/de/danoeh/antennapod/core/service/GpodnetSyncService.java b/core/src/main/java/de/danoeh/antennapod/core/service/GpodnetSyncService.java similarity index 89% rename from app/src/main/java/de/danoeh/antennapod/core/service/GpodnetSyncService.java rename to core/src/main/java/de/danoeh/antennapod/core/service/GpodnetSyncService.java index 8a2659029..0f2a81dfb 100644 --- a/app/src/main/java/de/danoeh/antennapod/core/service/GpodnetSyncService.java +++ b/core/src/main/java/de/danoeh/antennapod/core/service/GpodnetSyncService.java @@ -9,9 +9,15 @@ import android.content.Intent; import android.os.IBinder; import android.support.v4.app.NotificationCompat; import android.util.Log; -import de.danoeh.antennapod.BuildConfig; -import de.danoeh.antennapod.R; -import de.danoeh.antennapod.activity.MainActivity; + +import java.util.Date; +import java.util.LinkedList; +import java.util.List; +import java.util.Set; + +import de.danoeh.antennapod.core.BuildConfig; +import de.danoeh.antennapod.core.ClientConfig; +import de.danoeh.antennapod.core.R; import de.danoeh.antennapod.core.feed.Feed; import de.danoeh.antennapod.core.gpoddernet.GpodnetService; import de.danoeh.antennapod.core.gpoddernet.GpodnetServiceAuthenticationException; @@ -25,11 +31,6 @@ import de.danoeh.antennapod.core.storage.DownloadRequestException; import de.danoeh.antennapod.core.storage.DownloadRequester; import de.danoeh.antennapod.core.util.NetworkUtils; -import java.util.Date; -import java.util.LinkedList; -import java.util.List; -import java.util.Set; - /** * Synchronizes local subscriptions with gpodder.net service. The service should be started with ACTION_SYNC as an action argument. * This class also provides static methods for starting the GpodnetSyncService. @@ -89,14 +90,17 @@ public class GpodnetSyncService extends Service { // first sync: download all subscriptions... GpodnetSubscriptionChange changes = service.getSubscriptionChanges(GpodnetPreferences.getUsername(), GpodnetPreferences.getDeviceID(), 0); - if (BuildConfig.DEBUG) Log.d(TAG, "Downloaded subscription changes: " + changes); + if (BuildConfig.DEBUG) + Log.d(TAG, "Downloaded subscription changes: " + changes); processSubscriptionChanges(localSubscriptions, changes); // ... then upload all local subscriptions - if (BuildConfig.DEBUG) Log.d(TAG, "Uploading subscription list: " + localSubscriptions); + if (BuildConfig.DEBUG) + Log.d(TAG, "Uploading subscription list: " + localSubscriptions); GpodnetUploadChangesResponse uploadChangesResponse = service.uploadChanges(GpodnetPreferences.getUsername(), GpodnetPreferences.getDeviceID(), localSubscriptions, new LinkedList()); - if (BuildConfig.DEBUG) Log.d(TAG, "Uploading changes response: " + uploadChangesResponse); + if (BuildConfig.DEBUG) + Log.d(TAG, "Uploading changes response: " + uploadChangesResponse); GpodnetPreferences.removeAddedFeeds(localSubscriptions); GpodnetPreferences.removeRemovedFeeds(GpodnetPreferences.getRemovedFeedsCopy()); GpodnetPreferences.setLastSyncTimestamp(uploadChangesResponse.timestamp); @@ -106,14 +110,17 @@ public class GpodnetSyncService extends Service { // download remote changes first... GpodnetSubscriptionChange subscriptionChanges = service.getSubscriptionChanges(GpodnetPreferences.getUsername(), GpodnetPreferences.getDeviceID(), timestamp); - if (BuildConfig.DEBUG) Log.d(TAG, "Downloaded subscription changes: " + subscriptionChanges); + if (BuildConfig.DEBUG) + Log.d(TAG, "Downloaded subscription changes: " + subscriptionChanges); processSubscriptionChanges(localSubscriptions, subscriptionChanges); // ... then upload changes local changes - if (BuildConfig.DEBUG) Log.d(TAG, String.format("Uploading subscriptions, Added: %s\nRemoved: %s", - added.toString(), removed)); + if (BuildConfig.DEBUG) + Log.d(TAG, String.format("Uploading subscriptions, Added: %s\nRemoved: %s", + added.toString(), removed)); GpodnetUploadChangesResponse uploadChangesResponse = service.uploadChanges(GpodnetPreferences.getUsername(), GpodnetPreferences.getDeviceID(), added, removed); - if (BuildConfig.DEBUG) Log.d(TAG, "Upload subscriptions response: " + uploadChangesResponse); + if (BuildConfig.DEBUG) + Log.d(TAG, "Upload subscriptions response: " + uploadChangesResponse); GpodnetPreferences.removeAddedFeeds(added); GpodnetPreferences.removeRemovedFeeds(removed); @@ -165,8 +172,7 @@ public class GpodnetSyncService extends Service { id = R.id.notification_gpodnet_sync_error; } - PendingIntent activityIntent = PendingIntent.getActivity(this, 0, new Intent(this, MainActivity.class), PendingIntent.FLAG_UPDATE_CURRENT); -// TODO getGpodnetSyncServiceErrorNotificationPendingIntent + PendingIntent activityIntent = ClientConfig.gpodnetCallbacks.getGpodnetSyncServiceErrorNotificationPendingIntent(this); Notification notification = builder.setContentTitle(title) .setContentText(description) .setContentIntent(activityIntent) diff --git a/app/src/main/java/de/danoeh/antennapod/core/service/download/APRedirectHandler.java b/core/src/main/java/de/danoeh/antennapod/core/service/download/APRedirectHandler.java similarity index 97% rename from app/src/main/java/de/danoeh/antennapod/core/service/download/APRedirectHandler.java rename to core/src/main/java/de/danoeh/antennapod/core/service/download/APRedirectHandler.java index 1c62eaa77..3efcf4da8 100644 --- a/app/src/main/java/de/danoeh/antennapod/core/service/download/APRedirectHandler.java +++ b/core/src/main/java/de/danoeh/antennapod/core/service/download/APRedirectHandler.java @@ -1,7 +1,7 @@ package de.danoeh.antennapod.core.service.download; import android.util.Log; -import de.danoeh.antennapod.BuildConfig; +import de.danoeh.antennapod.core.BuildConfig; import org.apache.http.Header; import org.apache.http.HttpResponse; import org.apache.http.impl.client.DefaultRedirectHandler; diff --git a/app/src/main/java/de/danoeh/antennapod/core/service/download/AntennapodHttpClient.java b/core/src/main/java/de/danoeh/antennapod/core/service/download/AntennapodHttpClient.java similarity index 95% rename from app/src/main/java/de/danoeh/antennapod/core/service/download/AntennapodHttpClient.java rename to core/src/main/java/de/danoeh/antennapod/core/service/download/AntennapodHttpClient.java index dc792db81..67f059d7d 100644 --- a/app/src/main/java/de/danoeh/antennapod/core/service/download/AntennapodHttpClient.java +++ b/core/src/main/java/de/danoeh/antennapod/core/service/download/AntennapodHttpClient.java @@ -1,8 +1,7 @@ package de.danoeh.antennapod.core.service.download; import android.util.Log; -import de.danoeh.antennapod.AppConfig; -import de.danoeh.antennapod.BuildConfig; + import org.apache.http.client.HttpClient; import org.apache.http.client.params.HttpClientParams; import org.apache.http.conn.ClientConnectionManager; @@ -21,6 +20,9 @@ import org.apache.http.params.HttpParams; import java.util.concurrent.TimeUnit; +import de.danoeh.antennapod.core.BuildConfig; +import de.danoeh.antennapod.core.ClientConfig; + /** * Provides access to a HttpClient singleton. */ @@ -46,7 +48,7 @@ public class AntennapodHttpClient { if (BuildConfig.DEBUG) Log.d(TAG, "Creating new instance of HTTP client"); HttpParams params = new BasicHttpParams(); - params.setParameter(CoreProtocolPNames.USER_AGENT, AppConfig.USER_AGENT); + params.setParameter(CoreProtocolPNames.USER_AGENT, ClientConfig.USER_AGENT); params.setIntParameter("http.protocol.max-redirects", MAX_REDIRECTS); params.setBooleanParameter("http.protocol.reject-relative-redirect", false); diff --git a/app/src/main/java/de/danoeh/antennapod/core/service/download/DownloadRequest.java b/core/src/main/java/de/danoeh/antennapod/core/service/download/DownloadRequest.java similarity index 100% rename from app/src/main/java/de/danoeh/antennapod/core/service/download/DownloadRequest.java rename to core/src/main/java/de/danoeh/antennapod/core/service/download/DownloadRequest.java diff --git a/app/src/main/java/de/danoeh/antennapod/core/service/download/DownloadService.java b/core/src/main/java/de/danoeh/antennapod/core/service/download/DownloadService.java similarity index 94% rename from app/src/main/java/de/danoeh/antennapod/core/service/download/DownloadService.java rename to core/src/main/java/de/danoeh/antennapod/core/service/download/DownloadService.java index e9381d509..9229622ed 100644 --- a/app/src/main/java/de/danoeh/antennapod/core/service/download/DownloadService.java +++ b/core/src/main/java/de/danoeh/antennapod/core/service/download/DownloadService.java @@ -3,7 +3,6 @@ package de.danoeh.antennapod.core.service.download; import android.annotation.SuppressLint; import android.app.Notification; import android.app.NotificationManager; -import android.app.PendingIntent; import android.app.Service; import android.content.BroadcastReceiver; import android.content.Context; @@ -13,7 +12,6 @@ import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.media.MediaMetadataRetriever; import android.os.Binder; -import android.os.Bundle; import android.os.Handler; import android.os.IBinder; import android.support.v4.app.NotificationCompat; @@ -53,18 +51,15 @@ import java.util.concurrent.atomic.AtomicInteger; import javax.xml.parsers.ParserConfigurationException; -import de.danoeh.antennapod.BuildConfig; -import de.danoeh.antennapod.R; -import de.danoeh.antennapod.activity.DownloadAuthenticationActivity; -import de.danoeh.antennapod.activity.MainActivity; -import de.danoeh.antennapod.adapter.NavListAdapter; +import de.danoeh.antennapod.core.BuildConfig; +import de.danoeh.antennapod.core.ClientConfig; +import de.danoeh.antennapod.core.R; import de.danoeh.antennapod.core.feed.EventDistributor; import de.danoeh.antennapod.core.feed.Feed; import de.danoeh.antennapod.core.feed.FeedImage; import de.danoeh.antennapod.core.feed.FeedItem; import de.danoeh.antennapod.core.feed.FeedMedia; import de.danoeh.antennapod.core.feed.FeedPreferences; -import de.danoeh.antennapod.fragment.DownloadsFragment; import de.danoeh.antennapod.core.storage.DBReader; import de.danoeh.antennapod.core.storage.DBTasks; import de.danoeh.antennapod.core.storage.DBWriter; @@ -330,31 +325,19 @@ public class DownloadService extends Service { } @SuppressLint("NewApi") - private void setupNotificationBuilders() { // TODO getNotificationContentIntent - Intent intent = new Intent(this, MainActivity.class); - intent.putExtra(MainActivity.EXTRA_NAV_TYPE, NavListAdapter.VIEW_TYPE_NAV); - intent.putExtra(MainActivity.EXTRA_NAV_INDEX, MainActivity.POS_DOWNLOADS); - Bundle args = new Bundle(); - args.putInt(DownloadsFragment.ARG_SELECTED_TAB, DownloadsFragment.POS_RUNNING); - intent.putExtra(MainActivity.EXTRA_FRAGMENT_ARGS, args); - - PendingIntent pIntent = PendingIntent.getActivity(this, 0, intent, - PendingIntent.FLAG_UPDATE_CURRENT - ); - - + private void setupNotificationBuilders() { Bitmap icon = BitmapFactory.decodeResource(getResources(), R.drawable.stat_notify_sync); if (android.os.Build.VERSION.SDK_INT >= 16) { notificationBuilder = new Notification.BigTextStyle( new Notification.Builder(this).setOngoing(true) - .setContentIntent(pIntent).setLargeIcon(icon) + .setContentIntent(ClientConfig.downloadServiceCallbacks.getNotificationContentIntent(this)).setLargeIcon(icon) .setSmallIcon(R.drawable.stat_notify_sync) ); } else { notificationCompatBuilder = new NotificationCompat.Builder(this) - .setOngoing(true).setContentIntent(pIntent) + .setOngoing(true).setContentIntent(ClientConfig.downloadServiceCallbacks.getNotificationContentIntent(this)) .setLargeIcon(icon) .setSmallIcon(R.drawable.stat_notify_sync); } @@ -555,22 +538,15 @@ public class DownloadService extends Service { } } - if (createReport) { // TODO getReportNotificationContentIntent + if (createReport) { if (BuildConfig.DEBUG) Log.d(TAG, "Creating report"); - Intent intent = new Intent(this, MainActivity.class); - intent.putExtra(MainActivity.EXTRA_NAV_TYPE, NavListAdapter.VIEW_TYPE_NAV); - intent.putExtra(MainActivity.EXTRA_NAV_INDEX, MainActivity.POS_DOWNLOADS); - Bundle args = new Bundle(); - args.putInt(DownloadsFragment.ARG_SELECTED_TAB, DownloadsFragment.POS_LOG); - intent.putExtra(MainActivity.EXTRA_FRAGMENT_ARGS, args); - // create notification object Notification notification = new NotificationCompat.Builder(this) .setTicker( - getString(de.danoeh.antennapod.R.string.download_report_title)) + getString(R.string.download_report_title)) .setContentTitle( - getString(de.danoeh.antennapod.R.string.download_report_title)) + getString(R.string.download_report_title)) .setContentText( String.format( getString(R.string.download_report_content), @@ -582,7 +558,7 @@ public class DownloadService extends Service { R.drawable.stat_notify_sync) ) .setContentIntent( - PendingIntent.getActivity(this, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT) + ClientConfig.downloadServiceCallbacks.getReportNotificationContentIntent(this) ) .setAutoCancel(true).build(); NotificationManager nm = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); @@ -632,12 +608,6 @@ public class DownloadService extends Service { final String resourceTitle = (downloadRequest.getTitle() != null) ? downloadRequest.getTitle() : downloadRequest.getSource(); - // TODO getAuthentificationNotificationContentIntent - final Intent activityIntent = new Intent(getApplicationContext(), DownloadAuthenticationActivity.class); - activityIntent.putExtra(DownloadAuthenticationActivity.ARG_DOWNLOAD_REQUEST, downloadRequest); - activityIntent.putExtra(DownloadAuthenticationActivity.ARG_SEND_TO_DOWNLOAD_REQUESTER_BOOL, true); - final PendingIntent contentIntent = PendingIntent.getActivity(getApplicationContext(), 0, activityIntent, PendingIntent.FLAG_ONE_SHOT); - NotificationCompat.Builder builder = new NotificationCompat.Builder(DownloadService.this); builder.setTicker(getText(R.string.authentication_notification_title)) .setContentTitle(getText(R.string.authentication_notification_title)) @@ -647,7 +617,7 @@ public class DownloadService extends Service { .setSmallIcon(R.drawable.ic_stat_authentication) .setLargeIcon(BitmapFactory.decodeResource(getResources(), R.drawable.ic_stat_authentication)) .setAutoCancel(true) - .setContentIntent(contentIntent); + .setContentIntent(ClientConfig.downloadServiceCallbacks.getAuthentificationNotificationContentIntent(DownloadService.this, downloadRequest)); Notification n = builder.build(); NotificationManager nm = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); nm.notify(downloadRequest.getSource().hashCode(), n); diff --git a/app/src/main/java/de/danoeh/antennapod/core/service/download/DownloadStatus.java b/core/src/main/java/de/danoeh/antennapod/core/service/download/DownloadStatus.java similarity index 100% rename from app/src/main/java/de/danoeh/antennapod/core/service/download/DownloadStatus.java rename to core/src/main/java/de/danoeh/antennapod/core/service/download/DownloadStatus.java diff --git a/core/src/main/java/de/danoeh/antennapod/core/service/download/Downloader.java b/core/src/main/java/de/danoeh/antennapod/core/service/download/Downloader.java new file mode 100644 index 000000000..d8042d202 --- /dev/null +++ b/core/src/main/java/de/danoeh/antennapod/core/service/download/Downloader.java @@ -0,0 +1,73 @@ +package de.danoeh.antennapod.core.service.download; + +import android.content.Context; +import android.net.wifi.WifiManager; + +import java.util.concurrent.Callable; + +import de.danoeh.antennapod.core.ClientConfig; +import de.danoeh.antennapod.core.R; + +/** + * Downloads files + */ +public abstract class Downloader implements Callable { + private static final String TAG = "Downloader"; + + protected volatile boolean finished; + + protected volatile boolean cancelled; + + protected DownloadRequest request; + protected DownloadStatus result; + + public Downloader(DownloadRequest request) { + super(); + this.request = request; + this.request.setStatusMsg(R.string.download_pending); + this.cancelled = false; + this.result = new DownloadStatus(request, null, false, false, null); + } + + protected abstract void download(); + + public final Downloader call() { + WifiManager wifiManager = (WifiManager) + ClientConfig.applicationCallbacks.getApplicationInstance().getSystemService(Context.WIFI_SERVICE); + WifiManager.WifiLock wifiLock = null; + if (wifiManager != null) { + wifiLock = wifiManager.createWifiLock(TAG); + wifiLock.acquire(); + } + + download(); + + if (wifiLock != null) { + wifiLock.release(); + } + + if (result == null) { + throw new IllegalStateException( + "Downloader hasn't created DownloadStatus object"); + } + finished = true; + return this; + } + + public DownloadRequest getDownloadRequest() { + return request; + } + + public DownloadStatus getResult() { + return result; + } + + public boolean isFinished() { + return finished; + } + + public void cancel() { + cancelled = true; + } + +} \ No newline at end of file diff --git a/app/src/main/java/de/danoeh/antennapod/core/service/download/DownloaderCallback.java b/core/src/main/java/de/danoeh/antennapod/core/service/download/DownloaderCallback.java similarity index 100% rename from app/src/main/java/de/danoeh/antennapod/core/service/download/DownloaderCallback.java rename to core/src/main/java/de/danoeh/antennapod/core/service/download/DownloaderCallback.java diff --git a/app/src/main/java/de/danoeh/antennapod/core/service/download/HttpDownloader.java b/core/src/main/java/de/danoeh/antennapod/core/service/download/HttpDownloader.java similarity index 96% rename from app/src/main/java/de/danoeh/antennapod/core/service/download/HttpDownloader.java rename to core/src/main/java/de/danoeh/antennapod/core/service/download/HttpDownloader.java index cba59be01..32d0d351a 100644 --- a/app/src/main/java/de/danoeh/antennapod/core/service/download/HttpDownloader.java +++ b/core/src/main/java/de/danoeh/antennapod/core/service/download/HttpDownloader.java @@ -2,13 +2,7 @@ package de.danoeh.antennapod.core.service.download; import android.net.http.AndroidHttpClient; import android.util.Log; -import de.danoeh.antennapod.BuildConfig; -import de.danoeh.antennapod.PodcastApp; -import de.danoeh.antennapod.R; -import de.danoeh.antennapod.core.feed.FeedImage; -import de.danoeh.antennapod.core.util.DownloadError; -import de.danoeh.antennapod.core.util.StorageUtils; -import de.danoeh.antennapod.core.util.URIUtil; + import org.apache.commons.io.IOUtils; import org.apache.commons.lang3.StringUtils; import org.apache.http.Header; @@ -21,11 +15,23 @@ import org.apache.http.client.methods.HttpGet; import org.apache.http.impl.auth.BasicScheme; import org.apache.http.message.BasicHeader; -import java.io.*; +import java.io.BufferedInputStream; +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.io.RandomAccessFile; import java.net.HttpURLConnection; import java.net.SocketTimeoutException; import java.net.UnknownHostException; +import de.danoeh.antennapod.core.BuildConfig; +import de.danoeh.antennapod.core.ClientConfig; +import de.danoeh.antennapod.core.R; +import de.danoeh.antennapod.core.feed.FeedImage; +import de.danoeh.antennapod.core.util.DownloadError; +import de.danoeh.antennapod.core.util.StorageUtils; +import de.danoeh.antennapod.core.util.URIUtil; + public class HttpDownloader extends Downloader { private static final String TAG = "HttpDownloader"; @@ -104,7 +110,7 @@ public class HttpDownloader extends Downloader { return; } - if (!StorageUtils.storageAvailable(PodcastApp.getInstance())) { + if (!StorageUtils.storageAvailable(ClientConfig.applicationCallbacks.getApplicationInstance())) { onFail(DownloadError.ERROR_DEVICE_NOT_FOUND, null); return; } diff --git a/app/src/main/java/de/danoeh/antennapod/core/service/playback/PlaybackService.java b/core/src/main/java/de/danoeh/antennapod/core/service/playback/PlaybackService.java similarity index 97% rename from app/src/main/java/de/danoeh/antennapod/core/service/playback/PlaybackService.java rename to core/src/main/java/de/danoeh/antennapod/core/service/playback/PlaybackService.java index c191c9521..5123e40c7 100644 --- a/app/src/main/java/de/danoeh/antennapod/core/service/playback/PlaybackService.java +++ b/core/src/main/java/de/danoeh/antennapod/core/service/playback/PlaybackService.java @@ -34,10 +34,9 @@ import org.apache.commons.lang3.StringUtils; import java.io.IOException; import java.util.List; -import de.danoeh.antennapod.BuildConfig; -import de.danoeh.antennapod.R; -import de.danoeh.antennapod.activity.AudioplayerActivity; -import de.danoeh.antennapod.activity.VideoplayerActivity; +import de.danoeh.antennapod.core.BuildConfig; +import de.danoeh.antennapod.core.ClientConfig; +import de.danoeh.antennapod.core.R; import de.danoeh.antennapod.core.asynctask.PicassoProvider; import de.danoeh.antennapod.core.feed.Chapter; import de.danoeh.antennapod.core.feed.FeedItem; @@ -46,7 +45,6 @@ import de.danoeh.antennapod.core.feed.MediaType; import de.danoeh.antennapod.core.preferences.PlaybackPreferences; import de.danoeh.antennapod.core.preferences.UserPreferences; import de.danoeh.antennapod.core.receiver.MediaButtonReceiver; -import de.danoeh.antennapod.core.receiver.PlayerWidget; import de.danoeh.antennapod.core.storage.DBTasks; import de.danoeh.antennapod.core.storage.DBWriter; import de.danoeh.antennapod.core.util.QueueAccess; @@ -57,6 +55,8 @@ import de.danoeh.antennapod.core.util.playback.Playable; * Controls the MediaPlayer that plays a FeedMedia-file */ public class PlaybackService extends Service { + public static final String FORCE_WIDGET_UPDATE = "de.danoeh.antennapod.FORCE_WIDGET_UPDATE"; + public static final String STOP_WIDGET_UPDATE = "de.danoeh.antennapod.STOP_WIDGET_UPDATE"; /** * Logging tag */ @@ -172,17 +172,13 @@ public class PlaybackService extends Service { * running, the type of the last played media will be looked up. */ public static Intent getPlayerActivityIntent(Context context) { - if (isRunning) { // TODO getPlayerActivityIntent - if (currentMediaType == MediaType.VIDEO) { - return new Intent(context, VideoplayerActivity.class); - } else { - return new Intent(context, AudioplayerActivity.class); - } + if (isRunning) { + return ClientConfig.playbackServiceCallbacks.getPlayerActivityIntent(context, currentMediaType); } else { if (PlaybackPreferences.getCurrentEpisodeIsVideo()) { - return new Intent(context, VideoplayerActivity.class); + return ClientConfig.playbackServiceCallbacks.getPlayerActivityIntent(context, MediaType.VIDEO); } else { - return new Intent(context, AudioplayerActivity.class); + return ClientConfig.playbackServiceCallbacks.getPlayerActivityIntent(context, MediaType.AUDIO); } } } @@ -193,11 +189,7 @@ public class PlaybackService extends Service { */ public static Intent getPlayerActivityIntent(Context context, Playable media) { MediaType mt = media.getMediaType(); - if (mt == MediaType.VIDEO) { - return new Intent(context, VideoplayerActivity.class); - } else { - return new Intent(context, AudioplayerActivity.class); - } + return ClientConfig.playbackServiceCallbacks.getPlayerActivityIntent(context, mt); } @SuppressLint("NewApi") @@ -796,12 +788,12 @@ public class PlaybackService extends Service { private void stopWidgetUpdater() { taskManager.cancelWidgetUpdater(); - sendBroadcast(new Intent(PlayerWidget.STOP_WIDGET_UPDATE)); + sendBroadcast(new Intent(STOP_WIDGET_UPDATE)); } private void updateWidget() { PlaybackService.this.sendBroadcast(new Intent( - PlayerWidget.FORCE_WIDGET_UPDATE)); + FORCE_WIDGET_UPDATE)); } public boolean sleepTimerActive() { diff --git a/app/src/main/java/de/danoeh/antennapod/core/service/playback/PlaybackServiceMediaPlayer.java b/core/src/main/java/de/danoeh/antennapod/core/service/playback/PlaybackServiceMediaPlayer.java similarity index 99% rename from app/src/main/java/de/danoeh/antennapod/core/service/playback/PlaybackServiceMediaPlayer.java rename to core/src/main/java/de/danoeh/antennapod/core/service/playback/PlaybackServiceMediaPlayer.java index 62ad59166..590b67853 100644 --- a/app/src/main/java/de/danoeh/antennapod/core/service/playback/PlaybackServiceMediaPlayer.java +++ b/core/src/main/java/de/danoeh/antennapod/core/service/playback/PlaybackServiceMediaPlayer.java @@ -21,7 +21,7 @@ import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.locks.ReentrantLock; -import de.danoeh.antennapod.BuildConfig; +import de.danoeh.antennapod.core.BuildConfig; import de.danoeh.antennapod.core.feed.Chapter; import de.danoeh.antennapod.core.feed.MediaType; import de.danoeh.antennapod.core.preferences.UserPreferences; diff --git a/app/src/main/java/de/danoeh/antennapod/core/service/playback/PlaybackServiceTaskManager.java b/core/src/main/java/de/danoeh/antennapod/core/service/playback/PlaybackServiceTaskManager.java similarity index 99% rename from app/src/main/java/de/danoeh/antennapod/core/service/playback/PlaybackServiceTaskManager.java rename to core/src/main/java/de/danoeh/antennapod/core/service/playback/PlaybackServiceTaskManager.java index 1b33e8667..1865afa6f 100644 --- a/app/src/main/java/de/danoeh/antennapod/core/service/playback/PlaybackServiceTaskManager.java +++ b/core/src/main/java/de/danoeh/antennapod/core/service/playback/PlaybackServiceTaskManager.java @@ -5,7 +5,7 @@ import android.util.Log; import org.apache.commons.lang3.Validate; -import de.danoeh.antennapod.BuildConfig; +import de.danoeh.antennapod.core.BuildConfig; import de.danoeh.antennapod.core.feed.EventDistributor; import de.danoeh.antennapod.core.feed.FeedItem; import de.danoeh.antennapod.core.storage.DBReader; diff --git a/app/src/main/java/de/danoeh/antennapod/core/service/playback/PlayerStatus.java b/core/src/main/java/de/danoeh/antennapod/core/service/playback/PlayerStatus.java similarity index 100% rename from app/src/main/java/de/danoeh/antennapod/core/service/playback/PlayerStatus.java rename to core/src/main/java/de/danoeh/antennapod/core/service/playback/PlayerStatus.java diff --git a/app/src/main/java/de/danoeh/antennapod/core/storage/DBReader.java b/core/src/main/java/de/danoeh/antennapod/core/storage/DBReader.java similarity index 99% rename from app/src/main/java/de/danoeh/antennapod/core/storage/DBReader.java rename to core/src/main/java/de/danoeh/antennapod/core/storage/DBReader.java index 1b93e6ea2..62edaae29 100644 --- a/app/src/main/java/de/danoeh/antennapod/core/storage/DBReader.java +++ b/core/src/main/java/de/danoeh/antennapod/core/storage/DBReader.java @@ -4,7 +4,7 @@ import android.content.Context; import android.database.Cursor; import android.database.SQLException; import android.util.Log; -import de.danoeh.antennapod.BuildConfig; +import de.danoeh.antennapod.core.BuildConfig; import de.danoeh.antennapod.core.feed.*; import de.danoeh.antennapod.core.service.download.DownloadStatus; import de.danoeh.antennapod.core.util.DownloadError; diff --git a/app/src/main/java/de/danoeh/antennapod/core/storage/DBTasks.java b/core/src/main/java/de/danoeh/antennapod/core/storage/DBTasks.java similarity index 99% rename from app/src/main/java/de/danoeh/antennapod/core/storage/DBTasks.java rename to core/src/main/java/de/danoeh/antennapod/core/storage/DBTasks.java index 28cab29b9..982959bc2 100644 --- a/app/src/main/java/de/danoeh/antennapod/core/storage/DBTasks.java +++ b/core/src/main/java/de/danoeh/antennapod/core/storage/DBTasks.java @@ -4,7 +4,7 @@ import android.content.Context; import android.content.Intent; import android.database.Cursor; import android.util.Log; -import de.danoeh.antennapod.BuildConfig; +import de.danoeh.antennapod.core.BuildConfig; import de.danoeh.antennapod.core.asynctask.FlattrClickWorker; import de.danoeh.antennapod.core.asynctask.FlattrStatusFetcher; import de.danoeh.antennapod.core.feed.*; diff --git a/app/src/main/java/de/danoeh/antennapod/core/storage/DBWriter.java b/core/src/main/java/de/danoeh/antennapod/core/storage/DBWriter.java similarity index 99% rename from app/src/main/java/de/danoeh/antennapod/core/storage/DBWriter.java rename to core/src/main/java/de/danoeh/antennapod/core/storage/DBWriter.java index 225f74c96..eec15acd2 100644 --- a/app/src/main/java/de/danoeh/antennapod/core/storage/DBWriter.java +++ b/core/src/main/java/de/danoeh/antennapod/core/storage/DBWriter.java @@ -7,7 +7,7 @@ import android.content.SharedPreferences; import android.database.Cursor; import android.preference.PreferenceManager; import android.util.Log; -import de.danoeh.antennapod.BuildConfig; +import de.danoeh.antennapod.core.BuildConfig; import de.danoeh.antennapod.core.asynctask.FlattrClickWorker; import de.danoeh.antennapod.core.feed.*; import de.danoeh.antennapod.core.preferences.GpodnetPreferences; diff --git a/app/src/main/java/de/danoeh/antennapod/core/storage/DownloadRequestException.java b/core/src/main/java/de/danoeh/antennapod/core/storage/DownloadRequestException.java similarity index 100% rename from app/src/main/java/de/danoeh/antennapod/core/storage/DownloadRequestException.java rename to core/src/main/java/de/danoeh/antennapod/core/storage/DownloadRequestException.java diff --git a/app/src/main/java/de/danoeh/antennapod/core/storage/DownloadRequester.java b/core/src/main/java/de/danoeh/antennapod/core/storage/DownloadRequester.java similarity index 99% rename from app/src/main/java/de/danoeh/antennapod/core/storage/DownloadRequester.java rename to core/src/main/java/de/danoeh/antennapod/core/storage/DownloadRequester.java index c313055a5..2fd653d32 100644 --- a/app/src/main/java/de/danoeh/antennapod/core/storage/DownloadRequester.java +++ b/core/src/main/java/de/danoeh/antennapod/core/storage/DownloadRequester.java @@ -4,7 +4,7 @@ import android.content.Context; import android.content.Intent; import android.util.Log; import android.webkit.URLUtil; -import de.danoeh.antennapod.BuildConfig; +import de.danoeh.antennapod.core.BuildConfig; import de.danoeh.antennapod.core.feed.*; import de.danoeh.antennapod.core.preferences.UserPreferences; import de.danoeh.antennapod.core.service.download.DownloadRequest; diff --git a/app/src/main/java/de/danoeh/antennapod/core/storage/FeedItemStatistics.java b/core/src/main/java/de/danoeh/antennapod/core/storage/FeedItemStatistics.java similarity index 100% rename from app/src/main/java/de/danoeh/antennapod/core/storage/FeedItemStatistics.java rename to core/src/main/java/de/danoeh/antennapod/core/storage/FeedItemStatistics.java diff --git a/app/src/main/java/de/danoeh/antennapod/core/storage/FeedSearcher.java b/core/src/main/java/de/danoeh/antennapod/core/storage/FeedSearcher.java similarity index 98% rename from app/src/main/java/de/danoeh/antennapod/core/storage/FeedSearcher.java rename to core/src/main/java/de/danoeh/antennapod/core/storage/FeedSearcher.java index 41b379471..3a63685ba 100644 --- a/app/src/main/java/de/danoeh/antennapod/core/storage/FeedSearcher.java +++ b/core/src/main/java/de/danoeh/antennapod/core/storage/FeedSearcher.java @@ -1,7 +1,7 @@ package de.danoeh.antennapod.core.storage; import android.content.Context; -import de.danoeh.antennapod.R; +import de.danoeh.antennapod.core.R; import de.danoeh.antennapod.core.feed.FeedItem; import de.danoeh.antennapod.core.feed.SearchResult; import de.danoeh.antennapod.core.util.comparator.SearchResultValueComparator; diff --git a/app/src/main/java/de/danoeh/antennapod/core/storage/PodDBAdapter.java b/core/src/main/java/de/danoeh/antennapod/core/storage/PodDBAdapter.java similarity index 92% rename from app/src/main/java/de/danoeh/antennapod/core/storage/PodDBAdapter.java rename to core/src/main/java/de/danoeh/antennapod/core/storage/PodDBAdapter.java index eb6592510..1407080dc 100644 --- a/app/src/main/java/de/danoeh/antennapod/core/storage/PodDBAdapter.java +++ b/core/src/main/java/de/danoeh/antennapod/core/storage/PodDBAdapter.java @@ -16,7 +16,8 @@ import org.apache.commons.lang3.Validate; import java.util.Arrays; import java.util.List; -import de.danoeh.antennapod.BuildConfig; +import de.danoeh.antennapod.core.BuildConfig; +import de.danoeh.antennapod.core.ClientConfig; import de.danoeh.antennapod.core.feed.Chapter; import de.danoeh.antennapod.core.feed.Feed; import de.danoeh.antennapod.core.feed.FeedComponent; @@ -34,7 +35,6 @@ import de.danoeh.antennapod.core.util.flattr.FlattrStatus; */ public class PodDBAdapter { private static final String TAG = "PodDBAdapter"; - private static final int DATABASE_VERSION = 12; public static final String DATABASE_NAME = "Antennapod.db"; /** @@ -318,7 +318,8 @@ public class PodDBAdapter { private static synchronized PodDBHelper getDbHelperSingleton(Context appContext) { if (dbHelperSingleton == null) { - dbHelperSingleton = new PodDBHelper(appContext, DATABASE_NAME, null, DATABASE_VERSION); + dbHelperSingleton = new PodDBHelper(appContext, DATABASE_NAME, null, + ClientConfig.storageCallbacks.getDatabaseVersion()); } return dbHelperSingleton; } @@ -1302,90 +1303,8 @@ public class PodDBAdapter { @Override public void onUpgrade(final SQLiteDatabase db, final int oldVersion, - final int newVersion) { // TODO onUpgrade - Log.w("DBAdapter", "Upgrading from version " + oldVersion + " to " - + newVersion + "."); - if (oldVersion <= 1) { - db.execSQL("ALTER TABLE " + TABLE_NAME_FEEDS + " ADD COLUMN " - + KEY_TYPE + " TEXT"); - } - if (oldVersion <= 2) { - db.execSQL("ALTER TABLE " + TABLE_NAME_SIMPLECHAPTERS - + " ADD COLUMN " + KEY_LINK + " TEXT"); - } - if (oldVersion <= 3) { - db.execSQL("ALTER TABLE " + TABLE_NAME_FEED_ITEMS - + " ADD COLUMN " + KEY_ITEM_IDENTIFIER + " TEXT"); - } - if (oldVersion <= 4) { - db.execSQL("ALTER TABLE " + TABLE_NAME_FEEDS + " ADD COLUMN " - + KEY_FEED_IDENTIFIER + " TEXT"); - } - if (oldVersion <= 5) { - db.execSQL("ALTER TABLE " + TABLE_NAME_DOWNLOAD_LOG - + " ADD COLUMN " + KEY_REASON_DETAILED + " TEXT"); - db.execSQL("ALTER TABLE " + TABLE_NAME_DOWNLOAD_LOG - + " ADD COLUMN " + KEY_DOWNLOADSTATUS_TITLE + " TEXT"); - } - if (oldVersion <= 6) { - db.execSQL("ALTER TABLE " + TABLE_NAME_SIMPLECHAPTERS - + " ADD COLUMN " + KEY_CHAPTER_TYPE + " INTEGER"); - } - if (oldVersion <= 7) { - db.execSQL("ALTER TABLE " + TABLE_NAME_FEED_MEDIA - + " ADD COLUMN " + KEY_PLAYBACK_COMPLETION_DATE - + " INTEGER"); - } - if (oldVersion <= 8) { - final int KEY_ID_POSITION = 0; - final int KEY_MEDIA_POSITION = 1; - - // Add feeditem column to feedmedia table - db.execSQL("ALTER TABLE " + TABLE_NAME_FEED_MEDIA - + " ADD COLUMN " + KEY_FEEDITEM - + " INTEGER"); - Cursor feeditemCursor = db.query(TABLE_NAME_FEED_ITEMS, new String[]{KEY_ID, KEY_MEDIA}, "? > 0", new String[]{KEY_MEDIA}, null, null, null); - if (feeditemCursor.moveToFirst()) { - db.beginTransaction(); - ContentValues contentValues = new ContentValues(); - do { - long mediaId = feeditemCursor.getLong(KEY_MEDIA_POSITION); - contentValues.put(KEY_FEEDITEM, feeditemCursor.getLong(KEY_ID_POSITION)); - db.update(TABLE_NAME_FEED_MEDIA, contentValues, KEY_ID + "=?", new String[]{String.valueOf(mediaId)}); - contentValues.clear(); - } while (feeditemCursor.moveToNext()); - db.setTransactionSuccessful(); - db.endTransaction(); - } - feeditemCursor.close(); - } - if (oldVersion <= 9) { - db.execSQL("ALTER TABLE " + TABLE_NAME_FEEDS - + " ADD COLUMN " + KEY_AUTO_DOWNLOAD - + " INTEGER DEFAULT 1"); - } - if (oldVersion <= 10) { - db.execSQL("ALTER TABLE " + TABLE_NAME_FEEDS - + " ADD COLUMN " + KEY_FLATTR_STATUS - + " INTEGER"); - db.execSQL("ALTER TABLE " + TABLE_NAME_FEED_ITEMS - + " ADD COLUMN " + KEY_FLATTR_STATUS - + " INTEGER"); - db.execSQL("ALTER TABLE " + TABLE_NAME_FEED_MEDIA - + " ADD COLUMN " + KEY_PLAYED_DURATION - + " INTEGER"); - } - if (oldVersion <= 11) { - db.execSQL("ALTER TABLE " + TABLE_NAME_FEEDS - + " ADD COLUMN " + KEY_USERNAME - + " TEXT"); - db.execSQL("ALTER TABLE " + TABLE_NAME_FEEDS - + " ADD COLUMN " + KEY_PASSWORD - + " TEXT"); - db.execSQL("ALTER TABLE " + TABLE_NAME_FEED_ITEMS - + " ADD COLUMN " + KEY_IMAGE - + " INTEGER"); - } + final int newVersion) { + ClientConfig.storageCallbacks.onUpgrade(db, oldVersion, newVersion); } } } diff --git a/app/src/main/java/de/danoeh/antennapod/core/syndication/handler/FeedHandler.java b/core/src/main/java/de/danoeh/antennapod/core/syndication/handler/FeedHandler.java similarity index 100% rename from app/src/main/java/de/danoeh/antennapod/core/syndication/handler/FeedHandler.java rename to core/src/main/java/de/danoeh/antennapod/core/syndication/handler/FeedHandler.java diff --git a/app/src/main/java/de/danoeh/antennapod/core/syndication/handler/FeedHandlerResult.java b/core/src/main/java/de/danoeh/antennapod/core/syndication/handler/FeedHandlerResult.java similarity index 100% rename from app/src/main/java/de/danoeh/antennapod/core/syndication/handler/FeedHandlerResult.java rename to core/src/main/java/de/danoeh/antennapod/core/syndication/handler/FeedHandlerResult.java diff --git a/app/src/main/java/de/danoeh/antennapod/core/syndication/handler/HandlerState.java b/core/src/main/java/de/danoeh/antennapod/core/syndication/handler/HandlerState.java similarity index 100% rename from app/src/main/java/de/danoeh/antennapod/core/syndication/handler/HandlerState.java rename to core/src/main/java/de/danoeh/antennapod/core/syndication/handler/HandlerState.java diff --git a/app/src/main/java/de/danoeh/antennapod/core/syndication/handler/SyndHandler.java b/core/src/main/java/de/danoeh/antennapod/core/syndication/handler/SyndHandler.java similarity index 98% rename from app/src/main/java/de/danoeh/antennapod/core/syndication/handler/SyndHandler.java rename to core/src/main/java/de/danoeh/antennapod/core/syndication/handler/SyndHandler.java index 573c873eb..1dda24944 100644 --- a/app/src/main/java/de/danoeh/antennapod/core/syndication/handler/SyndHandler.java +++ b/core/src/main/java/de/danoeh/antennapod/core/syndication/handler/SyndHandler.java @@ -1,7 +1,7 @@ package de.danoeh.antennapod.core.syndication.handler; import android.util.Log; -import de.danoeh.antennapod.BuildConfig; +import de.danoeh.antennapod.core.BuildConfig; import de.danoeh.antennapod.core.feed.Feed; import de.danoeh.antennapod.core.syndication.namespace.*; import de.danoeh.antennapod.core.syndication.namespace.atom.NSAtom; diff --git a/app/src/main/java/de/danoeh/antennapod/core/syndication/handler/TypeGetter.java b/core/src/main/java/de/danoeh/antennapod/core/syndication/handler/TypeGetter.java similarity index 98% rename from app/src/main/java/de/danoeh/antennapod/core/syndication/handler/TypeGetter.java rename to core/src/main/java/de/danoeh/antennapod/core/syndication/handler/TypeGetter.java index e1ebd63a5..32cd538d5 100644 --- a/app/src/main/java/de/danoeh/antennapod/core/syndication/handler/TypeGetter.java +++ b/core/src/main/java/de/danoeh/antennapod/core/syndication/handler/TypeGetter.java @@ -1,7 +1,7 @@ package de.danoeh.antennapod.core.syndication.handler; import android.util.Log; -import de.danoeh.antennapod.BuildConfig; +import de.danoeh.antennapod.core.BuildConfig; import de.danoeh.antennapod.core.feed.Feed; import org.apache.commons.io.input.XmlStreamReader; import org.jsoup.Jsoup; diff --git a/app/src/main/java/de/danoeh/antennapod/core/syndication/handler/UnsupportedFeedtypeException.java b/core/src/main/java/de/danoeh/antennapod/core/syndication/handler/UnsupportedFeedtypeException.java similarity index 100% rename from app/src/main/java/de/danoeh/antennapod/core/syndication/handler/UnsupportedFeedtypeException.java rename to core/src/main/java/de/danoeh/antennapod/core/syndication/handler/UnsupportedFeedtypeException.java diff --git a/app/src/main/java/de/danoeh/antennapod/core/syndication/namespace/NSContent.java b/core/src/main/java/de/danoeh/antennapod/core/syndication/namespace/NSContent.java similarity index 100% rename from app/src/main/java/de/danoeh/antennapod/core/syndication/namespace/NSContent.java rename to core/src/main/java/de/danoeh/antennapod/core/syndication/namespace/NSContent.java diff --git a/app/src/main/java/de/danoeh/antennapod/core/syndication/namespace/NSITunes.java b/core/src/main/java/de/danoeh/antennapod/core/syndication/namespace/NSITunes.java similarity index 100% rename from app/src/main/java/de/danoeh/antennapod/core/syndication/namespace/NSITunes.java rename to core/src/main/java/de/danoeh/antennapod/core/syndication/namespace/NSITunes.java diff --git a/app/src/main/java/de/danoeh/antennapod/core/syndication/namespace/NSMedia.java b/core/src/main/java/de/danoeh/antennapod/core/syndication/namespace/NSMedia.java similarity index 97% rename from app/src/main/java/de/danoeh/antennapod/core/syndication/namespace/NSMedia.java rename to core/src/main/java/de/danoeh/antennapod/core/syndication/namespace/NSMedia.java index 15c377f79..7f03f1139 100644 --- a/app/src/main/java/de/danoeh/antennapod/core/syndication/namespace/NSMedia.java +++ b/core/src/main/java/de/danoeh/antennapod/core/syndication/namespace/NSMedia.java @@ -1,7 +1,7 @@ package de.danoeh.antennapod.core.syndication.namespace; import android.util.Log; -import de.danoeh.antennapod.BuildConfig; +import de.danoeh.antennapod.core.BuildConfig; import de.danoeh.antennapod.core.feed.FeedMedia; import de.danoeh.antennapod.core.syndication.handler.HandlerState; import de.danoeh.antennapod.core.syndication.util.SyndTypeUtils; diff --git a/app/src/main/java/de/danoeh/antennapod/core/syndication/namespace/NSRSS20.java b/core/src/main/java/de/danoeh/antennapod/core/syndication/namespace/NSRSS20.java similarity index 99% rename from app/src/main/java/de/danoeh/antennapod/core/syndication/namespace/NSRSS20.java rename to core/src/main/java/de/danoeh/antennapod/core/syndication/namespace/NSRSS20.java index fd8f6176b..c29741456 100644 --- a/app/src/main/java/de/danoeh/antennapod/core/syndication/namespace/NSRSS20.java +++ b/core/src/main/java/de/danoeh/antennapod/core/syndication/namespace/NSRSS20.java @@ -1,7 +1,7 @@ package de.danoeh.antennapod.core.syndication.namespace; import android.util.Log; -import de.danoeh.antennapod.BuildConfig; +import de.danoeh.antennapod.core.BuildConfig; import de.danoeh.antennapod.core.feed.FeedImage; import de.danoeh.antennapod.core.feed.FeedItem; import de.danoeh.antennapod.core.feed.FeedMedia; diff --git a/app/src/main/java/de/danoeh/antennapod/core/syndication/namespace/NSSimpleChapters.java b/core/src/main/java/de/danoeh/antennapod/core/syndication/namespace/NSSimpleChapters.java similarity index 100% rename from app/src/main/java/de/danoeh/antennapod/core/syndication/namespace/NSSimpleChapters.java rename to core/src/main/java/de/danoeh/antennapod/core/syndication/namespace/NSSimpleChapters.java diff --git a/app/src/main/java/de/danoeh/antennapod/core/syndication/namespace/Namespace.java b/core/src/main/java/de/danoeh/antennapod/core/syndication/namespace/Namespace.java similarity index 100% rename from app/src/main/java/de/danoeh/antennapod/core/syndication/namespace/Namespace.java rename to core/src/main/java/de/danoeh/antennapod/core/syndication/namespace/Namespace.java diff --git a/app/src/main/java/de/danoeh/antennapod/core/syndication/namespace/SyndElement.java b/core/src/main/java/de/danoeh/antennapod/core/syndication/namespace/SyndElement.java similarity index 100% rename from app/src/main/java/de/danoeh/antennapod/core/syndication/namespace/SyndElement.java rename to core/src/main/java/de/danoeh/antennapod/core/syndication/namespace/SyndElement.java diff --git a/app/src/main/java/de/danoeh/antennapod/core/syndication/namespace/atom/AtomText.java b/core/src/main/java/de/danoeh/antennapod/core/syndication/namespace/atom/AtomText.java similarity index 100% rename from app/src/main/java/de/danoeh/antennapod/core/syndication/namespace/atom/AtomText.java rename to core/src/main/java/de/danoeh/antennapod/core/syndication/namespace/atom/AtomText.java diff --git a/app/src/main/java/de/danoeh/antennapod/core/syndication/namespace/atom/NSAtom.java b/core/src/main/java/de/danoeh/antennapod/core/syndication/namespace/atom/NSAtom.java similarity index 99% rename from app/src/main/java/de/danoeh/antennapod/core/syndication/namespace/atom/NSAtom.java rename to core/src/main/java/de/danoeh/antennapod/core/syndication/namespace/atom/NSAtom.java index 1547dc222..61cb9ec65 100644 --- a/app/src/main/java/de/danoeh/antennapod/core/syndication/namespace/atom/NSAtom.java +++ b/core/src/main/java/de/danoeh/antennapod/core/syndication/namespace/atom/NSAtom.java @@ -1,7 +1,7 @@ package de.danoeh.antennapod.core.syndication.namespace.atom; import android.util.Log; -import de.danoeh.antennapod.BuildConfig; +import de.danoeh.antennapod.core.BuildConfig; import de.danoeh.antennapod.core.feed.FeedImage; import de.danoeh.antennapod.core.feed.FeedItem; import de.danoeh.antennapod.core.feed.FeedMedia; diff --git a/app/src/main/java/de/danoeh/antennapod/core/syndication/util/SyndDateUtils.java b/core/src/main/java/de/danoeh/antennapod/core/syndication/util/SyndDateUtils.java similarity index 100% rename from app/src/main/java/de/danoeh/antennapod/core/syndication/util/SyndDateUtils.java rename to core/src/main/java/de/danoeh/antennapod/core/syndication/util/SyndDateUtils.java diff --git a/app/src/main/java/de/danoeh/antennapod/core/syndication/util/SyndTypeUtils.java b/core/src/main/java/de/danoeh/antennapod/core/syndication/util/SyndTypeUtils.java similarity index 100% rename from app/src/main/java/de/danoeh/antennapod/core/syndication/util/SyndTypeUtils.java rename to core/src/main/java/de/danoeh/antennapod/core/syndication/util/SyndTypeUtils.java diff --git a/app/src/main/java/de/danoeh/antennapod/core/util/ChapterUtils.java b/core/src/main/java/de/danoeh/antennapod/core/util/ChapterUtils.java similarity index 99% rename from app/src/main/java/de/danoeh/antennapod/core/util/ChapterUtils.java rename to core/src/main/java/de/danoeh/antennapod/core/util/ChapterUtils.java index d6046026f..759a60f43 100644 --- a/app/src/main/java/de/danoeh/antennapod/core/util/ChapterUtils.java +++ b/core/src/main/java/de/danoeh/antennapod/core/util/ChapterUtils.java @@ -1,7 +1,7 @@ package de.danoeh.antennapod.core.util; import android.util.Log; -import de.danoeh.antennapod.BuildConfig; +import de.danoeh.antennapod.core.BuildConfig; import de.danoeh.antennapod.core.feed.Chapter; import de.danoeh.antennapod.core.util.comparator.ChapterStartTimeComparator; import de.danoeh.antennapod.core.util.id3reader.ChapterReader; diff --git a/app/src/main/java/de/danoeh/antennapod/core/util/Converter.java b/core/src/main/java/de/danoeh/antennapod/core/util/Converter.java similarity index 100% rename from app/src/main/java/de/danoeh/antennapod/core/util/Converter.java rename to core/src/main/java/de/danoeh/antennapod/core/util/Converter.java diff --git a/app/src/main/java/de/danoeh/antennapod/core/util/DownloadError.java b/core/src/main/java/de/danoeh/antennapod/core/util/DownloadError.java similarity index 97% rename from app/src/main/java/de/danoeh/antennapod/core/util/DownloadError.java rename to core/src/main/java/de/danoeh/antennapod/core/util/DownloadError.java index 447e7d256..602c221bf 100644 --- a/app/src/main/java/de/danoeh/antennapod/core/util/DownloadError.java +++ b/core/src/main/java/de/danoeh/antennapod/core/util/DownloadError.java @@ -1,7 +1,7 @@ package de.danoeh.antennapod.core.util; import android.content.Context; -import de.danoeh.antennapod.R; +import de.danoeh.antennapod.core.R; /** Utility class for Download Errors. */ public enum DownloadError { diff --git a/app/src/main/java/de/danoeh/antennapod/core/util/DuckType.java b/core/src/main/java/de/danoeh/antennapod/core/util/DuckType.java similarity index 98% rename from app/src/main/java/de/danoeh/antennapod/core/util/DuckType.java rename to core/src/main/java/de/danoeh/antennapod/core/util/DuckType.java index 5d2803b84..f432424f8 100644 --- a/app/src/main/java/de/danoeh/antennapod/core/util/DuckType.java +++ b/core/src/main/java/de/danoeh/antennapod/core/util/DuckType.java @@ -6,7 +6,7 @@ import java.lang.reflect.InvocationHandler; import java.lang.reflect.Method; import java.lang.reflect.Proxy; -import de.danoeh.antennapod.BuildConfig; +import de.danoeh.antennapod.core.BuildConfig; /** * Allows "duck typing" or dynamic invocation based on method signature rather diff --git a/app/src/main/java/de/danoeh/antennapod/core/util/EpisodeFilter.java b/core/src/main/java/de/danoeh/antennapod/core/util/EpisodeFilter.java similarity index 100% rename from app/src/main/java/de/danoeh/antennapod/core/util/EpisodeFilter.java rename to core/src/main/java/de/danoeh/antennapod/core/util/EpisodeFilter.java diff --git a/app/src/main/java/de/danoeh/antennapod/core/util/FeedtitleComparator.java b/core/src/main/java/de/danoeh/antennapod/core/util/FeedtitleComparator.java similarity index 100% rename from app/src/main/java/de/danoeh/antennapod/core/util/FeedtitleComparator.java rename to core/src/main/java/de/danoeh/antennapod/core/util/FeedtitleComparator.java diff --git a/app/src/main/java/de/danoeh/antennapod/core/util/FileNameGenerator.java b/core/src/main/java/de/danoeh/antennapod/core/util/FileNameGenerator.java similarity index 100% rename from app/src/main/java/de/danoeh/antennapod/core/util/FileNameGenerator.java rename to core/src/main/java/de/danoeh/antennapod/core/util/FileNameGenerator.java diff --git a/app/src/main/java/de/danoeh/antennapod/core/util/InvalidFeedException.java b/core/src/main/java/de/danoeh/antennapod/core/util/InvalidFeedException.java similarity index 100% rename from app/src/main/java/de/danoeh/antennapod/core/util/InvalidFeedException.java rename to core/src/main/java/de/danoeh/antennapod/core/util/InvalidFeedException.java diff --git a/app/src/main/java/de/danoeh/antennapod/core/util/LangUtils.java b/core/src/main/java/de/danoeh/antennapod/core/util/LangUtils.java similarity index 100% rename from app/src/main/java/de/danoeh/antennapod/core/util/LangUtils.java rename to core/src/main/java/de/danoeh/antennapod/core/util/LangUtils.java diff --git a/app/src/main/java/de/danoeh/antennapod/core/util/NetworkUtils.java b/core/src/main/java/de/danoeh/antennapod/core/util/NetworkUtils.java similarity index 98% rename from app/src/main/java/de/danoeh/antennapod/core/util/NetworkUtils.java rename to core/src/main/java/de/danoeh/antennapod/core/util/NetworkUtils.java index 89bba290c..b321536a3 100644 --- a/app/src/main/java/de/danoeh/antennapod/core/util/NetworkUtils.java +++ b/core/src/main/java/de/danoeh/antennapod/core/util/NetworkUtils.java @@ -6,7 +6,7 @@ import android.net.NetworkInfo; import android.net.wifi.WifiInfo; import android.net.wifi.WifiManager; import android.util.Log; -import de.danoeh.antennapod.BuildConfig; +import de.danoeh.antennapod.core.BuildConfig; import de.danoeh.antennapod.core.preferences.UserPreferences; import java.util.Arrays; diff --git a/app/src/main/java/de/danoeh/antennapod/core/util/QueueAccess.java b/core/src/main/java/de/danoeh/antennapod/core/util/QueueAccess.java similarity index 100% rename from app/src/main/java/de/danoeh/antennapod/core/util/QueueAccess.java rename to core/src/main/java/de/danoeh/antennapod/core/util/QueueAccess.java diff --git a/app/src/main/java/de/danoeh/antennapod/core/util/ShareUtils.java b/core/src/main/java/de/danoeh/antennapod/core/util/ShareUtils.java similarity index 100% rename from app/src/main/java/de/danoeh/antennapod/core/util/ShareUtils.java rename to core/src/main/java/de/danoeh/antennapod/core/util/ShareUtils.java diff --git a/app/src/main/java/de/danoeh/antennapod/core/util/ShownotesProvider.java b/core/src/main/java/de/danoeh/antennapod/core/util/ShownotesProvider.java similarity index 100% rename from app/src/main/java/de/danoeh/antennapod/core/util/ShownotesProvider.java rename to core/src/main/java/de/danoeh/antennapod/core/util/ShownotesProvider.java diff --git a/core/src/main/java/de/danoeh/antennapod/core/util/StorageUtils.java b/core/src/main/java/de/danoeh/antennapod/core/util/StorageUtils.java new file mode 100644 index 000000000..dea380937 --- /dev/null +++ b/core/src/main/java/de/danoeh/antennapod/core/util/StorageUtils.java @@ -0,0 +1,67 @@ +package de.danoeh.antennapod.core.util; + +import android.app.Activity; +import android.content.Context; +import android.os.Build; +import android.os.StatFs; +import android.util.Log; + +import java.io.File; + +import de.danoeh.antennapod.core.BuildConfig; +import de.danoeh.antennapod.core.ClientConfig; +import de.danoeh.antennapod.core.preferences.UserPreferences; + +/** + * Utility functions for handling storage errors + */ +public class StorageUtils { + private static final String TAG = "StorageUtils"; + + public static boolean storageAvailable(Context context) { + File dir = UserPreferences.getDataFolder(context, null); + if (dir != null) { + return dir.exists() && dir.canRead() && dir.canWrite(); + } else { + if (BuildConfig.DEBUG) + Log.d(TAG, "Storage not available: data folder is null"); + return false; + } + } + + /** + * Checks if external storage is available. If external storage isn't + * available, the current activity is finsished an an error activity is + * launched. + * + * @param activity the activity which would be finished if no storage is + * available + * @return true if external storage is available + */ + public static boolean checkStorageAvailability(Activity activity) { + boolean storageAvailable = storageAvailable(activity); + if (!storageAvailable) { + activity.finish(); + activity.startActivity(ClientConfig.applicationCallbacks.getStorageErrorActivity(activity)); + } + return storageAvailable; + } + + /** + * Get the number of free bytes that are available on the external storage. + */ + public static long getFreeSpaceAvailable() { + StatFs stat = new StatFs(UserPreferences.getDataFolder( + ClientConfig.applicationCallbacks.getApplicationInstance(), null).getAbsolutePath()); + long availableBlocks; + long blockSize; + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR2) { + availableBlocks = stat.getAvailableBlocksLong(); + blockSize = stat.getBlockSizeLong(); + } else { + availableBlocks = stat.getAvailableBlocks(); + blockSize = stat.getBlockSize(); + } + return availableBlocks * blockSize; + } +} diff --git a/core/src/main/java/de/danoeh/antennapod/core/util/ThemeUtils.java b/core/src/main/java/de/danoeh/antennapod/core/util/ThemeUtils.java new file mode 100644 index 000000000..f67367643 --- /dev/null +++ b/core/src/main/java/de/danoeh/antennapod/core/util/ThemeUtils.java @@ -0,0 +1,23 @@ +package de.danoeh.antennapod.core.util; + +import android.util.Log; + +import de.danoeh.antennapod.core.R; +import de.danoeh.antennapod.core.preferences.UserPreferences; + +public class ThemeUtils { + private static final String TAG = "ThemeUtils"; + + public static int getSelectionBackgroundColor() { + int theme = UserPreferences.getTheme(); + if (theme == R.style.Theme_AntennaPod_Dark) { + return R.color.selection_background_color_dark; + } else if (theme == R.style.Theme_AntennaPod_Light) { + return R.color.selection_background_color_light; + } else { + Log.e(TAG, + "getSelectionBackgroundColor could not match the current theme to any color!"); + return R.color.selection_background_color_light; + } + } +} diff --git a/app/src/main/java/de/danoeh/antennapod/core/util/URIUtil.java b/core/src/main/java/de/danoeh/antennapod/core/util/URIUtil.java similarity index 95% rename from app/src/main/java/de/danoeh/antennapod/core/util/URIUtil.java rename to core/src/main/java/de/danoeh/antennapod/core/util/URIUtil.java index c614abbc1..092c06b4a 100644 --- a/app/src/main/java/de/danoeh/antennapod/core/util/URIUtil.java +++ b/core/src/main/java/de/danoeh/antennapod/core/util/URIUtil.java @@ -1,7 +1,7 @@ package de.danoeh.antennapod.core.util; import android.util.Log; -import de.danoeh.antennapod.BuildConfig; +import de.danoeh.antennapod.core.BuildConfig; import java.net.MalformedURLException; import java.net.URI; diff --git a/app/src/main/java/de/danoeh/antennapod/core/util/URLChecker.java b/core/src/main/java/de/danoeh/antennapod/core/util/URLChecker.java similarity index 97% rename from app/src/main/java/de/danoeh/antennapod/core/util/URLChecker.java rename to core/src/main/java/de/danoeh/antennapod/core/util/URLChecker.java index c707e55bc..ca49427c0 100644 --- a/app/src/main/java/de/danoeh/antennapod/core/util/URLChecker.java +++ b/core/src/main/java/de/danoeh/antennapod/core/util/URLChecker.java @@ -4,7 +4,7 @@ import android.util.Log; import org.apache.commons.lang3.StringUtils; -import de.danoeh.antennapod.BuildConfig; +import de.danoeh.antennapod.core.BuildConfig; /** * Provides methods for checking and editing a URL. diff --git a/app/src/main/java/de/danoeh/antennapod/core/util/UndoBarController.java b/core/src/main/java/de/danoeh/antennapod/core/util/UndoBarController.java similarity index 99% rename from app/src/main/java/de/danoeh/antennapod/core/util/UndoBarController.java rename to core/src/main/java/de/danoeh/antennapod/core/util/UndoBarController.java index d0721ac23..5843c5f8f 100644 --- a/app/src/main/java/de/danoeh/antennapod/core/util/UndoBarController.java +++ b/core/src/main/java/de/danoeh/antennapod/core/util/UndoBarController.java @@ -26,7 +26,7 @@ import com.nineoldandroids.animation.Animator; import com.nineoldandroids.animation.AnimatorListenerAdapter; import com.nineoldandroids.view.ViewHelper; import com.nineoldandroids.view.ViewPropertyAnimator; -import de.danoeh.antennapod.R; +import de.danoeh.antennapod.core.R; import static com.nineoldandroids.view.ViewPropertyAnimator.animate; diff --git a/app/src/main/java/de/danoeh/antennapod/core/util/comparator/ChapterStartTimeComparator.java b/core/src/main/java/de/danoeh/antennapod/core/util/comparator/ChapterStartTimeComparator.java similarity index 100% rename from app/src/main/java/de/danoeh/antennapod/core/util/comparator/ChapterStartTimeComparator.java rename to core/src/main/java/de/danoeh/antennapod/core/util/comparator/ChapterStartTimeComparator.java diff --git a/app/src/main/java/de/danoeh/antennapod/core/util/comparator/DownloadStatusComparator.java b/core/src/main/java/de/danoeh/antennapod/core/util/comparator/DownloadStatusComparator.java similarity index 100% rename from app/src/main/java/de/danoeh/antennapod/core/util/comparator/DownloadStatusComparator.java rename to core/src/main/java/de/danoeh/antennapod/core/util/comparator/DownloadStatusComparator.java diff --git a/app/src/main/java/de/danoeh/antennapod/core/util/comparator/FeedItemPubdateComparator.java b/core/src/main/java/de/danoeh/antennapod/core/util/comparator/FeedItemPubdateComparator.java similarity index 100% rename from app/src/main/java/de/danoeh/antennapod/core/util/comparator/FeedItemPubdateComparator.java rename to core/src/main/java/de/danoeh/antennapod/core/util/comparator/FeedItemPubdateComparator.java diff --git a/app/src/main/java/de/danoeh/antennapod/core/util/comparator/PlaybackCompletionDateComparator.java b/core/src/main/java/de/danoeh/antennapod/core/util/comparator/PlaybackCompletionDateComparator.java similarity index 100% rename from app/src/main/java/de/danoeh/antennapod/core/util/comparator/PlaybackCompletionDateComparator.java rename to core/src/main/java/de/danoeh/antennapod/core/util/comparator/PlaybackCompletionDateComparator.java diff --git a/app/src/main/java/de/danoeh/antennapod/core/util/comparator/SearchResultValueComparator.java b/core/src/main/java/de/danoeh/antennapod/core/util/comparator/SearchResultValueComparator.java similarity index 100% rename from app/src/main/java/de/danoeh/antennapod/core/util/comparator/SearchResultValueComparator.java rename to core/src/main/java/de/danoeh/antennapod/core/util/comparator/SearchResultValueComparator.java diff --git a/app/src/main/java/de/danoeh/antennapod/core/util/exception/MediaFileNotFoundException.java b/core/src/main/java/de/danoeh/antennapod/core/util/exception/MediaFileNotFoundException.java similarity index 100% rename from app/src/main/java/de/danoeh/antennapod/core/util/exception/MediaFileNotFoundException.java rename to core/src/main/java/de/danoeh/antennapod/core/util/exception/MediaFileNotFoundException.java diff --git a/app/src/main/java/de/danoeh/antennapod/core/util/flattr/FlattrServiceCreator.java b/core/src/main/java/de/danoeh/antennapod/core/util/flattr/FlattrServiceCreator.java similarity index 93% rename from app/src/main/java/de/danoeh/antennapod/core/util/flattr/FlattrServiceCreator.java rename to core/src/main/java/de/danoeh/antennapod/core/util/flattr/FlattrServiceCreator.java index 5a7cfa47f..e4818214e 100644 --- a/app/src/main/java/de/danoeh/antennapod/core/util/flattr/FlattrServiceCreator.java +++ b/core/src/main/java/de/danoeh/antennapod/core/util/flattr/FlattrServiceCreator.java @@ -1,7 +1,7 @@ package de.danoeh.antennapod.core.util.flattr; import android.util.Log; -import de.danoeh.antennapod.BuildConfig; +import de.danoeh.antennapod.core.BuildConfig; import org.shredzone.flattr4j.FlattrFactory; import org.shredzone.flattr4j.FlattrService; import org.shredzone.flattr4j.oauth.AccessToken; diff --git a/app/src/main/java/de/danoeh/antennapod/core/util/flattr/FlattrStatus.java b/core/src/main/java/de/danoeh/antennapod/core/util/flattr/FlattrStatus.java similarity index 100% rename from app/src/main/java/de/danoeh/antennapod/core/util/flattr/FlattrStatus.java rename to core/src/main/java/de/danoeh/antennapod/core/util/flattr/FlattrStatus.java diff --git a/app/src/main/java/de/danoeh/antennapod/core/util/flattr/FlattrThing.java b/core/src/main/java/de/danoeh/antennapod/core/util/flattr/FlattrThing.java similarity index 100% rename from app/src/main/java/de/danoeh/antennapod/core/util/flattr/FlattrThing.java rename to core/src/main/java/de/danoeh/antennapod/core/util/flattr/FlattrThing.java diff --git a/app/src/main/java/de/danoeh/antennapod/core/util/flattr/FlattrUtils.java b/core/src/main/java/de/danoeh/antennapod/core/util/flattr/FlattrUtils.java similarity index 91% rename from app/src/main/java/de/danoeh/antennapod/core/util/flattr/FlattrUtils.java rename to core/src/main/java/de/danoeh/antennapod/core/util/flattr/FlattrUtils.java index e07ed11e9..42eeeadce 100644 --- a/app/src/main/java/de/danoeh/antennapod/core/util/flattr/FlattrUtils.java +++ b/core/src/main/java/de/danoeh/antennapod/core/util/flattr/FlattrUtils.java @@ -26,10 +26,9 @@ import java.util.EnumSet; import java.util.List; import java.util.TimeZone; -import de.danoeh.antennapod.BuildConfig; -import de.danoeh.antennapod.PodcastApp; -import de.danoeh.antennapod.R; -import de.danoeh.antennapod.activity.FlattrAuthActivity; +import de.danoeh.antennapod.core.BuildConfig; +import de.danoeh.antennapod.core.ClientConfig; +import de.danoeh.antennapod.core.R; import de.danoeh.antennapod.core.asynctask.FlattrTokenFetcher; import de.danoeh.antennapod.core.storage.DBWriter; @@ -53,8 +52,8 @@ public class FlattrUtils { private static volatile AccessToken cachedToken; private static AndroidAuthenticator createAuthenticator() { - return new AndroidAuthenticator(HOST_NAME, BuildConfig.FLATTR_APP_KEY, - BuildConfig.FLATTR_APP_SECRET); + return new AndroidAuthenticator(HOST_NAME, ClientConfig.flattrCallbacks.getFlattrAppKey(), + ClientConfig.flattrCallbacks.getFlattrAppSecret()); } public static void startAuthProcess(Context context) throws FlattrException { @@ -69,7 +68,7 @@ public class FlattrUtils { if (BuildConfig.DEBUG) Log.d(TAG, "Retrieving access token"); String token = PreferenceManager.getDefaultSharedPreferences( - PodcastApp.getInstance()) + ClientConfig.applicationCallbacks.getApplicationInstance()) .getString(PREF_ACCESS_TOKEN, null); if (token != null) { if (BuildConfig.DEBUG) @@ -89,8 +88,8 @@ public class FlattrUtils { * Returns true if FLATTR_APP_KEY and FLATTR_APP_SECRET in BuildConfig are not null and not empty */ public static boolean hasAPICredentials() { - return StringUtils.isNotEmpty(BuildConfig.FLATTR_APP_KEY) - && StringUtils.isNotEmpty(BuildConfig.FLATTR_APP_SECRET); + return StringUtils.isNotEmpty(ClientConfig.flattrCallbacks.getFlattrAppKey()) + && StringUtils.isNotEmpty(ClientConfig.flattrCallbacks.getFlattrAppSecret()); } public static boolean hasToken() { @@ -101,7 +100,7 @@ public class FlattrUtils { if (BuildConfig.DEBUG) Log.d(TAG, "Storing token"); SharedPreferences.Editor editor = PreferenceManager - .getDefaultSharedPreferences(PodcastApp.getInstance()).edit(); + .getDefaultSharedPreferences(ClientConfig.applicationCallbacks.getApplicationInstance()).edit(); if (token != null) { editor.putString(PREF_ACCESS_TOKEN, token.getToken()); } else { @@ -220,7 +219,7 @@ public class FlattrUtils { * Opens a dialog that ask the user to either connect the app with flattr or to be redirected to * the thing's website. * If no API credentials are available, the user will immediately be redirected to the thing's website. - * */ + */ public static void showNoTokenDialogOrRedirect(final Context context, final String url) { if (hasAPICredentials()) { AlertDialog.Builder builder = new AlertDialog.Builder(context); @@ -231,8 +230,8 @@ public class FlattrUtils { @Override public void onClick(DialogInterface dialog, int which) { - context.startActivity(new Intent(context, - FlattrAuthActivity.class)); + context.startActivity( + ClientConfig.flattrCallbacks.getFlattrAuthenticationActivityIntent(context)); } } @@ -267,8 +266,8 @@ public class FlattrUtils { @Override public void onClick(DialogInterface dialog, int which) { - context.startActivity(new Intent(context, - FlattrAuthActivity.class)); + context.startActivity( + ClientConfig.flattrCallbacks.getFlattrAuthenticationActivityIntent(context)); } } diff --git a/app/src/main/java/de/danoeh/antennapod/core/util/flattr/SimpleFlattrThing.java b/core/src/main/java/de/danoeh/antennapod/core/util/flattr/SimpleFlattrThing.java similarity index 100% rename from app/src/main/java/de/danoeh/antennapod/core/util/flattr/SimpleFlattrThing.java rename to core/src/main/java/de/danoeh/antennapod/core/util/flattr/SimpleFlattrThing.java diff --git a/app/src/main/java/de/danoeh/antennapod/core/util/gui/FeedItemUndoToken.java b/core/src/main/java/de/danoeh/antennapod/core/util/gui/FeedItemUndoToken.java similarity index 100% rename from app/src/main/java/de/danoeh/antennapod/core/util/gui/FeedItemUndoToken.java rename to core/src/main/java/de/danoeh/antennapod/core/util/gui/FeedItemUndoToken.java diff --git a/app/src/main/java/de/danoeh/antennapod/core/util/id3reader/ChapterReader.java b/core/src/main/java/de/danoeh/antennapod/core/util/id3reader/ChapterReader.java similarity index 98% rename from app/src/main/java/de/danoeh/antennapod/core/util/id3reader/ChapterReader.java rename to core/src/main/java/de/danoeh/antennapod/core/util/id3reader/ChapterReader.java index a0bce1c79..9f3c4c6d5 100644 --- a/app/src/main/java/de/danoeh/antennapod/core/util/id3reader/ChapterReader.java +++ b/core/src/main/java/de/danoeh/antennapod/core/util/id3reader/ChapterReader.java @@ -1,7 +1,7 @@ package de.danoeh.antennapod.core.util.id3reader; import android.util.Log; -import de.danoeh.antennapod.BuildConfig; +import de.danoeh.antennapod.core.BuildConfig; import de.danoeh.antennapod.core.feed.Chapter; import de.danoeh.antennapod.core.feed.ID3Chapter; import de.danoeh.antennapod.core.util.id3reader.model.FrameHeader; diff --git a/app/src/main/java/de/danoeh/antennapod/core/util/id3reader/ID3Reader.java b/core/src/main/java/de/danoeh/antennapod/core/util/id3reader/ID3Reader.java similarity index 100% rename from app/src/main/java/de/danoeh/antennapod/core/util/id3reader/ID3Reader.java rename to core/src/main/java/de/danoeh/antennapod/core/util/id3reader/ID3Reader.java diff --git a/app/src/main/java/de/danoeh/antennapod/core/util/id3reader/ID3ReaderException.java b/core/src/main/java/de/danoeh/antennapod/core/util/id3reader/ID3ReaderException.java similarity index 100% rename from app/src/main/java/de/danoeh/antennapod/core/util/id3reader/ID3ReaderException.java rename to core/src/main/java/de/danoeh/antennapod/core/util/id3reader/ID3ReaderException.java diff --git a/app/src/main/java/de/danoeh/antennapod/core/util/id3reader/model/FrameHeader.java b/core/src/main/java/de/danoeh/antennapod/core/util/id3reader/model/FrameHeader.java similarity index 100% rename from app/src/main/java/de/danoeh/antennapod/core/util/id3reader/model/FrameHeader.java rename to core/src/main/java/de/danoeh/antennapod/core/util/id3reader/model/FrameHeader.java diff --git a/app/src/main/java/de/danoeh/antennapod/core/util/id3reader/model/Header.java b/core/src/main/java/de/danoeh/antennapod/core/util/id3reader/model/Header.java similarity index 100% rename from app/src/main/java/de/danoeh/antennapod/core/util/id3reader/model/Header.java rename to core/src/main/java/de/danoeh/antennapod/core/util/id3reader/model/Header.java diff --git a/app/src/main/java/de/danoeh/antennapod/core/util/id3reader/model/TagHeader.java b/core/src/main/java/de/danoeh/antennapod/core/util/id3reader/model/TagHeader.java similarity index 100% rename from app/src/main/java/de/danoeh/antennapod/core/util/id3reader/model/TagHeader.java rename to core/src/main/java/de/danoeh/antennapod/core/util/id3reader/model/TagHeader.java diff --git a/app/src/main/java/de/danoeh/antennapod/core/util/playback/AudioPlayer.java b/core/src/main/java/de/danoeh/antennapod/core/util/playback/AudioPlayer.java similarity index 100% rename from app/src/main/java/de/danoeh/antennapod/core/util/playback/AudioPlayer.java rename to core/src/main/java/de/danoeh/antennapod/core/util/playback/AudioPlayer.java diff --git a/app/src/main/java/de/danoeh/antennapod/core/util/playback/ExternalMedia.java b/core/src/main/java/de/danoeh/antennapod/core/util/playback/ExternalMedia.java similarity index 100% rename from app/src/main/java/de/danoeh/antennapod/core/util/playback/ExternalMedia.java rename to core/src/main/java/de/danoeh/antennapod/core/util/playback/ExternalMedia.java diff --git a/app/src/main/java/de/danoeh/antennapod/core/util/playback/IPlayer.java b/core/src/main/java/de/danoeh/antennapod/core/util/playback/IPlayer.java similarity index 100% rename from app/src/main/java/de/danoeh/antennapod/core/util/playback/IPlayer.java rename to core/src/main/java/de/danoeh/antennapod/core/util/playback/IPlayer.java diff --git a/app/src/main/java/de/danoeh/antennapod/core/util/playback/MediaPlayerError.java b/core/src/main/java/de/danoeh/antennapod/core/util/playback/MediaPlayerError.java similarity index 94% rename from app/src/main/java/de/danoeh/antennapod/core/util/playback/MediaPlayerError.java rename to core/src/main/java/de/danoeh/antennapod/core/util/playback/MediaPlayerError.java index a3a907e48..0650225f0 100644 --- a/app/src/main/java/de/danoeh/antennapod/core/util/playback/MediaPlayerError.java +++ b/core/src/main/java/de/danoeh/antennapod/core/util/playback/MediaPlayerError.java @@ -2,7 +2,7 @@ package de.danoeh.antennapod.core.util.playback; import android.content.Context; import android.media.MediaPlayer; -import de.danoeh.antennapod.R; +import de.danoeh.antennapod.core.R; /** Utility class for MediaPlayer errors. */ public class MediaPlayerError { diff --git a/app/src/main/java/de/danoeh/antennapod/core/util/playback/Playable.java b/core/src/main/java/de/danoeh/antennapod/core/util/playback/Playable.java similarity index 100% rename from app/src/main/java/de/danoeh/antennapod/core/util/playback/Playable.java rename to core/src/main/java/de/danoeh/antennapod/core/util/playback/Playable.java diff --git a/app/src/main/java/de/danoeh/antennapod/core/util/playback/PlaybackController.java b/core/src/main/java/de/danoeh/antennapod/core/util/playback/PlaybackController.java similarity index 99% rename from app/src/main/java/de/danoeh/antennapod/core/util/playback/PlaybackController.java rename to core/src/main/java/de/danoeh/antennapod/core/util/playback/PlaybackController.java index 35bd27057..5118d92ae 100644 --- a/app/src/main/java/de/danoeh/antennapod/core/util/playback/PlaybackController.java +++ b/core/src/main/java/de/danoeh/antennapod/core/util/playback/PlaybackController.java @@ -19,8 +19,8 @@ import android.widget.TextView; import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.Validate; -import de.danoeh.antennapod.BuildConfig; -import de.danoeh.antennapod.R; +import de.danoeh.antennapod.core.BuildConfig; +import de.danoeh.antennapod.core.R; import de.danoeh.antennapod.core.feed.Chapter; import de.danoeh.antennapod.core.feed.FeedMedia; import de.danoeh.antennapod.core.feed.MediaType; diff --git a/app/src/main/java/de/danoeh/antennapod/core/util/playback/Timeline.java b/core/src/main/java/de/danoeh/antennapod/core/util/playback/Timeline.java similarity index 99% rename from app/src/main/java/de/danoeh/antennapod/core/util/playback/Timeline.java rename to core/src/main/java/de/danoeh/antennapod/core/util/playback/Timeline.java index 5177bbca3..443ff0ad1 100644 --- a/app/src/main/java/de/danoeh/antennapod/core/util/playback/Timeline.java +++ b/core/src/main/java/de/danoeh/antennapod/core/util/playback/Timeline.java @@ -14,7 +14,7 @@ import org.jsoup.select.Elements; import java.util.regex.Matcher; import java.util.regex.Pattern; -import de.danoeh.antennapod.BuildConfig; +import de.danoeh.antennapod.core.BuildConfig; import de.danoeh.antennapod.core.util.Converter; import de.danoeh.antennapod.core.util.ShownotesProvider; diff --git a/app/src/main/java/de/danoeh/antennapod/core/util/playback/VideoPlayer.java b/core/src/main/java/de/danoeh/antennapod/core/util/playback/VideoPlayer.java similarity index 100% rename from app/src/main/java/de/danoeh/antennapod/core/util/playback/VideoPlayer.java rename to core/src/main/java/de/danoeh/antennapod/core/util/playback/VideoPlayer.java diff --git a/app/src/main/java/de/danoeh/antennapod/core/util/syndication/FeedDiscoverer.java b/core/src/main/java/de/danoeh/antennapod/core/util/syndication/FeedDiscoverer.java similarity index 100% rename from app/src/main/java/de/danoeh/antennapod/core/util/syndication/FeedDiscoverer.java rename to core/src/main/java/de/danoeh/antennapod/core/util/syndication/FeedDiscoverer.java diff --git a/app/src/main/java/de/danoeh/antennapod/core/util/vorbiscommentreader/OggInputStream.java b/core/src/main/java/de/danoeh/antennapod/core/util/vorbiscommentreader/OggInputStream.java similarity index 100% rename from app/src/main/java/de/danoeh/antennapod/core/util/vorbiscommentreader/OggInputStream.java rename to core/src/main/java/de/danoeh/antennapod/core/util/vorbiscommentreader/OggInputStream.java diff --git a/app/src/main/java/de/danoeh/antennapod/core/util/vorbiscommentreader/VorbisCommentChapterReader.java b/core/src/main/java/de/danoeh/antennapod/core/util/vorbiscommentreader/VorbisCommentChapterReader.java similarity index 98% rename from app/src/main/java/de/danoeh/antennapod/core/util/vorbiscommentreader/VorbisCommentChapterReader.java rename to core/src/main/java/de/danoeh/antennapod/core/util/vorbiscommentreader/VorbisCommentChapterReader.java index a6934c60e..c4961a3ab 100644 --- a/app/src/main/java/de/danoeh/antennapod/core/util/vorbiscommentreader/VorbisCommentChapterReader.java +++ b/core/src/main/java/de/danoeh/antennapod/core/util/vorbiscommentreader/VorbisCommentChapterReader.java @@ -1,7 +1,7 @@ package de.danoeh.antennapod.core.util.vorbiscommentreader; import android.util.Log; -import de.danoeh.antennapod.BuildConfig; +import de.danoeh.antennapod.core.BuildConfig; import de.danoeh.antennapod.core.feed.Chapter; import de.danoeh.antennapod.core.feed.VorbisCommentChapter; diff --git a/app/src/main/java/de/danoeh/antennapod/core/util/vorbiscommentreader/VorbisCommentHeader.java b/core/src/main/java/de/danoeh/antennapod/core/util/vorbiscommentreader/VorbisCommentHeader.java similarity index 100% rename from app/src/main/java/de/danoeh/antennapod/core/util/vorbiscommentreader/VorbisCommentHeader.java rename to core/src/main/java/de/danoeh/antennapod/core/util/vorbiscommentreader/VorbisCommentHeader.java diff --git a/app/src/main/java/de/danoeh/antennapod/core/util/vorbiscommentreader/VorbisCommentReader.java b/core/src/main/java/de/danoeh/antennapod/core/util/vorbiscommentreader/VorbisCommentReader.java similarity index 100% rename from app/src/main/java/de/danoeh/antennapod/core/util/vorbiscommentreader/VorbisCommentReader.java rename to core/src/main/java/de/danoeh/antennapod/core/util/vorbiscommentreader/VorbisCommentReader.java diff --git a/app/src/main/java/de/danoeh/antennapod/core/util/vorbiscommentreader/VorbisCommentReaderException.java b/core/src/main/java/de/danoeh/antennapod/core/util/vorbiscommentreader/VorbisCommentReaderException.java similarity index 100% rename from app/src/main/java/de/danoeh/antennapod/core/util/vorbiscommentreader/VorbisCommentReaderException.java rename to core/src/main/java/de/danoeh/antennapod/core/util/vorbiscommentreader/VorbisCommentReaderException.java diff --git a/app/src/main/res/drawable-hdpi-v11/ic_stat_antenna.png b/core/src/main/res/drawable-hdpi-v11/ic_stat_antenna.png similarity index 100% rename from app/src/main/res/drawable-hdpi-v11/ic_stat_antenna.png rename to core/src/main/res/drawable-hdpi-v11/ic_stat_antenna.png diff --git a/app/src/main/res/drawable-hdpi-v11/ic_stat_authentication.png b/core/src/main/res/drawable-hdpi-v11/ic_stat_authentication.png similarity index 100% rename from app/src/main/res/drawable-hdpi-v11/ic_stat_authentication.png rename to core/src/main/res/drawable-hdpi-v11/ic_stat_authentication.png diff --git a/app/src/main/res/drawable-hdpi-v11/stat_notify_sync.png b/core/src/main/res/drawable-hdpi-v11/stat_notify_sync.png similarity index 100% rename from app/src/main/res/drawable-hdpi-v11/stat_notify_sync.png rename to core/src/main/res/drawable-hdpi-v11/stat_notify_sync.png diff --git a/app/src/main/res/drawable-hdpi-v11/stat_notify_sync_error.png b/core/src/main/res/drawable-hdpi-v11/stat_notify_sync_error.png similarity index 100% rename from app/src/main/res/drawable-hdpi-v11/stat_notify_sync_error.png rename to core/src/main/res/drawable-hdpi-v11/stat_notify_sync_error.png diff --git a/app/src/main/res/drawable-hdpi/action_about.png b/core/src/main/res/drawable-hdpi/action_about.png similarity index 100% rename from app/src/main/res/drawable-hdpi/action_about.png rename to core/src/main/res/drawable-hdpi/action_about.png diff --git a/app/src/main/res/drawable-hdpi/action_about_dark.png b/core/src/main/res/drawable-hdpi/action_about_dark.png similarity index 100% rename from app/src/main/res/drawable-hdpi/action_about_dark.png rename to core/src/main/res/drawable-hdpi/action_about_dark.png diff --git a/app/src/main/res/drawable-hdpi/action_search.png b/core/src/main/res/drawable-hdpi/action_search.png similarity index 100% rename from app/src/main/res/drawable-hdpi/action_search.png rename to core/src/main/res/drawable-hdpi/action_search.png diff --git a/app/src/main/res/drawable-hdpi/action_search_dark.png b/core/src/main/res/drawable-hdpi/action_search_dark.png similarity index 100% rename from app/src/main/res/drawable-hdpi/action_search_dark.png rename to core/src/main/res/drawable-hdpi/action_search_dark.png diff --git a/app/src/main/res/drawable-hdpi/action_settings.png b/core/src/main/res/drawable-hdpi/action_settings.png similarity index 100% rename from app/src/main/res/drawable-hdpi/action_settings.png rename to core/src/main/res/drawable-hdpi/action_settings.png diff --git a/app/src/main/res/drawable-hdpi/action_settings_dark.png b/core/src/main/res/drawable-hdpi/action_settings_dark.png similarity index 100% rename from app/src/main/res/drawable-hdpi/action_settings_dark.png rename to core/src/main/res/drawable-hdpi/action_settings_dark.png diff --git a/app/src/main/res/drawable-hdpi/action_stream.png b/core/src/main/res/drawable-hdpi/action_stream.png similarity index 100% rename from app/src/main/res/drawable-hdpi/action_stream.png rename to core/src/main/res/drawable-hdpi/action_stream.png diff --git a/app/src/main/res/drawable-hdpi/action_stream_dark.png b/core/src/main/res/drawable-hdpi/action_stream_dark.png similarity index 100% rename from app/src/main/res/drawable-hdpi/action_stream_dark.png rename to core/src/main/res/drawable-hdpi/action_stream_dark.png diff --git a/app/src/main/res/drawable-hdpi/av_download.png b/core/src/main/res/drawable-hdpi/av_download.png similarity index 100% rename from app/src/main/res/drawable-hdpi/av_download.png rename to core/src/main/res/drawable-hdpi/av_download.png diff --git a/app/src/main/res/drawable-hdpi/av_download_dark.png b/core/src/main/res/drawable-hdpi/av_download_dark.png similarity index 100% rename from app/src/main/res/drawable-hdpi/av_download_dark.png rename to core/src/main/res/drawable-hdpi/av_download_dark.png diff --git a/app/src/main/res/drawable-hdpi/av_fast_forward.png b/core/src/main/res/drawable-hdpi/av_fast_forward.png similarity index 100% rename from app/src/main/res/drawable-hdpi/av_fast_forward.png rename to core/src/main/res/drawable-hdpi/av_fast_forward.png diff --git a/app/src/main/res/drawable-hdpi/av_fast_forward_dark.png b/core/src/main/res/drawable-hdpi/av_fast_forward_dark.png similarity index 100% rename from app/src/main/res/drawable-hdpi/av_fast_forward_dark.png rename to core/src/main/res/drawable-hdpi/av_fast_forward_dark.png diff --git a/app/src/main/res/drawable-hdpi/av_pause.png b/core/src/main/res/drawable-hdpi/av_pause.png similarity index 100% rename from app/src/main/res/drawable-hdpi/av_pause.png rename to core/src/main/res/drawable-hdpi/av_pause.png diff --git a/app/src/main/res/drawable-hdpi/av_pause_dark.png b/core/src/main/res/drawable-hdpi/av_pause_dark.png similarity index 100% rename from app/src/main/res/drawable-hdpi/av_pause_dark.png rename to core/src/main/res/drawable-hdpi/av_pause_dark.png diff --git a/app/src/main/res/drawable-hdpi/av_play.png b/core/src/main/res/drawable-hdpi/av_play.png similarity index 100% rename from app/src/main/res/drawable-hdpi/av_play.png rename to core/src/main/res/drawable-hdpi/av_play.png diff --git a/app/src/main/res/drawable-hdpi/av_play_dark.png b/core/src/main/res/drawable-hdpi/av_play_dark.png similarity index 100% rename from app/src/main/res/drawable-hdpi/av_play_dark.png rename to core/src/main/res/drawable-hdpi/av_play_dark.png diff --git a/app/src/main/res/drawable-hdpi/av_rewind.png b/core/src/main/res/drawable-hdpi/av_rewind.png similarity index 100% rename from app/src/main/res/drawable-hdpi/av_rewind.png rename to core/src/main/res/drawable-hdpi/av_rewind.png diff --git a/app/src/main/res/drawable-hdpi/av_rewind_dark.png b/core/src/main/res/drawable-hdpi/av_rewind_dark.png similarity index 100% rename from app/src/main/res/drawable-hdpi/av_rewind_dark.png rename to core/src/main/res/drawable-hdpi/av_rewind_dark.png diff --git a/app/src/main/res/drawable-hdpi/content_discard.png b/core/src/main/res/drawable-hdpi/content_discard.png similarity index 100% rename from app/src/main/res/drawable-hdpi/content_discard.png rename to core/src/main/res/drawable-hdpi/content_discard.png diff --git a/app/src/main/res/drawable-hdpi/content_discard_dark.png b/core/src/main/res/drawable-hdpi/content_discard_dark.png similarity index 100% rename from app/src/main/res/drawable-hdpi/content_discard_dark.png rename to core/src/main/res/drawable-hdpi/content_discard_dark.png diff --git a/app/src/main/res/drawable-hdpi/content_new.png b/core/src/main/res/drawable-hdpi/content_new.png similarity index 100% rename from app/src/main/res/drawable-hdpi/content_new.png rename to core/src/main/res/drawable-hdpi/content_new.png diff --git a/app/src/main/res/drawable-hdpi/content_new_dark.png b/core/src/main/res/drawable-hdpi/content_new_dark.png similarity index 100% rename from app/src/main/res/drawable-hdpi/content_new_dark.png rename to core/src/main/res/drawable-hdpi/content_new_dark.png diff --git a/app/src/main/res/drawable-hdpi/default_cover.png b/core/src/main/res/drawable-hdpi/default_cover.png similarity index 100% rename from app/src/main/res/drawable-hdpi/default_cover.png rename to core/src/main/res/drawable-hdpi/default_cover.png diff --git a/app/src/main/res/drawable-hdpi/default_cover_dark.png b/core/src/main/res/drawable-hdpi/default_cover_dark.png similarity index 100% rename from app/src/main/res/drawable-hdpi/default_cover_dark.png rename to core/src/main/res/drawable-hdpi/default_cover_dark.png diff --git a/app/src/main/res/drawable-hdpi/device_access_time.png b/core/src/main/res/drawable-hdpi/device_access_time.png similarity index 100% rename from app/src/main/res/drawable-hdpi/device_access_time.png rename to core/src/main/res/drawable-hdpi/device_access_time.png diff --git a/app/src/main/res/drawable-hdpi/device_access_time_dark.png b/core/src/main/res/drawable-hdpi/device_access_time_dark.png similarity index 100% rename from app/src/main/res/drawable-hdpi/device_access_time_dark.png rename to core/src/main/res/drawable-hdpi/device_access_time_dark.png diff --git a/app/src/main/res/drawable-hdpi/ic_action_overflow.png b/core/src/main/res/drawable-hdpi/ic_action_overflow.png similarity index 100% rename from app/src/main/res/drawable-hdpi/ic_action_overflow.png rename to core/src/main/res/drawable-hdpi/ic_action_overflow.png diff --git a/app/src/main/res/drawable-hdpi/ic_action_overflow_dark.png b/core/src/main/res/drawable-hdpi/ic_action_overflow_dark.png similarity index 100% rename from app/src/main/res/drawable-hdpi/ic_action_overflow_dark.png rename to core/src/main/res/drawable-hdpi/ic_action_overflow_dark.png diff --git a/app/src/main/res/drawable-hdpi/ic_action_pause_over_video.png b/core/src/main/res/drawable-hdpi/ic_action_pause_over_video.png similarity index 100% rename from app/src/main/res/drawable-hdpi/ic_action_pause_over_video.png rename to core/src/main/res/drawable-hdpi/ic_action_pause_over_video.png diff --git a/app/src/main/res/drawable-hdpi/ic_action_play_over_video.png b/core/src/main/res/drawable-hdpi/ic_action_play_over_video.png similarity index 100% rename from app/src/main/res/drawable-hdpi/ic_action_play_over_video.png rename to core/src/main/res/drawable-hdpi/ic_action_play_over_video.png diff --git a/app/src/main/res/drawable-hdpi/ic_drag_handle.png b/core/src/main/res/drawable-hdpi/ic_drag_handle.png similarity index 100% rename from app/src/main/res/drawable-hdpi/ic_drag_handle.png rename to core/src/main/res/drawable-hdpi/ic_drag_handle.png diff --git a/app/src/main/res/drawable-hdpi/ic_drag_handle_dark.png b/core/src/main/res/drawable-hdpi/ic_drag_handle_dark.png similarity index 100% rename from app/src/main/res/drawable-hdpi/ic_drag_handle_dark.png rename to core/src/main/res/drawable-hdpi/ic_drag_handle_dark.png diff --git a/app/src/main/res/drawable-hdpi/ic_drawer.png b/core/src/main/res/drawable-hdpi/ic_drawer.png similarity index 100% rename from app/src/main/res/drawable-hdpi/ic_drawer.png rename to core/src/main/res/drawable-hdpi/ic_drawer.png diff --git a/app/src/main/res/drawable-hdpi/ic_drawer_dark.png b/core/src/main/res/drawable-hdpi/ic_drawer_dark.png similarity index 100% rename from app/src/main/res/drawable-hdpi/ic_drawer_dark.png rename to core/src/main/res/drawable-hdpi/ic_drawer_dark.png diff --git a/app/src/main/res/drawable-hdpi/ic_launcher.png b/core/src/main/res/drawable-hdpi/ic_launcher.png similarity index 100% rename from app/src/main/res/drawable-hdpi/ic_launcher.png rename to core/src/main/res/drawable-hdpi/ic_launcher.png diff --git a/app/src/main/res/drawable-hdpi/ic_new.png b/core/src/main/res/drawable-hdpi/ic_new.png similarity index 100% rename from app/src/main/res/drawable-hdpi/ic_new.png rename to core/src/main/res/drawable-hdpi/ic_new.png diff --git a/app/src/main/res/drawable-hdpi/ic_new_dark.png b/core/src/main/res/drawable-hdpi/ic_new_dark.png similarity index 100% rename from app/src/main/res/drawable-hdpi/ic_new_dark.png rename to core/src/main/res/drawable-hdpi/ic_new_dark.png diff --git a/app/src/main/res/drawable-hdpi/ic_stat_antenna.png b/core/src/main/res/drawable-hdpi/ic_stat_antenna.png similarity index 100% rename from app/src/main/res/drawable-hdpi/ic_stat_antenna.png rename to core/src/main/res/drawable-hdpi/ic_stat_antenna.png diff --git a/app/src/main/res/drawable-hdpi/ic_stat_authentication.png b/core/src/main/res/drawable-hdpi/ic_stat_authentication.png similarity index 100% rename from app/src/main/res/drawable-hdpi/ic_stat_authentication.png rename to core/src/main/res/drawable-hdpi/ic_stat_authentication.png diff --git a/app/src/main/res/drawable-hdpi/location_web_site.png b/core/src/main/res/drawable-hdpi/location_web_site.png similarity index 100% rename from app/src/main/res/drawable-hdpi/location_web_site.png rename to core/src/main/res/drawable-hdpi/location_web_site.png diff --git a/app/src/main/res/drawable-hdpi/location_web_site_dark.png b/core/src/main/res/drawable-hdpi/location_web_site_dark.png similarity index 100% rename from app/src/main/res/drawable-hdpi/location_web_site_dark.png rename to core/src/main/res/drawable-hdpi/location_web_site_dark.png diff --git a/app/src/main/res/drawable-hdpi/navigation_accept.png b/core/src/main/res/drawable-hdpi/navigation_accept.png similarity index 100% rename from app/src/main/res/drawable-hdpi/navigation_accept.png rename to core/src/main/res/drawable-hdpi/navigation_accept.png diff --git a/app/src/main/res/drawable-hdpi/navigation_accept_dark.png b/core/src/main/res/drawable-hdpi/navigation_accept_dark.png similarity index 100% rename from app/src/main/res/drawable-hdpi/navigation_accept_dark.png rename to core/src/main/res/drawable-hdpi/navigation_accept_dark.png diff --git a/app/src/main/res/drawable-hdpi/navigation_cancel.png b/core/src/main/res/drawable-hdpi/navigation_cancel.png similarity index 100% rename from app/src/main/res/drawable-hdpi/navigation_cancel.png rename to core/src/main/res/drawable-hdpi/navigation_cancel.png diff --git a/app/src/main/res/drawable-hdpi/navigation_cancel_dark.png b/core/src/main/res/drawable-hdpi/navigation_cancel_dark.png similarity index 100% rename from app/src/main/res/drawable-hdpi/navigation_cancel_dark.png rename to core/src/main/res/drawable-hdpi/navigation_cancel_dark.png diff --git a/app/src/main/res/drawable-hdpi/navigation_chapters.png b/core/src/main/res/drawable-hdpi/navigation_chapters.png similarity index 100% rename from app/src/main/res/drawable-hdpi/navigation_chapters.png rename to core/src/main/res/drawable-hdpi/navigation_chapters.png diff --git a/app/src/main/res/drawable-hdpi/navigation_chapters_dark.png b/core/src/main/res/drawable-hdpi/navigation_chapters_dark.png similarity index 100% rename from app/src/main/res/drawable-hdpi/navigation_chapters_dark.png rename to core/src/main/res/drawable-hdpi/navigation_chapters_dark.png diff --git a/app/src/main/res/drawable-hdpi/navigation_collapse.png b/core/src/main/res/drawable-hdpi/navigation_collapse.png similarity index 100% rename from app/src/main/res/drawable-hdpi/navigation_collapse.png rename to core/src/main/res/drawable-hdpi/navigation_collapse.png diff --git a/app/src/main/res/drawable-hdpi/navigation_collapse_dark.png b/core/src/main/res/drawable-hdpi/navigation_collapse_dark.png similarity index 100% rename from app/src/main/res/drawable-hdpi/navigation_collapse_dark.png rename to core/src/main/res/drawable-hdpi/navigation_collapse_dark.png diff --git a/app/src/main/res/drawable-hdpi/navigation_expand.png b/core/src/main/res/drawable-hdpi/navigation_expand.png similarity index 100% rename from app/src/main/res/drawable-hdpi/navigation_expand.png rename to core/src/main/res/drawable-hdpi/navigation_expand.png diff --git a/app/src/main/res/drawable-hdpi/navigation_expand_dark.png b/core/src/main/res/drawable-hdpi/navigation_expand_dark.png similarity index 100% rename from app/src/main/res/drawable-hdpi/navigation_expand_dark.png rename to core/src/main/res/drawable-hdpi/navigation_expand_dark.png diff --git a/app/src/main/res/drawable-hdpi/navigation_refresh.png b/core/src/main/res/drawable-hdpi/navigation_refresh.png similarity index 100% rename from app/src/main/res/drawable-hdpi/navigation_refresh.png rename to core/src/main/res/drawable-hdpi/navigation_refresh.png diff --git a/app/src/main/res/drawable-hdpi/navigation_refresh_dark.png b/core/src/main/res/drawable-hdpi/navigation_refresh_dark.png similarity index 100% rename from app/src/main/res/drawable-hdpi/navigation_refresh_dark.png rename to core/src/main/res/drawable-hdpi/navigation_refresh_dark.png diff --git a/app/src/main/res/drawable-hdpi/navigation_shownotes.png b/core/src/main/res/drawable-hdpi/navigation_shownotes.png similarity index 100% rename from app/src/main/res/drawable-hdpi/navigation_shownotes.png rename to core/src/main/res/drawable-hdpi/navigation_shownotes.png diff --git a/app/src/main/res/drawable-hdpi/navigation_shownotes_dark.png b/core/src/main/res/drawable-hdpi/navigation_shownotes_dark.png similarity index 100% rename from app/src/main/res/drawable-hdpi/navigation_shownotes_dark.png rename to core/src/main/res/drawable-hdpi/navigation_shownotes_dark.png diff --git a/app/src/main/res/drawable-hdpi/navigation_up.png b/core/src/main/res/drawable-hdpi/navigation_up.png similarity index 100% rename from app/src/main/res/drawable-hdpi/navigation_up.png rename to core/src/main/res/drawable-hdpi/navigation_up.png diff --git a/app/src/main/res/drawable-hdpi/navigation_up_dark.png b/core/src/main/res/drawable-hdpi/navigation_up_dark.png similarity index 100% rename from app/src/main/res/drawable-hdpi/navigation_up_dark.png rename to core/src/main/res/drawable-hdpi/navigation_up_dark.png diff --git a/app/src/main/res/drawable-hdpi/social_share.png b/core/src/main/res/drawable-hdpi/social_share.png similarity index 100% rename from app/src/main/res/drawable-hdpi/social_share.png rename to core/src/main/res/drawable-hdpi/social_share.png diff --git a/app/src/main/res/drawable-hdpi/social_share_dark.png b/core/src/main/res/drawable-hdpi/social_share_dark.png similarity index 100% rename from app/src/main/res/drawable-hdpi/social_share_dark.png rename to core/src/main/res/drawable-hdpi/social_share_dark.png diff --git a/app/src/main/res/drawable-hdpi/spinner_button.9.png b/core/src/main/res/drawable-hdpi/spinner_button.9.png similarity index 100% rename from app/src/main/res/drawable-hdpi/spinner_button.9.png rename to core/src/main/res/drawable-hdpi/spinner_button.9.png diff --git a/app/src/main/res/drawable-hdpi/spinner_button_dark.9.png b/core/src/main/res/drawable-hdpi/spinner_button_dark.9.png similarity index 100% rename from app/src/main/res/drawable-hdpi/spinner_button_dark.9.png rename to core/src/main/res/drawable-hdpi/spinner_button_dark.9.png diff --git a/app/src/main/res/drawable-hdpi/stat_notify_sync.png b/core/src/main/res/drawable-hdpi/stat_notify_sync.png similarity index 100% rename from app/src/main/res/drawable-hdpi/stat_notify_sync.png rename to core/src/main/res/drawable-hdpi/stat_notify_sync.png diff --git a/app/src/main/res/drawable-hdpi/stat_notify_sync_error.png b/core/src/main/res/drawable-hdpi/stat_notify_sync_error.png similarity index 100% rename from app/src/main/res/drawable-hdpi/stat_notify_sync_error.png rename to core/src/main/res/drawable-hdpi/stat_notify_sync_error.png diff --git a/app/src/main/res/drawable-hdpi/stat_playlist.png b/core/src/main/res/drawable-hdpi/stat_playlist.png similarity index 100% rename from app/src/main/res/drawable-hdpi/stat_playlist.png rename to core/src/main/res/drawable-hdpi/stat_playlist.png diff --git a/app/src/main/res/drawable-hdpi/stat_playlist_dark.png b/core/src/main/res/drawable-hdpi/stat_playlist_dark.png similarity index 100% rename from app/src/main/res/drawable-hdpi/stat_playlist_dark.png rename to core/src/main/res/drawable-hdpi/stat_playlist_dark.png diff --git a/app/src/main/res/drawable-hdpi/type_audio.png b/core/src/main/res/drawable-hdpi/type_audio.png similarity index 100% rename from app/src/main/res/drawable-hdpi/type_audio.png rename to core/src/main/res/drawable-hdpi/type_audio.png diff --git a/app/src/main/res/drawable-hdpi/type_audio_dark.png b/core/src/main/res/drawable-hdpi/type_audio_dark.png similarity index 100% rename from app/src/main/res/drawable-hdpi/type_audio_dark.png rename to core/src/main/res/drawable-hdpi/type_audio_dark.png diff --git a/app/src/main/res/drawable-hdpi/type_video.png b/core/src/main/res/drawable-hdpi/type_video.png similarity index 100% rename from app/src/main/res/drawable-hdpi/type_video.png rename to core/src/main/res/drawable-hdpi/type_video.png diff --git a/app/src/main/res/drawable-hdpi/type_video_dark.png b/core/src/main/res/drawable-hdpi/type_video_dark.png similarity index 100% rename from app/src/main/res/drawable-hdpi/type_video_dark.png rename to core/src/main/res/drawable-hdpi/type_video_dark.png diff --git a/app/src/main/res/drawable-ldpi-v11/ic_stat_antenna.png b/core/src/main/res/drawable-ldpi-v11/ic_stat_antenna.png similarity index 100% rename from app/src/main/res/drawable-ldpi-v11/ic_stat_antenna.png rename to core/src/main/res/drawable-ldpi-v11/ic_stat_antenna.png diff --git a/app/src/main/res/drawable-ldpi/action_stream.png b/core/src/main/res/drawable-ldpi/action_stream.png similarity index 100% rename from app/src/main/res/drawable-ldpi/action_stream.png rename to core/src/main/res/drawable-ldpi/action_stream.png diff --git a/app/src/main/res/drawable-ldpi/action_stream_dark.png b/core/src/main/res/drawable-ldpi/action_stream_dark.png similarity index 100% rename from app/src/main/res/drawable-ldpi/action_stream_dark.png rename to core/src/main/res/drawable-ldpi/action_stream_dark.png diff --git a/app/src/main/res/drawable-ldpi/ic_launcher.png b/core/src/main/res/drawable-ldpi/ic_launcher.png similarity index 100% rename from app/src/main/res/drawable-ldpi/ic_launcher.png rename to core/src/main/res/drawable-ldpi/ic_launcher.png diff --git a/app/src/main/res/drawable-ldpi/ic_stat_antenna.png b/core/src/main/res/drawable-ldpi/ic_stat_antenna.png similarity index 100% rename from app/src/main/res/drawable-ldpi/ic_stat_antenna.png rename to core/src/main/res/drawable-ldpi/ic_stat_antenna.png diff --git a/app/src/main/res/drawable-ldpi/stat_playlist.png b/core/src/main/res/drawable-ldpi/stat_playlist.png similarity index 100% rename from app/src/main/res/drawable-ldpi/stat_playlist.png rename to core/src/main/res/drawable-ldpi/stat_playlist.png diff --git a/app/src/main/res/drawable-ldpi/stat_playlist_dark.png b/core/src/main/res/drawable-ldpi/stat_playlist_dark.png similarity index 100% rename from app/src/main/res/drawable-ldpi/stat_playlist_dark.png rename to core/src/main/res/drawable-ldpi/stat_playlist_dark.png diff --git a/app/src/main/res/drawable-mdpi-v11/ic_stat_antenna.png b/core/src/main/res/drawable-mdpi-v11/ic_stat_antenna.png similarity index 100% rename from app/src/main/res/drawable-mdpi-v11/ic_stat_antenna.png rename to core/src/main/res/drawable-mdpi-v11/ic_stat_antenna.png diff --git a/app/src/main/res/drawable-mdpi-v11/ic_stat_authentication.png b/core/src/main/res/drawable-mdpi-v11/ic_stat_authentication.png similarity index 100% rename from app/src/main/res/drawable-mdpi-v11/ic_stat_authentication.png rename to core/src/main/res/drawable-mdpi-v11/ic_stat_authentication.png diff --git a/app/src/main/res/drawable-mdpi-v11/stat_notify_sync.png b/core/src/main/res/drawable-mdpi-v11/stat_notify_sync.png similarity index 100% rename from app/src/main/res/drawable-mdpi-v11/stat_notify_sync.png rename to core/src/main/res/drawable-mdpi-v11/stat_notify_sync.png diff --git a/app/src/main/res/drawable-mdpi-v11/stat_notify_sync_error.png b/core/src/main/res/drawable-mdpi-v11/stat_notify_sync_error.png similarity index 100% rename from app/src/main/res/drawable-mdpi-v11/stat_notify_sync_error.png rename to core/src/main/res/drawable-mdpi-v11/stat_notify_sync_error.png diff --git a/app/src/main/res/drawable-mdpi/action_about.png b/core/src/main/res/drawable-mdpi/action_about.png similarity index 100% rename from app/src/main/res/drawable-mdpi/action_about.png rename to core/src/main/res/drawable-mdpi/action_about.png diff --git a/app/src/main/res/drawable-mdpi/action_about_dark.png b/core/src/main/res/drawable-mdpi/action_about_dark.png similarity index 100% rename from app/src/main/res/drawable-mdpi/action_about_dark.png rename to core/src/main/res/drawable-mdpi/action_about_dark.png diff --git a/app/src/main/res/drawable-mdpi/action_search.png b/core/src/main/res/drawable-mdpi/action_search.png similarity index 100% rename from app/src/main/res/drawable-mdpi/action_search.png rename to core/src/main/res/drawable-mdpi/action_search.png diff --git a/app/src/main/res/drawable-mdpi/action_search_dark.png b/core/src/main/res/drawable-mdpi/action_search_dark.png similarity index 100% rename from app/src/main/res/drawable-mdpi/action_search_dark.png rename to core/src/main/res/drawable-mdpi/action_search_dark.png diff --git a/app/src/main/res/drawable-mdpi/action_settings.png b/core/src/main/res/drawable-mdpi/action_settings.png similarity index 100% rename from app/src/main/res/drawable-mdpi/action_settings.png rename to core/src/main/res/drawable-mdpi/action_settings.png diff --git a/app/src/main/res/drawable-mdpi/action_settings_dark.png b/core/src/main/res/drawable-mdpi/action_settings_dark.png similarity index 100% rename from app/src/main/res/drawable-mdpi/action_settings_dark.png rename to core/src/main/res/drawable-mdpi/action_settings_dark.png diff --git a/app/src/main/res/drawable-mdpi/action_stream.png b/core/src/main/res/drawable-mdpi/action_stream.png similarity index 100% rename from app/src/main/res/drawable-mdpi/action_stream.png rename to core/src/main/res/drawable-mdpi/action_stream.png diff --git a/app/src/main/res/drawable-mdpi/action_stream_dark.png b/core/src/main/res/drawable-mdpi/action_stream_dark.png similarity index 100% rename from app/src/main/res/drawable-mdpi/action_stream_dark.png rename to core/src/main/res/drawable-mdpi/action_stream_dark.png diff --git a/app/src/main/res/drawable-mdpi/av_download.png b/core/src/main/res/drawable-mdpi/av_download.png similarity index 100% rename from app/src/main/res/drawable-mdpi/av_download.png rename to core/src/main/res/drawable-mdpi/av_download.png diff --git a/app/src/main/res/drawable-mdpi/av_download_dark.png b/core/src/main/res/drawable-mdpi/av_download_dark.png similarity index 100% rename from app/src/main/res/drawable-mdpi/av_download_dark.png rename to core/src/main/res/drawable-mdpi/av_download_dark.png diff --git a/app/src/main/res/drawable-mdpi/av_fast_forward.png b/core/src/main/res/drawable-mdpi/av_fast_forward.png similarity index 100% rename from app/src/main/res/drawable-mdpi/av_fast_forward.png rename to core/src/main/res/drawable-mdpi/av_fast_forward.png diff --git a/app/src/main/res/drawable-mdpi/av_fast_forward_dark.png b/core/src/main/res/drawable-mdpi/av_fast_forward_dark.png similarity index 100% rename from app/src/main/res/drawable-mdpi/av_fast_forward_dark.png rename to core/src/main/res/drawable-mdpi/av_fast_forward_dark.png diff --git a/app/src/main/res/drawable-mdpi/av_pause.png b/core/src/main/res/drawable-mdpi/av_pause.png similarity index 100% rename from app/src/main/res/drawable-mdpi/av_pause.png rename to core/src/main/res/drawable-mdpi/av_pause.png diff --git a/app/src/main/res/drawable-mdpi/av_pause_dark.png b/core/src/main/res/drawable-mdpi/av_pause_dark.png similarity index 100% rename from app/src/main/res/drawable-mdpi/av_pause_dark.png rename to core/src/main/res/drawable-mdpi/av_pause_dark.png diff --git a/app/src/main/res/drawable-mdpi/av_play.png b/core/src/main/res/drawable-mdpi/av_play.png similarity index 100% rename from app/src/main/res/drawable-mdpi/av_play.png rename to core/src/main/res/drawable-mdpi/av_play.png diff --git a/app/src/main/res/drawable-mdpi/av_play_dark.png b/core/src/main/res/drawable-mdpi/av_play_dark.png similarity index 100% rename from app/src/main/res/drawable-mdpi/av_play_dark.png rename to core/src/main/res/drawable-mdpi/av_play_dark.png diff --git a/app/src/main/res/drawable-mdpi/av_rewind.png b/core/src/main/res/drawable-mdpi/av_rewind.png similarity index 100% rename from app/src/main/res/drawable-mdpi/av_rewind.png rename to core/src/main/res/drawable-mdpi/av_rewind.png diff --git a/app/src/main/res/drawable-mdpi/av_rewind_dark.png b/core/src/main/res/drawable-mdpi/av_rewind_dark.png similarity index 100% rename from app/src/main/res/drawable-mdpi/av_rewind_dark.png rename to core/src/main/res/drawable-mdpi/av_rewind_dark.png diff --git a/app/src/main/res/drawable-mdpi/content_discard.png b/core/src/main/res/drawable-mdpi/content_discard.png similarity index 100% rename from app/src/main/res/drawable-mdpi/content_discard.png rename to core/src/main/res/drawable-mdpi/content_discard.png diff --git a/app/src/main/res/drawable-mdpi/content_discard_dark.png b/core/src/main/res/drawable-mdpi/content_discard_dark.png similarity index 100% rename from app/src/main/res/drawable-mdpi/content_discard_dark.png rename to core/src/main/res/drawable-mdpi/content_discard_dark.png diff --git a/app/src/main/res/drawable-mdpi/content_new.png b/core/src/main/res/drawable-mdpi/content_new.png similarity index 100% rename from app/src/main/res/drawable-mdpi/content_new.png rename to core/src/main/res/drawable-mdpi/content_new.png diff --git a/app/src/main/res/drawable-mdpi/content_new_dark.png b/core/src/main/res/drawable-mdpi/content_new_dark.png similarity index 100% rename from app/src/main/res/drawable-mdpi/content_new_dark.png rename to core/src/main/res/drawable-mdpi/content_new_dark.png diff --git a/app/src/main/res/drawable-mdpi/default_cover.png b/core/src/main/res/drawable-mdpi/default_cover.png similarity index 100% rename from app/src/main/res/drawable-mdpi/default_cover.png rename to core/src/main/res/drawable-mdpi/default_cover.png diff --git a/app/src/main/res/drawable-mdpi/default_cover_dark.png b/core/src/main/res/drawable-mdpi/default_cover_dark.png similarity index 100% rename from app/src/main/res/drawable-mdpi/default_cover_dark.png rename to core/src/main/res/drawable-mdpi/default_cover_dark.png diff --git a/app/src/main/res/drawable-mdpi/device_access_time.png b/core/src/main/res/drawable-mdpi/device_access_time.png similarity index 100% rename from app/src/main/res/drawable-mdpi/device_access_time.png rename to core/src/main/res/drawable-mdpi/device_access_time.png diff --git a/app/src/main/res/drawable-mdpi/device_access_time_dark.png b/core/src/main/res/drawable-mdpi/device_access_time_dark.png similarity index 100% rename from app/src/main/res/drawable-mdpi/device_access_time_dark.png rename to core/src/main/res/drawable-mdpi/device_access_time_dark.png diff --git a/app/src/main/res/drawable-mdpi/ic_action_overflow.png b/core/src/main/res/drawable-mdpi/ic_action_overflow.png similarity index 100% rename from app/src/main/res/drawable-mdpi/ic_action_overflow.png rename to core/src/main/res/drawable-mdpi/ic_action_overflow.png diff --git a/app/src/main/res/drawable-mdpi/ic_action_overflow_dark.png b/core/src/main/res/drawable-mdpi/ic_action_overflow_dark.png similarity index 100% rename from app/src/main/res/drawable-mdpi/ic_action_overflow_dark.png rename to core/src/main/res/drawable-mdpi/ic_action_overflow_dark.png diff --git a/app/src/main/res/drawable-mdpi/ic_action_pause_over_video.png b/core/src/main/res/drawable-mdpi/ic_action_pause_over_video.png similarity index 100% rename from app/src/main/res/drawable-mdpi/ic_action_pause_over_video.png rename to core/src/main/res/drawable-mdpi/ic_action_pause_over_video.png diff --git a/app/src/main/res/drawable-mdpi/ic_action_play_over_video.png b/core/src/main/res/drawable-mdpi/ic_action_play_over_video.png similarity index 100% rename from app/src/main/res/drawable-mdpi/ic_action_play_over_video.png rename to core/src/main/res/drawable-mdpi/ic_action_play_over_video.png diff --git a/app/src/main/res/drawable-mdpi/ic_drag_handle.png b/core/src/main/res/drawable-mdpi/ic_drag_handle.png similarity index 100% rename from app/src/main/res/drawable-mdpi/ic_drag_handle.png rename to core/src/main/res/drawable-mdpi/ic_drag_handle.png diff --git a/app/src/main/res/drawable-mdpi/ic_drag_handle_dark.png b/core/src/main/res/drawable-mdpi/ic_drag_handle_dark.png similarity index 100% rename from app/src/main/res/drawable-mdpi/ic_drag_handle_dark.png rename to core/src/main/res/drawable-mdpi/ic_drag_handle_dark.png diff --git a/app/src/main/res/drawable-mdpi/ic_drawer.png b/core/src/main/res/drawable-mdpi/ic_drawer.png similarity index 100% rename from app/src/main/res/drawable-mdpi/ic_drawer.png rename to core/src/main/res/drawable-mdpi/ic_drawer.png diff --git a/app/src/main/res/drawable-mdpi/ic_drawer_dark.png b/core/src/main/res/drawable-mdpi/ic_drawer_dark.png similarity index 100% rename from app/src/main/res/drawable-mdpi/ic_drawer_dark.png rename to core/src/main/res/drawable-mdpi/ic_drawer_dark.png diff --git a/app/src/main/res/drawable-mdpi/ic_launcher.png b/core/src/main/res/drawable-mdpi/ic_launcher.png similarity index 100% rename from app/src/main/res/drawable-mdpi/ic_launcher.png rename to core/src/main/res/drawable-mdpi/ic_launcher.png diff --git a/app/src/main/res/drawable-mdpi/ic_new.png b/core/src/main/res/drawable-mdpi/ic_new.png similarity index 100% rename from app/src/main/res/drawable-mdpi/ic_new.png rename to core/src/main/res/drawable-mdpi/ic_new.png diff --git a/app/src/main/res/drawable-mdpi/ic_new_dark.png b/core/src/main/res/drawable-mdpi/ic_new_dark.png similarity index 100% rename from app/src/main/res/drawable-mdpi/ic_new_dark.png rename to core/src/main/res/drawable-mdpi/ic_new_dark.png diff --git a/app/src/main/res/drawable-mdpi/ic_stat_antenna.png b/core/src/main/res/drawable-mdpi/ic_stat_antenna.png similarity index 100% rename from app/src/main/res/drawable-mdpi/ic_stat_antenna.png rename to core/src/main/res/drawable-mdpi/ic_stat_antenna.png diff --git a/app/src/main/res/drawable-mdpi/ic_stat_authentication.png b/core/src/main/res/drawable-mdpi/ic_stat_authentication.png similarity index 100% rename from app/src/main/res/drawable-mdpi/ic_stat_authentication.png rename to core/src/main/res/drawable-mdpi/ic_stat_authentication.png diff --git a/app/src/main/res/drawable-mdpi/location_web_site.png b/core/src/main/res/drawable-mdpi/location_web_site.png similarity index 100% rename from app/src/main/res/drawable-mdpi/location_web_site.png rename to core/src/main/res/drawable-mdpi/location_web_site.png diff --git a/app/src/main/res/drawable-mdpi/location_web_site_dark.png b/core/src/main/res/drawable-mdpi/location_web_site_dark.png similarity index 100% rename from app/src/main/res/drawable-mdpi/location_web_site_dark.png rename to core/src/main/res/drawable-mdpi/location_web_site_dark.png diff --git a/app/src/main/res/drawable-mdpi/navigation_accept.png b/core/src/main/res/drawable-mdpi/navigation_accept.png similarity index 100% rename from app/src/main/res/drawable-mdpi/navigation_accept.png rename to core/src/main/res/drawable-mdpi/navigation_accept.png diff --git a/app/src/main/res/drawable-mdpi/navigation_accept_dark.png b/core/src/main/res/drawable-mdpi/navigation_accept_dark.png similarity index 100% rename from app/src/main/res/drawable-mdpi/navigation_accept_dark.png rename to core/src/main/res/drawable-mdpi/navigation_accept_dark.png diff --git a/app/src/main/res/drawable-mdpi/navigation_cancel.png b/core/src/main/res/drawable-mdpi/navigation_cancel.png similarity index 100% rename from app/src/main/res/drawable-mdpi/navigation_cancel.png rename to core/src/main/res/drawable-mdpi/navigation_cancel.png diff --git a/app/src/main/res/drawable-mdpi/navigation_cancel_dark.png b/core/src/main/res/drawable-mdpi/navigation_cancel_dark.png similarity index 100% rename from app/src/main/res/drawable-mdpi/navigation_cancel_dark.png rename to core/src/main/res/drawable-mdpi/navigation_cancel_dark.png diff --git a/app/src/main/res/drawable-mdpi/navigation_chapters.png b/core/src/main/res/drawable-mdpi/navigation_chapters.png similarity index 100% rename from app/src/main/res/drawable-mdpi/navigation_chapters.png rename to core/src/main/res/drawable-mdpi/navigation_chapters.png diff --git a/app/src/main/res/drawable-mdpi/navigation_chapters_dark.png b/core/src/main/res/drawable-mdpi/navigation_chapters_dark.png similarity index 100% rename from app/src/main/res/drawable-mdpi/navigation_chapters_dark.png rename to core/src/main/res/drawable-mdpi/navigation_chapters_dark.png diff --git a/app/src/main/res/drawable-mdpi/navigation_collapse.png b/core/src/main/res/drawable-mdpi/navigation_collapse.png similarity index 100% rename from app/src/main/res/drawable-mdpi/navigation_collapse.png rename to core/src/main/res/drawable-mdpi/navigation_collapse.png diff --git a/app/src/main/res/drawable-mdpi/navigation_collapse_dark.png b/core/src/main/res/drawable-mdpi/navigation_collapse_dark.png similarity index 100% rename from app/src/main/res/drawable-mdpi/navigation_collapse_dark.png rename to core/src/main/res/drawable-mdpi/navigation_collapse_dark.png diff --git a/app/src/main/res/drawable-mdpi/navigation_expand.png b/core/src/main/res/drawable-mdpi/navigation_expand.png similarity index 100% rename from app/src/main/res/drawable-mdpi/navigation_expand.png rename to core/src/main/res/drawable-mdpi/navigation_expand.png diff --git a/app/src/main/res/drawable-mdpi/navigation_expand_dark.png b/core/src/main/res/drawable-mdpi/navigation_expand_dark.png similarity index 100% rename from app/src/main/res/drawable-mdpi/navigation_expand_dark.png rename to core/src/main/res/drawable-mdpi/navigation_expand_dark.png diff --git a/app/src/main/res/drawable-mdpi/navigation_refresh.png b/core/src/main/res/drawable-mdpi/navigation_refresh.png similarity index 100% rename from app/src/main/res/drawable-mdpi/navigation_refresh.png rename to core/src/main/res/drawable-mdpi/navigation_refresh.png diff --git a/app/src/main/res/drawable-mdpi/navigation_refresh_dark.png b/core/src/main/res/drawable-mdpi/navigation_refresh_dark.png similarity index 100% rename from app/src/main/res/drawable-mdpi/navigation_refresh_dark.png rename to core/src/main/res/drawable-mdpi/navigation_refresh_dark.png diff --git a/app/src/main/res/drawable-mdpi/navigation_shownotes.png b/core/src/main/res/drawable-mdpi/navigation_shownotes.png similarity index 100% rename from app/src/main/res/drawable-mdpi/navigation_shownotes.png rename to core/src/main/res/drawable-mdpi/navigation_shownotes.png diff --git a/app/src/main/res/drawable-mdpi/navigation_shownotes_dark.png b/core/src/main/res/drawable-mdpi/navigation_shownotes_dark.png similarity index 100% rename from app/src/main/res/drawable-mdpi/navigation_shownotes_dark.png rename to core/src/main/res/drawable-mdpi/navigation_shownotes_dark.png diff --git a/app/src/main/res/drawable-mdpi/navigation_up.png b/core/src/main/res/drawable-mdpi/navigation_up.png similarity index 100% rename from app/src/main/res/drawable-mdpi/navigation_up.png rename to core/src/main/res/drawable-mdpi/navigation_up.png diff --git a/app/src/main/res/drawable-mdpi/navigation_up_dark.png b/core/src/main/res/drawable-mdpi/navigation_up_dark.png similarity index 100% rename from app/src/main/res/drawable-mdpi/navigation_up_dark.png rename to core/src/main/res/drawable-mdpi/navigation_up_dark.png diff --git a/app/src/main/res/drawable-mdpi/social_share.png b/core/src/main/res/drawable-mdpi/social_share.png similarity index 100% rename from app/src/main/res/drawable-mdpi/social_share.png rename to core/src/main/res/drawable-mdpi/social_share.png diff --git a/app/src/main/res/drawable-mdpi/social_share_dark.png b/core/src/main/res/drawable-mdpi/social_share_dark.png similarity index 100% rename from app/src/main/res/drawable-mdpi/social_share_dark.png rename to core/src/main/res/drawable-mdpi/social_share_dark.png diff --git a/app/src/main/res/drawable-mdpi/spinner_button.9.png b/core/src/main/res/drawable-mdpi/spinner_button.9.png similarity index 100% rename from app/src/main/res/drawable-mdpi/spinner_button.9.png rename to core/src/main/res/drawable-mdpi/spinner_button.9.png diff --git a/app/src/main/res/drawable-mdpi/spinner_button_dark.9.png b/core/src/main/res/drawable-mdpi/spinner_button_dark.9.png similarity index 100% rename from app/src/main/res/drawable-mdpi/spinner_button_dark.9.png rename to core/src/main/res/drawable-mdpi/spinner_button_dark.9.png diff --git a/app/src/main/res/drawable-mdpi/stat_notify_sync.png b/core/src/main/res/drawable-mdpi/stat_notify_sync.png similarity index 100% rename from app/src/main/res/drawable-mdpi/stat_notify_sync.png rename to core/src/main/res/drawable-mdpi/stat_notify_sync.png diff --git a/app/src/main/res/drawable-mdpi/stat_notify_sync_error.png b/core/src/main/res/drawable-mdpi/stat_notify_sync_error.png similarity index 100% rename from app/src/main/res/drawable-mdpi/stat_notify_sync_error.png rename to core/src/main/res/drawable-mdpi/stat_notify_sync_error.png diff --git a/app/src/main/res/drawable-mdpi/stat_playlist.png b/core/src/main/res/drawable-mdpi/stat_playlist.png similarity index 100% rename from app/src/main/res/drawable-mdpi/stat_playlist.png rename to core/src/main/res/drawable-mdpi/stat_playlist.png diff --git a/app/src/main/res/drawable-mdpi/stat_playlist_dark.png b/core/src/main/res/drawable-mdpi/stat_playlist_dark.png similarity index 100% rename from app/src/main/res/drawable-mdpi/stat_playlist_dark.png rename to core/src/main/res/drawable-mdpi/stat_playlist_dark.png diff --git a/app/src/main/res/drawable-mdpi/type_audio.png b/core/src/main/res/drawable-mdpi/type_audio.png similarity index 100% rename from app/src/main/res/drawable-mdpi/type_audio.png rename to core/src/main/res/drawable-mdpi/type_audio.png diff --git a/app/src/main/res/drawable-mdpi/type_audio_dark.png b/core/src/main/res/drawable-mdpi/type_audio_dark.png similarity index 100% rename from app/src/main/res/drawable-mdpi/type_audio_dark.png rename to core/src/main/res/drawable-mdpi/type_audio_dark.png diff --git a/app/src/main/res/drawable-mdpi/type_video.png b/core/src/main/res/drawable-mdpi/type_video.png similarity index 100% rename from app/src/main/res/drawable-mdpi/type_video.png rename to core/src/main/res/drawable-mdpi/type_video.png diff --git a/app/src/main/res/drawable-mdpi/type_video_dark.png b/core/src/main/res/drawable-mdpi/type_video_dark.png similarity index 100% rename from app/src/main/res/drawable-mdpi/type_video_dark.png rename to core/src/main/res/drawable-mdpi/type_video_dark.png diff --git a/app/src/main/res/drawable-xhdpi-v11/ic_stat_antenna.png b/core/src/main/res/drawable-xhdpi-v11/ic_stat_antenna.png similarity index 100% rename from app/src/main/res/drawable-xhdpi-v11/ic_stat_antenna.png rename to core/src/main/res/drawable-xhdpi-v11/ic_stat_antenna.png diff --git a/app/src/main/res/drawable-xhdpi-v11/ic_stat_authentication.png b/core/src/main/res/drawable-xhdpi-v11/ic_stat_authentication.png similarity index 100% rename from app/src/main/res/drawable-xhdpi-v11/ic_stat_authentication.png rename to core/src/main/res/drawable-xhdpi-v11/ic_stat_authentication.png diff --git a/app/src/main/res/drawable-xhdpi-v11/stat_notify_sync.png b/core/src/main/res/drawable-xhdpi-v11/stat_notify_sync.png similarity index 100% rename from app/src/main/res/drawable-xhdpi-v11/stat_notify_sync.png rename to core/src/main/res/drawable-xhdpi-v11/stat_notify_sync.png diff --git a/app/src/main/res/drawable-xhdpi-v11/stat_notify_sync_error.png b/core/src/main/res/drawable-xhdpi-v11/stat_notify_sync_error.png similarity index 100% rename from app/src/main/res/drawable-xhdpi-v11/stat_notify_sync_error.png rename to core/src/main/res/drawable-xhdpi-v11/stat_notify_sync_error.png diff --git a/app/src/main/res/drawable-xhdpi/action_about.png b/core/src/main/res/drawable-xhdpi/action_about.png similarity index 100% rename from app/src/main/res/drawable-xhdpi/action_about.png rename to core/src/main/res/drawable-xhdpi/action_about.png diff --git a/app/src/main/res/drawable-xhdpi/action_about_dark.png b/core/src/main/res/drawable-xhdpi/action_about_dark.png similarity index 100% rename from app/src/main/res/drawable-xhdpi/action_about_dark.png rename to core/src/main/res/drawable-xhdpi/action_about_dark.png diff --git a/app/src/main/res/drawable-xhdpi/action_search.png b/core/src/main/res/drawable-xhdpi/action_search.png similarity index 100% rename from app/src/main/res/drawable-xhdpi/action_search.png rename to core/src/main/res/drawable-xhdpi/action_search.png diff --git a/app/src/main/res/drawable-xhdpi/action_search_dark.png b/core/src/main/res/drawable-xhdpi/action_search_dark.png similarity index 100% rename from app/src/main/res/drawable-xhdpi/action_search_dark.png rename to core/src/main/res/drawable-xhdpi/action_search_dark.png diff --git a/app/src/main/res/drawable-xhdpi/action_settings.png b/core/src/main/res/drawable-xhdpi/action_settings.png similarity index 100% rename from app/src/main/res/drawable-xhdpi/action_settings.png rename to core/src/main/res/drawable-xhdpi/action_settings.png diff --git a/app/src/main/res/drawable-xhdpi/action_settings_dark.png b/core/src/main/res/drawable-xhdpi/action_settings_dark.png similarity index 100% rename from app/src/main/res/drawable-xhdpi/action_settings_dark.png rename to core/src/main/res/drawable-xhdpi/action_settings_dark.png diff --git a/app/src/main/res/drawable-xhdpi/action_stream.png b/core/src/main/res/drawable-xhdpi/action_stream.png similarity index 100% rename from app/src/main/res/drawable-xhdpi/action_stream.png rename to core/src/main/res/drawable-xhdpi/action_stream.png diff --git a/app/src/main/res/drawable-xhdpi/action_stream_dark.png b/core/src/main/res/drawable-xhdpi/action_stream_dark.png similarity index 100% rename from app/src/main/res/drawable-xhdpi/action_stream_dark.png rename to core/src/main/res/drawable-xhdpi/action_stream_dark.png diff --git a/app/src/main/res/drawable-xhdpi/av_download.png b/core/src/main/res/drawable-xhdpi/av_download.png similarity index 100% rename from app/src/main/res/drawable-xhdpi/av_download.png rename to core/src/main/res/drawable-xhdpi/av_download.png diff --git a/app/src/main/res/drawable-xhdpi/av_download_dark.png b/core/src/main/res/drawable-xhdpi/av_download_dark.png similarity index 100% rename from app/src/main/res/drawable-xhdpi/av_download_dark.png rename to core/src/main/res/drawable-xhdpi/av_download_dark.png diff --git a/app/src/main/res/drawable-xhdpi/av_fast_forward.png b/core/src/main/res/drawable-xhdpi/av_fast_forward.png similarity index 100% rename from app/src/main/res/drawable-xhdpi/av_fast_forward.png rename to core/src/main/res/drawable-xhdpi/av_fast_forward.png diff --git a/app/src/main/res/drawable-xhdpi/av_fast_forward_dark.png b/core/src/main/res/drawable-xhdpi/av_fast_forward_dark.png similarity index 100% rename from app/src/main/res/drawable-xhdpi/av_fast_forward_dark.png rename to core/src/main/res/drawable-xhdpi/av_fast_forward_dark.png diff --git a/app/src/main/res/drawable-xhdpi/av_pause.png b/core/src/main/res/drawable-xhdpi/av_pause.png similarity index 100% rename from app/src/main/res/drawable-xhdpi/av_pause.png rename to core/src/main/res/drawable-xhdpi/av_pause.png diff --git a/app/src/main/res/drawable-xhdpi/av_pause_dark.png b/core/src/main/res/drawable-xhdpi/av_pause_dark.png similarity index 100% rename from app/src/main/res/drawable-xhdpi/av_pause_dark.png rename to core/src/main/res/drawable-xhdpi/av_pause_dark.png diff --git a/app/src/main/res/drawable-xhdpi/av_play.png b/core/src/main/res/drawable-xhdpi/av_play.png similarity index 100% rename from app/src/main/res/drawable-xhdpi/av_play.png rename to core/src/main/res/drawable-xhdpi/av_play.png diff --git a/app/src/main/res/drawable-xhdpi/av_play_dark.png b/core/src/main/res/drawable-xhdpi/av_play_dark.png similarity index 100% rename from app/src/main/res/drawable-xhdpi/av_play_dark.png rename to core/src/main/res/drawable-xhdpi/av_play_dark.png diff --git a/app/src/main/res/drawable-xhdpi/av_rewind.png b/core/src/main/res/drawable-xhdpi/av_rewind.png similarity index 100% rename from app/src/main/res/drawable-xhdpi/av_rewind.png rename to core/src/main/res/drawable-xhdpi/av_rewind.png diff --git a/app/src/main/res/drawable-xhdpi/av_rewind_dark.png b/core/src/main/res/drawable-xhdpi/av_rewind_dark.png similarity index 100% rename from app/src/main/res/drawable-xhdpi/av_rewind_dark.png rename to core/src/main/res/drawable-xhdpi/av_rewind_dark.png diff --git a/app/src/main/res/drawable-xhdpi/content_discard.png b/core/src/main/res/drawable-xhdpi/content_discard.png similarity index 100% rename from app/src/main/res/drawable-xhdpi/content_discard.png rename to core/src/main/res/drawable-xhdpi/content_discard.png diff --git a/app/src/main/res/drawable-xhdpi/content_discard_dark.png b/core/src/main/res/drawable-xhdpi/content_discard_dark.png similarity index 100% rename from app/src/main/res/drawable-xhdpi/content_discard_dark.png rename to core/src/main/res/drawable-xhdpi/content_discard_dark.png diff --git a/app/src/main/res/drawable-xhdpi/content_new.png b/core/src/main/res/drawable-xhdpi/content_new.png similarity index 100% rename from app/src/main/res/drawable-xhdpi/content_new.png rename to core/src/main/res/drawable-xhdpi/content_new.png diff --git a/app/src/main/res/drawable-xhdpi/content_new_dark.png b/core/src/main/res/drawable-xhdpi/content_new_dark.png similarity index 100% rename from app/src/main/res/drawable-xhdpi/content_new_dark.png rename to core/src/main/res/drawable-xhdpi/content_new_dark.png diff --git a/app/src/main/res/drawable-xhdpi/content_remove.png b/core/src/main/res/drawable-xhdpi/content_remove.png similarity index 100% rename from app/src/main/res/drawable-xhdpi/content_remove.png rename to core/src/main/res/drawable-xhdpi/content_remove.png diff --git a/app/src/main/res/drawable-xhdpi/content_remove_dark.png b/core/src/main/res/drawable-xhdpi/content_remove_dark.png similarity index 100% rename from app/src/main/res/drawable-xhdpi/content_remove_dark.png rename to core/src/main/res/drawable-xhdpi/content_remove_dark.png diff --git a/app/src/main/res/drawable-xhdpi/default_cover.png b/core/src/main/res/drawable-xhdpi/default_cover.png similarity index 100% rename from app/src/main/res/drawable-xhdpi/default_cover.png rename to core/src/main/res/drawable-xhdpi/default_cover.png diff --git a/app/src/main/res/drawable-xhdpi/default_cover_dark.png b/core/src/main/res/drawable-xhdpi/default_cover_dark.png similarity index 100% rename from app/src/main/res/drawable-xhdpi/default_cover_dark.png rename to core/src/main/res/drawable-xhdpi/default_cover_dark.png diff --git a/app/src/main/res/drawable-xhdpi/device_access_time.png b/core/src/main/res/drawable-xhdpi/device_access_time.png similarity index 100% rename from app/src/main/res/drawable-xhdpi/device_access_time.png rename to core/src/main/res/drawable-xhdpi/device_access_time.png diff --git a/app/src/main/res/drawable-xhdpi/device_access_time_dark.png b/core/src/main/res/drawable-xhdpi/device_access_time_dark.png similarity index 100% rename from app/src/main/res/drawable-xhdpi/device_access_time_dark.png rename to core/src/main/res/drawable-xhdpi/device_access_time_dark.png diff --git a/app/src/main/res/drawable-xhdpi/ic_action_overflow.png b/core/src/main/res/drawable-xhdpi/ic_action_overflow.png similarity index 100% rename from app/src/main/res/drawable-xhdpi/ic_action_overflow.png rename to core/src/main/res/drawable-xhdpi/ic_action_overflow.png diff --git a/app/src/main/res/drawable-xhdpi/ic_action_overflow_dark.png b/core/src/main/res/drawable-xhdpi/ic_action_overflow_dark.png similarity index 100% rename from app/src/main/res/drawable-xhdpi/ic_action_overflow_dark.png rename to core/src/main/res/drawable-xhdpi/ic_action_overflow_dark.png diff --git a/app/src/main/res/drawable-xhdpi/ic_action_pause_over_video.png b/core/src/main/res/drawable-xhdpi/ic_action_pause_over_video.png similarity index 100% rename from app/src/main/res/drawable-xhdpi/ic_action_pause_over_video.png rename to core/src/main/res/drawable-xhdpi/ic_action_pause_over_video.png diff --git a/app/src/main/res/drawable-xhdpi/ic_action_play_over_video.png b/core/src/main/res/drawable-xhdpi/ic_action_play_over_video.png similarity index 100% rename from app/src/main/res/drawable-xhdpi/ic_action_play_over_video.png rename to core/src/main/res/drawable-xhdpi/ic_action_play_over_video.png diff --git a/app/src/main/res/drawable-xhdpi/ic_drag_handle.png b/core/src/main/res/drawable-xhdpi/ic_drag_handle.png similarity index 100% rename from app/src/main/res/drawable-xhdpi/ic_drag_handle.png rename to core/src/main/res/drawable-xhdpi/ic_drag_handle.png diff --git a/app/src/main/res/drawable-xhdpi/ic_drag_handle_dark.png b/core/src/main/res/drawable-xhdpi/ic_drag_handle_dark.png similarity index 100% rename from app/src/main/res/drawable-xhdpi/ic_drag_handle_dark.png rename to core/src/main/res/drawable-xhdpi/ic_drag_handle_dark.png diff --git a/app/src/main/res/drawable-xhdpi/ic_drawer.png b/core/src/main/res/drawable-xhdpi/ic_drawer.png similarity index 100% rename from app/src/main/res/drawable-xhdpi/ic_drawer.png rename to core/src/main/res/drawable-xhdpi/ic_drawer.png diff --git a/app/src/main/res/drawable-xhdpi/ic_drawer_dark.png b/core/src/main/res/drawable-xhdpi/ic_drawer_dark.png similarity index 100% rename from app/src/main/res/drawable-xhdpi/ic_drawer_dark.png rename to core/src/main/res/drawable-xhdpi/ic_drawer_dark.png diff --git a/app/src/main/res/drawable-xhdpi/ic_launcher.png b/core/src/main/res/drawable-xhdpi/ic_launcher.png similarity index 100% rename from app/src/main/res/drawable-xhdpi/ic_launcher.png rename to core/src/main/res/drawable-xhdpi/ic_launcher.png diff --git a/app/src/main/res/drawable-xhdpi/ic_new.png b/core/src/main/res/drawable-xhdpi/ic_new.png similarity index 100% rename from app/src/main/res/drawable-xhdpi/ic_new.png rename to core/src/main/res/drawable-xhdpi/ic_new.png diff --git a/app/src/main/res/drawable-xhdpi/ic_new_dark.png b/core/src/main/res/drawable-xhdpi/ic_new_dark.png similarity index 100% rename from app/src/main/res/drawable-xhdpi/ic_new_dark.png rename to core/src/main/res/drawable-xhdpi/ic_new_dark.png diff --git a/app/src/main/res/drawable-xhdpi/ic_stat_antenna.png b/core/src/main/res/drawable-xhdpi/ic_stat_antenna.png similarity index 100% rename from app/src/main/res/drawable-xhdpi/ic_stat_antenna.png rename to core/src/main/res/drawable-xhdpi/ic_stat_antenna.png diff --git a/app/src/main/res/drawable-xhdpi/ic_stat_authentication.png b/core/src/main/res/drawable-xhdpi/ic_stat_authentication.png similarity index 100% rename from app/src/main/res/drawable-xhdpi/ic_stat_authentication.png rename to core/src/main/res/drawable-xhdpi/ic_stat_authentication.png diff --git a/app/src/main/res/drawable-xhdpi/ic_undobar_undo.png b/core/src/main/res/drawable-xhdpi/ic_undobar_undo.png similarity index 100% rename from app/src/main/res/drawable-xhdpi/ic_undobar_undo.png rename to core/src/main/res/drawable-xhdpi/ic_undobar_undo.png diff --git a/app/src/main/res/drawable-xhdpi/location_web_site.png b/core/src/main/res/drawable-xhdpi/location_web_site.png similarity index 100% rename from app/src/main/res/drawable-xhdpi/location_web_site.png rename to core/src/main/res/drawable-xhdpi/location_web_site.png diff --git a/app/src/main/res/drawable-xhdpi/location_web_site_dark.png b/core/src/main/res/drawable-xhdpi/location_web_site_dark.png similarity index 100% rename from app/src/main/res/drawable-xhdpi/location_web_site_dark.png rename to core/src/main/res/drawable-xhdpi/location_web_site_dark.png diff --git a/app/src/main/res/drawable-xhdpi/navigation_accept.png b/core/src/main/res/drawable-xhdpi/navigation_accept.png similarity index 100% rename from app/src/main/res/drawable-xhdpi/navigation_accept.png rename to core/src/main/res/drawable-xhdpi/navigation_accept.png diff --git a/app/src/main/res/drawable-xhdpi/navigation_accept_dark.png b/core/src/main/res/drawable-xhdpi/navigation_accept_dark.png similarity index 100% rename from app/src/main/res/drawable-xhdpi/navigation_accept_dark.png rename to core/src/main/res/drawable-xhdpi/navigation_accept_dark.png diff --git a/app/src/main/res/drawable-xhdpi/navigation_cancel.png b/core/src/main/res/drawable-xhdpi/navigation_cancel.png similarity index 100% rename from app/src/main/res/drawable-xhdpi/navigation_cancel.png rename to core/src/main/res/drawable-xhdpi/navigation_cancel.png diff --git a/app/src/main/res/drawable-xhdpi/navigation_cancel_dark.png b/core/src/main/res/drawable-xhdpi/navigation_cancel_dark.png similarity index 100% rename from app/src/main/res/drawable-xhdpi/navigation_cancel_dark.png rename to core/src/main/res/drawable-xhdpi/navigation_cancel_dark.png diff --git a/app/src/main/res/drawable-xhdpi/navigation_chapters.png b/core/src/main/res/drawable-xhdpi/navigation_chapters.png similarity index 100% rename from app/src/main/res/drawable-xhdpi/navigation_chapters.png rename to core/src/main/res/drawable-xhdpi/navigation_chapters.png diff --git a/app/src/main/res/drawable-xhdpi/navigation_chapters_dark.png b/core/src/main/res/drawable-xhdpi/navigation_chapters_dark.png similarity index 100% rename from app/src/main/res/drawable-xhdpi/navigation_chapters_dark.png rename to core/src/main/res/drawable-xhdpi/navigation_chapters_dark.png diff --git a/app/src/main/res/drawable-xhdpi/navigation_collapse.png b/core/src/main/res/drawable-xhdpi/navigation_collapse.png similarity index 100% rename from app/src/main/res/drawable-xhdpi/navigation_collapse.png rename to core/src/main/res/drawable-xhdpi/navigation_collapse.png diff --git a/app/src/main/res/drawable-xhdpi/navigation_collapse_dark.png b/core/src/main/res/drawable-xhdpi/navigation_collapse_dark.png similarity index 100% rename from app/src/main/res/drawable-xhdpi/navigation_collapse_dark.png rename to core/src/main/res/drawable-xhdpi/navigation_collapse_dark.png diff --git a/app/src/main/res/drawable-xhdpi/navigation_expand.png b/core/src/main/res/drawable-xhdpi/navigation_expand.png similarity index 100% rename from app/src/main/res/drawable-xhdpi/navigation_expand.png rename to core/src/main/res/drawable-xhdpi/navigation_expand.png diff --git a/app/src/main/res/drawable-xhdpi/navigation_expand_dark.png b/core/src/main/res/drawable-xhdpi/navigation_expand_dark.png similarity index 100% rename from app/src/main/res/drawable-xhdpi/navigation_expand_dark.png rename to core/src/main/res/drawable-xhdpi/navigation_expand_dark.png diff --git a/app/src/main/res/drawable-xhdpi/navigation_refresh.png b/core/src/main/res/drawable-xhdpi/navigation_refresh.png similarity index 100% rename from app/src/main/res/drawable-xhdpi/navigation_refresh.png rename to core/src/main/res/drawable-xhdpi/navigation_refresh.png diff --git a/app/src/main/res/drawable-xhdpi/navigation_refresh_dark.png b/core/src/main/res/drawable-xhdpi/navigation_refresh_dark.png similarity index 100% rename from app/src/main/res/drawable-xhdpi/navigation_refresh_dark.png rename to core/src/main/res/drawable-xhdpi/navigation_refresh_dark.png diff --git a/app/src/main/res/drawable-xhdpi/navigation_shownotes.png b/core/src/main/res/drawable-xhdpi/navigation_shownotes.png similarity index 100% rename from app/src/main/res/drawable-xhdpi/navigation_shownotes.png rename to core/src/main/res/drawable-xhdpi/navigation_shownotes.png diff --git a/app/src/main/res/drawable-xhdpi/navigation_shownotes_dark.png b/core/src/main/res/drawable-xhdpi/navigation_shownotes_dark.png similarity index 100% rename from app/src/main/res/drawable-xhdpi/navigation_shownotes_dark.png rename to core/src/main/res/drawable-xhdpi/navigation_shownotes_dark.png diff --git a/app/src/main/res/drawable-xhdpi/navigation_up.png b/core/src/main/res/drawable-xhdpi/navigation_up.png similarity index 100% rename from app/src/main/res/drawable-xhdpi/navigation_up.png rename to core/src/main/res/drawable-xhdpi/navigation_up.png diff --git a/app/src/main/res/drawable-xhdpi/navigation_up_dark.png b/core/src/main/res/drawable-xhdpi/navigation_up_dark.png similarity index 100% rename from app/src/main/res/drawable-xhdpi/navigation_up_dark.png rename to core/src/main/res/drawable-xhdpi/navigation_up_dark.png diff --git a/app/src/main/res/drawable-xhdpi/social_share.png b/core/src/main/res/drawable-xhdpi/social_share.png similarity index 100% rename from app/src/main/res/drawable-xhdpi/social_share.png rename to core/src/main/res/drawable-xhdpi/social_share.png diff --git a/app/src/main/res/drawable-xhdpi/social_share_dark.png b/core/src/main/res/drawable-xhdpi/social_share_dark.png similarity index 100% rename from app/src/main/res/drawable-xhdpi/social_share_dark.png rename to core/src/main/res/drawable-xhdpi/social_share_dark.png diff --git a/app/src/main/res/drawable-xhdpi/spinner_button.9.png b/core/src/main/res/drawable-xhdpi/spinner_button.9.png similarity index 100% rename from app/src/main/res/drawable-xhdpi/spinner_button.9.png rename to core/src/main/res/drawable-xhdpi/spinner_button.9.png diff --git a/app/src/main/res/drawable-xhdpi/spinner_button_dark.9.png b/core/src/main/res/drawable-xhdpi/spinner_button_dark.9.png similarity index 100% rename from app/src/main/res/drawable-xhdpi/spinner_button_dark.9.png rename to core/src/main/res/drawable-xhdpi/spinner_button_dark.9.png diff --git a/app/src/main/res/drawable-xhdpi/stat_playlist.png b/core/src/main/res/drawable-xhdpi/stat_playlist.png similarity index 100% rename from app/src/main/res/drawable-xhdpi/stat_playlist.png rename to core/src/main/res/drawable-xhdpi/stat_playlist.png diff --git a/app/src/main/res/drawable-xhdpi/stat_playlist_dark.png b/core/src/main/res/drawable-xhdpi/stat_playlist_dark.png similarity index 100% rename from app/src/main/res/drawable-xhdpi/stat_playlist_dark.png rename to core/src/main/res/drawable-xhdpi/stat_playlist_dark.png diff --git a/app/src/main/res/drawable-xhdpi/type_audio.png b/core/src/main/res/drawable-xhdpi/type_audio.png similarity index 100% rename from app/src/main/res/drawable-xhdpi/type_audio.png rename to core/src/main/res/drawable-xhdpi/type_audio.png diff --git a/app/src/main/res/drawable-xhdpi/type_audio_dark.png b/core/src/main/res/drawable-xhdpi/type_audio_dark.png similarity index 100% rename from app/src/main/res/drawable-xhdpi/type_audio_dark.png rename to core/src/main/res/drawable-xhdpi/type_audio_dark.png diff --git a/app/src/main/res/drawable-xhdpi/type_video.png b/core/src/main/res/drawable-xhdpi/type_video.png similarity index 100% rename from app/src/main/res/drawable-xhdpi/type_video.png rename to core/src/main/res/drawable-xhdpi/type_video.png diff --git a/app/src/main/res/drawable-xhdpi/type_video_dark.png b/core/src/main/res/drawable-xhdpi/type_video_dark.png similarity index 100% rename from app/src/main/res/drawable-xhdpi/type_video_dark.png rename to core/src/main/res/drawable-xhdpi/type_video_dark.png diff --git a/app/src/main/res/drawable-xhdpi/undobar.9.png b/core/src/main/res/drawable-xhdpi/undobar.9.png similarity index 100% rename from app/src/main/res/drawable-xhdpi/undobar.9.png rename to core/src/main/res/drawable-xhdpi/undobar.9.png diff --git a/app/src/main/res/drawable-xhdpi/undobar_button_focused.9.png b/core/src/main/res/drawable-xhdpi/undobar_button_focused.9.png similarity index 100% rename from app/src/main/res/drawable-xhdpi/undobar_button_focused.9.png rename to core/src/main/res/drawable-xhdpi/undobar_button_focused.9.png diff --git a/app/src/main/res/drawable-xhdpi/undobar_button_pressed.9.png b/core/src/main/res/drawable-xhdpi/undobar_button_pressed.9.png similarity index 100% rename from app/src/main/res/drawable-xhdpi/undobar_button_pressed.9.png rename to core/src/main/res/drawable-xhdpi/undobar_button_pressed.9.png diff --git a/app/src/main/res/drawable-xhdpi/undobar_divider.9.png b/core/src/main/res/drawable-xhdpi/undobar_divider.9.png similarity index 100% rename from app/src/main/res/drawable-xhdpi/undobar_divider.9.png rename to core/src/main/res/drawable-xhdpi/undobar_divider.9.png diff --git a/app/src/main/res/drawable-xxhdpi/ic_action_overflow.png b/core/src/main/res/drawable-xxhdpi/ic_action_overflow.png similarity index 100% rename from app/src/main/res/drawable-xxhdpi/ic_action_overflow.png rename to core/src/main/res/drawable-xxhdpi/ic_action_overflow.png diff --git a/app/src/main/res/drawable-xxhdpi/ic_action_overflow_dark.png b/core/src/main/res/drawable-xxhdpi/ic_action_overflow_dark.png similarity index 100% rename from app/src/main/res/drawable-xxhdpi/ic_action_overflow_dark.png rename to core/src/main/res/drawable-xxhdpi/ic_action_overflow_dark.png diff --git a/app/src/main/res/drawable-xxhdpi/ic_action_pause_over_video.png b/core/src/main/res/drawable-xxhdpi/ic_action_pause_over_video.png similarity index 100% rename from app/src/main/res/drawable-xxhdpi/ic_action_pause_over_video.png rename to core/src/main/res/drawable-xxhdpi/ic_action_pause_over_video.png diff --git a/app/src/main/res/drawable-xxhdpi/ic_action_play_over_video.png b/core/src/main/res/drawable-xxhdpi/ic_action_play_over_video.png similarity index 100% rename from app/src/main/res/drawable-xxhdpi/ic_action_play_over_video.png rename to core/src/main/res/drawable-xxhdpi/ic_action_play_over_video.png diff --git a/app/src/main/res/drawable-xxhdpi/ic_drag_handle.png b/core/src/main/res/drawable-xxhdpi/ic_drag_handle.png similarity index 100% rename from app/src/main/res/drawable-xxhdpi/ic_drag_handle.png rename to core/src/main/res/drawable-xxhdpi/ic_drag_handle.png diff --git a/app/src/main/res/drawable-xxhdpi/ic_drag_handle_dark.png b/core/src/main/res/drawable-xxhdpi/ic_drag_handle_dark.png similarity index 100% rename from app/src/main/res/drawable-xxhdpi/ic_drag_handle_dark.png rename to core/src/main/res/drawable-xxhdpi/ic_drag_handle_dark.png diff --git a/app/src/main/res/drawable-xxhdpi/ic_drawer.png b/core/src/main/res/drawable-xxhdpi/ic_drawer.png similarity index 100% rename from app/src/main/res/drawable-xxhdpi/ic_drawer.png rename to core/src/main/res/drawable-xxhdpi/ic_drawer.png diff --git a/app/src/main/res/drawable-xxhdpi/ic_drawer_dark.png b/core/src/main/res/drawable-xxhdpi/ic_drawer_dark.png similarity index 100% rename from app/src/main/res/drawable-xxhdpi/ic_drawer_dark.png rename to core/src/main/res/drawable-xxhdpi/ic_drawer_dark.png diff --git a/app/src/main/res/drawable-xxhdpi/ic_launcher.png b/core/src/main/res/drawable-xxhdpi/ic_launcher.png similarity index 100% rename from app/src/main/res/drawable-xxhdpi/ic_launcher.png rename to core/src/main/res/drawable-xxhdpi/ic_launcher.png diff --git a/app/src/main/res/drawable-xxhdpi/ic_new.png b/core/src/main/res/drawable-xxhdpi/ic_new.png similarity index 100% rename from app/src/main/res/drawable-xxhdpi/ic_new.png rename to core/src/main/res/drawable-xxhdpi/ic_new.png diff --git a/app/src/main/res/drawable-xxhdpi/ic_new_dark.png b/core/src/main/res/drawable-xxhdpi/ic_new_dark.png similarity index 100% rename from app/src/main/res/drawable-xxhdpi/ic_new_dark.png rename to core/src/main/res/drawable-xxhdpi/ic_new_dark.png diff --git a/app/src/main/res/drawable-xxhdpi/ic_stat_authentication.png b/core/src/main/res/drawable-xxhdpi/ic_stat_authentication.png similarity index 100% rename from app/src/main/res/drawable-xxhdpi/ic_stat_authentication.png rename to core/src/main/res/drawable-xxhdpi/ic_stat_authentication.png diff --git a/app/src/main/res/drawable/badge.xml b/core/src/main/res/drawable/badge.xml similarity index 100% rename from app/src/main/res/drawable/badge.xml rename to core/src/main/res/drawable/badge.xml diff --git a/app/src/main/res/drawable/borderless_button.xml b/core/src/main/res/drawable/borderless_button.xml similarity index 100% rename from app/src/main/res/drawable/borderless_button.xml rename to core/src/main/res/drawable/borderless_button.xml diff --git a/app/src/main/res/drawable/borderless_button_dark.xml b/core/src/main/res/drawable/borderless_button_dark.xml similarity index 100% rename from app/src/main/res/drawable/borderless_button_dark.xml rename to core/src/main/res/drawable/borderless_button_dark.xml diff --git a/app/src/main/res/drawable/horizontal_divider.9.png b/core/src/main/res/drawable/horizontal_divider.9.png similarity index 100% rename from app/src/main/res/drawable/horizontal_divider.9.png rename to core/src/main/res/drawable/horizontal_divider.9.png diff --git a/app/src/main/res/drawable/overlay_button_circle_background.xml b/core/src/main/res/drawable/overlay_button_circle_background.xml similarity index 100% rename from app/src/main/res/drawable/overlay_button_circle_background.xml rename to core/src/main/res/drawable/overlay_button_circle_background.xml diff --git a/app/src/main/res/drawable/overlay_drawable.xml b/core/src/main/res/drawable/overlay_drawable.xml similarity index 100% rename from app/src/main/res/drawable/overlay_drawable.xml rename to core/src/main/res/drawable/overlay_drawable.xml diff --git a/app/src/main/res/drawable/overlay_drawable_dark.xml b/core/src/main/res/drawable/overlay_drawable_dark.xml similarity index 100% rename from app/src/main/res/drawable/overlay_drawable_dark.xml rename to core/src/main/res/drawable/overlay_drawable_dark.xml diff --git a/app/src/main/res/drawable/type_audio.png b/core/src/main/res/drawable/type_audio.png similarity index 100% rename from app/src/main/res/drawable/type_audio.png rename to core/src/main/res/drawable/type_audio.png diff --git a/app/src/main/res/drawable/type_video.png b/core/src/main/res/drawable/type_video.png similarity index 100% rename from app/src/main/res/drawable/type_video.png rename to core/src/main/res/drawable/type_video.png diff --git a/app/src/main/res/drawable/undobar_button.xml b/core/src/main/res/drawable/undobar_button.xml similarity index 100% rename from app/src/main/res/drawable/undobar_button.xml rename to core/src/main/res/drawable/undobar_button.xml diff --git a/app/src/main/res/drawable/vertical_divider.9.png b/core/src/main/res/drawable/vertical_divider.9.png similarity index 100% rename from app/src/main/res/drawable/vertical_divider.9.png rename to core/src/main/res/drawable/vertical_divider.9.png diff --git a/app/src/main/res/drawable/white_circle.xml b/core/src/main/res/drawable/white_circle.xml similarity index 100% rename from app/src/main/res/drawable/white_circle.xml rename to core/src/main/res/drawable/white_circle.xml diff --git a/app/src/main/res/values-az/strings.xml b/core/src/main/res/values-az/strings.xml similarity index 100% rename from app/src/main/res/values-az/strings.xml rename to core/src/main/res/values-az/strings.xml diff --git a/app/src/main/res/values-ca/strings.xml b/core/src/main/res/values-ca/strings.xml similarity index 100% rename from app/src/main/res/values-ca/strings.xml rename to core/src/main/res/values-ca/strings.xml diff --git a/app/src/main/res/values-cs-rCZ/strings.xml b/core/src/main/res/values-cs-rCZ/strings.xml similarity index 100% rename from app/src/main/res/values-cs-rCZ/strings.xml rename to core/src/main/res/values-cs-rCZ/strings.xml diff --git a/app/src/main/res/values-da/strings.xml b/core/src/main/res/values-da/strings.xml similarity index 100% rename from app/src/main/res/values-da/strings.xml rename to core/src/main/res/values-da/strings.xml diff --git a/app/src/main/res/values-de/strings.xml b/core/src/main/res/values-de/strings.xml similarity index 100% rename from app/src/main/res/values-de/strings.xml rename to core/src/main/res/values-de/strings.xml diff --git a/app/src/main/res/values-es-rES/strings.xml b/core/src/main/res/values-es-rES/strings.xml similarity index 100% rename from app/src/main/res/values-es-rES/strings.xml rename to core/src/main/res/values-es-rES/strings.xml diff --git a/app/src/main/res/values-es/strings.xml b/core/src/main/res/values-es/strings.xml similarity index 100% rename from app/src/main/res/values-es/strings.xml rename to core/src/main/res/values-es/strings.xml diff --git a/app/src/main/res/values-fr/strings.xml b/core/src/main/res/values-fr/strings.xml similarity index 100% rename from app/src/main/res/values-fr/strings.xml rename to core/src/main/res/values-fr/strings.xml diff --git a/app/src/main/res/values-hi-rIN/strings.xml b/core/src/main/res/values-hi-rIN/strings.xml similarity index 100% rename from app/src/main/res/values-hi-rIN/strings.xml rename to core/src/main/res/values-hi-rIN/strings.xml diff --git a/app/src/main/res/values-it-rIT/strings.xml b/core/src/main/res/values-it-rIT/strings.xml similarity index 100% rename from app/src/main/res/values-it-rIT/strings.xml rename to core/src/main/res/values-it-rIT/strings.xml diff --git a/app/src/main/res/values-iw-rIL/strings.xml b/core/src/main/res/values-iw-rIL/strings.xml similarity index 100% rename from app/src/main/res/values-iw-rIL/strings.xml rename to core/src/main/res/values-iw-rIL/strings.xml diff --git a/app/src/main/res/values-ko/strings.xml b/core/src/main/res/values-ko/strings.xml similarity index 100% rename from app/src/main/res/values-ko/strings.xml rename to core/src/main/res/values-ko/strings.xml diff --git a/app/src/main/res/values-land/styles.xml b/core/src/main/res/values-land/styles.xml similarity index 100% rename from app/src/main/res/values-land/styles.xml rename to core/src/main/res/values-land/styles.xml diff --git a/app/src/main/res/values-large/dimens.xml b/core/src/main/res/values-large/dimens.xml similarity index 100% rename from app/src/main/res/values-large/dimens.xml rename to core/src/main/res/values-large/dimens.xml diff --git a/app/src/main/res/values-nl/strings.xml b/core/src/main/res/values-nl/strings.xml similarity index 100% rename from app/src/main/res/values-nl/strings.xml rename to core/src/main/res/values-nl/strings.xml diff --git a/app/src/main/res/values-pl-rPL/strings.xml b/core/src/main/res/values-pl-rPL/strings.xml similarity index 100% rename from app/src/main/res/values-pl-rPL/strings.xml rename to core/src/main/res/values-pl-rPL/strings.xml diff --git a/app/src/main/res/values-pt-rBR/strings.xml b/core/src/main/res/values-pt-rBR/strings.xml similarity index 100% rename from app/src/main/res/values-pt-rBR/strings.xml rename to core/src/main/res/values-pt-rBR/strings.xml diff --git a/app/src/main/res/values-pt/strings.xml b/core/src/main/res/values-pt/strings.xml similarity index 100% rename from app/src/main/res/values-pt/strings.xml rename to core/src/main/res/values-pt/strings.xml diff --git a/app/src/main/res/values-ro-rRO/strings.xml b/core/src/main/res/values-ro-rRO/strings.xml similarity index 100% rename from app/src/main/res/values-ro-rRO/strings.xml rename to core/src/main/res/values-ro-rRO/strings.xml diff --git a/app/src/main/res/values-ru/strings.xml b/core/src/main/res/values-ru/strings.xml similarity index 100% rename from app/src/main/res/values-ru/strings.xml rename to core/src/main/res/values-ru/strings.xml diff --git a/app/src/main/res/values-sv-rSE/strings.xml b/core/src/main/res/values-sv-rSE/strings.xml similarity index 100% rename from app/src/main/res/values-sv-rSE/strings.xml rename to core/src/main/res/values-sv-rSE/strings.xml diff --git a/app/src/main/res/values-uk-rUA/strings.xml b/core/src/main/res/values-uk-rUA/strings.xml similarity index 100% rename from app/src/main/res/values-uk-rUA/strings.xml rename to core/src/main/res/values-uk-rUA/strings.xml diff --git a/app/src/main/res/values-v11/colors.xml b/core/src/main/res/values-v11/colors.xml similarity index 100% rename from app/src/main/res/values-v11/colors.xml rename to core/src/main/res/values-v11/colors.xml diff --git a/app/src/main/res/values-v14/dimens.xml b/core/src/main/res/values-v14/dimens.xml similarity index 100% rename from app/src/main/res/values-v14/dimens.xml rename to core/src/main/res/values-v14/dimens.xml diff --git a/app/src/main/res/values-v14/styles.xml b/core/src/main/res/values-v14/styles.xml similarity index 100% rename from app/src/main/res/values-v14/styles.xml rename to core/src/main/res/values-v14/styles.xml diff --git a/app/src/main/res/values-v16/styles.xml b/core/src/main/res/values-v16/styles.xml similarity index 100% rename from app/src/main/res/values-v16/styles.xml rename to core/src/main/res/values-v16/styles.xml diff --git a/app/src/main/res/values-v19/colors.xml b/core/src/main/res/values-v19/colors.xml similarity index 100% rename from app/src/main/res/values-v19/colors.xml rename to core/src/main/res/values-v19/colors.xml diff --git a/app/src/main/res/values-zh-rCN/strings.xml b/core/src/main/res/values-zh-rCN/strings.xml similarity index 100% rename from app/src/main/res/values-zh-rCN/strings.xml rename to core/src/main/res/values-zh-rCN/strings.xml diff --git a/app/src/main/res/values/arrays.xml b/core/src/main/res/values/arrays.xml similarity index 100% rename from app/src/main/res/values/arrays.xml rename to core/src/main/res/values/arrays.xml diff --git a/app/src/main/res/values/attrs.xml b/core/src/main/res/values/attrs.xml similarity index 100% rename from app/src/main/res/values/attrs.xml rename to core/src/main/res/values/attrs.xml diff --git a/app/src/main/res/values/colors.xml b/core/src/main/res/values/colors.xml similarity index 100% rename from app/src/main/res/values/colors.xml rename to core/src/main/res/values/colors.xml diff --git a/app/src/main/res/values/dimens.xml b/core/src/main/res/values/dimens.xml similarity index 100% rename from app/src/main/res/values/dimens.xml rename to core/src/main/res/values/dimens.xml diff --git a/app/src/main/res/values/ids.xml b/core/src/main/res/values/ids.xml similarity index 100% rename from app/src/main/res/values/ids.xml rename to core/src/main/res/values/ids.xml diff --git a/app/src/main/res/values/integers.xml b/core/src/main/res/values/integers.xml similarity index 100% rename from app/src/main/res/values/integers.xml rename to core/src/main/res/values/integers.xml diff --git a/app/src/main/res/values/strings.xml b/core/src/main/res/values/strings.xml similarity index 100% rename from app/src/main/res/values/strings.xml rename to core/src/main/res/values/strings.xml diff --git a/app/src/main/res/values/styles.xml b/core/src/main/res/values/styles.xml similarity index 100% rename from app/src/main/res/values/styles.xml rename to core/src/main/res/values/styles.xml diff --git a/settings.gradle b/settings.gradle index d33586960..de34bc1c1 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1,2 +1,2 @@ -include ':app' +include ':app', ':core' include ':app:dslv:library'