mirror of
https://github.com/mihonapp/mihon.git
synced 2025-11-14 21:18:56 +01:00
Remove some dead code
This commit is contained in:
@@ -4,8 +4,6 @@ import rx.Observable
|
||||
import rx.Subscription
|
||||
import rx.subscriptions.CompositeSubscription
|
||||
|
||||
fun Subscription?.isNullOrUnsubscribed() = this == null || isUnsubscribed
|
||||
|
||||
operator fun CompositeSubscription.plusAssign(subscription: Subscription) = add(subscription)
|
||||
|
||||
fun <T, U, R> Observable<T>.combineLatest(o2: Observable<U>, combineFn: (T, U) -> R): Observable<R> {
|
||||
|
||||
@@ -24,7 +24,6 @@ import eu.kanade.tachiyomi.util.system.getResourceColor
|
||||
import eu.kanade.tachiyomi.util.system.toast
|
||||
import eu.kanade.tachiyomi.widget.preference.AdaptiveTitlePreferenceCategory
|
||||
import eu.kanade.tachiyomi.widget.preference.IntListPreference
|
||||
import eu.kanade.tachiyomi.widget.preference.SwitchPreferenceCategory
|
||||
|
||||
@DslMarker
|
||||
@Target(AnnotationTarget.TYPE)
|
||||
@@ -53,10 +52,6 @@ inline fun PreferenceGroup.switchPreference(block: (@DSL SwitchPreferenceCompat)
|
||||
return initThenAdd(SwitchPreferenceCompat(context), block)
|
||||
}
|
||||
|
||||
inline fun PreferenceGroup.switchPreferenceCategory(block: (@DSL SwitchPreferenceCategory).() -> Unit): SwitchPreferenceCategory {
|
||||
return initThenAdd(SwitchPreferenceCategory(context), block)
|
||||
}
|
||||
|
||||
inline fun PreferenceGroup.checkBoxPreference(block: (@DSL CheckBoxPreference).() -> Unit): CheckBoxPreference {
|
||||
return initThenAdd(CheckBoxPreference(context), block)
|
||||
}
|
||||
|
||||
@@ -32,8 +32,6 @@ import androidx.compose.ui.platform.ViewCompositionStrategy
|
||||
import androidx.core.view.children
|
||||
import androidx.core.view.descendants
|
||||
import androidx.core.view.forEach
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.google.android.material.floatingactionbutton.ExtendedFloatingActionButton
|
||||
import com.google.android.material.shape.MaterialShapeDrawable
|
||||
import com.google.android.material.snackbar.Snackbar
|
||||
import eu.kanade.presentation.theme.TachiyomiTheme
|
||||
@@ -174,42 +172,6 @@ inline fun View.popupMenu(
|
||||
return popup
|
||||
}
|
||||
|
||||
/**
|
||||
* Shrink an ExtendedFloatingActionButton when the associated RecyclerView is scrolled down.
|
||||
*
|
||||
* @param recycler [RecyclerView] that the FAB should shrink/extend in response to.
|
||||
*/
|
||||
inline fun ExtendedFloatingActionButton.shrinkOnScroll(recycler: RecyclerView): RecyclerView.OnScrollListener {
|
||||
val listener = object : RecyclerView.OnScrollListener() {
|
||||
override fun onScrolled(recyclerView: RecyclerView, dx: Int, dy: Int) {
|
||||
if (dy <= 0) {
|
||||
extend()
|
||||
} else {
|
||||
shrink()
|
||||
}
|
||||
}
|
||||
}
|
||||
recycler.addOnScrollListener(listener)
|
||||
return listener
|
||||
}
|
||||
|
||||
/**
|
||||
* Callback will be run immediately when no animation running
|
||||
*/
|
||||
fun RecyclerView.onAnimationsFinished(callback: (RecyclerView) -> Unit) = post(
|
||||
object : Runnable {
|
||||
override fun run() {
|
||||
if (isAnimating) {
|
||||
itemAnimator?.isRunning {
|
||||
post(this)
|
||||
}
|
||||
} else {
|
||||
callback(this@onAnimationsFinished)
|
||||
}
|
||||
}
|
||||
},
|
||||
)
|
||||
|
||||
/**
|
||||
* Returns this ViewGroup's first child of specified class
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user