From a2cb9946f15e129761db4b8e9fc4539e76978449 Mon Sep 17 00:00:00 2001 From: LagradOst Date: Sun, 12 Sep 2021 16:10:22 +0200 Subject: [PATCH] settings and fix --- app/build.gradle | 4 +- .../com/lagradost/cloudstream3/MainAPI.kt | 20 ++- .../lagradost/cloudstream3/MainActivity.kt | 6 + .../animeproviders/GogoanimeProvider.kt | 2 +- .../cloudstream3/ui/APIRepository.kt | 1 + .../cloudstream3/ui/home/HomeFragment.kt | 6 +- .../cloudstream3/ui/player/PlayerFragment.kt | 140 ++++++++++++------ .../cloudstream3/ui/result/EpisodeAdapter.kt | 2 + .../cloudstream3/ui/search/SearchFragment.kt | 29 +++- .../ui/settings/SettingsFragment.kt | 42 +++++- .../drawable/ic_outline_voice_over_off_24.xml | 5 + app/src/main/res/layout/result_episode.xml | 135 +++++++++-------- app/src/main/res/values-fr/strings.xml | 26 ++-- app/src/main/res/values-gr/strings.xml | 26 ++-- app/src/main/res/values-hi/strings.xml | 16 +- app/src/main/res/values-ml/strings.xml | 20 +-- app/src/main/res/values-mo/string.xml | 26 ++-- app/src/main/res/values-nl/strings.xml | 26 ++-- app/src/main/res/values-pl/strings.xml | 26 ++-- app/src/main/res/values-sv/strings.xml | 26 ++-- app/src/main/res/values-tl/strings.xml | 26 ++-- app/src/main/res/values/strings.xml | 40 +++-- app/src/main/res/xml/settings.xml | 51 ++++--- 23 files changed, 439 insertions(+), 262 deletions(-) create mode 100644 app/src/main/res/drawable/ic_outline_voice_over_off_24.xml diff --git a/app/build.gradle b/app/build.gradle index 685d6f5a..d29c97fe 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -31,8 +31,8 @@ android { applicationId "com.lagradost.cloudstream3" minSdkVersion 21 targetSdkVersion 30 - versionCode 21 - versionName "1.8.6" + versionCode 23 + versionName "1.8.8" resValue "string", "app_version", "${defaultConfig.versionName}${versionNameSuffix ?: ""}" diff --git a/app/src/main/java/com/lagradost/cloudstream3/MainAPI.kt b/app/src/main/java/com/lagradost/cloudstream3/MainAPI.kt index dabe2460..0311c304 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/MainAPI.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/MainAPI.kt @@ -8,7 +8,6 @@ import com.fasterxml.jackson.databind.json.JsonMapper import com.fasterxml.jackson.module.kotlin.KotlinModule import com.lagradost.cloudstream3.animeproviders.* import com.lagradost.cloudstream3.movieproviders.* -import com.lagradost.cloudstream3.torrentproviders.* import com.lagradost.cloudstream3.utils.ExtractorLink import java.util.* @@ -48,7 +47,7 @@ object APIHolder { ) val restrictedApis = arrayListOf( - NyaaProvider(), + //NyaaProvider(), //torrents in cs3 is wack TrailersToProvider(), ) @@ -84,6 +83,21 @@ object APIHolder { )?.toHashSet() ?: hashSet } + fun Activity.getApiDubstatusSettings(): HashSet { + val settingsManager = PreferenceManager.getDefaultSharedPreferences(this) + val hashSet = HashSet() + hashSet.addAll(DubStatus.values()) + val list = settingsManager.getStringSet( + this.getString(R.string.display_sub_key), + hashSet.map { it.name }.toMutableSet() + ) ?: return hashSet + + val names = DubStatus.values().map { it.name }.toHashSet() + //if(realSet.isEmpty()) return hashSet + + return list.filter { names.contains(it) }.map { DubStatus.valueOf(it) }.toHashSet() + } + fun Activity.getApiTypeSettings(): HashSet { val settingsManager = PreferenceManager.getDefaultSharedPreferences(this) val hashSet = HashSet() @@ -247,7 +261,7 @@ class HomePageResponse( class HomePageList( val name: String, - val list: List + var list: List ) interface SearchResponse { diff --git a/app/src/main/java/com/lagradost/cloudstream3/MainActivity.kt b/app/src/main/java/com/lagradost/cloudstream3/MainActivity.kt index 869c4b9c..f6f913bd 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/MainActivity.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/MainActivity.kt @@ -23,8 +23,12 @@ import androidx.preference.PreferenceManager import com.google.android.gms.cast.framework.CastButtonFactory import com.jaredrummler.android.colorpicker.ColorPickerDialogListener import com.lagradost.cloudstream3.APIHolder.apis +import com.lagradost.cloudstream3.APIHolder.getApiDubstatusSettings +import com.lagradost.cloudstream3.APIHolder.getApiSettings +import com.lagradost.cloudstream3.APIHolder.getApiTypeSettings import com.lagradost.cloudstream3.APIHolder.restrictedApis import com.lagradost.cloudstream3.receivers.VideoDownloadRestartReceiver +import com.lagradost.cloudstream3.ui.APIRepository import com.lagradost.cloudstream3.ui.download.DOWNLOAD_NAVIGATE_TO import com.lagradost.cloudstream3.ui.download.DownloadChildFragment import com.lagradost.cloudstream3.ui.download.DownloadFragment @@ -394,6 +398,8 @@ class MainActivity : AppCompatActivity(), ColorPickerDialogListener { } catch (e: Exception) { e.printStackTrace() } + APIRepository.dubStatusActive = getApiDubstatusSettings() + /* val relativePath = (Environment.DIRECTORY_DOWNLOADS) + File.separatorChar val displayName = "output.dex" //""output.dex" diff --git a/app/src/main/java/com/lagradost/cloudstream3/animeproviders/GogoanimeProvider.kt b/app/src/main/java/com/lagradost/cloudstream3/animeproviders/GogoanimeProvider.kt index 52f03d65..0a47a61e 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/animeproviders/GogoanimeProvider.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/animeproviders/GogoanimeProvider.kt @@ -209,7 +209,7 @@ class GogoanimeProvider : MainAPI() { ) "1080" else qualityRegex.find(it.text())?.destructured?.component1().toString() ExtractorLink( "Gogoanime", - "Gogoanime - " + qual + "p", + if(qual == "null") "Gogoanime" else "Gogoanime - " + qual + "p", it.attr("href"), page.url, getQualityFromName(qual), diff --git a/app/src/main/java/com/lagradost/cloudstream3/ui/APIRepository.kt b/app/src/main/java/com/lagradost/cloudstream3/ui/APIRepository.kt index 22370666..83b4eea9 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/ui/APIRepository.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/ui/APIRepository.kt @@ -10,6 +10,7 @@ class APIRepository(val api: MainAPI) { companion object { var providersActive = HashSet() var typesActive = HashSet() + var dubStatusActive = HashSet() val noneApi = object : MainAPI() { override val name: String diff --git a/app/src/main/java/com/lagradost/cloudstream3/ui/home/HomeFragment.kt b/app/src/main/java/com/lagradost/cloudstream3/ui/home/HomeFragment.kt index fb265b8d..265fd961 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/ui/home/HomeFragment.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/ui/home/HomeFragment.kt @@ -28,6 +28,7 @@ import com.lagradost.cloudstream3.ui.AutofitRecyclerView import com.lagradost.cloudstream3.ui.WatchType import com.lagradost.cloudstream3.ui.result.START_ACTION_RESUME_LATEST import com.lagradost.cloudstream3.ui.search.* +import com.lagradost.cloudstream3.ui.search.SearchFragment.Companion.filterSearchResponse import com.lagradost.cloudstream3.ui.search.SearchHelper.handleSearchClickCallback import com.lagradost.cloudstream3.utils.AppUtils.loadSearchResult import com.lagradost.cloudstream3.utils.DataStore.getKey @@ -252,8 +253,11 @@ class HomeFragment : Fragment() { when (data) { is Resource.Success -> { val d = data.value + currentHomePage = d - (home_master_recycler?.adapter as ParentItemAdapter?)?.items = d.items + (home_master_recycler?.adapter as ParentItemAdapter?)?.items = + d.items.map { HomePageList(it.name, it.list.filterSearchResponse()) } + home_master_recycler?.adapter?.notifyDataSetChanged() currentMainList.clear() chooseRandomMainPage()?.let { response -> diff --git a/app/src/main/java/com/lagradost/cloudstream3/ui/player/PlayerFragment.kt b/app/src/main/java/com/lagradost/cloudstream3/ui/player/PlayerFragment.kt index b27a8c06..3cb7ba13 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/ui/player/PlayerFragment.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/ui/player/PlayerFragment.kt @@ -16,11 +16,13 @@ import android.graphics.drawable.Icon import android.media.AudioManager import android.net.Uri import android.os.* +import android.provider.Settings import android.view.LayoutInflater import android.view.MotionEvent import android.view.View import android.view.View.* import android.view.ViewGroup +import android.view.WindowManager.LayoutParams.* import android.view.animation.AccelerateInterpolator import android.view.animation.AlphaAnimation import android.view.animation.Animation @@ -105,6 +107,7 @@ import kotlinx.android.synthetic.main.fragment_player.* import kotlinx.android.synthetic.main.player_custom_layout.* import kotlinx.coroutines.* import java.io.File +import java.lang.reflect.Array.setInt import javax.net.ssl.HttpsURLConnection import javax.net.ssl.SSLContext import javax.net.ssl.SSLSession @@ -437,6 +440,8 @@ class PlayerFragment : Fragment() { private var playerResizeEnabled = true//settingsManager!!.getBoolean("player_resize_enabled", false) private var doubleTapEnabled = false private var useSystemBrightness = false + private var useTrueSystemBrightness = false + private val fullscreenNotch = true//settingsManager.getBoolean("fullscreen_notch", true) private var skipTime = 0L private var prevDiffX = 0.0 @@ -450,6 +455,63 @@ class PlayerFragment : Fragment() { private var cachedVolume = 0f private var isValidTouch = false + private fun getBrightness(): Float { + return if (useSystemBrightness) { + if (useTrueSystemBrightness) { + 1 - (Settings.System.getInt( + context?.contentResolver, + Settings.System.SCREEN_BRIGHTNESS + ) * (1 / 255).toFloat()) + } else { + val lp = activity?.window?.attributes + 1 - if (lp?.screenBrightness ?: -1.0f <= 0f) + (Settings.System.getInt( + context?.contentResolver, + Settings.System.SCREEN_BRIGHTNESS + ) * (1 / 255).toFloat()) + else lp?.screenBrightness!! + } + } else brightness_overlay.alpha + } + + private fun setBrightness(context: Context?, alpha: Float) { + val realAlpha = minOf(1f, maxOf(alpha, 0.005f)) // clamp + if (useSystemBrightness) { + if (useTrueSystemBrightness) { + Settings.System.putInt( + context?.contentResolver, + Settings.System.SCREEN_BRIGHTNESS_MODE, + Settings.System.SCREEN_BRIGHTNESS_MODE_MANUAL + ) + + Settings.System.putInt( + context?.contentResolver, + Settings.System.SCREEN_BRIGHTNESS, (realAlpha * 255).toInt() + ) + } else { + val lp = activity?.window?.attributes + lp?.screenBrightness = 1 - realAlpha + activity?.window?.attributes = lp + } + } else { + brightness_overlay?.alpha = realAlpha + } + + context?.setKey(VIDEO_PLAYER_BRIGHTNESS, realAlpha) + } + + private fun changeBrightness(diffY: Float): Float { + val currentBrightness = getBrightness() + val alpha = minOf( + maxOf( + 0.005f, // BRIGHTNESS_OVERRIDE_OFF doesn't seem to work + currentBrightness - diffY * 0.5f + ), 1.0f + ) + setBrightness(context, alpha) + return alpha + } + fun handleMotionEvent(motionEvent: MotionEvent) { // TIME_UNSET == -9223372036854775807L // No swiping on unloaded @@ -526,40 +588,9 @@ class PlayerFragment : Fragment() { } else if (progressBarRightHolder != null) { progressBarRightHolder?.alpha = 1f - if (useSystemBrightness) { - // https://developer.android.com/reference/android/view/WindowManager.LayoutParams#screenBrightness - val lp = activity?.window?.attributes - val currentBrightness = - if (lp?.screenBrightness ?: -1.0f <= 0f) (android.provider.Settings.System.getInt( - context?.contentResolver, - android.provider.Settings.System.SCREEN_BRIGHTNESS - ) * (1 / 255).toFloat()) - else lp?.screenBrightness!! - - val alpha = minOf( - maxOf( - 0.005f, // BRIGHTNESS_OVERRIDE_OFF doesn't seem to work - currentBrightness - diffY.toFloat() * 0.5f - ), 1.0f - )// 0.05f *if (diffY > 0) 1 else -1 - lp?.screenBrightness = alpha - activity?.window?.attributes = lp - - progressBarRight?.max = 100 * 100 - progressBarRight?.progress = (alpha * 100 * 100).toInt() - } else { - val alpha = minOf( - 0.95f, - brightness_overlay.alpha + diffY.toFloat() * 0.5f - ) // 0.05f *if (diffY > 0) 1 else -1 - brightness_overlay?.alpha = alpha - - context?.setKey(VIDEO_PLAYER_BRIGHTNESS, alpha) - - progressBarRight?.max = 100 * 100 - progressBarRight?.progress = ((1f - alpha) * 100 * 100).toInt() - } - + val alpha = changeBrightness(-diffY.toFloat()) + progressBarRight?.max = 100 * 100 + progressBarRight?.progress = ((1f - alpha) * 100 * 100).toInt() currentY = motionEvent.rawY } } @@ -715,9 +746,9 @@ class PlayerFragment : Fragment() { override fun onChange(selfChange: Boolean) { val currentVolume = audioManager?.getStreamVolume(AudioManager.STREAM_MUSIC) val maxVolume = audioManager?.getStreamMaxVolume(AudioManager.STREAM_MUSIC) - val progressBarRight = activity.findViewById(R.id.progressBarRight) + val progressBarLeft = activity.findViewById(R.id.progressBarLeft) if (currentVolume != null && maxVolume != null) { - progressBarRight?.progress = currentVolume * 100 / maxVolume + progressBarLeft?.progress = currentVolume * 100 / maxVolume } } } @@ -980,13 +1011,17 @@ class PlayerFragment : Fragment() { SubtitlesFragment.applyStyleEvent += ::onSubStyleChanged settingsManager = PreferenceManager.getDefaultSharedPreferences(activity) - swipeEnabled = settingsManager.getBoolean("swipe_enabled", true) - swipeVerticalEnabled = settingsManager.getBoolean("swipe_vertical_enabled", true) - playBackSpeedEnabled = settingsManager.getBoolean("playback_speed_enabled", false) - playerResizeEnabled = settingsManager.getBoolean("player_resize_enabled", true) - doubleTapEnabled = settingsManager.getBoolean("double_tap_enabled", false) + context?.let { ctx -> + swipeEnabled = settingsManager.getBoolean(ctx.getString(R.string.swipe_enabled_key), true) + swipeVerticalEnabled = settingsManager.getBoolean(ctx.getString(R.string.swipe_vertical_enabled_key), true) + playBackSpeedEnabled = settingsManager.getBoolean(ctx.getString(R.string.player_speed), false) + playerResizeEnabled = settingsManager.getBoolean(ctx.getString(R.string.player_resize_enabled_key), true) + doubleTapEnabled = settingsManager.getBoolean(ctx.getString(R.string.double_tap_enabled_key), false) + useSystemBrightness = settingsManager.getBoolean(ctx.getString(R.string.use_system_brightness_key), false) + } - brightness_overlay?.alpha = context?.getKey(VIDEO_PLAYER_BRIGHTNESS, 0f) ?: 0f + if (swipeVerticalEnabled) + setBrightness(context, context?.getKey(VIDEO_PLAYER_BRIGHTNESS) ?: 1f) navigationBarHeight = requireContext().getNavigationBarHeight() statusBarHeight = requireContext().getStatusBarHeight() @@ -1578,6 +1613,13 @@ class PlayerFragment : Fragment() { override fun onResume() { super.onResume() + + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P && fullscreenNotch) { + val params = activity?.window?.attributes + params?.layoutInDisplayCutoutMode = LAYOUT_IN_DISPLAY_CUTOUT_MODE_SHORT_EDGES + activity?.window?.attributes = params + } + torrentStream?.currentTorrent?.resume() onAudioFocusEvent += ::handlePauseEvent @@ -1598,6 +1640,20 @@ class PlayerFragment : Fragment() { } override fun onDestroy() { + + /* val lp = activity?.window?.attributes + + + lp?.screenBrightness = 1f + activity?.window?.attributes = lp*/ + // restoring screen brightness + val lp = activity?.window?.attributes + lp?.screenBrightness = BRIGHTNESS_OVERRIDE_NONE + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) { + lp?.layoutInDisplayCutoutMode = LAYOUT_IN_DISPLAY_CUTOUT_MODE_DEFAULT + } + activity?.window?.attributes = lp + loading_overlay?.isVisible = false savePos() SubtitlesFragment.applyStyleEvent -= ::onSubStyleChanged diff --git a/app/src/main/java/com/lagradost/cloudstream3/ui/result/EpisodeAdapter.kt b/app/src/main/java/com/lagradost/cloudstream3/ui/result/EpisodeAdapter.kt index 431a66db..4cd5c932 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/ui/result/EpisodeAdapter.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/ui/result/EpisodeAdapter.kt @@ -139,8 +139,10 @@ class EpisodeAdapter( @SuppressLint("SetTextI18n") fun bind(card: ResultEpisode) { localCard = card + val name = if (card.name == null) "${episodeText.context.getString(R.string.episode)} ${card.episode}" else "${card.episode}. ${card.name}" episodeText.text = name + episodeText.isSelected = true // is needed for text repeating val displayPos = card.getDisplayPosition() episodeProgress?.max = (card.duration / 1000).toInt() diff --git a/app/src/main/java/com/lagradost/cloudstream3/ui/search/SearchFragment.kt b/app/src/main/java/com/lagradost/cloudstream3/ui/search/SearchFragment.kt index e1bb8e13..0b7d2aa9 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/ui/search/SearchFragment.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/ui/search/SearchFragment.kt @@ -17,14 +17,13 @@ import androidx.preference.PreferenceManager import androidx.recyclerview.widget.GridLayoutManager import androidx.recyclerview.widget.RecyclerView import com.google.android.material.switchmaterial.SwitchMaterial +import com.lagradost.cloudstream3.* import com.lagradost.cloudstream3.APIHolder.apis import com.lagradost.cloudstream3.APIHolder.getApiSettings import com.lagradost.cloudstream3.APIHolder.getApiTypeSettings -import com.lagradost.cloudstream3.HomePageList -import com.lagradost.cloudstream3.R -import com.lagradost.cloudstream3.TvType import com.lagradost.cloudstream3.mvvm.Resource import com.lagradost.cloudstream3.mvvm.observe +import com.lagradost.cloudstream3.ui.APIRepository import com.lagradost.cloudstream3.ui.APIRepository.Companion.providersActive import com.lagradost.cloudstream3.ui.APIRepository.Companion.typesActive import com.lagradost.cloudstream3.ui.home.HomeFragment @@ -39,6 +38,18 @@ import com.lagradost.cloudstream3.utils.UIHelper.hideKeyboard import kotlinx.android.synthetic.main.fragment_search.* class SearchFragment : Fragment() { + companion object { + fun List.filterSearchResponse(): List { + return this.filter { response -> + if (response is AnimeSearchResponse) { + response.dubStatus?.any { APIRepository.dubStatusActive.contains(it) } ?: false + } else { + true + } + } + } + } + private lateinit var searchViewModel: SearchViewModel override fun onCreateView( @@ -187,7 +198,7 @@ class SearchFragment : Fragment() { toggleSearch(isOn) } - listView.setOnItemClickListener { _, _, i, _ -> + listView.setOnItemClickListener { _, _, _, _ -> val types = HashSet() for ((index, api) in apis.withIndex()) { if (listView.checkedItemPositions[index]) { @@ -199,7 +210,7 @@ class SearchFragment : Fragment() { } } - listView2.setOnItemClickListener { _, _, i, _ -> + listView2.setOnItemClickListener { _, _, _, _ -> for ((index, api) in apis.withIndex()) { var isSupported = false @@ -343,8 +354,12 @@ class SearchFragment : Fragment() { observe(searchViewModel.currentSearch) { list -> (search_master_recycler?.adapter as ParentItemAdapter?)?.apply { - items = list.map { - HomePageList(it.apiName, if (it.data is Resource.Success) it.data.value else ArrayList()) + items = list.map { ongoing -> + val ongoingList = HomePageList( + ongoing.apiName, + if (ongoing.data is Resource.Success) ongoing.data.value.filterSearchResponse() else ArrayList() + ) + ongoingList } notifyDataSetChanged() } diff --git a/app/src/main/java/com/lagradost/cloudstream3/ui/settings/SettingsFragment.kt b/app/src/main/java/com/lagradost/cloudstream3/ui/settings/SettingsFragment.kt index 4afa6080..e9d9dcc9 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/ui/settings/SettingsFragment.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/ui/settings/SettingsFragment.kt @@ -6,16 +6,19 @@ import androidx.appcompat.app.AlertDialog import androidx.preference.Preference import androidx.preference.PreferenceFragmentCompat import androidx.preference.PreferenceManager +import com.lagradost.cloudstream3.APIHolder.getApiDubstatusSettings +import com.lagradost.cloudstream3.DubStatus import com.lagradost.cloudstream3.MainActivity.Companion.setLocale import com.lagradost.cloudstream3.MainActivity.Companion.showToast import com.lagradost.cloudstream3.R import com.lagradost.cloudstream3.mvvm.logError +import com.lagradost.cloudstream3.ui.APIRepository import com.lagradost.cloudstream3.ui.subtitles.SubtitlesFragment import com.lagradost.cloudstream3.utils.InAppUpdater.Companion.runAutoUpdate import com.lagradost.cloudstream3.utils.Qualities -import com.lagradost.cloudstream3.utils.SingleSelectionHelper import com.lagradost.cloudstream3.utils.SingleSelectionHelper.showBottomDialog import com.lagradost.cloudstream3.utils.SingleSelectionHelper.showDialog +import com.lagradost.cloudstream3.utils.SingleSelectionHelper.showMultiDialog import com.lagradost.cloudstream3.utils.UIHelper.hideKeyboard import kotlin.concurrent.thread @@ -30,7 +33,7 @@ class SettingsFragment : PreferenceFragmentCompat() { Triple("\uD83C\uDDEC\uD83C\uDDF7", "Greek", "gr"), Triple("\uD83C\uDDF8\uD83C\uDDEA", "Swedish", "sv"), Triple("\uD83C\uDDF5\uD83C\uDDED", "Tagalog", "tl"), - Triple("\uD83C\uDDF5\uD83C\uDDF1", "Polish", "pl"), + Triple("\uD83C\uDDF5\uD83C\uDDF1", "Polish", "pl"), Triple("\uD83C\uDDEE\uD83C\uDDF3", "Hindi", "hi"), Triple("\uD83C\uDDEE\uD83C\uDDF3", "Malayalam", "ml"), ) // idk, if you find a way of automating this it would be great @@ -43,6 +46,7 @@ class SettingsFragment : PreferenceFragmentCompat() { val benenePreference = findPreference(getString(R.string.benene_count))!! val watchQualityPreference = findPreference(getString(R.string.quality_pref_key))!! val legalPreference = findPreference(getString(R.string.legal_notice_key))!! + val subdubPreference = findPreference(getString(R.string.display_sub_key))!! legalPreference.setOnPreferenceClickListener { val builder: AlertDialog.Builder = AlertDialog.Builder(it.context) @@ -52,12 +56,44 @@ class SettingsFragment : PreferenceFragmentCompat() { return@setOnPreferenceClickListener true } + subdubPreference.setOnPreferenceClickListener { + val settingsManager = PreferenceManager.getDefaultSharedPreferences(context) + + activity?.getApiDubstatusSettings()?.let { current -> + val dublist = DubStatus.values() + val names = dublist.map { it.name } + + val currentList = ArrayList() + for (i in current) { + currentList.add(dublist.indexOf(i)) + } + + context?.showMultiDialog( + names, + currentList, + getString(R.string.display_subbed_dubbed_settings), + {}) { selectedList -> + APIRepository.dubStatusActive = selectedList.map { dublist[it] }.toHashSet() + + settingsManager.edit().putStringSet( + this.getString(R.string.display_sub_key), + selectedList.map { names[it] }.toMutableSet() + ).apply() + } + } + + + + return@setOnPreferenceClickListener true + } + watchQualityPreference.setOnPreferenceClickListener { val prefNames = resources.getStringArray(R.array.quality_pref) val prefValues = resources.getIntArray(R.array.quality_pref_values) val settingsManager = PreferenceManager.getDefaultSharedPreferences(context) - val currentQuality = settingsManager.getInt(getString(R.string.watch_quality_pref), Qualities.values().last().value) + val currentQuality = + settingsManager.getInt(getString(R.string.watch_quality_pref), Qualities.values().last().value) context?.showBottomDialog( prefNames.toList(), prefValues.indexOf(currentQuality), diff --git a/app/src/main/res/drawable/ic_outline_voice_over_off_24.xml b/app/src/main/res/drawable/ic_outline_voice_over_off_24.xml new file mode 100644 index 00000000..b6ed06ac --- /dev/null +++ b/app/src/main/res/drawable/ic_outline_voice_over_off_24.xml @@ -0,0 +1,5 @@ + + + diff --git a/app/src/main/res/layout/result_episode.xml b/app/src/main/res/layout/result_episode.xml index e20fa097..069bb0a5 100644 --- a/app/src/main/res/layout/result_episode.xml +++ b/app/src/main/res/layout/result_episode.xml @@ -13,27 +13,27 @@ android:layout_marginBottom="5dp" > - + - + + android:contentDescription="@string/episode_play_img_des" + android:layout_height="match_parent" + android:layout_width="wrap_content" + /> + + - - - - - + + + + \ No newline at end of file diff --git a/app/src/main/res/values-fr/strings.xml b/app/src/main/res/values-fr/strings.xml index 8651542e..4efecb36 100644 --- a/app/src/main/res/values-fr/strings.xml +++ b/app/src/main/res/values-fr/strings.xml @@ -105,27 +105,27 @@ Lecteur en mode Picture-in-Picture Continuer la lecture dans une fenêtre miniature en superposition sur d\'autres applis Boutton de redimentionnement du lecteur - Supprimer les bordures noires + Supprimer les bordures noires Sous-titres Paramètres des sous-titres du lecteur - Vitesse de lecture - Ajouter l\'option de vitesse sur le lecteur - Balayer pour avancer rapidement - Balayer vers la gauche ou la droite pour controler le temps du lecteur vidéo + Vitesse de lecture + Ajouter l\'option de vitesse sur le lecteur + Balayer pour avancer rapidement + Balayer vers la gauche ou la droite pour controler le temps du lecteur vidéo Balayer pour changer les paramètres Balayer sur le coté droit ou gauche pour changer le niveau de luminosité ou de volume - Taper deux fois pour rechercher - Taper deux fois sur le coté droit ou gauche pour avancer ou reculer + Taper deux fois pour rechercher + Taper deux fois sur le coté droit ou gauche pour avancer ou reculer Rechercher Informations Recherche Avancée Donne les résultats séparé par les fournisseur - N\'envoyer les données que lors d\'un crash - N\'envoyer aucune données - Afficher les mises-à-jour de l\'application - Chercher des mises-à-jour automatiquement au démarage - Mettre à jour vers une version béta - Rechercher pour une mise à jour vers une version béta au lieu des version complètes seulement + N\'envoyer les données que lors d\'un crash + N\'envoyer aucune données + Afficher les mises-à-jour de l\'application + Chercher des mises-à-jour automatiquement au démarage + Mettre à jour vers une version béta + Rechercher pour une mise à jour vers une version béta au lieu des version complètes seulement Github L\'application Light Novel par les mêmes devs Application d\'animés par les mêmes devs diff --git a/app/src/main/res/values-gr/strings.xml b/app/src/main/res/values-gr/strings.xml index 250f6d58..5ce69857 100644 --- a/app/src/main/res/values-gr/strings.xml +++ b/app/src/main/res/values-gr/strings.xml @@ -105,27 +105,27 @@ Picture-in-picture Συνεχίζει την αναπαραγωγή σε ένα μίνι παίκτη πάνω από άλλες εφαρμογές Αλλαγή μεγέθους παίκτη - Αφαίρεση μαύρων περιγραμμάτων + Αφαίρεση μαύρων περιγραμμάτων Υπότιτλοι Ρυθμίσεις υποτίτλων του παίκτη - Eigengrau Mode - Προσθέτει την επιλογή ταχύτητας στον παίκτη - Σύρετε για seek - Σύρετε αριστερά ή δεξιά για να ελέγξετε τον χρόνο στον παίκτη + Eigengrau Mode + Προσθέτει την επιλογή ταχύτητας στον παίκτη + Σύρετε για seek + Σύρετε αριστερά ή δεξιά για να ελέγξετε τον χρόνο στον παίκτη Σύρετε για να αλλάξετε ρυθμίσεις Σύρετε αριστερά ή δεξιά για να αλλάξετε τη φωτεινότητα ή την ένταση - Διπλό πάτημα για seek - Διπλό πάτημα στα αριστερά ή δεξιά για seek μπροστά ή πίσω + Διπλό πάτημα για seek + Διπλό πάτημα στα αριστερά ή δεξιά για seek μπροστά ή πίσω Αναζήτηση Πληροφορείες Προχωρημένη Αναζήτηση Δίνει τα αποτελέσματα αναζήτησης χωρισμένα ανά πάροχο - Αποστέλλει δεδομένα μόνο για σφάλματα - Δεν στέλνει δεδομένα - Εμφάνιση ενημερώσεων - Αυτόματη αναζήτηση νέων ενημερώσεων - Ενημέρωση σε προ-εκδόσεις - Αναζητήστε ενημερώσεις προ-εκδόσεων αντί για κανονικές εκδόσεις + Αποστέλλει δεδομένα μόνο για σφάλματα + Δεν στέλνει δεδομένα + Εμφάνιση ενημερώσεων + Αυτόματη αναζήτηση νέων ενημερώσεων + Ενημέρωση σε προ-εκδόσεις + Αναζητήστε ενημερώσεις προ-εκδόσεων αντί για κανονικές εκδόσεις Github Light novel app by the same devs Anime app by the same devs diff --git a/app/src/main/res/values-hi/strings.xml b/app/src/main/res/values-hi/strings.xml index 151725b6..91f89eaf 100644 --- a/app/src/main/res/values-hi/strings.xml +++ b/app/src/main/res/values-hi/strings.xml @@ -80,20 +80,20 @@ कोई वर्णन नही मिला आपकी वीडियो एक छोटे से डब्बे में चलाता है - काले बॉर्डर को हटाता है + काले बॉर्डर को हटाता है प्लेयर की subtitle सेटिंग्स - प्लेयर में वीडियो की रफ्तार धिमी या तेज़ करता है - दाएं या बाएं तरफ स्वाइप करने से वीडियो को आगे पीछे करता है + प्लेयर में वीडियो की रफ्तार धिमी या तेज़ करता है + दाएं या बाएं तरफ स्वाइप करने से वीडियो को आगे पीछे करता है दाएं तरफ या बाएं तरफ स्वाइप करने से रोशिनी और आवाज़ को ऊपर नीचे करता है - दो बार दाएं या बाएं तरफ दबाने से वीडियो को आगे या पीछे करा जा सकता है + दो बार दाएं या बाएं तरफ दबाने से वीडियो को आगे या पीछे करा जा सकता है खोजें जानकारी नतीजों को सूत्रों के हिसाब से बांटकर दिखता है - सिर्फ दुर्घटना होने पे आपकी कुछ जानकारी भेजी जाएगी - आपकी जानकारी नही भेजी जाएगी - हर बार खुलने पे नए अपडेट के लिए जांच करेगा - पूरी रिलीस के बजाए पूर्व रिलीस की जांच करेगा + सिर्फ दुर्घटना होने पे आपकी कुछ जानकारी भेजी जाएगी + आपकी जानकारी नही भेजी जाएगी + हर बार खुलने पे नए अपडेट के लिए जांच करेगा + पूरी रिलीस के बजाए पूर्व रिलीस की जांच करेगा हमारा एक Light novel app हमारा एक Anime app Discord से जुड़िये diff --git a/app/src/main/res/values-ml/strings.xml b/app/src/main/res/values-ml/strings.xml index 275fd19b..ac88c77a 100644 --- a/app/src/main/res/values-ml/strings.xml +++ b/app/src/main/res/values-ml/strings.xml @@ -98,28 +98,28 @@ Continues playback in a miniature player on top of other apps - കറുത്ത അതിർത്തി നീക്കംചെയ്യുക + കറുത്ത അതിർത്തി നീക്കംചെയ്യുക Player subtitles settings - വേഗം നിയന്ത്രിക്കാൻ ഓപ്ഷൻ ചേർക്കുക + വേഗം നിയന്ത്രിക്കാൻ ഓപ്ഷൻ ചേർക്കുക - Swipe left or right to control time in the videoplayer + Swipe left or right to control time in the videoplayer Swipe on the left or right side to change brightness or volume - Tap twice on the right or left side to seek forwards or backwards + Tap twice on the right or left side to seek forwards or backwards തിരയുക വിവരം സ്ട്രോതസായി തിരിച്ച ഫലം തരുക - ക്രാഷാകുമ്പോൾ മാത്രം അയക്കുക - ടാറ്റ അയക്കാതിരിക്കുക - അപ്ഡേറ്റുകൾ അറിയിക്കുക - ആരംഭത്തിൽ അപ്ഡേറ്റുകൾ തിരയുക - പരീക്ഷണാത്മക അപ്ഡേറ് - പരീക്ഷണാത്മക അപ്ഡേറ്റുകൾ മാത്രം സ്വീകരിക്കുക + ക്രാഷാകുമ്പോൾ മാത്രം അയക്കുക + ടാറ്റ അയക്കാതിരിക്കുക + അപ്ഡേറ്റുകൾ അറിയിക്കുക + ആരംഭത്തിൽ അപ്ഡേറ്റുകൾ തിരയുക + പരീക്ഷണാത്മക അപ്ഡേറ് + പരീക്ഷണാത്മക അപ്ഡേറ്റുകൾ മാത്രം സ്വീകരിക്കുക ഗിറ്റ്ഹബ് നമ്മുടെ ലൈറ്റ് നോവൽ ആപ്പ് നമ്മുടെ ആനിമേ ആപ്പ് diff --git a/app/src/main/res/values-mo/string.xml b/app/src/main/res/values-mo/string.xml index ca66161c..513afa6f 100644 --- a/app/src/main/res/values-mo/string.xml +++ b/app/src/main/res/values-mo/string.xml @@ -83,26 +83,26 @@ ohaahhooooo ooooooohhaa ouuhhh ouuhhhohahh oh ahoooaaahhuaoooooooo-ahahahh oouuhaoouuh aaaaa aauuhohahhh oooooaaaghhoh oh aaaaa - aaaghhaaahhuahooo oha aaaghh + aaaghhaaahhuahooo oha aaaghh ahhhaauugghh oha ooh ouuhhh oooohhahhh ouuhhh - haaahhh ahoouuh - haaoooohhaaahhuoha ouuhhh ah oouuh ohoohaaahhu - ohahaaaauugghh ahooo aaahhu - aaaghh aaaghhohahooooo ouuhhh oouuh ooo-ahahahooo-ahah ohaaaaaghh + haaahhh ahoouuh + haaoooohhaaahhuoha ouuhhh ah oouuh ohoohaaahhu + ohahaaaauugghh ahooo aaahhu + aaaghh aaaghhohahooooo ouuhhh oouuh ooo-ahahahooo-ahah ohaaaaaghh aaaaaahhaaahhuoouuhaaaaa aahooo ohahhaaahhuoh ooo-ahahahhhooo-ahah aaaghha oooohhoouuh aaaghhaaaghhooo-ahah - ahaauuhaaaaaooooo ahooo aauuh aaaghhaooo-ahah + ahaauuhaaaaaooooo ahooo aauuh aaaghhaooo-ahah aauuh aauugghh ah aah ouuhhhooo-ahah aaaghh aauugghh ahahooo ouuhhhahh ooh oouuhahoooahhaaahhu ohaooh oouuhooo-ahah - aaaaa ahhhahhohoouuhahoooaaaghh aahhhaaaaa - oouuhoooohh ahhooo-ahah - haa oohaauugghhooh oh - aaahhuoouuhouuhhh aauugghhahaaaghhoohahhoooohhouuhhh - aaaghh ahhhahoooooo-ahah aaaghh - ahhh ooo-ahahahhahh ooooo aauugghh oooohhahhhahoooaoooohhouuhhh aaahhu + aaaaa ahhhahhohoouuhahoooaaaghh aahhhaaaaa + oouuhoooohh ahhooo-ahah + haa oohaauugghhooh oh + aaahhuoouuhouuhhh aauugghhahaaaghhoohahhoooohhouuhhh + aaaghh ahhhahoooooo-ahah aaaghh + ahhh ooo-ahahahhahh ooooo aauugghh oooohhahhhahoooaoooohhouuhhh aaahhu aauuhoha ooo-ahahoh ohaaauugghh ahhh haaahooo ooooohaa ohaaaaaaahoooahoooaaaghh @@ -173,6 +173,6 @@ aauugghhaaaaa haa ooh aaaaa oouuh haa - oohahaha hahha ooooohaha + oohahaha hahha ooooohaha oohahaha hahha ooooohaha haaoou \ No newline at end of file diff --git a/app/src/main/res/values-nl/strings.xml b/app/src/main/res/values-nl/strings.xml index f2887b39..a4e5b4cb 100644 --- a/app/src/main/res/values-nl/strings.xml +++ b/app/src/main/res/values-nl/strings.xml @@ -104,27 +104,27 @@ Beeld-in-beeld Blijft afspelen in een miniatuurspeler bovenop andere apps - Verwijder de zwarte randen + Verwijder de zwarte randen Knop voor formaat wijzigen Ondertiteling Ondertiteling instellingen - Eigengrau modus - Voegt de snelheid optie toe in de speler - Veeg om te zoeken - Veeg naar links of rechts om de tijd in de videoplayer te regelen + Eigengrau modus + Voegt de snelheid optie toe in de speler + Veeg om te zoeken + Veeg naar links of rechts om de tijd in de videoplayer te regelen wissen om instellingen te wijzigen Veeg aan de linker- of rechterkant om de helderheid of het volume te wijzigen - Dubbeltik om te zoeken - Tik twee keer aan de rechter- of linkerkant om vooruit of achteruit te zoeken + Dubbeltik om te zoeken + Tik twee keer aan de rechter- of linkerkant om vooruit of achteruit te zoeken Zoeken Geavanceerd zoeken Geeft u de zoekresultaten gescheiden per aanbieder - Stuurt alleen gegevens bij crashes - Zendt geen gegevens - Toon app updates - Automatisch zoeken naar nieuwe updates bij het opstarten - Update naar pre-releases - Zoeken naar prerelease updates in plaats van alleen volledige releases + Stuurt alleen gegevens bij crashes + Zendt geen gegevens + Toon app updates + Automatisch zoeken naar nieuwe updates bij het opstarten + Update naar pre-releases + Zoeken naar prerelease updates in plaats van alleen volledige releases Github Light novel app van dezelfde ontwikkelaars Anime app van dezelfde ontwikkelaars diff --git a/app/src/main/res/values-pl/strings.xml b/app/src/main/res/values-pl/strings.xml index 935a5b10..4d4b3b3c 100644 --- a/app/src/main/res/values-pl/strings.xml +++ b/app/src/main/res/values-pl/strings.xml @@ -100,27 +100,27 @@ Obraz-w-obrazie Oglądaj w małym, pływającym okienku Przycisk zmiany rozmiaru - Usuwanie czarnych ramek + Usuwanie czarnych ramek Napisy Ustawienia napisów - Tryb Eigengrau - Ustawienia prędkości - Przesuwaj aby przeglądać - Przesuwaj w lewo lub prawo aby kontrolować czas + Tryb Eigengrau + Ustawienia prędkości + Przesuwaj aby przeglądać + Przesuwaj w lewo lub prawo aby kontrolować czas Przesuwaj aby zmienić ustawienia Przesuwaj po lewej lub prawej stronie aby zmienić jasność i głośność - Podwójne wciśnięcie aby przeglądać - Naciśnij 2 razy z prawej lub lewej strony aby przeglądać + Podwójne wciśnięcie aby przeglądać + Naciśnij 2 razy z prawej lub lewej strony aby przeglądać Szukaj Informacje Zaawansowane wyszukiwanie Szukaj z podziałem na dostawców - Wysyłaj dane tylko przy awariach - Nie wysyłaj żadnych danych - Pokazuj aktualizacje - Automatycznie wyszukuj aktualizacji - Aktualizuj do wersji beta - Wyszukuj wersji beta, zamiast pełnych wydań + Wysyłaj dane tylko przy awariach + Nie wysyłaj żadnych danych + Pokazuj aktualizacje + Automatycznie wyszukuj aktualizacji + Aktualizuj do wersji beta + Wyszukuj wersji beta, zamiast pełnych wydań Github Aplikacja do noweli Aplikacja do anime diff --git a/app/src/main/res/values-sv/strings.xml b/app/src/main/res/values-sv/strings.xml index 6facea51..99a7c529 100644 --- a/app/src/main/res/values-sv/strings.xml +++ b/app/src/main/res/values-sv/strings.xml @@ -95,27 +95,27 @@ Bild-i-bild Fortsätter uppspelning i en miniatyrspelare ovanpå andra appar Lägger till en knapp för att justera bildförhållandet - Ta bort de svarta kanterna + Ta bort de svarta kanterna Undertexter Inställningar för undertexter - Eigengrau Läge - Lägger till hastighetsalternativet i spelaren - Svep för att strya tiden - Svep åt vänster eller höger för att styra tiden i videospelaren + Eigengrau Läge + Lägger till hastighetsalternativet i spelaren + Svep för att strya tiden + Svep åt vänster eller höger för att styra tiden i videospelaren Svep för att ändra inställningar Svep på vänster eller höger sida för att ändra ljusstyrka eller volym - Dubbeltryck för att hoppa fram eller bak - Tryck två gånger på höger eller vänster sida för att hoppa fram eller bak + Dubbeltryck för att hoppa fram eller bak + Tryck två gånger på höger eller vänster sida för att hoppa fram eller bak Sök Information Avancerade sökresultat Presenterar sökresultaten i flera olika rader baserat på leverantören - Skickar endast data när appen kraschar - Skickar ingen data - Visa appuppdateringar - Sök automatiskt efter nya uppdateringar vid start - Uppdatera till beta-version - Sök efter beta-version istället för fullständiga utgåvor av appen + Skickar endast data när appen kraschar + Skickar ingen data + Visa appuppdateringar + Sök automatiskt efter nya uppdateringar vid start + Uppdatera till beta-version + Sök efter beta-version istället för fullständiga utgåvor av appen Github Lightnovel app av samma utvecklare Anime app av samma utvecklare diff --git a/app/src/main/res/values-tl/strings.xml b/app/src/main/res/values-tl/strings.xml index d12c3d21..34bce7fe 100644 --- a/app/src/main/res/values-tl/strings.xml +++ b/app/src/main/res/values-tl/strings.xml @@ -130,28 +130,28 @@ Picture-in-picture Ipagpatuloy ang panonood sa maliit na player sa ibabaw ng mga apps Pindutan ng baguhan ng laki - tanggalin ang itim na gilid + tanggalin ang itim na gilid nakasaling diyalogo Mga settings ng nakasaling diyalogo - Eigengrau Mode - Idagdag ang opsyon na pabilisin ang pinapanood sa player - i-Swipe upang maghanap - i-Swipe patungong kaliwa o kanan para ibahin ang oras ng pinapanood + Eigengrau Mode + Idagdag ang opsyon na pabilisin ang pinapanood sa player + i-Swipe upang maghanap + i-Swipe patungong kaliwa o kanan para ibahin ang oras ng pinapanood i-Swipe upang ibahin ang mga settings i-Swipe ang bandang kaliwa at kanan upang ibahin ang liwanag o lakas ng tunog - Pumindot ng dalawang beses upong maghanap - Pindutin ng dalawang beses ang bandang kanan at kaliwa upang sumulong at umurong + Pumindot ng dalawang beses upong maghanap + Pindutin ng dalawang beses ang bandang kanan at kaliwa upang sumulong at umurong Maghanap Marami pang impormasyon Psulong na paghahanap Ibigay ang resulta ng nakahiwalay batay sa pinagkukunan ng pelikula - Ipadala lamang ang impormasyon sa pagkakataon ng kamalian - Huwag ipadala ang impormasyon - Ipakita ang mga update - Hanapin ang bagong update sa simula - i-Update sa mga prerealese - Hanapin ang prerelease sa halip ng buong release + Ipadala lamang ang impormasyon sa pagkakataon ng kamalian + Huwag ipadala ang impormasyon + Ipakita ang mga update + Hanapin ang bagong update sa simula + i-Update sa mga prerealese + Hanapin ang prerelease sa halip ng buong release Github Light novel app ng parehong tagalikha Anime app ng parehong tagalikha diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index cec9a6f4..6668c951 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -13,6 +13,14 @@ subtitle_settings_key quality_pref_key unknown_prerelease + use_system_brightness_key + swipe_enabled_key + playback_speed_enabled_key + player_resize_enabled_key + pip_enabled_key + double_tap_enabled_key + swipe_vertical_enabled_key + display_sub_key %d %s | %sMB @@ -139,28 +147,31 @@ Picture-in-picture Continues playback in a miniature player on top of other apps Player resize button - Remove the black borders + Remove the black borders Subtitles Player subtitles settings - Eigengrau Mode - Adds the speed option in the player - Swipe to seek - Swipe left or right to control time in the videoplayer + Eigengrau Mode + Adds the speed option in the player + Swipe to seek + Swipe left or right to control time in the videoplayer Swipe to change settings Swipe on the left or right side to change brightness or volume - Double tap to seek - Tap twice on the right or left side to seek forwards or backwards + Double tap to seek + Tap twice on the right or left side to seek forwards or backwards + Use system brightness + Use system brightness in the app player instead of an dark overlay + Search Info Advanced Search Gives you the search results separated by provider - Only sends data on crashes - Sends no data - Show app updates - Automatically search for new updates on start - Update to prereleases - Search for prerelease updates instead of full releases only + Only sends data on crashes + Sends no data + Show app updates + Automatically search for new updates on start + Update to prereleases + Search for prerelease updates instead of full releases only Github Light novel app by the same devs Anime app by the same devs @@ -243,8 +254,9 @@ Don\'t show again Update Preferred watch quality + Display Dubbed/Subbed Anime - Legal Notice + Disclaimer legal_notice_key Any legal issues regarding the content on this application should be taken up with the actual file hosts and providers themselves as we are not affiliated with them. diff --git a/app/src/main/res/xml/settings.xml b/app/src/main/res/xml/settings.xml index c6c0d1df..df19d139 100644 --- a/app/src/main/res/xml/settings.xml +++ b/app/src/main/res/xml/settings.xml @@ -20,47 +20,53 @@ + - + +