Cleanup and fix a few compiler warnings
This commit is contained in:
@@ -44,12 +44,14 @@ class DeferredField<T> {
|
||||
*/
|
||||
suspend fun get(): T {
|
||||
// Check if field is initialized and return immediately if it is
|
||||
@Suppress("UNCHECKED_CAST")
|
||||
if (initialized) return content as T
|
||||
|
||||
// Wait for field to initialize
|
||||
mutex.withLock {}
|
||||
|
||||
// Field is initialized, return value
|
||||
@Suppress("UNCHECKED_CAST")
|
||||
return content as T
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,9 +1,6 @@
|
||||
package exh.util
|
||||
|
||||
import android.content.Context
|
||||
import android.view.View
|
||||
import android.view.WindowInsets
|
||||
import androidx.annotation.Px
|
||||
import com.google.android.material.chip.Chip
|
||||
import com.google.android.material.chip.ChipGroup
|
||||
import exh.EH_SOURCE_ID
|
||||
@@ -12,23 +9,6 @@ import exh.metadata.metadata.EHentaiSearchMetadata.Companion.TAG_TYPE_LIGHT
|
||||
import exh.metadata.metadata.EHentaiSearchMetadata.Companion.TAG_TYPE_NORMAL
|
||||
import exh.metadata.metadata.EHentaiSearchMetadata.Companion.TAG_TYPE_WEAK
|
||||
|
||||
inline fun View.updatePaddingRelative(
|
||||
@Px start: Int = paddingStart,
|
||||
@Px top: Int = paddingTop,
|
||||
@Px end: Int = paddingEnd,
|
||||
@Px bottom: Int = paddingBottom
|
||||
) {
|
||||
setPaddingRelative(start, top, end, bottom)
|
||||
}
|
||||
|
||||
object RecyclerWindowInsetsListener : View.OnApplyWindowInsetsListener {
|
||||
override fun onApplyWindowInsets(v: View, insets: WindowInsets): WindowInsets {
|
||||
v.updatePaddingRelative(bottom = insets.systemWindowInsetBottom)
|
||||
// v.updatePaddingRelative(bottom = v.paddingBottom + insets.systemWindowInsetBottom)
|
||||
return insets
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Replaces chips in a ChipGroup.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user