-
Notifications
You must be signed in to change notification settings - Fork 183
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move more filemngr modules to mpp (#976)
**Background** Some modules of new file manager can be moved to multiplatform, so here's this transition **Changes** - Move all filemngr modules to MPP (except upload - it depends on deeplinks) - Move coil to MPP with coil3 & ktor3 for server-image loading **Test plan** - See CI is ok - Open flipper app and see images loading - Open new file manager see it's working --------- Co-authored-by: Nikita Kulikov <[email protected]>
- Loading branch information
1 parent
1e2564a
commit 18a6549
Showing
137 changed files
with
1,090 additions
and
572 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
4 changes: 3 additions & 1 deletion
4
...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
18 changes: 18 additions & 0 deletions
18
...api/src/commonMain/kotlin/com/flipperdevices/bridge/dao/api/model/FlipperKeyTypeMppKtx.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,18 @@ | ||
package com.flipperdevices.bridge.dao.api.model | ||
|
||
import flipperapp.components.core.ui.res.generated.resources.ic_fileformat_ibutton | ||
import flipperapp.components.core.ui.res.generated.resources.ic_fileformat_ir | ||
import flipperapp.components.core.ui.res.generated.resources.ic_fileformat_nfc | ||
import flipperapp.components.core.ui.res.generated.resources.ic_fileformat_rf | ||
import flipperapp.components.core.ui.res.generated.resources.ic_fileformat_sub | ||
import org.jetbrains.compose.resources.DrawableResource | ||
import flipperapp.components.core.ui.res.generated.resources.Res as DesignSystem | ||
|
||
val FlipperKeyType.iconResource: DrawableResource | ||
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 | ||
} |
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
97 changes: 97 additions & 0 deletions
97
.../core/ui/ktx/src/androidMain/kotlin/com/flipperdevices/core/ui/ktx/AndroidOrangeAppBar.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,97 @@ | ||
package com.flipperdevices.core.ui.ktx | ||
|
||
import androidx.annotation.DrawableRes | ||
import androidx.annotation.StringRes | ||
import androidx.compose.foundation.layout.padding | ||
import androidx.compose.foundation.layout.size | ||
import androidx.compose.material.Icon | ||
import androidx.compose.material.icons.Icons | ||
import androidx.compose.material.icons.filled.Settings | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.ui.Modifier | ||
import androidx.compose.ui.graphics.vector.rememberVectorPainter | ||
import androidx.compose.ui.res.painterResource | ||
import androidx.compose.ui.res.stringResource | ||
import androidx.compose.ui.tooling.preview.Preview | ||
import androidx.compose.ui.unit.dp | ||
import com.flipperdevices.core.ui.theme.FlipperThemeInternal | ||
import com.flipperdevices.core.ui.theme.LocalPalletV2 | ||
|
||
@Composable | ||
fun OrangeAppBar( | ||
@StringRes titleId: Int, | ||
modifier: Modifier = Modifier, | ||
onBack: (() -> Unit)? = null, | ||
endBlock: (@Composable (Modifier) -> Unit)? = null | ||
) { | ||
OrangeAppBar( | ||
modifier = modifier, | ||
title = stringResource(titleId), | ||
onBack = onBack, | ||
endBlock = endBlock | ||
) | ||
} | ||
|
||
@Composable | ||
fun OrangeAppBarWithIcon( | ||
@StringRes titleId: Int, | ||
@DrawableRes endIconId: Int, | ||
onBack: (() -> Unit)? = null, | ||
onEndClick: () -> Unit | ||
) { | ||
OrangeAppBarWithIcon( | ||
title = stringResource(titleId), | ||
onBack = onBack, | ||
endIconId = endIconId, | ||
onEndClick = onEndClick | ||
) | ||
} | ||
|
||
@Composable | ||
fun OrangeAppBarWithIcon( | ||
title: String, | ||
@DrawableRes endIconId: Int, | ||
modifier: Modifier = Modifier, | ||
onBack: (() -> Unit)? = null, | ||
onEndClick: () -> Unit | ||
) { | ||
OrangeAppBarWithIcon( | ||
title = title, | ||
endIconPainter = painterResource(endIconId), | ||
modifier = modifier, | ||
onBack = onBack, | ||
onEndClick = onEndClick | ||
) | ||
} | ||
|
||
@Preview | ||
@Composable | ||
private fun OrangeAppBarPreview() { | ||
FlipperThemeInternal { | ||
OrangeAppBar( | ||
title = "Screenname", | ||
onBack = {} | ||
) | ||
} | ||
} | ||
|
||
@Preview | ||
@Composable | ||
private fun OrangeAppBarEndBlockPreview() { | ||
FlipperThemeInternal { | ||
OrangeAppBar( | ||
title = "Screenname", | ||
onBack = {}, | ||
endBlock = { | ||
Icon( | ||
modifier = Modifier | ||
.padding(end = 14.dp) | ||
.size(24.dp), | ||
painter = rememberVectorPainter(Icons.Filled.Settings), | ||
contentDescription = null, | ||
tint = LocalPalletV2.current.icon.blackAndWhite.default | ||
) | ||
} | ||
) | ||
} | ||
} |
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
10 changes: 10 additions & 0 deletions
10
components/core/ui/res/src/commonMain/composeResources/drawable/ic_back.xml
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,10 @@ | ||
<vector xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:width="24dp" | ||
android:height="24dp" | ||
android:viewportWidth="24" | ||
android:viewportHeight="24"> | ||
<path | ||
android:pathData="M16.2142,3.2169C15.722,2.7055 14.9239,2.7055 14.4317,3.2169L6.8692,11.074C6.377,11.5854 6.377,12.4146 6.8692,12.926L14.4317,20.7831C14.9239,21.2945 15.722,21.2945 16.2142,20.7831C16.7064,20.2717 16.7064,19.4426 16.2142,18.9311L9.543,12L16.2142,5.0688C16.7064,4.5574 16.7064,3.7283 16.2142,3.2169Z" | ||
android:fillColor="#000000" | ||
android:fillType="evenOdd"/> | ||
</vector> |
Oops, something went wrong.