-
Notifications
You must be signed in to change notification settings - Fork 169
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add switch to mark new posts as NSFW / toggle tag on existing posts (#…
…833) * Added a switch do CreatePost.kt and PostEdit.kt to mark a new post as NSFW and change the tag of an existing post. Added logic in the corresponding Activities. Closes #679 * Changed switch to checkbox, changed arrangement to "SpaceBetween", moved composable out of CreatePost.kt and PostEdit.kt to reduce unnecessary redundancy.
- Loading branch information
1 parent
e66e1c1
commit 5eae33d
Showing
7 changed files
with
62 additions
and
0 deletions.
There are no files selected for viewing
32 changes: 32 additions & 0 deletions
32
app/src/main/java/com/jerboa/ui/components/post/composables/PostComposables.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,32 @@ | ||
package com.jerboa.ui.components.post.composables | ||
|
||
import androidx.compose.foundation.layout.Arrangement | ||
import androidx.compose.foundation.layout.Row | ||
import androidx.compose.foundation.layout.fillMaxWidth | ||
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.res.stringResource | ||
import com.jerboa.R | ||
|
||
@Composable | ||
fun CheckboxIsNsfw( | ||
checked: Boolean, | ||
onCheckedChange: (checked: Boolean) -> Unit, | ||
) { | ||
Row( | ||
verticalAlignment = Alignment.CenterVertically, | ||
horizontalArrangement = Arrangement.SpaceBetween, | ||
modifier = Modifier.fillMaxWidth(), | ||
) { | ||
Text( | ||
text = stringResource(R.string.create_post_tag_nsfw), | ||
) | ||
Checkbox( | ||
checked = checked, | ||
onCheckedChange = onCheckedChange, | ||
) | ||
} | ||
} |
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