Toast when no download source selected

This commit is contained in:
Bnyro 2022-12-06 12:08:12 +01:00
parent 3c3d313bec
commit 1700bbfe0d
5 changed files with 7 additions and 5 deletions

View File

@ -17,8 +17,8 @@ import com.github.libretube.databinding.AllCaughtUpRowBinding
import com.github.libretube.databinding.TrendingRowBinding import com.github.libretube.databinding.TrendingRowBinding
import com.github.libretube.databinding.VideoRowBinding import com.github.libretube.databinding.VideoRowBinding
import com.github.libretube.extensions.formatShort import com.github.libretube.extensions.formatShort
import com.github.libretube.extensions.toPixel
import com.github.libretube.extensions.toID import com.github.libretube.extensions.toID
import com.github.libretube.extensions.toPixel
import com.github.libretube.ui.base.BaseActivity import com.github.libretube.ui.base.BaseActivity
import com.github.libretube.ui.extensions.setFormattedDuration import com.github.libretube.ui.extensions.setFormattedDuration
import com.github.libretube.ui.extensions.setWatchProgressLength import com.github.libretube.ui.extensions.setWatchProgressLength

View File

@ -132,7 +132,10 @@ class DownloadDialog(
val vidUrl = videoUrl[binding.videoSpinner.selectedItemPosition] val vidUrl = videoUrl[binding.videoSpinner.selectedItemPosition]
val audUrl = audioUrl[binding.audioSpinner.selectedItemPosition] val audUrl = audioUrl[binding.audioSpinner.selectedItemPosition]
if (audUrl == "" && vidUrl == "") return@setOnClickListener if (audUrl == "" && vidUrl == "") {
Toast.makeText(context, R.string.nothing_selected, Toast.LENGTH_SHORT).show()
return@setOnClickListener
}
val fileName = binding.fileName.text.toString().sanitize() val fileName = binding.fileName.text.toString().sanitize()

View File

@ -23,8 +23,8 @@ import com.github.libretube.enums.PlaylistType
import com.github.libretube.extensions.TAG import com.github.libretube.extensions.TAG
import com.github.libretube.extensions.awaitQuery import com.github.libretube.extensions.awaitQuery
import com.github.libretube.extensions.query import com.github.libretube.extensions.query
import com.github.libretube.extensions.toPixel
import com.github.libretube.extensions.toID import com.github.libretube.extensions.toID
import com.github.libretube.extensions.toPixel
import com.github.libretube.ui.adapters.PlaylistAdapter import com.github.libretube.ui.adapters.PlaylistAdapter
import com.github.libretube.ui.base.BaseFragment import com.github.libretube.ui.base.BaseFragment
import com.github.libretube.ui.extensions.serializable import com.github.libretube.ui.extensions.serializable

View File

@ -5,7 +5,6 @@ import android.os.Bundle
import androidx.preference.ListPreference import androidx.preference.ListPreference
import androidx.preference.Preference import androidx.preference.Preference
import androidx.preference.SwitchPreferenceCompat import androidx.preference.SwitchPreferenceCompat
import com.github.libretube.BuildConfig
import com.github.libretube.R import com.github.libretube.R
import com.github.libretube.constants.PreferenceKeys import com.github.libretube.constants.PreferenceKeys
import com.github.libretube.ui.adapters.IconsSheetAdapter import com.github.libretube.ui.adapters.IconsSheetAdapter
@ -14,7 +13,6 @@ import com.github.libretube.ui.dialogs.NavBarOptionsDialog
import com.github.libretube.ui.dialogs.RequireRestartDialog import com.github.libretube.ui.dialogs.RequireRestartDialog
import com.github.libretube.ui.sheets.IconsBottomSheet import com.github.libretube.ui.sheets.IconsBottomSheet
import com.github.libretube.util.PreferenceHelper import com.github.libretube.util.PreferenceHelper
import com.google.android.material.color.DynamicColors
class AppearanceSettings : BasePreferenceFragment() { class AppearanceSettings : BasePreferenceFragment() {
override val titleResourceId: Int = R.string.appearance override val titleResourceId: Int = R.string.appearance

View File

@ -415,6 +415,7 @@
<string name="username_email">Proceed with an e-mail address that isn\'t recommended\?</string> <string name="username_email">Proceed with an e-mail address that isn\'t recommended\?</string>
<string name="proceed">Proceed</string> <string name="proceed">Proceed</string>
<string name="play_latest_videos">Play latest videos</string> <string name="play_latest_videos">Play latest videos</string>
<string name="nothing_selected">Nothing selected!</string>
<!-- Notification channel strings --> <!-- Notification channel strings -->
<string name="download_channel_name">Download Service</string> <string name="download_channel_name">Download Service</string>