-
Notifications
You must be signed in to change notification settings - Fork 211
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Migrate :bridge:synchronization, :core:ktx and :core:theme to KMP (#929)
**Background** Right now we can't move forward with the new transport API without migrating to KMP **Changes** - Migrate `:bridge:synchronization:ui` to KMP - Migrate `:bridge:synchronization:api` to KMP - Migrate `:core:ktx` to KMP - Migrate `:core:theme` to KMP - Remove parcelize from almost all modules and add `:core:kmpparcelizable` **Test plan** Try build app
- Loading branch information
Showing
140 changed files
with
496 additions
and
477 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
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
plugins { | ||
id("flipper.android-compose") | ||
id("kotlin-parcelize") | ||
|
||
id("kotlinx-serialization") | ||
} | ||
|
||
|
8 changes: 2 additions & 6 deletions
8
components/archive/api/src/main/java/com/flipperdevices/archive/model/CategoryType.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 |
---|---|---|
@@ -1,21 +1,17 @@ | ||
package com.flipperdevices.archive.model | ||
|
||
import android.os.Parcelable | ||
import androidx.compose.runtime.Immutable | ||
import com.flipperdevices.bridge.dao.api.model.FlipperKeyType | ||
import kotlinx.parcelize.Parcelize | ||
import kotlinx.serialization.Serializable | ||
|
||
@Serializable | ||
@Immutable | ||
sealed class CategoryType : Parcelable { | ||
@Parcelize | ||
sealed class CategoryType { | ||
@Serializable | ||
data class ByFileType( | ||
val fileType: FlipperKeyType | ||
) : CategoryType() | ||
|
||
@Parcelize | ||
@Serializable | ||
object Deleted : CategoryType() | ||
data object Deleted : CategoryType() | ||
} |
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
5 changes: 1 addition & 4 deletions
5
components/archive/impl/src/main/java/com/flipperdevices/archive/impl/model/CategoryItem.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 |
---|---|---|
@@ -1,14 +1,11 @@ | ||
package com.flipperdevices.archive.impl.model | ||
|
||
import android.os.Parcelable | ||
import androidx.annotation.DrawableRes | ||
import com.flipperdevices.archive.model.CategoryType | ||
import kotlinx.parcelize.Parcelize | ||
|
||
@Parcelize | ||
data class CategoryItem( | ||
@DrawableRes val iconId: Int?, | ||
val title: String, | ||
val count: Int?, | ||
val categoryType: CategoryType | ||
) : Parcelable | ||
) |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,26 @@ | ||
plugins { | ||
id("flipper.android-compose") | ||
id("flipper.multiplatform-compose") | ||
id("flipper.multiplatform-dependencies") | ||
id("kotlinx-serialization") | ||
id("kotlin-parcelize") | ||
} | ||
|
||
android.namespace = "com.flipperdevices.bridge.dao.api" | ||
|
||
dependencies { | ||
compose.resources { | ||
publicResClass = true | ||
} | ||
|
||
commonDependencies { | ||
implementation(projects.components.core.kmpparcelize) | ||
implementation(projects.components.core.ui.theme) | ||
implementation(projects.components.core.ui.res) | ||
implementation(projects.components.core.ktx) | ||
|
||
implementation(libs.kotlin.coroutines) | ||
implementation(libs.kotlin.serialization.json) | ||
implementation(libs.kotlin.immutable.collections) | ||
} | ||
|
||
implementation(libs.compose.ui) | ||
androidDependencies { | ||
implementation(projects.components.core.ui.res) | ||
} |
12 changes: 12 additions & 0 deletions
12
...o/api/src/androidMain/kotlin/com/flipperdevices/bridge/dao/api/model/FlipperKeyTypeKtx.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,12 @@ | ||
package com.flipperdevices.bridge.dao.api.model | ||
|
||
import com.flipperdevices.core.ui.res.R as DesignSystem | ||
|
||
val FlipperKeyType.icon: Int | ||
get() = when (this) { | ||
FlipperKeyType.SUB_GHZ -> DesignSystem.drawable.ic_fileformat_sub | ||
FlipperKeyType.RFID -> DesignSystem.drawable.ic_fileformat_rf | ||
FlipperKeyType.NFC -> DesignSystem.drawable.ic_fileformat_nfc | ||
FlipperKeyType.INFRARED -> DesignSystem.drawable.ic_fileformat_ir | ||
FlipperKeyType.I_BUTTON -> DesignSystem.drawable.ic_fileformat_ibutton | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
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
5 changes: 1 addition & 4 deletions
5
.../bridge/dao/api/model/FlipperKeyCrypto.kt → .../bridge/dao/api/model/FlipperKeyCrypto.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 |
---|---|---|
@@ -1,13 +1,10 @@ | ||
package com.flipperdevices.bridge.dao.api.model | ||
|
||
import android.os.Parcelable | ||
import kotlinx.parcelize.Parcelize | ||
import kotlinx.serialization.Serializable | ||
|
||
@Parcelize | ||
@Serializable | ||
data class FlipperKeyCrypto( | ||
val fileId: String, | ||
val pathToKey: String, | ||
val cryptoKey: String | ||
) : Parcelable | ||
) |
Oops, something went wrong.