generated from amosproj/amos202Xss0Y-projname
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #216 from amosproj/add_description_to_features
[UI] fix scrolling on configuration screen, feature descriptions on configuration screen, add autoscroll + toggle to visualization
- Loading branch information
Showing
32 changed files
with
454 additions
and
210 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
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
40 changes: 0 additions & 40 deletions
40
...app/src/main/java/de/amosproj3/ziofa/ui/configuration/composables/EbpfIOFeatureOptions.kt
This file was deleted.
Oops, something went wrong.
70 changes: 70 additions & 0 deletions
70
...rc/main/java/de/amosproj3/ziofa/ui/configuration/composables/PresetFeatureOptionsGroup.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,70 @@ | ||
// SPDX-FileCopyrightText: 2024 Felix Hilgers <[email protected]> | ||
// SPDX-FileCopyrightText: 2024 Luca Bretting <[email protected]> | ||
// | ||
// SPDX-License-Identifier: MIT | ||
|
||
package de.amosproj3.ziofa.ui.configuration.composables | ||
|
||
import androidx.compose.foundation.Image | ||
import androidx.compose.foundation.layout.Arrangement | ||
import androidx.compose.foundation.layout.Column | ||
import androidx.compose.foundation.layout.Row | ||
import androidx.compose.foundation.layout.Spacer | ||
import androidx.compose.foundation.layout.fillMaxWidth | ||
import androidx.compose.foundation.layout.height | ||
import androidx.compose.foundation.layout.padding | ||
import androidx.compose.material.icons.Icons | ||
import androidx.compose.material.icons.automirrored.filled.ArrowForward | ||
import androidx.compose.material3.Checkbox | ||
import androidx.compose.material3.Text | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.ui.Alignment | ||
import androidx.compose.ui.Modifier | ||
import androidx.compose.ui.text.font.FontStyle | ||
import androidx.compose.ui.text.font.FontWeight | ||
import androidx.compose.ui.unit.dp | ||
import de.amosproj3.ziofa.ui.configuration.data.BackendFeatureOptions | ||
import de.amosproj3.ziofa.ui.configuration.data.FeatureType | ||
import kotlinx.collections.immutable.ImmutableList | ||
|
||
/** | ||
* Displays a group of options along with a title. All [options] must be of the specified [type] and | ||
* only those will be shown. | ||
*/ | ||
@Composable | ||
fun PresetFeatureOptionsGroup( | ||
options: ImmutableList<BackendFeatureOptions>, | ||
type: FeatureType, | ||
onOptionChanged: (BackendFeatureOptions, Boolean) -> Unit, | ||
modifier: Modifier = Modifier, | ||
) { | ||
Column(modifier = modifier.padding(horizontal = 20.dp, vertical = 15.dp).fillMaxWidth()) { | ||
SectionTitleRow(type.displayName) | ||
Spacer(Modifier.height(15.dp)) | ||
options | ||
.filter { it.type == type } | ||
.forEach { option -> | ||
Row( | ||
modifier = Modifier.fillMaxWidth().padding(bottom = 15.dp), | ||
horizontalArrangement = Arrangement.SpaceBetween, | ||
verticalAlignment = Alignment.CenterVertically, | ||
) { | ||
Row(verticalAlignment = Alignment.CenterVertically) { | ||
Image( | ||
imageVector = Icons.AutoMirrored.Filled.ArrowForward, | ||
contentDescription = "", | ||
modifier = Modifier.padding(end = 10.dp), | ||
) | ||
Column { | ||
Text(option.name, fontWeight = FontWeight.Bold) | ||
Text(option.description, fontStyle = FontStyle.Italic) | ||
} | ||
} | ||
Checkbox( | ||
checked = option.active, | ||
onCheckedChange = { onOptionChanged(option, it) }, | ||
) | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.