fix: what does the fix say? 🦊
This commit is contained in:
parent
37949c7e8e
commit
7717974b9e
8 changed files with 436 additions and 15 deletions
|
@ -16,6 +16,8 @@ import ani.dantotsu.navBarHeight
|
|||
import ani.dantotsu.profile.User
|
||||
import ani.dantotsu.settings.saving.PrefManager
|
||||
import ani.dantotsu.statusBarHeight
|
||||
import ani.dantotsu.toast
|
||||
import ani.dantotsu.util.Logger
|
||||
|
||||
class StatusActivity : AppCompatActivity(), StoriesCallback {
|
||||
private lateinit var activity: ArrayList<User>
|
||||
|
@ -44,10 +46,14 @@ class StatusActivity : AppCompatActivity(), StoriesCallback {
|
|||
|
||||
val key = "activities"
|
||||
val watchedActivity = PrefManager.getCustomVal<Set<Int>>(key, setOf())
|
||||
val startFrom = findFirstNonMatch(watchedActivity, activity[position].activity )
|
||||
val startIndex = if ( startFrom > 0) startFrom else 0
|
||||
binding.stories.setStoriesList(activity[position].activity, this, startIndex + 1)
|
||||
|
||||
if (activity.getOrNull(position) != null) {
|
||||
val startFrom = findFirstNonMatch(watchedActivity, activity[position].activity )
|
||||
val startIndex = if ( startFrom > 0) startFrom else 0
|
||||
binding.stories.setStoriesList(activity[position].activity, this, startIndex + 1)
|
||||
} else {
|
||||
Logger.log("index out of bounds for position $position of size ${activity.size}")
|
||||
finish()
|
||||
}
|
||||
|
||||
}
|
||||
private fun findFirstNonMatch(watchedActivity: Set<Int>, activity: List<Activity>): Int {
|
||||
|
@ -58,13 +64,16 @@ class StatusActivity : AppCompatActivity(), StoriesCallback {
|
|||
}
|
||||
return -1
|
||||
}
|
||||
|
||||
override fun onPause() {
|
||||
super.onPause()
|
||||
binding.stories.pause()
|
||||
}
|
||||
|
||||
override fun onResume() {
|
||||
super.onResume()
|
||||
binding.stories.resume()
|
||||
if (hasWindowFocus())
|
||||
binding.stories.resume()
|
||||
}
|
||||
|
||||
override fun onWindowFocusChanged(hasFocus: Boolean) {
|
||||
|
|
|
@ -424,7 +424,8 @@ class MediaDetailsActivity : AppCompatActivity(), AppBarLayout.OnOffsetChangedLi
|
|||
}
|
||||
|
||||
override fun onResume() {
|
||||
navBar.selectTabAt(selected)
|
||||
if (::navBar.isInitialized)
|
||||
navBar.selectTabAt(selected)
|
||||
super.onResume()
|
||||
}
|
||||
|
||||
|
|
|
@ -43,6 +43,7 @@ import kotlinx.coroutines.CoroutineScope
|
|||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.launch
|
||||
import uy.kohesive.injekt.injectLazy
|
||||
import java.util.Locale
|
||||
|
||||
class ExtensionsActivity : AppCompatActivity() {
|
||||
lateinit var binding: ActivityExtensionsBinding
|
||||
|
@ -173,8 +174,11 @@ class ExtensionsActivity : AppCompatActivity() {
|
|||
initActivity(this)
|
||||
binding.languageselect.setOnClickListener {
|
||||
val languageOptions =
|
||||
LanguageMapper.Companion.Language.entries.map { it.name }.toTypedArray()
|
||||
val builder = AlertDialog.Builder(currContext(), R.style.MyPopup)
|
||||
LanguageMapper.Companion.Language.entries.map { entry ->
|
||||
entry.name.lowercase().replace("_", " ")
|
||||
.replaceFirstChar { if (it.isLowerCase()) it.titlecase(Locale.ROOT) else it.toString() }
|
||||
}.toTypedArray()
|
||||
val builder = AlertDialog.Builder(this, R.style.MyPopup)
|
||||
val listOrder: String = PrefManager.getVal(PrefName.LangSort)
|
||||
val index = LanguageMapper.Companion.Language.entries.toTypedArray()
|
||||
.indexOfFirst { it.code == listOrder }
|
||||
|
|
|
@ -6,6 +6,7 @@ import androidx.core.app.NotificationCompat
|
|||
import ani.dantotsu.R
|
||||
import ani.dantotsu.connections.crashlytics.CrashlyticsInterface
|
||||
import ani.dantotsu.snackString
|
||||
import ani.dantotsu.util.Logger
|
||||
import eu.kanade.tachiyomi.data.notification.Notifications
|
||||
import eu.kanade.tachiyomi.extension.InstallStep
|
||||
import uy.kohesive.injekt.Injekt
|
||||
|
@ -30,6 +31,7 @@ class InstallerSteps(
|
|||
|
||||
fun onError(error: Throwable, extra: () -> Unit) {
|
||||
Injekt.get<CrashlyticsInterface>().logException(error)
|
||||
Logger.log(error)
|
||||
val builder = NotificationCompat.Builder(
|
||||
context,
|
||||
Notifications.CHANNEL_DOWNLOADER_ERROR
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue