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 8d8c67831..a6eb42c6d 100644 --- a/app/src/main/java/com/github/libretube/api/PipedApi.kt +++ b/app/src/main/java/com/github/libretube/api/PipedApi.kt @@ -1,6 +1,11 @@ package com.github.libretube.api -import retrofit2.http.* +import retrofit2.http.Body +import retrofit2.http.GET +import retrofit2.http.Header +import retrofit2.http.POST +import retrofit2.http.Path +import retrofit2.http.Query interface PipedApi { @GET("trending") diff --git a/app/src/main/java/com/github/libretube/db/AppDatabase.kt b/app/src/main/java/com/github/libretube/db/AppDatabase.kt index 7895e0a12..88daecd16 100644 --- a/app/src/main/java/com/github/libretube/db/AppDatabase.kt +++ b/app/src/main/java/com/github/libretube/db/AppDatabase.kt @@ -2,8 +2,16 @@ package com.github.libretube.db import androidx.room.Database import androidx.room.RoomDatabase -import com.github.libretube.db.dao.* -import com.github.libretube.db.obj.* +import com.github.libretube.db.dao.CustomInstanceDao +import com.github.libretube.db.dao.LocalSubscriptionDao +import com.github.libretube.db.dao.SearchHistoryDao +import com.github.libretube.db.dao.WatchHistoryDao +import com.github.libretube.db.dao.WatchPositionDao +import com.github.libretube.db.obj.CustomInstance +import com.github.libretube.db.obj.LocalSubscription +import com.github.libretube.db.obj.SearchHistoryItem +import com.github.libretube.db.obj.WatchHistoryItem +import com.github.libretube.db.obj.WatchPosition @Database( entities = [ diff --git a/app/src/main/java/com/github/libretube/db/dao/CustomInstanceDao.kt b/app/src/main/java/com/github/libretube/db/dao/CustomInstanceDao.kt index c0dcc0420..182db494e 100644 --- a/app/src/main/java/com/github/libretube/db/dao/CustomInstanceDao.kt +++ b/app/src/main/java/com/github/libretube/db/dao/CustomInstanceDao.kt @@ -1,6 +1,10 @@ package com.github.libretube.db.dao -import androidx.room.* +import androidx.room.Dao +import androidx.room.Delete +import androidx.room.Insert +import androidx.room.OnConflictStrategy +import androidx.room.Query import com.github.libretube.db.obj.CustomInstance @Dao diff --git a/app/src/main/java/com/github/libretube/db/dao/LocalSubscriptionDao.kt b/app/src/main/java/com/github/libretube/db/dao/LocalSubscriptionDao.kt index cd5d6b988..a925f3535 100644 --- a/app/src/main/java/com/github/libretube/db/dao/LocalSubscriptionDao.kt +++ b/app/src/main/java/com/github/libretube/db/dao/LocalSubscriptionDao.kt @@ -1,6 +1,10 @@ package com.github.libretube.db.dao -import androidx.room.* +import androidx.room.Dao +import androidx.room.Delete +import androidx.room.Insert +import androidx.room.OnConflictStrategy +import androidx.room.Query import com.github.libretube.db.obj.LocalSubscription @Dao diff --git a/app/src/main/java/com/github/libretube/db/dao/SearchHistoryDao.kt b/app/src/main/java/com/github/libretube/db/dao/SearchHistoryDao.kt index 632e8f150..4556d4a13 100644 --- a/app/src/main/java/com/github/libretube/db/dao/SearchHistoryDao.kt +++ b/app/src/main/java/com/github/libretube/db/dao/SearchHistoryDao.kt @@ -1,6 +1,10 @@ package com.github.libretube.db.dao -import androidx.room.* +import androidx.room.Dao +import androidx.room.Delete +import androidx.room.Insert +import androidx.room.OnConflictStrategy +import androidx.room.Query import com.github.libretube.db.obj.SearchHistoryItem @Dao diff --git a/app/src/main/java/com/github/libretube/db/dao/WatchHistoryDao.kt b/app/src/main/java/com/github/libretube/db/dao/WatchHistoryDao.kt index 9258102ee..dfa5b732a 100644 --- a/app/src/main/java/com/github/libretube/db/dao/WatchHistoryDao.kt +++ b/app/src/main/java/com/github/libretube/db/dao/WatchHistoryDao.kt @@ -1,6 +1,10 @@ package com.github.libretube.db.dao -import androidx.room.* +import androidx.room.Dao +import androidx.room.Delete +import androidx.room.Insert +import androidx.room.OnConflictStrategy +import androidx.room.Query import com.github.libretube.db.obj.WatchHistoryItem @Dao diff --git a/app/src/main/java/com/github/libretube/db/dao/WatchPositionDao.kt b/app/src/main/java/com/github/libretube/db/dao/WatchPositionDao.kt index 9c4dc825e..6855eaab4 100644 --- a/app/src/main/java/com/github/libretube/db/dao/WatchPositionDao.kt +++ b/app/src/main/java/com/github/libretube/db/dao/WatchPositionDao.kt @@ -1,6 +1,10 @@ package com.github.libretube.db.dao -import androidx.room.* +import androidx.room.Dao +import androidx.room.Delete +import androidx.room.Insert +import androidx.room.OnConflictStrategy +import androidx.room.Query import com.github.libretube.db.obj.WatchPosition @Dao diff --git a/app/src/main/java/com/github/libretube/obj/BackupFile.kt b/app/src/main/java/com/github/libretube/obj/BackupFile.kt index 8f2d47517..3ab5320ce 100644 --- a/app/src/main/java/com/github/libretube/obj/BackupFile.kt +++ b/app/src/main/java/com/github/libretube/obj/BackupFile.kt @@ -1,6 +1,10 @@ package com.github.libretube.obj -import com.github.libretube.db.obj.* +import com.github.libretube.db.obj.CustomInstance +import com.github.libretube.db.obj.LocalSubscription +import com.github.libretube.db.obj.SearchHistoryItem +import com.github.libretube.db.obj.WatchHistoryItem +import com.github.libretube.db.obj.WatchPosition data class BackupFile( var watchHistory: List? = null, 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 96f34708b..457692b14 100644 --- a/app/src/main/java/com/github/libretube/services/BackgroundMode.kt +++ b/app/src/main/java/com/github/libretube/services/BackgroundMode.kt @@ -21,7 +21,11 @@ import com.github.libretube.constants.PreferenceKeys import com.github.libretube.db.DatabaseHelper import com.github.libretube.extensions.query import com.github.libretube.extensions.toID -import com.github.libretube.util.* +import com.github.libretube.util.AutoPlayHelper +import com.github.libretube.util.NowPlayingNotification +import com.github.libretube.util.PlayerHelper +import com.github.libretube.util.PlayingQueue +import com.github.libretube.util.PreferenceHelper 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/sheets/PlaylistOptionsBottomSheet.kt b/app/src/main/java/com/github/libretube/sheets/PlaylistOptionsBottomSheet.kt index 20f98eb3c..21451fa8b 100644 --- a/app/src/main/java/com/github/libretube/sheets/PlaylistOptionsBottomSheet.kt +++ b/app/src/main/java/com/github/libretube/sheets/PlaylistOptionsBottomSheet.kt @@ -14,12 +14,12 @@ import com.github.libretube.ui.views.BottomSheet import com.github.libretube.util.BackgroundHelper import com.github.libretube.util.PreferenceHelper import com.google.android.material.dialog.MaterialAlertDialogBuilder -import java.io.IOException import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch import kotlinx.coroutines.runBlocking import retrofit2.HttpException +import java.io.IOException class PlaylistOptionsBottomSheet( private val playlistId: String, diff --git a/app/src/main/java/com/github/libretube/ui/activities/AboutActivity.kt b/app/src/main/java/com/github/libretube/ui/activities/AboutActivity.kt index 0d10c90ed..277d65cc5 100644 --- a/app/src/main/java/com/github/libretube/ui/activities/AboutActivity.kt +++ b/app/src/main/java/com/github/libretube/ui/activities/AboutActivity.kt @@ -10,7 +10,12 @@ import android.os.Bundle import androidx.core.text.HtmlCompat import androidx.core.text.parseAsHtml import com.github.libretube.R -import com.github.libretube.constants.* +import com.github.libretube.constants.DONATE_URL +import com.github.libretube.constants.GITHUB_URL +import com.github.libretube.constants.LICENSE_URL +import com.github.libretube.constants.PIPED_GITHUB_URL +import com.github.libretube.constants.WEBLATE_URL +import com.github.libretube.constants.WEBSITE_URL import com.github.libretube.databinding.ActivityAboutBinding import com.github.libretube.extensions.BaseActivity import com.github.libretube.extensions.getStyledSnackBar diff --git a/app/src/main/java/com/github/libretube/ui/activities/CommunityActivity.kt b/app/src/main/java/com/github/libretube/ui/activities/CommunityActivity.kt index 764cb671e..b48da6bc0 100644 --- a/app/src/main/java/com/github/libretube/ui/activities/CommunityActivity.kt +++ b/app/src/main/java/com/github/libretube/ui/activities/CommunityActivity.kt @@ -3,7 +3,11 @@ package com.github.libretube.ui.activities import android.content.Intent import android.net.Uri import android.os.Bundle -import com.github.libretube.constants.* +import com.github.libretube.constants.DISCORD_URL +import com.github.libretube.constants.MATRIX_URL +import com.github.libretube.constants.REDDIT_URL +import com.github.libretube.constants.TELEGRAM_URL +import com.github.libretube.constants.TWITTER_URL import com.github.libretube.databinding.ActivityCommunityBinding import com.github.libretube.extensions.BaseActivity 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 f2f0cf2ac..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 @@ -7,7 +7,12 @@ import android.os.Build import android.os.Bundle import android.os.Handler import android.os.Looper -import android.view.* +import android.view.Menu +import android.view.MenuItem +import android.view.View +import android.view.WindowInsets +import android.view.WindowInsetsController +import android.view.WindowManager import android.widget.Toast import androidx.activity.OnBackPressedCallback import androidx.appcompat.widget.SearchView 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 18aa37443..3f9b3bef6 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 @@ -15,11 +15,11 @@ import com.github.libretube.extensions.TAG import com.github.libretube.extensions.formatShort import com.github.libretube.util.ImageHelper import com.github.libretube.util.NavigationHelper -import java.io.IOException import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch import retrofit2.HttpException +import java.io.IOException class CommentsAdapter( private val videoId: String, 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 3bc0429b7..514db53dd 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 @@ -17,11 +17,11 @@ import com.github.libretube.sheets.VideoOptionsBottomSheet import com.github.libretube.util.ImageHelper import com.github.libretube.util.NavigationHelper import com.github.libretube.util.PreferenceHelper -import java.io.IOException import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch import retrofit2.HttpException +import java.io.IOException class PlaylistAdapter( private val videoFeed: MutableList, 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 ed5fecf8d..a11ce1d87 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 @@ -15,11 +15,11 @@ import com.github.libretube.util.ImageHelper import com.github.libretube.util.NavigationHelper import com.github.libretube.util.PreferenceHelper import com.google.android.material.dialog.MaterialAlertDialogBuilder -import java.io.IOException import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch import retrofit2.HttpException +import java.io.IOException class PlaylistsAdapter( private val playlists: MutableList, diff --git a/app/src/main/java/com/github/libretube/ui/dialogs/AddToPlaylistDialog.kt b/app/src/main/java/com/github/libretube/ui/dialogs/AddToPlaylistDialog.kt index 227438547..8dc58d1f2 100644 --- a/app/src/main/java/com/github/libretube/ui/dialogs/AddToPlaylistDialog.kt +++ b/app/src/main/java/com/github/libretube/ui/dialogs/AddToPlaylistDialog.kt @@ -18,8 +18,8 @@ import com.github.libretube.models.PlaylistViewModel import com.github.libretube.util.PreferenceHelper import com.github.libretube.util.ThemeHelper import com.google.android.material.dialog.MaterialAlertDialogBuilder -import java.io.IOException import retrofit2.HttpException +import java.io.IOException class AddToPlaylistDialog : DialogFragment() { private lateinit var binding: DialogAddtoplaylistBinding diff --git a/app/src/main/java/com/github/libretube/ui/dialogs/CreatePlaylistDialog.kt b/app/src/main/java/com/github/libretube/ui/dialogs/CreatePlaylistDialog.kt index f259f6068..087cfbf8c 100644 --- a/app/src/main/java/com/github/libretube/ui/dialogs/CreatePlaylistDialog.kt +++ b/app/src/main/java/com/github/libretube/ui/dialogs/CreatePlaylistDialog.kt @@ -14,8 +14,8 @@ import com.github.libretube.ui.fragments.LibraryFragment import com.github.libretube.util.PreferenceHelper import com.github.libretube.util.ThemeHelper import com.google.android.material.dialog.MaterialAlertDialogBuilder -import java.io.IOException import retrofit2.HttpException +import java.io.IOException class CreatePlaylistDialog : DialogFragment() { private var token: String = "" 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 95c210d7a..d590722e1 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 @@ -17,8 +17,8 @@ import com.github.libretube.extensions.TAG import com.github.libretube.services.DownloadService import com.github.libretube.util.ThemeHelper import com.google.android.material.dialog.MaterialAlertDialogBuilder -import java.io.IOException import retrofit2.HttpException +import java.io.IOException class DownloadDialog( private val videoId: String 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 1599745a4..0f319860c 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 @@ -13,8 +13,8 @@ import com.github.libretube.extensions.TAG import com.github.libretube.util.PreferenceHelper import com.github.libretube.util.ThemeHelper import com.google.android.material.dialog.MaterialAlertDialogBuilder -import java.io.IOException import retrofit2.HttpException +import java.io.IOException class LoginDialog : DialogFragment() { private lateinit var binding: DialogLoginBinding 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 8b566fe07..b88f03142 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 @@ -18,8 +18,8 @@ import com.github.libretube.extensions.formatShort import com.github.libretube.extensions.toID import com.github.libretube.ui.adapters.ChannelAdapter import com.github.libretube.util.ImageHelper -import java.io.IOException import retrofit2.HttpException +import java.io.IOException class ChannelFragment : BaseFragment() { private lateinit var binding: FragmentChannelBinding 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 45706c8d9..aea4f99e1 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 @@ -19,8 +19,8 @@ import com.github.libretube.ui.adapters.ChannelAdapter import com.github.libretube.ui.adapters.TrendingAdapter import com.github.libretube.util.LocaleHelper import com.github.libretube.util.PreferenceHelper -import java.io.IOException import retrofit2.HttpException +import java.io.IOException class HomeFragment : BaseFragment() { private lateinit var binding: FragmentHomeBinding 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 249203afb..b4eb72b19 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 @@ -21,8 +21,8 @@ import com.github.libretube.models.PlayerViewModel import com.github.libretube.ui.adapters.PlaylistsAdapter import com.github.libretube.ui.dialogs.CreatePlaylistDialog import com.github.libretube.util.PreferenceHelper -import java.io.IOException import retrofit2.HttpException +import java.io.IOException 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 c2f9761bf..b014ed6fb 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 @@ -10,8 +10,12 @@ import android.content.res.Configuration import android.graphics.Rect import android.media.session.PlaybackState import android.net.Uri -import android.os.* +import android.os.Build import android.os.Build.VERSION.SDK_INT +import android.os.Bundle +import android.os.Handler +import android.os.Looper +import android.os.PowerManager import android.text.Html import android.text.format.DateUtils import android.util.Log @@ -42,7 +46,13 @@ 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.extensions.* +import com.github.libretube.extensions.BaseFragment +import com.github.libretube.extensions.TAG +import com.github.libretube.extensions.awaitQuery +import com.github.libretube.extensions.formatShort +import com.github.libretube.extensions.hideKeyboard +import com.github.libretube.extensions.query +import com.github.libretube.extensions.toID import com.github.libretube.interfaces.PlayerOptionsInterface import com.github.libretube.models.PlayerViewModel import com.github.libretube.services.BackgroundMode @@ -54,10 +64,21 @@ import com.github.libretube.ui.adapters.TrendingAdapter 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.* -import com.google.android.exoplayer2.* +import com.github.libretube.util.AutoPlayHelper +import com.github.libretube.util.BackgroundHelper +import com.github.libretube.util.ImageHelper +import com.github.libretube.util.NetworkHelper +import com.github.libretube.util.NowPlayingNotification +import com.github.libretube.util.PlayerHelper +import com.github.libretube.util.PlayingQueue +import com.github.libretube.util.PreferenceHelper +import com.google.android.exoplayer2.C +import com.google.android.exoplayer2.DefaultLoadControl +import com.google.android.exoplayer2.ExoPlayer +import com.google.android.exoplayer2.MediaItem import com.google.android.exoplayer2.MediaItem.SubtitleConfiguration import com.google.android.exoplayer2.MediaItem.fromUri +import com.google.android.exoplayer2.Player import com.google.android.exoplayer2.audio.AudioAttributes import com.google.android.exoplayer2.ext.cronet.CronetDataSource import com.google.android.exoplayer2.source.DefaultMediaSourceFactory @@ -72,13 +93,13 @@ import com.google.android.exoplayer2.upstream.DefaultDataSource import com.google.android.exoplayer2.upstream.DefaultHttpDataSource import com.google.android.exoplayer2.video.VideoSize import com.google.android.material.dialog.MaterialAlertDialogBuilder -import java.io.IOException -import java.util.concurrent.Executors import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch import org.chromium.net.CronetEngine import retrofit2.HttpException +import java.io.IOException +import java.util.concurrent.Executors import kotlin.math.abs class PlayerFragment : BaseFragment() { @@ -848,9 +869,11 @@ class PlayerFragment : BaseFragment() { return } // position is almost the end of the video => don't seek, start from beginning - if (position != null && position < streams.duration!! * 1000 * 0.9) exoPlayer.seekTo( - position - ) + if (position != null && position < streams.duration!! * 1000 * 0.9) { + exoPlayer.seekTo( + position + ) + } } // used for autoplay and skipping to next video 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 3b4696b67..daac0ed01 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 @@ -18,8 +18,8 @@ import com.github.libretube.extensions.TAG import com.github.libretube.extensions.toID import com.github.libretube.sheets.PlaylistOptionsBottomSheet import com.github.libretube.ui.adapters.PlaylistAdapter -import java.io.IOException import retrofit2.HttpException +import java.io.IOException class PlaylistFragment : BaseFragment() { private lateinit var binding: FragmentPlaylistBinding diff --git a/app/src/main/java/com/github/libretube/ui/fragments/SearchFragment.kt b/app/src/main/java/com/github/libretube/ui/fragments/SearchFragment.kt index fa03a3e71..1e096e471 100644 --- a/app/src/main/java/com/github/libretube/ui/fragments/SearchFragment.kt +++ b/app/src/main/java/com/github/libretube/ui/fragments/SearchFragment.kt @@ -20,8 +20,8 @@ import com.github.libretube.models.SearchViewModel import com.github.libretube.ui.activities.MainActivity import com.github.libretube.ui.adapters.SearchHistoryAdapter import com.github.libretube.ui.adapters.SearchSuggestionsAdapter -import java.io.IOException import retrofit2.HttpException +import java.io.IOException class SearchFragment : BaseFragment() { private lateinit var binding: FragmentSearchBinding 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 091e28229..413eef6e8 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 @@ -20,8 +20,8 @@ import com.github.libretube.extensions.hideKeyboard import com.github.libretube.ui.activities.MainActivity import com.github.libretube.ui.adapters.SearchAdapter import com.github.libretube.util.PreferenceHelper -import java.io.IOException import retrofit2.HttpException +import java.io.IOException class SearchResultFragment : BaseFragment() { private lateinit var binding: FragmentSearchResultBinding diff --git a/app/src/main/java/com/github/libretube/util/ImportHelper.kt b/app/src/main/java/com/github/libretube/util/ImportHelper.kt index 99d5c0f4b..b02c05e65 100644 --- a/app/src/main/java/com/github/libretube/util/ImportHelper.kt +++ b/app/src/main/java/com/github/libretube/util/ImportHelper.kt @@ -11,11 +11,11 @@ import com.github.libretube.api.SubscriptionHelper import com.github.libretube.extensions.TAG import com.github.libretube.obj.NewPipeSubscription import com.github.libretube.obj.NewPipeSubscriptions -import java.io.FileOutputStream import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch import kotlinx.coroutines.runBlocking +import java.io.FileOutputStream class ImportHelper(private val activity: Activity) { /** 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 e79260df0..7780cfbb0 100644 --- a/app/src/main/java/com/github/libretube/util/NotificationHelper.kt +++ b/app/src/main/java/com/github/libretube/util/NotificationHelper.kt @@ -7,7 +7,11 @@ import android.content.Intent import android.os.Build import androidx.core.app.NotificationCompat import androidx.core.app.NotificationManagerCompat -import androidx.work.* +import androidx.work.Constraints +import androidx.work.ExistingPeriodicWorkPolicy +import androidx.work.NetworkType +import androidx.work.PeriodicWorkRequest +import androidx.work.WorkManager import com.github.libretube.R import com.github.libretube.api.RetrofitInstance import com.github.libretube.api.SubscriptionHelper @@ -16,9 +20,9 @@ import com.github.libretube.constants.PUSH_CHANNEL_ID import com.github.libretube.constants.PreferenceKeys import com.github.libretube.extensions.toID import com.github.libretube.ui.activities.MainActivity -import java.util.concurrent.TimeUnit import kotlinx.coroutines.async import kotlinx.coroutines.runBlocking +import java.util.concurrent.TimeUnit class NotificationHelper( private val context: Context