chore: cleanup compiler warnings
- Explicitly specifying `extractNativeLibs` is done through the buildscript `useLegacyPackaging` property now
- `@Supress("INVISIBLE_REFERENCE")` is deprecated in K2
This commit is contained in:
parent
a7d20eab01
commit
3dfc16a132
3 changed files with 94 additions and 4 deletions
|
|
@ -96,6 +96,9 @@ android {
|
|||
jniLibs {
|
||||
// x86 is dead
|
||||
excludes += "/lib/x86/*.so"
|
||||
|
||||
// Equivalent of AndroidManifest's extractNativeLibs=false
|
||||
useLegacyPackaging = false
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -22,7 +22,6 @@
|
|||
|
||||
<application
|
||||
android:name=".ManagerApplication"
|
||||
android:extractNativeLibs="false"
|
||||
android:icon="@mipmap/ic_launcher"
|
||||
android:label="@string/app_name"
|
||||
android:largeHeap="true"
|
||||
|
|
|
|||
|
|
@ -6,8 +6,6 @@ import androidx.compose.runtime.Stable
|
|||
import androidx.compose.ui.unit.Dp
|
||||
import androidx.compose.ui.unit.LayoutDirection
|
||||
|
||||
typealias PaddingValuesSides = WindowInsetsSides
|
||||
|
||||
/**
|
||||
* Remove particular side values from [PaddingValues].
|
||||
*/
|
||||
|
|
@ -15,7 +13,6 @@ fun PaddingValues.exclude(sides: PaddingValuesSides): PaddingValues =
|
|||
ExcludePaddingValues(this, sides)
|
||||
|
||||
@Stable
|
||||
@Suppress("INVISIBLE_REFERENCE")
|
||||
private class ExcludePaddingValues(
|
||||
private val values: PaddingValues,
|
||||
private val excludeSides: PaddingValuesSides,
|
||||
|
|
@ -52,3 +49,94 @@ private class ExcludePaddingValues(
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Copy of [WindowInsetsSides] with the necessary methods exposed publicly.
|
||||
*/
|
||||
@Suppress("unused")
|
||||
@JvmInline
|
||||
value class PaddingValuesSides private constructor(private val value: Int) {
|
||||
/**
|
||||
* Returns a [PaddingValuesSides] containing sides defied in [sides] and the
|
||||
* sides in `this`.
|
||||
*/
|
||||
operator fun plus(sides: PaddingValuesSides): PaddingValuesSides =
|
||||
PaddingValuesSides(value or sides.value)
|
||||
|
||||
internal fun hasAny(sides: PaddingValuesSides): Boolean =
|
||||
(value and sides.value) != 0
|
||||
|
||||
override fun toString(): String = "PaddingValuesSides(${valueToString()})"
|
||||
|
||||
private fun valueToString(): String = buildString {
|
||||
fun appendPlus(text: String) {
|
||||
if (isNotEmpty()) append('+')
|
||||
append(text)
|
||||
}
|
||||
|
||||
if (value and Start.value == Start.value) appendPlus("Start")
|
||||
if (value and Left.value == Left.value) appendPlus("Left")
|
||||
if (value and Top.value == Top.value) appendPlus("Top")
|
||||
if (value and End.value == End.value) appendPlus("End")
|
||||
if (value and Right.value == Right.value) appendPlus("Right")
|
||||
if (value and Bottom.value == Bottom.value) appendPlus("Bottom")
|
||||
}
|
||||
|
||||
companion object {
|
||||
internal val AllowLeftInLtr = PaddingValuesSides(1 shl 3)
|
||||
internal val AllowRightInLtr = PaddingValuesSides(1 shl 2)
|
||||
internal val AllowLeftInRtl = PaddingValuesSides(1 shl 1)
|
||||
internal val AllowRightInRtl = PaddingValuesSides(1 shl 0)
|
||||
|
||||
/**
|
||||
* Indicates a start side, which is left or right
|
||||
* depending on [LayoutDirection]. If [LayoutDirection.Ltr], [Start]
|
||||
* is the left side. If [LayoutDirection.Rtl], [Start] is the right side.
|
||||
*
|
||||
* Use [Left] or [Right] if the physical direction is required.
|
||||
*/
|
||||
val Start = AllowLeftInLtr + AllowRightInRtl
|
||||
|
||||
/**
|
||||
* Indicates an end side, which is left or right
|
||||
* depending on [LayoutDirection]. If [LayoutDirection.Ltr], [End]
|
||||
* is the right side. If [LayoutDirection.Rtl], [End] is the left side.
|
||||
*
|
||||
* Use [Left] or [Right] if the physical direction is required.
|
||||
*/
|
||||
val End = AllowRightInLtr + AllowLeftInRtl
|
||||
|
||||
/**
|
||||
* Indicates the top side.
|
||||
*/
|
||||
val Top = PaddingValuesSides(1 shl 4)
|
||||
|
||||
/**
|
||||
* Indicates the bottom side.
|
||||
*/
|
||||
val Bottom = PaddingValuesSides(1 shl 5)
|
||||
|
||||
/**
|
||||
* Indicates a left side. Most layouts will prefer using
|
||||
* [Start] or [End] to account for [LayoutDirection].
|
||||
*/
|
||||
val Left = AllowLeftInLtr + AllowLeftInRtl
|
||||
|
||||
/**
|
||||
* Indicates a right side. Most layouts will prefer using
|
||||
* [Start] or [End] to account for [LayoutDirection].
|
||||
*/
|
||||
val Right = AllowRightInLtr + AllowRightInRtl
|
||||
|
||||
/**
|
||||
* Indicates a horizontal sides. This is a combination of
|
||||
* [Left] and [Right] sides, or [Start] and [End] sides.
|
||||
*/
|
||||
val Horizontal = Left + Right
|
||||
|
||||
/**
|
||||
* Indicates a [Top] and [Bottom] sides.
|
||||
*/
|
||||
val Vertical = Top + Bottom
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue