-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: make
InstallOptions
serializable
- Loading branch information
1 parent
932c583
commit e2c9472
Showing
3 changed files
with
50 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
app/src/main/kotlin/com/aliucord/manager/util/ColorParceler.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package com.aliucord.manager.util | ||
|
||
import android.os.Parcel | ||
import androidx.compose.ui.graphics.Color | ||
import androidx.compose.ui.graphics.toArgb | ||
import kotlinx.parcelize.Parceler | ||
|
||
/** | ||
* Parcelize Compose [Color] for reading and writing in ARGB representation for the sRGB color space. | ||
*/ | ||
object ColorParceler : Parceler<Color> { | ||
override fun create(parcel: Parcel): Color = | ||
Color(parcel.readInt()) | ||
|
||
override fun Color.write(parcel: Parcel, flags: Int) = | ||
parcel.writeInt(toArgb()) | ||
} |