-
Notifications
You must be signed in to change notification settings - Fork 196
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
**Background** New FileManager sample with some implemented features **Changes** - Add new FileManager listing - Add new FileManager uploading - Add new FileManager file/folder creation **Test plan** - Open BridgeConnectionSample - Open FileManager
- Loading branch information
1 parent
abce7be
commit 18a214e
Showing
98 changed files
with
5,542 additions
and
13 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
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
90 changes: 90 additions & 0 deletions
90
...l/src/main/java/com/flipperdevices/archive/impl/composable/filemanager/FileManagerCard.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,90 @@ | ||
package com.flipperdevices.archive.impl.composable.filemanager | ||
|
||
import androidx.compose.foundation.layout.Arrangement | ||
import androidx.compose.foundation.layout.Column | ||
import androidx.compose.foundation.layout.Row | ||
import androidx.compose.foundation.layout.fillMaxWidth | ||
import androidx.compose.foundation.layout.padding | ||
import androidx.compose.foundation.shape.RoundedCornerShape | ||
import androidx.compose.material.Card | ||
import androidx.compose.material.Icon | ||
import androidx.compose.material.MaterialTheme | ||
import androidx.compose.material.Text | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.ui.Alignment | ||
import androidx.compose.ui.Modifier | ||
import androidx.compose.ui.draw.clip | ||
import androidx.compose.ui.graphics.Color | ||
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.archive.impl.R | ||
import com.flipperdevices.core.ui.ktx.clickableRipple | ||
import com.flipperdevices.core.ui.theme.FlipperThemeInternal | ||
import com.flipperdevices.core.ui.theme.LocalPallet | ||
import com.flipperdevices.core.ui.theme.LocalPalletV2 | ||
import com.flipperdevices.core.ui.theme.LocalTypography | ||
import com.flipperdevices.core.ui.res.R as DesignSystem | ||
|
||
@Composable | ||
fun FileManagerCard( | ||
onClick: () -> Unit, | ||
modifier: Modifier = Modifier | ||
) { | ||
Card(modifier = modifier) { | ||
Column( | ||
modifier = Modifier | ||
.clip(RoundedCornerShape(12.dp)) | ||
.clickableRipple(onClick = onClick) | ||
.padding(12.dp), | ||
verticalArrangement = Arrangement.spacedBy(12.dp), | ||
) { | ||
Row( | ||
horizontalArrangement = Arrangement.SpaceBetween, | ||
modifier = Modifier.fillMaxWidth() | ||
) { | ||
Row( | ||
horizontalArrangement = Arrangement.spacedBy(15.dp), | ||
verticalAlignment = Alignment.CenterVertically | ||
) { | ||
Icon( | ||
painter = painterResource( | ||
if (MaterialTheme.colors.isLight) { | ||
R.drawable.ic_file_dark | ||
} else { | ||
R.drawable.ic_file_light | ||
} | ||
), | ||
contentDescription = null, | ||
tint = Color.Unspecified | ||
) | ||
Text( | ||
text = stringResource(R.string.archive_card_file_manager_title), | ||
style = LocalTypography.current.buttonB16, | ||
color = LocalPalletV2.current.text.title.primary | ||
) | ||
} | ||
|
||
Icon( | ||
painter = painterResource(DesignSystem.drawable.ic_forward), | ||
contentDescription = null, | ||
tint = LocalPallet.current.iconTint30 | ||
) | ||
} | ||
Text( | ||
text = stringResource(R.string.archive_card_file_manager_desc), | ||
style = LocalTypography.current.bodyR14, | ||
color = LocalPalletV2.current.text.caption.secondary | ||
) | ||
} | ||
} | ||
} | ||
|
||
@Preview | ||
@Composable | ||
private fun FileManagerCardPreview() { | ||
FlipperThemeInternal { | ||
FileManagerCard(onClick = {}) | ||
} | ||
} |
41 changes: 41 additions & 0 deletions
41
components/archive/impl/src/main/res/drawable/ic_file_dark.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,41 @@ | ||
<vector xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:width="30dp" | ||
android:height="30dp" | ||
android:viewportWidth="30" | ||
android:viewportHeight="30"> | ||
<group> | ||
<clip-path | ||
android:pathData="M4,1h23v28h-23z"/> | ||
<group> | ||
<clip-path | ||
android:pathData="M27,29H4V1H19V3H6V27H25V9H27V29Z"/> | ||
<path | ||
android:pathData="M4,29H2V31H4V29ZM27,29V31H29V29H27ZM27,9H29V7H27V9ZM19,1H21V-1H19V1ZM4,1V-1H2V1H4ZM19,3V5H21V3H19ZM6,3V1H4V3H6ZM6,27H4V29H6V27ZM25,27V29H27V27H25ZM25,9V7H23V9H25ZM4,31H27V27H4V31ZM29,29V9H25V29H29ZM19,-1H4V3H19V-1ZM2,1V29H6V1H2ZM17,1V3H21V1H17ZM19,1H6V5H19V1ZM4,3V27H8V3H4ZM6,29H25V25H6V29ZM27,27V9H23V27H27ZM25,11H27V7H25V11Z" | ||
android:fillColor="#000000"/> | ||
</group> | ||
<path | ||
android:pathData="M19,3h2v2h-2z" | ||
android:fillColor="#000000"/> | ||
<path | ||
android:pathData="M17,3h4v8h-4z" | ||
android:fillColor="#000000"/> | ||
<path | ||
android:pathData="M21,5h2v2h-2z" | ||
android:fillColor="#000000"/> | ||
<path | ||
android:pathData="M23,7h2v2h-2z" | ||
android:fillColor="#000000"/> | ||
<path | ||
android:pathData="M17,7h8v4h-8z" | ||
android:fillColor="#000000"/> | ||
<path | ||
android:pathData="M10,14h11v2h-11z" | ||
android:fillColor="#000000"/> | ||
<path | ||
android:pathData="M10,18h11v2h-11z" | ||
android:fillColor="#000000"/> | ||
<path | ||
android:pathData="M10,22h11v2h-11z" | ||
android:fillColor="#000000"/> | ||
</group> | ||
</vector> |
41 changes: 41 additions & 0 deletions
41
components/archive/impl/src/main/res/drawable/ic_file_light.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,41 @@ | ||
<vector xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:width="30dp" | ||
android:height="30dp" | ||
android:viewportWidth="30" | ||
android:viewportHeight="30"> | ||
<group> | ||
<clip-path | ||
android:pathData="M4,1h23v28h-23z"/> | ||
<group> | ||
<clip-path | ||
android:pathData="M27,29H4V1H19V3H6V27H25V9H27V29Z"/> | ||
<path | ||
android:pathData="M4,29H2V31H4V29ZM27,29V31H29V29H27ZM27,9H29V7H27V9ZM19,1H21V-1H19V1ZM4,1V-1H2V1H4ZM19,3V5H21V3H19ZM6,3V1H4V3H6ZM6,27H4V29H6V27ZM25,27V29H27V27H25ZM25,9V7H23V9H25ZM4,31H27V27H4V31ZM29,29V9H25V29H29ZM19,-1H4V3H19V-1ZM2,1V29H6V1H2ZM17,1V3H21V1H17ZM19,1H6V5H19V1ZM4,3V27H8V3H4ZM6,29H25V25H6V29ZM27,27V9H23V27H27ZM25,11H27V7H25V11Z" | ||
android:fillColor="#FFFFFF"/> | ||
</group> | ||
<path | ||
android:pathData="M19,3h2v2h-2z" | ||
android:fillColor="#FFFFFF"/> | ||
<path | ||
android:pathData="M17,3h4v8h-4z" | ||
android:fillColor="#FFFFFF"/> | ||
<path | ||
android:pathData="M21,5h2v2h-2z" | ||
android:fillColor="#FFFFFF"/> | ||
<path | ||
android:pathData="M23,7h2v2h-2z" | ||
android:fillColor="#FFFFFF"/> | ||
<path | ||
android:pathData="M17,7h8v4h-8z" | ||
android:fillColor="#FFFFFF"/> | ||
<path | ||
android:pathData="M10,14h11v2h-11z" | ||
android:fillColor="#FFFFFF"/> | ||
<path | ||
android:pathData="M10,18h11v2h-11z" | ||
android:fillColor="#FFFFFF"/> | ||
<path | ||
android:pathData="M10,22h11v2h-11z" | ||
android:fillColor="#FFFFFF"/> | ||
</group> | ||
</vector> |
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
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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
plugins { | ||
id("flipper.multiplatform") | ||
id("flipper.multiplatform-dependencies") | ||
} | ||
|
||
android.namespace = "com.flipperdevices.filemanager.listing.api" | ||
|
||
commonDependencies { | ||
implementation(projects.components.core.ui.decompose) | ||
|
||
implementation(libs.compose.ui) | ||
implementation(libs.decompose) | ||
|
||
implementation(libs.okio) | ||
} |
20 changes: 20 additions & 0 deletions
20
.../androidMain/kotlin/com/flipperdevices/filemanager/listing/api/FilesDecomposeComponent.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,20 @@ | ||
package com.flipperdevices.filemanager.listing.api | ||
|
||
import com.arkivanov.decompose.ComponentContext | ||
import com.flipperdevices.ui.decompose.DecomposeOnBackParameter | ||
import com.flipperdevices.ui.decompose.ScreenDecomposeComponent | ||
import okio.Path | ||
|
||
abstract class FilesDecomposeComponent( | ||
componentContext: ComponentContext | ||
) : ScreenDecomposeComponent(componentContext) { | ||
fun interface Factory { | ||
operator fun invoke( | ||
componentContext: ComponentContext, | ||
onBack: DecomposeOnBackParameter, | ||
path: Path, | ||
onPathChanged: (Path) -> Unit, | ||
onUploadClick: () -> Unit | ||
): FilesDecomposeComponent | ||
} | ||
} |
Oops, something went wrong.