Package dev.inmo.micro_utils.common

Types

ByteArrayAllocator
Link copied to clipboard
common
typealias ByteArrayAllocator = () -> ByteArray
ByteArrayAllocatorSerializer
Link copied to clipboard
object ByteArrayAllocatorSerializer : KSerializer<ByteArrayAllocator>
object ByteArrayAllocatorSerializer : KSerializer<ByteArrayAllocator>
object ByteArrayAllocatorSerializer : KSerializer<ByteArrayAllocator>
Diff
Link copied to clipboard
data class Diff<T>
data class Diff<T>
data class Diff<T>

Diff object which contains information about differences between two Iterables

Either
Link copied to clipboard
interface Either<T1, T2>

Realization of this interface will contains at least one not null - t1 or t2

common
interface Either<T1, T2>

Realization of this interface will contains at least one not null - t1 or t2

interface Either<T1, T2>

Realization of this interface will contains at least one not null - t1 or t2

EitherFirst
Link copied to clipboard
data class EitherFirst<T1, T2>(t1: T1) : Either<T1, T2>

This type Either will always have not nullable t1

common
data class EitherFirst<T1, T2>(t1: T1) : Either<T1, T2>

This type Either will always have not nullable t1

data class EitherFirst<T1, T2>(t1: T1) : Either<T1, T2>

This type Either will always have not nullable t1

EitherSecond
Link copied to clipboard
data class EitherSecond<T1, T2>(t2: T2) : Either<T1, T2>

This type Either will always have not nullable t2

common
data class EitherSecond<T1, T2>(t2: T2) : Either<T1, T2>

This type Either will always have not nullable t2

data class EitherSecond<T1, T2>(t2: T2) : Either<T1, T2>

This type Either will always have not nullable t2

FileName
Link copied to clipboard
value class FileName(string: String)
value class FileName(string: String)
value class FileName(string: String)
MPPFile
Link copied to clipboard
class MPPFile
class MPPFile
class MPPFile
SuspendByteArrayAllocator
Link copied to clipboard
common
typealias SuspendByteArrayAllocator = suspend () -> ByteArray

Functions

asAllocator
Link copied to clipboard
suspend fun SuspendByteArrayAllocator.asAllocator(): ByteArrayAllocator
suspend fun SuspendByteArrayAllocator.asAllocator(): ByteArrayAllocator
suspend fun SuspendByteArrayAllocator.asAllocator(): ByteArrayAllocator
bytes
Link copied to clipboard
suspend fun MPPFile.bytes(): ByteArray
suspend fun MPPFile.bytes(): ByteArray
suspend fun MPPFile.bytes(): ByteArray
calculateDiff
Link copied to clipboard
fun <T> Iterable<T>.calculateDiff(other: Iterable<T>, strictComparison: Boolean = false): Diff<T>

Calculating Diff object

common
fun <T> Iterable<T>.calculateDiff(other: Iterable<T>, strictComparison: Boolean = false): Diff<T>

Calculating Diff object

fun <T> Iterable<T>.calculateDiff(other: Iterable<T>, strictComparison: Boolean = false): Diff<T>

Calculating Diff object

calculateStrictDiff
Link copied to clipboard
inline fun <T> Iterable<T>.calculateStrictDiff(other: Iterable<T>): Diff<T>

This method call calculateDiff with strict mode enabled

common
inline fun <T> Iterable<T>.calculateStrictDiff(other: Iterable<T>): Diff<T>

This method call calculateDiff with strict mode enabled

inline fun <T> Iterable<T>.calculateStrictDiff(other: Iterable<T>): Diff<T>

This method call calculateDiff with strict mode enabled

