-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature [Event Creation/Edition] Add possibility to add types to events #318
Merged
Merged
Changes from all commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
1674c96
Merge branch 'main' of github.com:SwEnt-Group13/Unio
AlouchLaBouche 0739098
Merge branch 'fix/navigation-welcome'
AlouchLaBouche af13f83
Merge branch 'main' of github.com:SwEnt-Group13/Unio
AlouchLaBouche b7ca7cd
Merge branch 'main' of github.com:SwEnt-Group13/Unio
AlouchLaBouche 58e19d5
Merge branch 'main' of github.com:SwEnt-Group13/Unio
AlouchLaBouche 75795da
Merge branch 'main' of github.com:SwEnt-Group13/Unio
AlouchLaBouche 304fec1
feat(Events): Add new event types
AlouchLaBouche ac14557
feat(Users): Add new user interests to match event types
AlouchLaBouche 7750877
feat(Event): Add new translations for new event types
AlouchLaBouche 2900916
feat(Event): Add new colors for new event types
AlouchLaBouche b25bcc0
feat(Event): Add Other event type as a default
AlouchLaBouche 6dc8567
feat(EventType): Add EventTypeOverlay skeleton
AlouchLaBouche 6965fd7
Merge branch 'feature/event_types' of github.com:SwEnt-Group13/Unio i…
AlouchLaBouche e735a1d
chore(EventTypeOverlay): Add necessary test tags
AlouchLaBouche df1a23f
feat(EventCreation): Add functional types selector overlay
AlouchLaBouche 499acbf
refactor(EventEditComposable): Make association Chip generic
AlouchLaBouche 0844fe1
refactor(EventCreation/Edition): Use the new generic chip composable
AlouchLaBouche 3424e52
chore(TestTage/Strings): Add corresponding test tags and strings
AlouchLaBouche 646db53
feat(EventTypeOverlay): Make sure that max event types is 3
AlouchLaBouche fe53358
style(All): ktfmt
AlouchLaBouche 23f73b2
test(EventCreation/Edition): Add corresponding tests
AlouchLaBouche 092df88
chore(EventEditComponents): Add necessary test tags
AlouchLaBouche c6da95e
style(All): ktfmt
AlouchLaBouche 0ef79da
Merge main into feature/event-types 18/12 19h18
AlouchLaBouche 9fb4296
fix(UnitTests): Add default list (empty) for types field
AlouchLaBouche 57605b7
fix(EventTypeOverlay): remove unnecessary print
AlouchLaBouche File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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 |
---|---|---|
|
@@ -58,11 +58,11 @@ import androidx.compose.ui.platform.testTag | |
import androidx.compose.ui.unit.dp | ||
import androidx.compose.ui.window.PopupProperties | ||
import com.android.unio.R | ||
import com.android.unio.model.association.Association | ||
import com.android.unio.model.map.Location | ||
import com.android.unio.model.map.nominatim.NominatimLocationSearchViewModel | ||
import com.android.unio.model.strings.FormatStrings.DAY_MONTH_YEAR_FORMAT | ||
import com.android.unio.model.strings.FormatStrings.HOUR_MINUTE_FORMAT | ||
import com.android.unio.model.strings.test_tags.event.EventDetailsTestTags | ||
import com.android.unio.ui.image.AsyncImageWrapper | ||
import com.android.unio.ui.utils.ToastUtils | ||
import com.google.firebase.Timestamp | ||
|
@@ -172,24 +172,26 @@ fun NominatimLocationPicker( | |
} | ||
|
||
/** | ||
* Composable for the association chips that show the selected associations. | ||
* Composable for the different chips used that must be displayed in a flowRow | ||
* | ||
* @param associations List<Pair<Association, MutableState<Boolean>>> : List of associations and | ||
* their selected state. | ||
* @param items a generic list of items that can have their elements selected or not | ||
*/ | ||
@OptIn(ExperimentalLayoutApi::class) | ||
@Composable | ||
fun AssociationChips( | ||
associations: List<Pair<Association, MutableState<Boolean>>>, | ||
fun <T> Chips( | ||
items: List<Pair<T, MutableState<Boolean>>>, | ||
getName: (T) -> String, | ||
) { | ||
Comment on lines
-182
to
184
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Very clever use of genericity, well done 🚀 |
||
val context = LocalContext.current | ||
|
||
FlowRow { | ||
associations.forEach { (association, selected) -> | ||
items.forEach { (item, selected) -> | ||
if (selected.value) { | ||
InputChip( | ||
label = { Text(association.name) }, | ||
label = { Text(getName(item)) }, | ||
onClick = {}, | ||
selected = selected.value, | ||
modifier = Modifier.testTag(EventDetailsTestTags.CHIPS + getName(item)), | ||
avatar = { | ||
Icon( | ||
Icons.Default.Close, | ||
|
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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work on extracting these strings, it's much appreciated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, for my own understanding, what do the comments indicate ? Is it the associated user interests ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I need to remove them, but yes it is the "potential matches" with the user interests that can be used with the custom recommendation system