From f9f634de1a53edd3757a16007abbb15964040481 Mon Sep 17 00:00:00 2001 From: Bnyro Date: Tue, 20 Sep 2022 19:53:34 +0200 Subject: [PATCH 1/3] code structure --- app/proguard-rules.pro | 2 +- app/src/main/AndroidManifest.xml | 28 ++--- .../com/github/libretube/api/ExternalApi.kt | 6 +- .../java/com/github/libretube/api/PipedApi.kt | 106 +++++++++--------- .../libretube/api/SubscriptionHelper.kt | 6 +- .../github/libretube/{ => api}/obj/Channel.kt | 4 +- .../libretube/{ => api}/obj/ChapterSegment.kt | 2 +- .../github/libretube/{ => api}/obj/Comment.kt | 2 +- .../libretube/{ => api}/obj/CommentsPage.kt | 4 +- .../{ => api}/obj/DeleteUserRequest.kt | 2 +- .../libretube/{ => api}/obj/Instances.kt | 2 +- .../github/libretube/{ => api}/obj/Login.kt | 2 +- .../github/libretube/{ => api}/obj/Message.kt | 2 +- .../libretube/{ => api}/obj/PipedStream.kt | 2 +- .../libretube/{ => api}/obj/Playlist.kt | 4 +- .../libretube/{ => api}/obj/PlaylistId.kt | 2 +- .../libretube/{ => api}/obj/Playlists.kt | 2 +- .../libretube/{ => api}/obj/SearchItem.kt | 2 +- .../libretube/{ => api}/obj/SearchResult.kt | 2 +- .../github/libretube/{ => api}/obj/Segment.kt | 2 +- .../libretube/{ => api}/obj/Segments.kt | 4 +- .../libretube/{ => api}/obj/StreamItem.kt | 2 +- .../github/libretube/{ => api}/obj/Streams.kt | 12 +- .../libretube/{ => api}/obj/Subscribe.kt | 2 +- .../libretube/{ => api}/obj/Subscribed.kt | 2 +- .../libretube/{ => api}/obj/Subscription.kt | 2 +- .../libretube/{ => api}/obj/Subtitle.kt | 2 +- .../github/libretube/{ => api}/obj/Token.kt | 2 +- .../com/github/libretube/db/DatabaseHelper.kt | 4 +- .../models/SubscriptionsViewModel.kt | 8 +- .../libretube/obj/NewPipeSubscriptions.kt | 2 + .../libretube/{ => obj}/update/Asset.kt | 2 +- .../libretube/{ => obj}/update/Author.kt | 2 +- .../libretube/{ => obj}/update/Reactions.kt | 2 +- .../libretube/{ => obj}/update/UpdateInfo.kt | 2 +- .../libretube/{ => obj}/update/Uploader.kt | 2 +- .../libretube/services/BackgroundMode.kt | 12 +- .../sheets/PlaylistOptionsBottomSheet.kt | 14 ++- .../sheets/VideoOptionsBottomSheet.kt | 8 +- .../{ => ui}/activities/AboutActivity.kt | 2 +- .../{ => ui}/activities/CommunityActivity.kt | 2 +- .../{ => ui}/activities/MainActivity.kt | 6 +- .../{ => ui}/activities/NoInternetActivity.kt | 4 +- .../activities/OfflinePlayerActivity.kt | 2 +- .../{ => ui}/activities/RouterActivity.kt | 2 +- .../{ => ui}/activities/SettingsActivity.kt | 4 +- .../{ => ui}/adapters/BackupOptionsAdapter.kt | 2 +- .../{ => ui}/adapters/BottomSheetAdapter.kt | 2 +- .../{ => ui}/adapters/ChannelAdapter.kt | 8 +- .../{ => ui}/adapters/ChaptersAdapter.kt | 6 +- .../{ => ui}/adapters/CommentsAdapter.kt | 12 +- .../{ => ui}/adapters/DownloadsAdapter.kt | 4 +- .../adapters/LegacySubscriptionAdapter.kt | 6 +- .../{ => ui}/adapters/NavBarOptionsAdapter.kt | 2 +- .../{ => ui}/adapters/PlaylistAdapter.kt | 15 ++- .../{ => ui}/adapters/PlaylistsAdapter.kt | 12 +- .../{ => ui}/adapters/RepliesAdapter.kt | 8 +- .../{ => ui}/adapters/SearchAdapter.kt | 14 +-- .../{ => ui}/adapters/SearchHistoryAdapter.kt | 2 +- .../adapters/SearchSuggestionsAdapter.kt | 2 +- .../adapters/SubscriptionChannelAdapter.kt | 8 +- .../{ => ui}/adapters/TrendingAdapter.kt | 6 +- .../{ => ui}/adapters/WatchHistoryAdapter.kt | 2 +- .../{ => ui}/dialogs/AddToPlaylistDialog.kt | 8 +- .../{ => ui}/dialogs/BackupDialog.kt | 4 +- .../{ => ui}/dialogs/CreatePlaylistDialog.kt | 10 +- .../{ => ui}/dialogs/CustomInstanceDialog.kt | 2 +- .../{ => ui}/dialogs/DeleteAccountDialog.kt | 8 +- .../{ => ui}/dialogs/DownloadDialog.kt | 6 +- .../libretube/{ => ui}/dialogs/ErrorDialog.kt | 2 +- .../libretube/{ => ui}/dialogs/LoginDialog.kt | 15 ++- .../{ => ui}/dialogs/LogoutDialog.kt | 2 +- .../{ => ui}/dialogs/NavBarOptionsDialog.kt | 4 +- .../{ => ui}/dialogs/RequireRestartDialog.kt | 2 +- .../libretube/{ => ui}/dialogs/ShareDialog.kt | 2 +- .../{ => ui}/dialogs/UpdateDialog.kt | 4 +- .../{ => ui}/fragments/ChannelFragment.kt | 4 +- .../{ => ui}/fragments/DownloadsFragment.kt | 4 +- .../{ => ui}/fragments/HomeFragment.kt | 6 +- .../{ => ui}/fragments/LibraryFragment.kt | 6 +- .../{ => ui}/fragments/PlayerFragment.kt | 32 +++--- .../{ => ui}/fragments/PlaylistFragment.kt | 4 +- .../{ => ui}/fragments/SearchFragment.kt | 8 +- .../fragments/SearchResultFragment.kt | 6 +- .../fragments/SubscriptionsFragment.kt | 10 +- .../fragments/WatchHistoryFragment.kt | 4 +- .../{ => ui}/preferences/AdvancedSettings.kt | 8 +- .../preferences/AppearanceSettings.kt | 8 +- .../preferences/AudioVideoSettings.kt | 6 +- .../{ => ui}/preferences/GeneralSettings.kt | 10 +- .../{ => ui}/preferences/HistorySettings.kt | 6 +- .../{ => ui}/preferences/InstanceSettings.kt | 14 +-- .../{ => ui}/preferences/MainSettings.kt | 8 +- .../preferences/NotificationSettings.kt | 6 +- .../{ => ui}/preferences/PlayerSettings.kt | 6 +- .../preferences/SponsorBlockSettings.kt | 6 +- .../libretube/{ => ui}/views/BottomSheet.kt | 4 +- .../{ => ui}/views/CustomExoPlayerView.kt | 10 +- .../{ => ui}/views/CustomSwipeToRefresh.kt | 2 +- .../{ => ui}/views/DoubleTapOverlay.kt | 2 +- .../views/MaterialPreferenceFragment.kt | 2 +- .../views/SingleViewTouchableMotionLayout.kt | 2 +- .../github/libretube/util/AutoPlayHelper.kt | 6 +- .../github/libretube/util/NavigationHelper.kt | 4 +- .../libretube/util/NotificationHelper.kt | 2 +- .../libretube/util/NowPlayingNotification.kt | 7 +- .../com/github/libretube/util/PlayerHelper.kt | 8 +- app/src/main/res/layout/activity_main.xml | 2 +- .../res/layout/activity_offline_player.xml | 6 +- app/src/main/res/layout/fragment_channel.xml | 6 +- app/src/main/res/layout/fragment_home.xml | 2 +- app/src/main/res/layout/fragment_library.xml | 6 +- app/src/main/res/layout/fragment_player.xml | 12 +- app/src/main/res/layout/fragment_playlist.xml | 2 +- app/src/main/res/layout/fragment_search.xml | 2 +- .../res/layout/fragment_search_result.xml | 2 +- .../res/layout/fragment_subscriptions.xml | 6 +- app/src/main/res/navigation/nav.xml | 18 +-- 118 files changed, 379 insertions(+), 368 deletions(-) rename app/src/main/java/com/github/libretube/{ => api}/obj/Channel.kt (77%) rename app/src/main/java/com/github/libretube/{ => api}/obj/ChapterSegment.kt (85%) rename app/src/main/java/com/github/libretube/{ => api}/obj/Comment.kt (93%) rename app/src/main/java/com/github/libretube/{ => api}/obj/CommentsPage.kt (62%) rename app/src/main/java/com/github/libretube/{ => api}/obj/DeleteUserRequest.kt (64%) rename app/src/main/java/com/github/libretube/{ => api}/obj/Instances.kt (91%) rename app/src/main/java/com/github/libretube/{ => api}/obj/Login.kt (83%) rename app/src/main/java/com/github/libretube/{ => api}/obj/Message.kt (59%) rename app/src/main/java/com/github/libretube/{ => api}/obj/PipedStream.kt (93%) rename app/src/main/java/com/github/libretube/{ => api}/obj/Playlist.kt (77%) rename app/src/main/java/com/github/libretube/{ => api}/obj/PlaylistId.kt (87%) rename app/src/main/java/com/github/libretube/{ => api}/obj/Playlists.kt (87%) rename app/src/main/java/com/github/libretube/{ => api}/obj/SearchItem.kt (95%) rename app/src/main/java/com/github/libretube/{ => api}/obj/SearchResult.kt (88%) rename app/src/main/java/com/github/libretube/{ => api}/obj/Segment.kt (86%) rename app/src/main/java/com/github/libretube/{ => api}/obj/Segments.kt (51%) rename app/src/main/java/com/github/libretube/{ => api}/obj/StreamItem.kt (93%) rename app/src/main/java/com/github/libretube/{ => api}/obj/Streams.kt (66%) rename app/src/main/java/com/github/libretube/{ => api}/obj/Subscribe.kt (81%) rename app/src/main/java/com/github/libretube/{ => api}/obj/Subscribed.kt (81%) rename app/src/main/java/com/github/libretube/{ => api}/obj/Subscription.kt (87%) rename app/src/main/java/com/github/libretube/{ => api}/obj/Subtitle.kt (88%) rename app/src/main/java/com/github/libretube/{ => api}/obj/Token.kt (83%) rename app/src/main/java/com/github/libretube/{ => obj}/update/Asset.kt (93%) rename app/src/main/java/com/github/libretube/{ => obj}/update/Author.kt (95%) rename app/src/main/java/com/github/libretube/{ => obj}/update/Reactions.kt (90%) rename app/src/main/java/com/github/libretube/{ => obj}/update/UpdateInfo.kt (95%) rename app/src/main/java/com/github/libretube/{ => obj}/update/Uploader.kt (95%) rename app/src/main/java/com/github/libretube/{ => ui}/activities/AboutActivity.kt (99%) rename app/src/main/java/com/github/libretube/{ => ui}/activities/CommunityActivity.kt (97%) rename app/src/main/java/com/github/libretube/{ => ui}/activities/MainActivity.kt (99%) rename app/src/main/java/com/github/libretube/{ => ui}/activities/NoInternetActivity.kt (95%) rename app/src/main/java/com/github/libretube/{ => ui}/activities/OfflinePlayerActivity.kt (99%) rename app/src/main/java/com/github/libretube/{ => ui}/activities/RouterActivity.kt (98%) rename app/src/main/java/com/github/libretube/{ => ui}/activities/SettingsActivity.kt (94%) rename app/src/main/java/com/github/libretube/{ => ui}/adapters/BackupOptionsAdapter.kt (96%) rename app/src/main/java/com/github/libretube/{ => ui}/adapters/BottomSheetAdapter.kt (97%) rename app/src/main/java/com/github/libretube/{ => ui}/adapters/ChannelAdapter.kt (90%) rename app/src/main/java/com/github/libretube/{ => ui}/adapters/ChaptersAdapter.kt (92%) rename app/src/main/java/com/github/libretube/{ => ui}/adapters/CommentsAdapter.kt (91%) rename app/src/main/java/com/github/libretube/{ => ui}/adapters/DownloadsAdapter.kt (96%) rename app/src/main/java/com/github/libretube/{ => ui}/adapters/LegacySubscriptionAdapter.kt (90%) rename app/src/main/java/com/github/libretube/{ => ui}/adapters/NavBarOptionsAdapter.kt (97%) rename app/src/main/java/com/github/libretube/{ => ui}/adapters/PlaylistAdapter.kt (88%) rename app/src/main/java/com/github/libretube/{ => ui}/adapters/PlaylistsAdapter.kt (92%) rename app/src/main/java/com/github/libretube/{ => ui}/adapters/RepliesAdapter.kt (90%) rename app/src/main/java/com/github/libretube/{ => ui}/adapters/SearchAdapter.kt (93%) rename app/src/main/java/com/github/libretube/{ => ui}/adapters/SearchHistoryAdapter.kt (97%) rename app/src/main/java/com/github/libretube/{ => ui}/adapters/SearchSuggestionsAdapter.kt (96%) rename app/src/main/java/com/github/libretube/{ => ui}/adapters/SubscriptionChannelAdapter.kt (91%) rename app/src/main/java/com/github/libretube/{ => ui}/adapters/TrendingAdapter.kt (94%) rename app/src/main/java/com/github/libretube/{ => ui}/adapters/WatchHistoryAdapter.kt (98%) rename app/src/main/java/com/github/libretube/{ => ui}/dialogs/AddToPlaylistDialog.kt (96%) rename app/src/main/java/com/github/libretube/{ => ui}/dialogs/BackupDialog.kt (96%) rename app/src/main/java/com/github/libretube/{ => ui}/dialogs/CreatePlaylistDialog.kt (90%) rename app/src/main/java/com/github/libretube/{ => ui}/dialogs/CustomInstanceDialog.kt (98%) rename app/src/main/java/com/github/libretube/{ => ui}/dialogs/DeleteAccountDialog.kt (89%) rename app/src/main/java/com/github/libretube/{ => ui}/dialogs/DownloadDialog.kt (96%) rename app/src/main/java/com/github/libretube/{ => ui}/dialogs/ErrorDialog.kt (97%) rename app/src/main/java/com/github/libretube/{ => ui}/dialogs/LoginDialog.kt (90%) rename app/src/main/java/com/github/libretube/{ => ui}/dialogs/LogoutDialog.kt (96%) rename app/src/main/java/com/github/libretube/{ => ui}/dialogs/NavBarOptionsDialog.kt (96%) rename app/src/main/java/com/github/libretube/{ => ui}/dialogs/RequireRestartDialog.kt (95%) rename app/src/main/java/com/github/libretube/{ => ui}/dialogs/ShareDialog.kt (98%) rename app/src/main/java/com/github/libretube/{ => ui}/dialogs/UpdateDialog.kt (95%) rename app/src/main/java/com/github/libretube/{ => ui}/fragments/ChannelFragment.kt (98%) rename app/src/main/java/com/github/libretube/{ => ui}/fragments/DownloadsFragment.kt (94%) rename app/src/main/java/com/github/libretube/{ => ui}/fragments/HomeFragment.kt (96%) rename app/src/main/java/com/github/libretube/{ => ui}/fragments/LibraryFragment.kt (97%) rename app/src/main/java/com/github/libretube/{ => ui}/fragments/PlayerFragment.kt (98%) rename app/src/main/java/com/github/libretube/{ => ui}/fragments/PlaylistFragment.kt (98%) rename app/src/main/java/com/github/libretube/{ => ui}/fragments/SearchFragment.kt (94%) rename app/src/main/java/com/github/libretube/{ => ui}/fragments/SearchResultFragment.kt (97%) rename app/src/main/java/com/github/libretube/{ => ui}/fragments/SubscriptionsFragment.kt (96%) rename app/src/main/java/com/github/libretube/{ => ui}/fragments/WatchHistoryFragment.kt (96%) rename app/src/main/java/com/github/libretube/{ => ui}/preferences/AdvancedSettings.kt (95%) rename app/src/main/java/com/github/libretube/{ => ui}/preferences/AppearanceSettings.kt (95%) rename app/src/main/java/com/github/libretube/{ => ui}/preferences/AudioVideoSettings.kt (71%) rename app/src/main/java/com/github/libretube/{ => ui}/preferences/GeneralSettings.kt (88%) rename app/src/main/java/com/github/libretube/{ => ui}/preferences/HistorySettings.kt (92%) rename app/src/main/java/com/github/libretube/{ => ui}/preferences/InstanceSettings.kt (95%) rename app/src/main/java/com/github/libretube/{ => ui}/preferences/MainSettings.kt (95%) rename app/src/main/java/com/github/libretube/{ => ui}/preferences/NotificationSettings.kt (91%) rename app/src/main/java/com/github/libretube/{ => ui}/preferences/PlayerSettings.kt (92%) rename app/src/main/java/com/github/libretube/{ => ui}/preferences/SponsorBlockSettings.kt (71%) rename app/src/main/java/com/github/libretube/{ => ui}/views/BottomSheet.kt (94%) rename app/src/main/java/com/github/libretube/{ => ui}/views/CustomExoPlayerView.kt (98%) rename app/src/main/java/com/github/libretube/{ => ui}/views/CustomSwipeToRefresh.kt (96%) rename app/src/main/java/com/github/libretube/{ => ui}/views/DoubleTapOverlay.kt (93%) rename app/src/main/java/com/github/libretube/{ => ui}/views/MaterialPreferenceFragment.kt (98%) rename app/src/main/java/com/github/libretube/{ => ui}/views/SingleViewTouchableMotionLayout.kt (98%) diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro index b7d85991e..c035dfb82 100644 --- a/app/proguard-rules.pro +++ b/app/proguard-rules.pro @@ -24,7 +24,7 @@ -keep class com.github.libretube.obj.** { *; } # prevents android from removing it --keep class com.github.libretube.update.** { *; } +-keep class com.github.libretube.obj.**.** { *; } # prevents obfuscation in debug logs -dontobfuscate \ No newline at end of file diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 4491ea9e2..e77abb8c6 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -22,27 +22,27 @@ tools:targetApi="n"> @@ -84,7 +84,7 @@ android:label="@string/app_name" android:roundIcon="@mipmap/ic_fire_round" android:supportsPictureInPicture="true" - android:targetActivity=".activities.MainActivity" + android:targetActivity=".ui.activities.MainActivity" android:windowSoftInputMode="adjustPan"> @@ -102,7 +102,7 @@ android:label="@string/app_name" android:roundIcon="@mipmap/ic_flame_round" android:supportsPictureInPicture="true" - android:targetActivity=".activities.MainActivity" + android:targetActivity=".ui.activities.MainActivity" android:windowSoftInputMode="adjustPan"> @@ -120,7 +120,7 @@ android:label="@string/app_name" android:roundIcon="@mipmap/ic_shaped_round" android:supportsPictureInPicture="true" - android:targetActivity=".activities.MainActivity" + android:targetActivity=".ui.activities.MainActivity" android:windowSoftInputMode="adjustPan"> @@ -138,7 +138,7 @@ android:label="@string/app_name" android:roundIcon="@mipmap/ic_torch_round" android:supportsPictureInPicture="true" - android:targetActivity=".activities.MainActivity" + android:targetActivity=".ui.activities.MainActivity" android:windowSoftInputMode="adjustPan"> @@ -156,7 +156,7 @@ android:label="@string/app_name" android:roundIcon="@mipmap/ic_legacy_round" android:supportsPictureInPicture="true" - android:targetActivity=".activities.MainActivity" + android:targetActivity=".ui.activities.MainActivity" android:windowSoftInputMode="adjustPan"> @@ -174,7 +174,7 @@ android:label="@string/app_name" android:roundIcon="@mipmap/ic_bird_round" android:supportsPictureInPicture="true" - android:targetActivity=".activities.MainActivity" + android:targetActivity=".ui.activities.MainActivity" android:windowSoftInputMode="adjustPan"> @@ -183,7 +183,7 @@ diff --git a/app/src/main/java/com/github/libretube/api/ExternalApi.kt b/app/src/main/java/com/github/libretube/api/ExternalApi.kt index 9daf29192..a547a8fbb 100644 --- a/app/src/main/java/com/github/libretube/api/ExternalApi.kt +++ b/app/src/main/java/com/github/libretube/api/ExternalApi.kt @@ -2,14 +2,14 @@ package com.github.libretube.api import com.github.libretube.constants.GITHUB_API_URL import com.github.libretube.constants.PIPED_INSTANCES_URL -import com.github.libretube.obj.Instances -import com.github.libretube.update.UpdateInfo +import com.github.libretube.api.obj.Instances +import com.github.libretube.obj.update.UpdateInfo import retrofit2.http.GET interface ExternalApi { // only for fetching servers list @GET(PIPED_INSTANCES_URL) - suspend fun getInstances(): List + suspend fun getInstances(): List // fetch latest version info @GET(GITHUB_API_URL) diff --git a/app/src/main/java/com/github/libretube/api/PipedApi.kt b/app/src/main/java/com/github/libretube/api/PipedApi.kt index 1139da77c..1dd62eb3c 100644 --- a/app/src/main/java/com/github/libretube/api/PipedApi.kt +++ b/app/src/main/java/com/github/libretube/api/PipedApi.kt @@ -1,21 +1,21 @@ package com.github.libretube.api -import com.github.libretube.obj.Channel -import com.github.libretube.obj.CommentsPage -import com.github.libretube.obj.DeleteUserRequest -import com.github.libretube.obj.Login -import com.github.libretube.obj.Message -import com.github.libretube.obj.Playlist -import com.github.libretube.obj.PlaylistId -import com.github.libretube.obj.Playlists -import com.github.libretube.obj.SearchResult -import com.github.libretube.obj.Segments -import com.github.libretube.obj.StreamItem -import com.github.libretube.obj.Streams -import com.github.libretube.obj.Subscribe -import com.github.libretube.obj.Subscribed -import com.github.libretube.obj.Subscription -import com.github.libretube.obj.Token +import com.github.libretube.api.obj.Channel +import com.github.libretube.api.obj.CommentsPage +import com.github.libretube.api.obj.DeleteUserRequest +import com.github.libretube.api.obj.Login +import com.github.libretube.api.obj.Message +import com.github.libretube.api.obj.Playlist +import com.github.libretube.api.obj.PlaylistId +import com.github.libretube.api.obj.Playlists +import com.github.libretube.api.obj.SearchResult +import com.github.libretube.api.obj.Segments +import com.github.libretube.api.obj.StreamItem +import com.github.libretube.api.obj.Streams +import com.github.libretube.api.obj.Subscribe +import com.github.libretube.api.obj.Subscribed +import com.github.libretube.api.obj.Subscription +import com.github.libretube.api.obj.Token import retrofit2.http.Body import retrofit2.http.GET import retrofit2.http.Header @@ -25,148 +25,148 @@ import retrofit2.http.Query interface PipedApi { @GET("trending") - suspend fun getTrending(@Query("region") region: String): List + suspend fun getTrending(@Query("region") region: String): List @GET("streams/{videoId}") - suspend fun getStreams(@Path("videoId") videoId: String): Streams + suspend fun getStreams(@Path("videoId") videoId: String): com.github.libretube.api.obj.Streams @GET("comments/{videoId}") - suspend fun getComments(@Path("videoId") videoId: String): CommentsPage + suspend fun getComments(@Path("videoId") videoId: String): com.github.libretube.api.obj.CommentsPage @GET("sponsors/{videoId}") suspend fun getSegments( @Path("videoId") videoId: String, @Query("category") category: String - ): Segments + ): com.github.libretube.api.obj.Segments @GET("nextpage/comments/{videoId}") suspend fun getCommentsNextPage( @Path("videoId") videoId: String, @Query("nextpage") nextPage: String - ): CommentsPage + ): com.github.libretube.api.obj.CommentsPage @GET("search") suspend fun getSearchResults( @Query("q") searchQuery: String, @Query("filter") filter: String - ): SearchResult + ): com.github.libretube.api.obj.SearchResult @GET("nextpage/search") suspend fun getSearchResultsNextPage( @Query("q") searchQuery: String, @Query("filter") filter: String, @Query("nextpage") nextPage: String - ): SearchResult + ): com.github.libretube.api.obj.SearchResult @GET("suggestions") suspend fun getSuggestions(@Query("query") query: String): List @GET("channel/{channelId}") - suspend fun getChannel(@Path("channelId") channelId: String): Channel + suspend fun getChannel(@Path("channelId") channelId: String): com.github.libretube.api.obj.Channel @GET("user/{name}") - suspend fun getChannelByName(@Path("name") channelName: String): Channel + suspend fun getChannelByName(@Path("name") channelName: String): com.github.libretube.api.obj.Channel @GET("nextpage/channel/{channelId}") suspend fun getChannelNextPage( @Path("channelId") channelId: String, @Query("nextpage") nextPage: String - ): Channel + ): com.github.libretube.api.obj.Channel @GET("playlists/{playlistId}") - suspend fun getPlaylist(@Path("playlistId") playlistId: String): Playlist + suspend fun getPlaylist(@Path("playlistId") playlistId: String): com.github.libretube.api.obj.Playlist @GET("nextpage/playlists/{playlistId}") suspend fun getPlaylistNextPage( @Path("playlistId") playlistId: String, @Query("nextpage") nextPage: String - ): Playlist + ): com.github.libretube.api.obj.Playlist @POST("login") - suspend fun login(@Body login: Login): Token + suspend fun login(@Body login: com.github.libretube.api.obj.Login): com.github.libretube.api.obj.Token @POST("register") - suspend fun register(@Body login: Login): Token + suspend fun register(@Body login: com.github.libretube.api.obj.Login): com.github.libretube.api.obj.Token @POST("user/delete") suspend fun deleteAccount( @Header("Authorization") token: String, - @Body password: DeleteUserRequest + @Body password: com.github.libretube.api.obj.DeleteUserRequest ) @GET("feed") - suspend fun getFeed(@Query("authToken") token: String?): List + suspend fun getFeed(@Query("authToken") token: String?): List @GET("feed/unauthenticated") - suspend fun getUnauthenticatedFeed(@Query("channels") channels: String): List + suspend fun getUnauthenticatedFeed(@Query("channels") channels: String): List @GET("subscribed") suspend fun isSubscribed( @Query("channelId") channelId: String, @Header("Authorization") token: String - ): Subscribed + ): com.github.libretube.api.obj.Subscribed @GET("subscriptions") - suspend fun subscriptions(@Header("Authorization") token: String): List + suspend fun subscriptions(@Header("Authorization") token: String): List @GET("subscriptions/unauthenticated") - suspend fun unauthenticatedSubscriptions(@Query("channels") channels: String): List + suspend fun unauthenticatedSubscriptions(@Query("channels") channels: String): List @POST("subscribe") suspend fun subscribe( @Header("Authorization") token: String, - @Body subscribe: Subscribe - ): Message + @Body subscribe: com.github.libretube.api.obj.Subscribe + ): com.github.libretube.api.obj.Message @POST("unsubscribe") suspend fun unsubscribe( @Header("Authorization") token: String, - @Body subscribe: Subscribe - ): Message + @Body subscribe: com.github.libretube.api.obj.Subscribe + ): com.github.libretube.api.obj.Message @POST("import") suspend fun importSubscriptions( @Query("override") override: Boolean, @Header("Authorization") token: String, @Body channels: List - ): Message + ): com.github.libretube.api.obj.Message @POST("import/playlist") suspend fun importPlaylist( @Header("Authorization") token: String, - @Body playlistId: PlaylistId - ): Message + @Body playlistId: com.github.libretube.api.obj.PlaylistId + ): com.github.libretube.api.obj.Message @GET("user/playlists") - suspend fun playlists(@Header("Authorization") token: String): List + suspend fun playlists(@Header("Authorization") token: String): List @POST("user/playlists/rename") suspend fun renamePlaylist( @Header("Authorization") token: String, - @Body playlistId: PlaylistId + @Body playlistId: com.github.libretube.api.obj.PlaylistId ) @POST("user/playlists/delete") suspend fun deletePlaylist( @Header("Authorization") token: String, - @Body playlistId: PlaylistId - ): Message + @Body playlistId: com.github.libretube.api.obj.PlaylistId + ): com.github.libretube.api.obj.Message @POST("user/playlists/create") suspend fun createPlaylist( @Header("Authorization") token: String, - @Body name: Playlists - ): PlaylistId + @Body name: com.github.libretube.api.obj.Playlists + ): com.github.libretube.api.obj.PlaylistId @POST("user/playlists/add") suspend fun addToPlaylist( @Header("Authorization") token: String, - @Body playlistId: PlaylistId - ): Message + @Body playlistId: com.github.libretube.api.obj.PlaylistId + ): com.github.libretube.api.obj.Message @POST("user/playlists/remove") suspend fun removeFromPlaylist( @Header("Authorization") token: String, - @Body playlistId: PlaylistId - ): Message + @Body playlistId: com.github.libretube.api.obj.PlaylistId + ): com.github.libretube.api.obj.Message } diff --git a/app/src/main/java/com/github/libretube/api/SubscriptionHelper.kt b/app/src/main/java/com/github/libretube/api/SubscriptionHelper.kt index 510b1362a..333138350 100644 --- a/app/src/main/java/com/github/libretube/api/SubscriptionHelper.kt +++ b/app/src/main/java/com/github/libretube/api/SubscriptionHelper.kt @@ -5,7 +5,7 @@ import com.github.libretube.db.DatabaseHolder.Companion.Database import com.github.libretube.db.obj.LocalSubscription import com.github.libretube.extensions.TAG import com.github.libretube.extensions.await -import com.github.libretube.obj.Subscribe +import com.github.libretube.api.obj.Subscribe import com.github.libretube.util.PreferenceHelper import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Dispatchers @@ -19,7 +19,7 @@ object SubscriptionHelper { try { RetrofitInstance.authApi.subscribe( PreferenceHelper.getToken(), - Subscribe(channelId) + com.github.libretube.api.obj.Subscribe(channelId) ) } catch (e: Exception) { Log.e(TAG(), e.toString()) @@ -40,7 +40,7 @@ object SubscriptionHelper { try { RetrofitInstance.authApi.unsubscribe( PreferenceHelper.getToken(), - Subscribe(channelId) + com.github.libretube.api.obj.Subscribe(channelId) ) } catch (e: Exception) { Log.e(TAG(), e.toString()) diff --git a/app/src/main/java/com/github/libretube/obj/Channel.kt b/app/src/main/java/com/github/libretube/api/obj/Channel.kt similarity index 77% rename from app/src/main/java/com/github/libretube/obj/Channel.kt rename to app/src/main/java/com/github/libretube/api/obj/Channel.kt index 3cccb1c94..9ef59269f 100644 --- a/app/src/main/java/com/github/libretube/obj/Channel.kt +++ b/app/src/main/java/com/github/libretube/api/obj/Channel.kt @@ -1,4 +1,4 @@ -package com.github.libretube.obj +package com.github.libretube.api.obj import com.fasterxml.jackson.annotation.JsonIgnoreProperties @@ -12,5 +12,5 @@ data class Channel( var nextpage: String? = null, var subscriberCount: Long = 0, var verified: Boolean = false, - var relatedStreams: List? = null + var relatedStreams: List? = null ) diff --git a/app/src/main/java/com/github/libretube/obj/ChapterSegment.kt b/app/src/main/java/com/github/libretube/api/obj/ChapterSegment.kt similarity index 85% rename from app/src/main/java/com/github/libretube/obj/ChapterSegment.kt rename to app/src/main/java/com/github/libretube/api/obj/ChapterSegment.kt index 38120cc81..6fbdfed00 100644 --- a/app/src/main/java/com/github/libretube/obj/ChapterSegment.kt +++ b/app/src/main/java/com/github/libretube/api/obj/ChapterSegment.kt @@ -1,4 +1,4 @@ -package com.github.libretube.obj +package com.github.libretube.api.obj import com.fasterxml.jackson.annotation.JsonIgnoreProperties diff --git a/app/src/main/java/com/github/libretube/obj/Comment.kt b/app/src/main/java/com/github/libretube/api/obj/Comment.kt similarity index 93% rename from app/src/main/java/com/github/libretube/obj/Comment.kt rename to app/src/main/java/com/github/libretube/api/obj/Comment.kt index 5266c0d47..398689d8b 100644 --- a/app/src/main/java/com/github/libretube/obj/Comment.kt +++ b/app/src/main/java/com/github/libretube/api/obj/Comment.kt @@ -1,4 +1,4 @@ -package com.github.libretube.obj +package com.github.libretube.api.obj import com.fasterxml.jackson.annotation.JsonIgnoreProperties diff --git a/app/src/main/java/com/github/libretube/obj/CommentsPage.kt b/app/src/main/java/com/github/libretube/api/obj/CommentsPage.kt similarity index 62% rename from app/src/main/java/com/github/libretube/obj/CommentsPage.kt rename to app/src/main/java/com/github/libretube/api/obj/CommentsPage.kt index 1244cc4a9..e0b8a01bf 100644 --- a/app/src/main/java/com/github/libretube/obj/CommentsPage.kt +++ b/app/src/main/java/com/github/libretube/api/obj/CommentsPage.kt @@ -1,10 +1,10 @@ -package com.github.libretube.obj +package com.github.libretube.api.obj import com.fasterxml.jackson.annotation.JsonIgnoreProperties @JsonIgnoreProperties(ignoreUnknown = true) data class CommentsPage( - val comments: MutableList = arrayListOf(), + val comments: MutableList = arrayListOf(), val disabled: Boolean? = null, val nextpage: String? = "" ) diff --git a/app/src/main/java/com/github/libretube/obj/DeleteUserRequest.kt b/app/src/main/java/com/github/libretube/api/obj/DeleteUserRequest.kt similarity index 64% rename from app/src/main/java/com/github/libretube/obj/DeleteUserRequest.kt rename to app/src/main/java/com/github/libretube/api/obj/DeleteUserRequest.kt index f48084e46..e4a961836 100644 --- a/app/src/main/java/com/github/libretube/obj/DeleteUserRequest.kt +++ b/app/src/main/java/com/github/libretube/api/obj/DeleteUserRequest.kt @@ -1,4 +1,4 @@ -package com.github.libretube.obj +package com.github.libretube.api.obj data class DeleteUserRequest( var password: String? = null diff --git a/app/src/main/java/com/github/libretube/obj/Instances.kt b/app/src/main/java/com/github/libretube/api/obj/Instances.kt similarity index 91% rename from app/src/main/java/com/github/libretube/obj/Instances.kt rename to app/src/main/java/com/github/libretube/api/obj/Instances.kt index 99a75c2d8..053cb8b63 100644 --- a/app/src/main/java/com/github/libretube/obj/Instances.kt +++ b/app/src/main/java/com/github/libretube/api/obj/Instances.kt @@ -1,4 +1,4 @@ -package com.github.libretube.obj +package com.github.libretube.api.obj import com.fasterxml.jackson.annotation.JsonIgnoreProperties diff --git a/app/src/main/java/com/github/libretube/obj/Login.kt b/app/src/main/java/com/github/libretube/api/obj/Login.kt similarity index 83% rename from app/src/main/java/com/github/libretube/obj/Login.kt rename to app/src/main/java/com/github/libretube/api/obj/Login.kt index 962d9394c..0636d72d9 100644 --- a/app/src/main/java/com/github/libretube/obj/Login.kt +++ b/app/src/main/java/com/github/libretube/api/obj/Login.kt @@ -1,4 +1,4 @@ -package com.github.libretube.obj +package com.github.libretube.api.obj import com.fasterxml.jackson.annotation.JsonIgnoreProperties diff --git a/app/src/main/java/com/github/libretube/obj/Message.kt b/app/src/main/java/com/github/libretube/api/obj/Message.kt similarity index 59% rename from app/src/main/java/com/github/libretube/obj/Message.kt rename to app/src/main/java/com/github/libretube/api/obj/Message.kt index 5a0afeb26..93f063af0 100644 --- a/app/src/main/java/com/github/libretube/obj/Message.kt +++ b/app/src/main/java/com/github/libretube/api/obj/Message.kt @@ -1,4 +1,4 @@ -package com.github.libretube.obj +package com.github.libretube.api.obj data class Message( var message: String? = null diff --git a/app/src/main/java/com/github/libretube/obj/PipedStream.kt b/app/src/main/java/com/github/libretube/api/obj/PipedStream.kt similarity index 93% rename from app/src/main/java/com/github/libretube/obj/PipedStream.kt rename to app/src/main/java/com/github/libretube/api/obj/PipedStream.kt index 59109a210..ed9e9d973 100644 --- a/app/src/main/java/com/github/libretube/obj/PipedStream.kt +++ b/app/src/main/java/com/github/libretube/api/obj/PipedStream.kt @@ -1,4 +1,4 @@ -package com.github.libretube.obj +package com.github.libretube.api.obj import com.fasterxml.jackson.annotation.JsonIgnoreProperties diff --git a/app/src/main/java/com/github/libretube/obj/Playlist.kt b/app/src/main/java/com/github/libretube/api/obj/Playlist.kt similarity index 77% rename from app/src/main/java/com/github/libretube/obj/Playlist.kt rename to app/src/main/java/com/github/libretube/api/obj/Playlist.kt index 1c1a054b4..7cd691cb6 100644 --- a/app/src/main/java/com/github/libretube/obj/Playlist.kt +++ b/app/src/main/java/com/github/libretube/api/obj/Playlist.kt @@ -1,4 +1,4 @@ -package com.github.libretube.obj +package com.github.libretube.api.obj import com.fasterxml.jackson.annotation.JsonIgnoreProperties @@ -12,5 +12,5 @@ data class Playlist( var uploaderUrl: String? = null, var uploaderAvatar: String? = null, var videos: Int? = 0, - var relatedStreams: List? = null + var relatedStreams: List? = null ) diff --git a/app/src/main/java/com/github/libretube/obj/PlaylistId.kt b/app/src/main/java/com/github/libretube/api/obj/PlaylistId.kt similarity index 87% rename from app/src/main/java/com/github/libretube/obj/PlaylistId.kt rename to app/src/main/java/com/github/libretube/api/obj/PlaylistId.kt index b814e0055..088a105c2 100644 --- a/app/src/main/java/com/github/libretube/obj/PlaylistId.kt +++ b/app/src/main/java/com/github/libretube/api/obj/PlaylistId.kt @@ -1,4 +1,4 @@ -package com.github.libretube.obj +package com.github.libretube.api.obj import com.fasterxml.jackson.annotation.JsonIgnoreProperties diff --git a/app/src/main/java/com/github/libretube/obj/Playlists.kt b/app/src/main/java/com/github/libretube/api/obj/Playlists.kt similarity index 87% rename from app/src/main/java/com/github/libretube/obj/Playlists.kt rename to app/src/main/java/com/github/libretube/api/obj/Playlists.kt index f5dd42a61..2d46ced8f 100644 --- a/app/src/main/java/com/github/libretube/obj/Playlists.kt +++ b/app/src/main/java/com/github/libretube/api/obj/Playlists.kt @@ -1,4 +1,4 @@ -package com.github.libretube.obj +package com.github.libretube.api.obj import com.fasterxml.jackson.annotation.JsonIgnoreProperties diff --git a/app/src/main/java/com/github/libretube/obj/SearchItem.kt b/app/src/main/java/com/github/libretube/api/obj/SearchItem.kt similarity index 95% rename from app/src/main/java/com/github/libretube/obj/SearchItem.kt rename to app/src/main/java/com/github/libretube/api/obj/SearchItem.kt index 526ecc071..f55604d8b 100644 --- a/app/src/main/java/com/github/libretube/obj/SearchItem.kt +++ b/app/src/main/java/com/github/libretube/api/obj/SearchItem.kt @@ -1,4 +1,4 @@ -package com.github.libretube.obj +package com.github.libretube.api.obj import com.fasterxml.jackson.annotation.JsonIgnoreProperties diff --git a/app/src/main/java/com/github/libretube/obj/SearchResult.kt b/app/src/main/java/com/github/libretube/api/obj/SearchResult.kt similarity index 88% rename from app/src/main/java/com/github/libretube/obj/SearchResult.kt rename to app/src/main/java/com/github/libretube/api/obj/SearchResult.kt index 49286ce93..42ff66005 100644 --- a/app/src/main/java/com/github/libretube/obj/SearchResult.kt +++ b/app/src/main/java/com/github/libretube/api/obj/SearchResult.kt @@ -1,4 +1,4 @@ -package com.github.libretube.obj +package com.github.libretube.api.obj import com.fasterxml.jackson.annotation.JsonIgnoreProperties diff --git a/app/src/main/java/com/github/libretube/obj/Segment.kt b/app/src/main/java/com/github/libretube/api/obj/Segment.kt similarity index 86% rename from app/src/main/java/com/github/libretube/obj/Segment.kt rename to app/src/main/java/com/github/libretube/api/obj/Segment.kt index b4eff6aec..ea92df057 100644 --- a/app/src/main/java/com/github/libretube/obj/Segment.kt +++ b/app/src/main/java/com/github/libretube/api/obj/Segment.kt @@ -1,4 +1,4 @@ -package com.github.libretube.obj +package com.github.libretube.api.obj import com.fasterxml.jackson.annotation.JsonIgnoreProperties diff --git a/app/src/main/java/com/github/libretube/obj/Segments.kt b/app/src/main/java/com/github/libretube/api/obj/Segments.kt similarity index 51% rename from app/src/main/java/com/github/libretube/obj/Segments.kt rename to app/src/main/java/com/github/libretube/api/obj/Segments.kt index e7c1b1297..2d70bfe72 100644 --- a/app/src/main/java/com/github/libretube/obj/Segments.kt +++ b/app/src/main/java/com/github/libretube/api/obj/Segments.kt @@ -1,8 +1,8 @@ -package com.github.libretube.obj +package com.github.libretube.api.obj import com.fasterxml.jackson.annotation.JsonIgnoreProperties @JsonIgnoreProperties(ignoreUnknown = true) data class Segments( - val segments: MutableList = arrayListOf() + val segments: MutableList = arrayListOf() ) diff --git a/app/src/main/java/com/github/libretube/obj/StreamItem.kt b/app/src/main/java/com/github/libretube/api/obj/StreamItem.kt similarity index 93% rename from app/src/main/java/com/github/libretube/obj/StreamItem.kt rename to app/src/main/java/com/github/libretube/api/obj/StreamItem.kt index b8eb2ee9e..ad612a9fc 100644 --- a/app/src/main/java/com/github/libretube/obj/StreamItem.kt +++ b/app/src/main/java/com/github/libretube/api/obj/StreamItem.kt @@ -1,4 +1,4 @@ -package com.github.libretube.obj +package com.github.libretube.api.obj import com.fasterxml.jackson.annotation.JsonIgnoreProperties diff --git a/app/src/main/java/com/github/libretube/obj/Streams.kt b/app/src/main/java/com/github/libretube/api/obj/Streams.kt similarity index 66% rename from app/src/main/java/com/github/libretube/obj/Streams.kt rename to app/src/main/java/com/github/libretube/api/obj/Streams.kt index b497859ac..13dd5efea 100644 --- a/app/src/main/java/com/github/libretube/obj/Streams.kt +++ b/app/src/main/java/com/github/libretube/api/obj/Streams.kt @@ -1,4 +1,4 @@ -package com.github.libretube.obj +package com.github.libretube.api.obj import com.fasterxml.jackson.annotation.JsonIgnoreProperties @@ -19,13 +19,13 @@ data class Streams( val views: Long?, val likes: Long?, val dislikes: Long?, - val audioStreams: List?, - val videoStreams: List?, - val relatedStreams: List?, - val subtitles: List?, + val audioStreams: List?, + val videoStreams: List?, + val relatedStreams: List?, + val subtitles: List?, val livestream: Boolean?, val proxyUrl: String?, - val chapters: List? + val chapters: List? ) { constructor() : this( "", "", "", "", "", "", "", "", "", "", null, -1, -1, -1, -1, emptyList(), emptyList(), diff --git a/app/src/main/java/com/github/libretube/obj/Subscribe.kt b/app/src/main/java/com/github/libretube/api/obj/Subscribe.kt similarity index 81% rename from app/src/main/java/com/github/libretube/obj/Subscribe.kt rename to app/src/main/java/com/github/libretube/api/obj/Subscribe.kt index 83995018b..f474e129b 100644 --- a/app/src/main/java/com/github/libretube/obj/Subscribe.kt +++ b/app/src/main/java/com/github/libretube/api/obj/Subscribe.kt @@ -1,4 +1,4 @@ -package com.github.libretube.obj +package com.github.libretube.api.obj import com.fasterxml.jackson.annotation.JsonIgnoreProperties diff --git a/app/src/main/java/com/github/libretube/obj/Subscribed.kt b/app/src/main/java/com/github/libretube/api/obj/Subscribed.kt similarity index 81% rename from app/src/main/java/com/github/libretube/obj/Subscribed.kt rename to app/src/main/java/com/github/libretube/api/obj/Subscribed.kt index ebe36afc0..f20324e50 100644 --- a/app/src/main/java/com/github/libretube/obj/Subscribed.kt +++ b/app/src/main/java/com/github/libretube/api/obj/Subscribed.kt @@ -1,4 +1,4 @@ -package com.github.libretube.obj +package com.github.libretube.api.obj import com.fasterxml.jackson.annotation.JsonIgnoreProperties diff --git a/app/src/main/java/com/github/libretube/obj/Subscription.kt b/app/src/main/java/com/github/libretube/api/obj/Subscription.kt similarity index 87% rename from app/src/main/java/com/github/libretube/obj/Subscription.kt rename to app/src/main/java/com/github/libretube/api/obj/Subscription.kt index 5eb7eccc4..5ddcf0861 100644 --- a/app/src/main/java/com/github/libretube/obj/Subscription.kt +++ b/app/src/main/java/com/github/libretube/api/obj/Subscription.kt @@ -1,4 +1,4 @@ -package com.github.libretube.obj +package com.github.libretube.api.obj import com.fasterxml.jackson.annotation.JsonIgnoreProperties diff --git a/app/src/main/java/com/github/libretube/obj/Subtitle.kt b/app/src/main/java/com/github/libretube/api/obj/Subtitle.kt similarity index 88% rename from app/src/main/java/com/github/libretube/obj/Subtitle.kt rename to app/src/main/java/com/github/libretube/api/obj/Subtitle.kt index 1bcdc6957..74454e802 100644 --- a/app/src/main/java/com/github/libretube/obj/Subtitle.kt +++ b/app/src/main/java/com/github/libretube/api/obj/Subtitle.kt @@ -1,4 +1,4 @@ -package com.github.libretube.obj +package com.github.libretube.api.obj import com.fasterxml.jackson.annotation.JsonIgnoreProperties diff --git a/app/src/main/java/com/github/libretube/obj/Token.kt b/app/src/main/java/com/github/libretube/api/obj/Token.kt similarity index 83% rename from app/src/main/java/com/github/libretube/obj/Token.kt rename to app/src/main/java/com/github/libretube/api/obj/Token.kt index 9682cec96..6f49ff7e8 100644 --- a/app/src/main/java/com/github/libretube/obj/Token.kt +++ b/app/src/main/java/com/github/libretube/api/obj/Token.kt @@ -1,4 +1,4 @@ -package com.github.libretube.obj +package com.github.libretube.api.obj import com.fasterxml.jackson.annotation.JsonIgnoreProperties diff --git a/app/src/main/java/com/github/libretube/db/DatabaseHelper.kt b/app/src/main/java/com/github/libretube/db/DatabaseHelper.kt index e4dcb9780..b0a083423 100644 --- a/app/src/main/java/com/github/libretube/db/DatabaseHelper.kt +++ b/app/src/main/java/com/github/libretube/db/DatabaseHelper.kt @@ -6,11 +6,11 @@ import com.github.libretube.db.obj.SearchHistoryItem import com.github.libretube.db.obj.WatchHistoryItem import com.github.libretube.db.obj.WatchPosition import com.github.libretube.extensions.toID -import com.github.libretube.obj.Streams +import com.github.libretube.api.obj.Streams import com.github.libretube.util.PreferenceHelper object DatabaseHelper { - fun addToWatchHistory(videoId: String, streams: Streams) { + fun addToWatchHistory(videoId: String, streams: com.github.libretube.api.obj.Streams) { val watchHistoryItem = WatchHistoryItem( videoId, streams.title, diff --git a/app/src/main/java/com/github/libretube/models/SubscriptionsViewModel.kt b/app/src/main/java/com/github/libretube/models/SubscriptionsViewModel.kt index 7cd7213b7..cac255157 100644 --- a/app/src/main/java/com/github/libretube/models/SubscriptionsViewModel.kt +++ b/app/src/main/java/com/github/libretube/models/SubscriptionsViewModel.kt @@ -7,8 +7,8 @@ import com.github.libretube.api.RetrofitInstance import com.github.libretube.api.SubscriptionHelper import com.github.libretube.extensions.TAG import com.github.libretube.extensions.toID -import com.github.libretube.obj.StreamItem -import com.github.libretube.obj.Subscription +import com.github.libretube.api.obj.StreamItem +import com.github.libretube.api.obj.Subscription import com.github.libretube.util.PreferenceHelper import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Dispatchers @@ -19,11 +19,11 @@ class SubscriptionsViewModel : ViewModel() { value = false } - var videoFeed = MutableLiveData?>().apply { + var videoFeed = MutableLiveData?>().apply { value = null } - var subscriptions = MutableLiveData?>().apply { + var subscriptions = MutableLiveData?>().apply { value = null } diff --git a/app/src/main/java/com/github/libretube/obj/NewPipeSubscriptions.kt b/app/src/main/java/com/github/libretube/obj/NewPipeSubscriptions.kt index 9c19551d2..20f2ed2b1 100644 --- a/app/src/main/java/com/github/libretube/obj/NewPipeSubscriptions.kt +++ b/app/src/main/java/com/github/libretube/obj/NewPipeSubscriptions.kt @@ -1,5 +1,7 @@ package com.github.libretube.obj +import com.github.libretube.obj.NewPipeSubscription + data class NewPipeSubscriptions( val app_version: String = "", val app_version_int: Int = 0, diff --git a/app/src/main/java/com/github/libretube/update/Asset.kt b/app/src/main/java/com/github/libretube/obj/update/Asset.kt similarity index 93% rename from app/src/main/java/com/github/libretube/update/Asset.kt rename to app/src/main/java/com/github/libretube/obj/update/Asset.kt index a1e4a2c5e..1388df1c1 100644 --- a/app/src/main/java/com/github/libretube/update/Asset.kt +++ b/app/src/main/java/com/github/libretube/obj/update/Asset.kt @@ -1,4 +1,4 @@ -package com.github.libretube.update +package com.github.libretube.obj.update import com.fasterxml.jackson.annotation.JsonIgnoreProperties diff --git a/app/src/main/java/com/github/libretube/update/Author.kt b/app/src/main/java/com/github/libretube/obj/update/Author.kt similarity index 95% rename from app/src/main/java/com/github/libretube/update/Author.kt rename to app/src/main/java/com/github/libretube/obj/update/Author.kt index 6b9ecd84d..ae61b7660 100644 --- a/app/src/main/java/com/github/libretube/update/Author.kt +++ b/app/src/main/java/com/github/libretube/obj/update/Author.kt @@ -1,4 +1,4 @@ -package com.github.libretube.update +package com.github.libretube.obj.update import com.fasterxml.jackson.annotation.JsonIgnoreProperties diff --git a/app/src/main/java/com/github/libretube/update/Reactions.kt b/app/src/main/java/com/github/libretube/obj/update/Reactions.kt similarity index 90% rename from app/src/main/java/com/github/libretube/update/Reactions.kt rename to app/src/main/java/com/github/libretube/obj/update/Reactions.kt index 9a87fc84d..0ec667860 100644 --- a/app/src/main/java/com/github/libretube/update/Reactions.kt +++ b/app/src/main/java/com/github/libretube/obj/update/Reactions.kt @@ -1,4 +1,4 @@ -package com.github.libretube.update +package com.github.libretube.obj.update import com.fasterxml.jackson.annotation.JsonIgnoreProperties diff --git a/app/src/main/java/com/github/libretube/update/UpdateInfo.kt b/app/src/main/java/com/github/libretube/obj/update/UpdateInfo.kt similarity index 95% rename from app/src/main/java/com/github/libretube/update/UpdateInfo.kt rename to app/src/main/java/com/github/libretube/obj/update/UpdateInfo.kt index f72391c3e..8491dc734 100644 --- a/app/src/main/java/com/github/libretube/update/UpdateInfo.kt +++ b/app/src/main/java/com/github/libretube/obj/update/UpdateInfo.kt @@ -1,4 +1,4 @@ -package com.github.libretube.update +package com.github.libretube.obj.update import com.fasterxml.jackson.annotation.JsonIgnoreProperties diff --git a/app/src/main/java/com/github/libretube/update/Uploader.kt b/app/src/main/java/com/github/libretube/obj/update/Uploader.kt similarity index 95% rename from app/src/main/java/com/github/libretube/update/Uploader.kt rename to app/src/main/java/com/github/libretube/obj/update/Uploader.kt index 6c19aff19..9dc63930b 100644 --- a/app/src/main/java/com/github/libretube/update/Uploader.kt +++ b/app/src/main/java/com/github/libretube/obj/update/Uploader.kt @@ -1,4 +1,4 @@ -package com.github.libretube.update +package com.github.libretube.obj.update import com.fasterxml.jackson.annotation.JsonIgnoreProperties diff --git a/app/src/main/java/com/github/libretube/services/BackgroundMode.kt b/app/src/main/java/com/github/libretube/services/BackgroundMode.kt index 3fd4010b2..f18930aad 100644 --- a/app/src/main/java/com/github/libretube/services/BackgroundMode.kt +++ b/app/src/main/java/com/github/libretube/services/BackgroundMode.kt @@ -18,9 +18,9 @@ import com.github.libretube.constants.IntentData import com.github.libretube.constants.PLAYER_NOTIFICATION_ID import com.github.libretube.constants.PreferenceKeys import com.github.libretube.extensions.toID -import com.github.libretube.obj.Segment -import com.github.libretube.obj.Segments -import com.github.libretube.obj.Streams +import com.github.libretube.api.obj.Segment +import com.github.libretube.api.obj.Segments +import com.github.libretube.api.obj.Streams import com.github.libretube.util.AutoPlayHelper import com.github.libretube.util.NowPlayingNotification import com.github.libretube.util.PlayerHelper @@ -52,7 +52,7 @@ class BackgroundMode : Service() { /** * The response that gets when called the Api. */ - private var streams: Streams? = null + private var streams: com.github.libretube.api.obj.Streams? = null /** * The [ExoPlayer] player. Followed tutorial [here](https://developer.android.com/codelabs/exoplayer-intro) @@ -68,7 +68,7 @@ class BackgroundMode : Service() { /** * SponsorBlock Segment data */ - private var segmentData: Segments? = null + private var segmentData: com.github.libretube.api.obj.Segments? = null /** * [Notification] for the player @@ -307,7 +307,7 @@ class BackgroundMode : Service() { if (segmentData == null || segmentData!!.segments.isEmpty()) return - segmentData!!.segments.forEach { segment: Segment -> + segmentData!!.segments.forEach { segment: com.github.libretube.api.obj.Segment -> val segmentStart = (segment.segment!![0] * 1000f).toLong() val segmentEnd = (segment.segment[1] * 1000f).toLong() val currentPosition = player?.currentPosition diff --git a/app/src/main/java/com/github/libretube/sheets/PlaylistOptionsBottomSheet.kt b/app/src/main/java/com/github/libretube/sheets/PlaylistOptionsBottomSheet.kt index 1969219ce..8134da711 100644 --- a/app/src/main/java/com/github/libretube/sheets/PlaylistOptionsBottomSheet.kt +++ b/app/src/main/java/com/github/libretube/sheets/PlaylistOptionsBottomSheet.kt @@ -7,13 +7,13 @@ import android.widget.Toast import com.github.libretube.R import com.github.libretube.api.RetrofitInstance import com.github.libretube.databinding.DialogTextPreferenceBinding -import com.github.libretube.dialogs.ShareDialog +import com.github.libretube.ui.dialogs.ShareDialog import com.github.libretube.extensions.TAG import com.github.libretube.extensions.toID -import com.github.libretube.obj.PlaylistId +import com.github.libretube.api.obj.PlaylistId import com.github.libretube.util.BackgroundHelper import com.github.libretube.util.PreferenceHelper -import com.github.libretube.views.BottomSheet +import com.github.libretube.ui.views.BottomSheet import com.google.android.material.dialog.MaterialAlertDialogBuilder import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Dispatchers @@ -114,7 +114,9 @@ class PlaylistOptionsBottomSheet( private fun importPlaylist(token: String, playlistId: String) { CoroutineScope(Dispatchers.IO).launch { val response = try { - RetrofitInstance.authApi.importPlaylist(token, PlaylistId(playlistId)) + RetrofitInstance.authApi.importPlaylist(token, + com.github.libretube.api.obj.PlaylistId(playlistId) + ) } catch (e: IOException) { println(e) return@launch @@ -130,7 +132,7 @@ class PlaylistOptionsBottomSheet( try { RetrofitInstance.authApi.renamePlaylist( PreferenceHelper.getToken(), - PlaylistId( + com.github.libretube.api.obj.PlaylistId( playlistId = id, newName = newName ) @@ -146,7 +148,7 @@ class PlaylistOptionsBottomSheet( try { RetrofitInstance.authApi.deletePlaylist( PreferenceHelper.getToken(), - PlaylistId(id) + com.github.libretube.api.obj.PlaylistId(id) ) } catch (e: Exception) { return@launch diff --git a/app/src/main/java/com/github/libretube/sheets/VideoOptionsBottomSheet.kt b/app/src/main/java/com/github/libretube/sheets/VideoOptionsBottomSheet.kt index ba4fa68af..2d82d3fa7 100644 --- a/app/src/main/java/com/github/libretube/sheets/VideoOptionsBottomSheet.kt +++ b/app/src/main/java/com/github/libretube/sheets/VideoOptionsBottomSheet.kt @@ -4,13 +4,13 @@ import android.os.Bundle import android.widget.Toast import com.github.libretube.R import com.github.libretube.constants.IntentData -import com.github.libretube.dialogs.AddToPlaylistDialog -import com.github.libretube.dialogs.DownloadDialog -import com.github.libretube.dialogs.ShareDialog +import com.github.libretube.ui.dialogs.AddToPlaylistDialog +import com.github.libretube.ui.dialogs.DownloadDialog +import com.github.libretube.ui.dialogs.ShareDialog import com.github.libretube.util.BackgroundHelper import com.github.libretube.util.PlayingQueue import com.github.libretube.util.PreferenceHelper -import com.github.libretube.views.BottomSheet +import com.github.libretube.ui.views.BottomSheet /** * Dialog with different options for a selected video. diff --git a/app/src/main/java/com/github/libretube/activities/AboutActivity.kt b/app/src/main/java/com/github/libretube/ui/activities/AboutActivity.kt similarity index 99% rename from app/src/main/java/com/github/libretube/activities/AboutActivity.kt rename to app/src/main/java/com/github/libretube/ui/activities/AboutActivity.kt index 7a8eacacc..277d65cc5 100644 --- a/app/src/main/java/com/github/libretube/activities/AboutActivity.kt +++ b/app/src/main/java/com/github/libretube/ui/activities/AboutActivity.kt @@ -1,4 +1,4 @@ -package com.github.libretube.activities +package com.github.libretube.ui.activities import android.content.ClipData import android.content.ClipboardManager diff --git a/app/src/main/java/com/github/libretube/activities/CommunityActivity.kt b/app/src/main/java/com/github/libretube/ui/activities/CommunityActivity.kt similarity index 97% rename from app/src/main/java/com/github/libretube/activities/CommunityActivity.kt rename to app/src/main/java/com/github/libretube/ui/activities/CommunityActivity.kt index d4d1f57e0..b48da6bc0 100644 --- a/app/src/main/java/com/github/libretube/activities/CommunityActivity.kt +++ b/app/src/main/java/com/github/libretube/ui/activities/CommunityActivity.kt @@ -1,4 +1,4 @@ -package com.github.libretube.activities +package com.github.libretube.ui.activities import android.content.Intent import android.net.Uri diff --git a/app/src/main/java/com/github/libretube/activities/MainActivity.kt b/app/src/main/java/com/github/libretube/ui/activities/MainActivity.kt similarity index 99% rename from app/src/main/java/com/github/libretube/activities/MainActivity.kt rename to app/src/main/java/com/github/libretube/ui/activities/MainActivity.kt index 27c49c31a..8ee5aaed9 100644 --- a/app/src/main/java/com/github/libretube/activities/MainActivity.kt +++ b/app/src/main/java/com/github/libretube/ui/activities/MainActivity.kt @@ -1,4 +1,4 @@ -package com.github.libretube.activities +package com.github.libretube.ui.activities import android.content.Intent import android.content.pm.ActivityInfo @@ -25,10 +25,10 @@ import com.github.libretube.R import com.github.libretube.constants.IntentData import com.github.libretube.constants.PreferenceKeys import com.github.libretube.databinding.ActivityMainBinding -import com.github.libretube.dialogs.ErrorDialog +import com.github.libretube.ui.dialogs.ErrorDialog import com.github.libretube.extensions.BaseActivity import com.github.libretube.extensions.toID -import com.github.libretube.fragments.PlayerFragment +import com.github.libretube.ui.fragments.PlayerFragment import com.github.libretube.models.PlayerViewModel import com.github.libretube.models.SearchViewModel import com.github.libretube.models.SubscriptionsViewModel diff --git a/app/src/main/java/com/github/libretube/activities/NoInternetActivity.kt b/app/src/main/java/com/github/libretube/ui/activities/NoInternetActivity.kt similarity index 95% rename from app/src/main/java/com/github/libretube/activities/NoInternetActivity.kt rename to app/src/main/java/com/github/libretube/ui/activities/NoInternetActivity.kt index aa6da6756..c76a0b1f9 100644 --- a/app/src/main/java/com/github/libretube/activities/NoInternetActivity.kt +++ b/app/src/main/java/com/github/libretube/ui/activities/NoInternetActivity.kt @@ -1,4 +1,4 @@ -package com.github.libretube.activities +package com.github.libretube.ui.activities import android.content.Intent import android.os.Bundle @@ -7,7 +7,7 @@ import com.github.libretube.R import com.github.libretube.databinding.ActivityNointernetBinding import com.github.libretube.extensions.BaseActivity import com.github.libretube.extensions.getStyledSnackBar -import com.github.libretube.fragments.DownloadsFragment +import com.github.libretube.ui.fragments.DownloadsFragment import com.github.libretube.util.NetworkHelper import com.github.libretube.util.ThemeHelper diff --git a/app/src/main/java/com/github/libretube/activities/OfflinePlayerActivity.kt b/app/src/main/java/com/github/libretube/ui/activities/OfflinePlayerActivity.kt similarity index 99% rename from app/src/main/java/com/github/libretube/activities/OfflinePlayerActivity.kt rename to app/src/main/java/com/github/libretube/ui/activities/OfflinePlayerActivity.kt index 077e036ad..ab148e5f9 100644 --- a/app/src/main/java/com/github/libretube/activities/OfflinePlayerActivity.kt +++ b/app/src/main/java/com/github/libretube/ui/activities/OfflinePlayerActivity.kt @@ -1,4 +1,4 @@ -package com.github.libretube.activities +package com.github.libretube.ui.activities import android.content.pm.ActivityInfo import android.graphics.Color diff --git a/app/src/main/java/com/github/libretube/activities/RouterActivity.kt b/app/src/main/java/com/github/libretube/ui/activities/RouterActivity.kt similarity index 98% rename from app/src/main/java/com/github/libretube/activities/RouterActivity.kt rename to app/src/main/java/com/github/libretube/ui/activities/RouterActivity.kt index 7c9f98ee1..8d0319a75 100644 --- a/app/src/main/java/com/github/libretube/activities/RouterActivity.kt +++ b/app/src/main/java/com/github/libretube/ui/activities/RouterActivity.kt @@ -1,4 +1,4 @@ -package com.github.libretube.activities +package com.github.libretube.ui.activities import android.content.Intent import android.content.pm.PackageManager diff --git a/app/src/main/java/com/github/libretube/activities/SettingsActivity.kt b/app/src/main/java/com/github/libretube/ui/activities/SettingsActivity.kt similarity index 94% rename from app/src/main/java/com/github/libretube/activities/SettingsActivity.kt rename to app/src/main/java/com/github/libretube/ui/activities/SettingsActivity.kt index 7ec558e68..416bdc213 100644 --- a/app/src/main/java/com/github/libretube/activities/SettingsActivity.kt +++ b/app/src/main/java/com/github/libretube/ui/activities/SettingsActivity.kt @@ -1,11 +1,11 @@ -package com.github.libretube.activities +package com.github.libretube.ui.activities import android.os.Bundle import androidx.activity.OnBackPressedCallback import com.github.libretube.R import com.github.libretube.databinding.ActivitySettingsBinding import com.github.libretube.extensions.BaseActivity -import com.github.libretube.preferences.MainSettings +import com.github.libretube.ui.preferences.MainSettings class SettingsActivity : BaseActivity() { lateinit var binding: ActivitySettingsBinding diff --git a/app/src/main/java/com/github/libretube/adapters/BackupOptionsAdapter.kt b/app/src/main/java/com/github/libretube/ui/adapters/BackupOptionsAdapter.kt similarity index 96% rename from app/src/main/java/com/github/libretube/adapters/BackupOptionsAdapter.kt rename to app/src/main/java/com/github/libretube/ui/adapters/BackupOptionsAdapter.kt index afae49d93..df171b4af 100644 --- a/app/src/main/java/com/github/libretube/adapters/BackupOptionsAdapter.kt +++ b/app/src/main/java/com/github/libretube/ui/adapters/BackupOptionsAdapter.kt @@ -1,4 +1,4 @@ -package com.github.libretube.adapters +package com.github.libretube.ui.adapters import android.view.LayoutInflater import android.view.ViewGroup diff --git a/app/src/main/java/com/github/libretube/adapters/BottomSheetAdapter.kt b/app/src/main/java/com/github/libretube/ui/adapters/BottomSheetAdapter.kt similarity index 97% rename from app/src/main/java/com/github/libretube/adapters/BottomSheetAdapter.kt rename to app/src/main/java/com/github/libretube/ui/adapters/BottomSheetAdapter.kt index 80fff9c24..35076697d 100644 --- a/app/src/main/java/com/github/libretube/adapters/BottomSheetAdapter.kt +++ b/app/src/main/java/com/github/libretube/ui/adapters/BottomSheetAdapter.kt @@ -1,4 +1,4 @@ -package com.github.libretube.adapters +package com.github.libretube.ui.adapters import android.view.LayoutInflater import android.view.View diff --git a/app/src/main/java/com/github/libretube/adapters/ChannelAdapter.kt b/app/src/main/java/com/github/libretube/ui/adapters/ChannelAdapter.kt similarity index 90% rename from app/src/main/java/com/github/libretube/adapters/ChannelAdapter.kt rename to app/src/main/java/com/github/libretube/ui/adapters/ChannelAdapter.kt index e09ada15c..ffd7b38a4 100644 --- a/app/src/main/java/com/github/libretube/adapters/ChannelAdapter.kt +++ b/app/src/main/java/com/github/libretube/ui/adapters/ChannelAdapter.kt @@ -1,4 +1,4 @@ -package com.github.libretube.adapters +package com.github.libretube.ui.adapters import android.text.format.DateUtils import android.view.LayoutInflater @@ -9,13 +9,13 @@ import com.github.libretube.databinding.VideoRowBinding import com.github.libretube.extensions.formatShort import com.github.libretube.extensions.setWatchProgressLength import com.github.libretube.extensions.toID -import com.github.libretube.obj.StreamItem +import com.github.libretube.api.obj.StreamItem import com.github.libretube.sheets.VideoOptionsBottomSheet import com.github.libretube.util.ImageHelper import com.github.libretube.util.NavigationHelper class ChannelAdapter( - private val videoFeed: MutableList, + private val videoFeed: MutableList, private val childFragmentManager: FragmentManager ) : RecyclerView.Adapter() { @@ -24,7 +24,7 @@ class ChannelAdapter( return videoFeed.size } - fun updateItems(newItems: List) { + fun updateItems(newItems: List) { val feedSize = videoFeed.size videoFeed.addAll(newItems) notifyItemRangeInserted(feedSize, newItems.size) diff --git a/app/src/main/java/com/github/libretube/adapters/ChaptersAdapter.kt b/app/src/main/java/com/github/libretube/ui/adapters/ChaptersAdapter.kt similarity index 92% rename from app/src/main/java/com/github/libretube/adapters/ChaptersAdapter.kt rename to app/src/main/java/com/github/libretube/ui/adapters/ChaptersAdapter.kt index f85c6536c..7fd29ad10 100644 --- a/app/src/main/java/com/github/libretube/adapters/ChaptersAdapter.kt +++ b/app/src/main/java/com/github/libretube/ui/adapters/ChaptersAdapter.kt @@ -1,17 +1,17 @@ -package com.github.libretube.adapters +package com.github.libretube.ui.adapters import android.graphics.Color import android.view.LayoutInflater import android.view.ViewGroup import androidx.recyclerview.widget.RecyclerView import com.github.libretube.databinding.ChapterColumnBinding -import com.github.libretube.obj.ChapterSegment +import com.github.libretube.api.obj.ChapterSegment import com.github.libretube.util.ImageHelper import com.github.libretube.util.ThemeHelper import com.google.android.exoplayer2.ExoPlayer class ChaptersAdapter( - private val chapters: List, + private val chapters: List, private val exoPlayer: ExoPlayer ) : RecyclerView.Adapter() { private var selectedPosition = 0 diff --git a/app/src/main/java/com/github/libretube/adapters/CommentsAdapter.kt b/app/src/main/java/com/github/libretube/ui/adapters/CommentsAdapter.kt similarity index 91% rename from app/src/main/java/com/github/libretube/adapters/CommentsAdapter.kt rename to app/src/main/java/com/github/libretube/ui/adapters/CommentsAdapter.kt index 4f40dc1f8..08ee77465 100644 --- a/app/src/main/java/com/github/libretube/adapters/CommentsAdapter.kt +++ b/app/src/main/java/com/github/libretube/ui/adapters/CommentsAdapter.kt @@ -1,4 +1,4 @@ -package com.github.libretube.adapters +package com.github.libretube.ui.adapters import android.util.Log import android.view.LayoutInflater @@ -12,8 +12,8 @@ import com.github.libretube.api.RetrofitInstance import com.github.libretube.databinding.CommentsRowBinding import com.github.libretube.extensions.TAG import com.github.libretube.extensions.formatShort -import com.github.libretube.obj.Comment -import com.github.libretube.obj.CommentsPage +import com.github.libretube.api.obj.Comment +import com.github.libretube.api.obj.CommentsPage import com.github.libretube.util.ImageHelper import com.github.libretube.util.NavigationHelper import kotlinx.coroutines.CoroutineScope @@ -24,14 +24,14 @@ import java.io.IOException class CommentsAdapter( private val videoId: String, - private val comments: MutableList + private val comments: MutableList ) : RecyclerView.Adapter() { private var isLoading = false private var nextpage = "" - private var repliesPage = CommentsPage() + private var repliesPage = com.github.libretube.api.obj.CommentsPage() - fun updateItems(newItems: List) { + fun updateItems(newItems: List) { val commentsSize = comments.size comments.addAll(newItems) notifyItemRangeInserted(commentsSize, newItems.size) diff --git a/app/src/main/java/com/github/libretube/adapters/DownloadsAdapter.kt b/app/src/main/java/com/github/libretube/ui/adapters/DownloadsAdapter.kt similarity index 96% rename from app/src/main/java/com/github/libretube/adapters/DownloadsAdapter.kt rename to app/src/main/java/com/github/libretube/ui/adapters/DownloadsAdapter.kt index 0be4e5129..60ef45b8c 100644 --- a/app/src/main/java/com/github/libretube/adapters/DownloadsAdapter.kt +++ b/app/src/main/java/com/github/libretube/ui/adapters/DownloadsAdapter.kt @@ -1,4 +1,4 @@ -package com.github.libretube.adapters +package com.github.libretube.ui.adapters import android.annotation.SuppressLint import android.content.Intent @@ -6,7 +6,7 @@ import android.view.LayoutInflater import android.view.ViewGroup import androidx.recyclerview.widget.RecyclerView import com.github.libretube.R -import com.github.libretube.activities.OfflinePlayerActivity +import com.github.libretube.ui.activities.OfflinePlayerActivity import com.github.libretube.constants.IntentData import com.github.libretube.databinding.DownloadedMediaRowBinding import com.github.libretube.obj.DownloadedFile diff --git a/app/src/main/java/com/github/libretube/adapters/LegacySubscriptionAdapter.kt b/app/src/main/java/com/github/libretube/ui/adapters/LegacySubscriptionAdapter.kt similarity index 90% rename from app/src/main/java/com/github/libretube/adapters/LegacySubscriptionAdapter.kt rename to app/src/main/java/com/github/libretube/ui/adapters/LegacySubscriptionAdapter.kt index 253e6fb75..67286c7cb 100644 --- a/app/src/main/java/com/github/libretube/adapters/LegacySubscriptionAdapter.kt +++ b/app/src/main/java/com/github/libretube/ui/adapters/LegacySubscriptionAdapter.kt @@ -1,16 +1,16 @@ -package com.github.libretube.adapters +package com.github.libretube.ui.adapters import android.view.LayoutInflater import android.view.ViewGroup import androidx.recyclerview.widget.RecyclerView import com.github.libretube.databinding.LegacySubscriptionChannelBinding import com.github.libretube.extensions.toID -import com.github.libretube.obj.Subscription +import com.github.libretube.api.obj.Subscription import com.github.libretube.util.ImageHelper import com.github.libretube.util.NavigationHelper class LegacySubscriptionAdapter( - private val subscriptions: List + private val subscriptions: List ) : RecyclerView.Adapter() { override fun onCreateViewHolder( diff --git a/app/src/main/java/com/github/libretube/adapters/NavBarOptionsAdapter.kt b/app/src/main/java/com/github/libretube/ui/adapters/NavBarOptionsAdapter.kt similarity index 97% rename from app/src/main/java/com/github/libretube/adapters/NavBarOptionsAdapter.kt rename to app/src/main/java/com/github/libretube/ui/adapters/NavBarOptionsAdapter.kt index a419cb466..55f6513bb 100644 --- a/app/src/main/java/com/github/libretube/adapters/NavBarOptionsAdapter.kt +++ b/app/src/main/java/com/github/libretube/ui/adapters/NavBarOptionsAdapter.kt @@ -1,4 +1,4 @@ -package com.github.libretube.adapters +package com.github.libretube.ui.adapters import android.view.LayoutInflater import android.view.ViewGroup diff --git a/app/src/main/java/com/github/libretube/adapters/PlaylistAdapter.kt b/app/src/main/java/com/github/libretube/ui/adapters/PlaylistAdapter.kt similarity index 88% rename from app/src/main/java/com/github/libretube/adapters/PlaylistAdapter.kt rename to app/src/main/java/com/github/libretube/ui/adapters/PlaylistAdapter.kt index 4bb6767e7..7a80e4569 100644 --- a/app/src/main/java/com/github/libretube/adapters/PlaylistAdapter.kt +++ b/app/src/main/java/com/github/libretube/ui/adapters/PlaylistAdapter.kt @@ -1,4 +1,4 @@ -package com.github.libretube.adapters +package com.github.libretube.ui.adapters import android.app.Activity import android.util.Log @@ -13,8 +13,8 @@ import com.github.libretube.extensions.TAG import com.github.libretube.extensions.setFormattedDuration import com.github.libretube.extensions.setWatchProgressLength import com.github.libretube.extensions.toID -import com.github.libretube.obj.PlaylistId -import com.github.libretube.obj.StreamItem +import com.github.libretube.api.obj.PlaylistId +import com.github.libretube.api.obj.StreamItem import com.github.libretube.sheets.VideoOptionsBottomSheet import com.github.libretube.util.ImageHelper import com.github.libretube.util.NavigationHelper @@ -26,7 +26,7 @@ import retrofit2.HttpException import java.io.IOException class PlaylistAdapter( - private val videoFeed: MutableList, + private val videoFeed: MutableList, private val playlistId: String, private val isOwner: Boolean, private val activity: Activity, @@ -37,7 +37,7 @@ class PlaylistAdapter( return videoFeed.size } - fun updateItems(newItems: List) { + fun updateItems(newItems: List) { val oldSize = videoFeed.size videoFeed.addAll(newItems) notifyItemRangeInserted(oldSize, videoFeed.size) @@ -83,7 +83,10 @@ class PlaylistAdapter( try { RetrofitInstance.authApi.removeFromPlaylist( PreferenceHelper.getToken(), - PlaylistId(playlistId = playlistId, index = position) + com.github.libretube.api.obj.PlaylistId( + playlistId = playlistId, + index = position + ) ) } catch (e: IOException) { println(e) diff --git a/app/src/main/java/com/github/libretube/adapters/PlaylistsAdapter.kt b/app/src/main/java/com/github/libretube/ui/adapters/PlaylistsAdapter.kt similarity index 92% rename from app/src/main/java/com/github/libretube/adapters/PlaylistsAdapter.kt rename to app/src/main/java/com/github/libretube/ui/adapters/PlaylistsAdapter.kt index 761eb00ea..4c8198f31 100644 --- a/app/src/main/java/com/github/libretube/adapters/PlaylistsAdapter.kt +++ b/app/src/main/java/com/github/libretube/ui/adapters/PlaylistsAdapter.kt @@ -1,4 +1,4 @@ -package com.github.libretube.adapters +package com.github.libretube.ui.adapters import android.app.Activity import android.util.Log @@ -10,8 +10,8 @@ import com.github.libretube.R import com.github.libretube.api.RetrofitInstance import com.github.libretube.databinding.PlaylistsRowBinding import com.github.libretube.extensions.TAG -import com.github.libretube.obj.PlaylistId -import com.github.libretube.obj.Playlists +import com.github.libretube.api.obj.PlaylistId +import com.github.libretube.api.obj.Playlists import com.github.libretube.sheets.PlaylistOptionsBottomSheet import com.github.libretube.util.ImageHelper import com.github.libretube.util.NavigationHelper @@ -24,7 +24,7 @@ import retrofit2.HttpException import java.io.IOException class PlaylistsAdapter( - private val playlists: MutableList, + private val playlists: MutableList, private val childFragmentManager: FragmentManager, private val activity: Activity ) : RecyclerView.Adapter() { @@ -33,7 +33,7 @@ class PlaylistsAdapter( return playlists.size } - fun updateItems(newItems: List) { + fun updateItems(newItems: List) { val oldSize = playlists.size playlists.addAll(newItems) notifyItemRangeInserted(oldSize, playlists.size) @@ -90,7 +90,7 @@ class PlaylistsAdapter( val response = try { RetrofitInstance.authApi.deletePlaylist( PreferenceHelper.getToken(), - PlaylistId(id) + com.github.libretube.api.obj.PlaylistId(id) ) } catch (e: IOException) { println(e) diff --git a/app/src/main/java/com/github/libretube/adapters/RepliesAdapter.kt b/app/src/main/java/com/github/libretube/ui/adapters/RepliesAdapter.kt similarity index 90% rename from app/src/main/java/com/github/libretube/adapters/RepliesAdapter.kt rename to app/src/main/java/com/github/libretube/ui/adapters/RepliesAdapter.kt index 3339d25dd..a2b0a9719 100644 --- a/app/src/main/java/com/github/libretube/adapters/RepliesAdapter.kt +++ b/app/src/main/java/com/github/libretube/ui/adapters/RepliesAdapter.kt @@ -1,4 +1,4 @@ -package com.github.libretube.adapters +package com.github.libretube.ui.adapters import android.view.LayoutInflater import android.view.View @@ -6,12 +6,12 @@ import android.view.ViewGroup import androidx.recyclerview.widget.RecyclerView import com.github.libretube.databinding.RepliesRowBinding import com.github.libretube.extensions.formatShort -import com.github.libretube.obj.Comment +import com.github.libretube.api.obj.Comment import com.github.libretube.util.ImageHelper import com.github.libretube.util.NavigationHelper class RepliesAdapter( - private val replies: MutableList + private val replies: MutableList ) : RecyclerView.Adapter() { fun clear() { @@ -20,7 +20,7 @@ class RepliesAdapter( notifyItemRangeRemoved(0, size) } - fun updateItems(newItems: List) { + fun updateItems(newItems: List) { var repliesSize = replies.size replies.addAll(newItems) notifyItemRangeInserted(repliesSize, newItems.size) diff --git a/app/src/main/java/com/github/libretube/adapters/SearchAdapter.kt b/app/src/main/java/com/github/libretube/ui/adapters/SearchAdapter.kt similarity index 93% rename from app/src/main/java/com/github/libretube/adapters/SearchAdapter.kt rename to app/src/main/java/com/github/libretube/ui/adapters/SearchAdapter.kt index 1561faec8..bc3d29a2d 100644 --- a/app/src/main/java/com/github/libretube/adapters/SearchAdapter.kt +++ b/app/src/main/java/com/github/libretube/ui/adapters/SearchAdapter.kt @@ -1,4 +1,4 @@ -package com.github.libretube.adapters +package com.github.libretube.ui.adapters import android.view.LayoutInflater import android.view.View @@ -14,7 +14,7 @@ import com.github.libretube.extensions.formatShort import com.github.libretube.extensions.setFormattedDuration import com.github.libretube.extensions.setWatchProgressLength import com.github.libretube.extensions.toID -import com.github.libretube.obj.SearchItem +import com.github.libretube.api.obj.SearchItem import com.github.libretube.sheets.PlaylistOptionsBottomSheet import com.github.libretube.sheets.VideoOptionsBottomSheet import com.github.libretube.util.ImageHelper @@ -24,12 +24,12 @@ import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch class SearchAdapter( - private val searchItems: MutableList, + private val searchItems: MutableList, private val childFragmentManager: FragmentManager ) : RecyclerView.Adapter() { - fun updateItems(newItems: List) { + fun updateItems(newItems: List) { val searchItemsSize = searchItems.size searchItems.addAll(newItems) notifyItemRangeInserted(searchItemsSize, newItems.size) @@ -79,7 +79,7 @@ class SearchAdapter( } } - private fun bindWatch(item: SearchItem, binding: VideoRowBinding) { + private fun bindWatch(item: com.github.libretube.api.obj.SearchItem, binding: VideoRowBinding) { binding.apply { ImageHelper.loadImage(item.thumbnail, thumbnail) thumbnailDuration.setFormattedDuration(item.duration!!) @@ -110,7 +110,7 @@ class SearchAdapter( } } - private fun bindChannel(item: SearchItem, binding: ChannelRowBinding) { + private fun bindChannel(item: com.github.libretube.api.obj.SearchItem, binding: ChannelRowBinding) { binding.apply { ImageHelper.loadImage(item.thumbnail, searchChannelImage) searchChannelName.text = item.name @@ -157,7 +157,7 @@ class SearchAdapter( } } - private fun bindPlaylist(item: SearchItem, binding: PlaylistSearchRowBinding) { + private fun bindPlaylist(item: com.github.libretube.api.obj.SearchItem, binding: PlaylistSearchRowBinding) { binding.apply { ImageHelper.loadImage(item.thumbnail, searchThumbnail) if (item.videos?.toInt() != -1) searchPlaylistNumber.text = item.videos.toString() diff --git a/app/src/main/java/com/github/libretube/adapters/SearchHistoryAdapter.kt b/app/src/main/java/com/github/libretube/ui/adapters/SearchHistoryAdapter.kt similarity index 97% rename from app/src/main/java/com/github/libretube/adapters/SearchHistoryAdapter.kt rename to app/src/main/java/com/github/libretube/ui/adapters/SearchHistoryAdapter.kt index e8377b69a..1326ac7ee 100644 --- a/app/src/main/java/com/github/libretube/adapters/SearchHistoryAdapter.kt +++ b/app/src/main/java/com/github/libretube/ui/adapters/SearchHistoryAdapter.kt @@ -1,4 +1,4 @@ -package com.github.libretube.adapters +package com.github.libretube.ui.adapters import android.view.LayoutInflater import android.view.ViewGroup diff --git a/app/src/main/java/com/github/libretube/adapters/SearchSuggestionsAdapter.kt b/app/src/main/java/com/github/libretube/ui/adapters/SearchSuggestionsAdapter.kt similarity index 96% rename from app/src/main/java/com/github/libretube/adapters/SearchSuggestionsAdapter.kt rename to app/src/main/java/com/github/libretube/ui/adapters/SearchSuggestionsAdapter.kt index d2df68374..c3fdca2ee 100644 --- a/app/src/main/java/com/github/libretube/adapters/SearchSuggestionsAdapter.kt +++ b/app/src/main/java/com/github/libretube/ui/adapters/SearchSuggestionsAdapter.kt @@ -1,4 +1,4 @@ -package com.github.libretube.adapters +package com.github.libretube.ui.adapters import android.view.LayoutInflater import android.view.ViewGroup diff --git a/app/src/main/java/com/github/libretube/adapters/SubscriptionChannelAdapter.kt b/app/src/main/java/com/github/libretube/ui/adapters/SubscriptionChannelAdapter.kt similarity index 91% rename from app/src/main/java/com/github/libretube/adapters/SubscriptionChannelAdapter.kt rename to app/src/main/java/com/github/libretube/ui/adapters/SubscriptionChannelAdapter.kt index 23d5489a9..5d320c49f 100644 --- a/app/src/main/java/com/github/libretube/adapters/SubscriptionChannelAdapter.kt +++ b/app/src/main/java/com/github/libretube/ui/adapters/SubscriptionChannelAdapter.kt @@ -1,4 +1,4 @@ -package com.github.libretube.adapters +package com.github.libretube.ui.adapters import android.view.LayoutInflater import android.view.ViewGroup @@ -7,11 +7,11 @@ import com.github.libretube.R import com.github.libretube.api.SubscriptionHelper import com.github.libretube.databinding.ChannelSubscriptionRowBinding import com.github.libretube.extensions.toID -import com.github.libretube.obj.Subscription +import com.github.libretube.api.obj.Subscription import com.github.libretube.util.ImageHelper import com.github.libretube.util.NavigationHelper -class SubscriptionChannelAdapter(private val subscriptions: MutableList) : +class SubscriptionChannelAdapter(private val subscriptions: MutableList) : RecyclerView.Adapter() { override fun getItemCount(): Int { @@ -19,7 +19,7 @@ class SubscriptionChannelAdapter(private val subscriptions: MutableList, + private val streamItems: List, private val childFragmentManager: FragmentManager, private val showAllAtOne: Boolean = true ) : RecyclerView.Adapter() { diff --git a/app/src/main/java/com/github/libretube/adapters/WatchHistoryAdapter.kt b/app/src/main/java/com/github/libretube/ui/adapters/WatchHistoryAdapter.kt similarity index 98% rename from app/src/main/java/com/github/libretube/adapters/WatchHistoryAdapter.kt rename to app/src/main/java/com/github/libretube/ui/adapters/WatchHistoryAdapter.kt index 7252332d0..74409f0be 100644 --- a/app/src/main/java/com/github/libretube/adapters/WatchHistoryAdapter.kt +++ b/app/src/main/java/com/github/libretube/ui/adapters/WatchHistoryAdapter.kt @@ -1,4 +1,4 @@ -package com.github.libretube.adapters +package com.github.libretube.ui.adapters import android.view.LayoutInflater import android.view.ViewGroup diff --git a/app/src/main/java/com/github/libretube/dialogs/AddToPlaylistDialog.kt b/app/src/main/java/com/github/libretube/ui/dialogs/AddToPlaylistDialog.kt similarity index 96% rename from app/src/main/java/com/github/libretube/dialogs/AddToPlaylistDialog.kt rename to app/src/main/java/com/github/libretube/ui/dialogs/AddToPlaylistDialog.kt index 74ac7a9a9..10b893c00 100644 --- a/app/src/main/java/com/github/libretube/dialogs/AddToPlaylistDialog.kt +++ b/app/src/main/java/com/github/libretube/ui/dialogs/AddToPlaylistDialog.kt @@ -1,4 +1,4 @@ -package com.github.libretube.dialogs +package com.github.libretube.ui.dialogs import android.app.Dialog import android.os.Bundle @@ -15,7 +15,7 @@ import com.github.libretube.constants.IntentData import com.github.libretube.databinding.DialogAddtoplaylistBinding import com.github.libretube.extensions.TAG import com.github.libretube.models.PlaylistViewModel -import com.github.libretube.obj.PlaylistId +import com.github.libretube.api.obj.PlaylistId import com.github.libretube.util.PreferenceHelper import com.github.libretube.util.ThemeHelper import com.google.android.material.dialog.MaterialAlertDialogBuilder @@ -92,7 +92,9 @@ class AddToPlaylistDialog : DialogFragment() { fun run() { lifecycleScope.launchWhenCreated { val response = try { - RetrofitInstance.authApi.addToPlaylist(token, PlaylistId(playlistId, videoId)) + RetrofitInstance.authApi.addToPlaylist(token, + com.github.libretube.api.obj.PlaylistId(playlistId, videoId) + ) } catch (e: IOException) { println(e) Log.e(TAG(), "IOException, you might not have internet connection") diff --git a/app/src/main/java/com/github/libretube/dialogs/BackupDialog.kt b/app/src/main/java/com/github/libretube/ui/dialogs/BackupDialog.kt similarity index 96% rename from app/src/main/java/com/github/libretube/dialogs/BackupDialog.kt rename to app/src/main/java/com/github/libretube/ui/dialogs/BackupDialog.kt index 62148198f..6b6a7c568 100644 --- a/app/src/main/java/com/github/libretube/dialogs/BackupDialog.kt +++ b/app/src/main/java/com/github/libretube/ui/dialogs/BackupDialog.kt @@ -1,11 +1,11 @@ -package com.github.libretube.dialogs +package com.github.libretube.ui.dialogs import android.app.Dialog import android.os.Bundle import androidx.fragment.app.DialogFragment import androidx.recyclerview.widget.LinearLayoutManager import com.github.libretube.R -import com.github.libretube.adapters.BackupOptionsAdapter +import com.github.libretube.ui.adapters.BackupOptionsAdapter import com.github.libretube.databinding.DialogBackupBinding import com.github.libretube.db.DatabaseHolder.Companion.Database import com.github.libretube.extensions.await diff --git a/app/src/main/java/com/github/libretube/dialogs/CreatePlaylistDialog.kt b/app/src/main/java/com/github/libretube/ui/dialogs/CreatePlaylistDialog.kt similarity index 90% rename from app/src/main/java/com/github/libretube/dialogs/CreatePlaylistDialog.kt rename to app/src/main/java/com/github/libretube/ui/dialogs/CreatePlaylistDialog.kt index c2ea2cc9f..859e3144a 100644 --- a/app/src/main/java/com/github/libretube/dialogs/CreatePlaylistDialog.kt +++ b/app/src/main/java/com/github/libretube/ui/dialogs/CreatePlaylistDialog.kt @@ -1,4 +1,4 @@ -package com.github.libretube.dialogs +package com.github.libretube.ui.dialogs import android.app.Dialog import android.os.Bundle @@ -10,8 +10,8 @@ import com.github.libretube.R import com.github.libretube.api.RetrofitInstance import com.github.libretube.databinding.DialogCreatePlaylistBinding import com.github.libretube.extensions.TAG -import com.github.libretube.fragments.LibraryFragment -import com.github.libretube.obj.Playlists +import com.github.libretube.ui.fragments.LibraryFragment +import com.github.libretube.api.obj.Playlists import com.github.libretube.util.PreferenceHelper import com.github.libretube.util.ThemeHelper import com.google.android.material.dialog.MaterialAlertDialogBuilder @@ -52,7 +52,9 @@ class CreatePlaylistDialog : DialogFragment() { private fun createPlaylist(name: String) { lifecycleScope.launchWhenCreated { val response = try { - RetrofitInstance.authApi.createPlaylist(token, Playlists(name = name)) + RetrofitInstance.authApi.createPlaylist(token, + com.github.libretube.api.obj.Playlists(name = name) + ) } catch (e: IOException) { println(e) Log.e(TAG(), "IOException, you might not have internet connection") diff --git a/app/src/main/java/com/github/libretube/dialogs/CustomInstanceDialog.kt b/app/src/main/java/com/github/libretube/ui/dialogs/CustomInstanceDialog.kt similarity index 98% rename from app/src/main/java/com/github/libretube/dialogs/CustomInstanceDialog.kt rename to app/src/main/java/com/github/libretube/ui/dialogs/CustomInstanceDialog.kt index a1e246dc6..44058104d 100644 --- a/app/src/main/java/com/github/libretube/dialogs/CustomInstanceDialog.kt +++ b/app/src/main/java/com/github/libretube/ui/dialogs/CustomInstanceDialog.kt @@ -1,4 +1,4 @@ -package com.github.libretube.dialogs +package com.github.libretube.ui.dialogs import android.app.Dialog import android.os.Bundle diff --git a/app/src/main/java/com/github/libretube/dialogs/DeleteAccountDialog.kt b/app/src/main/java/com/github/libretube/ui/dialogs/DeleteAccountDialog.kt similarity index 89% rename from app/src/main/java/com/github/libretube/dialogs/DeleteAccountDialog.kt rename to app/src/main/java/com/github/libretube/ui/dialogs/DeleteAccountDialog.kt index ecc2aca20..ccaabcc52 100644 --- a/app/src/main/java/com/github/libretube/dialogs/DeleteAccountDialog.kt +++ b/app/src/main/java/com/github/libretube/ui/dialogs/DeleteAccountDialog.kt @@ -1,4 +1,4 @@ -package com.github.libretube.dialogs +package com.github.libretube.ui.dialogs import android.app.Dialog import android.os.Bundle @@ -10,7 +10,7 @@ import com.github.libretube.R import com.github.libretube.api.RetrofitInstance import com.github.libretube.databinding.DialogDeleteAccountBinding import com.github.libretube.extensions.TAG -import com.github.libretube.obj.DeleteUserRequest +import com.github.libretube.api.obj.DeleteUserRequest import com.github.libretube.util.PreferenceHelper import com.github.libretube.util.ThemeHelper import com.google.android.material.dialog.MaterialAlertDialogBuilder @@ -45,7 +45,9 @@ class DeleteAccountDialog : DialogFragment() { val token = PreferenceHelper.getToken() try { - RetrofitInstance.authApi.deleteAccount(token, DeleteUserRequest(password)) + RetrofitInstance.authApi.deleteAccount(token, + com.github.libretube.api.obj.DeleteUserRequest(password) + ) } catch (e: Exception) { Log.e(TAG(), e.toString()) Toast.makeText(context, R.string.unknown_error, Toast.LENGTH_SHORT).show() diff --git a/app/src/main/java/com/github/libretube/dialogs/DownloadDialog.kt b/app/src/main/java/com/github/libretube/ui/dialogs/DownloadDialog.kt similarity index 96% rename from app/src/main/java/com/github/libretube/dialogs/DownloadDialog.kt rename to app/src/main/java/com/github/libretube/ui/dialogs/DownloadDialog.kt index 3c88f17f7..f46069535 100644 --- a/app/src/main/java/com/github/libretube/dialogs/DownloadDialog.kt +++ b/app/src/main/java/com/github/libretube/ui/dialogs/DownloadDialog.kt @@ -1,4 +1,4 @@ -package com.github.libretube.dialogs +package com.github.libretube.ui.dialogs import android.app.Dialog import android.content.Intent @@ -14,7 +14,7 @@ import com.github.libretube.R import com.github.libretube.api.RetrofitInstance import com.github.libretube.databinding.DialogDownloadBinding import com.github.libretube.extensions.TAG -import com.github.libretube.obj.Streams +import com.github.libretube.api.obj.Streams import com.github.libretube.services.DownloadService import com.github.libretube.util.ThemeHelper import com.google.android.material.dialog.MaterialAlertDialogBuilder @@ -66,7 +66,7 @@ class DownloadDialog( } } - private fun initDownloadOptions(streams: Streams) { + private fun initDownloadOptions(streams: com.github.libretube.api.obj.Streams) { val vidName = arrayListOf() val videoUrl = arrayListOf() diff --git a/app/src/main/java/com/github/libretube/dialogs/ErrorDialog.kt b/app/src/main/java/com/github/libretube/ui/dialogs/ErrorDialog.kt similarity index 97% rename from app/src/main/java/com/github/libretube/dialogs/ErrorDialog.kt rename to app/src/main/java/com/github/libretube/ui/dialogs/ErrorDialog.kt index 66dc11a6a..ffbd54eb7 100644 --- a/app/src/main/java/com/github/libretube/dialogs/ErrorDialog.kt +++ b/app/src/main/java/com/github/libretube/ui/dialogs/ErrorDialog.kt @@ -1,4 +1,4 @@ -package com.github.libretube.dialogs +package com.github.libretube.ui.dialogs import android.app.Dialog import android.content.ClipData diff --git a/app/src/main/java/com/github/libretube/dialogs/LoginDialog.kt b/app/src/main/java/com/github/libretube/ui/dialogs/LoginDialog.kt similarity index 90% rename from app/src/main/java/com/github/libretube/dialogs/LoginDialog.kt rename to app/src/main/java/com/github/libretube/ui/dialogs/LoginDialog.kt index b182fb64a..a80454ce7 100644 --- a/app/src/main/java/com/github/libretube/dialogs/LoginDialog.kt +++ b/app/src/main/java/com/github/libretube/ui/dialogs/LoginDialog.kt @@ -1,4 +1,4 @@ -package com.github.libretube.dialogs +package com.github.libretube.ui.dialogs import android.app.Dialog import android.os.Bundle @@ -10,7 +10,7 @@ import com.github.libretube.R import com.github.libretube.api.RetrofitInstance import com.github.libretube.databinding.DialogLoginBinding import com.github.libretube.extensions.TAG -import com.github.libretube.obj.Login +import com.github.libretube.api.obj.Login import com.github.libretube.util.PreferenceHelper import com.github.libretube.util.ThemeHelper import com.google.android.material.dialog.MaterialAlertDialogBuilder @@ -26,7 +26,10 @@ class LoginDialog : DialogFragment() { binding.login.setOnClickListener { if (binding.username.text.toString() != "" && binding.password.text.toString() != "") { val login = - Login(binding.username.text.toString(), binding.password.text.toString()) + com.github.libretube.api.obj.Login( + binding.username.text.toString(), + binding.password.text.toString() + ) login(login) } else { Toast.makeText(context, R.string.empty, Toast.LENGTH_SHORT).show() @@ -37,7 +40,7 @@ class LoginDialog : DialogFragment() { binding.username.text.toString() != "" && binding.password.text.toString() != "" ) { - val login = Login( + val login = com.github.libretube.api.obj.Login( binding.username.text.toString(), binding.password.text.toString() ) @@ -54,7 +57,7 @@ class LoginDialog : DialogFragment() { .show() } - private fun login(login: Login) { + private fun login(login: com.github.libretube.api.obj.Login) { lifecycleScope.launchWhenCreated { val response = try { RetrofitInstance.authApi.login(login) @@ -83,7 +86,7 @@ class LoginDialog : DialogFragment() { } } - private fun register(login: Login) { + private fun register(login: com.github.libretube.api.obj.Login) { fun run() { lifecycleScope.launchWhenCreated { val response = try { diff --git a/app/src/main/java/com/github/libretube/dialogs/LogoutDialog.kt b/app/src/main/java/com/github/libretube/ui/dialogs/LogoutDialog.kt similarity index 96% rename from app/src/main/java/com/github/libretube/dialogs/LogoutDialog.kt rename to app/src/main/java/com/github/libretube/ui/dialogs/LogoutDialog.kt index b4df8e9a9..9a152a1e6 100644 --- a/app/src/main/java/com/github/libretube/dialogs/LogoutDialog.kt +++ b/app/src/main/java/com/github/libretube/ui/dialogs/LogoutDialog.kt @@ -1,4 +1,4 @@ -package com.github.libretube.dialogs +package com.github.libretube.ui.dialogs import android.app.Dialog import android.os.Bundle diff --git a/app/src/main/java/com/github/libretube/dialogs/NavBarOptionsDialog.kt b/app/src/main/java/com/github/libretube/ui/dialogs/NavBarOptionsDialog.kt similarity index 96% rename from app/src/main/java/com/github/libretube/dialogs/NavBarOptionsDialog.kt rename to app/src/main/java/com/github/libretube/ui/dialogs/NavBarOptionsDialog.kt index 3eebad887..26ce94d5e 100644 --- a/app/src/main/java/com/github/libretube/dialogs/NavBarOptionsDialog.kt +++ b/app/src/main/java/com/github/libretube/ui/dialogs/NavBarOptionsDialog.kt @@ -1,4 +1,4 @@ -package com.github.libretube.dialogs +package com.github.libretube.ui.dialogs import android.app.Dialog import android.os.Bundle @@ -7,7 +7,7 @@ import androidx.recyclerview.widget.ItemTouchHelper import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.RecyclerView import com.github.libretube.R -import com.github.libretube.adapters.NavBarOptionsAdapter +import com.github.libretube.ui.adapters.NavBarOptionsAdapter import com.github.libretube.databinding.DialogNavbarOptionsBinding import com.github.libretube.util.NavBarHelper import com.google.android.material.dialog.MaterialAlertDialogBuilder diff --git a/app/src/main/java/com/github/libretube/dialogs/RequireRestartDialog.kt b/app/src/main/java/com/github/libretube/ui/dialogs/RequireRestartDialog.kt similarity index 95% rename from app/src/main/java/com/github/libretube/dialogs/RequireRestartDialog.kt rename to app/src/main/java/com/github/libretube/ui/dialogs/RequireRestartDialog.kt index 5c2f3faf0..26ef14fc6 100644 --- a/app/src/main/java/com/github/libretube/dialogs/RequireRestartDialog.kt +++ b/app/src/main/java/com/github/libretube/ui/dialogs/RequireRestartDialog.kt @@ -1,4 +1,4 @@ -package com.github.libretube.dialogs +package com.github.libretube.ui.dialogs import android.app.Dialog import android.os.Bundle diff --git a/app/src/main/java/com/github/libretube/dialogs/ShareDialog.kt b/app/src/main/java/com/github/libretube/ui/dialogs/ShareDialog.kt similarity index 98% rename from app/src/main/java/com/github/libretube/dialogs/ShareDialog.kt rename to app/src/main/java/com/github/libretube/ui/dialogs/ShareDialog.kt index 4118e0c6f..9756bc45c 100644 --- a/app/src/main/java/com/github/libretube/dialogs/ShareDialog.kt +++ b/app/src/main/java/com/github/libretube/ui/dialogs/ShareDialog.kt @@ -1,4 +1,4 @@ -package com.github.libretube.dialogs +package com.github.libretube.ui.dialogs import android.app.Dialog import android.content.Intent diff --git a/app/src/main/java/com/github/libretube/dialogs/UpdateDialog.kt b/app/src/main/java/com/github/libretube/ui/dialogs/UpdateDialog.kt similarity index 95% rename from app/src/main/java/com/github/libretube/dialogs/UpdateDialog.kt rename to app/src/main/java/com/github/libretube/ui/dialogs/UpdateDialog.kt index d55ef37f9..e27ead5cf 100644 --- a/app/src/main/java/com/github/libretube/dialogs/UpdateDialog.kt +++ b/app/src/main/java/com/github/libretube/ui/dialogs/UpdateDialog.kt @@ -1,4 +1,4 @@ -package com.github.libretube.dialogs +package com.github.libretube.ui.dialogs import android.app.Dialog import android.content.Intent @@ -9,7 +9,7 @@ import android.util.Log import androidx.fragment.app.DialogFragment import com.github.libretube.R import com.github.libretube.services.UpdateService -import com.github.libretube.update.UpdateInfo +import com.github.libretube.obj.update.UpdateInfo import com.google.android.material.dialog.MaterialAlertDialogBuilder class UpdateDialog( diff --git a/app/src/main/java/com/github/libretube/fragments/ChannelFragment.kt b/app/src/main/java/com/github/libretube/ui/fragments/ChannelFragment.kt similarity index 98% rename from app/src/main/java/com/github/libretube/fragments/ChannelFragment.kt rename to app/src/main/java/com/github/libretube/ui/fragments/ChannelFragment.kt index 41e18ef2a..e8936e9dd 100644 --- a/app/src/main/java/com/github/libretube/fragments/ChannelFragment.kt +++ b/app/src/main/java/com/github/libretube/ui/fragments/ChannelFragment.kt @@ -1,4 +1,4 @@ -package com.github.libretube.fragments +package com.github.libretube.ui.fragments import android.os.Bundle import android.util.Log @@ -8,7 +8,7 @@ import android.view.ViewGroup import androidx.lifecycle.lifecycleScope import androidx.recyclerview.widget.LinearLayoutManager import com.github.libretube.R -import com.github.libretube.adapters.ChannelAdapter +import com.github.libretube.ui.adapters.ChannelAdapter import com.github.libretube.api.RetrofitInstance import com.github.libretube.api.SubscriptionHelper import com.github.libretube.constants.IntentData diff --git a/app/src/main/java/com/github/libretube/fragments/DownloadsFragment.kt b/app/src/main/java/com/github/libretube/ui/fragments/DownloadsFragment.kt similarity index 94% rename from app/src/main/java/com/github/libretube/fragments/DownloadsFragment.kt rename to app/src/main/java/com/github/libretube/ui/fragments/DownloadsFragment.kt index cf2befe32..0d93d00bd 100644 --- a/app/src/main/java/com/github/libretube/fragments/DownloadsFragment.kt +++ b/app/src/main/java/com/github/libretube/ui/fragments/DownloadsFragment.kt @@ -1,4 +1,4 @@ -package com.github.libretube.fragments +package com.github.libretube.ui.fragments import android.os.Bundle import android.view.LayoutInflater @@ -7,7 +7,7 @@ import android.view.ViewGroup import androidx.core.view.size import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.RecyclerView -import com.github.libretube.adapters.DownloadsAdapter +import com.github.libretube.ui.adapters.DownloadsAdapter import com.github.libretube.databinding.FragmentDownloadsBinding import com.github.libretube.extensions.BaseFragment import com.github.libretube.util.DownloadHelper diff --git a/app/src/main/java/com/github/libretube/fragments/HomeFragment.kt b/app/src/main/java/com/github/libretube/ui/fragments/HomeFragment.kt similarity index 96% rename from app/src/main/java/com/github/libretube/fragments/HomeFragment.kt rename to app/src/main/java/com/github/libretube/ui/fragments/HomeFragment.kt index 1ac110440..b64d7a43f 100644 --- a/app/src/main/java/com/github/libretube/fragments/HomeFragment.kt +++ b/app/src/main/java/com/github/libretube/ui/fragments/HomeFragment.kt @@ -1,4 +1,4 @@ -package com.github.libretube.fragments +package com.github.libretube.ui.fragments import android.os.Bundle import android.util.Log @@ -10,8 +10,8 @@ import androidx.lifecycle.lifecycleScope import androidx.recyclerview.widget.GridLayoutManager import androidx.recyclerview.widget.LinearLayoutManager import com.github.libretube.R -import com.github.libretube.adapters.ChannelAdapter -import com.github.libretube.adapters.TrendingAdapter +import com.github.libretube.ui.adapters.ChannelAdapter +import com.github.libretube.ui.adapters.TrendingAdapter import com.github.libretube.api.RetrofitInstance import com.github.libretube.constants.PreferenceKeys import com.github.libretube.databinding.FragmentHomeBinding diff --git a/app/src/main/java/com/github/libretube/fragments/LibraryFragment.kt b/app/src/main/java/com/github/libretube/ui/fragments/LibraryFragment.kt similarity index 97% rename from app/src/main/java/com/github/libretube/fragments/LibraryFragment.kt rename to app/src/main/java/com/github/libretube/ui/fragments/LibraryFragment.kt index 95391b886..e0a701a7c 100644 --- a/app/src/main/java/com/github/libretube/fragments/LibraryFragment.kt +++ b/app/src/main/java/com/github/libretube/ui/fragments/LibraryFragment.kt @@ -1,4 +1,4 @@ -package com.github.libretube.fragments +package com.github.libretube.ui.fragments import android.os.Bundle import android.util.Log @@ -12,11 +12,11 @@ import androidx.navigation.fragment.findNavController import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.RecyclerView import com.github.libretube.R -import com.github.libretube.adapters.PlaylistsAdapter +import com.github.libretube.ui.adapters.PlaylistsAdapter import com.github.libretube.api.RetrofitInstance import com.github.libretube.constants.PreferenceKeys import com.github.libretube.databinding.FragmentLibraryBinding -import com.github.libretube.dialogs.CreatePlaylistDialog +import com.github.libretube.ui.dialogs.CreatePlaylistDialog import com.github.libretube.extensions.BaseFragment import com.github.libretube.extensions.TAG import com.github.libretube.models.PlayerViewModel diff --git a/app/src/main/java/com/github/libretube/fragments/PlayerFragment.kt b/app/src/main/java/com/github/libretube/ui/fragments/PlayerFragment.kt similarity index 98% rename from app/src/main/java/com/github/libretube/fragments/PlayerFragment.kt rename to app/src/main/java/com/github/libretube/ui/fragments/PlayerFragment.kt index 0d2d048cb..8f6f24a58 100644 --- a/app/src/main/java/com/github/libretube/fragments/PlayerFragment.kt +++ b/app/src/main/java/com/github/libretube/ui/fragments/PlayerFragment.kt @@ -1,4 +1,4 @@ -package com.github.libretube.fragments +package com.github.libretube.ui.fragments import android.annotation.SuppressLint import android.app.ActivityManager @@ -36,10 +36,10 @@ import androidx.recyclerview.widget.GridLayoutManager import androidx.recyclerview.widget.LinearLayoutManager import com.fasterxml.jackson.databind.ObjectMapper import com.github.libretube.R -import com.github.libretube.activities.MainActivity -import com.github.libretube.adapters.ChaptersAdapter -import com.github.libretube.adapters.CommentsAdapter -import com.github.libretube.adapters.TrendingAdapter +import com.github.libretube.ui.activities.MainActivity +import com.github.libretube.ui.adapters.ChaptersAdapter +import com.github.libretube.ui.adapters.CommentsAdapter +import com.github.libretube.ui.adapters.TrendingAdapter import com.github.libretube.api.CronetHelper import com.github.libretube.api.RetrofitInstance import com.github.libretube.api.SubscriptionHelper @@ -50,9 +50,9 @@ import com.github.libretube.databinding.ExoStyledPlayerControlViewBinding import com.github.libretube.databinding.FragmentPlayerBinding import com.github.libretube.db.DatabaseHelper import com.github.libretube.db.DatabaseHolder.Companion.Database -import com.github.libretube.dialogs.AddToPlaylistDialog -import com.github.libretube.dialogs.DownloadDialog -import com.github.libretube.dialogs.ShareDialog +import com.github.libretube.ui.dialogs.AddToPlaylistDialog +import com.github.libretube.ui.dialogs.DownloadDialog +import com.github.libretube.ui.dialogs.ShareDialog import com.github.libretube.extensions.BaseFragment import com.github.libretube.extensions.TAG import com.github.libretube.extensions.await @@ -61,10 +61,6 @@ import com.github.libretube.extensions.hideKeyboard import com.github.libretube.extensions.toID import com.github.libretube.interfaces.PlayerOptionsInterface import com.github.libretube.models.PlayerViewModel -import com.github.libretube.obj.ChapterSegment -import com.github.libretube.obj.Segment -import com.github.libretube.obj.Segments -import com.github.libretube.obj.Streams import com.github.libretube.services.BackgroundMode import com.github.libretube.services.DownloadService import com.github.libretube.util.AutoPlayHelper @@ -119,7 +115,7 @@ class PlayerFragment : BaseFragment() { private var playlistId: String? = null private var isSubscribed: Boolean? = false private var isLive = false - private lateinit var streams: Streams + private lateinit var streams: com.github.libretube.api.obj.Streams /** * for the transition @@ -141,8 +137,8 @@ class PlayerFragment : BaseFragment() { */ private lateinit var exoPlayer: ExoPlayer private lateinit var trackSelector: DefaultTrackSelector - private lateinit var segmentData: Segments - private lateinit var chapters: List + private lateinit var segmentData: com.github.libretube.api.obj.Segments + private lateinit var chapters: List /** * for the player view @@ -724,7 +720,7 @@ class PlayerFragment : BaseFragment() { if (!::segmentData.isInitialized || segmentData.segments.isEmpty()) return val currentPosition = exoPlayer.currentPosition - segmentData.segments.forEach { segment: Segment -> + segmentData.segments.forEach { segment: com.github.libretube.api.obj.Segment -> val segmentStart = (segment.segment!![0] * 1000f).toLong() val segmentEnd = (segment.segment[1] * 1000f).toLong() @@ -922,7 +918,7 @@ class PlayerFragment : BaseFragment() { } @SuppressLint("SetTextI18n") - private fun initializePlayerView(response: Streams) { + private fun initializePlayerView(response: com.github.libretube.api.obj.Streams) { // initialize the player view actions binding.player.initialize( childFragmentManager, @@ -1288,7 +1284,7 @@ class PlayerFragment : BaseFragment() { } private fun setStreamSource( - streams: Streams, + streams: com.github.libretube.api.obj.Streams, videosNameArray: Array, videosUrlArray: Array ) { diff --git a/app/src/main/java/com/github/libretube/fragments/PlaylistFragment.kt b/app/src/main/java/com/github/libretube/ui/fragments/PlaylistFragment.kt similarity index 98% rename from app/src/main/java/com/github/libretube/fragments/PlaylistFragment.kt rename to app/src/main/java/com/github/libretube/ui/fragments/PlaylistFragment.kt index 478b64316..98fa55d5c 100644 --- a/app/src/main/java/com/github/libretube/fragments/PlaylistFragment.kt +++ b/app/src/main/java/com/github/libretube/ui/fragments/PlaylistFragment.kt @@ -1,4 +1,4 @@ -package com.github.libretube.fragments +package com.github.libretube.ui.fragments import android.os.Bundle import android.util.Log @@ -10,7 +10,7 @@ import androidx.recyclerview.widget.ItemTouchHelper import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.RecyclerView import com.github.libretube.R -import com.github.libretube.adapters.PlaylistAdapter +import com.github.libretube.ui.adapters.PlaylistAdapter import com.github.libretube.api.RetrofitInstance import com.github.libretube.constants.IntentData import com.github.libretube.databinding.FragmentPlaylistBinding diff --git a/app/src/main/java/com/github/libretube/fragments/SearchFragment.kt b/app/src/main/java/com/github/libretube/ui/fragments/SearchFragment.kt similarity index 94% rename from app/src/main/java/com/github/libretube/fragments/SearchFragment.kt rename to app/src/main/java/com/github/libretube/ui/fragments/SearchFragment.kt index 14d4356a7..73aef7d5c 100644 --- a/app/src/main/java/com/github/libretube/fragments/SearchFragment.kt +++ b/app/src/main/java/com/github/libretube/ui/fragments/SearchFragment.kt @@ -1,4 +1,4 @@ -package com.github.libretube.fragments +package com.github.libretube.ui.fragments import android.os.Bundle import android.util.Log @@ -10,9 +10,9 @@ import androidx.lifecycle.lifecycleScope import androidx.navigation.fragment.findNavController import androidx.recyclerview.widget.LinearLayoutManager import com.github.libretube.R -import com.github.libretube.activities.MainActivity -import com.github.libretube.adapters.SearchHistoryAdapter -import com.github.libretube.adapters.SearchSuggestionsAdapter +import com.github.libretube.ui.activities.MainActivity +import com.github.libretube.ui.adapters.SearchHistoryAdapter +import com.github.libretube.ui.adapters.SearchSuggestionsAdapter import com.github.libretube.api.RetrofitInstance import com.github.libretube.databinding.FragmentSearchBinding import com.github.libretube.db.DatabaseHolder.Companion.Database diff --git a/app/src/main/java/com/github/libretube/fragments/SearchResultFragment.kt b/app/src/main/java/com/github/libretube/ui/fragments/SearchResultFragment.kt similarity index 97% rename from app/src/main/java/com/github/libretube/fragments/SearchResultFragment.kt rename to app/src/main/java/com/github/libretube/ui/fragments/SearchResultFragment.kt index dbc6a5bf1..70895d191 100644 --- a/app/src/main/java/com/github/libretube/fragments/SearchResultFragment.kt +++ b/app/src/main/java/com/github/libretube/ui/fragments/SearchResultFragment.kt @@ -1,4 +1,4 @@ -package com.github.libretube.fragments +package com.github.libretube.ui.fragments import android.os.Bundle import android.util.Log @@ -9,8 +9,8 @@ import androidx.lifecycle.lifecycleScope import androidx.navigation.fragment.findNavController import androidx.recyclerview.widget.LinearLayoutManager import com.github.libretube.R -import com.github.libretube.activities.MainActivity -import com.github.libretube.adapters.SearchAdapter +import com.github.libretube.ui.activities.MainActivity +import com.github.libretube.ui.adapters.SearchAdapter import com.github.libretube.api.RetrofitInstance import com.github.libretube.constants.PreferenceKeys import com.github.libretube.databinding.FragmentSearchResultBinding diff --git a/app/src/main/java/com/github/libretube/fragments/SubscriptionsFragment.kt b/app/src/main/java/com/github/libretube/ui/fragments/SubscriptionsFragment.kt similarity index 96% rename from app/src/main/java/com/github/libretube/fragments/SubscriptionsFragment.kt rename to app/src/main/java/com/github/libretube/ui/fragments/SubscriptionsFragment.kt index eb8412763..5bdca20d6 100644 --- a/app/src/main/java/com/github/libretube/fragments/SubscriptionsFragment.kt +++ b/app/src/main/java/com/github/libretube/ui/fragments/SubscriptionsFragment.kt @@ -1,4 +1,4 @@ -package com.github.libretube.fragments +package com.github.libretube.ui.fragments import android.os.Bundle import android.view.LayoutInflater @@ -10,15 +10,15 @@ import androidx.fragment.app.activityViewModels import androidx.recyclerview.widget.GridLayoutManager import androidx.recyclerview.widget.LinearLayoutManager import com.github.libretube.R -import com.github.libretube.adapters.LegacySubscriptionAdapter -import com.github.libretube.adapters.SubscriptionChannelAdapter -import com.github.libretube.adapters.TrendingAdapter +import com.github.libretube.ui.adapters.LegacySubscriptionAdapter +import com.github.libretube.ui.adapters.SubscriptionChannelAdapter +import com.github.libretube.ui.adapters.TrendingAdapter import com.github.libretube.constants.PreferenceKeys import com.github.libretube.databinding.FragmentSubscriptionsBinding import com.github.libretube.extensions.BaseFragment import com.github.libretube.models.SubscriptionsViewModel import com.github.libretube.util.PreferenceHelper -import com.github.libretube.views.BottomSheet +import com.github.libretube.ui.views.BottomSheet class SubscriptionsFragment : BaseFragment() { private lateinit var binding: FragmentSubscriptionsBinding diff --git a/app/src/main/java/com/github/libretube/fragments/WatchHistoryFragment.kt b/app/src/main/java/com/github/libretube/ui/fragments/WatchHistoryFragment.kt similarity index 96% rename from app/src/main/java/com/github/libretube/fragments/WatchHistoryFragment.kt rename to app/src/main/java/com/github/libretube/ui/fragments/WatchHistoryFragment.kt index 967a565a9..0b89e86dc 100644 --- a/app/src/main/java/com/github/libretube/fragments/WatchHistoryFragment.kt +++ b/app/src/main/java/com/github/libretube/ui/fragments/WatchHistoryFragment.kt @@ -1,4 +1,4 @@ -package com.github.libretube.fragments +package com.github.libretube.ui.fragments import android.os.Bundle import android.view.LayoutInflater @@ -7,7 +7,7 @@ import android.view.ViewGroup import androidx.recyclerview.widget.ItemTouchHelper import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.RecyclerView -import com.github.libretube.adapters.WatchHistoryAdapter +import com.github.libretube.ui.adapters.WatchHistoryAdapter import com.github.libretube.databinding.FragmentWatchHistoryBinding import com.github.libretube.db.DatabaseHolder.Companion.Database import com.github.libretube.db.obj.WatchHistoryItem diff --git a/app/src/main/java/com/github/libretube/preferences/AdvancedSettings.kt b/app/src/main/java/com/github/libretube/ui/preferences/AdvancedSettings.kt similarity index 95% rename from app/src/main/java/com/github/libretube/preferences/AdvancedSettings.kt rename to app/src/main/java/com/github/libretube/ui/preferences/AdvancedSettings.kt index 376e6a5f1..a3dfeae29 100644 --- a/app/src/main/java/com/github/libretube/preferences/AdvancedSettings.kt +++ b/app/src/main/java/com/github/libretube/ui/preferences/AdvancedSettings.kt @@ -1,4 +1,4 @@ -package com.github.libretube.preferences +package com.github.libretube.ui.preferences import android.net.Uri import android.os.Bundle @@ -8,14 +8,14 @@ import androidx.activity.result.contract.ActivityResultContracts.CreateDocument import androidx.preference.ListPreference import androidx.preference.Preference import com.github.libretube.R -import com.github.libretube.activities.SettingsActivity +import com.github.libretube.ui.activities.SettingsActivity import com.github.libretube.constants.PreferenceKeys -import com.github.libretube.dialogs.BackupDialog +import com.github.libretube.ui.dialogs.BackupDialog import com.github.libretube.obj.BackupFile import com.github.libretube.util.BackupHelper import com.github.libretube.util.ImageHelper import com.github.libretube.util.PreferenceHelper -import com.github.libretube.views.MaterialPreferenceFragment +import com.github.libretube.ui.views.MaterialPreferenceFragment import com.google.android.material.dialog.MaterialAlertDialogBuilder class AdvancedSettings : MaterialPreferenceFragment() { diff --git a/app/src/main/java/com/github/libretube/preferences/AppearanceSettings.kt b/app/src/main/java/com/github/libretube/ui/preferences/AppearanceSettings.kt similarity index 95% rename from app/src/main/java/com/github/libretube/preferences/AppearanceSettings.kt rename to app/src/main/java/com/github/libretube/ui/preferences/AppearanceSettings.kt index 4299bcd34..44b997892 100644 --- a/app/src/main/java/com/github/libretube/preferences/AppearanceSettings.kt +++ b/app/src/main/java/com/github/libretube/ui/preferences/AppearanceSettings.kt @@ -1,4 +1,4 @@ -package com.github.libretube.preferences +package com.github.libretube.ui.preferences import android.content.ActivityNotFoundException import android.content.Intent @@ -9,12 +9,12 @@ import androidx.preference.ListPreference import androidx.preference.Preference import androidx.preference.SwitchPreferenceCompat import com.github.libretube.R -import com.github.libretube.activities.SettingsActivity +import com.github.libretube.ui.activities.SettingsActivity import com.github.libretube.constants.PreferenceKeys -import com.github.libretube.dialogs.RequireRestartDialog +import com.github.libretube.ui.dialogs.RequireRestartDialog import com.github.libretube.util.PreferenceHelper import com.github.libretube.util.ThemeHelper -import com.github.libretube.views.MaterialPreferenceFragment +import com.github.libretube.ui.views.MaterialPreferenceFragment import com.google.android.material.color.DynamicColors class AppearanceSettings : MaterialPreferenceFragment() { diff --git a/app/src/main/java/com/github/libretube/preferences/AudioVideoSettings.kt b/app/src/main/java/com/github/libretube/ui/preferences/AudioVideoSettings.kt similarity index 71% rename from app/src/main/java/com/github/libretube/preferences/AudioVideoSettings.kt rename to app/src/main/java/com/github/libretube/ui/preferences/AudioVideoSettings.kt index 757d92669..3c92ca802 100644 --- a/app/src/main/java/com/github/libretube/preferences/AudioVideoSettings.kt +++ b/app/src/main/java/com/github/libretube/ui/preferences/AudioVideoSettings.kt @@ -1,9 +1,9 @@ -package com.github.libretube.preferences +package com.github.libretube.ui.preferences import android.os.Bundle import com.github.libretube.R -import com.github.libretube.activities.SettingsActivity -import com.github.libretube.views.MaterialPreferenceFragment +import com.github.libretube.ui.activities.SettingsActivity +import com.github.libretube.ui.views.MaterialPreferenceFragment class AudioVideoSettings : MaterialPreferenceFragment() { diff --git a/app/src/main/java/com/github/libretube/preferences/GeneralSettings.kt b/app/src/main/java/com/github/libretube/ui/preferences/GeneralSettings.kt similarity index 88% rename from app/src/main/java/com/github/libretube/preferences/GeneralSettings.kt rename to app/src/main/java/com/github/libretube/ui/preferences/GeneralSettings.kt index b9bc731a4..40ce73a57 100644 --- a/app/src/main/java/com/github/libretube/preferences/GeneralSettings.kt +++ b/app/src/main/java/com/github/libretube/ui/preferences/GeneralSettings.kt @@ -1,4 +1,4 @@ -package com.github.libretube.preferences +package com.github.libretube.ui.preferences import android.os.Bundle import androidx.preference.EditTextPreference @@ -6,12 +6,12 @@ import androidx.preference.ListPreference import androidx.preference.Preference import androidx.preference.SwitchPreferenceCompat import com.github.libretube.R -import com.github.libretube.activities.SettingsActivity +import com.github.libretube.ui.activities.SettingsActivity import com.github.libretube.constants.PreferenceKeys -import com.github.libretube.dialogs.NavBarOptionsDialog -import com.github.libretube.dialogs.RequireRestartDialog +import com.github.libretube.ui.dialogs.NavBarOptionsDialog +import com.github.libretube.ui.dialogs.RequireRestartDialog import com.github.libretube.util.PreferenceHelper -import com.github.libretube.views.MaterialPreferenceFragment +import com.github.libretube.ui.views.MaterialPreferenceFragment class GeneralSettings : MaterialPreferenceFragment() { diff --git a/app/src/main/java/com/github/libretube/preferences/HistorySettings.kt b/app/src/main/java/com/github/libretube/ui/preferences/HistorySettings.kt similarity index 92% rename from app/src/main/java/com/github/libretube/preferences/HistorySettings.kt rename to app/src/main/java/com/github/libretube/ui/preferences/HistorySettings.kt index f89a827b4..417872fca 100644 --- a/app/src/main/java/com/github/libretube/preferences/HistorySettings.kt +++ b/app/src/main/java/com/github/libretube/ui/preferences/HistorySettings.kt @@ -1,12 +1,12 @@ -package com.github.libretube.preferences +package com.github.libretube.ui.preferences import android.os.Bundle import androidx.preference.Preference import com.github.libretube.R -import com.github.libretube.activities.SettingsActivity +import com.github.libretube.ui.activities.SettingsActivity import com.github.libretube.constants.PreferenceKeys import com.github.libretube.db.DatabaseHolder.Companion.Database -import com.github.libretube.views.MaterialPreferenceFragment +import com.github.libretube.ui.views.MaterialPreferenceFragment import com.google.android.material.dialog.MaterialAlertDialogBuilder class HistorySettings : MaterialPreferenceFragment() { diff --git a/app/src/main/java/com/github/libretube/preferences/InstanceSettings.kt b/app/src/main/java/com/github/libretube/ui/preferences/InstanceSettings.kt similarity index 95% rename from app/src/main/java/com/github/libretube/preferences/InstanceSettings.kt rename to app/src/main/java/com/github/libretube/ui/preferences/InstanceSettings.kt index b90a24854..5f58c6f78 100644 --- a/app/src/main/java/com/github/libretube/preferences/InstanceSettings.kt +++ b/app/src/main/java/com/github/libretube/ui/preferences/InstanceSettings.kt @@ -1,4 +1,4 @@ -package com.github.libretube.preferences +package com.github.libretube.ui.preferences import android.net.Uri import android.os.Bundle @@ -12,19 +12,19 @@ import androidx.preference.ListPreference import androidx.preference.Preference import androidx.preference.SwitchPreferenceCompat import com.github.libretube.R -import com.github.libretube.activities.SettingsActivity +import com.github.libretube.ui.activities.SettingsActivity import com.github.libretube.api.RetrofitInstance import com.github.libretube.constants.PreferenceKeys import com.github.libretube.db.DatabaseHolder.Companion.Database import com.github.libretube.db.obj.CustomInstance -import com.github.libretube.dialogs.CustomInstanceDialog -import com.github.libretube.dialogs.DeleteAccountDialog -import com.github.libretube.dialogs.LoginDialog -import com.github.libretube.dialogs.LogoutDialog +import com.github.libretube.ui.dialogs.CustomInstanceDialog +import com.github.libretube.ui.dialogs.DeleteAccountDialog +import com.github.libretube.ui.dialogs.LoginDialog +import com.github.libretube.ui.dialogs.LogoutDialog import com.github.libretube.extensions.await import com.github.libretube.util.ImportHelper import com.github.libretube.util.PreferenceHelper -import com.github.libretube.views.MaterialPreferenceFragment +import com.github.libretube.ui.views.MaterialPreferenceFragment class InstanceSettings : MaterialPreferenceFragment() { diff --git a/app/src/main/java/com/github/libretube/preferences/MainSettings.kt b/app/src/main/java/com/github/libretube/ui/preferences/MainSettings.kt similarity index 95% rename from app/src/main/java/com/github/libretube/preferences/MainSettings.kt rename to app/src/main/java/com/github/libretube/ui/preferences/MainSettings.kt index 5a1dcd500..9c7856d6e 100644 --- a/app/src/main/java/com/github/libretube/preferences/MainSettings.kt +++ b/app/src/main/java/com/github/libretube/ui/preferences/MainSettings.kt @@ -1,16 +1,16 @@ -package com.github.libretube.preferences +package com.github.libretube.ui.preferences import android.os.Bundle import androidx.fragment.app.Fragment import androidx.preference.Preference import com.github.libretube.BuildConfig import com.github.libretube.R -import com.github.libretube.activities.SettingsActivity +import com.github.libretube.ui.activities.SettingsActivity import com.github.libretube.api.RetrofitInstance -import com.github.libretube.dialogs.UpdateDialog +import com.github.libretube.ui.dialogs.UpdateDialog import com.github.libretube.extensions.getStyledSnackBar import com.github.libretube.util.NetworkHelper -import com.github.libretube.views.MaterialPreferenceFragment +import com.github.libretube.ui.views.MaterialPreferenceFragment import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch diff --git a/app/src/main/java/com/github/libretube/preferences/NotificationSettings.kt b/app/src/main/java/com/github/libretube/ui/preferences/NotificationSettings.kt similarity index 91% rename from app/src/main/java/com/github/libretube/preferences/NotificationSettings.kt rename to app/src/main/java/com/github/libretube/ui/preferences/NotificationSettings.kt index 0feaf5ed5..b2402c795 100644 --- a/app/src/main/java/com/github/libretube/preferences/NotificationSettings.kt +++ b/app/src/main/java/com/github/libretube/ui/preferences/NotificationSettings.kt @@ -1,14 +1,14 @@ -package com.github.libretube.preferences +package com.github.libretube.ui.preferences import android.os.Bundle import androidx.preference.ListPreference import androidx.preference.SwitchPreferenceCompat import androidx.work.ExistingPeriodicWorkPolicy import com.github.libretube.R -import com.github.libretube.activities.SettingsActivity +import com.github.libretube.ui.activities.SettingsActivity import com.github.libretube.constants.PreferenceKeys import com.github.libretube.util.NotificationHelper -import com.github.libretube.views.MaterialPreferenceFragment +import com.github.libretube.ui.views.MaterialPreferenceFragment class NotificationSettings : MaterialPreferenceFragment() { diff --git a/app/src/main/java/com/github/libretube/preferences/PlayerSettings.kt b/app/src/main/java/com/github/libretube/ui/preferences/PlayerSettings.kt similarity index 92% rename from app/src/main/java/com/github/libretube/preferences/PlayerSettings.kt rename to app/src/main/java/com/github/libretube/ui/preferences/PlayerSettings.kt index aaa869e0f..ad4bd1989 100644 --- a/app/src/main/java/com/github/libretube/preferences/PlayerSettings.kt +++ b/app/src/main/java/com/github/libretube/ui/preferences/PlayerSettings.kt @@ -1,14 +1,14 @@ -package com.github.libretube.preferences +package com.github.libretube.ui.preferences import android.os.Bundle import androidx.preference.ListPreference import androidx.preference.Preference import androidx.preference.SwitchPreferenceCompat import com.github.libretube.R -import com.github.libretube.activities.SettingsActivity +import com.github.libretube.ui.activities.SettingsActivity import com.github.libretube.constants.PreferenceKeys import com.github.libretube.util.PreferenceHelper -import com.github.libretube.views.MaterialPreferenceFragment +import com.github.libretube.ui.views.MaterialPreferenceFragment import java.util.* class PlayerSettings : MaterialPreferenceFragment() { diff --git a/app/src/main/java/com/github/libretube/preferences/SponsorBlockSettings.kt b/app/src/main/java/com/github/libretube/ui/preferences/SponsorBlockSettings.kt similarity index 71% rename from app/src/main/java/com/github/libretube/preferences/SponsorBlockSettings.kt rename to app/src/main/java/com/github/libretube/ui/preferences/SponsorBlockSettings.kt index 511880d9f..eccd7a290 100644 --- a/app/src/main/java/com/github/libretube/preferences/SponsorBlockSettings.kt +++ b/app/src/main/java/com/github/libretube/ui/preferences/SponsorBlockSettings.kt @@ -1,9 +1,9 @@ -package com.github.libretube.preferences +package com.github.libretube.ui.preferences import android.os.Bundle import com.github.libretube.R -import com.github.libretube.activities.SettingsActivity -import com.github.libretube.views.MaterialPreferenceFragment +import com.github.libretube.ui.activities.SettingsActivity +import com.github.libretube.ui.views.MaterialPreferenceFragment class SponsorBlockSettings : MaterialPreferenceFragment() { diff --git a/app/src/main/java/com/github/libretube/views/BottomSheet.kt b/app/src/main/java/com/github/libretube/ui/views/BottomSheet.kt similarity index 94% rename from app/src/main/java/com/github/libretube/views/BottomSheet.kt rename to app/src/main/java/com/github/libretube/ui/views/BottomSheet.kt index b0e99b1a4..2f0adf2e2 100644 --- a/app/src/main/java/com/github/libretube/views/BottomSheet.kt +++ b/app/src/main/java/com/github/libretube/ui/views/BottomSheet.kt @@ -1,11 +1,11 @@ -package com.github.libretube.views +package com.github.libretube.ui.views import android.os.Bundle import android.view.LayoutInflater import android.view.View import android.view.ViewGroup import androidx.recyclerview.widget.LinearLayoutManager -import com.github.libretube.adapters.BottomSheetAdapter +import com.github.libretube.ui.adapters.BottomSheetAdapter import com.github.libretube.databinding.BottomSheetBinding import com.github.libretube.obj.BottomSheetItem import com.google.android.material.bottomsheet.BottomSheetDialogFragment diff --git a/app/src/main/java/com/github/libretube/views/CustomExoPlayerView.kt b/app/src/main/java/com/github/libretube/ui/views/CustomExoPlayerView.kt similarity index 98% rename from app/src/main/java/com/github/libretube/views/CustomExoPlayerView.kt rename to app/src/main/java/com/github/libretube/ui/views/CustomExoPlayerView.kt index adfe27c03..fae42eafe 100644 --- a/app/src/main/java/com/github/libretube/views/CustomExoPlayerView.kt +++ b/app/src/main/java/com/github/libretube/ui/views/CustomExoPlayerView.kt @@ -1,4 +1,4 @@ -package com.github.libretube.views +package com.github.libretube.ui.views import android.annotation.SuppressLint import android.content.Context @@ -10,7 +10,7 @@ import android.view.MotionEvent import android.view.View import androidx.fragment.app.FragmentManager import com.github.libretube.R -import com.github.libretube.activities.MainActivity +import com.github.libretube.ui.activities.MainActivity import com.github.libretube.constants.PreferenceKeys import com.github.libretube.constants.PreferenceRanges import com.github.libretube.databinding.DialogSliderBinding @@ -174,9 +174,9 @@ internal class CustomExoPlayerView( context.getString(R.string.playback_speed), R.drawable.ic_speed, "${ - player?.playbackParameters?.speed - .toString() - .replace(".0", "") + player?.playbackParameters?.speed + .toString() + .replace(".0", "") }x" ) ) diff --git a/app/src/main/java/com/github/libretube/views/CustomSwipeToRefresh.kt b/app/src/main/java/com/github/libretube/ui/views/CustomSwipeToRefresh.kt similarity index 96% rename from app/src/main/java/com/github/libretube/views/CustomSwipeToRefresh.kt rename to app/src/main/java/com/github/libretube/ui/views/CustomSwipeToRefresh.kt index 96476579c..13a2ac5db 100644 --- a/app/src/main/java/com/github/libretube/views/CustomSwipeToRefresh.kt +++ b/app/src/main/java/com/github/libretube/ui/views/CustomSwipeToRefresh.kt @@ -1,4 +1,4 @@ -package com.github.libretube.views +package com.github.libretube.ui.views import android.content.Context import android.util.AttributeSet diff --git a/app/src/main/java/com/github/libretube/views/DoubleTapOverlay.kt b/app/src/main/java/com/github/libretube/ui/views/DoubleTapOverlay.kt similarity index 93% rename from app/src/main/java/com/github/libretube/views/DoubleTapOverlay.kt rename to app/src/main/java/com/github/libretube/ui/views/DoubleTapOverlay.kt index bdd2a3fcb..1c98462ff 100644 --- a/app/src/main/java/com/github/libretube/views/DoubleTapOverlay.kt +++ b/app/src/main/java/com/github/libretube/ui/views/DoubleTapOverlay.kt @@ -1,4 +1,4 @@ -package com.github.libretube.views +package com.github.libretube.ui.views import android.content.Context import android.util.AttributeSet diff --git a/app/src/main/java/com/github/libretube/views/MaterialPreferenceFragment.kt b/app/src/main/java/com/github/libretube/ui/views/MaterialPreferenceFragment.kt similarity index 98% rename from app/src/main/java/com/github/libretube/views/MaterialPreferenceFragment.kt rename to app/src/main/java/com/github/libretube/ui/views/MaterialPreferenceFragment.kt index 98838be28..01abb2ea0 100644 --- a/app/src/main/java/com/github/libretube/views/MaterialPreferenceFragment.kt +++ b/app/src/main/java/com/github/libretube/ui/views/MaterialPreferenceFragment.kt @@ -1,4 +1,4 @@ -package com.github.libretube.views +package com.github.libretube.ui.views import android.os.Bundle import androidx.preference.EditTextPreference diff --git a/app/src/main/java/com/github/libretube/views/SingleViewTouchableMotionLayout.kt b/app/src/main/java/com/github/libretube/ui/views/SingleViewTouchableMotionLayout.kt similarity index 98% rename from app/src/main/java/com/github/libretube/views/SingleViewTouchableMotionLayout.kt rename to app/src/main/java/com/github/libretube/ui/views/SingleViewTouchableMotionLayout.kt index 51d2871d0..28249ef69 100644 --- a/app/src/main/java/com/github/libretube/views/SingleViewTouchableMotionLayout.kt +++ b/app/src/main/java/com/github/libretube/ui/views/SingleViewTouchableMotionLayout.kt @@ -1,4 +1,4 @@ -package com.github.libretube.views +package com.github.libretube.ui.views import android.annotation.SuppressLint import android.content.Context diff --git a/app/src/main/java/com/github/libretube/util/AutoPlayHelper.kt b/app/src/main/java/com/github/libretube/util/AutoPlayHelper.kt index af2084374..ade87a04f 100644 --- a/app/src/main/java/com/github/libretube/util/AutoPlayHelper.kt +++ b/app/src/main/java/com/github/libretube/util/AutoPlayHelper.kt @@ -2,7 +2,7 @@ package com.github.libretube.util import com.github.libretube.api.RetrofitInstance import com.github.libretube.extensions.toID -import com.github.libretube.obj.StreamItem +import com.github.libretube.api.obj.StreamItem import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.withContext @@ -18,7 +18,7 @@ class AutoPlayHelper( */ suspend fun getNextVideoId( currentVideoId: String, - relatedStreams: List? + relatedStreams: List? ): String? { return if (playlistId == null) { getNextTrendingVideoId( @@ -35,7 +35,7 @@ class AutoPlayHelper( * get the id of the next related video */ private fun getNextTrendingVideoId( - relatedStreams: List? + relatedStreams: List? ): String? { // don't play a video if it got played before already if (relatedStreams == null || relatedStreams.isEmpty()) return null diff --git a/app/src/main/java/com/github/libretube/util/NavigationHelper.kt b/app/src/main/java/com/github/libretube/util/NavigationHelper.kt index 0450a41e1..221db33dd 100644 --- a/app/src/main/java/com/github/libretube/util/NavigationHelper.kt +++ b/app/src/main/java/com/github/libretube/util/NavigationHelper.kt @@ -5,10 +5,10 @@ import android.os.Bundle import androidx.appcompat.app.AppCompatActivity import androidx.core.os.bundleOf import com.github.libretube.R -import com.github.libretube.activities.MainActivity +import com.github.libretube.ui.activities.MainActivity import com.github.libretube.constants.IntentData import com.github.libretube.extensions.toID -import com.github.libretube.fragments.PlayerFragment +import com.github.libretube.ui.fragments.PlayerFragment object NavigationHelper { fun navigateChannel( diff --git a/app/src/main/java/com/github/libretube/util/NotificationHelper.kt b/app/src/main/java/com/github/libretube/util/NotificationHelper.kt index c8b2e9369..bd52972ee 100644 --- a/app/src/main/java/com/github/libretube/util/NotificationHelper.kt +++ b/app/src/main/java/com/github/libretube/util/NotificationHelper.kt @@ -13,7 +13,7 @@ import androidx.work.NetworkType import androidx.work.PeriodicWorkRequest import androidx.work.WorkManager import com.github.libretube.R -import com.github.libretube.activities.MainActivity +import com.github.libretube.ui.activities.MainActivity import com.github.libretube.api.RetrofitInstance import com.github.libretube.api.SubscriptionHelper import com.github.libretube.constants.NOTIFICATION_WORK_NAME diff --git a/app/src/main/java/com/github/libretube/util/NowPlayingNotification.kt b/app/src/main/java/com/github/libretube/util/NowPlayingNotification.kt index 25aec4703..cc4c4006b 100644 --- a/app/src/main/java/com/github/libretube/util/NowPlayingNotification.kt +++ b/app/src/main/java/com/github/libretube/util/NowPlayingNotification.kt @@ -9,10 +9,9 @@ import android.graphics.drawable.BitmapDrawable import android.os.Build import android.support.v4.media.session.MediaSessionCompat import coil.request.ImageRequest -import com.github.libretube.activities.MainActivity +import com.github.libretube.ui.activities.MainActivity import com.github.libretube.constants.BACKGROUND_CHANNEL_ID import com.github.libretube.constants.PLAYER_NOTIFICATION_ID -import com.github.libretube.obj.Streams import com.google.android.exoplayer2.ExoPlayer import com.google.android.exoplayer2.Player import com.google.android.exoplayer2.ext.mediasession.MediaSessionConnector @@ -22,7 +21,7 @@ class NowPlayingNotification( private val context: Context, private val player: ExoPlayer ) { - private var streams: Streams? = null + private var streams: com.github.libretube.api.obj.Streams? = null /** * The [MediaSessionCompat] for the [streams]. @@ -122,7 +121,7 @@ class NowPlayingNotification( * Updates or creates the [playerNotification] */ fun updatePlayerNotification( - streams: Streams + streams: com.github.libretube.api.obj.Streams ) { this.streams = streams if (playerNotification == null) { diff --git a/app/src/main/java/com/github/libretube/util/PlayerHelper.kt b/app/src/main/java/com/github/libretube/util/PlayerHelper.kt index ae8401768..67d5ae2e5 100644 --- a/app/src/main/java/com/github/libretube/util/PlayerHelper.kt +++ b/app/src/main/java/com/github/libretube/util/PlayerHelper.kt @@ -3,12 +3,12 @@ package com.github.libretube.util import android.content.Context import android.view.accessibility.CaptioningManager import com.github.libretube.constants.PreferenceKeys -import com.github.libretube.obj.PipedStream +import com.github.libretube.api.obj.PipedStream import com.google.android.exoplayer2.ui.CaptionStyleCompat object PlayerHelper { // get the audio source following the users preferences - fun getAudioSource(context: Context, audios: List): String { + fun getAudioSource(context: Context, audios: List): String { val audioFormat = PreferenceHelper.getString(PreferenceKeys.PLAYER_AUDIO_FORMAT, "all") val audioQuality = if ( NetworkHelper.isNetworkMobile(context) @@ -34,7 +34,7 @@ object PlayerHelper { } // get the best bit rate from audio streams - private fun getMostBitRate(audios: List): String { + private fun getMostBitRate(audios: List): String { var bitrate = 0 var audioUrl = "" audios.forEach { @@ -47,7 +47,7 @@ object PlayerHelper { } // get the best bit rate from audio streams - private fun getLeastBitRate(audios: List): String { + private fun getLeastBitRate(audios: List): String { var bitrate = 1000000000 var audioUrl = "" audios.forEach { diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml index 43ea01a21..11b3b443e 100644 --- a/app/src/main/res/layout/activity_main.xml +++ b/app/src/main/res/layout/activity_main.xml @@ -6,7 +6,7 @@ android:layout_width="match_parent" android:layout_height="match_parent" app:layoutDescription="@xml/activity_main_scene" - tools:context=".activities.MainActivity"> + tools:context=".ui.activities.MainActivity"> - - - + \ No newline at end of file diff --git a/app/src/main/res/layout/fragment_channel.xml b/app/src/main/res/layout/fragment_channel.xml index 9090cfcd8..e3028d0d8 100644 --- a/app/src/main/res/layout/fragment_channel.xml +++ b/app/src/main/res/layout/fragment_channel.xml @@ -1,5 +1,5 @@ - + tools:context=".ui.fragments.ChannelFragment"> - + diff --git a/app/src/main/res/layout/fragment_home.xml b/app/src/main/res/layout/fragment_home.xml index 4b859beac..31af0267b 100644 --- a/app/src/main/res/layout/fragment_home.xml +++ b/app/src/main/res/layout/fragment_home.xml @@ -4,7 +4,7 @@ xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" - tools:context=".fragments.HomeFragment"> + tools:context=".ui.fragments.HomeFragment"> + tools:context=".ui.fragments.LibraryFragment"> - @@ -113,7 +113,7 @@ - + - + tools:context=".ui.fragments.PlayerFragment"> - - - + - \ No newline at end of file + \ No newline at end of file diff --git a/app/src/main/res/layout/fragment_playlist.xml b/app/src/main/res/layout/fragment_playlist.xml index 821883788..c39957aa3 100644 --- a/app/src/main/res/layout/fragment_playlist.xml +++ b/app/src/main/res/layout/fragment_playlist.xml @@ -3,7 +3,7 @@ xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" - tools:context=".fragments.PlaylistFragment"> + tools:context=".ui.fragments.PlaylistFragment"> + tools:context=".ui.fragments.SearchFragment"> + tools:context=".ui.fragments.SearchFragment"> + tools:context=".ui.fragments.SubscriptionsFragment"> - @@ -144,5 +144,5 @@ - + diff --git a/app/src/main/res/navigation/nav.xml b/app/src/main/res/navigation/nav.xml index d8ea003e1..1b311537d 100644 --- a/app/src/main/res/navigation/nav.xml +++ b/app/src/main/res/navigation/nav.xml @@ -7,47 +7,47 @@ \ No newline at end of file From 8e4b03a13b7363c718fa99ba661acd94f209eee1 Mon Sep 17 00:00:00 2001 From: Bnyro Date: Tue, 20 Sep 2022 20:00:15 +0200 Subject: [PATCH 2/3] fix updater --- .../github/libretube/services/UpdateService.kt | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/app/src/main/java/com/github/libretube/services/UpdateService.kt b/app/src/main/java/com/github/libretube/services/UpdateService.kt index 76dab8b38..8b3e566de 100644 --- a/app/src/main/java/com/github/libretube/services/UpdateService.kt +++ b/app/src/main/java/com/github/libretube/services/UpdateService.kt @@ -58,12 +58,15 @@ class UpdateService : Service() { val id = intent.getLongExtra(DownloadManager.EXTRA_DOWNLOAD_ID, -1) if (downloadId == id) { // install the apk after download finished - val installIntent = Intent(Intent.ACTION_VIEW) - installIntent.flags = Intent.FLAG_ACTIVITY_NEW_TASK - installIntent.setDataAndType( - Uri.fromFile(file), - downloadManager.getMimeTypeForDownloadedFile(downloadId) - ) + val installIntent = Intent(Intent.ACTION_VIEW).apply { + addFlags(Intent.FLAG_ACTIVITY_NEW_TASK) + addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION) + setDataAndType( + Uri.fromFile(file), + downloadManager.getMimeTypeForDownloadedFile(downloadId) + ) + } + try { startActivity(installIntent) } catch (e: Exception) { From eab603acb86df9bb9047aedf087ceb269bfc7821 Mon Sep 17 00:00:00 2001 From: Bnyro Date: Tue, 20 Sep 2022 20:00:51 +0200 Subject: [PATCH 3/3] ktlint --- .../java/com/github/libretube/api/ExternalApi.kt | 2 +- .../com/github/libretube/api/SubscriptionHelper.kt | 2 +- .../java/com/github/libretube/db/DatabaseHelper.kt | 2 +- .../libretube/models/SubscriptionsViewModel.kt | 4 ++-- .../github/libretube/obj/NewPipeSubscriptions.kt | 2 -- .../github/libretube/services/BackgroundMode.kt | 6 +++--- .../libretube/sheets/PlaylistOptionsBottomSheet.kt | 9 +++++---- .../libretube/sheets/VideoOptionsBottomSheet.kt | 2 +- .../github/libretube/ui/activities/MainActivity.kt | 4 ++-- .../github/libretube/ui/adapters/ChannelAdapter.kt | 2 +- .../libretube/ui/adapters/ChaptersAdapter.kt | 2 +- .../libretube/ui/adapters/CommentsAdapter.kt | 4 ++-- .../libretube/ui/adapters/DownloadsAdapter.kt | 2 +- .../ui/adapters/LegacySubscriptionAdapter.kt | 2 +- .../libretube/ui/adapters/PlaylistAdapter.kt | 4 ++-- .../libretube/ui/adapters/PlaylistsAdapter.kt | 4 ++-- .../github/libretube/ui/adapters/RepliesAdapter.kt | 2 +- .../github/libretube/ui/adapters/SearchAdapter.kt | 2 +- .../ui/adapters/SubscriptionChannelAdapter.kt | 4 ++-- .../libretube/ui/adapters/TrendingAdapter.kt | 2 +- .../libretube/ui/dialogs/AddToPlaylistDialog.kt | 5 +++-- .../github/libretube/ui/dialogs/BackupDialog.kt | 2 +- .../libretube/ui/dialogs/CreatePlaylistDialog.kt | 5 +++-- .../libretube/ui/dialogs/DeleteAccountDialog.kt | 5 +++-- .../github/libretube/ui/dialogs/DownloadDialog.kt | 2 +- .../com/github/libretube/ui/dialogs/LoginDialog.kt | 2 +- .../libretube/ui/dialogs/NavBarOptionsDialog.kt | 2 +- .../github/libretube/ui/dialogs/UpdateDialog.kt | 2 +- .../libretube/ui/fragments/ChannelFragment.kt | 2 +- .../libretube/ui/fragments/DownloadsFragment.kt | 2 +- .../github/libretube/ui/fragments/HomeFragment.kt | 4 ++-- .../libretube/ui/fragments/LibraryFragment.kt | 4 ++-- .../libretube/ui/fragments/PlayerFragment.kt | 14 +++++++------- .../libretube/ui/fragments/PlaylistFragment.kt | 2 +- .../libretube/ui/fragments/SearchFragment.kt | 6 +++--- .../libretube/ui/fragments/SearchResultFragment.kt | 4 ++-- .../ui/fragments/SubscriptionsFragment.kt | 8 ++++---- .../libretube/ui/fragments/WatchHistoryFragment.kt | 2 +- .../libretube/ui/preferences/AdvancedSettings.kt | 6 +++--- .../libretube/ui/preferences/AppearanceSettings.kt | 4 ++-- .../libretube/ui/preferences/GeneralSettings.kt | 4 ++-- .../libretube/ui/preferences/HistorySettings.kt | 2 +- .../libretube/ui/preferences/InstanceSettings.kt | 6 +++--- .../libretube/ui/preferences/MainSettings.kt | 6 +++--- .../ui/preferences/NotificationSettings.kt | 4 ++-- .../libretube/ui/preferences/PlayerSettings.kt | 4 ++-- .../com/github/libretube/ui/views/BottomSheet.kt | 2 +- .../libretube/ui/views/CustomExoPlayerView.kt | 8 ++++---- .../com/github/libretube/util/AutoPlayHelper.kt | 2 +- .../com/github/libretube/util/NavigationHelper.kt | 2 +- .../github/libretube/util/NotificationHelper.kt | 2 +- .../libretube/util/NowPlayingNotification.kt | 2 +- .../java/com/github/libretube/util/PlayerHelper.kt | 2 +- 53 files changed, 97 insertions(+), 95 deletions(-) diff --git a/app/src/main/java/com/github/libretube/api/ExternalApi.kt b/app/src/main/java/com/github/libretube/api/ExternalApi.kt index a547a8fbb..ab9c8d3eb 100644 --- a/app/src/main/java/com/github/libretube/api/ExternalApi.kt +++ b/app/src/main/java/com/github/libretube/api/ExternalApi.kt @@ -1,8 +1,8 @@ package com.github.libretube.api +import com.github.libretube.api.obj.Instances import com.github.libretube.constants.GITHUB_API_URL import com.github.libretube.constants.PIPED_INSTANCES_URL -import com.github.libretube.api.obj.Instances import com.github.libretube.obj.update.UpdateInfo import retrofit2.http.GET diff --git a/app/src/main/java/com/github/libretube/api/SubscriptionHelper.kt b/app/src/main/java/com/github/libretube/api/SubscriptionHelper.kt index 333138350..c39936590 100644 --- a/app/src/main/java/com/github/libretube/api/SubscriptionHelper.kt +++ b/app/src/main/java/com/github/libretube/api/SubscriptionHelper.kt @@ -1,11 +1,11 @@ package com.github.libretube.api import android.util.Log +import com.github.libretube.api.obj.Subscribe import com.github.libretube.db.DatabaseHolder.Companion.Database import com.github.libretube.db.obj.LocalSubscription import com.github.libretube.extensions.TAG import com.github.libretube.extensions.await -import com.github.libretube.api.obj.Subscribe import com.github.libretube.util.PreferenceHelper import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Dispatchers diff --git a/app/src/main/java/com/github/libretube/db/DatabaseHelper.kt b/app/src/main/java/com/github/libretube/db/DatabaseHelper.kt index b0a083423..f8ea13d62 100644 --- a/app/src/main/java/com/github/libretube/db/DatabaseHelper.kt +++ b/app/src/main/java/com/github/libretube/db/DatabaseHelper.kt @@ -1,12 +1,12 @@ package com.github.libretube.db +import com.github.libretube.api.obj.Streams import com.github.libretube.constants.PreferenceKeys import com.github.libretube.db.DatabaseHolder.Companion.Database import com.github.libretube.db.obj.SearchHistoryItem import com.github.libretube.db.obj.WatchHistoryItem import com.github.libretube.db.obj.WatchPosition import com.github.libretube.extensions.toID -import com.github.libretube.api.obj.Streams import com.github.libretube.util.PreferenceHelper object DatabaseHelper { diff --git a/app/src/main/java/com/github/libretube/models/SubscriptionsViewModel.kt b/app/src/main/java/com/github/libretube/models/SubscriptionsViewModel.kt index cac255157..fd139e4be 100644 --- a/app/src/main/java/com/github/libretube/models/SubscriptionsViewModel.kt +++ b/app/src/main/java/com/github/libretube/models/SubscriptionsViewModel.kt @@ -5,10 +5,10 @@ import androidx.lifecycle.MutableLiveData import androidx.lifecycle.ViewModel import com.github.libretube.api.RetrofitInstance import com.github.libretube.api.SubscriptionHelper -import com.github.libretube.extensions.TAG -import com.github.libretube.extensions.toID import com.github.libretube.api.obj.StreamItem import com.github.libretube.api.obj.Subscription +import com.github.libretube.extensions.TAG +import com.github.libretube.extensions.toID import com.github.libretube.util.PreferenceHelper import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Dispatchers diff --git a/app/src/main/java/com/github/libretube/obj/NewPipeSubscriptions.kt b/app/src/main/java/com/github/libretube/obj/NewPipeSubscriptions.kt index 20f2ed2b1..9c19551d2 100644 --- a/app/src/main/java/com/github/libretube/obj/NewPipeSubscriptions.kt +++ b/app/src/main/java/com/github/libretube/obj/NewPipeSubscriptions.kt @@ -1,7 +1,5 @@ package com.github.libretube.obj -import com.github.libretube.obj.NewPipeSubscription - data class NewPipeSubscriptions( val app_version: String = "", val app_version_int: Int = 0, diff --git a/app/src/main/java/com/github/libretube/services/BackgroundMode.kt b/app/src/main/java/com/github/libretube/services/BackgroundMode.kt index f18930aad..b3a4f0ae1 100644 --- a/app/src/main/java/com/github/libretube/services/BackgroundMode.kt +++ b/app/src/main/java/com/github/libretube/services/BackgroundMode.kt @@ -13,14 +13,14 @@ import android.widget.Toast import com.fasterxml.jackson.databind.ObjectMapper import com.github.libretube.R import com.github.libretube.api.RetrofitInstance +import com.github.libretube.api.obj.Segment +import com.github.libretube.api.obj.Segments +import com.github.libretube.api.obj.Streams import com.github.libretube.constants.BACKGROUND_CHANNEL_ID import com.github.libretube.constants.IntentData import com.github.libretube.constants.PLAYER_NOTIFICATION_ID import com.github.libretube.constants.PreferenceKeys import com.github.libretube.extensions.toID -import com.github.libretube.api.obj.Segment -import com.github.libretube.api.obj.Segments -import com.github.libretube.api.obj.Streams import com.github.libretube.util.AutoPlayHelper import com.github.libretube.util.NowPlayingNotification import com.github.libretube.util.PlayerHelper diff --git a/app/src/main/java/com/github/libretube/sheets/PlaylistOptionsBottomSheet.kt b/app/src/main/java/com/github/libretube/sheets/PlaylistOptionsBottomSheet.kt index 8134da711..8a1201830 100644 --- a/app/src/main/java/com/github/libretube/sheets/PlaylistOptionsBottomSheet.kt +++ b/app/src/main/java/com/github/libretube/sheets/PlaylistOptionsBottomSheet.kt @@ -6,14 +6,14 @@ import android.util.Log import android.widget.Toast import com.github.libretube.R import com.github.libretube.api.RetrofitInstance +import com.github.libretube.api.obj.PlaylistId import com.github.libretube.databinding.DialogTextPreferenceBinding -import com.github.libretube.ui.dialogs.ShareDialog import com.github.libretube.extensions.TAG import com.github.libretube.extensions.toID -import com.github.libretube.api.obj.PlaylistId +import com.github.libretube.ui.dialogs.ShareDialog +import com.github.libretube.ui.views.BottomSheet import com.github.libretube.util.BackgroundHelper import com.github.libretube.util.PreferenceHelper -import com.github.libretube.ui.views.BottomSheet import com.google.android.material.dialog.MaterialAlertDialogBuilder import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Dispatchers @@ -114,7 +114,8 @@ class PlaylistOptionsBottomSheet( private fun importPlaylist(token: String, playlistId: String) { CoroutineScope(Dispatchers.IO).launch { val response = try { - RetrofitInstance.authApi.importPlaylist(token, + RetrofitInstance.authApi.importPlaylist( + token, com.github.libretube.api.obj.PlaylistId(playlistId) ) } catch (e: IOException) { diff --git a/app/src/main/java/com/github/libretube/sheets/VideoOptionsBottomSheet.kt b/app/src/main/java/com/github/libretube/sheets/VideoOptionsBottomSheet.kt index 2d82d3fa7..a9a39b859 100644 --- a/app/src/main/java/com/github/libretube/sheets/VideoOptionsBottomSheet.kt +++ b/app/src/main/java/com/github/libretube/sheets/VideoOptionsBottomSheet.kt @@ -7,10 +7,10 @@ import com.github.libretube.constants.IntentData import com.github.libretube.ui.dialogs.AddToPlaylistDialog import com.github.libretube.ui.dialogs.DownloadDialog import com.github.libretube.ui.dialogs.ShareDialog +import com.github.libretube.ui.views.BottomSheet import com.github.libretube.util.BackgroundHelper import com.github.libretube.util.PlayingQueue import com.github.libretube.util.PreferenceHelper -import com.github.libretube.ui.views.BottomSheet /** * Dialog with different options for a selected video. diff --git a/app/src/main/java/com/github/libretube/ui/activities/MainActivity.kt b/app/src/main/java/com/github/libretube/ui/activities/MainActivity.kt index 8ee5aaed9..74374a1c8 100644 --- a/app/src/main/java/com/github/libretube/ui/activities/MainActivity.kt +++ b/app/src/main/java/com/github/libretube/ui/activities/MainActivity.kt @@ -25,14 +25,14 @@ import com.github.libretube.R import com.github.libretube.constants.IntentData import com.github.libretube.constants.PreferenceKeys import com.github.libretube.databinding.ActivityMainBinding -import com.github.libretube.ui.dialogs.ErrorDialog import com.github.libretube.extensions.BaseActivity import com.github.libretube.extensions.toID -import com.github.libretube.ui.fragments.PlayerFragment import com.github.libretube.models.PlayerViewModel import com.github.libretube.models.SearchViewModel import com.github.libretube.models.SubscriptionsViewModel import com.github.libretube.services.ClosingService +import com.github.libretube.ui.dialogs.ErrorDialog +import com.github.libretube.ui.fragments.PlayerFragment import com.github.libretube.util.NavBarHelper import com.github.libretube.util.NetworkHelper import com.github.libretube.util.PreferenceHelper diff --git a/app/src/main/java/com/github/libretube/ui/adapters/ChannelAdapter.kt b/app/src/main/java/com/github/libretube/ui/adapters/ChannelAdapter.kt index ffd7b38a4..2f80e0ea7 100644 --- a/app/src/main/java/com/github/libretube/ui/adapters/ChannelAdapter.kt +++ b/app/src/main/java/com/github/libretube/ui/adapters/ChannelAdapter.kt @@ -5,11 +5,11 @@ import android.view.LayoutInflater import android.view.ViewGroup import androidx.fragment.app.FragmentManager import androidx.recyclerview.widget.RecyclerView +import com.github.libretube.api.obj.StreamItem import com.github.libretube.databinding.VideoRowBinding import com.github.libretube.extensions.formatShort import com.github.libretube.extensions.setWatchProgressLength import com.github.libretube.extensions.toID -import com.github.libretube.api.obj.StreamItem import com.github.libretube.sheets.VideoOptionsBottomSheet import com.github.libretube.util.ImageHelper import com.github.libretube.util.NavigationHelper diff --git a/app/src/main/java/com/github/libretube/ui/adapters/ChaptersAdapter.kt b/app/src/main/java/com/github/libretube/ui/adapters/ChaptersAdapter.kt index 7fd29ad10..f75b43b85 100644 --- a/app/src/main/java/com/github/libretube/ui/adapters/ChaptersAdapter.kt +++ b/app/src/main/java/com/github/libretube/ui/adapters/ChaptersAdapter.kt @@ -4,8 +4,8 @@ import android.graphics.Color import android.view.LayoutInflater import android.view.ViewGroup import androidx.recyclerview.widget.RecyclerView -import com.github.libretube.databinding.ChapterColumnBinding import com.github.libretube.api.obj.ChapterSegment +import com.github.libretube.databinding.ChapterColumnBinding import com.github.libretube.util.ImageHelper import com.github.libretube.util.ThemeHelper import com.google.android.exoplayer2.ExoPlayer diff --git a/app/src/main/java/com/github/libretube/ui/adapters/CommentsAdapter.kt b/app/src/main/java/com/github/libretube/ui/adapters/CommentsAdapter.kt index 08ee77465..199162429 100644 --- a/app/src/main/java/com/github/libretube/ui/adapters/CommentsAdapter.kt +++ b/app/src/main/java/com/github/libretube/ui/adapters/CommentsAdapter.kt @@ -9,11 +9,11 @@ import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.RecyclerView import com.github.libretube.R import com.github.libretube.api.RetrofitInstance +import com.github.libretube.api.obj.Comment +import com.github.libretube.api.obj.CommentsPage import com.github.libretube.databinding.CommentsRowBinding import com.github.libretube.extensions.TAG import com.github.libretube.extensions.formatShort -import com.github.libretube.api.obj.Comment -import com.github.libretube.api.obj.CommentsPage import com.github.libretube.util.ImageHelper import com.github.libretube.util.NavigationHelper import kotlinx.coroutines.CoroutineScope diff --git a/app/src/main/java/com/github/libretube/ui/adapters/DownloadsAdapter.kt b/app/src/main/java/com/github/libretube/ui/adapters/DownloadsAdapter.kt index 60ef45b8c..e0b0fa10b 100644 --- a/app/src/main/java/com/github/libretube/ui/adapters/DownloadsAdapter.kt +++ b/app/src/main/java/com/github/libretube/ui/adapters/DownloadsAdapter.kt @@ -6,10 +6,10 @@ import android.view.LayoutInflater import android.view.ViewGroup import androidx.recyclerview.widget.RecyclerView import com.github.libretube.R -import com.github.libretube.ui.activities.OfflinePlayerActivity import com.github.libretube.constants.IntentData import com.github.libretube.databinding.DownloadedMediaRowBinding import com.github.libretube.obj.DownloadedFile +import com.github.libretube.ui.activities.OfflinePlayerActivity import com.google.android.material.dialog.MaterialAlertDialogBuilder import java.io.File diff --git a/app/src/main/java/com/github/libretube/ui/adapters/LegacySubscriptionAdapter.kt b/app/src/main/java/com/github/libretube/ui/adapters/LegacySubscriptionAdapter.kt index 67286c7cb..2bd0ad2bc 100644 --- a/app/src/main/java/com/github/libretube/ui/adapters/LegacySubscriptionAdapter.kt +++ b/app/src/main/java/com/github/libretube/ui/adapters/LegacySubscriptionAdapter.kt @@ -3,9 +3,9 @@ package com.github.libretube.ui.adapters import android.view.LayoutInflater import android.view.ViewGroup import androidx.recyclerview.widget.RecyclerView +import com.github.libretube.api.obj.Subscription import com.github.libretube.databinding.LegacySubscriptionChannelBinding import com.github.libretube.extensions.toID -import com.github.libretube.api.obj.Subscription import com.github.libretube.util.ImageHelper import com.github.libretube.util.NavigationHelper diff --git a/app/src/main/java/com/github/libretube/ui/adapters/PlaylistAdapter.kt b/app/src/main/java/com/github/libretube/ui/adapters/PlaylistAdapter.kt index 7a80e4569..8880c73f7 100644 --- a/app/src/main/java/com/github/libretube/ui/adapters/PlaylistAdapter.kt +++ b/app/src/main/java/com/github/libretube/ui/adapters/PlaylistAdapter.kt @@ -8,13 +8,13 @@ import android.view.ViewGroup import androidx.fragment.app.FragmentManager import androidx.recyclerview.widget.RecyclerView import com.github.libretube.api.RetrofitInstance +import com.github.libretube.api.obj.PlaylistId +import com.github.libretube.api.obj.StreamItem import com.github.libretube.databinding.PlaylistRowBinding import com.github.libretube.extensions.TAG import com.github.libretube.extensions.setFormattedDuration import com.github.libretube.extensions.setWatchProgressLength import com.github.libretube.extensions.toID -import com.github.libretube.api.obj.PlaylistId -import com.github.libretube.api.obj.StreamItem import com.github.libretube.sheets.VideoOptionsBottomSheet import com.github.libretube.util.ImageHelper import com.github.libretube.util.NavigationHelper diff --git a/app/src/main/java/com/github/libretube/ui/adapters/PlaylistsAdapter.kt b/app/src/main/java/com/github/libretube/ui/adapters/PlaylistsAdapter.kt index 4c8198f31..a4614fa49 100644 --- a/app/src/main/java/com/github/libretube/ui/adapters/PlaylistsAdapter.kt +++ b/app/src/main/java/com/github/libretube/ui/adapters/PlaylistsAdapter.kt @@ -8,10 +8,10 @@ import androidx.fragment.app.FragmentManager import androidx.recyclerview.widget.RecyclerView import com.github.libretube.R import com.github.libretube.api.RetrofitInstance -import com.github.libretube.databinding.PlaylistsRowBinding -import com.github.libretube.extensions.TAG import com.github.libretube.api.obj.PlaylistId import com.github.libretube.api.obj.Playlists +import com.github.libretube.databinding.PlaylistsRowBinding +import com.github.libretube.extensions.TAG import com.github.libretube.sheets.PlaylistOptionsBottomSheet import com.github.libretube.util.ImageHelper import com.github.libretube.util.NavigationHelper diff --git a/app/src/main/java/com/github/libretube/ui/adapters/RepliesAdapter.kt b/app/src/main/java/com/github/libretube/ui/adapters/RepliesAdapter.kt index a2b0a9719..ccf0571f8 100644 --- a/app/src/main/java/com/github/libretube/ui/adapters/RepliesAdapter.kt +++ b/app/src/main/java/com/github/libretube/ui/adapters/RepliesAdapter.kt @@ -4,9 +4,9 @@ import android.view.LayoutInflater import android.view.View import android.view.ViewGroup import androidx.recyclerview.widget.RecyclerView +import com.github.libretube.api.obj.Comment import com.github.libretube.databinding.RepliesRowBinding import com.github.libretube.extensions.formatShort -import com.github.libretube.api.obj.Comment import com.github.libretube.util.ImageHelper import com.github.libretube.util.NavigationHelper diff --git a/app/src/main/java/com/github/libretube/ui/adapters/SearchAdapter.kt b/app/src/main/java/com/github/libretube/ui/adapters/SearchAdapter.kt index bc3d29a2d..4e77f6657 100644 --- a/app/src/main/java/com/github/libretube/ui/adapters/SearchAdapter.kt +++ b/app/src/main/java/com/github/libretube/ui/adapters/SearchAdapter.kt @@ -7,6 +7,7 @@ import androidx.fragment.app.FragmentManager import androidx.recyclerview.widget.RecyclerView import com.github.libretube.R import com.github.libretube.api.SubscriptionHelper +import com.github.libretube.api.obj.SearchItem import com.github.libretube.databinding.ChannelRowBinding import com.github.libretube.databinding.PlaylistSearchRowBinding import com.github.libretube.databinding.VideoRowBinding @@ -14,7 +15,6 @@ import com.github.libretube.extensions.formatShort import com.github.libretube.extensions.setFormattedDuration import com.github.libretube.extensions.setWatchProgressLength import com.github.libretube.extensions.toID -import com.github.libretube.api.obj.SearchItem import com.github.libretube.sheets.PlaylistOptionsBottomSheet import com.github.libretube.sheets.VideoOptionsBottomSheet import com.github.libretube.util.ImageHelper diff --git a/app/src/main/java/com/github/libretube/ui/adapters/SubscriptionChannelAdapter.kt b/app/src/main/java/com/github/libretube/ui/adapters/SubscriptionChannelAdapter.kt index 5d320c49f..ee7f36f9d 100644 --- a/app/src/main/java/com/github/libretube/ui/adapters/SubscriptionChannelAdapter.kt +++ b/app/src/main/java/com/github/libretube/ui/adapters/SubscriptionChannelAdapter.kt @@ -5,9 +5,9 @@ import android.view.ViewGroup import androidx.recyclerview.widget.RecyclerView import com.github.libretube.R import com.github.libretube.api.SubscriptionHelper +import com.github.libretube.api.obj.Subscription import com.github.libretube.databinding.ChannelSubscriptionRowBinding import com.github.libretube.extensions.toID -import com.github.libretube.api.obj.Subscription import com.github.libretube.util.ImageHelper import com.github.libretube.util.NavigationHelper @@ -19,7 +19,7 @@ class SubscriptionChannelAdapter(private val subscriptions: MutableList