changeVisibility
Link copied to clipboard
fun View.changeVisibility(show: Boolean = !isShown, goneOnHide: Boolean = true)
collapse
Link copied to clipboard
fun View.collapse(duration: Long = 500)
collapseHorizontally
Link copied to clipboard
fun View.collapseHorizontally(duration: Long = 500)
Diff
Link copied to clipboard
inline fun <T> Iterable<T>.diff(other: Iterable<T>, strictComparison: Boolean = false): Diff<T>
inline fun <T> Iterable<T>.diff(other: Iterable<T>, strictComparison: Boolean = false): Diff<T>
inline fun <T> Iterable<T>.diff(other: Iterable<T>, strictComparison: Boolean = false): Diff<T>
disable
Link copied to clipboard
fun View.disable()
either
Link copied to clipboard
inline fun <T1, T2> Any.either(): Either<T1, T2>
inline fun <T1, T2> Any.either(): Either<T1, T2>
inline fun <T1, T2> Any.either(): Either<T1, T2>
enable
Link copied to clipboard
fun View.enable()
expand
Link copied to clipboard
fun View.expand(duration: Long = 500, targetWidth: Int = ViewGroup.LayoutParams.MATCH_PARENT, targetHeight: Int = ViewGroup.LayoutParams.WRAP_CONTENT)
expandHorizontally
Link copied to clipboard
fun View.expandHorizontally(duration: Long = 500, targetWidth: Int = ViewGroup.LayoutParams.MATCH_PARENT, targetHeight: Int = ViewGroup.LayoutParams.WRAP_CONTENT)
first
Link copied to clipboard
inline fun <T1, T2> Either.Companion.first(t1: T1): Either<T1, T2>
inline fun <T1, T2> Either.Companion.first(t1: T1): Either<T1, T2>
inline fun <T1, T2> Either.Companion.first(t1: T1): Either<T1, T2>
firstNotNull
Link copied to clipboard
fun <T> Iterable<T?>.firstNotNull(): T
fun <T> Iterable<T?>.firstNotNull(): T
fun <T> Iterable<T?>.firstNotNull(): T
getDp
Link copied to clipboard
inline fun Resources.getDp(resId: Int): Float
getSp
Link copied to clipboard
inline fun Resources.getSp(resId: Int): Float
gone
Link copied to clipboard
inline fun View.gone()
hide
Link copied to clipboard
inline fun View.hide()
joinTo
Link copied to clipboard
inline fun <I> Iterable<I>.joinTo(separator: I? = null, prefix: I? = null, postfix: I? = null): List<I>
inline fun <I> Iterable<I>.joinTo(crossinline separatorFun: (I) -> I?, prefix: I? = null, postfix: I? = null): List<I>
inline fun <I, R> Array<I>.joinTo(separator: R? = null, prefix: R? = null, postfix: R? = null, crossinline transform: (I) -> R?): Array<R>
inline fun <I, R> Array<I>.joinTo(crossinline separatorFun: (I) -> R?, prefix: R? = null, postfix: R? = null, crossinline transform: (I) -> R?): Array<R>
inline fun <I, R> Iterable<I>.joinTo(separator: R? = null, prefix: R? = null, postfix: R? = null, crossinline transform: (I) -> R?): List<R>
inline fun <I, R> Iterable<I>.joinTo(crossinline separatorFun: (I) -> R?, prefix: R? = null, postfix: R? = null, crossinline transform: (I) -> R?): List<R>
inline fun <I> Iterable<I>.joinTo(separator: I? = null, prefix: I? = null, postfix: I? = null): List<I>
inline fun <I> Iterable<I>.joinTo(crossinline separatorFun: (I) -> I?, prefix: I? = null, postfix: I? = null): List<I>
inline fun <I, R> Array<I>.joinTo(separator: R? = null, prefix: R? = null, postfix: R? = null, crossinline transform: (I) -> R?): Array<R>
inline fun <I, R> Array<I>.joinTo(crossinline separatorFun: (I) -> R?, prefix: R? = null, postfix: R? = null, crossinline transform: (I) -> R?): Array<R>
inline fun <I, R> Iterable<I>.joinTo(separator: R? = null, prefix: R? = null, postfix: R? = null, crossinline transform: (I) -> R?): List<R>
inline fun <I, R> Iterable<I>.joinTo(crossinline separatorFun: (I) -> R?, prefix: R? = null, postfix: R? = null, crossinline transform: (I) -> R?): List<R>
inline fun <I> Iterable<I>.joinTo(separator: I? = null, prefix: I? = null, postfix: I? = null): List<I>
inline fun <I> Iterable<I>.joinTo(crossinline separatorFun: (I) -> I?, prefix: I? = null, postfix: I? = null): List<I>
inline fun <I, R> Array<I>.joinTo(separator: R? = null, prefix: R? = null, postfix: R? = null, crossinline transform: (I) -> R?): Array<R>
inline fun <I, R> Array<I>.joinTo(crossinline separatorFun: (I) -> R?, prefix: R? = null, postfix: R? = null, crossinline transform: (I) -> R?): Array<R>
inline fun <I, R> Iterable<I>.joinTo(separator: R? = null, prefix: R? = null, postfix: R? = null, crossinline transform: (I) -> R?): List<R>
inline fun <I, R> Iterable<I>.joinTo(crossinline separatorFun: (I) -> R?, prefix: R? = null, postfix: R? = null, crossinline transform: (I) -> R?): List<R>
mapNotNullA
Link copied to clipboard
inline fun <T, R> Array<T>.mapNotNullA(mapper: (T) -> R?): List<R>
inline fun <T, R> Iterable<T>.mapNotNullA(transform: (T) -> R?): List<R>
onFirst
Link copied to clipboard
inline fun <T1, T2, E : Either<T1, T2>> E.onFirst(crossinline block: (T1) -> Unit): E

