Skip to content

Commit

Permalink
Merge branch 'master' of github.com:jmir1/tachiyomi-mi
Browse files Browse the repository at this point in the history
  • Loading branch information
jmir1 committed Jun 29, 2021
2 parents 9b67f11 + 0ddce7d commit f9f9f18
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import android.animation.Animator
import android.animation.AnimatorListenerAdapter
import android.app.Activity
import android.content.Intent
import android.net.Uri
import android.os.Bundle
import android.view.LayoutInflater
import android.view.Menu
Expand Down Expand Up @@ -904,7 +905,7 @@ class AnimeController :
} else {
val video = EpisodeLoader.getLink(episode, anime!!, source!!)?.awaitSingle()
if (video != null) {
val uri = video.uri!!
val uri = video.uri ?: Uri.parse(video.videoUrl)
currentExtEpisode = episode
val extIntent = Intent(Intent.ACTION_VIEW)
extIntent.setDataAndTypeAndNormalize(uri, "video/*")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,6 @@ class ReaderActivity : BaseRxActivity<ReaderActivityBinding, ReaderPresenter>()
binding = ReaderActivityBinding.inflate(layoutInflater)
setContentView(binding.root)

windowInsetsController.systemBarsBehavior = WindowInsetsControllerCompat.BEHAVIOR_SHOW_TRANSIENT_BARS_BY_SWIPE

if (presenter.needsInit()) {
val manga = intent.extras!!.getLong("manga", -1)
val chapter = intent.extras!!.getLong("chapter", -1)
Expand Down Expand Up @@ -365,7 +363,9 @@ class ReaderActivity : BaseRxActivity<ReaderActivityBinding, ReaderPresenter>()

val systemBarsColor = (binding.toolbarBottom.background as ColorDrawable).color
window.statusBarColor = systemBarsColor
window.navigationBarColor = systemBarsColor
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O_MR1) {
window.navigationBarColor = systemBarsColor
}
(binding.toolbar.background as MaterialShapeDrawable).fillColor = ColorStateList.valueOf(systemBarsColor)

// Set initial visibility
Expand Down Expand Up @@ -513,6 +513,7 @@ class ReaderActivity : BaseRxActivity<ReaderActivityBinding, ReaderPresenter>()
} else {
if (preferences.fullscreen().get()) {
windowInsetsController.hide(WindowInsetsCompat.Type.systemBars())
windowInsetsController.systemBarsBehavior = WindowInsetsControllerCompat.BEHAVIOR_SHOW_TRANSIENT_BARS_BY_SWIPE
}

if (animate) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,11 @@ import androidx.core.text.bold
import androidx.core.text.buildSpannedString
import androidx.core.view.isVisible
import eu.kanade.tachiyomi.R
import eu.kanade.tachiyomi.data.preference.PreferencesHelper
import eu.kanade.tachiyomi.databinding.ReaderTransitionViewBinding
import eu.kanade.tachiyomi.ui.reader.model.ChapterTransition
import uy.kohesive.injekt.Injekt
import uy.kohesive.injekt.api.get

class ReaderTransitionView @JvmOverloads constructor(context: Context, attrs: AttributeSet? = null) :
LinearLayout(context, attrs) {
Expand All @@ -28,6 +31,14 @@ class ReaderTransitionView @JvmOverloads constructor(context: Context, attrs: At
}

missingChapterWarning(transition)

val color = when (Injekt.get<PreferencesHelper>().readerTheme().get()) {
0 -> context.getColor(android.R.color.black)
else -> context.getColor(android.R.color.white)
}
listOf(binding.upperText, binding.warningText, binding.lowerText).forEach {
it.setTextColor(color)
}
}

/**
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/layout/reader_transition_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
android:layout_marginEnd="8dp"
android:scaleType="fitCenter"
app:srcCompat="@drawable/ic_warning_white_24dp"
app:tint="?attr/colorOnBackground"
app:tint="?attr/colorError"
tools:ignore="ContentDescription" />

<TextView
Expand Down

0 comments on commit f9f9f18

Please sign in to comment.