diff --git a/app/build.gradle b/app/build.gradle index 9a5e1cc8e..ab5cf0313 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -13,8 +13,8 @@ android { applicationId 'com.github.libretube' minSdk 21 targetSdk 33 - versionCode 17 - versionName '0.5.0' + versionCode 18 + versionName '0.5.1' multiDexEnabled true testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner' resValue "string", "app_name", "LibreTube" diff --git a/app/release/output-metadata.json b/app/release/output-metadata.json index 07499f0c2..e288a7878 100644 --- a/app/release/output-metadata.json +++ b/app/release/output-metadata.json @@ -11,10 +11,23 @@ "type": "UNIVERSAL", "filters": [], "attributes": [], - "versionCode": 17, - "versionName": "0.5.0", + "versionCode": 18, + "versionName": "0.5.1", "outputFile": "app-universal-release.apk" }, + { + "type": "ONE_OF_MANY", + "filters": [ + { + "filterType": "ABI", + "value": "x86_64" + } + ], + "attributes": [], + "versionCode": 18, + "versionName": "0.5.1", + "outputFile": "app-x86_64-release.apk" + }, { "type": "ONE_OF_MANY", "filters": [ @@ -24,8 +37,8 @@ } ], "attributes": [], - "versionCode": 17, - "versionName": "0.5.0", + "versionCode": 18, + "versionName": "0.5.1", "outputFile": "app-armeabi-v7a-release.apk" }, { @@ -37,8 +50,8 @@ } ], "attributes": [], - "versionCode": 17, - "versionName": "0.5.0", + "versionCode": 18, + "versionName": "0.5.1", "outputFile": "app-x86-release.apk" }, { @@ -50,22 +63,9 @@ } ], "attributes": [], - "versionCode": 17, - "versionName": "0.5.0", + "versionCode": 18, + "versionName": "0.5.1", "outputFile": "app-arm64-v8a-release.apk" - }, - { - "type": "ONE_OF_MANY", - "filters": [ - { - "filterType": "ABI", - "value": "x86_64" - } - ], - "attributes": [], - "versionCode": 17, - "versionName": "0.5.0", - "outputFile": "app-x86_64-release.apk" } ], "elementType": "File" diff --git a/app/src/main/java/com/github/libretube/MyApp.kt b/app/src/main/java/com/github/libretube/MyApp.kt index 140298946..a8de7b991 100644 --- a/app/src/main/java/com/github/libretube/MyApp.kt +++ b/app/src/main/java/com/github/libretube/MyApp.kt @@ -13,14 +13,14 @@ import com.fasterxml.jackson.core.type.TypeReference import com.fasterxml.jackson.databind.ObjectMapper import com.github.libretube.api.CronetHelper import com.github.libretube.api.RetrofitInstance +import com.github.libretube.constants.PreferenceKeys import com.github.libretube.db.DatabaseHolder import com.github.libretube.db.obj.WatchHistoryItem import com.github.libretube.db.obj.WatchPosition -import com.github.libretube.preferences.PreferenceHelper -import com.github.libretube.preferences.PreferenceKeys import com.github.libretube.util.ExceptionHandler import com.github.libretube.util.ImageHelper import com.github.libretube.util.NotificationHelper +import com.github.libretube.util.PreferenceHelper class MyApp : Application() { override fun onCreate() { diff --git a/app/src/main/java/com/github/libretube/activities/AboutActivity.kt b/app/src/main/java/com/github/libretube/activities/AboutActivity.kt index f2e7a514d..cf7132c67 100644 --- a/app/src/main/java/com/github/libretube/activities/AboutActivity.kt +++ b/app/src/main/java/com/github/libretube/activities/AboutActivity.kt @@ -8,13 +8,13 @@ import android.net.Uri import android.os.Build import android.os.Bundle import android.text.Html -import com.github.libretube.DONATE_URL -import com.github.libretube.GITHUB_URL -import com.github.libretube.LICENSE_URL -import com.github.libretube.PIPED_GITHUB_URL import com.github.libretube.R -import com.github.libretube.WEBLATE_URL -import com.github.libretube.WEBSITE_URL +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/activities/CommunityActivity.kt b/app/src/main/java/com/github/libretube/activities/CommunityActivity.kt index 7fe9f2211..d4d1f57e0 100644 --- a/app/src/main/java/com/github/libretube/activities/CommunityActivity.kt +++ b/app/src/main/java/com/github/libretube/activities/CommunityActivity.kt @@ -3,11 +3,11 @@ package com.github.libretube.activities import android.content.Intent import android.net.Uri import android.os.Bundle -import com.github.libretube.DISCORD_URL -import com.github.libretube.MATRIX_URL -import com.github.libretube.REDDIT_URL -import com.github.libretube.TELEGRAM_URL -import com.github.libretube.TWITTER_URL +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/activities/MainActivity.kt b/app/src/main/java/com/github/libretube/activities/MainActivity.kt index 0079e37c9..a0cbaed35 100644 --- a/app/src/main/java/com/github/libretube/activities/MainActivity.kt +++ b/app/src/main/java/com/github/libretube/activities/MainActivity.kt @@ -27,6 +27,7 @@ import androidx.navigation.NavController import androidx.navigation.findNavController import androidx.navigation.ui.setupWithNavController import com.github.libretube.R +import com.github.libretube.constants.PreferenceKeys import com.github.libretube.databinding.ActivityMainBinding import com.github.libretube.dialogs.ErrorDialog import com.github.libretube.extensions.BaseActivity @@ -34,10 +35,9 @@ import com.github.libretube.extensions.TAG import com.github.libretube.fragments.PlayerFragment import com.github.libretube.models.PlayerViewModel import com.github.libretube.models.SearchViewModel -import com.github.libretube.preferences.PreferenceHelper -import com.github.libretube.preferences.PreferenceKeys import com.github.libretube.services.ClosingService import com.github.libretube.util.NetworkHelper +import com.github.libretube.util.PreferenceHelper import com.github.libretube.util.ThemeHelper import com.google.android.material.dialog.MaterialAlertDialogBuilder import com.google.android.material.elevation.SurfaceColors @@ -167,15 +167,13 @@ class MainActivity : BaseActivity() { if (binding.mainMotionLayout.progress == 0F) { try { minimizePlayer() + return } catch (e: Exception) { - if (navController.currentDestination?.id == startFragmentId) { - // close app - moveTaskToBack(true) - } else { - navController.popBackStack() - } + // current fragment isn't the player fragment } - } else if (navController.currentDestination?.id == startFragmentId) { + } + + if (navController.currentDestination?.id == startFragmentId) { moveTaskToBack(true) } else { navController.popBackStack() diff --git a/app/src/main/java/com/github/libretube/adapters/PlaylistAdapter.kt b/app/src/main/java/com/github/libretube/adapters/PlaylistAdapter.kt index 7127d1e81..f00a70e32 100644 --- a/app/src/main/java/com/github/libretube/adapters/PlaylistAdapter.kt +++ b/app/src/main/java/com/github/libretube/adapters/PlaylistAdapter.kt @@ -16,9 +16,9 @@ import com.github.libretube.extensions.setWatchProgressLength import com.github.libretube.extensions.toID import com.github.libretube.obj.PlaylistId import com.github.libretube.obj.StreamItem -import com.github.libretube.preferences.PreferenceHelper import com.github.libretube.util.ImageHelper import com.github.libretube.util.NavigationHelper +import com.github.libretube.util.PreferenceHelper import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch diff --git a/app/src/main/java/com/github/libretube/adapters/PlaylistsAdapter.kt b/app/src/main/java/com/github/libretube/adapters/PlaylistsAdapter.kt index 55a146a73..4f5b8457a 100644 --- a/app/src/main/java/com/github/libretube/adapters/PlaylistsAdapter.kt +++ b/app/src/main/java/com/github/libretube/adapters/PlaylistsAdapter.kt @@ -13,9 +13,9 @@ import com.github.libretube.dialogs.PlaylistOptionsDialog import com.github.libretube.extensions.TAG import com.github.libretube.obj.PlaylistId import com.github.libretube.obj.Playlists -import com.github.libretube.preferences.PreferenceHelper 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 kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Dispatchers 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 aec89d9e8..8360ab3f9 100644 --- a/app/src/main/java/com/github/libretube/api/SubscriptionHelper.kt +++ b/app/src/main/java/com/github/libretube/api/SubscriptionHelper.kt @@ -6,7 +6,7 @@ import com.github.libretube.db.obj.LocalSubscription import com.github.libretube.extensions.TAG import com.github.libretube.extensions.await import com.github.libretube.obj.Subscribe -import com.github.libretube.preferences.PreferenceHelper +import com.github.libretube.util.PreferenceHelper import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch diff --git a/app/src/main/java/com/github/libretube/Constants.kt b/app/src/main/java/com/github/libretube/constants/Constants.kt similarity index 97% rename from app/src/main/java/com/github/libretube/Constants.kt rename to app/src/main/java/com/github/libretube/constants/Constants.kt index 9cb03468f..51dde19c2 100644 --- a/app/src/main/java/com/github/libretube/Constants.kt +++ b/app/src/main/java/com/github/libretube/constants/Constants.kt @@ -1,4 +1,4 @@ -package com.github.libretube +package com.github.libretube.constants /** * API link for the update checker diff --git a/app/src/main/java/com/github/libretube/preferences/PreferenceKeys.kt b/app/src/main/java/com/github/libretube/constants/PreferenceKeys.kt similarity index 98% rename from app/src/main/java/com/github/libretube/preferences/PreferenceKeys.kt rename to app/src/main/java/com/github/libretube/constants/PreferenceKeys.kt index c35622a02..58b229eae 100644 --- a/app/src/main/java/com/github/libretube/preferences/PreferenceKeys.kt +++ b/app/src/main/java/com/github/libretube/constants/PreferenceKeys.kt @@ -1,4 +1,4 @@ -package com.github.libretube.preferences +package com.github.libretube.constants /** * keys for the shared preferences diff --git a/app/src/main/java/com/github/libretube/preferences/PreferenceRanges.kt b/app/src/main/java/com/github/libretube/constants/PreferenceRanges.kt similarity index 84% rename from app/src/main/java/com/github/libretube/preferences/PreferenceRanges.kt rename to app/src/main/java/com/github/libretube/constants/PreferenceRanges.kt index 36fffda11..a82e623d3 100644 --- a/app/src/main/java/com/github/libretube/preferences/PreferenceRanges.kt +++ b/app/src/main/java/com/github/libretube/constants/PreferenceRanges.kt @@ -1,4 +1,4 @@ -package com.github.libretube.preferences +package com.github.libretube.constants import com.github.libretube.obj.SliderRange 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 664def33d..c129d8a97 100644 --- a/app/src/main/java/com/github/libretube/db/DatabaseHelper.kt +++ b/app/src/main/java/com/github/libretube/db/DatabaseHelper.kt @@ -1,12 +1,12 @@ package com.github.libretube.db +import com.github.libretube.constants.PreferenceKeys import com.github.libretube.db.obj.SearchHistoryItem import com.github.libretube.db.obj.WatchHistoryItem import com.github.libretube.db.obj.WatchPosition import com.github.libretube.extensions.toID import com.github.libretube.obj.Streams -import com.github.libretube.preferences.PreferenceHelper -import com.github.libretube.preferences.PreferenceKeys +import com.github.libretube.util.PreferenceHelper object DatabaseHelper { fun addToWatchHistory(videoId: String, streams: Streams) { diff --git a/app/src/main/java/com/github/libretube/db/DatabaseHolder.kt b/app/src/main/java/com/github/libretube/db/DatabaseHolder.kt index 2d92fdbcc..16e47e1f3 100644 --- a/app/src/main/java/com/github/libretube/db/DatabaseHolder.kt +++ b/app/src/main/java/com/github/libretube/db/DatabaseHolder.kt @@ -2,7 +2,7 @@ package com.github.libretube.db import android.content.Context import androidx.room.Room -import com.github.libretube.DATABASE_NAME +import com.github.libretube.constants.DATABASE_NAME object DatabaseHolder { lateinit var db: AppDatabase diff --git a/app/src/main/java/com/github/libretube/dialogs/AddToPlaylistDialog.kt b/app/src/main/java/com/github/libretube/dialogs/AddToPlaylistDialog.kt index 1e21cbdf4..9855ed794 100644 --- a/app/src/main/java/com/github/libretube/dialogs/AddToPlaylistDialog.kt +++ b/app/src/main/java/com/github/libretube/dialogs/AddToPlaylistDialog.kt @@ -15,7 +15,7 @@ import com.github.libretube.databinding.DialogAddtoplaylistBinding import com.github.libretube.extensions.TAG import com.github.libretube.models.PlaylistViewModel import com.github.libretube.obj.PlaylistId -import com.github.libretube.preferences.PreferenceHelper +import com.github.libretube.util.PreferenceHelper import com.github.libretube.util.ThemeHelper import com.google.android.material.dialog.MaterialAlertDialogBuilder import retrofit2.HttpException diff --git a/app/src/main/java/com/github/libretube/dialogs/CreatePlaylistDialog.kt b/app/src/main/java/com/github/libretube/dialogs/CreatePlaylistDialog.kt index 66f6c10e8..eefb9256f 100644 --- a/app/src/main/java/com/github/libretube/dialogs/CreatePlaylistDialog.kt +++ b/app/src/main/java/com/github/libretube/dialogs/CreatePlaylistDialog.kt @@ -12,7 +12,7 @@ import com.github.libretube.databinding.DialogCreatePlaylistBinding import com.github.libretube.extensions.TAG import com.github.libretube.fragments.LibraryFragment import com.github.libretube.obj.Playlists -import com.github.libretube.preferences.PreferenceHelper +import com.github.libretube.util.PreferenceHelper import com.github.libretube.util.ThemeHelper import com.google.android.material.dialog.MaterialAlertDialogBuilder import retrofit2.HttpException diff --git a/app/src/main/java/com/github/libretube/dialogs/DeleteAccountDialog.kt b/app/src/main/java/com/github/libretube/dialogs/DeleteAccountDialog.kt index 1cb5e039c..323875e06 100644 --- a/app/src/main/java/com/github/libretube/dialogs/DeleteAccountDialog.kt +++ b/app/src/main/java/com/github/libretube/dialogs/DeleteAccountDialog.kt @@ -11,7 +11,7 @@ import com.github.libretube.api.RetrofitInstance import com.github.libretube.databinding.DialogDeleteAccountBinding import com.github.libretube.extensions.TAG import com.github.libretube.obj.DeleteUserRequest -import com.github.libretube.preferences.PreferenceHelper +import com.github.libretube.util.PreferenceHelper import com.github.libretube.util.ThemeHelper import com.google.android.material.dialog.MaterialAlertDialogBuilder diff --git a/app/src/main/java/com/github/libretube/dialogs/ErrorDialog.kt b/app/src/main/java/com/github/libretube/dialogs/ErrorDialog.kt index cd0ac0b01..66dc11a6a 100644 --- a/app/src/main/java/com/github/libretube/dialogs/ErrorDialog.kt +++ b/app/src/main/java/com/github/libretube/dialogs/ErrorDialog.kt @@ -8,7 +8,7 @@ import android.os.Bundle import android.widget.Toast import androidx.fragment.app.DialogFragment import com.github.libretube.R -import com.github.libretube.preferences.PreferenceHelper +import com.github.libretube.util.PreferenceHelper import com.google.android.material.dialog.MaterialAlertDialogBuilder class ErrorDialog : DialogFragment() { diff --git a/app/src/main/java/com/github/libretube/dialogs/LoginDialog.kt b/app/src/main/java/com/github/libretube/dialogs/LoginDialog.kt index dea8cc329..4777bc4ca 100644 --- a/app/src/main/java/com/github/libretube/dialogs/LoginDialog.kt +++ b/app/src/main/java/com/github/libretube/dialogs/LoginDialog.kt @@ -11,7 +11,7 @@ import com.github.libretube.api.RetrofitInstance import com.github.libretube.databinding.DialogLoginBinding import com.github.libretube.extensions.TAG import com.github.libretube.obj.Login -import com.github.libretube.preferences.PreferenceHelper +import com.github.libretube.util.PreferenceHelper import com.github.libretube.util.ThemeHelper import com.google.android.material.dialog.MaterialAlertDialogBuilder import retrofit2.HttpException diff --git a/app/src/main/java/com/github/libretube/dialogs/LogoutDialog.kt b/app/src/main/java/com/github/libretube/dialogs/LogoutDialog.kt index c5dd117d7..b4df8e9a9 100644 --- a/app/src/main/java/com/github/libretube/dialogs/LogoutDialog.kt +++ b/app/src/main/java/com/github/libretube/dialogs/LogoutDialog.kt @@ -6,7 +6,7 @@ import android.widget.Toast import androidx.fragment.app.DialogFragment import com.github.libretube.R import com.github.libretube.databinding.DialogLogoutBinding -import com.github.libretube.preferences.PreferenceHelper +import com.github.libretube.util.PreferenceHelper import com.github.libretube.util.ThemeHelper import com.google.android.material.dialog.MaterialAlertDialogBuilder diff --git a/app/src/main/java/com/github/libretube/dialogs/PlaylistOptionsDialog.kt b/app/src/main/java/com/github/libretube/dialogs/PlaylistOptionsDialog.kt index dcc8557af..57402c18b 100644 --- a/app/src/main/java/com/github/libretube/dialogs/PlaylistOptionsDialog.kt +++ b/app/src/main/java/com/github/libretube/dialogs/PlaylistOptionsDialog.kt @@ -11,8 +11,8 @@ import com.github.libretube.api.RetrofitInstance import com.github.libretube.extensions.TAG import com.github.libretube.extensions.toID import com.github.libretube.obj.PlaylistId -import com.github.libretube.preferences.PreferenceHelper import com.github.libretube.util.BackgroundHelper +import com.github.libretube.util.PreferenceHelper import com.google.android.material.dialog.MaterialAlertDialogBuilder import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Dispatchers diff --git a/app/src/main/java/com/github/libretube/dialogs/ShareDialog.kt b/app/src/main/java/com/github/libretube/dialogs/ShareDialog.kt index f46306cf6..746aa2597 100644 --- a/app/src/main/java/com/github/libretube/dialogs/ShareDialog.kt +++ b/app/src/main/java/com/github/libretube/dialogs/ShareDialog.kt @@ -4,15 +4,15 @@ import android.app.Dialog import android.content.Intent import android.os.Bundle import androidx.fragment.app.DialogFragment -import com.github.libretube.PIPED_FRONTEND_URL import com.github.libretube.R -import com.github.libretube.YOUTUBE_FRONTEND_URL +import com.github.libretube.constants.PIPED_FRONTEND_URL +import com.github.libretube.constants.PreferenceKeys +import com.github.libretube.constants.YOUTUBE_FRONTEND_URL import com.github.libretube.databinding.DialogShareBinding import com.github.libretube.db.DatabaseHolder import com.github.libretube.db.obj.CustomInstance import com.github.libretube.extensions.await -import com.github.libretube.preferences.PreferenceHelper -import com.github.libretube.preferences.PreferenceKeys +import com.github.libretube.util.PreferenceHelper import com.google.android.material.dialog.MaterialAlertDialogBuilder class ShareDialog( diff --git a/app/src/main/java/com/github/libretube/dialogs/VideoOptionsDialog.kt b/app/src/main/java/com/github/libretube/dialogs/VideoOptionsDialog.kt index 0df687c03..8793146ec 100644 --- a/app/src/main/java/com/github/libretube/dialogs/VideoOptionsDialog.kt +++ b/app/src/main/java/com/github/libretube/dialogs/VideoOptionsDialog.kt @@ -8,10 +8,10 @@ import android.widget.ArrayAdapter import android.widget.Toast import androidx.fragment.app.DialogFragment import com.github.libretube.Globals -import com.github.libretube.PLAYER_NOTIFICATION_ID import com.github.libretube.R -import com.github.libretube.preferences.PreferenceHelper +import com.github.libretube.constants.PLAYER_NOTIFICATION_ID import com.github.libretube.util.BackgroundHelper +import com.github.libretube.util.PreferenceHelper import com.google.android.material.dialog.MaterialAlertDialogBuilder /** diff --git a/app/src/main/java/com/github/libretube/extensions/SliderPreference.kt b/app/src/main/java/com/github/libretube/extensions/SliderPreference.kt index c37fb9dc7..324a1f9de 100644 --- a/app/src/main/java/com/github/libretube/extensions/SliderPreference.kt +++ b/app/src/main/java/com/github/libretube/extensions/SliderPreference.kt @@ -5,10 +5,10 @@ import android.util.AttributeSet import android.view.LayoutInflater import androidx.preference.Preference import com.github.libretube.R +import com.github.libretube.constants.PreferenceKeys +import com.github.libretube.constants.PreferenceRanges import com.github.libretube.databinding.DialogSliderBinding -import com.github.libretube.preferences.PreferenceHelper -import com.github.libretube.preferences.PreferenceKeys -import com.github.libretube.preferences.PreferenceRanges +import com.github.libretube.util.PreferenceHelper import com.google.android.material.dialog.MaterialAlertDialogBuilder /** diff --git a/app/src/main/java/com/github/libretube/fragments/HomeFragment.kt b/app/src/main/java/com/github/libretube/fragments/HomeFragment.kt index 6312f9dbe..380724629 100644 --- a/app/src/main/java/com/github/libretube/fragments/HomeFragment.kt +++ b/app/src/main/java/com/github/libretube/fragments/HomeFragment.kt @@ -11,12 +11,12 @@ import androidx.recyclerview.widget.GridLayoutManager import com.github.libretube.R import com.github.libretube.adapters.TrendingAdapter import com.github.libretube.api.RetrofitInstance +import com.github.libretube.constants.PreferenceKeys import com.github.libretube.databinding.FragmentHomeBinding import com.github.libretube.extensions.BaseFragment import com.github.libretube.extensions.TAG -import com.github.libretube.preferences.PreferenceHelper -import com.github.libretube.preferences.PreferenceKeys import com.github.libretube.util.LocaleHelper +import com.github.libretube.util.PreferenceHelper import retrofit2.HttpException import java.io.IOException diff --git a/app/src/main/java/com/github/libretube/fragments/LibraryFragment.kt b/app/src/main/java/com/github/libretube/fragments/LibraryFragment.kt index 2e73b6c50..b47b06ce5 100644 --- a/app/src/main/java/com/github/libretube/fragments/LibraryFragment.kt +++ b/app/src/main/java/com/github/libretube/fragments/LibraryFragment.kt @@ -14,13 +14,13 @@ import androidx.recyclerview.widget.RecyclerView import com.github.libretube.R import com.github.libretube.adapters.PlaylistsAdapter import com.github.libretube.api.RetrofitInstance +import com.github.libretube.constants.PreferenceKeys import com.github.libretube.databinding.FragmentLibraryBinding import com.github.libretube.dialogs.CreatePlaylistDialog import com.github.libretube.extensions.BaseFragment import com.github.libretube.extensions.TAG import com.github.libretube.models.PlayerViewModel -import com.github.libretube.preferences.PreferenceHelper -import com.github.libretube.preferences.PreferenceKeys +import com.github.libretube.util.PreferenceHelper import retrofit2.HttpException import java.io.IOException diff --git a/app/src/main/java/com/github/libretube/fragments/PlayerFragment.kt b/app/src/main/java/com/github/libretube/fragments/PlayerFragment.kt index 8c23ec527..8de655787 100644 --- a/app/src/main/java/com/github/libretube/fragments/PlayerFragment.kt +++ b/app/src/main/java/com/github/libretube/fragments/PlayerFragment.kt @@ -44,6 +44,8 @@ import com.github.libretube.adapters.TrendingAdapter import com.github.libretube.api.CronetHelper import com.github.libretube.api.RetrofitInstance import com.github.libretube.api.SubscriptionHelper +import com.github.libretube.constants.PreferenceKeys +import com.github.libretube.constants.PreferenceRanges import com.github.libretube.databinding.DialogSliderBinding import com.github.libretube.databinding.DoubleTapOverlayBinding import com.github.libretube.databinding.ExoStyledPlayerControlViewBinding @@ -67,15 +69,13 @@ import com.github.libretube.obj.ChapterSegment import com.github.libretube.obj.Segment import com.github.libretube.obj.Segments import com.github.libretube.obj.Streams -import com.github.libretube.preferences.PreferenceHelper -import com.github.libretube.preferences.PreferenceKeys -import com.github.libretube.preferences.PreferenceRanges import com.github.libretube.services.BackgroundMode import com.github.libretube.util.AutoPlayHelper import com.github.libretube.util.BackgroundHelper import com.github.libretube.util.ImageHelper import com.github.libretube.util.NowPlayingNotification import com.github.libretube.util.PlayerHelper +import com.github.libretube.util.PreferenceHelper import com.github.libretube.views.PlayerOptionsBottomSheet import com.google.android.exoplayer2.C import com.google.android.exoplayer2.DefaultLoadControl diff --git a/app/src/main/java/com/github/libretube/fragments/SearchResultFragment.kt b/app/src/main/java/com/github/libretube/fragments/SearchResultFragment.kt index 1ee58b55b..dbc6a5bf1 100644 --- a/app/src/main/java/com/github/libretube/fragments/SearchResultFragment.kt +++ b/app/src/main/java/com/github/libretube/fragments/SearchResultFragment.kt @@ -12,14 +12,14 @@ import com.github.libretube.R import com.github.libretube.activities.MainActivity import com.github.libretube.adapters.SearchAdapter import com.github.libretube.api.RetrofitInstance +import com.github.libretube.constants.PreferenceKeys import com.github.libretube.databinding.FragmentSearchResultBinding import com.github.libretube.db.DatabaseHelper import com.github.libretube.db.obj.SearchHistoryItem import com.github.libretube.extensions.BaseFragment import com.github.libretube.extensions.TAG import com.github.libretube.extensions.hideKeyboard -import com.github.libretube.preferences.PreferenceHelper -import com.github.libretube.preferences.PreferenceKeys +import com.github.libretube.util.PreferenceHelper import retrofit2.HttpException import java.io.IOException diff --git a/app/src/main/java/com/github/libretube/fragments/SubscriptionsFragment.kt b/app/src/main/java/com/github/libretube/fragments/SubscriptionsFragment.kt index 6abd2b0ad..2d47e8ad1 100644 --- a/app/src/main/java/com/github/libretube/fragments/SubscriptionsFragment.kt +++ b/app/src/main/java/com/github/libretube/fragments/SubscriptionsFragment.kt @@ -12,11 +12,11 @@ import com.github.libretube.R import com.github.libretube.adapters.LegacySubscriptionAdapter import com.github.libretube.adapters.SubscriptionChannelAdapter import com.github.libretube.adapters.TrendingAdapter +import com.github.libretube.constants.PreferenceKeys import com.github.libretube.databinding.FragmentSubscriptionsBinding import com.github.libretube.extensions.BaseFragment import com.github.libretube.models.SubscriptionsViewModel -import com.github.libretube.preferences.PreferenceHelper -import com.github.libretube.preferences.PreferenceKeys +import com.github.libretube.util.PreferenceHelper import com.google.android.material.dialog.MaterialAlertDialogBuilder class SubscriptionsFragment : BaseFragment() { diff --git a/app/src/main/java/com/github/libretube/models/SubscriptionsViewModel.kt b/app/src/main/java/com/github/libretube/models/SubscriptionsViewModel.kt index a1c6c8cfc..4dd633a87 100644 --- a/app/src/main/java/com/github/libretube/models/SubscriptionsViewModel.kt +++ b/app/src/main/java/com/github/libretube/models/SubscriptionsViewModel.kt @@ -9,7 +9,7 @@ import com.github.libretube.extensions.TAG import com.github.libretube.extensions.toID import com.github.libretube.obj.StreamItem import com.github.libretube.obj.Subscription -import com.github.libretube.preferences.PreferenceHelper +import com.github.libretube.util.PreferenceHelper import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch diff --git a/app/src/main/java/com/github/libretube/preferences/AdvancedSettings.kt b/app/src/main/java/com/github/libretube/preferences/AdvancedSettings.kt index c5adbfe2a..1b17b4894 100644 --- a/app/src/main/java/com/github/libretube/preferences/AdvancedSettings.kt +++ b/app/src/main/java/com/github/libretube/preferences/AdvancedSettings.kt @@ -9,8 +9,10 @@ import androidx.preference.ListPreference import androidx.preference.Preference import com.github.libretube.R import com.github.libretube.activities.SettingsActivity +import com.github.libretube.constants.PreferenceKeys import com.github.libretube.util.BackupHelper import com.github.libretube.util.ImageHelper +import com.github.libretube.util.PreferenceHelper import com.github.libretube.views.MaterialPreferenceFragment import com.google.android.material.dialog.MaterialAlertDialogBuilder diff --git a/app/src/main/java/com/github/libretube/preferences/AppearanceSettings.kt b/app/src/main/java/com/github/libretube/preferences/AppearanceSettings.kt index a5dde2c12..4299bcd34 100644 --- a/app/src/main/java/com/github/libretube/preferences/AppearanceSettings.kt +++ b/app/src/main/java/com/github/libretube/preferences/AppearanceSettings.kt @@ -10,7 +10,9 @@ import androidx.preference.Preference import androidx.preference.SwitchPreferenceCompat import com.github.libretube.R import com.github.libretube.activities.SettingsActivity +import com.github.libretube.constants.PreferenceKeys import com.github.libretube.dialogs.RequireRestartDialog +import com.github.libretube.util.PreferenceHelper import com.github.libretube.util.ThemeHelper import com.github.libretube.views.MaterialPreferenceFragment import com.google.android.material.color.DynamicColors diff --git a/app/src/main/java/com/github/libretube/preferences/GeneralSettings.kt b/app/src/main/java/com/github/libretube/preferences/GeneralSettings.kt index e519e1b72..6393dff6e 100644 --- a/app/src/main/java/com/github/libretube/preferences/GeneralSettings.kt +++ b/app/src/main/java/com/github/libretube/preferences/GeneralSettings.kt @@ -6,7 +6,9 @@ import androidx.preference.ListPreference import androidx.preference.SwitchPreferenceCompat import com.github.libretube.R import com.github.libretube.activities.SettingsActivity +import com.github.libretube.constants.PreferenceKeys import com.github.libretube.dialogs.RequireRestartDialog +import com.github.libretube.util.PreferenceHelper import com.github.libretube.views.MaterialPreferenceFragment class GeneralSettings : MaterialPreferenceFragment() { diff --git a/app/src/main/java/com/github/libretube/preferences/HistorySettings.kt b/app/src/main/java/com/github/libretube/preferences/HistorySettings.kt index d871fd24a..ad3d0895b 100644 --- a/app/src/main/java/com/github/libretube/preferences/HistorySettings.kt +++ b/app/src/main/java/com/github/libretube/preferences/HistorySettings.kt @@ -4,6 +4,7 @@ import android.os.Bundle import androidx.preference.Preference import com.github.libretube.R import com.github.libretube.activities.SettingsActivity +import com.github.libretube.constants.PreferenceKeys import com.github.libretube.db.DatabaseHolder import com.github.libretube.views.MaterialPreferenceFragment import com.google.android.material.dialog.MaterialAlertDialogBuilder diff --git a/app/src/main/java/com/github/libretube/preferences/InstanceSettings.kt b/app/src/main/java/com/github/libretube/preferences/InstanceSettings.kt index 15b966bf2..72d27726a 100644 --- a/app/src/main/java/com/github/libretube/preferences/InstanceSettings.kt +++ b/app/src/main/java/com/github/libretube/preferences/InstanceSettings.kt @@ -14,6 +14,7 @@ import androidx.preference.SwitchPreferenceCompat import com.github.libretube.R import com.github.libretube.activities.SettingsActivity import com.github.libretube.api.RetrofitInstance +import com.github.libretube.constants.PreferenceKeys import com.github.libretube.db.DatabaseHolder import com.github.libretube.db.obj.CustomInstance import com.github.libretube.dialogs.CustomInstanceDialog @@ -23,6 +24,7 @@ import com.github.libretube.dialogs.LogoutDialog import com.github.libretube.extensions.await import com.github.libretube.util.ImportHelper import com.github.libretube.util.PermissionHelper +import com.github.libretube.util.PreferenceHelper import com.github.libretube.views.MaterialPreferenceFragment class InstanceSettings : MaterialPreferenceFragment() { diff --git a/app/src/main/java/com/github/libretube/preferences/NotificationSettings.kt b/app/src/main/java/com/github/libretube/preferences/NotificationSettings.kt index e3740a0e4..0e12388e8 100644 --- a/app/src/main/java/com/github/libretube/preferences/NotificationSettings.kt +++ b/app/src/main/java/com/github/libretube/preferences/NotificationSettings.kt @@ -6,6 +6,7 @@ import androidx.preference.SwitchPreferenceCompat import androidx.work.ExistingPeriodicWorkPolicy import com.github.libretube.R import com.github.libretube.activities.SettingsActivity +import com.github.libretube.constants.PreferenceKeys import com.github.libretube.util.NotificationHelper import com.github.libretube.views.MaterialPreferenceFragment diff --git a/app/src/main/java/com/github/libretube/preferences/PlayerSettings.kt b/app/src/main/java/com/github/libretube/preferences/PlayerSettings.kt index 3e75a6dea..90ff99b20 100644 --- a/app/src/main/java/com/github/libretube/preferences/PlayerSettings.kt +++ b/app/src/main/java/com/github/libretube/preferences/PlayerSettings.kt @@ -6,6 +6,8 @@ import androidx.preference.Preference import androidx.preference.SwitchPreferenceCompat import com.github.libretube.R import com.github.libretube.activities.SettingsActivity +import com.github.libretube.constants.PreferenceKeys +import com.github.libretube.util.PreferenceHelper import com.github.libretube.views.MaterialPreferenceFragment import java.util.* 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 0806ee2dc..e914b0bab 100644 --- a/app/src/main/java/com/github/libretube/services/BackgroundMode.kt +++ b/app/src/main/java/com/github/libretube/services/BackgroundMode.kt @@ -11,20 +11,20 @@ import android.os.IBinder import android.os.Looper import android.widget.Toast import com.fasterxml.jackson.databind.ObjectMapper -import com.github.libretube.BACKGROUND_CHANNEL_ID import com.github.libretube.Globals -import com.github.libretube.PLAYER_NOTIFICATION_ID import com.github.libretube.R import com.github.libretube.api.RetrofitInstance +import com.github.libretube.constants.BACKGROUND_CHANNEL_ID +import com.github.libretube.constants.PLAYER_NOTIFICATION_ID +import com.github.libretube.constants.PreferenceKeys import com.github.libretube.extensions.toID import com.github.libretube.obj.Segment import com.github.libretube.obj.Segments import com.github.libretube.obj.Streams -import com.github.libretube.preferences.PreferenceHelper -import com.github.libretube.preferences.PreferenceKeys import com.github.libretube.util.AutoPlayHelper import com.github.libretube.util.NowPlayingNotification import com.github.libretube.util.PlayerHelper +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/services/ClosingService.kt b/app/src/main/java/com/github/libretube/services/ClosingService.kt index 20382b94a..ad3f48a14 100644 --- a/app/src/main/java/com/github/libretube/services/ClosingService.kt +++ b/app/src/main/java/com/github/libretube/services/ClosingService.kt @@ -6,7 +6,7 @@ import android.content.Context import android.content.Intent import android.os.IBinder import androidx.annotation.Nullable -import com.github.libretube.PLAYER_NOTIFICATION_ID +import com.github.libretube.constants.PLAYER_NOTIFICATION_ID class ClosingService : Service() { 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 8f00d9971..8a2b24b26 100644 --- a/app/src/main/java/com/github/libretube/services/DownloadService.kt +++ b/app/src/main/java/com/github/libretube/services/DownloadService.kt @@ -17,16 +17,16 @@ import android.os.IBinder import android.util.Log import androidx.core.app.NotificationCompat import androidx.core.app.NotificationManagerCompat -import com.github.libretube.DOWNLOAD_CHANNEL_ID -import com.github.libretube.DOWNLOAD_FAILURE_NOTIFICATION_ID -import com.github.libretube.DOWNLOAD_PENDING_NOTIFICATION_ID -import com.github.libretube.DOWNLOAD_SUCCESS_NOTIFICATION_ID import com.github.libretube.Globals import com.github.libretube.R +import com.github.libretube.constants.DOWNLOAD_CHANNEL_ID +import com.github.libretube.constants.DOWNLOAD_FAILURE_NOTIFICATION_ID +import com.github.libretube.constants.DOWNLOAD_PENDING_NOTIFICATION_ID +import com.github.libretube.constants.DOWNLOAD_SUCCESS_NOTIFICATION_ID +import com.github.libretube.constants.PreferenceKeys import com.github.libretube.extensions.TAG import com.github.libretube.obj.DownloadType -import com.github.libretube.preferences.PreferenceHelper -import com.github.libretube.preferences.PreferenceKeys +import com.github.libretube.util.PreferenceHelper import java.io.File class DownloadService : Service() { @@ -180,8 +180,7 @@ class DownloadService : Service() { } private fun downloadNotification(intent: Intent) { - var pendingIntent: PendingIntent? = null - pendingIntent = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) { + val pendingIntent = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) { PendingIntent.getActivity(this, 0, intent, PendingIntent.FLAG_MUTABLE) } else { PendingIntent.getActivity(this, 0, intent, PendingIntent.FLAG_ONE_SHOT) @@ -234,7 +233,14 @@ class DownloadService : Service() { Globals.IS_DOWNLOAD_RUNNING = false Log.d(TAG(), "dl finished!") - stopForeground(true) + + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { + stopForeground(STOP_FOREGROUND_REMOVE) + } else { + @Suppress("DEPRECATION") + stopForeground(true) + } + stopService(Intent(this@DownloadService, DownloadService::class.java)) super.onDestroy() } diff --git a/app/src/main/java/com/github/libretube/update/UpdateChecker.kt b/app/src/main/java/com/github/libretube/update/UpdateChecker.kt index a2246d7d9..693a50d15 100644 --- a/app/src/main/java/com/github/libretube/update/UpdateChecker.kt +++ b/app/src/main/java/com/github/libretube/update/UpdateChecker.kt @@ -1,7 +1,7 @@ package com.github.libretube.update import com.fasterxml.jackson.databind.ObjectMapper -import com.github.libretube.GITHUB_API_URL +import com.github.libretube.constants.GITHUB_API_URL import com.github.libretube.extensions.await import java.net.URL @@ -9,7 +9,7 @@ object UpdateChecker { fun getLatestReleaseInfo(): UpdateInfo? { var versionInfo: UpdateInfo? = null // run http request as thread to make it async - val thread = Thread { + Thread { // otherwise crashes without internet versionInfo = getUpdateInfo() try { 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 af8185c84..3d790d7c8 100644 --- a/app/src/main/java/com/github/libretube/util/ExceptionHandler.kt +++ b/app/src/main/java/com/github/libretube/util/ExceptionHandler.kt @@ -1,7 +1,5 @@ package com.github.libretube.util -import com.github.libretube.preferences.PreferenceHelper - class ExceptionHandler( private val defaultExceptionHandler: Thread.UncaughtExceptionHandler? ) : Thread.UncaughtExceptionHandler { diff --git a/app/src/main/java/com/github/libretube/util/ImageHelper.kt b/app/src/main/java/com/github/libretube/util/ImageHelper.kt index 187886649..8b1bcc2be 100644 --- a/app/src/main/java/com/github/libretube/util/ImageHelper.kt +++ b/app/src/main/java/com/github/libretube/util/ImageHelper.kt @@ -6,8 +6,7 @@ import coil.ImageLoader import coil.disk.DiskCache import coil.load import com.github.libretube.api.CronetHelper -import com.github.libretube.preferences.PreferenceHelper -import com.github.libretube.preferences.PreferenceKeys +import com.github.libretube.constants.PreferenceKeys object ImageHelper { lateinit var imageLoader: ImageLoader 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 e8d49963e..b6a6c8e76 100644 --- a/app/src/main/java/com/github/libretube/util/ImportHelper.kt +++ b/app/src/main/java/com/github/libretube/util/ImportHelper.kt @@ -11,7 +11,6 @@ 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 com.github.libretube.preferences.PreferenceHelper import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch diff --git a/app/src/main/java/com/github/libretube/util/LocaleHelper.kt b/app/src/main/java/com/github/libretube/util/LocaleHelper.kt index f0defb1e5..6ccacf472 100644 --- a/app/src/main/java/com/github/libretube/util/LocaleHelper.kt +++ b/app/src/main/java/com/github/libretube/util/LocaleHelper.kt @@ -3,8 +3,7 @@ package com.github.libretube.util import android.content.Context import android.os.Build import android.telephony.TelephonyManager -import com.github.libretube.preferences.PreferenceHelper -import com.github.libretube.preferences.PreferenceKeys +import com.github.libretube.constants.PreferenceKeys import java.util.* object LocaleHelper { 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 bda483a0d..979542789 100644 --- a/app/src/main/java/com/github/libretube/util/NotificationHelper.kt +++ b/app/src/main/java/com/github/libretube/util/NotificationHelper.kt @@ -11,15 +11,14 @@ import androidx.work.ExistingPeriodicWorkPolicy import androidx.work.NetworkType import androidx.work.PeriodicWorkRequest import androidx.work.WorkManager -import com.github.libretube.NOTIFICATION_WORK_NAME -import com.github.libretube.PUSH_CHANNEL_ID import com.github.libretube.R import com.github.libretube.activities.MainActivity import com.github.libretube.api.RetrofitInstance import com.github.libretube.api.SubscriptionHelper +import com.github.libretube.constants.NOTIFICATION_WORK_NAME +import com.github.libretube.constants.PUSH_CHANNEL_ID +import com.github.libretube.constants.PreferenceKeys import com.github.libretube.extensions.toID -import com.github.libretube.preferences.PreferenceHelper -import com.github.libretube.preferences.PreferenceKeys import kotlinx.coroutines.async import kotlinx.coroutines.runBlocking import java.util.concurrent.TimeUnit 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 8b9ea2a5e..3ba76f905 100644 --- a/app/src/main/java/com/github/libretube/util/NowPlayingNotification.kt +++ b/app/src/main/java/com/github/libretube/util/NowPlayingNotification.kt @@ -7,9 +7,9 @@ import android.content.Intent import android.graphics.Bitmap import android.graphics.BitmapFactory import android.support.v4.media.session.MediaSessionCompat -import com.github.libretube.BACKGROUND_CHANNEL_ID -import com.github.libretube.PLAYER_NOTIFICATION_ID import com.github.libretube.activities.MainActivity +import com.github.libretube.constants.BACKGROUND_CHANNEL_ID +import com.github.libretube.constants.PLAYER_NOTIFICATION_ID import com.github.libretube.extensions.await import com.github.libretube.obj.Streams import com.google.android.exoplayer2.ExoPlayer diff --git a/app/src/main/java/com/github/libretube/util/PlayerHelper.kt b/app/src/main/java/com/github/libretube/util/PlayerHelper.kt index 8c9d48f97..fb53e0ac5 100644 --- a/app/src/main/java/com/github/libretube/util/PlayerHelper.kt +++ b/app/src/main/java/com/github/libretube/util/PlayerHelper.kt @@ -2,9 +2,8 @@ package com.github.libretube.util import android.content.Context import android.view.accessibility.CaptioningManager +import com.github.libretube.constants.PreferenceKeys import com.github.libretube.obj.PipedStream -import com.github.libretube.preferences.PreferenceHelper -import com.github.libretube.preferences.PreferenceKeys import com.google.android.exoplayer2.ui.CaptionStyleCompat object PlayerHelper { diff --git a/app/src/main/java/com/github/libretube/preferences/PreferenceHelper.kt b/app/src/main/java/com/github/libretube/util/PreferenceHelper.kt similarity index 96% rename from app/src/main/java/com/github/libretube/preferences/PreferenceHelper.kt rename to app/src/main/java/com/github/libretube/util/PreferenceHelper.kt index a80148b67..b63e95210 100644 --- a/app/src/main/java/com/github/libretube/preferences/PreferenceHelper.kt +++ b/app/src/main/java/com/github/libretube/util/PreferenceHelper.kt @@ -1,9 +1,10 @@ -package com.github.libretube.preferences +package com.github.libretube.util import android.content.Context import android.content.SharedPreferences import androidx.preference.PreferenceManager import com.fasterxml.jackson.databind.ObjectMapper +import com.github.libretube.constants.PreferenceKeys object PreferenceHelper { /** diff --git a/app/src/main/java/com/github/libretube/util/ThemeHelper.kt b/app/src/main/java/com/github/libretube/util/ThemeHelper.kt index a36da50e4..748e6c381 100644 --- a/app/src/main/java/com/github/libretube/util/ThemeHelper.kt +++ b/app/src/main/java/com/github/libretube/util/ThemeHelper.kt @@ -12,8 +12,7 @@ import androidx.appcompat.app.AppCompatActivity import androidx.appcompat.app.AppCompatDelegate import androidx.core.text.HtmlCompat import com.github.libretube.R -import com.github.libretube.preferences.PreferenceHelper -import com.github.libretube.preferences.PreferenceKeys +import com.github.libretube.constants.PreferenceKeys import com.google.android.material.color.DynamicColors object ThemeHelper { diff --git a/app/src/main/java/com/github/libretube/views/MaterialPreferenceFragment.kt b/app/src/main/java/com/github/libretube/views/MaterialPreferenceFragment.kt index 0aefcd3a6..ce2a88a25 100644 --- a/app/src/main/java/com/github/libretube/views/MaterialPreferenceFragment.kt +++ b/app/src/main/java/com/github/libretube/views/MaterialPreferenceFragment.kt @@ -7,7 +7,7 @@ import androidx.preference.Preference import androidx.preference.PreferenceFragmentCompat import com.github.libretube.R import com.github.libretube.databinding.DialogTextPreferenceBinding -import com.github.libretube.preferences.PreferenceHelper +import com.github.libretube.util.PreferenceHelper import com.google.android.material.dialog.MaterialAlertDialogBuilder /**