Will call block in case when Either.t1 of this is not null

common
inline fun <T1, T2, E : Either<T1, T2>> E.onFirst(crossinline block: (T1) -> Unit): E

Will call block in case when Either.t1 of this is not null

inline fun <T1, T2, E : Either<T1, T2>> E.onFirst(crossinline block: (T1) -> Unit): E

Will call block in case when Either.t1 of this is not null

onSecond
Link copied to clipboard
inline fun <T1, T2, E : Either<T1, T2>> E.onSecond(crossinline block: (T2) -> Unit): E

Will call block in case when Either.t2 of this is not null

common
inline fun <T1, T2, E : Either<T1, T2>> E.onSecond(crossinline block: (T2) -> Unit): E

Will call block in case when Either.t2 of this is not null

inline fun <T1, T2, E : Either<T1, T2>> E.onSecond(crossinline block: (T2) -> Unit): E

Will call block in case when Either.t2 of this is not null

second
Link copied to clipboard
inline fun <T1, T2> Either.Companion.second(t2: T2): Either<T1, T2>
inline fun <T1, T2> Either.Companion.second(t2: T2): Either<T1, T2>
inline fun <T1, T2> Either.Companion.second(t2: T2): Either<T1, T2>
show
Link copied to clipboard
inline fun View.show()
StrictDiff
Link copied to clipboard
inline fun <T> StrictDiff(old: Iterable<T>, new: Iterable<T>): Diff<T>
inline fun <T> StrictDiff(old: Iterable<T>, new: Iterable<T>): Diff<T>
inline fun <T> StrictDiff(old: Iterable<T>, new: Iterable<T>): Diff<T>
toggleEnabledState
Link copied to clipboard
fun View.toggleEnabledState(enabled: Boolean)
toggleExpandHorizontallyState
Link copied to clipboard
fun View.toggleExpandHorizontallyState(duration: Long = 500): Boolean
toggleExpandState
Link copied to clipboard
fun View.toggleExpandState(duration: Long = 500): Boolean
toggleVisibility
Link copied to clipboard
fun View.toggleVisibility(goneOnHide: Boolean = true)

Properties

asAllocator
Link copied to clipboard
val ByteArray.asAllocator: ByteArrayAllocator
asAllocator
Link copied to clipboard
common
val ByteArray.asAllocator: ByteArrayAllocator
asAllocator
Link copied to clipboard
val ByteArray.asAllocator: ByteArrayAllocator
asSuspendAllocator
Link copied to clipboard
asSuspendAllocator
Link copied to clipboard
common
asSuspendAllocator
Link copied to clipboard
asSuspendAllocator
Link copied to clipboard
asSuspendAllocator
Link copied to clipboard
common
asSuspendAllocator
Link copied to clipboard
bytesAllocator
Link copied to clipboard
val MPPFile.bytesAllocator: SuspendByteArrayAllocator
bytesAllocator
Link copied to clipboard
val MPPFile.bytesAllocator: SuspendByteArrayAllocator
bytesAllocator
Link copied to clipboard
common
val MPPFile.bytesAllocator: SuspendByteArrayAllocator
disabled
Link copied to clipboard
val View.disabled: Boolean
enabled
Link copied to clipboard
val View.enabled: Boolean
filename
Link copied to clipboard
val MPPFile.filename: FileName
filename
Link copied to clipboard
val MPPFile.filename: FileName
filename
Link copied to clipboard
common
val MPPFile.filename: FileName
filesize
Link copied to clipboard
val MPPFile.filesize: Long
filesize
Link copied to clipboard
val MPPFile.filesize: Long
filesize
Link copied to clipboard
common
val MPPFile.filesize: Long
gone
Link copied to clipboard
val View.gone: Boolean
hidden
Link copied to clipboard
val View.hidden: Boolean
isCollapsed
Link copied to clipboard
val View.isCollapsed: Boolean
isExpanded
Link copied to clipboard
val View.isExpanded: Boolean
shown
Link copied to clipboard
val View.shown: Boolean