From b734c69ea8e85f2fe741e608f16055e5cdefd709 Mon Sep 17 00:00:00 2001 From: Bnyro Date: Tue, 31 Jan 2023 16:43:39 +0100 Subject: [PATCH] Move helpers from `.util` to `.ui.listeners` and `.helpers` --- .../java/com/github/libretube/LibreTubeApp.kt | 10 +++++----- .../com/github/libretube/api/PlaylistsHelper.kt | 5 ++--- .../com/github/libretube/api/RetrofitInstance.kt | 2 +- .../github/libretube/api/SubscriptionHelper.kt | 2 +- .../com/github/libretube/db/DatabaseHelper.kt | 2 +- .../github/libretube/extensions/ToStreamItem.kt | 2 +- .../libretube/{util => helpers}/AudioHelper.kt | 2 +- .../{util => helpers}/BackgroundHelper.kt | 2 +- .../libretube/{util => helpers}/BackupHelper.kt | 2 +- .../{util => helpers}/BrightnessHelper.kt | 2 +- .../{util => helpers}/ClipboardHelper.kt | 2 +- .../libretube/{util => helpers}/DashHelper.kt | 2 +- .../{util => helpers}/DownloadHelper.kt | 2 +- .../libretube/{util => helpers}/ImageHelper.kt | 3 ++- .../libretube/{util => helpers}/ImportHelper.kt | 2 +- .../libretube/{util => helpers}/LocaleHelper.kt | 2 +- .../libretube/{util => helpers}/NavBarHelper.kt | 2 +- .../{util => helpers}/NavigationHelper.kt | 2 +- .../libretube/{util => helpers}/NetworkHelper.kt | 2 +- .../{util => helpers}/NotificationHelper.kt | 2 +- .../libretube/{util => helpers}/PlayerHelper.kt | 2 +- .../{util => helpers}/PreferenceHelper.kt | 2 +- .../libretube/{util => helpers}/ProxyHelper.kt | 2 +- .../{util => helpers}/ShortcutHelper.kt | 2 +- .../libretube/{util => helpers}/ThemeHelper.kt | 2 +- .../libretube/{util => helpers}/WindowHelper.kt | 2 +- .../github/libretube/services/BackgroundMode.kt | 4 ++-- .../github/libretube/services/DownloadService.kt | 6 +++--- .../github/libretube/services/UpdateService.kt | 2 +- .../libretube/ui/activities/MainActivity.kt | 12 ++++++------ .../ui/activities/NoInternetActivity.kt | 4 ++-- .../ui/activities/OfflinePlayerActivity.kt | 6 +++--- .../libretube/ui/activities/RouterActivity.kt | 2 +- .../libretube/ui/adapters/ChaptersAdapter.kt | 4 ++-- .../libretube/ui/adapters/CommentsAdapter.kt | 8 ++++---- .../libretube/ui/adapters/DownloadsAdapter.kt | 2 +- .../libretube/ui/adapters/IconsSheetAdapter.kt | 4 ++-- .../ui/adapters/LegacySubscriptionAdapter.kt | 4 ++-- .../libretube/ui/adapters/PlayingQueueAdapter.kt | 4 ++-- .../libretube/ui/adapters/PlaylistAdapter.kt | 4 ++-- .../ui/adapters/PlaylistBookmarkAdapter.kt | 4 ++-- .../libretube/ui/adapters/PlaylistsAdapter.kt | 4 ++-- .../libretube/ui/adapters/SearchAdapter.kt | 4 ++-- .../ui/adapters/SubscriptionChannelAdapter.kt | 4 ++-- .../libretube/ui/adapters/VideosAdapter.kt | 6 +++--- .../libretube/ui/adapters/WatchHistoryAdapter.kt | 4 ++-- .../com/github/libretube/ui/base/BaseActivity.kt | 4 ++-- .../libretube/ui/base/BasePreferenceFragment.kt | 2 +- .../github/libretube/ui/dialogs/BackupDialog.kt | 2 +- .../libretube/ui/dialogs/DeleteAccountDialog.kt | 2 +- .../libretube/ui/dialogs/DeletePlaylistDialog.kt | 2 +- .../libretube/ui/dialogs/DownloadDialog.kt | 2 +- .../github/libretube/ui/dialogs/ErrorDialog.kt | 4 ++-- .../github/libretube/ui/dialogs/LoginDialog.kt | 2 +- .../github/libretube/ui/dialogs/LogoutDialog.kt | 2 +- .../libretube/ui/dialogs/NavBarOptionsDialog.kt | 2 +- .../libretube/ui/dialogs/RequireRestartDialog.kt | 2 +- .../github/libretube/ui/dialogs/ShareDialog.kt | 2 +- .../ui/extensions/SetupNotificationBell.kt | 2 +- .../ui/fragments/AudioPlayerFragment.kt | 6 +++--- .../libretube/ui/fragments/ChannelFragment.kt | 2 +- .../libretube/ui/fragments/DownloadsFragment.kt | 2 +- .../libretube/ui/fragments/HomeFragment.kt | 2 +- .../libretube/ui/fragments/LibraryFragment.kt | 4 ++-- .../libretube/ui/fragments/PlayerFragment.kt | 16 ++++++++-------- .../libretube/ui/fragments/PlaylistFragment.kt | 4 ++-- .../ui/fragments/SearchResultFragment.kt | 2 +- .../ui/fragments/SubscriptionsFragment.kt | 2 +- .../libretube/ui/fragments/TrendsFragment.kt | 2 +- .../ui/fragments/WatchHistoryFragment.kt | 4 ++-- .../listeners}/PlayerGestureController.kt | 3 ++- .../listeners}/SeekbarPreviewListener.kt | 3 ++- .../ui/models/SubscriptionsViewModel.kt | 2 +- .../libretube/ui/preferences/AdvancedSettings.kt | 4 ++-- .../ui/preferences/AppearanceSettings.kt | 2 +- .../ui/preferences/BackupRestoreSettings.kt | 4 ++-- .../libretube/ui/preferences/GeneralSettings.kt | 4 ++-- .../libretube/ui/preferences/InstanceSettings.kt | 2 +- .../ui/preferences/NotificationSettings.kt | 2 +- .../libretube/ui/preferences/PlayerSettings.kt | 4 ++-- .../ui/sheets/ChannelOptionsBottomSheet.kt | 4 ++-- .../libretube/ui/sheets/PlaybackOptionsSheet.kt | 2 +- .../ui/sheets/PlaylistOptionsBottomSheet.kt | 2 +- .../ui/sheets/VideoOptionsBottomSheet.kt | 2 +- .../com/github/libretube/ui/tools/SleepTimer.kt | 2 +- .../github/libretube/ui/views/AppNameTextView.kt | 2 +- .../libretube/ui/views/CustomExoPlayerView.kt | 8 ++++---- .../libretube/ui/views/CustomSwipeToRefresh.kt | 2 +- .../github/libretube/ui/views/MarkableTimeBar.kt | 4 ++-- .../libretube/ui/views/SliderPreference.kt | 2 +- .../libretube/ui/views/TimePickerPreference.kt | 2 +- .../com/github/libretube/util/DataSaverMode.kt | 2 ++ .../github/libretube/util/ExceptionHandler.kt | 2 ++ .../libretube/util/NowPlayingNotification.kt | 2 ++ .../libretube/workers/NotificationWorker.kt | 2 +- 95 files changed, 155 insertions(+), 147 deletions(-) rename app/src/main/java/com/github/libretube/{util => helpers}/AudioHelper.kt (97%) rename app/src/main/java/com/github/libretube/{util => helpers}/BackgroundHelper.kt (98%) rename app/src/main/java/com/github/libretube/{util => helpers}/BackupHelper.kt (99%) rename app/src/main/java/com/github/libretube/{util => helpers}/BrightnessHelper.kt (98%) rename app/src/main/java/com/github/libretube/{util => helpers}/ClipboardHelper.kt (92%) rename app/src/main/java/com/github/libretube/{util => helpers}/DashHelper.kt (99%) rename app/src/main/java/com/github/libretube/{util => helpers}/DownloadHelper.kt (98%) rename app/src/main/java/com/github/libretube/{util => helpers}/ImageHelper.kt (97%) rename app/src/main/java/com/github/libretube/{util => helpers}/ImportHelper.kt (99%) rename app/src/main/java/com/github/libretube/{util => helpers}/LocaleHelper.kt (98%) rename app/src/main/java/com/github/libretube/{util => helpers}/NavBarHelper.kt (99%) rename app/src/main/java/com/github/libretube/{util => helpers}/NavigationHelper.kt (99%) rename app/src/main/java/com/github/libretube/{util => helpers}/NetworkHelper.kt (97%) rename app/src/main/java/com/github/libretube/{util => helpers}/NotificationHelper.kt (98%) rename app/src/main/java/com/github/libretube/{util => helpers}/PlayerHelper.kt (99%) rename app/src/main/java/com/github/libretube/{util => helpers}/PreferenceHelper.kt (99%) rename app/src/main/java/com/github/libretube/{util => helpers}/ProxyHelper.kt (97%) rename app/src/main/java/com/github/libretube/{util => helpers}/ShortcutHelper.kt (97%) rename app/src/main/java/com/github/libretube/{util => helpers}/ThemeHelper.kt (99%) rename app/src/main/java/com/github/libretube/{util => helpers}/WindowHelper.kt (98%) rename app/src/main/java/com/github/libretube/{util => ui/listeners}/PlayerGestureController.kt (98%) rename app/src/main/java/com/github/libretube/{util => ui/listeners}/SeekbarPreviewListener.kt (98%) diff --git a/app/src/main/java/com/github/libretube/LibreTubeApp.kt b/app/src/main/java/com/github/libretube/LibreTubeApp.kt index 791d5771d..48e06da95 100644 --- a/app/src/main/java/com/github/libretube/LibreTubeApp.kt +++ b/app/src/main/java/com/github/libretube/LibreTubeApp.kt @@ -13,11 +13,11 @@ import com.github.libretube.constants.DOWNLOAD_CHANNEL_ID import com.github.libretube.constants.PUSH_CHANNEL_ID import com.github.libretube.db.DatabaseHolder import com.github.libretube.util.ExceptionHandler -import com.github.libretube.util.ImageHelper -import com.github.libretube.util.NotificationHelper -import com.github.libretube.util.PreferenceHelper -import com.github.libretube.util.ProxyHelper -import com.github.libretube.util.ShortcutHelper +import com.github.libretube.helpers.ImageHelper +import com.github.libretube.helpers.NotificationHelper +import com.github.libretube.helpers.PreferenceHelper +import com.github.libretube.helpers.ProxyHelper +import com.github.libretube.helpers.ShortcutHelper class LibreTubeApp : Application() { override fun onCreate() { diff --git a/app/src/main/java/com/github/libretube/api/PlaylistsHelper.kt b/app/src/main/java/com/github/libretube/api/PlaylistsHelper.kt index e5e5db44f..f96a05282 100644 --- a/app/src/main/java/com/github/libretube/api/PlaylistsHelper.kt +++ b/app/src/main/java/com/github/libretube/api/PlaylistsHelper.kt @@ -17,9 +17,8 @@ import com.github.libretube.extensions.toLocalPlaylistItem import com.github.libretube.extensions.toStreamItem import com.github.libretube.extensions.toastFromMainThread import com.github.libretube.obj.ImportPlaylist -import com.github.libretube.util.PreferenceHelper -import com.github.libretube.util.ProxyHelper -import gen._base._base_java__assetres.srcjar.R.id.async +import com.github.libretube.helpers.PreferenceHelper +import com.github.libretube.helpers.ProxyHelper import java.io.IOException import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.async diff --git a/app/src/main/java/com/github/libretube/api/RetrofitInstance.kt b/app/src/main/java/com/github/libretube/api/RetrofitInstance.kt index 743280989..34e852e63 100644 --- a/app/src/main/java/com/github/libretube/api/RetrofitInstance.kt +++ b/app/src/main/java/com/github/libretube/api/RetrofitInstance.kt @@ -2,7 +2,7 @@ package com.github.libretube.api import com.github.libretube.constants.PIPED_API_URL import com.github.libretube.constants.PreferenceKeys -import com.github.libretube.util.PreferenceHelper +import com.github.libretube.helpers.PreferenceHelper import com.jakewharton.retrofit2.converter.kotlinx.serialization.asConverterFactory import okhttp3.MediaType.Companion.toMediaType import retrofit2.Retrofit 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 945020b7a..e2d45fe49 100644 --- a/app/src/main/java/com/github/libretube/api/SubscriptionHelper.kt +++ b/app/src/main/java/com/github/libretube/api/SubscriptionHelper.kt @@ -10,7 +10,7 @@ import com.github.libretube.constants.PreferenceKeys 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.util.PreferenceHelper +import com.github.libretube.helpers.PreferenceHelper import com.google.android.material.dialog.MaterialAlertDialogBuilder import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.runBlocking 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 a71f51057..35b58768a 100644 --- a/app/src/main/java/com/github/libretube/db/DatabaseHelper.kt +++ b/app/src/main/java/com/github/libretube/db/DatabaseHelper.kt @@ -7,7 +7,7 @@ import com.github.libretube.db.obj.SearchHistoryItem import com.github.libretube.db.obj.WatchHistoryItem import com.github.libretube.extensions.query import com.github.libretube.extensions.toID -import com.github.libretube.util.PreferenceHelper +import com.github.libretube.helpers.PreferenceHelper object DatabaseHelper { private const val MAX_SEARCH_HISTORY_SIZE = 20 diff --git a/app/src/main/java/com/github/libretube/extensions/ToStreamItem.kt b/app/src/main/java/com/github/libretube/extensions/ToStreamItem.kt index 7f1e718b7..14b42969e 100644 --- a/app/src/main/java/com/github/libretube/extensions/ToStreamItem.kt +++ b/app/src/main/java/com/github/libretube/extensions/ToStreamItem.kt @@ -3,7 +3,7 @@ package com.github.libretube.extensions import com.github.libretube.api.obj.StreamItem import com.github.libretube.api.obj.Streams import com.github.libretube.db.obj.LocalPlaylistItem -import com.github.libretube.util.ProxyHelper +import com.github.libretube.helpers.ProxyHelper fun Streams.toStreamItem(videoId: String): StreamItem { return StreamItem( diff --git a/app/src/main/java/com/github/libretube/util/AudioHelper.kt b/app/src/main/java/com/github/libretube/helpers/AudioHelper.kt similarity index 97% rename from app/src/main/java/com/github/libretube/util/AudioHelper.kt rename to app/src/main/java/com/github/libretube/helpers/AudioHelper.kt index 603933cd5..d373ac6b3 100644 --- a/app/src/main/java/com/github/libretube/util/AudioHelper.kt +++ b/app/src/main/java/com/github/libretube/helpers/AudioHelper.kt @@ -1,4 +1,4 @@ -package com.github.libretube.util +package com.github.libretube.helpers import android.content.Context import android.media.AudioManager diff --git a/app/src/main/java/com/github/libretube/util/BackgroundHelper.kt b/app/src/main/java/com/github/libretube/helpers/BackgroundHelper.kt similarity index 98% rename from app/src/main/java/com/github/libretube/util/BackgroundHelper.kt rename to app/src/main/java/com/github/libretube/helpers/BackgroundHelper.kt index 77ae845e8..662e29396 100644 --- a/app/src/main/java/com/github/libretube/util/BackgroundHelper.kt +++ b/app/src/main/java/com/github/libretube/helpers/BackgroundHelper.kt @@ -1,4 +1,4 @@ -package com.github.libretube.util +package com.github.libretube.helpers import android.app.ActivityManager import android.content.Context diff --git a/app/src/main/java/com/github/libretube/util/BackupHelper.kt b/app/src/main/java/com/github/libretube/helpers/BackupHelper.kt similarity index 99% rename from app/src/main/java/com/github/libretube/util/BackupHelper.kt rename to app/src/main/java/com/github/libretube/helpers/BackupHelper.kt index fbd324a56..aaa852b55 100644 --- a/app/src/main/java/com/github/libretube/util/BackupHelper.kt +++ b/app/src/main/java/com/github/libretube/helpers/BackupHelper.kt @@ -1,4 +1,4 @@ -package com.github.libretube.util +package com.github.libretube.helpers import android.content.Context import android.net.Uri diff --git a/app/src/main/java/com/github/libretube/util/BrightnessHelper.kt b/app/src/main/java/com/github/libretube/helpers/BrightnessHelper.kt similarity index 98% rename from app/src/main/java/com/github/libretube/util/BrightnessHelper.kt rename to app/src/main/java/com/github/libretube/helpers/BrightnessHelper.kt index 09b3ec427..f96a7b04c 100644 --- a/app/src/main/java/com/github/libretube/util/BrightnessHelper.kt +++ b/app/src/main/java/com/github/libretube/helpers/BrightnessHelper.kt @@ -1,4 +1,4 @@ -package com.github.libretube.util +package com.github.libretube.helpers import android.app.Activity import android.view.WindowManager diff --git a/app/src/main/java/com/github/libretube/util/ClipboardHelper.kt b/app/src/main/java/com/github/libretube/helpers/ClipboardHelper.kt similarity index 92% rename from app/src/main/java/com/github/libretube/util/ClipboardHelper.kt rename to app/src/main/java/com/github/libretube/helpers/ClipboardHelper.kt index 47ad931ff..791b8d3a9 100644 --- a/app/src/main/java/com/github/libretube/util/ClipboardHelper.kt +++ b/app/src/main/java/com/github/libretube/helpers/ClipboardHelper.kt @@ -1,4 +1,4 @@ -package com.github.libretube.util +package com.github.libretube.helpers import android.content.ClipData import android.content.ClipboardManager diff --git a/app/src/main/java/com/github/libretube/util/DashHelper.kt b/app/src/main/java/com/github/libretube/helpers/DashHelper.kt similarity index 99% rename from app/src/main/java/com/github/libretube/util/DashHelper.kt rename to app/src/main/java/com/github/libretube/helpers/DashHelper.kt index 2f44f07e5..f26d7e726 100644 --- a/app/src/main/java/com/github/libretube/util/DashHelper.kt +++ b/app/src/main/java/com/github/libretube/helpers/DashHelper.kt @@ -1,4 +1,4 @@ -package com.github.libretube.util +package com.github.libretube.helpers import com.github.libretube.api.obj.PipedStream import com.github.libretube.api.obj.Streams diff --git a/app/src/main/java/com/github/libretube/util/DownloadHelper.kt b/app/src/main/java/com/github/libretube/helpers/DownloadHelper.kt similarity index 98% rename from app/src/main/java/com/github/libretube/util/DownloadHelper.kt rename to app/src/main/java/com/github/libretube/helpers/DownloadHelper.kt index a9f513519..fcf315785 100644 --- a/app/src/main/java/com/github/libretube/util/DownloadHelper.kt +++ b/app/src/main/java/com/github/libretube/helpers/DownloadHelper.kt @@ -1,4 +1,4 @@ -package com.github.libretube.util +package com.github.libretube.helpers import android.content.Context import android.content.Intent diff --git a/app/src/main/java/com/github/libretube/util/ImageHelper.kt b/app/src/main/java/com/github/libretube/helpers/ImageHelper.kt similarity index 97% rename from app/src/main/java/com/github/libretube/util/ImageHelper.kt rename to app/src/main/java/com/github/libretube/helpers/ImageHelper.kt index 31fc77438..a5151d44f 100644 --- a/app/src/main/java/com/github/libretube/util/ImageHelper.kt +++ b/app/src/main/java/com/github/libretube/helpers/ImageHelper.kt @@ -1,4 +1,4 @@ -package com.github.libretube.util +package com.github.libretube.helpers import android.content.Context import android.graphics.Bitmap @@ -13,6 +13,7 @@ import coil.request.CachePolicy import coil.request.ImageRequest import com.github.libretube.api.CronetHelper import com.github.libretube.constants.PreferenceKeys +import com.github.libretube.util.DataSaverMode import java.io.File import java.io.FileOutputStream import okio.use diff --git a/app/src/main/java/com/github/libretube/util/ImportHelper.kt b/app/src/main/java/com/github/libretube/helpers/ImportHelper.kt similarity index 99% rename from app/src/main/java/com/github/libretube/util/ImportHelper.kt rename to app/src/main/java/com/github/libretube/helpers/ImportHelper.kt index 7855e18a2..5ad42edef 100644 --- a/app/src/main/java/com/github/libretube/util/ImportHelper.kt +++ b/app/src/main/java/com/github/libretube/helpers/ImportHelper.kt @@ -1,4 +1,4 @@ -package com.github.libretube.util +package com.github.libretube.helpers import android.app.Activity import android.net.Uri diff --git a/app/src/main/java/com/github/libretube/util/LocaleHelper.kt b/app/src/main/java/com/github/libretube/helpers/LocaleHelper.kt similarity index 98% rename from app/src/main/java/com/github/libretube/util/LocaleHelper.kt rename to app/src/main/java/com/github/libretube/helpers/LocaleHelper.kt index 9f28e1915..f6d65cd25 100644 --- a/app/src/main/java/com/github/libretube/util/LocaleHelper.kt +++ b/app/src/main/java/com/github/libretube/helpers/LocaleHelper.kt @@ -1,4 +1,4 @@ -package com.github.libretube.util +package com.github.libretube.helpers import android.content.Context import android.content.res.Configuration diff --git a/app/src/main/java/com/github/libretube/util/NavBarHelper.kt b/app/src/main/java/com/github/libretube/helpers/NavBarHelper.kt similarity index 99% rename from app/src/main/java/com/github/libretube/util/NavBarHelper.kt rename to app/src/main/java/com/github/libretube/helpers/NavBarHelper.kt index 4e7d61d96..e2788b5b3 100644 --- a/app/src/main/java/com/github/libretube/util/NavBarHelper.kt +++ b/app/src/main/java/com/github/libretube/helpers/NavBarHelper.kt @@ -1,4 +1,4 @@ -package com.github.libretube.util +package com.github.libretube.helpers import android.content.Context import android.util.Log diff --git a/app/src/main/java/com/github/libretube/util/NavigationHelper.kt b/app/src/main/java/com/github/libretube/helpers/NavigationHelper.kt similarity index 99% rename from app/src/main/java/com/github/libretube/util/NavigationHelper.kt rename to app/src/main/java/com/github/libretube/helpers/NavigationHelper.kt index 07d59eb33..d8449d216 100644 --- a/app/src/main/java/com/github/libretube/util/NavigationHelper.kt +++ b/app/src/main/java/com/github/libretube/helpers/NavigationHelper.kt @@ -1,4 +1,4 @@ -package com.github.libretube.util +package com.github.libretube.helpers import android.app.NotificationManager import android.content.Context diff --git a/app/src/main/java/com/github/libretube/util/NetworkHelper.kt b/app/src/main/java/com/github/libretube/helpers/NetworkHelper.kt similarity index 97% rename from app/src/main/java/com/github/libretube/util/NetworkHelper.kt rename to app/src/main/java/com/github/libretube/helpers/NetworkHelper.kt index 757fc584c..8f303230e 100644 --- a/app/src/main/java/com/github/libretube/util/NetworkHelper.kt +++ b/app/src/main/java/com/github/libretube/helpers/NetworkHelper.kt @@ -1,4 +1,4 @@ -package com.github.libretube.util +package com.github.libretube.helpers import android.content.Context import android.net.ConnectivityManager diff --git a/app/src/main/java/com/github/libretube/util/NotificationHelper.kt b/app/src/main/java/com/github/libretube/helpers/NotificationHelper.kt similarity index 98% rename from app/src/main/java/com/github/libretube/util/NotificationHelper.kt rename to app/src/main/java/com/github/libretube/helpers/NotificationHelper.kt index 04dd98243..6745abbb9 100644 --- a/app/src/main/java/com/github/libretube/util/NotificationHelper.kt +++ b/app/src/main/java/com/github/libretube/helpers/NotificationHelper.kt @@ -1,4 +1,4 @@ -package com.github.libretube.util +package com.github.libretube.helpers import android.content.Context import androidx.work.Constraints diff --git a/app/src/main/java/com/github/libretube/util/PlayerHelper.kt b/app/src/main/java/com/github/libretube/helpers/PlayerHelper.kt similarity index 99% rename from app/src/main/java/com/github/libretube/util/PlayerHelper.kt rename to app/src/main/java/com/github/libretube/helpers/PlayerHelper.kt index 91bf6b7b5..915bd7c40 100644 --- a/app/src/main/java/com/github/libretube/util/PlayerHelper.kt +++ b/app/src/main/java/com/github/libretube/helpers/PlayerHelper.kt @@ -1,4 +1,4 @@ -package com.github.libretube.util +package com.github.libretube.helpers import android.app.Activity import android.app.PendingIntent diff --git a/app/src/main/java/com/github/libretube/util/PreferenceHelper.kt b/app/src/main/java/com/github/libretube/helpers/PreferenceHelper.kt similarity index 99% rename from app/src/main/java/com/github/libretube/util/PreferenceHelper.kt rename to app/src/main/java/com/github/libretube/helpers/PreferenceHelper.kt index d72174b5a..c3f54fb8a 100644 --- a/app/src/main/java/com/github/libretube/util/PreferenceHelper.kt +++ b/app/src/main/java/com/github/libretube/helpers/PreferenceHelper.kt @@ -1,4 +1,4 @@ -package com.github.libretube.util +package com.github.libretube.helpers import android.content.Context import android.content.SharedPreferences diff --git a/app/src/main/java/com/github/libretube/util/ProxyHelper.kt b/app/src/main/java/com/github/libretube/helpers/ProxyHelper.kt similarity index 97% rename from app/src/main/java/com/github/libretube/util/ProxyHelper.kt rename to app/src/main/java/com/github/libretube/helpers/ProxyHelper.kt index b91a354a5..a1f05117d 100644 --- a/app/src/main/java/com/github/libretube/util/ProxyHelper.kt +++ b/app/src/main/java/com/github/libretube/helpers/ProxyHelper.kt @@ -1,4 +1,4 @@ -package com.github.libretube.util +package com.github.libretube.helpers import com.github.libretube.api.RetrofitInstance import com.github.libretube.constants.PreferenceKeys diff --git a/app/src/main/java/com/github/libretube/util/ShortcutHelper.kt b/app/src/main/java/com/github/libretube/helpers/ShortcutHelper.kt similarity index 97% rename from app/src/main/java/com/github/libretube/util/ShortcutHelper.kt rename to app/src/main/java/com/github/libretube/helpers/ShortcutHelper.kt index ea1b14279..5f66735bb 100644 --- a/app/src/main/java/com/github/libretube/util/ShortcutHelper.kt +++ b/app/src/main/java/com/github/libretube/helpers/ShortcutHelper.kt @@ -1,4 +1,4 @@ -package com.github.libretube.util +package com.github.libretube.helpers import android.content.Context import android.content.Intent diff --git a/app/src/main/java/com/github/libretube/util/ThemeHelper.kt b/app/src/main/java/com/github/libretube/helpers/ThemeHelper.kt similarity index 99% rename from app/src/main/java/com/github/libretube/util/ThemeHelper.kt rename to app/src/main/java/com/github/libretube/helpers/ThemeHelper.kt index b75544bd8..1796966c8 100644 --- a/app/src/main/java/com/github/libretube/util/ThemeHelper.kt +++ b/app/src/main/java/com/github/libretube/helpers/ThemeHelper.kt @@ -1,4 +1,4 @@ -package com.github.libretube.util +package com.github.libretube.helpers import android.app.Activity import android.content.ComponentName diff --git a/app/src/main/java/com/github/libretube/util/WindowHelper.kt b/app/src/main/java/com/github/libretube/helpers/WindowHelper.kt similarity index 98% rename from app/src/main/java/com/github/libretube/util/WindowHelper.kt rename to app/src/main/java/com/github/libretube/helpers/WindowHelper.kt index 3a36279d2..3220320c8 100644 --- a/app/src/main/java/com/github/libretube/util/WindowHelper.kt +++ b/app/src/main/java/com/github/libretube/helpers/WindowHelper.kt @@ -1,4 +1,4 @@ -package com.github.libretube.util +package com.github.libretube.helpers import android.os.Build import android.view.WindowManager 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 d1413db69..fd6fa630b 100644 --- a/app/src/main/java/com/github/libretube/services/BackgroundMode.kt +++ b/app/src/main/java/com/github/libretube/services/BackgroundMode.kt @@ -30,8 +30,8 @@ import com.github.libretube.extensions.query import com.github.libretube.extensions.toID import com.github.libretube.extensions.toStreamItem import com.github.libretube.util.NowPlayingNotification -import com.github.libretube.util.PlayerHelper -import com.github.libretube.util.PlayerHelper.loadPlaybackParams +import com.github.libretube.helpers.PlayerHelper +import com.github.libretube.helpers.PlayerHelper.loadPlaybackParams import com.github.libretube.util.PlayingQueue import com.google.android.exoplayer2.ExoPlayer import com.google.android.exoplayer2.MediaItem diff --git a/app/src/main/java/com/github/libretube/services/DownloadService.kt b/app/src/main/java/com/github/libretube/services/DownloadService.kt index 64a75c03a..2fd5d8f07 100644 --- a/app/src/main/java/com/github/libretube/services/DownloadService.kt +++ b/app/src/main/java/com/github/libretube/services/DownloadService.kt @@ -30,9 +30,9 @@ import com.github.libretube.receivers.NotificationReceiver import com.github.libretube.receivers.NotificationReceiver.Companion.ACTION_DOWNLOAD_PAUSE import com.github.libretube.receivers.NotificationReceiver.Companion.ACTION_DOWNLOAD_RESUME import com.github.libretube.ui.activities.MainActivity -import com.github.libretube.util.DownloadHelper -import com.github.libretube.util.DownloadHelper.getNotificationId -import com.github.libretube.util.ImageHelper +import com.github.libretube.helpers.DownloadHelper +import com.github.libretube.helpers.DownloadHelper.getNotificationId +import com.github.libretube.helpers.ImageHelper import java.io.File import java.net.HttpURLConnection import java.net.SocketTimeoutException 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 ba836c593..9ed9be389 100644 --- a/app/src/main/java/com/github/libretube/services/UpdateService.kt +++ b/app/src/main/java/com/github/libretube/services/UpdateService.kt @@ -11,7 +11,7 @@ import android.os.Environment import android.os.IBinder import android.widget.Toast import com.github.libretube.R -import com.github.libretube.util.DownloadHelper +import com.github.libretube.helpers.DownloadHelper import java.io.File class UpdateService : Service() { 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 05f4d25e5..364742269 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 @@ -36,12 +36,12 @@ import com.github.libretube.ui.models.PlayerViewModel import com.github.libretube.ui.models.SearchViewModel import com.github.libretube.ui.models.SubscriptionsViewModel import com.github.libretube.ui.tools.SleepTimer -import com.github.libretube.util.NavBarHelper -import com.github.libretube.util.NavigationHelper -import com.github.libretube.util.NetworkHelper -import com.github.libretube.util.PreferenceHelper -import com.github.libretube.util.ThemeHelper -import com.github.libretube.util.WindowHelper +import com.github.libretube.helpers.NavBarHelper +import com.github.libretube.helpers.NavigationHelper +import com.github.libretube.helpers.NetworkHelper +import com.github.libretube.helpers.PreferenceHelper +import com.github.libretube.helpers.ThemeHelper +import com.github.libretube.helpers.WindowHelper import com.google.android.material.elevation.SurfaceColors class MainActivity : BaseActivity() { diff --git a/app/src/main/java/com/github/libretube/ui/activities/NoInternetActivity.kt b/app/src/main/java/com/github/libretube/ui/activities/NoInternetActivity.kt index 4ab4ce987..06339f0fd 100644 --- a/app/src/main/java/com/github/libretube/ui/activities/NoInternetActivity.kt +++ b/app/src/main/java/com/github/libretube/ui/activities/NoInternetActivity.kt @@ -8,8 +8,8 @@ import com.github.libretube.R import com.github.libretube.databinding.ActivityNointernetBinding import com.github.libretube.ui.base.BaseActivity import com.github.libretube.ui.fragments.DownloadsFragment -import com.github.libretube.util.NavigationHelper -import com.github.libretube.util.NetworkHelper +import com.github.libretube.helpers.NavigationHelper +import com.github.libretube.helpers.NetworkHelper import com.google.android.material.snackbar.Snackbar class NoInternetActivity : BaseActivity() { diff --git a/app/src/main/java/com/github/libretube/ui/activities/OfflinePlayerActivity.kt b/app/src/main/java/com/github/libretube/ui/activities/OfflinePlayerActivity.kt index d56276ea0..2d192ce6d 100644 --- a/app/src/main/java/com/github/libretube/ui/activities/OfflinePlayerActivity.kt +++ b/app/src/main/java/com/github/libretube/ui/activities/OfflinePlayerActivity.kt @@ -19,9 +19,9 @@ import com.github.libretube.extensions.updateParameters import com.github.libretube.ui.base.BaseActivity import com.github.libretube.ui.extensions.setAspectRatio import com.github.libretube.ui.models.PlayerViewModel -import com.github.libretube.util.PlayerHelper -import com.github.libretube.util.PlayerHelper.loadPlaybackParams -import com.github.libretube.util.WindowHelper +import com.github.libretube.helpers.PlayerHelper +import com.github.libretube.helpers.PlayerHelper.loadPlaybackParams +import com.github.libretube.helpers.WindowHelper import com.google.android.exoplayer2.C import com.google.android.exoplayer2.ExoPlayer import com.google.android.exoplayer2.MediaItem diff --git a/app/src/main/java/com/github/libretube/ui/activities/RouterActivity.kt b/app/src/main/java/com/github/libretube/ui/activities/RouterActivity.kt index 1af65395b..bae5a0ca8 100644 --- a/app/src/main/java/com/github/libretube/ui/activities/RouterActivity.kt +++ b/app/src/main/java/com/github/libretube/ui/activities/RouterActivity.kt @@ -8,7 +8,7 @@ import android.util.Log import com.github.libretube.constants.IntentData import com.github.libretube.extensions.TAG import com.github.libretube.ui.base.BaseActivity -import com.github.libretube.util.NavigationHelper +import com.github.libretube.helpers.NavigationHelper import com.github.libretube.util.TextUtils class RouterActivity : BaseActivity() { 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 8b7f64a68..a7b628c85 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 @@ -8,8 +8,8 @@ import androidx.recyclerview.widget.RecyclerView import com.github.libretube.api.obj.ChapterSegment import com.github.libretube.databinding.ChapterColumnBinding import com.github.libretube.ui.viewholders.ChaptersViewHolder -import com.github.libretube.util.ImageHelper -import com.github.libretube.util.ThemeHelper +import com.github.libretube.helpers.ImageHelper +import com.github.libretube.helpers.ThemeHelper import com.google.android.exoplayer2.ExoPlayer class ChaptersAdapter( 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 c1979eea1..bb8ba390f 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 @@ -21,11 +21,11 @@ import com.github.libretube.databinding.CommentsRowBinding import com.github.libretube.extensions.formatShort import com.github.libretube.ui.fragments.CommentsRepliesFragment import com.github.libretube.ui.viewholders.CommentsViewHolder -import com.github.libretube.util.ClipboardHelper -import com.github.libretube.util.ImageHelper -import com.github.libretube.util.NavigationHelper +import com.github.libretube.helpers.ClipboardHelper +import com.github.libretube.helpers.ImageHelper +import com.github.libretube.helpers.NavigationHelper import com.github.libretube.util.TextUtils -import com.github.libretube.util.ThemeHelper +import com.github.libretube.helpers.ThemeHelper class CommentsAdapter( private val fragment: Fragment?, 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 a61a25b07..72b1cd834 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 @@ -16,7 +16,7 @@ import com.github.libretube.extensions.formatAsFileSize import com.github.libretube.extensions.query import com.github.libretube.ui.activities.OfflinePlayerActivity import com.github.libretube.ui.viewholders.DownloadsViewHolder -import com.github.libretube.util.ImageHelper +import com.github.libretube.helpers.ImageHelper import com.google.android.material.dialog.MaterialAlertDialogBuilder import java.io.File diff --git a/app/src/main/java/com/github/libretube/ui/adapters/IconsSheetAdapter.kt b/app/src/main/java/com/github/libretube/ui/adapters/IconsSheetAdapter.kt index a1805b683..3d14cc083 100644 --- a/app/src/main/java/com/github/libretube/ui/adapters/IconsSheetAdapter.kt +++ b/app/src/main/java/com/github/libretube/ui/adapters/IconsSheetAdapter.kt @@ -9,8 +9,8 @@ import com.github.libretube.R import com.github.libretube.constants.PreferenceKeys import com.github.libretube.databinding.AppIconItemBinding import com.github.libretube.ui.viewholders.IconsSheetViewHolder -import com.github.libretube.util.PreferenceHelper -import com.github.libretube.util.ThemeHelper +import com.github.libretube.helpers.PreferenceHelper +import com.github.libretube.helpers.ThemeHelper class IconsSheetAdapter : RecyclerView.Adapter() { override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): IconsSheetViewHolder { 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 d339f00ba..da2242be9 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 @@ -8,8 +8,8 @@ import com.github.libretube.extensions.toID import com.github.libretube.ui.base.BaseActivity import com.github.libretube.ui.sheets.ChannelOptionsBottomSheet import com.github.libretube.ui.viewholders.LegacySubscriptionViewHolder -import com.github.libretube.util.ImageHelper -import com.github.libretube.util.NavigationHelper +import com.github.libretube.helpers.ImageHelper +import com.github.libretube.helpers.NavigationHelper class LegacySubscriptionAdapter( private val subscriptions: List diff --git a/app/src/main/java/com/github/libretube/ui/adapters/PlayingQueueAdapter.kt b/app/src/main/java/com/github/libretube/ui/adapters/PlayingQueueAdapter.kt index d0875c073..2a2bb18b3 100644 --- a/app/src/main/java/com/github/libretube/ui/adapters/PlayingQueueAdapter.kt +++ b/app/src/main/java/com/github/libretube/ui/adapters/PlayingQueueAdapter.kt @@ -9,9 +9,9 @@ import androidx.recyclerview.widget.RecyclerView import com.github.libretube.databinding.QueueRowBinding import com.github.libretube.extensions.toID import com.github.libretube.ui.viewholders.PlayingQueueViewHolder -import com.github.libretube.util.ImageHelper +import com.github.libretube.helpers.ImageHelper import com.github.libretube.util.PlayingQueue -import com.github.libretube.util.ThemeHelper +import com.github.libretube.helpers.ThemeHelper class PlayingQueueAdapter : RecyclerView.Adapter() { 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 e3302049f..0285534a4 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 @@ -18,8 +18,8 @@ import com.github.libretube.ui.extensions.setFormattedDuration import com.github.libretube.ui.extensions.setWatchProgressLength import com.github.libretube.ui.sheets.VideoOptionsBottomSheet import com.github.libretube.ui.viewholders.PlaylistViewHolder -import com.github.libretube.util.ImageHelper -import com.github.libretube.util.NavigationHelper +import com.github.libretube.helpers.ImageHelper +import com.github.libretube.helpers.NavigationHelper import java.io.IOException import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Dispatchers diff --git a/app/src/main/java/com/github/libretube/ui/adapters/PlaylistBookmarkAdapter.kt b/app/src/main/java/com/github/libretube/ui/adapters/PlaylistBookmarkAdapter.kt index 08863c48c..a7fcef33c 100644 --- a/app/src/main/java/com/github/libretube/ui/adapters/PlaylistBookmarkAdapter.kt +++ b/app/src/main/java/com/github/libretube/ui/adapters/PlaylistBookmarkAdapter.kt @@ -14,8 +14,8 @@ import com.github.libretube.enums.PlaylistType import com.github.libretube.extensions.query import com.github.libretube.ui.sheets.PlaylistOptionsBottomSheet import com.github.libretube.ui.viewholders.PlaylistBookmarkViewHolder -import com.github.libretube.util.ImageHelper -import com.github.libretube.util.NavigationHelper +import com.github.libretube.helpers.ImageHelper +import com.github.libretube.helpers.NavigationHelper class PlaylistBookmarkAdapter( private val bookmarks: List, 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 4c4f4b7b6..a3cf346cd 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 @@ -11,8 +11,8 @@ import com.github.libretube.ui.base.BaseActivity import com.github.libretube.ui.dialogs.DeletePlaylistDialog import com.github.libretube.ui.sheets.PlaylistOptionsBottomSheet import com.github.libretube.ui.viewholders.PlaylistsViewHolder -import com.github.libretube.util.ImageHelper -import com.github.libretube.util.NavigationHelper +import com.github.libretube.helpers.ImageHelper +import com.github.libretube.helpers.NavigationHelper class PlaylistsAdapter( private val playlists: MutableList, 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 c99229616..eefc2683e 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 @@ -21,8 +21,8 @@ import com.github.libretube.ui.sheets.ChannelOptionsBottomSheet import com.github.libretube.ui.sheets.PlaylistOptionsBottomSheet import com.github.libretube.ui.sheets.VideoOptionsBottomSheet import com.github.libretube.ui.viewholders.SearchViewHolder -import com.github.libretube.util.ImageHelper -import com.github.libretube.util.NavigationHelper +import com.github.libretube.helpers.ImageHelper +import com.github.libretube.helpers.NavigationHelper import com.github.libretube.util.TextUtils class SearchAdapter( 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 c0e2c37e1..104e7cab7 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 @@ -10,8 +10,8 @@ import com.github.libretube.ui.base.BaseActivity import com.github.libretube.ui.extensions.setupSubscriptionButton import com.github.libretube.ui.sheets.ChannelOptionsBottomSheet import com.github.libretube.ui.viewholders.SubscriptionChannelViewHolder -import com.github.libretube.util.ImageHelper -import com.github.libretube.util.NavigationHelper +import com.github.libretube.helpers.ImageHelper +import com.github.libretube.helpers.NavigationHelper class SubscriptionChannelAdapter( private val subscriptions: MutableList diff --git a/app/src/main/java/com/github/libretube/ui/adapters/VideosAdapter.kt b/app/src/main/java/com/github/libretube/ui/adapters/VideosAdapter.kt index 326edefd5..ddbdbd791 100644 --- a/app/src/main/java/com/github/libretube/ui/adapters/VideosAdapter.kt +++ b/app/src/main/java/com/github/libretube/ui/adapters/VideosAdapter.kt @@ -25,9 +25,9 @@ import com.github.libretube.ui.extensions.setFormattedDuration import com.github.libretube.ui.extensions.setWatchProgressLength import com.github.libretube.ui.sheets.VideoOptionsBottomSheet import com.github.libretube.ui.viewholders.VideosViewHolder -import com.github.libretube.util.ImageHelper -import com.github.libretube.util.NavigationHelper -import com.github.libretube.util.PreferenceHelper +import com.github.libretube.helpers.ImageHelper +import com.github.libretube.helpers.NavigationHelper +import com.github.libretube.helpers.PreferenceHelper import com.github.libretube.util.TextUtils class VideosAdapter( diff --git a/app/src/main/java/com/github/libretube/ui/adapters/WatchHistoryAdapter.kt b/app/src/main/java/com/github/libretube/ui/adapters/WatchHistoryAdapter.kt index 3359efefe..7378b42fe 100644 --- a/app/src/main/java/com/github/libretube/ui/adapters/WatchHistoryAdapter.kt +++ b/app/src/main/java/com/github/libretube/ui/adapters/WatchHistoryAdapter.kt @@ -13,8 +13,8 @@ import com.github.libretube.ui.extensions.setFormattedDuration import com.github.libretube.ui.extensions.setWatchProgressLength import com.github.libretube.ui.sheets.VideoOptionsBottomSheet import com.github.libretube.ui.viewholders.WatchHistoryViewHolder -import com.github.libretube.util.ImageHelper -import com.github.libretube.util.NavigationHelper +import com.github.libretube.helpers.ImageHelper +import com.github.libretube.helpers.NavigationHelper class WatchHistoryAdapter( private val watchHistory: MutableList diff --git a/app/src/main/java/com/github/libretube/ui/base/BaseActivity.kt b/app/src/main/java/com/github/libretube/ui/base/BaseActivity.kt index 189aad047..c56566e63 100644 --- a/app/src/main/java/com/github/libretube/ui/base/BaseActivity.kt +++ b/app/src/main/java/com/github/libretube/ui/base/BaseActivity.kt @@ -2,8 +2,8 @@ package com.github.libretube.ui.base import android.os.Bundle import androidx.appcompat.app.AppCompatActivity -import com.github.libretube.util.LocaleHelper -import com.github.libretube.util.ThemeHelper +import com.github.libretube.helpers.LocaleHelper +import com.github.libretube.helpers.ThemeHelper /** * Activity that applies the LibreTube theme and the in-app language diff --git a/app/src/main/java/com/github/libretube/ui/base/BasePreferenceFragment.kt b/app/src/main/java/com/github/libretube/ui/base/BasePreferenceFragment.kt index 49879195d..1c58428b1 100644 --- a/app/src/main/java/com/github/libretube/ui/base/BasePreferenceFragment.kt +++ b/app/src/main/java/com/github/libretube/ui/base/BasePreferenceFragment.kt @@ -8,7 +8,7 @@ import androidx.preference.PreferenceFragmentCompat import com.github.libretube.R import com.github.libretube.databinding.DialogTextPreferenceBinding import com.github.libretube.ui.activities.SettingsActivity -import com.github.libretube.util.PreferenceHelper +import com.github.libretube.helpers.PreferenceHelper import com.google.android.material.dialog.MaterialAlertDialogBuilder /** diff --git a/app/src/main/java/com/github/libretube/ui/dialogs/BackupDialog.kt b/app/src/main/java/com/github/libretube/ui/dialogs/BackupDialog.kt index ae0ce72b5..858550188 100644 --- a/app/src/main/java/com/github/libretube/ui/dialogs/BackupDialog.kt +++ b/app/src/main/java/com/github/libretube/ui/dialogs/BackupDialog.kt @@ -9,7 +9,7 @@ import com.github.libretube.R import com.github.libretube.db.DatabaseHolder.Companion.Database import com.github.libretube.obj.BackupFile import com.github.libretube.obj.PreferenceItem -import com.github.libretube.util.PreferenceHelper +import com.github.libretube.helpers.PreferenceHelper import com.google.android.material.dialog.MaterialAlertDialogBuilder import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch diff --git a/app/src/main/java/com/github/libretube/ui/dialogs/DeleteAccountDialog.kt b/app/src/main/java/com/github/libretube/ui/dialogs/DeleteAccountDialog.kt index c08746e62..295a91bbd 100644 --- a/app/src/main/java/com/github/libretube/ui/dialogs/DeleteAccountDialog.kt +++ b/app/src/main/java/com/github/libretube/ui/dialogs/DeleteAccountDialog.kt @@ -12,7 +12,7 @@ import com.github.libretube.api.RetrofitInstance import com.github.libretube.api.obj.DeleteUserRequest import com.github.libretube.databinding.DialogDeleteAccountBinding import com.github.libretube.extensions.TAG -import com.github.libretube.util.PreferenceHelper +import com.github.libretube.helpers.PreferenceHelper import com.google.android.material.dialog.MaterialAlertDialogBuilder class DeleteAccountDialog : DialogFragment() { diff --git a/app/src/main/java/com/github/libretube/ui/dialogs/DeletePlaylistDialog.kt b/app/src/main/java/com/github/libretube/ui/dialogs/DeletePlaylistDialog.kt index 9c0f92652..01bef8455 100644 --- a/app/src/main/java/com/github/libretube/ui/dialogs/DeletePlaylistDialog.kt +++ b/app/src/main/java/com/github/libretube/ui/dialogs/DeletePlaylistDialog.kt @@ -11,7 +11,7 @@ import com.github.libretube.api.obj.PlaylistId import com.github.libretube.db.DatabaseHolder import com.github.libretube.enums.PlaylistType import com.github.libretube.extensions.TAG -import com.github.libretube.util.PreferenceHelper +import com.github.libretube.helpers.PreferenceHelper import com.google.android.material.dialog.MaterialAlertDialogBuilder import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch diff --git a/app/src/main/java/com/github/libretube/ui/dialogs/DownloadDialog.kt b/app/src/main/java/com/github/libretube/ui/dialogs/DownloadDialog.kt index e165e1f47..7aa5a33e1 100644 --- a/app/src/main/java/com/github/libretube/ui/dialogs/DownloadDialog.kt +++ b/app/src/main/java/com/github/libretube/ui/dialogs/DownloadDialog.kt @@ -15,7 +15,7 @@ import com.github.libretube.api.RetrofitInstance import com.github.libretube.api.obj.Streams import com.github.libretube.databinding.DialogDownloadBinding import com.github.libretube.extensions.TAG -import com.github.libretube.util.DownloadHelper +import com.github.libretube.helpers.DownloadHelper import com.github.libretube.util.TextUtils import com.google.android.material.dialog.MaterialAlertDialogBuilder import java.io.IOException diff --git a/app/src/main/java/com/github/libretube/ui/dialogs/ErrorDialog.kt b/app/src/main/java/com/github/libretube/ui/dialogs/ErrorDialog.kt index 68a154997..8d3de5b60 100644 --- a/app/src/main/java/com/github/libretube/ui/dialogs/ErrorDialog.kt +++ b/app/src/main/java/com/github/libretube/ui/dialogs/ErrorDialog.kt @@ -6,8 +6,8 @@ import android.os.Bundle import android.widget.Toast import androidx.fragment.app.DialogFragment import com.github.libretube.R -import com.github.libretube.util.ClipboardHelper -import com.github.libretube.util.PreferenceHelper +import com.github.libretube.helpers.ClipboardHelper +import com.github.libretube.helpers.PreferenceHelper import com.google.android.material.dialog.MaterialAlertDialogBuilder class ErrorDialog : DialogFragment() { diff --git a/app/src/main/java/com/github/libretube/ui/dialogs/LoginDialog.kt b/app/src/main/java/com/github/libretube/ui/dialogs/LoginDialog.kt index 5281ed074..9a6afdeeb 100644 --- a/app/src/main/java/com/github/libretube/ui/dialogs/LoginDialog.kt +++ b/app/src/main/java/com/github/libretube/ui/dialogs/LoginDialog.kt @@ -12,7 +12,7 @@ import com.github.libretube.api.RetrofitInstance import com.github.libretube.api.obj.Login import com.github.libretube.databinding.DialogLoginBinding import com.github.libretube.extensions.TAG -import com.github.libretube.util.PreferenceHelper +import com.github.libretube.helpers.PreferenceHelper import com.github.libretube.util.TextUtils import com.google.android.material.dialog.MaterialAlertDialogBuilder diff --git a/app/src/main/java/com/github/libretube/ui/dialogs/LogoutDialog.kt b/app/src/main/java/com/github/libretube/ui/dialogs/LogoutDialog.kt index 72f7d730b..3d48aacf5 100644 --- a/app/src/main/java/com/github/libretube/ui/dialogs/LogoutDialog.kt +++ b/app/src/main/java/com/github/libretube/ui/dialogs/LogoutDialog.kt @@ -8,7 +8,7 @@ import androidx.core.app.ActivityCompat import androidx.fragment.app.DialogFragment import com.github.libretube.R import com.github.libretube.databinding.DialogLogoutBinding -import com.github.libretube.util.PreferenceHelper +import com.github.libretube.helpers.PreferenceHelper import com.google.android.material.dialog.MaterialAlertDialogBuilder class LogoutDialog : DialogFragment() { diff --git a/app/src/main/java/com/github/libretube/ui/dialogs/NavBarOptionsDialog.kt b/app/src/main/java/com/github/libretube/ui/dialogs/NavBarOptionsDialog.kt index deb142297..30bcb73e5 100644 --- a/app/src/main/java/com/github/libretube/ui/dialogs/NavBarOptionsDialog.kt +++ b/app/src/main/java/com/github/libretube/ui/dialogs/NavBarOptionsDialog.kt @@ -9,7 +9,7 @@ import androidx.recyclerview.widget.RecyclerView import com.github.libretube.R import com.github.libretube.databinding.DialogNavbarOptionsBinding import com.github.libretube.ui.adapters.NavBarOptionsAdapter -import com.github.libretube.util.NavBarHelper +import com.github.libretube.helpers.NavBarHelper import com.google.android.material.dialog.MaterialAlertDialogBuilder class NavBarOptionsDialog : DialogFragment() { diff --git a/app/src/main/java/com/github/libretube/ui/dialogs/RequireRestartDialog.kt b/app/src/main/java/com/github/libretube/ui/dialogs/RequireRestartDialog.kt index 5011d2657..cf245f828 100644 --- a/app/src/main/java/com/github/libretube/ui/dialogs/RequireRestartDialog.kt +++ b/app/src/main/java/com/github/libretube/ui/dialogs/RequireRestartDialog.kt @@ -5,7 +5,7 @@ import android.os.Bundle import androidx.core.app.ActivityCompat import androidx.fragment.app.DialogFragment import com.github.libretube.R -import com.github.libretube.util.NavigationHelper +import com.github.libretube.helpers.NavigationHelper import com.google.android.material.dialog.MaterialAlertDialogBuilder class RequireRestartDialog : DialogFragment() { diff --git a/app/src/main/java/com/github/libretube/ui/dialogs/ShareDialog.kt b/app/src/main/java/com/github/libretube/ui/dialogs/ShareDialog.kt index 67fbcf391..700e3ef8f 100644 --- a/app/src/main/java/com/github/libretube/ui/dialogs/ShareDialog.kt +++ b/app/src/main/java/com/github/libretube/ui/dialogs/ShareDialog.kt @@ -14,7 +14,7 @@ import com.github.libretube.db.DatabaseHolder.Companion.Database import com.github.libretube.enums.ShareObjectType import com.github.libretube.extensions.awaitQuery import com.github.libretube.obj.ShareData -import com.github.libretube.util.PreferenceHelper +import com.github.libretube.helpers.PreferenceHelper import com.google.android.material.dialog.MaterialAlertDialogBuilder class ShareDialog( diff --git a/app/src/main/java/com/github/libretube/ui/extensions/SetupNotificationBell.kt b/app/src/main/java/com/github/libretube/ui/extensions/SetupNotificationBell.kt index 335192635..854569d98 100644 --- a/app/src/main/java/com/github/libretube/ui/extensions/SetupNotificationBell.kt +++ b/app/src/main/java/com/github/libretube/ui/extensions/SetupNotificationBell.kt @@ -1,7 +1,7 @@ package com.github.libretube.ui.extensions import com.github.libretube.R -import com.github.libretube.util.PreferenceHelper +import com.github.libretube.helpers.PreferenceHelper import com.google.android.material.button.MaterialButton fun MaterialButton.setupNotificationBell(channelId: String) { diff --git a/app/src/main/java/com/github/libretube/ui/fragments/AudioPlayerFragment.kt b/app/src/main/java/com/github/libretube/ui/fragments/AudioPlayerFragment.kt index 40512ce0c..93a6a39b9 100644 --- a/app/src/main/java/com/github/libretube/ui/fragments/AudioPlayerFragment.kt +++ b/app/src/main/java/com/github/libretube/ui/fragments/AudioPlayerFragment.kt @@ -26,9 +26,9 @@ import com.github.libretube.ui.dialogs.ShareDialog import com.github.libretube.ui.sheets.PlaybackOptionsSheet import com.github.libretube.ui.sheets.PlayingQueueSheet import com.github.libretube.ui.sheets.VideoOptionsBottomSheet -import com.github.libretube.util.BackgroundHelper -import com.github.libretube.util.ImageHelper -import com.github.libretube.util.NavigationHelper +import com.github.libretube.helpers.BackgroundHelper +import com.github.libretube.helpers.ImageHelper +import com.github.libretube.helpers.NavigationHelper import com.github.libretube.util.PlayingQueue class AudioPlayerFragment : BaseFragment() { diff --git a/app/src/main/java/com/github/libretube/ui/fragments/ChannelFragment.kt b/app/src/main/java/com/github/libretube/ui/fragments/ChannelFragment.kt index 625f4eda9..11ac52e83 100644 --- a/app/src/main/java/com/github/libretube/ui/fragments/ChannelFragment.kt +++ b/app/src/main/java/com/github/libretube/ui/fragments/ChannelFragment.kt @@ -26,7 +26,7 @@ import com.github.libretube.ui.adapters.VideosAdapter import com.github.libretube.ui.base.BaseFragment import com.github.libretube.ui.dialogs.ShareDialog import com.github.libretube.ui.extensions.setupSubscriptionButton -import com.github.libretube.util.ImageHelper +import com.github.libretube.helpers.ImageHelper import java.io.IOException import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Dispatchers diff --git a/app/src/main/java/com/github/libretube/ui/fragments/DownloadsFragment.kt b/app/src/main/java/com/github/libretube/ui/fragments/DownloadsFragment.kt index 77bb48329..b5bf1a17f 100644 --- a/app/src/main/java/com/github/libretube/ui/fragments/DownloadsFragment.kt +++ b/app/src/main/java/com/github/libretube/ui/fragments/DownloadsFragment.kt @@ -25,7 +25,7 @@ import com.github.libretube.services.DownloadService import com.github.libretube.ui.adapters.DownloadsAdapter import com.github.libretube.ui.base.BaseFragment import com.github.libretube.ui.viewholders.DownloadsViewHolder -import com.github.libretube.util.DownloadHelper +import com.github.libretube.helpers.DownloadHelper import java.io.File import kotlinx.coroutines.Job import kotlinx.coroutines.flow.collectLatest diff --git a/app/src/main/java/com/github/libretube/ui/fragments/HomeFragment.kt b/app/src/main/java/com/github/libretube/ui/fragments/HomeFragment.kt index 97f75c4be..68d2b369c 100644 --- a/app/src/main/java/com/github/libretube/ui/fragments/HomeFragment.kt +++ b/app/src/main/java/com/github/libretube/ui/fragments/HomeFragment.kt @@ -22,7 +22,7 @@ import com.github.libretube.ui.adapters.PlaylistBookmarkAdapter import com.github.libretube.ui.adapters.PlaylistsAdapter import com.github.libretube.ui.adapters.VideosAdapter import com.github.libretube.ui.base.BaseFragment -import com.github.libretube.util.LocaleHelper +import com.github.libretube.helpers.LocaleHelper import kotlinx.coroutines.CancellationException import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch diff --git a/app/src/main/java/com/github/libretube/ui/fragments/LibraryFragment.kt b/app/src/main/java/com/github/libretube/ui/fragments/LibraryFragment.kt index d61693c03..99ccb43ad 100644 --- a/app/src/main/java/com/github/libretube/ui/fragments/LibraryFragment.kt +++ b/app/src/main/java/com/github/libretube/ui/fragments/LibraryFragment.kt @@ -26,8 +26,8 @@ import com.github.libretube.ui.adapters.PlaylistsAdapter import com.github.libretube.ui.base.BaseFragment import com.github.libretube.ui.dialogs.CreatePlaylistDialog import com.github.libretube.ui.models.PlayerViewModel -import com.github.libretube.util.NavBarHelper -import com.github.libretube.util.PreferenceHelper +import com.github.libretube.helpers.NavBarHelper +import com.github.libretube.helpers.PreferenceHelper class LibraryFragment : BaseFragment() { diff --git a/app/src/main/java/com/github/libretube/ui/fragments/PlayerFragment.kt b/app/src/main/java/com/github/libretube/ui/fragments/PlayerFragment.kt index f9da8f9d8..9985a0c67 100644 --- a/app/src/main/java/com/github/libretube/ui/fragments/PlayerFragment.kt +++ b/app/src/main/java/com/github/libretube/ui/fragments/PlayerFragment.kt @@ -86,19 +86,19 @@ import com.github.libretube.ui.models.PlayerViewModel import com.github.libretube.ui.sheets.BaseBottomSheet import com.github.libretube.ui.sheets.CommentsSheet import com.github.libretube.ui.sheets.PlayingQueueSheet -import com.github.libretube.util.BackgroundHelper -import com.github.libretube.util.DashHelper +import com.github.libretube.helpers.BackgroundHelper +import com.github.libretube.helpers.DashHelper import com.github.libretube.util.DataSaverMode import com.github.libretube.util.HtmlParser -import com.github.libretube.util.ImageHelper +import com.github.libretube.helpers.ImageHelper import com.github.libretube.util.LinkHandler -import com.github.libretube.util.NavigationHelper +import com.github.libretube.helpers.NavigationHelper import com.github.libretube.util.NowPlayingNotification -import com.github.libretube.util.PlayerHelper -import com.github.libretube.util.PlayerHelper.loadPlaybackParams +import com.github.libretube.helpers.PlayerHelper +import com.github.libretube.helpers.PlayerHelper.loadPlaybackParams import com.github.libretube.util.PlayingQueue -import com.github.libretube.util.PreferenceHelper -import com.github.libretube.util.SeekbarPreviewListener +import com.github.libretube.helpers.PreferenceHelper +import com.github.libretube.ui.listeners.SeekbarPreviewListener import com.github.libretube.util.TextUtils import com.google.android.exoplayer2.C import com.google.android.exoplayer2.ExoPlayer diff --git a/app/src/main/java/com/github/libretube/ui/fragments/PlaylistFragment.kt b/app/src/main/java/com/github/libretube/ui/fragments/PlaylistFragment.kt index 63e4f9875..3d775b0a9 100644 --- a/app/src/main/java/com/github/libretube/ui/fragments/PlaylistFragment.kt +++ b/app/src/main/java/com/github/libretube/ui/fragments/PlaylistFragment.kt @@ -31,8 +31,8 @@ import com.github.libretube.ui.base.BaseFragment import com.github.libretube.ui.extensions.serializable import com.github.libretube.ui.models.PlayerViewModel import com.github.libretube.ui.sheets.PlaylistOptionsBottomSheet -import com.github.libretube.util.ImageHelper -import com.github.libretube.util.NavigationHelper +import com.github.libretube.helpers.ImageHelper +import com.github.libretube.helpers.NavigationHelper import com.github.libretube.util.PlayingQueue import com.github.libretube.util.TextUtils diff --git a/app/src/main/java/com/github/libretube/ui/fragments/SearchResultFragment.kt b/app/src/main/java/com/github/libretube/ui/fragments/SearchResultFragment.kt index 54a84c9b8..51d7fc5e5 100644 --- a/app/src/main/java/com/github/libretube/ui/fragments/SearchResultFragment.kt +++ b/app/src/main/java/com/github/libretube/ui/fragments/SearchResultFragment.kt @@ -18,7 +18,7 @@ import com.github.libretube.extensions.TAG import com.github.libretube.extensions.hideKeyboard import com.github.libretube.ui.adapters.SearchAdapter import com.github.libretube.ui.base.BaseFragment -import com.github.libretube.util.PreferenceHelper +import com.github.libretube.helpers.PreferenceHelper import java.io.IOException import retrofit2.HttpException diff --git a/app/src/main/java/com/github/libretube/ui/fragments/SubscriptionsFragment.kt b/app/src/main/java/com/github/libretube/ui/fragments/SubscriptionsFragment.kt index 3cfecbb8a..1cb41c30f 100644 --- a/app/src/main/java/com/github/libretube/ui/fragments/SubscriptionsFragment.kt +++ b/app/src/main/java/com/github/libretube/ui/fragments/SubscriptionsFragment.kt @@ -19,7 +19,7 @@ import com.github.libretube.ui.adapters.VideosAdapter import com.github.libretube.ui.base.BaseFragment import com.github.libretube.ui.models.SubscriptionsViewModel import com.github.libretube.ui.sheets.BaseBottomSheet -import com.github.libretube.util.PreferenceHelper +import com.github.libretube.helpers.PreferenceHelper class SubscriptionsFragment : BaseFragment() { private lateinit var binding: FragmentSubscriptionsBinding diff --git a/app/src/main/java/com/github/libretube/ui/fragments/TrendsFragment.kt b/app/src/main/java/com/github/libretube/ui/fragments/TrendsFragment.kt index 2a78b0496..ead15d77e 100644 --- a/app/src/main/java/com/github/libretube/ui/fragments/TrendsFragment.kt +++ b/app/src/main/java/com/github/libretube/ui/fragments/TrendsFragment.kt @@ -15,7 +15,7 @@ import com.github.libretube.extensions.TAG import com.github.libretube.ui.activities.SettingsActivity import com.github.libretube.ui.adapters.VideosAdapter import com.github.libretube.ui.base.BaseFragment -import com.github.libretube.util.LocaleHelper +import com.github.libretube.helpers.LocaleHelper import com.google.android.material.snackbar.Snackbar import java.io.IOException import retrofit2.HttpException diff --git a/app/src/main/java/com/github/libretube/ui/fragments/WatchHistoryFragment.kt b/app/src/main/java/com/github/libretube/ui/fragments/WatchHistoryFragment.kt index ec8293b70..563829078 100644 --- a/app/src/main/java/com/github/libretube/ui/fragments/WatchHistoryFragment.kt +++ b/app/src/main/java/com/github/libretube/ui/fragments/WatchHistoryFragment.kt @@ -22,9 +22,9 @@ import com.github.libretube.extensions.query import com.github.libretube.ui.adapters.WatchHistoryAdapter import com.github.libretube.ui.base.BaseFragment import com.github.libretube.ui.models.PlayerViewModel -import com.github.libretube.util.NavigationHelper +import com.github.libretube.helpers.NavigationHelper import com.github.libretube.util.PlayingQueue -import com.github.libretube.util.ProxyHelper +import com.github.libretube.helpers.ProxyHelper import com.google.android.material.dialog.MaterialAlertDialogBuilder class WatchHistoryFragment : BaseFragment() { diff --git a/app/src/main/java/com/github/libretube/util/PlayerGestureController.kt b/app/src/main/java/com/github/libretube/ui/listeners/PlayerGestureController.kt similarity index 98% rename from app/src/main/java/com/github/libretube/util/PlayerGestureController.kt rename to app/src/main/java/com/github/libretube/ui/listeners/PlayerGestureController.kt index 42150da11..60f900ee4 100644 --- a/app/src/main/java/com/github/libretube/util/PlayerGestureController.kt +++ b/app/src/main/java/com/github/libretube/ui/listeners/PlayerGestureController.kt @@ -1,4 +1,4 @@ -package com.github.libretube.util +package com.github.libretube.ui.listeners import android.annotation.SuppressLint import android.content.res.Configuration @@ -15,6 +15,7 @@ import androidx.core.os.postDelayed import com.github.libretube.ui.base.BaseActivity import com.github.libretube.ui.interfaces.PlayerGestureOptions import com.github.libretube.ui.models.PlayerViewModel +import com.github.libretube.helpers.PlayerHelper import kotlin.math.abs class PlayerGestureController(activity: BaseActivity, private val listener: PlayerGestureOptions) : diff --git a/app/src/main/java/com/github/libretube/util/SeekbarPreviewListener.kt b/app/src/main/java/com/github/libretube/ui/listeners/SeekbarPreviewListener.kt similarity index 98% rename from app/src/main/java/com/github/libretube/util/SeekbarPreviewListener.kt rename to app/src/main/java/com/github/libretube/ui/listeners/SeekbarPreviewListener.kt index cad92c8a6..a21a28b00 100644 --- a/app/src/main/java/com/github/libretube/util/SeekbarPreviewListener.kt +++ b/app/src/main/java/com/github/libretube/ui/listeners/SeekbarPreviewListener.kt @@ -1,4 +1,4 @@ -package com.github.libretube.util +package com.github.libretube.ui.listeners import android.graphics.Bitmap import android.view.View @@ -10,6 +10,7 @@ import androidx.core.view.updateLayoutParams import coil.request.ImageRequest import com.github.libretube.api.obj.PreviewFrames import com.github.libretube.obj.PreviewFrame +import com.github.libretube.helpers.ImageHelper import com.google.android.exoplayer2.ui.TimeBar class SeekbarPreviewListener( diff --git a/app/src/main/java/com/github/libretube/ui/models/SubscriptionsViewModel.kt b/app/src/main/java/com/github/libretube/ui/models/SubscriptionsViewModel.kt index 03fdcfd1d..8dc4c846e 100644 --- a/app/src/main/java/com/github/libretube/ui/models/SubscriptionsViewModel.kt +++ b/app/src/main/java/com/github/libretube/ui/models/SubscriptionsViewModel.kt @@ -9,7 +9,7 @@ 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 com.github.libretube.helpers.PreferenceHelper import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch diff --git a/app/src/main/java/com/github/libretube/ui/preferences/AdvancedSettings.kt b/app/src/main/java/com/github/libretube/ui/preferences/AdvancedSettings.kt index 3c92363c8..44729128d 100644 --- a/app/src/main/java/com/github/libretube/ui/preferences/AdvancedSettings.kt +++ b/app/src/main/java/com/github/libretube/ui/preferences/AdvancedSettings.kt @@ -7,8 +7,8 @@ import androidx.preference.Preference import com.github.libretube.R import com.github.libretube.constants.PreferenceKeys import com.github.libretube.ui.base.BasePreferenceFragment -import com.github.libretube.util.ImageHelper -import com.github.libretube.util.PreferenceHelper +import com.github.libretube.helpers.ImageHelper +import com.github.libretube.helpers.PreferenceHelper import com.google.android.material.dialog.MaterialAlertDialogBuilder class AdvancedSettings : BasePreferenceFragment() { diff --git a/app/src/main/java/com/github/libretube/ui/preferences/AppearanceSettings.kt b/app/src/main/java/com/github/libretube/ui/preferences/AppearanceSettings.kt index 3e5aa8615..d2913a214 100644 --- a/app/src/main/java/com/github/libretube/ui/preferences/AppearanceSettings.kt +++ b/app/src/main/java/com/github/libretube/ui/preferences/AppearanceSettings.kt @@ -12,7 +12,7 @@ import com.github.libretube.ui.base.BasePreferenceFragment import com.github.libretube.ui.dialogs.NavBarOptionsDialog import com.github.libretube.ui.dialogs.RequireRestartDialog import com.github.libretube.ui.sheets.IconsBottomSheet -import com.github.libretube.util.PreferenceHelper +import com.github.libretube.helpers.PreferenceHelper class AppearanceSettings : BasePreferenceFragment() { override val titleResourceId: Int = R.string.appearance diff --git a/app/src/main/java/com/github/libretube/ui/preferences/BackupRestoreSettings.kt b/app/src/main/java/com/github/libretube/ui/preferences/BackupRestoreSettings.kt index fc065ae99..e478f69b9 100644 --- a/app/src/main/java/com/github/libretube/ui/preferences/BackupRestoreSettings.kt +++ b/app/src/main/java/com/github/libretube/ui/preferences/BackupRestoreSettings.kt @@ -10,8 +10,8 @@ import com.github.libretube.R import com.github.libretube.obj.BackupFile import com.github.libretube.ui.base.BasePreferenceFragment import com.github.libretube.ui.dialogs.BackupDialog -import com.github.libretube.util.BackupHelper -import com.github.libretube.util.ImportHelper +import com.github.libretube.helpers.BackupHelper +import com.github.libretube.helpers.ImportHelper import java.time.LocalDateTime import java.time.format.DateTimeFormatter diff --git a/app/src/main/java/com/github/libretube/ui/preferences/GeneralSettings.kt b/app/src/main/java/com/github/libretube/ui/preferences/GeneralSettings.kt index 5d28cf875..e3d4daf42 100644 --- a/app/src/main/java/com/github/libretube/ui/preferences/GeneralSettings.kt +++ b/app/src/main/java/com/github/libretube/ui/preferences/GeneralSettings.kt @@ -9,8 +9,8 @@ import com.github.libretube.R import com.github.libretube.constants.PreferenceKeys import com.github.libretube.ui.base.BasePreferenceFragment import com.github.libretube.ui.dialogs.RequireRestartDialog -import com.github.libretube.util.LocaleHelper -import com.github.libretube.util.PreferenceHelper +import com.github.libretube.helpers.LocaleHelper +import com.github.libretube.helpers.PreferenceHelper class GeneralSettings : BasePreferenceFragment() { override val titleResourceId: Int = R.string.general diff --git a/app/src/main/java/com/github/libretube/ui/preferences/InstanceSettings.kt b/app/src/main/java/com/github/libretube/ui/preferences/InstanceSettings.kt index da14044ea..d17ddab51 100644 --- a/app/src/main/java/com/github/libretube/ui/preferences/InstanceSettings.kt +++ b/app/src/main/java/com/github/libretube/ui/preferences/InstanceSettings.kt @@ -20,7 +20,7 @@ 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.util.PreferenceHelper +import com.github.libretube.helpers.PreferenceHelper class InstanceSettings : BasePreferenceFragment() { override val titleResourceId: Int = R.string.instance diff --git a/app/src/main/java/com/github/libretube/ui/preferences/NotificationSettings.kt b/app/src/main/java/com/github/libretube/ui/preferences/NotificationSettings.kt index 34807ebdf..ea534f637 100644 --- a/app/src/main/java/com/github/libretube/ui/preferences/NotificationSettings.kt +++ b/app/src/main/java/com/github/libretube/ui/preferences/NotificationSettings.kt @@ -8,7 +8,7 @@ import com.github.libretube.R import com.github.libretube.constants.PreferenceKeys import com.github.libretube.ui.base.BasePreferenceFragment import com.github.libretube.ui.views.TimePickerPreference -import com.github.libretube.util.NotificationHelper +import com.github.libretube.helpers.NotificationHelper class NotificationSettings : BasePreferenceFragment() { override val titleResourceId: Int = R.string.notifications diff --git a/app/src/main/java/com/github/libretube/ui/preferences/PlayerSettings.kt b/app/src/main/java/com/github/libretube/ui/preferences/PlayerSettings.kt index f77cb80a7..8b4735898 100644 --- a/app/src/main/java/com/github/libretube/ui/preferences/PlayerSettings.kt +++ b/app/src/main/java/com/github/libretube/ui/preferences/PlayerSettings.kt @@ -13,8 +13,8 @@ import androidx.preference.SwitchPreferenceCompat import com.github.libretube.R import com.github.libretube.constants.PreferenceKeys import com.github.libretube.ui.base.BasePreferenceFragment -import com.github.libretube.util.LocaleHelper -import com.github.libretube.util.PreferenceHelper +import com.github.libretube.helpers.LocaleHelper +import com.github.libretube.helpers.PreferenceHelper class PlayerSettings : BasePreferenceFragment() { override val titleResourceId: Int = R.string.player diff --git a/app/src/main/java/com/github/libretube/ui/sheets/ChannelOptionsBottomSheet.kt b/app/src/main/java/com/github/libretube/ui/sheets/ChannelOptionsBottomSheet.kt index f3edef523..e78ff3f05 100644 --- a/app/src/main/java/com/github/libretube/ui/sheets/ChannelOptionsBottomSheet.kt +++ b/app/src/main/java/com/github/libretube/ui/sheets/ChannelOptionsBottomSheet.kt @@ -9,8 +9,8 @@ import com.github.libretube.extensions.TAG import com.github.libretube.extensions.toID import com.github.libretube.obj.ShareData import com.github.libretube.ui.dialogs.ShareDialog -import com.github.libretube.util.BackgroundHelper -import com.github.libretube.util.NavigationHelper +import com.github.libretube.helpers.BackgroundHelper +import com.github.libretube.helpers.NavigationHelper import kotlinx.coroutines.runBlocking /** diff --git a/app/src/main/java/com/github/libretube/ui/sheets/PlaybackOptionsSheet.kt b/app/src/main/java/com/github/libretube/ui/sheets/PlaybackOptionsSheet.kt index caaa79898..01bc6ff15 100644 --- a/app/src/main/java/com/github/libretube/ui/sheets/PlaybackOptionsSheet.kt +++ b/app/src/main/java/com/github/libretube/ui/sheets/PlaybackOptionsSheet.kt @@ -7,7 +7,7 @@ import android.view.ViewGroup import com.github.libretube.constants.PreferenceKeys import com.github.libretube.databinding.PlaybackBottomSheetBinding import com.github.libretube.extensions.round -import com.github.libretube.util.PreferenceHelper +import com.github.libretube.helpers.PreferenceHelper import com.google.android.exoplayer2.ExoPlayer import com.google.android.exoplayer2.PlaybackParameters diff --git a/app/src/main/java/com/github/libretube/ui/sheets/PlaylistOptionsBottomSheet.kt b/app/src/main/java/com/github/libretube/ui/sheets/PlaylistOptionsBottomSheet.kt index b832bc36a..caac4343c 100644 --- a/app/src/main/java/com/github/libretube/ui/sheets/PlaylistOptionsBottomSheet.kt +++ b/app/src/main/java/com/github/libretube/ui/sheets/PlaylistOptionsBottomSheet.kt @@ -16,7 +16,7 @@ import com.github.libretube.obj.ShareData import com.github.libretube.ui.dialogs.DeletePlaylistDialog import com.github.libretube.ui.dialogs.RenamePlaylistDialog import com.github.libretube.ui.dialogs.ShareDialog -import com.github.libretube.util.BackgroundHelper +import com.github.libretube.helpers.BackgroundHelper import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch diff --git a/app/src/main/java/com/github/libretube/ui/sheets/VideoOptionsBottomSheet.kt b/app/src/main/java/com/github/libretube/ui/sheets/VideoOptionsBottomSheet.kt index fb75cf325..2aeb75168 100644 --- a/app/src/main/java/com/github/libretube/ui/sheets/VideoOptionsBottomSheet.kt +++ b/app/src/main/java/com/github/libretube/ui/sheets/VideoOptionsBottomSheet.kt @@ -9,7 +9,7 @@ import com.github.libretube.obj.ShareData 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.helpers.BackgroundHelper import com.github.libretube.util.PlayingQueue import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Dispatchers diff --git a/app/src/main/java/com/github/libretube/ui/tools/SleepTimer.kt b/app/src/main/java/com/github/libretube/ui/tools/SleepTimer.kt index 54c6c1386..5d1401287 100644 --- a/app/src/main/java/com/github/libretube/ui/tools/SleepTimer.kt +++ b/app/src/main/java/com/github/libretube/ui/tools/SleepTimer.kt @@ -8,7 +8,7 @@ import androidx.core.os.postDelayed import com.github.libretube.R import com.github.libretube.constants.PreferenceKeys import com.github.libretube.ui.activities.MainActivity -import com.github.libretube.util.PreferenceHelper +import com.github.libretube.helpers.PreferenceHelper import com.google.android.material.snackbar.Snackbar object SleepTimer { diff --git a/app/src/main/java/com/github/libretube/ui/views/AppNameTextView.kt b/app/src/main/java/com/github/libretube/ui/views/AppNameTextView.kt index aad8a7f5a..848b62c42 100644 --- a/app/src/main/java/com/github/libretube/ui/views/AppNameTextView.kt +++ b/app/src/main/java/com/github/libretube/ui/views/AppNameTextView.kt @@ -4,7 +4,7 @@ import android.content.Context import android.util.AttributeSet import android.util.TypedValue import androidx.appcompat.widget.AppCompatTextView -import com.github.libretube.util.ThemeHelper +import com.github.libretube.helpers.ThemeHelper class AppNameTextView : AppCompatTextView { constructor(context: Context, attributeSet: AttributeSet?) : super(context, attributeSet) diff --git a/app/src/main/java/com/github/libretube/ui/views/CustomExoPlayerView.kt b/app/src/main/java/com/github/libretube/ui/views/CustomExoPlayerView.kt index 132654c0c..7b5d65c5a 100644 --- a/app/src/main/java/com/github/libretube/ui/views/CustomExoPlayerView.kt +++ b/app/src/main/java/com/github/libretube/ui/views/CustomExoPlayerView.kt @@ -32,10 +32,10 @@ import com.github.libretube.ui.interfaces.PlayerOptions import com.github.libretube.ui.models.PlayerViewModel import com.github.libretube.ui.sheets.BaseBottomSheet import com.github.libretube.ui.sheets.PlaybackOptionsSheet -import com.github.libretube.util.AudioHelper -import com.github.libretube.util.BrightnessHelper -import com.github.libretube.util.PlayerGestureController -import com.github.libretube.util.PlayerHelper +import com.github.libretube.helpers.AudioHelper +import com.github.libretube.helpers.BrightnessHelper +import com.github.libretube.ui.listeners.PlayerGestureController +import com.github.libretube.helpers.PlayerHelper import com.github.libretube.util.PlayingQueue import com.google.android.exoplayer2.ExoPlayer import com.google.android.exoplayer2.Player diff --git a/app/src/main/java/com/github/libretube/ui/views/CustomSwipeToRefresh.kt b/app/src/main/java/com/github/libretube/ui/views/CustomSwipeToRefresh.kt index 733e7ea1e..dc006a82e 100644 --- a/app/src/main/java/com/github/libretube/ui/views/CustomSwipeToRefresh.kt +++ b/app/src/main/java/com/github/libretube/ui/views/CustomSwipeToRefresh.kt @@ -8,7 +8,7 @@ import android.view.MotionEvent.ACTION_MOVE import android.view.ViewConfiguration import androidx.swiperefreshlayout.widget.SwipeRefreshLayout import com.github.libretube.R -import com.github.libretube.util.ThemeHelper +import com.github.libretube.helpers.ThemeHelper import kotlin.math.abs class CustomSwipeToRefresh(context: Context?, attrs: AttributeSet?) : diff --git a/app/src/main/java/com/github/libretube/ui/views/MarkableTimeBar.kt b/app/src/main/java/com/github/libretube/ui/views/MarkableTimeBar.kt index ffd97eefb..36615a265 100644 --- a/app/src/main/java/com/github/libretube/ui/views/MarkableTimeBar.kt +++ b/app/src/main/java/com/github/libretube/ui/views/MarkableTimeBar.kt @@ -11,8 +11,8 @@ import com.github.libretube.R import com.github.libretube.api.obj.Segment import com.github.libretube.constants.PreferenceKeys import com.github.libretube.extensions.dpToPx -import com.github.libretube.util.PreferenceHelper -import com.github.libretube.util.ThemeHelper +import com.github.libretube.helpers.PreferenceHelper +import com.github.libretube.helpers.ThemeHelper import com.google.android.exoplayer2.Player import com.google.android.exoplayer2.ui.DefaultTimeBar diff --git a/app/src/main/java/com/github/libretube/ui/views/SliderPreference.kt b/app/src/main/java/com/github/libretube/ui/views/SliderPreference.kt index 1f927013a..6aee66187 100644 --- a/app/src/main/java/com/github/libretube/ui/views/SliderPreference.kt +++ b/app/src/main/java/com/github/libretube/ui/views/SliderPreference.kt @@ -7,7 +7,7 @@ import androidx.preference.Preference import com.github.libretube.R import com.github.libretube.databinding.DialogSliderBinding import com.github.libretube.extensions.round -import com.github.libretube.util.PreferenceHelper +import com.github.libretube.helpers.PreferenceHelper import com.google.android.material.dialog.MaterialAlertDialogBuilder /** diff --git a/app/src/main/java/com/github/libretube/ui/views/TimePickerPreference.kt b/app/src/main/java/com/github/libretube/ui/views/TimePickerPreference.kt index f319b2ac5..248f527a3 100644 --- a/app/src/main/java/com/github/libretube/ui/views/TimePickerPreference.kt +++ b/app/src/main/java/com/github/libretube/ui/views/TimePickerPreference.kt @@ -5,7 +5,7 @@ import android.text.format.DateFormat.is24HourFormat import android.util.AttributeSet import androidx.appcompat.app.AppCompatActivity import androidx.preference.Preference -import com.github.libretube.util.PreferenceHelper +import com.github.libretube.helpers.PreferenceHelper import com.google.android.material.timepicker.MaterialTimePicker import com.google.android.material.timepicker.TimeFormat import java.time.LocalTime diff --git a/app/src/main/java/com/github/libretube/util/DataSaverMode.kt b/app/src/main/java/com/github/libretube/util/DataSaverMode.kt index 619ce58d2..29cf85aff 100644 --- a/app/src/main/java/com/github/libretube/util/DataSaverMode.kt +++ b/app/src/main/java/com/github/libretube/util/DataSaverMode.kt @@ -2,6 +2,8 @@ package com.github.libretube.util import android.content.Context import com.github.libretube.constants.PreferenceKeys +import com.github.libretube.helpers.NetworkHelper +import com.github.libretube.helpers.PreferenceHelper object DataSaverMode { fun isEnabled(context: Context): Boolean { diff --git a/app/src/main/java/com/github/libretube/util/ExceptionHandler.kt b/app/src/main/java/com/github/libretube/util/ExceptionHandler.kt index 3d790d7c8..e6ab250df 100644 --- a/app/src/main/java/com/github/libretube/util/ExceptionHandler.kt +++ b/app/src/main/java/com/github/libretube/util/ExceptionHandler.kt @@ -1,5 +1,7 @@ package com.github.libretube.util +import com.github.libretube.helpers.PreferenceHelper + class ExceptionHandler( private val defaultExceptionHandler: Thread.UncaughtExceptionHandler? ) : Thread.UncaughtExceptionHandler { 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 234a1cbd2..761130a6f 100644 --- a/app/src/main/java/com/github/libretube/util/NowPlayingNotification.kt +++ b/app/src/main/java/com/github/libretube/util/NowPlayingNotification.kt @@ -24,6 +24,8 @@ import com.github.libretube.compat.PendingIntentCompat 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.helpers.ImageHelper +import com.github.libretube.helpers.PlayerHelper import com.github.libretube.ui.activities.MainActivity import com.google.android.exoplayer2.ExoPlayer import com.google.android.exoplayer2.Player diff --git a/app/src/main/java/com/github/libretube/workers/NotificationWorker.kt b/app/src/main/java/com/github/libretube/workers/NotificationWorker.kt index 2ea3e01bc..b910e5552 100644 --- a/app/src/main/java/com/github/libretube/workers/NotificationWorker.kt +++ b/app/src/main/java/com/github/libretube/workers/NotificationWorker.kt @@ -21,7 +21,7 @@ import com.github.libretube.extensions.TAG import com.github.libretube.extensions.toID import com.github.libretube.ui.activities.MainActivity import com.github.libretube.ui.views.TimePickerPreference -import com.github.libretube.util.PreferenceHelper +import com.github.libretube.helpers.PreferenceHelper import java.time.LocalTime import kotlinx.coroutines.runBlocking